const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/main-bNxqLkof.js","assets/index-ComZzUQM.js","assets/main-Jpa1YoBA.css","assets/index-fSLzYZDo.js"])))=>i.map(i=>d[i]);
import{_ as s}from"./index-ComZzUQM.js";import{am as u}from"./main-bNxqLkof.js";const a=3,w=15,f=30*24*60*60*1e3,p=2500,i="review:winCount",c="review:lastPromptTs";async function r(){const{Preferences:t}=await s(async()=>{const{Preferences:e}=await import("./main-bNxqLkof.js").then(n=>n.aU);return{Preferences:e}},__vite__mapDeps([0,1,2]));return t}async function P(){try{const t=await r(),{value:e}=await t.get({key:i});return e&&parseInt(e,10)||0}catch{return 0}}async function y(t){try{await(await r()).set({key:i,value:String(t)})}catch{}}async function _(){try{const t=await r(),{value:e}=await t.get({key:c});return e&&parseInt(e,10)||0}catch{return 0}}async function l(t){try{await(await r()).set({key:c,value:String(t)})}catch{}}let o=!1;async function v(){if(!o){o=!0;try{const{InAppReview:t}=await s(async()=>{const{InAppReview:e}=await import("./index-fSLzYZDo.js");return{InAppReview:e}},__vite__mapDeps([3,1,0,2]));await t.requestReview(),console.log("[InAppReview] Review prompt shown")}catch(t){console.warn("[InAppReview] requestReview failed:",t)}finally{o=!1}}}function R(t,e){if(t<a)return!1;const n=Date.now();return e>0&&n-e<f?!1:t===a||(t-a)%w===0}async function T(){try{if(!u.isNativePlatform())return;const t=await P()+1;await y(t);const e=await _();if(!R(t,e))return;setTimeout(async()=>{try{await l(Date.now()),await v()}catch(n){console.warn("[InAppReview] Delayed prompt error:",n)}},p)}catch(t){console.warn("[InAppReview] maybePromptReview error:",t)}}export{T as maybePromptReview};
