https://aiagentstore.ai/_next/static/chunks/pages/admin/ai-opportunity-responses-a6c0a10109554c73.js
1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8361],{5002:(e,t,s)=>{"use strict";var r=s(42490);s(34117);var n=s(16879),i=function(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}(n),a=void 0!==r&&r.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},o=function(){function e(e){var t=void 0===e?{}:e,s=t.name,r=void 0===s?"stylesheet":s,n=t.optimizeForSpeed,i=void 0===n?a:n;d(l(r),"`name` must be a string"),this._name=r,this._deletedRulePlaceholder="#"+r+"-deleted-rule____{}",d("boolean"==typeof i,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=i,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o=document.querySelector('meta[property="csp-nonce"]');this._nonce=o?o.getAttribute("content"):null}var t,s=e.prototype;return s.setOptimizeForSpeed=function(e){d("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),d(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},s.isOptimizeForSpeed=function(){return this._optimizeForSpeed},s.inject=function(){var e=this;if(d(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(a||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,s){return"number"==typeof s?e._serverSheet.cssRules[s]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),s},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},s.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},s.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},s.insertRule=function(e,t){if(d(l(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var s=this.getSheet();"number"!=typeof t&&(t=s.cssRules.length);try{s.insertRule(e,t)}catch(t){return a||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var r=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,r))}return this._rulesCount++},s.replaceRule=function(e,t){if(this._optimizeForSpeed){var s=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!s.cssRules[e])return e;s.deleteRule(e);try{s.insertRule(t,e)}catch(r){a||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),s.insertRule(this._deletedRulePlaceholder,e)}}else{var r=this._tags[e];d(r,"old rule at index `"+e+"` not found"),r.textContent=t}return e},s.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];d(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},s.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
1h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]},s.cssRules=function(){var e=this;return this._tags.reduce(function(t,s){return s?t=t.concat(Array.prototype.map.call(e.getSheetForTag(s).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},s.makeStyleTag=function(e,t,s){t&&d(l(t),"makeStyleTag accepts only strings as second parameter");var r=document.createElement("style");this._nonce&&r.setAttribute("nonce",this._nonce),r.type="text/css",r.setAttribute("data-"+e,""),t&&r.appendChild(document.createTextNode(t));var n=document.head||document.getElementsByTagName("head")[0];return s?n.insertBefore(r,s):n.appendChild(r),r},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var s=0;s<t.length;s++){var r=t[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}();function d(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var c=function(e){for(var t=5381,s=e.length;s;)t=33*t^e.charCodeAt(--s);return t>>>0},u={};function h(e,t){if(!t)return"jsx-"+e;var s=String(t),r=e+s;return u[r]||(u[r]="jsx-"+c(e+"-"+s)),u[r]}function p(e,t){var s=e+t;return u[s]||(u[s]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[s]}var m=function(){function e(e){var t=void 0===e?{}:e,s=t.styleSheet,r=void 0===s?null:s,n=t.optimizeForSpeed,i=void 0!==n&&n;this._sheet=r||new o({name:"styled-jsx",optimizeForSpeed:i}),this._sheet.inject(),r&&"boolean"==typeof i&&(this._sheet.setOptimizeForSpeed(i),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var s=this.getIdAndRules(e),r=s.styleId,n=s.rules;if(r in this._instancesCounts){this._instancesCounts[r]+=1;return}var i=n.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[r]=i,this._instancesCounts[r]=1},t.remove=function(e){var t=this,s=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(s in this._instancesCounts,"styleId: `"+s+"` not found"),this._instancesCounts[s]-=1,this._instancesCounts[s]<1){var r=this._fromServer&&this._fromServer[s];r?(r.parentNode.removeChild(r),delete this._fromServer[s]):(this._indices[s].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[s]),delete this._instancesCounts[s]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],s=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return s[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return!!e[1]}))},t.styles=function(e){var t,s;return t=this.cssRules(),void 0===(s=e)&&(s={}),t.map(function(e){var t=e[0],r=e[1];return i.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:s.nonce?s.nonce:void 0,dangerouslySetInnerHTML:{__html:r}})})},t.getIdAndRules=function(e){var t=e.children,s=e.dynamic,r=e.id;if(s){var n=h(r,s);return{styleId:n,rules:Array.isArray(t)?t.map(function(e){return p(n,e)}):[p(n,t)]}}return{styleId:h(r),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),x=n.createContext(null);x.displayName="StyleSheetContext";var f=i.default.useInsertionEffect||i.default.useLayoutEffect,y=new m;function g(e){var t=y||n.useContext(x);return t&&f(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}g.dynamic=function(e){return e.map(function(e){return h(e[0],e[1])}).join(" ")},t.style=g},12970:(e,t,s)=>{"use strict";s.d(t,{I:()=>i});var r=s(89917),n=s(81829);let i=(0,r.c7)(n.app)},15597:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/ai-opportunity-responses",function(){return s(31450)}])},23915:(e,t,s)=>{"use strict";s.d(t,{db:()=>n.db,j2:()=>r.auth});var r=s(81829),n=s(47530);s(89226),s(12970)},31450:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var r=s(69519),n=s(45047),i=s.n(n),a=s(69842),l=s(11695),o=s(47530),d=s(16879),c=s(65225);function u(e){let{item:t,onSelect:s,selectedId:n}=e,i=t.createdAt?.toDate?t.createdAt.toDate():t.createdAt?._seconds?new Date(1e3*t.createdAt._seconds):null,a=n===t.id;
1return(0,r.jsxs)("tr",{className:`cursor-pointer ${a?"bg-gray-200":"hover:bg-gray-50"}`,onClick:()=>s(t),"aria-selected":a,children:[(0,r.jsx)("td",{className:"px-3 py-2 text-sm text-gray-600",children:i?i.toLocaleString():"-"}),(0,r.jsx)("td",{className:"px-3 py-2 text-sm font-medium",children:t.email}),(0,r.jsx)("td",{className:"px-3 py-2 text-sm",children:t.country||"-"}),(0,r.jsx)("td",{className:"px-3 py-2 text-sm",children:t.city||"-"}),(0,r.jsx)("td",{className:"px-3 py-2 text-xs",children:(0,r.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded",children:t.status||"-"})}),(0,r.jsx)("td",{className:"px-3 py-2 text-xs",children:(0,r.jsx)("span",{className:"px-2 py-1 bg-gray-100 rounded",children:t.analysisStatus||"-"})}),(0,r.jsx)("td",{className:"px-3 py-2 text-sm text-right",children:t.lastBlockSubmitted||"-"})]})}let h="https://aiagentstore.ai";function p(e){let{doc:t,onOpenAnswers:s}=e;if(!t)return(0,r.jsx)("div",{className:"text-sm text-gray-500",children:"Select a row to view details"});let n=t.createdAt?.toDate?t.createdAt.toDate():t.createdAt?._seconds?new Date(1e3*t.createdAt._seconds):null,[a,l]=(0,d.useState)({reanalyze:!1,resend:!1}),[o,c]=(0,d.useState)(""),[u,p]=(0,d.useState)(!1),m=async()=>{try{l(e=>({...e,reanalyze:!0})),c(""),p(!0);let e=await fetch(`${h}/reAnalyzeAiOpportunityResponse`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({docId:t.id})}),s=await e.json();if(!e.ok||!s?.success)throw Error(s?.error||"request_failed");c("Re-analysis requestedâ¦")}catch(e){c("Failed to request re-analysis.")}finally{l(e=>({...e,reanalyze:!1}))}},x=async()=>{try{l(e=>({...e,resend:!0})),c("");let e=await fetch(`${h}/resendAiOpportunityReport`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({docId:t.id})}),s=await e.json();if(!e.ok||!s?.success)throw Error(s?.error||"request_failed");c("Report email resent to user.")}catch(e){c("Failed to resend email.")}finally{l(e=>({...e,resend:!1}))}},f=u||"analyzing"===t.analysisStatus,y=function(e){let t=String(e||"").trim().replace(/^```(?:html|markdown|md|text|txt)?\s*/i,"").replace(/\s*```$/i,""),s=t.match(/BEGIN_HTML\b:?([\s\S]*?)(?:\bEND_HTML\b|\bBEGIN_SUMMARY\b|$)/i),r=(s?s[1]:t).replace(/^\s*BEGIN_(?:HTML|SUMMARY)\b:?\s*$/gim,"").replace(/^\s*END_(?:HTML|SUMMARY)\b:?\s*$/gim,"").replace(/<\/?(?:html|body)[^>]*>/gi,"").trim();return/<h2|<ol|<ul|<p|<br\s*\/?>/i.test(r)?r:r.split(/\r?\n/).map(e=>e.trim()).filter((e,t,s)=>""!==e||""!==(s[t-1]||"")).map(e=>e?/^(executive summary|quick wins|phased|kpi|roi|next steps|data \+ integration|data and integration)/i.test(e)?`<h2>${e}</h2>`:`<p>${e}</p>`:"").join("")||r}(t.aiReportHtml||"");return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{className:"text-sm text-gray-600",children:["Created: ",n?n.toLocaleString():"-"]}),(0,r.jsxs)("div",{className:"text-sm",children:["Email: ",(0,r.jsx)("b",{children:t.email})," | ",t.country||"-",", ",t.city||"-"]}),(0,r.jsxs)("div",{className:"text-sm",children:["Status: ",(0,r.jsx)("b",{children:t.status||"-"})," | Analysis: ",(0,r.jsx)("b",{children:t.analysisStatus||"-"})]}),(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,r.jsx)("button",{className:"px-3 py-1.5 rounded bg-blue-600 text-white text-sm hover:bg-blue-700",onClick:()=>s(t),children:"View answers (formatted)"}),(0,r.jsx)("button",{className:`px-3 py-1.5 rounded text-white text-sm ${a.reanalyze?"bg-gray-400":"bg-indigo-600 hover:bg-indigo-700"}`,onClick:m,disabled:a.reanalyze,children:a.reanalyze?"Re-analyzingâ¦":"Re-analyze"}),(0,r.jsx)("button",{className:`px-3 py-1.5 rounded text-white text-sm ${a.resend?"bg-gray-400":"bg-emerald-600 hover:bg-emerald-700"}`,onClick:x,disabled:a.resend,children:a.resend?"Resendingâ¦":"Resend email"}),o?(0,r.jsx)("div",{className:"text-sm text-gray-700",children:o}):null]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"font-semibold mb-2",children:"AI Report"}),t.aiReportHtml?(0,r.jsxs)("div",{className:"jsx-9885289d209f9723 border rounded overflow-hidden bg-white",children:[(0,r.jsx)(i(),{id:"9885289d209f9723",children:'.email-preview.jsx-9885289d209f9723{font-family:Inter,Arial,sans-serif;max-width:760px;margin:auto;color:#111;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.email-header.jsx-9885289d209f9723{padding:28px 28px 12px}.email-header.jsx-9885289d209f9723 h1.jsx-9885289d209f9723{font-size:32px;line-height:1.25;margin:0 0 12px 0;font-weight:800}.email-header.jsx-9885289d209f9723 .sub.jsx-9885289d209f9723{font-size:15px;color:#555;margin-bottom:18px}.email-content.jsx-9885289d209f9723{padding:0 28px 28px;font-size:16px;line-height:1.75;white-space:normal}.email-content.jsx-9885289d209f9723 h2.jsx-9885289d209f9723{margin:28px 0 12px 0;font-size:24px;line-height:1.35;font-weight:800}.email-content.jsx-9885289d209f9723 h3.jsx-9885289d209f9723{margin:20px 0 10px 0;font-size:18px;font-weight:700}.email-content.jsx-9885289d209f9723 p.jsx-9885289d209f9723{margin:14px 0}.email-content.jsx-9885289d209f9723 ol.jsx-9885289d209f9723,.email-content.jsx-9885289d209f9723 ul.jsx-9885289d209f9723{margin:12px 0 12px 24px}.email-content.jsx-9885289d209f9723 li.jsx-9885289d209f9723{margin:6px 0}.email-content.jsx-9885289d209f9723 strong.jsx-9885289d209f9723,.email-content.jsx-9885289d209f9723 b.jsx-9885289d209f9723{font-weight:700}.email-content.jsx-9885289d209f9723 p.jsx-9885289d209f9723>strong.jsx-9885289d209f9723:first-child{display:block;font-size:22px;line-height:1.4;margin:24px 0 8px;font-weight:800}.email-content.jsx-9885289d209f9723 p.jsx-9885289d209f9723:before{content:""}.email-content.jsx-9885289d209f9723 .kpi.jsx-9885289d209f9723,.email-content.jsx-9885289d209f9723 .note.jsx-9885289d209f9723{color:#333}'}),(0,r.jsxs)("div",{className:"jsx-9885289d209f9723 email-preview",children:[(0,r.jsxs)("div",{className:"jsx-9885289d209f9723 email-header",children:[(0,r.jsx)("h1",{className:"jsx-9885289d209f9723",children:"Your AI Opportunity Plan"}),(0,r.jsx)("div",{className:"jsx-9885289d209f9723 sub",children:"Prepared from your questionnaire. Save this email for reference."})]}),(0,r.jsxs)("div",{className:"jsx-9885289d209f9723 email-content relative",children:[f&&(0,r.jsx)("div",{className:"jsx-9885289d209f9723 absolute inset-0 bg-white/60 backdrop-blur-sm flex items-center justify-center z-10",children:(0,r.jsxs)("div",{className:"jsx-9885289d209f9723 flex items-center gap-2 text-gray-700",children:[(0,r.jsx)("span",{className:"jsx-9885289d209f9723 animate-spin h-5 w-5 border-2 border-gray-400 border-t-transparent roun
1ded-full"}),"Analyzingâ¦"]})}),(0,r.jsx)("div",{dangerouslySetInnerHTML:{__html:y},className:"jsx-9885289d209f9723"})]})]})]}):(0,r.jsx)("div",{className:"text-sm text-gray-500",children:"No report yet."})]})]})}function m(e){let{doc:t,onClose:s}=e;if(!t)return null;let{questions:n,option_sets:i}=c.A,a=t.answers||{},l=e=>0===e||!1===e||(Array.isArray(e)?e.length>0:null!=e&&""!==String(e)),o=(()=>{let e=-1;for(let t=0;t<n.length;t++)l(a[n[t].key])&&(e=t);return e})(),d=Math.min(n.length-1,o>=0?o+3:2),u=n.map((e,t)=>({q:e,i:t})).slice(0,d+1).reduce((e,t)=>((e[t.q.block]=e[t.q.block]||[]).push(t),e),{});return(0,r.jsx)("div",{className:"fixed inset-0 bg-black/60 z-[999999] overflow-y-auto",role:"dialog","aria-modal":"true",children:(0,r.jsx)("div",{className:"min-h-full flex items-start justify-center p-4",children:(0,r.jsxs)("div",{className:"bg-white rounded-xl shadow-2xl w-full max-w-5xl border p-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,r.jsx)("h2",{className:"text-xl font-bold",children:"Questionnaire Answers"}),(0,r.jsx)("button",{onClick:s,className:"px-3 py-1.5 rounded bg-gray-200 hover:bg-gray-300",children:"Close"})]}),(0,r.jsx)("div",{className:"space-y-6",children:Object.keys(u).sort((e,t)=>Number(e)-Number(t)).map(e=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"border-t border-gray-300 pt-4 mb-2 text-xs text-gray-500",children:["Block ",e]}),(0,r.jsx)("div",{className:"space-y-4",children:u[e].map(e=>{let{q:t}=e,s=a[t.key],n=t.options||t.options_ref&&i[t.options_ref]||[],o="multiple_choice"===t.type&&Array.isArray(s)?s:[],d=a[`${t.key}_other`];return(0,r.jsxs)("div",{className:"",children:[(0,r.jsx)("div",{className:"text-xs font-semibold text-gray-500",children:t.category}),(0,r.jsx)("div",{className:"text-sm font-semibold text-gray-900 mb-1",children:t.text}),"single_choice"===t.type&&(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[n.map(e=>{let t=s===e.value;return(0,r.jsx)("span",{className:`px-2 py-1 rounded text-xs ${t?"bg-blue-600 text-white":"bg-red-50 text-red-700 border border-red-300"}`,children:e.label},e.value)}),"other"===s&&d?(0,r.jsxs)("span",{className:"px-2 py-1 rounded text-xs bg-blue-700 text-white",children:["Other: ",d]}):null]}),"multiple_choice"===t.type&&(0,r.jsxs)("div",{className:"flex flex-wrap gap-2",children:[n.map(e=>{let t=o.includes(e.value);return(0,r.jsx)("span",{className:`px-2 py-1 rounded text-xs ${t?"bg-blue-600 text-white":"bg-red-50 text-red-700 border border-red-300"}`,children:e.label},e.value)}),o.includes("other")&&d?(0,r.jsxs)("span",{className:"px-2 py-1 rounded text-xs bg-blue-700 text-white",children:["Other: ",d]}):null]}),"boolean"===t.type&&(0,r.jsx)("div",{className:"flex gap-2",children:["Yes","No"].map((e,t)=>{let n=!0===s&&0===t||!1===s&&1===t;return(0,r.jsx)("span",{className:`px-2 py-1 rounded text-xs ${n?"bg-blue-600 text-white":"bg-red-50 text-red-700 border border-red-300"}`,children:e},e)})}),("number"===t.type||"percent"===t.type||"currency"===t.type)&&l(s)&&(0,r.jsxs)("div",{className:"px-3 py-2 rounded bg-gray-50 border text-sm inline-block",children:[String(s),"percent"===t.type?" %":"",t.unit?` (${t.unit})`:""]}),("text"===t.type||"scale"===t.type)&&l(s)&&(0,r.jsx)("div",{className:"px-3 py-2 rounded bg-gray-50 border text-sm whitespace-pre-wrap",children:String(s)}),!l(s)&&n.length>0&&(0,r.jsx)("div",{className:"flex flex-wrap gap-2 mt-1",children:n.map(e=>(0,r.jsx)("span",{className:"px-2 py-1 rounded text-xs bg-red-50 text-red-700 border border-red-300 opacity-80",children:e.label},e.value))})]},t.id)})})]},e))})]})})})}let x=(0,a.A)(function(){let[e,t]=(0,d.useState)([]),[s,n]=(0,d.useState)(null),[i,a]=(0,d.useState)(""),[c,h]=(0,d.useState)(null);(0,d.useEffect)(()=>{if(!s?.id)return;let e=(0,l.doc)(o.db,"aiOpportunityResponses",s.id),t=(0,l.onSnapshot)(e,e=>{e.exists()&&n({id:e.id,...e.data()})});return()=>t()},[s?.id]),(0,d.useEffect)(()=>{let e=(0,l.collection)(o.db,"aiOpportunityResponses"),s=(0,l.query)(e,(0,l.orderBy)("createdAt","desc"),(0,l.limit)(200)),r=(0,l.onSnapshot)(s,e=>{t(e.docs.map(e=>({id:e.id,...e.data()})))});return()=>r()},[]);let x=(0,d.useMemo)(()=>{let t=i.trim().toLowerCase();return t?e.filter(e=>(e.email||"").toLowerCase().includes(t)):e},[e,i]);return(0,r.jsxs)("div",{className:"max-w-6xl mx-auto px-4 py-6",children:[(0,r.jsx)("h1",{className:"text-2xl font-bold mb-4",children:"AI Opportunity Responses"}),(0,r.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,r.jsx)("input",{className:"border rounded px-3 py-2 w-64",placeholder:"Search by email",value:i,onChange:e=>a(e.target.value)}),(0,r.jsxs)("div",{className:"text-sm text-gray-600",children:[x.length," total"]})]}),(0,r.jsx)("div",{className:"border rounded overflow-auto",style:{maxHeight:500},children:(0,r.jsxs)("table",{className:"min-w-full text-sm",children:[(0,r.jsx)("thead",{className:"bg-gray-50 sticky top-0",children:(0,r.jsxs)("tr",{children:[(0,r.jsx)("th",{className:"px-3 py-2 text-left",children:"Created"}),(0,r.jsx)("th",{className:"px-3 py-2 text-left",children:"Email"}),(0,r.jsx)("th",{className:"px-3 py-2 text-left",children:"Country"}),(0,r.jsx)("th",{className:"px-3 py-2 text-left",children:"City"}),(0,r.jsx)("th",{className:"px-3 py-2 text-left",children:"Status"}),(0,r.jsx)("th",{className:"px-3 py-2 text-left",children:"Analysis"}),(0,r.jsx)("th",{className:"px-3 py-2 text-right",children:"Block"})]})}),(0,r.jsx)("tbody",{children:x.map(e=>(0,r.jsx)(u,{item:e,onSelect:n,selectedId:s?.id},e.id))})]})})]}),(0,r.jsx)("div",{children:(0,r.jsx)(p,{doc:s,onOpenAnswers:e=>h(e)})})]}),c&&(0,r.jsx)(m,{doc:c,onClose:()=>h(null)})]})})},34117:()=>{},45047:(e,t,s)=>{"use strict";e.exports=s(5002).style},47530:(e,t,s)=>{"use strict";s.r(t),s.d(t,{db:()=>i});var r=s(11695),n=s(81829);let i=(0,r.getFirestore)(n.app)},69842:(e,t,s)=>{"use strict";s.d(t,{A:()=>d});var r=s(69519),n=s(16879),i=s(96200),a=s(23915),l=s(11695),o=s(95090);let d=e=>t=>
1{let s=(0,i.useRouter)(),[d,c]=(0,n.useState)(null),[u,h]=(0,n.useState)(""),p=(0,n.useRef)(null);return((0,n.useEffect)(()=>{let e=a.j2.onAuthStateChanged(async e=>{if(!e){c(null),h("noauth"),p.current&&clearTimeout(p.current),p.current=setTimeout(()=>c(!1),1400);return}p.current&&(clearTimeout(p.current),p.current=null);try{let t=await (0,l.getDoc)((0,l.doc)(a.db,"users",e.uid)),s=t.exists()&&t.data()?.admin===111;c(s),h(s?"":"forbidden")}catch(e){console.error("Error fetching user data:",e),c(!1),h("error")}});return()=>{e&&e(),p.current&&clearTimeout(p.current)}},[]),null===d)?(0,r.jsx)("div",{className:"flex justify-center items-center h-screen",children:(0,r.jsx)(o.A,{})}):d?(0,r.jsx)(e,{...t,isAdmin:d}):("noauth"===u?s.push("/login"):s.push("/unauthorized"),null)}},89226:(e,t,s)=>{"use strict";s.d(t,{C:()=>i});var r=s(7924),n=s(81829);let i=(0,r.Uz)(n.app)},95090:(e,t,s)=>{"use strict";s.d(t,{A:()=>n});var r=s(69519);let n=function(){return(0,r.jsx)("div",{className:"loader"})}}},e=>{e.O(0,[6235,5497,8430,7924,9917,5225,636,6593,8792],()=>e(e.s=15597)),_N_E=e.O()}]);
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.