PageSourceSearch

https://www.quant-soc.com/_next/static/chunks/app/(platform)/blog/…?dpl=dpl_6p7LDDNYmQPPdtq1Te1P1fe5csVx

js quant-soc.com collected 2026-10-09 22:31:07 UTC 98,333 bytes, 1 lines download raw bytes

1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b52d7059-f736-4ad8-944c-3c1a73a3a291",e._sentryDebugIdIdentifier="sentry-dbid-b52d7059-f736-4ad8-944c-3c1a73a3a291")}catch(e){}}(),(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[518,8686],{4014:(e,t,a)=>{"use strict";a.d(t,{M:()=>d});var n=a(95155),i=a(12115),r=a(47522),o=a(26195),s=a(71408),l=a(61527),c=a(25016);function d(e){let{text:t,disabled:a=!1,copyLabel:d="Copy",copiedLabel:u="Copied",className:h,surfaceClassName:m,onCopy:g,onCopied:p,onCopyFailed:f}=e,[y,v]=(0,i.useState)(!1),b=!a&&(!!g||!!t);(0,i.useEffect)(()=>{if(!y)return;let e=window.setTimeout(()=>v(!1),2e3);return()=>window.clearTimeout(e)},[y]);let w=async()=>{if(!b){null==f||f();return}try{if(g)await g();else if(t)await navigator.clipboard.writeText(t);else{null==f||f();return}v(!0),null==p||p()}catch(e){v(!1),null==f||f()}};return(0,n.jsx)("button",{type:"button",onClick:()=>void w(),disabled:!b,className:(0,c.cn)("inline-flex h-8 w-8 shrink-0 cursor-pointer items-center justify-center rounded-lg text-muted-foreground shadow-elevation-1 transition-colors duration-200",m,"hover:brightness-95 disabled:cursor-not-allowed disabled:opacity-40 dark:hover:brightness-110","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",h),"aria-label":y?u:d,title:y?u:d,children:(0,n.jsx)(s.N,{mode:"wait",initial:!1,children:y?(0,n.jsx)(l.P.span,{initial:{opacity:0,scale:.75,rotate:-20},animate:{opacity:1,scale:1,rotate:0},exit:{opacity:0,scale:.75,rotate:20},transition:{duration:.16},className:"text-success-text",children:(0,n.jsx)(r.A,{className:"h-4 w-4",stroke:2})},"check"):(0,n.jsx)(l.P.span,{initial:{opacity:0,scale:.75},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.75},transition:{duration:.16},children:(0,n.jsx)(o.A,{className:"h-4 w-4",stroke:2})},"copy")})})}},12554:(e,t,a)=>{"use strict";a.d(t,{l:()=>s});var n=a(95155),i=a(12115),r=a(15239),o=a(2821);let s=e=>{let{height:t,width:a,src:s="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300'%3E%3Crect width='400' height='300' fill='%23e5e5e5'/%3E%3C/svg%3E",className:l,objectFit:c,alt:d,layout:u,...h}=e,[m,g]=(0,i.useState)(!0),p="fill"!==u&&!0!==h.fill&&null==a&&null==t;return(0,n.jsx)(r.default,{className:(0,o.A)("transition duration-300 transform",m?"blur-sm scale-105":"blur-0 scale-100",l),onLoad:()=>g(!1),src:s,width:p?400:a,height:p?300:t,loading:"lazy",decoding:"async",placeholder:"string"==typeof s?"empty":"blur",quality:100,layout:u,alt:d||"Image",style:c?{objectFit:c}:void 0,...h})}},16633:(e,t,a)=>{"use strict";a.r(t),a.d(t,{LinkPreview:()=>m,default:()=>g});var n=a(95155),i=a(21270),r=a(38591),o=a(12115),s=a(53350),l=a(53615),c=a(71408),d=a(61527),u=a(15239),h=a(25016);let m=e=>{let{children:t,url:a,className:m,width:g=200,height:p=125,quality:f=50,layout:y="fixed",isStatic:v=!1,imageSrc:b="",asChild:w=!0,allowLocal:x=!1,previewClassName:k}=e,[j,P]=o.useState(a),[T,S]=o.useState(void 0),[C,N]=o.useState(!1);o.useEffect(()=>N(!1),[T]),o.useEffect(()=>{try{let e=/^https?:\/\//.test(a)?a:new URL(a,window.location.origin).href;P(e);let t=new URL(e).hostname,n="localhost"===t||"127.0.0.1"===t||t.endsWith(".local")||/^10\./.test(t)||/^192\.168\./.test(t)||/^(172\.(1[6-9]|2[0-9]|3[0-1])\.)/.test(t);if(v)S(b);else if(!n||x){let t=(0,r.l)({url:e,screenshot:!0,meta:!1,embed:"screenshot.url",colorScheme:"dark","viewport.isMobile":!0,"viewport.deviceScaleFactor":1,"viewport.width":3*g,"viewport.height":3*p});S("https://api.microlink.io/?".concat(t))}else S(void 0)}catch(e){P(a),S(v?b:void 0)}},[a,v,b,g,p,x]);let[M,A]=o.useState(!1),[L,R]=o.useState(!1);o.useEffect(()=>{R(!0)},[]);let I=(0,s.d)(0);return(0,l.z)(I,{stiffness:70,damping:22}),(0,n.jsxs)(n.Fragment,{children:[L&&T&&!C?(0,n.jsx)("span",{"aria-hidden":"true",className:"hidden",children:(0,n.jsx)(u.default,{src:T,width:g,height:p,alt:"",onError:()=>N(!0)})}):null,(0,n.jsxs)(i.bL,{openDelay:50,closeDelay:100,onOpenChange:e=>A(e),children:[(0,n.jsx)(i.l9,{asChild:!0,onMouseMove:e=>{let t=e.target.getBoundingClientRect(),a=(e.clientX-t.left-t.width/2)/2;I.set(a)},children:(()=>
1{if(o.isValidElement(t)&&"string"==typeof t.type&&"a"===t.type.toLowerCase()){var e,a,i,r,s;return o.cloneElement(t,{href:new URL(j,window.location.origin).toString(),target:null!=(r=null==(e=t.props)?void 0:e.target)?r:"_blank",rel:null!=(s=null==(a=t.props)?void 0:a.rel)?s:"noopener noreferrer",className:(0,h.cn)("text-foreground",m,null==(i=t.props)?void 0:i.className)})}return(0,n.jsx)("a",{href:j,className:(0,h.cn)("text-foreground",m),target:"_blank",rel:"noopener noreferrer",children:t})})()}),T&&!C&&(0,n.jsx)(i.ZL,{children:(0,n.jsx)(i.UC,{className:"z-[80] [transform-origin:var(--radix-hover-card-content-transform-origin)]",side:"top",align:"center",sideOffset:10,collisionPadding:8,children:(0,n.jsx)(c.N,{children:M&&(0,n.jsx)(d.P.div,{initial:{opacity:0,y:14,scale:.9},animate:{opacity:1,y:0,scale:1,transition:{type:"spring",stiffness:180,damping:26}},exit:{opacity:0,y:14,scale:.9},className:(0,h.cn)("shadow-elevation-3 rounded-xl transform",k),children:(0,n.jsx)("a",{href:j,className:"block p-1 bg-background border-2 border-transparent shadow-elevation-1 rounded-xl hover:border-border text-xs",target:"_blank",rel:"noopener noreferrer",children:(0,n.jsx)(u.default,{src:v?b:T,width:g,height:p,className:"rounded-lg",alt:"preview image",onError:()=>N(!0)})})})})})})]})]})},g=m},27078:(e,t,a)=>{"use strict";a.d(t,{Z:()=>k});var n=a(95155);a(12115);var i=a(52619),r=a.n(i),o=a(61527),s=a(76974),l=a(44591),c=a(69365),d=a(12554),u=a(71968),h=a(94667),m=a(33359),g=a(25016),p=a(23714),f=a(53434),y=a(87505),v=a(50262);let b={rest:{opacity:0},hover:{opacity:1,transition:{type:"spring",stiffness:260,damping:30,staggerChildren:.08,delayChildren:.05}}},w={rest:{opacity:0,y:18},hover:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}}},x={rest:{},hover:{}},k=e=>{let{blog:t,variant:a="default",inCarousel:i=!1}=e;return"featured"===a?(0,n.jsx)(P,{blog:t,inCarousel:i}):(0,n.jsx)(j,{blog:t})};function j(e){var t;let{blog:a}=e,i=(0,p.z)(),o="".concat(i.blogLink,"/").concat(a.slug);return(0,n.jsx)(r(),{href:o,className:"block h-full",children:(0,n.jsxs)(u.Zp,{className:"flex h-full w-full flex-col overflow-hidden transition-transform duration-200 hover:scale-[1.02]",children:[a.image?(0,n.jsx)("div",{className:"relative min-h-[13rem] flex-1",children:(0,n.jsx)(d.l,{src:a.image,alt:"Cover image for ".concat(a.title),fill:!0,sizes:"(min-width: 1024px) 33vw, (min-width: 768px) 50vw, 100vw",className:"object-cover object-top"})}):(0,n.jsx)("div",{className:"flex min-h-[13rem] flex-1 items-center justify-center",children:(0,n.jsx)(v.L
1ogo,{asLink:!1})}),(0,n.jsxs)("div",{className:"shrink-0 p-4 md:p-8",children:[(0,n.jsx)(y.AuthorsInline,{authors:a.authors,nameDisplay:"all",ringClassName:"ring-1 ring-background",className:"mb-4",readingTime:null==(t=a.readingTime)?void 0:t.text}),(0,n.jsx)("h3",{className:"mb-3 text-2xl font-bold tracking-tight text-foreground",children:(0,n.jsx)(s.Ay,{children:a.title})}),(0,n.jsx)("p",{className:"text-sm text-muted-foreground line-clamp-3",children:a.description})]})]})})}function P(e){var t;let{blog:a,inCarousel:i=!1}=e,k=(0,p.z)(),j="".concat(k.blogLink,"/").concat(a.slug),P=(0,m.r)({enableSwipeReveal:!i}),T=(0,n.jsxs)(o.P.div,{"data-slot":"card","data-revealed":P.isActive?"true":void 0,variants:x,initial:"rest",animate:P.motionAnimate,whileHover:P.motionWhileHover,onClick:P.hasFinePointer?void 0:P.toggleReveal,onTouchStart:i?void 0:P.onTouchStart,onTouchMove:i?void 0:P.onTouchMove,onTouchEnd:i?void 0:P.onTouchEnd,onTouchCancel:i?void 0:P.onTouchCancel,className:(0,g.cn)("group/project relative block overflow-hidden text-left",!P.hasFinePointer&&"cursor-pointer"),children:[(0,n.jsxs)("div",{className:"relative aspect-[3/2] min-h-[280px] w-full md:aspect-auto md:min-h-[360px]",children:[a.image?(0,n.jsx)(d.l,{src:a.image,alt:"Cover image for ".concat(a.title),fill:!0,sizes:"(min-width: 1024px) 68vw, 100vw",className:"object-cover object-center"}):(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-muted",children:(0,n.jsx)(v.L
1ogo,{asLink:!1})}),(0,n.jsx)(h.j,{}),(0,n.jsx)("div",{className:"pointer-events-none absolute inset-x-0 bottom-0 z-20 p-4 md:p-8",children:(0,n.jsx)(c.E,{as:"h3",size:"2xl",weight:"bold",className:"text-on-media max-w-[min(100%,28rem)] tracking-tight",children:(0,n.jsx)(s.Ay,{children:a.title})})})]}),(0,n.jsxs)(o.P.div,{variants:b,className:(0,g.cn)("absolute inset-0 z-20 flex flex-col justify-between p-6 backdrop-blur-md md:p-8","bg-white/55 text-foreground dark:bg-black/50 dark:text-white"),children:[(0,n.jsxs)(o.P.div,{variants:w,className:"space-y-4",children:[(0,n.jsx)(y.AuthorsInline,{authors:a.authors,nameDisplay:"all",ringClassName:"ring-1 ring-background",namesClassName:"text-sm font-medium text-foreground/90 dark:text-white/90",readingTime:null==(t=a.readingTime)?void 0:t.text}),(0,n.jsx)(c.E,{as:"h3",size:"2xl",weight:"bold",className:"tracking-tight text-foreground dark:text-white md:text-3xl",children:(0,n.jsx)(s.Ay,{children:a.title})}),(0,n.jsx)("p",{className:"text-base font-medium text-foreground/80 dark:text-white/80",children:a.description})]}),(0,n.jsx)(o.P.div,{variants:w,children:(0,n.jsx)(l.C,{as:"span",variant:"ghost",size:"auto",parentGroup:"project",className:"pointer-events-none border-0 bg-transparent p-0 text-inherit shadow-none hover:bg-transparent group-data-[revealed=true]/project:[margin-left:calc((var(--unit)-var(--jog))/-2)]",children:f.G.blog.readCta})})]}),!P.hasFinePointer&&P.revealed&&(0,n.jsx)(r(),{href:j,"aria-label":a.title,className:"absolute inset-0 z-30",onClick:e=>e.stopPropagation()})]}),S=(0,n.jsx)(u.Zp,{className:"w-full overflow-hidden",children:T});return P.hasFinePointer?(0,n.jsx)(r(),{href:j,className:"block",children:S}):(0,n.jsx)("div",{ref:P.containerRef,className:"block",children:S})}},30893:(e,t,a)=>{"use strict";a.d(t,{y:()=>m});var n=a(95155),i=a(12115),r=a(61527),o=a(41407),s=a(65229),l=a(25016);function c(e){let{filterId:t,blur:a}=e;return(0,n.jsx)("svg",{className:"absolute hidden h-0 w-0","aria-hidden":!0,children:(0,n.jsx)("defs",{children:(0,n.jsxs)("filter",{id:t,x:"-50%",y:"-50%",width:"200%",height:"200%",children:[(0,n.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:a,result:"blur"}),(0,n.jsx)("feColorMatrix",{in:"blur",type:"matrix",values:"1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 20 -10",result:"goo"}),(0,n.jsx)("feComposite",{in:"SourceGraphic",in2:"goo",operator:"atop"})]})})})}function d(e){let{layoutId:t}=e;return(0,n.jsxs)(r.P.svg,{layoutId:t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,className:"size-4 shrink-0",children:[(0,n.jsx)("circle",{cx:"11",cy:"11",r:"8"}),(0,n.jsx)("path",{d:"m21 21-4.3-4.3"})]})}let u={duration:.4,type:"spring",bounce:.25},h={collapsed:{scale:0,opacity:0},expanded:{scale:1,opacity:1}};function m(e){let{placeholder:t="Type to search...",className:a,classNames:m,collapsedWidth:g=115,expandedWidth:p=200,fitToPlaceholder:f=!1,defaultExpanded:y=!1,expandedOffset:v=52,gooeyBlur:b=5,value:w,defaultValue:x="",onValueChange:k,onOpenChange:j,onClear:P,onSubmit:T,icon:S,clearLabel:C="Clear",disabled:N=!1}=e,M=(0,i.useId)().replace(/:/g,""),A="gooey-filter-".concat(M),L="gooey-input-icon-".concat(M),R="gooey-input-field-".concat(M),I=(0,i.useRef)(null),E=(0,i.useRef)(null),z=(0,i.useRef)(y),W=(0,i.useRef)(!1),[F,B]=(0,i.useState)(y),[q,G]=(0,i.useState)(x),[_,D]=(0,i.useState)(!1),[H,Y]=(0,i.useState)(null),[O,Q]=(0,i.useState)(!1),[U,V]=(0,i.useState)(!1),[K,Z]=(0,i.useState)(!1),J=(0,o.I)(),X=void 0!==w,$=X?w:q,ee=(0,i.useCallback)(e=>{X||G(e),null==k||k(e)},[X,k]),et=(0,i.useCallback)(e=>{B(e),null==j||j(e)},[j]);(0,i.useEffect)(()=>{if(F){if(W.current){var e;W.current=!1,null==(e=I.current)||e.focus()}}else z.current&&ee("");z.current=F},[F,ee]),(0,i.useLayoutEffect)(()=>{if(!f)return;let e=()=>{let e=E.current;e&&Y(Math.ceil(e.getBoundingClientRect().width))};e();let t=!1;return"undefined"!=typeof document&&"fonts"in document&&document.fonts.ready.then(()=>{t||e()}),()=>{t=!0}},[f,t]);let ea=f&&null!==H?H+58:g,en=f&&null!==H?H+60:p,ei=(0,i.useMemo)(()=>({collapsed:{width:ea,marginLeft:0},expanded:{width:en,marginLeft:v}}),[ea,en,v]),er=(0,i.useCallback)(()=>{let e=I.current;if(!e)return;let t=e.scrollWidth-e.clientWidth;V(e.scrollLeft>1),Z(e.scrollLeft<t-1)},[]);(0,i.useEffect)(()=>{let e=I.current;if(!e||!F)return void Q(!1);let t=()=>{Q(e.scrollWidth-e.clientWidth>1),er()},a=new ResizeObserver(t);return a.observe(e),t(),()=>a.disconnect()},[F,$,en,er]);let eo=O&&F&&!_&&!J&&!N;(0,i.useEffect)(()=>
1{if(!eo)return;let e=I.current;if(!e)return;let t=0,a=null,n=i=>{let r=e.scrollWidth-e.clientWidth;if(r>1){null===a&&(a=i);let t=r/28*1e3,n=(i-a)%(2*(t+1100));e.scrollLeft=n<1100?0:n<1100+t?(n-1100)/t*r:n<2200+t?r:r-(n-2200-t)/t*r,er()}t=requestAnimationFrame(n)};return t=requestAnimationFrame(n),()=>{cancelAnimationFrame(t),document.activeElement!==e&&(e.scrollLeft=0)}},[eo,er]);let es=(0,i.useCallback)(()=>{N||(W.current=!0,et(!0))},[N,et]),el=(0,i.useCallback)(e=>{ee(e.target.value)},[ee]),ec=(0,i.useCallback)(()=>{D(!0)},[]),ed=(0,i.useCallback)(()=>{D(!1),$||et(!1)},[$,et]),eu=(0,i.useCallback)(e=>{"Enter"===e.key&&(null==T||T($))},[T,$]),eh=(0,i.useCallback)(e=>{var t;e.preventDefault(),e.stopPropagation(),ee(""),null==P||P(),null==(t=I.current)||t.focus()},[P,ee]),em="bg-foreground text-background shadow-elevation-1 ring-1 ring-border/60",eg=O?"linear-gradient(to right, transparent 0, black ".concat(14*!!U,"px, black calc(100% - ").concat(14*!!K,"px), transparent 100%)"):void 0,ep=e=>void 0!==S?(0,n.jsx)(r.P.span,{layoutId:e,className:"flex size-4 shrink-0 items-center justify-center",children:S}):(0,n.jsx)(d,{layoutId:e});return(0,n.jsxs)("div",{className:(0,l.cn)("relative flex items-center justify-center",a,null==m?void 0:m.root),children:[(0,n.jsx)(c,{filterId:A,blur:b}),f?(0,n.jsx)("span",{ref:E,"aria-hidden":!0,className:"pointer-events-none invisible absolute left-0 top-0 -z-10 whitespace-pre text-sm font-medium",children:t}):null,(0,n.jsxs)("div",{className:(0,l.cn)("relative flex h-10 items-center justify-center",null==m?void 0:m.filterWrap),style:{filter:"url(#".concat(A,")")},children:[(0,n.jsx)(r.P.div,{className:(0,l.cn)("flex h-10 items-center justify-center",null==m?void 0:m.buttonRow),variants:ei,initial:"collapsed",animate:F?"expanded":"collapsed",transition:u,children:(0,n.jsxs)("div",{role:"button",tabIndex:N?-1:0,"aria-disabled":N||void 0,onClick:N?void 0:es,onKeyDown:e=>{N||e.target===e.currentTarget&&("Enter"===e.key||" "===e.key)&&(e.preventDefault(),es())},className:(0,l.cn)("flex h-10 w-full cursor-pointer items-center justify-center gap-1 rounded-full px-4 text-sm font-medium outline-none transition-[color,box-shadow] focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",N&&"pointer-events-none opacity-50",F?"pl-4 pr-1":"px-4",em,null==m?void 0:m.trigger),children:[F?null:(0,n.jsxs)("span",{className:"flex items-center gap-1.5",children:[ep(L),(0,n.jsx)("span",{className:"whitespace-nowrap",children:t})]}),(0,n.jsx)(r.P.input,{layoutId:R,ref:I,type:"search",enterKeyHint:"search",autoComplete:"off",value:$,onChange:el,onKeyDown:eu,onFocus:ec,onBlur:ed,onScroll:er,style:{WebkitMaskImage:eg,maskImage:eg},disabled:N||!F,placeholder:F?t:"",className:(0,l.cn)("h-full min-w-0 bg-transparent text-sm text-background outline-none","[&::-webkit-search-cancel-button]:hidden [&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:hidden",F?"flex-1 placeholder:text-background/50 dark:placeholder:text-background/45":"w-0 flex-none pointer-events-none opacity-0",null==m?void 0:m.input)}),F?(0,n.jsx)("button",{type:"button","aria-label":C,onMouseDown:e=>e.preventDefault(),onClick:eh,className:"flex size-8 shrink-0 items-center justify-center rounded-full text-background/75 transition-colors hover:text-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-background/40",children:(0,n.jsx)(s.A,{className:"size-[18px]",strokeWidth:2.25})}):null]})}),(0,n.jsx)("div",{className:(0,l.cn)("pointer-events-none absolute inset-y-0 left-0 flex items-center",null==m?void 0:m.bubble),children:(0,n.jsx)(r.P.div,{className:(0,l.cn)("flex size-10 items-center justify-center rounded-full",em,null==m?void 0:m.bubbleSurface),variants:h,initial:"collapsed",animate:F?"expanded":"collapsed",transition:u,children:ep("".concat(L,"-bubble"))})})]})]})}},33359:(e,t,a)=>{"use strict";a.d(t,{r:()=>r});var n=a(12115),i=a(45250);function r(e){var t;let a=null==(t=null==e?void 0:e.enableSwipeReveal)||t,r=function(){let[e,t]=(0,n.use
1State)(!0);return(0,n.useEffect)(()=>{if(!window.matchMedia)return;let e=window.matchMedia("(hover: hover) and (pointer: fine)"),a=()=>t(e.matches);return a(),e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[]),e}(),[o,s]=(0,n.useState)(!1),[l,c]=(0,n.useState)(!1),d=(0,n.useRef)(null),u=(0,n.useRef)(null),h=(0,n.useRef)({x:0,y:0}),m=(0,n.useRef)("none"),g=(0,n.useRef)(!1),p=(0,n.useCallback)(()=>{u.current=null,h.current={x:0,y:0},m.current="none",c(!1)},[]),f=(0,n.useCallback)(()=>{if(!r){if(g.current){g.current=!1;return}s(e=>!e)}},[r]),y=(0,n.useCallback)(()=>{s(!1),p()},[p]);(0,i.j)(d,()=>{(o||l)&&y()});let v=(0,n.useCallback)(e=>{if(r)return;let t=e.touches[0];t&&(u.current={x:t.clientX,y:t.clientY},h.current={x:0,y:0},m.current="none",g.current=!1,c(!1))},[r]),b=(0,n.useCallback)(e=>{if(r||!u.current)return;let t=e.touches[0];if(!t)return;let a=t.clientX-u.current.x,n=t.clientY-u.current.y;h.current={x:a,y:n};let i=Math.abs(a),o=Math.abs(n),s=Math.hypot(a,n);if(o>48&&o>1.75*i){m.current="scroll",c(!1);return}s>=10&&(m.current="swipe",c(!0))},[r]),w=(0,n.useCallback)(()=>{if(r||!u.current)return;let{x:e,y:t}=h.current,n=Math.hypot(e,t);"swipe"===m.current&&n>=28&&a&&(s(!0),g.current=!0),p()},[a,r,p]),x=(0,n.useCallback)(()=>{p()},[p]),k=o||l,j=!r&&k?"hover":"rest",P=r?"hover":void 0;return{hasFinePointer:r,revealed:o,touchPreview:l,isActive:k,toggleReveal:f,dismiss:y,containerRef:d,motionAnimate:j,motionWhileHover:P,onTouchStart:v,onTouchMove:b,onTouchEnd:w,onTouchCancel:x}}},33968:(e,t,a)=>{Promise.resolve().then(a.bind(a,83231)),Promise.resolve().then(a.bind(a,60518)),Promise.resolve().then(a.bind(a,1946)),Promise.resolve().then(a.bind(a,16633)),Promise.resolve().then(a.t.bind(a,81356,23)),Promise.resolve().then(a.bind(a,57609)),Promise.resolve().then(a.bind(a,269)),Promise.resolve().then(a.bind(a,33911)),Promise.resolve().then(a.bind(a,95344)),Promise.resolve().then(a.bind(a,74345)),Promise.resolve().then(a.bind(a,75738)),Promise.resolve().then(a.bind(a,68533)),Promise.resolve().then(a.bind(a,35213)),Promise.resolve().then(a.bind(a,35387)),Promise.resolve().then(a.bind(a,75297)),Promise.resolve().then(a.bind(a,23317)),Promise.resolve().then(a.bind(a,48393)),Promise.resolve().then(a.bind(a,60708)),Promise.resolve().then(a.bind(a,50621)),Promise.resolve().then(a.bind(a,42015))},45250:(e,t,a)=>{"use strict";a.d(t,{j:()=>i});var n=a(12115);let i=(e,t)=>{(0,n.useEffect)(()=>{let a=a=>{!e.current||e.current.contains(a.target)||t(a)};return document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}},[e,t])}},48644:(e,t,a)=>{"use strict";a.d(t,{Y:()=>r});var n=a(12115),i=a(5379);function r(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"dark",{resolvedTheme:t}=(0,i.D)(),[a,r]=(0,n.useState)(!1);(0,n.useEffect)(()=>{r(!0)},[]);let o=a?"dark"===t?"dark":"light":e;return{resolvedTheme:o,isDark:"dark"===o,mounted:a}}},50621:(e,t,a)=>{"use strict";a.d(t,{ProductBlogSearch:()=>h});var n=a(95155),i=a(12115),r=a(30893),o=a(25016),s=a(27078),l=a(83424),c=a(53434);function d(e){let{posts:t,documents:a,className:d}=e,[u,h]=(0,i.useState)(""),[m,g]=(0,i.useState)(!1),[p,f]=(0,i.useState)(0),[y,v]=(0,i.useState)(!1),[b,w]=(0,i.useState)(280),x=(0,i.useRef)(null),k=(0,i.useRef)(null),j=(0,i.useMemo)(()=>(function(e){let t=new l.A({idField:"slug",fields:["title","description","authors","body"],storeFields:["slug"],searchOptions:{boost:{title:3,description:2,authors:1.5,body:1},fuzzy:.2,prefix:!0,combineWith:"AND"}});return t.addAll([...e]),t})(a),[a]),P=(0,i.useMemo)(()=>{let e=u.trim();if(!e)return t;let n=function(e,t,a){let n=a.trim();return n?e.search(n).map(e=>e.slug):t.map(e=>e.slug)}(j,a,e),i=new Map(t.map(e=>[e.slug,e]));return n.map(e=>i.get(e)).filter(e=>void 0!==e)},[a,t,u,j]),T=t.length>0,S=u.trim().length>0,C=P.length>0,N=S&&!C&&T,M=(0,i.useMemo)(()=>S&&C?P:t,[P,S,C,t]);return(0,i.useEffect)(()=>{if(!m){v(!1),w(280);return}let e=x.current,t=k.current;if(!e)return;let a=()=>{var a;let n=e.clientWidth,i=null!=(a=null==t?void 0:t.offsetWidth)?a:0,r=n<332||i>0&&n<i+332+12,o=Math.min(280,Math.max(148,n-(r?0:i+12)-52));v(r),w(o)};a();let n=new ResizeObserver(()=>{requestAnimationFrame(a)});n.observe(e),t&&n.observe(t);let i=window.setTimeout(a,450);return()=>{n.disconnect(),window.clearTimeout(i)}},[m]),(0,n.jsxs)("section",{className:(0,o.cn)("flex flex-col gap-4",d),children:[(0,n.jsxs)("div",{ref:x,className:(0,o.cn)("flex min-w-0 items-center gap-3 overflow-x-clip",y?"justify-end":"justify-between"),children:[(0,n.jsx)("p",{ref:k,"aria-hidden":y,className:(0,o.cn)("shrink-0 text-xs font-medium uppercase tracking-[0.14em] text-muted-foreground",y&&"hidden"),children:c.G.blog.allArticlesLabel}),(0,n.jsx)("div",{className:"flex min-w-0 items-center justify-end",children:(0,n.jsx)(r.y,{placeholder:m?c.G.blog.searchExpandedHint:c.G.blog.searchPlaceholder,value:u,onValueChange:h,onOpenChange:g,onClear:()=>{h(""),g(!1),f(e=>e+1)},clearLabel:c.G.blog.searchClearLabel,expandedWidth:b,collapsedWidth:132,className:"min-w-0 max-w-full"},p)})]}),N?(0,n.jsxs)("div",{className:"py-6 text-center text-muted-foreground",children:[(0,n.jsx)("p",{children:c.G.blog.searchEmpty}
1),(0,n.jsx)("p",{className:"mt-1 text-sm text-muted-foreground/80",children:c.G.blog.searchEmptyBrowse})]}):null,M.length>0?(0,n.jsx)("div",{className:"grid auto-rows-fr gap-8 md:grid-cols-2 lg:grid-cols-3",children:M.map(e=>(0,n.jsx)("div",{className:"h-full animate-in fade-in slide-in-from-bottom-1 duration-300",children:(0,n.jsx)(s.Z,{blog:e})},e.slug))}):(0,n.jsx)("div",{className:"py-12 text-center text-muted-foreground",children:c.G.blog.empty})]})}let u=JSON.parse('[{"slug":"machine-learning-in-quant","title":"Machine Learning in Quant: Seeing Beyond the Numbers","description":"How quants turn satellite photos, news, and earnings calls into signals they can trade on.","authors":"Arsenii Harbar","body":"Introduction: Why Machine Learning in Quant? Financial markets are noisy, unpredictable, and packed with information. Traditional statistical models do a good job of spotting trends, but Machine Learning goes further . It can pick up on patterns too complex, too subtle, or too fast-moving for humans (or even classic models) to catch. In quant trading, machine learning means more than predicting tomorrow’s stock price. It is about drawing useful conclusions, what practitioners call inference , from all kinds of data, from satellite photos to CEO speeches. --- What is Machine Learning? A Beginner’s Guide Quantitative finance is a broad, fast-moving field that blends mathematics, statistics, computer and data science. At , we think of it as a toolkit with different branches, and Machine Learning is one of the most powerful tools in it. At its core, Machine Learning is when a computer learns patterns from data instead of being explicitly programmed with rules. - In traditional programming: you write rules → feed data → get answers. - In ML: you build a model → train it using data → the model learns rules → it can predict answers on new data. Beginner examples: - Spotify recommending songs (based on your listening history). - Email detecting spam (recognizing patterns in suspicious messages). - Image recognition apps that spot cats vs. dogs (without being told what “cat ears” are). In quant, these same principles apply. You just swap cats and dogs for bullish and bearish markets. --- Interesting Ways ML is Used in Quant Computer Vision : Seeing the Economy from Space Markets aren’t just about numbers on screens. With Computer Vision , algorithms can process satellite and drone images to uncover signals invisible to traditional models. - Crop forecasting Descartes Labs + Cargill : In 2016, Cargill , a global agribusiness giant, partnered with New Mexico startup Descartes Labs . Using satellite imagery and Cargill’s private datasets, Descartes built an ML model to forecast U.S. corn yields with just a 1% error margin. This gave Cargill sharper insights for commodity trading and supply-chain management, proving how alternative data can directly translate into trading edges. - Car park monitoring ( Orbital Insight , RS Metrics ): Satellite providers like Orbital Insight and RS Metrics track car counts outside retail stores. Hedge funds use this data to anticipate earnings surprises. For example, surging car traffic at Walmart locations can hint at stronger-than-expected quarterly sales. - Shipping & logistics: Firms such as SpaceKnow and Descartes Labs monitor port congestion and global shipping routes via satellite. These signals feed into macro trading strategies by giving real-time views of supply chains, commodity flows, and global trade. - ESG monitoring RS Metrics ESGSignals : Beyond trading, RS Metrics applies satellite analytics to environmental and governance risks. Its ESGSignals product measures carbon emissions, water stress, land usage, and clean-energy adoption at thousands of industrial sites. For quant investors, this provides objective, third-party data that can be built into risk models and ESG-driven investment strategies. Why it matters: Computer Vision turns the physical world into quantifiable data. Whether it’s crops, cars, or cargo ships, these insights help traders and risk managers capture signals faster than traditional reporting cycles. --- Natural Language Processing (NLP) : Reading Between the Lines Mar
1kets run on information, and NLP helps turn words into numbers. By parsing unstructured data (news, research notes, social media chatter), quant teams can extract signals faster than human analysts ever could. - Analyst reports & news: Sentiment models gauge optimism or fear in financial coverage, turning text into quantifiable metrics. - Social media chatter: Retail-driven platforms like Reddit’s WallStreetBets or Twitter can signal unusual momentum, and NLP models detect shifts in tone before they move the tape. - CEO & employee posts: Corporate communications on LinkedIn or blogs can reveal confidence (or concern). NLP algorithms track subtle changes in tone, frequency, or language. - Case study (Goldman Sachs AI in trading ): Goldman Sachs , a $100B+ revenue bank, has embedded NLP into its AI-powered trading systems. Neural networks analyze global newsfeeds, central bank speeches, analyst commentary, and Twitter sentiment in real time. These signals feed into reinforcement-learning agents that autonomously recalibrate portfolio weights across asset classes. The results speak volumes: - +27% intraday trade profitability compared to human-only desks. - Execution latency cut by 90% (120ms → 14ms). - Outperformed benchmarks by 8–11% during volatile periods , thanks to NLP-driven recalibration. - Analysts freed from routine model tuning, spending more time on novel research (e.g., integrating ESG or satellite data). - Full transparency for regulators: every NLP-derived trade signal is auditable. Why it matters: NLP lets quants turn text, once dismissed as “soft data”, into structured, tradeable signals. From detecting fear in analyst reports to parsing the tone of central bank speeches, NLP is a cornerstone of modern quant research. --- Speech Recognition + NLP: Listening for Truth Spoken language often reveals more than written text. By combining speech recognition with NLP, quants can extract actionable signals from CEO earnings calls , policy speeches, and corporate disclosures. - Earnings calls: Hedge funds like Man Group / AHL use algorithms to detect hesitation, stress, overconfidence, or unusually positive tone in executives’ voices. Machine analysis can flag subtle signals invisible to human analysts. - Policy speeches: Central bank or regulatory communications often contain subtle guidance for markets. NLP models can parse tone, word choice, and emphasis faster than humans, feeding signals into macro or multi-asset trading strategies. - Truth detection & corporate disclosures: NLP systems now evaluate whether the language or tone in reports and filings indicates hidden risk or optimism. Research from the NBER shows that companies have been optimizing disclosure to be “machine-readable” , with executives coached on word choice to avoid triggering algorithmic red flags. - Case study ( Sentieo platform): NLP tools quantify tone, sentiment, and word frequency in earnings calls and filings. Hedge funds can run multiple versions of drafts through models to assess which signals are likely to move markets, creating a feedback loop between corporate communication and algorithmic trading. Why it matters: Speech + NLP turns subtle human communication into quantifiable data. Traders can measure tone, detect hidden signals, and feed them into automated strategies, a clear example of how AI is extending human insight into voice and language. Fun fact: Some executives now carefully avoid words like “but” or “challenging,” because NLP algorithms are sensitive to these triggers, a real-life cat-and-mouse game between management and algorithmic investors. --- Key Concepts and Fundamentals Machine Learning is transforming quantitative finance by uncovering patterns and signals that traditional models often miss. At , we see it as a great entry point into quant: practical, powerful, and useful well beyond finance. Here are some core ideas to know: - Supervised Learning : Training algorithms on historical data (like past stock movements) so they can make predictions on new, unseen data. - Unsupervised Learning : Finding structure in messy datasets, such as clustering companies by hidden similarities in performance or behavior. - Reinforcement Learning : Teaching algorithms to make decisions one after another, such as an agent that learns how to rebalance a portfolio over time. - Deep Learning : Neural networks that can handle complex inputs like images, text, or speech, opening the door to satellite analysis, news sentiment, or CEO call transcripts. At , we emphasize hands-on learning. That means experimenting with real market data, coding trading algorithms, and testing ML models through simulations. Every project you build strengthens your portfolio, the kind of evidence top firms look for when hiring quants. Machine Learning isn’t just another branch of quant. It’s becoming the glue that connects finance, technology, and data science. Additional Materials - A Guide to Machine Learning in Finance - Popular applications of computer vision in finance - Natural Language Processing (NLP) in Finance: How AI is Transforming Market Analysis"},{"slug":"profiling-for-alpha","title":"Profiling for Alpha: Why the Fastest Fix Is Rarely Your First Guess","description":"In quant finance, speed is money, and the slowest line of code is almost never the one you would guess.","authors":"Arsenii Harbar","body":"Table of Contents - Introduction - What Profiling Actually Is - Do Not Guess Why It Is Slow. Measure. - Case Study: Pricing an Option, Two Ways - The GPU Trap: Why Your Stopwatch Lies to You - From Toy Example to Real Systems - Getting Started Introduction In quant finance, how fast your co
1de runs feeds straight into how much money you make or lose, what traders call profit and loss . A market maker whose price quotes update a few microseconds late gets picked off by faster traders. A risk desk whose overnight Value at Risk report (an estimate of how much the firm could lose on a bad day) is not ready before the morning meeting is flying blind. A researcher whose backtest , a trial run of a strategy on past market data, takes six hours to try one set of settings gets through far fewer ideas than a colleague whose version takes forty minutes. These problems are rarely solved by writing faster code in the abstract. They are solved by finding the one line that is actually holding everything up. That habit of measuring first is called profiling . This article is about that habit. Instead of a grab-bag of tricks for speeding up Python, we cover the one idea underneath all of them: measure before you optimize. Skipping that step is still one of the most common and expensive mistakes in quantitative computing. What Profiling Actually Is A profiler is a diagnostic tool that answers one question precisely: where did the time go? It hands you a table with a number next to every operation your code executed, so you can see which lines dominate your runtime. Human intuition about code performance is notoriously unreliable. Engineers optimize the segment they assume is slow. Then they measure, and discover their target accounted for 5% of the total, while an overlooked function ate 80%. This happens to experienced engineers on sophisticated systems all the time. The fix is not to develop better intuition. The fix is to measure the system directly. The whole practice of quantitative research rests on the idea that you do not trust a market claim until you test it against data. Profiling points that exact instinct at your own codebase. Do Not Guess Why It Is Slow. Measure. A 2020 Google paper on the Transformer , the neural-network design behind today\'s AI language models, captures this attitude perfectly. The authors tested several versions of one common building block and found that a few of them consistently beat the standard version across a wide range of language tasks. In their conclusion, they admitted they had no theoretical explanation for why: > We offer no explanation as to why these architectures seem to work; we attribute their success, as all else, to divine benevolence. > > Noam Shazeer, GLU Variants Improve Transformer (2020) That line gets quoted often in ML circles, including the Hugging Face profiling series . People cite it because it is honest. The authors did not lean on a theory. They leaned on careful, repeated measurement, and trusted the data over their ability to explain it. Profiling asks for that same honesty about performance. You do not need a theoretical explanation for why your code is slow before you speed it up. You need a profiler and the discipline to trust its output over your assumptions. Case Study: Pricing an Option, Two Ways Let us make this concrete with Monte Carlo option pricing, which estimates a value by simulating thousands of random outcomes and averaging them. We price a simple call option , the right to buy a stock at a fixed price, by simulating many possible future prices for the stock, taking the payoff in each case, and averaging the results. The simulated prices follow geometric Brownian motion , the standard model for how a stock drifts and wobbles over time. First the beginner\'s version, then the one you write after profiling. Version 1: the naive loop, computing one path at a time: Version 2: the vectorized approach, computing all paths at once with NumPy: Timed with timeit, best of three runs, 500,000 paths, on an ordinary laptop CPU: | Version | Time | Price | |---|---|---| | Naive loop | 0.271 s | 7.13 | | Vectorized | 0.014 s | 7.13 | 19x faster, identical answer. The underlying simulation is exactly the same. The difference is that Version 2 runs the random draw, the exponential, and the payoff for all 500,000 paths through a handful of large array operations instead of 500,000 separate Python-level steps. Version 1\'s runtime is not dominated by computation. It is dominated by the overhead of the interpreter looping half a million times and calling random.gauss and math.exp on every single iteration. This is what vectorization buys you. Why it matters: You did not need a profiler to catch this one. The function is tiny and the speedup is enormous, so a plain stopwatch is enough. The real failure modes hide in code where the bottleneck is buried, such as a 500-line risk engine or a model running on a GPU. There, profiling stops being optional. The GPU Trap: Why Your Stopwatch Lies to You When you run pricing engines or models on a graphics card (GPU) , there is a specific timing trap waiting for you. Graphics cards are increasingly common for large-scale Monte Carlo risk calculations and are standard for deep learning. A graphics card runs its work asynchronously , which just means the rest of your program does not wait around for it. When Python calls a GPU operation, the main processor does not wait for it to finish. It hands the work to the GPU and moves straight to the next line. Wrapping time.perf_counter() around a block of GPU code without forcing synchronization (using torch.cuda.synchronize() in PyTorch) usually measures how fast Python launched the work, not how fast the GPU executed it. Those two numbers are often far apart, and the gap is a useful diagnostic. If launching the workload takes longer than the computation itself, your co
1de is launch-overhead-bound, not compute-bound. The fixes for those two states are completely different. You either batch more work into each launch, or you optimize the underlying math. Guess wrong and you spend a day speeding up the part that was never the problem. There is a second trap inside the profiler tables themselves. Most profilers report both self time (time spent directly inside a function, excluding the calls it makes) and total time (self time plus everything its children did). A developer sees a tiny self-time number and concludes the function is efficient, when the heavy work is actually happening in the child operations it triggered, correctly excluded from its self-time. Misreading those two columns leads people to draw wrong conclusions from perfectly accurate data. A pricing engine that looks fast under naive timing but is secretly overhead-bound will scale badly the moment you raise the batch size, which tends to be exactly when a risk desk needs it most. From Toy Example to Real Systems Real quantitative systems earn their monitoring: - Backtesting engines sweep thousands of parameter combinations. The gap between a vectorized and a naive implementation decides whether you test 50 ideas a day or 5. - Risk engines estimate figures like Value at Risk, or the cost of a trading partner defaulting (its CVA ), by running simulations inside simulations. Banks reach for graphics-card acceleration here because that work splits neatly across thousands of small cores. Profiling tells you whether you are actually using that power or paying for an idle card. - Machine learning models generate trading signals. Profiling is the only reliable way to tell whether the delay in getting a prediction (its latency ) comes from the neural network itself or from unoptimized data preparation sitting in front of it. In every case the method is the same, whether you are hunting for alpha or controlling risk. Form a hypothesis about what is slow, measure it, and be ready to be wrong. Getting Started You do not need heavy tooling to start measuring. Ordered roughly by sophistication: 1. time.perf_counter() / timeit: the plain stopwatch. Perfect for isolating a complete, synchronous CPU function. 2. cProfile: Python\'s built-in function-level profiler. It shows which calls dominate the runtime and needs no external dependencies. 3. torch.profiler : if your code touches PyTorch on CPU or GPU, use the dedicated tool. The Profiling in PyTorch series from Hugging Face is a good walkthrough of how to read its output. Start with basic timing. Reach for a real profiler the moment your intuition and your measurements disagree. At we treat that disagreement as the interesting part, not an annoyance, and if you profile honestly it shows up fast. Additional Materials - GLU Variants Improve Transformer (Noam Shazeer, 2020) - Profiling in PyTorch, Part 1: A Beginner\'s Guide to torch.profiler - Profiling in PyTorch, Part 2: From nn.Linear to a Fused MLP - Profiling in PyTorch, Part 3: Attention is all you profile - PyTorch Profiler official documentation"},{"slug":"quantconnect-crash-course","title":"Quant Crash Course","description":"Build and test your first real trading algorithm on QuantConnect, no experience needed.","authors":"Erdem Gunseli, Michael Bolebrukh","body":"What is QuantConnect? Think of QuantConnect as your coding playground for trading. It\'s a cloud platform where you can write, test, and actually trade strategies without worrying about servers, data feeds, or broker integrations. Here\'s the deal: You write Python code, test it on years of market data, and if it works, you can flip a switch and trade it live. All in your browser. Why people love it: • Tons of free market data (terabytes) • Write once, trade anywhere (multiple brokers) • Active community of 400,000+ traders sharing ideas It\'s basically like GitHub for traders, but with real money on the line. Your First 5 Minutes Let\'s get you from zero to your first working algorithm. No fluff, just the essentials. 1. Sign up Go to QuantConnect and create a free account 2. Create algorithm Hit Algorithm Lab → \\"Create New Algorithm\\" → Choose Python 3. Don\'t panic You\'ll see some auto-generated code. Simpler than it looks. Your First Real Algorithm Alright, now that you\'ve seen the basic structure, let\'s build something that actually does something interesting. We\'ll create a simple momentum strategy, built on the idea that recent winners tend to keep winning and recent losers keep losing. Remember: The strategy logic is everything. The Python syntax is just a tool to express your ideas. What we\'re building: A strategy that picks between SPY ( S&P 500 ) and QQQ ( Nasdaq ) based on which one is trending stronger. Syntax doesn\'t matter, strategy does: The trading strategy is 1000x more important than the code syntax. Focus on the logic , not the expressions. When you see self.spy = self.add_equity(\\"SPY\\", Resolution.DAILY) with a comment, just think \\"ok this bit does that\\" and move on. Syntax is the easy part; anyone can learn Python basics in a few weeks. The hard part is understanding what makes a good trading strategy . Don\'t get stuck on the code details. Concepts â
1†’ Strategy >> Strategy → Code. Focus on the big picture logic, not how Python works. --- What just happened? • We created a strategy that picks between SPY and QQQ based on momentum • It rebalances monthly (daily trading is expensive and stressful) • The momentum indicator looks at the last 20 days to decide which is \\"hot\\" Testing Your Strategy: Backtesting Here\'s a key concept: before risking real money, you want to test your strategy on historical data. This is called backtesting . What backtesting does: It runs your strategy on past market data to see how it would have performed. Think time machine for trading strategies. Your momentum strategy? It gets tested on years of real market data automatically. You\'ll see metrics like: - Total return : How much money you made/lost - Win rate : Percentage of profitable trades - Max drawdown : Worst losing streak This way you know if your idea works before putting real money on the line. One Important Thing: You Can Lose Money Algorithmic trading isn\'t a get-rich-quick scheme. You can lose money , just like any other investment. Start Small When you\'re ready to use real money, start with an amount you can afford to lose . Think of it as tuition for learning. What\'s Next? Ready to try it yourself? Here\'s your simple next steps: 1. Sign Up Go to QuantConnect and create a free account 2. Try the Demo Copy and paste the momentum strategy code above. Hit backtest and watch it work. 3. Learn More Try the BootCamp tutorials to learn step by step. That\'s It: You Know the Basics! You\'ve just learned the core concepts of algorithmic trading: 1. Algorithms can trade automatically based on rules you write 2. Backtesting lets you test strategies on historical data 3. QuantConnect makes it accessible without complex setup 4. You can start with fake money to learn safely The beauty of QuantConnect is that it handles all the technical complexity. You just focus on the trading ideas. Ready to give it a shot? Go play with that momentum strategy. See if you can make it better. That\'s how everyone starts."},{"slug":"scraping-the-world","title":"Scraping the World","description":"How hedge funds mine web traffic and Reddit for signals that move markets before the news does.","authors":"Michael Bolebrukh, Erdem Gunseli","body":"How Web Data Shapes Financial Strategies Table of Contents - Web Traffic Predicts Home Depot’s Rally - Retail Websites Foreshadow GoPro’s Fall - Twitter Sentiment Drives Market Moves - Hedge Funds Scrape Reddit for Retail Buzz - Job Postings Reveal Strategic Pivots In today’s markets, the most valuable information isn’t always in the earnings reports or balance sheets. A lot of it is scattered across the internet. Hedge funds and quantitative traders are increasingly turning to web-scraped data , information collected automatically from websites, to gain an edge: scanning website traffic , reading product listings, watching social media chatter, or even analyzing job postings. These unusual data sources, once overlooked, now drive billion-dollar strategies. Let’s explore five eye-catching examples of how quants have transformed raw web data into profitable trades. Web Traffic Predicts Home Depot’s Rally Goldman Sachs Asset Management once spotted a spike in visits to HomeDepot.com by analyzing web traffic scraped from Alexa.com . The insight? Consumer demand was booming well before official news. Acting on this early signal, they bought Home Depot shares, and profited when the company raised its outlook and the stock rallied. The digital “footprints” of shoppers reveal market trends faster than traditional data. Retail Websites Foreshadow GoPro’s Fall In 2015, data firm Eagle Alpha scraped e-commerce sites for GoPro camera availability. They found signs of weak demand (fewer sell-outs and falling prices) even as Wall Street analysts stayed optimistic. Expecting disappointing earnings, they placed a bet that the stock would fall. Sure enough, GoPro missed its targets, and the stock sank. Product availability and pricing data on retailer sites can expose consumer demand shifts before earnings season. Twitter Sentiment Drives Market Moves Traders now sift through Twitter’s firehose of posts to read the crowd’s mood, or sentiment , in real time. Research has shown that collective Twitter mood can predict market movements with surprising accuracy. Hedge funds use natural language processing , softw
1are that reads text the way a person would, to sort tweets into bullish or bearish, while others track influencers like Elon Musk , whose crypto posts famously trigger instant trading spikes. Hedge Funds Scrape Reddit for Retail Buzz After the GameStop short squeeze , funds started systematically scraping Reddit ’s r/WallStreetBets to avoid being blindsided, and even to profit from viral momentum. If a stock’s mentions surge on Reddit, quants can protect their positions or ride the hype wave. In 2025, Reddit even partnered with the parent company of the New York Stock Exchange to package forum data for investors. Job Postings Reveal Strategic Pivots In 2019, one hedge fund scraped company career pages and noticed a surge in AI engineer job listings. Sensing a pivot toward artificial intelligence , they bought the company’s stock, which later jumped after an official AI announcement. Others scrape sites like Glassdoor to track employee morale, selling out if the mood turns sharply negative. Conclusion From tracking website visits to decoding Reddit threads, web-scraped data has become one of the most fascinating frontiers in quantitative finance. It’s a reminder that in today’s digital world, almost every click, comment, or job post can be transformed into a trading signal. At , we explore these innovative strategies not only to understand how hedge funds operate, but also to prepare solutions that take advantage of alternative data . Additional Materials - Using Satellite imaging for stock market prediction - Stack Exchange Discussion on alternative data"},{"slug":"top-5-beginner-quant-projects","title":"Top 5 Beginner Projects to Get Into Quantitative Finance","description":"Five hands-on projects that take you from a blank notebook to a portfolio worth showing a recruiter.","authors":"Michael Bolebrukh","body":"Quantitative finance can be difficult to approach as a beginner. You might understand some Python, probability, or statistics, but still have no idea what you are supposed to build. The good news is that your first project does not need to predict the stock market or compete with a hedge fund. A useful beginner project should help you work with real financial data, turn a mathematical idea into code , and test whether your results actually make sense. The five projects below cover different parts of quantitative finance, from basic market analysis to portfolio construction, derivatives pricing, and statistical arbitrage . They are arranged roughly in order of difficulty, so you can work through them as a sequence or choose the area that interests you most. Table of Contents - 1. Financial Market and Risk Dashboard - 2. Moving Average Crossover Backtest - 3. Markowitz Portfolio Optimiser - 4. Black–Scholes and Monte Carlo Option Pricer - 5. Cointegration-Based Pairs Trading - Choosing Your First Project 1. Build a Financial Market and Risk Dashboard A financial dashboard is a good place to start because it forces you to become comfortable with market data before you try to build a trading strategy. Choose a small collection of stocks or exchange-traded funds (ETFs) and download their historical prices using Python. From there, calculate daily returns, cumulative returns, annualised volatility , maximum drawdown , and the Sharpe ratio . You can also compare the assets using a correlation matrix and measure their performance against a benchmark such as the S&P 500 . At first, this can be done entirely inside a Jupyter notebook. Once the calculations work, you could use Streamlit or Plotly to turn the notebook into an interactive application where the user can enter a ticker and select a date range. Questions a decent version should answer: • Which asset produced the highest return? • Which one experienced the worst drawdown? • Did the asset with the highest return also have the best risk-adjusted performance? • How did correlations change during periods of market stress? What you will practise: Python, Pandas, NumPy, data visualisation, financial returns, and risk metrics. Ideas for extending the project: • Add rolling volatility and rolling Sharpe-ratio charts. • C
1ompare stocks from different industries. • Calculate Value at Risk and Conditional Value at Risk . • Allow the user to upload their own portfolio. • Generate a downloadable performance report. YouTube example: Financial Market Risk Assessment Using Python Similar GitHub project: Quantitative Portfolio Analysis Dashboard 2. Backtest a Moving Average Crossover Strategy Once you know how to handle price data, the next step is to build a basic backtest . A moving average crossover is one of the simplest strategies you can implement. You calculate a short-term moving average and a long-term moving average for the same asset. When the short moving average moves above the long moving average, the strategy enters a position. When it moves below, the strategy exits. For example, you could use a 50-day moving average and a 200-day moving average. The exact numbers are not particularly important. The point of the project is not to discover a perfect combination of parameters; it is to understand the structure of a backtest. You will need to translate the strategy into exact rules, generate positions, calculate daily strategy returns, and compare the result with simply buying and holding the asset. Your final output should include an equity curve , total return , annualised volatility, Sharpe ratio, and maximum drawdown. Watch out for look-ahead bias : If a signal is calculated using today\'s closing price, you cannot also pretend that you entered the trade at that same closing price. Shifting your positions by one period is a small detail, but ignoring it introduces look-ahead bias and makes the backtest unreliable. What you will practise: Signal generation, backtesting, time-series calculations, benchmarking, and common research errors. Ideas for extending the project: • Add transaction fees and slippage. • Test different moving-average lengths. • Compare results across stocks, indices, and commodities. • Separate your data into in-sample and out-of-sample periods. • Test whether the strategy works after parameters have been chosen. Do not judge the strategy only by its return. A strategy that gains 20% while experiencing a 50% drawdown is very different from one that gains 15% with a 10% drawdown. YouTube example: Moving Average Crossover Trading System Backtest in Python Similar GitHub project: Vectorised Backtest Tutorial 3. Create a Markowitz Portfolio Optimiser A portfolio optimiser is a natural next project for anyone interested in the mathematical side of quantitative finance. Start by selecting a group of stocks or ETFs. Using their historical returns, estimate the expected return of each asset and the covariance matrix between them. You can then generate different portfolio weight combinations and calculate the expected return and volatility of each portfolio. Plotting these portfolios produces the familiar efficient frontier from Modern Portfolio Theory . From there, identify the minimum-volatility portfolio and the portfolio with the highest estimated Sharpe ratio. This is a good project for learning how an optimisation problem becomes a working program. It also shows why portfolio construction is not simply a matter of selecting the assets with the highest historical returns. Correlations matter . Combining two volatile assets can still reduce overall portfolio risk when their returns do not move together closely. A weakness worth investigating: The result can be extremely sensitive to the expected returns you feed into the optimiser. Small changes in the input data may produce very different portfolio weights. Rather than hiding this problem, include it in your analysis. What you will practise: Linear algebra, covariance matrices, numerical optimisation, diversification, and portfolio theory. Ideas for extending the project: • Compare the optimised portfolio with equal weighting. • Add a no-short-selling constraint. • Limit the maximum allocation to any one asset. • Rebalance the portfolio monthly or quarterly. • Test the chosen weights on a later, unseen period. • Use shrinkage or another method to improve the covariance estimate. A strong submission should explain the mathematics, show the weights clearly, and discuss the limitations of using historical averages as estimates of future returns. YouTube example: Markowitz Bullet in Python: Efficient Frontier Similar GitHub project: Markowitz Portfolio Optimisation in Python 4. Build a Black–Scholes and Monte Carlo Option Pricer This project is a good introduction to derivatives and computational finance. Begin with a European call or put option . Implement the Black–Scholes formula 
1in Python using the current asset price, strike price, time to expiry, risk-free rate, and volatility. The formula gives you an analytical option value under the assumptions of the model. Next, calculate the same price using Monte Carlo simulation . Simulate thousands of possible terminal prices for the underlying asset using geometric Brownian motion . Calculate the option payoff under each simulated outcome, take the average, and discount it back to the present. The Monte Carlo estimate should move closer to the Black–Scholes value as the number of simulations increases. Do not stop after printing two numbers. Plot some of the simulated price paths. Run the calculation with different numbers of simulations and record the error. You can also repeat the experiment several times to see how much the Monte Carlo estimate varies. What you will practise: Derivatives, probability, simulation, geometric Brownian motion, and numerical methods. Ideas for extending the project: • Price both calls and puts. • Check that put-call parity holds. • Calculate Delta, Gamma, Vega, Theta, and Rho. • Add a binomial-tree pricing method. • Produce a heatmap showing how the option price changes with volatility and the underlying price. • Add confidence intervals to the Monte Carlo estimate. • Build a small Streamlit pricing application. This project also gives you plenty to discuss in a README. You can explain the model assumptions, show where Monte Carlo error comes from, and compare the advantages of analytical and numerical pricing methods. YouTube example: Monte Carlo Simulation for Option Pricing with Python Similar GitHub project: Black–Scholes Option Pricing with Monte Carlo 5. Build a Cointegration-Based Pairs-Trading Strategy Pairs trading is the most advanced project on this list, but it is also the closest to a small quantitative research project. The basic idea is to find two assets whose prices share a stable long-term relationship . When that relationship temporarily moves away from its usual level, the strategy buys one asset and sells the other, expecting the spread between them to return towards its historical mean. Start with stocks from the same industry rather than testing completely unrelated companies. You might examine two banks, two oil companies, or two large technology firms. Correlation is not enough: Two price series can be highly correlated without having a stable long-term spread. A better project should introduce stationarity and cointegration . You can use linear regression to estimate the hedge ratio between the two assets, construct the spread, and apply an Augmented Dickey–Fuller test. If the spread appears stationary, calculate its rolling z-score . The strategy can enter a trade when the z-score moves beyond a chosen threshold and exit when it returns closer to zero. Backtest the resulting long-short positions and include transaction costs. More importantly, choose the pair and trading rules using one period of data, then evaluate them on an out-of-sample period . Otherwise, it is very easy to search through enough stocks and parameters until you find an impressive historical result by chance. What you will practise: Regression, stationarity, cointegration, hypothesis testing, z-scores, and market-neutral strategy design. Ideas for extending the project: • Search for cointegrated pairs within the same sector. • Estimate the hedge ratio using a rolling window. • Calculate the half-life of mean reversion. • Compare correlation-based and cointegration-based pair selection. • Add stop-loss and maximum-holding-period rules. • Build a portfolio containing several pairs. • Test whether the relationship remains stable over time. The most interesting result may be that a pair which worked well historically stops behaving in the same way later. That is not a failed project. Finding and explaining the failure is part of quantitative research. YouTube example: Backtest a Pairs Trading Strategy in Python Similar GitHub project: Pairs Trading with Python Choosing Your First Quantitative Finance Project Whichever project you choose, make the work your own . Change the assets, test a different period, add another metric, and explain the decisions you made. Your GitHub repository should contain readable code, a clear README, the assumptions behind the model, and an honest discussion of what did not work. A simple project becomes much more convincing when you can explain every line of the code and every limitation of the result. That is a far better starting point for quantitative finance than a complicated model you do not fully understand. Ready to build? Pick one project, finish a rough version, then extend it. That is how most people at start turning theory into something they can show. Additional Materials - Financial Market Risk Assessment Using Python : a dashboard walkthrough for returns and risk metrics - Moving Average Crossover Trading System Backtest in Python : a simple signal-and-backtest tutorial - Markowitz Bullet in Python: Efficient Frontier : visualising the efficient frontier - Monte Carlo Simulation for Option Pricing with Python : simulation-based option pricing - Backtest a Pairs Trading Strategy in Python : pairs trading from spread construction to backtest - Quantitative finance Python projects on GitHub : browse open-source examples for inspiration"},{"slug":"what-is-quantitative-finance","title":"What is Quantitative Finance?","description":"How quants use math and code to find tradable patterns in the market\'s noise, explained from scratch.","authors":"Michael Bolebrukh, Erdem Gunseli","body":"Table of Contents - Introduction: Why Finance Needs Quants - What Are Stocks? A Beginner’s Guide - How Are Stock Prices Determined? - What is Quantitative Finance? - Key Concepts and Fundamentals - : Learning, Building, Innovating Introduction: Why Finance Needs Quants Finance has always been about making decisions under uncertainty. But in today’s world, markets move faster, data flows endlessly, and complexity grows by the day. Traditional intuition and experience are no longer enough. That’s where quants , short for quantitative analysts, come in. Quants use mathematics, statistics, and programming to understand how markets behave and to design strategies that manage risk and generate returns. From pricing complex derivatives to building algorithmic trading systems, quantitative methods allow us to see patterns and opportunities hidden in the noise of financial data. In short, finance needs quants because modern markets demand data-driven decision making . Whether you’re an investor, a risk manager, or a student curious about the world of finance, quantitative thinking gives you the tools to navigate and succeed in today’s financial landscape. What Are Stocks? A Beginner’s Guide When a company wants to expand beyond its current limits, it needs money. To raise those funds, the company can look for investors, people or businesses willing to provide capital. One common way to do this is by selling part of the company’s ownership in exchange for cash. This ownership is divided into units called shares . Shares can be sold privately between a small group of investors or publicly through stock exchanges . Think of a stock exchange as a giant marketplace where shares are bought and sold, much like products in a supermarket. But what does owning a share actually mean? In essence, a share represents partial ownership of the company. This often comes with the right to re
1ceive dividends , which are payments a company makes to its shareholders as a reward for investing. If you own one share, you may receive one dividend payment. The size, frequency, and even existence of dividends depend entirely on the company’s management. Some companies pay dividends regularly, others pay them occasionally, and some reinvest all profits back into growth instead. When dividends are planned, companies typically announce them to the public a few months in advance. The trading floor of the New York Stock Exchange . How Are Stock Prices Determined? When a company goes public, it raises money by offering shares to investors. Initially, the price is set during an Initial Public Offering (IPO) , but once shares begin trading on a stock exchange, prices are no longer fixed by the company. Instead, they move according to supply and demand. On an exchange, prices are determined through a continuous auction. If traders expect the company to perform well, demand rises and the price increases. If confidence falls, sellers dominate and the price drops. This tug-of-war between buyers and sellers is the foundation of stock pricing, a topic we explore further in our Market Microstructure & Trading course, which covers order books, liquidity, and the dynamics of auctions in detail. It’s important to recognize that the market price of a stock is not always its fair value . Mispricing is common: stocks are often priced above or below what their fundamentals justify. This gap between price and value is exactly what creates opportunities for traders and investors. Beyond stocks, financial markets include instruments like bonds, currencies, and derivatives (futures, options, swaps). Derivatives allow traders to speculate or hedge risk, often using leverage , where a small investment controls a much larger exposure. Leverage magnifies both gains and losses, making derivatives powerful but risky. Their pricing, r
1isk dynamics, and applications are core topics in the Financial Mathematics branch. This diagram is a classic way to explain the difference between market price and intrinsic value of a stock. What is Quantitative Finance? There are three common approaches to financial analysis: fundamental, technical, and quantitative. Fundamental analysis focuses on the business itself. Analysts study company financial statements, industry trends, competitors, management quality, and even investor sentiment to estimate a company’s fair value. For example, an analyst might review Apple’s quarterly earnings reports, forecast iPhone sales, and compare them with competitors like Samsung before deciding whether Apple’s stock is undervalued. This method requires deep expertise in accounting and finance, and it relies on information beyond stock prices. Technical analysis takes the opposite view. Instead of studying the business, it focuses purely on price and volume data. Traders use charts, patterns, and indicators such as moving averages or the Relative Strength Index (a momentum gauge) to predict short-term movements. For instance, if Tesla’s stock repeatedly bounces at a certain price level, a technical analyst might treat that as a “support level” and expect it to rise again. Quantitative analysis , what we focus on at , combines and expands on both approaches. It uses mathematics, statistics, and computer science to analyze large datasets and reduce human bias. A quant might build a regression model to link macroeconomic variables with stock returns, use machine learning to forecast volatility, or construct an algorithm that executes trades in milliseconds. Quantitative methods rely on both financial fundamentals and historical price data, but transform them into models that can be tested, improved, and automated. In the last 40 years, quantitative strategies have consistently outperformed traditional approaches, and today they power some of the world’s largest financial institutions, from hedge funds like Renaissance Technologies , Citadel , and Two Sigma to investment banks like Goldman Sachs and J.P. Morgan . Investopedia , a useful resource of news on stocks, investing, and finance. Key Concepts and Fundamentals Quantitative finance is broad, interconnected, and endlessly exciting. At , we divide the field into several branches, each with its own balance of mathematics, statistics, data science, and computer science. You can approach them separately or study them together; many members explore multiple areas and build strong, interdisciplinary skill sets. If you don’t enjoy heavy mathematics, start with Machine Learning & AI, which develops deep expertise in techniques that are highly valuable both inside and outside finance. If you’re more interested in markets and decision-making than raw coding, explore Portfolio & Risk Management . If you want to dive into the mathematical foundations of modern finance, then Financial Mathematics is your home. And of course, you’re never limited to just one; many of our members move across all branches. Each course includes practical tasks inspired by real industry work. You can download worksheets, complete hands-on exercises, and build a portfolio of projects, the kind that demonstrates the skills employers expect for six-figure entry-level quant roles. Here are the core areas we cover: Financial Mathematics - Pricing theory (derivatives, options, futures) - Stochastic processes (Brownian motion, It\xf4 calculus) - Martingale pricing, Black–Scholes–Merton model - Term structure models (Hull–White, HJM, CIR) Statistics & Econometrics - Regression models (linear, logistic, quantile) - Time series analysis (ARIMA, GARCH, cointegration) - Volatility forecasting - Factor models (Fama–French, PCA) Portfolio & Risk Management - Modern Portfolio Theory (Markowitz) - CAPM , APT , multifactor models - Risk measures: VaR , CVaR , Expected Shortfall - Stress testing and scenario analysis - Hedging strategies Machine Learning & AI in Finance - Supervised learning (regression, classification) - Unsupervised learning (clustering, PCA, anomaly detection) - Deep learning (RNNs, LSTMs, Transformers for time series) - Reinforcement learning for trading and execution - NLP for news, sentiment, and filings Market Microstructure & Trading - Limit order books (liquidity, order flow imbalance) - Bid–ask spreads, slippage, transaction costs - Execution algorithms (VWAP, TWAP, POV, Almgren–Chriss) - High-frequency trading ( HFT ) strategies - Statistical arbitrage and pairs trading Numerical Methods & Computation - Monte Carlo simulation - Finite difference methods for PDEs - Optimization methods (convex, stochastic, evolutionary) 
1- Risk-neutral pricing via simulation - Parallel computing (GPU, distributed systems) : Learning, Building, Innovating At , we welcome everyone, no prior experience required. Our lessons are designed to be accessible even to those with no background in mathematics or computer science. If you’re already a postgraduate or an industry practitioner, don’t worry: our advanced sections and projects will be challenging enough to keep you engaged. Events We Organise We host a wide variety of events across Edinburgh, ranging from academic to practical to recreational: - Academic-focused: discussions on research articles, structured lessons, and guest lectures from professors and industry professionals. - Practical workshops: hands-on sessions covering trading, strategy development, and programming skills. - Competitions and hackathons: team-based challenges where members build trading algorithms, backtest strategies, and compete for performance. - Recreational activities: film screenings and social events. Yes, there are plenty of excellent investing and quant-related films worth watching (IMDb 7+ and higher). Projects We Build Active members can also take part in larger-scale projects. These combine knowledge from all the areas of quantitative finance, from financial mathematics to machine learning, to develop working algorithms that can be tested, refined, and even deployed for real profit. Participating in these projects not only gives you practical, resume-ready experience but also connects you with peers, mentors, and industry contacts. Additional Materials - Youtube video from Socratica : examples of strategies and a short intro to what quant is - The Quants : How a New Breed of Math Whizzes Conquered Wall Street and Nearly Destroyed It (a great book on how financial markets work and what quants do) - A short article that might clarify some of your questions"}]');function h(e){let{posts:t,className:a}=e;return(0,n.jsx)(d,{posts:t,documents:u,className:a})}},51105:(e,t,a)=>{"use strict";a.d(t,{f:()=>s});var n=a(95155),i=a(12115),r=a(25016);let o=["One","Two","Three"].map((e,t)=>({id:String(t),content:(0,n.jsx)("div",{className:"flex h-44 w-full items-center justify-center rounded-2xl border border-border bg-card text-2xl font-semibold text-foreground",children:e})}));function s(e){let{items:t=o,className:a,classNames:s,gap:l=24,autoPlayMs:c=4e3,slideClassName:d="w-full shrink-0 md:w-[36.75rem]",pauseOnHover:u=!0,onIndexChange:h,showDots:m=!0,loop:g=!0,startIndex:p=0,infinite:f=!1}=e,y=t.length,v=Math.min(Math.max(p,0),Math.max(y-1,0)),[b,w]=(0,i.useState)(v),[x,k]=(0,i.useState)(!1),[j,P]=(0,i.useState)(0),[T,S]=(0,i.useState)(0),C=(0,i.useRef)(null),N=(0,i.useRef)(null),M=(0,i.useRef)(0),A=(0,i.useRef)(0),L=(0,i.useRef)(0),R=(0,i.useRef)(0);(0,i.useEffect)(()=>{let e=()=>{let e=C.current;if(e&&S(e.clientWidth),!N.current)return;let t=N.current.getBoundingClientRect().width;P(t),M.current=t+l};e();let t=new ResizeObserver(e);return N.current&&t.observe(N.current),C.current&&t.observe(C.current),window.addEventListener("resize",e),()=>{t.disconnect(),window.removeEventListener("resize",e)}},[l,y]),(0,i.useEffect)(()=>{if(v<=0)return;let e=C.current,t=M.current;e&&!(t<=0)&&e.scrollTo({left:v*t,behavior:"auto"})},[]),(0,i.useEffect)(()=>{if(!c||y<=1||u&&x)return;let e=window.setInterval(()=>{if(Date.now()-R.current<1500)return;let e=C.current,t=M.current;if(!e||t<=0)return;let a=Math.round(e.scrollLeft/t);if(f)return void e.scrollTo({left:(a+1)*t,behavior:"smooth"});if(!g&&a>=y-1)return;let n=(a+1)%y;e.scrollTo({left:n*t,behavior:"smooth"})},c);return()=>window.clearInterval(e)},[c,y,x,u,g,f]);let I=(0,i.useRef)(b);if((0,i.useEffect)(()=>{I.current!==b&&(I.current=b,null==h||h(b))},[b,h]),(0,i.useEffect)(()=>()=>{cancelAnimationFrame(A.current),window.clearTimeout(L.current)},[]),0===y)return null;let E=f?Math.min(y,Math.ceil((T||1)/Math.max(1,M.current||j+l))):0,z=f?t.slice(0,E):[],W=!f&&j>0?Math.max(0,(T||0)-j):0;return(0,n.jsxs)("div",{className:(0,r.cn)("flex flex-col gap-4",a),onMouseEnter:u?()=>k(!0):void 0,onMouseLeave:u?()=>k(!1):void 0,children:[(0,n.jsxs)("div",{ref:C,onScroll:()=>{R.current=Date.now(),cancelAnimationFrame(A.current),A.current=requestAnimationFrame(()=>{let e=C.current,t=M.current;if(!e||t<=0)return;let a=Math.round(e.scrollLeft/t),n=f?(a%y+y)%y:Math.max(0,Math.min(a,y-1));w(e=>e===n?e:n)}),f&&(window.clearTimeout(L.current),L.current=window.setTimeout(()=>{let e=C.current,t=y*M.current;e&&!(t<=0)&&e.scrollLeft>=t&&e.scrollTo({left:e.scrollLeft-t,behavior:"auto"})},150))},className:(0,r.cn)("flex snap-x snap-mandatory overflow-x-auto overscroll-x-contain [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",null==s?void 0:s.scroller),style:{gap:"".concat(l,"px")},children:[t.map((e,t)=>(0,n.jsx)("div",{ref:0===t?N:void 0,className:(0,r.cn)(d,"snap-start",null==s?void 0:s.slide),children:e.content},e.id)),z.map(e=>
1(0,n.jsx)("div",{"aria-hidden":!0,className:(0,r.cn)(d,"snap-start",null==s?void 0:s.slide),children:e.content},"clone-".concat(e.id))),W>0?(0,n.jsx)("div",{"aria-hidden":!0,className:"shrink-0",style:{width:W}}):null]}),m&&y>1?(0,n.jsx)("div",{className:"flex w-full items-center justify-center",children:(0,n.jsx)("div",{className:(0,r.cn)("mx-auto flex h-fit w-fit items-center justify-center gap-3 rounded-full bg-background px-4 py-3 shadow-elevation-2",null==s?void 0:s.dots),children:t.map((e,t)=>(0,n.jsx)("button",{type:"button","aria-label":"Show slide ".concat(t+1),"aria-current":b===t,onClick:()=>(e=>{let t=C.current,a=M.current;if(!t||a<=0||0===y)return;let n=(e%y+y)%y;t.scrollTo({left:n*a,behavior:"smooth"})})(t),className:(0,r.cn)("size-2 cursor-pointer rounded-full transition-all duration-300",b===t?"bg-foreground":"bg-foreground/15 hover:bg-foreground/30",null==s?void 0:s.dot,b===t&&(null==s?void 0:s.dotActive))},e.id))})}):null]})}},51724:(e,t,a)=>{"use strict";a.d(t,{J:()=>c});var n=a(95155),i=a(12115),r=a(15239),o=a(53350),s=a(68),l=a(61527);function c(e){let{src:t="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 300'%3E%3Crect width='400' height='300' fill='%23e5e5e5'/%3E%3C/svg%3E",alt:a="",shift:c=12,className:d="",container:u,priority:h=!1}=e,m=i.useRef(null),g=i.useRef(null),[p,f]=i.useState(!1);i.useEffect(()=>{let e=g.current;e&&e.complete&&e.naturalWidth>0&&f(!0)},[t]);let y=(0,o.d)(.5),v=i.useCallback(()=>{var e;let t=m.current;if(!t)return;let a=null!=(e=null==u?void 0:u.current)?e:null,n=a?a.getBoundingClientRect().top:0,i=a?a.clientHeight:window.innerHeight,r=t.getBoundingClientRect(),o=i+r.height,s=o>0?(n+i-r.top)/o:.5;y.set(Math.min(1,Math.max(0,s)))},[u,y]);i.useLayoutEffect(()=>{var e;v();let t=null!=(e=null==u?void 0:u.current)?e:window,a=0,n=()=>{a||(a=requestAnimationFrame(()=>{a=0,v()}))};return t.addEventListener("scroll",n,{passive:!0}),window.addEventListener("resize",n,{passive:!0}),()=>{a&&cancelAnimationFrame(a),t.removeEventListener("scroll",n),window.removeEventListener("resize",n)}},[v,u]);let b=(0,s.G)(y,[0,1],["-".concat(c,"%"),"".concat(c,"%")]),w="string"==typeof t&&t.startsWith("data:"),x="string"!=typeof t;return(0,n.jsx)("div",{ref:m,className:"relative w-full overflow-hidden bg-muted ".concat(d),style:d?void 0:{aspectRatio:"4 / 3"},children:(0,n.jsx)(l.P.div,{className:"absolute inset-0 will-change-transform",style:{y:b,scale:1+2*c/100+.01},children:(0,n.jsx)(r.default,{ref:g,src:t,alt:a,fill:!0,sizes:"(min-width: 1024px) 1024px, 100vw",className:"object-cover select-none pointer-events-none transition duration-500 ".concat(p?"blur-0 scale-100":"blur-md scale-105"),draggable:!1,priority:h,placeholder:x?"blur":"empty",onLoad:()=>f(!0),unoptimized:w})})})}},57224:(e,t,a)=>{"use strict";function n(e,t){if(!window.matchMedia)return()=>{};let a=window.matchMedia(e);return a.addEventListener("change",t),()=>{a.removeEventListener("change",t)}}a.d(t,{v:()=>n})},57609:(e,t,a)=>{"use strict";a.d(t,{BlogFeaturedCarousel:()=>o});var n=a(95155),i=a(51105),r=a(27078);function o(e){let{posts:t}=e;if(0===t.length)return null;let a=t.map(e=>({id:e.slug,content:(0,n.jsx)(r.Z,{blog:e,variant:"featured",inCarousel:!0})}));return(0,n.jsx)(i.f,{items:a,slideClassName:"w-full shrink-0",autoPlayMs:6e3})}},60518:(e,t,a)=>{"use strict";a.r(t),a.d(t,{DynamicBackgroundGradientAnimation:()=>s});var n=a(95155),i=a(12115),r=a(25016),o=a(71307);let s=e=>{var t,a,s,l,c;let{gradientBackgroundStart:d,gradientBackgroundEnd:u,firstColor:h,secondColor:m,thirdColor:g,fourthColor:p,fifthColor:f,colors:y,paused:v=!1,pointerColor:b,size:w="80%",blendingValue:x="hard-light",children:k,className:j,interactive:P=!0,containerClassName:T,motionSpeed:S="slow",staticOnMobile:C=!1,transparentShell:N=!1}=e;T=null!=T?T:"absolute inset-0";let M=null!=(t=null==y?void 0:y[0])?t:h,A=null!=(a=null==y?void 0:y[1])?a:m,L=null!=(s=null==y?void 0:y[2])?s:g,R=null!=(l=null==y?void 0:y[3])?l:p,I=null!=(c=null==y?void 0:y[4])?c:f,E=(0,i.useRef)(null),z=(0,i.useRef)(null),[W,F]=(0,i.useState)(0),[B,q]=(0,i.useState)(0),[G,_]=(0,i.useState)(0),[D,H]=(0,i.useState)(0),{mobile:Y}=(0,o.al)(),O=C&&Y,Q=!!(d||u||M||A||L||R||I||b);(0,i.useEffect)(()=>
1{if(N&&!Q)return;let e=N?z.current:document.body;if(e)return e.style.setProperty("--gradient-background-start",d||"rgb(var(--brand-anim-gradient-start))"),e.style.setProperty("--gradient-background-end",u||"rgb(var(--brand-anim-gradient-end))"),e.style.setProperty("--first-color",M||"var(--brand-anim-first)"),e.style.setProperty("--second-color",A||"var(--brand-anim-second)"),e.style.setProperty("--third-color",L||"var(--brand-anim-third)"),e.style.setProperty("--fourth-color",R||"var(--brand-anim-fourth)"),e.style.setProperty("--fifth-color",I||"var(--brand-anim-fifth)"),e.style.setProperty("--pointer-color",b||"var(--brand-anim-pointer)"),e.style.setProperty("--size",w),e.style.setProperty("--blending-value",x),"slow"===S?e.style.setProperty("--animation-speed","1.5"):"fast"===S?e.style.setProperty("--animation-speed","0.7"):e.style.setProperty("--animation-speed","1"),()=>{e.style.removeProperty("--gradient-background-start"),e.style.removeProperty("--gradient-background-end"),e.style.removeProperty("--first-color"),e.style.removeProperty("--second-color"),e.style.removeProperty("--third-color"),e.style.removeProperty("--fourth-color"),e.style.removeProperty("--fifth-color"),e.style.removeProperty("--pointer-color"),e.style.removeProperty("--size"),e.style.removeProperty("--blending-value"),e.style.removeProperty("--animation-speed")}},[d,u,M,A,L,R,I,b,w,x,S,N,Q]),(0,i.useEffect)(()=>{O||E.current&&F(e=>{let t=e+(G-e)/20;return q(e=>{let a=e+(D-e)/20;return E.current&&(E.current.style.transform="translate(".concat(Math.round(t),"px, ").concat(Math.round(a),"px)")),a}),t})},[O,G,D]);let[U,V]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{V(/^((?!chrome|android).)*safari/i.test(navigator.userAgent))},[]),(0,n.jsxs)("div",{ref:z,className:(0,r.cn)("min-h-[100dvh] w-full overflow-hidden",N?"bg-transparent":"bg-[linear-gradient(40deg,var(--gradient-background-start),var(--gradient-background-end))]",T),children:[!O&&(0,n.jsx)("svg",{className:"hidden",children:(0,n.jsx)("defs",{children:(0,n.jsxs)("filter",{id:"blurMe",children:[(0,n.jsx)("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"10",result:"blur"}),(0,n.jsx)("feColorMatrix",{in:"blur",mode:"matrix",values:"1 0 0 0 0  0 1 0 0 0  0 0 1 0 0  0 0 0 18 -8",result:"goo"}),(0,n.jsx)("feBlend",{in:"SourceGraphic",in2:"goo"})]})})}),(0,n.jsx)("div",{className:(0,r.cn)("relative z-10",j),children:k}),!O&&(0,n.jsxs)("div",{className:(0,r.cn)("gradients-container h-full w-full blur-lg absolute inset-0 pointer-events-none z-0",U?"blur-2xl":"[filter:url(#blurMe)_blur(40px)]",v&&"[&>div]:[animation-play-state:paused]"),children:[(0,n.jsx)("div",{className:(0,r.cn)("absolute [background:radial-gradient(circle_at_center,_var(--first-color)_0,_var(--first-color)_50%)_no-repeat]","[mix-blend-mode:var(--blending-value)] w-[var(--size)] h-[var(--size)] top-[calc(50%-var(--size)/2)] left-[calc(50%-var(--size)/2)]","[transform-origin:center_center]","animate-first","opacity-100 anim-duration-slow")}),(0,n.jsx)("div",{className:(0,r.cn)("absolute [background:radial-gradient(circle_at_center,_rgba(var(--second-color),_0.8)_0,_rgba(var(--second-color),_0)_50%)_no-repeat]","[mix-blend-mode:var(--blending-value)] w-[var(--size)] h-[var(--size)] top-[calc(50%-var(--size)/2)] left-[calc(50%-var(--size)/2)]","[transform-origin:calc(50%-400px)]","animate-second","opacity-100 anim-duration-slow")}),(0,n.jsx)("div",{className:(0,r.cn)("absolute [background:radial-gradient(circle_at_center,_rgba(var(--third-color),_0.8)_0,_rgba(var(--third-color),_0)_50%)_no-repeat]","[mix-blend-mode:var(--blending-value)] w-[var(--size)] h-[var(--size)] top-[calc(50%-var(--size)/2)] left-[calc(50%-var(--size)/2)]","[transform-origin:calc(50%+400px)]","animate-third","opacity-100 anim-duration-slow")}),(0,n.jsx)("div",{className:(0,r.cn)("absolute [background:radial-gradient(circle_at_center,_rgba(var(--fourth-color),_0.8)_0,_rgba(var(--fourth-color),_0)_50%)_no-repeat]","[mix-blend-mode:var(--blending-value)] w-[var(--size)] h-[var(--size)] top-[calc(50%-var(--size)/2)] left-[calc(50%-var(--size)/2)]","[transform-origin:calc(50%-200px)]","animate-fourth","opacity-70 anim-duration-slow")}),(0,n.jsx)("div",{className:(0,r.cn)("absolute [background:radial-gradient(circle_at_center,_rgba(var(--fifth-color),_0.8)_0,_rgba(var(--fifth-color),_0)_50%)_no-repeat]","[mix-blend-mode:var(--blending-value)] w-[var(--size)] h-[var(--size)] top-[calc(50%-var(--size)/2)] left-[calc(50%-var(--size)/2)]","[transform-origin:calc(50%-800px)_calc(50%+800px)]","animate-fifth","opacity-100 anim-duration-slow")}),P&&(0,n.jsx)("div",{ref:E,onMouseMove:e=>{if(E.current){let t=E.current.getBoundingClientRect();_(e.clientX-t.left),H(e.clientY-t.top)}},className:(0,r.cn)("absolute [background:radial-gradient(circle_at_center,_rgba(var(--pointer-color),_0.8)_0,_rgba(var(--pointer-color),_0)_50%)_no-repeat]","[mix-blend-mode:var(--blending-value)] w-full h-full -top-1/2 -left-1/2","opacity-70")})]})]})}},63384:(e,t,a)=>{"use strict";a.d(t,{L:()=>n});let n={sm:640,md:768,lg:1024}},69365:(e,t,a)=>{"use strict";a.d(t,{E:()=>l});var n=a(95155),i=a(12115),r=a(83101),o=a(25016);let s=(0,r.F)("",{variants:{size:{sm:"text-sm",base:"text-base",lg:"text-lg",xl:"text-xl","2xl":"text-2xl","3xl":"text-3xl"},weight:{normal:"font-normal",medium:"font-medium",semibold:"font-semibold",bold:"font-bold"},tone:{default:"text-foreground",muted:"text-muted-foreground"}}
1,defaultVariants:{size:"base",weight:"normal",tone:"default"}}),l=i.forwardRef((e,t)=>{let{as:a="p",className:i,size:r,weight:l,tone:c,truncate:d=!1,style:u,children:h,...m}=e;return(0,n.jsx)(a,{ref:t,className:(0,o.cn)(s({size:r,weight:l,tone:c}),!0===d&&"truncate","number"==typeof d&&"overflow-hidden",i),style:"number"==typeof d?{display:"-webkit-box",WebkitBoxOrient:"vertical",WebkitLineClamp:d,...u}:u,...m,children:null!=h?h:"The quick brown fox jumps over the lazy dog"})});l.displayName="Text"},71307:(e,t,a)=>{"use strict";a.d(t,{al:()=>c});var n=a(12115),i=a(63384);let r="(pointer: coarse) and (hover: none)";var o=a(26281),s=a(57224);let l={touchPrimary:!1,narrow:!1,prefersOnScreenInput:!1,native:!1,prefersOnScreenKeyboard:!1,mobile:!1};function c(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.L.md,[t,a]=(0,n.useState)(!1),[c,d]=(0,n.useState)(l);return(0,n.useEffect)(()=>{a(!0);let t=()=>{d(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.L.md,t=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.L.md,t=window.matchMedia(r).matches,a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.L.md;return window.matchMedia("(max-width: ".concat(e,"px)")).matches}(e);return{touchPrimary:t,narrow:a,prefersOnScreenInput:t||a}}(e),a=(0,o.J)(),n=a||t.touchPrimary;return{...t,native:a,prefersOnScreenKeyboard:n,mobile:a||t.prefersOnScreenInput}}(e))};t();let n=(0,s.v)(r,t),l=(0,s.v)(function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i.L.md;return"(max-width: ".concat(e,"px)")}(e),t);return()=>{n(),l()}},[e]),{mobile:c.mobile,env:c,mounted:t}}},71968:(e,t,a)=>{"use strict";a.d(t,{BT:()=>m,Wu:()=>g,ZB:()=>h,Zp:()=>d,aR:()=>u,fP:()=>l,wL:()=>p});var n=a(95155),i=a(12115),r=a(83101),o=a(25016),s=a(4634);let l=(0,r.F)("relative rounded-xl text-foreground transition-all",{variants:{variant:{default:"surface surface-glass-dramatic",subtle:"surface surface-glass-subtle",solid:"border border-border/60 bg-card/40 backdrop-blur"}},defaultVariants:{variant:"default"}}),c={none:"",sm:"p-4",md:"p-6",lg:"p-8"},d=i.forwardRef((e,t)=>{let{className:a,variant:i,interactive:r=!1,padding:d="none",as:u="div",...h}=e;return(0,n.jsx)(u,{ref:t,className:(0,o.cn)(l({variant:i}),c[d],r&&s.e,a),...h})});d.displayName="Card";let u=i.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("flex flex-col space-y-1.5 p-6",a),...i})});u.displayName="CardHeader";let h=i.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("font-semibold leading-none tracking-tight",a),...i})});h.displayName="CardTitle";let m=i.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",a),...i})});m.displayName="CardDescription";let g=i.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("p-6 pt-0",a),...i})});g.displayName="CardContent";let p=i.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)("div",{ref:t,className:(0,o.cn)("flex items-center p-6 pt-0",a),...i})});p.displayName="CardFooter"},73895:(e,t,a)=>{"use strict";a.d(t,{m:()=>c});var n=a(95155),i=a(12115),r=a(21270),o=a(71408),s=a(61527),l=a(25016);function c(e){let{content:t,children:a,containerClassName:c,leading:d=1.625,side:u="top",delayMs:h=80,arrow:m=!1,contentClassName:g,sideOffset:p=10,triggerClassName:f="inline cursor-help"}=e,[y,v]=i.useState(!1),[b,w]=i.useState(!1),x=i.useRef(void 0),k=i.useCallback(e=>{v(e),e&&w(!0)},[]);return i.useEffect(()=>{if(!y)return;let e=()=>v(!1),t=e=>{"Escape"===e.key&&v(!1)};return document.addEventListener("scroll",e,{capture:!0,passive:!0}),window.addEventListener("wheel",e,{passive:!0}),window.addEventListener("touchmove",e,{passive:!0}),window.addEventListener("keydown",t),()=>{document.removeEventListener("scroll",e,{capture:!0}),window.removeEventListener("wheel",e),window.removeEventListener("touchmove",e),window.removeEventListener("keydown",t)}},[y]),(0,n.jsxs)(r.bL,{open:y,onOpenChange:k,openDelay:h,closeDelay:100,children:[(0,n.jsx)(r.l9,{asChild:!0,children:(0,n.jsx)("span",{className:(0,l.cn)(f,"focus-visible:outline-none"),onPointerDown:e=>{x.current=e.pointerType},onClick:e=>{"touch"===x.current&&(e.stopPropagation(),k(!y))},children:a})}),(0,n.jsx)(r.ZL,{children:b?(0,n.jsxs)(r.UC,{forceMount:!0,side:u,align:"center",sideOffset:p,collisionPadding:{top:12,bottom:12,left:16,right:16},className:(0,l.cn)("z-50 outline-none [transform-origin:var(--radix-hover-card-content-transform-origin)]",!y&&"pointer-events-none",g),children:[(0,n.jsx)(o.N,{onExitComplete:()=>w(!1),children:y?(0,n.jsx)(s.P.div,{initial:{opacity:0,y:10,scale:.96}
1,animate:{opacity:1,y:0,scale:1,transition:{type:"spring",stiffness:180,damping:24}},exit:{opacity:0,y:-8,scale:.94,transition:{duration:.18,ease:"easeIn"}},className:(0,l.cn)("w-max max-w-[min(20rem,var(--radix-hover-card-content-available-width),calc(100vw-2rem))] rounded-xl border border-border/80 bg-background/95 p-4 text-sm text-foreground shadow-tooltip backdrop-blur supports-[backdrop-filter]:bg-background/90",c),style:{lineHeight:d},children:t},"tooltip-content"):null}),m&&y?(0,n.jsx)(r.i3,{className:"fill-border/80",width:12,height:6}):null]}):null})]})}},83231:(e,t,a)=>{"use strict";a.d(t,{CodeBlock:()=>p});var n=a(95155),i=a(12115),r=a(31627),o=a(33305),s=a(1003);r.A.registerLanguage("python",o.A),r.A.registerLanguage("markup",s.A);let l=new Set(["python","py","markup","html","xml","svg","mathml","ssml","atom","rss","text","plain","plaintext","none"]),c=(0,i.lazy)(()=>a.e(9653).then(a.bind(a,59653)));var d=a(98397),u=a(571),h=a(25016),m=a(48644),g=a(4014);function p(e){var t,a,o,s,p,f;let{language:y="python",theme:v,chrome:b="overlay",classNames:w,filename:x,highlightLines:k=[],code:j='print("Hello, world!")',tabs:P,showLineNumbers:T=!1,copyButton:S=!0,wrap:C=!1,className:N}=e,[M,A]=(0,i.useState)(0),{isDark:L}=(0,m.Y)("dark");(0,i.useEffect)(()=>{A(0)},[P]);let R=null==P?void 0:P[M],I=null!=(a=null!=(t=null==R?void 0:R.code)?t:j)?a:"",E=null!=(o=null==R?void 0:R.language)?o:y,z=l.has(E.toLowerCase())?r.A:c,W=null!=(p=null!=(s=null==R?void 0:R.filename)?s:x)?p:null==R?void 0:R.name,F=null!=(f=null==R?void 0:R.highlightLines)?f:k,B=(0,i.useMemo)(()=>new Set(F),[F]),q=(v?"dark"===v:L)?d.A:u.A,G=!!(W||(null==P?void 0:P.length)),_="bar"===b,D=_?"":"surface surface-glass-subtle";return(0,n.jsx)(i.Suspense,{fallback:null,children:(0,n.jsxs)("figure",{className:(0,h.cn)("not-prose relative my-6 overflow-hidden rounded-2xl text-foreground shadow-elevation-1",_?"":"surface surface-glass-dramatic",N,null==w?void 0:w.container),children:[_&&(G||S)?(0,n.jsxs)("figcaption",{className:(0,h.cn)("flex items-center justify-between gap-2 px-3 py-2",null==w?void 0:w.header),children:[(0,n.jsx)("div",{className:"flex min-w-0 flex-1 items-center",children:(null==P?void 0:P.length)?(0,n.jsx)("div",{className:"flex min-w-0 flex-wrap items-center gap-1",children:P.map((e,t)=>(0,n.jsx)("button",{type:"button",onClick:()=>(0,i.startTransition)(()=>A(t)),className:(0,h.cn)("rounded-lg px-2.5 py-1 text-xs font-medium transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",t===M?"bg-muted text-foreground shadow-elevation-1 dark:bg-white/10":"text-muted-foreground hover:bg-muted/70 hover:text-foreground dark:hover:bg-white/10"),children:e.name},"".concat(e.name,"-").concat(t)))}):W?(0,n.jsx)("span",{className:"truncate rounded-lg px-2.5 py-1 font-mono text-xs font-medium text-inherit opacity-80",children:W}):null}),S?(0,n.jsx)(g.M,{text:I,surfaceClassName:"bg-transparent shadow-none"}):null]}):null,!_&&G?(0,n.jsx)("figcaption",{className:(0,h.cn)("pointer-events-none absolute left-3 right-14 top-3 z-10 flex min-w-0 items-center",null==w?void 0:w.header),children:(null==P?void 0:P.length)?(0,n.jsx)("div",{className:(0,h.cn)("pointer-events-auto flex min-w-0 flex-wrap items-center gap-1 rounded-xl p-1 shadow-elevation-1",D),children:P.map((e,t)=>(0,n.jsx)("button",{type:"button",onClick:()=>(0,i.startTransition)(()=>A(t)),className:(0,h.cn)("rounded-lg px-2.5 py-1 text-xs font-medium transition-colors duration-200","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background",t===M?"bg-muted text-foreground shadow-elevation-1 dark:bg-white/10":"text-muted-foreground hover:bg-muted/70 hover:text-foreground dark:hover:bg-white/10"),children:e.name},"".concat(e.name,"-").concat(t)))}):(0,n.jsx)("span",{className:(0,h.cn)("pointer-events-auto truncate rounded-lg px-2.5 py-1 font-mono text-xs font-medium text-muted-foreground shadow-elevation-1",D),children:W})}):null,!_&&S?(0,n.jsx)("div",{className:"absolute right-3 top-3 z-10",children:(0,n.jsx)(g.M,{text:I,surfaceClassName:D})}):null,(0,n.jsx)("div",{className:(0,h.cn)("overflow-x-auto",_&&"[&_pre]:!bg-transparent [&_code]:!bg-transparent",null==w?void 0:w.code),children:(0,n.jsx)(z,{language:E,style:q,showLineNumbers:T,wrapLongLines:C,wrapLines:!0,lineProps:e=>({className:B.has(e)?"block bg-primary/10 border-l-2 border-primary":"block border-l-2 border-transparent"}),customStyle:{margin:0,padding:_?"1rem":G?"3.75rem 3.75rem 1rem 1rem":"1rem 3.75rem 1rem 1rem",background:"transparent",backgroundColor:"transparent",fontSize:"0.875rem",lineHeight:"1.7"},codeTagProps:{className:"font-mono",style:{background:"transparent",backgroundColor:"transparent"}},children:I})})]})})}},94667:(e,t,a)=>{"use strict";a.d(t,{C:()=>l,j:()=>s});var n=a(95155),i=a(25016);let r={bottom:"inset-x-0 bottom-0",top:"inset-x-0 top-0"},o={bottom:"to top",top:"to bottom"};function s(e){let{className:t,position:a="bottom",mode:s="darken",intensity:l="medium",blur:c=2,size:d,color:u}=e,h=o[a],m={};m["--scrim-direction"]=h,d&&(m["--scrim-size"]=d),u&&(m["--scrim-color"]=u);let g="linear-gradient(".concat(h,", transparent 0, black 8px, black 30%, transparent), ")+"linear-gradient(to right, transparent 0, black 32px, black calc(100% - 32px), transparent 100%)";return(0,n.jsx)("div",{"aria-hidden":!0,style:m,className:(0,i.cn)("media-scrim pointer-events-none absolute z-10",r[a],"lighten"===s&&"media-scrim-lighten","medium"!==l&&"media-scrim-".concat(l),t),children:c>0?(0,n.jsx)("div",{className:"absolute inset-0",style:{backdropFilter:"blur(".concat(c,"px)"),WebkitBackdropFilter:"blur(".concat(c,"px)"),maskImage:g,maskComposite:"intersect"}}):null})}function l(e){return(0,n.jsx)(s,{...e})}},94762:(e,t,a)=>{"use strict";a.d(t,{M:()=>o,Y:()=>s});var n=a(95155),i=a(12115),r=a(25016);function o(e){let{children:t,className:a,textClassName:o,minFontSize:s=32,maxFontSize:l=128,unfittedFontSize:c,as:d="span"}=e,u=i.useRef(null),h=i.useRef(null),[m,g]=i.useState(null);return i.useLayoutEffect(()=>{var e;let t=u.current,a=h.current;if(!t||!a)return;let n=-1,i=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=t.clientWidth;if(!i||!e&&i===n)return;n=i;let r=a.style.transition;a.style.transition="none";try{let e=s,t=l,n=s;for(;e<=t;){let r=Math.floor((e+t)/2);a.style.fontSize="".concat(r,"px"),a.scrollWidth<=i?(n=r,e=r+1):t=r-1}a.style.fontSize="".concat(n,"px"),g(n)}finally{a.style.transition=r}};i(!0);let r=new ResizeObserver(()=>i());
1return r.observe(t),null==(e=document.fonts)||e.ready.then(()=>i(!0)),()=>r.disconnect()},[t,s,l]),(0,n.jsx)(d,{ref:u,style:{lineHeight:1},className:(0,r.cn)("block w-full text-center",a),children:(0,n.jsx)("span",{ref:h,className:(0,r.cn)("inline-block whitespace-nowrap",o),style:{fontSize:null!==m?m:null!=c?c:l},children:t})})}function s(e){let{children:t,className:a,align:o="center"}=e,s=i.useRef(null),l=i.useRef(null);return i.useLayoutEffect(()=>{let e=s.current,t=l.current;if(!e||!t)return;let a=0,n=0,i=1,r=new ResizeObserver(r=>{for(let i of r)if(i.target===e){let t=getComputedStyle(e);a=Math.round(i.contentRect.width+(Number.parseFloat(t.paddingLeft)||0)+(Number.parseFloat(t.paddingRight)||0))}else i.target===t&&(n=Math.round(i.contentRect.width));let o=n>0&&a>0?Math.min(1,a/n):1;o!==i&&(t.style.transform="scale(".concat(o,")"),i=o)});return r.observe(e),r.observe(t),()=>r.disconnect()},[]),(0,n.jsx)("span",{ref:s,style:{lineHeight:1},className:(0,r.cn)("flex w-full items-center overflow-hidden","left"===o?"justify-start":"right"===o?"justify-end":"justify-center",a),children:(0,n.jsx)("span",{ref:l,className:(0,r.cn)("inline-flex w-max flex-none items-center whitespace-nowrap","left"===o?"origin-left":"right"===o?"origin-right":"origin-center"),style:{transform:"scale(1)"},children:t})})}}},e=>{e.O(0,[4206,8364,7618,1527,4909,1356,1135,7664,1543,1957,1412,4968,1711,9790,1270,6814,7116,456,4438,484,3434,6260,4174,1092,7938,7172,1918,8583,2210,8441,8874,7358],()=>e(e.s=33968)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.