1import{u as ke,r,j as e,b as v,H as Xe,L as Se}from"./app-DP13319Q.js";import{D as Qe}from"./DraggableMenu-Bk7Spryo.js";import"./model-viewer-BNdxy5m2.js";import{F as f,h as Ce,c as Ge,aH as Je,ax as ze,al as et,a as _e,k as re}from"./index-CtyZ6W6U.js";import{l as tt}from"./index.module-D1uRunsO.js";import{E as at,l as ot,u as st,a as rt,P as it}from"./react-stripe.esm-D6Ettci4.js";import{M as se}from"./react-tooltip.min-DW3XhwOj.js";/* empty css */import"./index-DQkUn08L.js";const lt=ot("pk_live_51IyCo8Dpr0bpQPac24tix9UpShzoMw1uWsW3JvzcMrKVFnvUsXAnvBknJSPYucZCYSLT4Z0UVBeKx49jlYakdjIw00coa3YVdn"),nt=({price:E,email:T,clientSecret:ie,onSuccess:K,onBack:o,onError:V})=>{const z=st(),I=rt(),[x,j]=r.useState(!1),[U,u]=r.useState(""),[H,le]=r.useState(!1),L=async W=>{if(W.preventDefault(),u(""),!z||!I){u("Payment system not ready. Please try again.");return}j(!0);try{const{error:N}=await I.submit();if(N){console.error("Payment form validation failed:",N),u(N.message||"Payment form validation failed");return}console.log("Payment form validated successfully");const{error:S,paymentIntent:_}=await z.confirmPayment({elements:I,confirmParams:{return_url:`${window.location.origin}/payment-success`,receipt_email:T,payment_method_data:{billing_details:{email:T}}},clientSecret:ie,redirect:"if_required"});if(console.log("Payment confirmation result:",{stripeError:S,paymentIntent:_}),S){console.error("Stripe payment error:",S),u(S.message||"Payment failed");return}if(!_){console.error("No payment intent returned"),u("Payment processing failed. No payment intent received.");return}switch(console.log("Payment intent status:",_.status),_.status){case"succeeded":console.log("Payment succeeded!"),K();break;case"requires_action":console.log("Payment requires additional action"),u("Payment requires additional authentication. Please complete the verification.");break;case"processing":console.log("Payment processing"),u("Payment is processing. Please wait for confirmation.");break;case"requires_payment_method":case"canceled":case"requires_confirmation":default:console.error("Payment failed with status:",_.status),u(`Payment failed. Status: ${_.status}`)}}catch(N){console.error("Unexpected error during payment processing:",N);const S=N instanceof Error?N.message:"Payment processing failed. Please try again.";u(S)}finally{j(!1)}};return e.jsxs("form",{onSubmit:L,children:[U&&e.jsxs("div",{className:"mb-4 p-3 bg-red-500/90 text-white rounded-lg flex items-center gap-2","data-tooltip-id":"modal-tooltip","data-tooltip-content":"An error occurred during payment.",children:[e.jsx(f,{icon:_e}),U]}),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",{"data-tooltip-id":"modal-tooltip","data-tooltip-content":"Your email for the receipt.",children:"Email:"}),e.jsx("span",{className:"text-yellow-400",children:T})]}),e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsx("span",{"data-tooltip-id":"modal-tooltip","data-tooltip-content":"Total amount to be paid.",children:"Amount:"}),e.jsxs("span",{className:"text-yellow-400",children:["US$",E.toFixed(2)]})]})]}),e.jsx("div",{className:"mt-6 space-y-4",children:e.jsx(it,{options:{layout:"tabs",fields:{billingDetails:{email:"auto"}}},onReady:()=>le(!0)})}),e.jsx("div",{className:"mt-6",children:e.jsx("button",{type:"submit",disabled:x||!z||!H,className:`w-full bg-yellow-400 text-black font-bold py-3 px-4 rounded-full hover:bg-yellow-500 transition-colors ${x||!z||!H?"o
1pacity-70 cursor-not-allowed":""}`,"data-tooltip-id":"modal-tooltip","data-tooltip-content":"Complete your secure payment",children:x?e.jsxs(e.Fragment,{children:[e.jsx(f,{icon:re,className:"animate-spin mr-2"}),"Processing..."]}):`Pay US$${E.toFixed(2)}`})}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("button",{type:"button",onClick:o,className:"text-sm text-yellow-400 hover:underline","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Go back to the previous step",children:"Back to email"}),e.jsx("p",{className:"mt-2 text-xs text-gray-500","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Your payment is securely processed by Stripe.",children:"Payment secured by STRIPE. You'll be redirected after payment."})]})]})};function yt(){var Ne;const E=ke().props;r.useRef(null);const[T,ie]=r.useState(!0),{auth:K,template:o,initialFunnels:V,domains:z,tokenInfo:I,promoprice:x}=ke().props,j=(I==null?void 0:I.current_price)||1,[U,u]=r.useState([]),[H,le]=r.useState(""),[L,W]=r.useState("fuzzy"),[N,S]=r.useState(1),[_,X]=r.useState(!0),[Q,G]=r.useState(!1),[R,l]=r.useState(""),[he,A]=r.useState(""),[p,ne]=r.useState(null),[g,J]=r.useState(""),[b,q]=r.useState("ez.wiki"),[Fe,ee]=r.useState(!1),[xe]=tt(g,500),[F,ce]=r.useState({checking:!1,available:null,message:""}),[C,fe]=r.useState("bee"),[a,y]=r.useState({show:!1,charCount:0,price:0,promoPrice:x||0,handle:"",domain:b,couponCode:"",buyingPrice:x||0,sellingPrice:0}),[ge,$e]=r.useState(""),[Ee,de]=r.useState(!1),[Ie,te]=r.useState(1),[me,be]=r.useState(""),[Me,ye]=r.useState(""),[ct,we]=r.useState(0),[B,Ue]=r.useState(((Ne=K.user)==null?void 0:Ne.email)||""),[Y,ae]=r.useState(!1),O=r.useMemo(()=>a.promoPrice===0&&!a.couponValid?a.price:a.buyingPrice,[a.price,a.promoPrice,a.buyingPrice,a.couponValid]),ue=r.useMemo(()=>{const t=O*j;return t>0&&t<1?1:t},[O,j]),je=r.useCallback(t=>{try{return new URL(t),!0}catch{return!1}},[]),Z=r.useCallback(t=>{var c;return(c=t.split("?")[0].split(".").pop())==null?void 0:c.toLowerCase()},[]),pe=r.useCallback(t=>t?["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"].includes(t):!1,[]),He=r.useMemo(()=>o!=null&&o.image&&pe(Z(o.image))?e.jsx("style",{children:` 2 .blur-bg { 3 background: url('${o.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${o.image}') no-repeat center center; 4 background-size: cover; 5 } 6 `}):null,[o,Z,pe]);r.useEffect(()=>{if(o!=null&&o.image){const t=new Blob([o.image],{type:"text/html"}),i=URL.createObjectURL(t);return $e(i),()=>{URL.revokeObjectURL(i)}}},[o]),r.useEffect(()=>{if(o!=null&&o.image.includes("facebook.com")||o!=null&&o.image.includes("fb.watch")){const t=document.createElement("script");return t.src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v3.0",t.async=!0,t.defer=!0,t.crossOrigin="anonymous",document.body.appendChild(t),()=>{document.body.removeChild(t)}}},[o]),r.useEffect(()=>{E.initialFunnels&&(u(E.initialFunnels.data),X(E.initialFunnels.next_page_url!==null))},[E.initialFunnels]),r.useEffect(()=>{V&&(u(V.data),X(V.next_page_url!==null))},[V]),r.useEffect(()=>{if(a.couponCode){const t=setTimeout(()=>{Le()},500);return()=>clearTimeout(t)}},[a.couponCode]),r.useEffect(()=>{xe&&p&&ve()},[xe,b]);const Le=async()=>{if(!(!a.couponCode||!g))try{const t=await v.post("/couponcodecustom",{couponcode:a.couponCode,domainurl:g,type:"domain"}),i=parseFloat(t.data.offprice);y(c=>({...c,buyingPrice:i,couponValid:t.data.valid,couponMessage:t.data.valid?t.data.title:"Invalid coupon code"}))}catch{y(i=>({...i,couponValid:!1,couponMessage:"Error validating coupon code"}))}},ve=async()=>{var t,i,c,s;if(!(!g||!p))try{ce({checking:!0,available:null,message:"Checking availability..."}),y({...a,show:!1});const n=await v.post("/check-domain-availability",{domain:b,handle:g,current_funnel_id:p.id});if(n.data.available){const h=Number(n.data.price)||0,m=Number(n.data.promoPrice)||0;y({show:!0,charCount:n.data.charCount||0,price:h,promoPrice:m,handle:n.data.handle||"",domain:b,couponCode:"",buyingPrice:m>0?m:h,sellingPrice:0})}ce({checking:!1,available:n.data.available,message:n.data.message})}catch(n){console.error("Availability check error:",n),ce({checking:!1,available:!1,message:((i=(t=n.response)==null?void 0:t.data)==null?void 0:i.message)||"Failed to check availability"}),l(((s=(c=n.response)==null?void 0:c.data)==null?void 0:s.message)||"Failed to check availability")}},Re=async()=>{var t,i,c;if(!B){l("Please enter your email address");return}
6if(!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(B)){l("Please enter a valid email address");return}l(""),ae(!0);try{const s={price:a.price,email:B,custom_handle:g,domain:b,promo_price:a.promoPrice,coupon_code:a.couponCode,selling_price:a.sellingPrice,payment_method:C,funnelId:p==null?void 0:p.id},n=O*j;if(C==="usd"&&n>0&&n<1){const m=1/j;a.promoPrice>0||a.couponValid?s.promo_price=m:s.price=m}const h=await v.post("/initiate-domain-payment",s,{headers:{"X-CSRF-TOKEN":((t=document.querySelector('meta[name="csrf-token"]'))==null?void 0:t.getAttribute("content"))||""}});be(h.data.clientSecret),ye(h.data.payment_intent_id),we(h.data.handle_purchase_id),te(2)}catch(s){v.isAxiosError(s)?l(((c=(i=s.response)==null?void 0:i.data)==null?void 0:c.error)||"Failed to initialize payment"):l("Failed to connect to payment service")}finally{ae(!1)}},De=async()=>{var t,i,c;ae(!0),l("");try{const s=await v.post("/domain-handle-success",{payment_intent_id:Me},{headers:{"X-CSRF-TOKEN":((t=document.querySelector('meta[name="csrf-token"]'))==null?void 0:t.getAttribute("content"))||""}});
6s.data.success?(A(`Handle purchased successfully! Your new URL: https://${g}.${b}`),de(!1),u(U.map(n=>{if(n.id===(p==null?void 0:p.id)){const h={id:Date.now(),domain:g,domainselected:b};return{...n,handle_domains:[...n.handle_domains||[],h]}}return n})),te(1),be(""),ye(""),we(0),l(""),setTimeout(()=>{A(""),ne(null),J(""),ee(!1),q("ez.wiki"),y({show:!1,charCount:0,price:0,promoPrice:x||0,handle:"",domain:b,couponCode:"",buyingPrice:x||0,sellingPrice:0})},3e3),await oe()):l(s.data.error||"Payment verification failed")}catch(s){console.error("Payment verification error:",s),v.isAxiosError(s)?l(((c=(i=s.response)==null?void 0:i.data)==null?void 0:c.error)||"Payment verification failed"):l("Failed to verify payment. Please contact support.")}finally{ae(!1)}},oe=async()=>{try{const t=await v.get("/search-ez-funnels",{params:{query:H,type:L,page:1}});u(t.data.data),S(1),X(t.data.next_page_url!==null)}catch(t){console.error("Search error:",t),l("Failed to search funnels. Please try again."),setTimeout(()=>l(""),5e3)}},Te=async()=>{var t,i,c;try{G(!0);const s=((t=document.querySelector('meta[name="csrf-token"]'))==null?void 0:t.getAttribute("content"))||"",n=await v.get("/search-ez-funnels",{params:{query:H,type:L,page:N+1,with:"customDomains"},headers:{"X-CSRF-TOKEN":s,"Content-Type":"application/json"}});n.data&&n.data.data&&(u(h=>{const m=[...h];return n.data.data.forEach(P=>{const k=m.findIndex(d=>d.id===P.id);k>=0?m[k]={...m[k],...P,handle_domains:[...m[k].handle_domains||[],...P.handle_domains||[]],custom_domains:[...m[k].custom_domains||[],...P.custom_domains||[]]}:m.push(P)}),m}),S(N+1),X(n.data.next_page_url!==null))}catch(s){console.error("Load more error:",s),l(((c=(i=s.response)==null?void 0:i.data)==null?void 0:c.message)||"Failed to load more items. Please try again."),setTimeout(()=>l(""),5e3)}finally{G(!1)}},Ve=async t=>{var i,c,s,n,h,m,P,k;if(t.preventDefault(),!(!p||!g)){if(C==="usd"&&O*j>0){de(!0);return}try{G(!0),l(""),A("");const d={current_funnel_id:p.id,custom_handle:g,domain:b,price:a.price,promo_price:a.promoPrice,coupon_code:a.couponCode,selling_price:a.sellingPrice,payment_method:C},$=await v.post(`/update-ezdomain-funnel-handle/${p.id}`,d);
6$.data.success?(A(`Handle purchased successfully! Your new URL: ${$.data.url}`),u(U.map(D=>{if(D.id===p.id){const M={id:Date.now(),domain:g,domainselected:b};return{...D,handle_domains:[...D.handle_domains||[],M]}}return D})),setTimeout(()=>{A(""),ne(null),J(""),ee(!1),q("ez.wiki"),y({show:!1,charCount:0,price:0,promoPrice:x||0,handle:"",domain:b,couponCode:"",buyingPrice:x||0,sellingPrice:0})},3e3),C==="bee"&&await v.get("/buy-bee/balance")):l($.data.error||"Failed to complete the purchase. Please try again.")}catch(d){if(console.error("Handle purchase error:",d),v.isAxiosError(d))if(d.response)switch(d.response.status){case 409:l(((i=d.response.data)==null?void 0:i.error)||"This handle is already taken by another user.");break;case 400:(c=d.response.data)!=null&&c.messages?l(Object.values(d.response.data.messages).join(" ")):l(((s=d.response.data)==null?void 0:s.error)||"Invalid request. Please check your input.");break;case 403:l(((n=d.response.data)==null?void 0:n.error)||"Insufficient balance for this purchase.");break;case 422:const $=(h=d.response.data)==null?void 0:h.errors;l($?Object.values($).flat().join(" "):((m=d.response.data)==null?void 0:m.message)||"Validation failed. Please check your input.");break;default:l(((P=d.response.data)==null?void 0:P.message)||((k=d.response.data)==null?void 0:k.error)||"An unexpected error occurred. Please try again.")}else d.request?l("Network error. Please check your connection and try again."):l("Request setup error. Please try again.");else l("An unexpected error occurred. Please try again.")}finally{G(!1)}}},Ae=t=>{ne(t),J(t.token),q("ez.wiki"),ee(!0),y({show:!1,charCount:0,price:0,promoPrice:x||0,handle:"",domain:"ez.wiki",couponCode:"",buyingPrice:x||0,sellingPrice:0})},qe=t=>new Date(t).toLocaleDateString("en-US",{weekday:"short",day:"2-digit",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"}),Be=r.useCallback(()=>{if(!o)return null;const t=Z(o.image)||"",c=`${o.user_id===0?"https://admin.ez3d.ai/":"https://ez.wiki/"}${o.image}`,s=["jpg","jpeg","png","gif","bmp","tiff","tif","webp","apng","svg","ico"],n=["ppt","pptx","pdf","xls","xlsx","doc","docx","pages","ai","psd","eps","ttf","dxf","xps","rar","zip","ods","odt","odp"],h=/(?:youtube(?:-nocookie)?\.com\/(?:[^\/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/ ]{11})/i,m=/(?:https?:\/\/)?(?:www\.)?linkedin\.com\/(?:in|posts|company|feed|showcase|embed\/feed\/update\/urn:li:[^/]+:[^"&?/ ]+)/i,P=/^https?:\/\/(?:www\.|player\.)?vimeo\.com\/(?:channels\/(?:\w+\/)?|groups\/([^\/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:$|\/|\?)(?:[?]?.*)$/im,k=/^(https?:\/\/)?(www\.)?fb\.watch\/[a-zA-Z0-9(\.\?)?]/,d=/^(https?:\/\/)?(www\.)?facebook\.com\/[a-zA-Z0-9(\.\?)?]/,$=/<iframe.*?src=["'](.*?)["'].*?>.*?<\/iframe>/is,D=/<blockquote/,M=o.image.match(h),Ye=o.image.match(m),Pe=o.image.match(P),Oe=o.image.match(k),Ze=o.image.match(d),Ke=o.image.match($)||D.test(o.image);if(s.includes(t))return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 7 .blur-overlay { 8 position: fixed; 9 top: 0; 10 left: 0; 11 width: 100%; 12 height: 100%; 13 backdrop-filter: blur(20px); 14 z-index: -1; 15 } 16 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("img",{src:c,alt:"Background",className:"absolute inset-0 max-w-full max-h-full m-auto z-0 rounded-lg",onError:w=>console.error("Image failed to load",w)})]});if(n.includes(t))return e.jsx("iframe",{src:`https://docs.google.com/viewer?url=${c}&embedded=true`,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",loading:"lazy",allow:"autoplay; fullscreen",allowFullScreen:!0,sandbox:"allow-scripts allow-same-origin",title:"Document Viewer",scrolling:"yes"});if(Ke){const w=o.image.replace(/<(iframe|blockquote)([^>]*)\s(height|width|style)=["'][^"']*["']([^>]*)>/gi,'<$1$2$4 class="fixed top-0 left-0 w-full h-full" scrolling="yes">').replace(/class="([^"]*)"/g,'class="$1 absolute inset-0 m-auto"'),We=/<(iframe|blockquote)[^>
16]*class="/i.test(w)?w:w.replace(/<(iframe|blockquote)/g,'<$1 scrolling="yes" class="absolute w-full h-full inset-0 m-auto"');return e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 17 .blur-overlay { 18 position: fixed; 19 top: 0; 20 left: 0; 21 width: 100%; 22 height: 100%; 23 backdrop-filter: blur(20px); 24 z-index: -2; 25 } 26 .twitter-tweet { 27 position: fixed; 28 top: 0; 29 left: 0; 30 width: 100vw; 31 height: 100vh; 32 object-fit: cover; 33 z-index: 0; 34 border: none; 35 } 36 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full object-cover",dangerouslySetInnerHTML:{__html:We}})]})}if(M){const w=o.option==="autoplay"?"autoplay=1":o.option==="mute"?"autoplay=1&mute=1":"mute=1";return e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"fixed top-0 left-0 w-full h-full z-[-2]",children:e.jsx("iframe",{loading:"lazy",src:`https://www.youtube.com/embed/${M[1]}?${w}&loop=1&playlist=${M[1]}&controls=0&showinfo=0&modestbranding=1&iv_load_policy=3`,className:"w-full h-full object-cover",frameBorder:"0",allow:"autoplay; fullscreen",allowFullScreen:!0})}),e.jsx("style",{children:` 37 .blur-overlay { 38 position: fixed; 39 top: 0; 40 left: 0; 41 width: 100%; 42 height: 100%; 43 backdrop-filter: blur(20px); 44 z-index: -1; 45 } 46 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{id:"bgVideo",loading:"lazy",className:"fixed top-0 left-0 w-full h-full object-cover",src:`https://www.youtube.com/embed/${M[1]}?${o.option}=1&mute=1&loop=1&playlist=${M[1]}`,title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",referrerPolicy:"strict-origin-when-cross-origin",allowFullScreen:!0})]})}if(Ye){let w=o.image;return w.includes("?compact=1")||(w+=(w.includes("?")?"&":"?")+"compact=1"),e.jsx("div",{className:"fixed top-0 left-0 w-full h-full flex justify-center items-center bg-black",children:e.jsx("iframe",{id:"bgVideo",src:w,className:"w-full h-full",frameBorder:"0",allowFullScreen:!0,title:"Embedded LinkedIn Post",scrolling:"yes"})})}return Pe?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 47 .blur-overlay { 48 position: fixed; 49 top: 0; 50 left: 0; 51 width: 100%; 52 height: 100%; 53 backdrop-filter: blur(20px); 54 z-index: -1; 55 } 56 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:`https://player.vimeo.com/video/${Pe[3]}?h=33160d1512&color=de0101`,className:"fixed top-0 left-0 w-full h-full object-cover",frameBorder:"0",allowFullScreen:!0})]}):Oe||Ze&&!o.image.includes("groups")?e.jsx("div",{className:"fixed top-0 left-0 w-full h-full",children:e.jsx("div",{className:"fb-post","data-href":o.image,"data-width":"1400","data-show-text":"true"})}):t==="mp4"?e.jsxs(e.Fragment,{children:[e.jsxs("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,className:"fixed top-0 left-0 w-full h-full object-cover z-[-3]",children:[e.jsx("source",{src:c,type:"video/mp4"}),"Your browser does not support the video tag."]}),e.jsx("style",{children:` 57 .blur-overlay { 58 position: fixed; 59 top: 0; 60 left: 0; 61 width: 100%; 62 height: 100%; 63 backdrop-filter: blur(20px); 64 z-index: -2; 65 } 66 `}),e.jsx("div",{className:"blur-overlay"}),e.jsxs("video",{id:"bgVideo",autoPlay:!0,loop:!0,muted:!0,playsInl
66ine:!0,className:"absolute inset-0 max-w-full max-h-full m-auto",controls:!0,children:[e.jsx("source",{src:c,type:"video/mp4"}),"Your browser does not support the video tag."]})]}):t==="glb"?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 67 .blur-overlay { 68 position: fixed; 69 top: 0; 70 left: 0; 71 width: 100%; 72 height: 100%; 73 backdrop-filter: blur(20px); 74 z-index: -1; 75 } 76 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("model-viewer",{src:c,alt:"3D model",className:"fixed top-0 left-0 w-full h-full",ar:!0,"auto-rotate":!0,"camera-controls":!0,"shadow-intensity":"1"})]}):je(o.image)?e.jsxs(e.Fragment,{children:[e.jsx("style",{children:` 77 .blur-overlay { 78 position: fixed; 79 top: 0; 80 left: 0; 81 width: 100%; 82 height: 100%; 83 backdrop-filter: blur(20px); 84 z-index: -1; 85 } 86 `}),e.jsx("div",{className:"blur-overlay"}),e.jsx("iframe",{loading:"lazy",id:"bgVideo",allow:"camera; microphone; fullscreen; display-capture; autoplay",src:o.image,className:"fixed top-0 left-0 w-full h-full",frameBorder:"0",allowFullScreen:!0,scrolling:"yes"})]}):e.jsx("iframe",{src:ge,className:"fixed top-0 left-0 w-full h-full border-none",allow:"microphone *; camera *; autoplay *; fullscreen *; display-capture *;",sandbox:`allow-forms allow-modals allow-orientation-lock allow-pointer-lock 87 allow-popups allow-popups-to-escape-sandbox allow-presentation 88 allow-same-origin allow-scripts allow-top-navigation 89 allow-top-navigation-by-user-activation allow-downloads allow-storage-access-by-user-activation`,allowFullScreen:!0,loading:"lazy",name:"binauralMixerFrame",allowTransparency:"true",scrolling:"yes"})},[o,ge,Z,je]);return e.jsxs(e.Fragment,{children:[e.jsxs(Xe,{children:[e.jsx("title",{children:"EZ Handle - Domain URLs for Your Funnels"}),He,e.jsx("style",{children:` 90 .react-tooltip { 91 z-index: 99999 !important; 92 opacity: 1 !important; 93 font-size: 12px; 94 padding: 4px 8px; 95 } 96 `})]}),e.jsx(se,{id:"nav-tooltip"}),e.jsx(se,{id:"action-tooltip"}),e.jsx(se,{id:"form-tooltip"}),e.jsx(se,{id:"modal-tooltip"}),e.jsx(Qe,{auth:K}),e.jsxs("main",{className:`relative flex justify-end p-4 min-h-screen overflow-hidden ${o!=null&&o.image&&pe(Z(o.image))?"blur-bg":""}`,children:[e.jsx("div",{className:"absolute inset-0 z-0",children:Be()}),T&&e.jsxs("div",{className:"relative mt-4 mx-auto bottom-4 z-50 backdrop-blur-sm p-4 rounded-xl border border-white-700 overflow-y-auto shadow-2xl",children:[e.jsx("button",{onClick:()=>ie(!1),className:"absolute top-2 right-2 w-8 h-8 bg-black rounded-full flex items-center justify-center z-50 hover:bg-gray-800 transition-colors focus:outline-none focus:ring-2 focus:ring-white","aria-label":"Close panel","data-tooltip-id":"action-tooltip","data-tooltip-content":"Close this panel",children:e.jsx(f,{icon:Ce,className:"text-white text-lg",style:{textShadow:"0.7px 0.7px 0 rgb(255,0,0), -0.7px -0.7px 0 rgb(0,255,255)"}})}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-4 space-y-4",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx("input",{type:"text",placeholder:"Search by token",className:"flex-grow bg-white text-gray-900 px-3 py-2 rounded-md focus:outline-none focus:ring-2 focus:ring-yellow-400 min-w-0",value:H,onChange:t=>le(t.target.value),onKeyPress:t=>t.key==="Enter"&&oe(),"data-tooltip-id":"form-tooltip","data-tooltip-content":"Enter a funnel token to
96search"}),e.jsxs("div",{className:"flex items-center",children:[e.jsxs("button",{className:`font-semibold px-3 py-2 flex items-center gap-1.5 whitespace-nowrap rounded-l-md border-r transition-colors ${L==="fuzzy"?"bg-green-600 text-white border-green-700 hover:bg-green-700":"bg-gray-600 text-gray-300 border-gray-700 hover:bg-gray-700"}`,onClick:()=>{W("fuzzy"),oe()},"data-tooltip-id":"form-tooltip","data-tooltip-content":"Fuzzy search finds similar matches",children:[e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:e.jsx("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z",clipRule:"evenodd"})}),"Fuzzy"]}),e.jsxs("button",{className:`font-semibold px-3 py-2 flex items-center gap-1.5 whitespace-nowrap rounded-r-md transition-colors ${L==="exact"?"bg-green-600 text-white hover:bg-green-700":"bg-gray-600 text-gray-300 hover:bg-gray-700"}`,onClick:()=>{W("exact"),oe()},"data-tooltip-id":"form-tooltip","data-tooltip-content":"Exact search finds only perfect matches",children:[e.jsx("span",{className:"text-sm",children:"ð"}),"Exact"]})]})]}),e.jsx("div",{className:"max-h-[65vh] overflow-y-auto custom-scrollbar space-y-2",children:U.map(t=>{var i,c;return e.jsxs("div",{className:"flex items-center p-4 gap-1 bg-[#5d0f6e] rounded-lg",children:[e.jsx("span",{className:"text-4xl select-none",children:"ð"}),e.jsx("div",{className:"flex-grow min-w-0",children:e.jsxs("div",{className:"flex flex-col gap-y-2",children:[e.jsxs("a",{href:`https://ez.wiki/${encodeURIComponent(t.token)}`,target:"_blank",className:"text-yellow-400 font-semibold truncate",rel:"noopener noreferrer","data-tooltip-id":"action-tooltip","data-tooltip-content":`Visit default URL: https://ez.wiki/${t.token}`,children:["https://ez.wiki/",t.token]}),(i=t.handle_domains)==null?void 0:i.map(s=>e.jsxs("a",{href:`https://${s.domain}.${s.domainselected}`,target:"_blank",className:"text-yellow-400 font-semibold truncate",rel:"noopener noreferrer","data-tooltip-id":"action-tooltip","data-tooltip-content":`Visit sub-domain: https://${s.domain}.${s.domainselected}`,children:["https://",s.domain,".",s.domainselected]},s.id)),(c=t.custom_domains)==null?void 0:c.map(s=>e.jsxs("a",{href:`https://${s.domainselected}/${s.domain}`,target:"_blank",className:"text-yellow-400 font-semibold truncate",rel:"noopener noreferrer","data-tooltip-id":"action-tooltip","data-tooltip-content":`Visit custom domain: https://${s.domainselected}/${s.domain}`,children:["https://",s.domainselected,"/",s.domain]},s.id)),e.jsx("p",{className:"text-purple-300 text-sm whitespace-nowrap",children:qe(t.created_at)})]})}),e.jsx("button",{className:"bg-yellow-400 text-black font-bold py-1 px-5 rounded-md text-sm hover:bg-yellow-500 transition-colors whitespace-nowrap",onClick:()=>Ae(t),"data-tooltip-id":"action-tooltip","data-tooltip-content":"Configure a custom domain handle for this funnel",children:"Add Domain Handle"})]},t.id)})}),_&&e.jsx("div",{className:"flex justify-center mt-4",children:e.jsx("button",{className:"bg-black text-white border border-white px-8 py-2 rounded-md font-semibold hover:bg-white hover:text-black transition-colors",onClick:Te,disabled:Q,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Load more funnels",children:Q?"Loading...":"Load More"})})]}),e.jsx("div",{className:"col-span-1 space-y-4",children:Fe?e.jsxs("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 space-y-4",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("h2",{className:"text-xl font-bold text-white",children:[e.jsx(f,{icon:Ge,className:"mr-2"}),"Domain Handle for: ",p==null?void 0:p.token]}),e.jsx("button",{onClick:()=>{ee(!1),q("ez.wiki"),y({show:!1,charCount:0,price:0,promoPrice:x||0,handle:"",domain:"ez.wiki",couponCode:"",buyingPrice:x||0,sellingPrice:0})},className:"text-gray-400 hover:text-white transition-colors","data-tooltip-id":"action-tooltip","data-tooltip-content":"Cancel and close this form",children:e.jsx(f,{icon:Ce})})]}),he&&e.jsx("div",{className:"mb-4 p-4 bg-green-100 border border-green-400 text-green-700 rounded-lg",children:he}),R&&e.jsx("div",{className:"mb-4 p-4 bg-red-100 border border-red-400 text-red-700 rounded-lg",children:R}),e.jsxs("form",{onSubmit:Ve,className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-yellow-400 font-medium",children:"New Domain Handle"}),e.jsxs("div",{className:"flex items-center bg-gray-700 border border-gray-600 rounded-lg overflow-hidden",children:[e.jsx("input",{type:"text",value:g,onChange:t=>{const i=t.target.value;J(i),y({...a,show:!1})},className:"flex-grow px-4 py-2 bg-gray-700 text-white focus:outline-none focus:ring-2 focus:ring-yellow-400",placeholder:"your-custom-handle",required:!0,title:"Only letters, numbers, and hyphens are allowed","data-tooltip-id":"form-tooltip","data-tooltip-content":"Enter your desired handle (e.g., 'my-brand')"}),e.jsx("select",{className:"px-4 py-2 bg-gray-600 text-gray-300 border-r border-gray-500 focus:outline-none",value:b,onChange:t=>{q(t.target.value),y({...a,domain:t.target.value,show:!1})},"data-tooltip-id":"form-tooltip","data-tooltip-content":"Select the domain extension for your handle",children:z==null?void 0:z.map(t=>e.jsxs("option",{value:t.domain,children:[".",t.domain]},t.id))}
96),e.jsx("button",{type:"button",className:`px-4 py-2 ${F.checking?"bg-gray-600 text-gray-300":F.available?"bg-green-600 text-white":"bg-red-600 text-white"}`,onClick:ve,disabled:F.checking,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Check if this handle is available",children:F.checking?"Checking...":F.available?"Available":"Unavailable"})]}),F.message&&e.jsx("p",{className:`text-sm ${F.available?"text-green-400":"text-red-400"}`,children:F.message})]}),a.show&&e.jsxs("div",{className:"mt-6 bg-gray-900/50 p-4 rounded-lg border border-gray-700",children:[e.jsxs("h3",{className:"text-yellow-400 font-medium mb-2",children:[e.jsx(f,{icon:Je,className:"mr-2"}),"Handle Purchase"]}),e.jsxs("div",{className:"mb-4",children:[e.jsxs("p",{className:"text-white",children:[a.handle,".",a.domain]}),e.jsxs("p",{className:"text-gray-300 text-sm",children:[a.charCount," letters = EZ$",(Number(a.price)||0).toFixed(2)]})]}),e.jsxs("div",{className:"mb-4",children:[e.jsx("label",{className:"text-gray-300 text-sm",children:"Payment Method"}),e.jsxs("div",{className:"flex gap-2 mt-1",children:[e.jsx("button",{type:"button",className:`flex-1 py-2 rounded-md border ${C==="bee"?"bg-yellow-400 text-black border-yellow-500":"bg-gray-700 text-gray-300 border-gray-600"}`,onClick:()=>fe("bee"),"data-tooltip-id":"form-tooltip","data-tooltip-content":"Pay with EZ$ tokens",children:"EZ$"}),e.jsx("button",{type:"button",className:`flex-1 py-2 rounded-md border ${C==="usd"?"bg-green-500 text-white border-green-600":"bg-gray-700 text-gray-300 border-gray-600"}`,onClick:()=>fe("usd"),"data-tooltip-id":"form-tooltip","data-tooltip-content":"Pay with USD via Stripe",children:"US$"})]})]}),C==="bee"?e.jsxs(e.Fragment,{children:[a.couponValid?e.jsx("div",{className:"bg-purple-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-green-400 font-semibold",children:["Special Offer: Lifetime Ownership for EZ$",a.buyingPrice.toFixed(2)]})}):a.promoPrice>0&&e.jsx("div",{className:"bg-purple-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-green-400 font-semibold",children:["Pre-launch Price: EZ$",a.promoPrice.toFixed(2)]})}),a.couponValid&&a.buyingPrice<a.promoPrice&&a.promoPrice>0&&e.jsx("div",{className:"bg-purple-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-yellow-300 text-sm mt-1",children:["You're saving EZ$",(a.promoPrice-a.buyingPrice).toFixed(2),"!"]})})]}):e.jsxs(e.Fragment,{children:[a.couponValid?e.jsx("div",{className:"bg-blue-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-green-400 font-semibold",children:["Special Offer: Lifetime Ownership for US$",(a.buyingPrice*j).toFixed(2)]})}):a.promoPrice>0&&e.jsx("div",{className:"bg-blue-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-green-400 font-semibold",children:["Pre-launch Price: US$",(a.promoPrice*j).toFixed(2)]})}),a.couponValid&&a.buyingPrice<a.promoPrice&&a.promoPrice>0&&e.jsx("div",{className:"bg-blue-900/30 p-3 rounded-lg mb-4",children:e.jsxs("p",{className:"text-yellow-300 text-sm mt-1",children:["You're saving US$",((a.promoPrice-a.buyingPrice)*j).toFixed(2),"!"]})})]}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("label",{className:"text-gray-300 text-sm",children:"Coupon Code"}),e.jsx("input",{type:"text",className:"w-full bg-gray-700 text-white px-3 py-2 rounded-md border border-gray-600 focus:outline-none focus:ring-2 focus:ring-yellow-400",placeholder:"Enter coupon code",value:a.couponCode,onChange:t=>y({...a,couponCode:t.target.value}),"data-tooltip-id":"form-tooltip","data-tooltip-content":"Enter a coupon code for a discount"})]}),a.couponCode&&e.jsx("div",{className:`mt-2 text-sm ${a.couponValid?"text-green-400":"text-red-400"}`,children:a.couponMessage||"Validating coupon..."}),e.jsxs("div",{children:[e.jsx("label",{className:"text-gray-300 text-sm",children:"NYP (optional)"}),e.jsx("input",{type:"number",className:"input-no-spinner w-full bg-gray-700 text-white px-3 py-2 rounded-md border border-gray-600 focus:outline-none focus:ring-2 focus:ring-yellow-400",value:a.sellingPrice??"",onChange:t=>{const i=t.target.value;y({...a,sellingPrice:i===""?void 0:parseFloat(i)})},min:"0",step:"1",placeholder:"Set price if you want to list in marketplace","data-tooltip-id":"form-tooltip","data-tooltip-content":"Name Your Price: Set a price to list this on the marketplace after purchase."})]})]}),e.jsx("div",{className:"mt-4 text-xs text-gray-400",children:e.jsxs("div",{className:"flex items-start",children:[e.jsx("input",{type:"checkbox",id:"terms-checkbox",required:!0,className:"mt-1 mr-2","data-tooltip-id":"form-tooltip","data-tooltip-content":"You must agree to the terms to proceed"}),e.jsx("label",{htmlFor:"terms-checkbox",children:"By claiming your handle you agree to the current user T&C and future changes of the T&C"})]})}),e.jsx("button",{type:"submit",className:"w-full mt-4 bg-green-600 hover:bg-green-700 text-white font-bold py-2 px-4 roun
96ded-md transition-colors",disabled:Q,"data-tooltip-id":"action-tooltip","data-tooltip-content":"Finalize your handle purchase",children:Q?"Processing...":C==="bee"?`Buy Handle for EZ$${O.toFixed(2)}`:`Buy Handle for US$${ue.toFixed(2)}`})]})]}),!a.show&&e.jsxs("div",{className:"bg-gray-900/50 p-4 rounded-lg border border-gray-700",children:[e.jsxs("h3",{className:"text-yellow-400 font-medium mb-2",children:[e.jsx(f,{icon:ze,className:"mr-2"}),"About Domain Handles"]}),e.jsxs("ul",{className:"text-gray-300 text-sm space-y-2 list-disc pl-5",children:[e.jsx("li",{children:"Create memorable, branded URLs for your funnels"}),e.jsx("li",{children:"Improve sharing and marketing of your content"}),e.jsx("li",{children:"Handle must be unique across all users"}),e.jsx("li",{children:"Only letters, numbers, and hyphens allowed"}),e.jsx("li",{children:"Minimum 3 characters, maximum 32 characters"})]})]})]}):e.jsx("div",{className:"bg-gray-800/80 border border-gray-700 rounded-lg p-6 flex flex-col items-center justify-center h-full",children:e.jsxs("div",{className:"text-center max-w-md",children:[e.jsx(f,{icon:et,className:"text-6xl text-yellow-400 mb-4","data-tooltip-id":"form-tooltip","data-tooltip-content":"Domain Handle Management Area"}),e.jsx("h2",{className:"text-2xl font-bold text-white mb-2","data-tooltip-id":"form-tooltip","data-tooltip-content":"Create memorable URLs for your funnels",children:"Domain Handle Management"}),e.jsx("p",{className:"text-gray-300 mb-6",children:"Select a funnel from the list to assign or update its Domain handle. Domain handles make your funnel URLs more memorable and branded."}),e.jsxs("div",{className:"bg-gray-900/50 p-4 rounded-lg border border-gray-700 text-left",children:[e.jsxs("h3",{className:"text-yellow-400 font-medium mb-2",children:[e.jsx(f,{icon:ze,className:"mr-2"}),"Example Handles:"]}),e.jsxs("ul",{className:"text-gray-300 text-sm space-y-1",children:[e.jsxs("li",{children:["⢠",e.jsx("span",{className:"text-white",children:"yourbrand"}),".ez.wiki"]}),e.jsxs("li",{children:["⢠",e.jsx("span",{className:"text-white",children:"product-name"}),".ez.wiki"]}),e.jsxs("li",{children:["⢠",e.jsx("span",{className:"text-white",children:"company-2023"}),".ez.wiki"]})]})]})]})})})]})]}),Ee&&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-sm w-full relative max-h-[90vh] overflow-y-auto",children:[e.jsx("button",{onClick:()=>{de(!1),te(1),l("")},className:"sticky top-0 right-0 ml-auto text-white/70 hover:text-white transition-colors z-10",disabled:Y,"data-tooltip-id":"modal-tooltip","data-tooltip-content":"Close payment window",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"})})}),e.jsxs("div",{className:"space-y-6",children:[R&&e.jsxs("div",{className:"bg-red-500/90 text-white p-3 rounded-lg flex items-center gap-2",children:[e.jsx(f,{icon:_e}),R]}),Y&&e.jsx("div",{className:"absolute inset-0 bg-black/50 flex items-center justify-center rounded-lg",children:e.jsx(f,{icon:re,className:"animate-spin text-4xl text-white"})}),Ie===1?e.jsxs(e.Fragment,{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:"Purchase Handle"}),e.jsxs("p",{className:"text-[#a8d0e6]",children:["You'll be charged US$",ue.toFixed(2)]})]}),e.jsxs("div",{className:"mt-6",children:[e.jsxs("div",{className:"flex items-center bg-white rounded-md",children:[e.jsx("div",{className:"p-3 bg-[#4CAF50] rounded-l-md",children:e.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-6 w-6 text-white",f
96ill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),e.jsx("input",{type:"email",value:B,onChange:t=>Ue(t.target.value),className:"w-full p-3 bg-white text-gray-800 outline-none rounded-r-md",placeholder:"Email",required:!0,disabled:Y,"data-tooltip-id":"modal-tooltip","data-tooltip-content":"Your receipt will be sent to this email address"})]}),R&&e.jsx("div",{className:"mt-2 text-[#ff6b6b] text-sm",children:R})]}),e.jsx("div",{className:"mt-6",children:e.jsx("button",{onClick:Re,disabled:Y,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","data-tooltip-id":"modal-tooltip","data-tooltip-content":"Proceed to the secure payment form",children:Y?e.jsxs(e.Fragment,{children:[e.jsx(f,{icon:re,className:"animate-spin mr-2"}),"Processing..."]}):"Continue to Payment"})}),e.jsxs("div",{className:"mt-4 text-center",children:[e.jsx("p",{className:"text-xs text-[#a8d0e6]",children:"Payment secured by STRIPE. You'll be taken to a thank you page after the payment."}),e.jsxs("p",{className:"mt-1 text-xs text-[#a8d0e6]",children:[e.jsx(Se,{href:"/terms",className:"hover:underline text-white",children:"Terms"})," and"," ",e.jsx(Se,{href:"/privacy",className:"hover:underline text-white",children:"Privacy"}),"."]})]})]}):e.jsx(at,{stripe:lt,options:{clientSecret:me,appearance:{theme:"night",variables:{colorPrimary:"#FFD700",colorBackground:"#235A72",colorText:"white",colorDanger:"#ff6b6b",fontFamily:"Inter, system-ui, sans-serif"}}},children:me?e.jsx(nt,{price:ue,email:B,clientSecret:me,onSuccess:De,onBack:()=>te(1),onError:l}):e.jsx("div",{className:"flex items-center justify-center py-8",children:e.jsx(f,{icon:re,className:"animate-spin text-2xl"})})})]})]})})]})]})}export{yt 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.