PageSourceSearch

https://bbcc.ai/build/assets/marketplace-ki0tKVQ5.js

js bbcc.ai collected 2026-10-05 12:13:38 UTC 17,368 bytes, 8 lines download raw bytes

1import{u as be,r as s,j as e,H as je,L as y,b as j}from"./app-DP13319Q.js";import{F as n,a8 as we,a9 as Ne,aa as ve,i as Pe,ap as Se,a as U,f as Ee,ar as ke,h as Fe,az as Ce,k as L}from"./index-CtyZ6W6U.js";import{D as Ae}from"./DraggableMenu-Bk7Spryo.js";import{A as _e}from"./app-logo-icon-B_rIw4ab.js";import{c as Me}from"./cjs-G0qneMx2.js";import{M as Ie}from"./MarketplaceListings-eTRB6eNh.js";import{M}from"./react-tooltip.min-DW3XhwOj.js";import{E as $e,l as De,u as ze,a as Te,P as Re}from"./react-stripe.esm-D6Ettci4.js";/* empty css            */import"./index-DQkUn08L.js";import"./clsx-B-dksMZM.js";const qe=De("pk_test_51IyCo8Dpr0bpQPacr3v1TYpEaU5tpZKkGo9U0x5IHlt0lCZEeqqAltwkPAMuMBwifNgq2gfMbqCN0zR6ZWe9G2UN00Qj78PNYg"),Be=({price:r,email:N,clientSecret:I,onSuccess:O,onBack:$,onError:k})=>{const p=ze(),x=Te(),[w,v]=s.useState(!1),[F,m]=s.useState(""),[D,P]=s.useState(!1),z=async C=>{if(C.preventDefault(),m(""),!p||!x){m("Payment system not ready. Please try again.");return}v(!0);try{const{error:l}=await x.submit();if(l){m(l.message||"Payment form validation failed");return}const{error:h,paymentIntent:f}=await p.confirmPayment({elements:x,confirmParams:{return_url:`${window.location.origin}/payment-success`,receipt_email:N,payment_method_data:{billing_details:{email:N}}},clientSecret:I,redirect:"if_required"});if(h){m(h.message||"Payment failed");return}if(!f){m("Payment processing failed. No payment intent received.");return}switch(f.status){case"succeeded":O();break;case"requires_action":m("Payment requires additional authentication. Please complete the verification.");break;case"processing":m("Payment is processing. Please wait for confirmation.");break;case"requires_payment_method":case"canceled":case"requires_confirmation":default:m(`Payment failed. Status: ${f.status}`)}}catch(l){const h=l instanceof Error?l.message:"Payment processing failed. Please try again.";m(h)}finally{v(!1)}};return e.jsxs("form",{onSubmit:z,children:[F&&e.jsxs("div",{className:"mb-4 p-3 bg-red-500/90 text-white rounded-lg flex items-center gap-2",children:[e.jsx(n,{icon:U}),F]}),e.jsxs("div",{className:"mt-4 text-sm text-gray-300",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{children:"Email:"}),e.jsx("span",{className:"text-yellow-400",children:N})]}),e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{children:"Amount:"}),e.jsxs("span",{className:"text-yellow-400",children:["US$",r.toFixed(2)]})]})]}),e.jsx("div",{className:"mt-6 space-y-4",children:e.jsx(Re,{options:{layout:"tabs",fields:{billingDetails:{email:"auto"}}},onReady:()=>P(!0)})}),e.jsx("div",{className:"mt-6",children:e.jsx("button",{type:"submit",disabled:w||!p||!D,className:`w-full bg-yellow-400 text-black font-bold py-3 px-4 rounded-full hover:bg-yellow-500 transition-colors ${w||!p||!D?"opacity-70 cursor-not-allowed":""}`,children:w?e.jsxs(e.Fragment,{children:[e.jsx(n,{icon:L,className:"animate-spin mr-2"}),"Processing..."]}):`Purchase for US$${r.toFixed(2)}`})}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("button",{type:"button",onClick:$,className:"text-sm text-yellow-400 hover:underline",children:"Back to email"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500",children:"Payment secured by STRIPE. You'll be redirected after payment."})]})]})};function Je(){var K,Q,V,X,J,ee,te,se,ae,re;const{auth:r,domains:N,filters:I,template:O,pagination:$}=be().props,[k,p]=s.useState(N),[x,w]=s.useState($),[v,F]=s.useState(I),[m,D]=s.useState(((K=r.balance)==null?void 0:K.balance)||0),[P,z]=s.useState(""),[C,l]=s.useState(""),[h,f]=s.useState(!1),[ie,Ue]=s.useState(!0),[oe,G]=s.useState(!1),[Z,A]=s.useState(!1),[le,T]=s.useState(!1),[a,R]=s.useState(null),[g,H]=s.useState(((Q=r.user)==null?void 0:Q.email)||""),[S,ce]=s.useState(""),[E,de]=s.useState(""),[b,q]=s.useState(null),[me,_]=s.useState(1),[B,Y]=s.useState(""),[ue,pe]=s.useState(""),W=s.useRef(null);s.useEffect(()=>{const t=async()=>{var c;if(g&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(g))try{const d=await j.post("/check-user-exists",{email:g},{headers:{"X-CSRF-TOKEN":((c=document.querySelector('meta[name="csrf-token"]'))==null?void 0:c.getAttribute("content"))||""}});q(d.data.exists)}catch(d){console.error("Error checking user existence:",d),q(null)}else q(null)},i=setTimeout(()=>{t()},500);return()=>clearTimeout(i)},[g]);const xe=async t=>{A(!0);try{const i=await j.get(route("marketplace.loadmore"),{params:{...t,page:1}});p(i.data.domains),w(i.data.pagination),F(t)}catch(i){console.error("Error fetching filtered domains:",i),l("Failed to apply filters. Please try again.")}finally{A(!1)}},he=t=>{xe(t)},fe=async()=>
1{if(!(Z||x.current_page>=x.last_page)){A(!0);try{const t=await j.get(route("marketplace.loadmore"),{params:{...v,page:x.current_page+1}});p([...k,...t.data.domains]),w(t.data.pagination)}catch(t){console.error("Error loading more domains:",t),l("Failed to load more domains. Please try again.")}finally{A(!1)}}},ge=async()=>{var t,i,c,d;if(a){f(!0),l("");try{const o=Number(((i=(t=a.sells)==null?void 0:t[0])==null?void 0:i.price)||0),u=await j.post("/marketplace/initiate-domain-payment",{email:g,password:!r.user&&!b?S:void 0,domain_id:a.id,domain_type:a.type,price:o,promo_price:o,coupon_code:"",payment_method:"usd"});if(u.data.clientSecret)Y(u.data.clientSecret),pe(u.data.payment_intent_id),_(2);else throw new Error("Failed to initialize payment")}catch(o){let u="An error occurred during purchase";j.isAxiosError(o)?u=((d=(c=o.response)==null?void 0:c.data)==null?void 0:d.error)||o.message:o instanceof Error&&(u=o.message),l(u)}finally{f(!1)}}},ye=async()=>{var t,i;f(!0);try{const c=await j.post("/marketplace/domain-payment-success",{payment_intent_id:ue,domain_id:a==null?void 0:a.id,domain_type:a==null?void 0:a.type});if(c.data.success)z("Domain purchased successfully!"),T(!1),R(null),_(1),a&&p(d=>d.filter(o=>!(o.id===a.id&&o.type===a.type)));else throw new Error(c.data.error||"Payment verification failed")}catch(c){const d=j.isAxiosError(c)?((i=(t=c.response)==null?void 0:t.data)==null?void 0:i.error)||c.message:"Payment verification failed";l(d)}finally{f(!1)}};return e.jsxs(e.Fragment,{children:[e.jsxs(je,{children:[e.jsx("title",{children:"Marketplace - Buy and Sell Domains"}),e.jsx("meta",{name:"description",content:"Marketplace for buying and selling domains with Stripe"}),e.jsx("style",{children:`
2                    .react-tooltip {
3                        z-index: 99999 !important;
4                        opacity: 1 !important;
5                        font-size: 12px;
6                        padding: 4px 8px;
7                    }
8                `})]}),e.jsx(M,{id:"nav-tooltip"}),e.jsx(M,{id:"action-tooltip"}),e.jsx(M,{id:"form-tooltip"}),e.jsx(M,{id:"modal-tooltip"}),r.user?e.jsx(Ae,{auth:r}):e.jsx(Me,{nodeRef:W,bounds:"parent",cancel:".no-drag",defaultPosition:{x:window.innerWidth-650,y:0},children:e.jsx("div",{ref:W,className:"space-x-4 z-10 absolute mt-5 cursor-move touch-none",children:e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs(y,{href:route("home"),className:"flex items-center px-2 py-0 rounded-full bg-[#235A72] no-drag transition-colors duration-300 hover:bg-[#1C4A5E]","data-tooltip-id":"nav-tooltip","data-tooltip-content":"Go to Homepage",children:[e.jsx(_e,{className:"size-8 fill-current text-[#8EF587]"}),e.jsx("span",{className:"ml-2 text-[#8EF587]",children:"ez.wiki"})]}),e.jsx(y,{href:route("demodesign"),className:"group no-drag","data-tooltip-id":"nav-tooltip","data-tooltip-content":"Purchase and Own a Branded Staging Portal in WiKi 2.0, Supported by Crowdsourcing",children:e.jsxs("span",{className:"flex items-center gap-2 bg-orange-500 text-white font-medium py-2 px-4 rounded-full transition-all duration-300 hover:bg-orange-600 cursor-pointer",children:[e.jsx(n,{icon:we,className:"text-white"}),e.jsx("span",{className:"hidden group-hover:inline",children:"EXPRESS DOMAIN"})]})}),e.jsx(y,{href:route("login"),className:"group no-drag","data-tooltip-id":"nav-tooltip","data-tooltip-content":"Sign in to your account",children:e.jsxs("span",{className:"flex items-center gap-2 bg-[#235A72] text-[#8EF587] font-medium py-2 px-4 rounded-full transition-all duration-300 hover:bg-[#1C4A5E] cursor-pointer",children:[e.jsx(n,{icon:Ne,className:"text-[#8EF587]"}),e.jsx("span",{className:"hidden group-hover:inline",children:"SIGN IN"})]})}),e.jsx(y,{href:route("register"),className:"group no-drag","data-tooltip-id":"nav-tooltip","data-tooltip-content":"Create a new account",children:e.jsxs("span",{className:"flex items-center gap-2 bg-[#235A72] text-[#8EF587] font-medium py-2 px-4 rounded-full transition-all duration-300 hover:bg-[#1C4A5E] cursor-pointer",children:[e.jsx(n,{icon:ve,className:"text-[#8EF587]"}),e.jsx("span",{className:"hidden group-hover:inline",children:"SIGN UP"})]})}),e.jsx(y,{href:route("marketplace"),className:"group no-drag","data-tooltip-id":"nav-tooltip","data-tooltip-content":"Browse the marketplace",children:e.jsxs("span",{className:"flex items-center gap-2 bg-[#235A72] text-[#8EF587] font-medium py-2 px-4 roun
8ded-full transition-all duration-300 hover:bg-[#1C4A5E] cursor-pointer",children:[e.jsx(n,{icon:Pe,className:"text-[#8EF587]"}),e.jsx("span",{className:"hidden group-hover:inline",children:"DOMAIN MART"})]})}),e.jsx(y,{href:route("templatemarketplace"),className:"group no-drag","data-tooltip-id":"nav-tooltip","data-tooltip-content":"Browse the theme marketplace",children:e.jsxs("span",{className:"flex items-center gap-2 bg-[#235A72] text-[#8EF587] font-medium py-2 px-4 rounded-full transition-all duration-300 hover:bg-[#1C4A5E] cursor-pointer",children:[e.jsx(n,{icon:Se,className:"text-[#8EF587]"}),e.jsx("span",{className:"hidden group-hover:inline",children:"THEME RENTAL"})]})})]})})}),e.jsxs("main",{className:"relative flex justify-end p-4 min-h-screen overflow-hidden",children:[C&&e.jsxs("div",{className:"fixed top-20 right-4 bg-red-600 text-white px-4 py-2 rounded-md shadow-lg z-1000 flex items-center",children:[e.jsx(n,{icon:U,className:"mr-2"}),C]}),P&&e.jsxs("div",{className:"fixed top-20 right-4 bg-green-600 text-white px-4 py-2 rounded-md shadow-lg z-1000 flex items-center",children:[e.jsx(n,{icon:Ee,className:"mr-2"}),P,P.includes("Invoice")&&e.jsx(n,{icon:ke,className:"ml-2"})]}),oe&&e.jsx("div",{className:"fixed inset-0 flex items-center justify-center z-100 p-4",children:e.jsxs("div",{className:"backdrop-blur-sm rounded-xl p-6 max-w-md w-full border border-yellow-500",children:[e.jsxs("div",{className:"flex justify-between items-start mb-4",children:[e.jsxs("h3",{className:"text-xl font-bold text-yellow-400 flex items-center",children:[e.jsx(n,{icon:U,className:"mr-2"}),"Insufficient Balance"]}),e.jsx("button",{onClick:()=>G(!1),className:"text-gray-400 hover:text-white","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Close",children:e.jsx(n,{icon:Fe})})]}),e.jsx("p",{className:"text-gray-300 mb-6",children:"You don't have enough EZ$ to complete this purchase. Please purchase more EZ$ to continue."}),e.jsxs("div",{className:"flex justify-end space-x-3",children:[e.jsx("button",{onClick:()=>G(!1),className:"px-4 py-2 bg-gray-700 hover:bg-gray-600 rounded-lg text-white","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Cancel purchase",children:"Cancel"}),e.jsxs("a",{href:route("purchase"),target:"_blank",className:"px-4 py-2 bg-yellow-600 hover:bg-yellow-500 rounded-lg text-white font-semibold flex items-center","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Go to the purchase page to add funds",children:[e.jsx(n,{icon:Ce,className:"mr-2"}),"Purchase EZ$"]})]})]})}),le&&a&&e.jsx("div",{className:"fixed inset-0 bg-black/70 min-h-screen flex items-center justify-center z-[100] p-4 overflow-y-auto",children:e.jsxs("div",{className:"bg-[#235A72] border border-[#3a7a94] text-white p-8 rounded-lg shadow-lg max-w-md w-full relative max-h-[90vh] overflow-y-auto",children:[e.jsx("button",{onClick:()=>{T(!1),R(null),l(""),_(1),Y("")},className:"absolute top-4 right-4 text-white/70 hover:text-white transition-colors z-10",disabled:h,children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M6 18L18 6M6 6l12 12"})})}),me===1?e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"text-center",children:[e.jsx("div",{className:"w-14 h-14 rounded-full backdrop-blur-md flex items-center justify-center overflow-hidden border border-white/20 bg-gradient-to-br from-white/15 to-transparent shadow-lg mx-auto",children:e.jsx("img",{src:"https://ez.wiki/logo.gif",className:"w-10 h-10 rounded-full object-cover",alt:"ez.wiki Logo"})}),e.jsx("h2",{className:"text-xl font-bold mt-4 text-white",children:"Domain Purchase"}),e.jsx("p",{className:"text-[#a8d0e6] mt-2",children:a.type==="CUSTOM"?`${a.domainselected}/${a.domain}`:`${a.domain}.${a.domainselected}`}),e.jsxs("div",{className:"bg-[#2a6b87] p-4 rounded-lg mt-4",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsx("span",{className:"text-gray-300",children:"Domain Price:"}),e.jsxs("span",{className:"text-yellow-400",children:["US$",Number(((X=(V=a.sells)==null?void 0:V[0])==null?void 0:X.price)||0).toFixed(2)]})]}),e.jsxs("div",{className:"flex justify-between items-center mb-2 border-t border-gray-600 pt-2",children:[e.jsx("span",{className:"text-gray-300 font-bold",children:"Total:"}),e.jsxs("span",{className:"text-green-400 font-bold",children:["US$",Number(((ee=(J=a.sells)==null?void 0:J[0])==null?void 0:ee.price)||0).toFixed(2)]})]})]})]}),e.jsxs("div",{className:"bg-[#2a6b87] p-4 rounded-lg",children:[!r.user&&!b&&e.jsx("div",{className:"mb-4",children:e.jsx("h3",{className:"text-lg font-semibold text-white border-b border-gray-600 pb-2",children:"Create Account"})}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:r.user?"Email Address":"Email Address *"}),e.jsx("input",{type:"email",value:g,onChange:t=>H(t.target.value),placeholder:"Enter your email address",className:"w-full bg-gray-700 text-white py-2 px-4 roun
8ded-md border border-gray-600 focus:outline-none focus:ring-2 focus:ring-green-400",required:!0}),b!==null&&!r.user&&e.jsx("p",{className:`text-xs mt-1 ${b?"text-green-400":"text-yellow-400"}`,children:b?"✓ Account exists - no password needed":"New account - password required"})]}),!r.user&&!b&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Password *"}),e.jsx("input",{type:"password",value:S,onChange:t=>ce(t.target.value),placeholder:"Create your password",className:"w-full bg-gray-700 text-white py-2 px-4 rounded-md border border-gray-600 focus:outline-none focus:ring-2 focus:ring-green-400",required:!0})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:"Confirm Password *"}),e.jsx("input",{type:"password",value:E,onChange:t=>de(t.target.value),placeholder:"Confirm your password",className:"w-full bg-gray-700 text-white py-2 px-4 rounded-md border border-gray-600 focus:outline-none focus:ring-2 focus:ring-green-400",required:!0}),S!==E&&E&&e.jsx("p",{className:"text-red-400 text-xs mt-1",children:"Passwords do not match"})]})]})]}),e.jsx("button",{onClick:ge,disabled:h||!g||!r.user&&!b&&(!S||!E||S!==E),className:"w-full bg-[#FFD700] text-gray-900 font-bold py-3 px-4 rounded-full hover:bg-[#FFC000] transition-colors disabled:opacity-70 disabled:cursor-not-allowed",children:h?e.jsxs(e.Fragment,{children:[e.jsx(n,{icon:L,className:"animate-spin mr-2"}),"Processing..."]}):`Purchase Domain for US$${Number(((se=(te=a.sells)==null?void 0:te[0])==null?void 0:se.price)||0).toFixed(2)}`}),e.jsxs("div",{className:"text-center text-xs text-[#a8d0e6]",children:[e.jsx("p",{children:"Payment secured by STRIPE. You'll receive the domain immediately after purchase."}),e.jsxs("p",{className:"mt-1",children:[e.jsx(y,{href:"/terms",className:"hover:underline text-white",children:"Terms"})," and"," ",e.jsx(y,{href:"/privacy",className:"hover:underline text-white",children:"Privacy"}),"."]})]})]}):e.jsx($e,{stripe:qe,options:{clientSecret:B,appearance:{theme:"night",variables:{colorPrimary:"#FFD700",colorBackground:"#235A72",colorText:"white",colorDanger:"#ff6b6b",fontFamily:"Inter, system-ui, sans-serif"}}},children:B?e.jsx(Be,{price:Number(((re=(ae=a.sells)==null?void 0:ae[0])==null?void 0:re.price)||0),email:g,clientSecret:B,onSuccess:ye,onBack:()=>_(1),onError:l}):e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(n,{icon:L,className:"animate-spin text-2xl"})})})]})}),ie&&e.jsx("div",{className:`relative bg-gray-900 mx-auto bottom-4 z-50 backdrop-blur-sm p-4 rounded-xl border border-white-700 overflow-y-auto shadow-2xl w-full max-w-6xl ${r.user?"mt-4":"mt-17"}`,children:e.jsx(Ie,{auth:r,initialDomains:k,initialPagination:x,initialFilters:v,onFilterChange:he,onLoadMore:fe,isLoading:Z,onPurchase:async(t,i,c,d)=>{var u;const o=d||k.find(ne=>ne.id===t&&ne.type===i);o&&(R(o),T(!0),(u=r.user)!=null&&u.email&&H(r.user.email))}})})]})]})}export{Je 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.