1import{r as n,dJ as u,j as e,Q as h,T as f,V as j,W as N,Y as w,B as d,L as x}from"./index-CPbGo_jB.js";import{S as y,a as g,b as v}from"./square-plus-BCzOsvHe.js";import{C as S}from"./circle-check-big-D_jJm4Ax.js";import{D as C}from"./download-DAku0S5T.js";function I(){const[s,a]=n.useState(null),[i,r]=n.useState(!1),[c,l]=n.useState(!1);n.useEffect(()=>{if(typeof window>"u")return;l(u());const t=m=>{m.preventDefault(),a(m),r(!0)},o=()=>{l(!0),r(!1),a(null)};return window.addEventListener("beforeinstallprompt",t),window.addEventListener("appinstalled",o),()=>{window.removeEventListener("beforeinstallprompt",t),window.removeEventListener("appinstalled",o)}},[]);const p=n.useCallback(async()=>{if(!s)return!1;try{await s.prompt();const{outcome:t}=await s.userChoice;return t==="accepted"?(a(null),r(!1),!0):!1}catch(t){return console.error("Error prompting install:",t),!1}},[s]);return{canInstall:i,isInstalled:c,promptInstall:p}}const b=()=>{const{canInstall:s,isInstalled:a,promptInstall:i}=I(),r=typeof navigator<"u"&&/iPad|iPhone|iPod/.test(navigator.userAgent),c=typeof navigator<"u"&&/^((?!chrome|android).)*safari/i.test(navigator.userAgent),l=async()=>{await i()};return e.jsx("div",{className:"min-h-screen bg-background flex items-center justify-center p-4",children:e.jsxs(h,{className:"w-full max-w-md",children:[e.jsxs(f,{className:"text-center",children:[e.jsx("div",{className:"mx-auto mb-4 h-16 w-16 rounded-2xl bg-primary flex items-center justify-center",children:e.jsx(y,{className:"h-8 w-8 text-primary-foreground"})}),e.jsx(j,{className:"text-2xl",children:"Install SoMerch"}),e.jsx(N,{children:"Get the full app experience on your device"})]}),e.jsx(w,{className:"space-y-6",children:a?e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("div",{className:"mx-auto h-12 w-12 rounded-full bg-green-100 flex items-center justify-center",children:e.jsx(S,{className:"h-6 w-6 text-green-600"})}),e.jsx("p",{className:"text-muted-foreground",children:"SoMerch is already installed on your device!"}),e.jsx(d,{asChild:!0,className:"w-full",children:e.jsx(x,{to:"/",children:"Open App"})})]}):s?e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[e.jsx("p",{children:"â Works offline"}),e.jsx("p",{children:"â Fast and responsive"}),e.jsx("p",{children:"â Home screen access"}),e.jsx("p",{children:"â Push notifications"})]}),e.jsxs(d,{onClick:l,className:"w-full",size:"lg",children:[e.jsx(C,{className:"mr-2 h-5 w-5"}),"Install App"]})]}):r||c?e.jsxs("div",{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground text-center",children:"To install SoMerch on your iOS device:"}),e.jsxs("ol",{className:"space-y-4 text-sm",children:[e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 h-6 w-6 rounded-full bg-primary/10 flex items-center justify-center text-xs font-medium text-primary",children:"1"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Tap the"}),e.jsx(g,{className:"h-4 w-4"}),e.jsx("span",{children:"Share button"})]})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 h-6 w-6 rounded-full bg-primary/10 flex items-center justify-center text-xs font-medium text-primary",children:"2"}),e.jsx("span",{children:'Scroll down and tap "Add to Home Screen"'})]}),e.jsxs("li",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"flex-shrink-0 h-6 w-6 rounded-full bg-primary/10 flex items-center justify-center text-xs font-medium text-primary",children:"3"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("span",{children:"Tap"}),e.jsx(v,{className:"h-4 w-4"}),e.jsx("span",{children:'"Add"'})]})]})]}),e.jsx("div",{className:"pt-2 border-t",children:e.jsx("p",{className:"text-xs text-muted-foreground text-center",children:"Make sure you're using Safari for the best experience"})})]}):e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Your browser doesn't support app installation. Try using Chrome, Edge, or Safari."}),e.jsx(d,{asChild:!0,variant:"outline",className:"w-full",children:e.jsx(x,{to:"/",children:"Continue in Browser"})})]})})]})})},L=b;export{L as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.