1import{u as z,x as U,r as l,j as e,G as w,cE as ee,v as se,bz as te,bA as ae,by as M,q as N,a5 as ie,B as I,bB as F,$ as le,a3 as ne,t as f,aw as re,U as oe,P as de,bY as ce,n as me,o as pe,i as xe}from"./index-C1fX6R5K.js";import{D as q}from"./download-CFkdWdQ5.js";import{I as he}from"./info-Dcq4UHh3.js";import"./i18n-BtccWlCM.js";import"./index-paNpr7jU.js";function ue({currentProductId:s,productType:t}){const{t:m}=z(),i=U(),[p,v]=l.useState([]),[n,g]=l.useState(!0),[C,y]=l.useState([[],[],[],[]]),[b,h]=l.useState(4);if(l.useEffect(()=>{(async()=>{if(s){g(!0);try{const{data:r}=await N.get(`/api/products/${s}/similar`);v(r)}catch(r){console.error("Failed to fetch similar products",r)}finally{g(!1)}}})()},[s]),l.useEffect(()=>{const d=()=>{const r=window.innerWidth;r<640?h(1):r<768?h(2):r<1024?h(3):h(4)};return d(),window.addEventListener("resize",d),()=>window.removeEventListener("resize",d)},[]),l.useEffect(()=>{if(p.length===0){y(Array.from({length:b},()=>[]));return}const d=Array.from({length:b},()=>[]);p.forEach((r,o)=>{d[o%b].push(r)}),y(d)},[p,b]),!n&&p.length===0)return null;const _=()=>{i(t?`/market?type=${t}`:"/market")};return e.jsxs("div",{className:"mt-12 w-full animate-in fade-in duration-500",children:[e.jsxs("div",{className:"flex items-center justify-between mb-6",children:[e.jsx("h2",{className:"text-xl sm:text-2xl font-bold font-['Titillium_Web',sans-serif] text-white",children:m("similar_products.title","Similar Products")}),e.jsxs(w,{variant:"ghost",onClick:_,className:"text-[#f97316] hover:text-[#ea580c] hover:bg-transparent p-0 font-medium group",children:[m("similar_products.see_more","See more"),e.jsx(ee,{className:"ml-2 w-4 h-4 transition-transform group-hover:translate-x-1"})]})]}),n?e.jsx("div",{className:"flex gap-4",children:[...Array(b)].map((d,r)=>e.jsx("div",{className:"flex-1 space-y-4",children:[...Array(2)].map((o,S)=>e.jsx("div",{className:"w-full rounded-xl bg-[#1e1f25] animate-pulse h-48 border border-[#2d2e35]"},`skeleton-${r}-${S}`))},r))}):e.jsx("div",{className:"flex gap-4 items-start",children:C.map((d,r)=>e.jsx("div",{className:"flex-1 space-y-4",children:d.map(o=>e.jsx(se,{to:`/market/${o.id}`,className:"block group",children:e.jsx("div",{className:"relative bg-[#1e1f25] border border-transparent hover:border-white/10 rounded-xl overflow-hidden transition-all duration-300 group-hover:shadow-2xl group-hover:shadow-primary/5",children:e.jsxs("div",{className:"w-full relative",children:[o.images&&o.images.length>0?e.jsx(te,{src:`https://s3.eu-central-003.backblazeb2.com/maxskills-dev/${o.images[0]}`,alt:o.name,className:"w-full h-auto object-cover block"}):e.jsx("div",{className:"w-full aspect-square bg-[#2d2e35] flex items-center justify-center text-gray-500",children:e.jsx(ae,{className:"h-10 w-10 opacity-20"})}),e.jsx("div",{className:"absolute top-3 left-3 flex gap-2 z-10",children:o.is_premium&&e.jsx("div",{className:"bg-[#f97316] text-white p-1.5 rounded-full shadow-lg",children:e.jsx(M,{className:"w-3.5 h-3.5",fill:"currentColor"})})})]})})},o.id))},r))})]})}function T({method:s}){if(!s)return null;const t=s.details&&typeof s.details=="object"?Object.entries(s.details).filter(([,n])=>n!==null&&n!==""&&n!==void 0):[],m=!!s.instructions?.trim(),i=t.length>0;if(!m&&!i)return null;const p=n=>{navigator.clipboard?.writeText(n).then(()=>f.success("Copied"))},v=n=>n.replace(/_/g," ").replace(/\b\w/g,g=>g.toUpperCase());return e.jsxs("div",{className:"rounded-lg border border-[#2d2e35] bg-[#000216]/60 p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-xs text-blue-300 uppercase tracking-wide",children:[e.jsx(he,{className:"w-3.5 h-3.5"}),e.jsx("span",{children:"How to pay"})]}),m&&e.jsx("p",{className:"text-sm text-[#cfd1da] whitespace-pre-wrap",children:s.instructions}),i&&e.jsx("div",{className:"space-y-1.5",children:t.map(([n,g])=>e.jsxs("div",{className:"flex items-start justify-between gap-3 text-sm",children:[e.jsx("span",{className:"text-[#aaaebb] capitalize",children:v(n)}),e.jsxs("button",{type:"button",onClick:()=>p(String(g)),className:"text-right text-white font-medium hover:text-primary inline-flex items-center gap-1.5 break-all",title:"Click to copy",children:[String(g),e.jsx(xe,{className:"w-3 h-3 opacity-50"})]})]},n))})]})}function fe({product:s,order:t,onClose:m,onOrderPlaced:i}){const[p,v]=l.useState([]),[n,g]=l.useState(""),[C,y]=l.useState([]),[b,h]=l.useState(""),{t:_}=z(),[d,r]=l.useState(!1),[o,S]=l.useState(null),[k,x]=l.useState(!1),[c,u]=l.useState(!1),[j,D]=l.useState(""),[L,E]=l.useState(!1);l.useEffect(()=>{N.get("/api/payment-methods/active").then(a=>v(a.data)).catch(()=>{})},[]);const B=p.find(a=>String(a.id)===n),A=p.find(a=>String(a.id)===j),O=!!t?.has_proof||!!t?.proof_path||t?.payment_status==="proof_pending",R=t?.status==="pending"&&!O,H=async()=>
1{if(!(!t||!j)){E(!0);try{const{data:a}=await N.patch(`/api/product-orders/${t.id}/payment-method`,{payment_method_id:j});f.success("Payment method updated."),i(a.order??a),u(!1)}catch(a){f.error(a.response?.data?.message||"Failed to update payment method.")}finally{E(!1)}}},J=()=>s.promo_price&&s.promo_ends_at&&new Date<new Date(s.promo_ends_at)?s.promo_price:s.price,V=async()=>{if(!n){f.error("Please select a payment method.");return}r(!0);try{const a=new FormData;a.append("payment_method_id",n),b&&a.append("notes",b),C.forEach((Q,Z)=>a.append(`proofs[${Z}]`,Q));const{data:P}=await N.post(`/api/products/${s.id}/orders`,a,{headers:{"Content-Type":"multipart/form-data"}});f.success("Order placed! Awaiting admin approval."),i(P.order??P)}catch(a){const P=a.response?.data?.message||"Failed to place order.";f.error(P)}finally{r(!1)}},X=async()=>{if(!(!o||!t)){x(!0);try{const a=new FormData;a.append("proof",o),await N.post(`/api/product-orders/${t.id}/proof`,a,{headers:{"Content-Type":"multipart/form-data"}}),f.success("Proof submitted!"),S(null),i({...t,payment_status:"proof_pending"})}catch{f.error("Failed to upload proof.")}finally{x(!1)}}},W={pending:"text-yellow-400",completed:"text-green-400",cancelled:"text-red-400",refunded:"text-gray-400",proof_pending:"text-blue-400"},K=a=>a==="completed"?e.jsx(ce,{className:"w-4 h-4 text-green-400"}):a==="cancelled"?e.jsx(me,{className:"w-4 h-4 text-red-400"}):e.jsx(pe,{className:"w-4 h-4 text-yellow-400"});return e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/70 p-4",onClick:m,children:e.jsxs("div",{className:"w-full max-w-lg bg-[#1e1f25] border border-[#2d2e35] rounded-2xl shadow-2xl overflow-hidden",onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"p-5 border-b border-[#2d2e35]",children:[e.jsx("h2",{className:"text-lg font-bold text-white",children:s.name}),e.jsx("div",{className:"flex items-center gap-3 mt-1",children:s.promo_price&&s.promo_ends_at&&new Date<new Date(s.promo_ends_at)?e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"text-2xl font-bold text-green-400",children:[s.promo_price," DT"]}),e.jsxs("span",{className:"text-sm line-through text-gray-500",children:[s.price," DT"]}),e.jsx(I,{className:"bg-green-500/10 text-green-400 border-green-500/20",children:"Promo"})]}):e.jsxs("span",{className:"text-2xl font-bold text-white",children:[s.price," DT"]})})]}),e.jsx("div",{className:"p-5 space-y-4 max-h-[70vh] overflow-y-auto",children:t?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"bg-[#000216] border border-[#2d2e35] rounded-xl p-4 space-y-2",children:[e.jsx("p",{className:"text-xs text-[#aaaebb] uppercase tracking-wide",children:"Your Order"}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-white font-medium",children:"Status"}),e.jsxs("span",{className:`flex items-center gap-1.5 font-semibold capitalize ${W[t.status]||"text-white"}`,children:[K(t.status)," ",t.status]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-white font-medium",children:"Payment"}),e.jsx("span",{className:`font-semibold capitalize ${W[t.payment_status]||"text-[#aaaebb]"}`,children:t.payment_status?.replace("_"," ")})]}),t.payment_method&&e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-white font-medium",children:"Method"}),e.jsxs("div",{className:"flex items-center gap-2",children:[t.payment_method.icon_url&&e.jsx("img",{src:t.payment_method.icon_url,alt:t.payment_method.name,className:"w-5 h-5 object-contain rounded"}),e.jsx("span",{className:"text-[#aaaebb]",children:t.payment_method.name})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-white font-medium",children:"Total"}),e.jsxs("span",{className:"text-white font-bold",children:[t.total," DT"]})]})]}),!c&&t.payment_method&&e.jsx(T,{method:t.payment_method}),R&&!c&&e.jsxs(w,{variant:"outline",onClick:()=>{D(String(t.payment_method?.id??"")),u(!0)},className:"w-full border-[#2d2e35] text-white hover:bg-[#1e1f25]",children:[e.jsx(re,{className:"w-4 h-4 mr-2"})," Change payment method"]}),c&&e.jsxs("div",{className:"space-y-3 border border-[#2d2e35] rounded-xl p-3 bg-[#000216]/60",children:[e.jsx("p",{className:"text-sm font-medium text-white",children:"Select a different method"}),e.jsx("div",{className:"space-y-2",children:p.map(a=>e.jsxs("label",{className:`flex items-center gap-3 p-2.5 rounded-lg border cursor-pointer transition-colors ${j===String(a.id)?"border-primary bg-primary/10":"border-[#2d2e35] bg-[#000216] hover:border-[#3d3e45]"}`,children:[e.jsx("input",{type:"radio",name:"change_payment_method",value:String(a.id),checked:j===String(a.id),onChange:()=>D(String(a.id)),className:"sr-only"}),a.icon_url&&e.jsx("img",{src:a.icon_url,alt:a.name,className:"w-7 h-7 object-contain rounded"}),e.jsx("span",{className:"flex-1 text-white text-sm font-medium",children:a.name}),e.jsx("div",{className:`w-4 h-4 rounded-full border-2 flex-shrink-0 ${j===String(a.id)?"border-primary bg-primary":"border-[#3d3e45]"}`})]},a.id))}),A&&e.jsx(T,{method:A}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx(w,{variant:"ghost",onClick:()=>u(!1),className:"flex-1 text-[#aaaebb]",children:"Cancel"}),e.jsx(w,{onClick:H,disabled:L||!j||j===String(t.payment_method?.id??""),className:"flex-1 bg-primary text-black hover:bg-primary/90",children:L?"Saving...":"Save"})]})]}),R&&!c&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-[#aaaebb]",children:"Upload payment proof to accelerate validation:"}),e.jsx("input",{type:"file",accept:"image/*,.pdf",className:"block w-full text-sm text-[#aaaebb] file:mr-3 file:py-1.5 file:px-3 file:rounded-lg file:border-0 file:text-sm file:bg-[#2d2e35] file:text-white hover:file:bg-[#3d3e45] cursor-pointer",onChange:a=>S(a.target.files?.[0]||null)}),e.jsxs(w,{onClick:X,disabled:!o||k,className:"w-full bg-blue-600 hover:bg-blue-700 text-white",children:[e.jsx(oe,{className:"w-4 h-4 mr-2"}),k?"Uploading...":"Submit Proof"]}),e.jsx(de,{payableType:"order",payableId:t.id})]}),O&&t.status==="pending"&&e.jsx("p",{className:"text-sm text-center text-blue-400 bg-blue-500/10 rounded-lg p-3",children:"Proof submitted â awaiting admin validation."}),t.status==="completed"&&e.jsx("p",{className:"text-sm text-center text-green-400 bg-green-500/10 rounded-lg p-3",children:"Payment c
1onfirmed. You now have access to this product."}),(t.status==="cancelled"||t.status==="refunded")&&e.jsxs("p",{className:"text-sm text-center text-red-400 bg-red-500/10 rounded-lg p-3",children:["This order was ",t.status,"."]})]}):e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-medium text-white",children:"Select Payment Method"}),e.jsxs("div",{className:"space-y-2",children:[p.map(a=>e.jsxs("label",{className:`flex items-center gap-3 p-3 rounded-xl border cursor-pointer transition-colors ${n===String(a.id)?"border-primary bg-primary/10":"border-[#2d2e35] bg-[#000216] hover:border-[#3d3e45]"}`,children:[e.jsx("input",{type:"radio",name:"payment_method",value:String(a.id),checked:n===String(a.id),onChange:()=>g(String(a.id)),className:"sr-only"}),a.icon_url&&e.jsx("img",{src:a.icon_url,alt:a.name,className:"w-8 h-8 object-contain rounded"}),e.jsxs("div",{className:"flex-1",children:[e.jsx("p",{className:"text-white font-medium",children:a.name}),a.details?.account&&e.jsx("p",{className:"text-xs text-[#aaaebb]",children:a.details.account})]}),e.jsx("div",{className:`w-4 h-4 rounded-full border-2 flex-shrink-0 ${n===String(a.id)?"border-primary bg-primary":"border-[#3d3e45]"}`})]},a.id)),p.length===0&&e.jsx("p",{className:"text-[#aaaebb] text-sm text-center py-4",children:"No payment methods available."})]}),B&&e.jsx(T,{method:B})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-white",children:"Payment Proof (optional)"}),e.jsx("p",{className:"text-xs text-[#aaaebb]",children:"Upload screenshot or receipt (up to 3 files, jpg/png/pdf)"}),e.jsx("input",{type:"file",multiple:!0,accept:"image/*,.pdf",className:"block w-full text-sm text-[#aaaebb] file:mr-3 file:py-1.5 file:px-3 file:rounded-lg file:border-0 file:text-sm file:bg-[#2d2e35] file:text-white hover:file:bg-[#3d3e45] cursor-pointer mt-1",onChange:a=>y(Array.from(a.target.files||[]).slice(0,3))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-white",children:"Notes (optional)"}),e.jsx("textarea",{rows:2,className:"w-full rounded-lg border border-[#2d2e35] bg-[#000216] px-3 py-2 text-sm text-white focus:ring-2 focus:ring-primary outline-none",placeholder:"Any additional info for the admin...",value:b,onChange:a=>h(a.target.value)})]}),e.jsxs(w,{onClick:V,disabled:d||!n,className:"w-full bg-orange-500 hover:bg-orange-600 text-white font-bold h-11",children:[e.jsx(F,{className:"w-4 h-4 mr-2"}),d?_("product_details.placing_order"):_("product_details.buy_for",{price:J()})]})]})}),e.jsx("div",{className:"p-4 border-t border-[#2d2e35]",children:e.jsx(w,{variant:"ghost",onClick:m,className:"w-full text-[#aaaebb]",children:"Close"})})]})})}function ve(){const{t:s}=z(),{id:t}=ie(),m=U(),[i,p]=l.useState(null),[v,n]=l.useState(!0),[g,C]=l.useState(null),[y,b]=l.useState(!1),[h,_]=l.useState(null),[d,r]=l.useState(!1);l.useEffect(()=>{t&&(async()=>{n(!0);try{const[c,u]=await Promise.all([N.get(`/api/products/${t}`),N.get("/api/subscriptions/current").catch(()=>({data:{status:"inactive"}}))]);p(c.data),C(u.data),c.data.is_paid&&N.get(`/api/products/${c.data.id}/my-order`).then(j=>_(j.data.order)).catch(()=>{})}catch{f.error(s("product_details.not_found","Product not found")),m("/market")}finally{n(!1)}})()},[t,m,s]);const o=async()=>{if(i){b(!0);try{const x=await N.get(`/api/products/${i.id}/download`,{responseType:"blob"}),c=window.URL.createObjectURL(new Blob([x.data])),u=document.createElement("a");u.href=c;const j=i.source_file?i.source_file.split(".").pop():i.format||"zip",D=`${i.name.replace(/[^a-z0-9]/gi,"_").toLowerCase()}.${j}`;u.setAttribute("download",D),document.body.appendChild(u),u.click(),u.remove(),window.URL.revokeObjectURL(c),f.success(s("product_details.download_started","Download started!"))}catch(x){if(x.response?.data instanceof Blob){const c=await x.response.data.text();try{const u=JSON.parse(c);f.error(u.message||s("product_details.download_failed","Download failed."))}catch{f.error(s("product_details.download_failed","Download failed."))}}else f.error(x.response?.data?.message||s("product_details.download_failed","Download failed."))}finally{b(!1)}}};if(v||!i)return e.jsx("div",{className:"min-h-screen flex items-center justify-center text-white",children:s("loading_screen.loading","Loading...")});const S=!i.is_premium||g&&g.status==="active",k=()=>i.promo_price&&i.promo_ends_at&&new Date<new Date(i.promo_ends_at)?i.promo_price:i.price;return e.jsxs("div",{className:"min-h-screen text-white",children:[e.jsxs("div",{className:"w-full max-w-[1200px] mx-auto px-4 sm:px-6 lg:px-8 py-6 sm:py-8 lg:py-10",children:[e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-[1fr_450px] gap-6 lg:gap-8",children:[e.jsxs("div",{className:"w-full space-y-6",children:[e.jsx("div",{className:"bg-[#242424] border border-[#333] rounded-xl overflow-hidden shadow-sm",children:e.jsxs("div",{className:"w-full relative",children:[i.is_premium&&!S&&e.jsx("div",{className:"absolute top-4 left-4 z-10",children:e.jsxs(I,{className:"bg-orange-500/90 text-white border-none text-sm px-3 py-1 flex items-center gap-1",children:[e.jsx(M,{className:"w-3 h-3"})," ",s("product_details.premium","Premium")]})}),i.is_paid&&e.jsx("div",{className:"absolute top-4 left-4 z-10",children:e.jsxs(I,{className:"bg-blue-600/90 text-white border-none text-sm px-3 py-1 flex items-center gap-1",children:[e.jsx(F,{className:"w-3 h-3"})," ",k()," DT"]})}),e.jsx("img",{src:i.images?.[0]?`https://s3.eu-central-003.backblazeb2.com/maxskills-dev/${i.images[0]}`:"/placeholder.png",alt:i.name,className:"w-full h-auto"})]})}),e.jsx("div",{className:"lg:hidden",children:e.jsx(G,{product:i,t:s})}),e.jsxs("div",{className:"hidden lg:block",children:[e.jsx("h2",{className:"text-xl font-bold mb-4",children:s("product_details.description","Description")}),e.jsx("div",{className:"text-gray-300 whitespace-pre-wrap",children:i.long_description||i.description})]})]}),e.jsxs("div",{className:"w-full space-y-6",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"font-['Titillium_Web',sans-serif] font-bold text-2xl sm:text-3xl leading-snug mb-3",children:i.name}),e.jsxs("div",{className:"space-y-3 mt-6",children:[e.jsx(Y,{icon:e.jsx(le,{className:"w-5 h-5 text-blue-400"}),text:`${s("product_details.format","Format")}: ${i.format||s("product_card.types.digital","Digital")}`}),i.description&&i.description.split(` 2`).map((x,c)=>x.trim()&&e.jsx(Y,{icon:e.jsx(ne,{className:"w-5 h-5 text-green-500"}),text:x.trim()},c))]})]}),e.jsxs("div",{className:"bg-[#1e1f25] border border-[#333] rounded-xl p-6 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{className:"text-gray-400",children:s("product_details.license_type","License Type")}),e.jsx("span",{className:`font-bold ${i.is_paid?"text-blue-400":i.is_premium?"text-orange-400":"text-green-400"}`,children:i.is_paid?"Paid":i.is_premium?s("product_details.premium","Premium"):s("product_details.free","Free")})]}),i.is_paid?e.jsxs("div",{className:"space-y-3",children:[e.jsx("div",{className:"flex items-center justify-between",children:i.promo_price&&i.promo_ends_at&&new Date<new Date(i.promo_ends_at)?e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("span",{className:"text-2xl font-bold text-green-400",children:[i.promo_price," DT"]}),e.jsxs("span",{className:"text-sm line-through text-gray-500",children:[i.price," DT"]})]}):e.jsxs("span",{className:"text-2xl font-bold text-white",children:[i.price," DT"]})}),h?.status==="completed"?e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm text-center text-green-400 bg-green-500/10 rounded-lg p-3",children:"Purchase confirmed â you have access."}),e.jsxs(w,{onClick:o,disabled:y,className:"w-full bg-green-600 hover:bg-green-700 text-white font-bold h-12 text-lg",children:[e.jsx(q,{className:"mr-2 h-5 w-5"})," Download Now"]})]}):e.jsxs(w,{onClick:()=>r(!0),className:"w-full bg-orange-500 hover:bg-orange-600 text-white font-bold h-12 text-lg",children:[e.jsx(F,{className:"mr-2 h-5 w-5"}
2),h?s("product_details.view_my_order"):s("product_details.buy_action",{price:k()})]}),h&&h.status!=="completed"&&e.jsxs("p",{className:"text-xs text-center text-[#aaaebb]",children:["Order status: ",e.jsx("span",{className:"capitalize text-yellow-400",children:h.status})]})]}):S?e.jsx(w,{onClick:o,disabled:y,className:"w-full bg-green-600 hover:bg-green-700 text-white font-bold h-12 text-lg",children:y?s("product_details.downloading","Downloading..."):e.jsxs(e.Fragment,{children:[e.jsx(q,{className:"mr-2 h-5 w-5"})," ",s("product_details.download_now","Download Now")]})}):e.jsxs("div",{className:"space-y-3",children:[e.jsxs(w,{onClick:()=>m("/pricing"),className:"w-full bg-orange-600 hover:bg-orange-700 text-white font-bold h-12 text-lg",children:[e.jsx(M,{className:"mr-2 h-5 w-5"})," ",s("product_details.upgrade_to_download","Upgrade to Download")]}),e.jsx("p",{className:"text-xs text-center text-gray-400",children:s("product_details.upgrade_desc","Unlock this file and thousands more with a Premium subscription.")})]})]}),e.jsx(ge,{seller:i.seller,t:s}),e.jsx("div",{className:"hidden lg:block",children:e.jsx(G,{product:i,t:s})})]})]}),i&&e.jsx(ue,{currentProductId:i.id,productType:i.type})]}),d&&e.jsx(fe,{product:i,order:h,onClose:()=>r(!1),onOrderPlaced:x=>{_(x)}})]})}function Y({icon:s,text:t}){return e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex-shrink-0",children:s}),e.jsx("p",{className:"font-['Titillium_Web',sans-serif] text-sm text-[#f2f2f2]",children:t})]})}function ge({seller:s,t}){const m=U();return s?e.jsx("div",{className:"bg-[#1e1f25] border border-[#333] rounded-xl p-4",children:e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"w-12 h-12 rounded-full bg-gray-700 overflow-hidden flex-shrink-0",children:e.jsx("img",{src:s.avatar||`https://ui-avatars.com/api/?name=${encodeURIComponent(s.name)}`,alt:s.name,className:"w-full h-full object-cover",onError:i=>{i.currentTarget.src=`https://ui-avatars.com/api/?name=${encodeURIComponent(s.name)}`}})}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-['Titillium_Web',sans-serif] font-semibold text-base text-[#f2f2f2]",children:s.name}),e.jsx("p",{className:"font-['Titillium_Web',sans-serif] text-sm text-[#999]",children:s.username?`@${s.username}`:t("product_details.seller","Seller")})]})]}),e.jsx(w,{variant:"ghost",onClick:()=>m(`/profile/${s.username||s.id}`),className:"text-[#f97316] hover:text-[#ea580c] hover:bg-transparent p-0 font-medium",children:t("profile.view_profile","View Profile")})]})}):null}function G({product:s,t}){return e.jsxs("div",{className:"bg-[#1e1f25] border border-[#333] rounded-xl p-4",children:[e.jsxs("h3",{className:"font-['Titillium_Web',sans-serif] font-semibold text-base text-[#f2f2f2] mb-4",children:[t("product_details.informations","Informations"),":"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[e.jsx($,{label:t("product_details.format_label","Format:"),value:s.format||t("product_details.na","N/A")}),e.jsx($,{label:t("product_details.file_size","File Size:"),value:s.file_size||t("post_c
2ard.unknown","Unknown")}),e.jsx($,{label:t("product_details.id","ID:"),value:s.unique_number||`#${s.id}`}),e.jsx($,{label:t("product_details.license","License:"),value:s.is_paid?"Paid":s.is_premium?t("product_details.premium","Premium"):t("product_details.free","Free")})]})]})}function $({label:s,value:t}){return e.jsxs("div",{children:[e.jsx("span",{className:"font-['Titillium_Web',sans-serif] text-sm text-[#999] block",children:s}),e.jsx("span",{className:"font-['Titillium_Web',sans-serif] text-sm text-[#f2f2f2] font-semibold",children:t})]})}export{ve as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.