(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4258],{16514:(e,r,a)=>{"use strict";a.d(r,{Browser:()=>i});var s=a(27507),t=a(84173),l=a(42199);function n(e){let{index:r,blocking:a,className:l}=e,n=(0,t.useRef)();return(0,t.useEffect)(()=>{let e=setInterval(()=>{n.current&&(n.current.style.animation="fadeout 0.5s ease forwards",n.current.children[0]&&(n.current.children[0].style.animation=""),setTimeout(()=>{n.current&&(n.current.style.width=(.6*Math.random()+.2)*100+"%",n.current.style.animation="fadein 0.4s ease ".concat(.2*r,"s forwards"),n.current.children[0]&&(n.current.children[0].style.animation="slideout .4s ease ".concat(.2*r,"s forwards")))},800))},4e3);return()=>clearInterval(e)},[]),(0,s.jsx)("div",{className:l+" browser-skeleton",style:{opacity:0,animation:"fadein 0.4s ease ".concat(.2*r,"s forwards"),transformOrigin:"left"},ref:n,children:a?null:(0,s.jsx)("span",{style:{animation:"slideout .4s ease ".concat(.2*r,"s forwards")}})})}function i(e){let{highlight:r,blocking:a}=e;return(0,s.jsx)("div",{className:"not-prose h-56 w-full px-4 flex items-center justify-center",children:(0,s.jsxs)("div",{className:(0,l.Z)("w-64 max-w-full h-48 border rounded-md shadow bg-white dark:bg-black duration-700 transition-transform",r?"border-neutral-300 dark:border-neutral-700 ":""),style:{animation:"fadein .5s ease"},children:[(0,s.jsxs)("div",{className:(0,l.Z)("flex bg-gray-400/5 dark:bg-gray-600/5 p-1 border-b gap-1 ",r?"border-neutral-300 dark:border-neutral-700":""),children:[(0,s.jsx)("div",{className:"border rounded-full w-2 h-2 bg-red-600"}),(0,s.jsx)("div",{className:"border rounded-full w-2 h-2 bg-amber-500"}),(0,s.jsx)("div",{className:"border rounded-full w-2 h-2 bg-green-600"})]}),(0,s.jsxs)("div",{className:"p-4 animate-pulse relative overflow-hidden",children:[(0,s.jsx)(n,{blocking:a,index:a?6.5:0,className:(0,l.Z)("h-2 w-2/3 rounded",r?"bg-gray-400 dark:bg-gray-600 opacity-80":"bg-gray-300 dark:bg-gray-700 opacity-80")}),(0,s.jsx)(n,{blocking:a,index:a?6.5:1,className:(0,l.Z)("h-2 w-1/2 mt-2 rounded",r?"bg-gray-400 dark:bg-gray-600 opacity-80":"bg-gray-300 dark:bg-gray-700 opacity-80")}),(0,s.jsx)(n,{blocking:a,index:a?6.5:2,className:(0,l.Z)("h-2 w-1/2 mt-2 rounded",r?"bg-gray-400 dark:bg-gray-600 opacity-80":"bg-gray-300 dark:bg-gray-700 opacity-80")}),(0,s.jsx)(n,{blocking:a,index:a?6.5:3,className:(0,l.Z)("h-2 w-3/4 mt-2 rounded",r?"bg-gray-400 dark:bg-gray-600 opacity-80":"bg-gray-300 dark:bg-gray-700 opacity-80")}),(0,s.jsx)(n,{blocking:a,index:a?6.5:4,className:(0,l.Z)("h-2 w-2/3 mt-2 rounded",r?"bg-gray-400 dark:bg-gray-600 opacity-80":"bg-gray-300 dark:bg-gray-700 opacity-80")}),(0,s.jsx)(n,{blocking:a,index:a?6.5:5,className:(0,l.Z)("h-2 w-1/4 mt-2 rounded",r?"bg-gray-400 dark:bg-gray-600 opacity-80":"bg-gray-300 dark:bg-gray-700 opacity-80")}),(0,s.jsx)(n,{blocking:a,index:a?6.5:6,className:(0,l.Z)("h-2 w-1/2 mt-2 rounded",r?"bg-gray-400 dark:bg-gray-600 opacity-80":"bg-gray-300 dark:bg-gray-700 opacity-80")}),(0,s.jsx)(n,{blocking:a,index:a?6.5:7,className:(0,l.Z)("h-2 w-1/2 mt-2 rounded",r?"bg-gray-400 dark:bg-gray-600 opacity-80":"bg-gray-300 dark:bg-gray-700 opacity-80")}),(0,s.jsx)(n,{blocking:a,index:a?6.5:8,className:(0,l.Z)("h-2 w-1/2 mt-2 rounded",r?"bg-gray-400 dark:bg-gray-600 opacity-80":"bg-gray-300 dark:bg-gray-700 opacity-80")})]})]})})}},58437:(e,r,a)=>{"use strict";a.r(r),a.d(r,{Card:()=>b,ExampleCard:()=>w,ExampleCards:()=>Z,FeatureCard:()=>v,FrameworkCard:()=>k,IntegrationCard:()=>y,ModelCard:()=>N,TweetCard:()=>j,UIPreviewCard:()=>_,UIPreviewWide:()=>C});var s=a(27507),t=a(67400),l=a(69856),n=a(13913),i=a(1922),o=a(84173),c=a(55308),d=a(59534),x=a(19925),g=a(39588),u=a(57175),h=a(19454),m=a(87402);let p=e=>{let{className:r}=e;return(0,s.jsx)("svg",{className:"w-5 h-5 p-0.5 "+r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"M7.49933 0.25C3.49635 0.25 0.25 3.49593 0.25 7.50024C0.25 10.703 2.32715 13.4206 5.2081 14.3797C5.57084 14.446 5.70302 14.2222 5.70302 14.0299C5.70302 13.8576 5.69679 13.4019 5.69323 12.797C3.67661 13.235 3.25112 11.825 3.25112 11.825C2.92132 10.9874 2.44599 10.7644 2.44599 10.7644C1.78773 10.3149 2.49584 10.3238 2.49584 10.3238C3.22353 10.375 3.60629 11.0711 3.60629 11.0711C4.25298 12.1788 5.30335 11.8588 5.71638 11.6732C5.78225 11.205 5.96962 10.8854 6.17658 10.7043C4.56675 10.5209 2.87415 9.89918 2.87415 7.12104C2.87415 6.32925 3.15677 5.68257 3.62053 5.17563C3.54576 4.99226 3.29697 4.25521 3.69174 3.25691C3.69174 3.25691 4.30015 3.06196 5.68522 3.99973C6.26337 3.83906 6.8838 3.75895 7.50022 3.75583C8.1162 3.75895 8.73619 3.83906 9.31523 3.99973C10.6994 3.06196 11.3069 3.25691 11.3069 3.25691C11.7026 4.25521 11.4538 4.99226 11.3795 5.17563C11.8441 5.68257 12.1245 6.32925 12.1245 7.12104C12.1245 9.9063 10.4292 10.5192 8.81452 10.6985C9.07444 10.9224 9.30633 11.3648 9.30633 12.0413C9.30633 13.0102 9.29742 13.7922 9.29742 14.0299C9.29742 14.2239 9.42828 14.4496 9.79591 14.3788C12.6746 13.4179 14.75 10.7025 14.75 7.50024C14.75 3.49593 11.5036 0.25 7.49933 0.25Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})},f=e=>{let{className:r}=e;return(0,s.jsx)("svg",{className:"w-5 h-5 "+r,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M12 4L3 20H21L12 4Z",fill:"currentColor"})})};function b(e){let{title:r,description:a,children:t,badges:l,compact:n,fill:i,topTitle:o,sharp:c}=e,d=(0,s.jsx)("p",{className:"text-lg font-semibold leading-tight tracking-tight text-neutral-800 dark:text-neutral-100",children:r});return(0,s.jsxs)("div",{className:"dark:bg-neutral-950 ".concat(i&&"h-full w-full flex flex-col justify-between"," transition-all border not-prose ").concat(c?"":"rounded-lg"," shadow-sm border-gray-200 hover:border-gray-300 relative hover:shadow-neutral-800/5 hover:shadow-lg\n      ").concat(n?"px-4 py-4":"px-6 py-6"),children:[o&&d,(0,s.jsx)("div",{className:"flex ".concat(i?"flex-1 overflow-visible":""," items-center justify-center overflow-hidden z-10"),children:t}),(0,s.jsxs)("div",{className:"mt-2",children:[!o&&d,(0,s.jsx)("p",{className:"mt-1 text-sm text-neutral-500",children:a}),(0,s.jsx)("div",{children:l})]})]})}function j(e){let{author:r,username:a,avatar:l,children:n,tweetId:i}=e;return(0,s.jsx)(t.default,{href:"https://x.com/".concat(a,"/status/").concat(i),target:"_blank",rel:"noopener noreferrer",children:(0,s.jsx)("div",{className:"sm:min-w-[250px] relative xl:z-20 text-left transition-[transform] scale-100 hover:scale-[102%] duration-300",children:(0,s.jsx)(b,{compact:!0,className:"border-none",children:(0,s.jsxs)("div",{className:"w-full",children:[(0,s.jsxs)("div",{className:"flex items-center mb-2",children:[(0,s.jsx)("img",{src:l,alt:"".concat(r,"'s avatar"),className:"w-12 h-12 mr-3 rounded-full"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-bold text-[15px] text-neutral-900 dark:text-neutral-100",children:r}),(0,s.jsxs)("p",{className:"text-[15px] text-neutral-500",children:["@",a]})]})]}),(0,s.jsx)("div",{className:"text-[15px] text-neutral-700 dark:text-neutral-300 mt-2",children:n})]})})})})}function w(e){let{title:r,description:a,children:t,demoUrl:l,repoUrl:n,deployUrl:i}=e;return(0,s.jsxs)("div",{onClick:e=>{"A"!==e.target.tagName&&(e.preventDefault(),window.open(l||n,"_blank"))},className:"overflow-hidden transition-all border rounded-lg shadow-sm cursor-pointer group border-neutral-300/70 hover:border-neutral-300 hover:shadow-lg hover:shadow-neutral-800/5",children:[(0,s.jsx)("div",{className:"relative",children:(0,s.jsx)("div",{className:"flex items-center justify-center select-none pointer-events-none opacity-90 group-hover:opacity-100 transition-opacity aspect-[2/1]",children:t})}),(0,s.jsxs)("div",{className:"px-6 pt-6 pb-4 bg-neutral-100 group-hover:bg-neutral-50",children:[(0,s.jsx)("p",{className:"text-lg font-bold tracking-tight text-neutral-800",children:r}),(0,s.jsx)("p",{className:"mt-1 text-neutral-500",children:a})]}),(0,s.jsxs)("div",{className:"flex items-center justify-start w-full px-3 pb-4 select-none whitespace-nowrap bg-neutral-100 group-hover:bg-neutral-50",children:[(0,s.jsxs)("a",{href:n,target:"_blank",className:"transition-colors group flex items-center justify-center gap-1 py-2 px-3 font-medium tracking-tight text-[15px] text-center text-neutral-900",children:[(0,s.jsx)(p,{className:"transition-colors text-neutral-500 group-hover:text-neutral-800"}),"View Repo"]}),(0,s.jsxs)("a",{href:i,target:"_blank",className:"transition-colors group flex items-center justify-center gap-1 py-2 px-3 font-medium tracking-tight text-[15px] text-center text-neutral-900",children:[(0,s.jsx)(f,{className:"transition-colors text-neutral-500 group-hover:text-neutral-800"}),"Deploy to Vercel"]})]})]})}function y(e){let{href:r,title:a,description:n}=e;return(0,s.jsxs)(t.default,{href:r,className:"p-6 transition-all border border-gray-200 rounded-lg shadow-lg group hover:border-gray-300 shadow-transparent hover:shadow-neutral-800/5",children:[(0,s.jsxs)("span",{className:"flex items-end justify-between mb-3",children:[(0,s.jsx)("span",{className:"block text-lg font-semibold tracking-tight text-gray-800",children:a}),(0,s.jsx)(l.Z,{className:"w-6 h-6 text-gray-200 transition-colors duration-300 stroke-2 group-hover:text-gray-400"})]}),(0,s.jsx)("span",{className:"text-sm text-gray-500 leading-[1.4rem] block group-hover:text-gray-600 transition-colors duration-300",children:n})]})}function v(e){let{href:r,title:a,description:l,children:n}=e;return(0,s.jsx)(t.default,{href:r,children:(0,s.jsx)("div",{className:"sm:w-[250px] h-96 relative xl:z-20 text-left transition-[transform] scale-100 hover:scale-[102%] duration-300",children:(0,s.jsx)(b,{title:a,description:l,fill:!0,compact:!0,sharp:!0,children:n})})})}function N(e){let{href:r,title:a,color:l,children:n,features:i}=e,o=(0,s.jsxs)("div",{className:"flex flex-row flex-wrap w-full gap-2 text-gray-900",children:[(null==i?void 0:i.image)&&(0,s.jsx)(c.C,{icon:(0,s.jsx)(g.E,{alt:"feature-icon"}),text:"Only selected models in GPT-4",variant:"gray-subtle",children:"Image Input"}),(null==i?void 0:i.object)&&(0,s.jsx)(c.C,{icon:(0,s.jsx)(x.D,{}),variant:"gray-subtle",children:"Object Generation"}),(null==i?void 0:i.tool)&&(0,s.jsx)(c.C,{icon:(0,s.jsx)(h.J,{}),variant:"gray-subtle",children:"Tool Usage"}),(null==i?void 0:i.stream)&&(0,s.jsx)(c.C,{icon:(0,s.jsx)(u.U,{}),variant:"gray-subtle",children:"Tool Streaming"}),0===Object.keys(i).length&&(0,s.jsx)(c.C,{icon:(0,s.jsx)(d.x,{}),variant:"gray-subtle",children:"Provider Dependent"})]});return(0,s.jsx)(t.default,{href:r,children:(0,s.jsxs)(b,{title:a,badges:o,compact:!0,topTitle:!0,children:[(0,s.jsx)("div",{className:"flex items-center justify-center min-h-36",children:n}),(0,s.jsxs)("svg",{className:"absolute top-0 left-0 w-full h-full pointer-events-none",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("radialGradient",{id:"".concat(l,"-glow"),children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#".concat(l,"19")}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#".concat(l,"00")})]})}),(0,s.jsx)("ellipse",{cx:"50%",cy:"0%",rx:"54%",ry:"20%",fill:"url(#".concat(l,"-glow)")})]})]})})}function k(e){let{href:r,title:a,color:l,children:n}=e;return(0,s.jsx)(t.default,{href:r,children:(0,s.jsxs)(b,{title:a,compact:!0,children:[(0,s.jsx)("div",{className:"flex items-center justify-center h-40 pt-8",children:n}),(0,s.jsxs)("svg",{className:"absolute top-0 left-0 w-full h-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[(0,s.jsx)("defs",{children:(0,s.jsxs)("radialGradient",{id:"".concat(l,"-glow"),children:[(0,s.jsx)("stop",{offset:"0%",stopColor:"#".concat(l,"19")}),(0,s.jsx)("stop",{offset:"100%",stopColor:"#".concat(l,"00")})]})}),(0,s.jsx)("ellipse",{cx:"50%",cy:"0%",rx:"54%",ry:"20%",fill:"url(#".concat(l,"-glow)")})]})]})})}function _(e){let{title:r,description:a,children:t}=e,[l,c]=(0,o.useState)(!1);return(0,s.jsxs)("div",{className:"transition-all border border-gray-200 rounded-lg shadow-lg hover:border-gray-300 shadow-transparent hover:shadow-neutral-800/5",children:[(0,s.jsx)("div",{className:"flex items-center justify-center overflow-hidden",children:(0,o.cloneElement)(t,{isPlaying:l})}),(0,s.jsxs)("div",{className:"flex flex-col gap-2 mx-6 mt-2 mb-6",children:[(0,s.jsxs)("div",{className:"flex flex-row justify-between",children:[(0,s.jsx)("p",{className:"text-lg font-semibold tracking-tight text-neutral-800",children:r}),(0,s.jsxs)("button",{type:"submit",className:"inline-flex items-center rounded shadow px-2 py-1.5 font-sans text-xs text-gray-400 !bg-zinc-900 hover:!bg-zinc-700 transition-colors",onClick:()=>{c(e=>!e)},children:[(0,s.jsx)("span",{className:"sr-only",children:"Play"}),l?(0,s.jsx)(i.Z,{className:"w-4 h-4 fill-white stroke-white","aria-hidden":"true"}):(0,s.jsx)(n.Z,{className:"w-4 h-4 fill-white stroke-none","aria-hidden":"true"})]})]}),(0,s.jsx)("p",{className:"mt-1 text-neutral-500",children:a})]})]})}function C(e){let{children:r}=e;return(0,s.jsx)("div",{className:"flex flex-row items-center justify-center transition-all border border-gray-200 rounded-lg shadow-lg hover:border-gray-300 shadow-transparent hover:shadow-neutral-800/5",children:(0,s.jsx)("div",{className:"flex items-center justify-center w-full overflow-hidden sm:w-96",children:(0,o.cloneElement)(r,{isPlaying:!0})})})}let Z=()=>(0,s.jsxs)("div",{className:"grid w-full grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,s.jsx)(k,{title:"Next.js App Router",href:"/examples/next-app",color:"000000",children:(0,s.jsx)(m.Wk,{size:78})}),(0,s.jsx)(k,{title:"Next.js Pages Router",href:"/examples/next-pages",color:"000000",children:(0,s.jsx)(m.Wk,{size:78})}),(0,s.jsx)(k,{title:"Node.js",href:"/examples/node",color:"73B054",children:(0,s.jsx)(m.qh,{size:78})})]})},26632:(e,r,a)=>{"use strict";a.d(r,{MusicPlayer:()=>m});var s=a(27507),t=a(64916),l=a(72401),n=a(53172),i=a(74627),o=a(26718),c=a(45280),d=a(12374),x=a.n(d),g=a(84173),u=a(42199);function h(){return(0,s.jsx)("svg",{"aria-hidden":!0,className:x().tail,fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",children:(0,s.jsx)("path",{d:"M10 0H0V5C0 13.2842 6.71582 20 15 20H20C14.4771 20 10 15.5229 10 10V0Z",className:"fill-white dark:fill-black"})})}function m(){let[e]=(0,g.useState)(!1),r=(0,g.useRef)(null);return(0,s.jsxs)("div",{className:"mx-10 my-4 h-44",children:[(0,s.jsxs)("div",{className:"relative drop-shadow-[0px_0px_1px_rgba(0,0,0,0.3)] dark:drop-shadow-[0px_0px_1px_theme(colors.zinc.500)] transform-gpu",children:[(0,s.jsx)("div",{className:"bottom-0 left-0 text-white absolute -scale-x-100",children:(0,s.jsx)(h,{})}),(0,s.jsx)("div",{className:"mb-4 w-fit rounded-full px-4 py-2 z-10 bg-white dark:bg-black text-sm text-gray-900 dark:text-white",children:"Make a music player"})]}),(0,s.jsx)("div",{"aria-hidden":!0,className:"bg-background-100 w-full overflow-hidden rounded-md shadow-[0px_4px_12px_rgba(0,0,0,0.1)]",style:{height:136},children:(0,s.jsx)("div",{className:(0,u.W)("flex justify-between p-3 pr-4 w-56"),children:(0,s.jsxs)(c.m.div,{animate:{width:"100%"},className:"flex flex-col",initial:!1,transition:{duration:.4,ease:[.77,0,.175,1],delay:.6},children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"bg-background-200 border-gray-alpha-400 h-12 w-12 rounded-sm border"}),(0,s.jsxs)("div",{className:"flex flex-col items-start gap-0.5",children:[(0,s.jsx)(c.m.div,{className:"flex flex-col items-start gap-0.5",children:(0,s.jsx)(o.x,{weight:500,children:"Blowin’ in the Wind"})},"title"),(0,s.jsx)(c.m.div,{className:"flex flex-col items-start gap-0.5",children:(0,s.jsx)(o.x,{color:"gray-900",weight:500,children:"Bob Dylan"})},"actions")]})]}),(0,s.jsx)(i.fC,{className:"relative flex h-1.5 w-full touch-none select-none items-center pt-4",defaultValue:[35],max:100,step:1,children:(0,s.jsx)(i.fQ,{className:"relative h-[6px] grow rounded-full bg-gray-400",children:e?(0,s.jsx)(i.e6,{className:"absolute h-full rounded-full bg-teal-600",ref:r}):(0,s.jsx)(c.m.div,{className:"absolute h-full w-[36%] rounded-full bg-teal-600",children:(0,s.jsx)(c.m.div,{className:"bg-background-100 border-gray-alpha-400 absolute right-[-6px] top-1/2 block h-4 w-4 -translate-y-1/2 rounded-full border focus:outline-none"})})})}),(0,s.jsxs)("div",{className:"mt-3 flex items-center justify-between",children:[(0,s.jsx)("button",{"aria-label":"Go to previous track",className:"bg-background-100 hover:bg-background-200 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full p-0 text-gray-900 shadow-md transition-colors",tabIndex:-1,type:"button",children:(0,s.jsx)(l.R,{})}),(0,s.jsx)("button",{"aria-label":"Play",className:"bg-background-100 hover:bg-background-200 flex h-9 w-9 cursor-pointer items-center justify-center rounded-full p-0 text-gray-900 shadow-md transition-colors",tabIndex:-1,type:"button",children:(0,s.jsx)(t.z,{className:"mr-[-1px]"})}),(0,s.jsx)("button",{"aria-label":"Go to previous track",className:"bg-background-100 hover:bg-background-200 flex h-8 w-8 cursor-pointer items-center justify-center rounded-full p-0 text-gray-900 shadow-md transition-colors",tabIndex:-1,type:"button",children:(0,s.jsx)(n.j,{})})]})]})})})]})}},54748:e=>{e.exports={ring:"framework-circles_ring__QX5KS",rotate:"framework-circles_rotate__snDMJ",outerRingMask:"framework-circles_outerRingMask__0mqSD",innerRingMask:"framework-circles_innerRingMask__4CPHa"}},12374:e=>{e.exports={"message-item":"message_message-item__mj5b9","message-bubble":"message_message-bubble___SrGP","message-name":"message_message-name__RLDYj","message-avatar":"message_message-avatar__LBTfc","message-content":"message_message-content__H2ww2",tail:"message_tail__csqNs",url:"message_url__bsD3y","green-background":"message_green-background__n_pKH"}},58598:e=>{e.exports={wrapper:"vercel-ai_wrapper__bOQF0",labels:"vercel-ai_labels__5DIH6",label:"vercel-ai_label__UAByc","colorful-lines":"vercel-ai_colorful-lines__Xrz30",vercel:"vercel-ai_vercel__letVl","icon-wrapper":"vercel-ai_icon-wrapper__0IXBl","window-wrapper":"vercel-ai_window-wrapper__2BYZp",window:"vercel-ai_window__knHig"}}}]);