PageSourceSearch

https://www.vefogix.com/_next/static/chunks/56784-541033e8352bb25e.js

js vefogix.com collected 2026-10-01 11:47:43 UTC 101,044 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[56784,23595,70168,71575],{2646:function(e,t,a){a.r(t),a.d(t,{default:function(){return K}});var r=a(57437),s=a(2265),i=a(99376),o=a(27648),l=a(83464),n=a(75186),d=a(64131);a(98527);var c=a(99551),u=a(23595),m=a(23099),g=a(42056),h=a(71575),p=a(54207),f=a(23314),x=a(21396),v=a(99397),b=a(92451),y=a(10407),k=a(51817),w=a(46506),j=a(43720),_=a(15868),N=a(32489),C=a(5005),S=a(86595),E=a(53417),A=a(89345),P=a(91723),R=a(33327),I=a(11239),U=a(70525),B=a(71769),F=a(53113),L=a(88156),T=a(48736),M=a(48614),D=a(3462),W=a(7396),Z=a(31086),z=a(34221),q=a(37810),O=a(28112),V=a(99406);function G(e){if(!e)return null;if(e.startsWith("http"))return e;let t=c.BASE_URL.replace(/\/api\/?$/,"");return"".concat(t||"https://www.vefogix.com").concat(e)}function K(){var e,t,a,K,Y,$,H,J,Q,X,ee,et,ea,er,es,ei,eo,el,en,ed,ec,eu,em,eg,eh,ep,ef,ex,ev,eb,ey,ek,ew,ej,e_,eN,eC,eS,eE,eA,eP,eR,eI,eU;let{viewingUsername:eB,isViewingOtherProfile:eF=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},eL=(0,i.useRouter)(),eT=(0,i.useParams)(),eM=(0,i.usePathname)(),eD=(0,i.useSearchParams)(),{userdata:eW,fetchUsers:eZ,updateUserData:ez,loading:eq}=(0,u.U)(),{currentRole:eO}=(0,g.$)(),eV="/publisher-profile/"===eM,eG=eB||(null==eT?void 0:eT.username)||null,eK=eF||null!==eG&&eG!==(null==eW?void 0:eW.username),[eY,e$]=(0,s.useState)(null),[eH,eJ]=(0,s.useState)(!1),{profileData:eQ,publisherDashboardData:eX,marketplaceProfile:e0,portfolioItems:e1,portfolioLoading:e2,publisherListings:e4,publisherListingsLoading:e5,publisherReviews:e3,reviewsData:e6,publisherReviewsLoading:e9,loading:e8,publisherDashboardLoading:e7,publisherPerformanceData:te,publisherPerformanceLoading:tt,fetchPublisherDashboard:ta,fetchPublisherPerformance:tr,fetchPortfolio:ts,createPortfolio:ti,updatePortfolio:to,deletePortfolio:tl,fetchListings:tn,fetchReviews:td,submitSellerReviewResponseAction:tc,uploadProfilePic:tu,uploadCoverPic:tm,updateProfile:tg}=(0,m.X)(),th=eD.get("tab"),tp=["Services","About","Portfolio","Reviews","Performance"],tf=(0,s.useMemo)(()=>{if(!th)return"Performance";let e=th.charAt(0).toUpperCase()+th.slice(1).toLowerCase();return tp.includes(e)?e:"Performance"},[th]),[tx,tv]=(0,s.useState)(tf),[tb,ty]=(0,s.useState)(""),[tk,tw]=(0,s.useState)(1);(0,s.useEffect)(()=>{tv(tf)},[tf]);let[tj,t_]=(0,s.useState)(!1),[tN,tC]=(0,s.useState)(!1),[tS,tE]=(0,s.useState)(!1),[tA,tP]=(0,s.useState)(!1),[tR,tI]=(0,s.use
1State)(null),[tU,tB]=(0,s.useState)({}),[tF,tL]=(0,s.useState)(""),[tT,tM]=(0,s.useState)(""),[tD,tW]=(0,s.useState)(""),[tZ,tz]=(0,s.useState)(""),[tq,tO]=(0,s.useState)(!1),[tV,tG]=(0,s.useState)([]),[tK,tY]=(0,s.useState)(null),[t$,tH]=(0,s.useState)(!1),[tJ,tQ]=(0,s.useState)(!1),tX=(0,s.useRef)(null),{buyer_Tasks_Paginated:t0,buyerTasksPaginated:t1}=(0,h.G)(),[t2,t4]=(0,s.useState)(1),[t5,t3]=(0,s.useState)("");(0,s.useEffect)(()=>{t4(1),t3("")},[tx]),(0,s.useMemo)(()=>[],[]);let[t6,t9]=(0,s.useState)([]),t8=null==eW?void 0:eW.id,t7=(null==eW?void 0:eW.username)||(null==eW?void 0:eW.first_name)||"User",ae=(null==eW?void 0:eW.profile_picture)||void 0,at=eK?(null==eY?void 0:null===(e=eY.profile)||void 0===e?void 0:e.id)||eG:(null==e0?void 0:e0.id)||(null==eQ?void 0:null===(t=eQ.user)||void 0===t?void 0:t.id)||(null==eX?void 0:null===(a=eX.profile)||void 0===a?void 0:a.id),aa=eK?(null==eY?void 0:null===(K=eY.profile)||void 0===K?void 0:K.username)||(null==eY?void 0:null===(Y=eY.profile)||void 0===Y?void 0:Y.first_name)||eG:(null==e0?void 0:e0.username)||(null==eQ?void 0:null===($=eQ.user)||void 0===$?void 0:$.username)||(null==eX?void 0:null===(H=eX.profile)||void 0===H?void 0:H.username)||(null==eW?void 0:eW.username),ar=eK?G(null==eY?void 0:null===(J=eY.profile)||void 0===J?void 0:J.profile_picture)||void 0:G((null==e0?void 0:e0.profile_picture)||(null==eQ?void 0:null===(Q=eQ.user)||void 0===Q?void 0:Q.profile_picture)||(null==eX?void 0:null===(X=eX.profile)||void 0===X?void 0:X.profile_picture))||void 0,as=async()=>{if(!d.default.get("login_access_token")){let e=eM||window.location.pathname,t="".concat(e).concat(window.location.search);eL.push("/signin?redirect=".concat(encodeURIComponent(t))),n.default.error("Please login to start a chat");return}if(!eK){n.default.error("You cannot chat with yourself");return}if(!at||!aa){n.default.error("Unable to start chat. Publisher information is unavailable.");return}if(t6.some(e=>e.publisherId===String(at))){(0,n.default)("Chat is already open",{icon:"\uD83D\uDCAC",style:{background:"#3B82F6",color:"#fff"}});return}let e=ah.map(e=>({id:e.id,title:e.title||"Service",slug:e.slug||"",price:"number"==typeof e.price?e.price:Number(e.price),currency:e.currency||"USD"})),t={publisherId:String(at),publisherName:aa,publisherAvatar:ar,requireServiceSelection:!0,profileServices:e,publisherListingsUsername:eG||void 0};t9(e=>[...e,t])};(0,s.useEffect)(()=>{tS&&eK&&eG&&(async()=>{var e,t,a,r;eJ(!0);try{let t=await l.default.get("".concat(c.BASE_URL,"marketplace/profile/publisherdashboard/"),{params:{username:eG},headers:{"Content-Type":"application/json"}});if(null===(e=t.data)||void 0===e?void 0:e.profile){let e=t.data.profile.profile_image||t.data.profile.profile_picture,a=t.data.profile.cover_image||t.data.profile.cover_picture||t.data.profile.cover_photo;t.data.profile={...t.data.profile,profile_image:G(e),cover_image:G(a)}}e$(t.data)}catch(e){(null===(t=e.response)||void 0===t?void 0:t.status)===404?eL.replace("/not-found"):n.default.error((null===(r=e.response)||void 0===r?void 0:null===(a=r.data)||void 0===a?void 0:a.message)||"Failed to load profile")}finally{eJ(!1)}})()},[tS,eK,eG]),(0,s.useEffect)(()=>{tS&&!eK&&"buyer"===eO&&eL.replace("/profile")},[tS,eL,eO,eK]),(0,s.useEffect)(()=>{if(tS&&!eK){if(!d.default.get("login_access_token")){eL.push("/signin");return}ta()}},[tS,eL,ta,eK]),(0,s.useEffect)(()=>{if(!tS||eK||!d.default.get("login_access_token"))return;let e=setTimeout(()=>{var e,t;let a=(null==eW?void 0:eW.username)||(null==eQ?void 0:null===(e=eQ.user)||void 0===e?void 0:e.username)||(null==e0?void 0:e0.username)||(null==eX?void 0:null===(t=eX.profile)||void 0===t?void 0:t.username);ts({portfolio_type:"publisher"}).catch(()=>{}),a?tn({username:a,status:"all"}).catch(()=>{}):tn({status:"all"}).catch(()=>{}),"Reviews"!==tx&&td({sort:"newest"}).catch(()=>{})},500);return()=>clearTimeout(e)},[tS,eK,ts,tn,td,tx]),(0,s.useEffect)(()=>{tS&&eK&&eG&&(ts({username:eG}).catch(()=>{}),tn({username:eG,status:"all"}).catch(()=>{}),"Reviews"!==tx&&td({username:eG,sort:"newest"}).catch(()=>{}))},[tS,eK,eG,ts,tn,td,tx]),(0,s.useEffect)(()=>
1{if(!tS||"Reviews"!==tx)return;let e={sort:"newest",page:tk,page_size:12};eK&&eG&&(e.username=eG),tb&&(e.rating=tb),td(e).catch(()=>{})},[tS,tx,tk,tb,eK,eG,td]),(0,s.useEffect)(()=>{if(tS&&"Performance"===tx){if(eK&&eG)tr(eG);else if(!eK){var e;let t=(null==eX?void 0:null===(e=eX.profile)||void 0===e?void 0:e.username)||(null==e0?void 0:e0.username)||(null==eW?void 0:eW.username);if(t)tr(t);else{let e=setTimeout(()=>{tr(void 0)},500);return()=>clearTimeout(e)}}}},[tS,tx,eK,eG,null==eX?void 0:null===(ee=eX.profile)||void 0===ee?void 0:ee.username,null==e0?void 0:e0.username,null==eW?void 0:eW.username,tr]);let ai=eK?eY:eX,ao=(null==ai?void 0:ai.stats)?{last_90_days_gig:ai.stats.last_90_days_gig||{},last_90_days:ai.stats.last_90_days||{},allTime:ai.stats.all_time||{},social:ai.stats.social||{}}:{last_90_days_gig:{},allTime:{},social:{}},al=(null==ai?void 0:ai.about)?{bio:ai.about.bio||"",intro_video:ai.about.intro_video||"",languages:ai.about.languages||[]}:(null==eQ?void 0:eQ.about)?{bio:"string"==typeof eQ.about?eQ.about:(null===(et=eQ.about)||void 0===et?void 0:et.bio)||"",intro_video:(null===(ea=eQ.about)||void 0===ea?void 0:ea.intro_video)||"",languages:(eQ.language||[]).map(e=>({language:e.title||e.language||e,proficiency:null}))}:{bio:"",languages:[],intro_video:""},an=null!==(eE=null!==(eS=null!==(eC=null!==(eN=null!==(e_=null==ai?void 0:null===(er=ai.profile)||void 0===er?void 0:er.is_about)&&void 0!==e_?e_:null==e0?void 0:e0.is_about)&&void 0!==eN?eN:null==eQ?void 0:null===(es=eQ.user)||void 0===es?void 0:es.is_about)&&void 0!==eC?eC:null==eW?void 0:eW.is_about)&&void 0!==eS?eS:null==eW?void 0:null===(ei=eW.profile)||void 0===ei?void 0:ei.is_about)&&void 0!==eE&&eE,ad=(null==ai?void 0:ai.profile)?{...ai.profile,is_about:an,profile_image:(null===(eo=ai.profile.profile_image)||void 0===eo?void 0:eo.startsWith("http"))?ai.profile.profile_image:G(ai.profile.profile_image)||G(ai.profile.profile_picture)||null,cover_image:(null===(el=ai.profile.cover_image)||void 0===el?void 0:el.startsWith("http"))?ai.profile.cover_image:G(ai.profile.cover_image)||G(ai.profile.cover_picture)||G(ai.profile.cover_photo)||null,social_links:ai.profile.social_links||null,join_date:(null===(ed=ai.stats)||void 0===ed?void 0:null===(en=ed.all_time)||void 0===en?void 0:en.member_since)||ai.profile.join_date||null}:e0?{...e0,is_about:an,social_links:e0.social_links||null,join_date:e0.join_date||null}:(null==eQ?void 0:eQ.user)?{...eQ.user,is_about:an,social_links:eQ.user.social_profiles?{facebook:eQ.user.social_profiles.facebook||null,linkedin:eQ.user.social_profiles.linkedin||null,instagram:eQ.user.social_profiles.instagram||null,x_account:eQ.user.social_profiles.x||null,whatsapp:eQ.user.social_profiles.whatsapp||null,telegram:eQ.user.social_profiles.telegram||null}:null}:eW?{...eW,is_about:an}:null,ac=(null==ai?void 0:null===(eu=ai.stats)||void 0===eu?void 0:null===(ec=eu.all_time)||void 0===ec?void 0:ec.average_rating)!==void 0&&null!==ai.stats.all_time.average_rating?ai.stats.all_time.average_rating.toFixed(1):(null==eQ?void 0:eQ.average_rating)!==void 0&&null!==eQ.average_rating?eQ.average_rating.toFixed(1):"0",au=(null==e6?void 0:e6.total_count)!==void 0?e6.total_count:(null==ai?void 0:null===(eg=ai.stats)||void 0===eg?void 0:null===(em=eg.all_time)||void 0===em?void 0:em.review_count)!==void 0?ai.stats.all_time.review_count:(null==ai?void 0:null===(ep=ai.stats)||void 0===ep?void 0:null===(eh=ep.all_time)||void 0===eh?void 0:eh.custom_orders_reviews)!==void 0?ai.stats.all_time.custom_orders_reviews:(null==eQ?void 0:eQ.review_count)!==void 0&&null!==eQ.review_count?eQ.review_count:0,am=(0,s.useMemo)(()=>(e1||[]).filter(e=>("publisher"===e.portfolio_type||!e.portfolio_type)&&(!eK||!0===e.is_public)),[e1,eK]),ag=e3&&Array.isArray(e3)&&e3.length>0?e3.map(e=>{var t,a;let r=e.buyer_info||e.buyer||e.buyer_profile||e.user||e.reviewer||{},s=e.gig_info;return{id:e.id,reviewer:{id:null!==(t=r.id)&&void 0!==t?t:0,username:null!==(a=r.username)&&void 0!==a?a:"Buyer",profile_picture:"",country:""},rating:e.rating,comment:e.comment,order_id:0,service_title:(null==s?void 0:s.title)||"",created_at:e.created_at,helpful_count:0,response:e.gigseller_response&&e.gigseller_response.trim()?{c
1omment:e.gigseller_response,created_at:e.gigseller_response_at||e.created_at}:void 0}}):[];e4.length;let ah=e4.length>0?e4:[],ap=(0,s.useMemo)(()=>{let e=(t2-1)*6;return ah.slice(e,e+6)},[ah,t2]),af=Math.ceil(ah.length/6);(0,s.useEffect)(()=>{tS&&!eK&&(d.default.get("login_access_token")||e8||eq||e7||eL.push("/signin"))},[tS,eW,eL,e8,eq,e7,eK]),(0,s.useEffect)(()=>{if(!eK&&tS){if(th){let e=th.charAt(0).toUpperCase()+th.slice(1).toLowerCase();if(tp.includes(e)){tv(e);return}}tv("publisher"===eO?"Performance":"Orders")}},[eO,eK,tS,th]);let ax=async e=>{var t,a,r,s,i;try{let s=d.default.get("login_access_token");if(!s){n.default.error("You need to log in first.");return}let i=await l.default.put("".concat(c.BASE_URL,"marketplace/profile/edit/"),e,{headers:{Authorization:"Bearer ".concat(s),"Content-Type":"multipart/form-data"}});(null===(t=i.data)||void 0===t?void 0:t.profile)&&tg(i.data.profile),null===(a=i.data)||void 0===a||a.about,await ta(),n.default.success((null===(r=i.data)||void 0===r?void 0:r.message)||"Profile updated successfully!")}catch(e){n.default.error((null===(i=e.response)||void 0===i?void 0:null===(s=i.data)||void 0===s?void 0:s.message)||"Failed to update profile. Please try again.")}},av=async e=>{var t,a,r,s;try{tC(!0);let r=d.default.get("login_access_token");if(!r){n.default.error("You need to log in first.");return}let s=new FormData;s.append("profile_image",e);let i=await l.default.put("".concat(c.BASE_URL,"marketplace/profile/edit/"),s,{headers:{Authorization:"Bearer ".concat(r),"Content-Type":"multipart/form-data"}});(null===(t=i.data)||void 0===t?void 0:t.profile)&&tg(i.data.profile),await ta(),n.default.success((null===(a=i.data)||void 0===a?void 0:a.message)||"Profile picture updated successfully!")}catch(e){n.default.error((null===(s=e.response)||void 0===s?void 0:null===(r=s.data)||void 0===r?void 0:r.message)||"Failed to upload profile picture. Please try again.")}finally{tC(!1)}},ab=async e=>{var t,a,r,s;try{tC(!0);let r=d.default.get("login_access_token");if(!r){n.default.error("You need to log in first.");return}let s=new FormData;s.append("cover_image",e);let i=await l.default.put("".concat(c.BASE_URL,"marketplace/profile/edit/"),s,{headers:{Authorization:"Bearer ".concat(r),"Content-Type":"multipart/form-data"}});(null===(t=i.data)||void 0===t?void 0:t.profile)&&tg(i.data.profile),await ta(),n.default.success((null===(a=i.data)||void 0===a?void 0:a.message)||"Cover image updated successfully!")}catch(e){n.default.error((null===(s=e.response)||void 0===s?void 0:null===(r=s.data)||void 0===r?void 0:r.message)||"Failed to upload cover image. Please try again.")}finally{tC(!1)}},ay=e=>{let t=[],a=["image/jpeg","image/png","image/webp","video/webm","video/mp4","video/quicktime"];e.forEach(e=>{if(!a.includes(e.type)){n.default.error("".concat(e.name,": Invalid file type. Accepted: JPG, PNG, WEBM, MP4, MOV"));return}let r=e.type.startsWith("image/");if(e.size>(r?20971520:262144e3)){n.default.error("".concat(e.name,": File too large. Max size: ").concat(r?"20MB":"250MB"));return}t.push(e)}),t.length>0&&tG([...tV,...t]),tX.current&&(tX.current.value="")},ak=async()=>{if(!tF.trim()){n.default.error("Please enter a project name");return}tH(!0);try{var e,t;let a=(null==eW?void 0:eW.id)||(null==eW?void 0:eW.uid)||(null==e0?void 0:e0.id)||(null==eQ?void 0:null===(e=eQ.user)||void 0===e?void 0:e.id)||(null==eX?void 0:null===(t=eX.profile)||void 0===t?void 0:t.id);if(!a){n.default.error("User information not available. Please refresh the page."),tH(!1);return}tR?(await to({id:tR.id,title:tF,description:tT,category:tD||void 0,project_url:tZ||void 0,image:tV.length>0?tV[0]:null===tK?null:void 0,user:a}),n.default.success("Project updated successfully!")):(await ti({portfolio_type:"publisher",title:tF,description:tT,category:tD||void 0,project_url:tZ||void 0,image:tV.length>0?tV[0]:void 0,user:a}),n.default.success("Project created successfully!")),tP(!1),tI(null),tL(""),tM(""),tW(""),tz(""),tG([]),tY(null)}catch(e){n.default.error((null==e?void 0:e.message)||"Failed to save project. Please try again.")}finally{tH(!1)}},aw=e=>{var t;tI(e),tL(e.title||""),tM(e.description||""),tW(e.category||""),tz(e.project_url||""),tO(null!==(t=e.is_pinned)&&void 0!==t&&t),tY(G(e.image)),tG([]),tP(!0)},aj=async e=>{if(confirm("Are you sure you want to delete this project?"))try{await tl(e),n.default.success("Project deleted successfully!")}catch(e){n.default.error((null==e?void 0:e.message)||"Failed to delete project. Please try again.")}},a_=async e=>{try{await to({id:e.id,is_pinned:!e.is_pinned}),n.default.success(e.is_pinned?"Portfolio item unpinned":"Portfolio item pinned"),ts({portfolio_type:"publisher"})}catch(e){console.error("Error toggling pin:",e),n.default.error((null==e?void 0:e.message)||"Failed to update pin status")}};(0,s.useEffect)(()=>{tE(!0)},[]);let aN=eK?eH:e8||e7||eq&&!eK;return!tS||aN?(0,r.jsx)("div",{className:"flex items-center justify-center min-h-screen",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary"})}):tS&&(eK||d.default.get("login_access_token"))?(0,r.jsxs)(r.Fragment,{children:[eK&&(0,r.jsx)(p.default,{}),(0,r.jsxs)("div",{className:"min-h-screen bg-gray-1 dark:bg-dark-2 ".concat(eK?"pb-12":""),children:[(0,r.jsx)(Z.P,{userdata:eW,profileUserData:ad,averageRating:ac,totalReviews:au,stats:ao,onEditProfile:()=>t_(!0),onUploadProfilePic:av,onUploadCoverPic:ab,isPublisherRole:!0,isViewingOther:eK,headingLevel:eK?"h2":"h1",aboutInfo:al,onCh
1atClick:as,onCustomOrderClick:()=>window.open("https://api.whatsapp.com/send/?phone=18288000589&text&type=phone_number&app_absent=0","_blank")}),!eK&&(0,r.jsx)(z.y,{isOpen:tj,onClose:()=>t_(!1),userdata:ad||eW,onUpdate:ax,isPublisherRole:!0,aboutInfo:al}),(0,r.jsx)("div",{className:"container mx-auto px-3 xsm:px-4 sm:px-6 lg:px-8 max-w-[1440px] mt-6 sm:mt-8",children:(0,r.jsxs)("div",{className:"flex flex-col gap-6 sm:gap-8",children:[(0,r.jsx)("div",{className:"bg-white dark:bg-dark-2 rounded-2xl sm:rounded-[2.5rem] border border-stroke dark:border-dark-3 p-1.5 sm:p-2 shadow-xl -mx-0.5 xsm:mx-0 ".concat(eV?"md:sticky md:top-0":"md:sticky md:top-30"," z-20"),children:(0,r.jsx)("div",{className:"flex items-stretch justify-start sm:justify-between overflow-x-auto no-scrollbar gap-1.5 sm:gap-2 px-0.5 sm:px-1 snap-x snap-mandatory pb-0.5",children:["Performance","Services","About","Portfolio","Reviews"].map(e=>(0,r.jsx)("button",{onClick:()=>tv(e),className:"flex-1 min-w-[4.25rem] xsm:min-w-[5.25rem] sm:min-w-[6.5rem] md:min-w-[7.5rem] lg:min-w-[120px] shrink-0 snap-start px-2.5 sm:px-4 md:px-6 py-2 sm:py-2.5 text-[9px] xsm:text-[10px] sm:text-[11px] md:text-xs font-black font-satoshi uppercase tracking-[0.08em] sm:tracking-[0.12em] md:tracking-[0.15em] transition-all duration-500 relative group overflow-visible ".concat(tx===e?"bg-gradient-to-r from-[#3692F4] to-[#003973] text-white rounded-full shadow-lg sm:transform sm:scale-105 z-10":"text-gray-400 dark:text-gray-500 hover:text-primary dark:hover:text-white hover:bg-gray-50 dark:hover:bg-dark-3 rounded-full"),children:e},e))})}),(0,r.jsxs)("div",{className:"w-full",children:[(0,r.jsxs)(M.M,{mode:"wait",children:["Services"===tx&&(0,r.jsxs)(D.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white dark:bg-dark-2 rounded-2xl sm:rounded-[2.5rem] border border-stroke dark:border-dark-3 p-4 sm:p-6 md:p-8 lg:p-10 shadow-xl",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between mb-6 sm:mb-8 lg:mb-10",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl font-black text-gray-900 dark:text-white font-satoshi tracking-tight",children:"My Services"}),(0,r.jsxs)("p",{className:"text-xs sm:text-sm text-gray-600 dark:text-gray-400 font-satoshi",children:[ah.length," services available"]})]}),(0,r.jsx)("div",{className:"flex gap-3 shrink-0"})]}),e5?(0,r.jsx)("div",{className:"col-span-full flex items-center justify-center py-16",children:(0,r.jsx)("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-primary"})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-3 sm:gap-4 md:gap-5",id:"publisher-services-list",children:0===ap.length?(0,r.jsxs)("div",{className:"col-span-full flex flex-col items-center justify-center py-16",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-full bg-gray-2 dark:bg-dark-3 flex items-center justify-center mb-4",children:(0,r.jsx)(v.Z,{className:"w-12 h-12 text-gray-400 dark:text-gray-500"})}),(0,r.jsx)("p",{className:"text-xl font-semibold text-gray-700 dark:text-gray-300 mb-2 font-satoshi",children:"No Services Available"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 text-center max-w-md font-satoshi mb-4",children:"Start by creating your first service to showcase your expertise"})]}):ap.map(e=>(0,r.jsx)(q.f,{item:e},e.id))}),ah.length>6&&(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row items-center justify-between gap-4 mt-8 pt-6 border-t border-stroke dark:border-dark-4",children:[(0,r.jsxs)("span",{className:"text-xs sm:text-sm text-gray-500 dark:text-gray-400 font-satoshi font-semibold",children:["Showing services ",(0,r.jsx)("span",{className:"text-gray-950 dark:text-white font-bold",children:Math.min(ah.length,(t2-1)*6+1)})," to"," ",(0,r.jsx)("span",{className:"text-gray-950 dark:text-white font-bold",children:Math.min(ah.length,6*t2)})," of"," ",(0,r.jsx)("span",{className:"text-gray-950 dark:text-white font-bold",children:ah.length})," available"]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center justify-center gap-3 sm:gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 border border-stroke dark:border-dark-3 rounded-xl px-2 py-1 bg-gray-50 dark:bg-dark-3/50 shadow-inner",children:[(0,r.jsx)("span",{className:"text-[11px] sm:text-xs text-gray-500 dark:text-gray-400 font-satoshi font-semibold",children:"Go to:"}),(0,r.jsx)("input",{type:"text",placeholder:"Page",value:t5,onChange:e=>t3(e.target.value.replace(/\D/g,"")),onKeyDown:e=>{if("Enter"===e.key){let e=parseInt(t5,10);if(e>=1&&e<=af){var t;t4(e),t3(""),null===(t=document.getElementById("publisher-services-list"))||void 0===t||t.scrollIntoView({behavior:"smooth"})}}},className:"w-10 sm:w-12 text-center text-xs border border-stroke dark:border-dark-4 roun
1ded-lg bg-white dark:bg-dark-2 text-gray-900 dark:text-white focus:outline-none focus:ring-1 focus:ring-primary py-0.5 font-bold"}),(0,r.jsx)("button",{onClick:()=>{let e=parseInt(t5,10);if(e>=1&&e<=af){var t;t4(e),t3(""),null===(t=document.getElementById("publisher-services-list"))||void 0===t||t.scrollIntoView({behavior:"smooth"})}},className:"px-2 py-0.5 bg-gradient-to-r from-primary to-primarydark text-white rounded-lg text-[10px] sm:text-xs font-bold transition-all duration-300 hover:shadow-md active:scale-95",children:"Go"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("button",{disabled:1===t2,onClick:()=>{if(t2>1){var e;t4(t2-1),null===(e=document.getElementById("publisher-services-list"))||void 0===e||e.scrollIntoView({behavior:"smooth"})}},className:"flex items-center gap-1 px-2.5 sm:px-3 py-1.5 sm:py-2 rounded-xl text-xs font-semibold transition-all duration-300 font-satoshi border bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-white dark:disabled:hover:bg-dark-2",children:[(0,r.jsx)(b.Z,{className:"w-3.5 h-3.5"}),(0,r.jsx)("span",{children:"Prev"})]}),(()=>{let e=[],t=Math.max(1,t2-2),a=Math.min(af,t+5-1);a-t<4&&(t=Math.max(1,a-5+1));for(let r=t;r<=a;r++)e.push(r);return(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[t>1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>{var e;t4(1),null===(e=document.getElementById("publisher-services-list"))||void 0===e||e.scrollIntoView({behavior:"smooth"})},className:"w-7 h-7 sm:w-8 sm:h-8 rounded-xl flex items-center justify-center text-xs font-semibold transition-all duration-300 font-satoshi border bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3",children:"1"}),t>2&&(0,r.jsx)("span",{className:"text-gray-400 px-0.5 font-satoshi text-xs",children:"..."})]}),e.map(e=>{let t=t2===e;return(0,r.jsx)("button",{onClick:()=>{var t;t4(e),null===(t=document.getElementById("publisher-services-list"))||void 0===t||t.scrollIntoView({behavior:"smooth"})},className:"w-7 h-7 sm:w-8 sm:h-8 rounded-xl flex items-center justify-center text-xs font-semibold transition-all duration-300 font-satoshi border ".concat(t?"bg-gradient-to-r from-primary to-primarydark text-white border-transparent shadow-md shadow-primary/20 scale-[1.02]":"bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3"),children:e},e)}),a<af&&(0,r.jsxs)(r.Fragment,{children:[a<af-1&&(0,r.jsx)("span",{className:"text-gray-400 px-0.5 font-satoshi text-xs",children:"..."}),(0,r.jsx)("button",{onClick:()=>{var e;t4(af),null===(e=document.getElementById("publisher-services-list"))||void 0===e||e.scrollIntoView({behavior:"smooth"})},className:"w-7 h-7 sm:w-8 sm:h-8 rounded-xl flex items-center justify-center text-xs font-semibold transition-all duration-300 font-satoshi border bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3",children:af})]})]})})(),(0,r.jsxs)("button",{disabled:t2===af,onClick:()=>{if(t2<af){var e;t4(t2+1),null===(e=document.getElementById("publisher-services-list"))||void 0===e||e.scrollIntoView({behavior:"smooth"})}},className:"flex items-center gap-1 px-2.5 sm:px-3 py-1.5 sm:py-2 rounded-xl text-xs font-semibold transition-all duration-300 font-satoshi border bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-white dark:disabled:hover:bg-dark-2",children:[(0,r.jsx)("span",{children:"Next"}),(0,r.jsx)(y.Z,{className:"w-3.5 h-3.5"})]})]})]})]})]})]},"services"),"About"===tx&&(0,r.jsx)(D.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white dark:bg-dark-2 rounded-2xl sm:rounded-[2.5rem] border border-stroke dark:border-dark-3 p-4 sm:p-6 md:p-8 lg:p-10 shadow-xl",children:(0,r.jsx)(O.o,{aboutInfo:al,username:(null==ad?void 0:ad.username)||(null==eW?void 0:eW.username)||(null==eW?void 0:eW.first_name),profileData:ad,stats:ao,isOwnProfile:!eK,onUp
1dateSuccess:()=>{ta(),ts({portfolio_type:"publisher"})}})},"about"),"Portfolio"===tx&&(0,r.jsxs)(D.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white dark:bg-dark-2 rounded-2xl sm:rounded-[2.5rem] border border-stroke dark:border-dark-3 p-4 sm:p-6 md:p-8 lg:p-10 shadow-xl",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between mb-6 sm:mb-8 lg:mb-10",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl font-black text-gray-900 dark:text-white mb-2 font-satoshi tracking-tight",children:"Portfolio"}),(0,r.jsx)("p",{className:"text-xs sm:text-sm text-gray-600 dark:text-gray-400 font-satoshi",children:"Showcase your published work and services"})]}),(0,r.jsx)("div",{className:"flex items-center gap-3 shrink-0",children:!eK&&(0,r.jsxs)(D.E.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>{tI(null),tP(!0)},className:"flex w-full sm:w-auto items-center justify-center gap-2 bg-gradient-to-r from-primary to-primarydark text-white px-4 sm:px-5 py-2.5 rounded-lg text-xs sm:text-sm font-semibold shadow-lg hover:shadow-xl transition-all font-satoshi",children:[(0,r.jsx)(v.Z,{className:"w-4 h-4 shrink-0"}),"Add Portfolio Item"]})})]}),e2?(0,r.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,r.jsx)(k.Z,{className:"w-8 h-8 animate-spin text-primary"})}):(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(r.Fragment,{children:am.length>0?(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 sm:gap-6",children:am.map(e=>(0,r.jsxs)("div",{className:"relative group",children:[(0,r.jsx)(o.default,{href:"/profile/portfolio/".concat(e.id),className:"block",children:(0,r.jsx)(V.i,{item:{id:e.id,title:e.title||"Untitled Project",description:e.description||"",image:G(e.image),category:e.category||"",project_url:e.project_url||"",created_at:e.created_at,is_pinned:e.is_pinned||!1}})}),!eK&&(0,r.jsxs)("div",{className:"absolute top-3 right-3 z-30 flex gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,r.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),a_(e)},className:"w-8 h-8 rounded-lg bg-white dark:bg-dark-3 flex items-center justify-center shadow-md transition-colors ".concat(e.is_pinned?"bg-yellow-50 dark:bg-yellow-900/20 hover:bg-yellow-100 dark:hover:bg-yellow-900/30":"hover:bg-gray-50 dark:hover:bg-dark-4"),title:e.is_pinned?"Unpin":"Pin",children:e.is_pinned?(0,r.jsx)(w.Z,{className:"w-4 h-4 text-yellow-600 dark:text-yellow-400 fill-yellow-600 dark:fill-yellow-400"}):(0,r.jsx)(j.Z,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),(0,r.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),aw(e)},className:"w-8 h-8 rounded-lg bg-white dark:bg-dark-3 flex items-center justify-center shadow-md hover:bg-gray-50 dark:hover:bg-dark-4 transition-colors",title:"Edit",children:(0,r.jsx)(_.Z,{className:"w-4 h-4 text-gray-600 dark:text-gray-400"})}),(0,r.jsx)("button",{onClick:t=>{t.preventDefault(),t.stopPropagation(),aj(e.id)},className:"w-8 h-8 rounded-lg bg-white dark:bg-dark-3 flex items-center justify-center shadow-md hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors",title:"Delete",children:(0,r.jsx)(N.Z,{className:"w-4 h-4 text-red-500"})})]})]},e.id))}):(0,r.jsxs)("div",{className:"bg-white dark:bg-dark-2 rounded-xl p-12 border border-stroke dark:border-dark-3 text-center",children:[(0,r.jsx)("div",{className:"w-24 h-24 rounded-full bg-gray-2 dark:bg-dark-3 flex items-center justify-center mb-4 mx-auto",children:(0,r.jsx)(C.Z,{className:"w-12 h-12 text-gray-400 dark:text-gray-500"})}),(0,r.jsx)("p",{className:"text-xl font-semibold text-gray-700 dark:text-gray-300 mb-2 font-satoshi",children:"No Portfolio Items Yet"}),(0,r.jsx)("p",{className:"text-sm text-gray-500 dark:text-gray-400 mb-6 font-satoshi",children:"Create your first portfolio item to showcase your published work"}),(0,r.jsx)("div",{className:"flex items-center justify-center gap-3",children:!eK&&(0,r.jsxs)(D.E.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>tP(!0),className:"flex items-center gap-2 bg-gradient-to-r from-primary to-primarydark text-white px-6 py-3 rounded-lg text-sm font-semibold shadow-lg hover:shadow-xl transition-all font-satoshi",children:[(0,r.jsx)(v.Z,{className:"w-4 h-4"}),"Create Portfolio Item"]})})]})})})]},"portfolio"),"Reviews"===tx&&(0,r.jsxs)(D.E.div,{id:"client-reviews",initial:{opacity:0,y:20}
1,animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"bg-white dark:bg-dark-2 rounded-2xl sm:rounded-[2.5rem] border border-stroke dark:border-dark-3 p-4 sm:p-6 md:p-8 lg:p-10 shadow-xl",children:[(0,r.jsxs)("div",{className:"mb-6 sm:mb-8 lg:mb-10",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl font-black text-gray-900 dark:text-white mb-2 font-satoshi tracking-tight",children:"Client Reviews"}),(0,r.jsx)("p",{className:"text-xs sm:text-sm text-gray-600 dark:text-gray-400 font-satoshi",children:"What others are saying about this publisher"})]}),(()=>{var e,t,a,s,i;let o=(null==e6?void 0:e6.rating_distribution)||{},l=(null===(e=o["5"])||void 0===e?void 0:e.count)||0,n=(null===(t=o["4"])||void 0===t?void 0:t.count)||0,d=(null===(a=o["3"])||void 0===a?void 0:a.count)||0,c=(null===(s=o["2"])||void 0===s?void 0:s.count)||0,u=(null===(i=o["1"])||void 0===i?void 0:i.count)||0;return(0,r.jsxs)("div",{className:"flex flex-col lg:flex-row items-stretch lg:items-center justify-between gap-6 p-6 mb-8 rounded-2xl bg-gray-50/50 dark:bg-dark-3/50 border border-stroke dark:border-dark-4 shadow-sm",children:[(0,r.jsx)("div",{className:"flex items-center gap-4 shrink-0 justify-center sm:justify-start",children:(0,r.jsxs)("div",{className:"text-center sm:text-left",children:[(0,r.jsxs)("div",{className:"flex items-baseline justify-center sm:justify-start gap-1",children:[(0,r.jsx)("span",{className:"text-3xl sm:text-4xl font-black text-gray-900 dark:text-white font-satoshi",children:(null==e6?void 0:e6.average_rating)!==void 0?Number(e6.average_rating).toFixed(1):"0.0"}),(0,r.jsx)("span",{className:"text-sm text-gray-400 font-bold",children:"/ 5"})]}),(0,r.jsx)("div",{className:"flex items-center justify-center sm:justify-start gap-1 mt-1",children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>{let a=(null==e6?void 0:e6.average_rating)||0;return(0,r.jsx)(S.Z,{className:"w-4 h-4 ".concat(t<Math.round(a)?"fill-yellow-500 text-yellow-500":"fill-gray-300 text-gray-300 dark:fill-gray-600 dark:text-gray-600")},t)})}),(0,r.jsxs)("p",{className:"text-xs text-gray-500 mt-1 font-satoshi font-semibold",children:[(null==e6?void 0:e6.total_count)||0," Total Reviews"]})]})}),(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-2 justify-center lg:justify-end",children:[{value:"",label:"All",count:(null==e6?void 0:e6.total_count)||0},{value:"5",label:"5 Stars",count:l},{value:"4",label:"4 Stars",count:n},{value:"3",label:"3 Stars",count:d},{value:"2",label:"2 Stars",count:c},{value:"1",label:"1 Star",count:u}].map(e=>{let t=tb===e.value;return(0,r.jsxs)("button",{onClick:()=>{ty(e.value),tw(1)},className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs sm:text-sm font-semibold transition-all duration-300 font-satoshi border ".concat(t?"bg-gradient-to-r from-primary to-primarydark text-white border-transparent shadow-md shadow-primary/20 scale-[1.02]":"bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:border-gray-400 dark:hover:border-gray-600"),children:[""!==e.value&&(0,r.jsx)(S.Z,{className:"w-3.5 h-3.5 ".concat(t?"fill-white text-white":"fill-yellow-500 text-yellow-500")}),(0,r.jsx)("span",{children:e.label}),(0,r.jsx)("span",{className:"px-1.5 py-0.5 rounded-md text-[10px] ".concat(t?"bg-white/20 text-white":"bg-gray-100 dark:bg-dark-3 text-gray-500 dark:text-gray-400"),children:e.count})]},e.value)})})]})})(),e9?(0,r.jsx)("div",{className:"flex items-center justify-center py-16",children:(0,r.jsx)(k.Z,{className:"w-8 h-8 animate-spin text-primary"})}):ag.length>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"grid grid-cols-1 gap-6",children:ag.map(e=>{let t=tU[e.id]||{show:!1,text:"",submitting:!1},a=async()=>{if(!t.text.trim()){n.default.error("Please enter a response");return}tB(t=>({...t,[e.id]:{...t[e.id],submitting:!0}}));try{await tc({reviewId:e.id,response:t.text.trim()}),n.default.success("Response submitted successfully!"),tB(t=>({...t,[e.id]:{show:!1,text:"",submitting:!1}}));let a={sort:"newest",page:tk,page_size:12};eK&&eG&&(a.username=eG),tb&&(a.rating=tb),await td(a)}catch(t){n.default.error((null==t?void 0:t.message)||"Failed to submit response. Please try again."),tB(t=>
1({...t,[e.id]:{...t[e.id],submitting:!1}}))}};return(0,r.jsx)(D.E.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"bg-white dark:bg-dark-3 rounded-xl sm:rounded-[2rem] p-4 sm:p-6 md:p-8 border border-stroke dark:border-dark-4 shadow-lg hover:shadow-xl transition-all duration-300",children:(0,r.jsxs)("div",{className:"flex flex-col xsm:flex-row items-start gap-3 sm:gap-4",children:[(0,r.jsx)("div",{className:"w-12 h-12 sm:w-14 sm:h-14 rounded-full bg-gradient-to-br from-primary to-primarydark flex items-center justify-center text-white font-bold text-base sm:text-lg shadow-lg font-satoshi flex-shrink-0",children:e.reviewer.username.charAt(0).toUpperCase()}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 w-full",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between mb-2",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("div",{className:"font-semibold text-gray-900 dark:text-white font-satoshi break-words",children:e.reviewer.username}),(0,r.jsxs)("div",{className:"text-[11px] sm:text-xs text-gray-500 dark:text-gray-400 font-satoshi",children:[e.reviewer.country," • ",(0,W.pi)(e.created_at)]})]}),(0,r.jsx)("div",{className:"flex items-center gap-1 shrink-0",children:[void 0,void 0,void 0,void 0,void 0].map((t,a)=>(0,r.jsx)(S.Z,{className:"w-3.5 h-3.5 ".concat(a<e.rating?"fill-yellow-dark text-yellow-dark":"fill-gray-300 text-gray-300 dark:fill-gray-600 dark:text-gray-600")},a))})]}),(0,r.jsx)("p",{className:"text-sm text-gray-700 dark:text-gray-300 mb-2 font-satoshi",children:e.comment}),e.service_title&&""!==e.service_title.trim()&&(0,r.jsxs)("div",{className:"text-xs text-gray-500 dark:text-gray-400 mb-2 font-satoshi",children:["Service: ",(0,r.jsx)("span",{className:"font-bold text-gray-700 dark:text-gray-300",children:e.service_title})]}),e.response&&(0,r.jsxs)("div",{className:"mt-3 pt-3 border-t border-stroke dark:border-dark-4",children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-primary dark:text-primary mb-1 font-satoshi",children:eK?"Publisher Response:":"Your Response:"}),(0,r.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400 font-satoshi",children:e.response.comment}),(0,r.jsx)("div",{className:"text-xs text-gray-500 dark:text-gray-400 mt-1 font-satoshi",children:(0,W.pi)(e.response.created_at)})]}),!eK&&!e.response&&(0,r.jsx)("div",{className:"mt-4",children:t.show?(0,r.jsxs)("div",{className:"mt-3 pt-3 border-t border-stroke dark:border-dark-4",children:[(0,r.jsx)("label",{className:"block text-sm font-semibold text-gray-900 dark:text-white mb-2 font-satoshi",children:"Your Response"}),(0,r.jsx)("textarea",{value:t.text,onChange:t=>tB(a=>({...a,[e.id]:{...a[e.id],text:t.target.value}})),rows:3,placeholder:"Write your response to this review...",className:"w-full px-4 py-2 border border-stroke dark:border-dark-3 rounded-lg bg-white dark:bg-dark-2 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent resize-none font-satoshi mb-3"}),(0,r.jsxs)("div",{className:"flex flex-col xsm:flex-row flex-wrap items-stretch xsm:items-center gap-2",children:[(0,r.jsx)("button",{onClick:a,disabled:!t.text.trim()||t.submitting,className:"px-4 py-2 bg-gradient-to-r from-primary to-primarydark text-white rounded-lg text-sm font-semibold hover:shadow-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed font-satoshi w-full xsm:w-auto",children:t.submitting?"Submitting...":"Submit Response"}),(0,r.jsx)("button",{onClick:()=>tB(t=>({...t,[e.id]:{show:!1,text:"",submitting:!1}})),className:"px-4 py-2 bg-white dark:bg-dark-2 text-gray-700 dark:text-gray-300 rounded-lg text-sm font-semibold border border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3 transition-all font-satoshi w-full xsm:w-auto",children:"Cancel"})]})]}):(0,r.jsx)("button",{onClick:()=>tB(t=>({...t,[e.id]:{show:!0,text:"",submitting:!1}})),className:"text-sm text-primary dark:text-primary hover:underline font-satoshi",children:"Respond to this review"})})]})]})},e.id)})}),!e9&&ag.length>0&&(()=>{let e=(null==e6?void 0:e6.api_count)||0,t=Math.ceil(e/12);return t<=1?null:(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-8 pt-6 border-t border-stroke dark:border-dark-4",children:[(0,r.jsxs)("span",{className:"text-xs sm:text-sm text-gray-500 dark:text-gray-400 font-satoshi font-semibold",children:["Showing page ",(0,r.jsx)("span",{className:"text-gray-950 dark:text-white font-bold",children:tk})," of ",(0,r.jsx)("span",{className:"text-gray-950 dark:text-white font-bold",children:t})," (",(0,r.jsx)("span",{className:"text-gray-950 dark:text-white font-bold",children:e})," total reviews)"]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)("button",{disabled:1===tk,onClick:()=>
1{if(tk>1){var e;tw(tk-1),null===(e=document.getElementById("client-reviews"))||void 0===e||e.scrollIntoView({behavior:"smooth"})}},className:"flex items-center gap-1 px-3 py-2 rounded-xl text-xs sm:text-sm font-semibold transition-all duration-300 font-satoshi border bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-white dark:disabled:hover:bg-dark-2",children:[(0,r.jsx)(b.Z,{className:"w-4 h-4"}),(0,r.jsx)("span",{children:"Prev"})]}),(()=>{let e=[],a=Math.max(1,tk-2),s=Math.min(t,a+5-1);s-a<4&&(a=Math.max(1,s-5+1));for(let t=a;t<=s;t++)e.push(t);return(0,r.jsxs)("div",{className:"flex items-center gap-1",children:[a>1&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("button",{onClick:()=>{var e;tw(1),null===(e=document.getElementById("client-reviews"))||void 0===e||e.scrollIntoView({behavior:"smooth"})},className:"w-8 h-8 rounded-xl flex items-center justify-center text-xs sm:text-sm font-semibold transition-all duration-300 font-satoshi border bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3",children:"1"}),a>2&&(0,r.jsx)("span",{className:"text-gray-400 px-1 font-satoshi text-xs",children:"..."})]}),e.map(e=>{let t=tk===e;return(0,r.jsx)("button",{onClick:()=>{var t;tw(e),null===(t=document.getElementById("client-reviews"))||void 0===t||t.scrollIntoView({behavior:"smooth"})},className:"w-8 h-8 rounded-xl flex items-center justify-center text-xs sm:text-sm font-semibold transition-all duration-300 font-satoshi border ".concat(t?"bg-gradient-to-r from-primary to-primarydark text-white border-transparent shadow-md shadow-primary/20 scale-[1.02]":"bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3"),children:e},e)}),s<t&&(0,r.jsxs)(r.Fragment,{children:[s<t-1&&(0,r.jsx)("span",{className:"text-gray-400 px-1 font-satoshi text-xs",children:"..."}),(0,r.jsx)("button",{onClick:()=>{var e;tw(t),null===(e=document.getElementById("client-reviews"))||void 0===e||e.scrollIntoView({behavior:"smooth"})},className:"w-8 h-8 rounded-xl flex items-center justify-center text-xs sm:text-sm font-semibold transition-all duration-300 font-satoshi border bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3",children:t})]})]})})(),(0,r.jsxs)("button",{disabled:tk===t,onClick:()=>{if(tk<t){var e;tw(tk+1),null===(e=document.getElementById("client-reviews"))||void 0===e||e.scrollIntoView({behavior:"smooth"})}},className:"flex items-center gap-1 px-3 py-2 rounded-xl text-xs sm:text-sm font-semibold transition-all duration-300 font-satoshi border bg-white dark:bg-dark-2 text-gray-600 dark:text-gray-400 border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3 disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:bg-white dark:disabled:hover:bg-dark-2",children:[(0,r.jsx)("span",{children:"Next"}),(0,r.jsx)(y.Z,{className:"w-4 h-4"})]})]})]})})()]}):(0,r.jsxs)("div",{className:"text-center py-16",children:[(0,r.jsx)(E.Z,{className:"w-16 h-16 mx-auto text-gray-400 dark:text-gray-600 mb-4"}),(0,r.jsx)("p",{className:"text-gray-600 dark:text-gray-400 font-satoshi",children:"No reviews yet"})]})]},"reviews"),"Performance"===tx&&(0,r.jsx)(D.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"w-full max-w-[min(100%,80rem)] mx-auto px-0 sm:px-2 md:px-4 lg:px-6 mt-4 sm:mt-6 pb-12 sm:pb-16 lg:pb-20",children:tt?(0,r.jsx)("div",{className:"flex items-center justify-center min-h-[400px]",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("div",{className:"w-12 h-12 border-4 border-primary/20 border-t-primary rounded-full animate-spin mx-auto mb-4"}),(0,r.jsx)("p",{className:"text-gray-600 dark:text-gray-400 font-satoshi",children:"Loading performance data..."})]})}):te?(0,r.jsxs)("div",{className:"space-y-8 sm:space-y-10 lg:space-y-12",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 sm:gap-6 pb-6 sm:pb-8 border-b border-stroke dark:border-dark-3",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h2",{className:"text-2xl sm:text-3xl font-black text-gray-900 dark:text-white mb-2 font-satoshi tracking-tight",children:"Performance Overview"}),(0,r.jsxs)("p",{className:"text-xs sm:text-sm text-gray-600 dark:text-gray-400 font-satoshi",children:["Comprehensive metrics and analytics for ",(null===(ef=te.publisher)||void 0===ef?void 0:ef.username)||"this publisher"]})]}),te.rating_breakdown&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3 px-4 sm:px-6 py-2.5 sm:py-3 rounded-xl sm:rounded-2xl bg-gradient-to-r from-primary/10 to-primarydark/10 dark:from-primary/20 dark:to-primarydark/20 border border-primary/20 w-full sm:w-auto",children:[(0,r.jsx)(S.Z,{className:"h-5 w-5 sm:h-6 sm:w-6 fill-yellow-500 text-yellow-500 shrink-0"}),(0,r.jsxs)("div",{className:"flex items-baseline gap-1.5 flex-wrap",children:[(0,r.jsx)("span",{className:"text-xl sm:text-2xl font-black text-gray-900 dark:text-white font-satoshi",children:(null===(ex=te.rating_breakdown.average_rating)||void 0===ex?void 0:ex.toFixed(1))||"0.0"}),(0,r.jsx)("span",{className:"text-sm text-gray-400 font-satoshi font-black",children:"/ 5"})]}),(0,r.jsxs)("span",{className:"text-xs text-gray-500 font-bold uppercase tracking-widest font-satoshi ml-2",children:["(",te.rating_breakdown.total_reviews||0," reviews)"]})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 sm:gap-5 lg:gap-6",children:[{label:"Order Response Rate",val:(null==te?void 0:null===(ev=te.last_90_days_gig)||void 0===ev?void 0:ev.on_time_delivery_percentage)?Number(te.last_90_days_gig.on_time_delivery_percentage).toFixed(0)+"%":"100%",desc:"Recent response activity",icon:(0,r.jsx)(A.Z,{className:"w-6 h-6"}),gradient:"from-[#3692F4] to-[#003973]",shadow:"shadow-blue-200"},{label:"Delivered on Time",val:Number(null!==(eA=null===(eb=te.last_90_days_gig)||void 0===eb?void 0:eb.on_time_delivery_percentage)&&void 0!==eA?eA:100).toFixed(0)+"%",desc:"Order delivery speed",icon:(0,r.jsx)(P.Z,{className:"w-6 h-6"}),gradient:"from-[#00B67A] to-[#006A04]",shadow:"shadow-emerald-200"},{label:"Order Completion",val:Number(null!==(eP=null===(ey=te.last_90_days_gig)||void 0===ey?void 0:ey.completion_rate_percentage)&&void 0!==eP?eP:100).toFixed(0)+"%",desc:"Successful order ratio",icon:(0,r.jsx)(R.Z,{className:"w-6 h-6"}),gradient:"from-[#FACC15] to-[#D97706]",shadow:"shadow-amber-200"},{label:"Response Time",val:"1 Hr",desc:"Average response speed",icon:(0,r.jsx)(I.Z,{className:"w-6 h-6"}),gradient:"from-[#EC4899] to-[#BE185D]",shadow:"shadow-pink-200"}
1].map((e,t)=>(0,r.jsxs)(D.E.div,{whileHover:{y:-5},className:"relative overflow-hidden rounded-2xl sm:rounded-[2.5rem] p-5 sm:p-6 md:p-8 text-white bg-gradient-to-br ".concat(e.gradient," ").concat(e.shadow," shadow-2xl transition-all duration-300"),children:[(0,r.jsxs)("div",{className:"relative z-10 space-y-4 sm:space-y-6",children:[(0,r.jsx)("div",{className:"bg-white/20 w-10 h-10 sm:w-12 sm:h-12 rounded-xl sm:rounded-2xl flex items-center justify-center backdrop-blur-md border border-white/20",children:e.icon}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-[9px] sm:text-[10px] font-black uppercase tracking-[0.15em] sm:tracking-[0.2em] opacity-80 mb-1 font-satoshi",children:e.label}),(0,r.jsx)("h4",{className:"text-3xl sm:text-4xl font-black font-satoshi",children:e.val})]}),(0,r.jsx)("p",{className:"text-xs font-medium opacity-60 font-satoshi italic",children:e.desc})]}),(0,r.jsx)("div",{className:"absolute -right-4 -bottom-4 w-32 h-32 bg-white/10 rounded-full blur-3xl"})]},t))}),(0,r.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-5 sm:gap-6 lg:gap-8",children:[(0,r.jsx)("div",{className:"lg:col-span-2 space-y-6 sm:space-y-8",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-dark-2 rounded-2xl sm:rounded-[2.5rem] p-5 sm:p-6 md:p-8 lg:p-10 border border-stroke dark:border-dark-3 shadow-xl h-full relative overflow-hidden group",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 mb-6 sm:mb-8 lg:mb-10",children:[(0,r.jsx)("div",{className:"w-14 h-14 sm:w-16 sm:h-16 rounded-xl sm:rounded-2xl bg-blue-50 dark:bg-blue-900/20 flex items-center justify-center text-blue-600 group-hover:scale-110 transition-transform duration-500 shrink-0",children:(0,r.jsx)(U.Z,{className:"w-7 h-7 sm:w-8 sm:h-8"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("h3",{className:"text-xl sm:text-2xl font-black text-gray-900 dark:text-white font-satoshi tracking-tight",children:"Marketplace Activity"}),(0,r.jsx)("p",{className:"text-xs sm:text-sm text-gray-500 dark:text-gray-400 font-satoshi",children:"Detailed breakdown of your recent orders and tasks."})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 xsm:grid-cols-3 gap-4 sm:gap-5 lg:gap-6",children:[{label:"Recent Orders",val:null!==(eR=null===(ek=te.last_90_days_gig)||void 0===ek?void 0:ek.recent_orders)&&void 0!==eR?eR:0,color:"text-blue-600",bg:"bg-blue-50/50"},{label:"Completed Tasks",val:null!==(eI=null===(ew=te.last_90_days_gig)||void 0===ew?void 0:ew.completed_tasks)&&void 0!==eI?eI:0,color:"text-emerald-600",bg:"bg-emerald-50/50"},{label:"Rejected Tasks",val:null!==(eU=null===(ej=te.last_90_days_gig)||void 0===ej?void 0:ej.rejected_tasks)&&void 0!==eU?eU:0,color:"text-rose-600",bg:"bg-rose-50/50"}].map((e,t)=>(0,r.jsxs)("div",{className:"".concat(e.bg," dark:bg-dark-3 rounded-xl sm:rounded-2xl p-4 sm:p-5 md:p-6 border border-transparent hover:border-gray-200 transition-all text-center"),children:[(0,r.jsx)("p",{className:"text-[9px] sm:text-[10px] font-black uppercase tracking-widest text-gray-400 mb-1 sm:mb-2 font-satoshi",children:e.label}),(0,r.jsx)("p",{className:"text-3xl sm:text-4xl font-black font-satoshi ".concat(e.color),children:String(e.val).padStart(2,"0")})]},t))})]})}),(0,r.jsx)("div",{className:"lg:col-span-1",children:(0,r.jsxs)("div",{className:"bg-white dark:bg-dark-2 rounded-2xl sm:rounded-[2.5rem] p-5 sm:p-6 md:p-8 lg:p-10 border border-stroke dark:border-dark-3 shadow-xl h-full",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 sm:gap-4 mb-6 sm:mb-8",children:[(0,r.jsx)("div",{className:"w-12 h-12 sm:w-14 sm:h-14 rounded-xl sm:rounded-2xl bg-yellow-50 dark:bg-yellow-900/20 flex items-center justify-center text-yellow-500 shrink-0",children:(0,r.jsx)(S.Z,{className:"w-6 h-6 sm:w-7 sm:h-7 fill-yellow-500"})}),(0,r.jsx)("h3",{className:"text-lg sm:text-xl font-black text-gray-900 dark:text-white font-satoshi",children:"Review Ratings"})]}),(0,r.jsx)("div",{className:"space-y-4",children:[5,4,3,2,1].map(e=>{var t,a;let s=String(e),i=(null===(a=te.rating_breakdown)||void 0===a?void 0:null===(t=a.distribution)||void 0===t?void 0:t[s])||{count:0,percentage:0},o=i.percentage||0;return(0,r.jsxs)("div",{className:"space-y-2",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between text-xs font-black font-satoshi",children:[(0,r.jsxs)("span",{className:"text-gray-400",children:[e," stars"]}),(0,r.jsx)("span",{className:"text-gray-900 dark:text-white",children:i.count})]}),(0,r.jsx)("div",{className:"h-2.5 rounded-full bg-gray-100 dark:bg-dark-3 overflow-hidden",children:(0,r.jsx)(D.E.div,{initial:{width:0},animate:{width:"".concat(o,"%")},className:"h-full bg-yellow-400 rounded-full"})})]},e)})})]})})]}),te.top_gigs&&te.top_gigs.length>0&&(0,r.jsxs)("div",{className:"rounded-2xl sm:rounded-[2.5rem] border border-stroke dark:border-dark-3 bg-white dark:bg-dark-2 p-5 sm:p-6 md:p-8 lg:p-10 shadow-xl space-y-6 sm:space-y-8",children:[(0,r.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4",children:[(0,r.jsx)("div",{className:"w-14 h-14 sm:w-16 sm:h-16 rounded-xl sm:rounded-2xl bg-indigo-50 dark:bg-indigo-900/20 flex items-center justify-center text-indigo-600 shrink-0",children:(0,r.jsx)(B.Z,{className:"w-7 h-7 sm:w-8 sm:h-8"})}),(0,r.jsx)("h3",{className:"text-xl sm:text-2xl font-black text-gray-900 dark:text-white font-satoshi tracking-tight",children:"Top Performing Gigs"})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4 sm:gap-5 lg:gap-6",children:te.top_gigs.map((e,t)=>{var a;return(0,r.jsx)(o.default,{href:"/".concat(e.gig_seller_username,"/").concat(e.slug),className:"group block",children:(0,r.jsxs)("div",{className:"rounded-3xl border border-stroke dark:border-dark-3 bg-white dark:bg-dark-2 hover:shadow-2xl transition-all duration-500 overflow-hidden",children:[(0,r.jsxs)("div",{className:"relative h-48 bg-gray-100 dark:bg-dark-3 overflow-hidden",children:[e.image?(0,r.jsx)("img",{src:"https://www.vefogix.com".concat(e.image||""),alt:e.gig_title,className:"w-full h-full object-cover group-hover:scale-110 transition-transform duration-700"}):(0,r.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,r.jsx)(F.Z,{className:"w-12 h-12 text-gray-300"})}),(0,r.jsx)("div",{className:"absolute top-4 left-4",children:(0,r.jsxs)("span",{className:"px-4 py-2 rounded-xl bg-black text-white text-[10px] font-black uppercase tracking-widest shadow-xl",children:["#",t+1]})})]}),(0,r.jsxs)("div",{className:"p-6",children:[(0,r.jsx)("h4",{className:"text-lg font-black text-gray-900 dark:text-white font-satoshi line-clamp-2 mb-4 group-hover:text-primary transition-colors h-14",children:e.gig_title}),(0,r.jsxs)("div",{className:"flex items-center justify-between pt-4 border-t border-gray-50 dark:border-dark-3",children:[(0,r.jsxs)("span",{className:"text-xs font-bold text-gray-400 uppercase tracking-widest font-satoshi",children:[e.orders," orders"]}),(0,r.jsxs)("span",{className:"text-xl font-black text-primary font-satoshi",children:["$",null===(a=e.price)||void 0===a?void 0:a.toFixed(2)]})]})]})]})},e.gig_id||t)})})]})]}):(0,r.jsx)("div",{className:"flex items-center justify-center min-h-[400px]",children:(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)("p",{className:"text-gray-600 dark:text-gray-400 font-satoshi",children:"No performance data available"})})})},"performance")]}),(0,r.jsx)(M.M,{children:tA&&(0,r.jsx)(D.E.div,{initial:{opacity:0}
1,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-[999999] flex items-center justify-center p-4",onClick:()=>tP(!1),children:(0,r.jsxs)(D.E.div,{initial:{scale:.95,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.95,opacity:0},onClick:e=>e.stopPropagation(),className:"bg-white dark:bg-dark-2 rounded-2xl shadow-2xl w-full max-w-2xl max-h-[90vh] flex flex-col",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-stroke dark:border-dark-3 flex-shrink-0",children:[(0,r.jsx)("h2",{className:"text-2xl font-bold text-gray-900 dark:text-white font-satoshi",children:tR?"Edit Portfolio Item":"Add Portfolio Item"}),(0,r.jsx)("button",{onClick:()=>{tP(!1),tI(null),tL(""),tM(""),tW(""),tz(""),tG([]),tY(null)},className:"w-8 h-8 rounded-lg flex items-center justify-center hover:bg-gray-100 dark:hover:bg-dark-3 transition-colors",children:(0,r.jsx)(N.Z,{className:"w-5 h-5 text-gray-500 dark:text-gray-400"})})]}),(0,r.jsxs)("div",{className:"p-6 space-y-6 overflow-y-auto flex-1 min-h-0",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-semibold text-gray-900 dark:text-white mb-2 font-satoshi",children:"Project Name"}),(0,r.jsx)("input",{type:"text",value:tF,onChange:e=>tL(e.target.value),placeholder:"Enter your project name",className:"w-full px-4 py-3 rounded-lg border border-stroke dark:border-dark-3 bg-white dark:bg-dark-2 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent font-satoshi"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-semibold text-gray-900 dark:text-white mb-2 font-satoshi",children:"Description"}),(0,r.jsx)("textarea",{value:tT,onChange:e=>tM(e.target.value),placeholder:"Tell us more about the project",rows:4,className:"w-full px-4 py-3 rounded-lg border border-stroke dark:border-dark-3 bg-white dark:bg-dark-2 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent resize-none font-satoshi"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-semibold text-gray-900 dark:text-white mb-2 font-satoshi",children:"Category (Optional)"}),(0,r.jsx)("input",{type:"text",value:tD,onChange:e=>tW(e.target.value),placeholder:"e.g., Web Development, Design",className:"w-full px-4 py-3 rounded-lg border border-stroke dark:border-dark-3 bg-white dark:bg-dark-2 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent font-satoshi"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-semibold text-gray-900 dark:text-white mb-2 font-satoshi",children:"Project URL (Optional)"}),(0,r.jsx)("input",{type:"url",value:tZ,onChange:e=>tz(e.target.value),placeholder:"https://example.com/published-article",className:"w-full px-4 py-3 rounded-lg border border-stroke dark:border-dark-3 bg-white dark:bg-dark-2 text-gray-900 dark:text-white placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-primary focus:border-transparent font-satoshi"})]}),(0,r.jsx)("div",{className:"p-4 bg-blue-50 dark:bg-blue-900/20 border border-blue-200 dark:border-blue-800/30 rounded-lg mb-4",children:(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"w-5 h-5 rounded-full bg-blue-500 flex items-center justify-center flex-shrink-0 mt-0.5",children:(0,r.jsx)("span",{className:"text-white text-xs font-bold",children:"ℹ"})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-semibold text-blue-900 dark:text-blue-300 mb-1 font-satoshi",children:"Admin Approval Required"}),(0,r.jsx)("p",{className:"text-xs text-blue-700 dark:text-blue-400 font-satoshi",children:"Your portfolio item will be reviewed by an administrator. Once approved, it will be visible in your public profile portfolio section."})]})]})}),(0,r.jsxs)("div",{className:"flex items-center justify-between p-4 rounded-lg border border-stroke dark:border-dark-3 bg-white dark:bg-dark-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-semibold text-gray-900 dark:text-white mb-1 font-satoshi",children:"Pin to Top"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-400 font-satoshi",children:"Show at the top of portfolio"})]}),(0,r.jsxs)("label",{className:"relative inline-flex items-center cursor-pointer",children:[(0,r.jsx)("input",{type:"checkbox",checked:tq,onChange:e=>tO(e.target.checked),className:"sr-only peer"}),(0,r.jsx)("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-primary/20 dark:peer-focus:ring-primary/30 rounded-full peer dark:bg-dark-3 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-primary"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-sm font-semibold text-gray-900 dark:text-white mb-2 font-satoshi",children:"Attach file"}),(0,r.jsxs)("div",{onDragEnter:e=>{e.preventDefault(),e.stopPropagation(),tQ(!0)},onDragLeave:e=>{e.preventDefault(),e.stopPropagation(),tQ(!1)},onDragOver:e=>{e.preventDefault(),e.stopPropagation()},onDrop:e=>{e.preventDefault(),e.stopPropagation(),tQ(!1),ay(Array.from(e.dataTransfer.files))},onClick:()=>{var e;return null===(e=tX.current)||void 0===e?void 0:e.click()},className:"border-2 border-dashed rounded-xl p-8 text-center cursor-pointer transition-all ".concat(tJ?"border-primary bg-primary/5 dark:bg-primary/10":"border-gray-300 dark:border-dark-3 hover:border-primary hover:bg-gray-50 dark:hover:bg-dark-3"),children:[(0,r.jsx)(L.Z,{className:"w-12 h-12 mx-auto mb-4 ".concat(tJ?"text-primary":"text-gray-400 dark:text-gray-500")}),(0,r.jsxs)("p",{className:"text-sm text-gray-600 dark:text-gray-400 mb-1 font-satoshi",children:["Drop files here or ",(0,r.jsx)("span",{className:"text-primary font-semibold",children:"browse"})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-500 font-satoshi",children:"Maximum file size 20MB (Image) or 250MB (Video)"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 dark:text-gray-500 mt-2 font-satoshi",children:"Accepted file types: JPG, PNG, WEBM, MP4, MOV"}),(0,r.jsx)("input",{ref:tX,type:"file",multiple:!0,accept:"image/jpeg,image/png,image/webp,video/webm,video/mp4,video/quicktime",onChange:e=>{e.target.files&&ay(Array.from(e.target.files))},className:"hidden"},tV.length)]}),tV.length>0&&(0,r.jsx)("div",{className:"mt-4 space-y-2",children:tV.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center justify-between p-3 bg-gray-50 dark:bg-dark-3 rounded-lg",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)(T.Z,{className:"w-5 h-5 text-gray-500 dark:text-gray-400"}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-white font-satoshi",children:e.name}),(0,r.jsxs)("p",{className:"text-xs text-gray-500 dark:text-gray-400 font-satoshi",children:[(e.size/1024/1024).toFixed(2)," MB"]})]})]}),(0,r.jsx)("button",{onClick:()=>{tG(tV.filter((e,a)=>a!==t))},className:"w-6 h-6 rounded-full flex items-center justify-center hover:bg-red-100 dark:hover:bg-red-900/20 transition-colors",children:(0,r.jsx)(N.Z,{className:"w-4 h-4 text-red-500"})})]},t))}),tK&&0===tV.length&&(0,r.jsx)("div",{className:"mt-3",children:(0,r.jsxs)("div",{className:"flex items-center justify-between p-2.5 bg-gray-50 dark:bg-dark-3 rounded-lg border border-stroke dark:border-dark-3",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)(T.Z,{className:"w-4 h-4 text-gray-500 dark:text-gray-400 flex-shrink-0"}),(0,r.jsx)("div",{className:"min-w-0 flex-1",children:(0,r.jsx)("p",{className:"text-sm font-medium text-gray-900 dark:text-white font-satoshi truncate",children:tK.split("/").pop()||"Current Image"})})]}),(0,r.jsx)("button",{onClick:()=>{tY(null)},className:"w-7 h-7 rounded-lg flex items-center justify-center hover:bg-red-100 dark:hover:bg-red-900/20 transition-colors flex-shrink-0",title:"Remove Image",children:(0,r.jsx)(N.Z,{className:"w-3.5 h-3.5 text-red-500"})})]})})]})]}),(0,r.jsxs)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-stroke dark:border-dark-3 flex-shrink-0",children:[(0,r.jsx)("button",{onClick:()=>{tP(!1),tI(null),tL(""),tM(""),tW(""),tz(""),tG([]),tY(null)},className:"px-6 py-2.5 rounded-lg text-sm font-semibold text-primary dark:text-primary bg-white dark:bg-dark-2 border border-stroke dark:border-dark-3 hover:bg-gray-50 dark:hover:bg-dark-3 transition-all font-satoshi",children:"Cancel"}),(0,r.jsx)("button",{onClick:ak,disabled:!tF.trim()||t$,className:"px-6 py-2.5 rounded-lg text-sm font-semibold bg-gradient-to-r from-primary to-primarydark text-white hover:shadow-lg transition-all disabled:opacity-50 disabled:cursor-not-allowed font-satoshi flex items-center gap-2",children:t$?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(k.Z,{className:"w-4 h-4 animate-spin"}),tR?"Updating...":"Creating..."]}):tR?"Update":"Submit"})]})]})})})]})]})})]}),eK&&(0,r.jsx)(f.FooterFour,{}),t6.length>0&&(0,r.jsx)("div",{className:"fixed bottom-2 right-2 xsm:bottom-3 xsm:right-3 sm:bottom-4 sm:right-4 z-[100000] flex flex-row-reverse gap-2 sm:gap-3 items-end max-h-[calc(100vh-6rem)] sm:max-h-[calc(100vh-8rem)] max-w-[calc(100vw-1rem)] overflow-x-auto overflow-y-hidden",children:t6.map(e=>(0,r.jsx)("div",{className:"flex-shrink-0",children:(0,r.jsx)(x.Z,{publisherId:e.publisherId,publisherName:e.publisherName,publisherAvatar:e.publisherAvatar,currentUserId:String(t8),currentUserName:t7,currentUserAvatar:ae,roomId:e.roomId,taskId:e.taskId,requireServiceSelection:e.requireServiceSelection,profileServices:e.profileServices,publisherListingsUsername:e.publisherListingsUsername,onClose:()=>{t9(t=>t.filter(t=>t.publisherId!==e.publisherId))}})},e.publisherId))})]}):null}},42056:function(e,t,a){a.d(t,{$:function(){return u},a:function(){return c}});var r=a(57437),s=a(2265),i=a(99376),o=a(64131),l=a(38695),n=a(93131);let d=(0,s.createContext)(void 0),c=e=>{let{children:t}=e,a=(0,i.usePathname)(),c=(0,s.useRef)(null),u=(0,n.K)(),m=(0,s.useMemo)(()=>(0,l.h)((0,l.YE)(),{resolved:!1}),[]),g=u.isResolved?u:m;(0,s.useRef)(g).current=g;let h=(0,s.useCallback)(()=>
1!1,[]),[p,f]=(0,s.useState)(()=>{try{let e=localStorage.getItem("currentUserRole");if(e){let t;if(t=e.startsWith('"')&&e.endsWith('"')?JSON.parse(e):e,["buyer","seller","publisher","agency"].includes(t)){if("agency"===t&&!h())return"buyer";return t}console.warn("Invalid role in localStorage: ".concat(t,", defaulting to buyer"))}}catch(e){console.warn("Error parsing role from localStorage:",e)}return"buyer"}),x=e=>"/backlink-monitor"===e||"/backlink-report"===e||"/feedback"===e||"/support-tickets"===e?null:e.startsWith("/publisher-")||e.includes("/publisher/")||"/balance"===e||e.startsWith("/balance/")||"/press-release-tasks"===e||e.startsWith("/press-release-tasks/")||"/publisher-my-platform"===e||"/publisher-dashboard"===e||"/publisher-guestpost-tasks"===e||"/publisher-task-view"===e||e.startsWith("/publisher-task-view")||"/update-owner"===e?"publisher":e.startsWith("/seller-")||e.includes("/seller/")||"/testing-seller-db"===e||e.startsWith("/testing-seller-db/")||"/my-clients"===e||"/my-requests"===e||e.startsWith("/my-requests/")||"/my-tasks"===e||"/client-details"===e?"seller":e.startsWith("/buyer-")||e.includes("/buyer/")||"/all-publisher-sites"===e||"/premium-sites"===e||"/favorite-sites"===e||"/blacklisted-sites"===e||"/trusted-sites"===e||"/verified-websites"===e||"/projects"===e||e.startsWith("/projects/")||"/project-publisher-site"===e||"/top-publishers"===e||e.startsWith("/top-publishers/")||"/invoices"===e||"/my-packages"===e||e.startsWith("/my-packages/")||"/backlink-monitor"===e||"/backlink-report"===e||"/company-dashboard"===e||"/owner-sites"===e||"/task-create"===e||"/all-invoices"===e||"/buyer-encode"===e||e.startsWith("/buyer-encode/")||"/create-website-earn-money"===e||"/partner"===e||e.startsWith("/press-release-")||"/buyer-task-view"===e||e.startsWith("/buyer-task-view")?"buyer":null,v=()=>{f("buyer"),localStorage.removeItem("currentUserRole"),localStorage.removeItem("isPublisher"),localStorage.removeItem("selectedMenu"),(0,l.Rg)()},b=()=>{f(e=>e)};return(0,s.useEffect)(()=>{let e=()=>{if(!(localStorage.getItem("login_access_token")||o.default.get("login_access_token"))){"buyer"!==p&&v();return}try{let e=localStorage.getItem("currentUserRole");if(!e){"buyer"!==p&&f("buyer");return}let t=e.startsWith('"')&&e.endsWith('"')?JSON.parse(e):e;if(!["buyer","seller","publisher","agency"].includes(t)){console.warn("Invalid role in localStorage: ".concat(t,", resetting to buyer")),v();return}let a="agency"!==t||h()?t:"buyer";a!==p&&a!==c.current&&f(a)}catch(e){console.warn("Error parsing role from localStorage:",e),v()}};return e(),window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[p,g.hasAgencyAccess]),(0,s.useEffect)(()=>{if(!a)return;let e=x(a);if(e&&e!==p){c.current=e,f(e),localStorage.setItem("currentUserRole",e),setTimeout(()=>{c.current=null},100);return}"agency"===p&&g.isResolved&&!g.hasAgencyAccess&&(f("buyer"),localStorage.setItem("currentUserRole","buyer"))},[a,g.hasAgencyAccess,g.isResolved]),(0,s.useEffect)(()=>{{let e=setTimeout(()=>{b()},100);return()=>clearTimeout(e)}},[]),(0,r.jsx)(d.Provider,{value:{currentRole:p,switchToRole:(e,t)=>{let a="agency"!==e||h()?e:"buyer";if(!["buyer","seller","publisher","agency"].includes(e)){console.error("Invalid role: ".concat(e));return}if(f(a),localStorage.setItem("currentUserRole",a),localStorage.removeItem("isPublisher"),localStorage.removeItem("selectedMenu"),t){let e=(()=>{switch(a){case"buyer":default:return"/buyer-dashboard/";case"seller":return"/seller-dashboard/";case"publisher":return"/publisher-dashboard/";case"agency":return h()?"/agency-dashboard/":"/buyer-dashboard/"}})();setTimeout(()=>{t.push(e)},100)}else console.warn("No router provided for navigation")},resetRole:v,handleLogin:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"buyer",t="agency"!==e||h()?e:"buyer";f(t),localStorage.setItem("currentUserRole",t),localStorage.removeItem("isPublisher"),localStorage.removeItem("selectedMenu")},forceRefresh:b,isPublisher:"publisher"===p},children:t})},u=()=>{let e=(0,s.useContext)(d);if(void 0===e)throw Error("useLayout must be used within a LayoutProvider");return e}},71575:function(e,t,a){a.d(t,{G:function(){return u},P:function(){return c}});var r=a(57437),s=a(2265),i=a(83464),o=a(99551),l=a(64131),n=a(75186);let d=(0,s.createContext)(),c=e=>{let{children:t}
1=e,[a,c]=(0,s.useState)([]),[u,m]=(0,s.useState)([]),[g,h]=(0,s.useState)([]),[p,f]=(0,s.useState)(null),[x,v]=(0,s.useState)(null),[b,y]=(0,s.useState)(null),[k,w]=(0,s.useState)(0),[j,_]=(0,s.useState)(1),[N,C]=(0,s.useState)(10),[S,E]=(0,s.useState)(!1),[A,P]=(0,s.useState)(""),R=(0,s.useRef)(new Set),I=(0,s.useRef)(new Map),U=(0,s.useCallback)(async function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,r=l.default.get("login_access_token");if(!r)return{error:!0,detail:"Authentication credentials were not provided."};let s={headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},params:t};a&&"function"==typeof a.addEventListener&&(s.signal=a);try{return(await i.default.get(e,s)).data}catch(e){if(!i.default.isCancel(e)){var o,n;let t=null==e?void 0:null===(o=e.response)||void 0===o?void 0:o.status,a=null==e?void 0:null===(n=e.response)||void 0===n?void 0:n.data;if(401===t)return{error:!0,detail:(null==a?void 0:a.detail)||"Authentication credentials were not provided."};if(400===t)return{error:!0,detail:(null==a?void 0:a.error)||(null==a?void 0:a.message)||"Bad request",status:400,data:a};if(404===t)return{error:!0,detail:"Resource not found",status:404};if(a)return{error:!0,detail:a,status:t};return console.error("API call failed:",e),{error:!0,detail:e.message||"An error occurred"}}return null}},[]),B=(0,s.useCallback)(async()=>{let e="publisher-tasks";if(!R.current.has(e)){R.current.add(e),E(!0);try{let e=await U("".concat(o.BASE_URL,"my-tasks/publisher/"));e&&!e.error?(m(e),y(null)):(null==e?void 0:e.error)&&(y(e),v(e))}finally{E(!1),R.current.delete(e)}}},[U]),F=(0,s.useCallback)(async()=>{let e="buyer-tasks";if(!R.current.has(e)){R.current.add(e),E(!0);try{let e=await U("".concat(o.BASE_URL,"my-tasks/buyer/"));e&&!e.error?(h(e),y(null)):(null==e?void 0:e.error)&&y(e)}finally{E(!1),R.current.delete(e)}}},[U]),L=(0,s.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Not Started",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",n=arguments.length>7&&void 0!==arguments[7]?arguments[7]:"",d=arguments.length>8&&void 0!==arguments[8]?arguments[8]:"",c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"",u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:"",m=arguments.length>11&&void 0!==arguments[11]?arguments[11]:null,g=arguments.length>12&&void 0!==arguments[12]&&arguments[12],h=arguments.length>13&&void 0!==arguments[13]?arguments[13]:"",p=arguments.length>14&&void 0!==arguments[14]?arguments[14]:"",f=arguments.length>15&&void 0!==arguments[15]?arguments[15]:"all",x=arguments.length>16&&void 0!==arguments[16]?arguments[16]:"",b=arguments.length>17&&void 0!==arguments[17]?arguments[17]:"",k="publisher-tasks-".concat(e,"-").concat(t,"-").concat(a,"-").concat(p,"-").concat(r,"-").concat(s,"-").concat(i,"-").concat(l,"-").concat(n,"-").concat(d,"-").concat(c,"-").concat(u,"-").concat(g,"-").concat(h,"-").concat(f,"-").concat(x,"-").concat(b),w=Date.now(),j=I.current.get(k);if(!(j&&w-j<1e3||R.current.has(k))){R.current.add(k),I.current.set(k,w),E(!0);try{let k={status:e,page:t,page_size:a,task_id:r,query:p,searchSeller:s,searchDomain:i,post_url:l,start_date:n,end_date:d,sortTask:c,ownership:u,searchPostingManager:h};g&&(k.press_task=!0),f&&"all"!==f&&(k.project_ownership=f),x&&(k.url_status=x),b&&(k.index_status=b);let w=await U("".concat(o.BASE_URL,"publisher-tasks/"),k,m);w&&w.error?(v(w),y(w)):w&&!w.error&&(v(w),y(null))}finally{E(!1),R.current.delete(k)}}},[U]),T=(0,s.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"Not Started",t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:10,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"",i=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",n=arguments.length>7&&void 0!==arguments[7]?arguments[7]:null,d=arguments.length>8&&void 0!==arguments[8]&&arguments[8],c=arguments.length>9&&void 0!==arguments[9]?arguments[9]:"",u=arguments.length>10&&void 0!==arguments[10]?arguments[10]:"",m=arguments.length>11&&void 0!==arguments[11]?arguments[11]:"",g=arguments.length>12&&void 0!==arguments[12]?arguments[12]:"",h=arguments.length>13&&void 0!==arguments[13]?arguments[13]:"all",p="buyer-tasks-".concat(e,"-").concat(t,"-").concat(a,"-").concat(r,"-").concat(s,"-").concat(i,"-").concat(l,"-").concat(c,"-").concat(u,"-").concat(m,"-").concat(g,"-").concat(h);if(!R.current.has(p)){R.current.add(p),E(!0);try{let p={status:e,page:t,page_size:a,search:s,task_id:r,publisher:i,post_url:l,start_date:c,end_date:u,postingManager:m,query:g};
1Object.keys(p).forEach(e=>{(""===p[e]||null===p[e]||void 0===p[e])&&delete p[e]}),d&&(p.press_task=!0),h&&"all"!==h&&(p.project_ownership=h);let x=await U("".concat(o.BASE_URL,"buyer-tasks/"),p,n);x&&x.error?(f(x),y(x)):x&&!x.error&&(f(x),y(null))}finally{E(!1),R.current.delete(p)}}},[U]),M=(0,s.useCallback)(async function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r="websites-".concat(e,"-").concat(t,"-").concat(a);if(!R.current.has(r)){R.current.add(r),E(!0);try{let r=await U("".concat(o.BASE_URL,"publisher-sites/"),{page:e,page_size:t,search:a});r&&!r.error?(c(r.results||[]),w(r.count||0),y(null)):(null==r?void 0:r.error)&&y(r)}finally{E(!1),R.current.delete(r)}}},[U]),D=(0,s.useCallback)(async e=>{let t=l.default.get("login_access_token");if(!t)return null;try{let a=await i.default.post("".concat(o.BASE_URL,"publisher-sites/"),e,{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}});return c(e=>[...e,a.data]),a}catch(e){var a;throw console.error("Error adding website:",e),(null===(a=e.response)||void 0===a?void 0:a.data)&&n.default.error(e.response.data[0]||"Failed to add website"),e}},[]),W=(0,s.useCallback)(async(e,t)=>{let a=l.default.get("login_access_token");if(!a)return null;try{let r=await i.default.put("".concat(o.BASE_URL,"publisher-sites/").concat(e,"/"),t,{headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"}});return c(a=>a.map(a=>a.uid===e?{...a,...t}:a)),r}catch(e){throw console.error("Error updating website:",e),e}},[]),Z=(0,s.useCallback)(async e=>{let t=l.default.get("login_access_token");if(!t)return null;try{await i.default.put("".concat(o.BASE_URL,"publisher-sites/").concat(e,"/"),{delete_status:!0},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}}),c(t=>t.filter(t=>t.id!==e))}catch(e){throw console.error("Error deleting website:",e),e}},[]),z=(0,s.useCallback)(e=>{_(e),M(e,N,A)},[M,N,A]),q=(0,s.useCallback)((e,t)=>{C(t),_(1),M(1,t,A)},[M,A]),O=(0,s.useCallback)((e,t,a)=>{let r=e[0];P(r),M(j,N,r)},[M,j,N]),V=(0,s.useCallback)(e=>{e&&e(),P(""),M(j,N,"")},[M,j,N]),G=(0,s.useCallback)(()=>{c([]),m([]),h([]),f(null),v(null),w(0),_(1),C(10),E(!1),P(""),y(null),R.current.clear(),I.current.clear()},[]),K=(0,s.useMemo)(()=>({websites:a,publisherTasks:u,buyerTasks:g,buyerTasksPaginated:p,publisherTasksPaginated:x,dataCount:k,currentPage:j,pageSize:N,loading:S,searchText:A,apiError:b,fetchWebsites:M,publisher_Tasks:B,buyer_Tasks:F,buyer_Tasks_Paginated:T,publisher_Tasks_Paginated:L,addWebsite:D,updateWebsite:W,deleteWebsite:Z,handlePageChange:z,handlePageSizeChange:q,handleSearch:O,handleReset:V,setSearchText:P,clearWebsiteData:G}),[a,u,g,p,x,k,j,N,S,A,b,M,B,F,T,L,D,W,Z,z,q,O,V,G]);return(0,r.jsx)(d.Provider,{value:K,children:t})},u=()=>{let e=(0,s.useContext)(d);if(!e)throw Error("useWebsites must be used within a WebsiteProvider");return e}},93131:function(e,t,a){a.d(t,{K:function(){return o}});var r=a(2265),s=a(40525),i=a(38695);let o=()=>{let e=(0,s.C)(e=>e.profile.userdata),t=(0,s.C)(e=>e.profile.loading);return(0,r.useMemo)(()=>(0,i.h)(e,{resolved:!!e&&!t}),[e,t])}},23595:function(e,t,a){a.d(t,{U:function(){return n}});var r=a(2265),s=a(40525),i=a(60937),o=a(64131),l=a(42056);let n=()=>{let e=(0,s.T)(),{userdata:t,userprofile:a,buyerBalance:n,loading:d,error:c}=(0,s.C)(e=>e.profile),{currentRole:u}=(0,l.$)(),m=(0,r.useRef)(!1),g=(0,r.useCallback)(async()=>{try{return await e((0,i.In)()).unwrap()}catch(e){var t;(null==e?void 0:null===(t=e.response)||void 0===t?void 0:t.status)!==401&&console.error("Failed to fetch profile:",e);return}},[e]);return(0,r.useEffect)(()=>{let e=o.default.get("login_access_token");"publisher"!==u&&(t||d||!e||m.current?!e&&m.current&&(m.current=!1):(m.current=!0,g()))},[t,d,g,u]),{userdata:t,userprofile:a,buyerBalance:n,loading:d,error:c,fetchUsers:g,updateUserData:(0,r.useCallback)(t=>{e((0,i.ck)(t))},[e]),clearUserData:(0,r.useCallback)(()=>{e((0,i.FZ)()),localStorage.removeItem("profile_cache"),localStorage.removeItem("profile_id")},[e])}}},38695:function(e,t,a){a.d(t,{PD:function(){return d},Rg:function(){return h},YE:function(){return m},h:function(){return n},tw:function(){return g}});var r=a(82374);let s=["admin","member"],i=["pending","approved","rejected","changes_requested","suspended"],o=e=>s.includes(e)?e:null,l=e=>i.includes(e)?e:null,n=(e,t)=>{var a;let s=o(null==e?void 0:e.agency_role),i=l(null==e?void 0:e.agency_status),n="member"===s||"admin"===s,d="approved"===i,c="admin"===s;return{role:s,status:i,isMember:n,isAdmin:c,hasAgencyAccess:r.K&&d&&c,canReachDashboard:r.K&&(c||!n&&null!=i),canRegister:r.K&&!n&&null==i,canEditAgency:r.K&&c&&(d||"changes_requested"===i),canAssignProjects:r.K&&d&&c,isSuspended:"suspended"===i,isResolved:null!==(a=null==t?void 0:t.resolved)&&void 0!==a&&a}};n(null,{resolved:!0});let d=e=>null,c="agencyRole",u="agencyStatus",m=()=>{try{return{agency_role:localStorage.getItem(c),agency_status:localStorage.getItem(u)}}catch(e){return null}},g=e=>{try{let t="string"==typeof e.agency_role?e.agency_role:"",a="str
1ing"==typeof e.agency_status?e.agency_status:"";localStorage.setItem(c,t),localStorage.setItem(u,a)}catch(e){}},h=()=>{try{localStorage.removeItem(c),localStorage.removeItem(u)}catch(e){}}},82374:function(e,t,a){a.d(t,{K:function(){return r}});let r=!0},27788:function(e,t,a){a.r(t),a.d(t,{decrementChatNotifUnreadCount:function(){return i},markAllChatNotifReadLocally:function(){return c},markChatNotifReadLocally:function(){return d},prependChatNotification:function(){return l},resetChatNotifUnreadCount:function(){return o},setChatNotifLoading:function(){return u},setChatNotifUnreadCount:function(){return s},setChatNotifications:function(){return n}});let r=(0,a(39129).oM)({name:"chatNotifications",initialState:{unreadCount:0,notifications:[],isLoading:!1},reducers:{setChatNotifUnreadCount(e,t){e.unreadCount=t.payload},decrementChatNotifUnreadCount(e,t){e.unreadCount=Math.max(0,e.unreadCount-t.payload)},resetChatNotifUnreadCount(e){e.unreadCount=0},prependChatNotification(e,t){!e.notifications.some(e=>e.id===t.payload.id)&&(e.notifications.unshift(t.payload),e.notifications.length>50&&e.notifications.pop())},setChatNotifications(e,t){e.notifications=t.payload},markChatNotifReadLocally(e,t){let a=new Set(t.payload);e.notifications=e.notifications.map(e=>a.has(e.id)?{...e,is_read:!0}:e)},markAllChatNotifReadLocally(e){e.notifications=e.notifications.map(e=>({...e,is_read:!0})),e.unreadCount=0},setChatNotifLoading(e,t){e.isLoading=t.payload}}}),{setChatNotifUnreadCount:s,decrementChatNotifUnreadCount:i,resetChatNotifUnreadCount:o,prependChatNotification:l,setChatNotifications:n,markChatNotifReadLocally:d,markAllChatNotifReadLocally:c,setChatNotifLoading:u}=r.actions;t.default=r.reducer},18719:function(e,t,a){a.r(t),a.d(t,{decrementUnreadCount:function(){return i},markAllReadLocally:function(){return c},markReadLocally:function(){return d},prependNotification:function(){return l},resetUnreadCount:function(){return o}
1,setLoading:function(){return u},setNotifications:function(){return n},setUnreadCount:function(){return s}});let r=(0,a(39129).oM)({name:"notifications",initialState:{unreadCount:0,notifications:[],isLoading:!1},reducers:{setUnreadCount(e,t){e.unreadCount=t.payload},decrementUnreadCount(e,t){e.unreadCount=Math.max(0,e.unreadCount-t.payload)},resetUnreadCount(e){e.unreadCount=0},prependNotification(e,t){!e.notifications.some(e=>e.id===t.payload.id)&&(e.notifications.unshift(t.payload),e.notifications.length>50&&e.notifications.pop())},setNotifications(e,t){e.notifications=t.payload},markReadLocally(e,t){let a=new Set(t.payload);e.notifications=e.notifications.map(e=>a.has(e.id)?{...e,is_read:!0}:e)},markAllReadLocally(e){e.notifications=e.notifications.map(e=>({...e,is_read:!0})),e.unreadCount=0},setLoading(e,t){e.isLoading=t.payload}}}),{setUnreadCount:s,decrementUnreadCount:i,resetUnreadCount:o,prependNotification:l,setNotifications:n,markReadLocally:d,markAllReadLocally:c,setLoading:u}=r.actions;t.default=r.reducer},60937:function(e,t,a){a.d(t,{FZ:function(){return u},In:function(){return d},ck:function(){return m}});var r=a(39129),s=a(83464),i=a(64131),o=a(99551),l=a(38695),n=a(51083);let d=(0,r.hg)("profile/fetchProfile",async(e,t)=>{var a,r,l,d,c,u,m,g,h,p,f,x,v,b,y;let{rejectWithValue:k}=t,w=i.default.get("login_access_token");if(!w)return k("No authentication token found");try{let e=await s.default.get("".concat(o.BASE_URL,"marketplace/profile/buyerdashboard/"),{headers:{Authorization:"Bearer ".concat(w),"Content-Type":"application/json"},validateStatus:e=>e<500});if(401===e.status)return(0,n.k)().catch(()=>{}),i.default.remove("login_access_token"),i.default.remove("login_refresh_token"),k("Authentication failed");let t=(null===(a=e.data)||void 0===a?void 0:a.profile)||e.data,v=(null===(r=e.data)||void 0===r?void 0:r.about)||{};return{...t,agency_role:null!==(g=null===(l=e.data)||void 0===l?void 0:l.agency_role)&&void 0!==g?g:null,agency_status:null!==(h=null===(d=e.data)||void 0===d?void 0:d.agency_status)&&void 0!==h?h:null,agency_name:null!==(p=null===(c=e.data)||void 0===c?void 0:c.agency_name)&&void 0!==p?p:null,agency_logo:null!==(f=null===(u=e.data)||void 0===u?void 0:u.agency_logo)&&void 0!==f?f:null,is_invite:null!==(x=null===(m=e.data)||void 0===m?void 0:m.is_invite)&&void 0!==x?x:null,gig_publisher_status:v.gig_publisher_status,bio:v.bio,intro_video:v.intro_video,languages:v.languages}}catch(e){if((null===(v=e.response)||void 0===v?void 0:v.status)!==401)return k((null===(y=e.response)||void 0===y?void 0:null===(b=y.data)||void 0===b?void 0:b.message)||"Failed to fetch profile");return k("Authentication required")}}),c=(0,r.oM)({name:"profile",initialState:{userdata:null,userprofile:null,buyerBalance:0,loading:!1,error:null},reducers:{clearProfile:e=>{e.userdata=null,e.userprofile=null,e.buyerBalance=0,e.error=null,e.loading=!1,(0,l.Rg)()},updateProfile:(e,t)=>{if(e.userdata){var a;e.userdata={...e.userdata,...t.payload},(null===(a=t.payload.buyer_wallet)||void 0===a?void 0:a.remain_balance)!==void 0&&(e.buyerBalance=t.payload.buyer_wallet.remain_balance)}}},extraReducers:e=>{e.addCase(d.pending,e=>{e.loading=!0,e.error=null}).addCase(d.fulfilled,(e,t)=>{var a,r,s,i,o;e.loading=!1,e.userdata=t.payload,e.userprofile=(null===(a=t.payload)||void 0===a?void 0:a.email)||null,e.buyerBalance=Number((null===(s=t.payload)||void 0===s?void 0:null===(r=s.buyer_wallet)||void 0===r?void 0:r.remain_balance)||0),e.error=null,(0,l.tw)({agency_role:null===(i=t.payload)||void 0===i?void 0:i.agency_role,agency_status:null===(o=t.payload)||void 0===o?void 0:o.agency_status})}).addCase(d.rejected,(e,t)=>{e.loading=!1,e.error=t.payload,e.userdata=null,(0,l.Rg)()})}}),{clearProfile:u,updateProfile:m}=c.actions;t.ZP=c.reducer},4310:function(e,t,a){a.d(t,{LL:function(){return u},Xq:function(){return n},bd:function(){return d},fq:function(){return l},h2:function(){return c},zt:function(){return m}});var r=a(83464),s=a(64131),i=a(99551),o=a(75186);async function l(){try{let e=s.default.get("login_access_token");if(!e)return console.warn("⚠️ [Cart] No auth token - returning empty cart"),[];let t="".concat(i.BASE_URL,"marketplace/cart/"),a=await r.default.get(t,{headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},validateStatus:e=>e<500});if(404===a.status)return console.warn("⚠️ [Cart] API endpoint not found (404) - Cart feature may not be available on server"),[];if(a.status>=400)return console.error("❌ [Cart] API error:",{status:a.status,data:a.data}),[];return a.data.results||[]}catch(r){var e,t,a;return console.error("❌ [Cart] Error fetching cart items:",{error:r.message,status:null===(e=r.response)||void 0===e?void 0:e.status,data:null===(t=r.response)||void 0===t?void 0:t.data}),(null===(a=r.response)||void 0===a?void 0:a.status)&&404!==r.response.status&&o.default.error("Failed to load cart items"),[]}}async function n(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;try{let n=s.default.get("login_access_token");if(!n)return console.warn("⚠️ [Cart] No auth token - user not logged in"),o.default.error("Please login to add packages to cart"),null;try{let o=await l(),n=o.find(a=>{let r=a.gig.id===e,s=null===a.package_id&&null==t||null!==a.package_id&&a.package_id===t;return r&&s});if(n){let t=n.quantity+a;console.log("\uD83D\uDD04 [Cart] Exact match found for gig ".concat(e,", updating quantity from ").concat(n.quantity," to ").concat(t));let r=await d(n.id,t);if(r)return window.dispatchEvent(new CustomEvent("vefogix:cart-updated")),r;console.warn("⚠️ [Cart] Failed to update existing item, will try to add new item")}let c=o.find(t=>t.gig.id===e);if(c&&null==t!=(null===c.package_id)){console.log("\uD83D\uDD04 [Cart] Found same gig ".concat(e," with different package setup. Merging into existing cart item ").concat(c.id));let o=null!=t?t:c.package_id,l=c.quantity+a,n=s.default.get("login_access_token");if(n)try{let e=await r.default.put("".concat(i.BASE_URL,"marketplace/cart/").concat(c.id,"/"),{package_id:o,quantity:l},{headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});return window.dispatchEvent(new CustomEvent("vefogix:cart-updated")),e.data}catch(e){console.warn("⚠️ [Cart] Failed to update package_id, will add as new item",e)}}}catch(e){console.warn("⚠️ [Cart] Error checking existing cart items, proceeding with add:",e)}let c=await r.default.post("".concat(i.BASE_URL,"marketplace/cart/"),{gig_id:e,package_id:t||null,quantity:a},{headers:{Authorization:"Bearer ".concat(n),"Content-Type":"application/json"}});return window.dispatchEvent(new CustomEvent("vefogix:cart-updated")),c.data}catch(t){var n,c,u,m,g,h,p,f,x;if(console.error("❌ [Cart] Error adding to cart:",{error:t.message,status:null===(n=t.response)||void 0===n?void 0:n.status,data:null===(c=t.response)||void 0===c?void 0:c.data}),(null===(u=t.response)||void 0===u?void 0:u.status)===401){s.default.remove("login_access_token"),o.default.error("Session expired. Please sign in again.");{let e=window.location.pathname+window.location.search;window.location.href="/signin?redirect=".concat(encodeURIComponent(e))}return null}let e=(null===(g=t.response)||void 0===g?void 0:null===(m=g.data)||void 0===m?void 0:m.error)||(null===(p=t.response)||void 0===p?void 0:null===(h=p.data)||void 0===h?void 0:h.detail)||(null===(x=t.response)||void 0===x?void 0:null===(f=x.data)||void 0===f?void 0:f.message)||"Failed to add package to cart";return o.default.error(e),null}}async function d(e,t){try{let a=s.default.get("login_access_token");if(!a)return null;let o=await r.default.put("".concat(i.BASE_URL,"marketplace/cart/").concat(e,"/"),{quantity:t},{headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"}});return window.dispatchEvent(new CustomEvent("vefogix:cart-updated")),o.data}catch(e){return console.error("Error updating cart item:",e),o.default.error("Failed to update cart package"),null}}async function c(e){try{let t=s.default.get("login_access_token");if(!t)return!1;return await r.default.delete("".concat(i.BASE_URL,"marketplace/cart/").concat(e,"/"),{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}}),window.dispatchEvent(new CustomEvent("vefogix:cart-updated")),!0}catch(e){return console.error("Error removing from cart:",e),o.default.error("Failed to remove package from cart"),!1}}async function u(){try{let e=s.default.get("login_access_token");if(!e)return!1;return await r.default.delete("".concat(i.BASE_URL,"marketplace/cart/clear/"),{headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"}}),window.dispatchEvent(new CustomEvent("vefogix:cart-updated")),!0}catch(e){return console.error("Error clearing cart:",e),o.default.error("Failed to clear cart"),!1}}async function m(){try{return(await l()).reduce((e,t)=>
1e+t.quantity,0)}catch(e){return console.warn("⚠️ [Cart] Error getting cart count:",e),0}}},7444:function(e,t,a){a.d(t,{D$:function(){return u},S:function(){return g},dv:function(){return o}});var r=a(64131),s=a(83464),i=a(99551);async function o(){let e=["".concat(i.BASE_URL,"marketplace/firebase/config/"),"".concat(i.BASE_URL,"notifications/firebase-config/"),"".concat(i.BASE_URL,"auth/firebase-config/")],t=!1;for(let i of e)try{let e=await s.default.get(i,{validateStatus:e=>e<500});if(e.status>=200&&e.status<300)return e.data;if(e.status>=400&&e.status<500){e.status;continue}}catch(l){var a,r;let s=null==l?void 0:null===(a=l.response)||void 0===a?void 0:a.status,o=null==l?void 0:null===(r=l.response)||void 0===r?void 0:r.data;if(s>=500){t=!0,i===e[0]&&(console.error("❌ [Firebase] Server error (".concat(s,") at ").concat(i)),console.error("❌ [Firebase] Error details:",{error:(null==o?void 0:o.error)||l.message,detail:(null==o?void 0:o.detail)||"No details available",endpoint:i}),console.error("❌ [Firebase] This indicates a backend server issue. Notifications may not work."));break}if(404===s)continue}return t?console.error("❌ [Firebase] Failed to fetch Firebase config due to server error.\n   Please check the backend logs and ensure:\n   1. The Firebase config endpoint is working correctly\n   2. The backend service is running properly\n   3. The endpoint returns valid Firebase configuration\n   Notifications will not work until this is fixed."):console.warn("⚠️ [Firebase] Failed to fetch Firebase config - no backend endpoint available.\n   The backend needs to implement one of these endpoints:\n   - GET /api/marketplace/firebase/config/\n   - GET /api/notifications/firebase-config/\n   - GET /api/auth/firebase-config/\n   Notifications will not work until this is fixed."),null}let l=!1,n=null,d=null,c=null;async function u(e){if(n===e)return;if(l&&d)return d;let t=r.default.get("login_access_token");if(!t){console.warn("No access token found, skipping FCM token registration");return}return l=!0,d=(async()=>{try{let o=["".concat(i.BASE_URL,"marketplace/firebase/fcm-token/"),"".concat(i.BASE_URL,"notifications/fcm-token/"),"".concat(i.BASE_URL,"auth/fcm-token/")],l=!1;for(let i of o)try{let a=await s.default.post(i,{token:e},{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"},validateStatus:e=>e<500});if(a.status>=200&&a.status<300){n=e;return}if(a.status>=400&&a.status<500){console.warn("⚠️ Client error (".concat(a.status,") at ").concat(i,":"),a.data),a.status;continue}}catch(s){var a,r;let e=null==s?void 0:null===(a=s.response)||void 0===a?void 0:a.status,t=null==s?void 0:null===(r=s.response)||void 0===r?void 0:r.data;if(e>=500){l=!0,console.error("❌ Server error (".concat(e,") at ").concat(i,":"),{error:(null==t?void 0:t.error)||s.message,detail:(null==t?void 0:t.detail)||"No details available",endpoint:i});break}if(404===e)continue;console.warn("⚠️ Error (".concat(e||"unknown",") with ").concat(i,":"),t||s.message)}l?console.error("❌ FCM token registration failed due to server error.\n   Please check the backend logs and ensure:\n   1. The FCMToken model migration is applied\n   2. The database table exists\n   3. The backend service is running correctly"):console.warn("⚠️ FCM token registration failed - no backend endpoint available.\n   The backend needs to implement one of these endpoints:\n   - POST /api/marketplace/firebase/fcm-token/\n   - POST /api/notifications/fcm-token/\n   - POST /api/auth/fcm-token/\n   Notifications will still work via Firebase Realtime Database listeners.")}finally{l=!1,d=null}})()}async function m(e){if(e)return e;if(n)return n;try{let{getNotificationService:e}=await Promise.all([a.e(21401),a.e(27012),a.e(10278),a.e(81803),a.e(64767),a.e(22081)]).then(a.bind(a,64767)),t=e().getFcmToken();if(t)return t}catch(e){}try{var t;let{getMessaging:e,getToken:r,isSupported:s}=await a.e(27012).then(a.bind(a,27012));if(!await s())return null;let i=await o(),l=null==i?void 0:i.vapidKey;if(!l)return null;let{initializeFirebase:n}=await Promise.all([a.e(21401),a.e(27012),a.e(8858)]).then(a.bind(a,8858)),d=await n();if(!d)return null;
1let c=await (null===(t=navigator.serviceWorker)||void 0===t?void 0:t.getRegistration("/firebase-messaging-sw.js"));return await r(e(d),{vapidKey:l,...c?{serviceWorkerRegistration:c}:{}})||null}catch(e){return null}}async function g(e){if(c)return c;c=(async()=>{try{let l=r.default.get("login_access_token"),n=await m(e);if(l&&n){let e=["".concat(i.BASE_URL,"marketplace/firebase/fcm-token/"),"".concat(i.BASE_URL,"notifications/fcm-token/"),"".concat(i.BASE_URL,"auth/fcm-token/")],a=!1;for(let r of e)try{let e=await s.default.delete(r,{data:{token:n},headers:{Authorization:"Bearer ".concat(l),"Content-Type":"application/json"},validateStatus:e=>e<500});if(e.status>=200&&e.status<300){a=!0;break}if(404===e.status)continue;console.warn("⚠️ Client error (".concat(e.status,") deactivating FCM token at ").concat(r,":"),e.data);continue}catch(s){var t,o;let e=null==s?void 0:null===(t=s.response)||void 0===t?void 0:t.status,a=null==s?void 0:null===(o=s.response)||void 0===o?void 0:o.data;if(e>=500){console.error("❌ Server error (".concat(e,") deactivating FCM token at ").concat(r,":"),{error:(null==a?void 0:a.error)||s.message,detail:(null==a?void 0:a.detail)||"No details available",endpoint:r});break}if(404===e)continue;console.warn("⚠️ Error (".concat(e||"unknown",") deactivating FCM token at ").concat(r,":"),a||s.message)}a||console.warn("⚠️ FCM token deactivation failed - the token may stay active on the backend.\n   Expected one of these endpoints to accept DELETE:\n   - DELETE /api/marketplace/firebase/fcm-token/\n   - DELETE /api/notifications/fcm-token/\n   - DELETE /api/auth/fcm-token/")}try{let{getMessaging:e,deleteToken:t,isSupported:r}=await a.e(27012).then(a.bind(a,27012));if(await r()){let{initializeFirebase:r}=await Promise.all([a.e(21401),a.e(27012),a.e(8858)]).then(a.bind(a,8858)),s=await r();if(s){let a=await t(e(s));console.log("\uD83D\uDDD1️ [FCM] deleteToken result: ".concat(a))}}}catch(e){console.warn("⚠️ Failed to delete local FCM token:",(null==e?void 0:e.message)||e)}}catch(e){console.warn("⚠️ FCM token cleanup skipped due to an unexpected error:",(null==e?void 0:e.message)||e)}finally{n=null,l=!1,d=null}})();try{return await c}finally{c=null}}},51083:function(e,t,a){a.d(t,{k:function(){return s}});var r=a(7444);async function s(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8e3,t=(async()=>{await (0,r.S)();try{let{resetNotificationFcmToken:e}=await Promise.all([a.e(21401),a.e(27012),a.e(10278),a.e(81803),a.e(64767),a.e(22081)]).then(a.bind(a,64767));e()}catch(e){console.warn("⚠️ Failed to reset chat notification FCM state:",(null==e?void 0:e.message)||e)}})(),s=new Promise(t=>{setTimeout(()=>{console.warn("⚠️ Push notification cleanup timed out after ".concat(e,"ms - continuing logout")),t()},e)});try{await Promise.race([t,s])}catch(e){console.warn("⚠️ Push notification cleanup failed - continuing logout:",(null==e?void 0:e.message)||e)}}},16907:function(e,t,a){a.d(t,{$f:function(){return d},IQ:function(){return l},Mp:function(){return n},QM:function(){return u},RE:function(){return c}});var r=a(83464),s=a(64131),i=a(99551),o=a(75186);async function l(){try{let e=s.default.get("login_access_token");if(!e)return[];let t="".concat(i.BASE_URL,"marketplace/wishlist/"),a=await r.default.get(t,{headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/json"},validateStatus:e=>e<500});if(404===a.status)return console.warn("⚠️ [Wishlist] API endpoint not found (404) - Wishlist feature may not be available on server"),[];if(a.status>=400)return console.error("❌ [Wishlist] API error:",{status:a.status,data:a.data}),[];return a.data.results||[]}catch(r){var e,t,a;return console.error("❌ [Wishlist] Error fetching wishlist items:",{error:r.message,status:null===(e=r.response)||void 0===e?void 0:e.status,data:null===(t=r.response)||void 0===t?void 0:t.data}),(null===(a=r.response)||void 0===a?void 0:a.status)&&404!==r.response.status&&o.default.error("Failed to load wishlist items"),[]}}async function n(e,t){try{let a=s.default.get("login_access_token");if(!a)return console.warn("⚠️ [Wishlist] No auth token - user not logged in"),o.default.error("Please login to add items to wishlist"),null;let l={gig_id:e};null!=t&&(l.package_id=t);let n=await r.default.post("".concat(i.BASE_URL,"marketplace/wis
1hlist/"),l,{headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"}});return window.dispatchEvent(new CustomEvent("vefogix:wishlist-updated")),n.data}catch(t){var a,l,n,d,c,u,m,g,h,p;if(console.error("❌ [Wishlist] Error adding to wishlist:",{error:t.message,status:null===(a=t.response)||void 0===a?void 0:a.status,data:null===(l=t.response)||void 0===l?void 0:l.data}),(null===(n=t.response)||void 0===n?void 0:n.status)===401){s.default.remove("login_access_token"),o.default.error("Session expired. Please sign in again.");{let e=window.location.pathname+window.location.search;window.location.href="/signin?redirect=".concat(encodeURIComponent(e))}return null}let e=(null===(c=t.response)||void 0===c?void 0:null===(d=c.data)||void 0===d?void 0:d.error)||(null===(m=t.response)||void 0===m?void 0:null===(u=m.data)||void 0===u?void 0:u.detail)||(null===(h=t.response)||void 0===h?void 0:null===(g=h.data)||void 0===g?void 0:g.message)||"Failed to add item to wishlist";return(null===(p=t.response)||void 0===p?void 0:p.status)===400&&e.includes("already")?o.default.error("Item already in wishlist"):o.default.error(e),null}}async function d(e){try{let t=s.default.get("login_access_token");if(!t)return!1;return await r.default.delete("".concat(i.BASE_URL,"marketplace/wishlist/").concat(e,"/"),{headers:{Authorization:"Bearer ".concat(t),"Content-Type":"application/json"}}),window.dispatchEvent(new CustomEvent("vefogix:wishlist-updated")),!0}catch(e){return console.error("Error removing from wishlist:",e),o.default.error("Failed to remove item from wishlist"),!1}}async function c(e,t){try{let a=s.default.get("login_access_token");if(!a)return console.warn("⚠️ [Wishlist] No auth token - returning false"),{isInWishlist:!1,itemId:null};let o=null!=t?"".concat(i.BASE_URL,"marketplace/wishlist/check/").concat(e,"/?package_id=").concat(t):"".concat(i.BASE_URL,"marketplace/wishlist/check/").concat(e,"/"),l=await r.default.get(o,{headers:{Authorization:"Bearer ".concat(a),"Content-Type":"application/json"}});return{isInWishlist:l.data.is_in_wishlist||!1,itemId:l.data.wishlist_item_id||null}}catch(e){var a,o;return console.error("❌ [Wishlist] Error checking wishlist status:",{error:e.message,status:null===(a=e.response)||void 0===a?void 0:a.status,data:null===(o=e.response)||void 0===o?void 0:o.data}),{isInWishlist:!1,itemId:null}}}async function u(){try{return(await l()).length}catch(e){return console.warn("⚠️ [Wishlist] Error getting wishlist count:",e),0}}}}]);

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.