PageSourceSearch

https://haitipal.com/static/js/76.2c7f1b63.chunk.js

js haitipal.com collected 2026-10-07 03:33:47 UTC 44,462 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[76],{2540(e,t,a){a.d(t,{s:()=>o});var s=a(5043),i=a(2489),l=a(579);const n={1:"#6C6C80",2:"#9AA0B5",3:"#39FF14",4:"#00F0FF",5:"#00F0FF",6:"#FFD700",7:"#FFD700",8:"#FF2A5F",9:"#FF2A5F",10:"#FF4D79",11:"#FF4D79"},o=s.memo(function(e){let t=e.level,a=void 0===t?1:t,s=e.tier,o=e.size,r=void 0===o?"md":o,c=e.showTier,d=void 0!==c&&c;const m=n[a]||"#FFD700",x="sm"===r?"h-6 px-2 text-[11px]":"lg"===r?"h-9 px-3 text-sm":"h-7 px-2.5 text-xs";return(0,l.jsxs)("span",{"data-testid":"level-badge",className:"inline-flex items-center gap-1 rounded-full font-bold ".concat(x),style:{color:m,border:"1px solid ".concat(m,"55"),background:"".concat(m,"1a"),boxShadow:"0 0 12px ".concat(m,"33")},children:[(0,l.jsx)(i.A,{className:"sm"===r?"h-3 w-3":"h-3.5 w-3.5",style:{fill:"".concat(m,"44")}}),"LV",a,d&&s?(0,l.jsxs)("span",{className:"opacity-80 font-medium",children:["\xb7 ",s]}):null]})})},6613(e,t,a){a.d(t,{J:()=>l});const s="native_platform";const i=function(){try{const e=new URLSearchParams(window.location.search).get("native");if(e)return localStorage.setItem(s,e.toLowerCase()),e.toLowerCase();const t=localStorage.getItem(s);if(t)return t;const a=window.Capacitor&&"function"===typeof window.Capacitor.getPlatform?window.Capacitor.getPlatform():null;if("ios"===a||"android"===a)return localStorage.setItem(s,a),a;if(/HaitipalNative/i.test(navigator.userAgent||""))return localStorage.setItem(s,"ios"),"ios"}catch(e){return null}return null}(),l=()=>"ios"===i||"android"===i},1089(e,t,a){a.d(t,{cn:()=>l});var s=a(8387),i=a(9359);function l(){for(var e=arguments.length,t=new Array(e),a=0;a<e;a++)t[a]=arguments[a];return(0,i.QP)((0,s.$)(t))}},1527(e,t,a){a.r(t),a.d(t,{default:()=>re});var s=a(9379),i=a(5544),l=a(5043),n=a(953),o=a(8847),r=a(5684),c=a(5187),d=a(2540),m=a(6328),x=a(6104),u=a(8371),p=a(5727),h=a(2024),f=a(3908),g=a(4830),v=a(5087),w=a(1064),j=a(9855),b=a(614),y=a(4918),N=a(5077),k=a(2574),A=a(5746),F=a(579);function _(e){return e?e.startsWith("http")?e:"".concat("https://haitipal.com").concat(e):e}function C(e){let t=e.targetId,a=e.isSelf,n=e.isGuest;const o=(0,c.A)().user,r=(0,l.useState)([]),d=(0,i.A)(r,2),C=d[0],S=d[1],R=(0,l.useState)(!0),P=(0,i.A)(R,2),D=P[0],T=P[1],E=(0,l.useState)(!1),z=(0,i.A)(E,2),I=z[0],L=z[1],M=(0,l.useState)(!1),Y=(0,i.A)(M,2),V=Y[0],K=Y[1],O=(0,l.useState)(null),B=(0,i.A)(O,2),G=B[0],U=B[1],W=(0,l.useState)(null),J=(0,i.A)(W,2),Z=J[0],X=J[1],q=(0,l.useState)([]),H=(0,i.A)(q,2),$=H[0],Q=H[1],ee=(0,l.useState)(""),te=(0,i.A)(ee,2),ae=te[0],se=te[1],ie=(0,l.useState)(!1),le=(0,i.A)(ie,2),ne=le[0],oe=le[1],re=(0,l.useRef)(null),ce=G?C.find(e=>e.id===G.id)||G:null;(0,l.useEffect)(()=>{null!==ce&&void 0!==ce&&ce.id?(x.Ay.get("/profile/media/".concat(ce.id,"/comments")).then(e=>Q(e.data)).catch(()=>Q([])),se(""),ue(null)):Q([])},[null===ce||void 0===ce?void 0:ce.id]);const de=(0,l.useState)(null),me=(0,i.A)(de,2),xe=me[0],ue=me[1];(0,l.useEffect)(()=>{t&&(T(!0),x.Ay.get("/users/".concat(t,"/media")).then(e=>S(e.data)).catch(()=>S([])).finally(()=>T(!1)))},[t]);const pe=async e=>{if(!e)return;const t=e.type.startsWith("video/"),a=t?26214400:5242880;if(e.size>a)return void m.oR.error(t?"Videyo a tw\xf2 gwo (maks 25MB)":"Foto a tw\xf2 gwo (maks 5MB)");if(t&&!await(e=>new Promise(t=>{if(!e.type.startsWith("video/"))return t(!0);const a=document.createElement("video");a.preload="metadata",a.onloadedmetadata=()=>{window.URL.revokeObjectURL(a.src),t(a.duration<=61)},a.onerror=()=>t(!0),a.src=URL.createObjectURL(e)}))(e))return void m.oR.error("Videyo a dwe kout (maks 60 segond)");const s=new FormData;s.append("file",e),s.append("is_private",V?"true":"false"),L(!0);try{const e=(await x.Ay.post("/profile/media",s,{headers:{"Content-Type":"multipart/form-data"}})).data;S(t=>[e,...t]),m.oR.success("Kontni ajoute!")}catch(n){var i,l;m.oR.error((null===(i=n.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.detail)||"Nou pa ka voye kontni an")}finally{L(!1)}};return(0,F.jsxs)("div",{className:"mt-6 rounded-3xl surface p-6","data-testid":"profile-media-section",children:[(0,F.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[(0,F.jsxs)("h2",{className:"font-display text-2xl font-extrabold",children:["Foto & Videyo ",(0,F.jsxs)("span",{className:"text-sm font-medium text-gray-400",children:["\xb7 ",C.length]})]}),a&&!n&&(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs font-semibold text-gray-300","data-testid":"media-private-toggle",children:[(0,F.jsx)("input",{type:"checkbox",checked:V,onChange:e=>K(e.target.checked),className:"h-4 w-4 accent-[#FF2A5F]"}),(0,F.jsx)(p.A,{className:"h-3.5 w-3.5"})," Prive"]}),(0,F.jsx)("input",{ref:re,type:"file",accept:"image/*,video/mp4,video/webm,video/quicktime",className:"hidden","data-testid":"media-file-input",onChange:e=>{var t;const a=null===(t=e.target.files)||void 0===t?void 0:t[0];e.target.value="",pe(a)}}),(0,F.jsxs)("button",{"data-testid":"media-add-btn",onClick:()=>{var e;return null===(e=re.current)||void 0===e?void 0:e.click()},disabled:I,className:"flex items-center gap-2 rounded-full bg-[#FF2A5F] px-4 py-2 text-sm font-bold text-white transition-transform hover:scale-105 disabled:opacity-60 glow-pink",children:[I?(0,F.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):(0,F.jsx)(f.A,{className:"h-4 w-4"})," Ajoute"]})]})]}),D?(0,F.jsx)("div",{className:"flex items-center justify-center py-10",children:(0,F.jsx)(h.A,{className:"h-7 w-7 animate-spin text-[#FF2A5F]"})}):0===C.length?(0,F.jsx)("p",{className:"mt-6 text-center text-sm text-gray-400","data-testid":"media-empty",children:a?"Ou poko mete okenn foto oswa videyo.":"Pa gen kontni pou moun sa a."}):(0,F.jsx)("div",{className:"mt-4 grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-4","data-testid":"media-grid",children:C.map(e=>{var t,i,l,n;return(0,F.jsxs)("div",{"data-testid":"media-item-".concat(e.id),className:"group relative aspect-square overflow-hidden rounded-2xl surface-2",children:[(0,F.jsx)("button",{onClick:()=>(async e=>{if(U(e),!a)try{const t=(await x.Ay.post("/profile/media/".concat(e.id,"/view"))).data;S(a=>a.map(a=>a.id===e.id?(0,s.A)((0,s.A)({},a),{},{views:t.views}):a))}catch(t){}})(e),className:"h-full w-full","data-testid":"media-open-".concat(e.id),children:"video"===e.kind?(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("video",{src:_(e.url),className:"h-full w-full object-cover",muted:!0,playsInl
1ine:!0,preload:"metadata"}),(0,F.jsx)("span",{className:"absolute inset-0 flex items-center justify-center",children:(0,F.jsx)(g.A,{className:"h-9 w-9 text-white drop-shadow-lg",fill:"white"})})]}):(0,F.jsx)("img",{src:_(e.url),alt:"",className:"h-full w-full object-cover"})}),(0,F.jsxs)("span",{className:"absolute bottom-1.5 left-1.5 flex items-center gap-1 rounded-full bg-black/60 px-2 py-0.5 text-[11px] font-bold text-white","data-testid":"media-views-".concat(e.id),children:[(0,F.jsx)(v.A,{className:"h-3 w-3"})," ",e.views||0]}),((null===(t=e.reactions)||void 0===t?void 0:t["\u2764\ufe0f"])||0)+((null===(i=e.reactions)||void 0===i?void 0:i["\ud83d\udd25"])||0)>0&&(0,F.jsxs)("span",{className:"absolute bottom-1.5 right-1.5 flex items-center gap-1 rounded-full bg-black/60 px-2 py-0.5 text-[11px] font-bold text-white","data-testid":"media-reactions-".concat(e.id),children:[null!==(l=e.reactions)&&void 0!==l&&l["\u2764\ufe0f"]?(0,F.jsxs)("span",{children:["\u2764\ufe0f",e.reactions["\u2764\ufe0f"]]}):null,null!==(n=e.reactions)&&void 0!==n&&n["\ud83d\udd25"]?(0,F.jsxs)("span",{children:["\ud83d\udd25",e.reactions["\ud83d\udd25"]]}):null]}),e.is_private&&(0,F.jsxs)("span",{className:"absolute top-1.5 left-1.5 flex items-center gap-1 rounded-full bg-black/60 px-2 py-0.5 text-[10px] font-bold text-[#FFD700]",children:[(0,F.jsx)(p.A,{className:"h-3 w-3"})," Prive"]}),a&&(0,F.jsxs)("div",{className:"absolute right-1.5 top-1.5 flex gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,F.jsx)("button",{"data-testid":"media-privacy-".concat(e.id),onClick:()=>(async e=>{try{const t=(await x.Ay.post("/profile/media/".concat(e.id,"/privacy"),{is_private:!e.is_private})).data;S(a=>a.map(a=>a.id===e.id?(0,s.A)((0,s.A)({},a),{},{is_private:t.is_private}):a))}catch(t){m.oR.error("Yon er\xe8 rive")}})(e),title:e.is_private?"F\xe8 piblik":"F\xe8 prive",className:"flex h-7 w-7 items-center justify-center rounded-full bg-black/70 text-white hover:bg-black",children:e.is_private?(0,F.jsx)(w.A,{className:"h-3.5 w-3.5"}):(0,F.jsx)(p.A,{className:"h-3.5 w-3.5"})}),(0,F.jsx)("button",{"data-testid":"media-delete-".concat(e.id),onClick:()=>X(e),title:"Efase",className:"flex h-7 w-7 items-center justify-center rounded-full bg-black/70 text-white hover:bg-red-600",children:(0,F.jsx)(j.A,{className:"h-3.5 w-3.5"})})]})]},e.id)})}),ce&&(0,F.jsxs)("div",{className:"fixed inset-0 z-[100] flex flex-col items-center justify-center bg-black/90 p-4","data-testid":"media-lightbox",onClick:()=>U(null),children:[(0,F.jsx)("button",{"data-testid":"media-lightbox-close",className:"absolute right-4 top-4 flex h-10 w-10 items-center justify-center rounded-full bg-white/15 text-white hover:bg-white/25",children:(0,F.jsx)(b.A,{className:"h-5 w-5"})}),(0,F.jsx)("div",{onClick:e=>e.stopPropagation(),className:"max-h-[75vh] max-w-[90vw]",children:"video"===ce.kind?(0,F.jsx)("video",{src:_(ce.url),controls:!0,autoPlay:!0,playsInline:!0,className:"max-h-[75vh] max-w-[90vw] rounded-2xl bg-black","data-testid":"media-lightbox-video"}):(0,F.jsx)("img",{src:_(ce.url),alt:"",className:"max-h-[75vh] max-w-[90vw] rounded-2xl object-contain","data-testid":"media-lightbox-image"})}),(0,F.jsx)("div",{onClick:e=>e.stopPropagation(),className:"mt-4 flex items-center gap-3","data-testid":"media-reaction-bar",children:[{e:"\u2764\ufe0f",icon:y.A,key:"heart"},{e:"\ud83d\udd25",icon:N.A,key:"fire"}].map(e=>{var t;let i=e.e,l=(e.icon,e.key);const n=(ce.my_reactions||[]).includes(i);return(0,F.jsxs)("button",{"data-testid":"media-react-".concat(l),onClick:()=>a?(async e=>{if(ce)try{const t=(await x.Ay.get("/profile/media/".concat(ce.id,"/reactors"))).data;ue({emoji:e,list:t.filter(t=>t.emoji===e)})}catch(i){var t,a;m.oR.error((null===(t=i.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.detail)||"Yon er\xe8 rive")}})(i):(async(e,t)=>{try{const a=(await x.Ay.post("/profile/media/".concat(e.id,"/react"),{emoji:t})).data;S(i=>i.map(i=>{if(i.id!==e.id)return i;const l=new Set(i.my_reactions||[]);return a.reacted?l.add(t):l.delete(t),(0,s.A)((0,s.A)({},i),{},{reactions:a.reactions,my_reactions:Array.from(l)})}))}catch(i){var a,l;m.oR.error((null===(a=i.response)||void 0===a||null===(l=a.data)||void 0===l?void 0:l.detail)||"Yon er\xe8 rive")}})(ce,i),title:a?"W\xe8 ki moun ki reyaji":void 0,className:"flex items-center gap-2 rounded-full px-5 py-2.5 text-base font-bold transition-transform hover:scale-105 ".concat(n?"bg-[#FF2A5F] text-white":"bg-white/10 text-white ring-1 ring-white/15 hover:bg-white/20"),children:[(0,F.jsx)("span",{className:"text-xl",children:i})," ",(null===(t=ce.reactions)||void 0===t?void 0:t[i])||0]},l)})}),xe&&(0,F.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"mt-3 w-full max-w-md rounded-2xl bg-white/5 p-3 ring-1 ring-white/10","data-testid":"reactors-recap",children:[(0,F.jsxs)("div",{className:"mb-2 flex items-center justify-between",children:[(0,F.jsxs)("p",{className:"text-sm font-bold text-white",children:[xe.emoji," ",xe.list.length," moun"]}
1),(0,F.jsx)("button",{"data-testid":"reactors-close",onClick:()=>ue(null),className:"text-gray-400 hover:text-white",children:(0,F.jsx)(b.A,{className:"h-4 w-4"})})]}),0===xe.list.length?(0,F.jsx)("p",{className:"py-2 text-center text-sm text-gray-400",children:"Poko gen moun."}):(0,F.jsx)("div",{className:"max-h-40 space-y-2 overflow-y-auto",children:xe.list.map(e=>(0,F.jsxs)("div",{"data-testid":"reactor-".concat(e.user_id),className:"flex items-center gap-2",children:[(0,F.jsx)("img",{src:e.picture,alt:"",className:"h-6 w-6 rounded-full object-cover"}),(0,F.jsx)("span",{className:"text-sm text-gray-100",children:e.name})]},e.user_id))})]}),(0,F.jsxs)("div",{onClick:e=>e.stopPropagation(),className:"mt-4 flex w-full max-w-md flex-col rounded-2xl bg-white/5 ring-1 ring-white/10","data-testid":"media-comments",children:[(0,F.jsx)("div",{className:"max-h-40 space-y-2 overflow-y-auto p-3",children:0===$.length?(0,F.jsx)("p",{className:"py-2 text-center text-sm text-gray-400",children:"Poko gen k\xf2mant\xe8. Kite premye a!"}):$.map(e=>(0,F.jsxs)("div",{"data-testid":"comment-".concat(e.id),className:"group flex items-start gap-2",children:[(0,F.jsx)("img",{src:e.picture,alt:"",className:"h-6 w-6 rounded-full object-cover"}),(0,F.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,F.jsx)("p",{className:"text-xs font-bold text-white",children:e.name}),(0,F.jsx)("p",{className:"break-words text-sm text-gray-200",children:e.text}),!n&&(0,F.jsxs)("button",{"data-testid":"comment-like-".concat(e.id),onClick:()=>(async e=>{try{const t=(await x.Ay.post("/profile/media/".concat(ce.id,"/comments/").concat(e.id,"/like"))).data;Q(a=>a.map(a=>a.id===e.id?(0,s.A)((0,s.A)({},a),{},{likes:t.likes,liked:t.liked}):a))}catch(i){var t,a;m.oR.error((null===(t=i.response)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.detail)||"Yon er\xe8 rive")}})(e),className:"mt-1 flex items-center gap-1 text-[11px] font-semibold transition-colors ".concat(e.liked?"text-[#FF2A5F]":"text-gray-400 hover:text-[#FF6B93]"),children:[(0,F.jsx)(y.A,{className:"h-3.5 w-3.5",fill:e.liked?"currentColor":"none"})," ",e.likes||0]})]}),(a||e.user_id===(null===o||void 0===o?void 0:o.user_id))&&(0,F.jsx)("button",{"data-testid":"comment-delete-".concat(e.id),onClick:()=>(async e=>{try{await x.Ay.delete("/profile/media/".concat(ce.id,"/comments/").concat(e.id)),Q(t=>t.filter(t=>t.id!==e.id))}catch(t){m.oR.error("Yon er\xe8 rive")}})(e),title:"Efase",className:"shrink-0 text-gray-500 opacity-0 transition-opacity hover:text-red-400 group-hover:opacity-100",children:(0,F.jsx)(j.A,{className:"h-3.5 w-3.5"})})]},e.id))}),!n&&(0,F.jsxs)("form",{onSubmit:e=>{e.preventDefault(),(async()=>{const t=ae.trim();if(t&&ce){oe(!0);try{const e=(await x.Ay.post("/profile/media/".concat(ce.id,"/comments"),{text:t})).data;Q(t=>[...t,e]),se("")}catch(e){var a,s;m.oR.error((null===(a=e.response)||void 0===a||null===(s=a.data)||void 0===s?void 0:s.detail)||"Yon er\xe8 rive")}finally{oe(!1)}}})()},className:"flex items-center gap-2 border-t border-white/10 p-2",children:[(0,F.jsx)(k.A,{className:"ml-1 h-4 w-4 shrink-0 text-gray-400"}),(0,F.jsx)("input",{"data-testid":"comment-input",value:ae,onChange:e=>se(e.target.value.slice(0,300)),placeholder:"Ekri yon k\xf2mant\xe8\u2026",className:"min-w-0 flex-1 bg-transparent text-sm text-white placeholder:text-gray-500 outline-none"}),(0,F.jsx)("button",{type:"submit","data-testid":"comment-submit-btn",disabled:ne||!ae.trim(),className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-[#FF2A5F] text-white transition-transform hover:scale-105 disabled:opacity-40",children:ne?(0,F.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):(0,F.jsx)(A.A,{className:"h-4 w-4"})})]})]})]}),(0,F.jsx)(u.T,{open:!!Z,onOpenChange:e=>{e||X(null)},title:"Efase kontni an?",description:"Foto oswa videyo sa a ap dispar\xe8t n\xe8t. Ou p ap ka retabli l.",confirmLabel:"Efase",onConfirm:()=>{Z&&(async e=>{try{await x.Ay.delete("/profile/media/".concat(e.id)),S(t=>t.filter(t=>t.id!==e.id))}catch(t){m.oR.error("Yon er\xe8 rive")}})(Z),X(null)}})]})}var S=a(879),R=a(7118),P=a(8502);function D(e){let t=e.userId,a=e.mode,s=e.onClose,n=e.onOpenProfile;const o=(0,l.useState)([]),r=(0,i.A)(o,2),c=r[0],d=r[1],m=(0,l.useState)(!0),u=(0,i.A)(m,2),p=u[0],f=u[1],g=(0,P.X)().openAvatar,v="followers"===a?"Swiv\xe8":"Ap swiv";(0,l.useEffect)(()=>{f(!0),x.Ay.get("/users/".concat(t,"/").concat("followers"===a?"followers":"following")).then(e=>d(e.data||[])).catch(()=>d([])).finally(()=>f(!1))},[t,a]);return(0,F.jsx)("div",{"data-testid":"follow-list-modal",className:"fixed inset-0 z-[80] flex items-end justify-center bg-black/70 backdrop-blur-sm sm:items-center",onClick:s,children:(0,F.jsxs)("div",{className:"w-full max-w-md overflow-hidden rounded-t-3xl border border-white/10 bg-[#0e0e16] [html.light_&]:bg-[#e9edf4] sm:rounded-3xl",onClick:e=>e.stopPropagation(),children:[(0,F.jsxs)("div",{className:"flex items-center justify-between border-b border-white/10 px-5 py-4",children:[(0,F.jsxs)("h2",{className:"flex items-center gap-2 font-display text-xl font-extrabold text-white",children:[(0,F.jsx)(R.A,{className:"h-5 w-5 text-[#00F0FF]"})," ",v]}),(0,F.jsx)("button",{"data-testid":"follow-list-close",onClick:s,className:"text-gray-400 hover:text-white",children:(0,F.jsx)(b.A,{className:"h-5 w-5"})})]}),(0,F.jsx)("div",{className:"max-h-[60vh] overflow-y-auto p-3",children:p?(0,F.jsx)("div",{className:"py-8 text-center",children:(0,F.jsx)(h.A,{className:"mx-auto h-6 w-6 animate-spin text-[#FF2A5F]"})}):0===c.length?(0,F.jsx)("p",{className:"py-8 text-center text-sm text-gray-500","data-testid":"follow-list-empty",children:"followers"===a?"Poko gen swiv\xe8.":"Poko ap swiv p\xe8s\xf2n."}):(0,F.jsx)("div",{className:"space-y-1.5",children:c.map(e=>(0,F.jsxs)("button",{"data-testid":"follow-list-item-".concat(e.user_id),onClick:()=>{return t=e.user_id,s(),void(n&&n(t));var t},className:"flex w-full items-center gap-3 rounded-2xl p-2.5 text-left transition-colors hover:bg-white/5",children:[(0,F.jsx)("img",{src:e.picture||"/haitipal-logo.png",alt:e.name,"data-testid":"follow-list-avatar-".concat(e.user_id),onClick:t=>{t.stopPropagation(),e.picture&&g(e.picture,e.name)},className:"h-11 w-11 cursor-pointer rounded-full object-cover ring-2 ring-white/10 transition-transform hover:scale-110"}),(0,F.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,F.jsx)("p",{className:"truncate font-bold text-white",children:e.name}),e.username&&(0,F.jsxs)("p",{className:"truncate text-xs text-gray-400",children:["@",e.username]})]})]},e.user_id))})})]})})}var T=a(6613),E=a(2489),z=a(9432),I=a(9169),L=a(5937),M=a(9757),Y=a(247),V=a(2629),K=a(8800),O=a(254),B=a(1884),G=a(6099),U=a(3946),W=a(9586),J=a(9292),Z=a(8693),X=a(3944),q=a(1622),H=a(6608),$=a(764),Q=a(1286),ee=a(7719);const te={shield:E.A,coins:z.A,gem:I.A,heart:y.A,flame:N.A},ae=[{v:"selibat\xe8",l:"Selibat\xe8"},{v:"nan yon relasyon",l:"Nan yon relasyon"},{v:"marye",l:"Marye"},{v:"div\xf2se",l:"Div\xf2se"},{v:"v\xe8f",l:"V\xe8f"}],se=[{v:"gason",l:"Gason"},{v:"fanm",l:"Fanm"},{v:"l\xf2t",l:"L\xf2t"}],ie=[{v:"fanm",l:"Fanm"},{v:"gason",l:"Gason"},{v:"tou de",l:"Tou de"}],le=(e,t)=>
1{var a;return(null===(a=e.find(e=>e.v===t))||void 0===a?void 0:a.l)||""};function ne(e){let t=e.icon,a=e.label,s=e.value,i=e.color;return(0,F.jsxs)("div",{className:"rounded-2xl surface-2 p-4",children:[(0,F.jsxs)("div",{className:"flex items-center gap-2 text-xs uppercase tracking-widest text-gray-400",children:[t," ",a]}),(0,F.jsx)("p",{className:"mt-2 font-display text-3xl font-black",style:{color:i},children:s})]})}function oe(e){let t=e.sl,a=e.onJoin;const s=(0,l.useState)(Date.now()),n=(0,i.A)(s,2),o=n[0],r=n[1];(0,l.useEffect)(()=>{const e=setInterval(()=>r(Date.now()),1e3);return()=>clearInterval(e)},[]);const c=Math.max(0,new Date(t.scheduled_at).getTime()-o),d=c<=0,m=Math.floor(c/864e5),x=Math.floor(c%864e5/36e5),u=Math.floor(c%36e5/6e4),p=Math.floor(c%6e4/1e3),h=m>0?"".concat(m,"j ").concat(x,"\xe8 ").concat(u,"m"):x>0?"".concat(x,"\xe8 ").concat(u,"m ").concat(p,"s"):"".concat(u,"m ").concat(p,"s");return(0,F.jsxs)("div",{"data-testid":"scheduled-live-badge",className:"mt-2 flex flex-wrap items-center gap-2 rounded-2xl border border-[#00F0FF]/30 bg-[#00A8CC]/10 px-3 py-2",children:[(0,F.jsx)(L.A,{className:"h-4 w-4 shrink-0 text-[#00F0FF]"}),(0,F.jsx)("span",{className:"text-sm font-bold text-white",children:t.title||"Dir\xe8k pwograme"}),d?(0,F.jsxs)("button",{onClick:a,"data-testid":"scheduled-live-join",className:"inline-flex items-center gap-1 rounded-full bg-[#FF2A5F] px-3 py-1 text-xs font-bold text-white transition-transform hover:scale-105",children:[(0,F.jsx)(M.A,{className:"h-3.5 w-3.5"})," Antre"]}):(0,F.jsx)("span",{className:"rounded-full bg-[#00F0FF]/15 px-2 py-0.5 text-sm font-black tabular-nums text-[#00F0FF]","data-testid":"scheduled-live-countdown",children:h}),(0,F.jsx)("span",{className:"text-[11px] text-gray-400",children:t.when_label})]})}function re(e){let t=e.overrideUserId;const a=(0,n.g)().userId,u=(0,c.A)(),p=u.user,f=u.setUser,g=u.logout,v=(0,n.Zp)(),w=(0,o.e)().openOverlay,b=(0,P.X)().openAvatar,N=t||a||(null===p||void 0===p?void 0:p.user_id),k=(0,l.useState)(null),_=(0,i.A)(k,2),R=_[0],z=_[1],I=(0,l.useState)(!0),L=(0,i.A)(I,2),M=L[0],re=L[1],ce=(0,l.useState)(!1),de=(0,i.A)(ce,2),me=de[0],xe=de[1],ue=(0,l.useState)(!1),pe=(0,i.A)(ue,2),he=pe[0],fe=pe[1],ge=(0,l.useState)(!1),ve=(0,i.A)(ge,2),we=ve[0],je=ve[1],be=(0,l.useState)(!1),ye=(0,i.A)(be,2),Ne=ye[0],ke=ye[1],Ae=(0,l.useState)({followers:0,following:0}),Fe=(0,i.A)(Ae,2),_e=Fe[0],Ce=Fe[1],Se=(0,l.useState)(null),Re=(0,i.A)(Se,2),Pe=Re[0],De=Re[1],Te=(0,l.useState)(""),Ee=(0,i.A)(Te,2),ze=Ee[0],Ie=Ee[1],Le=(0,l.useState)(!1),Me=(0,i.A)(Le,2),Ye=Me[0],Ve=Me[1],Ke=(0,l.useState)(!1),Oe=(0,i.A)(Ke,2),Be=Oe[0],Ge=Oe[1],Ue=(0,l.useState)([]),We=(0,i.A)(Ue,2),Je=We[0],Ze=We[1],Xe=(0,l.useRef)(null),qe=(0,l.useState)({marital_status:"",gender:"",looking:!1,looking_pref:""}),He=(0,i.A)(qe,2),$e=He[0],Qe=He[1],et=(0,l.useState)(!1),tt=(0,i.A)(et,2),at=tt[0],st=tt[1],it=(0,l.useState)(null),lt=(0,i.A)(it,2),nt=lt[0],ot=lt[1],rt=(0,l.useState)(!1),ct=(0,i.A)(rt,2),dt=ct[0],mt=ct[1],xt=(0,l.useState)(!1),ut=(0,i.A)(xt,2),pt=ut[0],ht=ut[1],ft=(0,l.useState)(!1),gt=(0,i.A)(ft,2),vt=gt[0],wt=gt[1],jt=()=>{x.Ay.get("/tiktok/status").then(e=>ot(e.data)).catch(()=>ot(null))};(0,l.useEffect)(()=>{if(t)return;jt();const e=new URLSearchParams(window.location.search).get("tiktok");"connected"===e?(m.oR.success("Kont TikTok ou konekte! \ud83c\udfb5"),window.history.replaceState({},"",window.location.pathname)):"error"===e&&(m.oR.error("Koneksyon TikTok la echwe. Eseye ank\xf2."),window.history.replaceState({},"",window.location.pathname))},[t]);(0,l.useEffect)(()=>{N&&(re(!0),x.Ay.get("/users/".concat(N,"/profile")).then(e=>{z(e.data),xe(!!e.data.is_friend),Ie(e.data.ppv_bio||""),je(!!e.data.is_following),Ce({followers:e.data.followers||0,following:e.data.following||0}),Qe({marital_status:e.data.marital_status||"",gender:e.data.gender||"",looking:!!e.data.looking,looking_pref:e.data.looking_pref||""})}).catch(()=>z(null)).finally(()=>re(!1)),x.Ay.get("/ads/user/".concat(N)).then(e=>Ze(e.data||[])).catch(()=>Ze([])))},[N]);if(M)return(0,F.jsx)(r.G,{children:(0,F.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center",children:(0,F.jsx)(h.A,{className:"h-10 w-10 animate-spin text-[#FF2A5F]"})})});if(!R)return(0,F.jsx)(r.G,{children:(0,F.jsx)("p",{className:"text-center text-gray-400",children:"Nou pa jwenn pwofil la."})});const bt=R.member_since?new Date(R.member_since).toLocaleDateString(void 0,{year:"numeric",month:"short",timeZone:"America/Ne
1w_York"}):"\u2014",yt=R.badges.filter(e=>e.earned);return(0,F.jsxs)(r.G,{children:[(0,F.jsxs)("div",{className:"relative overflow-hidden rounded-3xl surface","data-testid":"profile-hero",children:[(0,F.jsx)("img",{src:"https://images.pexels.com/photos/6066572/pexels-photo-6066572.jpeg?auto=compress&cs=tinysrgb&dpr=2&h=650&w=940",alt:"",className:"absolute inset-0 h-40 w-full object-cover opacity-40"}),(0,F.jsx)("div",{className:"absolute inset-x-0 top-0 h-40 bg-gradient-to-b from-transparent to-[#12121A]"}),(0,F.jsxs)("div",{className:"relative z-10 flex flex-col items-start gap-4 p-6 pt-20 sm:flex-row sm:items-end sm:p-8 sm:pt-24",children:[(0,F.jsxs)("div",{className:"relative",children:[(0,F.jsx)("img",{src:R.picture,alt:R.name,onClick:()=>R.picture&&b(R.picture,R.name),className:"h-28 w-28 cursor-pointer rounded-3xl object-cover ring-4 ring-[#12121A] transition-transform hover:scale-105","data-testid":"profile-avatar"}),R.is_self&&(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)("input",{ref:Xe,type:"file",accept:"image/*",className:"hidden","data-testid":"avatar-file-input",onChange:e=>{var t;const a=null===(t=e.target.files)||void 0===t?void 0:t[0];e.target.value="",(async t=>{if(!t)return;if(!t.type.startsWith("image/"))return void m.oR.error("S\xe8lman imaj");if(t.size>5242880)return void m.oR.error("Imaj la tw\xf2 gwo (maks 5MB)");const a=new FormData;a.append("file",t),Ge(!0);try{const e=(await x.Ay.post("/profile/avatar",a,{headers:{"Content-Type":"multipart/form-data"}})).data;f(t=>t?(0,s.A)((0,s.A)({},t),{},{picture:e.picture}):t),z(t=>t?(0,s.A)((0,s.A)({},t),{},{picture:e.picture}):t),m.oR.success("Foto pwofil ou chanje!")}catch(e){var i,l;m.oR.error((null===(i=e.response)||void 0===i||null===(l=i.data)||void 0===l?void 0:l.detail)||"Nou pa ka chanje foto a")}finally{Ge(!1)}})(a)}}),(0,F.jsx)("button",{"data-testid":"avatar-edit-btn",onClick:()=>{var e;return null===(e=Xe.current)||void 0===e?void 0:e.click()},disabled:Be,title:"Chanje foto pwofil",className:"absolute -bottom-2 -right-2 flex h-10 w-10 items-center justify-center rounded-full bg-[#FF2A5F] text-white ring-4 ring-[#12121A] transition-transform hover:scale-110 disabled:opacity-60",children:Be?(0,F.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):(0,F.jsx)(Y.A,{className:"h-4 w-4"})})]})]}),(0,F.jsxs)("div",{className:"flex-1",children:[(0,F.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,F.jsxs)("h1",{className:"flex items-center gap-2 font-display text-3xl font-black ".concat(R.is_vip?"text-[#FFD700] drop-shadow-[0_0_8px_rgba(255,215,0,0.5)]":""),"data-testid":"profile-name",children:[R.is_vip&&(0,F.jsx)(V.A,{className:"h-7 w-7 text-[#FFD700]","data-testid":"vip-crown-profile"}),R.name]}),(0,F.jsx)(d.s,{level:R.level,tier:R.tier,size:"lg",showTier:!0}),R.is_vip&&(0,F.jsxs)("span",{"data-testid":"vip-badge-profile",className:"flex items-center gap-1 rounded-full bg-[#FFD700] px-2.5 py-1 text-[11px] font-black uppercase text-black",children:[(0,F.jsx)(V.A,{className:"h-3 w-3"})," VIP"]}),R.is_admin&&(0,F.jsx)("span",{className:"rounded-full bg-[#FF2A5F] px-2.5 py-1 text-[11px] font-bold uppercase",children:"Admin"})]}),(0,F.jsxs)("p",{className:"mt-1 flex items-center gap-2 text-sm text-gray-400",children:[(0,F.jsx)(K.A,{className:"h-4 w-4"})," Manm depi ",bt]}),(0,F.jsxs)("div",{className:"mt-2 flex items-center gap-4","data-testid":"follow-counts",children:[(0,F.jsxs)("button",{onClick:()=>De("followers"),"data-testid":"open-followers-btn",className:"text-sm text-gray-300 transition-colors hover:text-white",children:[(0,F.jsx)("span",{className:"font-black text-white","data-testid":"followers-count",children:_e.followers})," ",(0,F.jsx)("span",{className:"text-gray-400",children:"Swiv\xe8"})]}),(0,F.jsxs)("button",{onClick:()=>De("following"),"data-testid":"open-following-btn",className:"text-sm text-gray-300 transition-colors hover:text-white",children:[(0,F.jsx)("span",{className:"font-black text-white","data-testid":"following-count",children:_e.following})," ",(0,F.jsx)("span",{className:"text-gray-400",children:"Ap swiv"})]})]}),R.next_scheduled_live&&(0,F.jsx)(oe,{sl:R.next_scheduled_live,onJoin:()=>v("/room/".concat(R.next_scheduled_live.room))})]}),R.is_self?(0,T.J)()?null:(0,F.jsx)("button",{onClick:()=>w("wallet"),className:"rounded-full bg-[#FF2A5F] px-5 py-2.5 text-sm font-bold text-white transition-transform hover:scale-105 glow-pink",children:"Achte jeton"}):(0,F.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row",children:[(0,F.jsxs)("button",{"data-testid":"follow-toggle-btn",onClick:async()=>{ke(!0);try{if(we){const e=(await x.Ay.delete("/users/".concat(N,"/follow"))).data;je(!1),Ce(t=>{var a;return(0,s.A)((0,s.A)({},t),{},{followers:null!==(a=e.followers)&&void 0!==a?a:Math.max(0,t.followers-1)})})}else{const e=(await x.Ay.post("/users/".concat(N,"/follow"))).data;je(!0),Ce(t=>{var a;return(0,s.A)((0,s.A)({},t),{},{followers:null!==(a=e.followers)&&void 0!==a?a:t.followers+1})}),m.oR.success("Ou ap swiv ".concat(R.name," kounye a! \ud83d\udd14"))}}catch(a){var e,t;m.oR.error((null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Yon er\xe8 rive")}finally{ke(!1)}},disabled:Ne,className:"flex items-center justify-center gap-2 rounded-full px-5 py-2.5 text-sm font-bold transition-transform hover:scale-105 disabled:opacity-60 ".concat(we?"surface-2 text-white ring-1 ring-white/15":"bg-[#FF2A5F] text-white glow-pink"),children:[Ne?(0,F.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):we?(0,F.jsx)(O.A,{className:"h-4 w-4"}):(0,F.jsx)(B.A,{className:"h-4 w-4"}),we?"Ap swiv":"Swiv"]}),(0,F.jsxs)("button",{"data-testid":"friend-toggle-btn",onClick:async()=>{fe(!0);try{me?(await x.Ay.delete("/friends/".concat(N)),xe(!1),m.oR.success("".concat(R.name," retire nan zanmi ou"))):(await x.Ay.post("/friends/".concat(N)),xe(!0),m.oR.success("".concat(R.name," ajoute k\xf2m zanmi! \ud83c\udf89")))}catch(a){var e,t;m.oR.error((null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Yon er\xe8 rive")}finally{fe(!1)}},disabled:he,className:"flex items-center justify-center gap-2 rounded-full px-5 py-2.5 text-sm font-bold transition-transform hover:scale-105 disabled:opacity-60 ".concat(me?"surface-2 text-white ring-1 ring-white/15":"bg-[#00A8CC] text-white"),children:[he?(0,F.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):me?(0,F.jsx)(O.A,{className:"h-4 w-4"}):(0,F.jsx)(B.A,{className:"h-4 w-4"}),me?"Zanmi":"Ajoute zanmi"]}
1)]})]})]}),(0,F.jsxs)("div",{className:"mt-6 grid grid-cols-2 gap-4 lg:grid-cols-4",children:[(0,F.jsx)(ne,{icon:(0,F.jsx)(G.A,{className:"h-4 w-4 text-cyan-400"}),label:"Pwen",value:R.points,color:"#00F0FF"}),(0,F.jsx)(ne,{icon:(0,F.jsx)(A.A,{className:"h-4 w-4 text-[#FF2A5F]"}),label:"Bay",value:R.gifts_sent_tokens,color:"#FF2A5F"}),(0,F.jsx)(ne,{icon:(0,F.jsx)(U.A,{className:"h-4 w-4 text-yellow-400"}),label:"Resevwa",value:R.gifts_received_tokens,color:"#FFD700"}),(0,F.jsx)(ne,{icon:(0,F.jsx)(y.A,{className:"h-4 w-4 text-[#FF4D79]"}),label:"Kado resevwa",value:R.gifts_received_count,color:"#FF4D79"})]}),R.is_self?(0,F.jsxs)("div",{className:"mt-6 rounded-3xl surface p-6","data-testid":"social-editor",children:[(0,F.jsxs)("h2",{className:"flex items-center gap-2 font-display text-xl font-bold",children:[(0,F.jsx)(W.A,{className:"h-5 w-5 text-[#FF4D79]"})," Estati sosyal"]}),(0,F.jsxs)("div",{className:"mt-4 grid gap-4 sm:grid-cols-2",children:[(0,F.jsxs)("div",{children:[(0,F.jsx)("label",{className:"text-xs font-semibold uppercase tracking-widest text-gray-400",children:"Estati"}),(0,F.jsxs)("select",{"data-testid":"marital-select",value:$e.marital_status,onChange:e=>Qe(t=>(0,s.A)((0,s.A)({},t),{},{marital_status:e.target.value})),className:"mt-1.5 w-full rounded-xl surface-2 p-3 text-sm text-white outline-none ring-1 ring-white/10 focus:ring-2 focus:ring-[#FF2A5F]/50",children:[(0,F.jsx)("option",{value:"",children:"\u2014 Chwazi \u2014"}),ae.map(e=>(0,F.jsx)("option",{value:e.v,children:e.l},e.v))]})]}),(0,F.jsxs)("div",{children:[(0,F.jsx)("label",{className:"text-xs font-semibold uppercase tracking-widest text-gray-400",children:"S\xe8ks"}),(0,F.jsxs)("select",{"data-testid":"gender-select",value:$e.gender,onChange:e=>Qe(t=>(0,s.A)((0,s.A)({},t),{},{gender:e.target.value})),className:"mt-1.5 w-full rounded-xl surface-2 p-3 text-sm text-white outline-none ring-1 ring-white/10 focus:ring-2 focus:ring-[#FF2A5F]/50",children:[(0,F.jsx)("option",{value:"",children:"\u2014 Chwazi \u2014"}),se.map(e=>(0,F.jsx)("option",{value:e.v,children:e.l},e.v))]})]})]}),(0,F.jsxs)("label",{className:"mt-4 flex cursor-pointer items-center gap-2 text-sm font-semibold text-gray-200","data-testid":"looking-toggle",children:[(0,F.jsx)("input",{type:"checkbox",checked:$e.looking,onChange:e=>Qe(t=>(0,s.A)((0,s.A)({},t),{},{looking:e.target.checked})),className:"h-4 w-4 accent-[#FF2A5F]"}),(0,F.jsx)(J.A,{className:"h-4 w-4 text-[#00A8CC]"})," M ap ch\xe8che yon moun"]}),$e.looking&&(0,F.jsxs)("div",{className:"mt-3",children:[(0,F.jsx)("label",{className:"text-xs font-semibold uppercase tracking-widest text-gray-400",children:"M ap ch\xe8che"}),(0,F.jsxs)("select",{"data-testid":"looking-pref-select",value:$e.looking_pref,onChange:e=>Qe(t=>(0,s.A)((0,s.A)({},t),{},{looking_pref:e.target.value})),className:"mt-1.5 w-full rounded-xl surface-2 p-3 text-sm text-white outline-none ring-1 ring-white/10 focus:ring-2 focus:ring-[#FF2A5F]/50 sm:w-1/2",children:[(0,F.jsx)("option",{value:"",children:"\u2014 Chwazi \u2014"}),ie.map(e=>(0,F.jsx)("option",{value:e.v,children:e.l},e.v))]})]}),(0,F.jsx)("div",{className:"mt-4 flex justify-end",children:(0,F.jsxs)("button",{"data-testid":"social-save-btn",onClick:async()=>{st(!0);try{const e=(await x.Ay.post("/profile/social",$e)).data;f(t=>t?(0,s.A)((0,s.A)({},t),e):t),z(t=>t?(0,s.A)((0,s.A)({},t),e):t),m.oR.success("Enf\xf2masyon anrejistre!")}catch(a){var e,t;m.oR.error((null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Yon er\xe8 rive")}finally{st(!1)}},disabled:at,className:"flex items-center gap-1.5 rounded-full bg-[#FF2A5F] px-4 py-2 text-sm font-bold text-white transition-transform hover:scale-105 disabled:opacity-60 glow-pink",children:[at?(0,F.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):(0,F.jsx)(Z.A,{className:"h-4 w-4"})," Anrejistre"]})})]}):R.marital_status||R.looking?(0,F.jsxs)("div",{className:"mt-6 rounded-3xl surface p-6","data-testid":"social-view",children:[(0,F.jsxs)("h2",{className:"flex items-center gap-2 font-display text-lg font-bold",children:[(0,F.jsx)(W.A,{className:"h-5 w-5 text-[#FF4D79]"})," Estati sosyal"]}),(0,F.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[R.marital_status&&(0,F.jsx)("span",{className:"rounded-full bg-white/10 px-3 py-1.5 text-sm font-semibold text-white",children:le(ae,R.marital_status)}),R.gender&&(0,F.jsx)("span",{className:"rounded-full bg-white/10 px-3 py-1.5 text-sm font-semibold text-white",children:le(se,R.gender)}),R.looking&&(0,F.jsxs)("span",{className:"rounded-full bg-[#FF2A5F]/20 px-3 py-1.5 text-sm font-semibold text-[#FF6B93]",children:["\ud83d\udc98 K ap ch\xe8che",R.looking_pref?" \xb7 ".concat(le(ie,R.looking_pref)):""]})]})]}):null,R.is_self&&R.is_performer&&(0,F.jsxs)("div",{className:"mt-6 rounded-3xl border border-[#FFD700]/30 bg-[#FFD700]/5 p-6","data-testid":"ppv-bio-editor",children:[(0,F.jsxs)("h2",{className:"flex items-center gap-2 font-display text-xl font-bold text-[#FFD700]",children:[(0,F.jsx)(X.A,{className:"h-5 w-5"})," Bio PPV ou"]}),(0,F.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Ekri yon ti deskripsyon vizit\xe8 yo ap w\xe8 anvan yo k\xf2manse yon chat prive PPV av\xe8 w (20 jeton/min)."}),(0,F.jsx)("textarea",{"data-testid":"ppv-bio-input",value:ze,onChange:e=>Ie(e.target.value.slice(0,200)),rows:3,maxLength:200,placeholder:"Egz: Chante, kons\xe8y, oswa senpleman pale ak mwen an prive\u2026",className:"mt-3 w-full rounded-2xl surface-2 p-3 text-sm text-white outline-none ring-1 ring-white/10 focus:ring-2 focus:ring-[#FFD700]/50"}),(0,F.jsxs)("div",{className:"mt-2 flex items-center justify-between",children:[(0,F.jsxs)("span",{className:"text-xs text-gray-500",children:[ze.length,"/200"]}),(0,F.jsxs)("button",{"data-testid":"ppv-bio-save-btn",onClick:async()=>{Ve(!0);try{const e=(await x.Ay.post("/ppv/bio",{bio:ze})).data;f(t=>t?(0,s.A)((0,s.A)({},t),{},{ppv_bio:e.ppv_bio}):t),z(t=>t?(0,s.A)((0,s.A)({},t),{},{ppv_bio:e.ppv_bio}):t),m.oR.success("Bio PPV anrejistre!")}catch(a){var e,t;m.oR.error((null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Yon er\xe8 rive")}finally{Ve(!1)}},disabled:Ye,className:"flex items-center gap-1.5 rounded-full bg-[#FFD700] px-4 py-2 text-sm font-bold text-black transition-transform hover:scale-105 disabled:opacity-60",children:[Ye?(0,F.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):(0,F.jsx)(Z.A,{className:"h-4 w-4"})," Anrejistre"]})]})]}),!R.is_self&&R.is_performer&&R.ppv_bio&&(0,F.jsxs)("div",{className:"mt-6 rounded-3xl border border-[#FFD700]/30 bg-[#FFD700]/5 p-6","data-testid":"ppv-bio-view",children:[(0,F.jsxs)("h2",{className:"flex items-center gap-2 font-display text-lg font-bold text-[#FFD700]",children:[(0,F.jsx)(X.A,{className:"h-5 w-5"})," P\xe8f\xf2m\xe8 PPV"]}),(0,F.jsx)("p",{className:"mt-2 text-sm text-gray-200",children:R.ppv_bio})]}),R.is_self&&(null===nt||void 0===nt?void 0:nt.configured)&&(0,F.jsxs)("div",{className:"mt-6 rounded-3xl border border-white/10 surface-2 p-6","data-testid":"tiktok-panel",children:[(0,F.jsxs)("h2",{className:"flex items-center gap-2 font-display text-lg font-bold text-white",children:[(0,F.jsx)(q.A,{className:"h-5 w-5"})," TikTok"]}),nt.connected?(0,F.jsxs)("div",{className:"mt-3",children:[(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[nt.avatar&&(0,F.jsx)("img",{src:nt.avatar,alt:"",className:"h-10 w-10 rounded-full object-cover ring-1 ring-white/15"}),(0,F.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,F.jsxs)("p",{className:"text-sm font-bold text-white",children:["Konekte",nt.display_name?" \xb7 ".concat(nt.display_name):""]}),(0,F.jsx)("p",{className:"text-[11px] text-gray-500",children:"Ou ka pataje rezilta JeniPal ak videyo sou TikTok."})]})]}),(0,F.jsx)("button",{"data-testid":"tiktok-disconnect-btn",onClick:async()=>{mt(!0);try{await x.Ay.post("/tiktok/disconnect"),m.oR.info("TikTok dekonekte"),jt()}catch(e){m.oR.error("Er\xe8")}finally{mt(!1)}},disabled:dt,className:"mt-3 h-10 w-full rounded-full bg-red-500/15 text-sm font-bold text-red-400 hover:bg-red-500/25 disabled:opacity-60",children:dt?"\u2026":"Dekonekte TikTok"})]}):(0,F.jsxs)("div",{className:"mt-3",children:[(0,F.jsx)("p",{className:"mb-3 text-sm text-gray-400",children:"Konekte kont TikTok ou pou w pataje moman HAITIPAL yo dir\xe8kteman sou TikTok."}),(0,F.jsx)("button",{"data-testid":"tiktok-connect-profile-btn",onClick:async()=>{mt(!0);try{const e=(await x.Ay.get("/tiktok/oauth/start")).data;window.location.assign(e.authorize_url)}catch(a){var e,t;m.oR.error((null===a||void 0===a||null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Nou pa ka konekte TikTok"),mt(!1)}},disabled:dt,className:"flex h-11 w-full items-center justify-center gap-2 rounded-full bg-white text-sm font-black uppercase tracking-wide text-black transition-transform hover:scale-[1.02] disabled:opacity-60",children:dt?(0,F.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(q.A,{className:"h-4 w-4"})," Konekte TikTok"]})})]})]}),(0,F.jsx)(S.X$,{targetId:N,isSelf:R.is_self,isGuest:R.is_guest}),(0,F.jsx)(C,{targetId:N,isSelf:R.is_self,isGuest:R.is_guest}),Je.length>0&&(0,F.jsxs)("div",{className:"mt-6 rounded-3xl border border-[#FF2A5F]/30 bg-[#FF2A5F]/5 p-6","data-testid":"profile-ads",children:[(0,F.jsxs)("h2",{className:"flex items-center gap-2 font-display text-lg font-bold text-[#FF2A5F]",children:[(0,F.jsx)(H.A,{className:"h-5 w-5"})," Piblisite"]}),(0,F.jsx)("div",{className:"mt-4 grid gap-4 sm:grid-cols-2",children:Je.map(e=>(0,F.jsxs)("div",{"data-testid":"profile-ad-".concat(e.id),className:"overflow-hidden rounded-2xl border border-white/10 bg-white/5",children:[e.image_url&&(0,F.jsx)("img",{src:"".concat("https://haitipal.com").concat(e.image_url),alt:"",className:"max-h-40 w-full object-cover"}),(0,F.jsxs)("div",{className:"p-3",children:[(0,F.jsx)("p",{className:"text-sm font-semibold text-white",children:e.text}),(0,F.jsxs)("div",{className:"mt-1.5 flex flex-wrap items-center gap-3",children:[e.link_url&&(0,F.jsxs)("a",{href:e.link_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs font-bold text-[#00A8CC] hover:underline",children:[(0,F.jsx)($.A,{className:"h-3.5 w-3.5"})," Vizite"]}),e.phone&&(0,F.jsxs)("a",{href:"tel:".concat(e.phone),className:"inline-flex items-center gap-1 text-xs font-bold text-[#00A8CC] hover:underline",children:[(0,F.jsx)(Q.A,{className:"h-3.5 w-3.5"})," ",e.phone]}
1)]})]})]},e.id))})]}),(0,F.jsxs)("div",{className:"mt-6 rounded-3xl surface p-6",children:[(0,F.jsxs)("h2",{className:"font-display text-2xl font-extrabold",children:["Meday ",(0,F.jsxs)("span",{className:"text-sm font-medium text-gray-400",children:["\xb7 ",yt.length," genyen"]})]}),(0,F.jsx)("div",{className:"mt-4 grid grid-cols-2 gap-3 sm:grid-cols-3 lg:grid-cols-5","data-testid":"badges-grid",children:R.badges.map(e=>{const t=te[e.icon]||E.A;return(0,F.jsxs)("div",{"data-testid":"badge-".concat(e.id),className:"flex flex-col items-center gap-2 rounded-2xl border p-4 text-center transition-transform ".concat(e.earned?"border-white/10 hover:-translate-y-1":"border-white/5 opacity-35"),style:e.earned?{background:"".concat(e.color,"12"),boxShadow:"0 0 18px ".concat(e.color,"22")}:{},children:[(0,F.jsx)(t,{className:"h-8 w-8",style:{color:e.earned?e.color:"#6C6C80"}}),(0,F.jsx)("p",{className:"text-sm font-bold",children:e.label}),(0,F.jsx)("p",{className:"text-[11px] text-gray-400",children:e.desc})]},e.id)})})]}),R.is_self&&!R.is_guest&&!(null!==p&&void 0!==p&&p.is_admin||"admin"===(null===p||void 0===p?void 0:p.role))&&(0,F.jsxs)("div",{className:"mt-6 rounded-3xl border border-red-500/25 bg-red-500/5 p-6","data-testid":"account-danger-zone",children:[(0,F.jsxs)("h2",{className:"flex items-center gap-2 font-display text-lg font-bold text-red-400",children:[(0,F.jsx)(ee.A,{className:"h-5 w-5"})," Z\xf2n danje"]}),(0,F.jsxs)("p",{className:"mt-2 text-sm text-gray-400",children:["Efase kont ou an n\xe8t. Sa a ap retire pwofil ou, foto yo, p\xf2s yo ak done ou yo \u2014 ",(0,F.jsx)("span",{className:"font-bold text-red-300",children:"ou pa ka def\xe8t sa"}),"."]}),(0,F.jsxs)("button",{"data-testid":"delete-account-btn",onClick:()=>ht(!0),className:"mt-4 flex items-center gap-2 rounded-full bg-red-500/15 px-5 py-2.5 text-sm font-bold text-red-400 transition-colors hover:bg-red-500/25",children:[(0,F.jsx)(j.A,{className:"h-4 w-4"})," Efase kont mwen"]})]}),pt&&(0,F.jsx)("div",{className:"fixed inset-0 z-[130] flex items-center justify-center bg-black/70 p-4 backdrop-blur-sm",onClick:()=>!vt&&ht(!1),"data-testid":"delete-account-modal",children:(0,F.jsxs)("div",{className:"w-full max-w-sm rounded-3xl border border-red-500/30 bg-[#12121A] [html.light_&]:bg-[#e9edf4] p-6",onClick:e=>e.stopPropagation(),children:[(0,F.jsxs)("div",{className:"flex items-center gap-3",children:[(0,F.jsx)("div",{className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-full bg-red-500/15",children:(0,F.jsx)(ee.A,{className:"h-6 w-6 text-red-400"})}),(0,F.jsx)("h3",{className:"font-display text-xl font-black text-white",children:"Efase kont ou?"})]}),(0,F.jsxs)("p",{className:"mt-3 text-sm text-gray-400",children:["Aksyon sa a ",(0,F.jsx)("span",{className:"font-bold text-red-300",children:"pa ka def\xe8t"}
1),". Tout pwofil, foto, p\xf2s, jeton ak pwen ou yo ap dispar\xe8t pou tout tan."]}),(0,F.jsxs)("div",{className:"mt-5 flex gap-2",children:[(0,F.jsx)("button",{"data-testid":"delete-account-cancel",disabled:vt,onClick:()=>ht(!1),className:"flex-1 rounded-full surface-2 px-4 py-3 text-sm font-bold text-gray-200 transition-colors hover:bg-white/10 disabled:opacity-50",children:"Anile"}),(0,F.jsx)("button",{"data-testid":"delete-account-confirm",disabled:vt,onClick:async()=>{wt(!0);try{await x.Ay.delete("/auth/account"),m.oR.success("Kont ou efase n\xe8t. N ap sonje w! \ud83d\udc4b"),await g(),v("/login")}catch(a){var e,t;m.oR.error((null===a||void 0===a||null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail)||"Nou pa ka efase kont lan kounye a"),wt(!1),ht(!1)}},className:"flex flex-1 items-center justify-center gap-2 rounded-full bg-red-500 px-4 py-3 text-sm font-bold text-white transition-colors hover:bg-red-600 disabled:opacity-50",children:vt?(0,F.jsx)(h.A,{className:"h-4 w-4 animate-spin"}):(0,F.jsxs)(F.Fragment,{children:[(0,F.jsx)(j.A,{className:"h-4 w-4"})," Wi, efase l"]})})]})]})}),Pe&&(0,F.jsx)(D,{userId:N,mode:Pe,onClose:()=>De(null),onOpenProfile:e=>w("profile",e)})]})}}}]);
2//# sourceMappingURL=76.2c7f1b63.chunk.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.