1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,28653,e=>{"use strict";e.i(436180);var t=e.i(98925),s=e.i(667673),a=e.i(920869),n=e.i(50028);async function r(){let e=s.auth.currentUser;if(console.log("fetching data from firebase"),console.log("user",e?.uid),!e)return void console.log("No user found");let n=(0,t.doc)(s.db,"users",e.uid),r=await (0,t.getDoc)(n);if(console.log("snap",r.exists()),!r.exists())return;let i=r.data();return console.log("data tree",i.tree),i.tree?a.fileFolderTree.updateFromRemote(i.tree):a.fileFolderTree.updateFromRemote(void 0),i}let i=async(e,r)=>{let i=(0,t.doc)(s.db,"users",e),l=await (0,t.getDoc)(i);if(!l.exists()){let s={userId:e,...r,credits:{total:n.FREE_SIGNUP_CREDITS,used:0},plan:"spark",platform:"web",updatedAt:t.Timestamp.now(),createdAt:t.Timestamp.now(),tree:a.rootTree};return await (0,t.setDoc)(i,s,{merge:!0}),s}return l.data()};async function l(e,a){try{let n=(0,t.collection)(s.db,"users",e,"entities",a,"items"),r=await (0,t.getDocs)(n),i=await Promise.all(r.docs.map(async n=>{let r=n.data(),i=(0,t.collection)(s.db,"users",e,"files"),l=(0,t.query)(i,(0,t.where)(`metadata.${a}`,"array-contains",{entityId:n.id,canonicalName:r.canonicalName})),o=await (0,t.getDocs)(l);return{entityId:n.id,...r,fileCount:o.size}}));return console.log(`ð Fetched ${i.length} ${a} with file counts`),i}catch(e){return console.error(`Error fetching ${a} with file counts:`,e),[]}}async function o(e,a,n,r){try{let i=(0,t.collection)(s.db,"users",e,"files"),l=(0,t.query)(i,(0,t.where)(`metadata.${a}`,"array-contains",{entityId:n,canonicalName:r}));return(await (0,t.getDocs)(l)).docs.map(e=>({id:e.id,...e.data()}))}catch(e){return console.error(`Error fetching files for entity ${n}:`,e),[]}}async function d(e,a){try{let n=(0,t.doc)(s.db,"users",e,"files",a),r=await (0,t.getDoc)(n);if(r.exists())return{id:r.id,...r.data()};return null}catch(e){return console.error(`Error fetching file ${a}:`,e),null}}async function c(e){try{let a=(0,t.collection)(s.db,"users",e,"files");return(await (0,t.getDocs)(a)).docs.map(e=>({id:e.id,...e.data()}))}catch(e){return console.error("Error fetching all files:",e),[]}}e.s(["createUserDocument",0,i,"fetchAllFiles",()=>c,"fetchEntitiesByTypeWithFileCounts",()=>l,"fetchFileById",()=>d,"fetchFilesByEntity",()=>o,"fetchUser",()=>r])},516015,(e,t,s)=>{},898547,(e,t,s)=>{var a=e.i(247167);e.r(516015);var n=e.r(271645),r=n&&"object"==typeof n&&"default"in n?n:{default:n},i=void 0!==a.default&&a.default.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,a=void 0===s?"stylesheet":s,n=t.optimizeForSpeed,r=void 0===n?i:n;d(l(a),"`name` must be a string"),this._name=a,this._deletedRulePlaceholder="#"+a+"-deleted-rule____{}",d("boolean"==typeof r,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=r,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var o="undefined"!=typeof window&&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,"undefined"!=typeof window&&this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.getSheet(),this._optimizeForSpeed||(i||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]}
1,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"),"undefined"==typeof window)return"number"!=typeof t&&(t=this._serverSheet.cssRules.length),this._serverSheet.insertRule(e,t),this._rulesCount++;if(this._optimizeForSpeed){var s=this.getSheet();"number"!=typeof t&&(t=s.cssRules.length);try{s.insertRule(e,t)}catch(t){return i||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var a=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,a))}return this._rulesCount++},s.replaceRule=function(e,t){if(this._optimizeForSpeed||"undefined"==typeof window){var s="undefined"!=typeof window?this.getSheet():this._serverSheet;if(t.trim()||(t=this._deletedRulePlaceholder),!s.cssRules[e])return e;s.deleteRule(e);try{s.insertRule(t,e)}catch(a){i||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 a=this._tags[e];d(a,"old rule at index `"+e+"` not found"),a.textContent=t}return e},s.deleteRule=function(e){if("undefined"==typeof window)return void this._serverSheet.deleteRule(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,"undefined"!=typeof window?(this._tags.forEac
1h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]):this._serverSheet.cssRules=[]},s.cssRules=function(){var e=this;return"undefined"==typeof window?this._serverSheet.cssRules: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 a=document.createElement("style");this._nonce&&a.setAttribute("nonce",this._nonce),a.type="text/css",a.setAttribute("data-"+e,""),t&&a.appendChild(document.createTextNode(t));var n=document.head||document.getElementsByTagName("head")[0];return s?n.insertBefore(a,s):n.appendChild(a),a},t=[{key:"length",get:function(){return this._rulesCount}}],function(e,t){for(var s=0;s<t.length;s++){var a=t[s];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,a.key,a)}}(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 f(e,t){if(!t)return"jsx-"+e;var s=String(t),a=e+s;return u[a]||(u[a]="jsx-"+c(e+"-"+s)),u[a]}function x(e,t){"undefined"==typeof window&&(t=t.replace(/\/style/gi,"\\/style"));var s=e+t;return u[s]||(u[s]=t.replace(/__jsx-style-dynamic-selector/g,e)),u[s]}var h=function(){function e(e){var t=void 0===e?{}:e,s=t.styleSheet,a=void 0===s?null:s,n=t.optimizeForSpeed,r=void 0!==n&&n;this._sheet=a||new o({name:"styled-jsx",optimizeForSpeed:r}),this._sheet.inject(),a&&"boolean"==typeof r&&(this._sheet.setOptimizeForSpeed(r),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()),"undefined"==typeof window||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),a=s.styleId,n=s.rules;if(a in this._instancesCounts){this._instancesCounts[a]+=1;return}var r=n.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[a]=r,this._instancesCounts[a]=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 a=this._fromServer&&this._fromServer[s];a?(a.parentNode.removeChild(a),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],a=e[1];return r.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:s.nonce?s.nonce:void 0,dangerouslySetInnerHTML:{__html:a}})})},t.getIdAndRules=function(e){var t=e.children,s=e.dynamic,a=e.id;if(s){var n=f(a,s);return{styleId:n,rules:Array.isArray(t)?t.map(function(e){return x(n,e)}):[x(n,t)]}}return{styleId:f(a),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}(),p=n.createContext(null);function m(){return new h}function b(){return n.useContext(p)}p.displayName="StyleSheetContext";var j=r.default.useInsertionEffect||r.default.useLayoutEffect,g="undefined"!=typeof window?m():void 0;function y(e){var t=g||b();return t&&("undefined"==typeof window?t.add(e):j(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)])),null}y.dynamic=function(e){return e.map(function(e){return f(e[0],e[1])}).join(" ")},s.StyleRegistry=function(e){var t=e.registry,s=e.children,a=n.useContext(p),i=n.useState(function(){return a||t||m(
1)})[0];return r.default.createElement(p.Provider,{value:i},s)},s.createStyleRegistry=m,s.style=y,s.useStyleRegistry=b},437902,(e,t,s)=>{t.exports=e.r(898547).style},751975,346897,e=>{"use strict";var t=e.i(475254);let s=(0,t.default)("tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);e.s(["Tag",()=>s],751975);let a=(0,t.default)("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);e.s(["MapPin",()=>a],346897)},87316,e=>{"use strict";let t=(0,e.i(475254).default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);e.s(["Calendar",()=>t],87316)},440160,398361,778917,e=>{"use strict";var t=e.i(475254);let s=(0,t.default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["Download",()=>s],440160);let a=(0,t.default)("maximize-2",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]]);e.s(["Maximize2",()=>a],398361);let n=(0,t.default)("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);e.s(["ExternalLink",()=>n],778917)},667585,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let a=e.r(132061);function n({reason:e,children:t}){if("undefined"==typeof window)throw Object.defineProperty(new a.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},309885,(e,t,s)=>{"use strict";function a(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"encodeURIPath",{enumerable:!0,get:function(){return a}})},652157,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"PreloadChunks",{enumerable:!0,get:function(){return l}});let a=e.r(843476),n=e.r(174080),r=e.r(563599),i=e.r(309885);function l({moduleIds:e}){if("undefined"!=typeof window)return null;let t=r.workAsyncStorage.getStore();if(void 0===t)return null;let s=[];if(t.reactLoadableManifest&&e){let a=t.reactLoadableManifest;for(let t of e){if(!a[t])continue;let e=a[t].files;s.push(...e)}}return 0===s.length?null:(0,a.jsx)(a.Fragment,{children:s.map(e=>{let s=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}?dpl=dpl_99yu7bUaLiC1oqcXWJ3dateYiDGG`;return e.endsWith(".css")?(0,a.jsx)("link",{precedence:"dynamic",href:s,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,n.preload)(s,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},869093,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return d}});let a=e.r(843476),n=e.r(271645),r=e.r(667585),i=e.r(652157);function l(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},d=function(e){let t={...o,...e},s=(0,n.lazy)(()=>t.loader().then(l)),d=t.loading;function c(e){let l=d?(0,a.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,c=o?n.Suspense:n.Fragment,u=t.ssr?(0,a.jsxs)(a.Fragment,{children:["undefined"==typeof window?(0,a.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,a.jsx)(s,{...e})]}):(0,a.jsx)(r.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(s,{...e})});return(0,a.jsx)(c,{...o?{fallback:l}:{},children:u})}return c.displayName="LoadableComponent",c}},770703,(e,t,s)=>{"use strict";Object.defineProperty(s,"__esModule",{value:!0}),Object.defineProperty(s,"default",{enumerable:!0,get:function(){return n}});let a=e.r(555682)._(e.r(869093));function n(e,t){let s={};"function"==typeof e&&(s.loader=e);let n={...s,...t};return(0,a.default)({...n,modules:n.loadableGenerated?.modules})}("function"==typeof s.default||"object"==typeof s.default&&null!==s.default)&&void 0===s.default.__esModule&&(Object.defineProperty(s.default,"__esMo
1dule",{value:!0}),Object.assign(s.default,s),t.exports=s.default)},125107,e=>{"use strict";var t=e.i(843476),s=e.i(437902),a=e.i(271645),n=e.i(618566),r=e.i(37727),i=e.i(178583),l=e.i(794008),o=e.i(952571),d=e.i(751975),c=e.i(761911),u=e.i(607486),f=e.i(346897),x=e.i(503116),h=e.i(87316),p=e.i(283086),m=e.i(440160),b=e.i(398361),j=e.i(778917),g=e.i(667673),y=e.i(28653),v=e.i(397844),w=e.i(59198);let _=(0,e.i(770703).default)(()=>e.A(326027),{loadableGenerated:{modules:[20982]},ssr:!1,loading:()=>(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-slate-400 gap-4",children:[(0,t.jsx)("div",{className:"w-8 h-8 border-4 border-blue-500 border-t-transparent rounded-full animate-spin"}),(0,t.jsx)("p",{className:"text-sm font-medium",children:"Preparing Viewer..."})]})});function N({file:e,isOpen:N,onClose:S}){let k=(0,n.useRouter)(),[z,R]=(0,a.useState)(null),[F,C]=(0,a.useState)(!1),[T,E]=(0,a.useState)(null),[P,O]=(0,a.useState)(!1);(0,a.useEffect)(()=>{window.innerWidth>=768&&O(!0)},[N]),(0,a.useEffect)(()=>{N&&e?.id&&(async()=>{C(!0);try{let t=g.auth.currentUser;if(!t)return;let s=await t.getIdToken();fetch("/api/files/action",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${s}`},body:JSON.stringify({action:"updateLastOpened",fileId:e.id})});let a=await (0,y.fetchFileById)(t.uid,e.id);a&&R(a)}catch(e){console.error("Error loading file data:",e),E("Failed to load file details")}finally{C(!1)}})()},[N,e?.id]),(0,a.useEffect)(()=>{N||(R(null),E(null))},[N]),(0,a.useEffect)(()=>{let e=e=>{"Escape"===e.key&&S()};return N&&(document.addEventListener("keydown",e),document.body.style.overflow="hidden"),()=>{document.removeEventListener("keydown",e),document.body.style.overflow="unset"}},[N,S]);let A=(e,t)=>{S(),k.push(`/dashboard/entities?search=${encodeURIComponent(e)}&type=${t}`)};if(!N||!e)return null;let I=z?.metadata;return(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 fixed inset-0 bg-slate-950/40 backdrop-blur-md z-[100] flex items-center justify-center p-0 sm:p-4 md:p-6 lg:p-10",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 w-full h-full max-w-[1600px] bg-white rounded-none sm:rounded-[32px] shadow-2xl overflow-hidden flex flex-col relative animate-in zoom-in-95 duration-300",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 h-16 border-b border-slate-100 px-6 flex items-center justify-between bg-white relative z-10 shrink-0",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-3 min-w-0",children:[(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 w-10 h-10 rounded-xl bg-slate-50 flex items-center justify-center text-slate-400 shrink-0",children:(0,t.jsx)(i.FileText,{size:20})}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 min-w-0",children:[(0,t.jsx)("h2",{className:"jsx-3a2a484e1bfd0434 text-sm font-bold text-slate-900 truncate",children:e.name}),(0,t.jsx)("p",{className:"jsx-3a2a484e1bfd0434 text-[10px] font-bold text-slate-400 uppercase tracking-widest leading-none mt-1",children:F?"Loading Intelligence...":z?.path||"Workspace Root"})]})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-2",children:[(0,t.jsx)("button",{onClick:()=>O(!P),title:"Toggle Sidebar",className:`jsx-3a2a484e1bfd0434 p-2 rounded-xl transition-all ${P?"bg-slate-100 text-slate-900":"text-slate-400 hover:bg-slate-50"}`,children:(0,t.jsx)(o.Info,{size:18})}),(0,t.jsx)("a",{href:e.r2Url,target:"_blank",download:!0,title:"Download",className:"jsx-3a2a484e1bfd0434 p-2 rounded-xl text-slate-400 hover:bg-slate-50 transition-all hidden sm:flex",children:(0,t.jsx)(m.Download,{size:18})}),(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 w-px h-6 bg-slate-100 mx-2 hidden sm:block"}),(0,t.jsx)("button",{onClick:S,title:"Close (Esc)",className:"jsx-3a2a484e1bfd0434 p-2 rounded-xl text-slate-400 hover:bg-red-50 hover:text-red-500 transition-all",children:(0,t.jsx)(r.X,{size:20})})]})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex-1 flex overflow-hidden bg-slate-50/50 relative",children:[(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 flex-1 relative overflow-hidden flex items-center justify-center p-2 sm:p-4",children:e.mimeType.includes("pdf")?(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 w-full h-full bg-white rounded-xl sm:rounded-2xl shadow-sm border border-slate-100 overflow-hidden relative",children:[(0,t.jsx)(_,{url:e.r2Url}),(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 absolute top-0 left-0 right-0 h-1 bg-gradient-to-b from-white to-transparent pointer-events-none"})]}):e.mimeType.includes("image")?(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 h-full flex items-center justify-center p-2 sm:p-4",children:(0,t.jsx)("img",{src:e.r2Url,alt:e.name,className:"jsx-3a2a484e1bfd0434 max-w-full max-h-full object-contain rounded-lg sm:rounded-xl shadow-xl border border-white"})}):(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex flex-col items-center gap-4 text-slate-400",children:[(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 w-20 h-20 rounded-[2rem] bg-slate-100 flex items-center justify-center",children:(0,t.jsx)(l.File,{size:40})}),(0,t.jsx)("p",{className:"jsx-3a2a484e1bfd0434 text-xs sm:text-sm font-medium",children:"Preview not available"}),(0,t.jsx)("a",{href:e.r2Url,target:"_blank",className:"jsx-3a2a484e1bfd0434 px-6 py-2 bg-slate-900 text-white rounded-xl text-[10px] sm:text-xs font-bold hover:bg-slate-800 transition-all",children:"Download File"})]})}),P&&(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 absolute inset-0 lg:relative lg:inset-auto w-full lg:w-[380px] h-full border-l border-slate-100 bg-white/95 lg:bg-white backdrop-blur-md lg:backdrop-blur-none flex flex-col overflow-hidden animate-in slide-in-from-right lg:slide-in-from-right duration-300 z-40",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex-1 overflow-y-auto p-6 sm:p-8 space-y-10 custom-scrollbar min-h-0",children:[(0,t.jsx)("button",{onClick:()=>O(!1),className:"jsx-3a2a484e1bfd0434 lg:hidden absolute top-6 right-6 p-2 rounded-full bg-slate-100 text-slate-500 hover:bg-slate-200 transition-all z-50",children:(0,t.jsx)(r.X,{size:18})}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 space-y-4",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-2 text-slate-400",children:[(0,t.jsx)(x.Clock,{size:14}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[10px] font-bold uppercase tracking-widest",children:"About this file"})]}),(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 space-y-3",children:(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 p-4 bg-slate-50 rounded-2xl space-y-3",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex justify-between items-center",children:[(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[11px] font-bold text-slate-400 uppercase tracking-tight",children:"Format"}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-xs font-bold text-slate-700",children:(0,v.getFileDisplayType)(e.r2Url)})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex justify-between items-center",children:[(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[11px] font-bold text-slate-400 uppercase tracking-tight",children:"Size"}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-xs font-bold text-slate-700",children:z?.size?(0,v.formatFileSize)(z.size):"Calculating..."})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex justify-between items-center",children:[(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[11px] font-bold text-slate-400 uppercase tracking-tight",children:"Modified"}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-xs font-bold text-slate-700",children:z?.timestamp?(0,v.timeAgo)(z.timestamp):"Unknown"})]})]})})]}),z?.metadata?.topics&&z.metadata.topics.length>0&&(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 space-y-4",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-2 text-slate-400",children:[(0,t.jsx)(d.Tag,{size:14,className:"text-blue-600"}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[10px] font-bold uppercase tracking-widest",children:"Tags & Metadata"})]}),(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 flex flex-wrap gap-2",children:z?.metadata?.topics?.map((e,s)=>(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 px-3 py-1 rounded-full text-blue-600 text-[10px] font-bold border border-blue-100 bg-blue-50/50 flex items-center gap-1",children:e},s))})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 space-y-4",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-2 text-slate-400",children:[(0,t.jsx)(p.Sparkles,{size:14,className:"text-blue-500"}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[10px] font-bold uppercase tracking-widest text-blue-600",children:"AI Intelligence"})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 p-5 bg-blue-50/30 border border-blue-50 rounded-2xl relative overflow-hidden group",children:[(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 absolute top-0 right-0 p-3 op
1acity-10 group-hover:opacity-20 transition-opacity",children:(0,t.jsx)(p.Sparkles,{size:40,className:"text-blue-600 fill-current"})}),(0,t.jsx)("h4",{className:"jsx-3a2a484e1bfd0434 text-xs font-bold text-slate-900 mb-2",children:"Executive Summary"}),(0,t.jsx)("p",{className:"jsx-3a2a484e1bfd0434 text-[13px] text-slate-600 leading-relaxed font-medium italic",children:F?"Analyzing document content...":z?.metadata.summary||"No summary available for this document."})]})]}),I?.dates&&I.dates.length>0&&(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 space-y-4",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-2 text-slate-400",children:[(0,t.jsx)(h.Calendar,{size:14,className:"text-amber-500"}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[10px] font-bold uppercase tracking-widest text-amber-600",children:"Important Dates"})]}),(0,t.jsx)("div",{className:"jsx-3a2a484e1bfd0434 grid gap-2",children:I.dates.map((e,s)=>(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex justify-between items-center p-3 rounded-xl bg-amber-50/50 border border-amber-50",children:[(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[11px] font-bold text-slate-600 truncate mr-2",children:(0,w.toTitleCase)(e.label||"")}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[11px] font-bold text-amber-700 whitespace-nowrap",children:e.value?new Date(e.value).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"N/A"})]},s))})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 space-y-6",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-2 text-slate-400",children:[(0,t.jsx)(b.Maximize2,{size:14}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[10px] font-bold uppercase tracking-widest",children:"Extracted Entities"})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 space-y-3",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-2 text-slate-500",children:[(0,t.jsx)(c.Users,{size:14}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[11px] font-bold uppercase tracking-tight",children:"People"})]}),(0,t.jsxs)("span",{className:"jsx-3a2a484e1bfd0434 text-[10px] font-bold text-slate-400",children:[I?.people?.length||0," Found"]})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex flex-wrap gap-2",children:[I?.people?.map((e,s)=>(0,t.jsxs)("button",{onClick:()=>A(e.canonicalName,"people"),className:"jsx-3a2a484e1bfd0434 group flex items-center gap-1.5 px-3 py-1.5 bg-slate-50 hover:bg-slate-100 text-slate-700 text-[11px] font-bold rounded-lg border border-slate-100 italic transition-all",children:[e.canonicalName,(0,t.jsx)(j.ExternalLink,{size:10,className:"opacity-0 group-hover:opacity-40"})]},s)),!I?.people?.length&&(0,t.jsx)("p",{className:"jsx-3a2a484e1bfd0434 text-[11px] text-slate-400 font-medium",children:"None detected"})]})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 space-y-3",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-2 text-slate-500",children:[(0,t.jsx)(u.Building2,{size:14}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[11px] font-bold uppercase tracking-tight",children:"Organizations"})]}),(0,t.jsxs)("span",{className:"jsx-3a2a484e1bfd0434 text-[10px] font-bold text-slate-400",children:[I?.organizations?.length||0," Found"]})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex flex-wrap gap-2",children:[I?.organizations?.map((e,s)=>(0,t.jsxs)("button",{onClick:()=>A(e.canonicalName,"organizations"),className:"jsx-3a2a484e1bfd0434 group flex items-center gap-1.5 px-3 py-1.5 bg-slate-50 hover:bg-slate-100 text-slate-700 text-[11px] font-bold rounded-lg border border-slate-100 transition-all",children:[e.canonicalName,(0,t.jsx)(j.ExternalLink,{size:10,className:"opacity-0 group-hover:opacity-40"})]},s)),!I?.organizations?.length&&(0,t.jsx)("p",{className:"jsx-3a2a484e1bfd0434 text-[11px] text-slate-400 font-medium",children:"None detected"})]})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 space-y-3",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex items-center gap-2 text-slate-500",children:[(0,t.jsx)(f.MapPin,{size:14}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[11px] font-bold uppercase tracking-tight",children:"Locations"})]}),(0,t.jsxs)("span",{className:"jsx-3a2a484e1bfd0434 text-[10px] font-bold text-slate-400",children:[I?.locations?.length||0," Found"]})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 flex flex-wrap gap-2",children:[I?.locations?.map((e,s)=>(0,t.jsxs)("button",{onClick:()=>A(e.canonicalName,"locations"),className:"jsx-3a2a484e1bfd0434 group flex items-center gap-1.5 px-3 py-1.5 bg-slate-50 hover:bg-slate-100 text-slate-700 text-[11px] font-bold rounded-lg border border-slate-100 transition-all",children:[e.canonicalName,(0,t.jsx)(j.ExternalLink,{size:10,
1className:"opacity-0 group-hover:opacity-40"})]},s)),!I?.locations?.length&&(0,t.jsx)("p",{className:"jsx-3a2a484e1bfd0434 text-[11px] text-slate-400 font-medium",children:"None detected"})]})]})]})]}),(0,t.jsxs)("div",{className:"jsx-3a2a484e1bfd0434 p-6 bg-white border-t border-slate-100 flex items-center justify-center gap-2 text-slate-400 shrink-0",children:[(0,t.jsx)(d.Tag,{size:12}),(0,t.jsx)("span",{className:"jsx-3a2a484e1bfd0434 text-[9px] font-bold uppercase tracking-[0.2em]",children:"End of Document Intelligence"})]})]})]})]}),(0,t.jsx)(s.default,{id:"3a2a484e1bfd0434",children:".custom-scrollbar.jsx-3a2a484e1bfd0434::-webkit-scrollbar{width:4px}.custom-scrollbar.jsx-3a2a484e1bfd0434::-webkit-scrollbar-track{background:0 0}.custom-scrollbar.jsx-3a2a484e1bfd0434::-webkit-scrollbar-thumb{background:#f1f5f9;border-radius:10px}.custom-scrollbar.jsx-3a2a484e1bfd0434.jsx-3a2a484e1bfd0434::-webkit-scrollbar-thumb:hover{background:#e2e8f0}"})]})}e.s(["FileModal",()=>N])}]);
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.