import{w as S,o as C,j as N,C as l,l as c,A as a,B as g,u as e,n as t,t as A,x as h,T as b,D as d,H as B,e as j}from"./Button-DnvJ7MH3.js";import{u as q,S as E}from"./usePwaInstall-HB_UDdOh.js";import{S as P}from"./smartphone-BQ2R3CLp.js";import{X as y}from"./x-CZb06UDe.js";const T={key:0,class:"fixed bottom-0 left-0 right-0 z-50 border-t border-zinc-200 bg-white p-4 shadow-2xl dark:border-zinc-700 dark:bg-zinc-800"},V={class:"mx-auto flex max-w-md items-center justify-between gap-4"},D={class:"flex items-center gap-3"},F={class:"flex h-12 w-12 items-center justify-center rounded-xl bg-sky-500/20 text-sky-500"},L={class:"font-semibold text-zinc-900 dark:text-zinc-100"},G={class:"flex items-center gap-2"},H={key:0,class:"fixed bottom-4 left-4 right-4 z-50 max-w-sm rounded-2xl border border-zinc-200 bg-white p-5 shadow-2xl dark:border-zinc-700 dark:bg-zinc-800"},M={class:"flex items-start gap-3"},U={class:"flex h-10 w-10 shrink-0 items-center justify-center rounded-xl bg-emerald-500/20 text-emerald-500"},X={class:"min-w-0 flex-1"},Q={__name:"PwaInstallPrompt",props:{appName:{type:String,default:"App"},slug:{type:String,required:!0}},setup(u){const k=u,{installPromptEvent:m,showIosInstructions:p,isStandalone:n,isIos:x,tryGetDismissed:f,dismiss:i,triggerInstall:z,registerListener:w,unregisterListener:_}=q(k.slug),r=j(!1);S(m,v=>{v&&!n.value&&!f()&&(r.value=!0)},{immediate:!0});function I(){z().then(()=>{r.value=!1})}return C(()=>{n.value||(w(),x.value&&!f()&&!n.value&&(p.value=!0))}),N(()=>{_()}),(v,s)=>(l(),c(B,null,[a(b,{"enter-active-class":"transition duration-300 ease-out","enter-from-class":"translate-y-full opacity-0","enter-to-class":"translate-y-0 opacity-100","leave-active-class":"transition duration-200 ease-in","leave-from-class":"translate-y-0 opacity-100","leave-to-class":"translate-y-full opacity-0"},{default:g(()=>[r.value&&e(m)&&!e(n)?(l(),c("div",T,[t("div",V,[t("div",D,[t("div",F,[a(e(P),{class:"h-6 w-6"})]),t("div",null,[t("p",L,"Instalar "+A(u.appName),1),s[3]||(s[3]=t("p",{class:"text-sm text-zinc-500 dark:text-zinc-400"},"Acesso rápido pela tela inicial",-1))])]),t("div",G,[t("button",{type:"button",class:"rounded-xl bg-sky-500 px-4 py-2.5 font-medium text-white shadow-lg transition hover:bg-sky-600 active:scale-[0.98]",onClick:I}," Instalar "),t("button",{type:"button",class:"shrink-0 rounded-lg p-2 text-zinc-400 transition hover:bg-zinc-100 hover:text-zinc-600 dark:hover:bg-zinc-700 dark:hover:text-zinc-300","aria-label":"Fechar",onClick:s[0]||(s[0]=o=>{e(i)(),r.value=!1})},[a(e(y),{class:"h-5 w-5"})])])])])):h("",!0)]),_:1}),a(b,{"enter-active-class":"transition duration-300 ease-out","enter-from-class":"opacity-0 scale-95","enter-to-class":"opacity-100 scale-100","leave-active-class":"transition duration-200 ease-in","leave-from-class":"opacity-100 scale-100","leave-to-class":"opacity-0 scale-95"},{default:g(()=>[e(p)&&e(x)&&!e(n)?(l(),c("div",H,[t("div",M,[t("div",U,[a(e(E),{class:"h-5 w-5"})]),t("div",X,[s[4]||(s[4]=t("p",{class:"font-semibold text-zinc-900 dark:text-zinc-100"},"Adicionar à tela inicial",-1)),s[5]||(s[5]=t("p",{class:"mt-1 text-sm leading-relaxed text-zinc-600 dark:text-zinc-400"},[d(" No Safari, toque no ícone "),t("strong",null,"Compartilhar"),d(" (quadrado com seta para cima) na barra inferior. Em seguida, toque em "),t("strong",null,"« Adicionar à Tela de Início »"),d(". ")],-1)),t("button",{type:"button",class:"mt-4 w-full rounded-xl bg-emerald-500 px-4 py-2.5 font-medium text-white transition hover:bg-emerald-600",onClick:s[1]||(s[1]=(...o)=>e(i)&&e(i)(...o))}," Entendi ")]),t("button",{type:"button",class:"shrink-0 rounded-lg p-1.5 text-zinc-400 hover:bg-zinc-100 hover:text-zinc-600 dark:hover:bg-zinc-700 dark:hover:text-zinc-300","aria-label":"Fechar",onClick:s[2]||(s[2]=(...o)=>e(i)&&e(i)(...o))},[a(e(y),{class:"h-5 w-5"})])])])):h("",!0)]),_:1})],64))}};export{Q as _};
