PageSourceSearch

https://jvinvest.ai/assets/DataTransparency-CbYUjx_b.js

js jvinvest.ai collected 2026-10-05 14:05:59 UTC 74,537 bytes, 11 lines download raw bytes

vendor: 4,360 bytes, lines 1-11
1import{c as Nn,a9 as Sn,r as i,aa as se,ab as Pa,j as e,ac as he,ad as re,ae as Oa,af as Ia,ag as Ee,ah as La,ai as Ae,aj as ue,ak as Ba,al as Ya,am as Ha,b as ce,d as le,e as ie,a as Ua,f as we,g as de,B as ot,L as za,J as Fa,y as K,z as h,A as $,D as Wa,F as Va,an as sn,ao as Za,ap as Ga,N as qa,aq as Xa,ar as $a,as as Ka,at as Ke,s as Se,t as ve,u as D,v as P,w as je,x as f,T as on,au as Qe}from"./index-m4mBRonp.js";import{c as Qa}from"./index-BdQq_4o_.js";import{D as Ja}from"./database-BQzVryG_.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const er=Nn("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const tr=Nn("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);var Pe="Switch",[nr,ns]=Sn(Pe),[ar,rr]=nr(Pe),vn=i.forwardRef((t,n)=>{const{__scopeSwitch:a,name:r,checked:s,defaultChecked:o,required:l,disabled:d,value:m="on",onCheckedChange:x,form:p,..._}=t,[b,k]=i.useState(null),T=se(n,R=>k(R)),M=i.useRef(!1),F=b?p||!!b.closest("form"):!0,[w,j]=Pa({prop:s,defaultProp:o??!1,onChange:x,caller:Pe});return e.jsxs(ar,{scope:a,checked:w,disabled:d,children:[e.jsx(he.button,{type:"button",role:"switch","aria-checked":w,"aria-required":l,"data-state":Dn(w),"data-disabled":d?"":void 0,disabled:d,value:m,..._,ref:T,onClick:re(t.onClick,R=>{j(U=>!U),F&&(M.current=R.isPropagationStopped(),M.current||R.stopPropagation())})}),F&&e.jsx(En,{control:b,bubbles:!M.current,name:r,value:m,checked:w,required:l,disabled:d,form:p,style:{transform:"translateX(-100%)"}})]})});vn.displayName=Pe;var jn="SwitchThumb",Cn=i.forwardRef((t,n)=>{const{__scopeSwitch:a,...r}=t,s=rr(jn,a);return e.jsx(he.span,{"data-state":Dn(s.checked),"data-disabled":s.disabled?"":void 0,...r,ref:n})});Cn.displayName=jn;var sr="SwitchBubbleInput",En=i.forwardRef(({__scopeSwitch:t,control:n,checked:a,bubbles:r=!0,...s},o)=>{const l=i.useRef(null),d=se(l,o),m=Oa(a),x=Ia(n);return i.useEffect(()=>{const p=l.current;if(!p)return;const _=window.HTMLInputElement.prototype,k=Object.getOwnPropertyDescriptor(_,"checked").set;if(m!==a&&k){const T=new Event("click",{bubbles:r});k.call(p,a),p.dispatchEvent(T)}},[m,a,r]),e.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:a,...s,tabIndex:-1,ref:d,style:{...s.style,...x,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});En.displayName=sr;function Dn(t){return t?"checked":"unchecked"}var Mn=vn,or=Cn;const Ce=i.forwardRef(({className:t,...n},a)=>e.jsx(Mn,{className:Ee("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",t),...n,ref:a,children:e.jsx(or,{className:Ee("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));Ce.displayName=Mn.displayName;function cr(t,n){return i.useReducer((a,r)=>n[a][r]??a,t)}var it="ScrollArea",[Rn,as]=Sn(it),[lr,q]=Rn(it),An=i.forwardRef((t,n)=>{const{__scopeScrollArea:a,type:r="hover",dir:s,scrollHideDelay:o=600,...l}=t,[d,m]=i.useState(null),[x,p]=i.useState(null),[_,b]=i.useState(null),[k,T]=i.useState(null),[M,F]=i.useState(null),[w,j]=i.useState(0),[R,U]=i.useState(0),[O,A]=i.useState(!1),[Y,J]=i.useState(!1),N=se(n,C=>m(C)),S=La(s);return e.jsx(lr,{scope:a,type:r,dir:S,scrollHideDelay:o,scrollArea:d,viewport:x,onViewportChange:p,content:_,onContentChange:b,scrollbarX:k,onScrollbarXChange:T,scrollbarXEnabled:O,onScrollbarXEnabledChange:A,scrollbarY:M,onScrollbarYChange:F,scrollbarYEnabled:Y,onScrollbarYEnabledChange:J,onCornerWidthChange:j,onCornerHeight
vendor: 18,884 bytes, line 11
11Change:U,children:e.jsx(he.div,{dir:S,...l,ref:N,style:{position:"relative","--radix-scroll-area-corner-width":w+"px","--radix-scroll-area-corner-height":R+"px",...t.style}})})});An.displayName=it;var Pn="ScrollAreaViewport",On=i.forwardRef((t,n)=>{const{__scopeScrollArea:a,children:r,nonce:s,...o}=t,l=q(Pn,a),d=i.useRef(null),m=se(n,d,l.onViewportChange);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:s}),e.jsx(he.div,{"data-radix-scroll-area-viewport":"",...o,ref:m,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...t.style},children:e.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});On.displayName=Pn;var Q="ScrollAreaScrollbar",dt=i.forwardRef((t,n)=>{const{forceMount:a,...r}=t,s=q(Q,t.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=s,d=t.orientation==="horizontal";return i.useEffect(()=>(d?o(!0):l(!0),()=>{d?o(!1):l(!1)}),[d,o,l]),s.type==="hover"?e.jsx(ir,{...r,ref:n,forceMount:a}):s.type==="scroll"?e.jsx(dr,{...r,ref:n,forceMount:a}):s.type==="auto"?e.jsx(In,{...r,ref:n,forceMount:a}):s.type==="always"?e.jsx(ut,{...r,ref:n}):null});dt.displayName=Q;var ir=i.forwardRef((t,n)=>{const{forceMount:a,...r}=t,s=q(Q,t.__scopeScrollArea),[o,l]=i.useState(!1);return i.useEffect(()=>{const d=s.scrollArea;let m=0;if(d){const x=()=>{window.clearTimeout(m),l(!0)},p=()=>{m=window.setTimeout(()=>l(!1),s.scrollHideDelay)};return d.addEventListener("pointerenter",x),d.addEventListener("pointerleave",p),()=>{window.clearTimeout(m),d.removeEventListener("pointerenter",x),d.removeEventListener("pointerleave",p)}}},[s.scrollArea,s.scrollHideDelay]),e.jsx(Ae,{present:a||o,children:e.jsx(In,{"data-state":o?"visible":"hidden",...r,ref:n})})}),dr=i.forwardRef((t,n)=>{const{forceMount:a,...r}=t,s=q(Q,t.__scopeScrollArea),o=t.orientation==="horizontal",l=Ie(()=>m("SCROLL_END"),100),[d,m]=cr("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return i.useEffect(()=>{if(d==="idle"){const x=window.setTimeout(()=>m("HIDE"),s.scrollHideDelay);return()=>window.clearTimeout(x)}},[d,s.scrollHideDelay,m]),i.useEffect(()=>{const x=s.viewport,p=o?"scrollLeft":"scrollTop";if(x){let _=x[p];const b=()=>{const k=x[p];_!==k&&(m("SCROLL"),l()),_=k};return x.addEventListener("scroll",b),()=>x.removeEventListener("scroll",b)}},[s.viewport,o,m,l]),e.jsx(Ae,{present:a||d!=="hidden",children:e.jsx(ut,{"data-state":d==="hidden"?"hidden":"visible",...r,ref:n,onPointerEnter:re(t.onPointerEnter,()=>m("POINTER_ENTER")),onPointerLeave:re(t.onPointerLeave,()=>m("POINTER_LEAVE"))})})}),In=i.forwardRef((t,n)=>{const a=q(Q,t.__scopeScrollArea),{forceMount:r,...s}=t,[o,l]=i.useState(!1),d=t.orientation==="horizontal",m=Ie(()=>{if(a.viewport){const x=a.viewport.offsetWidth<a.viewport.scrollWidth,p=a.viewport.offsetHeight<a.viewport.scrollHeight;l(d?x:p)}},10);return ye(a.viewport,m),ye(a.content,m),e.jsx(Ae,{present:r||o,children:e.jsx(ut,{"data-state":o?"visible":"hidden",...s,ref:n})})}),ut=i.forwardRef((t,n)=>{const{orientation:a="vertical",...r}=t,s=q(Q,t.__scopeScrollArea),o=i.useRef(null),l=i.useRef(0),[d,m]=i.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),x=Un(d.viewport,d.content),p={...r,sizes:d,onSizesChange:m,hasThumb:x>0&&x<1,onThumbChange:b=>o.current=b,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:b=>l.current=b};function _(b,k){return xr(b,l.current,d,k)}return a==="horizontal"?e.jsx(ur,{...p,ref:n,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollLeft,k=cn(b,d,s.dir);o.current.style.transform=`translate3d(${k}px, 0, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollLeft=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollLeft=_(b,s.dir))}}):a==="vertical"?e.jsx(hr,{...p,ref:n,onThumbPositionChange:()=>{if(s.viewport&&o.current){const b=s.viewport.scrollTop,k=cn(b,d);o.current.style.transform=`translate3d(0, ${k}px, 0)`}},onWheelScroll:b=>{s.viewport&&(s.viewport.scrollTop=b)},onDragScroll:b=>{s.viewport&&(s.viewport.scrollTop=_(b))}}):null}),ur=i.forwardRef((t,n)=>{const{sizes:a,onSizesChange:r,...s}=t,o=q(Q,t.__scopeScrollArea),[l,d]=i.useState(),m=i.useRef(null),x=se(n,m,o.onScrollbarXChange);return i.useEffect(()=>{m.current&&d(getComputedStyle(m.current))},[m]),e.jsx(Bn,{"data-orientation":"horizontal",...s,ref:x,sizes:a,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":Oe(a)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.x),onDragScroll:p=>t.onDragScroll(p.x),onWheelScroll:(p,_)=>{if(o.viewport){const b=o.viewport.scrollLeft+p.deltaX;t.onWheelScroll(b),Fn(b,_)&&p.preventDefault()}},onResize:()=>{m.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:m.current.clientWidth,paddingStart:Me(l.paddingLeft),paddingEnd:Me(l.paddingRight)}})}})}),hr=i.forwardRef((t,n)=>{const{sizes:a,onSizesChange:r,...s}=t,o=q(Q,t.__scopeScrollArea),[l,d]=i.useState(),m=i.useRef(null),x=se(n,m,o.onScrollbarYChange);return i.useEffect(()=>{m.current&&d(getComputedStyle(m.current))},[m]),e.jsx(Bn,{"data-orientation":"vertical",...s,ref:x,sizes:a,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":Oe(a)+"px",...t.style},onThumbPointerDown:p=>t.onThumbPointerDown(p.y),onDragScroll:p=>t.onDragScroll(p.y),onWheelScroll:(p,_)=>{if(o.viewport){const b=o.viewport.scrollTop+p.deltaY;t.onWheelScroll(b),Fn(b,_)&&p.preventDefault()}},onResize:()=>{m.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:m.current.clientHeight,paddingStart:Me(l.paddingTop),paddingEnd:Me(l.paddingBottom)}})}})}),[mr,Ln]=Rn(Q),Bn=i.forwardRef((t,n)=>{const{__scopeScrollArea:a,sizes:r,hasThumb:s,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:d,onThumbPositionChange:m,onDragScroll:x,onWheelScroll:p,onResize:_,...b}=t,k=q(Q,a),[T,M]=i.useState(null),F=se(n,N=>M(N)),w=i.useRef(null),j=i.useRef(""),R=k.viewport,U=r.content-r.viewport,O=ue(p),A=ue(m),Y=Ie(_,10);function J(N){if(w.current){const S=N.clientX-w.current.left,C=N.clientY-w.current.top;x({x:S,y:C})}}return i.useEffect(()=>{const N=S=>{const C=S.target;(T==null?void 0:T.contains(C))&&O(S,U)};return document.addEventListener("wheel",N,{passive:!1}),()=>document.removeEventListener("wheel",N,{passive:!1})},[R,T,U,O]),i.useEffect(A,[r,A]),ye(T,Y),ye(k.content,Y),e.jsx(mr,{scope:a,scrollbar:T,hasThumb:s,onThumbChange:ue(o),onThumbPointerUp:ue(l),onThumbPositionChange:A,onThumbPointerDown:ue(d),children:e.jsx(he.div,{...b,ref:F,style:{position:"absolute",...b.style},onPointerDown:re(t.onPointerDown,N=>{N.button===0&&(N.target.setPointerCapture(N.pointerId),w.current=T.getBoundingClientRect(),j.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",k.viewport&&(k.viewport.style.scrollBehavior="auto"),J(N))}),onPointerMove:re(t.onPointerMove,J),onPointerUp:re(t.onPointerUp,N=>{const S=N.target;S.hasPointerCapture(N.pointerId)&&S.releasePointerCapture(N.pointerId),document.body.style.webkitUserSelect=j.current,k.viewport&&(k.viewport.style.scrollBehavior=""),w.current=null})})})}),De="ScrollAreaThumb",Yn=i.forwardRef((t,n)=>{const{forceMount:a,...r}=t,s=Ln(De,t.__scopeScrollArea);return e.jsx(Ae,{present:a||s.hasThumb,children:e.jsx(fr,{ref:n,...r})})}),fr=i.forwardRef((t,n)=>{const{__scopeScrollArea:a,style:r,...s}=t,o=q(De,a),l=Ln(De,a),{onThumbPositionChange:d}=l,m=se(n,_=>l.onThumbChange(_)),x=i.useRef(void 0),p=Ie(()=>{x.current&&(x.current(),x.current=void 0)},100);return i.useEffect(()=>{const _=o.viewport;if(_){const b=()=>{if(p(),!x.current){const k=gr(_,d);x.current=k,d()}};return d(),_.addEventListener("scroll",b),()=>_.removeEventListener("scroll",b)}},[o.viewport,p,d]),e.jsx(he.div,{"data-state":l.hasThumb?"visible":"hidden",...s,ref:m,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:re(t.onPointerDownCapture,_=>{const k=_.target.getBoundingClientRect(),T=_.clientX-k.left,M=_.clientY-k.top;l.onThumbPointerDown({x:T,y:M})}),onPointerUp:re(t.onPointerUp,l.onThumbPointerUp)})});Yn.displayName=De;var ht="ScrollAreaCorner",Hn=i.forwardRef((t,n)=>{const a=q(ht,t.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?e.jsx(pr,{...t,ref:n}):null});Hn.displayName=ht;var pr=i.forwardRef((t,n)=>{const{__scopeScrollArea:a,...r}=t,s=q(ht,a),[o,l]=i.useState(0),[d,m]=i.useState(0),x=!!(o&&d);return ye(s.scrollbarX,()=>{var _;const p=((_=s.scrollbarX)==null?void 0:_.offsetHeight)||0;s.onCornerHeightChange(p),m(p)}),ye(s.scrollbarY,()=>{var _;const p=((_=s.scrollbarY)==null?void 0:_.offsetWidth)||0;s.onCornerWidthChange(p),l(p)}),x?e.jsx(he.div,{...r,ref:n,style:{width:o,height:d,position:"absolute",right:s.dir==="ltr"?0:void 0,left:s.dir==="rtl"?0:void 0,bottom:0,...t.style}}):null});function Me(t){return t?parseInt(t,10):0}function Un(t,n){const a=t/n;return isNaN(a)?0:a}function Oe(t){const n=Un(t.viewport,t.content),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,r=(t.scrollbar.size-a)*n;return Math.max(r,18)}function xr(t,n,a,r="ltr"){const s=Oe(a),o=s/2,l=n||o,d=s-l,m=a.scrollbar.paddingStart+l,x=a.scrollbar.size-a.scrollbar.paddingEnd-d,p=a.content-a.viewport,_=r==="ltr"?[0,p]:[p*-1,0];return zn([m,x],_)(t)}function cn(t,n,a="ltr"){const r=Oe(n),s=n.scrollbar.paddingStart+n.scrollbar.paddingEnd,o=n.scrollbar.size-s,l=n.content-n.viewport,d=o-r,m=a==="ltr"?[0,l]:[l*-1,0],x=Qa(t,m);return zn([0,l],[0,d])(x)}function zn(t,n){return a=>{if(t[0]===t[1]||n[0]===n[1])return n[0];const r=(n[1]-n[0])/(t[1]-t[0]);return n[0]+r*(a-t[0])}}function Fn(t,n){return t>0&&t<n}var gr=(t,n=()=>{})=>{let a={left:t.scrollLeft,top:t.scrollTop},r=0;return function s(){const o={left:t.scrollLeft,top:t.scrollTop},l=a.left!==o.left,d=a.top!==o.top;(l||d)&&n(),a=o,r=window.requestAnimationFrame(s)}(),()=>window.cancelAnimationFrame(r)};function Ie(t,n){const a=ue(t),r=i.useRef(0);return i.useEffect(()=>()=>window.clearTimeout(r.current),[]),i.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,n)},[a,n])}function ye(t,n){const a=ue(n);Ba(()=>{let r=0;if(t){const s=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(a)});return s.observe(t),()=>{window.cancelAnimationFrame(r),s.unobserve(t)}}},[t,a])}var Wn=An,_r=On,br=Hn;const ct=i.forwardRef(({className:t,children:n,...a},r)=>e.jsxs(Wn,{ref:r,className:Ee("relative overflow-hidden",t),...a,children:[e.jsx(_r,{className:"h-full w-full rounded-[inherit]",children:n}),e.jsx(Vn,{}),e.jsx(br,{})]}));ct.displayName=Wn.displayName;const Vn=i.forwardRef(({className:t,orientation:n="vertical",...a},r)=>e.jsx(dt,{ref:r,orientation:n,className:Ee("flex touch-none select-none transition-colors",n==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",n==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",t),...a,children:e.jsx(Yn,{className:"relative flex-1 rounded-full bg-border"})}));Vn.displayName=dt.displayName;function ln(t,n,a){const r=Ya(),s=yr(t,a.timeZone,a.locale??r.locale);return"formatToParts"in s?wr(s,n):kr(s,n)}function wr(t,n){const a=t.formatToParts(n);for(let r=a.length-1;r>=0;--r)if(a[r].type==="timeZoneName")return a[r].value}function kr(t,n){const a=t.format(n).replace(/\u200E/g,""),r=/ [\w-+ ]+$/.exec(a);return r?r[0].substr(1):""}function yr(t,n,a){return new Intl.DateTimeFormat(a?[a.code,"en-US"]:void 0,{timeZone:n,timeZoneName:t})}function Tr(t,n){const a=Cr(n);return"formatToParts"in a?Sr(a,t):vr(a,t)}const Nr={year:0,month:1,day:2,hour:3,minute:4,second:5};function Sr(t,n){try{const a=t.formatToParts(n),r=[];for(let s=0;s<a.length;s++){const o=Nr[a[s].type];o!==void 0&&(r[o]=parseInt(a[s].value,10))}return r}catch(a){if(a instanceof RangeError)return[NaN];throw a}}function vr(t,n){const a=t.format(n),r=/(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(a);return[parseInt(r[3],10),parseInt(r[1],10),parseInt(r[2],10),parseInt(r[4],10),parseInt(r[5],10),parseInt(r[6],10)]}const Je={},dn=new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:"America/New_York",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(new Date("2014-06-25T04:00:00.123Z")),jr=dn==="06/25/2014, 00:00:00"||dn==="‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";function Cr(t){return Je[t]||(Je[t]=jr?new Intl.DateTimeFormat("en-US",{hourCycle:"h23",timeZone:t,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"}):new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"numeric",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit"})),Je[t]}function Zn(t,n,a,r,s,o,l){const d=new Date(0);return d.setUTCFullYear(t,n,a),d.setUTCHours(r,s,o,l),d}const un=36e5,Er=6e4,et={timezone:/([Z+-].*)$/,timezoneZ:/^(Z)$/,timezoneHH:/^([+-]\d{2})$/,timezoneHHMM:/^([+-])(\d{2}):?(\d{2})$/};function mt(t,n,a){if(!t)return 0;let r=et.timezoneZ.exec(t);if(r)return 0;let s,o;if(r=et.timezoneHH.exec(t),r)return s=parseInt(r[1],10),hn(s)?-(s*un):NaN;if(r=et.timezoneHHMM.exec(t),r){s=parseInt(r[2],10);const l=parseInt(r[3],10);return hn(s,l)?(o=Math.abs(s)*un+l*Er,r[1]==="+"?-o:o):NaN}if(Rr(t)){n=new Date(n||Date.now());const l=a?n:Dr(n),d=lt(l,t);return-(a?d:Mr(n,d,t))}return NaN}function Dr(t){return Zn(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds())}function lt(t,n){const a=Tr(t,n),r=Zn(a[0],a[1]-1,a[2],a[3]%24,a[4],a[5],0).getTime();let s=t.getTime();const o=s%1e3;return s-=o>=0?o:1e3+o,r-s}function Mr(t,n,a){let s=t.getTime()-n;const o=lt(new Date(s),a);if(n===o)return n;s-=o-n;const l=lt(new Date(s),a);return o===l?o:Math.max(o,l)}function hn(t,n){return-23<=t&&t<=23&&(n==null||0<=n&&n<=59)}const mn={};function Rr(t){if(mn[t])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:t}),mn[t]=!0,!0}catch{return!1}}const Ar=60*1e3,Pr={X:function(t,n,a){const r=tt(a.timeZone,t);if(r===0)return"Z";switch(n){case"X":return fn(r);case"XXXX":case"XX":return ke(r);case"XXXXX":case"XXX":default:return ke(r,":")}},x:function(t,n,a){const r=tt(a.timeZone,t);switch(n){case"x":return fn(r);case"xxxx":case"xx":return ke(r);case"xxxxx":case"xxx":default:return ke(r,":")}},O:function(t,n,a){const r=tt(a.timeZone,t);switch(n){case"O":case"OO":case"OOO":return"GMT"+Or(r,":");case"OOOO":default:return"GMT"+ke(r,":")}},z:function(t,n,a){switch(n){case"z":case"zz":case"zzz":return ln("short",t,a);case"zzzz":default:return ln("long",t,a)}}};function tt(t,n){const a=t?mt(t,n,!0)/Ar:(n==null?void 0:n.getTimezoneOffset())??0;if(Number.isNaN(a))throw new RangeError("Invalid time zone specified: "+t);return a}function Re(t,n){const a=t<0?"-":"";let r=Math.abs(t).toString();for(;r.length<n;)r="0"+r;return a+r}function ke(t,n=""){const a=t>0?"-":"+",r=Math.abs(t),s=Re(Math.floor(r/60),2),o=Re(Math.floor(r%60),2);return a+s+n+o}function fn(t,n){return t%60===0?(t>0?"-":"+")+Re(Math.abs(t)/60,2):ke(t,n)}function Or(t,n=""){const a=t>0?"-":"+",r=Math.abs(t),s=Math.floor(r/60),o=r%60;return o===0?a+String(s):a+String(s)+n+Re(o,2)}function pn(t){const n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+t-+n}const Ir=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,nt=36e5,xn=6e4,Lr=2,B={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,plainTime:/:/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:Ir};function Gn(t,n={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(t===null)return new Date(NaN);const a=n.additionalDigits==null?Lr:Number(n.additionalDigits);if(a!==2&&a!==1&&a!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]")return new Date(t.getTime());if(typeof t=="number"||Object.prototype.toString.call(t)==="[object Number]")return new Date(t);if(Object.prototype.toString.call(t)!=="[object String]")return new Date(NaN);const r=Br(t),{year:s,restDateString:o}=Yr(r.date,a),l=Hr(o,s);if(l===null||isNaN(l.getTime()))return new Date(NaN);if(l){const d=l.getTime();let m=0,x;if(r.time&&(m=Ur(r.time),m===null||isNaN(m)))return new Date(NaN);if(r.timeZone||n.timeZone){if(x=mt(r.timeZone||n.timeZone,new Date(d+m)),isNaN(x))return new Date(NaN)}else x=pn(new Date(d+m)),x=pn(new Date(d+m+x));return new Date(d+m+x)}else return new Date(NaN)}function Br(t){const n={};let a=B.dateTimePattern.exec(t),r;if(a?(n.date=a[1],r=a[3]):(a=B.datePattern.exec(t),a?(n.date=a[1],r=a[2]):(n.date=null,r=t)),r){const s=B.timeZone.exec(r);s?(n.time=r.replace(s[1],""),n.timeZone=s[1].trim()):n.time=r}return n}function Yr(t,n){if(t){const a=B.YYY[n],r=B.YYYYY[n];let s=B.YYYY.exec(t)||r.exec(t);if(s){const o=s[1];return{year:parseInt(o,10),restDateString:t.slice(o.length)}}if(s=B.YY.exec(t)||a.exec(t),s){const o=s[1];return{year:parseInt(o,10)*100,restDateString:t.slice(o.length)}}}return{year:null}}function Hr(t,n){if(n===null)return null;let a,r,s;if(!t||!t.length)return a=new Date(0),a.setUTCFullYear(n),a;let o=B.MM.exec(t);if(o)return a=new Date(0),r=parseInt(o[1],10)-1,_n(n,r)?(a.setUTCFullYear(n,r),a):new Date(NaN);if(o=B.DDD.exec(t),o){a=new Date(0);const l=parseInt(o[1],10);return Wr(n,l)?(a.setUTCFullYear(n,0,l),a):new Date(NaN)}if(o=B.MMDD.exec(t),o){a=new Date(0),r=parseInt(o[1],10)-1;const l=parseInt(o[2],10);return _n(n,r,l)?(a.setUTCFullYear(n,r,l),a):new Date(NaN)}if(o=B.Www.exec(t),o)return s=parseInt(o[1],10)-1,bn(s)?gn(n,s):new Date(NaN);if(o=B.WwwD.exec(t),o){s=parseInt(o[1],10)-1;const l=parseInt(o[2],10)-1;return bn(s,l)?gn(n,s,l):new Date(NaN)}return null}function Ur(t){let n,a,r=B.HH.exec(t);if(r)return n=parseFloat(r[1].replace(",",".")),at(n)?n%24*nt:NaN;
11if(r=B.HHMM.exec(t),r)return n=parseInt(r[1],10),a=parseFloat(r[2].replace(",",".")),at(n,a)?n%24*nt+a*xn:NaN;if(r=B.HHMMSS.exec(t),r){n=parseInt(r[1],10),a=parseInt(r[2],10);const s=parseFloat(r[3].replace(",","."));return at(n,a,s)?n%24*nt+a*xn+s*1e3:NaN}return null}function gn(t,n,a){n=n||0,a=a||0;const r=new Date(0);r.setUTCFullYear(t,0,4);const s=r.getUTCDay()||7,o=n*7+a+1-s;return r.setUTCDate(r.getUTCDate()+o),r}const zr=[31,28,31,30,31,30,31,31,30,31,30,31],Fr=[31,29,31,30,31,30,31,31,30,31,30,31];function qn(t){return t%400===0||t%4===0&&t%100!==0}function _n(t,n,a){if(n<0||n>11)return!1;if(a!=null){if(a<1)return!1;const r=qn(t);if(r&&a>Fr[n]||!r&&a>zr[n])return!1}return!0}function Wr(t,n){if(n<1)return!1;const a=qn(t);return!(a&&n>366||!a&&n>365)}function bn(t,n){return!(t<0||t>52||n!=null&&(n<0||n>6))}function at(t,n,a){return!(t<0||t>=25||n!=null&&(n<0||n>=60)||a!=null&&(a<0||a>=60))}const Vr=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function Zr(t,n,a={}){n=String(n);const r=n.match(Vr);if(r){const s=Gn(a.originalDate||t,a);n=r.reduce(function(o,l){if(l[0]==="'")return o;const d=o.indexOf(l),m=o[d-1]==="'",x=o.replace(l,"'"+Pr[l[0]](s,l,a)+"'");return m?x.substring(0,d-1)+x.substring(d+1):x},n)}return Ha(t,n,a)}function Gr(t,n,a){t=Gn(t,a);const r=mt(n,t,!0),s=new Date(t.getTime()-r),o=new Date(0);return o.setFullYear(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()),o.setHours(s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),o}function rt(t,n,a,r){return r={...r,timeZone:n,originalDate:t},Zr(Gr(t,n,{timeZone:r.timeZone}),a,r)}const st=["NVDA","AAPL","MSFT","AMZN","GOOGL","TSM","AVGO","GOOG","TSLA","META","BRK-B","WMT","005930.KS","LLY","JPM","XOM","TCEHY","ASML","JNJ","000660.KS","V","MU","ORCL","MA","AMD","COST","NFLX","BAC","CAT","ABBV","CVX","HD","PG","CSCO","INTC","9988.HK","PLTR","LRCX","RHHBY","KO","GE","HSBC","AZN","AMAT","MS","UNH","NVS","MRK","MC.PA","TM","GS","GEV","RTX","NESN.SW","WFC","RY.TO","SHEL.L","PM","IBM","KLAC","C","AXP","LIN","SIE.DE","MCD","CBA.AX","PEP","SAP.DE","8306.T","TXN","TMO","VZ","AMGN","NEE","DIS","SAN.MC","APH","T","NOVO-B.CO","TJX","BA","TD.TO","ALV.DE","BLK","SHOP.TO","ABT","CRM","ISRG","APP","SCHW","UBER","QCOM","SPGI","6758.T","ACN","INTU","NOW","BKNG"],wn={"SHEL.L":["SHEL"],"NOVO-B.CO":["NVO"],"NESN.SW":["NSRGY"],"RY.TO":["RY"],"SAP.DE":["SAP"],"TD.TO":["TD"],"6758.T":["SONY"],"8306.T":["MUFG"],"9988.HK":["BABA"],"SHOP.TO":["SHOP"],TCEHY:["TCEHY"]},qr=new Set(["NVDA","AAPL","MSFT","AMZN","GOOGL","AVGO","GOOG","TSLA","META","BRK-B","WMT","LLY","JPM","XOM","JNJ","V","MU","ORCL","MA","AMD","COST","NFLX","BAC","CAT","ABBV","CVX","HD","PG","CSCO","INTC","PLTR","LRCX","KO","GE","AMAT","MS","UNH","MRK","GS","GEV","RTX","WFC","PM","IBM","KLAC","C","AXP","LIN","MCD","PEP","TXN","TMO","VZ","AMGN","NEE","DIS","APH","T","TJX","BA","BLK","ABT","CRM","ISRG","APP","SCHW","UBER","QCOM","SPGI","ACN","INTU","NOW","BKNG"]),Xr=new Set(["TSM","ASML","HSBC","AZN","NVS","TM","SHEL.L","9988.HK"]),$r=new Set(["SHOP.TO"]);function kn(t){return qr.has(t)?{label:"SEC EDGAR · 10-K → GPT-5-mini",tone:"sec"}:Xr.has(t)?{label:"SEC EDGAR · 20-F → GPT-5-mini",tone:"sec"}:$r.has(t)?{label:"SEC EDGAR · 40-F → GPT-5-mini",tone:"sec"}:{label:"Firecrawl (IR-Seite) → GPT-5-mini",tone:"fc"}}const Kr=()=>{const[t,n]=i.useState(new Map),[a,r]=i.useState(new Map),[s,o]=i.useState(!0),[l,d]=i.useState(!1),[m,x]=i.useState(!1),[p,_]=i.useState(null),b=async()=>{o(!0);const[w,j]=await Promise.all([h.from("saved_sankey_data").select("ticker, parsed_data, updated_at"),h.from("msci_companies").select("ticker").order("market_cap_value",{ascending:!1}).limit(100)]);if(w.error){$.error(`Konnte Sankey-Daten nicht laden: ${w.error.message}`),o(!1);return}const R=new Map;(w.data??[]).forEach(O=>{const A=O.parsed_data??{};R.set(O.ticker,{ticker:O.ticker,period_end:A.periodEnd??null,fiscal_year:A.fiscalYear?String(A.fiscalYear):null,updated_at:O.updated_at})}),n(R);const U=new Map;(j.data??[]).forEach((O,A)=>{const Y=(O.ticker||"").toUpperCase();Y&&U.set(Y,{rank:A+1,dbTicker:Y})}),r(U),o(!1)};i.useEffect(()=>{b();const w=()=>b(),j=()=>{document.visibilityState==="visible"&&b()};return window.addEventListener("focus",w),document.addEventListener("visibilitychange",j),(
11)=>{window.removeEventListener("focus",w),document.removeEventListener("visibilitychange",j)}},[]);const{outdated:k,cutoffIso:T,updatedToday:M}=i.useMemo(()=>{const w=new Date,j=new Date(w);j.setMonth(j.getMonth()-14);const R=j.toISOString().slice(0,10),U=N=>{const S=[];t.has(N)&&S.push(t.get(N));for(const C of wn[N]??[])t.has(C)&&S.push(t.get(C));if(S.length!==0)return S.sort((C,W)=>(W.period_end??"").localeCompare(C.period_end??"")),S[0]},O=N=>{const S=N.toUpperCase(),C=a.get(S);if(C)return{rank:C.rank,dbTicker:C.dbTicker};for(const W of wn[N]??[]){const me=a.get(W.toUpperCase());if(me)return{rank:me.rank,dbTicker:me.dbTicker}}return{rank:null,dbTicker:S}},A=[],Y=[],J=p?new Date(p).getTime():null;return st.forEach(N=>{const S=U(N),{rank:C,dbTicker:W}=O(N);S?S.period_end?S.period_end<R&&A.push({ticker:N,rank:C,dbTicker:W,reason:`Annual Report > 14 Monate alt (${S.period_end})`}):A.push({ticker:N,rank:C,dbTicker:W,reason:"Sankey ohne period_end"}):A.push({ticker:N,rank:C,dbTicker:W,reason:"kein Sankey in der DB"}),J&&(S!=null&&S.updated_at)&&new Date(S.updated_at).getTime()>=J&&Y.push({ticker:N,rank:C,dbTicker:W,updated_at:S.updated_at,period_end:S.period_end})}),Y.sort((N,S)=>S.updated_at.localeCompare(N.updated_at)),{outdated:A,cutoffIso:R,updatedToday:Y}},[t,a,p]),F=async()=>{d(!0);try{const{data:w,error:j}=await h.functions.invoke("sankey-backfill-all",{body:{runType:"manual",tickers:k.map(R=>R.ticker)}});if(j)throw j;$.success(`Aktualisierung gestartet: ${(w==null?void 0:w.queued)??k.length} Ticker in der Warteschlange`),setTimeout(b,2e3)}catch(w){$.error(`Fehler: ${w.message}`)}finally{d(!1)}};return e.jsxs(ce,{className:"bg-amber-50 dark:bg-amber-950/20 border-amber-200 dark:border-amber-900",children:[e.jsxs(le,{children:[e.jsxs(ie,{className:"flex items-center gap-2",children:[e.jsx(Ua,{className:"h-5 w-5 text-amber-600 dark:text-amber-400"}),e.jsx("span",{className:"text-amber-700 dark:text-amber-300 font-bold",children:"Sankey-Daten der 98 Equity-Valuation-Unternehmen"})]}),e.jsx(we,{className:"text-amber-700 dark:text-amber-400",children:"Jede Nacht wird geprüft, welche Jahresberichte fehlen oder älter als 14 Monate sind (period_end aus saved_sankey_data). Nur veraltete Datensätze werden neu gezogen."})]}),e.jsxs(de,{className:"space-y-3",children:[!m&&e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx("div",{className:"text-sm text-amber-700 dark:text-amber-300",children:s?"Lädt…":k.length===0?`Alle ${st.length} Sankeys sind aktuell.`:`${k.length} von ${st.length} Jahresberichte${k.length===1?"":"n"} veraltet`}),e.jsxs(ot,{size:"sm",variant:"outline",onClick:()=>{_(new Date().toISOString()),b(),x(!0)},disabled:s||k.length===0,children:[e.jsx(er,{className:"h-4 w-4 mr-1"}),"Zeige nicht aktuelle Werte"]})]}),m&&k.length>0&&e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{className:"text-sm text-amber-700 dark:text-amber-300 font-medium",children:[k.length," nicht aktuelle",k.length===1?"r":""," Jahresbericht",k.length===1?"":"e"]}),e.jsxs(ot,{size:"sm",onClick:F,disabled:l,children:[l?e.jsx(za,{className:"h-4 w-4 animate-spin mr-1"}):e.jsx(Fa,{className:"h-4 w-4 mr-1"}),"Fehlende Jahresberichte aktualisieren"]})]}),e.jsx("div",{className:"rounded-md bg-background/60 p-3 space-y-1",children:k.map(w=>e.jsxs("div",{className:"flex items-center justify-between text-xs border-b border-border/50 last:border-0 py-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:`/valuation#ticker-${w.dbTicker}`,title:`Zu ${w.dbTicker} in der Equity-Valuation-Tabelle springen`,className:"inline-flex items-center",children:e.jsx(K,{variant:"outline",className:"text-xs hover:bg-primary/10 cursor-pointer transition-colors",children:w.ticker})}),e.jsx("span",{className:"text-muted-foreground font-mono",children:w.rank!=null?`#${w.rank}`:"—"}),(()=>{const j=kn(w.ticker);return e.jsx(K,{variant:"secondary",className:`text-[10px] ${j.tone==="sec"?"bg-blue-100 text-blue-800 dark:bg-blue-950 dark:text-blue-300":"bg-purple-100 text-purple-800 dark:bg-purple-950 dar
11k:text-purple-300"}`,children:j.label})})()]}),e.jsx("div",{className:"text-muted-foreground",children:w.reason})]},w.ticker))}),M.length>0&&e.jsxs("div",{className:"space-y-2 pt-2",children:[e.jsxs("div",{className:"text-sm text-emerald-700 dark:text-emerald-300 font-medium",children:["Heute aktualisiert: ",M.length]}),e.jsx("div",{className:"rounded-md bg-background/60 p-3 space-y-1",children:M.map(w=>e.jsxs("div",{className:"flex items-center justify-between text-xs border-b border-border/50 last:border-0 py-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("a",{href:`/valuation#ticker-${w.dbTicker}`,title:`Zu ${w.dbTicker} in der Equity-Valuation-Tabelle springen`,className:"inline-flex items-center",children:e.jsx(K,{variant:"outline",className:"text-xs hover:bg-primary/10 cursor-pointer transition-colors",children:w.ticker})}),e.jsx("span",{className:"text-muted-foreground font-mono",children:w.rank!=null?`#${w.rank}`:"—"}),(()=>{const j=kn(w.ticker);return e.jsx(K,{variant:"secondary",className:`text-[10px] ${j.tone==="sec"?"bg-blue-100 text-blue-800 dark:bg-blue-950 dark:text-blue-300":"bg-purple-100 text-purple-800 dark:bg-purple-950 dark:text-purple-300"}`,children:j.label})})()]}),e.jsxs("div",{className:"text-muted-foreground",children:[w.period_end??"—"," · ",new Date(w.updated_at).toLocaleTimeString("de-DE",{hour:"2-digit",minute:"2-digit"})]})]},w.ticker))})]})]})]})]})},yn=[{name:"fetch-index-prices-every-minute",description:"Aktienindizes: Dow Jones, S&P 500, Nasdaq, VIX, DAX, Euro Stoxx 50, FTSE 100, Nikkei 225, etc.",schedule:"* * * * *",scheduleReadable:"Jede Minute",functionName:"fetch-index-prices",targetTable:"Direkt angezeigt (kein Cache)",displayLocation:"News → Aktienindizes Tabelle",resultQuery:"index_prices"},{name:"msci-prices-every-minute",description:"MSCI Top 100: Aktienkurse, 1D% und YTD% Performance",schedule:"* * * * *",scheduleReadable:"Jede Minute",functionName:"update-msci-prices",targetTable:"msci_companies",displayLocation:"News → MSCI Top 100 Tabelle",resultQuery:"msci_companies"},{name:"sync-us-marketcap-every-5-min",description:"Sync US Market Cap: us_index_constituents → msci_companies (interne Datenbank-Synchronisation)",schedule:"*/5 * * * *",scheduleReadable:"Alle 5 Minuten",functionName:"sync-us-marketcap",targetTable:"msci_companies",displayLocation:"News → MSCI Top 100 Tabelle",resultQuery:"msci_us_sync"},{name:"yahoo-prices-hourly",description:"S&P 500/Nasdaq 100: Kurse + automatische Market Cap Berechnung (Kurs × Shares)",schedule:"0 * * * *",scheduleReadable:"Stündlich zur vollen Stunde",functionName:"fetch-yahoo-prices",targetTable:"us_index_constituents",displayLocation:"Aktienanalyse → S&P 500 Tabelle",resultQuery:"yahoo_prices"},{name:"wikipedia-sp500-daily",description:"S&P 500 Constituents (Ticker, Name, Sektor) + Bereinigung alter Einträge",schedule:"0 1 * * *",scheduleReadable:"Täglich um 02:00 MEZ",functionName:"fetch-wikipedia-sp500",targetTable:"us_index_constituents",displayLocation:"Aktienanalyse → Aktientabelle",resultQuery:"wikipedia_sp500"},{name:"sec-shares-update-daily",description:"Shares Outstanding aus 10-Q/10-K Filings",schedule:"0 2 * * *",scheduleReadable:"Täglich um 03:00 MEZ",functionName:"fetch-sec-shares-outstanding",targetTable:"us_index_constituents",displayLocation:"Aktienanalyse → S&P 500 Tabelle",resultQuery:"sec_shares"},{name:"fetch-daily-valuations",description:"Bewertungsdaten: Country ROE, Bond Duration/Yield, Sector Valuations",schedule:"0 3 * * *",scheduleReadable:"Täglich um 04:00 MEZ",functionName:"fetch-daily-valuations",targetTable:"ishares_roe_data, bond_etf_data, msci_sector_data",displayLocation:"ETF → Bonds & Spreads, Presentation → ROE by Country/Sector",resultQuery:"daily_valuations"},{name:"update-eps-dps-cache-daily",description:"EPS TTM (EDGAR + Yahoo) für US-Aktien (10-Q/10-K Filings) und internationale Aktien",schedule:"0 6 * * *",scheduleReadable:"Täglich um 07:00 MEZ",functionName:"update-eps-cache",targetTable:"cached_eps_data",displayLocation:"Valuation → Top 50 Tabelle",resultQuery:"eps_cache"},{name:"fetch-msci-yahoo-mcap-daily",description:"Market Cap für internationale MSCI-Aktien mit Währungsumrechnung (EUR/GBP/CHF/JPY → USD)",schedule:"0 9 * * *",scheduleReadable:"Täglich um 10:00 ME
11Z",functionName:"fetch-msci-yahoo-mcap",targetTable:"msci_companies",displayLocation:"News → MSCI Top 100 Tabelle",resultQuery:"msci_international_mcap"},{name:"fetch-damodaran-posts-daily",description:"Aswath Damodaran Blog: Data Updates via RSS Feed",schedule:"0 8 * * *",scheduleReadable:"Täglich um 09:00 MEZ",functionName:"fetch-damodaran-posts",targetTable:"damodaran_posts",displayLocation:"Valuation → Damodaran Slider",resultQuery:"damodaran_posts"},{name:"check-imf-weo-updates",description:"IMF World Economic Outlook: Prüft täglich ob neue WEO-Daten (BIP, Inflation) verfügbar sind und aktualisiert automatisch",schedule:"0 12 * * *",scheduleReadable:"Täglich um 13:00 MEZ",functionName:"fetch-imf-weo-auto",targetTable:"imf_weo_projections, app_settings",displayLocation:"Economics → IMF WEO Prognosen",resultQuery:"imf_weo"},{name:"update-nasdaq100-weekly",description:"Nasdaq 100: Wikipedia-Abgleich der Indexzusammensetzung (in_nasdaq100 Flag)",schedule:"0 5 * * 0",scheduleReadable:"Sonntags um 06:00 ME
11Z",functionName:"fetch-wikipedia-nasdaq100",targetTable:"us_index_constituents",displayLocation:"Stocks → US Index Constituents",resultQuery:"nasdaq100_update"},{name:"fetch-shiller-data-daily",description:"Shiller CAPE Daten: Excel-Import von shillerdata.com (CAPE, S&P 500, GS10, 10Y Returns seit 1871)",schedule:"0 4 * * *",scheduleReadable:"Täglich um 05:00 MEZ",functionName:"fetch-shiller-data",targetTable:"shiller_data_cache",displayLocation:"Valuation → Shiller PE Modell",resultQuery:"shiller_data"},{name:"compute-valuation-models-daily",description:"KI Regimes (Valuation): Tägliche Neuberechnung des Valuation-Regimes via compute-ki-regimes-v2 (auf Basis Shiller CAPE / P/BV / Yields)",schedule:"0 22 * * *",scheduleReadable:"Täglich um 23:00 MEZ",functionName:"compute-ki-regimes-v2",targetTable:"ki_regimes_v2, ki_regimes_v2_runs",displayLocation:"KI Regimes → Valuation Panel",resultQuery:"valuation_regime"},{name:"fetch-ishares-roe-daily",description:"iShares ROE Daten: KGV, Forward KGV, KBV, implizite ROE pro Land aus US iShares Factsheets",schedule:"0 7 * * *",scheduleReadable:"Täglich um 08:00 MEZ",functionName:"fetch-ishares-roe",targetTable:"ishares_roe_data",displayLocation:"M+ → ROE by Country",resultQuery:"ishares_roe"},{name:"fetch-msci-country-roe-daily",description:"MSCI Country ROE: Bewertungskennzahlen pro Land aus MSCI End-of-Day Factsheets",schedule:"30 7 * * *",scheduleReadable:"Täglich um 08:30 MEZ",functionName:"fetch-msci-country-roe",targetTable:"ishares_roe_data",displayLocation:"M+ → ROE by Country (MSCI Quelle)",resultQuery:"msci_country_roe"},{name:"fetch-sector-roe-daily",description:"Sektor-ROE: Bewertungskennzahlen pro MSCI World Sektor (KGV, KBV, Yield)",schedule:"0 8 * * *",scheduleReadable:"Täglich um 09:00 MEZ",functionName:"fetch-sector-roe",targetTable:"msci_sector_data",displayLocation:"M+ → ROE by Sector",resultQuery:"sector_roe"},{name:"fetch-msci-ttm-earnings-daily",description:"MSCI TTM Earnings: Trailing-12M Net Income & Quartalsdaten für MSCI Top 100 Aktien",schedule:"0 0 * * *",scheduleReadable:"Täglich um 01:00 MEZ",functionName:"fetch-msci-ttm-earnings",targetTable:"msci_companies (ttm_quarterly_data, net_income_ttm)",displayLocation:"News → MSCI Top 100 (KGV-Spalte)",resultQuery:"msci_ttm"},{name:"extract-bond-data-daily",description:"Bond ETF Daten via AI: Yield & Duration aus iShares Factsheet PDFs (Backup zur fetch-daily-valuations Pipeline)",schedule:"30 8 * * *",scheduleReadable:"Täglich um 09:30 MEZ",functionName:"extract-bond-data",targetTable:"bond_etf_data (ai_yield_percent, ai_duration)",displayLocation:"ETF → Bonds & Spreads",resultQuery:"extract_bond"},{name:"yahoo-shares-daily",description:"Shares Outstanding via Yahoo: Fallback-Quelle für SEC-Filings, ergänzt fehlende Werte für Nasdaq-Only Tickers",schedule:"30 2 * * *",scheduleReadable:"Täglich um 03:30 MEZ",functionName:"fetch-yahoo-shares-outstanding",targetTable:"us_index_constituents (shares_outstanding)",displayLocation:"Aktienanalyse → S&P 500 / Nasdaq 100",resultQuery:"yahoo_shares"},{name:"refresh-landing-news-en",description:"Landing-News EN: Bloomberg / Reuters / CNBC / Seeking Alpha Marktzusammenfassungen",schedule:"*/10 * * * *",scheduleReadable:"Alle 10 Minuten",functionName:"fetch-landing-news",targetTable:"landing_news_cache",displayLocation:"Landing Page → Top News",resultQuery:"landing_news"},{name:"refresh-landing-news-de",description:"Landing-News DE: Bloomberg / Reuters / CNBC / Seeking Alpha Marktzusammenfassungen",schedule:"5-59/10 * * * *",scheduleReadable:"Alle 10 Minuten (Offset +5 Min)",functionName:"fetch-landing-news",targetTable:"landing_news_cache",displayLocation:"Landing Page → Top News",resultQuery:"landing_news"}],Tn=t=>{if(!t)return"";let n=t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;");return n=n.replace(/\[([^\]]+)\]\((https?:\/\/[^)]+)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer" class="text-primary hover:underline font-medium">$1</a>'),n=n.replace(/\*\*([^*]+)\*\*/g,"<strong>$1</strong>"),n=n.replace(/\n/g,"<br>"),n};function rs(){var N,S,C,W,me;const[t,n]=i.useState(!1),[a,r]=i.useState(!1),[s,o]=i.useState(!1),[l,d]=i.useState(!1);i.useState(!1);const[m,x]=i.useState(""),{isAdmin:p,user:_,loading:b}=Wa();i.useEffect(()=>{const u=()=>{x(rt(new Date,"Europe/Berlin","HH:mm",{locale:Qe}))};u();const y=setInterval(u,1e3);return()=>clearInterval(y)},[]);const k=Va();i.useEffect(()=>{if(!b){if(!_){$.error("Bitte melden Sie sich an, um auf diese Seite zuzugreifen"),k("/auth");return}if(!p){$.error("Sie benötigen Admin-Rechte für diese Seite"),k("/");return}}},[_,p,b,k]);const{data:T,refetch:M}=sn({queryKey:["data-statistics"],queryFn:async()=>{var Ut,zt,Ft,Wt,Vt,Zt,Gt,qt,Xt,$t,Kt,Qt,Jt,en,tn,nn,an;const u=new Date().toISOString().split("T")[0],y=new Date;y.setHours(0,0,0,0);const{data:E}=await h.from("us_index_constituents").select("wiki_last_update, company_name").not("company_name","is",null),V=(E==null?void 0:E.length)||0,ft=(E==null?void 0:E.reduce((c,g)=>g.wiki_last_update&&g.wiki_last_update>c?g.wiki_last_update:c,""))||null,{data:ee}=await h.from("us_index_constituents").select("price_date, current_price").not("current_price","is",null),pt=(ee==null?void 0:ee.filter(c=>c.price_date===u).length)||0,xt=(ee==null?void 0:ee.length)||0,gt=(ee==null?void 0:ee.reduce((c,g)=>g.price_date&&g.price_date>c?g.price_date:c,""))||null,{count:Xn}=await h.from("us_index_constituents").select("*",{count:"exact",head:!0}),{count:_t}=await h.from("us_index_constituents").select("*",{count:"exact",head:!0}).eq("in_sp500",!0),{data:Le,count:bt}=await h.from("us_index_constituents").select("ticker, company_name",{count:"exact"}).eq("in_nasdaq100",!0).eq("in_sp500",!1).order("ticker"),$n=(Le==null?void 0:Le.map(c=>c.ticker))||[],{data:I}=await h.from("us_index_constituents").select("shares_outstanding_date, shares_outstanding, shares_outstanding_source").not("shares_outstanding","is",null),{data:fe}=await h.from("us_index_constituents").select("ticker").is("shares_outstanding",null),wt=(I==null?void 0:I.filter(c=>c.shares_outstanding_source&&(c.shares_outstanding_source.includes("10-Q")||c.shares_outstanding_source.includes("10-K")||c.shares_outstanding_source.includes("8-K"))).length)||0,kt=(I==null?void 0:I.filter(c=>c.shares_outstanding_source&&c.shares_outstanding_source.includes("Polygon")&&!c.shares_outstanding_source.includes("no_data")).length)||0,Kn=(I==null?void 0:I.filter(c=>c.shares_outstanding_date===u).length)||0,Qn=(I==null?void 0:I.length)||0,yt=Xn||0,Jn=(fe==null?void 0:fe.length)||0,ea=(fe==null?void 0:fe.map(c=>c.ticker))||[],Tt=(I==null?void 0:I.reduce((c,g)=>g.shares_outstanding_date&&g.shares_outstanding_date>c?g.shares_outstanding_date:c,""))||null,{data:pe}=await h.from("update_logs").select("completed_at").eq("function_name","fetch-sec-shares-outstanding").eq("status","completed").order("completed_at",{ascending:!1}).limit(1).maybeSingle(),{data:Z}=await h.from("us_index_constituents").select("market_cap, market_cap_date, shares_outstanding, current_price").not("shares_outstanding","is",null).not("current_price","is",null),ta=(Z==null?void 0:Z.filter(c=>c.market_cap&&c.market_cap>0).length)||0,na=(Z==null?void 0:Z.filter(c=>!c.market_cap||c.market_cap===0).length)||0,aa=(Z==null?void 0:Z.filter(c=>c.market_cap_date===u).length)||0,ra=(Z==null?void 0:Z.reduce((c,g)=>g.market_cap_date&&g.market_cap_date>c?g.market_cap_date:c,""))||null,{data:Be}=await h.from("update_logs").select("completed_at").eq("function_name","fetch-yahoo-shares-outstanding").eq("status","completed").order("completed_at",{ascending:!1}).limit(1).maybeSingle(),{data:G}=await h.from("msci_companies").select("last_marketcap_update, market_cap_value"),Nt=(G==null?void 0:G.length)||0,sa=(G==null?void 0:G.filter(c=>c.last_marketcap_update?c.last_marketcap_update.split("T")[0]===u:!1).length)||0,St=(G==null?void 0:G.reduce((c,g)=>g.last_marketcap_update&&g.last_marketcap_update>c?g.last_marketcap_update:c,""))||null,{count:vt}=await h.from("financial_news").select("*",{count:"exact",head:!0}),{count:jt}=await h.from("financial_news").select("*",{count:"exact",head:!0}).gte("fetched_at",y.toISOString()),{data:xe}=await h.from("financial_news").select("fetched_at").order("fetched_at",{ascending:!1}).limit(1),oa=["Welt","EM","USA","Japan","UK","Frankreich","Kanada","Deutschland","Schweiz","China","Taiwan","Indien","Korea","Brasilien"],{data:ca}=await h.from("ishares_roe_data").select("country, ticker, kgv, kgv_forward, kbv, data_date, updated_at, source").in("country",oa),oe=new Map;
11(ca||[]).forEach(c=>{if(c.country==="Welt"&&c.ticker!=="EUNL"||c.country==="EM"&&c.ticker!=="IS3N")return;const g=oe.get(c.country),X=c.data_date||c.updated_at,rn=g?g.data_date||g.updated_at:null;(!g||X&&rn&&new Date(X)>new Date(rn))&&oe.set(c.country,c)});const Te=oe.size,Ct=Array.from(oe.values()).filter(c=>c.kgv!=null).length,la=Array.from(oe.values()).filter(c=>c.kgv_forward!=null).length,ia=Array.from(oe.values()).filter(c=>c.kbv!=null).length,da=Array.from(oe.values()).filter(c=>c.data_date!=null).length,{data:te}=await h.from("ishares_roe_data").select("updated_at").order("updated_at",{ascending:!1}).limit(1),{count:Ne}=await h.from("msci_sector_data").select("*",{count:"exact",head:!0}),{data:ge}=await h.from("msci_sector_data").select("updated_at").order("updated_at",{ascending:!1}).limit(1),{count:Et}=await h.from("bond_etf_data").select("*",{count:"exact",head:!0}),{data:Ye}=await h.from("bond_etf_data").select("updated_at").order("updated_at",{ascending:!1}).limit(1),{data:He}=await h.from("app_settings").select("setting_value").eq("setting_key","nasdaq100_last_manual_update").maybeSingle(),{data:Ue}=await h.from("msci_companies").select("price_date").not("price_date","is",null).order("price_date",{ascending:!1}).limit(1),ua=(G==null?void 0:G.filter(c=>c.market_cap_value&&c.market_cap_value>0).length)||0,{count:Dt}=await h.from("msci_companies").select("*",{count:"exact",head:!0}).eq("country","USA"),{count:Mt}=await h.from("stock_indices_prices").select("*",{count:"exact",head:!0}),{data:ze}=await h.from("stock_indices_prices").select("updated_at").order("updated_at",{ascending:!1}).limit(1),{count:Rt}=await h.from("damodaran_posts").select("*",{count:"exact",head:!0}),{data:Fe}=await h.from("damodaran_posts").select("updated_at").order("updated_at",{ascending:!1}).limit(1),{count:At}=await h.from("imf_weo_projections").select("*",{count:"exact",head:!0}),{data:We}=await h.from("imf_weo_projections").select("updated_at").order("updated_at",{ascending:!1,nullsFirst:!1}).limit(1),{count:Pt}=await h.from("shiller_data_cache").select("*",{count:"exact",head:!0}),{data:Ve}=await h.from("shiller_data_cache").select("fetched_at").order("fetched_at",{ascending:!1}).limit(1),{data:Ze,error:Qr}=await h.rpc("get_cron_job_last_runs"),v={};Ze&&Array.isArray(Ze)&&Ze.forEach(c=>{v[c.jobname]=c.last_run});const H={index_prices:{success:Mt||0,total:Mt||0,lastRun:v["fetch-index-prices-every-minute"]||((Ut=ze==null?void 0:ze[0])==null?void 0:Ut.updated_at)||null},financial_news:{success:jt||0,total:vt||0,lastRun:v["fetch-financial-news-every-minute"]||((zt=xe==null?void 0:xe[0])==null?void 0:zt.fetched_at)||null},msci_companies:{success:ua,total:Nt,lastRun:v["msci-prices-every-minute"]||((Ft=Ue==null?void 0:Ue[0])==null?void 0:Ft.price_date)||null},msci_us_sync:{success:Dt||0,total:Dt||0,lastRun:v["sync-us-marketcap-every-5-min"]||St},yahoo_prices:{success:pt,total:xt,lastRun:v["yahoo-prices-hourly"]||gt},wikipedia_sp500:{success:V,total:V,lastRun:v["wikipedia-sp500-daily"]||ft},sec_shares:{success:wt+kt,total:yt,lastRun:v["sec-shares-update-daily"]||(pe==null?void 0:pe.completed_at)||Tt},daily_valuations:{success:(Te||0)+(Ne||0)+(Et||0),total:(Te||0)+(Ne||0)+(Et||0),lastRun:v["fetch-daily-valuations"]||((Wt=te==null?void 0:te[0])==null?void 0:Wt.updated_at)||((Vt=ge==null?void 0:ge[0])==null?void 0:Vt.updated_at)||((Zt=Ye==null?void 0:Ye[0])==null?void 0:Zt.updated_at)||null},eps_cache:{success:0,total:0,lastRun:v["update-eps-cache-daily"]||null},msci_international_mcap:{success:0,total:0,lastRun:v["update-international-mcap-daily"]||null},damodaran_posts:{success:Rt||0,total:Rt||0,lastRun:v["fetch-damodaran-posts-daily"]||((Gt=Fe==null?void 0:Fe[0])==null?void 0:Gt.updated_at)||null},imf_weo:{success:At||0,total:At||0,lastRun:v["check-imf-weo-updates"]||((qt=We==null?void 0:We[0])==null?void 0:qt.updated_at)||null},shiller_data:{success:Pt||0,total:Pt||0,lastRun:v["fetch-shiller-data-daily"]||((Xt=Ve==null?void 0:Ve[0])==null?void 0:Xt.fetched_at)||null},lt_pbv_daily:{success:0,total:0,lastRun:v["compute-lt-pbv-daily-job"]||null}},{data:L,count:Ot}=await h.from("cached_eps_data").select("ticker, fetch_status, data_source, last_updated",{count:"exact"}),It=(L==null?void 0:L.filter(c=>c.fetch_status==="success").length)||0,ha=(L==null?void 0:L.filter(c=>{var g,X;return((g=c.data_source)==null?void 0:g.includes("SEC"))||((X=c.data_source)==null?void 0:X.includes("EDGAR"))}).length)||0,ma=(L==null?void 0:L.filter(c=>{var g,X;return((g=c.data_source)==null?void 0:g.includes("Polygon"))||((X=c.data_source)==null?void 0:X.includes("pol
11ygon"))}).length)||0,fa=(L==null?void 0:L.filter(c=>{var g,X;return((g=c.data_source)==null?void 0:g.includes("Yahoo"))||((X=c.data_source)==null?void 0:X.includes("yahoo"))}).length)||0,Lt=(L==null?void 0:L.reduce((c,g)=>g.last_updated&&g.last_updated>c?g.last_updated:c,""))||null;H.eps_cache={success:It,total:Ot||0,lastRun:v["update-eps-dps-cache-daily"]||Lt};const{data:z}=await h.from("msci_companies").select("name, ticker, market_cap_yahoo, market_cap_yahoo_date, country").neq("country","USA").order("market_cap_yahoo",{ascending:!1,nullsFirst:!1}),pa=(z==null?void 0:z.length)||0,xa=(z==null?void 0:z.filter(c=>c.market_cap_yahoo&&c.market_cap_yahoo>0).length)||0;z!=null&&z.filter(c=>c.market_cap_yahoo_date&&c.market_cap_yahoo_date.split("T")[0]===u).length;const ga=(z==null?void 0:z.reduce((c,g)=>g.market_cap_yahoo_date&&g.market_cap_yahoo_date>c?g.market_cap_yahoo_date:c,""))||null;H.msci_international_mcap={success:xa,total:pa,lastRun:v["update-international-mcap-daily"]||ga};const{count:Bt}=await h.from("lt_pbv_regimes").select("id",{count:"exact",head:!0}),{data:_e}=await h.from("lt_pbv_model_runs").select("computed_at, rows_inserted").order("computed_at",{ascending:!1}).limit(1);H.lt_pbv_daily={success:(($t=_e==null?void 0:_e[0])==null?void 0:$t.rows_inserted)||Bt||0,total:Bt||0,lastRun:v["compute-lt-pbv-daily-job"]||((Kt=_e==null?void 0:_e[0])==null?void 0:Kt.computed_at)||null};const{count:_a}=await h.from("ki_project_stocks").select("ticker",{count:"exact",head:!0}),{count:ba}=await h.from("ki_project_stocks").select("ticker",{count:"exact",head:!0}).or("status.ilike.%5/5%,status.ilike.%3/3%"),{data:Ge}=await h.from("ki_project_stocks").select("updated_at").order("updated_at",{ascending:!1}).limit(1);H.ki_stocks={success:ba||0,total:_a||0,lastRun:v["update-ki-stocks-daily"]||((Qt=Ge==null?void 0:Ge[0])==null?void 0:Qt.updated_at)||null};const{data:qe}=await h.from("us_index_constituents").select("wiki_last_update").eq("in_nasdaq100",!0).order("wiki_last_update",{ascending:!1,nullsFirst:!1}).limit(1),{count:Yt}=await h.from("us_index_constituents").select("ticker",{count:"exact",head:!0}).eq("in_nasdaq100",!0);H.nasdaq100_update={success:Yt||0,total:Yt||0,lastRun:v["update-nasdaq100-weekly"]||((Jt=qe==null?void 0:qe[0])==null?void 0:Jt.wiki_last_update)||null},H.ishares_roe={success:Ct,total:Te,lastRun:v["fetch-ishares-roe-daily"]||((en=te==null?void 0:te[0])==null?void 0:en.updated_at)||null};const{data:ne}=await h.from("ishares_roe_data").select("country, kgv, updated_at").eq("source","msci"),wa=(ne==null?void 0:ne.length)||0,ka=(ne==null?void 0:ne.filter(c=>c.kgv!=null).length)||0,ya=(ne==null?void 0:ne.reduce((c,g)=>g.updated_at&&g.updated_at>c?g.updated_at:c,""))||null;H.msci_country_roe={success:ka,total:wa,lastRun:v["fetch-msci-country-roe-daily"]||ya},H.sector_roe={success:Ne||0,total:Ne||0,lastRun:v["fetch-sector-roe-daily"]||((tn=ge==null?void 0:ge[0])==null?void 0:tn.updated_at)||null};const{count:Ta}=await h.from("msci_companies").select("ticker",{count:"exact",head:!0}),{count:Na}=await h.from("msci_companies").select("ticker",{count:"exact",head:!0}).not("net_income_ttm","is",null);H.msci_ttm={success:Na||0,total:Ta||0,lastRun:v["fetch-msci-ttm-earnings-daily"]||null};const{data:ae}=await h.from("bond_etf_data").select("ai_yield_percent, updated_at"),Sa=(ae==null?void 0:ae.length)||0,va=(ae==null?void 0:ae.filter(c=>c.ai_yield_percent!=null).length)||0,ja=(ae==null?void 0:ae.reduce((c,g)=>g.updated_at&&g.updated_at>c?g.updated_at:c,""))||null;H.extract_bond={success:va,total:Sa,lastRun:v["extract-bond-data-daily"]||ja};const{count:Ca}=await h.from("us_index_constituents").select("ticker",{count:"exact",head:!0}),{count:Ea}=await h.from("us_index_constituents").select("ticker",{count:"exact",head:!0}).not("shares_outstanding","is",null);H.yahoo_shares={success:Ea||0,total:Ca||0,lastRun:v["yahoo-shares-daily"]||null};const{count:Da}=await h.from("landing_news_cache").select("*",{count:"exact",head:!0}),{data:be}=await h.from("landing_news_cache").select("fetched_at, language").order("fetched_at",{ascending:!1}).limit(2),Ma=(be==null?void 0:be.length)||0,Ra=(be==null?void 0:be.reduce((c,g)=>g.fetched_at&&g.fetched_at>c?g.fetched_at:c,""))||null;H.landing_news={success:Ma,total:Da||0,lastRun:v["refresh-landing-news-en"]||v["refresh-landing-news-de"]||Ra};const{data:Xe}=await h.from("ki_regimes_v2_runs").select("computed_at").order("computed_at",{ascending:!1}).limit(1),{count:Ht}=await h.from("ki_regimes_v2").select("id",{count:"exact",head:!0}),$e=Xe==null?void 0:Xe[0],Aa=($e==null?void 0:$e.computed_at)||null;return H.valuation_regime={success:Ht||0,total:Ht||0,lastRun:v["compute-valuation-models-daily"]||Aa},{wiki:{total:V,lastUpdate:ft},prices:{updatedToday:pt,total:xt,lastUpdate:gt},shares:{updatedToday:Kn,total:Qn,totalConstituents:yt,missing:Jn,missingTickers:ea,lastUpdate:Tt,secCount:wt,polygonCount:kt,lastSecLog:(pe==null?void 0:pe.completed_at)||null}
11,yahooMCap:{count:ta,missing:na,updatedToday:aa,lastUpdate:ra,lastLog:(Be==null?void 0:Be.completed_at)||null},msci:{updatedToday:sa,total:Nt,lastUpdate:St},news:{updatedToday:jt||0,total:vt||0,lastUpdate:(nn=xe==null?void 0:xe[0])==null?void 0:nn.fetched_at},isharesRoe:{total:Te,withPE:Ct,withFwPE:la,withPB:ia,withDate:da,lastUpdate:((an=te==null?void 0:te[0])==null?void 0:an.updated_at)||null},cronJobResults:H,constituentsBreakdown:{total:(_t||0)+(bt||0),sp500:_t||0,nasdaqOnly:bt||0,nasdaqOnlyTickers:$n,nasdaq100LastManualUpdate:(He==null?void 0:He.setting_value)||null},epsCache:{total:Ot||0,success:It,source1:ha,source2:ma,source3:fa,lastUpdate:Lt},msciIntlData:z||[]}},refetchOnWindowFocus:!0,staleTime:1e3*10,refetchInterval:1e3*30}),{data:F}=sn({queryKey:["archived-market-reports"],queryFn:async()=>{const{data:u,error:y}=await h.from("daily_market_reports").select("*").order("report_date",{ascending:!1}).limit(30);if(y)throw y;return u||[]}});i.useEffect(()=>{console.log("Setting up real-time subscriptions for data transparency...");const u=h.channel("constituents-changes").on("postgres_changes",{event:"*",schema:"public",table:"us_index_constituents"},V=>{console.log("us_index_constituents updated:",V.eventType),M()}).subscribe(),y=h.channel("msci-changes").on("postgres_changes",{event:"*",schema:"public",table:"msci_companies"},V=>{console.log("msci_companies updated:",V.eventType),M()}).subscribe(),E=h.channel("news-changes").on("postgres_changes",{event:"INSERT",schema:"public",table:"financial_news"},V=>{console.log("financial_news updated:",V.eventType),M()}).subscribe();return()=>{console.log("Cleaning up real-time subscriptions..."),h.removeChannel(u),h.removeChannel(y),h.removeChannel(E)}},[M]);const w=u=>{if(!u)return"Nie";const y=new Date(u);return rt(y,"Europe/Berlin","dd.MM.yyyy HH:mm",{locale:Qe})+" Uhr"};i.useEffect(()=>{j(),R(),U(),O()},[]);const j=async()=>{try{const{data:u,error:y}=await h.from("app_settings").select("setting_value").eq("setting_key","busmodel_enabled").single();if(y&&y.code!=="PGRST116")return;n((u==null?void 0:u.setting_value)==="true")}catch(u){console.error("Error checking BusModel status:",u)}},R=async()=>{try{const{data:u,error:y}=await h.from("app_settings").select("setting_value").eq("setting_key","blog_enabled").single();if(y&&y.code!=="PGRST116")return;r((u==null?void 0:u.setting_value)==="true")}catch(u){console.error("Error checking Blog status:",u)}},U=async()=>{try{const{data:u,error:y}=await h.from("app_settings").select("setting_value").eq("setting_key","charts_enabled").single();if(y&&y.code!=="PGRST116")return;o((u==null?void 0:u.setting_value)==="true")}catch(u){console.error("Error checking Charts status:",u)}},O=async()=>{try{const{data:u,error:y}=await h.from("app_settings").select("setting_value").eq("setting_key","stock_markets_tradingview").single();if(y&&y.code!=="PGRST116")return;d((u==null?void 0:u.setting_value)==="true")}catch(u){console.error("Error checking Stock Markets TradingView status:",u)}},A=async u=>{try{const{error:y}=await h.from("app_settings").upsert({setting_key:"charts_enabled",setting_value:u?"true":"admin_only",updated_by:_==null?void 0:_.id,updated_at:new Date().toISOString()},{onConflict:"setting_key"});if(y)throw y;o(u),$.success(u?"Charts-Seite für alle Nutzer aktiviert":"Charts-Seite nur für Admins sichtbar")}catch(y){console.error("Error toggling Charts:",y),$.error("Fehler beim Ändern des Status")}},Y=async u=>{try{const{error:y}=await h.from("app_settings").upsert({setting_key:"busmodel_enabled",setting_value:u.toString(),updated_by:_==null?void 0:_.id,updated_at:new Date().toISOString()},{onConflict:"setting_key"});if(y)throw y;n(u),$.success(u?"Business Model Seite aktiviert":"Business Model Seite deaktiviert")}catch(y){console.error("Error toggling BusModel:",y),$.error("Fehler beim Ändern des Status")}},J=async u=>{try{const{error:y}=await h.from("app_settings").upsert({setting_key:"stock_markets_tradingview",setting_value:u.toString(),updated_by:_==null?void 0:_.id,updated_at:new Date().toISOString()},{onConflict:"setting_key"});if(y)throw y;d(u),$.success(u?"TradingView Stock Markets aktiviert":"Eigene Stock Markets Tabelle aktiviert")}catch(y){console.error("Error toggling Stock Markets TradingView:",y),$.error("Fehler beim Ändern des Status")}};return e.jsx("div",{className:"min-h-screen bg-gradient-to-b from-background to-muted/20 p-8",children:e.jsxs("div",{className:"max-w-6xl mx-auto 
11space-y-8",children:[e.jsxs("div",{className:"text-center space-y-4",children:[e.jsx("h1",{className:"text-4xl font-bold",children:"Datentransparenz"}),e.jsx("div",{className:"flex flex-col sm:flex-row justify-center items-center gap-3",children:e.jsxs(Za,{children:[e.jsx(Ga,{asChild:!0,children:e.jsxs(ot,{variant:"outline",className:"flex items-center gap-2 bg-gradient-to-r from-green-50 to-emerald-50 dark:from-green-950/30 dark:to-emerald-950/30 border-green-300 dark:border-green-700 hover:border-green-400 dark:hover:border-green-600 text-green-800 dark:text-green-200",children:[e.jsx(qa,{className:"h-4 w-4"}),"Marktberichte Archiv"]})}),e.jsxs(Xa,{className:"max-w-4xl max-h-[80vh]",children:[e.jsx($a,{children:e.jsx(Ka,{children:"Archivierte Marktberichte"})}),e.jsx(ct,{className:"h-[60vh] pr-4",children:e.jsx("div",{className:"space-y-6",children:F&&F.length>0?F.map(u=>e.jsxs(ce,{className:"border-muted",children:[e.jsx(le,{className:"pb-2",children:e.jsxs(ie,{className:"text-lg flex items-center justify-between",children:[e.jsx("span",{children:new Date(u.report_date).toLocaleDateString("de-DE",{weekday:"long",year:"numeric",month:"long",day:"numeric"})}),e.jsxs(K,{variant:"outline",className:"text-xs",children:[rt(new Date(u.created_at),"Europe/Berlin","HH:mm",{locale:Qe})," Uhr"]})]})}),e.jsxs(de,{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-sm text-muted-foreground mb-1",children:"🇩🇪 Deutsch"}),e.jsx("div",{className:"text-sm whitespace-pre-wrap bg-muted/50 p-3 rounded-md prose prose-sm dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:Tn(u.summary_de)}})]}),e.jsxs("div",{children:[e.jsx("h4",{className:"font-semibold text-sm text-muted-foreground mb-1",children:"🇬🇧 English"}),e.jsx("div",{className:"text-sm whitespace-pre-wrap bg-muted/50 p-3 rounded-md prose prose-sm dark:prose-invert max-w-none",dangerouslySetInnerHTML:{__html:Tn(u.summary_en)}})]})]})]},u.id)):e.jsx("div",{className:"text-center py-8 text-muted-foreground",children:"Noch keine archivierten Berichte vorhanden."})})})]})]})})]}),e.jsxs(ce,{className:"bg-blue-50 dark:bg-blue-950/20 border-blue-200 dark:border-blue-900 mb-6",children:[e.jsxs(le,{children:[e.jsx(ie,{children:"Seitenfreischaltung"}),e.jsx(we,{children:"Zusätzliche Seiten für alle Nutzer freischalten"})]}),e.jsxs(de,{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{htmlFor:"busmodel-toggle",className:"text-base",children:"Business Model Seite"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Schaltet die Business Model Seite mit Sankey-Diagrammen für alle Nutzer frei"})]}),e.jsx(Ce,{id:"busmodel-toggle",checked:t,onCheckedChange:Y})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{htmlFor:"charts-toggle",className:"text-base",children:"Charts-Seite"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Zeigt die Charts-Seite für alle Nutzer (Standard: nur Admins)"})]}),e.jsx(Ce,{id:"charts-toggle",checked:s,onCheckedChange:A})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"space-y-0.5",children:[e.jsx(Ke,{htmlFor:"stockmarkets-toggle",className:"text-base",children:"Stock Markets TradingView"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Verwendet TradingView Widget statt eigener Tabelle auf News-Seite"})]}),e.jsx(Ce,{id:"stockmarkets-toggle",checked:l,onCheckedChange:J})]})]})]}),e.jsxs(ce,{className:"bg-green-50 dark:bg-green-950/20 border-green-200 dark:border-green-900",children:[e.jsxs(le,{children:[e.jsxs(ie,{className:"flex items-center gap-2",children:[e.jsx(tr,{className:"h-5 w-5 text-green-600 dark:text-green-400"}),"Automatisierte Cron-Jobs"]}),e.jsxs(we,{children:["Diese Jobs laufen automatisch im Hintergrund und aktualisieren die Daten. Uhrzeit derzeit: ",m," Uhr"]})]}),e.jsxs(de,{children:[e.jsxs(Se,{children:[e.jsx(ve,{children:e.jsxs(D,{children:[e.jsx(P,{className:"w-10",children:"#"}),e.jsx(P,{children:"Job-Name"}),e.jsx(P,{children:"Beschreibung"}),e.jsx(P,{children:"Zeitplan (MEZ)"}),e.jsx(P,{children:"Ergebnis"}),e.jsx(P,{children:"Zuletzt gelaufen"})]})}),e.jsx(je,{children:yn.map((u,y)=>{var V;const E=u.resultQuery&&((V=T==null?void 0:T.cronJobResults)==null?void 0:V[u.resultQuery]);return e.jsxs(D,{children:[e.jsx(f,{className:"text-xs text-muted-foreground",children:y+1}),e.jsx(f,{className:"font-mono text-xs",children:u.name}),e.jsx(f,{className:"text-sm",children:u.description}),e.jsx(f,{children:e.jsxs("div",{className:"flex flex-col",children:[e.jsx("span",{className:"text-sm font-medium",children:u.scheduleReadable}),e.jsx("span",{className:"text-xs text-muted-foreground font-mono",children:u.schedule})]})}
11),e.jsx(f,{children:E?e.jsxs(K,{variant:E.success===E.total?"default":"outline",className:E.success===E.total?"bg-green-600 text-white":E.success>0?"bg-yellow-100 text-yellow-800 dark:bg-yellow-900/30 dark:text-yellow-300":"bg-red-100 text-red-800 dark:bg-red-900/30 dark:text-red-300",children:[E.success,"/",E.total]}):e.jsx("span",{className:"text-xs text-muted-foreground",children:"-"})}),e.jsx(f,{className:"text-xs text-muted-foreground",children:E!=null&&E.lastRun?w(E.lastRun):"-"})]},u.name)})})]}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-4",children:["Insgesamt ",yn.length," aktive Cron-Jobs • Zeiten in MEZ (Mitteleuropäische Zeit)"]}),(T==null?void 0:T.constituentsBreakdown)&&e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-xs text-muted-foreground mt-2",children:["Die ",T.constituentsBreakdown.total," Werte entsprechen ",T.constituentsBreakdown.sp500," S&P 500 Werten plus ",T.constituentsBreakdown.nasdaqOnly," zusätzlichen Nasdaq 100 Werten."]}),T.constituentsBreakdown.nasdaqOnlyTickers&&T.constituentsBreakdown.nasdaqOnlyTickers.length>0&&e.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["Nasdaq 100 Werte nicht im S&P 500: ",T.constituentsBreakdown.nasdaqOnlyTickers.join(", ")]})]})]})]}),e.jsxs(ce,{className:"bg-purple-50 dark:bg-purple-950/20 border-purple-200 dark:border-purple-900",children:[e.jsxs(le,{children:[e.jsxs(ie,{className:"flex items-center gap-2",children:[e.jsx(on,{className:"h-5 w-5 text-purple-600 dark:text-purple-400"}),"API Rate Limits"]}),e.jsx(we,{children:"Verfügbare Abfragen pro API-Provider"})]}),e.jsxs(de,{children:[e.jsxs(Se,{children:[e.jsx(ve,{children:e.jsxs(D,{children:[e.jsx(P,{children:"API Provider"}),e.jsx(P,{children:"Free Tier Limit"}),e.jsx(P,{children:"Verwendung"}),e.jsx(P,{children:"Hinweis"})]})}),e.jsxs(je,{children:[e.jsxs(D,{children:[e.jsx(f,{className:"font-medium",children:"Kurs-API"}),e.jsx(f,{children:e.jsx(K,{variant:"outline",children:"Unbegrenzt*"})}),e.jsx(f,{className:"text-sm text-muted-foreground",children:"Aktienkurse"}),e.jsx(f,{className:"text-xs text-muted-foreground",children:"*Inoffiziell, kein API Key"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-medium",children:"Filings-API"}),e.jsx(f,{children:e.jsx(K,{className:"!bg-green-600 text-white border-transparent",children:"10 calls/sec"})}),e.jsx(f,{className:"text-sm text-muted-foreground",children:"Shares Outstanding"}),e.jsx(f,{className:"text-xs text-muted-foreground",children:"Öffentliche Datenbank"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-medium",children:"Fallback-API 1"}),e.jsx(f,{children:e.jsx(K,{className:"!bg-green-600 text-white border-transparent",children:"5 calls/min"})}),e.jsx(f,{className:"text-sm text-muted-foreground",children:"Shares Outstanding (Fallback)"}),e.jsx(f,{className:"text-xs text-muted-foreground",children:"Gedrosselt bei hohem Volumen"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-medium",children:"Fallback-API 2"}),e.jsx(f,{children:e.jsx(K,{className:"!bg-green-600 text-white border-transparent",children:"60 calls/min"})}),e.jsx(f,{className:"text-sm text-muted-foreground",children:"Market Cap (Fallback)"}),e.jsx(f,{className:"text-xs text-muted-foreground",children:"Free Tier"})]})]})]}),e.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400 mt-3",children:"⚠️ Fallback-API 1: Max 5 Abfragen/Minute - bei mehr Tickern wird gedrosselt!"})]})]}),e.jsxs(ce,{className:"bg-teal-50 dark:bg-teal-950/20 border-teal-200 dark:border-teal-900",children:[e.jsxs(le,{children:[e.jsxs(ie,{className:"flex items-center gap-2",children:[e.jsx(on,{className:"h-5 w-5 text-teal-600 dark:text-teal-400"}),"International Market Cap Data"]}),e.jsx(we,{children:"Abgerufene Market Caps für internationale Aktien (nicht-USA)"})]}),e.jsxs(de,{children:[e.jsx(ct,{className:"h-[400px]",children:e.jsxs(Se,{children:[e.jsx(ve,{children:e.jsxs(D,{children:[e.jsx(P,{children:"Name"}),e.jsx(P,{children:"Ticker"}),e.jsx(P,{className:"text-right",children:"MCAP (in bn USD)"}),e.jsx(P,{children:"Abgerufen"})]})}),e.jsx(je,{children:(N=T==null?void 0:T.msciIntlData)==null?void 0:N.map(u=>{const y=new Date().toISOString().split("T")[0],E=u.market_cap_yahoo_date&&u.market_cap_yahoo_date.split("T")[0]!==y;return e.jsxs(D,{children:[e.jsxs(f,{className:"font-medium",children:[u.name,E&&e.jsx("span",{className:"text-red-500 ml-1",title:"Daten nicht von heute",children:"!"})]}),e.jsx(f,{className:"font-mono text-xs",children:u.ticker}),e.jsx(f,{className:"text-right",children:u.market_cap_yahoo?(u.market_cap_yahoo/1e9).toFixed(1):e.jsx("span",{className:"text-muted-foreground",children:"-"})}),e.jsx(f,{className:"text-xs text-muted-foreground",children:u.market_cap_yahoo_date?w(u.market_cap_yahoo_date):"-"})]},u.ticker)})})]})}),e.jsxs("p",{className:"text-xs text-muted-foreground mt-3",children:[((C=(S=T==null?void 0:T.cronJobResults)==null?void 0:S.msci_international_mcap)==null?void 0:C.success)||0," von ",((me=(W=T==null?void 0:T.cronJobResults)==null?void 0:W.msci_international_mcap)==null?void 0:me.total)||0," internationalen Aktien mit Market Cap Daten"]})]})]}),e.jsxs(ce,{className:"bg-red-50 dark:bg-red-950/20 border-red-200 dark:border-red-900",children:[e.jsxs(le,{children:[e.jsxs(ie,{className:"flex items-center gap-2",children:[e.jsx(Ja,{className:"h-5 w-5 text-red-600 dark:text-red-400"}),e.jsx("span",{className:"text-red-700 dark:text-red-300 font-bold",children:"Hardcoded Daten"})]}),e.jsx(we,{className:"text-red-600 dark:text-red-400",children:"Manuell eingetragene Werte, die nicht automatisch aktualisiert werden"})]}),e.jsxs(de,{children:[e.jsxs(Se,{children:[e.jsx(ve,{children:e.jsxs(D,{children:[e.jsx(P,{className:"text-red-700 dark:text-red-300 font-bold",children:"Datenpunkt"}),e.jsx(P,{className:"text-red-700 dark:text-red-300 font-bold",children:"Wert"}),e.jsx(P,{className:"text-red-700 dark:text-red-300 font-bold",children:"Verwendet auf"})]})}),e.jsxs(je,{children:[e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"US 3M Treasury (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"3.634%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"US 10Y Treasury (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"4.153%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"US 30Y Treasury (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"4.830%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"Germany 2Y Bund (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"2.123%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"Germany 10Y Bund (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"2.8623%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"Germany 30Y Bund (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"3.480%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"Switzerland 10Y (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"0.282%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"France 10Y OAT (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"3.560%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"Italy 10Y BTP (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"3.512%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"Japan 10Y JGB (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"2.079%"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Bonds → YTD"})]}),e.jsxs(D,{children:[e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400",children:"Nickel LME (31.12.2025)"}),e.jsx(f,{className:"font-bold text-red-600 dark:text-red-400 font-mono",children:"$15,150"}),e.jsx(f,{className:"text-sm text-red-600 dark:text-red-400",children:"News → Commodities → YTD"})]})]})]}),e.jsx("p",{className:"text-xs text-red-600 dark:text-red-400 mt-4 font-semibold",children:"⚠️ Diese Werte müssen jährlich zum Jahreswechsel manuell aktualisiert werden!"}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"Grund: Für europäische/japanische Anleihen und Nickel LME sind keine zuverlässigen API-Daten verfügbar."})]})]}),e.jsx(Kr,{})]})})}export{rs as default};

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.