import{r as l,Y as f,f as v,x as y,cb as b,q as e,F as p,s as n,cc as x,cd as m,ce as N,cf as C,L as k,cg as h,A as w,ch as q,bj as M}from"./index-c51caa49.js";import{d as E}from"./index-0b77d27e.js";import{i as P}from"./index-3de0a44a.js";var F={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zM641.7 520.8L442.3 677.6c-7.4 5.8-18.3.6-18.3-8.8V355.3c0-9.4 10.9-14.7 18.3-8.8l199.4 156.7a11.2 11.2 0 010 17.6z"}}]},name:"play-square",theme:"filled"};const S=F;var T=function(s,a){return l.createElement(f,v({},s,{ref:a,icon:S}))};const A=l.forwardRef(T);const g="/assets/cross-ca595c66.svg",I="/assets/sub-20-off-9c8ce93b.svg",L="/assets/badge-20-off-58851935.svg",$="/assets/invite-5172b05c.svg",_="/assets/letter-a190dc8a.svg",B="/assets/congratulations-193be256.svg",Q="/assets/communication-22d101bd.svg",j="/assets/share-5c1495fd.svg",Y=t=>`https://t.me/Roymate_bot?start=${t}`;function z(t,s,a,i){return e("div",{className:"quota-popup-container",children:n("div",{className:"quota-popup",children:[e("div",{className:"close-button",children:e("img",{src:g,onClick:s})}),e("div",{className:"art-container",children:e("img",{src:$})}),n("div",{className:"text-container",children:[e("h1",{children:"Invite and Earn"}),e("div",{className:"horizontal-line"}),n("p",{children:["For every friend you invite who subscribes, ",e("span",{style:{fontWeight:600},children:"you earn 30% of their subscription plan's message count."})]}),n("div",{className:"earn-info",children:[n("p",{style:{marginLeft:"1rem"},children:[e("img",{src:_}),"Share link to your friends"]}),n("p",{style:{marginLeft:"1rem"},children:[e("img",{src:B}),"They come and subscribe"]}),n("p",{style:{display:"flex",marginLeft:"1rem",alignItems:"flex-start"},children:[e("img",{src:Q}),"You earn 30% message quota",e("br",{})," You never have to queue during peak times"]})]}),n("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"},className:"quota-btn main-btn",onClick:()=>{a(),x()},children:[e("img",{style:{marginRight:"7px"},src:j}),e("span",{children:"Copy Link"})]})]})]})})}function R(t,s,a,i,o){const c=e(k,{className:"foot-link",to:"/pricing",style:{color:"#1c7aff"},children:"View More Plans"}),r=!i&&E(t),d=P(t);return m.showEarnWatchButton(),e("div",{className:"quota-popup-container",children:n("div",{className:"quota-popup",children:[e("div",{className:"close-button",children:e("img",{src:g,onClick:a})}),e("div",{className:"art-container",children:e("img",{src:I})}),n("div",{className:"text-container",children:[e("h1",{children:"Need More Messages?"}),e("div",{className:"horizontal-line"}),e("p",{children:"You've used up your trial quota. Subscribe now to enjoy a vast messaging allowance."}),n("div",{className:"pricing-info",children:[e("div",{className:"discount-corner",children:e("img",{src:L})}),e("h2",{children:"Classic"}),n("p",{style:{marginTop:0},children:[e("span",{className:"big-blue",children:"$7.99"}),e("span",{className:"small-blue",children:"/mo"}),e("span",{style:{textDecoration:"line-through"},children:"$9.99"})]}),n("ul",{children:[e("li",{children:"5,000 Messages /Month"}),e("li",{children:"Better Replies & Memory"})]}),e("p",{style:{color:"white",textAlign:"center"},children:"$23.98 for 3 months"})]}),r&&c,e("div",{className:"quota-btn main-btn",onClick:()=>{N(),o("/pricing")},children:"Subscribe & Continue"}),e("div",{className:"quota-btn subsidiary-btn",style:{whiteSpace:"nowrap"},onClick:()=>{var u;(u=window.gtag)==null||u.call(window,"event","Message_quota_popup_dearone_click"),location.href=Y("nsfwcharai-message-quota-end")},children:"Get 50 More Free Messages"}),n("div",{hidden:!d,className:"quota-btn subsidiary-btn",style:{border:"none",marginBottom:0,paddingBottom:0},onClick:()=>{m.clickEarnWatchButton(),o("/google-ad")},children:[e(A,{}),e("span",{style:{paddingLeft:6},children:"Earn by Watching"})]}),r?e("div",{className:"quota-btn subsidiary-btn",style:{border:"none"},onClick:()=>{s("earn-free"),C()},children:"Invite and Earn"}):c]})]})})}const U=({enable:t,type:s,profile:a,setType:i,close:o,copyLink:c})=>{const r=y();l.useEffect(()=>{s=="earn-free"&&t&&b()},[s,t]);let d=!1;if(a.utm&&(d=a.utm.includes("utm_source=google-ads")||a.utm.includes("utm_source=fb")),!t)return e(p,{});switch(s){case"earn-free":return z(i,o,c);case"sub-20-off":return R(a,i,o,d,r)}},W=async t=>{try{await navigator.clipboard.writeText(t),h.info("The invitation link has been copied to the clipboard.")}catch(s){console.error("Failed to copy: ",s),G(t)}},G=t=>{const s=document.createElement("textarea");s.value=t,s.style.position="absolute",s.style.left="-9999px",document.body.appendChild(s),s.focus(),s.select();try{const i=document.execCommand("copy")?"Your invitation link is copied and ready to share with friends.":"Failed to copy invite link";h.info(i)}catch(a){console.error("Fallback method failed: ",a)}finally{document.body.removeChild(s)}},O=({open:t,onModalClose:s})=>{const{profile:a,localData:i}=l.useContext(w),[o,c]=l.useState("sub-20-off");return l.useEffect(()=>{t&&q()},[t]),a?e(U,{enable:t,type:o,profile:a,setType:async r=>c(r),close:async()=>s(),copyLink:async()=>W(`${window.location.protocol}//${window.location.host}/?ref=${M(a)}`)}):e(p,{})};export{O as C,U as Q,g as a,W as c,Y as g};