firebase-os 1.1.7 → 1.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -599,7 +599,7 @@ service firebase.storage {
599
599
  }
600
600
  }
601
601
  }
602
- `,yHn=[{key:`VITE_FIREBASE_API_KEY`,label:`API Key`},{key:`VITE_FIREBASE_AUTH_DOMAIN`,label:`Auth Domain`},{key:`VITE_FIREBASE_PROJECT_ID`,label:`Project ID`},{key:`VITE_FIREBASE_STORAGE_BUCKET`,label:`Storage Bucket`},{key:`VITE_FIREBASE_MESSAGING_SENDER_ID`,label:`Messaging Sender ID`},{key:`VITE_FIREBASE_APP_ID`,label:`App ID`}];function bHn(e){let t;try{switch(e){case`VITE_FIREBASE_API_KEY`:t=void 0;break;case`VITE_FIREBASE_AUTH_DOMAIN`:t=void 0;break;case`VITE_FIREBASE_PROJECT_ID`:t=void 0;break;case`VITE_FIREBASE_STORAGE_BUCKET`:t=void 0;break;case`VITE_FIREBASE_MESSAGING_SENDER_ID`:t=void 0;break;case`VITE_FIREBASE_APP_ID`:t=void 0;break;case`VITE_ADMIN_EMAILS`:t=void 0;break}if(t&&typeof t==`string`&&t.trim()!==``)return t}catch{}try{let t=localStorage.getItem(`firebase_config`);if(t){let n=JSON.parse(t),r={VITE_FIREBASE_API_KEY:`apiKey`,VITE_FIREBASE_AUTH_DOMAIN:`authDomain`,VITE_FIREBASE_PROJECT_ID:`projectId`,VITE_FIREBASE_STORAGE_BUCKET:`storageBucket`,VITE_FIREBASE_MESSAGING_SENDER_ID:`messagingSenderId`,VITE_FIREBASE_APP_ID:`appId`,VITE_ADMIN_EMAILS:`adminEmails`}[e];if(r&&n[r])return n[r]}}catch{}return``}function xHn(){let e=[];for(let{key:t,label:n}of yHn){let r=bHn(t);!r||r.trim()===``?(console.log(`Missing key:`,t,r),e.push(n)):console.log(`Found key:`,t,r)}let t=bHn(`VITE_ADMIN_EMAILS`),n=!t||t.trim()===``;return console.log(`Setup complete?`,e.length===0,e),{allSet:e.length===0,missing:e,missingAdminEmails:n}}function SHn(){return xHn().allSet}var CHn=_Hn,wHn=vHn,THn=`VITE_FIREBASE_API_KEY=AIzaSyDxJ...
602
+ `,yHn=[{key:`VITE_FIREBASE_API_KEY`,label:`API Key`},{key:`VITE_FIREBASE_AUTH_DOMAIN`,label:`Auth Domain`},{key:`VITE_FIREBASE_PROJECT_ID`,label:`Project ID`},{key:`VITE_FIREBASE_STORAGE_BUCKET`,label:`Storage Bucket`},{key:`VITE_FIREBASE_MESSAGING_SENDER_ID`,label:`Messaging Sender ID`},{key:`VITE_FIREBASE_APP_ID`,label:`App ID`}];function bHn(e){let t;try{switch(e){case`VITE_FIREBASE_API_KEY`:t=void 0;break;case`VITE_FIREBASE_AUTH_DOMAIN`:t=void 0;break;case`VITE_FIREBASE_PROJECT_ID`:t=void 0;break;case`VITE_FIREBASE_STORAGE_BUCKET`:t=void 0;break;case`VITE_FIREBASE_MESSAGING_SENDER_ID`:t=void 0;break;case`VITE_FIREBASE_APP_ID`:t=void 0;break;case`VITE_ADMIN_EMAILS`:t=void 0;break}if(t&&typeof t==`string`&&t.trim()!==``)return t}catch{}try{let t=localStorage.getItem(`firebase_config`);if(t){let n=JSON.parse(t),r={VITE_FIREBASE_API_KEY:`apiKey`,VITE_FIREBASE_AUTH_DOMAIN:`authDomain`,VITE_FIREBASE_PROJECT_ID:`projectId`,VITE_FIREBASE_STORAGE_BUCKET:`storageBucket`,VITE_FIREBASE_MESSAGING_SENDER_ID:`messagingSenderId`,VITE_FIREBASE_APP_ID:`appId`,VITE_ADMIN_EMAILS:`adminEmails`}[e];if(r&&n[r])return n[r]}}catch{}return``}function xHn(){let e=[],t=[];for(let{key:n,label:r}of yHn){let i=bHn(n);i?i.trim()===``&&t.push(r):e.push(r)}let n=bHn(`VITE_ADMIN_EMAILS`),r=!n||n.trim()===``,i=[...e,...t];return{allSet:i.length===0,missing:i,empty:t,missingAdminEmails:r}}function SHn(){return xHn().allSet}var CHn=_Hn,wHn=vHn,THn=`VITE_FIREBASE_API_KEY=AIzaSyDxJ...
603
603
  VITE_FIREBASE_AUTH_DOMAIN=myproject.firebaseapp.com
604
604
  VITE_FIREBASE_PROJECT_ID=myproject
605
605
  VITE_FIREBASE_STORAGE_BUCKET=myproject.firebasestorage.app
