PageSourceSearch

https://certbox.app/assets/AppShell-C-RheLBE.js

js certbox.app collected 2026-09-24 14:07:52 UTC 28,025 bytes, 1 lines download raw bytes

1import{r as d,j as e,u as xe,b as pe,c as $}from"./vendor-tanstack-D3Q9Yyxk.js";import{i as fe}from"./role-utils-Bxbsxa0G.js";import{C as be}from"./CertBoxMark-FzqeIGEx.js";import{b1 as R,b4 as D,b6 as B,bh as P,cn as he,b7 as k,bc as ye}from"./index-DN5F4pPB.js";import{C as ge}from"./Card-Cc55VNJo.js";import{X as ie,aJ as ve,B as je,d as Ne,ap as we,aK as O,K as T,aa as A,a as Y,aL as U,o as H,J as G,I as J,i as W,S as I,a2 as V,an as X,z as Z,f as ee,y as te,H as se,aM as re,m as ke,ac as F,e as Ce,aD as ae,aN as Ee}from"./vendor-icons-DsBP5CwP.js";import{u as le,a as Se,d as C,L as M,O as De}from"./vendor-react-DrSAzhxl.js";import{f as _e,C as Qe}from"./CoachTip-TI1RrfFS.js";import{N as ne}from"./welcome-flow-CX8GzhEl.js";import{I as oe}from"./InvoiceIcon-DTMdlc_2.js";import{C as Me}from"./company-BQPOImA8.js";import"./vendor-helmet-CqRzfjPa.js";import"./vendor-supabase-DpwOtkOU.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};n.SENTRY_RELEASE={id:"8bad1ef1d1baf20043d4024cccb275075dbee4da"};var t=new n.Error().stack;t&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[t]="b803f148-42e3-4fca-8a4b-3bb8295f477f",n._sentryDebugIdIdentifier="sentry-dbid-b803f148-42e3-4fca-8a4b-3bb8295f477f")}catch{}})();const $e=[{value:"bug",label:"Bug report"},{value:"feature",label:"Feature request"},{value:"general",label:"General feedback"},{value:"complaint",label:"Complaint"}];function Ae({onClose:n}){const{user:t,profile:r}=R(),l=d.useRef(null),[x,f]=d.useState("general"),[p,w]=d.useState(""),[i,a]=d.useState(null),[m,v]=d.useState(null),[b,E]=d.useState(!1),[N,u]=d.useState(null),[y,h]=d.useState(!1);d.useEffect(()=>{const o=g=>{g.key==="Escape"&&n()};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[n]),d.useEffect(()=>{if(!y)return;const o=setTimeout(n,2e3);return()=>clearTimeout(o)},[y,n]);const j=d.useCallback(async()=>{const o=p.trim();if(o.length<10){u("Please enter at least 10 characters.");return}u(null),E(!0);try{const{error:g}=await D.from("feedback").insert({user_id:t.id,user_email:r?.email??t?.email??null,user_name:r?.displayName??null,page_url:window.location.href,category:x,message:o,rating:i??null});if(g)throw g;h(!0)}catch(g){const S=g instanceof Error?g.message:"Something went wrong. Please try again.";u(S)}finally{E(!1)}},[t,r,x,p,i]);return e.jsx("div",{className:"fixed inset-0 z-50 flex items-end sm:items-center justify-center bg-black/40 p-4",onClick:n,onKeyDown:o=>{if(o.key==="Escape"&&n(),o.key==="Tab"&&l.current){const g=l.current.querySelectorAll('button, [href], input, textarea, select, [tabindex]:not([tabindex="-1"])');if(g.length===0)return;const S=g[0],_=g[g.length-1];o.shiftKey&&document.activeElement===S?(o.preventDefault(),_.focus()):!o.shiftKey&&document.activeElement===_&&(o.preventDefault(),S.focus())}},children:e.jsx("div",{ref:l,className:"w-full max-w-md",onClick:o=>o.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":"Send feedback",children:e.jsxs(ge,{className:"relative p-0 overflow-hidden",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-border",children:[e.jsx("h2",{className:"text-base font-semibold text-text-primary",children:"Send feedback"}),e.jsx("button",{onClick:n,className:"p-2 -mr-1 min-w-[44px] min-h-[44px] flex items-center justify-center text-text-secondary hover:text-text-primary rounded-md transition-colors","aria-label":"Close",children:e.jsx(ie,{size:18})})]}),e.jsx("div",{className:"px-5 py-5 space-y-5",children:y?e.jsxs("div",{className:"py-6 text-center space-y-2",children:[e.jsx("p",{className:"text-xl",children:"Thanks!"}),e.jsx("p",{className:"text-sm text-text-secondary",children:"Your feedback has been received."})]}):e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("p",{className:"text-sm font-semibold text-text-primary",children:"Category"}),e.jsx("div",{className:"flex flex-wrap gap-2",children:$e.map(o=>e.jsx("button",{type:"button",onClick:()=>f(o.value),"aria-pressed":x===o.value,className:`px-3 py-2.5 min-h-[44px] text-sm rounded-full border transition-colors ${x===o.value?"bg-primary text-white border-primary":"bg-white text-text-secondary border-border hover:border-primary hover:text-primary"}`,children:o.label},o.value))})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsx("label",{htmlFor:"feedback-message",className:"block text-sm font-semibold text-text-primary",children:"Message"}),e.jsx("textarea",{id:"feedback-message",rows:4,value:p,onChange:o=>{w(o.target.value),N&&u(null)},placeholder:"Tell us what's on your mind...",className:"w-full px-3 py-3 text-base sm:text-sm border border-border rounded-[var(--radius-card)] bg-white text-text-primary placeholder:text-text-placeholder focus:outline-none focus:ring-2 focus:ring-primary/30 focus:border-primary transition-colors resize-none"}),N&&e.jsx("p",{className:"text-sm text-danger",children:N})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("p",{className:"text-sm font-semibold text-text-primary",children:["Overall satisfaction ",e.jsx("span",{className:"font-normal text-text-secondary",children:"(optional)"})]}),e.jsx("div",{className:"flex gap-1",role:"radiogroup","aria-label":"Rating",onMouseLeave:()=>v(null),children:[1,2,3,4,5].map(o=>{const g=o<=(m??i??0);return e.jsx("button",{type:"button",role:"radio","aria-checked":i===o,"aria-label":`${o} star${o>
11?"s":""}`,onClick:()=>a(S=>S===o?null:o),onMouseEnter:()=>v(o),className:"p-0.5 min-w-[44px] min-h-[44px] flex items-center justify-center transition-colors focus:outline-none focus:ring-2 focus:ring-primary/30 rounded",children:e.jsx(ve,{size:24,className:`transition-colors ${g?"fill-amber-400 stroke-amber-400":"fill-none stroke-border"}`})},o)})})]})]})}),!y&&e.jsxs("div",{className:"px-5 pb-5 flex justify-end gap-3",children:[e.jsx(B,{variant:"secondary",size:"sm",onClick:n,disabled:b,children:"Cancel"}),e.jsx(B,{variant:"primary",size:"sm",onClick:j,disabled:b||p.trim().length<10,children:b?"Sending...":"Send feedback"})]})]})})})}const ze="id,user_id,type,title,body,link,read,created_at";async function qe(n){const{data:t,error:r}=await D.from("notifications").select(ze).eq("user_id",n).order("created_at",{ascending:!1}).limit(50);return r?[]:(t??[]).map(he)}function ce(n){return xe({queryKey:P.notifications(n??""),queryFn:()=>qe(n),enabled:!!n,staleTime:3e4,refetchInterval:3e4,refetchIntervalInBackground:!1,refetchOnWindowFocus:!0,networkMode:"online"})}function Le(n){const{data:t}=ce(n);return t?.filter(r=>!r.read).length??0}function Ke(n){const t=pe(),r=P.notifications(n??""),l=P.unreadNotificationCount(n??""),x=$({mutationFn:async i=>{const{error:a}=await D.from("notifications").update({read:!0}).eq("id",i);if(a)throw a},onMutate:async i=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:l});const a=t.getQueryData(r),m=t.getQueryData(l);return a&&t.setQueryData(r,v=>(v??[]).map(b=>b.id===i?{...b,read:!0}:b)),t.setQueryData(l,v=>Math.max((v??1)-1,0)),{prevNotifs:a,prevCount:m}},onError:(i,a,m)=>{m?.prevNotifs&&t.setQueryData(r,m.prevNotifs),m?.prevCount!==void 0&&t.setQueryData(l,m.prevCount)},onSettled:()=>{t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:l})}}),f=$({mutationFn:async()=>{const{error:i}=await D.from("notifications").update({read:!0}).eq("user_id",n).eq("read",!1);if(i)throw i},onMutate:async()=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:l});const i=t.getQueryData(r),a=t.getQueryData(l);return i&&t.setQueryData(r,m=>(m??[]).map(v=>({...v,read:!0}))),t.setQueryData(l,0),{prevNotifs:i,prevCount:a}},onError:(i,a,m)=>{m?.prevNotifs&&t.setQueryData(r,m.prevNotifs),m?.prevCount!==void 0&&t.setQueryData(l,m.prevCount)},onSettled:()=>{t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:l})}}),p=$({mutationFn:async i=>{const{error:a}=await D.from("notifications").delete().eq("id",i);if(a)throw a},onMutate:async i=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:l});const a=t.getQueryData(r),m=t.getQueryData(l),v=a?.find(b=>b.id===i&&!b.read);return a&&t.setQueryData(r,b=>(b??[]).filter(E=>E.id!==i)),v&&t.setQueryData(l,b=>Math.max((b??1)-1,0)),{prevNotifs:a,prevCount:m}},onError:(i,a,m)=>{m?.prevNotifs&&t.setQueryData(r,m.prevNotifs),m?.prevCount!==void 0&&t.setQueryData(l,m.prevCount)},onSettled:()=>{t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:l})}}),w=$({mutationFn:async()=>{const{error:i}=await D.from("notifications").delete().eq("user_id",n);if(i)throw i},onMutate:async()=>{await t.cancelQueries({queryKey:r}),await t.cancelQueries({queryKey:l});const i=t.getQueryData(r),a=t.getQueryData(l);return t.setQueryData(r,[]),t.setQueryData(l,0),{prevNotifs:i,prevCount:a}},onError:(i,a,m)=>{m?.prevNotifs&&t.setQueryData(r,m.prevNotifs),m?.prevCount!==void 0&&t.setQueryData(l,m.prevCount)},onSettled:()=>{t.invalidateQueries({queryKey:r}),t.invalidateQueries({queryKey:l})}});return{markAsRead:x,markAllAsRead:f,dismiss:p,clearAll:w}}function Oe(n){if(!(n instanceof Date))return"";const t=Date.now()-n.getTime(),r=Math.floor(t/6e4);if(r<1)return"just now";if(r<60)return`${r}m ago`;const l=Math.floor(r/60);return l<24?`${l}h ago`:`${Math.floor(l/24)}d ago`}function Te(){const{user:n}=R(),t=le(),[r,l]=d.useState(!1),x=d.useRef(null),f=Le(n?.id),{data:p=[]}=ce(r?n?.id:void 0),{markAsRead:w,markAllAsRead:i,dismiss:a,clearAll:m}=Ke(n?.id),v=d.useCallback(()=>l(!1),[]);d.useEffect(()=>{if(!r)return;const u=h=>{x.current&&!x.current.contains(h.target)&&v()},y=h=>{if(h.key==="Escape"){v();return}if(h.key==="Tab"&&x.current){const j=x.current.querySelectorAll('button, [href], [tabindex]:not
1([tabindex="-1"])');if(j.length===0)return;const o=j[0],g=j[j.length-1];h.shiftKey&&document.activeElement===o?(h.preventDefault(),g.focus()):!h.shiftKey&&document.activeElement===g&&(h.preventDefault(),o.focus())}};return document.addEventListener("mousedown",u),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",y)}},[r,v]);const b=()=>{r||k("notifications_opened",{unread:f}),l(!r)},E=(u,y,h,j)=>{k("notification_clicked",{type:y,wasRead:h}),h||w.mutate(u),l(!1),j&&t(j)},N=(u,y,h)=>{u.stopPropagation(),k("notification_dismissed",{type:h}),a.mutate(y)};return e.jsxs("div",{className:"relative",ref:x,children:[e.jsxs("button",{onClick:b,className:"relative p-3 min-w-[44px] min-h-[44px] flex items-center justify-center text-text-secondary hover:text-text-primary transition-colors","aria-label":`Notifications${f>0?` (${f} unread)`:""}`,"aria-expanded":r,children:[e.jsx(je,{size:18}),f>0&&e.jsx("span",{className:"absolute top-1.5 right-1.5 w-5 h-5 bg-danger text-white text-sm font-semibold rounded-full flex items-center justify-center",children:f>9?"9+":f})]}),r&&e.jsxs("div",{role:"dialog","aria-modal":"true","aria-label":"Notifications",className:"absolute right-0 top-full mt-1 w-[min(20rem,calc(100vw-2rem))] max-h-96 bg-white border border-border rounded-[var(--radius-card)] shadow-lg overflow-hidden z-50",children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsx("h3",{className:"text-sm font-semibold",children:"Notifications"}),e.jsxs("div",{className:"flex items-center gap-3",children:[f>0&&e.jsxs("button",{onClick:()=>i.mutate(),className:"text-sm text-primary hover:underline flex items-center gap-1",children:[e.jsx(Ne,{size:12})," Mark all read"]}),p.length>0&&e.jsxs("button",{onClick:()=>{k("notifications_cleared",{count:p.length}),m.mutate()},className:"text-sm text-text-secondary hover:text-danger flex items-center gap-1",children:[e.jsx(we,{size:12})," Clear"]})]})]}),e.jsx("div",{className:"overflow-y-auto max-h-80",children:p.length===0?e.jsx("p",{className:"text-sm text-text-secondary text-center py-8",children:"No notifications."}):p.map(u=>e.jsx("button",{onClick:()=>E(u.id,u.type,u.read,u.link),className:`group w-full text-left px-4 py-3 border-b border-border last:border-0 hover:bg-background-secondary transition-colors ${u.read?"":"bg-primary/[0.08]"}`,children:e.jsxs("div",{className:"flex items-start gap-2",children:[!u.read&&e.jsx("span",{className:"w-2 h-2 bg-primary rounded-full mt-1.5 shrink-0"}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:`text-sm ${u.read?"":"font-semibold"}`,children:u.title}),u.body&&e.jsx("p",{className:"text-sm text-text-secondary mt-0.5 line-clamp-2",children:u.body}),e.jsx("p",{className:"text-sm text-text-secondary mt-1",children:Oe(u.createdAt)})]}),e.jsx("button",{onClick:y=>N(y,u.id,u.type),className:"opacity-60 md:opacity-0 md:group-hover:opacity-100 p-2 min-w-[44px] min-h-[44px] flex items-center justify-center text-text-secondary hover:text-danger transition-all shrink-0","aria-label":"Dismiss notification",children:e.jsx(ie,{size:14})})]})},u.id))})]})]})}const Ie=[{key:"dashboard",selector:'nav a[href="/"]',title:"Your dashboard",body:"Everything at a glance - work due, certificates, and money owed."},{key:"certificates",selector:'nav a[href="/certificates"]',title:"Certificates",body:"Every cert you make lives here - send it again or renew it when due."},{key:"jobs",selector:'nav a[href="/jobs"]',title:"Jobs",body:"Group a customer's work, certs and invoices in one place."},{key:"account",selector:'a[href="/account"]',title:"Your account",body:"Add your company details once - they go on every certificate you make."}];function Fe(){const[n,t]=d.useState(!1),[r,l]=d.useState(null),[x,f]=d.useState(0);d.useEffect(()=>{const a=()=>{l(null),f(0),t(!0),k("welcome_tour_started",{})};return window.addEventListener(ne,a),()=>window.removeEventListener(ne,a)},[]),d.useEffect(()=>{if(!n)return;const a=requestAnimationFrame(()=>l(Ie.filter(m=>_e(m.selector))));return()=>cancelAnimationFrame(a)},[n]);const p=n&&r?r[x]:null;if(d.useEffect(()=>{p&&k("welcome_tour_step",{index:x,key:p.key})},[p,x]),!n||!r||r.length===0||!p)return null;const w=a=>{k(a,{step:x}),t(!1)},i=x===r.length-1;return e.jsx(Qe,{targetSelector:p.selector,title:p.title,body:p.body,stepText:`${x+1} of ${r.length}`,nextLabel:i?"Done":"Next",skipLabel:"Skip",onBack:x>0?()=>f(a=>a-1):void 0,onSkip:()=>w("welcome_tour_skipped"),onNext:()=>{i?w("welcome_tour_completed"):f(a=>a+1)}},p.key)}function tt({children:n}={}){const{profile:t,signOut:r,userOrgs:l}=R(),x=Se(),f=fe(t?.role),p=d.useMemo(()=>f?[{to:"/",icon:O,label:"Dashboard"},{to:"/portfolio",icon:T,label:"Portfolio"},{to:"/properties",icon:A,label:"Properties"},{to:"/search",icon:Y,label:"Search"},{to:"/account",icon:U,label:"Account"}]:[],[f]),w=le(),[i,a]=d.useState(!1),[m,v]=d.useState(!1),{isFree:b,isTrialing:E,trialDaysLeft:N,trialHasCard:u}=ye(),[y,h]=d.useState(!1),j=d.useRef(null);d.useEffect(()=>{if(!y)return;const s=Q=>{j.current&&!j.current.contains(Q.target)&&h(!1)},c=Q=>{Q.key==="Escape"&&h(!1)};
1return document.addEventListener("click",s),document.addEventListener("keydown",c),()=>{document.removeEventListener("click",s),document.removeEventListener("keydown",c)}},[y]),d.useEffect(()=>{if(!i)return;const s=c=>{c.key==="Escape"&&a(!1)};return document.addEventListener("keydown",s),()=>document.removeEventListener("keydown",s)},[i]);const o=async()=>{a(!1),await r(),w("/")},g=/^\/certificates\/(new|[^/]+\/edit)/.test(x.pathname),S=d.useMemo(()=>[{to:"/",icon:O,label:"Dashboard"},{to:"/jobs",icon:T,label:"Jobs"},{to:"/certificates",icon:H,label:"Certificates"},{to:"/schedule",icon:G,label:"Schedule"},{to:"/invoices",icon:oe,label:"Invoices"},{to:"/clients",icon:J,label:"Clients"},{to:"/quotes",icon:W,label:"Quotes"}],[]),_=d.useMemo(()=>[...b?[{to:"/pricing",icon:I,label:"Upgrade to Pro",onClick:()=>k("upgrade_prompt_click",{feature:"nav"})}]:[],{to:"/tools",icon:V,label:"Calculators"},{to:"/guides",icon:X,label:"Guides"},{header:"Business tools"},{to:"/expenses",icon:Z,label:"Expenses"},{to:"/timesheets",icon:ee,label:"Timesheets"},{to:"/price-list",icon:te,label:"Price List"},{to:"/subcontractors",icon:se,label:"Subcontractors"},{to:"/business",icon:A,label:"Your business"},...t?.isAdmin?[{header:"Admin"},{to:"/admin",icon:re,label:"Product metrics"}]:[]],[t?.isAdmin,b]),de=d.useMemo(()=>[{to:"/",icon:O,label:"Home"},{to:"/jobs",icon:T,label:"Jobs"},{to:"/certificates",icon:H,label:"Certs"},{to:"/invoices",icon:oe,label:"Invoices"}],[]),[z,me]=d.useState(!1),q=d.useMemo(()=>[...b?[{to:"/pricing",icon:I,label:"Upgrade to Pro",onClick:()=>k("upgrade_prompt_click",{feature:"nav"})}]:[],{to:"/schedule",icon:G,label:"Schedule"},{to:"/clients",icon:J,label:"Clients"},{to:"/properties",icon:A,label:"Properties"},{to:"/quotes",icon:W,label:"Quotes"},{to:"/guides",icon:X,label:"Guides"}],[b]),L=d.useMemo(()=>[{to:"/tools",icon:V,label:"Calculators"},{to:"/expenses",icon:Z,label:"Expenses"},{to:"/timesheets",icon:ee,label:"Timesheets"},{to:"/price-list",icon:te,label:"Price List"},{to:"/subcontractors",icon:se,label:"Subcontractors"},{to:"/business",icon:A,label:"Your business"},...t?.isAdmin?[{to:"/admin",icon:re,label:"Product metrics"}]:[]],[t?.isAdmin]),K=d.useMemo(()=>[...q.map(c=>c.to),...L.map(c=>c.to),"/account"].some(c=>x.pathname===c||x.pathname.startsWith(`${c}/`)),[q,L,x.pathname]),ue=_.some(s=>"to"in s&&x.pathname.startsWith(s.to));return e.jsxs("div",{className:"min-h-screen bg-background-secondary",children:[e.jsx("header",{className:"bg-white border-b border-border sticky top-0 z-40",children:e.jsxs("div",{className:"max-w-6xl mx-auto px-4 h-14 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(be,{size:22}),e.jsx("span",{className:"text-base font-semibold text-primary",children:"CertBox"})]}),e.jsx("nav",{className:"hidden lg:flex items-center gap-4 min-w-0",children:f?p.map(s=>e.jsx(C,{to:s.to,end:s.to==="/",className:({isActive:c})=>`text-sm transition-colors whitespace-nowrap ${c?"font-semibold text-primary":"text-text-secondary hover:text-primary"}`,children:s.label},s.to)):e.jsxs(e.Fragment,{children:[S.map(s=>e.jsx(C,{to:s.to,end:s.to==="/",className:({isActive:c})=>`text-sm transition-colors whitespace-nowrap ${c?"font-semibold text-primary":"text-text-secondary hover:text-primary"}`,children:s.label},s.to)),e.jsxs("div",{className:"relative",ref:j,children:[e.jsxs("button",{onClick:()=>h(!y),"aria-haspopup":"true","aria-expanded":y,className:`flex items-center gap-1 text-sm transition-colors whitespace-nowrap ${ue?"font-semibold text-primary":"text-text-secondary hover:text-primary"}`,children:["More",e.jsx(ke,{size:14,className:`transition-transform ${y?"rotate-180":""}`})]}),y&&e.jsxs("div",{className:"absolute right-0 top-full mt-1 bg-white border border-border rounded-lg shadow-lg py-1 min-w-[180px]",children:[_.map((s,c)=>"header"in s?e.jsx("div",{className:"px-4 pt-2 pb-1 mt-1 border-t border-border text-sm text-text-secondary",children:s.header},`h-${c}`):e.jsxs(C,{to:s.to,onClick:()=>{h(!1),s.onClick?.()},className:({isActive:Q})=>`flex items-center gap-3 px-4 py-2.5 text-sm transition-colors ${Q?"font-semibold text-primary bg-primary/5":"text-text-secondary hover:text-text-primary hover:bg-background-secondary"}`,children:[e.jsx(s.icon,{size:18}),s.label]},s.to)),e.jsxs("button",{onClick:()=>{h(!1),o()},className:"flex items-center gap-3 px-4 py-2.5 text-sm w-full text-left border-t border-border mt-1 text-danger hover:bg-red-50 transition-colors min-h-[44px]",children:[e.jsx(F,{size:18}),"Sign out"]})]})]})]})}),e.jsxs("div",{className:"flex items-center gap-1",children:[E&&e.jsxs(M,{to:"/account?tab=billing",onClick:()=>k("upgrade_prompt_click",{feature:"nav_trial_pill"}),className:"inline-flex items-center gap-1.5 rounded-full bg-cta/15 border border-cta/40 px-2.5 py-1 mr-1 min-h-[32px] hover:bg-cta/25 transition-colors whitespace-nowrap","aria-label":`Pro trial, ${N} day${N===1?"":"s"}
1 left. ${u?"Your card is charged when it ends unless you cancel.":"No card is on file, so nothing will be charged."}`,title:`Your free Pro trial has ${N} day${N===1?"":"s"} left. ${u?"Your card is charged when it ends unless you cancel.":"No card is on file, so nothing will be charged."}`,children:[e.jsx(I,{size:14,className:"text-cta shrink-0","aria-hidden":!0}),e.jsx("span",{className:"text-sm font-semibold text-text-primary",children:"Pro trial"}),e.jsxs("span",{className:"text-sm text-text-secondary hidden sm:inline",children:[N,"d left"]})]}),e.jsxs(M,{to:"/account",className:"text-sm text-text-secondary hidden sm:block mr-2 hover:text-text-primary transition-colors text-right",children:[e.jsx("span",{children:t?.displayName}),(()=>{const s=l.find(c=>c.orgId===t?.orgId);return s&&s.orgName!==t?.displayName?e.jsx("span",{className:"block text-sm text-text-secondary",children:s.orgName}):null})()]}),e.jsx(M,{to:"/account",className:"sm:hidden p-1 min-w-[44px] min-h-[44px] flex items-center justify-center","aria-label":"Account",title:"Account",children:e.jsx("span",{className:"w-7 h-7 rounded-full bg-primary/10 text-primary text-sm font-semibold flex items-center justify-center",children:t?.displayName?.charAt(0)?.toUpperCase()||"?"})}),e.jsx(M,{to:"/search",className:"p-3 min-w-[44px] min-h-[44px] flex items-center justify-center text-text-secondary hover:text-text-primary transition-colors","aria-label":"Search",title:"Search",children:e.jsx(Y,{size:18})}),e.jsx(Te,{})]})]})}),!f&&i&&e.jsx("div",{className:"lg:hidden fixed inset-0 z-50 bg-black/30",onClick:()=>a(!1),children:e.jsxs("nav",{className:"bg-white w-64 h-full shadow-lg overflow-y-auto",role:"dialog","aria-modal":"true",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"px-4 pt-4 pb-3 mb-1 border-b border-border",children:[e.jsx("p",{className:"text-sm text-text-primary",children:t?.displayName}),e.jsx("p",{className:"text-sm text-text-secondary",children:t?.email}),(()=>{const s=l.find(c=>c.orgId===t?.orgId);return s&&s.orgName!==t?.displayName?e.jsx("p",{className:"text-sm text-primary mt-1",children:s.orgName}):null})()]}),q.map(s=>e.jsxs(C,{to:s.to,onClick:()=>{a(!1),s.onClick?.()},className:({isActive:c})=>`flex items-center gap-3 px-3 py-3 text-sm rounded-lg mx-1 transition-colors ${c?"bg-primary/10 text-primary":"text-text-secondary hover:text-text-primary hover:bg-background-secondary"}`,children:[e.jsx(s.icon,{size:20}),s.label]},s.to)),e.jsxs("div",{className:"border-t border-border mt-2 pt-2",children:[e.jsxs("button",{onClick:()=>me(!z),className:"flex items-center justify-between w-full px-3 py-3 text-sm text-text-secondary mx-1",children:[e.jsx("span",{children:"More tools"}),e.jsx(Ce,{size:14,className:`transition-transform ${z?"rotate-90":""}`})]}),z&&L.map(s=>e.jsxs(C,{to:s.to,onClick:()=>a(!1),className:({isActive:c})=>`flex items-center gap-3 px-3 py-3 text-sm rounded-lg mx-1 transition-colors ${c?"bg-primary/10 text-primary":"text-text-secondary hover:text-text-primary hover:bg-background-secondary"}`,children:[e.jsx(s.icon,{size:20}),s.label]},s.to))]}),e.jsxs("div",{className:"border-t border-border mt-4 pt-2 mx-1",children:[e.jsxs(C,{to:"/account",onClick:()=>a(!1),className:({isActive:s})=>`flex items-center gap-3 px-3 py-3 text-sm rounded-lg transition-colors ${s?"bg-primary/10 text-primary":"text-text-secondary hover:text-text-primary hover:bg-background-secondary"}`,children:[e.jsx(U,{size:20}),"Account"]}),e.jsxs("button",{onClick:()=>{a(!1),v(!0)},className:"flex items-center gap-3 px-3 py-3 text-sm text-text-secondary hover:text-text-primary hover:bg-background-secondary rounded-lg w-full",children:[e.jsx(ae,{size:20}),"Send feedback"]}),e.jsxs("button",{onClick:o,className:"flex items-center gap-3 px-3 py-3 text-sm text-danger hover:bg-red-50 rounded-lg w-full",children:[e.jsx(F,{size:20}),"Sign out"]})]})]})}),f&&i&&e.jsx("div",{className:"lg:hidden fixed inset-0 z-50 bg-black/30",onClick:()=>a(!1),children:e.jsxs("nav",{className:"bg-white w-64 h-full p-4 space-y-1 shadow-lg",role:"dialog","aria-modal":"true",onClick:s=>s.stopPropagation(),children:[e.jsxs("div",{className:"pb-3 mb-3 border-b border-border",children:[e.jsx("p",{className:"text-sm text-text-primary",children:t?.displayName}),e.jsx("p",{className:"text-sm text-text-secondary",children:t?.email})]}),p.map(s=>e.jsxs(C,{to:s.to,end:s.to==="/",onClick:()=>a(!1),className:({isActive:c})=>`flex items-center gap-3 px-3 py-3 text-sm rounded-lg transition-colors ${c?"bg-primary/10 text-primary":"text-text-secondary hover:text-text-primary hover:bg-background-secondary"}`,children:[e.jsx(s.icon,{size:20}),s.label]},s.to)),e.jsxs("button",{onClick:()=>{a(!1),v(!0)},className:"flex items-center gap-3 px-3 py-3 text-sm text-text-secondary hover:text-text-primary hover:bg-background-secondary rounded-lg w-full mt-4",children:[e.jsx(ae,{size:20}),"Send feedback"]}),e.jsxs("button",{onClick:o,className:"flex items-center gap-3 px-3 py-3 text-sm text-danger hover:bg-red-50 rounded-lg w-full",children:[e.jsx(F,{size:20}),"Sign out"]})]})}),e.jsx("main",{className:"max-w-6xl mx-auto px-4 py-6 pb-6",children:n??e.jsx(De,{})}),!g&&e.jsx("nav",{className:"lg:hidden fixed bottom-0 left-0 right-0 z-40 bg-white border-t border-border safe-area-bottom",children:e.jsx("div",{className:"flex items-center justify-around h-14",children:f?p.map(s=>e.jsx(C,{to:s.to,end:s.to==="/",className:({isActive:c})=>`flex flex-col items-center justify-center gap-0.5 min-w-[44px] min-h-[44px] text-sm transition-colors relative ${c?"text-primary":"text-text-secondary"}`,children:({isActive:c})=>e.jsxs(e.Fragment,{children:[c&&e.jsx("div",{className:"absolute top-0 left-2 right-2 h-0.5 bg-primary rounded-b"}),e.jsx("div",{className:`p-1.5 rounded-xl transition-all ${c?"bg-primary/10":""}`,children:e.jsx(s.icon,{size:20})}),s.label]})},s.to)):e.jsxs(e.Fragment,{children:[de.map(s=>e.jsx(C,{to:s.to,end:s.to==="/",className:({isActive:c})=>`flex flex-col items-center justify-center gap-0.5 min-w-[44px] min-h-[44px] text-sm transition-colors relative ${c?"text-primary":"text-text-secondary"}`,children:({isActive:c})=>e.jsxs(e.Fragment,{children:[c&&e.jsx("div",{className:"absolute top-0 left-2 right-2 h-0.5 bg-primary rounded-b"}),e.jsx("div",{className:`p-1.5 rounded-xl transition-all ${c?"bg-primary/10":""}`,children:e.jsx(s.icon,{size:20})}),s.label]})},s.to)),e.jsxs("button",{onClick:()=>a(!i),className:`flex flex-col items-center justify-center gap-0.5 min-w-[44px] min-h-[44px] text-sm transition-colors relative ${K?"text-primary":"text-text-secondary"}`,children:[K&&e.jsx("div",{className:"absolute top-0 left-2 right-2 h-0.5 bg-primary rounded-b"}),e.jsx("div",{className:`p-1.5 rounded-xl transition-all ${K?"bg-primary/10":""}`,children:e.jsx(Ee,{size:20})}),e.jsx("span",{children:"More"})]})]})})}),e.jsx(Fe,{}),m&&e.jsx(Ae,{onClose:()=>v(!1)}),e.jsxs("footer",{className:`border-t border-border bg-background-secondary mt-8 ${g?"":"mb-14 lg:mb-0"}`,children:[e.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-4 flex flex-col sm:flex-row items-center justify-between gap-2 text-sm text-text-secondary",children:[e.jsxs("span",{children:["© ",new Date().getFullYear()," CertBox"]}
1),e.jsxs("div",{className:"flex gap-4",children:[e.jsx("button",{onClick:()=>v(!0),className:"inline-flex items-center min-h-[44px] hover:text-text-primary",children:"Feedback"}),e.jsx(M,{to:"/guides/",className:"inline-flex items-center min-h-[44px] hover:text-text-primary",children:"Guides"}),e.jsx("a",{href:"/terms/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center min-h-[44px] hover:text-text-primary",children:"Terms"}),e.jsx("a",{href:"/privacy/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center min-h-[44px] hover:text-text-primary",children:"Privacy"})]})]}),e.jsx("p",{className:"max-w-6xl mx-auto px-4 pb-4 text-center sm:text-left text-sm text-text-secondary text-balance",children:Me})]})]})}export{tt as AppShell};

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.