const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DsXzAiAl.js","./index-BnSVhUZb.css","./index-Don9Oy5g.js"])))=>i.map(i=>d[i]);
import{C as u,_ as i}from"./index-DsXzAiAl.js";const n=3,f=15,w=720*60*60*1e3,P=2500,c="review:winCount",o="review:lastPromptTs";async function r(){const{Preferences:t}=await i(async()=>{const{Preferences:e}=await import("./index-DsXzAiAl.js").then(a=>a.i);return{Preferences:e}},__vite__mapDeps([0,1]),import.meta.url);return t}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 y(t){try{await(await r()).set({key:c,value:String(t)})}catch{}}async function p(){try{const t=await r(),{value:e}=await t.get({key:o});return e&&parseInt(e,10)||0}catch{return 0}}async function l(t){try{await(await r()).set({key:o,value:String(t)})}catch{}}let s=!1;async function m(){if(!s){s=!0;try{const{InAppReview:t}=await i(async()=>{const{InAppReview:e}=await import("./index-Don9Oy5g.js");return{InAppReview:e}},__vite__mapDeps([2,0,1]),import.meta.url);await t.requestReview()}catch{}finally{s=!1}}}function v(t,e){if(t<n)return!1;const a=Date.now();return e>0&&a-e<w?!1:t===n||(t-n)%f===0}async function T(){try{if(!u.isNativePlatform())return;const t=await _()+1;await y(t);const e=await p();if(!v(t,e))return;setTimeout(async()=>{try{await l(Date.now()),await m()}catch{}},P)}catch{}}export{T as maybePromptReview};