@@ -608,11 +608,11 @@ VITE_FIREBASE_APP_ID=1:123456789012:web:abcdef123456
608
608
  VITE_ADMIN_EMAILS=your@email.com,other@email.com`;function EHn({code:e,label:t}){let[n,r]=m.default.useState(!1);return(0,y.jsxs)(q.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>{navigator.clipboard.writeText(e),r(!0),setTimeout(()=>r(!1),2e3)},className:`inline-flex items-center gap-2 px-4 py-2 mt-2 rounded-xl text-[13px] font-bold tracking-wide transition-all ${n?`bg-emerald-500/10 text-emerald-500 border border-emerald-500/20`:`btn-secondary shadow-sm`}`,children:[n?(0,y.jsx)(be,{className:`w-4 h-4`}):(0,y.jsx)(je,{className:`w-4 h-4`}),n?`Copied to Clipboard!`:t]})}function DHn({code:e}){let[t,n]=m.default.useState(!1);return(0,y.jsxs)(`div`,{className:`my-5 glass-panel border border-[var(--panel-border)] rounded-2xl overflow-hidden shadow-inner bg-background`,children:[(0,y.jsxs)(`div`,{className:`flex items-center justify-between px-4 py-2.5 border-b border-[var(--panel-border)]/50 bg-foreground/[0.02]`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(it,{className:`w-3.5 h-3.5 text-foreground/30`}),(0,y.jsx)(`span`,{className:`text-[11px] font-bold uppercase tracking-widest text-foreground/30`,children:`.env`})]}),(0,y.jsxs)(`button`,{onClick:()=>{navigator.clipboard.writeText(e),n(!0),setTimeout(()=>n(!1),2e3)},className:`text-[11px] font-bold uppercase tracking-wider flex items-center gap-1.5 transition-colors ${t?`text-emerald-500`:`text-accent hover:text-accent-deep`}`,children:[t?(0,y.jsx)(be,{className:`w-3.5 h-3.5`}):(0,y.jsx)(je,{className:`w-3.5 h-3.5`}),t?`Copied`:`Copy`]})]}),(0,y.jsx)(`pre`,{className:`p-4 md:p-5 overflow-x-auto text-[13px] leading-[1.8] font-mono styled-scrollbars`,children:(0,y.jsx)(`code`,{children:e.split(`
609
609
  `).map((e,t)=>{let n=e.indexOf(`=`);if(n===-1)return(0,y.jsxs)(`span`,{className:`text-foreground/30`,children:[e,`
610
610
  `]},t);let r=e.substring(0,n),i=e.substring(n+1);return(0,y.jsxs)(`span`,{children:[(0,y.jsx)(`span`,{className:`text-accent`,children:r}),(0,y.jsx)(`span`,{className:`text-foreground/30`,children:`=`}),(0,y.jsx)(`span`,{className:`text-foreground/60`,children:i}),`
