PageSourceSearch

https://svelte.dev/_app/immutable/nodes/0.DG3tp3_o.js

js svelte.dev collected 2026-09-24 06:50:08 UTC 15,077 bytes, 1 lines download raw bytes

1import{$ as e,A as t,C as n,D as r,Et as i,G as a,H as o,I as s,J as c,L as l,Mt as u,O as d,Ot as f,Rt as p,St as m,Tt as h,Ut as g,V as _,Wt as v,Y as y,_t as b,at as x,bt as S,c as ee,dt as C,et as w,gt as te,ht as T,jt as ne,l as E,q as D,st as re,t as ie,tt as O,w as k,xt as A,y as j,yt as M,z as N,zt as P}from"../chunks/ADgAMhAY.js";import{c as ae,d as F,i as oe,l as se,n as I,r as L}from"../chunks/DrRLr3pK.js";import"../chunks/DYrviY11.js";import{r as R}from"../chunks/9UEQW3Ry.js";import"../chunks/tTSrAR-7.js";import{o as ce,r as le}from"../chunks/DCcLtfKt.js";import{i as z,n as ue,r as de,t as B}from"../chunks/BH-e7qfU.js";import{n as V,t as fe}from"../chunks/B3VH3IKy.js";import{i as pe,r as H,t as U}from"../chunks/mf4J78rW.js";import{r as me}from"../chunks/G6Q6idGW.js";import"../chunks/CBCSvp1g.js";var W=y(`<h3 class="svelte-3iokpk"> </h3>`),G=y(`<li class="svelte-3iokpk"><a class="svelte-3iokpk"> </a></li>`),K=y(`<li class="svelte-3iokpk"><!> <ul class="svelte-3iokpk"></ul></li>`),q=y(`<ul class="svelte-3iokpk"></ul>`),J=y(`<h2 class="svelte-3iokpk"><a class="svelte-3iokpk"> <span class="visually-hidden"> </span></a></h2> <!>`,1),Y=y(`<nav class="svelte-3iokpk"></nav>`);function he(e,t){P(t,!0);let r=ie(t,`contents`,19,()=>[]),o=i(void 0);_(()=>{c()});async function c(){let e=x(o).querySelector(`[aria-current="page"]`);if(!e){x(o).scrollTop=0;return}let t=x(o).offsetHeight/2,n=e.offsetHeight/2,r=e.offsetTop-t+n;requestAnimationFrame(()=>x(o).scrollTop=r)}var u={scrollToActive:c},d=Y();return s(d,21,r,l,(e,i,o)=>{var c=J(),u=A(c),d=S(u),f=S(d),p=m(f),h=S(p,!0);v(p),v(d),v(u);var g=m(u,2),_=e=>{var t=q();n(t,`--index: ${o}`),s(t,21,()=>x(i).sections,l,(e,t,n,r)=>{let i=()=>x(t).title,o=()=>x(t).sections;var c=K(),u=S(c),d=e=>{var t=W(),n=S(t,!0);v(t),T(()=>a(n,i())),D(e,t)};N(u,e=>{i()&&e(d)});var f=m(u,2);s(f,21,o,l,(e,t,n,r)=>{let i=()=>x(t).path,o=()=>x(t).title;var s=G(),c=S(s),l=S(c,!0);v(c),v(s),T(()=>{j(c,`href`,i()),j(c,`aria-current`,i()===R.url.pathname?`page`:void 0),a(l,o())}),D(e,s)}),v(f),v(c),D(e,c)}),v(t),T(()=>j(t,`id`,x(i).title)),D(e,t)};N(g,e=>{x(i).sections.length!==0&&e(_)}),T(()=>{n(u,`--index: ${o}; --reverse-index: ${r().length-o-1}`),j(d,`href`,`#${x(i).title??``}`),a(f,`${x(i).title??``} `),a(h,t.title)}),D(e,c)}),v(d),ee(d,e=>h(o,e),()=>x(o)),D(e,d),p(u)}var X=y(`<button class="raised icon svelte-111p50s"><!></button>`),ge=y(`<li class="svelte-111p50s"><a class="svelte-111p50s"> </a> <!></li>`),_e=y(`<!> <div class="menu svelte-111p50s"><div class="mobile-main-menu svelte-111p50s"><div></div> <div class="clip svelte-111p50s"><div><div class="universal svelte-111p50s"><div class="contents svelte-111p50s"><ul class="svelte-111p50s"></ul> <hr class="svelte-111p50s"/> <ul class="svelte-111p50s"><li class="svelte-111p50s"><a href="/chat" class="svelte-111p50s">Discord</a></li> <li class="svelte-111p50s"><a href="https://bsky.app/profile/svelte.dev" class="svelte-111p50s">Bluesky</a></li> <li class="svelte-111p50s"><a href="https://github.com/sveltejs" class="svelte-111p50s">GitHub</a></li></ul></div></div> <div class="context svelte-111p50s"><!></div> <label class="back-button svelte-111p50s"><button class="raised icon svelte-111p50s"><!></button> <span>Back to main menu</span></label></div></div></div></div>`,1);function ve(e,o){P(o,!0);let c=()=>u(B,`$reduced_motion`,d),[d,f]=ne(),_=ie(o,`current`,7),y=i(!!_()?.sections),b=i(void 0),C=i(0),M=i(0),ae=i(!1),F=i(void 0);fe(o.onclose),te(()=>{setTimeout(()=>{h(ae,!0)})});function se(e,{duration:t=400,easing:n=le}={}){let r=_()?e.clientHeight:x(M);return{css:(e,t)=>c()?`opacity: ${e}`:`transform: translate3d(0, ${r*t/.9}px, 0) scale(${.9+.1*e})`,easing:n,duration:t}}var I=_e(),L=A(I);oe(L,{get onclose(){return o.onclose}});var R=m(L,2),ue=S(R),de=S(ue);let V,pe;var H=m(de,2);let U;var W=S(H);let G;var K=S(W),q=S(K),J=S(q);s(J,21,()=>o.links,l,(e,t)=>{var n=ge(),r=S(n),i=S(r,!0);v(r);var o=m(r,2),s=e=>{var n=X();z(S(n),{name:`arrow-right-chevron`,size:18}),v(n),T(()=>j(n,`aria-label`,`Show ${x(t).title??``} submenu`)),w(`click`,n,async e=>{e.preventDefault(),_(x(t)),await re(),h(y,!0),await re(),x(b)?.scrollToActive()}),D(e,n)};N(o,e=>{x(t).sections&&e(s)}),v(n),T(()=>{j(r,`href`,`/${x(t).slug??``}`),a(i,x(t).title)}),D(e,n)}),v(J),g(4),v(q),v(K),ee(K,e=>h(F,e),()=>x(F));var Y=m(K,2),ve=S(Y),Z=e=>{ee(he(e,{get title(){return _().title},get contents(){return _().sections}}),e=>h(b,e,!0),()=>x(b))};N(ve,e=>{_()&&e(Z)}),v(Y);var ye=m(Y,2),Q=S(ye);z(S(Q),{name:`arrow-left`,size:18}),v(Q),g(2),v(ye),v(W),v(H),v(ue),v(R),r(R,(e,t)=>me?.(e,t),()=>({reset_focus:!1})),T(()=>{V=k(de,1,`menu-background svelte-111p50s`,null,V,{ready:x(ae)}),pe=n(de,``,pe,{height:x(y)?`100%`:`${x(M)}px`}),U=n(H,``,U,{"--height-difference":`${x(C)-x(M)}px`}),G=k(W,1,`viewport svelte-111p50s`,null,G,{"reduced-motion":c(),offset:x(y)}),K.inert=x(y),Y.inert=!x(y),Q.inert=!x(y)}),O(`transitionstart`,H,e=>{if(!e.target?.classList.contains(`viewport`)||e.propertyName!==`transform`)return;let t=`calc(var(--height-difference) + 1px)`,n=x(y)?t:`1px`,r=x(y)?`1px`:t,i=e.currentTarget;i.style.clipPath=`polygon(0% ${n}, 100% ${n}, 100% 100%, 0% 100%)`,setTimeout(()=>{i.style.clipPath=`polygon(0% ${r}, 100% ${r}, 100% 100%, 0% 100%)`},0)}),O(`transitionend`,H,e=>{e.target?.classList.contains(`viewport`)&&e.propertyName===`transform`&&(e.currentTarget.style.clipPath=``,x(y)||x(F)?.querySelector(`a`)?.focus())}),E(q,`clientHeight`,e=>h(M,e)),w(`click`,Q,()=>h(y,!1)),E(W,`clientHeight`,e=>h(C,e)),t(3,ue,()=>se,()=>({duration:200,easing:ce})),D(e,I),p(),f()}e([`click`]);var Z=y(`<button class="raised svelte-ocz8b7" type="button" aria-label="Toggle font"><span class="icon svelte-ocz8b7"></span></button>`);function ye(e,t){P(t,!0);let n=i(`elegant`);te(()=>{try{h(n,localStorage.getItem(`svelte:font`)??`elegant`,!0)}catch{}});function r(){h(n,x(n)===`elegant`?`boring`:`elegant`,!0),document.documentElement.classList.remove(`font-elegant`),document.documentElement.classList.remove(`font-boring`),document.documentElement.classList.add(`font-${x(n)}`);try{localStorage.setItem(`svelte:font`,x(n))}catch{}}var a=Z();T(()=>j(a,`aria-pressed`,x(n)===`boring`)),w(`click`,a,r),D(e,a),p()}e([`click`]);var Q=y(`<div class="current-section mobile svelte-wf8082"> </div>`),be=y(`<a class="secondary svelte-wf8082"> </a>`),xe=y(`<a class="svelte-wf8082"> <!></a>`),Se=y(`<a class="svelte-wf8082"> </a>`),Ce=y(`<div class="mobile svelte-wf8082"><!></div>`),we=y(`<nav aria-label="Primary"><a class="home-link svelte-wf8082" href="/" aria-label="Svelte"></a> <!> <div class="desktop svelte-wf8082"><div class="links svelte-wf8082"></div> <div class="menu svelte-wf8082"><!> <div class="external-links svelte-wf8082"><a href="/chat" aria-label="Discord Chat" class="svelte-wf8082"><span data-icon="discord" class="svelte-wf8082"></span></a> <a href="https://bsky.app/profile/svelte.dev" aria-label="Svelte on Bluesky" class="svelte-wf8082"><span data-icon="bluesky" class="svelte-wf8082"></span></a> <a href="https://github.com/sveltejs" aria-label="GitHub Organization" class="svelte-wf8082"><span data-icon="github" class="svelte-wf8082"></span></a></div> <!> <!></div></div> <div class="mobile mobile-menu svelte-wf8082"><button aria-label="Search" class="raised icon search"><!></button> <!> <!> <button aria-label="Toggle menu"><!></button></div></nav> <!>`,1);function Te(e,t){P(t,!0);let r=()=>u(de,`$overlay_open`,d),o=()=>u(ue,`$on_this_page_open`,d),[d,g]=ne(),_=ie(t,`home_title`,3,`Homepage`),y=i(!0),b=i(!1),C=i(void 0),E,F=!1;function oe(){F=!0}let L=0;function ce(){let e=window.scrollY;F||h(y,e===L?x(y):e<50||e<L,!0),L=e,F=!1}te(()=>{document.body.style.overflow=x(b)?`hidden`:``});var le=we();O(`scroll`,M,ce),O(`hashchange`,M,oe),O(`keydown`,M,e=>{x(b)&&e.key===`Escape`&&(h(b,!1),re().then(()=>E.focus()))});var B=A(le);let V,fe;var U=S(B),me=m(U,2),W=e=>{var n=Q(),r=S(n,!0);v(n),T(()=>a(r,t.title)),D(e,n)};N(me,e=>{t.title&&e(W)});var G=m(me,2),K=S(G);s(K,21,()=>t.links,l,(e,t)=>{var n=c(),r=A(n),i=e=>{se(e,{dropdown:e=>{ae(e,{children:(e,n)=>{var r=c();s(A(r),17,()=>x(t).sections,l,(e,t)=>{var n=be(),r=S(n,!0);v(n),T(e=>{j(n,`href`,x(t).path),j(n,`aria-current`,e),a(r,x(t).title)},[()=>R.url.pathname===x(t).path||R.url.pathname.startsWith(x(t).path)?`page`:void 0]),D(e,n)}),D(e,r)},$$slots:{default:!0}})},children:(e,n)=>{var r=xe(),i=S(r);z(m(i),{name:`chevron-down`}),v(r),T(e=>{j(r,`href`,`/${x(t).slug??``}`),j(r,`aria-current`,e),a(i,`${x(t).title??``} `)},[()=>R.url.pathname.startsWith(`/${x(t).slug}`)?`page`:void 0]),D(e,r)},$$slots:{dropdown:!0,default:!0}})},o=e=>{var n=Se(),r=S(n,!0);v(n),T(e=>{j(n,`href`,`/${x(t).slug??``}`),j(n,`aria-current`,e),a(r,x(t).title)},[()=>R.url.pathname.startsWith(`/${x(t).slug}`)?`page`:null]),D(e,n)};N(r,e=>{x(t).sections?.[0].path?e(i):e(o,-1)}),D(e,n)}),v(K);var q=m(K,2),J=S(q);H(J,{});var Y=m(J,4);ye(Y,{}),I(m(Y,2),{}),v(q),v(G);var he=m(G,2),X=S(he);z(S(X),{name:`search`,size:18}),v(X);var ge=m(X,2);ye(ge,{});var _e=m(ge,2);I(_e,{});var Z=m(_e,2);let Te;var Ee=S(Z);{let e=f(()=>x(b)?`close`:`menu`);z(Ee,{get name(){return x(e)},size:16})}v(Z),ee(Z,e=>E=e,()=>E),v(he),v(B);var De=m(B,2),Oe=e=>{var n=Ce();ve(S(n),{get links(){return t.links},get current(){return x(C)},onclose:()=>h(b,!1)}),v(n),D(e,n)};N(De,e=>{x(b)&&e(Oe)}),T(()=>{V=k(B,1,`svelte-wf8082`,null,V,{visible:x(y)}),fe=n(B,``,fe,{"z-index":r()&&(pe.active||o())?80:null}),j(U,`title`,_()),j(Z,`aria-expanded`,x(b)),Te=k(Z,1,`menu-toggle raised icon`,null,Te,{open:x(b)})}),w(`click`,X,()=>{pe.active=!0}),w(`click`,Z,()=>{if(h(b,!x(b)),x(b)){let e=R.url.pathname.split(`/`)[1];h(C,t.links.find(t=>t.slug===e))}}),D(e,le),p(),g()}e([`click`]);var Ee=()=>{window.si||(window.si=function(...e){window.siq=window.siq||[],window.siq.push(e)})},De=`@vercel/speed-insights`,Oe=`2.1.0-canary`;function ke(){return typeof window<`u`}function Ae(){return`production`}function je(){return Ae()===`development`}function Me(e){return e.scriptSrc?Pe(e.scriptSrc):je()?`https://va.vercel-scripts.com/v1/speed-insights/script.debug.js`:e.dsn?`https://va.vercel-scripts.com/v1/speed-insights/script.
1js`:e.basePath?Pe(`${e.basePath}/speed-insights/script.js`):`/_vercel/speed-insights/script.js`}function Ne(e,t){let n=e;if(t)try{n={...JSON.parse(t)?.speedInsights,...e}}catch{}let r={sdkn:De+(n.framework?`/${n.framework}`:``),sdkv:Oe};return n.sampleRate&&(r.sampleRate=n.sampleRate.toString()),n.route&&(r.route=n.route),je()&&n.debug===!1&&(r.debug=`false`),n.dsn&&(r.dsn=n.dsn),n.endpoint?r.endpoint=Pe(n.endpoint):n.basePath&&(r.endpoint=Pe(`${n.basePath}/speed-insights/vitals`)),{src:Me(n),beforeSend:n.beforeSend,dataset:r}}function Pe(e){return e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)?e:`/${e}`}function Fe(e={},t){var n;if(!ke()||e.route===null)return null;Ee();let{beforeSend:r,src:i,dataset:a}=Ne(e,t);if(document.head.querySelector(`script[src*="${i}"]`))return null;r&&((n=window.si)==null||n.call(window,`beforeSend`,r));let o=document.createElement(`script`);o.src=i,o.defer=!0;for(let[e,t]of Object.entries(a))o.dataset[e]=t;return o.onerror=()=>{console.log(`[Vercel Speed Insights] Failed to load script from ${i}. Please check if any content blockers are enabled and try again.`)},document.head.appendChild(o),{setRoute:e=>{o.dataset.route=e??void 0}}}function Ie(){try{return}catch{}}function Le(){try{return`{"analytics":{"scriptSrc":"a50aaa39ae0abbfc/script.js","viewEndpoint":"a50aaa39ae0abbfc/view","eventEndpoint":"a50aaa39ae0abbfc/event","sessionEndpoint":"a50aaa39ae0abbfc/session"},"speedInsights":{"scriptSrc":"51a6d87104faba1d/script.js","endpoint":"51a6d87104faba1d/vitals"}}`}catch{}}function Re(e={}){let t=null;C(()=>{b(()=>{let n=R.route?.id;if(n){if(!t){t=Fe({...e,route:n,framework:`sveltekit`,basePath:Ie()},Le());return}t.setRoute(n)}})})}var ze=()=>{window.va||(window.va=function(...e){window.vaq||(window.vaq=[]),window.vaq.push(e)})},Be=`@vercel/analytics`,Ve=`2.2.0-canary`;function He(){return typeof window<`u`}function Ue(){return`production`}function We(e=`auto`){if(e===`auto`){window.vam=Ue();return}window.vam=e}function Ge(){return(He()?window.vam:Ue())||`production`}function Ke(){return Ge()===`development`}function qe(e){return e.scriptSrc?$(e.scriptSrc):Ke()?`https://va.vercel-scripts.com/v1/script.debug.js`:e.basePath?$(`${e.basePath}/insights/script.js`):`/_vercel/insights/script.js`}function Je(e,t){let n=e;if(t)try{n={...JSON.parse(t)?.analytics,...e}}catch{}We(n.mode);let r={sdkn:Be+(n.framework?`/${n.framework}`:``),sdkv:Ve};return n.disableAutoTrack&&(r.disableAutoTrack=`1`),n.viewEndpoint&&(r.viewEndpoint=$(n.viewEndpoint)),n.eventEndpoint&&(r.eventEndpoint=$(n.eventEndpoint)),n.sessionEndpoint&&(r.sessionEndpoint=$(n.sessionEndpoint)),Ke()&&n.debug===!1&&(r.debug=`false`),n.dsn&&(r.dsn=n.dsn),n.endpoint?r.endpoint=n.endpoint:n.basePath&&(r.endpoint=$(`${n.basePath}/insights`)),{beforeSend:n.beforeSend,src:qe(n),dataset:r}}function $(e){return e.startsWith(`http://`)||e.startsWith(`https://`)||e.startsWith(`/`)?e:`/${e}`}function Ye(e={debug:!0},t){var n;if(!He())return;let{beforeSend:r,src:i,dataset:a}=Je(e,t);if(ze(),r&&((n=window.va)==null||n.call(window,`beforeSend`,r)),document.head.querySelector(`script[src*="${i}"]`))return;let o=document.createElement(`script`);o.src=i;for(let[e,t]of Object.entries(a))o.dataset[e]=t;o.defer=!0,o.onerror=()=>{let e=Ke()?`Please check if any ad blockers are enabled and try again.`:`Be sure to enable Web Analytics for your project and deploy again. See https://vercel.com/docs/analytics/quickstart for more information.`;console.log(`[Vercel Web Analytics] Failed to load script from ${i}. ${e}`)},document.head.appendChild(o)}var Xe=y(`<meta name="twitter:card" content="summary"/> <meta name="twitter:image" content="https://svelte.dev/images/twitter-thumbnail.jpg"/> <meta name="og:image" content="https://svelte.dev/images/twitter-thumbnail.jpg"/>`,1),Ze=y(`<!> <!>`,1);function Qe(e,t){P(t,!0),Re(),Ye({mode:`production`}),V(({from:e,to:t,cancel:n})=>{!e||!t||e.url.pathname.startsWith(`/tutorial/kit/`)!==t.url.pathname.startsWith(`/tutorial/kit`)&&(n(),location.href=t.url.href)});let n={docs:`Docs`,packages:`Packages`,playground:`Playground`,blog:`Blog`,tutorial:`Tutorial`,search:`Search`};var r=Ze();d(`12qhfyh`,e=>{var t=c(),n=A(t),r=e=>{var t=Xe();g(4),D(e,t)},i=f(()=>!R.route.id||!(R.route.id.startsWith(`/blog/`)||/^\/docs\/[^\/]+\/[^\/]+$/.test(R.route.id)));N(n,e=>{x(i)&&e(r)}),D(e,t)});var i=A(r);{let e=e=>{{let r=f(()=>n[R.url.pathname.split(`/`)[1]]??``);Te(e,{get title(){return x(r)},get links(){return t.data.nav_links}})}},r=e=>{var n=c();o(A(n),()=>t.children),D(e,n)},a=e=>{var n=c(),r=A(n),i=e=>{F(e,{get banner(){return t.data.banner}})};N(r,e=>{t.data.banner&&e(i)}),D(e,n)},s=f(()=>R.route.id!==`/(authed)/playground/[...id]/embed`);L(i,{get nav_visible(){return x(s)},top_nav:e,children:r,banner:a,$$slots:{top_nav:!0,default:!0,banner:!0}})}var a=m(i,2),s=e=>{U(e,{})};N(a,e=>{e(s)}),D(e,r),p()}export{Qe as component};

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.