const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./main-CEJ7cS7B.js","./react-CYZQF_UV.js","./livekit-IBzVVcEu.js","./three-Cs75aIhT.js","./index-Ec65i0Q1.js","./web3-D0IbNXhH.js","./main-D26uvIQV.css","./index-B6Jvkj-V.js"])))=>i.map(i=>d[i]);
import{_ as i}from"./three-Cs75aIhT.js";import{C as u}from"./index-Ec65i0Q1.js";import"./react-CYZQF_UV.js";import"./livekit-IBzVVcEu.js";const a=3,w=15,p=30*24*60*60*1e3,f=2500,s="review:winCount",c="review:lastPromptTs";async function n(){const{Preferences:t}=await i(async()=>{const{Preferences:e}=await import("./main-CEJ7cS7B.js").then(r=>r.i);return{Preferences:e}},__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url);return t}async function P(){try{const t=await n(),{value:e}=await t.get({key:s});return e&&parseInt(e,10)||0}catch{return 0}}async function l(t){try{await(await n()).set({key:s,value:String(t)})}catch{}}async function m(){try{const t=await n(),{value:e}=await t.get({key:c});return e&&parseInt(e,10)||0}catch{return 0}}async function y(t){try{await(await n()).set({key:c,value:String(t)})}catch{}}let o=!1;async function _(){if(!o){o=!0;try{const{InAppReview:t}=await i(async()=>{const{InAppReview:e}=await import("./index-B6Jvkj-V.js");return{InAppReview:e}},__vite__mapDeps([7,3,1,2,4]),import.meta.url);await t.requestReview(),console.log("[InAppReview] Review prompt shown")}catch(t){console.warn("[InAppReview] requestReview failed:",t)}finally{o=!1}}}function v(t,e){if(t<a)return!1;const r=Date.now();return e>0&&r-e<p?!1:t===a||(t-a)%w===0}async function E(){try{if(!u.isNativePlatform())return;const t=await P()+1;await l(t);const e=await m();if(!v(t,e))return;setTimeout(async()=>{try{await y(Date.now()),await _()}catch(r){console.warn("[InAppReview] Delayed prompt error:",r)}},f)}catch(t){console.warn("[InAppReview] maybePromptReview error:",t)}}export{E as maybePromptReview};