611
- `]},t)})})})]})}function Y9({title:e,children:t}){return(0,y.jsxs)(`div`,{className:`flex flex-col relative pb-10 mb-10 border-b border-[var(--panel-border)]/50 last:border-0 last:pb-0 last:mb-0`,children:[(0,y.jsx)(`div`,{className:`flex items-center gap-3 mb-4`,children:(0,y.jsx)(`h3`,{className:`text-[17px] md:text-[19px] font-extrabold text-foreground tracking-tight`,children:e})}),(0,y.jsx)(`div`,{className:`text-[14px] md:text-[15px] text-foreground/70 leading-relaxed space-y-4`,children:t})]})}function OHn({standalone:e}){let[t,n]=(0,m.useState)(()=>{let e=localStorage.getItem(`theme-mode`);return e===`light`?!1:e===`dark`?!0:window.matchMedia(`(prefers-color-scheme: dark)`).matches}),[r,i]=(0,m.useState)(null),[a,o]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{e&&document.documentElement.setAttribute(`data-theme`,t?`dark`:`light`)},[t,e]),(0,m.useEffect)(()=>{if(e&&d.t.faviconUrl){let e=document.querySelector(`link[rel*='icon']`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=d.t.faviconUrl}},[e]),(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col min-h-screen`,children:[(0,y.jsx)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-6 flex items-center justify-between`,children:(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h1`,{className:`w-fit inline-block text-3xl md:text-4xl lg:text-5xl font-extrabold tracking-tight mb-3 text-gradient mt-1`,children:`Setup`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,y.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/setup`]})]})}),(0,y.jsx)(`div`,{className:`flex flex-col gap-6 flex-1 pb-16`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:`glass-panel border border-[var(--panel-border)] rounded-3xl p-6 md:p-10 shadow-2xl relative overflow-hidden bg-background flex flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 mb-8 pb-6 border-b border-[var(--panel-border)]/50 relative z-10`,children:[(0,y.jsxs)(`div`,{className:`flex flex-col md:flex-row items-start md:items-center justify-between gap-4`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-xl font-extrabold text-foreground tracking-tight`,children:`Firebase Configuration`}),(0,y.jsx)(`p`,{className:`text-[14px] font-medium text-foreground/50 mt-2 leading-relaxed`,children:`Follow these steps to connect your Firebase project. Takes about 5 minutes.`})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,y.jsx)(q.a,{whileHover:{scale:1.05},whileTap:{scale:.95},href:`mailto:antonina@youraiworkflow.co`,title:`Email Support`,className:`w-10 h-10 flex items-center justify-center rounded-xl transition-all duration-300 cursor-pointer btn-secondary`,children:(0,y.jsx)(Xe,{className:`w-4 h-4`})}),(0,y.jsx)(q.a,{whileHover:{scale:1.05},whileTap:{scale:.95},href:`https://wa.me/34632407883`,target:`_blank`,rel:`noopener noreferrer`,title:`WhatsApp Support`,className:`w-10 h-10 flex items-center justify-center rounded-xl transition-all duration-300 cursor-pointer btn-secondary`,children:(0,y.jsx)(ain,{className:`w-4 h-4 text-foreground/80`})}),(0,y.jsxs)(q.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>{o(!0),i(null),setTimeout(()=>{let e=xHn();i({missing:e.missing,missingAdminEmails:e.missingAdminEmails}),e.allSet&&setTimeout(()=>{window.location.href=`/`},1800),o(!1)},800)},disabled:a,className:`h-10 px-4 flex items-center justify-center gap-2 rounded-xl transition-all duration-300 cursor-pointer btn-primary shadow-lg disabled:opacity-50 disabled:cursor-not-allowed ml-2`,title:`Verify Configuration`,children:[a?(0,y.jsx)(W,{className:`w-4 h-4 animate-spin`}):(0,y.jsx)(Ajt,{className:`w-4 h-4`}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold hidden sm:block`,children:`Verify Setup`})]})]})]}),r&&r.missing.length>0&&(0,y.jsxs)(q.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`flex flex-col gap-2 mt-2 bg-red-500/5 border border-red-500/10 p-4 rounded-2xl`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2.5 text-[13px]`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-red-500/10 border border-red-500/20 flex items-center justify-center shrink-0`,children:(0,y.jsx)(Te,{className:`w-4 h-4 text-red-500`})}),(0,y.jsxs)(`span`,{className:`font-bold text-foreground/70`,children:[`Missing values — update `,(0,y.jsx)(`code`,{className:`text-accent text-[12px]`,children:`.env`}),` and restart dev server`]})]}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-1.5 ml-10`,children:r.missing.map(e=>(0,y.jsx)(`span`,{className:`px-2.5 py-1 text-[11px] font-bold uppercase tracking-wider rounded-lg bg-red-500/10 border border-red-500/20 text-red-500`,children:e},e))})]}),r&&r.missing.length===0&&r.missingAdminEmails&&(0,y.jsxs)(q.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`flex items-center gap-2.5 mt-2 bg-yellow-500/5 border border-yellow-500/10 p-4 rounded-2xl`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-yellow-500/10 border border-yellow-500/20 flex items-center justify-center shrink-0`,children:(0,y.jsx)(Te,{className:`w-4 h-4 text-yellow-500`})}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold text-yellow-500`,children:`Warning: No Admin Emails configured. App is operational. Redirecting…`})]}),r&&r.missing.length===0&&!r.missingAdminEmails&&(0,y.jsxs)(q.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`flex items-center gap-2.5 mt-2 bg-emerald-500/5 border border-emerald-500/10 p-4 rounded-2xl`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center shrink-0`,children:(0,y.jsx)(Ee,{className:`w-4 h-4 text-emerald-500`})}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold text-emerald-500`,children:`All configured — redirecting…`})]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col relative z-10 p-6 md:p-8 bg-foreground/[0.015] rounded-3xl border border-[var(--panel-border)]/50 mt-4`,children:[(0,y.jsx)(Y9,{title:`Create a Firebase Project`,children:(0,y.jsxs)(`p`,{children:[`1. Navigate to`,` `,(0,y.jsx)(`a`,{href:`https://console.firebase.google.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent underline underline-offset-2 font-semibold hover:text-accent-deep transition-colors`,children:`console.firebase.google.com`}),` `,`and click `,(0,y.jsx)(`strong`,{children:`Add Project`}),`. `,(0,y.jsx)(`br`,{}),`2. Enter a project name and click `,(0,y.jsx)(`strong`,{children:`Continue`}),`. `,(0,y.jsx)(`br`,{}),`3. You can disable Google Analytics or leave it enabled. Click `,(0,y.jsx)(`strong`,{children:`Create Project`}),`.`]})}),(0,y.jsxs)(Y9,{title:`Add a Web App`,children:[(0,y.jsxs)(`p`,{children:[`1. On your Firebase project dashboard, click the `,(0,y.jsx)(`strong`,{children:`</> Web`}),` icon (next to iOS and Android icons). `,(0,y.jsx)(`br`,{}),`2. Give your app a simple nickname (e.g., `,(0,y.jsx)(`span`,{className:`text-accent`,children:`MyApp`}),`). You don't need to check "Firebase Hosting". `,(0,y.jsx)(`br`,{}),`3. Click `,(0,y.jsx)(`strong`,{children:`Register App`}),`. `,(0,y.jsx)(`br`,{}),`4. Firebase will show you an SDK script block containing an object with keys like `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-2 py-0.5`,children:`apiKey`}),`, `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-2 py-0.5`,children:`authDomain`}),`, etc. Keep this tab open.`]}),(0,y.jsx)(`pre`,{className:`mt-4 p-4 md:p-5 overflow-x-auto text-[13px] leading-[1.8] font-mono styled-scrollbars glass-panel border border-[var(--panel-border)] rounded-2xl bg-background shadow-inner text-foreground/60`,children:(0,y.jsx)(`code`,{children:`const firebaseConfig = {
611
+ `]},t)})})})]})}function Y9({title:e,children:t}){return(0,y.jsxs)(`div`,{className:`flex flex-col relative pb-10 mb-10 border-b border-[var(--panel-border)]/50 last:border-0 last:pb-0 last:mb-0`,children:[(0,y.jsx)(`div`,{className:`flex items-center gap-3 mb-4`,children:(0,y.jsx)(`h3`,{className:`text-[17px] md:text-[19px] font-extrabold text-foreground tracking-tight`,children:e})}),(0,y.jsx)(`div`,{className:`text-[14px] md:text-[15px] text-foreground/70 leading-relaxed space-y-4`,children:t})]})}function OHn({standalone:e}){let[t,n]=(0,m.useState)(()=>{let e=localStorage.getItem(`theme-mode`);return e===`light`?!1:e===`dark`?!0:window.matchMedia(`(prefers-color-scheme: dark)`).matches}),[r,i]=(0,m.useState)(null),[a,o]=(0,m.useState)(!1);return(0,m.useEffect)(()=>{e&&document.documentElement.setAttribute(`data-theme`,t?`dark`:`light`)},[t,e]),(0,m.useEffect)(()=>{if(e&&d.t.faviconUrl){let e=document.querySelector(`link[rel*='icon']`);e||(e=document.createElement(`link`),e.rel=`icon`,document.head.appendChild(e)),e.href=d.t.faviconUrl}},[e]),(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col min-h-screen`,children:[(0,y.jsx)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-6 flex items-center justify-between`,children:(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h1`,{className:`w-fit inline-block text-3xl md:text-4xl lg:text-5xl font-extrabold tracking-tight mb-3 text-gradient mt-1`,children:`Setup`}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,y.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/setup`]})]})}),(0,y.jsx)(`div`,{className:`flex flex-col gap-6 flex-1 pb-16`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},className:`glass-panel border border-[var(--panel-border)] rounded-3xl p-6 md:p-10 shadow-2xl relative overflow-hidden bg-background flex flex-col`,children:[(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 mb-8 pb-6 border-b border-[var(--panel-border)]/50 relative z-10`,children:[(0,y.jsxs)(`div`,{className:`flex flex-col md:flex-row items-start md:items-center justify-between gap-4`,children:[(0,y.jsxs)(`div`,{children:[(0,y.jsx)(`h2`,{className:`text-xl font-extrabold text-foreground tracking-tight`,children:`Firebase Configuration`}),(0,y.jsx)(`p`,{className:`text-[14px] font-medium text-foreground/50 mt-2 leading-relaxed`,children:`Follow these steps to connect your Firebase project. Takes about 5 minutes.`})]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 shrink-0`,children:[(0,y.jsx)(q.a,{whileHover:{scale:1.05},whileTap:{scale:.95},href:`mailto:antonina@youraiworkflow.co`,title:`Email Support`,className:`w-10 h-10 flex items-center justify-center rounded-xl transition-all duration-300 cursor-pointer btn-secondary`,children:(0,y.jsx)(Xe,{className:`w-4 h-4`})}),(0,y.jsx)(q.a,{whileHover:{scale:1.05},whileTap:{scale:.95},href:`https://wa.me/34632407883`,target:`_blank`,rel:`noopener noreferrer`,title:`WhatsApp Support`,className:`w-10 h-10 flex items-center justify-center rounded-xl transition-all duration-300 cursor-pointer btn-secondary`,children:(0,y.jsx)(ain,{className:`w-4 h-4 text-foreground/80`})}),(0,y.jsxs)(q.button,{whileHover:{scale:1.05},whileTap:{scale:.95},onClick:()=>{o(!0),i(null),setTimeout(()=>{let e=xHn();i({missing:e.missing,empty:e.empty,missingAdminEmails:e.missingAdminEmails}),e.allSet&&setTimeout(()=>{window.location.href=`/`},1800),o(!1)},800)},disabled:a,className:`h-10 px-4 flex items-center justify-center gap-2 rounded-xl transition-all duration-300 cursor-pointer btn-primary shadow-lg disabled:opacity-50 disabled:cursor-not-allowed ml-2`,title:`Verify Configuration`,children:[a?(0,y.jsx)(W,{className:`w-4 h-4 animate-spin`}):(0,y.jsx)(Ajt,{className:`w-4 h-4`}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold hidden sm:block`,children:`Verify Setup`})]})]})]}),r&&r.missing.length>0&&(0,y.jsxs)(q.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`flex flex-col gap-2 mt-2 bg-red-500/5 border border-red-500/10 p-4 rounded-2xl`,children:[(0,y.jsxs)(`div`,{className:`flex items-center gap-2.5 text-[13px]`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-red-500/10 border border-red-500/20 flex items-center justify-center shrink-0`,children:(0,y.jsx)(Te,{className:`w-4 h-4 text-red-500`})}),(0,y.jsx)(`span`,{className:`font-bold text-foreground/70`,children:r.empty&&r.empty.length>0?(0,y.jsxs)(y.Fragment,{children:[`These values are `,(0,y.jsx)(`span`,{className:`text-red-500`,children:`empty`}),` — fill them in your `,(0,y.jsx)(`code`,{className:`text-accent text-[12px]`,children:`.env`}),` file and restart the dev server`]}):(0,y.jsxs)(y.Fragment,{children:[`Missing values — update `,(0,y.jsx)(`code`,{className:`text-accent text-[12px]`,children:`.env`}),` and restart dev server`]})})]}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-1.5 ml-10`,children:r.missing.map(e=>(0,y.jsx)(`span`,{className:`px-2.5 py-1 text-[11px] font-bold uppercase tracking-wider rounded-lg bg-red-500/10 border border-red-500/20 text-red-500`,children:e},e))})]}),r&&r.missing.length===0&&r.missingAdminEmails&&(0,y.jsxs)(q.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`flex items-center gap-2.5 mt-2 bg-yellow-500/5 border border-yellow-500/10 p-4 rounded-2xl`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-yellow-500/10 border border-yellow-500/20 flex items-center justify-center shrink-0`,children:(0,y.jsx)(Te,{className:`w-4 h-4 text-yellow-500`})}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold text-yellow-500`,children:`Warning: No Admin Emails configured. App is operational. Redirecting…`})]}),r&&r.missing.length===0&&!r.missingAdminEmails&&(0,y.jsxs)(q.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:`flex items-center gap-2.5 mt-2 bg-emerald-500/5 border border-emerald-500/10 p-4 rounded-2xl`,children:[(0,y.jsx)(`div`,{className:`w-8 h-8 rounded-full bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center shrink-0`,children:(0,y.jsx)(Ee,{className:`w-4 h-4 text-emerald-500`})}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold text-emerald-500`,children:`All configured — redirecting…`})]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col relative z-10 p-6 md:p-8 bg-foreground/[0.015] rounded-3xl border border-[var(--panel-border)]/50 mt-4`,children:[(0,y.jsx)(Y9,{title:`Create a Firebase Project`,children:(0,y.jsxs)(`p`,{children:[`1. Navigate to`,` `,(0,y.jsx)(`a`,{href:`https://console.firebase.google.com`,target:`_blank`,rel:`noopener noreferrer`,className:`text-accent underline underline-offset-2 font-semibold hover:text-accent-deep transition-colors`,children:`console.firebase.google.com`}),` `,`and click `,(0,y.jsx)(`strong`,{children:`Add Project`}),`. `,(0,y.jsx)(`br`,{}),`2. Enter a project name and click `,(0,y.jsx)(`strong`,{children:`Continue`}),`. `,(0,y.jsx)(`br`,{}),`3. You can disable Google Analytics or leave it enabled. Click `,(0,y.jsx)(`strong`,{children:`Create Project`}),`.`]})}),(0,y.jsxs)(Y9,{title:`Add a Web App`,children:[(0,y.jsxs)(`p`,{children:[`1. On your Firebase project dashboard, click the `,(0,y.jsx)(`strong`,{children:`</> Web`}),` icon (next to iOS and Android icons). `,(0,y.jsx)(`br`,{}),`2. Give your app a simple nickname (e.g., `,(0,y.jsx)(`span`,{className:`text-accent`,children:`MyApp`}),`). You don't need to check "Firebase Hosting". `,(0,y.jsx)(`br`,{}),`3. Click `,(0,y.jsx)(`strong`,{children:`Register App`}),`. `,(0,y.jsx)(`br`,{}),`4. Firebase will show you an SDK script block containing an object with keys like `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-2 py-0.5`,children:`apiKey`}),`, `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-2 py-0.5`,children:`authDomain`}),`, etc. Keep this tab open.`]}),(0,y.jsx)(`pre`,{className:`mt-4 p-4 md:p-5 overflow-x-auto text-[13px] leading-[1.8] font-mono styled-scrollbars glass-panel border border-[var(--panel-border)] rounded-2xl bg-background shadow-inner text-foreground/60`,children:(0,y.jsx)(`code`,{children:`const firebaseConfig = {
612
612
  apiKey: "AIzaSy...",
613
613
  authDomain: "myproject.firebaseapp.com",
614
614
  projectId: "myproject",
615
615
  storageBucket: "myproject.firebasestorage.app",
616
616
  messagingSenderId: "123456789012",
617
617
  appId: "1:123456789012:web:abcdef123456"
618
- };`})})]}),(0,y.jsxs)(Y9,{title:`Configure your .env file`,children:[(0,y.jsxs)(`p`,{children:[`Open the `,(0,y.jsx)(`code`,{className:`text-accent font-bold text-[13px]`,children:`.env`}),` file in your source code root. Map the keys from your Firebase Web SDK to the `,(0,y.jsx)(`code`,{className:`bg-foreground/5 rounded px-2 py-0.5 font-mono text-[11px]`,children:`VITE_ FIREBASE_`}),` variables.`]}),(0,y.jsxs)(`p`,{className:`text-[13px] bg-accent/10 border border-accent/20 p-3 rounded-xl mt-2 text-foreground/80`,children:[(0,y.jsx)(`strong`,{children:`Important:`}),` Provide your own emails in `,(0,y.jsx)(`code`,{className:`bg-background/80 rounded px-1.5 py-0.5 font-mono text-[11px]`,children:`VITE_ADMIN_EMAILS`}),` separated by commas. These users will automatically get full admin privileges upon their first registration. No quotes or spaces!`]}),(0,y.jsx)(DHn,{code:THn})]}),(0,y.jsx)(Y9,{title:`Enable Authentication`,children:(0,y.jsxs)(`p`,{children:[`1. In Firebase console Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Security`}),` → `,(0,y.jsx)(`strong`,{children:`Authentication`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get Started`}),`. `,(0,y.jsx)(`br`,{}),`2. Click the `,(0,y.jsx)(`strong`,{children:`Sign-in method`}),` tab. `,(0,y.jsx)(`br`,{}),`3. Enable `,(0,y.jsx)(`strong`,{children:`Email/Password`}),` (no need to enable email links). `,(0,y.jsx)(`br`,{}),`4. Enable `,(0,y.jsx)(`strong`,{children:`Google`}),`. `,(0,y.jsx)(`br`,{}),`5. Enable `,(0,y.jsx)(`strong`,{children:`Anonymous`}),`.`]})}),(0,y.jsxs)(Y9,{title:`Create Firestore Database`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Firestore`}),`. Click `,(0,y.jsx)(`strong`,{children:`Create database`}),`. `,(0,y.jsx)(`br`,{}),`2. Keep the default location and start in `,(0,y.jsx)(`strong`,{children:`Production mode`}),`. `,(0,y.jsx)(`br`,{}),`3. Go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste the rules below, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:CHn,label:`Copy Firestore Rules`})]}),(0,y.jsxs)(Y9,{title:`Configure Storage (Optional but Recommended)`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Storage`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get started`}),`. Start in production mode. `,(0,y.jsx)(`br`,{}),`2. Once created, copy the bucket URL (e.g. `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`your-project.firebasestorage.app`}),`) and paste it into `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`VITE_FIREBASE_STORAGE_BUCKET`}),` in your `,(0,y.jsx)(`code`,{className:`text-[13px] font-bold`,children:`.env`}),`. `,(0,y.jsx)(`br`,{}),`3. In Firebase Storage, go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste tracking rules, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:wHn,label:`Copy Storage Rules`}),(0,y.jsx)(`p`,{className:`text-[12px] mt-4 opacity-60 font-medium border-l-2 border-foreground/20 pl-3`,children:`Note: Storage rules require the Blaze pay-as-you-go plan, but there are large free tiers so you won't be charged for development usage.`})]})]})]})})]})}function kHn(){let{user:e}=B(),t=(e?.displayName||e?.email?.split(`@`)[0]||`there`).split(` `)[0],n=t.charAt(0).toUpperCase()+t.slice(1);return(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col`,children:[(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-8`,children:[(0,y.jsxs)(`h1`,{className:`w-fit inline-block text-3xl md:text-4xl lg:text-5xl font-extrabold tracking-tight mb-3 text-gradient mt-1`,children:[`Welcome back, `,n,`.`]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,y.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/dashboard`]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 flex-1 min-h-[500px]`,children:[(0,y.jsx)(`div`,{className:`flex justify-start`,children:(0,y.jsx)(p9,{})}),(0,y.jsxs)(`div`,{className:`w-full flex-1 glass-panel rounded-3xl p-8 md:p-12 flex items-center justify-center relative overflow-hidden border border-[var(--panel-border)] shadow-2xl bg-[var(--panel-bg)]`,children:[(0,y.jsx)(`div`,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-64 h-64 bg-accent/10 blur-[100px] rounded-full pointer-events-none`}),(0,y.jsx)(K,{mode:`wait`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3},className:`text-center z-10`,children:[(0,y.jsx)(`div`,{className:`w-16 h-16 rounded-3xl bg-accent/10 border border-accent/20 flex items-center justify-center text-accent mx-auto mb-6 shadow-inner`,children:(0,y.jsx)(Me,{className:`w-6 h-6`})}),(0,y.jsx)(`h2`,{className:`text-2xl font-extrabold text-foreground mb-2`,children:`No data added here yet`}),(0,y.jsx)(`p`,{className:`text-foreground/40 font-medium`,children:`Keep moving forward, your data will appear here.`})]})})]})]})]})}var X9=()=>(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center min-h-[60vh] z-10 animate-in fade-in duration-500`,children:[(0,y.jsx)(`div`,{className:`w-12 h-12 rounded-xl glass-panel border border-[var(--panel-border)] flex items-center justify-center mb-6 shadow-xl`,children:(0,y.jsx)(Me,{className:`w-6 h-6 text-accent animate-pulse`})}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3 glass-panel px-5 py-2.5 rounded-full border border-[var(--panel-border)]`,children:[(0,y.jsx)(`div`,{className:`w-4 h-4 border-2 border-accent border-t-transparent rounded-full animate-spin`}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold tracking-widest uppercase text-foreground/70`,children:`Connecting`})]})]});function Z9({children:e}){let{user:t,loading:n,userInactive:r,signOut:i,roleResolved:a}=B(),o=(0,b.useLocation)();return n||!a?(0,y.jsx)(X9,{}):t?r?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>i(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(o.pathname)}`})}function Q9({children:e}){let{user:t,loading:n,roleResolved:r}=B(),[i]=(0,b.useSearchParams)();return n||!r?(0,y.jsx)(X9,{}):t&&t.emailVerified?(0,y.jsx)(b.Navigate,{to:i.get(`from`)||`/dashboard`,replace:!0}):(0,y.jsx)(y.Fragment,{children:e})}function AHn({children:e}){let{user:t,loading:n,roleResolved:r}=B();return n||!r?(0,y.jsx)(X9,{}):t?t.emailVerified?(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/`})}function $9({children:e}){let{user:t,userRole:n,loading:r,userInactive:i,signOut:a,roleResolved:o}=B(),s=(0,b.useLocation)();return r||!o?(0,y.jsx)(X9,{}):t?i?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>a(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?n===`admin`?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(s.pathname)}`})}function jHn(){return(0,y.jsxs)(`div`,{className:`fixed top-0 left-0 w-full h-full pointer-events-none -z-0 overflow-hidden`,children:[(0,y.jsx)(q.div,{animate:{scale:[1,1.1,1],opacity:[.6,1,.6]},transition:{duration:12,repeat:1/0,ease:`easeInOut`},className:`absolute -top-[30%] md:-top-[400px] -right-[10%] md:-right-[200px] w-[500px] md:w-[800px] h-[500px] md:h-[800px] rounded-full bg-decorator-1 blur-[80px] md:blur-[120px]`}),(0,y.jsx)(q.div,{animate:{scale:[1,1.2,1],opacity:[.5,.9,.5]},transition:{duration:18,repeat:1/0,ease:`easeInOut`,delay:2},className:`absolute -bottom-[20%] md:-bottom-[300px] -left-[10%] md:-left-[100px] w-[400px] md:w-[600px] h-[400px] md:h-[600px] rounded-full bg-decorator-2 blur-[60px] md:blur-[100px]`})]})}function MHn(){let e=R().components?.Home||Gse;return(0,y.jsx)(z,{children:(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{}),(0,y.jsxs)(b.Routes,{children:[(0,y.jsx)(b.Route,{path:`/`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(e,{})})}),(0,y.jsx)(b.Route,{path:`/register`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(Kse,{})})}),(0,y.jsx)(b.Route,{path:`/login`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(qse,{})})}),(0,y.jsx)(b.Route,{path:`/reset-password`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(bBn,{})})}),(0,y.jsx)(b.Route,{path:`/verify`,element:(0,y.jsx)(AHn,{children:(0,y.jsx)(Jse,{})})}),(0,y.jsx)(b.Route,{path:`/templates`,element:(0,y.jsx)(OBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/inline_form`,element:(0,y.jsx)(kBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/popup_form`,element:(0,y.jsx)(ABn,{})}),(0,y.jsx)(b.Route,{path:`/templates/confirmation`,element:(0,y.jsx)(jBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/board`,element:(0,y.jsx)(GBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/table`,element:(0,y.jsx)(XVn,{})}),(0,y.jsx)(b.Route,{path:`/templates/calendar`,element:(0,y.jsx)(QVn,{})}),(0,y.jsx)(b.Route,{path:`/users`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/users/:id`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/submissions`,element:(0,y.jsx)($9,{children:(0,y.jsx)(TBn,{})})}),(0,y.jsx)(b.Route,{path:`/requests`,element:(0,y.jsx)($9,{children:(0,y.jsx)(EBn,{})})}),(0,y.jsx)(b.Route,{path:`/drive/*`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(DBn,{})})}),(0,y.jsx)(b.Route,{path:`/theme`,element:(0,y.jsx)($9,{children:(0,y.jsx)(rHn,{})})}),(0,y.jsx)(b.Route,{path:`/pages/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(uHn,{})})}),(0,y.jsx)(b.Route,{path:`/forms/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(dHn,{})})}),(0,y.jsx)(b.Route,{path:`/settings`,element:(0,y.jsx)($9,{children:(0,y.jsx)(wBn,{})})}),(0,y.jsx)(b.Route,{path:`/profile`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(yBn,{})})}),(0,y.jsx)(b.Route,{path:`/dashboard`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(kHn,{})})}),(0,y.jsx)(b.Route,{path:`/setup`,element:(0,y.jsx)(b.Navigate,{to:`/`,replace:!0})}),(0,y.jsx)(b.Route,{path:`*`,element:(0,y.jsx)(gHn,{})})]}),(0,y.jsx)(jHn,{})]})})}function NHn(){return(0,y.jsx)(b.BrowserRouter,{children:(0,y.jsx)(PHn,{})})}function PHn(){let e=R();return e.firebaseConfig&&e.firebaseConfig.apiKey&&e.firebaseConfig.apiKey.trim()!==``&&e.firebaseConfig.projectId&&e.firebaseConfig.projectId.trim()!==``||SHn()?(0,y.jsx)(MHn,{}):(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{standalone:!0}),(0,y.jsx)(OHn,{standalone:!0}),(0,y.jsx)(jHn,{})]})}function FHn(e){return e.firebaseConfig&&E(e.firebaseConfig),(0,y.jsx)(L,{config:{firebaseConfig:e.firebaseConfig,adminEmails:e.adminEmails,basename:e.basename,onAuthChange:e.onAuthChange,themeConfig:e.themeConfig,components:e.components},children:(0,y.jsx)(F,{children:(0,y.jsx)(`div`,{className:`firebase-os flex-1 flex flex-col min-h-screen`,style:{background:`var(--bg-gradient)`,color:`var(--fg-color)`},children:(0,y.jsx)(NHn,{})})})})}exports.ContactPopup=Wo,exports.FirebaseOS=FHn,Object.defineProperty(exports,`auth`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`db`,{enumerable:!0,get:function(){return w}}),exports.defaultHomeConfig=Zo,Object.defineProperty(exports,`storage`,{enumerable:!0,get:function(){return T}}),exports.t=u,exports.useAuth=B,exports.useConfig=R,exports.useTheme=I;
618
+ };`})})]}),(0,y.jsxs)(Y9,{title:`Configure your .env file`,children:[(0,y.jsxs)(`p`,{children:[`Open the `,(0,y.jsx)(`code`,{className:`text-accent font-bold text-[13px]`,children:`.env`}),` file in your source code root. Map the keys from your Firebase Web SDK to the `,(0,y.jsx)(`code`,{className:`bg-foreground/5 rounded px-2 py-0.5 font-mono text-[11px]`,children:`VITE_ FIREBASE_`}),` variables.`]}),(0,y.jsxs)(`p`,{className:`text-[13px] bg-accent/10 border border-accent/20 p-3 rounded-xl mt-2 text-foreground/80`,children:[(0,y.jsx)(`strong`,{children:`Important:`}),` Provide your own emails in `,(0,y.jsx)(`code`,{className:`bg-background/80 rounded px-1.5 py-0.5 font-mono text-[11px]`,children:`VITE_ADMIN_EMAILS`}),` separated by commas. These users will automatically get full admin privileges upon their first registration. No quotes or spaces!`]}),(0,y.jsx)(DHn,{code:THn})]}),(0,y.jsx)(Y9,{title:`Enable Authentication`,children:(0,y.jsxs)(`p`,{children:[`1. In Firebase console Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Security`}),` → `,(0,y.jsx)(`strong`,{children:`Authentication`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get Started`}),`. `,(0,y.jsx)(`br`,{}),`2. Click the `,(0,y.jsx)(`strong`,{children:`Sign-in method`}),` tab. `,(0,y.jsx)(`br`,{}),`3. Enable `,(0,y.jsx)(`strong`,{children:`Email/Password`}),` (no need to enable email links). `,(0,y.jsx)(`br`,{}),`4. Enable `,(0,y.jsx)(`strong`,{children:`Google`}),`. `,(0,y.jsx)(`br`,{}),`5. Enable `,(0,y.jsx)(`strong`,{children:`Anonymous`}),`.`]})}),(0,y.jsxs)(Y9,{title:`Create Firestore Database`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Firestore`}),`. Click `,(0,y.jsx)(`strong`,{children:`Create database`}),`. `,(0,y.jsx)(`br`,{}),`2. Keep the default location and start in `,(0,y.jsx)(`strong`,{children:`Production mode`}),`. `,(0,y.jsx)(`br`,{}),`3. Go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste the rules below, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:CHn,label:`Copy Firestore Rules`})]}),(0,y.jsxs)(Y9,{title:`Configure Storage (Optional but Recommended)`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Storage`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get started`}),`. Start in production mode. `,(0,y.jsx)(`br`,{}),`2. Once created, copy the bucket URL (e.g. `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`your-project.firebasestorage.app`}),`) and paste it into `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`VITE_FIREBASE_STORAGE_BUCKET`}),` in your `,(0,y.jsx)(`code`,{className:`text-[13px] font-bold`,children:`.env`}),`. `,(0,y.jsx)(`br`,{}),`3. In Firebase Storage, go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste tracking rules, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:wHn,label:`Copy Storage Rules`}),(0,y.jsx)(`p`,{className:`text-[12px] mt-4 opacity-60 font-medium border-l-2 border-foreground/20 pl-3`,children:`Note: Storage rules require the Blaze pay-as-you-go plan, but there are large free tiers so you won't be charged for development usage.`})]})]})]})})]})}function kHn(){let{user:e}=B(),t=(e?.displayName||e?.email?.split(`@`)[0]||`there`).split(` `)[0],n=t.charAt(0).toUpperCase()+t.slice(1);return(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col`,children:[(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-8`,children:[(0,y.jsxs)(`h1`,{className:`w-fit inline-block text-3xl md:text-4xl lg:text-5xl font-extrabold tracking-tight mb-3 text-gradient mt-1`,children:[`Welcome back, `,n,`.`]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,y.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/dashboard`]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 flex-1 min-h-[500px]`,children:[(0,y.jsx)(`div`,{className:`flex justify-start`,children:(0,y.jsx)(p9,{})}),(0,y.jsxs)(`div`,{className:`w-full flex-1 glass-panel rounded-3xl p-8 md:p-12 flex items-center justify-center relative overflow-hidden border border-[var(--panel-border)] shadow-2xl bg-[var(--panel-bg)]`,children:[(0,y.jsx)(`div`,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-64 h-64 bg-accent/10 blur-[100px] rounded-full pointer-events-none`}),(0,y.jsx)(K,{mode:`wait`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3},className:`text-center z-10`,children:[(0,y.jsx)(`div`,{className:`w-16 h-16 rounded-3xl bg-accent/10 border border-accent/20 flex items-center justify-center text-accent mx-auto mb-6 shadow-inner`,children:(0,y.jsx)(Me,{className:`w-6 h-6`})}),(0,y.jsx)(`h2`,{className:`text-2xl font-extrabold text-foreground mb-2`,children:`No data added here yet`}),(0,y.jsx)(`p`,{className:`text-foreground/40 font-medium`,children:`Keep moving forward, your data will appear here.`})]})})]})]})]})}var X9=()=>(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center min-h-[60vh] z-10 animate-in fade-in duration-500`,children:[(0,y.jsx)(`div`,{className:`w-12 h-12 rounded-xl glass-panel border border-[var(--panel-border)] flex items-center justify-center mb-6 shadow-xl`,children:(0,y.jsx)(Me,{className:`w-6 h-6 text-accent animate-pulse`})}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3 glass-panel px-5 py-2.5 rounded-full border border-[var(--panel-border)]`,children:[(0,y.jsx)(`div`,{className:`w-4 h-4 border-2 border-accent border-t-transparent rounded-full animate-spin`}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold tracking-widest uppercase text-foreground/70`,children:`Connecting`})]})]});function Z9({children:e}){let{user:t,loading:n,userInactive:r,signOut:i,roleResolved:a}=B(),o=(0,b.useLocation)();return n||!a?(0,y.jsx)(X9,{}):t?r?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>i(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(o.pathname)}`})}function Q9({children:e}){let{user:t,loading:n,roleResolved:r}=B(),[i]=(0,b.useSearchParams)();return n||!r?(0,y.jsx)(X9,{}):t&&t.emailVerified?(0,y.jsx)(b.Navigate,{to:i.get(`from`)||`/dashboard`,replace:!0}):(0,y.jsx)(y.Fragment,{children:e})}function AHn({children:e}){let{user:t,loading:n,roleResolved:r}=B();return n||!r?(0,y.jsx)(X9,{}):t?t.emailVerified?(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/`})}function $9({children:e}){let{user:t,userRole:n,loading:r,userInactive:i,signOut:a,roleResolved:o}=B(),s=(0,b.useLocation)();return r||!o?(0,y.jsx)(X9,{}):t?i?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>a(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?n===`admin`?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(s.pathname)}`})}function jHn(){return(0,y.jsxs)(`div`,{className:`fixed top-0 left-0 w-full h-full pointer-events-none -z-0 overflow-hidden`,children:[(0,y.jsx)(q.div,{animate:{scale:[1,1.1,1],opacity:[.6,1,.6]},transition:{duration:12,repeat:1/0,ease:`easeInOut`},className:`absolute -top-[30%] md:-top-[400px] -right-[10%] md:-right-[200px] w-[500px] md:w-[800px] h-[500px] md:h-[800px] rounded-full bg-decorator-1 blur-[80px] md:blur-[120px]`}),(0,y.jsx)(q.div,{animate:{scale:[1,1.2,1],opacity:[.5,.9,.5]},transition:{duration:18,repeat:1/0,ease:`easeInOut`,delay:2},className:`absolute -bottom-[20%] md:-bottom-[300px] -left-[10%] md:-left-[100px] w-[400px] md:w-[600px] h-[400px] md:h-[600px] rounded-full bg-decorator-2 blur-[60px] md:blur-[100px]`})]})}function MHn(){let e=R().components?.Home||Gse;return(0,y.jsx)(z,{children:(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{}),(0,y.jsxs)(b.Routes,{children:[(0,y.jsx)(b.Route,{path:`/`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(e,{})})}),(0,y.jsx)(b.Route,{path:`/register`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(Kse,{})})}),(0,y.jsx)(b.Route,{path:`/login`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(qse,{})})}),(0,y.jsx)(b.Route,{path:`/reset-password`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(bBn,{})})}),(0,y.jsx)(b.Route,{path:`/verify`,element:(0,y.jsx)(AHn,{children:(0,y.jsx)(Jse,{})})}),(0,y.jsx)(b.Route,{path:`/templates`,element:(0,y.jsx)(OBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/inline_form`,element:(0,y.jsx)(kBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/popup_form`,element:(0,y.jsx)(ABn,{})}),(0,y.jsx)(b.Route,{path:`/templates/confirmation`,element:(0,y.jsx)(jBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/board`,element:(0,y.jsx)(GBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/table`,element:(0,y.jsx)(XVn,{})}),(0,y.jsx)(b.Route,{path:`/templates/calendar`,element:(0,y.jsx)(QVn,{})}),(0,y.jsx)(b.Route,{path:`/users`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/users/:id`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/submissions`,element:(0,y.jsx)($9,{children:(0,y.jsx)(TBn,{})})}),(0,y.jsx)(b.Route,{path:`/requests`,element:(0,y.jsx)($9,{children:(0,y.jsx)(EBn,{})})}),(0,y.jsx)(b.Route,{path:`/drive/*`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(DBn,{})})}),(0,y.jsx)(b.Route,{path:`/theme`,element:(0,y.jsx)($9,{children:(0,y.jsx)(rHn,{})})}),(0,y.jsx)(b.Route,{path:`/pages/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(uHn,{})})}),(0,y.jsx)(b.Route,{path:`/forms/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(dHn,{})})}),(0,y.jsx)(b.Route,{path:`/settings`,element:(0,y.jsx)($9,{children:(0,y.jsx)(wBn,{})})}),(0,y.jsx)(b.Route,{path:`/profile`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(yBn,{})})}),(0,y.jsx)(b.Route,{path:`/dashboard`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(kHn,{})})}),(0,y.jsx)(b.Route,{path:`/setup`,element:(0,y.jsx)(b.Navigate,{to:`/`,replace:!0})}),(0,y.jsx)(b.Route,{path:`*`,element:(0,y.jsx)(gHn,{})})]}),(0,y.jsx)(jHn,{})]})})}function NHn(){return(0,y.jsx)(b.BrowserRouter,{children:(0,y.jsx)(PHn,{})})}function PHn(){let e=R();return e.firebaseConfig&&e.firebaseConfig.apiKey&&e.firebaseConfig.apiKey.trim()!==``&&e.firebaseConfig.projectId&&e.firebaseConfig.projectId.trim()!==``||SHn()?(0,y.jsx)(MHn,{}):(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{standalone:!0}),(0,y.jsx)(OHn,{standalone:!0}),(0,y.jsx)(jHn,{})]})}function FHn(e){let t=e.firebaseConfig;return t&&t.apiKey&&t.apiKey.trim()!==``&&t.projectId&&t.projectId.trim()!==``&&E(t),(0,y.jsx)(L,{config:{firebaseConfig:e.firebaseConfig,adminEmails:e.adminEmails,basename:e.basename,onAuthChange:e.onAuthChange,themeConfig:e.themeConfig,components:e.components},children:(0,y.jsx)(F,{children:(0,y.jsx)(`div`,{className:`firebase-os flex-1 flex flex-col min-h-screen`,style:{background:`var(--bg-gradient)`,color:`var(--fg-color)`},children:(0,y.jsx)(NHn,{})})})})}exports.ContactPopup=Wo,exports.FirebaseOS=FHn,Object.defineProperty(exports,`auth`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`db`,{enumerable:!0,get:function(){return w}}),exports.defaultHomeConfig=Zo,Object.defineProperty(exports,`storage`,{enumerable:!0,get:function(){return T}}),exports.t=u,exports.useAuth=B,exports.useConfig=R,exports.useTheme=I;