1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67585,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"BailoutToCSR",{enumerable:!0,get:function(){return n}});let a=e.r(32061);function n({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new a.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,r)=>{"use strict";function a(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"encodeURIPath",{enumerable:!0,get:function(){return a}})},52157,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"PreloadChunks",{enumerable:!0,get:function(){return l}});let a=e.r(18050),n=e.r(74080),s=e.r(63599),i=e.r(9885),o=e.r(43369);function l({moduleIds:e}){if("u">typeof window)return null;let t=s.workAsyncStorage.getStore();if(void 0===t)return null;let r=[];if(t.reactLoadableManifest&&e){let a=t.reactLoadableManifest;for(let t of e){if(!a[t])continue;let e=a[t].files;r.push(...e)}}if(0===r.length)return null;let d=(0,o.getAssetTokenQuery)();return(0,a.jsx)(a.Fragment,{children:r.map(e=>{let r=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${d}`;return e.endsWith(".css")?(0,a.jsx)("link",{precedence:"dynamic",href:r,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,n.preload)(r,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return d}});let a=e.r(18050),n=e.r(71645),s=e.r(67585),i=e.r(52157);function o(e){return{default:e&&"default"in e?e.default:e}}let l={loader:()=>Promise.resolve(o(()=>null)),loading:null,ssr:!0},d=function(e){let t={...l,...e},r=(0,n.lazy)(()=>t.loader().then(o)),d=t.loading;function c(e){let o=d?(0,a.jsx)(d,{isLoading:!0,pastDelay:!0,error:null}):null,l=!t.ssr||!!t.loading,c=l?n.Suspense:n.Fragment,u=t.ssr?(0,a.jsxs)(a.Fragment,{children:["u"<typeof window?(0,a.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,a.jsx)(r,{...e})]}):(0,a.jsx)(s.BailoutToCSR,{reason:"next/dynamic",children:(0,a.jsx)(r,{...e})});return(0,a.jsx)(c,{...l?{fallback:o}:{},children:u})}return c.displayName="LoadableComponent",c}},70703,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return n}});let a=e.r(55682)._(e.r(69093));function n(e,t){let r={};"function"==typeof e&&(r.loader=e);let n={...r,...t};return(0,a.default)({...n,modules:n.loadableGenerated?.modules})}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},67423,(e,t,r)=>{"use strict";function a({widthInt:e,heightInt:t,blurWidth:r,blurHeight:n,blurDataURL:s,objectFit:i}){let o=r?40*r:e,l=n?40*n:t,d=o&&l?`viewBox='0 0 ${o} ${l}'`:"";return`%3Csvg xmlns='http://www.w3.org/2000/svg' ${d}%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='${d?"none":"contain"===i?"xMidYMid":"cover"===i?"xMidYMid slice":"none"}' style='filter: url(%23b);' href='${s}'/%3E%3C/svg%3E`}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImageBlurSvg",{enumerable:!0,get:function(){return a}})},87690,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={VALID_LOADERS:function(){return s},imageConfigDefault:function(){return i}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=["default","imgix","cloudinary","akamai","custom"],i={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:14400,formats:["image/webp"],maximumDiskCacheSize:void 0,maximumRedirects:3,maximumResponseBody:5e7,dangerouslyAllowLocalIP:!1,dangerouslyAllowSVG:!1,
1contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"attachment",localPatterns:void 0,remotePatterns:[],qualities:[75],unoptimized:!1,customCacheHandler:!1}},8927,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"getImgProps",{enumerable:!0,get:function(){return d}}),e.r(33525);let a=e.r(43369),n=e.r(67423),s=e.r(87690),i=["-moz-initial","fill","none","scale-down",void 0];function o(e){return void 0!==e.default}function l(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function d({src:e,sizes:t,unoptimized:r=!1,priority:c=!1,preload:u=!1,loading:h,className:f,quality:p,width:g,height:m,fill:x=!1,style:b,overrideSrc:v,onLoad:y,onLoadingComplete:w,placeholder:j="empty",blurDataURL:P,fetchPriority:k,decoding:R="async",layout:N,objectFit:D,objectPosition:M,lazyBoundary:S,lazyRoot:T,..._},C){var F;let E,O,A,{imgConf:z,showAltText:L,blurComplete:I,defaultLoader:B}=C,$=z||s.imageConfigDefault;if("allSizes"in $)E=$;else{let e=[...$.deviceSizes,...$.imageSizes].sort((e,t)=>e-t),t=$.deviceSizes.sort((e,t)=>e-t),r=$.qualities?.sort((e,t)=>e-t);E={...$,allSizes:e,deviceSizes:t,qualities:r}}if(void 0===B)throw Object.defineProperty(Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config"),"__NEXT_ERROR_CODE",{value:"E163",enumerable:!1,configurable:!0});let U=_.loader||B;delete _.loader,delete _.srcSet;let H="__next_img_default"in U;if(H){if("custom"===E.loader)throw Object.defineProperty(Error(`Image with src "${e}" is missing "loader" prop. 2Read more: https://nextjs.org/docs/messages/next-image-missing-loader`),"__NEXT_ERROR_CODE",{value:"E252",enumerable:!1,configurable:!0})}else{let e=U;U=t=>{let{config:r,...a}=t;return e(a)}}if(N){"fill"===N&&(x=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[N];e&&(b={...b,...e});let r={responsive:"100vw",fill:"100vw"}[N];r&&!t&&(t=r)}let W="",q=l(g),V=l(m);if((F=e)&&"object"==typeof F&&(o(F)||void 0!==F.src)){let t=o(e)?e.default:e;if(!t.src)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E460",enumerable:!1,configurable:!0});if(!t.height||!t.width)throw Object.defineProperty(Error(`An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received ${JSON.stringify(t)}`),"__NEXT_ERROR_CODE",{value:"E48",enumerable:!1,configurable:!0});if(O=t.blurWidth,A=t.blurHeight,P=P||t.blurDataURL,W=t.src,!x)if(q||V){if(q&&!V){let e=q/t.width;V=Math.round(t.height*e)}else if(!q&&V){let e=V/t.height;q=Math.round(t.width*e)}}else q=t.width,V=t.height}let G=!c&&!u&&("lazy"===h||void 0===h);(!(e="string"==typeof e?e:W)||e.startsWith("data:")||e.startsWith("blob:"))&&(r=!0,G=!1),E.unoptimized&&(r=!0),H&&!E.dangerouslyAllowSVG&&e.split("?",1)[0].endsWith(".svg")&&(r=!0);let Z=l(p),J=Object.assign(x?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:D,objectPosition:M}:{},L?{}:{color:"transparent"},b),X=I||"empty"===j?null:"blur"===j?`url("data:image/svg+xml;charset=utf-8,${(0,n.getImageBlurSvg)({widthInt:q,heightInt:V,blurWidth:O,blurHeight:A,blurDataURL:P||"",objectFit:J.objectFit})}")`:`url("${j}")`,K=i.includes(J.objectFit)?"fill"===J.objectFit?"100% 100%":"cover":J.objectFit,Q=X?{backgroundSize:K,backgroundPosition:J.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:X}:{},Y=function({config:e,src:t,unoptimized:r,width:n,quality:s,sizes:i,loader:o}){if(r){if(t.startsWith("/")&&!t.startsWith("//")){let e=(0,a.getDeploymentId)();if(e){let r=t.indexOf("?");if(-1!==r){let a=new URLSearchParams(t.slice(r+1));a.get("dpl")||(a.append("dpl",e),t=t.slice(0,r)+"?"+a.toString())}else t+=`?dpl=${e}`}}return{src:t,srcSet:void 0,sizes:void 0}}let{widths:l,kind:d}=function({deviceSizes:e,allSizes:t},r,a){if(a){let r=/(^|\s)(1?\d?\d)vw/g,n=[];for(let e;e=r.exec(a);)n.push(parseInt(e[2]));if(n.length){let r=.01*Math.min(...n);return{widths:t.filter(t=>t>=e[0]*r),kind:"w"}}return{widths:t,kind:"w"}}return"number"!=typeof r?{widths:e,kind:"w"}:{widths:[...new Set([r,2*r].map(e=>t.find(t=>t>=e)||t[t.length-1]))],kind:"x"}}(e,n,i),c=l.length-1;return{sizes:i||"w"!==d?i:"100vw",srcSet:l.map((r,a)=>`${o({config:e,src:t,quality:s,width:r})} ${"w"===d?r:a+1}${d}`).join(", "),src:o({config:e,src:t,quality:s,width:l[c]})}}({config:E,src:e,unoptimized:r,width:q,quality:Z,sizes:t,loader:U}),ee=G?"lazy":h;return{props:{..._,loading:ee,fetchPriority:k,width:q,height:V,decoding:R,className:f,style:{...J,...Q}
2,sizes:Y.sizes,srcSet:Y.srcSet,src:v||Y.src},meta:{unoptimized:r,preload:u||c,placeholder:j,fill:x}}}},98879,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return o}});let a=e.r(71645),n="u"<typeof window,s=n?()=>{}:a.useLayoutEffect,i=n?()=>{}:a.useEffect;function o(e){let{headManager:t,reduceComponentsToState:r}=e;function o(){if(t&&t.mountedInstances){let e=a.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(e))}}return n&&(t?.mountedInstances?.add(e.children),o()),s(()=>(t?.mountedInstances?.add(e.children),()=>{t?.mountedInstances?.delete(e.children)})),s(()=>(t&&(t._pendingUpdate=o),()=>{t&&(t._pendingUpdate=o)})),i(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},25633,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return g},defaultHead:function(){return u}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=e.r(55682),i=e.r(90809),o=e.r(18050),l=i._(e.r(71645)),d=s._(e.r(98879)),c=e.r(42732);function u(){return[(0,o.jsx)("meta",{charSet:"utf-8"},"charset"),(0,o.jsx)("meta",{name:"viewport",content:"width=device-width"},"viewport")]}function h(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===l.default.Fragment?e.concat(l.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}e.r(33525);let f=["name","httpEquiv","charSet","itemProp"];function p(e){let t,r,a,n;return e.reduce(h,[]).reverse().concat(u().reverse()).filter((t=new Set,r=new Set,a=new Set,n={},e=>{let s=!0,i=!1;if(e.key&&"number"!=typeof e.key&&e.key.indexOf("$")>0){i=!0;let r=e.key.slice(e.key.indexOf("$")+1);t.has(r)?s=!1:t.add(r)}switch(e.type){case"title":case"base":r.has(e.type)?s=!1:r.add(e.type);break;case"meta":for(let t=0,r=f.length;t<r;t++){let r=f[t];if(e.props.hasOwnProperty(r))if("charSet"===r)a.has(r)?s=!1:a.add(r);else{let t=e.props[r],a=n[r]||new Set;("name"!==r||!i)&&a.has(t)?s=!1:(a.add(t),n[r]=a)}}}return s})).reverse().map((e,t)=>{let r=e.key||t;return l.default.cloneElement(e,{key:r})})}let g=function({children:e}){let t=(0,l.useContext)(c.HeadManagerContext);return(0,o.jsx)(d.default,{reduceComponentsToState:p,headManager:t,children:e})};("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},18556,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"ImageConfigContext",{enumerable:!0,get:function(){return s}});let a=e.r(55682)._(e.r(71645)),n=e.r(87690),s=a.default.createContext(n.imageConfigDefault)},65856,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"RouterContext",{enumerable:!0,get:function(){return a}});let a=e.r(55682)._(e.r(71645)).default.createContext(null)},70965,(e,t,r)=>{"use strict";function a(e,t){let r=e||75;return t?.qualities?.length?t.qualities.reduce((e,t)=>Math.abs(t-r)<Math.abs(e-r)?t:e,t.qualities[0]):r}Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"findClosestQuality",{enumerable:!0,get:function(){return a}})},1948,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"default",{enumerable:!0,get:function(){return i}});let a=e.r(70965),n=e.r(43369);function s({config:e,src:t,width:r,quality:i}){let o=(0,n.getDeploymentId)();if(t.startsWith("/")&&!t.startsWith("//")){let e=t.indexOf("?");if(-1!==e){let r=new URLSearchParams(t.slice(e+1)),a=r.get("dpl");if(a){o=a,r.delete("dpl");let n=r.toString();t=t.slice(0,e)+(n?"?"+n:"")}}}if(t.startsWith("/")&&t.includes("?")&&e.localPatterns?.length===1&&"**"===e.localPatterns[0].pathname&&""===e.localPatterns[0].search)throw Object.defineProperty(Error(`Image with src "${t}" is using a query string which is not configured in images.localPatterns. 3Read more: https://nextjs.org/docs/messages/next-image-unconfigured-localpatterns`),"__NEXT_ERROR_CODE",{value:"E871",enumerable:!1,
3configurable:!0});let l=(0,a.findClosestQuality)(i,e);return`${e.path}?url=${encodeURIComponent(t)}&w=${r}&q=${l}${t.startsWith("/")&&o?`&dpl=${o}`:""}`}s.__next_img_default=!0;let i=s},5500,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"Image",{enumerable:!0,get:function(){return y}});let a=e.r(55682),n=e.r(90809),s=e.r(18050),i=n._(e.r(71645)),o=a._(e.r(74080)),l=a._(e.r(25633)),d=e.r(8927),c=e.r(87690),u=e.r(18556);e.r(33525);let h=e.r(65856),f=a._(e.r(1948)),p=e.r(18581),g={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1};function m(e,t,r,a,n,s,i){let o=e?.src;e&&e["data-loaded-src"]!==o&&(e["data-loaded-src"]=o,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&n(!0),r?.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let a=!1,n=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>a,isPropagationStopped:()=>n,persist:()=>{},preventDefault:()=>{a=!0,t.preventDefault()},stopPropagation:()=>{n=!0,t.stopPropagation()}})}a?.current&&a.current(e)}}))}function x(e){return i.use?{fetchPriority:e}:{fetchpriority:e}}"u"<typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let b=(0,i.forwardRef)(({src:e,srcSet:t,sizes:r,height:a,width:n,decoding:o,className:l,style:d,fetchPriority:c,placeholder:u,loading:h,unoptimized:f,fill:g,onLoadRef:b,onLoadingCompleteRef:v,setBlurComplete:y,setShowAltText:w,sizesInput:j,onLoad:P,onError:k,...R},N)=>{let D=(0,i.useCallback)(e=>{e&&(k&&(e.src=e.src),e.complete&&m(e,u,b,v,y,f,j))},[e,u,b,v,y,k,f,j]),M=(0,p.useMergedRef)(N,D);return(0,s.jsx)("img",{...R,...x(c),loading:h,width:n,height:a,decoding:o,"data-nimg":g?"fill":"1",className:l,style:d,sizes:r,srcSet:t,src:e,ref:M,onLoad:e=>{m(e.currentTarget,u,b,v,y,f,j)},onError:e=>{w(!0),"empty"!==u&&y(!0),k&&k(e)}})});function v({isAppRouter:e,imgAttributes:t}){let r={as:"image",imageSrcSet:t.srcSet,imageSizes:t.sizes,crossOrigin:t.crossOrigin,referrerPolicy:t.referrerPolicy,...x(t.fetchPriority)};return e&&o.default.preload?(o.default.preload(t.src,r),null):(0,s.jsx)(l.default,{children:(0,s.jsx)("link",{rel:"preload",href:t.srcSet?void 0:t.src,...r},"__nimg-"+t.src+t.srcSet+t.sizes)})}let y=(0,i.forwardRef)((e,t)=>{let r=(0,i.useContext)(h.RouterContext),a=(0,i.useContext)(u.ImageConfigContext),n=(0,i.useMemo)(()=>{let e=g||a||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t),n=e.qualities?.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r,qualities:n,localPatterns:"u"<typeof window?a?.localPatterns:e.localPatterns}},[a]),{onLoad:o,onLoadingComplete:l}=e,p=(0,i.useRef)(o);(0,i.useEffect)(()=>{p.current=o},[o]);let m=(0,i.useRef)(l);(0,i.useEffect)(()=>{m.current=l},[l]);let[x,y]=(0,i.useState)(!1),[w,j]=(0,i.useState)(!1),{props:P,meta:k}=(0,d.getImgProps)(e,{defaultLoader:f.default,imgConf:n,blurComplete:x,showAltText:w});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(b,{...P,unoptimized:k.unoptimized,placeholder:k.placeholder,fill:k.fill,onLoadRef:p,onLoadingCompleteRef:m,setBlurComplete:y,setShowAltText:j,sizesInput:e.sizes,ref:t}),k.preload?(0,s.jsx)(v,{isAppRouter:!r,imgAttributes:P}):null]})});("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},94909,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var a={default:function(){return c},getImageProps:function(){return d}};for(var n in a)Object.defineProperty(r,n,{enumerable:!0,get:a[n]});let s=e.r(55682),i=e.r(8927),o=e.r(5500),l=s._(e.r(1948));function d(e){let{props:t}=(0,i.getImgProps)(e,{defaultLoader:l.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[32,48,64,96,128,256,384],qualities:[75],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let c=o.Image},57688,(e,t,r)=>{t.exports=e.r(94909)},15573,(e,t,r)=>{t.exports=JSON.parse('{"highlights":[{"text":"What was less clear was the ultimate profitability of this new business, and whether it would be able to offset expected continued declines in Discovery\'s core linear pay TV business.","pageReference":1,"paragraphReference":"Paragraph 1"},{"text":"The push and pull of these factors had led to a wild ride in Discovery\'s share price: from $30 in December 2020 to $77 in March 2021, back to the mid-$30s in April 2021.","pageReference":1,"paragraphReference":"Paragraph 1"},{"text":"Zaslav had reached out to John Stankey, CEO of AT&T, about the potential to spin-out AT&T\'s media business (WarnerMedia) and combine it with Discovery to create WarnerMedia-Discovery.","pageReference":1,"paragraphReference":"Paragraph 2"},{"text":"Total revenues would be more than 3.5x Discovery alone, combine more than 200,000 hours of largely complementary content into one of the industry\'s largest libraries, diversify revenues to include high-quality movie studio and TV production capabilities, and catapult the streaming business into a \\"formidable\\" competitor to industry titans Netflix and Disney.","pageReference":1,"paragraphReference":"Paragraph 2"},{"text":"Although AT&T\'s media assets would represent the majority of the combined entity, the new company would be run by Discovery\'s management team.","pageReference":1,"paragraphReference":"Paragraph 2"},{"text":"negotiations faltered.","pageReference":1,"paragraphReference":"Paragraph 3"},{"text":"the two parties had failed to come to agreement on the relative valuations, and therefore pro forma ownership, of the combined entity.","pageReference":1,"paragraphReference":"Paragraph 3"},{"text":"Discovery had proposed that AT&T should own 65% of the combined company\'s equity, whereas AT&T maintained they should own 75%.","pageReference":1,"paragraphReference":"Paragraph 3"},{"text":"Zaslav faced a decision.","pageReference":1,"paragraphReference":"Paragraph 4"},{"text":"In his next update to Discovery\'s board of directors, he could advocate for giving AT&T a greater ownership stake in the combined entity â or make the case for walking away.","pageReference":1,"paragraphReference":"Paragraph 4"},{"text":"AT&T was one of the world\'s largest corporations by revenue, with over $143 billion in 2020.","pageReference":2,"paragraphReference":"Paragraph 1"},{"text":"By 2020, almost 80% of AT&T\'s revenues were still derived from the company\'s core communications segment, including wireless, broadband and wireline offerings.","pageReference":2,"paragraphReference":"Paragraph 1"},{"text":"Competition in AT&T\'s communications business (particularly U.S. wireless) had kept organic growth and profit margins in check.","pageReference":2,"paragraphReference":"Paragraph 2"}
3,{"text":"AT&T\'s foray into providing entertainment content began in May 2014 when they announced the $67 billion acquisition of DirectTV, a leading pay TV provider with strong content relationships serving over 20 million subscribers in the U.S.","pageReference":2,"paragraphReference":"Paragraph 2"},{"text":"The combination was touted to leverage the content and user experience of DirecTV across AT&T\'s nationwide broadband and mobile networks, and was expected to be accretive to free cash flow within 12 months.","pageReference":2,"paragraphReference":"Paragraph 2"},{"text":"on October 24, 2016, AT&T announced a cash and stock deal to acquire WarnerMedia for $106.4 billion.","pageReference":2,"paragraphReference":"Paragraph 3"},{"text":"The vision was, in what AT&T called a \\"converging media and communications industry,\\" to combine WarnerMedia\'s premium content with AT&T\'s massive distribution capabilities.","pageReference":2,"paragraphReference":"Paragraph 3"},{"text":"John Stankey, a longtime AT&T executive who had most recently led the entertainment group, was named CEO of AT&T\'s new WarnerMedia division.","pageReference":2,"paragraphReference":"Paragraph 4"},{"text":"WarnerMedia was a large media conglomerate, with over $29 billion in 2016 revenues and three main business segments: (i) Turner, the basic pay TV network business (38% of revenues, with 180 broadcast channels including CNN and Cartoon Network) (ii) Home Box Office (HBO), the premium pay TV network (19% of revenues, known for the production of high quality, original content such as Game of Thrones) and (iii) Warner Brothers, the television and movie studio (43% of revenues, the second largest movie studio in the world).","pageReference":2,"paragraphReference":"Paragraph 5"},{"text":"Stankey had a vision for WarnerMedia that would take it in new directions.","pageReference":2,"paragraphReference":"Paragraph 6"},{"text":"WarnerMedia\'s focus shifted to becoming a meaningful player in the evolving streaming market and expanding its content library to reach a much broader audience than HBO\'s high-end content had previously.","pageReference":2,"paragraphReference":"Paragraph 6"},{"text":"The revamped streaming service, called HBO Max, consolidated legacy HBO streaming services into a more robust offering and was launched in May 2020.","pageReference":2,"paragraphReference":"Paragraph 6"},{"text":"almost 64 million HBO Max and HBO subscribers combined, of which 11 million were added in the last 12 months.","pageReference":3,"paragraphReference":"Paragraph 1"},{"text":"Stankey targeted content that would hold viewers for \\"hours a day\\", rather than the \\"hours a week\\" which was more typical for HBO\'s Sunday night line-up.","pageReference":3,"paragraphReference":"Paragraph 2"},{"text":"the decision was made to direct the company\'s content exclusively to its own streaming service and restrict access on other platforms.","pageReference":3,"paragraphReference":"Paragraph 2"},{"text":"AT&T moved WarnerMedia\'s movies exclusively to their online platforms and began streaming new releases the same day they hit theaters (rather than with the customary window of theatrical exclusivity).","pageReference":3,"paragraphReference":"Paragraph 2"},{"text":"Shows with mass-market appeal, such as \\"Friends\\" and \\"The Big Bang Theory\\" would be withdrawn from competitor Netflix in service of boosting HBO\'s more niche, premium content to have broader appeal.","pageReference":3,"paragraphReference":"Paragraph 2"},{"text":"The new strategy for growing HBO\'s reach was expensive.","pageReference":3,"paragraphReference":"Paragraph 3"},{"text":"AT&T\'s push for more content production, while at the same time foregoing the licensing of shows to competitive platforms, increased production costs and reduced licensing revenues.","pageReference":3,"paragraphReference":"Paragraph 3"},{"text":"In Q4 2019, for example, AT&T estimated that revenues at WarnerMedia were reduced by $1.2 billion (12%) and EBITDA by $0.5 billion (16%).","pageReference":3,"paragraphReference":"Paragraph 3"},{"text":"In 2020, a further investment of over $2.0 billion was made in content and other transformation initiatives.","pageReference":3,"paragraphReference":"Paragraph 3"},{"text":"The dramatic and swift changes at WarnerMedia were not without internal politics and controversy.","pageReference":3,"paragraphReference":"Paragraph 4"},{"text":"There was a significant amount of executive turnover.","pageReference":3,"paragraphReference":"Paragraph 4"},{"text":"Now at the helm of AT&T, Stankey faced several challenges beyond WarnerMedia.","pageReference":3,"paragraphReference":"Paragraph 5"},{"text":"AT&T had a significant debt load of over $175 billion and faced hefty capital requirements of almost $30 billion in its core communications business over the next few years for the roll-out of its 5G wireless network and related spectrum.","pageReference":3,"paragraphReference":"Paragraph 5"},{"text":"the DirecTV business was underperforming expectations and had lost more than 9 million subscribers since acquisition.","pageReference":3,"paragraphReference":"Paragraph 5"},{"text":"In January 2021, AT&T recorded a $15.5 billion impairment charge, and in February 2021 announced that majority ownership of the DirecTV business would be spun off to private equity firm TPG at a headline valuation that represented a 75% discount to what they had paid for it in 2015.","pageReference":3,"paragraphReference":"Paragraph 5"},{"text":"AT&T committed to reducing its debt to EBITDA leverage in 2024, to 2.5x from an expected 3.0x at the end of 2021, using all excess free cash flow (after paying the dividend) to pay down debt.","pageReference":3,"paragraphReference":"Paragraph 6"},{"text":"AT&T also updated its targets for global HBO subscribers to 120-150 million by 2025, at which levels the division
3was expected to contribute one third of AT&T\'s total revenues.","pageReference":3,"paragraphReference":"Paragraph 6"},{"text":"Analysts applauded HBO\'s growth targets, but noted they were ambitious.","pageReference":3,"paragraphReference":"Paragraph 6"},{"text":"They also noted the company\'s large balance sheet, with one offering skepticism of AT&T\'s \\"ambition to try to turn around growth in every division simultaneously, while investing in building a new global streaming service and investing in spectrum without any compromise on capital allocation.\\"","pageReference":3,"paragraphReference":"Paragraph 6"},{"text":"Fitch, a credit ratings agency, downgraded AT&T to BBB+ from A-, and S&P issued a negative outlook for its BBB rating.","pageReference":3,"paragraphReference":"Paragraph 6"},{"text":"Although the term \\"Streaming Wars\\" was officially coined in 2015, competition for streaming subscribers had begun several years before.","pageReference":4,"paragraphReference":"Paragraph 1"},{"text":"Netflix, which began as a DVD-by-mail service in 1997, entered streaming in 2007.","pageReference":4,"paragraphReference":"Paragraph 1"},{"text":"The Streaming Wars heated up further just before the COVID-19 pandemic, with the launch of offerings from industry behemoths Disney and Apple (with services called Disney+ and Apple TV+) in November 2019.","pageReference":4,"paragraphReference":"Paragraph 2"},{"text":"The proliferation of offerings and platforms gave consumers a dizzying array of choices and caused seismic ripples through the broader media industry.","pageReference":4,"paragraphReference":"Paragraph 2"},{"text":"In the fight to win consumers\' loyalty (and subscription dollars), scale was considered crucial.","pageReference":4,"paragraphReference":"Paragraph 3"},{"text":"This was because the costs of content creation were high and largely fixed, while the marginal costs of distribution were relatively small, allowing for much greater profitability if content costs were spread over a large user base.","pageReference":4,"paragraphReference":"Paragraph 3"},{"text":"Further, aggregating sufficient and differentiated content to engage a subscriber was vital, as it was easy for subscribers to switch services.","pageReference":4,"paragraphReference":"Paragraph 3"},{"text":"several platforms decided to forego licensing revenues and make content exclusive to their streaming service.","pageReference":4,"paragraphReference":"Paragraph 3"},{"text":"At the end of 2020, Netflix remained the largest, with 204 million subscribers and a total enterprise value that had risen by 65% over the last year.","pageReference":4,"paragraphReference":"Paragraph 4"},{"text":"Disney+ had grown to over 95 million subscribers.","pageReference":4,"paragraphReference":"Paragraph 4"},{"text":"Others, including Apple TV+ and HBO Max, had grown, but remained relatively smaller players, with an estimated 13 million subscribers each.","pageReference":4,"paragraphReference":"Paragraph 4"},{"text":"As the pandemic began to recede, the boom of streaming subscriber growth also began to subside.","pageReference":4,"paragraphReference":"Paragraph 4"},{"text":"Experts expected consumers to consolidate spending to their preferred services.","pageReference":4,"paragraphReference":"Paragraph 4"},{"text":"The question for industry participants now was how to keep their subscribers, and the resulting impact on profitability.","pageReference":4,"paragraphReference":"Paragraph 4"},{"text":"At year-end 2020, Discovery was a global media company with a particular strength as one of the largest pay TV programmers, serving a cumulative 3.7 billion subscribers and viewers worldwide.","pageReference":4,"paragraphReference":"Paragraph 5"},{"text":"65% of total revenues were generated in the U.S., and 35% in international markets, primarily Europe.","pageReference":4,"paragraphReference":"Paragraph 5"},{"text":"In March 2018, Discovery acquired Scripps Networks Interactive for over $12 billion.","pageReference":5,"paragraphReference":"Paragraph 2"},{"text":"The deal was largely considered a success, including the realization of over $800 million synergies, such that Discovery reduced leverage from 4.8x debt to EBITDA at the time of the deal\'s close to 3.0x at the end of 2019, within its target range of 3.0-3.5x.","pageReference":5,"paragraphReference":"Paragraph 2"},{"text":"Discovery\'s nonfiction and lifestyle brands allowed for a differentiated type of content relative to most broadcasting peers.","pageReference":5,"paragraphReference":"Paragraph 3"},{"text":"It had a relatively low-cost profile, was largely fully owned and had strong viewer engagement.","pageReference":5,"paragraphReference":"Paragraph 3"},{"text":"As such, Discovery boasted one of the highest revenue-per-content-cost ratios in the industry.","pageReference":5,"paragraphReference":"Paragraph 3"},{"text":"Discovery generated revenues primarily through distribution and advertising, representing 52% and 46% of revenues in 2020, respectively.","pageReference":5,"paragraphReference":"Paragraph 4"},{"text":"there was no denying the pressure of cord cutting that rendered linear models subject to an expected slow and steady decline.","pageReference":5,"paragraphReference":"Paragraph 4"},{"text":"These declines had been accelerating since 2015, reaching year-on-year mid-to-high single digit percentages by the end of 2020, and were expected to continue.","pageReference":5,"paragraphReference":"Paragraph 4"},{"text":"In response to this pressure, Zaslav (CEO of Discovery since 2007) focused on developing Discovery\'s streaming offering, which would allow Discovery to generate revenues directly from subscribers.","pageReference":5,"paragraphReference":"Paragraph 5"},{"text":"In the fourth quarter of 2020, Discovery launched Discovery+, its aggregated \\"non-fiction, real-life subscription service\\" internationally, followed by a U.S. launch in January 2021.","pageReference":5,"paragraphReference":"Paragraph 5"},{"text":"The launch far exceeded those expectations, with 5 million international subscribers by the end of 2020 and 15 million total subscribers by April 2021.","pageReference":5,"paragraphReference":"Paragraph 5"}
3,{"text":"Zaslav had big ambitions for the service and called it \\"the most important new business\\" in his tenure, and one that could help to offset the pressure of cord-cutting.","pageReference":5,"paragraphReference":"Paragraph 5"},{"text":"While the launch of Discovery+ was strong, the aggregate subscriber numbers paled in comparison to those of streaming\'s leading players.","pageReference":5,"paragraphReference":"Paragraph 6"},{"text":"Zaslav was resultingly focused on offering more content across more genres.","pageReference":5,"paragraphReference":"Paragraph 6"},{"text":"Zaslav sought scale.","pageReference":5,"paragraphReference":"Paragraph 6"},{"text":"It was a tense moment for Zaslav, facing a decision that could reshape the media world in general and Discovery in particular.","pageReference":6,"paragraphReference":"Paragraph 1"},{"text":"AT&T had effectively walked away over the parties\' inability to reach agreement on the companies\' relative valuations.","pageReference":6,"paragraphReference":"Paragraph 1"},{"text":"Should Discovery reconsider its position and offer AT&T a greater ownership of the combined WarnerMedia-Discovery entity, or concede that an agreement could not be reached?","pageReference":6,"paragraphReference":"Paragraph 1"},{"text":"The structure under consideration was a \\"Reverse Morris Trust\\" transaction, whereby AT&T would distribute shares in WarnerMedia to its shareholders in a tax-free spinoff transaction.","pageReference":6,"paragraphReference":"Paragraph 2"},{"text":"AT&T also proposed that $43 billion of AT&T\'s net debt would be transferred to WarnerMedia at the time of deal closing, reducing AT&T\'s net debt accordingly.","pageReference":6,"paragraphReference":"Paragraph 2"},{"text":"Discovery would require the approval of its shareholders for the transaction to proceed, but AT&T, whose shareholders would own the majority of the new entity, would not require a vote.","pageReference":6,"paragraphReference":"Paragraph 2"},{"text":"In addition to the strategic benefits of size, scale and complementarity of assets, the deal offered meaningful potential cost synergies.","pageReference":6,"paragraphReference":"Paragraph 3"},{"text":"Discovery expected that it could achieve $3 billion in pre-tax synergies per year by the third year after closing.","pageReference":6,"paragraphReference":"Paragraph 3"},{"text":"These would be driven by efficiencies across the platform in marketing and technology, and the savings could be reinvested into content and growing the streaming platform.","pageReference":6,"paragraphReference":"Paragraph 3"},{"text":"Discovery would be merging into a much larger entity that had been through significant turmoil and management turnover in recent years.","pageReference":6,"paragraphReference":"Paragraph 4"},{"text":"the business under AT&T had made significant strategic pivots to prioritize streaming and the production of more content.","pageReference":6,"paragraphReference":"Paragraph 4"},{"text":"How had the company and, importantly, its creative culture adapted to these changes?","pageReference":6,"paragraphReference":"Paragraph 4"},{"text":"The necessarily high degree of secrecy that had accompanied the talks to date, to avoid leaks of the discussions before the parties were ready to announce a deal, had limited Discovery\'s access to WarnerMedia\'s leadership to discuss some of these strategic questions.","pageReference":6,"paragraphReference":"Paragraph 4"},{"text":"Discovery and WarnerMedia\'s content libraries were very different, as was their production machine.","pageReference":6,"paragraphReference":"Paragraph 5"},{"text":"HBO spent $3.5 billion on original content in 2019, equating to roughly $5 million per hour of programming; Discovery\'s production budget equated to approximately $400,000 per hour.","pageReference":6,"paragraphReference":"Paragraph 5"},{"text":"Could the production house that created Game of Thrones coexist under one roof with that which created Guy Fieri\'s \\"Diners, Drive-Ins and Dives\\"?","pageReference":6,"paragraphReference":"Paragraph 5"},{"text":"Zaslav had to consider whether this was a value maximizing strategy for Discovery\'s shareholders.","pageReference":6,"paragraphReference":"Paragraph 6"},{"text":"The combined company\'s size and scale would limit its viability as a target for other M&A.","pageReference":6,"paragraphReference":"Paragraph 6"},{"text":"With both opportunity and risk on the table, Zaslav faced a complicated decision.","pageReference":6,"paragraphReference":"Paragraph 7"}],"totalHighlightsCount":68}')},52683,e=>{"use strict";var t=e.i(18050),r=e.i(71645),a=e.i(70703),n=e.i(57951),s=e.i(57688),i=e.i(59544);function o(){let{user:e,signInWithGoogle:a,signOut:o,loading:l}=(0,n.useAuth)(),[d,c]=(0,r.useState)(!1),[u,h]=(0,r.useState)(!1),[f,p]=(0,r.useState)(!1),[g,m]=(0,r.useState)(!1),x=(0,r.useRef)(null);(0,r.useEffect)(()=>
3{if(u){p(!0);let e=setTimeout(()=>{m(!0)},10);return()=>clearTimeout(e)}{m(!1);let e=setTimeout(()=>{p(!1)},200);return()=>clearTimeout(e)}},[u]),(0,r.useEffect)(()=>{let e=e=>{x.current&&!x.current.contains(e.target)&&h(!1)};return u&&document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[u]);let b=async()=>{try{c(!0),await a()}catch(e){console.error("Sign in failed:",e)}finally{c(!1)}},v=async()=>{try{await o()}catch(e){console.error("Sign out failed:",e)}};return l?(0,t.jsxs)("div",{className:"flex items-center gap-2 px-4 py-2 bg-muted rounded-md",children:[(0,t.jsx)("div",{className:"animate-spin w-4 h-4 border border-border border-t-transparent rounded-full"}),(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:"Loading..."})]}):e?(0,t.jsxs)("div",{className:"relative",ref:x,children:[(0,t.jsx)(i.Button,{variant:"ghost",size:"icon",onClick:()=>{u?(m(!1),setTimeout(()=>{h(!1)},200)):h(!0)},className:"w-8 h-8 rounded-full hover:ring-2 hover:ring-accent p-0",title:"Profile menu",children:e.user_metadata?.avatar_url?(0,t.jsx)(s.default,{src:e.user_metadata.avatar_url,alt:e.user_metadata?.full_name||"User avatar",width:32,height:32,className:"w-8 h-8 rounded-full object-cover"}):(0,t.jsx)("div",{className:"w-8 h-8 rounded-full bg-blue-500 flex items-center justify-center text-white font-medium text-sm",children:(e.user_metadata?.full_name||e.email||"U")[0].toUpperCase()})}),f&&(0,t.jsxs)("div",{className:"absolute right-0 top-full mt-2 w-64 bg-background/95 backdrop-blur-sm rounded-lg shadow-2xl border border-border z-50 transition-all duration-200 origin-top-right ring-1 ring-border",style:{opacity:+!!g,transform:g?"scale(1)":"scale(0.95)",transformOrigin:"top right",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04), 0 0 0 1px rgba(0, 0, 0, 0.05)"},children:[(0,t.jsx)("div",{className:"p-4 border-b border-border",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[e.user_metadata?.avatar_url?(0,t.jsx)(s.default,{src:e.user_metadata.avatar_url,alt:e.user_metadata?.full_name||"User avatar",width:48,height:48,className:"w-12 h-12 rounded-full object-cover"}):(0,t.jsx)("div",{className:"w-12 h-12 rounded-full bg-blue-500 flex items-center justify-center text-white font-medium text-lg",children:(e.user_metadata?.full_name||e.email||"U")[0].toUpperCase()}),(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsx)("div",{className:"text-sm font-medium text-foreground truncate",children:e.user_metadata?.full_name||"User"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground truncate",children:e.email})]})]})}),(0,t.jsxs)("div",{className:"py-2",children:[(0,t.jsxs)(i.Button,{variant:"ghost",onClick:()=>{h(!1)},className:"flex items-center w-full justify-start px-4 py-2 text-sm text-foreground hover:bg-muted h-auto",children:[(0,t.jsx)("svg",{className:"w-4 h-4 mr-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})}),"Profile Settings"]}),(0,t.jsx)("div",{className:"border-t border-border my-1"}),(0,t.jsxs)(i.Button,{variant:"ghost",onClick:()=>{h(!1),v()},className:"flex items-center w-full justify-start px-4 py-2 text-sm text-red-700 hover:bg-red-50 h-auto",children:[(0,t.jsx)("svg",{className:"w-4 h-4 mr-3",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"})}),"Sign Out"]})]})]})]}):(0,t.jsxs)(i.Button,{variant:"outline",onClick:b,disabled:d,className:"flex items-center gap-2 px-3 py-1.5",children:[d?(0,t.jsx)("div",{className:"animate-spin w-4 h-4 border border-border border-t-transparent rounded-full"}):(0,t.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,t.jsx)("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,t.jsx)("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,t.jsx)("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),(0,t.jsx)("span",{className:"text-sm font-medium text-foreground",children:d?"Signing in...":"Sign in with Google"})]})}let l=({onMenuToggle:e,isMenuOpen:a=!1})=>{let[n,i]=(0,r.useState)(!1),[l,d]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{i(!0);let e=()=>{d(!0)};e();let t=new MutationObserver(e);return t.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]}
3),()=>t.disconnect()},[]),(0,t.jsx)("header",{className:"bg-background shadow-sm border-b border-border",children:(0,t.jsx)("div",{className:"w-full px-4 sm:px-6 lg:px-8",children:(0,t.jsxs)("div",{className:"flex justify-between items-center h-16",children:[(0,t.jsx)("div",{className:"flex items-center flex-shrink-0",children:(0,t.jsxs)("div",{className:"flex items-center justify-between w-full",children:[(0,t.jsx)("div",{className:"relative -ml-4",children:(0,t.jsx)("button",{onClick:e,className:"p-2 rounded-md hover:bg-muted transition-colors",title:"Menu",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})})}),n&&(0,t.jsx)("div",{className:"relative pl-4",children:(0,t.jsx)(s.default,{src:l?"/images/highlit_logo_dark.svg":"/images/highlit_logo_light.svg",alt:"Highlit Logo",width:120,height:24,style:{height:"24px",width:"auto"},priority:!0})})]})}),(0,t.jsx)("div",{className:"hidden lg:flex flex-1 justify-center px-8 max-w-md",children:(0,t.jsx)("nav",{className:"flex space-x-6"})}),(0,t.jsx)("div",{className:"flex items-center flex-shrink-0 space-x-4",children:n&&(0,t.jsx)(o,{})})]})})})},d=({children:e,onMenuToggle:r,isMenuOpen:a})=>(0,t.jsxs)("div",{className:"min-h-screen bg-background flex flex-col",children:[(0,t.jsx)(l,{onMenuToggle:r,isMenuOpen:a}),(0,t.jsx)("main",{className:"flex-1",children:e})]});var c=e.i(37216),u=(e.i(47167),e.i(15573));let h="/mock/mock.pdf",f="mock.pdf",p="ð¡ Mock PDF + Real APIs = Mixed Mode",g="â¡ LOADING",m="ð MOCK",x="ð REAL";u.default;let b=window.fetch,v=async(e,t)=>b?b(e,t):fetch(e,t),y=async()=>{try{let e=await v(h);if(!e.ok)throw Error(`Failed to load mock PDF: ${e.status} ${e.statusText}`);let t=await e.blob();return new File([t],f,{type:"application/pdf",lastModified:Date.now()})}catch(e){return console.error("â Failed to load mock PDF file:",e),console.warn("ð Make sure to place a PDF file at public/mock/mock.pdf"),new File([new Blob(["%PDF-1.4\n1 0 obj\n<<\n/Type /Catalog\n>>\nendobj\nxref\n0 1\n0000000000 65535 f \ntrailer\n<<\n/Size 1\n/Root 1 0 R\n>>\nstartxref\n9\n%%EOF"],{type:"application/pdf"})],f,{type:"application/pdf",lastModified:Date.now()})}},w=async()=>{try{let e=await v(h,{method:"HEAD"});e.ok||(e=await v(h,{method:"GET",headers:{Range:"bytes=0-1023"}}));let t=e.ok||206===e.status;return t||console.warn("â ï¸ Mock PDF not accessible:",e.status,e.statusText),t}catch(e){console.error("â Error checking mock PDF:",e);try{return(await v(h)).ok}catch(e){return console.error("â Fallback also failed:",e),!1}}};class j{static instance;listeners=new Set;initialized=!1;state={isMockMode:!1,mockPDFExists:null,isLoadingMockPDF:!1,isRefreshingPDF:!1};static getInstance(){return j.instance||(j.instance=new j),j.instance}static isDevMode(){return!1}getInitialMockMode(){return"true"===localStorage.getItem("useMockData")}async initialize(){if(!j.isDevMode()||this.initialized)return;this.initialized=!0;let e=this.getInitialMockMode();this.updateState({isMockMode:e}),setTimeout(async()=>{await this.checkPDFStatus()},500),this.exposeGlobalDebugFunctions(),window.addEventListener("storage",e=>{if("useMockData"===e.key){let t="true"===e.newValue;this.updateState({isMockMode:t})}});let t=localStorage.setItem;localStorage.setItem=function(e,r){t.call(this,e,r),"useMockData"===e&&setTimeout(()=>{P.updateState({isMockMode:"true"===r})},0)}}exposeGlobalDebugFunctions(){window.testMockPDF||(window.testMockPDF=async()=>{try{if(!await w())return{success:!1,error:"Mock PDF not found at expected location"};try{let e=await y();return{success:!0,file:{name:e.name,size:e.size,type:e.type}}}catch(e){return{success:!1,error:"Failed to create mock PDF file"}}}catch(e){return{success:!1,error:"Mock PDF test failed"}}},window.testMockAPI=async()=>{try{let e=await fetch("/api/upload-pdf",{method:"POST",body:new FormData}),t=null;return 200===e.status&&(t=await e.text()),{success:!0,uploadStatus:e.status,uploadData:t,useMockData:!1}}catch(e){return{success:!1,error:"Mock API test failed"}}},window.devToolsState=()=>this.getDebugInfo(),window.mockConfig=()=>({mockPdfUrl:h,useMockData:!1,instructions:"Use devToolsState() to see current state"}))}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}getState(){return{...this.state}}updateState(e){this.state={...this.state,...e}
3,this.listeners.forEach(e=>{try{e(this.state)}catch(e){}})}async toggleMockMode(){let e=!this.state.isMockMode;this.updateState({isMockMode:e}),localStorage.setItem("useMockData",e.toString()),window.toggleMockMode||setTimeout(()=>{window.location.reload()},100)}async checkPDFStatus(){if(j.isDevMode())try{let e=await w();this.updateState({mockPDFExists:e})}catch(e){this.updateState({mockPDFExists:!1})}}async refreshPDFStatus(){if(!this.state.isRefreshingPDF){this.updateState({isRefreshingPDF:!0});try{let e=await w();this.updateState({mockPDFExists:e})}catch(e){this.updateState({mockPDFExists:!1})}finally{this.updateState({isRefreshingPDF:!1})}}}async loadMockPDF(e){if(e&&!this.state.isLoadingMockPDF){this.updateState({isLoadingMockPDF:!0});try{let t=await y();e(t)}catch(e){}finally{this.updateState({isLoadingMockPDF:!1})}}}clearCache(){localStorage.clear(),sessionStorage.clear(),window.location.reload()}getDebugInfo(){return{initialized:this.initialized,devMode:j.isDevMode(),mockMode:this.state.isMockMode,useMockData:!1,environment:"production",mockPDFURL:h,pdfExists:this.state.mockPDFExists,listenerCount:this.listeners.size,localStorage:localStorage.getItem("useMockData")}}}let P=j.getInstance(),k=(0,r.memo)(({onMockPDFLoad:e})=>{let[a,n]=(0,r.useState)(P.getState()),[s]=(0,r.useState)(()=>j.isDevMode()),[i,o]=(0,r.useState)(!1),[l,d]=(0,r.useState)(!1),c=(0,r.useRef)(!1);if((0,r.useEffect)(()=>{o(!0),d("true"===localStorage.getItem("useMockData"))},[]),(0,r.useEffect)(()=>{if(!i)return;let e=()=>{let e="true"===localStorage.getItem("useMockData");e!==l&&d(e)};e();let t=setInterval(e,200);return window.addEventListener("storage",e),()=>{clearInterval(t),window.removeEventListener("storage",e)}},[i,l]),(0,r.useEffect)(()=>{if(!s||c.current)return;c.current=!0,P.initialize();let e=P.subscribe(e=>{n(e)});return()=>{e()}},[s]),!s)return null;let u=!!i&&l;return(0,t.jsx)("div",{className:"fixed bottom-4 right-4 z-50",children:(0,t.jsxs)("div",{className:"bg-popover text-popover-foreground p-4 rounded-lg shadow-lg border border-border min-w-64",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,t.jsx)("h3",{className:"text-sm font-semibold text-hl-yellow",children:"ð ï¸ Dev Tools"}),(0,t.jsx)("div",{className:"text-xs text-muted-foreground",children:i?u?m:x:g})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("label",{className:"text-xs text-muted-foreground",children:"Mock API Mode"}),(0,t.jsx)("button",{onClick:()=>{let e=!l;localStorage.setItem("useMockData",e.toString()),d(e)},className:`w-10 h-5 rounded-full transition-colors ${u?"bg-green-500":"bg-muted"}`,children:(0,t.jsx)("div",{className:`w-4 h-4 bg-white rounded-full transition-transform ${u?"translate-x-5":"translate-x-0.5"}`})})]}),null!==a.mockPDFExists&&(0,t.jsxs)("div",{className:"pt-2 border-t border-border",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between text-xs",children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Mock PDF Status"}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("span",{className:`${a.mockPDFExists?"text-green-400":"text-hl-yellow"}`,children:a.mockPDFExists?"â
Found":"â ï¸ Missing"}),(0,t.jsx)("button",{onClick:()=>P.refreshPDFStatus(),className:`text-xs transition-colors ${a.isRefreshingPDF?"text-muted-foreground cursor-not-allowed":"text-blue-400 hover:text-blue-300"}`,disabled:a.isRefreshingPDF,title:"Refresh PDF status",children:a.isRefreshingPDF?"â³":"ð"})]})]}),!a.mockPDFExists&&(0,t.jsx)("div",{className:"text-xs text-muted-foreground mt-1",children:"Place a PDF file at public/mock/mock.pdf"})]}),(0,t.jsx)("div",{className:"pt-2 border-t border-border",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 gap-1",children:[(0,t.jsx)("button",{onClick:()=>P.loadMockPDF(e),disabled:a.isLoadingMockPDF,className:`px-3 py-1 rounded text-xs transition-colors ${a.isLoadingMockPDF?"bg-muted cursor-not-allowed":"bg-blue-600 hover:bg-blue-500"}`,children:a.isLoadingMockPDF?"â³ Loading...":"ð Load Mock PDF"}),(0,t.jsx)("button",{onClick:()=>P.clearCache(),className:"px-3 py-1 bg-red-600 hover:bg-red-500 rounded text-xs transition-colors",children:"ð§¹ Clear Cache"})]})}),(0,t.jsxs)("div",{className:"pt-2 border-t border-border text-xs text-muted-foreground",children:[(0,t.jsxs)("div",{children:["Mode:"," ",i?u?"Mock APIs":"Real APIs":"Loading..."]}),(0,t.jsxs)("div",{children:["Env: ","production"]}
3),i&&(0,t.jsxs)("div",{className:"text-xs text-muted-foreground/70 mt-1",children:["State: ",u?"MOCK":"REAL"," | Hydrated:"," ",i?"YES":"NO"]}),i&&!u&&(0,t.jsx)("div",{className:"text-xs text-blue-400 mt-1",children:p})]})]})]})})});k.displayName="DevToolsPanel";let R=({onMockPDFLoad:e})=>j.isDevMode()?(0,t.jsx)(k,{onMockPDFLoad:e}):null;var N=e.i(11795);let D=new class{getSupabaseClient(){return(0,N.createClient)()}async savePDFToHistory(e,t){try{let r=this.getSupabaseClient(),{data:{session:a}}=await r.auth.getSession(),n=Date.now(),s=t.fileName.replace(/[^a-zA-Z0-9.-]/g,"_"),i=`${e.id}/${n}_${s}`,{error:o}=await r.storage.from("pdf-history").upload(i,t.file,{contentType:"application/pdf",upsert:!1});if(o)return console.error("Error uploading PDF to storage:",o),console.error("Upload details:",{bucket:"pdf-history",path:i,fileSize:t.file.size,fileType:t.file.type}),o.message?.includes("row-level security policy")?console.error("ð Storage RLS Policy Error: Please run the storage policies SQL script. See docs/STORAGE_BUCKET_SETUP.md for instructions."):o.message?.includes("404")&&console.error('𪣠Bucket Not Found: Please create a "pdf-history" bucket in Supabase Storage.'),null;let{data:l,error:d}=await r.from("pdf_history").insert({user_id:e.id,file_name:t.fileName,file_size:t.fileSize,storage_path:i,gemini_file_uri:t.geminiFileUri,gemini_document_id:t.geminiDocumentId,page_count:t.pageCount}).select().single();if(d)return console.error("Error saving PDF to history:",d),await r.storage.from("pdf-history").remove([i]),null;return l}catch(e){return console.error("Error saving PDF to history:",e),null}}async getPDFHistory(e){try{let{data:t,error:r}
3=await this.getSupabaseClient().from("pdf_history").select("*").eq("user_id",e.id).order("upload_date",{ascending:!1});if(r)return console.error("Error fetching PDF history:",r),[];return t||[]}catch(e){return console.error("Error fetching PDF history:",e),[]}}async updateLastAccessed(e,t){try{let{error:r}=await this.getSupabaseClient().from("pdf_history").update({last_accessed:new Date().toISOString()}).eq("id",t).eq("user_id",e.id);if(r)return console.error("Error updating last accessed:",r),!1;return!0}catch(e){return console.error("Error updating last accessed:",e),!1}}async deletePDFFromHistory(e,t){try{let{data:r}=await this.getSupabaseClient().from("pdf_history").select("storage_path").eq("id",t).eq("user_id",e.id).single();if(!r)return console.error("PDF not found"),!1;let{error:a}=await this.getSupabaseClient().from("pdf_history").delete().eq("id",t).eq("user_id",e.id);if(a)return console.error("Error deleting PDF from history:",a),!1;let{error:n}=await this.getSupabaseClient().storage.from("pdf-history").remove([r.storage_path]);return n&&console.error("Error deleting PDF from storage:",n),!0}catch(e){return console.error("Error deleting PDF from history:",e),!1}}async getPDFById(e,t){try{let{data:r,error:a}
3=await this.getSupabaseClient().from("pdf_history").select("*").eq("id",t).eq("user_id",e.id).single();if(a)return console.error("Error fetching PDF by ID:",a),null;return r}catch(e){return console.error("Error fetching PDF by ID:",e),null}}formatFileSize(e){if(0===e)return"0 Bytes";let t=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,t)).toFixed(2))+" "+["Bytes","KB","MB","GB"][t]}formatDate(e){let t=new Date(e),r=new Date().getTime()-t.getTime(),a=Math.floor(r/36e5),n=Math.floor(a/24);if(0===n){if(0===a){let e=Math.floor(r/6e4);return e<=1?"Just now":`${e}m ago`}return`${a}h ago`}return 1===n?"Yesterday":n<7?`${n}d ago`:t.toLocaleDateString()}async getPDFFileUrl(e){try{let{data:t}=await this.getSupabaseClient().storage.from("pdf-history").createSignedUrl(e,3600);return t?.signedUrl||null}catch(e){return console.error("Error getting PDF file URL:",e),null}}async downloadPDF(e){try{let{data:t,error:r}=await this.getSupabaseClient().storage.from("pdf-history").download(e);if(r)return console.error("Error downloading PDF:",r),null;return t}catch(e){return console.error("Error downloading PDF:",e),null}}};function M({isOpen:e,onToggle:a,onPDFSelect:s,currentPDFId:i,skipOverlay:o=!1,hidePanel:l=!1}){let{user:d}=(0,n.useAuth)(),[c,u]=(0,r.useState)([]),[h,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(null),m=(0,r.useCallback)(async()=>{if(d){f(!0),g(null);try{let e=await D.getPDFHistory(d);u(e)}catch(e){g("Failed to load PDF history"),console.error("Error loading PDF history:",e)}finally{f(!1)}}},[d]);(0,r.useEffect)(()=>{d&&e&&m()},[d,e,m]);let x=async e=>{d&&(s(e),setTimeout(()=>{m()},1e3))},b=async(e,t)=>{e.stopPropagation(),d&&confirm("Are you sure you want to delete this PDF from your history?")&&(await D.deletePDFFromHistory(d,t)?u(e=>e.filter(e=>e.id!==t)):g("Failed to delete PDF"))};return l?d?h?(0,t.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,t.jsx)("div",{className:"animate-spin w-6 h-6 border border-border border-t-transparent rounded-full"})}):p?(0,t.jsxs)("div",{className:"p-4 text-center",children:[(0,t.jsx)("div",{className:"text-red-500 mb-2",children:"â ï¸"}),(0,t.jsx)("p",{className:"text-sm text-red-600",children:p}),(0,t.jsx)("button",{onClick:m,className:"mt-2 text-sm text-blue-600 hover:underline",children:"Try again"})]}):0===c.length?(0,t.jsx)("div",{className:"flex items-center justify-center h-64 p-8 text-center",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-4xl mb-4",children:"ð"}),(0,t.jsx)("p",{className:"text-muted-foreground mb-2",children:"No PDFs yet"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Upload a PDF to start building your history"})]})}):(0,t.jsx)("div",{className:"p-2 space-y-2",children:c.map(e=>(0,t.jsx)("div",{onClick:()=>x(e),className:`group p-3 rounded-lg cursor-pointer transition-colors ${i===e.id?"bg-accent text-accent-foreground border border-accent":"hover:bg-muted border border-transparent"}`,children:(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("div",{className:"text-lg",children:"ð"}),(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground truncate",children:e.file_name})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:D.formatFileSize(e.file_size)}),e.page_count&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"â¢"}),(0,t.jsxs)("span",{children:[e.page_count," pages"]})]})]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Uploaded"," ",D.formatDate(e.upload_date)]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Last opened"," ",D.formatDate(e.last_accessed)]})]})]}),(0,t.jsx)("button",{onClick:t=>b(t,e.id),className:"opacity-0 group-hover:opacity-100 p-1 rounded-md hover:bg-red-100 text-red-500 transition-all",title:"Delete from history",children:(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})},e.id))}):(0,t.jsx)("div",{className:"flex items-center justify-center h-64 p-8 text-center",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-4xl mb-4",children:"ð"}),(0,t.jsx)("p",{className:"text-muted-foreground mb-2",children:"Sign in required"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Sign in to view your PDF history"})]})}
3):d?(0,t.jsxs)(t.Fragment,{children:[!o&&e&&(0,t.jsx)("div",{className:"fixed inset-0 z-40 animate-fade-in",style:{background:"linear-gradient(to right, rgba(0,0,0,0.95), rgba(0,0,0,0.4))",animation:"fadeIn 0.3s ease-out"},onClick:a}),(0,t.jsxs)("div",{className:`fixed left-0 top-0 h-screen bg-background shadow-2xl transition-transform duration-300 z-50 ${e?"translate-x-0":"-translate-x-full"}`,style:{width:"320px"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 p-4 border-b border-border",children:[(0,t.jsx)("button",{onClick:a,className:"p-2 rounded-md hover:bg-muted transition-colors",title:"Close panel",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"PDF History"})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:h?(0,t.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,t.jsx)("div",{className:"animate-spin w-6 h-6 border border-border border-t-transparent rounded-full"})}):p?(0,t.jsxs)("div",{className:"p-4 text-center",children:[(0,t.jsx)("div",{className:"text-red-500 mb-2",children:"â ï¸"}),(0,t.jsx)("p",{className:"text-sm text-red-600",children:p}),(0,t.jsx)("button",{onClick:m,className:"mt-2 text-sm text-blue-600 hover:underline",children:"Try again"})]}):0===c.length?(0,t.jsx)("div",{className:"flex items-center justify-center h-64 p-8 text-center",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-4xl mb-4",children:"ð"}),(0,t.jsx)("p",{className:"text-muted-foreground mb-2",children:"No PDFs yet"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Upload a PDF to start building your history"})]})}):(0,t.jsx)("div",{className:"p-2 space-y-2",children:c.map(e=>(0,t.jsx)("div",{onClick:()=>x(e),className:`group p-3 rounded-lg cursor-pointer transition-colors ${i===e.id?"bg-accent text-accent-foreground border border-accent":"hover:bg-muted border border-transparent"}`,children:(0,t.jsxs)("div",{className:"flex items-start justify-between",children:[(0,t.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,t.jsx)("div",{className:"text-lg",children:"ð"}),(0,t.jsx)("h3",{className:"text-sm font-medium text-foreground truncate",children:e.file_name})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[(0,t.jsx)("span",{children:D.formatFileSize(e.file_size)}),e.page_count&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{children:"â¢"}),(0,t.jsxs)("span",{children:[e.page_count," pages"]})]})]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Uploaded"," ",D.formatDate(e.upload_date)]}),(0,t.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Last opened"," ",D.formatDate(e.last_accessed)]})]})]}),(0,t.jsx)("button",{onClick:t=>b(t,e.id),className:"opacity-0 group-hover:opacity-100 p-1 rounded-md hover:bg-red-100 text-red-500 transition-all",title:"Delete from history",children:(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"})})})]})},e.id))})}),(0,t.jsx)("div",{className:"border-t border-border p-3",children:(0,t.jsxs)("button",{onClick:m,className:"w-full text-sm text-muted-foreground hover:text-foreground transition-colors flex items-center justify-center gap-2",children:[(0,t.jsx)("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),"Refresh"]})})]})]}
3):(0,t.jsxs)(t.Fragment,{children:[!o&&e&&(0,t.jsx)("div",{className:"fixed inset-0 z-40 animate-fade-in",style:{background:"linear-gradient(to right, rgba(0,0,0,0.95), rgba(0,0,0,0.4))",animation:"fadeIn 0.3s ease-out"},onClick:a}),(0,t.jsxs)("div",{className:`fixed left-0 top-0 h-screen bg-background shadow-2xl transition-transform duration-300 z-50 ${e?"translate-x-0":"-translate-x-full"}`,style:{width:"320px"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 p-4 border-b border-border",children:[(0,t.jsx)("button",{onClick:a,className:"p-2 rounded-md hover:bg-muted transition-colors",title:"Close panel",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"PDF History"})]}),(0,t.jsx)("div",{className:"flex items-center justify-center h-64 p-8 text-center",children:(0,t.jsxs)("div",{children:[(0,t.jsx)("div",{className:"text-4xl mb-4",children:"ð"}),(0,t.jsx)("p",{className:"text-muted-foreground mb-2",children:"Sign in required"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Sign in to view your PDF history"})]})})]})]})}function S({isOpen:e,onToggle:a,onPDFSelect:s,currentPDFId:i}){let{user:o,signInWithGoogle:l}=(0,n.useAuth)(),[d,c]=(0,r.useState)(null),[u,h]=(0,r.useState)(!1),[f,p]=(0,r.useState)(!1),[g,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>{if(e){h(!0);let e=setTimeout(()=>{p(!0)},10);return()=>clearTimeout(e)}{p(!1),c(null);let e=setTimeout(()=>{h(!1)},300);return()=>clearTimeout(e)}},[e]);let x=[{id:"history",label:"PDF History",icon:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v10a2 2 0 002 2h8a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})}),requiresAuth:!0},{id:"settings",label:"Settings",icon:(0,t.jsxs)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"}),(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z"})]}),requiresAuth:!1},{id:"help",label:"Help & Support",icon:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M8.228 9c.549-1.165 2.03-2 3.772-2 2.21 0 4 1.343 4 3 0 1.4-1.278 2.575-3.006 2.907-.542.104-.994.54-.994 1.093m0 3h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),requiresAuth:!1}],b=async()=>{try{m(!0),await l()}catch(e){console.error("Sign in failed:",e)}finally{m(!1)}},v=e=>{"history"===e&&("history"===d?c(null):c("history"))};return"history"===d?(0,t.jsxs)(t.Fragment,{children:[u&&(0,t.jsx)("div",{className:"fixed inset-0 z-40 transition-opacity duration-300",style:{background:"linear-gradient(to right, rgba(0,0,0,0.95), rgba(0,0,0,0.4))",opacity:+!!f},onClick:()=>c(null)}),u&&(0,t.jsxs)("div",{className:`fixed left-0 top-0 h-screen bg-background shadow-2xl transition-transform duration-300 z-50 ${f?"translate-x-0":"-translate-x-full"}`,style:{width:"320px"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 p-4 border-b border-border",children:[(0,t.jsx)("button",{onClick:a,className:"p-2 rounded-md hover:bg-muted transition-colors",title:"Close menu",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Menu"})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsxs)("div",{className:"p-2 space-y-1",children:[x.map(e=>e.requiresAuth&&!o?null:(0,t.jsxs)("button",{onClick:()=>v(e.id),className:`flex items-center w-full px-4 py-3 text-left rounded-lg transition-colors group ${d===e.id?"bg-accent text-accent-foreground":"text-foreground hover:bg-muted"}`,children:[(0,t.jsx)("div",{className:`mr-3 ${d===e.id?"text-accent-foreground":"text-muted-foreground group-hover:text-foreground"}`,children:e.icon}),(0,t.jsx)("span",{className:"font-medium",children:e.label})]},e.id)),!o&&(0,t.jsxs)("div",{className:"mt-6 p-4 bg-muted rounded-lg",children:[(0,t.jsxs)("div",{className:"flex items-center mb-3",children:[(0,t.jsx)("div",{className:"text-2xl mr-2",children:"ð"}),(0,t.jsx)("h3",{className:"font-medium text-foreground",children:"Sign in for more features"})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Sign in to access PDF history and personalized settings."}),(0,t.jsx)("button",{onClick:b,disabled:g,className:"flex items-center justify-center w-full gap-2 px-3 py-2 bg-background border border-border rounded-md hover:bg-muted transition-colors disabled:opacity-50 disabled:cursor-not-allowed shadow-sm text-sm font-medium text-foreground",children:g?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"animate-spin w-4 h-4 border border-border border-t-transparent roun
3ded-full"}),"Signing in..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,t.jsx)("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,t.jsx)("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,t.jsx)("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Sign in with Google"]})})]})]})}),(0,t.jsx)("div",{className:"border-t border-border p-4",children:(0,t.jsx)("div",{className:"text-center text-xs text-muted-foreground",children:"Highlit v1.0"})})]}),u&&(0,t.jsx)("div",{className:`fixed top-0 h-screen bg-background shadow-lg transition-transform duration-300 z-40 border-l border-border ${f?"translate-x-0":"translate-x-full"}`,style:{left:"320px",width:"320px"},children:(0,t.jsx)("div",{className:"h-full overflow-y-auto",children:(0,t.jsx)(M,{isOpen:!0,onToggle:()=>c(null),onPDFSelect:e=>{s?.(e),c(null),a()},currentPDFId:i,skipOverlay:!0,hidePanel:!0})})})]}):(0,t.jsxs)(t.Fragment,{children:[u&&(0,t.jsx)("div",{className:"fixed inset-0 z-40 transition-opacity duration-300",style:{background:"linear-gradient(to right, rgba(0,0,0,0.95), rgba(0,0,0,0.4))",opacity:+!!f},onClick:()=>{p(!1),setTimeout(()=>{a()},300)}}),u&&(0,t.jsxs)("div",{className:`fixed left-0 top-0 h-screen bg-background shadow-2xl transition-transform duration-300 z-50 ${f?"translate-x-0":"-translate-x-full"}`,style:{width:"320px"},children:[(0,t.jsxs)("div",{className:"flex items-center gap-4 p-4 border-b border-border",children:[(0,t.jsx)("button",{onClick:a,className:"p-2 rounded-md hover:bg-muted transition-colors",title:"Close menu",children:(0,t.jsx)("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 6h16M4 12h16M4 18h16"})})}),(0,t.jsx)("h2",{className:"text-lg font-semibold text-foreground",children:"Menu"})]}),(0,t.jsx)("div",{className:"flex-1 overflow-y-auto",children:(0,t.jsxs)("div",{className:"p-2 space-y-1",children:[x.map(e=>e.requiresAuth&&!o?null:(0,t.jsxs)("button",{onClick:()=>v(e.id),className:"flex items-center w-full px-4 py-3 text-left text-foreground hover:bg-muted rounded-lg transition-colors group",children:[(0,t.jsx)("div",{className:"mr-3 text-muted-foreground group-hover:text-foreground",children:e.icon}),(0,t.jsx)("span",{className:"font-medium",children:e.label})]},e.id)),!o&&(0,t.jsxs)("div",{className:"mt-6 p-4 bg-muted rounded-lg",children:[(0,t.jsxs)("div",{className:"flex items-center mb-3",children:[(0,t.jsx)("div",{className:"text-2xl mr-2",children:"ð"}),(0,t.jsx)("h3",{className:"font-medium text-foreground",children:"Sign in for more features"})]}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-4",children:"Sign in to access PDF history and personalized settings."}),(0,t.jsx)("button",{onClick:b,disabled:g,className:"flex items-center justify-center w-full gap-2 px-3 py-2 bg-background border border-border rounded-md hover:bg-muted transition-colors disabled:opacity-50 disabled:cursor-not-allowed shadow-sm text-sm font-medium text-foreground",children:g?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"animate-spin w-4 h-4 border border-border border-t-transparent rounded-full"}),"Signing in..."]}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("svg",{className:"w-4 h-4",viewBox:"0 0 24 24",children:[(0,t.jsx)("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),(0,t.jsx)("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),(0,t.jsx)("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),(0,t.jsx)("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Sign in with Google"]})})]})]})}),(0,t.jsx)("div",{className:"border-t border-border p-4",children:(0,t.jsx)("div",{className:"text-center text-xs text-muted-foreground",children:"Highlit v1.0"})})]})]})}window.fetch;let T=()=>!1,_=()=>
3{if(!window.fetch.__mockOverridden){let e=window.fetch;window.fetch=async(t,r)=>{let a="string"==typeof t?t:t instanceof URL?t.href:t.url;if(!(T()&&a.includes("/api/")))return e(a,r)},window.fetch.__mockOverridden=!0}window.getMockStatus=T,window.toggleMockMode=()=>{let e="true"===localStorage.getItem("useMockData");localStorage.setItem("useMockData",(!e).toString())},window.enableMockMode=()=>{localStorage.setItem("useMockData","true")},window.disableMockMode=()=>{localStorage.setItem("useMockData","false")},window.checkMockStatus=()=>T(),T()},C=()=>{_(),document.addEventListener("visibilitychange",()=>{document.hidden||window.fetch.__mockOverridden||_()})};C(),"loading"===document.readyState&&document.addEventListener("DOMContentLoaded",C),window.addEventListener("load",C);let F=(0,a.default)(()=>e.A(94304).then(e=>({default:e.default})),{loadableGenerated:{modules:[58606]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"flex items-center justify-center h-full",children:(0,t.jsx)("div",{className:"text-muted-foreground",children:"Loading PDF Viewer..."})})}),E=(0,a.default)(()=>
3e.A(16028),{loadableGenerated:{modules:[49340]},ssr:!1});function O(){let{user:e}=(0,n.useAuth)(),[a,s]=(0,r.useState)(null),[i,o]=(0,r.useState)(null),[l,u]=(0,r.useState)(33),[h,f]=(0,r.useState)(!1),[p,g]=(0,r.useState)(void 0),[m,x]=(0,r.useState)([]),[b,v]=(0,r.useState)(!1),[y,w]=(0,r.useState)(""),[j,P]=(0,r.useState)(!1),[k,N]=(0,r.useState)(void 0),M=(0,r.useRef)(null),T=(0,r.useRef)(null),_=async e=>{let t=e.target.files?.[0];t&&"application/pdf"===t.type&&await C(t)},C=async t=>{s(null),o(null),await new Promise(e=>setTimeout(e,100)),s(t),o(URL.createObjectURL(t)),N(void 0),g(void 0);let r={fileName:t.name,pageCount:0};try{let a=await c.geminiService.uploadPDFToGemini(t);if(!a||!a.fileUri){console.error("â Upload result is missing required fileUri property"),alert("Failed to upload PDF: The server did not return a valid file reference. Please check your Gemini API configuration and try again."),s(null),o(null);return}if(r.fileUri=a.fileUri,r.tempPath=a.tempPath,r.documentId=a.documentId,e){let r=await D.savePDFToHistory(e,{fileName:t.name,fileSize:t.size,file:t,geminiFileUri:a.fileUri,geminiDocumentId:a.documentId,pageCount:0});r&&N(r.id)}}catch(t){console.error("â Failed to upload PDF to service:",t);let e=t instanceof Error?t.message:"Unknown error occurred";alert(`Failed to upload PDF: ${e} 4 5Please ensure your Gemini API key is configured correctly in the server environment.`),s(null),o(null);return}g(r)},O=async e=>{e.preventDefault();let t=e.dataTransfer.files[0];t&&"application/pdf"===t.type&&await C(t)},A=async e=>{s(e),o(URL.createObjectURL(e)),g({fileName:e.name,pageCount:4,documentId:"mock-doc-12345",tempPath:"/tmp/mock-streaming-analysis.pdf",fileUri:"https://generativelanguage.googleapis.com/v1beta/files/5m6tpjdzlztv"})},z=async t=>{if(e)try{s(null),o(null),await new Promise(e=>setTimeout(e,100));let r=await D.getPDFFileUrl(t.storage_path);if(!r)return void console.error("Failed to get PDF file URL");let a=await D.downloadPDF(t.storage_path);if(!a)return void console.error("Failed to download PDF");let n=new File([a],t.file_name,{type:"application/pdf"});s(n),o(r),N(t.id);let i={fileName:t.file_name,pageCount:t.page_count||0,fileUri:t.gemini_file_uri,documentId:t.gemini_document_id,tempPath:""};g(i),await D.updateLastAccessed(e,t.id),P(!1)}catch(e){console.error("â Failed to load PDF from history:",e)}},L=()=>{P(!j)},I=(0,r.useCallback)(e=>{e.preventDefault(),f(!0)},[]),B=(0,r.useCallback)(e=>{if(!h||!T.current)return;let t=T.current.getBoundingClientRect();u(Math.max(20,Math.min(60,(t.right-e.clientX)/t.width*100)))},[h]),$=(0,r.useCallback)(()=>{f(!1)},[]);return(0,r.useEffect)(()=>(h?(document.addEventListener("mousemove",B),document.addEventListener("mouseup",$),document.body.style.cursor="col-resize",document.body.style.userSelect="none"):(document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",$),document.body.style.cursor="",document.body.style.userSelect=""),()=>{document.removeEventListener("mousemove",B),document.removeEventListener("mouseup",$),document.body.style.cursor="",document.body.style.userSelect=""}),[h,B,$]),(0,t.jsxs)(d,{onMenuToggle:L,isMenuOpen:j,children:[(0,t.jsx)(S,{isOpen:j,onToggle:L,onPDFSelect:z,currentPDFId:k}),(0,t.jsxs)("div",{ref:T,className:"flex h-[calc(100vh-4rem)] relative",children:[(0,t.jsx)("div",{className:"bg-background border-r border-border overflow-hidden h-full",style:{width:`${100-l}%`},children:a?(0,t.jsx)("div",{className:"h-full overflow-auto",children:(0,t.jsx)(F,{fileUrl:i,fileName:a.name,ref:M,highlights:m,onPageCountChange:e=>{p&&g({...p,pageCount:e})},isHighlightProcessing:b,highlightProcessingStatus:y})}):(0,t.jsx)("div",{className:"h-full flex items-center justify-center p-8",children:(0,t.jsxs)("div",{className:"w-full max-w-lg flex flex-col items-center justify-center border-2 border-dashed border-muted rounded-lg p-12 text-center hover:border-muted-foreground/50 transition-colors",onDrop:O,onDragOver:e=>{e.preventDefault()},children:[(0,t.jsx)("div",{className:"w-16 h-16 mx-auto mb-6 rounded-full bg-muted flex items-center justify-center",children:(0,t.jsx)("svg",{className:"w-8 h-8 text-muted-foreground",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"})})}),(0,t.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-2",children:"Upload your PDF"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground mb-6",children:"Drag and drop a file here, or click to select a file"}),(0,t.jsx)("input",{type:"file",accept:".pdf",id:"file-upload",className:"hidden",onChange:_}),(0,t.jsx)("label",{htmlFor:"file-upload",className:"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 cursor-pointer",children:"Choose File"}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-4",children:"PDF files up to 50MB"})]})})}),(0,t.jsxs)("div",{className:"w-1 bg-border hover:bg-primary curs
5or-col-resize transition-colors relative group",onMouseDown:I,children:[(0,t.jsx)("div",{className:"absolute inset-y-0 left-0 w-1 bg-primary opacity-0 group-hover:opacity-100 transition-opacity"}),(0,t.jsx)("div",{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-6 h-12 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity",children:(0,t.jsx)("div",{className:"w-0.5 h-6 bg-primary rounded-full"})})]}),(0,t.jsx)("div",{className:"bg-background flex flex-col h-full",style:{width:`${l}%`},children:a?(0,t.jsx)("div",{className:"h-full flex flex-col bg-background",children:(0,t.jsx)(E,{onNavigateToPage:e=>{M.current&&M.current.goToPage(e)},pdfContext:p,onHighlightsUpdate:e=>{x(e)},pdfViewerRef:M,onHighlightProcessingChange:(e,t)=>{v(e),w(t||"")}})}):(0,t.jsx)("div",{className:"h-full overflow-auto",children:(0,t.jsx)("div",{className:"flex flex-col justify-center min-h-full p-6",children:(0,t.jsxs)("div",{className:"space-y-6",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-foreground mb-3",children:"Getting Started"}),(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,t.jsx)("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary text-primary-foreground text-xs flex items-center justify-center font-medium",children:"1"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Upload your PDF using drag & drop or file picker"})]}),(0,t.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,t.jsx)("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary text-primary-foreground text-xs flex items-center justify-center font-medium",children:"2"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Extract highlights, summaries, and keywords with AI"})]}),(0,t.jsxs)("div",{className:"flex items-start space-x-3",children:[(0,t.jsx)("div",{className:"flex-shrink-0 w-6 h-6 rounded-full bg-primary text-primary-foreground text-xs flex items-center justify-center font-medium",children:"3"}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:"Chat with AI about your document content"})]})]})]}),(0,t.jsx)("div",{className:"border-t border-border pt-6",children:(0,t.jsxs)("div",{className:"rounded-lg bg-muted p-4",children:[(0,t.jsx)("h4",{className:"text-sm font-medium text-foreground mb-2",children:"Tips"}),(0,t.jsxs)("ul",{className:"text-xs text-muted-foreground space-y-1",children:[(0,t.jsx)("li",{children:"⢠PDF files up to 50MB supported"}),(0,t.jsx)("li",{children:"⢠Drag the border to resize panels"}),(0,t.jsx)("li",{children:"⢠Use the sidebar to access previous PDFs"})]})]})})]})})})})]}),(0,t.jsx)(R,{onMockPDFLoad:A})]})}e.s(["default",0,function(){let[e,a]=(0,r.useState)(!1);return((0,r.useEffect)(()=>{a(!0)},[]),e)?(0,t.jsx)(O,{}):(0,t.jsx)(d,{children:(0,t.jsx)("div",{className:"flex h-[calc(100vh-4rem)] items-center justify-center",children:(0,t.jsx)("div",{className:"animate-spin w-8 h-8 border border-border border-t-transparent rounded-full"})})})},"dynamic",0,"force-dynamic"],52683)}]);
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.