import{q as e,s as r,r as c,A as h,x as v,bk as f,bj as N,bl as g,bm as y}from"./index-c51caa49.js";import{a as u,c as b,Q as k,g as C}from"./ChatMessageQuotaEndModal-78c62b55.js";import{d as w}from"./index-0b77d27e.js";const x="/assets/check-in-c2e8863b.png";function q(a,t,n){const i=c.useRef(t);i.current=t,c.useEffect(()=>{if(a){const s=setTimeout(i.current,n);return()=>{clearTimeout(s)}}},[a,n])}const D=({onClose:a,title:t,titleIcon:n,content:i,onOk:s,btnTxt:o})=>e("div",{className:"quota-popup-container",children:r("div",{className:"quota-popup",children:[e("div",{className:"close-button",children:e("img",{src:u,onClick:a})}),n?e("div",{className:"art-container",children:e("img",{src:n})}):e("div",{style:{height:"40px"},className:"art-container"}),r("div",{className:"text-container",children:[e("h1",{children:t}),e("div",{className:"horizontal-line"}),i,e("div",{className:"quota-btn main-btn",onClick:s,children:o})]})]})}),E=({enable:a,close:t,onOpen:n})=>{const[i,s]=c.useState(!1),{profile:o}=c.useContext(h),[p,l]=c.useState(!1),m=v();return q(a,()=>{s(!0),n()},500),c.useEffect(()=>{a&&i&&f()},[a,i]),!a||!i||!o?null:p?e(k,{enable:!0,type:"earn-free",profile:o,setType:async()=>"earn-free",close:()=>{s(!1),l(!1)},copyLink:()=>b(`${window.location.protocol}//${window.location.host}/?ref=${N(o)}`)}):i?e("div",{className:"quota-popup-container",children:r("div",{className:"quota-popup",children:[e("div",{className:"close-button",children:e("img",{src:u,onClick:t})}),e("div",{className:"art-container",children:e("img",{src:x})}),r("div",{className:"text-container",children:[e("h1",{children:"Daily Check-in Bonus"}),e("div",{className:"horizontal-line"}),e("p",{className:"no-padding-p",children:"You've earned"}),e("p",{className:"highlight-p",children:"50 free messages!"}),e("div",{className:"daily-check-in-info",children:e("p",{children:"Bookmark our website to return tomorrow, or upgrade for even more."})}),e("div",{className:"quota-btn main-btn",onClick:()=>{g(),m("/pricing")},children:"Upgrade Now"}),e("div",{className:"quota-btn subsidiary-btn",style:{whiteSpace:"nowrap"},onClick:()=>{var d;(d=window.gtag)==null||d.call(window,"event","Daily_active_dearone_click"),location.href=C("nsfwcharai-daily-bonus")},children:"Claim Your Extra 50 Free Messages"}),w(o)&&e("div",{className:"quota-btn subsidiary-btn",style:{border:"none"},onClick:()=>{l(!0),y()},children:"Invite and Earn"})]})]})}):null};export{E as C,D as a};