diff --git a/404.html b/404.html index 45113cc..c28f9ad 100644 --- a/404.html +++ b/404.html @@ -1 +1 @@ -404: This page could not be found.我的博客
我的博客

404

This page could not be found.

\ No newline at end of file +404: This page could not be found.我的博客
我的博客

404

This page could not be found.

\ No newline at end of file diff --git a/_next/static/chunks/469-44b568725719917b.js b/_next/static/chunks/469-44b568725719917b.js deleted file mode 100644 index 823a328..0000000 --- a/_next/static/chunks/469-44b568725719917b.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[469],{8561:function(e,t,n){n.d(t,{default:function(){return o.a}});var r=n(3922),o=n.n(r)},1827:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return b}});let r=n(8903),o=n(3536),i=n(2842),a=o._(n(6856)),l=r._(n(2181)),s=r._(n(8261)),c=n(8898),u=n(9709),d=n(3499);n(3563);let f=n(3855),m=r._(n(8606)),p={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function g(e,t,n,r,o,i,a){let l=null==e?void 0:e.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&o(!0),null==n?void 0:n.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,o=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==r?void 0:r.current)&&r.current(e)}}))}function h(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}"undefined"==typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let y=(0,a.forwardRef)((e,t)=>{let{src:n,srcSet:r,sizes:o,height:l,width:s,decoding:c,className:u,style:d,fetchPriority:f,placeholder:m,loading:p,unoptimized:y,fill:v,onLoadRef:b,onLoadingCompleteRef:w,setBlurComplete:_,setShowAltText:S,sizesInput:C,onLoad:x,onError:j,...P}=e;return(0,i.jsx)("img",{...P,...h(f),loading:p,width:s,height:l,decoding:c,"data-nimg":v?"fill":"1",className:u,style:d,sizes:o,srcSet:r,src:n,ref:(0,a.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(j&&(e.src=e.src),e.complete&&g(e,m,b,w,_,y,C))},[n,m,b,w,_,j,y,C,t]),onLoad:e=>{g(e.currentTarget,m,b,w,_,y,C)},onError:e=>{S(!0),"empty"!==m&&_(!0),j&&j(e)}})});function v(e){let{isAppRouter:t,imgAttributes:n}=e,r={as:"image",imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:n.crossOrigin,referrerPolicy:n.referrerPolicy,...h(n.fetchPriority)};return t&&l.default.preload?(l.default.preload(n.src,r),null):(0,i.jsx)(s.default,{children:(0,i.jsx)("link",{rel:"preload",href:n.srcSet?void 0:n.src,...r},"__nimg-"+n.src+n.srcSet+n.sizes)})}let b=(0,a.forwardRef)((e,t)=>{let n=(0,a.useContext)(f.RouterContext),r=(0,a.useContext)(d.ImageConfigContext),o=(0,a.useMemo)(()=>{let e=p||r||u.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n}},[r]),{onLoad:l,onLoadingComplete:s}=e,g=(0,a.useRef)(l);(0,a.useEffect)(()=>{g.current=l},[l]);let h=(0,a.useRef)(s);(0,a.useEffect)(()=>{h.current=s},[s]);let[b,w]=(0,a.useState)(!1),[_,S]=(0,a.useState)(!1),{props:C,meta:x}=(0,c.getImgProps)(e,{defaultLoader:m.default,imgConf:o,blurComplete:b,showAltText:_});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y,{...C,unoptimized:x.unoptimized,placeholder:x.placeholder,fill:x.fill,onLoadRef:g,onLoadingCompleteRef:h,setBlurComplete:w,setShowAltText:S,sizesInput:e.sizes,ref:t}),x.priority?(0,i.jsx)(v,{isAppRouter:!n,imgAttributes:C}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7171:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return r}});let r=n(8903)._(n(6856)).default.createContext({})},2174:function(e,t){function n(e){let{ampFirst:t=!1,hybrid:n=!1,hasQuery:r=!1}=void 0===e?{}:e;return t||n&&r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return n}})},8898:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return l}}),n(3563);let r=n(2909),o=n(9709);function i(e){return void 0!==e.default}function a(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function l(e,t){var n;let l,s,c,{src:u,sizes:d,unoptimized:f=!1,priority:m=!1,loading:p,className:g,quality:h,width:y,height:v,fill:b=!1,style:w,overrideSrc:_,onLoad:S,onLoadingComplete:C,placeholder:x="empty",blurDataURL:j,fetchPriority:P,layout:E,objectFit:O,objectPosition:M,lazyBoundary:k,lazyRoot:z,...I}=e,{imgConf:T,showAltText:A,blurComplete:R,defaultLoader:L}=t,D=T||o.imageConfigDefault;if("allSizes"in D)l=D;else{let e=[...D.deviceSizes,...D.imageSizes].sort((e,t)=>e-t),t=D.deviceSizes.sort((e,t)=>e-t);l={...D,allSizes:e,deviceSizes:t}}if(void 0===L)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let N=I.loader||L;delete I.loader,delete I.srcSet;let U="__next_img_default"in N;if(U){if("custom"===l.loader)throw Error('Image with src "'+u+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=N;N=t=>{let{config:n,...r}=t;return e(r)}}if(E){"fill"===E&&(b=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[E];e&&(w={...w,...e});let t={responsive:"100vw",fill:"100vw"}[E];t&&!d&&(d=t)}let F="",G=a(y),B=a(v);if("object"==typeof(n=u)&&(i(n)||void 0!==n.src)){let e=i(u)?u.default:u;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(s=e.blurWidth,c=e.blurHeight,j=j||e.blurDataURL,F=e.src,!b){if(G||B){if(G&&!B){let t=G/e.width;B=Math.round(e.height*t)}else if(!G&&B){let t=B/e.height;G=Math.round(e.width*t)}}else G=e.width,B=e.height}}let V=!m&&("lazy"===p||void 0===p);(!(u="string"==typeof u?u:F)||u.startsWith("data:")||u.startsWith("blob:"))&&(f=!0,V=!1),l.unoptimized&&(f=!0),U&&u.endsWith(".svg")&&!l.dangerouslyAllowSVG&&(f=!0),m&&(P="high");let W=a(h),H=Object.assign(b?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:O,objectPosition:M}:{},A?{}:{color:"transparent"},w),J=R||"empty"===x?null:"blur"===x?'url("data:image/svg+xml;charset=utf-8,'+(0,r.getImageBlurSvg)({widthInt:G,heightInt:B,blurWidth:s,blurHeight:c,blurDataURL:j||"",objectFit:H.objectFit})+'")':'url("'+x+'")',q=J?{backgroundSize:H.objectFit||"cover",backgroundPosition:H.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:J}:{},K=function(e){let{config:t,src:n,unoptimized:r,width:o,quality:i,sizes:a,loader:l}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:s,kind:c}=function(e,t,n){let{deviceSizes:r,allSizes:o}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);r)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:o,kind:"w"}}return"number"!=typeof t?{widths:r,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))],kind:"x"}}(t,o,a),u=s.length-1;return{sizes:a||"w"!==c?a:"100vw",srcSet:s.map((e,r)=>l({config:t,src:n,quality:i,width:e})+" "+("w"===c?e:r+1)+c).join(", "),src:l({config:t,src:n,quality:i,width:s[u]})}}({config:l,src:u,unoptimized:f,width:G,quality:W,sizes:d,loader:N});return{props:{...I,loading:V?"lazy":p,fetchPriority:P,width:G,height:B,decoding:"async",className:g,style:{...H,...q},sizes:K.sizes,srcSet:K.srcSet,src:_||K.src},meta:{unoptimized:f,priority:m,placeholder:x,fill:b}}}},8261:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return g},defaultHead:function(){return d}});let r=n(8903),o=n(3536),i=n(2842),a=o._(n(6856)),l=r._(n(6776)),s=n(7171),c=n(6783),u=n(2174);function d(e){void 0===e&&(e=!1);let t=[(0,i.jsx)("meta",{charSet:"utf-8"})];return e||t.push((0,i.jsx)("meta",{name:"viewport",content:"width=device-width"})),t}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===a.default.Fragment?e.concat(a.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}n(3563);let m=["name","httpEquiv","charSet","itemProp"];function p(e,t){let{inAmpMode:n}=t;return e.reduce(f,[]).reverse().concat(d(n).reverse()).filter(function(){let e=new Set,t=new Set,n=new Set,r={};return o=>{let i=!0,a=!1;if(o.key&&"number"!=typeof o.key&&o.key.indexOf("$")>0){a=!0;let t=o.key.slice(o.key.indexOf("$")+1);e.has(t)?i=!1:e.add(t)}switch(o.type){case"title":case"base":t.has(o.type)?i=!1:t.add(o.type);break;case"meta":for(let e=0,t=m.length;e{let r=e.key||t;if(!n&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let t={...e.props||{}};return t["data-href"]=t.href,t.href=void 0,t["data-optimized-fonts"]=!0,a.default.cloneElement(e,t)}return a.default.cloneElement(e,{key:r})})}let g=function(e){let{children:t}=e,n=(0,a.useContext)(s.AmpStateContext),r=(0,a.useContext)(c.HeadManagerContext);return(0,i.jsx)(l.default,{reduceComponentsToState:p,headManager:r,inAmpMode:(0,u.isInAmpMode)(n),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2909:function(e,t){function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:o,blurDataURL:i,objectFit:a}=e,l=r?40*r:t,s=o?40*o:n,c=l&&s?"viewBox='0 0 "+l+" "+s+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+c+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(c?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+i+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},3499:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let r=n(8903)._(n(6856)),o=n(9709),i=r.default.createContext(o.imageConfigDefault)},9709:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{VALID_LOADERS:function(){return n},imageConfigDefault:function(){return r}});let n=["default","imgix","cloudinary","akamai","custom"],r={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",remotePatterns:[],unoptimized:!1}},3922:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return s},getImageProps:function(){return l}});let r=n(8903),o=n(8898),i=n(1827),a=r._(n(8606));function l(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:a.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let s=i.Image},8606:function(e,t){function n(e){let{config:t,src:n,width:r,quality:o}=e;return t.path+"?url="+encodeURIComponent(n)+"&w="+r+"&q="+(o||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}}),n.__next_img_default=!0;let r=n},3855:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return r}});let r=n(8903)._(n(6856)).default.createContext(null)},6776:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return l}});let r=n(6856),o="undefined"==typeof window,i=o?()=>{}:r.useLayoutEffect,a=o?()=>{}:r.useEffect;function l(e){let{headManager:t,reduceComponentsToState:n}=e;function l(){if(t&&t.mountedInstances){let o=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(o,e))}}if(o){var s;null==t||null==(s=t.mountedInstances)||s.add(e.children),l()}return i(()=>{var n;return null==t||null==(n=t.mountedInstances)||n.add(e.children),()=>{var n;null==t||null==(n=t.mountedInstances)||n.delete(e.children)}}),i(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},2741:function(e,t,n){n.d(t,{F:function(){return c},ThemeProvider:function(){return u}});var r=n(6856),o=["light","dark"],i="(prefers-color-scheme: dark)",a="undefined"==typeof window,l=r.createContext(void 0),s={setTheme:e=>{},themes:[]},c=()=>{var e;return null!=(e=r.useContext(l))?e:s},u=e=>r.useContext(l)?e.children:r.createElement(f,{...e}),d=["light","dark"],f=e=>{let{forcedTheme:t,disableTransitionOnChange:n=!1,enableSystem:a=!0,enableColorScheme:s=!0,storageKey:c="theme",themes:u=d,defaultTheme:f=a?"system":"light",attribute:y="data-theme",value:v,children:b,nonce:w}=e,[_,S]=r.useState(()=>p(c,f)),[C,x]=r.useState(()=>p(c)),j=v?Object.values(v):u,P=r.useCallback(e=>{let t=e;if(!t)return;"system"===e&&a&&(t=h());let r=v?v[t]:t,i=n?g():null,l=document.documentElement;if("class"===y?(l.classList.remove(...j),r&&l.classList.add(r)):r?l.setAttribute(y,r):l.removeAttribute(y),s){let e=o.includes(f)?f:null,n=o.includes(t)?t:e;l.style.colorScheme=n}null==i||i()},[]),E=r.useCallback(e=>{let t="function"==typeof e?e(e):e;S(t);try{localStorage.setItem(c,t)}catch(e){}},[t]),O=r.useCallback(e=>{x(h(e)),"system"===_&&a&&!t&&P("system")},[_,t]);r.useEffect(()=>{let e=window.matchMedia(i);return e.addListener(O),O(e),()=>e.removeListener(O)},[O]),r.useEffect(()=>{let e=e=>{e.key===c&&E(e.newValue||f)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[E]),r.useEffect(()=>{P(null!=t?t:_)},[t,_]);let M=r.useMemo(()=>({theme:_,setTheme:E,forcedTheme:t,resolvedTheme:"system"===_?C:_,themes:a?[...u,"system"]:u,systemTheme:a?C:void 0}),[_,E,t,C,a,u]);return r.createElement(l.Provider,{value:M},r.createElement(m,{forcedTheme:t,disableTransitionOnChange:n,enableSystem:a,enableColorScheme:s,storageKey:c,themes:u,defaultTheme:f,attribute:y,value:v,children:b,attrs:j,nonce:w}),b)},m=r.memo(e=>{let{forcedTheme:t,storageKey:n,attribute:a,enableSystem:l,enableColorScheme:s,defaultTheme:c,value:u,attrs:d,nonce:f}=e,m="system"===c,p="class"===a?"var d=document.documentElement,c=d.classList;".concat("c.remove(".concat(d.map(e=>"'".concat(e,"'")).join(","),")"),";"):"var d=document.documentElement,n='".concat(a,"',s='setAttribute';"),g=s?(o.includes(c)?c:null)?"if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'".concat(c,"'"):"if(e==='light'||e==='dark')d.style.colorScheme=e":"",h=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],r=u?u[e]:e,i=t?e+"|| ''":"'".concat(r,"'"),l="";return s&&n&&!t&&o.includes(e)&&(l+="d.style.colorScheme = '".concat(e,"';")),"class"===a?t||r?l+="c.add(".concat(i,")"):l+="null":r&&(l+="d[s](n,".concat(i,")")),l},y=t?"!function(){".concat(p).concat(h(t),"}()"):l?"!function(){try{".concat(p,"var e=localStorage.getItem('").concat(n,"');if('system'===e||(!e&&").concat(m,")){var t='").concat(i,"',m=window.matchMedia(t);if(m.media!==t||m.matches){").concat(h("dark"),"}else{").concat(h("light"),"}}else if(e){").concat(u?"var x=".concat(JSON.stringify(u),";"):"").concat(h(u?"x[e]":"e",!0),"}").concat(m?"":"else{"+h(c,!1,!1)+"}").concat(g,"}catch(e){}}()"):"!function(){try{".concat(p,"var e=localStorage.getItem('").concat(n,"');if(e){").concat(u?"var x=".concat(JSON.stringify(u),";"):"").concat(h(u?"x[e]":"e",!0),"}else{").concat(h(c,!1,!1),";}").concat(g,"}catch(t){}}();");return r.createElement("script",{nonce:f,dangerouslySetInnerHTML:{__html:y}})}),p=(e,t)=>{let n;if(!a){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},g=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},h=e=>(e||(e=window.matchMedia(i)),e.matches?"dark":"light")}}]); \ No newline at end of file diff --git a/_next/static/chunks/100-48d8e54a6ce3477d.js b/_next/static/chunks/470-dd03d5977538fe16.js similarity index 98% rename from _next/static/chunks/100-48d8e54a6ce3477d.js rename to _next/static/chunks/470-dd03d5977538fe16.js index 2897be7..14c6628 100644 --- a/_next/static/chunks/100-48d8e54a6ce3477d.js +++ b/_next/static/chunks/470-dd03d5977538fe16.js @@ -1,4 +1,4 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[100],{7882:function(e,t,r){r.d(t,{Z:function(){return s}});var n=r(6856);/** +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[470],{7882:function(e,t,r){r.d(t,{Z:function(){return s}});var n=r(6856);/** * @license lucide-react v0.429.0 - ISC * * This source code is licensed under the ISC license. @@ -28,4 +28,4 @@ * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */let n=(0,r(7882).Z)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},6960:function(e,t,r){r.d(t,{F:function(){return o},e:function(){return l}});var n=r(6856);function o(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}function l(...e){return n.useCallback(o(...e),e)}},1453:function(e,t,r){r.d(t,{f:function(){return a}});var n=r(6856),o=r(5502),l=r(2842),i=n.forwardRef((e,t)=>(0,l.jsx)(o.WV.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null===(r=e.onMouseDown)||void 0===r||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));i.displayName="Label";var a=i},5502:function(e,t,r){r.d(t,{WV:function(){return a},jH:function(){return s}});var n=r(6856),o=r(2181),l=r(6370),i=r(2842),a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let r=n.forwardRef((e,r)=>{let{asChild:n,...o}=e,a=n?l.g7:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(a,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function s(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}},2459:function(e,t,r){let n;r.d(t,{VY:function(){return r7},ZA:function(){return r4},JO:function(){return r6},ck:function(){return ne},wU:function(){return nr},eT:function(){return nt},__:function(){return r9},h_:function(){return r8},fC:function(){return r1},$G:function(){return no},u_:function(){return nn},Z0:function(){return nl},xz:function(){return r2},B4:function(){return r5},l_:function(){return r3}});var o,l,i,a,s,c,u,d,f=r(6856),p=r.t(f,2),m=r(2181);function h(e,[t,r]){return Math.min(r,Math.max(t,e))}function v(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}var g=r(2842);function b(e,t=[]){let r=[],n=()=>{let t=r.map(e=>f.createContext(e));return function(r){let n=r?.[e]||t;return f.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){let o=f.createContext(n),l=r.length;function i(t){let{scope:r,children:n,...i}=t,a=r?.[e][l]||o,s=f.useMemo(()=>i,Object.values(i));return(0,g.jsx)(a.Provider,{value:s,children:n})}return r=[...r,n],i.displayName=t+"Provider",[i,function(r,i){let a=i?.[e][l]||o,s=f.useContext(a);if(s)return s;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let o=r(e)[`__scope${n}`];return{...t,...o}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(n,...t)]}var y=r(6960),w=r(6370),x=f.createContext(void 0),E=r(5502);function S(e){let t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...e)=>t.current?.(...e),[])}var C="dismissableLayer.update",k=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),R=f.forwardRef((e,t)=>{var r,n;let{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c,...d}=e,p=f.useContext(k),[m,h]=f.useState(null),b=null!==(n=null==m?void 0:m.ownerDocument)&&void 0!==n?n:null===(r=globalThis)||void 0===r?void 0:r.document,[,w]=f.useState({}),x=(0,y.e)(t,e=>h(e)),R=Array.from(p.layers),[A]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=R.indexOf(A),L=m?R.indexOf(m):-1,N=p.layersWithOutsidePointerEventsDisabled.size>0,M=L>=T,O=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,n=S(e),o=f.useRef(!1),l=f.useRef(()=>{});return f.useEffect(()=>{let e=e=>{if(e.target&&!o.current){let t=function(){P("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",l.current),l.current=t,r.addEventListener("click",l.current,{once:!0})):t()}else r.removeEventListener("click",l.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",l.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target,r=[...p.branches].some(e=>e.contains(t));!M||r||(null==i||i(e),null==s||s(e),e.defaultPrevented||null==c||c())},b),W=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,n=S(e),o=f.useRef(!1);return f.useEffect(()=>{let e=e=>{e.target&&!o.current&&P("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(null==a||a(e),null==s||s(e),e.defaultPrevented||null==c||c())},b);return!function(e,t=globalThis?.document){let r=S(e);f.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{L!==p.layers.size-1||(null==l||l(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},b),f.useEffect(()=>{if(m)return o&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(u=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),j(),()=>{o&&1===p.layersWithOutsidePointerEventsDisabled.size&&(b.body.style.pointerEvents=u)}},[m,b,o,p]),f.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),j())},[m,p]),f.useEffect(()=>{let e=()=>w({});return document.addEventListener(C,e),()=>document.removeEventListener(C,e)},[]),(0,g.jsx)(E.WV.div,{...d,ref:x,style:{pointerEvents:N?M?"auto":"none":void 0,...e.style},onFocusCapture:v(e.onFocusCapture,W.onFocusCapture),onBlurCapture:v(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:v(e.onPointerDownCapture,O.onPointerDownCapture)})});function j(){let e=new CustomEvent(C);document.dispatchEvent(e)}function P(e,t,r,n){let{discrete:o}=n,l=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),o?(0,E.jH)(l,i):l.dispatchEvent(i)}R.displayName="DismissableLayer",f.forwardRef((e,t)=>{let r=f.useContext(k),n=f.useRef(null),o=(0,y.e)(t,n);return f.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,g.jsx)(E.WV.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var A=0;function T(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var L="focusScope.autoFocusOnMount",N="focusScope.autoFocusOnUnmount",M={bubbles:!1,cancelable:!0},O=f.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...i}=e,[a,s]=f.useState(null),c=S(o),u=S(l),d=f.useRef(null),p=(0,y.e)(t,e=>s(e)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(n){let e=function(e){if(m.paused||!a)return;let t=e.target;a.contains(t)?d.current=t:z(d.current,{select:!0})},t=function(e){if(m.paused||!a)return;let t=e.relatedTarget;null===t||a.contains(t)||z(d.current,{select:!0})};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&z(a)});return a&&r.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,a,m.paused]),f.useEffect(()=>{if(a){I.add(m);let e=document.activeElement;if(!a.contains(e)){let t=new CustomEvent(L,M);a.addEventListener(L,c),a.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.activeElement;for(let n of e)if(z(n,{select:t}),document.activeElement!==r)return}(W(a).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&z(a))}return()=>{a.removeEventListener(L,c),setTimeout(()=>{let t=new CustomEvent(N,M);a.addEventListener(N,u),a.dispatchEvent(t),t.defaultPrevented||z(null!=e?e:document.body,{select:!0}),a.removeEventListener(N,u),I.remove(m)},0)}}},[a,c,u,m]);let h=f.useCallback(e=>{if(!r&&!n||m.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[n,l]=function(e){let t=W(e);return[D(t,e),D(t.reverse(),e)]}(t);n&&l?e.shiftKey||o!==l?e.shiftKey&&o===n&&(e.preventDefault(),r&&z(l,{select:!0})):(e.preventDefault(),r&&z(n,{select:!0})):o===t&&e.preventDefault()}},[r,n,m.paused]);return(0,g.jsx)(E.WV.div,{tabIndex:-1,...i,ref:p,onKeyDown:h})});function W(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function D(e,t){for(let r of e)if(!function(e,t){let{upTo:r}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===r||e!==r);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function z(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}O.displayName="FocusScope";var I=(n=[],{add(e){let t=n[0];e!==t&&(null==t||t.pause()),(n=V(n,e)).unshift(e)},remove(e){var t;null===(t=(n=V(n,e))[0])||void 0===t||t.resume()}});function V(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var F=globalThis?.document?f.useLayoutEffect:()=>{},H=p["useId".toString()]||(()=>void 0),B=0;function _(e){let[t,r]=f.useState(H());return F(()=>{e||r(e=>e??String(B++))},[e]),e||(t?`radix-${t}`:"")}let K=["top","right","bottom","left"],$=Math.min,Z=Math.max,Y=Math.round,G=Math.floor,U=e=>({x:e,y:e}),X={left:"right",right:"left",bottom:"top",top:"bottom"},q={start:"end",end:"start"};function J(e,t){return"function"==typeof e?e(t):e}function Q(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function et(e){return"x"===e?"y":"x"}function er(e){return"y"===e?"height":"width"}function en(e){return["top","bottom"].includes(Q(e))?"y":"x"}function eo(e){return e.replace(/start|end/g,e=>q[e])}function el(e){return e.replace(/left|right|bottom|top/g,e=>X[e])}function ei(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function ea(e){let{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function es(e,t,r){let n,{reference:o,floating:l}=e,i=en(t),a=et(en(t)),s=er(a),c=Q(t),u="y"===i,d=o.x+o.width/2-l.width/2,f=o.y+o.height/2-l.height/2,p=o[s]/2-l[s]/2;switch(c){case"top":n={x:d,y:o.y-l.height};break;case"bottom":n={x:d,y:o.y+o.height};break;case"right":n={x:o.x+o.width,y:f};break;case"left":n={x:o.x-l.width,y:f};break;default:n={x:o.x,y:o.y}}switch(ee(t)){case"start":n[a]-=p*(r&&u?-1:1);break;case"end":n[a]+=p*(r&&u?-1:1)}return n}let ec=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:l=[],platform:i}=r,a=l.filter(Boolean),s=await (null==i.isRTL?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=es(c,n,s),f=n,p={},m=0;for(let r=0;re[t]>=0)}async function ep(e,t){let{placement:r,platform:n,elements:o}=e,l=await (null==n.isRTL?void 0:n.isRTL(o.floating)),i=Q(r),a=ee(r),s="y"===en(r),c=["left","top"].includes(i)?-1:1,u=l&&s?-1:1,d=J(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function em(e){return eg(e)?(e.nodeName||"").toLowerCase():"#document"}function eh(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ev(e){var t;return null==(t=(eg(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function eg(e){return e instanceof Node||e instanceof eh(e).Node}function eb(e){return e instanceof Element||e instanceof eh(e).Element}function ey(e){return e instanceof HTMLElement||e instanceof eh(e).HTMLElement}function ew(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof eh(e).ShadowRoot)}function ex(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=eR(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function eE(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(e){return!1}})}function eS(e){let t=eC(),r=eb(e)?eR(e):e;return"none"!==r.transform||"none"!==r.perspective||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","perspective","filter"].some(e=>(r.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(r.contain||"").includes(e))}function eC(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}function ek(e){return["html","body","#document"].includes(em(e))}function eR(e){return eh(e).getComputedStyle(e)}function ej(e){return eb(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eP(e){if("html"===em(e))return e;let t=e.assignedSlot||e.parentNode||ew(e)&&e.host||ev(e);return ew(t)?t.host:t}function eA(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let o=function e(t){let r=eP(t);return ek(r)?t.ownerDocument?t.ownerDocument.body:t.body:ey(r)&&ex(r)?r:e(r)}(e),l=o===(null==(n=e.ownerDocument)?void 0:n.body),i=eh(o);if(l){let e=eT(i);return t.concat(i,i.visualViewport||[],ex(o)?o:[],e&&r?eA(e):[])}return t.concat(o,eA(o,[],r))}function eT(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eL(e){let t=eR(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=ey(e),l=o?e.offsetWidth:r,i=o?e.offsetHeight:n,a=Y(r)!==l||Y(n)!==i;return a&&(r=l,n=i),{width:r,height:n,$:a}}function eN(e){return eb(e)?e:e.contextElement}function eM(e){let t=eN(e);if(!ey(t))return U(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:l}=eL(t),i=(l?Y(r.width):r.width)/n,a=(l?Y(r.height):r.height)/o;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}let eO=U(0);function eW(e){let t=eh(e);return eC()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eO}function eD(e,t,r,n){var o;void 0===t&&(t=!1),void 0===r&&(r=!1);let l=e.getBoundingClientRect(),i=eN(e),a=U(1);t&&(n?eb(n)&&(a=eM(n)):a=eM(e));let s=(void 0===(o=r)&&(o=!1),n&&(!o||n===eh(i))&&o)?eW(i):U(0),c=(l.left+s.x)/a.x,u=(l.top+s.y)/a.y,d=l.width/a.x,f=l.height/a.y;if(i){let e=eh(i),t=n&&eb(n)?eh(n):n,r=e,o=eT(r);for(;o&&n&&t!==r;){let e=eM(o),t=o.getBoundingClientRect(),n=eR(o),l=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=l,u+=i,o=eT(r=eh(o))}}return ea({width:d,height:f,x:c,y:u})}function ez(e){return eD(ev(e)).left+ej(e).scrollLeft}function eI(e,t,r){let n;if("viewport"===t)n=function(e,t){let r=eh(e),n=ev(e),o=r.visualViewport,l=n.clientWidth,i=n.clientHeight,a=0,s=0;if(o){l=o.width,i=o.height;let e=eC();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:l,height:i,x:a,y:s}}(e,r);else if("document"===t)n=function(e){let t=ev(e),r=ej(e),n=e.ownerDocument.body,o=Z(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),l=Z(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),i=-r.scrollLeft+ez(e),a=-r.scrollTop;return"rtl"===eR(n).direction&&(i+=Z(t.clientWidth,n.clientWidth)-o),{width:o,height:l,x:i,y:a}}(ev(e));else if(eb(t))n=function(e,t){let r=eD(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,l=ey(e)?eM(e):U(1),i=e.clientWidth*l.x;return{width:i,height:e.clientHeight*l.y,x:o*l.x,y:n*l.y}}(t,r);else{let r=eW(e);n={...t,x:t.x-r.x,y:t.y-r.y}}return ea(n)}function eV(e){return"static"===eR(e).position}function eF(e,t){return ey(e)&&"fixed"!==eR(e).position?t?t(e):e.offsetParent:null}function eH(e,t){let r=eh(e);if(eE(e))return r;if(!ey(e)){let t=eP(e);for(;t&&!ek(t);){if(eb(t)&&!eV(t))return t;t=eP(t)}return r}let n=eF(e,t);for(;n&&["table","td","th"].includes(em(n))&&eV(n);)n=eF(n,t);return n&&ek(n)&&eV(n)&&!eS(n)?r:n||function(e){let t=eP(e);for(;ey(t)&&!ek(t);){if(eS(t))return t;if(eE(t))break;t=eP(t)}return null}(e)||r}let eB=async function(e){let t=this.getOffsetParent||eH,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=ey(t),o=ev(t),l="fixed"===r,i=eD(e,!0,l,t),a={scrollLeft:0,scrollTop:0},s=U(0);if(n||!n&&!l){if(("body"!==em(t)||ex(o))&&(a=ej(t)),n){let e=eD(t,!0,l,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=ez(o))}return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},e_={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,l="fixed"===o,i=ev(n),a=!!t&&eE(t.floating);if(n===i||a&&l)return r;let s={scrollLeft:0,scrollTop:0},c=U(1),u=U(0),d=ey(n);if((d||!d&&!l)&&(("body"!==em(n)||ex(i))&&(s=ej(n)),ey(n))){let e=eD(n);c=eM(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-s.scrollLeft*c.x+u.x,y:r.y*c.y-s.scrollTop*c.y+u.y}},getDocumentElement:ev,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,l=[..."clippingAncestors"===r?eE(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=eA(e,[],!1).filter(e=>eb(e)&&"body"!==em(e)),o=null,l="fixed"===eR(e).position,i=l?eP(e):e;for(;eb(i)&&!ek(i);){let t=eR(i),r=eS(i);r||"fixed"!==t.position||(o=null),(l?!r&&!o:!r&&"static"===t.position&&!!o&&["absolute","fixed"].includes(o.position)||ex(i)&&!r&&function e(t,r){let n=eP(t);return!(n===r||!eb(n)||ek(n))&&("fixed"===eR(n).position||e(n,r))}(e,i))?n=n.filter(e=>e!==i):o=t,i=eP(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=l[0],a=l.reduce((e,r)=>{let n=eI(t,r,o);return e.top=Z(n.top,e.top),e.right=$(n.right,e.right),e.bottom=$(n.bottom,e.bottom),e.left=Z(n.left,e.left),e},eI(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:eH,getElementRects:eB,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=eL(e);return{width:t,height:r}},getScale:eM,isElement:eb,isRTL:function(e){return"rtl"===eR(e).direction}},eK=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:l,platform:i,elements:a,middlewareData:s}=t,{element:c,padding:u=0}=J(e,t)||{};if(null==c)return{};let d=ei(u),f={x:r,y:n},p=et(en(o)),m=er(p),h=await i.getDimensions(c),v="y"===p,g=v?"clientHeight":"clientWidth",b=l.reference[m]+l.reference[p]-f[p]-l.floating[m],y=f[p]-l.reference[p],w=await (null==i.getOffsetParent?void 0:i.getOffsetParent(c)),x=w?w[g]:0;x&&await (null==i.isElement?void 0:i.isElement(w))||(x=a.floating[g]||l.floating[m]);let E=x/2-h[m]/2-1,S=$(d[v?"top":"left"],E),C=$(d[v?"bottom":"right"],E),k=x-h[m]-C,R=x/2-h[m]/2+(b/2-y/2),j=Z(S,$(R,k)),P=!s.arrow&&null!=ee(o)&&R!==j&&l.reference[m]/2-(R{let n=new Map,o={platform:e_,...r},l={...o.platform,_c:n};return ec(e,t,{...o,platform:l})};var eZ="undefined"!=typeof document?f.useLayoutEffect:f.useEffect;function eY(e,t){let r,n,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!eY(e[n],t[n]))return!1;return!0}if((r=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){let r=o[n];if(("_owner"!==r||!e.$$typeof)&&!eY(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function eG(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eU(e,t){let r=eG(e);return Math.round(t*r)/r}function eX(e){let t=f.useRef(e);return eZ(()=>{t.current=e}),t}let eq=e=>({name:"arrow",options:e,fn(t){let{element:r,padding:n}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?eK({element:r.current,padding:n}).fn(t):{}:r?eK({element:r,padding:n}).fn(t):{}}}),eJ=(e,t)=>{var r;return{...(void 0===(r=e)&&(r=0),{name:"offset",options:r,async fn(e){var t,n;let{x:o,y:l,placement:i,middlewareData:a}=e,s=await ep(e,r);return i===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:o+s.x,y:l+s.y,data:{...s,placement:i}}}}),options:[e,t]}},eQ=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"shift",options:r,async fn(e){let{x:t,y:n,placement:o}=e,{mainAxis:l=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=J(r,e),c={x:t,y:n},u=await eu(e,s),d=en(Q(o)),f=et(d),p=c[f],m=c[d];if(l){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=p+u[e],n=p-u[t];p=Z(r,$(p,n))}if(i){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+u[e],n=m-u[t];m=Z(r,$(m,n))}let h=a.fn({...e,[f]:p,[d]:m});return{...h,data:{x:h.x-t,y:h.y-n}}}}),options:[e,t]}},e0=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{options:r,fn(e){let{x:t,y:n,placement:o,rects:l,middlewareData:i}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=J(r,e),u={x:t,y:n},d=en(o),f=et(d),p=u[f],m=u[d],h=J(a,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){let e="y"===f?"height":"width",t=l.reference[f]-l.floating[e]+v.mainAxis,r=l.reference[f]+l.reference[e]-v.mainAxis;pr&&(p=r)}if(c){var g,b;let e="y"===f?"width":"height",t=["top","left"].includes(Q(o)),r=l.reference[d]-l.floating[e]+(t&&(null==(g=i.offset)?void 0:g[d])||0)+(t?0:v.crossAxis),n=l.reference[d]+l.reference[e]+(t?0:(null==(b=i.offset)?void 0:b[d])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[f]:p,[d]:m}}}),options:[e,t]}},e1=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"flip",options:r,async fn(e){var t,n,o,l,i;let{placement:a,middlewareData:s,rects:c,initialPlacement:u,platform:d,elements:f}=e,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...y}=J(r,e);if(null!=(t=s.arrow)&&t.alignmentOffset)return{};let w=Q(a),x=en(u),E=Q(u)===u,S=await (null==d.isRTL?void 0:d.isRTL(f.floating)),C=h||(E||!b?[el(u)]:function(e){let t=el(e);return[eo(e),t,eo(t)]}(u)),k="none"!==g;!h&&k&&C.push(...function(e,t,r,n){let o=ee(e),l=function(e,t,r){let n=["left","right"],o=["right","left"];switch(e){case"top":case"bottom":if(r)return t?o:n;return t?n:o;case"left":case"right":return t?["top","bottom"]:["bottom","top"];default:return[]}}(Q(e),"start"===r,n);return o&&(l=l.map(e=>e+"-"+o),t&&(l=l.concat(l.map(eo)))),l}(u,b,g,S));let R=[u,...C],j=await eu(e,y),P=[],A=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&P.push(j[w]),m){let e=function(e,t,r){void 0===r&&(r=!1);let n=ee(e),o=et(en(e)),l=er(o),i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=el(i)),[i,el(i)]}(a,c,S);P.push(j[e[0]],j[e[1]])}if(A=[...A,{placement:a,overflows:P}],!P.every(e=>e<=0)){let e=((null==(o=s.flip)?void 0:o.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:A},reset:{placement:t}};let r=null==(l=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:l.placement;if(!r)switch(v){case"bestFit":{let e=null==(i=A.filter(e=>{if(k){let t=en(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:i[0];e&&(r=e);break}case"initialPlacement":r=u}if(a!==r)return{reset:{placement:r}}}return{}}}),options:[e,t]}},e2=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"size",options:r,async fn(e){let t,n;let{placement:o,rects:l,platform:i,elements:a}=e,{apply:s=()=>{},...c}=J(r,e),u=await eu(e,c),d=Q(o),f=ee(o),p="y"===en(o),{width:m,height:h}=l.floating;"top"===d||"bottom"===d?(t=d,n=f===(await (null==i.isRTL?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(n=d,t="end"===f?"top":"bottom");let v=h-u.top-u.bottom,g=m-u.left-u.right,b=$(h-u[t],v),y=$(m-u[n],g),w=!e.middlewareData.shift,x=b,E=y;if(p?E=f||w?$(y,g):g:x=f||w?$(b,v):v,w&&!f){let e=Z(u.left,0),t=Z(u.right,0),r=Z(u.top,0),n=Z(u.bottom,0);p?E=m-2*(0!==e||0!==t?e+t:Z(u.left,u.right)):x=h-2*(0!==r||0!==n?r+n:Z(u.top,u.bottom))}await s({...e,availableWidth:E,availableHeight:x});let S=await i.getDimensions(a.floating);return m!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}),options:[e,t]}},e5=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"hide",options:r,async fn(e){let{rects:t}=e,{strategy:n="referenceHidden",...o}=J(r,e);switch(n){case"referenceHidden":{let r=ed(await eu(e,{...o,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:ef(r)}}}case"escaped":{let r=ed(await eu(e,{...o,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:ef(r)}}}default:return{}}}}),options:[e,t]}},e6=(e,t)=>({...eq(e),options:[e,t]});var e8=f.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...l}=e;return(0,g.jsx)(E.WV.svg,{...l,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,g.jsx)("polygon",{points:"0,0 30,0 15,10"})})});e8.displayName="Arrow";var e7="Popper",[e3,e4]=b(e7),[e9,te]=e3(e7),tt=e=>{let{__scopePopper:t,children:r}=e,[n,o]=f.useState(null);return(0,g.jsx)(e9,{scope:t,anchor:n,onAnchorChange:o,children:r})};tt.displayName=e7;var tr="PopperAnchor",tn=f.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...o}=e,l=te(tr,r),i=f.useRef(null),a=(0,y.e)(t,i);return f.useEffect(()=>{l.onAnchorChange((null==n?void 0:n.current)||i.current)}),n?null:(0,g.jsx)(E.WV.div,{...o,ref:a})});tn.displayName=tr;var to="PopperContent",[tl,ti]=e3(to),ta=f.forwardRef((e,t)=>{var r,n,o,l,i,a,s,c;let{__scopePopper:u,side:d="bottom",sideOffset:p=0,align:h="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:w=!0,collisionBoundary:x=[],collisionPadding:C=0,sticky:k="partial",hideWhenDetached:R=!1,updatePositionStrategy:j="optimized",onPlaced:P,...A}=e,T=te(to,u),[L,N]=f.useState(null),M=(0,y.e)(t,e=>N(e)),[O,W]=f.useState(null),D=function(e){let[t,r]=f.useState(void 0);return F(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,o;if(!Array.isArray(t)||!t.length)return;let l=t[0];if("borderBoxSize"in l){let e=l.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,o=t.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(O),z=null!==(s=null==D?void 0:D.width)&&void 0!==s?s:0,I=null!==(c=null==D?void 0:D.height)&&void 0!==c?c:0,V="number"==typeof C?C:{top:0,right:0,bottom:0,left:0,...C},H=Array.isArray(x)?x:[x],B=H.length>0,_={padding:V,boundary:H.filter(td),altBoundary:B},{refs:K,floatingStyles:Y,placement:U,isPositioned:X,middlewareData:q}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:l,floating:i}={},transform:a=!0,whileElementsMounted:s,open:c}=e,[u,d]=f.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=f.useState(n);eY(p,n)||h(n);let[v,g]=f.useState(null),[b,y]=f.useState(null),w=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),x=f.useCallback(e=>{e!==k.current&&(k.current=e,y(e))},[]),E=l||v,S=i||b,C=f.useRef(null),k=f.useRef(null),R=f.useRef(u),j=null!=s,P=eX(s),A=eX(o),T=f.useCallback(()=>{if(!C.current||!k.current)return;let e={placement:t,strategy:r,middleware:p};A.current&&(e.platform=A.current),e$(C.current,k.current,e).then(e=>{let t={...e,isPositioned:!0};L.current&&!eY(R.current,t)&&(R.current=t,m.flushSync(()=>{d(t)}))})},[p,t,r,A]);eZ(()=>{!1===c&&R.current.isPositioned&&(R.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let L=f.useRef(!1);eZ(()=>(L.current=!0,()=>{L.current=!1}),[]),eZ(()=>{if(E&&(C.current=E),S&&(k.current=S),E&&S){if(P.current)return P.current(E,S,T);T()}},[E,S,T,P,j]);let N=f.useMemo(()=>({reference:C,floating:k,setReference:w,setFloating:x}),[w,x]),M=f.useMemo(()=>({reference:E,floating:S}),[E,S]),O=f.useMemo(()=>{let e={position:r,left:0,top:0};if(!M.floating)return e;let t=eU(M.floating,u.x),n=eU(M.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...eG(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,a,M.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:T,refs:N,elements:M,floatingStyles:O}),[u,T,N,M,O])}({strategy:"fixed",placement:d+("center"!==h?"-"+h:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r{l&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)});let f=u&&s?function(e,t){let r,n=null,o=ev(e);function l(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function i(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),l();let{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;let p=G(u),m=G(o.clientWidth-(c+d)),h={rootMargin:-p+"px "+-m+"px "+-G(o.clientHeight-(u+f))+"px "+-G(c)+"px",threshold:Z(0,$(1,s))||1},v=!0;function g(e){let t=e[0].intersectionRatio;if(t!==s){if(!v)return i();t?i(!1,t):r=setTimeout(()=>{i(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),l}(u,r):null,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let h=c?eD(e):null;return c&&function t(){let n=eD(e);h&&(n.x!==h.x||n.y!==h.y||n.width!==h.width||n.height!==h.height)&&r(),h=n,o=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{l&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(o)}}(...t,{animationFrame:"always"===j})},elements:{reference:T.anchor},middleware:[eJ({mainAxis:p+I,alignmentAxis:v}),w&&eQ({mainAxis:!0,crossAxis:!1,limiter:"partial"===k?e0():void 0,..._}),w&&e1({..._}),e2({..._,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:l,height:i}=r.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(n,"px")),a.setProperty("--radix-popper-available-height","".concat(o,"px")),a.setProperty("--radix-popper-anchor-width","".concat(l,"px")),a.setProperty("--radix-popper-anchor-height","".concat(i,"px"))}}),O&&e6({element:O,padding:b}),tf({arrowWidth:z,arrowHeight:I}),R&&e5({strategy:"referenceHidden",..._})]}),[J,Q]=tp(U),ee=S(P);F(()=>{X&&(null==ee||ee())},[X,ee]);let et=null===(r=q.arrow)||void 0===r?void 0:r.x,er=null===(n=q.arrow)||void 0===n?void 0:n.y,en=(null===(o=q.arrow)||void 0===o?void 0:o.centerOffset)!==0,[eo,el]=f.useState();return F(()=>{L&&el(window.getComputedStyle(L).zIndex)},[L]),(0,g.jsx)("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:X?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eo,"--radix-popper-transform-origin":[null===(l=q.transformOrigin)||void 0===l?void 0:l.x,null===(i=q.transformOrigin)||void 0===i?void 0:i.y].join(" "),...(null===(a=q.hide)||void 0===a?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,g.jsx)(tl,{scope:u,placedSide:J,onArrowChange:W,arrowX:et,arrowY:er,shouldHideArrow:en,children:(0,g.jsx)(E.WV.div,{"data-side":J,"data-align":Q,...A,ref:M,style:{...A.style,animation:X?void 0:"none"}})})})});ta.displayName=to;var ts="PopperArrow",tc={top:"bottom",right:"left",bottom:"top",left:"right"},tu=f.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=ti(ts,r),l=tc[o.placedSide];return(0,g.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,g.jsx)(e8,{...n,ref:t,style:{...n.style,display:"block"}})})});function td(e){return null!==e}tu.displayName=ts;var tf=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,l,i;let{placement:a,rects:s,middlewareData:c}=t,u=(null===(r=c.arrow)||void 0===r?void 0:r.centerOffset)!==0,d=u?0:e.arrowWidth,f=u?0:e.arrowHeight,[p,m]=tp(a),h={start:"0%",center:"50%",end:"100%"}[m],v=(null!==(l=null===(n=c.arrow)||void 0===n?void 0:n.x)&&void 0!==l?l:0)+d/2,g=(null!==(i=null===(o=c.arrow)||void 0===o?void 0:o.y)&&void 0!==i?i:0)+f/2,b="",y="";return"bottom"===p?(b=u?h:"".concat(v,"px"),y="".concat(-f,"px")):"top"===p?(b=u?h:"".concat(v,"px"),y="".concat(s.floating.height+f,"px")):"right"===p?(b="".concat(-f,"px"),y=u?h:"".concat(g,"px")):"left"===p&&(b="".concat(s.floating.width+f,"px"),y=u?h:"".concat(g,"px")),{data:{x:b,y}}}});function tp(e){let[t,r="center"]=e.split("-");return[t,r]}var tm=f.forwardRef((e,t)=>{var r,n;let{container:o,...l}=e,[i,a]=f.useState(!1);F(()=>a(!0),[]);let s=o||i&&(null===(n=globalThis)||void 0===n?void 0:null===(r=n.document)||void 0===r?void 0:r.body);return s?m.createPortal((0,g.jsx)(E.WV.div,{...l,ref:t}),s):null});function th({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,o]=function({defaultProp:e,onChange:t}){let r=f.useState(e),[n]=r,o=f.useRef(n),l=S(t);return f.useEffect(()=>{o.current!==n&&(l(n),o.current=n)},[n,o,l]),r}({defaultProp:t,onChange:r}),l=void 0!==e,i=l?e:n,a=S(r);return[i,f.useCallback(t=>{if(l){let r="function"==typeof t?t(e):t;r!==e&&a(r)}else o(t)},[l,e,o,a])]}tm.displayName="Portal";var tv=f.forwardRef((e,t)=>(0,g.jsx)(E.WV.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));tv.displayName="VisuallyHidden";var tg=new WeakMap,tb=new WeakMap,ty={},tw=0,tx=function(e){return e&&(e.host||tx(e.parentNode))},tE=function(e,t,r,n){var o=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=tx(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});ty[r]||(ty[r]=new WeakMap);var l=ty[r],i=[],a=new Set,s=new Set(o),c=function(e){!e||a.has(e)||(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,s=(tg.get(e)||0)+1,c=(l.get(e)||0)+1;tg.set(e,s),l.set(e,c),i.push(e),1===s&&o&&tb.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),a.clear(),tw++,function(){i.forEach(function(e){var t=tg.get(e)-1,o=l.get(e)-1;tg.set(e,t),l.set(e,o),t||(tb.has(e)||e.removeAttribute(n),tb.delete(e)),o||e.removeAttribute(r)}),--tw||(tg=new WeakMap,tg=new WeakMap,tb=new WeakMap,ty={})}},tS=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),tE(n,o,r,"aria-hidden")):function(){return null}},tC=function(){return(tC=Object.assign||function(e){for(var t,r=1,n=arguments.length;rt.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}"function"==typeof SuppressedError&&SuppressedError;var tR="right-scroll-bar-position",tj="width-before-scroll-bar";function tP(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var tA="undefined"!=typeof window?f.useLayoutEffect:f.useEffect,tT=new WeakMap,tL=(void 0===o&&(o={}),(void 0===l&&(l=function(e){return e}),i=[],a=!1,s={read:function(){if(a)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(e){var t=l(e,a);return i.push(t),function(){i=i.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(a=!0;i.length;){var t=i;i=[],t.forEach(e)}i={push:function(t){return e(t)},filter:function(){return i}}},assignMedium:function(e){a=!0;var t=[];if(i.length){var r=i;i=[],r.forEach(e),t=i}var n=function(){var r=t;t=[],r.forEach(e)},o=function(){return Promise.resolve().then(n)};o(),i={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),i}}}}).options=tC({async:!0,ssr:!1},o),s),tN=function(){},tM=f.forwardRef(function(e,t){var r,n,o,l,i=f.useRef(null),a=f.useState({onScrollCapture:tN,onWheelCapture:tN,onTouchMoveCapture:tN}),s=a[0],c=a[1],u=e.forwardProps,d=e.children,p=e.className,m=e.removeScrollBar,h=e.enabled,v=e.shards,g=e.sideCar,b=e.noIsolation,y=e.inert,w=e.allowPinchZoom,x=e.as,E=e.gapMode,S=tk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=(r=[i,t],n=function(e){return r.forEach(function(t){return tP(t,e)})},(o=(0,f.useState)(function(){return{value:null,callback:n,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=n,l=o.facade,tA(function(){var e=tT.get(l);if(e){var t=new Set(e),n=new Set(r),o=l.current;t.forEach(function(e){n.has(e)||tP(e,null)}),n.forEach(function(e){t.has(e)||tP(e,o)})}tT.set(l,r)},[r]),l),k=tC(tC({},S),s);return f.createElement(f.Fragment,null,h&&f.createElement(g,{sideCar:tL,removeScrollBar:m,shards:v,noIsolation:b,inert:y,setCallbacks:c,allowPinchZoom:!!w,lockRef:i,gapMode:E}),u?f.cloneElement(f.Children.only(d),tC(tC({},k),{ref:C})):f.createElement(void 0===x?"div":x,tC({},k,{className:p,ref:C}),d))});tM.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},tM.classNames={fullWidth:tj,zeroRight:tR};var tO=function(e){var t=e.sideCar,r=tk(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return f.createElement(n,tC({},r))};tO.isSideCarExport=!0;var tW=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=d||r.nc;return t&&e.setAttribute("nonce",t),e}())){var o,l;(o=t).styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n)),l=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(l)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tD=function(){var e=tW();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},tz=function(){var e=tD();return function(t){return e(t.styles,t.dynamic),null}},tI={left:0,top:0,right:0,gap:0},tV=function(e){return parseInt(e||"",10)||0},tF=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[tV(r),tV(n),tV(o)]},tH=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return tI;var t=tF(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},tB=tz(),t_="data-scroll-locked",tK=function(e,t,r,n){var o=e.left,l=e.top,i=e.right,a=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(a,"px ").concat(n,";\n }\n body[").concat(t_,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(l,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(tR," {\n right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(tj," {\n margin-right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(tR," .").concat(tR," {\n right: 0 ").concat(n,";\n }\n \n .").concat(tj," .").concat(tj," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(t_,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},t$=function(){var e=parseInt(document.body.getAttribute(t_)||"0",10);return isFinite(e)?e:0},tZ=function(){f.useEffect(function(){return document.body.setAttribute(t_,(t$()+1).toString()),function(){var e=t$()-1;e<=0?document.body.removeAttribute(t_):document.body.setAttribute(t_,e.toString())}},[])},tY=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;tZ();var l=f.useMemo(function(){return tH(o)},[o]);return f.createElement(tB,{styles:tK(l,!t,o,r?"":"!important")})},tG=!1;if("undefined"!=typeof window)try{var tU=Object.defineProperty({},"passive",{get:function(){return tG=!0,!0}});window.addEventListener("test",tU,tU),window.removeEventListener("test",tU,tU)}catch(e){tG=!1}var tX=!!tG&&{passive:!1},tq=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&"TEXTAREA"!==e.tagName&&"visible"===r[t])},tJ=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),tQ(e,n)){var o=t0(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},tQ=function(e,t){return"v"===e?tq(t,"overflowY"):tq(t,"overflowX")},t0=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},t1=function(e,t,r,n,o){var l,i=(l=window.getComputedStyle(t).direction,"h"===e&&"rtl"===l?-1:1),a=i*n,s=r.target,c=t.contains(s),u=!1,d=a>0,f=0,p=0;do{var m=t0(e,s),h=m[0],v=m[1]-m[2]-i*h;(h||v)&&tQ(e,s)&&(f+=v,p+=h),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return d&&(o&&1>Math.abs(f)||!o&&a>f)?u=!0:!d&&(o&&1>Math.abs(p)||!o&&-a>p)&&(u=!0),u},t2=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},t5=function(e){return[e.deltaX,e.deltaY]},t6=function(e){return e&&"current"in e?e.current:e},t8=0,t7=[],t3=(c=function(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(t8++)[0],l=f.useState(tz)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,o=0,l=t.length;oMath.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=tJ(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=tJ(d,u)),!f)return!1;if(!n.current&&"changedTouches"in e&&(s||c)&&(n.current=o),!o)return!0;var p=n.current||o;return t1(p,t,e,"h"===p?s:c,!0)},[]),s=f.useCallback(function(e){if(t7.length&&t7[t7.length-1]===l){var r="deltaY"in e?t5(e):t2(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta)[0]===r[0]&&n[1]===r[1]})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var o=(i.current.shards||[]).map(t6).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?a(e,o[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=f.useCallback(function(e,r,n,o){var l={name:e,delta:r,target:n,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(l),setTimeout(function(){t.current=t.current.filter(function(e){return e!==l})},1)},[]),u=f.useCallback(function(e){r.current=t2(e),n.current=void 0},[]),d=f.useCallback(function(t){c(t.type,t5(t),t.target,a(t,e.lockRef.current))},[]),p=f.useCallback(function(t){c(t.type,t2(t),t.target,a(t,e.lockRef.current))},[]);f.useEffect(function(){return t7.push(l),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",s,tX),document.addEventListener("touchmove",s,tX),document.addEventListener("touchstart",u,tX),function(){t7=t7.filter(function(e){return e!==l}),document.removeEventListener("wheel",s,tX),document.removeEventListener("touchmove",s,tX),document.removeEventListener("touchstart",u,tX)}},[]);var m=e.removeScrollBar,h=e.inert;return f.createElement(f.Fragment,null,h?f.createElement(l,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,m?f.createElement(tY,{gapMode:e.gapMode}):null)},tL.useMedium(c),tO),t4=f.forwardRef(function(e,t){return f.createElement(tM,tC({},e,{ref:t,sideCar:t3}))});t4.classNames=tM.classNames;var t9=[" ","Enter","ArrowUp","ArrowDown"],re=[" ","Enter"],rt="Select",[rr,rn,ro]=function(e){let t=e+"CollectionProvider",[r,n]=b(t),[o,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=e=>{let{scope:t,children:r}=e,n=f.useRef(null),l=f.useRef(new Map).current;return(0,g.jsx)(o,{scope:t,itemMap:l,collectionRef:n,children:r})};i.displayName=t;let a=e+"CollectionSlot",s=f.forwardRef((e,t)=>{let{scope:r,children:n}=e,o=l(a,r),i=(0,y.e)(t,o.collectionRef);return(0,g.jsx)(w.g7,{ref:i,children:n})});s.displayName=a;let c=e+"CollectionItemSlot",u="data-radix-collection-item",d=f.forwardRef((e,t)=>{let{scope:r,children:n,...o}=e,i=f.useRef(null),a=(0,y.e)(t,i),s=l(c,r);return f.useEffect(()=>(s.itemMap.set(i,{ref:i,...o}),()=>void s.itemMap.delete(i))),(0,g.jsx)(w.g7,{[u]:"",ref:a,children:n})});return d.displayName=c,[{Provider:i,Slot:s,ItemSlot:d},function(t){let r=l(e+"CollectionConsumer",t);return f.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(u,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},n]}(rt),[rl,ri]=b(rt,[ro,e4]),ra=e4(),[rs,rc]=rl(rt),[ru,rd]=rl(rt),rf=e=>{let{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:l,value:i,defaultValue:a,onValueChange:s,dir:c,name:u,autoComplete:d,disabled:p,required:m}=e,h=ra(t),[v,b]=f.useState(null),[y,w]=f.useState(null),[E,S]=f.useState(!1),C=function(e){let t=f.useContext(x);return e||t||"ltr"}(c),[k=!1,R]=th({prop:n,defaultProp:o,onChange:l}),[j,P]=th({prop:i,defaultProp:a,onChange:s}),A=f.useRef(null),T=!v||!!v.closest("form"),[L,N]=f.useState(new Set),M=Array.from(L).map(e=>e.props.value).join(";");return(0,g.jsx)(tt,{...h,children:(0,g.jsxs)(rs,{required:m,scope:t,trigger:v,onTriggerChange:b,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:_(),value:j,onValueChange:P,open:k,onOpenChange:R,dir:C,triggerPointerDownPosRef:A,disabled:p,children:[(0,g.jsx)(rr.Provider,{scope:t,children:(0,g.jsx)(ru,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(e=>{N(t=>new Set(t).add(e))},[]),onNativeOptionRemove:f.useCallback(e=>{N(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:r})}),T?(0,g.jsxs)(rJ,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:d,value:j,onChange:e=>P(e.target.value),disabled:p,children:[void 0===j?(0,g.jsx)("option",{value:""}):null,Array.from(L)]},M):null]})})};rf.displayName=rt;var rp="SelectTrigger",rm=f.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:n=!1,...o}=e,l=ra(r),i=rc(rp,r),a=i.disabled||n,s=(0,y.e)(t,i.onTriggerChange),c=rn(r),[u,d,f]=rQ(e=>{let t=c().filter(e=>!e.disabled),r=t.find(e=>e.value===i.value),n=r0(t,e,r);void 0!==n&&i.onValueChange(n.value)}),p=()=>{a||(i.onOpenChange(!0),f())};return(0,g.jsx)(tn,{asChild:!0,...l,children:(0,g.jsx)(E.WV.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":rq(i.value)?"":void 0,...o,ref:s,onClick:v(o.onClick,e=>{e.currentTarget.focus()}),onPointerDown:v(o.onPointerDown,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&(p(),i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)},e.preventDefault())}),onKeyDown:v(o.onKeyDown,e=>{let t=""!==u.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||d(e.key),(!t||" "!==e.key)&&t9.includes(e.key)&&(p(),e.preventDefault())})})})});rm.displayName=rp;var rh="SelectValue",rv=f.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,children:l,placeholder:i="",...a}=e,s=rc(rh,r),{onValueNodeHasChildrenChange:c}=s,u=void 0!==l,d=(0,y.e)(t,s.onValueNodeChange);return F(()=>{c(u)},[c,u]),(0,g.jsx)(E.WV.span,{...a,ref:d,style:{pointerEvents:"none"},children:rq(s.value)?(0,g.jsx)(g.Fragment,{children:i}):l})});rv.displayName=rh;var rg=f.forwardRef((e,t)=>{let{__scopeSelect:r,children:n,...o}=e;return(0,g.jsx)(E.WV.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});rg.displayName="SelectIcon";var rb=e=>(0,g.jsx)(tm,{asChild:!0,...e});rb.displayName="SelectPortal";var ry="SelectContent",rw=f.forwardRef((e,t)=>{let r=rc(ry,e.__scopeSelect),[n,o]=f.useState();return(F(()=>{o(new DocumentFragment)},[]),r.open)?(0,g.jsx)(rS,{...e,ref:t}):n?m.createPortal((0,g.jsx)(rx,{scope:e.__scopeSelect,children:(0,g.jsx)(rr.Slot,{scope:e.__scopeSelect,children:(0,g.jsx)("div",{children:e.children})})}),n):null});rw.displayName=ry;var[rx,rE]=rl(ry),rS=f.forwardRef((e,t)=>{let{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:i,side:a,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:b,avoidCollisions:x,...E}=e,S=rc(ry,r),[C,k]=f.useState(null),[j,P]=f.useState(null),L=(0,y.e)(t,e=>k(e)),[N,M]=f.useState(null),[W,D]=f.useState(null),z=rn(r),[I,V]=f.useState(!1),F=f.useRef(!1);f.useEffect(()=>{if(C)return tS(C)},[C]),f.useEffect(()=>{var e,t;let r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=r[0])&&void 0!==e?e:T()),document.body.insertAdjacentElement("beforeend",null!==(t=r[1])&&void 0!==t?t:T()),A++,()=>{1===A&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),A--}},[]);let H=f.useCallback(e=>{let[t,...r]=z().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(let r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&j&&(j.scrollTop=0),r===n&&j&&(j.scrollTop=j.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[z,j]),B=f.useCallback(()=>H([N,C]),[H,N,C]);f.useEffect(()=>{I&&B()},[I,B]);let{onOpenChange:_,triggerPointerDownPosRef:K}=S;f.useEffect(()=>{if(C){let e={x:0,y:0},t=t=>{var r,n,o,l;e={x:Math.abs(Math.round(t.pageX)-(null!==(o=null===(r=K.current)||void 0===r?void 0:r.x)&&void 0!==o?o:0)),y:Math.abs(Math.round(t.pageY)-(null!==(l=null===(n=K.current)||void 0===n?void 0:n.y)&&void 0!==l?l:0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():C.contains(r.target)||_(!1),document.removeEventListener("pointermove",t),K.current=null};return null!==K.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[C,_,K]),f.useEffect(()=>{let e=()=>_(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[_]);let[$,Z]=rQ(e=>{let t=z().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=r0(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),Y=f.useCallback((e,t,r)=>{let n=!F.current&&!r;(void 0!==S.value&&S.value===t||n)&&(M(e),n&&(F.current=!0))},[S.value]),G=f.useCallback(()=>null==C?void 0:C.focus(),[C]),U=f.useCallback((e,t,r)=>{let n=!F.current&&!r;(void 0!==S.value&&S.value===t||n)&&D(e)},[S.value]),X="popper"===n?rk:rC,q=X===rk?{side:a,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:b,avoidCollisions:x}:{};return(0,g.jsx)(rx,{scope:r,content:C,viewport:j,onViewportChange:P,itemRefCallback:Y,selectedItem:N,onItemLeave:G,itemTextRefCallback:U,focusSelectedItem:B,selectedItemText:W,position:n,isPositioned:I,searchRef:$,children:(0,g.jsx)(t4,{as:w.g7,allowPinchZoom:!0,children:(0,g.jsx)(O,{asChild:!0,trapped:S.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:v(o,e=>{var t;null===(t=S.trigger)||void 0===t||t.focus({preventScroll:!0}),e.preventDefault()}),children:(0,g.jsx)(R,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:(0,g.jsx)(X,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:e=>e.preventDefault(),...E,...q,onPlaced:()=>V(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:v(E.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||Z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=z().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})});rS.displayName="SelectContentImpl";var rC=f.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:n,...o}=e,l=rc(ry,r),i=rE(ry,r),[a,s]=f.useState(null),[c,u]=f.useState(null),d=(0,y.e)(t,e=>u(e)),p=rn(r),m=f.useRef(!1),v=f.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:x,focusSelectedItem:S}=i,C=f.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&c&&b&&w&&x){let e=l.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),r=l.valueNode.getBoundingClientRect(),o=x.getBoundingClientRect();if("rtl"!==l.dir){let n=o.left-t.left,l=r.left-n,i=e.left-l,s=e.width+i,c=Math.max(s,t.width),u=h(l,[10,window.innerWidth-10-c]);a.style.minWidth=s+"px",a.style.left=u+"px"}else{let n=t.right-o.right,l=window.innerWidth-r.right-n,i=window.innerWidth-e.right-l,s=e.width+i,c=Math.max(s,t.width),u=h(l,[10,window.innerWidth-10-c]);a.style.minWidth=s+"px",a.style.right=u+"px"}let i=p(),s=window.innerHeight-20,u=b.scrollHeight,d=window.getComputedStyle(c),f=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),y=f+v+u+parseInt(d.paddingBottom,10)+g,E=Math.min(5*w.offsetHeight,y),S=window.getComputedStyle(b),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),R=e.top+e.height/2-10,j=w.offsetHeight/2,P=f+v+(w.offsetTop+j);if(P<=R){let e=w===i[i.length-1].ref.current;a.style.bottom="0px";let t=c.clientHeight-b.offsetTop-b.offsetHeight;a.style.height=P+Math.max(s-R,j+(e?k:0)+t+g)+"px"}else{let e=w===i[0].ref.current;a.style.top="0px";let t=Math.max(R,f+b.offsetTop+(e?C:0)+j);a.style.height=t+(y-P)+"px",b.scrollTop=P-R+b.offsetTop}a.style.margin="".concat(10,"px 0"),a.style.minHeight=E+"px",a.style.maxHeight=s+"px",null==n||n(),requestAnimationFrame(()=>m.current=!0)}},[p,l.trigger,l.valueNode,a,c,b,w,x,l.dir,n]);F(()=>C(),[C]);let[k,R]=f.useState();F(()=>{c&&R(window.getComputedStyle(c).zIndex)},[c]);let j=f.useCallback(e=>{e&&!0===v.current&&(C(),null==S||S(),v.current=!1)},[C,S]);return(0,g.jsx)(rR,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:j,children:(0,g.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,g.jsx)(E.WV.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});rC.displayName="SelectItemAlignedPosition";var rk=f.forwardRef((e,t)=>{let{__scopeSelect:r,align:n="start",collisionPadding:o=10,...l}=e,i=ra(r);return(0,g.jsx)(ta,{...i,...l,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});rk.displayName="SelectPopperPosition";var[rR,rj]=rl(ry,{}),rP="SelectViewport",rA=f.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:n,...o}=e,l=rE(rP,r),i=rj(rP,r),a=(0,y.e)(t,l.onViewportChange),s=f.useRef(0);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),(0,g.jsx)(rr.Slot,{scope:r,children:(0,g.jsx)(E.WV.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"auto",...o.style},onScroll:v(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=i;if((null==n?void 0:n.current)&&r){let e=Math.abs(s.current-t.scrollTop);if(e>0){let n=window.innerHeight-20,o=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(o0?a:0,r.style.justifyContent="flex-end")}}}s.current=t.scrollTop})})})]})});rA.displayName=rP;var rT="SelectGroup",[rL,rN]=rl(rT),rM=f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=_();return(0,g.jsx)(rL,{scope:r,id:o,children:(0,g.jsx)(E.WV.div,{role:"group","aria-labelledby":o,...n,ref:t})})});rM.displayName=rT;var rO="SelectLabel",rW=f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=rN(rO,r);return(0,g.jsx)(E.WV.div,{id:o.id,...n,ref:t})});rW.displayName=rO;var rD="SelectItem",[rz,rI]=rl(rD),rV=f.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,disabled:o=!1,textValue:l,...i}=e,a=rc(rD,r),s=rE(rD,r),c=a.value===n,[u,d]=f.useState(null!=l?l:""),[p,m]=f.useState(!1),h=(0,y.e)(t,e=>{var t;return null===(t=s.itemRefCallback)||void 0===t?void 0:t.call(s,e,n,o)}),b=_(),w=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(""===n)throw Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,g.jsx)(rz,{scope:r,value:n,disabled:o,textId:b,isSelected:c,onItemTextChange:f.useCallback(e=>{d(t=>{var r;return t||(null!==(r=null==e?void 0:e.textContent)&&void 0!==r?r:"").trim()})},[]),children:(0,g.jsx)(rr.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:(0,g.jsx)(E.WV.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:h,onFocus:v(i.onFocus,()=>m(!0)),onBlur:v(i.onBlur,()=>m(!1)),onPointerUp:v(i.onPointerUp,w),onPointerMove:v(i.onPointerMove,e=>{if(o){var t;null===(t=s.onItemLeave)||void 0===t||t.call(s)}else e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:v(i.onPointerLeave,e=>{if(e.currentTarget===document.activeElement){var t;null===(t=s.onItemLeave)||void 0===t||t.call(s)}}),onKeyDown:v(i.onKeyDown,e=>{var t;(null===(t=s.searchRef)||void 0===t?void 0:t.current)!==""&&" "===e.key||(re.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});rV.displayName=rD;var rF="SelectItemText",rH=f.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,...l}=e,i=rc(rF,r),a=rE(rF,r),s=rI(rF,r),c=rd(rF,r),[u,d]=f.useState(null),p=(0,y.e)(t,e=>d(e),s.onItemTextChange,e=>{var t;return null===(t=a.itemTextRefCallback)||void 0===t?void 0:t.call(a,e,s.value,s.disabled)}),h=null==u?void 0:u.textContent,v=f.useMemo(()=>(0,g.jsx)("option",{value:s.value,disabled:s.disabled,children:h},s.value),[s.disabled,s.value,h]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=c;return F(()=>(b(v),()=>w(v)),[b,w,v]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(E.WV.span,{id:s.textId,...l,ref:p}),s.isSelected&&i.valueNode&&!i.valueNodeHasChildren?m.createPortal(l.children,i.valueNode):null]})});rH.displayName=rF;var rB="SelectItemIndicator",r_=f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return rI(rB,r).isSelected?(0,g.jsx)(E.WV.span,{"aria-hidden":!0,...n,ref:t}):null});r_.displayName=rB;var rK="SelectScrollUpButton",r$=f.forwardRef((e,t)=>{let r=rE(rK,e.__scopeSelect),n=rj(rK,e.__scopeSelect),[o,l]=f.useState(!1),i=(0,y.e)(t,n.onScrollButtonChange);return F(()=>{if(r.viewport&&r.isPositioned){let e=function(){l(t.scrollTop>0)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,g.jsx)(rG,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});r$.displayName=rK;var rZ="SelectScrollDownButton",rY=f.forwardRef((e,t)=>{let r=rE(rZ,e.__scopeSelect),n=rj(rZ,e.__scopeSelect),[o,l]=f.useState(!1),i=(0,y.e)(t,n.onScrollButtonChange);return F(()=>{if(r.viewport&&r.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;l(Math.ceil(t.scrollTop)t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,g.jsx)(rG,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});rY.displayName=rZ;var rG=f.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:n,...o}=e,l=rE("SelectScrollButton",r),i=f.useRef(null),a=rn(r),s=f.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return f.useEffect(()=>()=>s(),[s]),F(()=>{var e;let t=a().find(e=>e.ref.current===document.activeElement);null==t||null===(e=t.ref.current)||void 0===e||e.scrollIntoView({block:"nearest"})},[a]),(0,g.jsx)(E.WV.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:v(o.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(n,50))}),onPointerMove:v(o.onPointerMove,()=>{var e;null===(e=l.onItemLeave)||void 0===e||e.call(l),null===i.current&&(i.current=window.setInterval(n,50))}),onPointerLeave:v(o.onPointerLeave,()=>{s()})})}),rU=f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return(0,g.jsx)(E.WV.div,{"aria-hidden":!0,...n,ref:t})});rU.displayName="SelectSeparator";var rX="SelectArrow";function rq(e){return""===e||void 0===e}f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=ra(r),l=rc(rX,r),i=rE(rX,r);return l.open&&"popper"===i.position?(0,g.jsx)(tu,{...o,...n,ref:t}):null}).displayName=rX;var rJ=f.forwardRef((e,t)=>{let{value:r,...n}=e,o=f.useRef(null),l=(0,y.e)(t,o),i=function(e){let t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(r);return f.useEffect(()=>{let e=o.current,t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(i!==r&&t){let n=new Event("change",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[i,r]),(0,g.jsx)(tv,{asChild:!0,children:(0,g.jsx)("select",{...n,ref:l,defaultValue:r})})});function rQ(e){let t=S(e),r=f.useRef(""),n=f.useRef(0),o=f.useCallback(e=>{let o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),l=f.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,l]}function r0(e,t,r){var n;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,l=(n=Math.max(r?e.indexOf(r):-1,0),e.map((t,r)=>e[(n+r)%e.length]));1===o.length&&(l=l.filter(e=>e!==r));let i=l.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return i!==r?i:void 0}rJ.displayName="BubbleSelect";var r1=rf,r2=rm,r5=rv,r6=rg,r8=rb,r7=rw,r3=rA,r4=rM,r9=rW,ne=rV,nt=rH,nr=r_,nn=r$,no=rY,nl=rU},6370:function(e,t,r){r.d(t,{g7:function(){return i}});var n=r(6856),o=r(6960),l=r(2842),i=n.forwardRef((e,t)=>{let{children:r,...o}=e,i=n.Children.toArray(r),s=i.find(c);if(s){let e=s.props.children,r=i.map(t=>t!==s?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,l.jsx)(a,{...o,ref:t,children:n.isValidElement(e)?n.cloneElement(e,void 0,r):null})}return(0,l.jsx)(a,{...o,ref:t,children:r})});i.displayName="Slot";var a=n.forwardRef((e,t)=>{let{children:r,...l}=e;if(n.isValidElement(r)){let e,i;let a=(e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?r.ref:(e=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?r.props.ref:r.props.ref||r.ref;return n.cloneElement(r,{...function(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=(...e)=>{l(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}(l,r.props),ref:t?(0,o.F)(t,a):a})}return n.Children.count(r)>1?n.Children.only(null):null});a.displayName="SlotClone";var s=({children:e})=>(0,l.jsx)(l.Fragment,{children:e});function c(e){return n.isValidElement(e)&&e.type===s}},7756:function(e,t,r){r.d(t,{j:function(){return l}});let n=e=>"boolean"==typeof e?"".concat(e):0===e?"0":e,o=function(){for(var e,t,r=0,n="";rr=>{var l;if((null==t?void 0:t.variants)==null)return o(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:i,defaultVariants:a}=t,s=Object.keys(i).map(e=>{let t=null==r?void 0:r[e],o=null==a?void 0:a[e];if(null===t)return null;let l=n(t)||n(o);return i[e][l]}),c=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return o(e,s,null==t?void 0:null===(l=t.compoundVariants)||void 0===l?void 0:l.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...c}[t]):({...a,...c})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},5023:function(e,t,r){r.d(t,{W:function(){return n}});function n(){for(var e,t,r=0,n="",o=arguments.length;r{let t=a(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{let r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),o(r,t)||i(e)},getConflictingClassGroupIds:(e,t)=>{let o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},o=(e,t)=>{if(0===e.length)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),l=n?o(e.slice(1),n):void 0;if(l)return l;if(0===t.validators.length)return;let i=e.join("-");return t.validators.find(({validator:e})=>e(i))?.classGroupId},l=/^\[(.+)\]$/,i=e=>{if(l.test(e)){let t=l.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},a=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return d(Object.entries(e.classGroups),r).forEach(([e,r])=>{s(r,n,e,t)}),n},s=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){(""===e?t:c(t,e)).classGroupId=r;return}if("function"==typeof e){if(u(e)){s(e(n),t,r,n);return}t.validators.push({validator:e,classGroupId:r});return}Object.entries(e).forEach(([e,o])=>{s(o,c(t,e),r,n)})})},c=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},u=e=>e.isThemeGetter,d=(e,t)=>t?e.map(([e,r])=>[e,r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e)]):e,f=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=new Map,n=new Map,o=(o,l)=>{r.set(o,l),++t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},p=e=>{let{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],l=t.length,i=e=>{let r;let i=[],a=0,s=0;for(let c=0;cs?r-s:void 0}};return r?e=>r({className:e,parseClassName:i}):i},m=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},h=e=>({cache:f(e.cacheSize),parseClassName:p(e),...n(e)}),v=/\s+/,g=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,l=[],i=e.trim().split(v),a="";for(let e=i.length-1;e>=0;e-=1){let t=i[e],{modifiers:s,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(t),f=!!d,p=n(f?u.substring(0,d):u);if(!p){if(!f||!(p=n(u))){a=t+(a.length>0?" "+a:a);continue}f=!1}let h=m(s).join(":"),v=c?h+"!":h,g=v+p;if(l.includes(g))continue;l.push(g);let b=o(p,f);for(let e=0;e0?" "+a:a)}return a};function b(){let e,t,r=0,n="";for(;r{let t;if("string"==typeof e)return e;let r="";for(let n=0;n{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},x=/^\[(?:([a-z-]+):)?(.+)\]$/i,E=/^\d+\/\d+$/,S=new Set(["px","full","screen"]),C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,k=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,j=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,A=e=>L(e)||S.has(e)||E.test(e),T=e=>K(e,"length",$),L=e=>!!e&&!Number.isNaN(Number(e)),N=e=>K(e,"number",L),M=e=>!!e&&Number.isInteger(Number(e)),O=e=>e.endsWith("%")&&L(e.slice(0,-1)),W=e=>x.test(e),D=e=>C.test(e),z=new Set(["length","size","percentage"]),I=e=>K(e,z,Z),V=e=>K(e,"position",Z),F=new Set(["image","url"]),H=e=>K(e,F,G),B=e=>K(e,"",Y),_=()=>!0,K=(e,t,r)=>{let n=x.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},$=e=>k.test(e)&&!R.test(e),Z=()=>!1,Y=e=>j.test(e),G=e=>P.test(e),U=function(e,...t){let r,n,o;let l=function(a){return n=(r=h(t.reduce((e,t)=>t(e),e()))).cache.get,o=r.cache.set,l=i,i(a)};function i(e){let t=n(e);if(t)return t;let l=g(e,r);return o(e,l),l}return function(){return l(b.apply(null,arguments))}}(()=>{let e=w("colors"),t=w("spacing"),r=w("blur"),n=w("brightness"),o=w("borderColor"),l=w("borderRadius"),i=w("borderSpacing"),a=w("borderWidth"),s=w("contrast"),c=w("grayscale"),u=w("hueRotate"),d=w("invert"),f=w("gap"),p=w("gradientColorStops"),m=w("gradientColorStopPositions"),h=w("inset"),v=w("margin"),g=w("opacity"),b=w("padding"),y=w("saturate"),x=w("scale"),E=w("sepia"),S=w("skew"),C=w("space"),k=w("translate"),R=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",W,t],z=()=>[W,t],F=()=>["",A,T],K=()=>["auto",L,W],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",W],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[L,W];return{cacheSize:500,separator:":",theme:{colors:[_],spacing:[A,T],blur:["none","",D,W],brightness:q(),borderColor:[e],borderRadius:["none","","full",D,W],borderSpacing:z(),borderWidth:F(),contrast:q(),grayscale:U(),hueRotate:q(),invert:U(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[O,T],inset:P(),margin:P(),opacity:q(),padding:z(),saturate:q(),scale:q(),sepia:U(),skew:q(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[D]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),W]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",M,W]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",M,W]}],"grid-cols":[{"grid-cols":[_]}],"col-start-end":[{col:["auto",{span:["full",M,W]},W]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[_]}],"row-start-end":[{row:["auto",{span:[M,W]},W]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,t]}],"min-w":[{"min-w":[W,t,"min","max","fit"]}],"max-w":[{"max-w":[W,t,"none","full","min","max","fit","prose",{screen:[D]},D]}],h:[{h:[W,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,t,"auto","min","max","fit"]}],"font-size":[{text:["base",D,T]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",N]}],"font-family":[{font:[_]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",L,N]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",A,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",A,T]}],"underline-offset":[{"underline-offset":["auto",A,W]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),V]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",I]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},H]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Z()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[A,W]}],"outline-w":[{outline:[A,T]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[A,T]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",D,B]}],"shadow-color":[{shadow:[_]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",D,W]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[M,W]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",W]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",W]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[A,T,N]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}})}}]); \ No newline at end of file + */let n=(0,r(7882).Z)("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])},6960:function(e,t,r){r.d(t,{F:function(){return o},e:function(){return l}});var n=r(6856);function o(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}function l(...e){return n.useCallback(o(...e),e)}},1453:function(e,t,r){r.d(t,{f:function(){return a}});var n=r(6856),o=r(5502),l=r(2842),i=n.forwardRef((e,t)=>(0,l.jsx)(o.WV.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null===(r=e.onMouseDown)||void 0===r||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));i.displayName="Label";var a=i},5502:function(e,t,r){r.d(t,{WV:function(){return a},jH:function(){return s}});var n=r(6856),o=r(2181),l=r(6370),i=r(2842),a=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let r=n.forwardRef((e,r)=>{let{asChild:n,...o}=e,a=n?l.g7:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(a,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function s(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}},3832:function(e,t,r){let n;r.d(t,{VY:function(){return r3},ZA:function(){return r4},JO:function(){return r5},ck:function(){return ne},wU:function(){return nr},eT:function(){return nt},__:function(){return r9},h_:function(){return r8},fC:function(){return r1},$G:function(){return no},u_:function(){return nn},Z0:function(){return nl},xz:function(){return r2},B4:function(){return r6},l_:function(){return r7}});var o,l,i,a,s,c,u,d,f=r(6856),p=r.t(f,2),m=r(2181);function h(e,[t,r]){return Math.min(r,Math.max(t,e))}function v(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}var g=r(2842);function b(e,t=[]){let r=[],n=()=>{let t=r.map(e=>f.createContext(e));return function(r){let n=r?.[e]||t;return f.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return n.scopeName=e,[function(t,n){let o=f.createContext(n),l=r.length;function i(t){let{scope:r,children:n,...i}=t,a=r?.[e][l]||o,s=f.useMemo(()=>i,Object.values(i));return(0,g.jsx)(a.Provider,{value:s,children:n})}return r=[...r,n],i.displayName=t+"Provider",[i,function(r,i){let a=i?.[e][l]||o,s=f.useContext(a);if(s)return s;if(void 0!==n)return n;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let n=r.reduce((t,{useScope:r,scopeName:n})=>{let o=r(e)[`__scope${n}`];return{...t,...o}},{});return f.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}(n,...t)]}var y=r(6960),w=r(6370),x=f.createContext(void 0),E=r(5502);function S(e){let t=f.useRef(e);return f.useEffect(()=>{t.current=e}),f.useMemo(()=>(...e)=>t.current?.(...e),[])}var C="dismissableLayer.update",k=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),R=f.forwardRef((e,t)=>{var r,n;let{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:c,...d}=e,p=f.useContext(k),[m,h]=f.useState(null),b=null!==(n=null==m?void 0:m.ownerDocument)&&void 0!==n?n:null===(r=globalThis)||void 0===r?void 0:r.document,[,w]=f.useState({}),x=(0,y.e)(t,e=>h(e)),R=Array.from(p.layers),[A]=[...p.layersWithOutsidePointerEventsDisabled].slice(-1),T=R.indexOf(A),L=m?R.indexOf(m):-1,N=p.layersWithOutsidePointerEventsDisabled.size>0,M=L>=T,O=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,n=S(e),o=f.useRef(!1),l=f.useRef(()=>{});return f.useEffect(()=>{let e=e=>{if(e.target&&!o.current){let t=function(){P("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",l.current),l.current=t,r.addEventListener("click",l.current,{once:!0})):t()}else r.removeEventListener("click",l.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",l.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{let t=e.target,r=[...p.branches].some(e=>e.contains(t));!M||r||(null==i||i(e),null==s||s(e),e.defaultPrevented||null==c||c())},b),W=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,n=S(e),o=f.useRef(!1);return f.useEffect(()=>{let e=e=>{e.target&&!o.current&&P("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{let t=e.target;[...p.branches].some(e=>e.contains(t))||(null==a||a(e),null==s||s(e),e.defaultPrevented||null==c||c())},b);return!function(e,t=globalThis?.document){let r=S(e);f.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{L!==p.layers.size-1||(null==l||l(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},b),f.useEffect(()=>{if(m)return o&&(0===p.layersWithOutsidePointerEventsDisabled.size&&(u=b.body.style.pointerEvents,b.body.style.pointerEvents="none"),p.layersWithOutsidePointerEventsDisabled.add(m)),p.layers.add(m),j(),()=>{o&&1===p.layersWithOutsidePointerEventsDisabled.size&&(b.body.style.pointerEvents=u)}},[m,b,o,p]),f.useEffect(()=>()=>{m&&(p.layers.delete(m),p.layersWithOutsidePointerEventsDisabled.delete(m),j())},[m,p]),f.useEffect(()=>{let e=()=>w({});return document.addEventListener(C,e),()=>document.removeEventListener(C,e)},[]),(0,g.jsx)(E.WV.div,{...d,ref:x,style:{pointerEvents:N?M?"auto":"none":void 0,...e.style},onFocusCapture:v(e.onFocusCapture,W.onFocusCapture),onBlurCapture:v(e.onBlurCapture,W.onBlurCapture),onPointerDownCapture:v(e.onPointerDownCapture,O.onPointerDownCapture)})});function j(){let e=new CustomEvent(C);document.dispatchEvent(e)}function P(e,t,r,n){let{discrete:o}=n,l=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),o?(0,E.jH)(l,i):l.dispatchEvent(i)}R.displayName="DismissableLayer",f.forwardRef((e,t)=>{let r=f.useContext(k),n=f.useRef(null),o=(0,y.e)(t,n);return f.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,g.jsx)(E.WV.div,{...e,ref:o})}).displayName="DismissableLayerBranch";var A=0;function T(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var L="focusScope.autoFocusOnMount",N="focusScope.autoFocusOnUnmount",M={bubbles:!1,cancelable:!0},O=f.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:o,onUnmountAutoFocus:l,...i}=e,[a,s]=f.useState(null),c=S(o),u=S(l),d=f.useRef(null),p=(0,y.e)(t,e=>s(e)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(n){let e=function(e){if(m.paused||!a)return;let t=e.target;a.contains(t)?d.current=t:z(d.current,{select:!0})},t=function(e){if(m.paused||!a)return;let t=e.relatedTarget;null===t||a.contains(t)||z(d.current,{select:!0})};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&z(a)});return a&&r.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,a,m.paused]),f.useEffect(()=>{if(a){I.add(m);let e=document.activeElement;if(!a.contains(e)){let t=new CustomEvent(L,M);a.addEventListener(L,c),a.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.activeElement;for(let n of e)if(z(n,{select:t}),document.activeElement!==r)return}(W(a).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&z(a))}return()=>{a.removeEventListener(L,c),setTimeout(()=>{let t=new CustomEvent(N,M);a.addEventListener(N,u),a.dispatchEvent(t),t.defaultPrevented||z(null!=e?e:document.body,{select:!0}),a.removeEventListener(N,u),I.remove(m)},0)}}},[a,c,u,m]);let h=f.useCallback(e=>{if(!r&&!n||m.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[n,l]=function(e){let t=W(e);return[D(t,e),D(t.reverse(),e)]}(t);n&&l?e.shiftKey||o!==l?e.shiftKey&&o===n&&(e.preventDefault(),r&&z(l,{select:!0})):(e.preventDefault(),r&&z(n,{select:!0})):o===t&&e.preventDefault()}},[r,n,m.paused]);return(0,g.jsx)(E.WV.div,{tabIndex:-1,...i,ref:p,onKeyDown:h})});function W(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function D(e,t){for(let r of e)if(!function(e,t){let{upTo:r}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===r||e!==r);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function z(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}O.displayName="FocusScope";var I=(n=[],{add(e){let t=n[0];e!==t&&(null==t||t.pause()),(n=V(n,e)).unshift(e)},remove(e){var t;null===(t=(n=V(n,e))[0])||void 0===t||t.resume()}});function V(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}var F=globalThis?.document?f.useLayoutEffect:()=>{},H=p["useId".toString()]||(()=>void 0),B=0;function _(e){let[t,r]=f.useState(H());return F(()=>{e||r(e=>e??String(B++))},[e]),e||(t?`radix-${t}`:"")}let K=["top","right","bottom","left"],$=Math.min,Z=Math.max,Y=Math.round,G=Math.floor,U=e=>({x:e,y:e}),X={left:"right",right:"left",bottom:"top",top:"bottom"},q={start:"end",end:"start"};function J(e,t){return"function"==typeof e?e(t):e}function Q(e){return e.split("-")[0]}function ee(e){return e.split("-")[1]}function et(e){return"x"===e?"y":"x"}function er(e){return"y"===e?"height":"width"}function en(e){return["top","bottom"].includes(Q(e))?"y":"x"}function eo(e){return e.replace(/start|end/g,e=>q[e])}function el(e){return e.replace(/left|right|bottom|top/g,e=>X[e])}function ei(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function ea(e){let{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function es(e,t,r){let n,{reference:o,floating:l}=e,i=en(t),a=et(en(t)),s=er(a),c=Q(t),u="y"===i,d=o.x+o.width/2-l.width/2,f=o.y+o.height/2-l.height/2,p=o[s]/2-l[s]/2;switch(c){case"top":n={x:d,y:o.y-l.height};break;case"bottom":n={x:d,y:o.y+o.height};break;case"right":n={x:o.x+o.width,y:f};break;case"left":n={x:o.x-l.width,y:f};break;default:n={x:o.x,y:o.y}}switch(ee(t)){case"start":n[a]-=p*(r&&u?-1:1);break;case"end":n[a]+=p*(r&&u?-1:1)}return n}let ec=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:l=[],platform:i}=r,a=l.filter(Boolean),s=await (null==i.isRTL?void 0:i.isRTL(t)),c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=es(c,n,s),f=n,p={},m=0;for(let r=0;re[t]>=0)}async function ep(e,t){let{placement:r,platform:n,elements:o}=e,l=await (null==n.isRTL?void 0:n.isRTL(o.floating)),i=Q(r),a=ee(r),s="y"===en(r),c=["left","top"].includes(i)?-1:1,u=l&&s?-1:1,d=J(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),s?{x:p*u,y:f*c}:{x:f*c,y:p*u}}function em(e){return eg(e)?(e.nodeName||"").toLowerCase():"#document"}function eh(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function ev(e){var t;return null==(t=(eg(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function eg(e){return e instanceof Node||e instanceof eh(e).Node}function eb(e){return e instanceof Element||e instanceof eh(e).Element}function ey(e){return e instanceof HTMLElement||e instanceof eh(e).HTMLElement}function ew(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof eh(e).ShadowRoot)}function ex(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=eR(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function eE(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(e){return!1}})}function eS(e){let t=eC(),r=eb(e)?eR(e):e;return"none"!==r.transform||"none"!==r.perspective||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","perspective","filter"].some(e=>(r.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(r.contain||"").includes(e))}function eC(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}function ek(e){return["html","body","#document"].includes(em(e))}function eR(e){return eh(e).getComputedStyle(e)}function ej(e){return eb(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function eP(e){if("html"===em(e))return e;let t=e.assignedSlot||e.parentNode||ew(e)&&e.host||ev(e);return ew(t)?t.host:t}function eA(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let o=function e(t){let r=eP(t);return ek(r)?t.ownerDocument?t.ownerDocument.body:t.body:ey(r)&&ex(r)?r:e(r)}(e),l=o===(null==(n=e.ownerDocument)?void 0:n.body),i=eh(o);if(l){let e=eT(i);return t.concat(i,i.visualViewport||[],ex(o)?o:[],e&&r?eA(e):[])}return t.concat(o,eA(o,[],r))}function eT(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function eL(e){let t=eR(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=ey(e),l=o?e.offsetWidth:r,i=o?e.offsetHeight:n,a=Y(r)!==l||Y(n)!==i;return a&&(r=l,n=i),{width:r,height:n,$:a}}function eN(e){return eb(e)?e:e.contextElement}function eM(e){let t=eN(e);if(!ey(t))return U(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:l}=eL(t),i=(l?Y(r.width):r.width)/n,a=(l?Y(r.height):r.height)/o;return i&&Number.isFinite(i)||(i=1),a&&Number.isFinite(a)||(a=1),{x:i,y:a}}let eO=U(0);function eW(e){let t=eh(e);return eC()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eO}function eD(e,t,r,n){var o;void 0===t&&(t=!1),void 0===r&&(r=!1);let l=e.getBoundingClientRect(),i=eN(e),a=U(1);t&&(n?eb(n)&&(a=eM(n)):a=eM(e));let s=(void 0===(o=r)&&(o=!1),n&&(!o||n===eh(i))&&o)?eW(i):U(0),c=(l.left+s.x)/a.x,u=(l.top+s.y)/a.y,d=l.width/a.x,f=l.height/a.y;if(i){let e=eh(i),t=n&&eb(n)?eh(n):n,r=e,o=eT(r);for(;o&&n&&t!==r;){let e=eM(o),t=o.getBoundingClientRect(),n=eR(o),l=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;c*=e.x,u*=e.y,d*=e.x,f*=e.y,c+=l,u+=i,o=eT(r=eh(o))}}return ea({width:d,height:f,x:c,y:u})}function ez(e){return eD(ev(e)).left+ej(e).scrollLeft}function eI(e,t,r){let n;if("viewport"===t)n=function(e,t){let r=eh(e),n=ev(e),o=r.visualViewport,l=n.clientWidth,i=n.clientHeight,a=0,s=0;if(o){l=o.width,i=o.height;let e=eC();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,s=o.offsetTop)}return{width:l,height:i,x:a,y:s}}(e,r);else if("document"===t)n=function(e){let t=ev(e),r=ej(e),n=e.ownerDocument.body,o=Z(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),l=Z(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),i=-r.scrollLeft+ez(e),a=-r.scrollTop;return"rtl"===eR(n).direction&&(i+=Z(t.clientWidth,n.clientWidth)-o),{width:o,height:l,x:i,y:a}}(ev(e));else if(eb(t))n=function(e,t){let r=eD(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,l=ey(e)?eM(e):U(1),i=e.clientWidth*l.x;return{width:i,height:e.clientHeight*l.y,x:o*l.x,y:n*l.y}}(t,r);else{let r=eW(e);n={...t,x:t.x-r.x,y:t.y-r.y}}return ea(n)}function eV(e){return"static"===eR(e).position}function eF(e,t){return ey(e)&&"fixed"!==eR(e).position?t?t(e):e.offsetParent:null}function eH(e,t){let r=eh(e);if(eE(e))return r;if(!ey(e)){let t=eP(e);for(;t&&!ek(t);){if(eb(t)&&!eV(t))return t;t=eP(t)}return r}let n=eF(e,t);for(;n&&["table","td","th"].includes(em(n))&&eV(n);)n=eF(n,t);return n&&ek(n)&&eV(n)&&!eS(n)?r:n||function(e){let t=eP(e);for(;ey(t)&&!ek(t);){if(eS(t))return t;if(eE(t))break;t=eP(t)}return null}(e)||r}let eB=async function(e){let t=this.getOffsetParent||eH,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=ey(t),o=ev(t),l="fixed"===r,i=eD(e,!0,l,t),a={scrollLeft:0,scrollTop:0},s=U(0);if(n||!n&&!l){if(("body"!==em(t)||ex(o))&&(a=ej(t)),n){let e=eD(t,!0,l,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else o&&(s.x=ez(o))}return{x:i.left+a.scrollLeft-s.x,y:i.top+a.scrollTop-s.y,width:i.width,height:i.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},e_={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,l="fixed"===o,i=ev(n),a=!!t&&eE(t.floating);if(n===i||a&&l)return r;let s={scrollLeft:0,scrollTop:0},c=U(1),u=U(0),d=ey(n);if((d||!d&&!l)&&(("body"!==em(n)||ex(i))&&(s=ej(n)),ey(n))){let e=eD(n);c=eM(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-s.scrollLeft*c.x+u.x,y:r.y*c.y-s.scrollTop*c.y+u.y}},getDocumentElement:ev,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,l=[..."clippingAncestors"===r?eE(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=eA(e,[],!1).filter(e=>eb(e)&&"body"!==em(e)),o=null,l="fixed"===eR(e).position,i=l?eP(e):e;for(;eb(i)&&!ek(i);){let t=eR(i),r=eS(i);r||"fixed"!==t.position||(o=null),(l?!r&&!o:!r&&"static"===t.position&&!!o&&["absolute","fixed"].includes(o.position)||ex(i)&&!r&&function e(t,r){let n=eP(t);return!(n===r||!eb(n)||ek(n))&&("fixed"===eR(n).position||e(n,r))}(e,i))?n=n.filter(e=>e!==i):o=t,i=eP(i)}return t.set(e,n),n}(t,this._c):[].concat(r),n],i=l[0],a=l.reduce((e,r)=>{let n=eI(t,r,o);return e.top=Z(n.top,e.top),e.right=$(n.right,e.right),e.bottom=$(n.bottom,e.bottom),e.left=Z(n.left,e.left),e},eI(t,i,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:eH,getElementRects:eB,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=eL(e);return{width:t,height:r}},getScale:eM,isElement:eb,isRTL:function(e){return"rtl"===eR(e).direction}},eK=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:l,platform:i,elements:a,middlewareData:s}=t,{element:c,padding:u=0}=J(e,t)||{};if(null==c)return{};let d=ei(u),f={x:r,y:n},p=et(en(o)),m=er(p),h=await i.getDimensions(c),v="y"===p,g=v?"clientHeight":"clientWidth",b=l.reference[m]+l.reference[p]-f[p]-l.floating[m],y=f[p]-l.reference[p],w=await (null==i.getOffsetParent?void 0:i.getOffsetParent(c)),x=w?w[g]:0;x&&await (null==i.isElement?void 0:i.isElement(w))||(x=a.floating[g]||l.floating[m]);let E=x/2-h[m]/2-1,S=$(d[v?"top":"left"],E),C=$(d[v?"bottom":"right"],E),k=x-h[m]-C,R=x/2-h[m]/2+(b/2-y/2),j=Z(S,$(R,k)),P=!s.arrow&&null!=ee(o)&&R!==j&&l.reference[m]/2-(R{let n=new Map,o={platform:e_,...r},l={...o.platform,_c:n};return ec(e,t,{...o,platform:l})};var eZ="undefined"!=typeof document?f.useLayoutEffect:f.useEffect;function eY(e,t){let r,n,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!eY(e[n],t[n]))return!1;return!0}if((r=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){let r=o[n];if(("_owner"!==r||!e.$$typeof)&&!eY(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function eG(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function eU(e,t){let r=eG(e);return Math.round(t*r)/r}function eX(e){let t=f.useRef(e);return eZ(()=>{t.current=e}),t}let eq=e=>({name:"arrow",options:e,fn(t){let{element:r,padding:n}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?eK({element:r.current,padding:n}).fn(t):{}:r?eK({element:r,padding:n}).fn(t):{}}}),eJ=(e,t)=>{var r;return{...(void 0===(r=e)&&(r=0),{name:"offset",options:r,async fn(e){var t,n;let{x:o,y:l,placement:i,middlewareData:a}=e,s=await ep(e,r);return i===(null==(t=a.offset)?void 0:t.placement)&&null!=(n=a.arrow)&&n.alignmentOffset?{}:{x:o+s.x,y:l+s.y,data:{...s,placement:i}}}}),options:[e,t]}},eQ=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"shift",options:r,async fn(e){let{x:t,y:n,placement:o}=e,{mainAxis:l=!0,crossAxis:i=!1,limiter:a={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...s}=J(r,e),c={x:t,y:n},u=await eu(e,s),d=en(Q(o)),f=et(d),p=c[f],m=c[d];if(l){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=p+u[e],n=p-u[t];p=Z(r,$(p,n))}if(i){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=m+u[e],n=m-u[t];m=Z(r,$(m,n))}let h=a.fn({...e,[f]:p,[d]:m});return{...h,data:{x:h.x-t,y:h.y-n}}}}),options:[e,t]}},e0=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{options:r,fn(e){let{x:t,y:n,placement:o,rects:l,middlewareData:i}=e,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=J(r,e),u={x:t,y:n},d=en(o),f=et(d),p=u[f],m=u[d],h=J(a,e),v="number"==typeof h?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(s){let e="y"===f?"height":"width",t=l.reference[f]-l.floating[e]+v.mainAxis,r=l.reference[f]+l.reference[e]-v.mainAxis;pr&&(p=r)}if(c){var g,b;let e="y"===f?"width":"height",t=["top","left"].includes(Q(o)),r=l.reference[d]-l.floating[e]+(t&&(null==(g=i.offset)?void 0:g[d])||0)+(t?0:v.crossAxis),n=l.reference[d]+l.reference[e]+(t?0:(null==(b=i.offset)?void 0:b[d])||0)-(t?v.crossAxis:0);mn&&(m=n)}return{[f]:p,[d]:m}}}),options:[e,t]}},e1=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"flip",options:r,async fn(e){var t,n,o,l,i;let{placement:a,middlewareData:s,rects:c,initialPlacement:u,platform:d,elements:f}=e,{mainAxis:p=!0,crossAxis:m=!0,fallbackPlacements:h,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...y}=J(r,e);if(null!=(t=s.arrow)&&t.alignmentOffset)return{};let w=Q(a),x=en(u),E=Q(u)===u,S=await (null==d.isRTL?void 0:d.isRTL(f.floating)),C=h||(E||!b?[el(u)]:function(e){let t=el(e);return[eo(e),t,eo(t)]}(u)),k="none"!==g;!h&&k&&C.push(...function(e,t,r,n){let o=ee(e),l=function(e,t,r){let n=["left","right"],o=["right","left"];switch(e){case"top":case"bottom":if(r)return t?o:n;return t?n:o;case"left":case"right":return t?["top","bottom"]:["bottom","top"];default:return[]}}(Q(e),"start"===r,n);return o&&(l=l.map(e=>e+"-"+o),t&&(l=l.concat(l.map(eo)))),l}(u,b,g,S));let R=[u,...C],j=await eu(e,y),P=[],A=(null==(n=s.flip)?void 0:n.overflows)||[];if(p&&P.push(j[w]),m){let e=function(e,t,r){void 0===r&&(r=!1);let n=ee(e),o=et(en(e)),l=er(o),i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[l]>t.floating[l]&&(i=el(i)),[i,el(i)]}(a,c,S);P.push(j[e[0]],j[e[1]])}if(A=[...A,{placement:a,overflows:P}],!P.every(e=>e<=0)){let e=((null==(o=s.flip)?void 0:o.index)||0)+1,t=R[e];if(t)return{data:{index:e,overflows:A},reset:{placement:t}};let r=null==(l=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:l.placement;if(!r)switch(v){case"bestFit":{let e=null==(i=A.filter(e=>{if(k){let t=en(e.placement);return t===x||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:i[0];e&&(r=e);break}case"initialPlacement":r=u}if(a!==r)return{reset:{placement:r}}}return{}}}),options:[e,t]}},e2=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"size",options:r,async fn(e){let t,n;let{placement:o,rects:l,platform:i,elements:a}=e,{apply:s=()=>{},...c}=J(r,e),u=await eu(e,c),d=Q(o),f=ee(o),p="y"===en(o),{width:m,height:h}=l.floating;"top"===d||"bottom"===d?(t=d,n=f===(await (null==i.isRTL?void 0:i.isRTL(a.floating))?"start":"end")?"left":"right"):(n=d,t="end"===f?"top":"bottom");let v=h-u.top-u.bottom,g=m-u.left-u.right,b=$(h-u[t],v),y=$(m-u[n],g),w=!e.middlewareData.shift,x=b,E=y;if(p?E=f||w?$(y,g):g:x=f||w?$(b,v):v,w&&!f){let e=Z(u.left,0),t=Z(u.right,0),r=Z(u.top,0),n=Z(u.bottom,0);p?E=m-2*(0!==e||0!==t?e+t:Z(u.left,u.right)):x=h-2*(0!==r||0!==n?r+n:Z(u.top,u.bottom))}await s({...e,availableWidth:E,availableHeight:x});let S=await i.getDimensions(a.floating);return m!==S.width||h!==S.height?{reset:{rects:!0}}:{}}}),options:[e,t]}},e6=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"hide",options:r,async fn(e){let{rects:t}=e,{strategy:n="referenceHidden",...o}=J(r,e);switch(n){case"referenceHidden":{let r=ed(await eu(e,{...o,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:ef(r)}}}case"escaped":{let r=ed(await eu(e,{...o,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:ef(r)}}}default:return{}}}}),options:[e,t]}},e5=(e,t)=>({...eq(e),options:[e,t]});var e8=f.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...l}=e;return(0,g.jsx)(E.WV.svg,{...l,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,g.jsx)("polygon",{points:"0,0 30,0 15,10"})})});e8.displayName="Arrow";var e3="Popper",[e7,e4]=b(e3),[e9,te]=e7(e3),tt=e=>{let{__scopePopper:t,children:r}=e,[n,o]=f.useState(null);return(0,g.jsx)(e9,{scope:t,anchor:n,onAnchorChange:o,children:r})};tt.displayName=e3;var tr="PopperAnchor",tn=f.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:n,...o}=e,l=te(tr,r),i=f.useRef(null),a=(0,y.e)(t,i);return f.useEffect(()=>{l.onAnchorChange((null==n?void 0:n.current)||i.current)}),n?null:(0,g.jsx)(E.WV.div,{...o,ref:a})});tn.displayName=tr;var to="PopperContent",[tl,ti]=e7(to),ta=f.forwardRef((e,t)=>{var r,n,o,l,i,a,s,c;let{__scopePopper:u,side:d="bottom",sideOffset:p=0,align:h="center",alignOffset:v=0,arrowPadding:b=0,avoidCollisions:w=!0,collisionBoundary:x=[],collisionPadding:C=0,sticky:k="partial",hideWhenDetached:R=!1,updatePositionStrategy:j="optimized",onPlaced:P,...A}=e,T=te(to,u),[L,N]=f.useState(null),M=(0,y.e)(t,e=>N(e)),[O,W]=f.useState(null),D=function(e){let[t,r]=f.useState(void 0);return F(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,o;if(!Array.isArray(t)||!t.length)return;let l=t[0];if("borderBoxSize"in l){let e=l.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,o=t.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}(O),z=null!==(s=null==D?void 0:D.width)&&void 0!==s?s:0,I=null!==(c=null==D?void 0:D.height)&&void 0!==c?c:0,V="number"==typeof C?C:{top:0,right:0,bottom:0,left:0,...C},H=Array.isArray(x)?x:[x],B=H.length>0,_={padding:V,boundary:H.filter(td),altBoundary:B},{refs:K,floatingStyles:Y,placement:U,isPositioned:X,middlewareData:q}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:l,floating:i}={},transform:a=!0,whileElementsMounted:s,open:c}=e,[u,d]=f.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=f.useState(n);eY(p,n)||h(n);let[v,g]=f.useState(null),[b,y]=f.useState(null),w=f.useCallback(e=>{e!==C.current&&(C.current=e,g(e))},[]),x=f.useCallback(e=>{e!==k.current&&(k.current=e,y(e))},[]),E=l||v,S=i||b,C=f.useRef(null),k=f.useRef(null),R=f.useRef(u),j=null!=s,P=eX(s),A=eX(o),T=f.useCallback(()=>{if(!C.current||!k.current)return;let e={placement:t,strategy:r,middleware:p};A.current&&(e.platform=A.current),e$(C.current,k.current,e).then(e=>{let t={...e,isPositioned:!0};L.current&&!eY(R.current,t)&&(R.current=t,m.flushSync(()=>{d(t)}))})},[p,t,r,A]);eZ(()=>{!1===c&&R.current.isPositioned&&(R.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[c]);let L=f.useRef(!1);eZ(()=>(L.current=!0,()=>{L.current=!1}),[]),eZ(()=>{if(E&&(C.current=E),S&&(k.current=S),E&&S){if(P.current)return P.current(E,S,T);T()}},[E,S,T,P,j]);let N=f.useMemo(()=>({reference:C,floating:k,setReference:w,setFloating:x}),[w,x]),M=f.useMemo(()=>({reference:E,floating:S}),[E,S]),O=f.useMemo(()=>{let e={position:r,left:0,top:0};if(!M.floating)return e;let t=eU(M.floating,u.x),n=eU(M.floating,u.y);return a?{...e,transform:"translate("+t+"px, "+n+"px)",...eG(M.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,a,M.floating,u.x,u.y]);return f.useMemo(()=>({...u,update:T,refs:N,elements:M,floatingStyles:O}),[u,T,N,M,O])}({strategy:"fixed",placement:d+("center"!==h?"-"+h:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r{l&&e.addEventListener("scroll",r,{passive:!0}),i&&e.addEventListener("resize",r)});let f=u&&s?function(e,t){let r,n=null,o=ev(e);function l(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function i(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),l();let{left:c,top:u,width:d,height:f}=e.getBoundingClientRect();if(a||t(),!d||!f)return;let p=G(u),m=G(o.clientWidth-(c+d)),h={rootMargin:-p+"px "+-m+"px "+-G(o.clientHeight-(u+f))+"px "+-G(c)+"px",threshold:Z(0,$(1,s))||1},v=!0;function g(e){let t=e[0].intersectionRatio;if(t!==s){if(!v)return i();t?i(!1,t):r=setTimeout(()=>{i(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(g,h)}n.observe(e)}(!0),l}(u,r):null,p=-1,m=null;a&&(m=new ResizeObserver(e=>{let[n]=e;n&&n.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=m)||e.observe(t)})),r()}),u&&!c&&m.observe(u),m.observe(t));let h=c?eD(e):null;return c&&function t(){let n=eD(e);h&&(n.x!==h.x||n.y!==h.y||n.width!==h.width||n.height!==h.height)&&r(),h=n,o=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{l&&e.removeEventListener("scroll",r),i&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=m)||e.disconnect(),m=null,c&&cancelAnimationFrame(o)}}(...t,{animationFrame:"always"===j})},elements:{reference:T.anchor},middleware:[eJ({mainAxis:p+I,alignmentAxis:v}),w&&eQ({mainAxis:!0,crossAxis:!1,limiter:"partial"===k?e0():void 0,..._}),w&&e1({..._}),e2({..._,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:l,height:i}=r.reference,a=t.floating.style;a.setProperty("--radix-popper-available-width","".concat(n,"px")),a.setProperty("--radix-popper-available-height","".concat(o,"px")),a.setProperty("--radix-popper-anchor-width","".concat(l,"px")),a.setProperty("--radix-popper-anchor-height","".concat(i,"px"))}}),O&&e5({element:O,padding:b}),tf({arrowWidth:z,arrowHeight:I}),R&&e6({strategy:"referenceHidden",..._})]}),[J,Q]=tp(U),ee=S(P);F(()=>{X&&(null==ee||ee())},[X,ee]);let et=null===(r=q.arrow)||void 0===r?void 0:r.x,er=null===(n=q.arrow)||void 0===n?void 0:n.y,en=(null===(o=q.arrow)||void 0===o?void 0:o.centerOffset)!==0,[eo,el]=f.useState();return F(()=>{L&&el(window.getComputedStyle(L).zIndex)},[L]),(0,g.jsx)("div",{ref:K.setFloating,"data-radix-popper-content-wrapper":"",style:{...Y,transform:X?Y.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:eo,"--radix-popper-transform-origin":[null===(l=q.transformOrigin)||void 0===l?void 0:l.x,null===(i=q.transformOrigin)||void 0===i?void 0:i.y].join(" "),...(null===(a=q.hide)||void 0===a?void 0:a.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,g.jsx)(tl,{scope:u,placedSide:J,onArrowChange:W,arrowX:et,arrowY:er,shouldHideArrow:en,children:(0,g.jsx)(E.WV.div,{"data-side":J,"data-align":Q,...A,ref:M,style:{...A.style,animation:X?void 0:"none"}})})})});ta.displayName=to;var ts="PopperArrow",tc={top:"bottom",right:"left",bottom:"top",left:"right"},tu=f.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=ti(ts,r),l=tc[o.placedSide];return(0,g.jsx)("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:(0,g.jsx)(e8,{...n,ref:t,style:{...n.style,display:"block"}})})});function td(e){return null!==e}tu.displayName=ts;var tf=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,l,i;let{placement:a,rects:s,middlewareData:c}=t,u=(null===(r=c.arrow)||void 0===r?void 0:r.centerOffset)!==0,d=u?0:e.arrowWidth,f=u?0:e.arrowHeight,[p,m]=tp(a),h={start:"0%",center:"50%",end:"100%"}[m],v=(null!==(l=null===(n=c.arrow)||void 0===n?void 0:n.x)&&void 0!==l?l:0)+d/2,g=(null!==(i=null===(o=c.arrow)||void 0===o?void 0:o.y)&&void 0!==i?i:0)+f/2,b="",y="";return"bottom"===p?(b=u?h:"".concat(v,"px"),y="".concat(-f,"px")):"top"===p?(b=u?h:"".concat(v,"px"),y="".concat(s.floating.height+f,"px")):"right"===p?(b="".concat(-f,"px"),y=u?h:"".concat(g,"px")):"left"===p&&(b="".concat(s.floating.width+f,"px"),y=u?h:"".concat(g,"px")),{data:{x:b,y}}}});function tp(e){let[t,r="center"]=e.split("-");return[t,r]}var tm=f.forwardRef((e,t)=>{var r,n;let{container:o,...l}=e,[i,a]=f.useState(!1);F(()=>a(!0),[]);let s=o||i&&(null===(n=globalThis)||void 0===n?void 0:null===(r=n.document)||void 0===r?void 0:r.body);return s?m.createPortal((0,g.jsx)(E.WV.div,{...l,ref:t}),s):null});function th({prop:e,defaultProp:t,onChange:r=()=>{}}){let[n,o]=function({defaultProp:e,onChange:t}){let r=f.useState(e),[n]=r,o=f.useRef(n),l=S(t);return f.useEffect(()=>{o.current!==n&&(l(n),o.current=n)},[n,o,l]),r}({defaultProp:t,onChange:r}),l=void 0!==e,i=l?e:n,a=S(r);return[i,f.useCallback(t=>{if(l){let r="function"==typeof t?t(e):t;r!==e&&a(r)}else o(t)},[l,e,o,a])]}tm.displayName="Portal";var tv=f.forwardRef((e,t)=>(0,g.jsx)(E.WV.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));tv.displayName="VisuallyHidden";var tg=new WeakMap,tb=new WeakMap,ty={},tw=0,tx=function(e){return e&&(e.host||tx(e.parentNode))},tE=function(e,t,r,n){var o=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=tx(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});ty[r]||(ty[r]=new WeakMap);var l=ty[r],i=[],a=new Set,s=new Set(o),c=function(e){!e||a.has(e)||(a.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){!e||s.has(e)||Array.prototype.forEach.call(e.children,function(e){if(a.has(e))u(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,s=(tg.get(e)||0)+1,c=(l.get(e)||0)+1;tg.set(e,s),l.set(e,c),i.push(e),1===s&&o&&tb.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),a.clear(),tw++,function(){i.forEach(function(e){var t=tg.get(e)-1,o=l.get(e)-1;tg.set(e,t),l.set(e,o),t||(tb.has(e)||e.removeAttribute(n),tb.delete(e)),o||e.removeAttribute(r)}),--tw||(tg=new WeakMap,tg=new WeakMap,tb=new WeakMap,ty={})}},tS=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),tE(n,o,r,"aria-hidden")):function(){return null}},tC=function(){return(tC=Object.assign||function(e){for(var t,r=1,n=arguments.length;rt.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}"function"==typeof SuppressedError&&SuppressedError;var tR="right-scroll-bar-position",tj="width-before-scroll-bar";function tP(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var tA="undefined"!=typeof window?f.useLayoutEffect:f.useEffect,tT=new WeakMap,tL=(void 0===o&&(o={}),(void 0===l&&(l=function(e){return e}),i=[],a=!1,s={read:function(){if(a)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return i.length?i[i.length-1]:null},useMedium:function(e){var t=l(e,a);return i.push(t),function(){i=i.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(a=!0;i.length;){var t=i;i=[],t.forEach(e)}i={push:function(t){return e(t)},filter:function(){return i}}},assignMedium:function(e){a=!0;var t=[];if(i.length){var r=i;i=[],r.forEach(e),t=i}var n=function(){var r=t;t=[],r.forEach(e)},o=function(){return Promise.resolve().then(n)};o(),i={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),i}}}}).options=tC({async:!0,ssr:!1},o),s),tN=function(){},tM=f.forwardRef(function(e,t){var r,n,o,l,i=f.useRef(null),a=f.useState({onScrollCapture:tN,onWheelCapture:tN,onTouchMoveCapture:tN}),s=a[0],c=a[1],u=e.forwardProps,d=e.children,p=e.className,m=e.removeScrollBar,h=e.enabled,v=e.shards,g=e.sideCar,b=e.noIsolation,y=e.inert,w=e.allowPinchZoom,x=e.as,E=e.gapMode,S=tk(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),C=(r=[i,t],n=function(e){return r.forEach(function(t){return tP(t,e)})},(o=(0,f.useState)(function(){return{value:null,callback:n,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=n,l=o.facade,tA(function(){var e=tT.get(l);if(e){var t=new Set(e),n=new Set(r),o=l.current;t.forEach(function(e){n.has(e)||tP(e,null)}),n.forEach(function(e){t.has(e)||tP(e,o)})}tT.set(l,r)},[r]),l),k=tC(tC({},S),s);return f.createElement(f.Fragment,null,h&&f.createElement(g,{sideCar:tL,removeScrollBar:m,shards:v,noIsolation:b,inert:y,setCallbacks:c,allowPinchZoom:!!w,lockRef:i,gapMode:E}),u?f.cloneElement(f.Children.only(d),tC(tC({},k),{ref:C})):f.createElement(void 0===x?"div":x,tC({},k,{className:p,ref:C}),d))});tM.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},tM.classNames={fullWidth:tj,zeroRight:tR};var tO=function(e){var t=e.sideCar,r=tk(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return f.createElement(n,tC({},r))};tO.isSideCarExport=!0;var tW=function(){var e=0,t=null;return{add:function(n){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=d||r.nc;return t&&e.setAttribute("nonce",t),e}())){var o,l;(o=t).styleSheet?o.styleSheet.cssText=n:o.appendChild(document.createTextNode(n)),l=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(l)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},tD=function(){var e=tW();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},tz=function(){var e=tD();return function(t){return e(t.styles,t.dynamic),null}},tI={left:0,top:0,right:0,gap:0},tV=function(e){return parseInt(e||"",10)||0},tF=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[tV(r),tV(n),tV(o)]},tH=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return tI;var t=tF(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},tB=tz(),t_="data-scroll-locked",tK=function(e,t,r,n){var o=e.left,l=e.top,i=e.right,a=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(a,"px ").concat(n,";\n }\n body[").concat(t_,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(l,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(a,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(a,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(tR," {\n right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(tj," {\n margin-right: ").concat(a,"px ").concat(n,";\n }\n \n .").concat(tR," .").concat(tR," {\n right: 0 ").concat(n,";\n }\n \n .").concat(tj," .").concat(tj," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(t_,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(a,"px;\n }\n")},t$=function(){var e=parseInt(document.body.getAttribute(t_)||"0",10);return isFinite(e)?e:0},tZ=function(){f.useEffect(function(){return document.body.setAttribute(t_,(t$()+1).toString()),function(){var e=t$()-1;e<=0?document.body.removeAttribute(t_):document.body.setAttribute(t_,e.toString())}},[])},tY=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;tZ();var l=f.useMemo(function(){return tH(o)},[o]);return f.createElement(tB,{styles:tK(l,!t,o,r?"":"!important")})},tG=!1;if("undefined"!=typeof window)try{var tU=Object.defineProperty({},"passive",{get:function(){return tG=!0,!0}});window.addEventListener("test",tU,tU),window.removeEventListener("test",tU,tU)}catch(e){tG=!1}var tX=!!tG&&{passive:!1},tq=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&"TEXTAREA"!==e.tagName&&"visible"===r[t])},tJ=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),tQ(e,n)){var o=t0(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},tQ=function(e,t){return"v"===e?tq(t,"overflowY"):tq(t,"overflowX")},t0=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},t1=function(e,t,r,n,o){var l,i=(l=window.getComputedStyle(t).direction,"h"===e&&"rtl"===l?-1:1),a=i*n,s=r.target,c=t.contains(s),u=!1,d=a>0,f=0,p=0;do{var m=t0(e,s),h=m[0],v=m[1]-m[2]-i*h;(h||v)&&tQ(e,s)&&(f+=v,p+=h),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return d&&(o&&1>Math.abs(f)||!o&&a>f)?u=!0:!d&&(o&&1>Math.abs(p)||!o&&-a>p)&&(u=!0),u},t2=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},t6=function(e){return[e.deltaX,e.deltaY]},t5=function(e){return e&&"current"in e?e.current:e},t8=0,t3=[],t7=(c=function(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(t8++)[0],l=f.useState(tz)[0],i=f.useRef(e);f.useEffect(function(){i.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,o=0,l=t.length;oMath.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=tJ(d,u);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=tJ(d,u)),!f)return!1;if(!n.current&&"changedTouches"in e&&(s||c)&&(n.current=o),!o)return!0;var p=n.current||o;return t1(p,t,e,"h"===p?s:c,!0)},[]),s=f.useCallback(function(e){if(t3.length&&t3[t3.length-1]===l){var r="deltaY"in e?t6(e):t2(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta)[0]===r[0]&&n[1]===r[1]})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var o=(i.current.shards||[]).map(t5).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?a(e,o[0]):!i.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),c=f.useCallback(function(e,r,n,o){var l={name:e,delta:r,target:n,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(l),setTimeout(function(){t.current=t.current.filter(function(e){return e!==l})},1)},[]),u=f.useCallback(function(e){r.current=t2(e),n.current=void 0},[]),d=f.useCallback(function(t){c(t.type,t6(t),t.target,a(t,e.lockRef.current))},[]),p=f.useCallback(function(t){c(t.type,t2(t),t.target,a(t,e.lockRef.current))},[]);f.useEffect(function(){return t3.push(l),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",s,tX),document.addEventListener("touchmove",s,tX),document.addEventListener("touchstart",u,tX),function(){t3=t3.filter(function(e){return e!==l}),document.removeEventListener("wheel",s,tX),document.removeEventListener("touchmove",s,tX),document.removeEventListener("touchstart",u,tX)}},[]);var m=e.removeScrollBar,h=e.inert;return f.createElement(f.Fragment,null,h?f.createElement(l,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,m?f.createElement(tY,{gapMode:e.gapMode}):null)},tL.useMedium(c),tO),t4=f.forwardRef(function(e,t){return f.createElement(tM,tC({},e,{ref:t,sideCar:t7}))});t4.classNames=tM.classNames;var t9=[" ","Enter","ArrowUp","ArrowDown"],re=[" ","Enter"],rt="Select",[rr,rn,ro]=function(e){let t=e+"CollectionProvider",[r,n]=b(t),[o,l]=r(t,{collectionRef:{current:null},itemMap:new Map}),i=e=>{let{scope:t,children:r}=e,n=f.useRef(null),l=f.useRef(new Map).current;return(0,g.jsx)(o,{scope:t,itemMap:l,collectionRef:n,children:r})};i.displayName=t;let a=e+"CollectionSlot",s=f.forwardRef((e,t)=>{let{scope:r,children:n}=e,o=l(a,r),i=(0,y.e)(t,o.collectionRef);return(0,g.jsx)(w.g7,{ref:i,children:n})});s.displayName=a;let c=e+"CollectionItemSlot",u="data-radix-collection-item",d=f.forwardRef((e,t)=>{let{scope:r,children:n,...o}=e,i=f.useRef(null),a=(0,y.e)(t,i),s=l(c,r);return f.useEffect(()=>(s.itemMap.set(i,{ref:i,...o}),()=>void s.itemMap.delete(i))),(0,g.jsx)(w.g7,{[u]:"",ref:a,children:n})});return d.displayName=c,[{Provider:i,Slot:s,ItemSlot:d},function(t){let r=l(e+"CollectionConsumer",t);return f.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(u,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},n]}(rt),[rl,ri]=b(rt,[ro,e4]),ra=e4(),[rs,rc]=rl(rt),[ru,rd]=rl(rt),rf=e=>{let{__scopeSelect:t,children:r,open:n,defaultOpen:o,onOpenChange:l,value:i,defaultValue:a,onValueChange:s,dir:c,name:u,autoComplete:d,disabled:p,required:m}=e,h=ra(t),[v,b]=f.useState(null),[y,w]=f.useState(null),[E,S]=f.useState(!1),C=function(e){let t=f.useContext(x);return e||t||"ltr"}(c),[k=!1,R]=th({prop:n,defaultProp:o,onChange:l}),[j,P]=th({prop:i,defaultProp:a,onChange:s}),A=f.useRef(null),T=!v||!!v.closest("form"),[L,N]=f.useState(new Set),M=Array.from(L).map(e=>e.props.value).join(";");return(0,g.jsx)(tt,{...h,children:(0,g.jsxs)(rs,{required:m,scope:t,trigger:v,onTriggerChange:b,valueNode:y,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:S,contentId:_(),value:j,onValueChange:P,open:k,onOpenChange:R,dir:C,triggerPointerDownPosRef:A,disabled:p,children:[(0,g.jsx)(rr.Provider,{scope:t,children:(0,g.jsx)(ru,{scope:e.__scopeSelect,onNativeOptionAdd:f.useCallback(e=>{N(t=>new Set(t).add(e))},[]),onNativeOptionRemove:f.useCallback(e=>{N(t=>{let r=new Set(t);return r.delete(e),r})},[]),children:r})}),T?(0,g.jsxs)(rJ,{"aria-hidden":!0,required:m,tabIndex:-1,name:u,autoComplete:d,value:j,onChange:e=>P(e.target.value),disabled:p,children:[void 0===j?(0,g.jsx)("option",{value:""}):null,Array.from(L)]},M):null]})})};rf.displayName=rt;var rp="SelectTrigger",rm=f.forwardRef((e,t)=>{let{__scopeSelect:r,disabled:n=!1,...o}=e,l=ra(r),i=rc(rp,r),a=i.disabled||n,s=(0,y.e)(t,i.onTriggerChange),c=rn(r),[u,d,f]=rQ(e=>{let t=c().filter(e=>!e.disabled),r=t.find(e=>e.value===i.value),n=r0(t,e,r);void 0!==n&&i.onValueChange(n.value)}),p=()=>{a||(i.onOpenChange(!0),f())};return(0,g.jsx)(tn,{asChild:!0,...l,children:(0,g.jsx)(E.WV.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:a,"data-disabled":a?"":void 0,"data-placeholder":rq(i.value)?"":void 0,...o,ref:s,onClick:v(o.onClick,e=>{e.currentTarget.focus()}),onPointerDown:v(o.onPointerDown,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&(p(),i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)},e.preventDefault())}),onKeyDown:v(o.onKeyDown,e=>{let t=""!==u.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||d(e.key),(!t||" "!==e.key)&&t9.includes(e.key)&&(p(),e.preventDefault())})})})});rm.displayName=rp;var rh="SelectValue",rv=f.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,children:l,placeholder:i="",...a}=e,s=rc(rh,r),{onValueNodeHasChildrenChange:c}=s,u=void 0!==l,d=(0,y.e)(t,s.onValueNodeChange);return F(()=>{c(u)},[c,u]),(0,g.jsx)(E.WV.span,{...a,ref:d,style:{pointerEvents:"none"},children:rq(s.value)?(0,g.jsx)(g.Fragment,{children:i}):l})});rv.displayName=rh;var rg=f.forwardRef((e,t)=>{let{__scopeSelect:r,children:n,...o}=e;return(0,g.jsx)(E.WV.span,{"aria-hidden":!0,...o,ref:t,children:n||"▼"})});rg.displayName="SelectIcon";var rb=e=>(0,g.jsx)(tm,{asChild:!0,...e});rb.displayName="SelectPortal";var ry="SelectContent",rw=f.forwardRef((e,t)=>{let r=rc(ry,e.__scopeSelect),[n,o]=f.useState();return(F(()=>{o(new DocumentFragment)},[]),r.open)?(0,g.jsx)(rS,{...e,ref:t}):n?m.createPortal((0,g.jsx)(rx,{scope:e.__scopeSelect,children:(0,g.jsx)(rr.Slot,{scope:e.__scopeSelect,children:(0,g.jsx)("div",{children:e.children})})}),n):null});rw.displayName=ry;var[rx,rE]=rl(ry),rS=f.forwardRef((e,t)=>{let{__scopeSelect:r,position:n="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:l,onPointerDownOutside:i,side:a,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:b,avoidCollisions:x,...E}=e,S=rc(ry,r),[C,k]=f.useState(null),[j,P]=f.useState(null),L=(0,y.e)(t,e=>k(e)),[N,M]=f.useState(null),[W,D]=f.useState(null),z=rn(r),[I,V]=f.useState(!1),F=f.useRef(!1);f.useEffect(()=>{if(C)return tS(C)},[C]),f.useEffect(()=>{var e,t;let r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=r[0])&&void 0!==e?e:T()),document.body.insertAdjacentElement("beforeend",null!==(t=r[1])&&void 0!==t?t:T()),A++,()=>{1===A&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),A--}},[]);let H=f.useCallback(e=>{let[t,...r]=z().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(let r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&j&&(j.scrollTop=0),r===n&&j&&(j.scrollTop=j.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[z,j]),B=f.useCallback(()=>H([N,C]),[H,N,C]);f.useEffect(()=>{I&&B()},[I,B]);let{onOpenChange:_,triggerPointerDownPosRef:K}=S;f.useEffect(()=>{if(C){let e={x:0,y:0},t=t=>{var r,n,o,l;e={x:Math.abs(Math.round(t.pageX)-(null!==(o=null===(r=K.current)||void 0===r?void 0:r.x)&&void 0!==o?o:0)),y:Math.abs(Math.round(t.pageY)-(null!==(l=null===(n=K.current)||void 0===n?void 0:n.y)&&void 0!==l?l:0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():C.contains(r.target)||_(!1),document.removeEventListener("pointermove",t),K.current=null};return null!==K.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[C,_,K]),f.useEffect(()=>{let e=()=>_(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[_]);let[$,Z]=rQ(e=>{let t=z().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=r0(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),Y=f.useCallback((e,t,r)=>{let n=!F.current&&!r;(void 0!==S.value&&S.value===t||n)&&(M(e),n&&(F.current=!0))},[S.value]),G=f.useCallback(()=>null==C?void 0:C.focus(),[C]),U=f.useCallback((e,t,r)=>{let n=!F.current&&!r;(void 0!==S.value&&S.value===t||n)&&D(e)},[S.value]),X="popper"===n?rk:rC,q=X===rk?{side:a,sideOffset:s,align:c,alignOffset:u,arrowPadding:d,collisionBoundary:p,collisionPadding:m,sticky:h,hideWhenDetached:b,avoidCollisions:x}:{};return(0,g.jsx)(rx,{scope:r,content:C,viewport:j,onViewportChange:P,itemRefCallback:Y,selectedItem:N,onItemLeave:G,itemTextRefCallback:U,focusSelectedItem:B,selectedItemText:W,position:n,isPositioned:I,searchRef:$,children:(0,g.jsx)(t4,{as:w.g7,allowPinchZoom:!0,children:(0,g.jsx)(O,{asChild:!0,trapped:S.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:v(o,e=>{var t;null===(t=S.trigger)||void 0===t||t.focus({preventScroll:!0}),e.preventDefault()}),children:(0,g.jsx)(R,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:l,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>S.onOpenChange(!1),children:(0,g.jsx)(X,{role:"listbox",id:S.contentId,"data-state":S.open?"open":"closed",dir:S.dir,onContextMenu:e=>e.preventDefault(),...E,...q,onPlaced:()=>V(!0),ref:L,style:{display:"flex",flexDirection:"column",outline:"none",...E.style},onKeyDown:v(E.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||Z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=z().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){let r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>H(t)),e.preventDefault()}})})})})})})});rS.displayName="SelectContentImpl";var rC=f.forwardRef((e,t)=>{let{__scopeSelect:r,onPlaced:n,...o}=e,l=rc(ry,r),i=rE(ry,r),[a,s]=f.useState(null),[c,u]=f.useState(null),d=(0,y.e)(t,e=>u(e)),p=rn(r),m=f.useRef(!1),v=f.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:x,focusSelectedItem:S}=i,C=f.useCallback(()=>{if(l.trigger&&l.valueNode&&a&&c&&b&&w&&x){let e=l.trigger.getBoundingClientRect(),t=c.getBoundingClientRect(),r=l.valueNode.getBoundingClientRect(),o=x.getBoundingClientRect();if("rtl"!==l.dir){let n=o.left-t.left,l=r.left-n,i=e.left-l,s=e.width+i,c=Math.max(s,t.width),u=h(l,[10,window.innerWidth-10-c]);a.style.minWidth=s+"px",a.style.left=u+"px"}else{let n=t.right-o.right,l=window.innerWidth-r.right-n,i=window.innerWidth-e.right-l,s=e.width+i,c=Math.max(s,t.width),u=h(l,[10,window.innerWidth-10-c]);a.style.minWidth=s+"px",a.style.right=u+"px"}let i=p(),s=window.innerHeight-20,u=b.scrollHeight,d=window.getComputedStyle(c),f=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),y=f+v+u+parseInt(d.paddingBottom,10)+g,E=Math.min(5*w.offsetHeight,y),S=window.getComputedStyle(b),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),R=e.top+e.height/2-10,j=w.offsetHeight/2,P=f+v+(w.offsetTop+j);if(P<=R){let e=w===i[i.length-1].ref.current;a.style.bottom="0px";let t=c.clientHeight-b.offsetTop-b.offsetHeight;a.style.height=P+Math.max(s-R,j+(e?k:0)+t+g)+"px"}else{let e=w===i[0].ref.current;a.style.top="0px";let t=Math.max(R,f+b.offsetTop+(e?C:0)+j);a.style.height=t+(y-P)+"px",b.scrollTop=P-R+b.offsetTop}a.style.margin="".concat(10,"px 0"),a.style.minHeight=E+"px",a.style.maxHeight=s+"px",null==n||n(),requestAnimationFrame(()=>m.current=!0)}},[p,l.trigger,l.valueNode,a,c,b,w,x,l.dir,n]);F(()=>C(),[C]);let[k,R]=f.useState();F(()=>{c&&R(window.getComputedStyle(c).zIndex)},[c]);let j=f.useCallback(e=>{e&&!0===v.current&&(C(),null==S||S(),v.current=!1)},[C,S]);return(0,g.jsx)(rR,{scope:r,contentWrapper:a,shouldExpandOnScrollRef:m,onScrollButtonChange:j,children:(0,g.jsx)("div",{ref:s,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:k},children:(0,g.jsx)(E.WV.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});rC.displayName="SelectItemAlignedPosition";var rk=f.forwardRef((e,t)=>{let{__scopeSelect:r,align:n="start",collisionPadding:o=10,...l}=e,i=ra(r);return(0,g.jsx)(ta,{...i,...l,ref:t,align:n,collisionPadding:o,style:{boxSizing:"border-box",...l.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});rk.displayName="SelectPopperPosition";var[rR,rj]=rl(ry,{}),rP="SelectViewport",rA=f.forwardRef((e,t)=>{let{__scopeSelect:r,nonce:n,...o}=e,l=rE(rP,r),i=rj(rP,r),a=(0,y.e)(t,l.onViewportChange),s=f.useRef(0);return(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:n}),(0,g.jsx)(rr.Slot,{scope:r,children:(0,g.jsx)(E.WV.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:a,style:{position:"relative",flex:1,overflow:"auto",...o.style},onScroll:v(o.onScroll,e=>{let t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=i;if((null==n?void 0:n.current)&&r){let e=Math.abs(s.current-t.scrollTop);if(e>0){let n=window.innerHeight-20,o=Math.max(parseFloat(r.style.minHeight),parseFloat(r.style.height));if(o0?a:0,r.style.justifyContent="flex-end")}}}s.current=t.scrollTop})})})]})});rA.displayName=rP;var rT="SelectGroup",[rL,rN]=rl(rT),rM=f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=_();return(0,g.jsx)(rL,{scope:r,id:o,children:(0,g.jsx)(E.WV.div,{role:"group","aria-labelledby":o,...n,ref:t})})});rM.displayName=rT;var rO="SelectLabel",rW=f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=rN(rO,r);return(0,g.jsx)(E.WV.div,{id:o.id,...n,ref:t})});rW.displayName=rO;var rD="SelectItem",[rz,rI]=rl(rD),rV=f.forwardRef((e,t)=>{let{__scopeSelect:r,value:n,disabled:o=!1,textValue:l,...i}=e,a=rc(rD,r),s=rE(rD,r),c=a.value===n,[u,d]=f.useState(null!=l?l:""),[p,m]=f.useState(!1),h=(0,y.e)(t,e=>{var t;return null===(t=s.itemRefCallback)||void 0===t?void 0:t.call(s,e,n,o)}),b=_(),w=()=>{o||(a.onValueChange(n),a.onOpenChange(!1))};if(""===n)throw Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return(0,g.jsx)(rz,{scope:r,value:n,disabled:o,textId:b,isSelected:c,onItemTextChange:f.useCallback(e=>{d(t=>{var r;return t||(null!==(r=null==e?void 0:e.textContent)&&void 0!==r?r:"").trim()})},[]),children:(0,g.jsx)(rr.ItemSlot,{scope:r,value:n,disabled:o,textValue:u,children:(0,g.jsx)(E.WV.div,{role:"option","aria-labelledby":b,"data-highlighted":p?"":void 0,"aria-selected":c&&p,"data-state":c?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:h,onFocus:v(i.onFocus,()=>m(!0)),onBlur:v(i.onBlur,()=>m(!1)),onPointerUp:v(i.onPointerUp,w),onPointerMove:v(i.onPointerMove,e=>{if(o){var t;null===(t=s.onItemLeave)||void 0===t||t.call(s)}else e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:v(i.onPointerLeave,e=>{if(e.currentTarget===document.activeElement){var t;null===(t=s.onItemLeave)||void 0===t||t.call(s)}}),onKeyDown:v(i.onKeyDown,e=>{var t;(null===(t=s.searchRef)||void 0===t?void 0:t.current)!==""&&" "===e.key||(re.includes(e.key)&&w()," "===e.key&&e.preventDefault())})})})})});rV.displayName=rD;var rF="SelectItemText",rH=f.forwardRef((e,t)=>{let{__scopeSelect:r,className:n,style:o,...l}=e,i=rc(rF,r),a=rE(rF,r),s=rI(rF,r),c=rd(rF,r),[u,d]=f.useState(null),p=(0,y.e)(t,e=>d(e),s.onItemTextChange,e=>{var t;return null===(t=a.itemTextRefCallback)||void 0===t?void 0:t.call(a,e,s.value,s.disabled)}),h=null==u?void 0:u.textContent,v=f.useMemo(()=>(0,g.jsx)("option",{value:s.value,disabled:s.disabled,children:h},s.value),[s.disabled,s.value,h]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=c;return F(()=>(b(v),()=>w(v)),[b,w,v]),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(E.WV.span,{id:s.textId,...l,ref:p}),s.isSelected&&i.valueNode&&!i.valueNodeHasChildren?m.createPortal(l.children,i.valueNode):null]})});rH.displayName=rF;var rB="SelectItemIndicator",r_=f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return rI(rB,r).isSelected?(0,g.jsx)(E.WV.span,{"aria-hidden":!0,...n,ref:t}):null});r_.displayName=rB;var rK="SelectScrollUpButton",r$=f.forwardRef((e,t)=>{let r=rE(rK,e.__scopeSelect),n=rj(rK,e.__scopeSelect),[o,l]=f.useState(!1),i=(0,y.e)(t,n.onScrollButtonChange);return F(()=>{if(r.viewport&&r.isPositioned){let e=function(){l(t.scrollTop>0)},t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,g.jsx)(rG,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});r$.displayName=rK;var rZ="SelectScrollDownButton",rY=f.forwardRef((e,t)=>{let r=rE(rZ,e.__scopeSelect),n=rj(rZ,e.__scopeSelect),[o,l]=f.useState(!1),i=(0,y.e)(t,n.onScrollButtonChange);return F(()=>{if(r.viewport&&r.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight;l(Math.ceil(t.scrollTop)t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),o?(0,g.jsx)(rG,{...e,ref:i,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});rY.displayName=rZ;var rG=f.forwardRef((e,t)=>{let{__scopeSelect:r,onAutoScroll:n,...o}=e,l=rE("SelectScrollButton",r),i=f.useRef(null),a=rn(r),s=f.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return f.useEffect(()=>()=>s(),[s]),F(()=>{var e;let t=a().find(e=>e.ref.current===document.activeElement);null==t||null===(e=t.ref.current)||void 0===e||e.scrollIntoView({block:"nearest"})},[a]),(0,g.jsx)(E.WV.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:v(o.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(n,50))}),onPointerMove:v(o.onPointerMove,()=>{var e;null===(e=l.onItemLeave)||void 0===e||e.call(l),null===i.current&&(i.current=window.setInterval(n,50))}),onPointerLeave:v(o.onPointerLeave,()=>{s()})})}),rU=f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e;return(0,g.jsx)(E.WV.div,{"aria-hidden":!0,...n,ref:t})});rU.displayName="SelectSeparator";var rX="SelectArrow";function rq(e){return""===e||void 0===e}f.forwardRef((e,t)=>{let{__scopeSelect:r,...n}=e,o=ra(r),l=rc(rX,r),i=rE(rX,r);return l.open&&"popper"===i.position?(0,g.jsx)(tu,{...o,...n,ref:t}):null}).displayName=rX;var rJ=f.forwardRef((e,t)=>{let{value:r,...n}=e,o=f.useRef(null),l=(0,y.e)(t,o),i=function(e){let t=f.useRef({value:e,previous:e});return f.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(r);return f.useEffect(()=>{let e=o.current,t=Object.getOwnPropertyDescriptor(window.HTMLSelectElement.prototype,"value").set;if(i!==r&&t){let n=new Event("change",{bubbles:!0});t.call(e,r),e.dispatchEvent(n)}},[i,r]),(0,g.jsx)(tv,{asChild:!0,children:(0,g.jsx)("select",{...n,ref:l,defaultValue:r})})});function rQ(e){let t=S(e),r=f.useRef(""),n=f.useRef(0),o=f.useCallback(e=>{let o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),l=f.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return f.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,l]}function r0(e,t,r){var n;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,l=(n=Math.max(r?e.indexOf(r):-1,0),e.map((t,r)=>e[(n+r)%e.length]));1===o.length&&(l=l.filter(e=>e!==r));let i=l.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return i!==r?i:void 0}rJ.displayName="BubbleSelect";var r1=rf,r2=rm,r6=rv,r5=rg,r8=rb,r3=rw,r7=rA,r4=rM,r9=rW,ne=rV,nt=rH,nr=r_,nn=r$,no=rY,nl=rU},6370:function(e,t,r){r.d(t,{g7:function(){return i}});var n=r(6856),o=r(6960),l=r(2842),i=n.forwardRef((e,t)=>{let{children:r,...o}=e,i=n.Children.toArray(r),s=i.find(c);if(s){let e=s.props.children,r=i.map(t=>t!==s?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,l.jsx)(a,{...o,ref:t,children:n.isValidElement(e)?n.cloneElement(e,void 0,r):null})}return(0,l.jsx)(a,{...o,ref:t,children:r})});i.displayName="Slot";var a=n.forwardRef((e,t)=>{let{children:r,...l}=e;if(n.isValidElement(r)){let e,i;let a=(e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?r.ref:(e=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?r.props.ref:r.props.ref||r.ref;return n.cloneElement(r,{...function(e,t){let r={...t};for(let n in t){let o=e[n],l=t[n];/^on[A-Z]/.test(n)?o&&l?r[n]=(...e)=>{l(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...l}:"className"===n&&(r[n]=[o,l].filter(Boolean).join(" "))}return{...e,...r}}(l,r.props),ref:t?(0,o.F)(t,a):a})}return n.Children.count(r)>1?n.Children.only(null):null});a.displayName="SlotClone";var s=({children:e})=>(0,l.jsx)(l.Fragment,{children:e});function c(e){return n.isValidElement(e)&&e.type===s}},7756:function(e,t,r){r.d(t,{j:function(){return l}});let n=e=>"boolean"==typeof e?"".concat(e):0===e?"0":e,o=function(){for(var e,t,r=0,n="";rr=>{var l;if((null==t?void 0:t.variants)==null)return o(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:i,defaultVariants:a}=t,s=Object.keys(i).map(e=>{let t=null==r?void 0:r[e],o=null==a?void 0:a[e];if(null===t)return null;let l=n(t)||n(o);return i[e][l]}),c=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return o(e,s,null==t?void 0:null===(l=t.compoundVariants)||void 0===l?void 0:l.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...c}[t]):({...a,...c})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},5023:function(e,t,r){r.d(t,{W:function(){return n}});function n(){for(var e,t,r=0,n="",o=arguments.length;r{let t=a(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{let r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),o(r,t)||i(e)},getConflictingClassGroupIds:(e,t)=>{let o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},o=(e,t)=>{if(0===e.length)return t.classGroupId;let r=e[0],n=t.nextPart.get(r),l=n?o(e.slice(1),n):void 0;if(l)return l;if(0===t.validators.length)return;let i=e.join("-");return t.validators.find(({validator:e})=>e(i))?.classGroupId},l=/^\[(.+)\]$/,i=e=>{if(l.test(e)){let t=l.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},a=e=>{let{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return d(Object.entries(e.classGroups),r).forEach(([e,r])=>{s(r,n,e,t)}),n},s=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){(""===e?t:c(t,e)).classGroupId=r;return}if("function"==typeof e){if(u(e)){s(e(n),t,r,n);return}t.validators.push({validator:e,classGroupId:r});return}Object.entries(e).forEach(([e,o])=>{s(o,c(t,e),r,n)})})},c=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},u=e=>e.isThemeGetter,d=(e,t)=>t?e.map(([e,r])=>[e,r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e)]):e,f=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=new Map,n=new Map,o=(o,l)=>{r.set(o,l),++t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},p=e=>{let{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],l=t.length,i=e=>{let r;let i=[],a=0,s=0;for(let c=0;cs?r-s:void 0}};return r?e=>r({className:e,parseClassName:i}):i},m=e=>{if(e.length<=1)return e;let t=[],r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},h=e=>({cache:f(e.cacheSize),parseClassName:p(e),...n(e)}),v=/\s+/,g=(e,t)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,l=[],i=e.trim().split(v),a="";for(let e=i.length-1;e>=0;e-=1){let t=i[e],{modifiers:s,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(t),f=!!d,p=n(f?u.substring(0,d):u);if(!p){if(!f||!(p=n(u))){a=t+(a.length>0?" "+a:a);continue}f=!1}let h=m(s).join(":"),v=c?h+"!":h,g=v+p;if(l.includes(g))continue;l.push(g);let b=o(p,f);for(let e=0;e0?" "+a:a)}return a};function b(){let e,t,r=0,n="";for(;r{let t;if("string"==typeof e)return e;let r="";for(let n=0;n{let t=t=>t[e]||[];return t.isThemeGetter=!0,t},x=/^\[(?:([a-z-]+):)?(.+)\]$/i,E=/^\d+\/\d+$/,S=new Set(["px","full","screen"]),C=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,k=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,R=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,j=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,P=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,A=e=>L(e)||S.has(e)||E.test(e),T=e=>K(e,"length",$),L=e=>!!e&&!Number.isNaN(Number(e)),N=e=>K(e,"number",L),M=e=>!!e&&Number.isInteger(Number(e)),O=e=>e.endsWith("%")&&L(e.slice(0,-1)),W=e=>x.test(e),D=e=>C.test(e),z=new Set(["length","size","percentage"]),I=e=>K(e,z,Z),V=e=>K(e,"position",Z),F=new Set(["image","url"]),H=e=>K(e,F,G),B=e=>K(e,"",Y),_=()=>!0,K=(e,t,r)=>{let n=x.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},$=e=>k.test(e)&&!R.test(e),Z=()=>!1,Y=e=>j.test(e),G=e=>P.test(e),U=function(e,...t){let r,n,o;let l=function(a){return n=(r=h(t.reduce((e,t)=>t(e),e()))).cache.get,o=r.cache.set,l=i,i(a)};function i(e){let t=n(e);if(t)return t;let l=g(e,r);return o(e,l),l}return function(){return l(b.apply(null,arguments))}}(()=>{let e=w("colors"),t=w("spacing"),r=w("blur"),n=w("brightness"),o=w("borderColor"),l=w("borderRadius"),i=w("borderSpacing"),a=w("borderWidth"),s=w("contrast"),c=w("grayscale"),u=w("hueRotate"),d=w("invert"),f=w("gap"),p=w("gradientColorStops"),m=w("gradientColorStopPositions"),h=w("inset"),v=w("margin"),g=w("opacity"),b=w("padding"),y=w("saturate"),x=w("scale"),E=w("sepia"),S=w("skew"),C=w("space"),k=w("translate"),R=()=>["auto","contain","none"],j=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto",W,t],z=()=>[W,t],F=()=>["",A,T],K=()=>["auto",L,W],$=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],Z=()=>["solid","dashed","dotted","double","none"],Y=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],U=()=>["","0",W],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],q=()=>[L,W];return{cacheSize:500,separator:":",theme:{colors:[_],spacing:[A,T],blur:["none","",D,W],brightness:q(),borderColor:[e],borderRadius:["none","","full",D,W],borderSpacing:z(),borderWidth:F(),contrast:q(),grayscale:U(),hueRotate:q(),invert:U(),gap:z(),gradientColorStops:[e],gradientColorStopPositions:[O,T],inset:P(),margin:P(),opacity:q(),padding:z(),saturate:q(),scale:q(),sepia:U(),skew:q(),space:z(),translate:z()},classGroups:{aspect:[{aspect:["auto","square","video",W]}],container:["container"],columns:[{columns:[D]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...$(),W]}],overflow:[{overflow:j()}],"overflow-x":[{"overflow-x":j()}],"overflow-y":[{"overflow-y":j()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",M,W]}],basis:[{basis:P()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",W]}],grow:[{grow:U()}],shrink:[{shrink:U()}],order:[{order:["first","last","none",M,W]}],"grid-cols":[{"grid-cols":[_]}],"col-start-end":[{col:["auto",{span:["full",M,W]},W]}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":[_]}],"row-start-end":[{row:["auto",{span:[M,W]},W]}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",W]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",W]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",W,t]}],"min-w":[{"min-w":[W,t,"min","max","fit"]}],"max-w":[{"max-w":[W,t,"none","full","min","max","fit","prose",{screen:[D]},D]}],h:[{h:[W,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[W,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[W,t,"auto","min","max","fit"]}],"font-size":[{text:["base",D,T]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",N]}],"font-family":[{font:[_]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",W]}],"line-clamp":[{"line-clamp":["none",L,N]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",A,W]}],"list-image":[{"list-image":["none",W]}],"list-style-type":[{list:["none","disc","decimal",W]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[g]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[g]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",A,T]}],"underline-offset":[{"underline-offset":["auto",A,W]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:z()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",W]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",W]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[g]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...$(),V]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",I]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},H]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[l]}],"rounded-s":[{"rounded-s":[l]}],"rounded-e":[{"rounded-e":[l]}],"rounded-t":[{"rounded-t":[l]}],"rounded-r":[{"rounded-r":[l]}],"rounded-b":[{"rounded-b":[l]}],"rounded-l":[{"rounded-l":[l]}],"rounded-ss":[{"rounded-ss":[l]}],"rounded-se":[{"rounded-se":[l]}],"rounded-ee":[{"rounded-ee":[l]}],"rounded-es":[{"rounded-es":[l]}],"rounded-tl":[{"rounded-tl":[l]}],"rounded-tr":[{"rounded-tr":[l]}],"rounded-br":[{"rounded-br":[l]}],"rounded-bl":[{"rounded-bl":[l]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[g]}],"border-style":[{border:[...Z(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[g]}],"divide-style":[{divide:Z()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...Z()]}],"outline-offset":[{"outline-offset":[A,W]}],"outline-w":[{outline:[A,T]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:F()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[g]}],"ring-offset-w":[{"ring-offset":[A,T]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",D,B]}],"shadow-color":[{shadow:[_]}],opacity:[{opacity:[g]}],"mix-blend":[{"mix-blend":[...Y(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Y()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[s]}],"drop-shadow":[{"drop-shadow":["","none",D,W]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[y]}],sepia:[{sepia:[E]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[s]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[g]}],"backdrop-saturate":[{"backdrop-saturate":[y]}],"backdrop-sepia":[{"backdrop-sepia":[E]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",W]}],duration:[{duration:q()}],ease:[{ease:["linear","in","out","in-out",W]}],delay:[{delay:q()}],animate:[{animate:["none","spin","ping","pulse","bounce",W]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[M,W]}],"translate-x":[{"translate-x":[k]}],"translate-y":[{"translate-y":[k]}],"skew-x":[{"skew-x":[S]}],"skew-y":[{"skew-y":[S]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",W]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",W]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":z()}],"scroll-mx":[{"scroll-mx":z()}],"scroll-my":[{"scroll-my":z()}],"scroll-ms":[{"scroll-ms":z()}],"scroll-me":[{"scroll-me":z()}],"scroll-mt":[{"scroll-mt":z()}],"scroll-mr":[{"scroll-mr":z()}],"scroll-mb":[{"scroll-mb":z()}],"scroll-ml":[{"scroll-ml":z()}],"scroll-p":[{"scroll-p":z()}],"scroll-px":[{"scroll-px":z()}],"scroll-py":[{"scroll-py":z()}],"scroll-ps":[{"scroll-ps":z()}],"scroll-pe":[{"scroll-pe":z()}],"scroll-pt":[{"scroll-pt":z()}],"scroll-pr":[{"scroll-pr":z()}],"scroll-pb":[{"scroll-pb":z()}],"scroll-pl":[{"scroll-pl":z()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",W]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[A,T,N]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}})}}]); \ No newline at end of file diff --git a/_next/static/chunks/561-8003f6922ee71b30.js b/_next/static/chunks/561-8003f6922ee71b30.js new file mode 100644 index 0000000..9982fd3 --- /dev/null +++ b/_next/static/chunks/561-8003f6922ee71b30.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[561],{8561:function(e,t,n){n.d(t,{default:function(){return i.a}});var r=n(3922),i=n.n(r)},1827:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"Image",{enumerable:!0,get:function(){return v}});let r=n(8903),i=n(3536),o=n(2842),a=i._(n(6856)),l=r._(n(2181)),u=r._(n(8261)),s=n(8898),d=n(9709),f=n(3499);n(3563);let c=n(3855),p=r._(n(8606)),g={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0};function m(e,t,n,r,i,o,a){let l=null==e?void 0:e.src;e&&e["data-loaded-src"]!==l&&(e["data-loaded-src"]=l,("decode"in e?e.decode():Promise.resolve()).catch(()=>{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&i(!0),null==n?void 0:n.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let r=!1,i=!1;n.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>r,isPropagationStopped:()=>i,persist:()=>{},preventDefault:()=>{r=!0,t.preventDefault()},stopPropagation:()=>{i=!0,t.stopPropagation()}})}(null==r?void 0:r.current)&&r.current(e)}}))}function h(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}"undefined"==typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let y=(0,a.forwardRef)((e,t)=>{let{src:n,srcSet:r,sizes:i,height:l,width:u,decoding:s,className:d,style:f,fetchPriority:c,placeholder:p,loading:g,unoptimized:y,fill:b,onLoadRef:v,onLoadingCompleteRef:_,setBlurComplete:w,setShowAltText:S,sizesInput:j,onLoad:x,onError:C,...P}=e;return(0,o.jsx)("img",{...P,...h(c),loading:g,width:u,height:l,decoding:s,"data-nimg":b?"fill":"1",className:d,style:f,sizes:i,srcSet:r,src:n,ref:(0,a.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(C&&(e.src=e.src),e.complete&&m(e,p,v,_,w,y,j))},[n,p,v,_,w,C,y,j,t]),onLoad:e=>{m(e.currentTarget,p,v,_,w,y,j)},onError:e=>{S(!0),"empty"!==p&&w(!0),C&&C(e)}})});function b(e){let{isAppRouter:t,imgAttributes:n}=e,r={as:"image",imageSrcSet:n.srcSet,imageSizes:n.sizes,crossOrigin:n.crossOrigin,referrerPolicy:n.referrerPolicy,...h(n.fetchPriority)};return t&&l.default.preload?(l.default.preload(n.src,r),null):(0,o.jsx)(u.default,{children:(0,o.jsx)("link",{rel:"preload",href:n.srcSet?void 0:n.src,...r},"__nimg-"+n.src+n.srcSet+n.sizes)})}let v=(0,a.forwardRef)((e,t)=>{let n=(0,a.useContext)(c.RouterContext),r=(0,a.useContext)(f.ImageConfigContext),i=(0,a.useMemo)(()=>{let e=g||r||d.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),n=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:n}},[r]),{onLoad:l,onLoadingComplete:u}=e,m=(0,a.useRef)(l);(0,a.useEffect)(()=>{m.current=l},[l]);let h=(0,a.useRef)(u);(0,a.useEffect)(()=>{h.current=u},[u]);let[v,_]=(0,a.useState)(!1),[w,S]=(0,a.useState)(!1),{props:j,meta:x}=(0,s.getImgProps)(e,{defaultLoader:p.default,imgConf:i,blurComplete:v,showAltText:w});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(y,{...j,unoptimized:x.unoptimized,placeholder:x.placeholder,fill:x.fill,onLoadRef:m,onLoadingCompleteRef:h,setBlurComplete:_,setShowAltText:S,sizesInput:e.sizes,ref:t}),x.priority?(0,o.jsx)(b,{isAppRouter:!n,imgAttributes:j}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7171:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return r}});let r=n(8903)._(n(6856)).default.createContext({})},2174:function(e,t){function n(e){let{ampFirst:t=!1,hybrid:n=!1,hasQuery:r=!1}=void 0===e?{}:e;return t||n&&r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return n}})},8898:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return l}}),n(3563);let r=n(2909),i=n(9709);function o(e){return void 0!==e.default}function a(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function l(e,t){var n;let l,u,s,{src:d,sizes:f,unoptimized:c=!1,priority:p=!1,loading:g,className:m,quality:h,width:y,height:b,fill:v=!1,style:_,overrideSrc:w,onLoad:S,onLoadingComplete:j,placeholder:x="empty",blurDataURL:C,fetchPriority:P,layout:O,objectFit:z,objectPosition:E,lazyBoundary:M,lazyRoot:I,...k}=e,{imgConf:A,showAltText:R,blurComplete:D,defaultLoader:L}=t,N=A||i.imageConfigDefault;if("allSizes"in N)l=N;else{let e=[...N.deviceSizes,...N.imageSizes].sort((e,t)=>e-t),t=N.deviceSizes.sort((e,t)=>e-t);l={...N,allSizes:e,deviceSizes:t}}if(void 0===L)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let U=k.loader||L;delete k.loader,delete k.srcSet;let T="__next_img_default"in U;if(T){if("custom"===l.loader)throw Error('Image with src "'+d+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=U;U=t=>{let{config:n,...r}=t;return e(r)}}if(O){"fill"===O&&(v=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[O];e&&(_={..._,...e});let t={responsive:"100vw",fill:"100vw"}[O];t&&!f&&(f=t)}let F="",G=a(y),B=a(b);if("object"==typeof(n=d)&&(o(n)||void 0!==n.src)){let e=o(d)?d.default:d;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(u=e.blurWidth,s=e.blurHeight,C=C||e.blurDataURL,F=e.src,!v){if(G||B){if(G&&!B){let t=G/e.width;B=Math.round(e.height*t)}else if(!G&&B){let t=B/e.height;G=Math.round(e.width*t)}}else G=e.width,B=e.height}}let W=!p&&("lazy"===g||void 0===g);(!(d="string"==typeof d?d:F)||d.startsWith("data:")||d.startsWith("blob:"))&&(c=!0,W=!1),l.unoptimized&&(c=!0),T&&d.endsWith(".svg")&&!l.dangerouslyAllowSVG&&(c=!0),p&&(P="high");let V=a(h),H=Object.assign(v?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:z,objectPosition:E}:{},R?{}:{color:"transparent"},_),q=D||"empty"===x?null:"blur"===x?'url("data:image/svg+xml;charset=utf-8,'+(0,r.getImageBlurSvg)({widthInt:G,heightInt:B,blurWidth:u,blurHeight:s,blurDataURL:C||"",objectFit:H.objectFit})+'")':'url("'+x+'")',$=q?{backgroundSize:H.objectFit||"cover",backgroundPosition:H.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:q}:{},J=function(e){let{config:t,src:n,unoptimized:r,width:i,quality:o,sizes:a,loader:l}=e;if(r)return{src:n,srcSet:void 0,sizes:void 0};let{widths:u,kind:s}=function(e,t,n){let{deviceSizes:r,allSizes:i}=e;if(n){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let r;r=e.exec(n);r)t.push(parseInt(r[2]));if(t.length){let e=.01*Math.min(...t);return{widths:i.filter(t=>t>=r[0]*e),kind:"w"}}return{widths:i,kind:"w"}}return"number"!=typeof t?{widths:r,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>i.find(t=>t>=e)||i[i.length-1]))],kind:"x"}}(t,i,a),d=u.length-1;return{sizes:a||"w"!==s?a:"100vw",srcSet:u.map((e,r)=>l({config:t,src:n,quality:o,width:e})+" "+("w"===s?e:r+1)+s).join(", "),src:l({config:t,src:n,quality:o,width:u[d]})}}({config:l,src:d,unoptimized:c,width:G,quality:V,sizes:f,loader:U});return{props:{...k,loading:W?"lazy":g,fetchPriority:P,width:G,height:B,decoding:"async",className:m,style:{...H,...$},sizes:J.sizes,srcSet:J.srcSet,src:w||J.src},meta:{unoptimized:c,priority:p,placeholder:x,fill:v}}}},8261:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return m},defaultHead:function(){return f}});let r=n(8903),i=n(3536),o=n(2842),a=i._(n(6856)),l=r._(n(6776)),u=n(7171),s=n(6783),d=n(2174);function f(e){void 0===e&&(e=!1);let t=[(0,o.jsx)("meta",{charSet:"utf-8"})];return e||t.push((0,o.jsx)("meta",{name:"viewport",content:"width=device-width"})),t}function c(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===a.default.Fragment?e.concat(a.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}n(3563);let p=["name","httpEquiv","charSet","itemProp"];function g(e,t){let{inAmpMode:n}=t;return e.reduce(c,[]).reverse().concat(f(n).reverse()).filter(function(){let e=new Set,t=new Set,n=new Set,r={};return i=>{let o=!0,a=!1;if(i.key&&"number"!=typeof i.key&&i.key.indexOf("$")>0){a=!0;let t=i.key.slice(i.key.indexOf("$")+1);e.has(t)?o=!1:e.add(t)}switch(i.type){case"title":case"base":t.has(i.type)?o=!1:t.add(i.type);break;case"meta":for(let e=0,t=p.length;e{let r=e.key||t;if(!n&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let t={...e.props||{}};return t["data-href"]=t.href,t.href=void 0,t["data-optimized-fonts"]=!0,a.default.cloneElement(e,t)}return a.default.cloneElement(e,{key:r})})}let m=function(e){let{children:t}=e,n=(0,a.useContext)(u.AmpStateContext),r=(0,a.useContext)(s.HeadManagerContext);return(0,o.jsx)(l.default,{reduceComponentsToState:g,headManager:r,inAmpMode:(0,d.isInAmpMode)(n),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},2909:function(e,t){function n(e){let{widthInt:t,heightInt:n,blurWidth:r,blurHeight:i,blurDataURL:o,objectFit:a}=e,l=r?40*r:t,u=i?40*i:n,s=l&&u?"viewBox='0 0 "+l+" "+u+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+s+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(s?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+o+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return n}})},3499:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return o}});let r=n(8903)._(n(6856)),i=n(9709),o=r.default.createContext(i.imageConfigDefault)},9709:function(e,t){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{VALID_LOADERS:function(){return n},imageConfigDefault:function(){return r}});let n=["default","imgix","cloudinary","akamai","custom"],r={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",remotePatterns:[],unoptimized:!1}},3922:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{default:function(){return u},getImageProps:function(){return l}});let r=n(8903),i=n(8898),o=n(1827),a=r._(n(8606));function l(e){let{props:t}=(0,i.getImgProps)(e,{defaultLoader:a.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!0}});for(let[e,n]of Object.entries(t))void 0===n&&delete t[e];return{props:t}}let u=o.Image},8606:function(e,t){function n(e){let{config:t,src:n,width:r,quality:i}=e;return t.path+"?url="+encodeURIComponent(n)+"&w="+r+"&q="+(i||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return r}}),n.__next_img_default=!0;let r=n},6776:function(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return l}});let r=n(6856),i="undefined"==typeof window,o=i?()=>{}:r.useLayoutEffect,a=i?()=>{}:r.useEffect;function l(e){let{headManager:t,reduceComponentsToState:n}=e;function l(){if(t&&t.mountedInstances){let i=r.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(n(i,e))}}if(i){var u;null==t||null==(u=t.mountedInstances)||u.add(e.children),l()}return o(()=>{var n;return null==t||null==(n=t.mountedInstances)||n.add(e.children),()=>{var n;null==t||null==(n=t.mountedInstances)||n.delete(e.children)}}),o(()=>(t&&(t._pendingUpdate=l),()=>{t&&(t._pendingUpdate=l)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}}}]); \ No newline at end of file diff --git a/_next/static/chunks/572-0f6e91900f3cfcf0.js b/_next/static/chunks/572-0f6e91900f3cfcf0.js deleted file mode 100644 index a665570..0000000 --- a/_next/static/chunks/572-0f6e91900f3cfcf0.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[572],{4496:function(t,e,i){i.d(e,{default:function(){return n.a}});var s=i(1872),n=i.n(s)},614:function(t,e,i){let s;i.d(e,{E:function(){return rl}});var n,r=i(2842),o=i(6856);let a=(0,o.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),l=(0,o.createContext)({}),h=(0,o.createContext)(null),u="undefined"!=typeof window,d=u?o.useLayoutEffect:o.useEffect,c=(0,o.createContext)({strict:!1}),p=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),m="data-"+p("framerAppearId"),f={skipAnimations:!1,useManualTiming:!1},v=["read","resolveKeyframes","update","preRender","render","postRender"];function g(t,e){let i=!1,s=!0,n={delta:0,timestamp:0,isProcessing:!1},r=()=>i=!0,o=v.reduce((t,e)=>(t[e]=function(t){let e=new Set,i=new Set,s=!1,n=!1,r=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function a(e){r.has(e)&&(l.schedule(e),t()),e(o)}let l={schedule:(t,n=!1,o=!1)=>{let a=o&&s?e:i;return n&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(o=t,s){n=!0;return}s=!0,[e,i]=[i,e],i.clear(),e.forEach(a),s=!1,n&&(n=!1,l.process(t))}};return l}(r),t),{}),{read:a,resolveKeyframes:l,update:h,preRender:u,render:d,postRender:c}=o,p=()=>{let r=f.useManualTiming?n.timestamp:performance.now();i=!1,n.delta=s?1e3/60:Math.max(Math.min(r-n.timestamp,40),1),n.timestamp=r,n.isProcessing=!0,a.process(n),l.process(n),h.process(n),u.process(n),d.process(n),c.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(p))},m=()=>{i=!0,s=!0,n.isProcessing||t(p)};return{schedule:v.reduce((t,e)=>{let s=o[e];return t[e]=(t,e=!1,n=!1)=>(i||m(),s.schedule(t,e,n)),t},{}),cancel:t=>{for(let e=0;eS(t[e]))}function E(t){return!!(M(t)||t.variants)}function R(t){return Array.isArray(t)?t.join(" "):t}let D={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},k={};for(let t in D)k[t]={isEnabled:e=>D[t].some(t=>!!e[t])};let j=(0,o.createContext)({}),L=Symbol.for("motionComponentSymbol"),F=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function B(t){if("string"!=typeof t||t.includes("-"));else if(F.indexOf(t)>-1||/[A-Z]/u.test(t))return!0;return!1}let O={},U=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],I=new Set(U);function $(t,{layout:e,layoutId:i}){return I.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!O[t]||"opacity"===t)}let W=t=>!!(t&&t.getVelocity),N=(t,e)=>e&&"number"==typeof t?e.transform(t):t,z=(t,e,i)=>i>e?e:i"number"==typeof t,parse:parseFloat,transform:t=>t},Y={...H,transform:t=>z(0,1,t)},X={...H,default:1},K=t=>Math.round(1e5*t)/1e5,G=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function Z(t){return"string"==typeof t}let J=t=>({test:e=>Z(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Q=J("deg"),tt=J("%"),te=J("px"),ti=J("vh"),ts=J("vw"),tn={...tt,parse:t=>tt.parse(t)/100,transform:t=>tt.transform(100*t)},tr={...H,transform:Math.round},to={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,radius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,size:te,top:te,right:te,bottom:te,left:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:X,scaleX:X,scaleY:X,scaleZ:X,skew:Q,skewX:Q,skewY:Q,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:Y,originX:tn,originY:tn,originZ:te,zIndex:tr,backgroundPositionX:te,backgroundPositionY:te,fillOpacity:Y,strokeOpacity:Y,numOctaves:tr},ta={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tl=U.length,th=t=>e=>"string"==typeof e&&e.startsWith(t),tu=th("--"),td=th("var(--"),tc=t=>!!td(t)&&tp.test(t.split("/*")[0].trim()),tp=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function tm(t,e,i){let{style:s,vars:n,transformOrigin:r}=t,o=!1,a=!1;for(let t in e){let i=e[t];if(I.has(t)){o=!0;continue}if(tu(t)){n[t]=i;continue}{let e=N(i,to[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(!e.transform&&(o||i?s.transform=function(t,e,i){let s="",n=!0;for(let r=0;r({style:{},transform:{},transformOrigin:{},vars:{}});function tv(t,e,i){for(let s in e)W(e[s])||$(s,i)||(t[s]=e[s])}let tg=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ty(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||tg.has(t)}let tx=t=>!ty(t);try{(n=require("@emotion/is-prop-valid").default)&&(tx=t=>t.startsWith("on")?!ty(t):n(t))}catch(t){}function tP(t,e,i){return"string"==typeof t?t:te.transform(e+i*t)}let tw={offset:"stroke-dashoffset",array:"stroke-dasharray"},tT={offset:"strokeDashoffset",array:"strokeDasharray"};function tb(t,{attrX:e,attrY:i,attrScale:s,originX:n,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...h},u,d){if(tm(t,h,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:c,style:p,dimensions:m}=t;c.transform&&(m&&(p.transform=c.transform),delete c.transform),m&&(void 0!==n||void 0!==r||p.transform)&&(p.transformOrigin=function(t,e,i){let s=tP(e,t.x,t.width),n=tP(i,t.y,t.height);return`${s} ${n}`}(m,void 0!==n?n:.5,void 0!==r?r:.5)),void 0!==e&&(c.x=e),void 0!==i&&(c.y=i),void 0!==s&&(c.scale=s),void 0!==o&&function(t,e,i=1,s=0,n=!0){t.pathLength=1;let r=n?tw:tT;t[r.offset]=te.transform(-s);let o=te.transform(e),a=te.transform(i);t[r.array]=`${o} ${a}`}(c,o,a,l,!1)}let tS=()=>({...tf(),attrs:{}}),tA=t=>"string"==typeof t&&"svg"===t.toLowerCase();function tV(t,{style:e,vars:i},s,n){for(let r in Object.assign(t.style,e,n&&n.getProjectionStyles(s)),i)t.style.setProperty(r,i[r])}let tC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tM(t,e,i,s){for(let i in tV(t,e,void 0,s),e.attrs)t.setAttribute(tC.has(i)?i:p(i),e.attrs[i])}function tE(t,e,i){var s;let{style:n}=t,r={};for(let o in n)(W(n[o])||e.style&&W(e.style[o])||$(o,t)||(null===(s=null==i?void 0:i.getValue(o))||void 0===s?void 0:s.liveStyle)!==void 0)&&(r[o]=n[o]);return i&&n&&"string"==typeof n.willChange&&(i.applyWillChange=!1),r}function tR(t,e,i){let s=tE(t,e,i);for(let i in t)(W(t[i])||W(e[i]))&&(s[-1!==U.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]);return s}function tD(t){let e=[{},{}];return null==t||t.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function tk(t,e,i,s){if("function"==typeof e){let[n,r]=tD(s);e=e(void 0!==i?i:t.custom,n,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){let[n,r]=tD(s);e=e(void 0!==i?i:t.custom,n,r)}return e}let tj=t=>Array.isArray(t),tL=t=>!!(t&&"object"==typeof t&&t.mix&&t.toValue),tF=t=>tj(t)?t[t.length-1]||0:t;function tB(t){let e=W(t)?t.get():t;return tL(e)?e.toValue():e}let tO=new Set(["opacity","clipPath","filter","transform"]);function tU(t){return I.has(t)?"transform":tO.has(t)?p(t):void 0}function tI(t,e){-1===t.indexOf(e)&&t.push(e)}function t$(t,e){let i=t.indexOf(e);i>-1&&t.splice(i,1)}let tW=t=>(e,i)=>{let s=(0,o.useContext)(l),n=(0,o.useContext)(h),r=()=>(function({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:i,onMount:s},n,r,o,a){let l={latestValues:function(t,e,i,s,n){var r;let o={},a=[],l=s&&(null===(r=t.style)||void 0===r?void 0:r.willChange)===void 0,h=n(t,{});for(let t in h)o[t]=tB(h[t]);let{initial:u,animate:d}=t,c=M(t),p=E(t);e&&p&&!c&&!1!==t.inherit&&(void 0===u&&(u=e.initial),void 0===d&&(d=e.animate));let m=!!i&&!1===i.initial,f=(m=m||!1===u)?d:u;return f&&"boolean"!=typeof f&&!A(f)&&tN(t,f,(t,e)=>{for(let e in t){let i=t[e];if(Array.isArray(i)){let t=m?i.length-1:0;i=i[t]}null!==i&&(o[e]=i)}for(let t in e)o[t]=e[t]}),l&&(d&&!1!==u&&!A(d)&&tN(t,d,t=>{for(let e in t)!function(t,e){let i=tU(e);i&&tI(t,i)}(a,e)}),a.length&&(o.willChange=a.join(","))),o}(n,r,o,!a&&t,e),renderState:i()};return s&&(l.mount=t=>s(n,t,l)),l})(t,e,s,n,i);return i?r():function(t){let e=(0,o.useRef)(null);return null===e.current&&(e.current=t()),e.current}(r)};function tN(t,e,i){let s=Array.isArray(e)?e:[e];for(let e=0;et,{schedule:tH,cancel:tY,state:tX,steps:tK}=g("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:tz,!0),tG={useVisualState:tW({scrapeMotionValuesFromProps:tR,createRenderState:tS,onMount:(t,e,{renderState:i,latestValues:s})=>{tH.read(()=>{try{i.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){i.dimensions={x:0,y:0,width:0,height:0}}}),tH.render(()=>{tb(i,s,tA(e.tagName),t.transformTemplate),tM(e,i)})}})},tq={useVisualState:tW({applyWillChange:!0,scrapeMotionValuesFromProps:tE,createRenderState:tf})};function t_(t,e,i,s={passive:!0}){return t.addEventListener(e,i,s),()=>t.removeEventListener(e,i)}let tZ=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function tJ(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}let tQ=t=>e=>tZ(e)&&t(e,tJ(e));function t0(t,e,i,s){return t_(t,e,tQ(i),s)}let t1=(t,e)=>i=>e(t(i)),t5=(...t)=>t.reduce(t1);function t2(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}let t3=t2("dragHorizontal"),t9=t2("dragVertical");function t4(t){let e=!1;if("y"===t)e=t9();else if("x"===t)e=t3();else{let t=t3(),i=t9();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function t6(){let t=t4(!0);return!t||(t(),!1)}class t8{constructor(t){this.isMounted=!1,this.node=t}update(){}}function t7(t,e){let i=e?"onHoverStart":"onHoverEnd";return t0(t.current,e?"pointerenter":"pointerleave",(s,n)=>{if("touch"===s.pointerType||t6())return;let r=t.getProps();t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",e);let o=r[i];o&&tH.postRender(()=>o(s,n))},{passive:!t.getProps()[i]})}class et extends t8{mount(){this.unmount=t5(t7(this.node,!0),t7(this.node,!1))}unmount(){}}class ee extends t8{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=t5(t_(this.node.current,"focus",()=>this.onFocus()),t_(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}let ei=(t,e)=>!!e&&(t===e||ei(t,e.parentElement));function es(t,e){if(!e)return;let i=new PointerEvent("pointer"+t);e(i,tJ(i))}class en extends t8{constructor(){super(...arguments),this.removeStartListeners=tz,this.removeEndListeners=tz,this.removeAccessibleListeners=tz,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();let i=this.node.getProps(),s=t0(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;let{onTap:i,onTapCancel:s,globalTapTarget:n}=this.node.getProps(),r=n||ei(this.node.current,t.target)?i:s;r&&tH.update(()=>r(t,e))},{passive:!(i.onTap||i.onPointerUp)}),n=t0(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=t5(s,n),this.startPress(t,e)},this.startAccessiblePress=()=>{let t=t_(this.node.current,"keydown",t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=t_(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&es("up",(t,e)=>{let{onTap:i}=this.node.getProps();i&&tH.postRender(()=>i(t,e))})}),es("down",(t,e)=>{this.startPress(t,e)}))}),e=t_(this.node.current,"blur",()=>{this.isPressing&&es("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=t5(t,e)}}startPress(t,e){this.isPressing=!0;let{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&tH.postRender(()=>i(t,e))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!t6()}cancelPress(t,e){if(!this.checkPressEnd())return;let{onTapCancel:i}=this.node.getProps();i&&tH.postRender(()=>i(t,e))}mount(){let t=this.node.getProps(),e=t0(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=t_(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=t5(e,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}let er=new WeakMap,eo=new WeakMap,ea=t=>{let e=er.get(t.target);e&&e(t)},el=t=>{t.forEach(ea)},eh={some:0,all:1};class eu extends t8{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:s="some",once:n}=t,r={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof s?s:eh[s]};return function(t,e,i){let s=function({root:t,...e}){let i=t||document;eo.has(i)||eo.set(i,{});let s=eo.get(i),n=JSON.stringify(e);return s[n]||(s[n]=new IntersectionObserver(el,{root:t,...e})),s[n]}(e);return er.set(t,i),s.observe(t),()=>{er.delete(t),s.unobserve(t)}}(this.node.current,r,t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,n&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:i,onViewportLeave:s}=this.node.getProps(),r=e?i:s;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}function ed(t,e){if(!Array.isArray(e))return!1;let i=e.length;if(i!==t.length)return!1;for(let s=0;s1e3*t,em=t=>t/1e3,ef={type:"spring",stiffness:500,damping:25,restSpeed:10},ev=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),eg={type:"keyframes",duration:.8},ey={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ex=(t,{keyframes:e})=>e.length>2?eg:I.has(t)?t.startsWith("scale")?ev(e[1]):ef:ey;function eP(t,e){return t[e]||t.default||t}let ew={current:!1},eT=t=>null!==t;function eb(t,{repeat:e,repeatType:i="loop"},s){let n=t.filter(eT),r=e&&"loop"!==i&&e%2==1?0:n.length-1;return r&&void 0!==s?s:n[r]}let eS=t=>/^0[^.\s]+$/u.test(t),eA=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),eV=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,eC=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),eM=t=>t===H||t===te,eE=(t,e)=>parseFloat(t.split(", ")[e]),eR=(t,e)=>(i,{transform:s})=>{if("none"===s||!s)return 0;let n=s.match(/^matrix3d\((.+)\)$/u);if(n)return eE(n[1],e);{let e=s.match(/^matrix\((.+)\)$/u);return e?eE(e[1],t):0}},eD=new Set(["x","y","z"]),ek=U.filter(t=>!eD.has(t)),ej={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:eR(4,13),y:eR(5,14)};ej.translateX=ej.x,ej.translateY=ej.y;let eL=t=>e=>e.test(t),eF=[H,te,tt,Q,ts,ti,{test:t=>"auto"===t,parse:t=>t}],eB=t=>eF.find(eL(t)),eO=new Set,eU=!1,eI=!1;function e$(){if(eI){let t=Array.from(eO).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{let e=function(t){let e=[];return ek.forEach(i=>{let s=t.getValue(i);void 0!==s&&(e.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();let e=i.get(t);e&&e.forEach(([e,i])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}eI=!1,eU=!1,eO.forEach(t=>t.complete()),eO.clear()}function eW(){eO.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(eI=!0)})}class eN{constructor(t,e,i,s,n,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=s,this.element=n,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(eO.add(this),eU||(eU=!0,tH.read(eW),tH.resolveKeyframes(e$))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:e,element:i,motionValue:s}=this;for(let n=0;ni=>!!(Z(i)&&_.test(i)&&i.startsWith(t)||e&&null!=i&&Object.prototype.hasOwnProperty.call(i,e)),eH=(t,e,i)=>s=>{if(!Z(s))return s;let[n,r,o,a]=s.match(G);return{[t]:parseFloat(n),[e]:parseFloat(r),[i]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},eY=t=>z(0,255,t),eX={...H,transform:t=>Math.round(eY(t))},eK={test:ez("rgb","red"),parse:eH("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:s=1})=>"rgba("+eX.transform(t)+", "+eX.transform(e)+", "+eX.transform(i)+", "+K(Y.transform(s))+")"},eG={test:ez("#"),parse:function(t){let e="",i="",s="",n="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),s=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),s=t.substring(3,4),n=t.substring(4,5),e+=e,i+=i,s+=s,n+=n),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:n?parseInt(n,16)/255:1}},transform:eK.transform},eq={test:ez("hsl","hue"),parse:eH("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:s=1})=>"hsla("+Math.round(t)+", "+tt.transform(K(e))+", "+tt.transform(K(i))+", "+K(Y.transform(s))+")"},e_={test:t=>eK.test(t)||eG.test(t)||eq.test(t),parse:t=>eK.test(t)?eK.parse(t):eq.test(t)?eq.parse(t):eG.parse(t),transform:t=>Z(t)?t:t.hasOwnProperty("red")?eK.transform(t):eq.transform(t)},eZ="number",eJ="color",eQ=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function e0(t){let e=t.toString(),i=[],s={color:[],number:[],var:[]},n=[],r=0,o=e.replace(eQ,t=>(e_.test(t)?(s.color.push(r),n.push(eJ),i.push(e_.parse(t))):t.startsWith("var(")?(s.var.push(r),n.push("var"),i.push(t)):(s.number.push(r),n.push(eZ),i.push(parseFloat(t))),++r,"${}")).split("${}");return{values:i,split:o,indexes:s,types:n}}function e1(t){return e0(t).values}function e5(t){let{split:e,types:i}=e0(t),s=e.length;return t=>{let n="";for(let r=0;r"number"==typeof t?0:t,e3={test:function(t){var e,i;return isNaN(t)&&Z(t)&&((null===(e=t.match(G))||void 0===e?void 0:e.length)||0)+((null===(i=t.match(q))||void 0===i?void 0:i.length)||0)>0},parse:e1,createTransformer:e5,getAnimatableNone:function(t){let e=e1(t);return e5(t)(e.map(e2))}},e9=new Set(["brightness","contrast","saturate","opacity"]);function e4(t){let[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[s]=i.match(G)||[];if(!s)return t;let n=i.replace(s,""),r=e9.has(e)?1:0;return s!==i&&(r*=100),e+"("+r+n+")"}let e6=/\b([a-z-]*)\(.*?\)/gu,e8={...e3,getAnimatableNone:t=>{let e=t.match(e6);return e?e.map(e4).join(" "):t}},e7={...to,color:e_,backgroundColor:e_,outlineColor:e_,fill:e_,stroke:e_,borderColor:e_,borderTopColor:e_,borderRightColor:e_,borderBottomColor:e_,borderLeftColor:e_,filter:e8,WebkitFilter:e8},it=t=>e7[t];function ie(t,e){let i=it(t);return i!==e8&&(i=e3),i.getAnimatableNone?i.getAnimatableNone(e):void 0}let ii=new Set(["auto","none","0"]);class is extends eN{constructor(t,e,i,s,n){super(t,e,i,s,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i{e.getValue(t).set(i)}),this.resolveNoneKeyframes()}}function ir(t){let e;return()=>(void 0===e&&(e=t()),e)}function io(){s=void 0}let ia={now:()=>(void 0===s&&ia.set(tX.isProcessing||f.useManualTiming?tX.timestamp:performance.now()),s),set:t=>{s=t,queueMicrotask(io)}},il=(t,e)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(e3.test(t)||"0"===t)&&!t.startsWith("url("));class ih{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ia.now(),this.options={autoplay:t,delay:e,type:i,repeat:s,repeatDelay:n,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(eW(),e$()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=ia.now(),this.hasAttemptedResolve=!0;let{name:i,type:s,velocity:n,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,i,s){let n=t[0];if(null===n)return!1;if("display"===e||"visibility"===e)return!0;let r=t[t.length-1],o=il(n,e),a=il(r,e);return tz(o===a,`You are trying to animate ${e} from "${n}" to "${r}". ${n} is not an animatable value - to enable this animation set ${n} to a value animatable to ${r} via the \`style\` property.`),!!o&&!!a&&(function(t){let e=t[0];if(1===t.length)return!0;for(let i=0;i{this.resolveFinishedPromise=t})}}function iu(t,e,i){var s,n;let r=Math.max(e-5,0);return s=i-t(r),(n=e-r)?1e3/n*s:0}function id(t,e){return t*Math.sqrt(1-e*e)}let ic=["duration","bounce"],ip=["stiffness","damping","mass"];function im(t,e){return e.some(e=>void 0!==t[e])}function iv({keyframes:t,restDelta:e,restSpeed:i,...s}){let n;let r=t[0],o=t[t.length-1],a={done:!1,value:r},{stiffness:l,damping:h,mass:u,duration:d,velocity:c,isResolvedFromDuration:p}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!im(t,ip)&&im(t,ic)){let i=function({duration:t=800,bounce:e=.25,velocity:i=0,mass:s=1}){let n,r;tz(t<=ep(10),"Spring duration must be 10 seconds or less");let o=1-e;o=z(.05,1,o),t=z(.01,10,em(t)),o<1?(n=e=>{let s=e*o,n=s*t;return .001-(s-i)/id(e,o)*Math.exp(-n)},r=e=>{let s=e*o*t,r=Math.pow(o,2)*Math.pow(e,2)*t,a=id(Math.pow(e,2),o);return(s*i+i-r)*Math.exp(-s)*(-n(e)+.001>0?-1:1)/a}):(n=e=>-.001+Math.exp(-e*t)*((e-i)*t+1),r=e=>t*t*(i-e)*Math.exp(-e*t));let a=function(t,e,i){let s=i;for(let i=1;i<12;i++)s-=t(s)/e(s);return s}(n,r,5/t);if(t=ep(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{let e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}(t);(e={...e,...i,mass:1}).isResolvedFromDuration=!0}return e}({...s,velocity:-em(s.velocity||0)}),m=c||0,f=h/(2*Math.sqrt(l*u)),v=o-r,g=em(Math.sqrt(l/u)),y=5>Math.abs(v);if(i||(i=y?.01:2),e||(e=y?.005:.5),f<1){let t=id(g,f);n=e=>o-Math.exp(-f*g*e)*((m+f*g*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}else if(1===f)n=t=>o-Math.exp(-g*t)*(v+(m+g*v)*t);else{let t=g*Math.sqrt(f*f-1);n=e=>{let i=Math.exp(-f*g*e),s=Math.min(t*e,300);return o-i*((m+f*g*v)*Math.sinh(s)+t*v*Math.cosh(s))/t}}return{calculatedDuration:p&&d||null,next:t=>{let s=n(t);if(p)a.done=t>=d;else{let r=0;f<1&&(r=0===t?ep(m):iu(n,t,s));let l=Math.abs(r)<=i,h=Math.abs(o-s)<=e;a.done=l&&h}return a.value=a.done?o:s,a}}}function ig({keyframes:t,velocity:e=0,power:i=.8,timeConstant:s=325,bounceDamping:n=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:h=.5,restSpeed:u}){let d,c;let p=t[0],m={done:!1,value:p},f=t=>void 0!==a&&tl,v=t=>void 0===a?l:void 0===l?a:Math.abs(a-t)-g*Math.exp(-t/s),w=t=>x+P(t),T=t=>{let e=P(t),i=w(t);m.done=Math.abs(e)<=h,m.value=m.done?x:i},b=t=>{f(m.value)&&(d=t,c=iv({keyframes:[m.value,v(m.value)],velocity:iu(w,t,m.value),damping:n,stiffness:r,restDelta:h,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return(c||void 0!==d||(e=!0,T(t),b(t)),void 0!==d&&t>=d)?c.next(t-d):(e||T(t),m)}}}let iy=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function ix(t,e,i,s){if(t===e&&i===s)return tz;let n=e=>(function(t,e,i,s,n){let r,o;let a=0;do(r=iy(o=e+(i-e)/2,s,n)-t)>0?i=o:e=o;while(Math.abs(r)>1e-7&&++a<12);return o})(e,0,1,t,i);return t=>0===t||1===t?t:iy(n(t),e,s)}let iP=ix(.42,0,1,1),iw=ix(0,0,.58,1),iT=ix(.42,0,.58,1),ib=t=>Array.isArray(t)&&"number"!=typeof t[0],iS=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,iA=t=>e=>1-t(1-e),iV=t=>1-Math.sin(Math.acos(t)),iC=iA(iV),iM=iS(iV),iE=ix(.33,1.53,.69,.99),iR=iA(iE),iD=iS(iR),ik={linear:tz,easeIn:iP,easeInOut:iT,easeOut:iw,circIn:iV,circInOut:iM,circOut:iC,backIn:iR,backInOut:iD,backOut:iE,anticipate:t=>(t*=2)<1?.5*iR(t):.5*(2-Math.pow(2,-10*(t-1)))},ij=t=>{if(Array.isArray(t)){tz(4===t.length,"Cubic bezier arrays must contain four numerical values.");let[e,i,s,n]=t;return ix(e,i,s,n)}return"string"==typeof t?(tz(void 0!==ik[t],`Invalid easing type '${t}'`),ik[t]):t},iL=(t,e,i)=>{let s=e-t;return 0===s?1:(i-t)/s},iF=(t,e,i)=>t+(e-t)*i;function iB(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function iO(t,e){return i=>i>0?e:t}let iU=(t,e,i)=>{let s=t*t,n=i*(e*e-s)+s;return n<0?0:Math.sqrt(n)},iI=[eG,eK,eq],i$=t=>iI.find(e=>e.test(t));function iW(t){let e=i$(t);if(tz(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let i=e.parse(t);return e===eq&&(i=function({hue:t,saturation:e,lightness:i,alpha:s}){t/=360,i/=100;let n=0,r=0,o=0;if(e/=100){let s=i<.5?i*(1+e):i+e-i*e,a=2*i-s;n=iB(a,s,t+1/3),r=iB(a,s,t),o=iB(a,s,t-1/3)}else n=r=o=i;return{red:Math.round(255*n),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(i)),i}let iN=(t,e)=>{let i=iW(t),s=iW(e);if(!i||!s)return iO(t,e);let n={...i};return t=>(n.red=iU(i.red,s.red,t),n.green=iU(i.green,s.green,t),n.blue=iU(i.blue,s.blue,t),n.alpha=iF(i.alpha,s.alpha,t),eK.transform(n))},iz=new Set(["none","hidden"]);function iH(t,e){return i=>iF(t,e,i)}function iY(t){return"number"==typeof t?iH:"string"==typeof t?tc(t)?iO:e_.test(t)?iN:iG:Array.isArray(t)?iX:"object"==typeof t?e_.test(t)?iN:iK:iO}function iX(t,e){let i=[...t],s=i.length,n=t.map((t,i)=>iY(t)(t,e[i]));return t=>{for(let e=0;e{for(let e in s)i[e]=s[e](t);return i}}let iG=(t,e)=>{let i=e3.createTransformer(e),s=e0(t),n=e0(e);return s.indexes.var.length===n.indexes.var.length&&s.indexes.color.length===n.indexes.color.length&&s.indexes.number.length>=n.indexes.number.length?iz.has(t)&&!n.values.length||iz.has(e)&&!s.values.length?iz.has(t)?i=>i<=0?t:e:i=>i>=1?e:t:t5(iX(function(t,e){var i;let s=[],n={color:0,var:0,number:0};for(let r=0;re[0];if(2===r&&t[0]===t[1])return()=>e[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());let o=function(t,e,i){let s=[],n=i||iq,r=t.length-1;for(let i=0;i{let i=0;if(a>1)for(;il(z(t[0],t[r-1],e)):l}((i&&i.length===e.length?i:function(t){let e=[0];return function(t,e){let i=t[t.length-1];for(let s=1;s<=e;s++){let n=iL(0,e,s);t.push(iF(i,1,n))}}(e,t.length-1),e}(e)).map(e=>e*t),e,{ease:Array.isArray(n)?n:e.map(()=>n||iT).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}let iZ=t=>{let e=({timestamp:e})=>t(e);return{start:()=>tH.update(e,!0),stop:()=>tY(e),now:()=>tX.isProcessing?tX.timestamp:ia.now()}},iJ={decay:ig,inertia:ig,tween:i_,keyframes:i_,spring:iv},iQ=t=>t/100;class i0 extends ih{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();let{onStop:t}=this.options;t&&t()};let{name:e,motionValue:i,element:s,keyframes:n}=this.options,r=(null==s?void 0:s.KeyframeResolver)||eN;this.resolver=new r(n,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}initPlayback(t){let e,i;let{type:s="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:a=0}=this.options,l=iJ[s]||i_;l!==i_&&"number"!=typeof t[0]&&(e=t5(iQ,iq(t[0],t[1])),t=[0,100]);let h=l({...this.options,keyframes:t});"mirror"===o&&(i=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),null===h.calculatedDuration&&(h.calculatedDuration=function(t){let e=0,i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}(h));let{calculatedDuration:u}=h,d=u+r;return{generator:h,mirroredGenerator:i,mapPercentToKeyframes:e,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){let{resolved:i}=this;if(!i){let{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}let{finalKeyframe:s,generator:n,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:h,resolvedDuration:u}=i;if(null===this.startTime)return n.next(0);let{delay:d,repeat:c,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-h/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let v=this.currentTime-d*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>h;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=h);let y=this.currentTime,x=n;if(c){let t=Math.min(this.currentTime,h)/u,e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,(e=Math.min(e,c+1))%2&&("reverse"===p?(i=1-i,m&&(i-=m/u)):"mirror"===p&&(x=r)),y=z(0,1,i)*u}let P=g?{done:!1,value:a[0]}:x.next(y);o&&(P.value=o(P.value));let{done:w}=P;g||null===l||(w=this.speed>=0?this.currentTime>=h:this.currentTime<=0);let T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return T&&void 0!==s&&(P.value=eb(a,this.options,s)),f&&f(P.value),T&&this.finish(),P}get duration(){let{resolved:t}=this;return t?em(t.calculatedDuration):0}get time(){return em(this.currentTime)}set time(t){t=ep(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){let e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=em(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=iZ,onPlay:e,startTime:i}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();let s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=i?i:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}let i1=t=>Array.isArray(t)&&"number"==typeof t[0],i5=([t,e,i,s])=>`cubic-bezier(${t}, ${e}, ${i}, ${s})`,i2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:i5([0,.65,.55,1]),circOut:i5([.55,0,1,.45]),backIn:i5([.31,.01,.66,-.59]),backOut:i5([.33,1.53,.69,.99])};function i3(t){return i9(t)||i2.easeOut}function i9(t){if(t)return i1(t)?i5(t):Array.isArray(t)?t.map(i3):i2[t]}let i4=ir(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class i6 extends ih{constructor(t){super(t);let{name:e,motionValue:i,element:s,keyframes:n}=this.options;this.resolver=new is(n,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}initPlayback(t,e){var i,s;let{duration:n=300,times:r,ease:o,type:a,motionValue:l,name:h,startTime:u}=this.options;if(!(null===(i=l.owner)||void 0===i?void 0:i.current))return!1;if("spring"===(s=this.options).type||!function t(e){return!!(!e||"string"==typeof e&&e in i2||i1(e)||Array.isArray(e)&&e.every(t))}(s.ease)){let{onComplete:e,onUpdate:i,motionValue:s,element:l,...h}=this.options,u=function(t,e){let i=new i0({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0}),s={done:!1,value:t[0]},n=[],r=0;for(;!s.done&&r<2e4;)n.push((s=i.sample(r)).value),r+=10;return{times:void 0,keyframes:n,duration:r-10,ease:"linear"}}(t,h);1===(t=u.keyframes).length&&(t[1]=t[0]),n=u.duration,r=u.times,o=u.ease,a="keyframes"}let d=function(t,e,i,{delay:s=0,duration:n=300,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){let h={[e]:i};l&&(h.offset=l);let u=i9(a);return Array.isArray(u)&&(h.easing=u),t.animate(h,{delay:s,duration:n,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}(l.owner.current,h,t,{...this.options,duration:n,times:r,ease:o});return d.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(d.timeline=this.pendingTimeline,this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:i}=this.options;l.set(eb(t,this.options,e)),i&&i(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:n,times:r,type:a,ease:o,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:e}=t;return em(e)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:e}=t;return em(e.currentTime||0)}set time(t){let{resolved:e}=this;if(!e)return;let{animation:i}=e;i.currentTime=ep(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:e}=t;return e.playbackRate}set speed(t){let{resolved:e}=this;if(!e)return;let{animation:i}=e;i.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:e}=t;return e.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){let{resolved:e}=this;if(!e)return tz;let{animation:i}=e;i.timeline=t,i.onfinish=null}else this.pendingTimeline=t;return tz}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:e,keyframes:i,duration:s,type:n,ease:r,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){let{motionValue:t,onUpdate:e,onComplete:a,element:l,...h}=this.options,u=new i0({...h,keyframes:i,duration:s,type:n,ease:r,times:o,isGenerator:!0}),d=ep(this.time);t.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}let{onStop:a}=this.options;a&&a(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:e,name:i,repeatDelay:s,repeatType:n,damping:r,type:o}=t;return i4()&&i&&tO.has(i)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==n&&0!==r&&"inertia"!==o}}let i8=ir(()=>void 0!==window.ScrollTimeline);class i7{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let i=0;i{if(!i8()||!e.attachTimeline)return e.pause(),function(t,e){let i;let s=()=>{let{currentTime:s}=e,n=(null===s?0:s.value)/100;i!==n&&t(n),i=n};return tH.update(s,!0),()=>tY(s)}(t=>{e.time=e.duration*t},t);e.attachTimeline(t)});return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;ee[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}let st=(t,e,i,s={},n,r,o)=>a=>{let l=eP(s,t)||{},h=l.delay||s.delay||0,{elapsed:u=0}=s;u-=ep(h);let d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),o&&o()},onStop:o,name:t,motionValue:e,element:r?void 0:n};!function({when:t,delay:e,delayChildren:i,staggerChildren:s,staggerDirection:n,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length}(l)&&(d={...d,...ex(t,d)}),d.duration&&(d.duration=ep(d.duration)),d.repeatDelay&&(d.repeatDelay=ep(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let c=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(d.duration=0,0!==d.delay||(c=!0)),(ew.current||f.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!r&&void 0!==e.get()){let t=eb(d.keyframes,l);if(void 0!==t)return tH.update(()=>{d.onUpdate(t),d.onComplete()}),new i7([])}return!r&&i6.supports(d)?new i6(d):new i0(d)};class se{constructor(){this.subscriptions=[]}add(t){return tI(this.subscriptions,t),()=>t$(this.subscriptions,t)}notify(t,e,i){let s=this.subscriptions.length;if(s){if(1===s)this.subscriptions[0](t,e,i);else for(let n=0;n!isNaN(parseFloat(t)),ss={current:void 0};class sn{constructor(t,e={}){this.version="11.3.29",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{let i=ia.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=ia.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=si(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new se);let i=this.events[t].add(e);return"change"===t?()=>{i(),tH.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return ss.current&&ss.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var t;let e=ia.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return t=parseFloat(this.current)-parseFloat(this.prevFrameValue),i?1e3/i*t:0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function sr(t,e){return new sn(t,e)}function so(t){return t.getProps()[m]}class sa extends sn{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(t){let e=tU(t);if(!e)return;let i=this.counts.get(e)||0;this.counts.set(e,i+1),0===i&&(this.output.push(e),this.update());let s=!1;return()=>{if(s)return;s=!0;let t=this.counts.get(e)-1;this.counts.set(e,t),0===t&&(t$(this.output,e),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function sl(t,e){var i,s;if(!t.applyWillChange)return;let n=t.getValue("willChange");if(n||(null===(i=t.props.style)||void 0===i?void 0:i.willChange)||(n=new sa("auto"),t.addValue("willChange",n)),W(s=n)&&s.add)return n.add(e)}function sh(t,e,{delay:i=0,transitionOverride:s,type:n}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);let h=[],u=n&&t.animationState&&t.animationState.getState()[n];for(let e in l){let s=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),n=l[e];if(void 0===n||u&&function({protectedKeys:t,needsAnimating:e},i){let s=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,s}(u,e))continue;let a={delay:i,...eP(o||{},e)},d=!1;if(window.MotionHandoffAnimation){let i=so(t);if(i){let t=window.MotionHandoffAnimation(i,e,tH);null!==t&&(a.startTime=t,d=!0)}}s.start(st(e,s,n,t.shouldReduceMotion&&I.has(e)?{type:!1}:a,t,d,sl(t,e)));let c=s.animation;c&&h.push(c)}return a&&Promise.all(h).then(()=>{tH.update(()=>{a&&function(t,e){let{transitionEnd:i={},transition:s={},...n}=ec(t,e)||{};for(let e in n={...n,...i}){let i=tF(n[e]);t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,sr(i))}}(t,a)})}),h}function su(t,e,i={}){var s;let n=ec(t,e,"exit"===i.type?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0),{transition:r=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(r=i.transitionOverride);let o=n?()=>Promise.all(sh(t,n,i)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(s=0)=>{let{delayChildren:n=0,staggerChildren:o,staggerDirection:a}=r;return function(t,e,i=0,s=0,n=1,r){let o=[],a=(t.variantChildren.size-1)*s,l=1===n?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(sd).forEach((t,s)=>{t.notify("AnimationStart",e),o.push(su(t,e,{...r,delay:i+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,n+s,o,a,i)}:()=>Promise.resolve(),{when:l}=r;if(!l)return Promise.all([o(),a(i.delay)]);{let[t,e]="beforeChildren"===l?[o,a]:[a,o];return t().then(()=>e())}}function sd(t,e){return t.sortNodePosition(e)}let sc=[...V].reverse(),sp=V.length;function sm(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sf(){return{animate:sm(!0),whileInView:sm(),whileHover:sm(),whileTap:sm(),whileDrag:sm(),whileFocus:sm(),exit:sm()}}class sv extends t8{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:i})=>(function(t,e,i={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e))s=Promise.all(e.map(e=>su(t,e,i)));else if("string"==typeof e)s=su(t,e,i);else{let n="function"==typeof e?ec(t,e,i.custom):e;s=Promise.all(sh(t,n,i))}return s.then(()=>{t.notify("AnimationComplete",e)})})(t,e,i))),i=sf(),s=!0,n=e=>(i,s)=>{var n;let r=ec(t,s,"exit"===e?null===(n=t.presenceContext)||void 0===n?void 0:n.custom:void 0);if(r){let{transition:t,transitionEnd:e,...s}=r;i={...i,...s,...e}}return i};function r(r){let o=t.getProps(),a=t.getVariantContext(!0)||{},l=[],h=new Set,u={},d=1/0;for(let e=0;ed&&v),P=!1,w=Array.isArray(f)?f:[f],T=w.reduce(n(p),{});!1===g&&(T={});let{prevResolvedValues:b={}}=m,V={...b,...T},C=e=>{x=!0,h.has(e)&&(P=!0,h.delete(e)),m.needsAnimating[e]=!0;let i=t.getValue(e);i&&(i.liveStyle=!1)};for(let t in V){let e=T[t],i=b[t];if(!u.hasOwnProperty(t))(tj(e)&&tj(i)?ed(e,i):e===i)?void 0!==e&&h.has(t)?C(t):m.protectedKeys[t]=!0:null!=e?C(t):h.add(t)}m.prevProp=f,m.prevResolvedValues=T,m.isActive&&(u={...u,...T}),s&&t.blockInitialAnimation&&(x=!1),x&&(!y||P)&&l.push(...w.map(t=>({animation:t,options:{type:p}})))}if(h.size){let e={};h.forEach(i=>{let s=t.getBaseTarget(i),n=t.getValue(i);n&&(n.liveStyle=!0),e[i]=null!=s?s:null}),l.push({animation:e})}let p=!!l.length;return s&&(!1===o.initial||o.initial===o.animate)&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(l):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){var n;if(i[e].isActive===s)return Promise.resolve();null===(n=t.variantChildren)||void 0===n||n.forEach(t=>{var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,s)}),i[e].isActive=s;let o=r(e);for(let t in i)i[t].protectedKeys={};return o},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=sf(),s=!0}}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();A(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}let sg=0;class sy extends t8{constructor(){super(...arguments),this.id=sg++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;let s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>e(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}let sx=(t,e)=>Math.abs(t-e);class sP{constructor(t,e,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{var t,e;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let i=sb(this.lastMoveEventInfo,this.history),s=null!==this.startEvent,n=(t=i.offset,e={x:0,y:0},Math.sqrt(sx(t.x,e.x)**2+sx(t.y,e.y)**2)>=3);if(!s&&!n)return;let{point:r}=i,{timestamp:o}=tX;this.history.push({...r,timestamp:o});let{onStart:a,onMove:l}=this.handlers;s||(a&&a(this.lastMoveEvent,i),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,i)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=sw(e,this.transformPagePoint),tH.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:i,onSessionEnd:s,resumeAnimation:n}=this.handlers;if(this.dragSnapToOrigin&&n&&n(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=sb("pointercancel"===t.type?this.lastMoveEventInfo:sw(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,r),s&&s(t,r)},!tZ(t))return;this.dragSnapToOrigin=n,this.handlers=e,this.transformPagePoint=i,this.contextWindow=s||window;let r=sw(tJ(t),this.transformPagePoint),{point:o}=r,{timestamp:a}=tX;this.history=[{...o,timestamp:a}];let{onSessionStart:l}=e;l&&l(t,sb(r,this.history)),this.removeListeners=t5(t0(this.contextWindow,"pointermove",this.handlePointerMove),t0(this.contextWindow,"pointerup",this.handlePointerUp),t0(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),tY(this.updatePoint)}}function sw(t,e){return e?{point:e(t.point)}:t}function sT(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sb({point:t},e){return{point:t,delta:sT(t,sS(e)),offset:sT(t,e[0]),velocity:function(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,s=null,n=sS(t);for(;i>=0&&(s=t[i],!(n.timestamp-s.timestamp>ep(.1)));)i--;if(!s)return{x:0,y:0};let r=em(n.timestamp-s.timestamp);if(0===r)return{x:0,y:0};let o={x:(n.x-s.x)/r,y:(n.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}(e,0)}}function sS(t){return t[t.length-1]}function sA(t){return t.max-t.min}function sV(t,e,i,s=.5){t.origin=s,t.originPoint=iF(e.min,e.max,t.origin),t.scale=sA(i)/sA(e),t.translate=iF(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function sC(t,e,i,s){sV(t.x,e.x,i.x,s?s.originX:void 0),sV(t.y,e.y,i.y,s?s.originY:void 0)}function sM(t,e,i){t.min=i.min+e.min,t.max=t.min+sA(e)}function sE(t,e,i){t.min=e.min-i.min,t.max=t.min+sA(e)}function sR(t,e,i){sE(t.x,e.x,i.x),sE(t.y,e.y,i.y)}function sD(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function sk(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.min({translate:0,scale:1,origin:0,originPoint:0}),sB=()=>({x:sF(),y:sF()}),sO=()=>({min:0,max:0}),sU=()=>({x:sO(),y:sO()});function sI(t){return[t("x"),t("y")]}function s$({top:t,left:e,right:i,bottom:s}){return{x:{min:e,max:i},y:{min:t,max:s}}}function sW(t){return void 0===t||1===t}function sN({scale:t,scaleX:e,scaleY:i}){return!sW(t)||!sW(e)||!sW(i)}function sz(t){return sN(t)||sH(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function sH(t){var e,i;return(e=t.x)&&"0%"!==e||(i=t.y)&&"0%"!==i}function sY(t,e,i,s,n){return void 0!==n&&(t=s+n*(t-s)),s+i*(t-s)+e}function sX(t,e=0,i=1,s,n){t.min=sY(t.min,e,i,s,n),t.max=sY(t.max,e,i,s,n)}function sK(t,{x:e,y:i}){sX(t.x,e.translate,e.scale,e.originPoint),sX(t.y,i.translate,i.scale,i.originPoint)}function sG(t,e){t.min=t.min+e,t.max=t.max+e}function sq(t,e,i,s,n=.5){let r=iF(t.min,t.max,n);sX(t,e,i,r,s)}function s_(t,e){sq(t.x,e.x,e.scaleX,e.scale,e.originX),sq(t.y,e.y,e.scaleY,e.scale,e.originY)}function sZ(t,e){return s$(function(t,e){if(!e)return t;let i=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}let sJ=({current:t})=>t?t.ownerDocument.defaultView:null,sQ=new WeakMap;class s0{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=sU(),this.visualElement=t}start(t,{snapToCursor:e=!1}={}){let{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let{dragSnapToOrigin:s}=this.getProps();this.panSession=new sP(t,{onSessionStart:t=>{let{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(tJ(t,"page").point)},onStart:(t,e)=>{var i;let{drag:s,dragPropagation:n,onDragStart:r}=this.getProps();if(s&&!n&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=t4(s),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sI(t=>{let e=this.getAxisMotionValue(t).get()||0;if(tt.test(e)){let{projection:i}=this.visualElement;if(i&&i.layout){let s=i.layout.layoutBox[t];if(s){let t=sA(s);e=parseFloat(e)/100*t}}}this.originPoint[t]=e}),r&&tH.postRender(()=>r(t,e)),null===(i=this.removeWillChange)||void 0===i||i.call(this),this.removeWillChange=sl(this.visualElement,"transform");let{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{let{dragPropagation:i,dragDirectionLock:s,onDirectionLock:n,onDrag:r}=this.getProps();if(!i&&!this.openGlobalLock)return;let{offset:o}=e;if(s&&null===this.currentDirection){this.currentDirection=function(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}(o),null!==this.currentDirection&&n&&n(this.currentDirection);return}this.updateAxis("x",e.point,o),this.updateAxis("y",e.point,o),this.visualElement.render(),r&&r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>sI(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:sJ(this.visualElement)})}stop(t,e){var i;null===(i=this.removeWillChange)||void 0===i||i.call(this);let s=this.isDragging;if(this.cancel(),!s)return;let{velocity:n}=e;this.startAnimation(n);let{onDragEnd:r}=this.getProps();r&&tH.postRender(()=>r(t,e))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,i){let{drag:s}=this.getProps();if(!i||!s1(t,s,this.currentDirection))return;let n=this.getAxisMotionValue(t),r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},s){return void 0!==e&&ti&&(t=s?iF(i,t,s.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),n.set(r)}resolveConstraints(){var t;let{dragConstraints:e,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,n=this.constraints;e&&P(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=function(t,{top:e,left:i,bottom:s,right:n}){return{x:sD(t.x,i,n),y:sD(t.y,e,s)}}(s.layoutBox,e):this.constraints=!1,this.elastic=function(t=.35){return!1===t?t=0:!0===t&&(t=.35),{x:sj(t,"left","right"),y:sj(t,"top","bottom")}}(i),n!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&sI(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){let i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(s.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!P(e))return!1;let s=e.current;tz(null!==s,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:n}=this.visualElement;if(!n||!n.layout)return!1;let r=function(t,e,i){let s=sZ(t,i),{scroll:n}=e;return n&&(sG(s.x,n.offset.x),sG(s.y,n.offset.y)),s}(s,n.root,this.visualElement.getTransformPagePoint()),o={x:sk((t=n.layout.layoutBox).x,r.x),y:sk(t.y,r.y)};if(i){let t=i(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=s$(t))}return o}startAnimation(t){let{drag:e,dragMomentum:i,dragElastic:s,dragTransition:n,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{};return Promise.all(sI(o=>{if(!s1(o,e,this.currentDirection))return;let l=a&&a[o]||{};r&&(l={min:0,max:0});let h={type:"inertia",velocity:i?t[o]:0,bounceStiffness:s?200:1e6,bounceDamping:s?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...n,...l};return this.startAxisValueAnimation(o,h)})).then(o)}startAxisValueAnimation(t,e){let i=this.getAxisMotionValue(t);return i.start(st(t,i,0,e,this.visualElement,!1,sl(this.visualElement,t)))}stopAnimation(){sI(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){sI(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){let e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps();return i[e]||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){sI(e=>{let{drag:i}=this.getProps();if(!s1(e,i,this.currentDirection))return;let{projection:s}=this.visualElement,n=this.getAxisMotionValue(e);if(s&&s.layout){let{min:i,max:r}=s.layout.layoutBox[e];n.set(t[e]-iF(i,r,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!P(e)||!i||!this.constraints)return;this.stopAnimation();let s={x:0,y:0};sI(t=>{let e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){let i=e.get();s[t]=function(t,e){let i=.5,s=sA(t),n=sA(e);return n>s?i=iL(e.min,e.max-s,t.min):s>n&&(i=iL(t.min,t.max-n,e.min)),z(0,1,i)}({min:i,max:i},this.constraints[t])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),sI(e=>{if(!s1(e,t,null))return;let i=this.getAxisMotionValue(e),{min:n,max:r}=this.constraints[e];i.set(iF(n,r,s[e]))})}addListeners(){if(!this.visualElement.current)return;sQ.set(this.visualElement,this);let t=t0(this.visualElement.current,"pointerdown",t=>{let{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)}),e=()=>{let{dragConstraints:t}=this.getProps();P(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",e);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),tH.read(e);let n=t_(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(sI(e=>{let i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{n(),t(),s(),r&&r()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:n=!1,dragElastic:r=.35,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:s,dragConstraints:n,dragElastic:r,dragMomentum:o}}}function s1(t,e,i){return(!0===e||e===t)&&(null===i||i===t)}class s5 extends t8{constructor(t){super(t),this.removeGroupControls=tz,this.removeListeners=tz,this.controls=new s0(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tz}unmount(){this.removeGroupControls(),this.removeListeners()}}let s2=t=>(e,i)=>{t&&tH.postRender(()=>t(e,i))};class s3 extends t8{constructor(){super(...arguments),this.removePointerDownListener=tz}onPointerDown(t){this.session=new sP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sJ(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:s2(t),onStart:s2(e),onMove:i,onEnd:(t,e)=>{delete this.session,s&&tH.postRender(()=>s(t,e))}}}mount(){this.removePointerDownListener=t0(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let s9={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function s4(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let s6={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!te.test(t))return t;t=parseFloat(t)}let i=s4(t,e.target.x),s=s4(t,e.target.y);return`${i}% ${s}%`}};class s8 extends o.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:s}=this.props,{projection:n}=t;Object.assign(O,nt),n&&(e.group&&e.group.add(n),i&&i.register&&s&&i.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),s9.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:i,drag:s,isPresent:n}=this.props,r=i.projection;return r&&(r.isPresent=n,s||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent===n||(n?r.promote():r.relegate()||tH.postRender(()=>{let t=r.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),y.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function s7(t){let[e,i]=function(){let t=(0,o.useContext)(h);if(null===t)return[!0,null];let{isPresent:e,onExitComplete:i,register:s}=t,n=(0,o.useId)();(0,o.useEffect)(()=>s(n),[]);let r=(0,o.useCallback)(()=>i&&i(n),[n,i]);return!e&&i?[!1,r]:[!0]}(),s=(0,o.useContext)(j);return(0,r.jsx)(s8,{...t,layoutGroup:s,switchLayoutGroup:(0,o.useContext)(w),isPresent:e,safeToRemove:i})}let nt={borderRadius:{...s6,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:s6,borderTopRightRadius:s6,borderBottomLeftRadius:s6,borderBottomRightRadius:s6,boxShadow:{correct:(t,{treeScale:e,projectionDelta:i})=>{let s=e3.parse(t);if(s.length>5)return t;let n=e3.createTransformer(t),r="number"!=typeof s[0]?1:0,o=i.x.scale*e.x,a=i.y.scale*e.y;s[0+r]/=o,s[1+r]/=a;let l=iF(o,a,.5);return"number"==typeof s[2+r]&&(s[2+r]/=l),"number"==typeof s[3+r]&&(s[3+r]/=l),n(s)}}},ne=["TopLeft","TopRight","BottomLeft","BottomRight"],ni=ne.length,ns=t=>"string"==typeof t?parseFloat(t):t,nn=t=>"number"==typeof t||te.test(t);function nr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let no=nl(0,.5,iC),na=nl(.5,.95,tz);function nl(t,e,i){return s=>se?1:i(iL(t,e,s))}function nh(t,e){t.min=e.min,t.max=e.max}function nu(t,e){nh(t.x,e.x),nh(t.y,e.y)}function nd(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function nc(t,e,i,s,n){return t-=e,t=s+1/i*(t-s),void 0!==n&&(t=s+1/n*(t-s)),t}function np(t,e,[i,s,n],r,o){!function(t,e=0,i=1,s=.5,n,r=t,o=t){if(tt.test(e)&&(e=parseFloat(e),e=iF(o.min,o.max,e/100)-o.min),"number"!=typeof e)return;let a=iF(r.min,r.max,s);t===r&&(a-=e),t.min=nc(t.min,e,i,a,n),t.max=nc(t.max,e,i,a,n)}(t,e[i],e[s],e[n],e.scale,r,o)}let nm=["x","scaleX","originX"],nf=["y","scaleY","originY"];function nv(t,e,i,s){np(t.x,e,nm,i?i.x:void 0,s?s.x:void 0),np(t.y,e,nf,i?i.y:void 0,s?s.y:void 0)}function ng(t){return 0===t.translate&&1===t.scale}function ny(t){return ng(t.x)&&ng(t.y)}function nx(t,e){return t.min===e.min&&t.max===e.max}function nP(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function nw(t,e){return nP(t.x,e.x)&&nP(t.y,e.y)}function nT(t){return sA(t.x)/sA(t.y)}function nb(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class nS{constructor(){this.members=[]}add(t){tI(this.members,t),t.scheduleRender()}remove(t){if(t$(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){let e;let i=this.members.findIndex(e=>t===e);if(0===i)return!1;for(let t=i;t>=0;t--){let i=this.members[t];if(!1!==i.isPresent){e=i;break}}return!!e&&(this.promote(e),!0)}promote(t,e){let i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:s}=t.options;!1===s&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let nA=(t,e)=>t.depth-e.depth;class nV{constructor(){this.children=[],this.isDirty=!1}add(t){tI(this.children,t),this.isDirty=!0}remove(t){t$(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(nA),this.isDirty=!1,this.children.forEach(t)}}let nC={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},nM="undefined"!=typeof window&&void 0!==window.MotionDebug,nE=["","X","Y","Z"],nR={visibility:"hidden"},nD=0;function nk(t,e,i,s){let{latestValues:n}=e;n[t]&&(i[t]=n[t],e.setStaticValue(t,0),s&&(s[t]=0))}function nj({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:n}){return class{constructor(t={},i=null==e?void 0:e()){this.id=nD++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,nM&&(nC.totalNodes=nC.resolvedTargetDeltas=nC.recalculatedProjection=0),this.nodes.forEach(nB),this.nodes.forEach(nz),this.nodes.forEach(nH),this.nodes.forEach(nO),nM&&window.MotionDebug.record(nC)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){let i=ia.now(),s=({timestamp:e})=>{let n=e-i;n>=250&&(tY(s),t(n-250))};return tH.read(s,!0),()=>tY(s)}(s,0),s9.hasAnimatedSinceResize&&(s9.hasAnimatedSinceResize=!1,this.nodes.forEach(nN))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||n)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:i,layout:s})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let n=this.options.transition||r.getDefaultTransition()||n_,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!nw(this.targetLayout,s)||i,h=!e&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);let e={...eP(n,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||nN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,tY(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nY),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedTransform&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:i}=e.options;if(!i)return;let s=so(i);window.MotionHasOptimisedTransformAnimation(s)&&window.MotionCancelOptimisedTransform(s);let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&t(n)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}}(this.layoutCorrected,this.treeScale,this.path,i),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=sU());let{target:l}=e;if(!l){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(nd(this.prevProjectionDelta.x,this.projectionDelta.x),nd(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),sC(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===o&&this.treeScale.y===a&&nb(this.projectionDelta.x,this.prevProjectionDelta.x)&&nb(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),nM&&nC.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=sB(),this.projectionDelta=sB(),this.projectionDeltaWithTransform=sB()}setAnimationOrigin(t,e=!1){let i;let s=this.snapshot,n=s?s.latestValues:{},r={...this.latestValues},o=sB();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;let a=sU(),l=(s?s.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,d=!!(l&&!u&&!0===this.options.crossfade&&!this.path.some(nq));this.animationProgress=0,this.mixTargetDelta=e=>{let s=e/1e3;if(nK(o.x,t.x,s),nK(o.y,t.y,s),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var h,c,p,m;sR(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,nG(p.x,m.x,a.x,s),nG(p.y,m.y,a.y,s),i&&(h=this.relativeTarget,c=i,nx(h.x,c.x)&&nx(h.y,c.y))&&(this.isProjectionDirty=!1),i||(i=sU()),nu(i,this.relativeTarget)}l&&(this.animationValues=r,function(t,e,i,s,n,r){n?(t.opacity=iF(0,void 0!==i.opacity?i.opacity:1,no(s)),t.opacityExit=iF(void 0!==e.opacity?e.opacity:1,0,na(s))):r&&(t.opacity=iF(void 0!==e.opacity?e.opacity:1,void 0!==i.opacity?i.opacity:1,s));for(let n=0;n{s9.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,i){let s=W(0)?0:sr(0);return s.start(st("",s,1e3,i)),s.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:i,layout:s,latestValues:n}=t;if(e&&i&&s){if(this!==t&&this.layout&&s&&n0(this.options.animationType,this.layout.layoutBox,s.layoutBox)){i=this.target||sU();let e=sA(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;let s=sA(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+s}nu(e,i),s_(e,n),sC(this.projectionDeltaWithTransform,this.layoutCorrected,e,n)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new nS),this.sharedNodes.get(t).add(e);let i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){var t;let{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;let{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){let s=this.getStack();s&&s.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;let s={};i.z&&nk("z",t,s,this.animationValues);for(let e=0;e{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(nI),this.root.sharedNodes.clear()}}}function nL(t){t.updateLayout()}function nF(t){var e;let i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){let{layoutBox:e,measuredBox:s}=t.layout,{animationType:n}=t.options,r=i.source!==t.layout.source;"size"===n?sI(t=>{let s=r?i.measuredBox[t]:i.layoutBox[t],n=sA(s);s.min=e[t].min,s.max=s.min+n}):n0(n,i.layoutBox,e)&&sI(s=>{let n=r?i.measuredBox[s]:i.layoutBox[s],o=sA(e[s]);n.max=n.min+o,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+o)});let o=sB();sC(o,e,i.layoutBox);let a=sB();r?sC(a,t.applyTransform(s,!0),i.measuredBox):sC(a,e,i.layoutBox);let l=!ny(o),h=!1;if(!t.resumeFrom){let s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){let{snapshot:n,layout:r}=s;if(n&&r){let o=sU();sR(o,i.layoutBox,n.layoutBox);let a=sU();sR(a,e,r.layoutBox),nw(o,a)||(h=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=o,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function nB(t){nM&&nC.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function nO(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function nU(t){t.clearSnapshot()}function nI(t){t.clearMeasurements()}function n$(t){t.isLayoutDirty=!1}function nW(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function nN(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function nz(t){t.resolveTargetDelta()}function nH(t){t.calcProjection()}function nY(t){t.resetSkewAndRotation()}function nX(t){t.removeLeadSnapshot()}function nK(t,e,i){t.translate=iF(e.translate,0,i),t.scale=iF(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function nG(t,e,i,s){t.min=iF(e.min,i.min,s),t.max=iF(e.max,i.max,s)}function nq(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let n_={duration:.45,ease:[.4,0,.1,1]},nZ=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),nJ=nZ("applewebkit/")&&!nZ("chrome/")?Math.round:tz;function nQ(t){t.min=nJ(t.min),t.max=nJ(t.max)}function n0(t,e,i){return"position"===t||"preserve-aspect"===t&&!(.2>=Math.abs(nT(e)-nT(i)))}function n1(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}let n5=nj({attachResizeListener:(t,e)=>t_(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),n2={current:void 0},n3=nj({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!n2.current){let t=new n5({});t.mount(window),t.setOptions({layoutScroll:!0}),n2.current=t}return n2.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position}),n9={current:null},n4={current:!1},n6=new WeakMap,n8=[...eF,e_,e3],n7=t=>n8.find(eL(t)),rt=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],re=C.length;class ri{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:n,visualState:r},o={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=eN,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,tH.render(this.render,!1,!0))};let{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=!!n,this.isControllingVariants=M(e),this.isVariantNode=E(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:h,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(let t in u){let e=u[t];void 0!==a[t]&&W(e)&&e.set(a[t],!1)}}mount(t){this.current=t,n6.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),n4.current||function(){if(n4.current=!0,u){if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>n9.current=t.matches;t.addListener(e),e()}else n9.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||n9.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let t in n6.delete(this.current),this.projection&&this.projection.unmount(),tY(this.notifyUpdate),tY(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[t].clear();for(let t in this.features){let e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){let i=I.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&tH.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),n=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),n(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in k){let e=k[t];if(!e)continue;let{isEnabled:i,Feature:s}=e;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){let e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):sU()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){let i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=sr(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){var i;let s=void 0===this.latestValues[t]&&this.current?null!==(i=this.getBaseTargetFromProps(this.props,t))&&void 0!==i?i:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=s&&("string"==typeof s&&(eA(s)||eS(s))?s=parseFloat(s):!n7(s)&&e3.test(e)&&(s=ie(t,e)),this.setBaseTarget(t,W(s)?s.get():s)),W(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;let i;let{initial:s}=this.props;if("string"==typeof s||"object"==typeof s){let n=tk(this.props,s,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);n&&(i=n[t])}if(s&&void 0!==i)return i;let n=this.getBaseTargetFromProps(this.props,t);return void 0===n||W(n)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new se),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class rs extends ri{constructor(){super(...arguments),this.KeyframeResolver=is}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}}class rn extends rs{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=tV}readValueFromInstance(t,e){if(I.has(e)){let t=it(e);return t&&t.default||0}{let i=window.getComputedStyle(t),s=(tu(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:e}){return sZ(t,e)}build(t,e,i){tm(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return tE(t,e,i)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;W(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class rr extends rs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sU}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(I.has(e)){let t=it(e);return t&&t.default||0}return e=tC.has(e)?e:p(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return tR(t,e,i)}build(t,e,i){tb(t,e,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,i,s){tM(t,e,i,s)}mount(t){this.isSVGTag=tA(t.tagName),super.mount(t)}}let ro=(t,e)=>B(t)?new rr(e):new rn(e,{allowProjection:t!==o.Fragment}),ra={animation:{Feature:sv},exit:{Feature:sy},inView:{Feature:eu},tap:{Feature:en},focus:{Feature:ee},hover:{Feature:et},pan:{Feature:s3},drag:{Feature:s5,ProjectionNode:n3,MeasureLayout:s7},layout:{ProjectionNode:n3,MeasureLayout:s7}},rl=function(t){function e(e,i={}){return function({preloadedFeatures:t,createVisualElement:e,useRender:i,useVisualState:s,Component:n}){t&&function(t){for(let e in t)k[e]={...k[e],...t[e]}}(t);let p=(0,o.forwardRef)(function(t,p){var f;let v;let g={...(0,o.useContext)(a),...t,layoutId:function({layoutId:t}){let e=(0,o.useContext)(j).id;return e&&void 0!==t?e+"-"+t:t}(t)},{isStatic:x}=g,A=function(t){let{initial:e,animate:i}=function(t,e){if(M(t)){let{initial:e,animate:i}=t;return{initial:!1===e||S(e)?e:void 0,animate:S(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,(0,o.useContext)(l));return(0,o.useMemo)(()=>({initial:e,animate:i}),[R(e),R(i)])}(t),V=s(t,x);if(!x&&u){(0,o.useContext)(c).strict;let t=function(t){let{drag:e,layout:i}=k;if(!e&&!i)return{};let s={...e,...i};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==i?void 0:i.isEnabled(t))?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(g);v=t.MeasureLayout,A.visualElement=function(t,e,i,s,n){var r;let{visualElement:u}=(0,o.useContext)(l),p=(0,o.useContext)(c),f=(0,o.useContext)(h),v=(0,o.useContext)(a).reducedMotion,g=(0,o.useRef)();s=s||p.renderer,!g.current&&s&&(g.current=s(t,{visualState:e,parent:u,props:i,presenceContext:f,blockInitialAnimation:!!f&&!1===f.initial,reducedMotionConfig:v}));let x=g.current,S=(0,o.useContext)(w);x&&!x.projection&&n&&("html"===x.type||"svg"===x.type)&&function(t,e,i,s){let{layoutId:n,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:h}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(t.parent)),t.projection.setOptions({layoutId:n,layout:r,alwaysMeasureLayout:!!o||a&&P(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:h})}(g.current,i,n,S),(0,o.useInsertionEffect)(()=>{x&&x.update(i,f)});let A=i[m],V=(0,o.useRef)(!!A&&!window.MotionHandoffIsComplete&&(null===(r=window.MotionHasOptimisedAnimation)||void 0===r?void 0:r.call(window,A)));return d(()=>{x&&(x.updateFeatures(),y.render(x.render),V.current&&x.animationState&&x.animationState.animateChanges())}),(0,o.useEffect)(()=>{x&&(!V.current&&x.animationState&&x.animationState.animateChanges(),V.current=!1,T||(T=!0,queueMicrotask(b)))}),x}(n,V,g,e,t.ProjectionNode)}return(0,r.jsxs)(l.Provider,{value:A,children:[v&&A.visualElement?(0,r.jsx)(v,{visualElement:A.visualElement,...g}):null,i(n,t,(f=A.visualElement,(0,o.useCallback)(t=>{t&&V.mount&&V.mount(t),f&&(t?f.mount(t):f.unmount()),p&&("function"==typeof p?p(t):P(p)&&(p.current=t))},[f])),V,x,A.visualElement)]})});return p[L]=n,p}(t(e,i))}if("undefined"==typeof Proxy)return e;let i=new Map;return new Proxy(e,{get:(t,s)=>(i.has(s)||i.set(s,e(s)),i.get(s))})}((t,e)=>(function(t,{forwardMotionProps:e=!1},i,s){return{...B(t)?tG:tq,preloadedFeatures:i,useRender:function(t=!1){return(e,i,s,{latestValues:n},r)=>{let a=(B(e)?function(t,e,i,s){let n=(0,o.useMemo)(()=>{let i=tS();return tb(i,e,tA(s),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){let e={};tv(e,t.style,t),n.style={...e,...n.style}}return n}:function(t,e){let i={},s=function(t,e){let i=t.style||{},s={};return tv(s,i,t),Object.assign(s,function({transformTemplate:t},e){return(0,o.useMemo)(()=>{let i=tf();return tm(i,e,t),Object.assign({},i.vars,i.style)},[e])}(t,e)),s}(t,e);return t.drag&&!1!==t.dragListener&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===t.drag?"none":`pan-${"x"===t.drag?"y":"x"}`),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=s,i})(i,n,r,e),l=function(t,e,i){let s={};for(let n in t)("values"!==n||"object"!=typeof t.values)&&(tx(n)||!0===i&&ty(n)||!e&&!ty(n)||t.draggable&&n.startsWith("onDrag"))&&(s[n]=t[n]);return s}(i,"string"==typeof e,t),h=e!==o.Fragment?{...l,...a,ref:s}:{},{children:u}=i,d=(0,o.useMemo)(()=>W(u)?u.get():u,[u]);return(0,o.createElement)(e,{...h,children:d})}}(e),createVisualElement:s,Component:t}})(t,e,ra,ro))}}]); \ No newline at end of file diff --git a/_next/static/chunks/593-12288599e20618be.js b/_next/static/chunks/593-12288599e20618be.js new file mode 100644 index 0000000..721b899 --- /dev/null +++ b/_next/static/chunks/593-12288599e20618be.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[593],{4496:function(t,e,i){i.d(e,{default:function(){return n.a}});var s=i(1872),n=i.n(s)},4866:function(t,e,i){let s;i.d(e,{E:function(){return rl}});var n,r=i(2842),o=i(6856);let a=(0,o.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),l=(0,o.createContext)({}),h=(0,o.createContext)(null),u="undefined"!=typeof window,d=u?o.useLayoutEffect:o.useEffect,c=(0,o.createContext)({strict:!1}),p=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),m="data-"+p("framerAppearId"),f={skipAnimations:!1,useManualTiming:!1},v=["read","resolveKeyframes","update","preRender","render","postRender"];function g(t,e){let i=!1,s=!0,n={delta:0,timestamp:0,isProcessing:!1},r=()=>i=!0,o=v.reduce((t,e)=>(t[e]=function(t){let e=new Set,i=new Set,s=!1,n=!1,r=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function a(e){r.has(e)&&(l.schedule(e),t()),e(o)}let l={schedule:(t,n=!1,o=!1)=>{let a=o&&s?e:i;return n&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{if(o=t,s){n=!0;return}s=!0,[e,i]=[i,e],i.clear(),e.forEach(a),s=!1,n&&(n=!1,l.process(t))}};return l}(r),t),{}),{read:a,resolveKeyframes:l,update:h,preRender:u,render:d,postRender:c}=o,p=()=>{let r=f.useManualTiming?n.timestamp:performance.now();i=!1,n.delta=s?1e3/60:Math.max(Math.min(r-n.timestamp,40),1),n.timestamp=r,n.isProcessing=!0,a.process(n),l.process(n),h.process(n),u.process(n),d.process(n),c.process(n),n.isProcessing=!1,i&&e&&(s=!1,t(p))},m=()=>{i=!0,s=!0,n.isProcessing||t(p)};return{schedule:v.reduce((t,e)=>{let s=o[e];return t[e]=(t,e=!1,n=!1)=>(i||m(),s.schedule(t,e,n)),t},{}),cancel:t=>{for(let e=0;eS(t[e]))}function E(t){return!!(M(t)||t.variants)}function R(t){return Array.isArray(t)?t.join(" "):t}let D={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},k={};for(let t in D)k[t]={isEnabled:e=>D[t].some(t=>!!e[t])};let j=(0,o.createContext)({}),L=Symbol.for("motionComponentSymbol"),F=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function B(t){if("string"!=typeof t||t.includes("-"));else if(F.indexOf(t)>-1||/[A-Z]/u.test(t))return!0;return!1}let O={},U=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],I=new Set(U);function $(t,{layout:e,layoutId:i}){return I.has(t)||t.startsWith("origin")||(e||void 0!==i)&&(!!O[t]||"opacity"===t)}let W=t=>!!(t&&t.getVelocity),N=(t,e)=>e&&"number"==typeof t?e.transform(t):t,z=(t,e,i)=>i>e?e:i"number"==typeof t,parse:parseFloat,transform:t=>t},Y={...H,transform:t=>z(0,1,t)},X={...H,default:1},K=t=>Math.round(1e5*t)/1e5,G=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,q=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,_=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function Z(t){return"string"==typeof t}let J=t=>({test:e=>Z(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Q=J("deg"),tt=J("%"),te=J("px"),ti=J("vh"),ts=J("vw"),tn={...tt,parse:t=>tt.parse(t)/100,transform:t=>tt.transform(100*t)},tr={...H,transform:Math.round},to={borderWidth:te,borderTopWidth:te,borderRightWidth:te,borderBottomWidth:te,borderLeftWidth:te,borderRadius:te,radius:te,borderTopLeftRadius:te,borderTopRightRadius:te,borderBottomRightRadius:te,borderBottomLeftRadius:te,width:te,maxWidth:te,height:te,maxHeight:te,size:te,top:te,right:te,bottom:te,left:te,padding:te,paddingTop:te,paddingRight:te,paddingBottom:te,paddingLeft:te,margin:te,marginTop:te,marginRight:te,marginBottom:te,marginLeft:te,rotate:Q,rotateX:Q,rotateY:Q,rotateZ:Q,scale:X,scaleX:X,scaleY:X,scaleZ:X,skew:Q,skewX:Q,skewY:Q,distance:te,translateX:te,translateY:te,translateZ:te,x:te,y:te,z:te,perspective:te,transformPerspective:te,opacity:Y,originX:tn,originY:tn,originZ:te,zIndex:tr,backgroundPositionX:te,backgroundPositionY:te,fillOpacity:Y,strokeOpacity:Y,numOctaves:tr},ta={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},tl=U.length,th=t=>e=>"string"==typeof e&&e.startsWith(t),tu=th("--"),td=th("var(--"),tc=t=>!!td(t)&&tp.test(t.split("/*")[0].trim()),tp=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function tm(t,e,i){let{style:s,vars:n,transformOrigin:r}=t,o=!1,a=!1;for(let t in e){let i=e[t];if(I.has(t)){o=!0;continue}if(tu(t)){n[t]=i;continue}{let e=N(i,to[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(!e.transform&&(o||i?s.transform=function(t,e,i){let s="",n=!0;for(let r=0;r({style:{},transform:{},transformOrigin:{},vars:{}});function tv(t,e,i){for(let s in e)W(e[s])||$(s,i)||(t[s]=e[s])}let tg=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function ty(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||tg.has(t)}let tx=t=>!ty(t);try{(n=require("@emotion/is-prop-valid").default)&&(tx=t=>t.startsWith("on")?!ty(t):n(t))}catch(t){}function tP(t,e,i){return"string"==typeof t?t:te.transform(e+i*t)}let tw={offset:"stroke-dashoffset",array:"stroke-dasharray"},tT={offset:"strokeDashoffset",array:"strokeDasharray"};function tb(t,{attrX:e,attrY:i,attrScale:s,originX:n,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...h},u,d){if(tm(t,h,d),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};let{attrs:c,style:p,dimensions:m}=t;c.transform&&(m&&(p.transform=c.transform),delete c.transform),m&&(void 0!==n||void 0!==r||p.transform)&&(p.transformOrigin=function(t,e,i){let s=tP(e,t.x,t.width),n=tP(i,t.y,t.height);return`${s} ${n}`}(m,void 0!==n?n:.5,void 0!==r?r:.5)),void 0!==e&&(c.x=e),void 0!==i&&(c.y=i),void 0!==s&&(c.scale=s),void 0!==o&&function(t,e,i=1,s=0,n=!0){t.pathLength=1;let r=n?tw:tT;t[r.offset]=te.transform(-s);let o=te.transform(e),a=te.transform(i);t[r.array]=`${o} ${a}`}(c,o,a,l,!1)}let tS=()=>({...tf(),attrs:{}}),tA=t=>"string"==typeof t&&"svg"===t.toLowerCase();function tV(t,{style:e,vars:i},s,n){for(let r in Object.assign(t.style,e,n&&n.getProjectionStyles(s)),i)t.style.setProperty(r,i[r])}let tC=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function tM(t,e,i,s){for(let i in tV(t,e,void 0,s),e.attrs)t.setAttribute(tC.has(i)?i:p(i),e.attrs[i])}function tE(t,e,i){var s;let{style:n}=t,r={};for(let o in n)(W(n[o])||e.style&&W(e.style[o])||$(o,t)||(null===(s=null==i?void 0:i.getValue(o))||void 0===s?void 0:s.liveStyle)!==void 0)&&(r[o]=n[o]);return i&&n&&"string"==typeof n.willChange&&(i.applyWillChange=!1),r}function tR(t,e,i){let s=tE(t,e,i);for(let i in t)(W(t[i])||W(e[i]))&&(s[-1!==U.indexOf(i)?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i]=t[i]);return s}function tD(t){let e=[{},{}];return null==t||t.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function tk(t,e,i,s){if("function"==typeof e){let[n,r]=tD(s);e=e(void 0!==i?i:t.custom,n,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){let[n,r]=tD(s);e=e(void 0!==i?i:t.custom,n,r)}return e}let tj=t=>Array.isArray(t),tL=t=>!!(t&&"object"==typeof t&&t.mix&&t.toValue),tF=t=>tj(t)?t[t.length-1]||0:t;function tB(t){let e=W(t)?t.get():t;return tL(e)?e.toValue():e}let tO=new Set(["opacity","clipPath","filter","transform"]);function tU(t){return I.has(t)?"transform":tO.has(t)?p(t):void 0}function tI(t,e){-1===t.indexOf(e)&&t.push(e)}function t$(t,e){let i=t.indexOf(e);i>-1&&t.splice(i,1)}let tW=t=>(e,i)=>{let s=(0,o.useContext)(l),n=(0,o.useContext)(h),r=()=>(function({applyWillChange:t=!1,scrapeMotionValuesFromProps:e,createRenderState:i,onMount:s},n,r,o,a){let l={latestValues:function(t,e,i,s,n){var r;let o={},a=[],l=s&&(null===(r=t.style)||void 0===r?void 0:r.willChange)===void 0,h=n(t,{});for(let t in h)o[t]=tB(h[t]);let{initial:u,animate:d}=t,c=M(t),p=E(t);e&&p&&!c&&!1!==t.inherit&&(void 0===u&&(u=e.initial),void 0===d&&(d=e.animate));let m=!!i&&!1===i.initial,f=(m=m||!1===u)?d:u;return f&&"boolean"!=typeof f&&!A(f)&&tN(t,f,(t,e)=>{for(let e in t){let i=t[e];if(Array.isArray(i)){let t=m?i.length-1:0;i=i[t]}null!==i&&(o[e]=i)}for(let t in e)o[t]=e[t]}),l&&(d&&!1!==u&&!A(d)&&tN(t,d,t=>{for(let e in t)!function(t,e){let i=tU(e);i&&tI(t,i)}(a,e)}),a.length&&(o.willChange=a.join(","))),o}(n,r,o,!a&&t,e),renderState:i()};return s&&(l.mount=t=>s(n,t,l)),l})(t,e,s,n,i);return i?r():function(t){let e=(0,o.useRef)(null);return null===e.current&&(e.current=t()),e.current}(r)};function tN(t,e,i){let s=Array.isArray(e)?e:[e];for(let e=0;et,{schedule:tH,cancel:tY,state:tX,steps:tK}=g("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:tz,!0),tG={useVisualState:tW({scrapeMotionValuesFromProps:tR,createRenderState:tS,onMount:(t,e,{renderState:i,latestValues:s})=>{tH.read(()=>{try{i.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){i.dimensions={x:0,y:0,width:0,height:0}}}),tH.render(()=>{tb(i,s,tA(e.tagName),t.transformTemplate),tM(e,i)})}})},tq={useVisualState:tW({applyWillChange:!0,scrapeMotionValuesFromProps:tE,createRenderState:tf})};function t_(t,e,i,s={passive:!0}){return t.addEventListener(e,i,s),()=>t.removeEventListener(e,i)}let tZ=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function tJ(t,e="page"){return{point:{x:t[`${e}X`],y:t[`${e}Y`]}}}let tQ=t=>e=>tZ(e)&&t(e,tJ(e));function t0(t,e,i,s){return t_(t,e,tQ(i),s)}let t1=(t,e)=>i=>e(t(i)),t5=(...t)=>t.reduce(t1);function t2(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}let t3=t2("dragHorizontal"),t9=t2("dragVertical");function t6(t){let e=!1;if("y"===t)e=t9();else if("x"===t)e=t3();else{let t=t3(),i=t9();t&&i?e=()=>{t(),i()}:(t&&t(),i&&i())}return e}function t4(){let t=t6(!0);return!t||(t(),!1)}class t8{constructor(t){this.isMounted=!1,this.node=t}update(){}}function t7(t,e){let i=e?"onHoverStart":"onHoverEnd";return t0(t.current,e?"pointerenter":"pointerleave",(s,n)=>{if("touch"===s.pointerType||t4())return;let r=t.getProps();t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",e);let o=r[i];o&&tH.postRender(()=>o(s,n))},{passive:!t.getProps()[i]})}class et extends t8{mount(){this.unmount=t5(t7(this.node,!0),t7(this.node,!1))}unmount(){}}class ee extends t8{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=t5(t_(this.node.current,"focus",()=>this.onFocus()),t_(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}let ei=(t,e)=>!!e&&(t===e||ei(t,e.parentElement));function es(t,e){if(!e)return;let i=new PointerEvent("pointer"+t);e(i,tJ(i))}class en extends t8{constructor(){super(...arguments),this.removeStartListeners=tz,this.removeEndListeners=tz,this.removeAccessibleListeners=tz,this.startPointerPress=(t,e)=>{if(this.isPressing)return;this.removeEndListeners();let i=this.node.getProps(),s=t0(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;let{onTap:i,onTapCancel:s,globalTapTarget:n}=this.node.getProps(),r=n||ei(this.node.current,t.target)?i:s;r&&tH.update(()=>r(t,e))},{passive:!(i.onTap||i.onPointerUp)}),n=t0(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(i.onTapCancel||i.onPointerCancel)});this.removeEndListeners=t5(s,n),this.startPress(t,e)},this.startAccessiblePress=()=>{let t=t_(this.node.current,"keydown",t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=t_(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&es("up",(t,e)=>{let{onTap:i}=this.node.getProps();i&&tH.postRender(()=>i(t,e))})}),es("down",(t,e)=>{this.startPress(t,e)}))}),e=t_(this.node.current,"blur",()=>{this.isPressing&&es("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=t5(t,e)}}startPress(t,e){this.isPressing=!0;let{onTapStart:i,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),i&&tH.postRender(()=>i(t,e))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!t4()}cancelPress(t,e){if(!this.checkPressEnd())return;let{onTapCancel:i}=this.node.getProps();i&&tH.postRender(()=>i(t,e))}mount(){let t=this.node.getProps(),e=t0(t.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),i=t_(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=t5(e,i)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}let er=new WeakMap,eo=new WeakMap,ea=t=>{let e=er.get(t.target);e&&e(t)},el=t=>{t.forEach(ea)},eh={some:0,all:1};class eu extends t8{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:t={}}=this.node.getProps(),{root:e,margin:i,amount:s="some",once:n}=t,r={root:e?e.current:void 0,rootMargin:i,threshold:"number"==typeof s?s:eh[s]};return function(t,e,i){let s=function({root:t,...e}){let i=t||document;eo.has(i)||eo.set(i,{});let s=eo.get(i),n=JSON.stringify(e);return s[n]||(s[n]=new IntersectionObserver(el,{root:t,...e})),s[n]}(e);return er.set(t,i),s.observe(t),()=>{er.delete(t),s.unobserve(t)}}(this.node.current,r,t=>{let{isIntersecting:e}=t;if(this.isInView===e||(this.isInView=e,n&&!e&&this.hasEnteredView))return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);let{onViewportEnter:i,onViewportLeave:s}=this.node.getProps(),r=e?i:s;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return i=>t[i]!==e[i]}(t,e))&&this.startObserver()}unmount(){}}function ed(t,e){if(!Array.isArray(e))return!1;let i=e.length;if(i!==t.length)return!1;for(let s=0;s1e3*t,em=t=>t/1e3,ef={type:"spring",stiffness:500,damping:25,restSpeed:10},ev=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),eg={type:"keyframes",duration:.8},ey={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ex=(t,{keyframes:e})=>e.length>2?eg:I.has(t)?t.startsWith("scale")?ev(e[1]):ef:ey;function eP(t,e){return t[e]||t.default||t}let ew={current:!1},eT=t=>null!==t;function eb(t,{repeat:e,repeatType:i="loop"},s){let n=t.filter(eT),r=e&&"loop"!==i&&e%2==1?0:n.length-1;return r&&void 0!==s?s:n[r]}let eS=t=>/^0[^.\s]+$/u.test(t),eA=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),eV=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,eC=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),eM=t=>t===H||t===te,eE=(t,e)=>parseFloat(t.split(", ")[e]),eR=(t,e)=>(i,{transform:s})=>{if("none"===s||!s)return 0;let n=s.match(/^matrix3d\((.+)\)$/u);if(n)return eE(n[1],e);{let e=s.match(/^matrix\((.+)\)$/u);return e?eE(e[1],t):0}},eD=new Set(["x","y","z"]),ek=U.filter(t=>!eD.has(t)),ej={width:({x:t},{paddingLeft:e="0",paddingRight:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),height:({y:t},{paddingTop:e="0",paddingBottom:i="0"})=>t.max-t.min-parseFloat(e)-parseFloat(i),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:eR(4,13),y:eR(5,14)};ej.translateX=ej.x,ej.translateY=ej.y;let eL=t=>e=>e.test(t),eF=[H,te,tt,Q,ts,ti,{test:t=>"auto"===t,parse:t=>t}],eB=t=>eF.find(eL(t)),eO=new Set,eU=!1,eI=!1;function e$(){if(eI){let t=Array.from(eO).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),i=new Map;e.forEach(t=>{let e=function(t){let e=[];return ek.forEach(i=>{let s=t.getValue(i);void 0!==s&&(e.push([i,s.get()]),s.set(i.startsWith("scale")?1:0))}),e}(t);e.length&&(i.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();let e=i.get(t);e&&e.forEach(([e,i])=>{var s;null===(s=t.getValue(e))||void 0===s||s.set(i)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}eI=!1,eU=!1,eO.forEach(t=>t.complete()),eO.clear()}function eW(){eO.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(eI=!0)})}class eN{constructor(t,e,i,s,n,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=i,this.motionValue=s,this.element=n,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(eO.add(this),eU||(eU=!0,tH.read(eW),tH.resolveKeyframes(e$))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:e,element:i,motionValue:s}=this;for(let n=0;ni=>!!(Z(i)&&_.test(i)&&i.startsWith(t)||e&&null!=i&&Object.prototype.hasOwnProperty.call(i,e)),eH=(t,e,i)=>s=>{if(!Z(s))return s;let[n,r,o,a]=s.match(G);return{[t]:parseFloat(n),[e]:parseFloat(r),[i]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},eY=t=>z(0,255,t),eX={...H,transform:t=>Math.round(eY(t))},eK={test:ez("rgb","red"),parse:eH("red","green","blue"),transform:({red:t,green:e,blue:i,alpha:s=1})=>"rgba("+eX.transform(t)+", "+eX.transform(e)+", "+eX.transform(i)+", "+K(Y.transform(s))+")"},eG={test:ez("#"),parse:function(t){let e="",i="",s="",n="";return t.length>5?(e=t.substring(1,3),i=t.substring(3,5),s=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),i=t.substring(2,3),s=t.substring(3,4),n=t.substring(4,5),e+=e,i+=i,s+=s,n+=n),{red:parseInt(e,16),green:parseInt(i,16),blue:parseInt(s,16),alpha:n?parseInt(n,16)/255:1}},transform:eK.transform},eq={test:ez("hsl","hue"),parse:eH("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:i,alpha:s=1})=>"hsla("+Math.round(t)+", "+tt.transform(K(e))+", "+tt.transform(K(i))+", "+K(Y.transform(s))+")"},e_={test:t=>eK.test(t)||eG.test(t)||eq.test(t),parse:t=>eK.test(t)?eK.parse(t):eq.test(t)?eq.parse(t):eG.parse(t),transform:t=>Z(t)?t:t.hasOwnProperty("red")?eK.transform(t):eq.transform(t)},eZ="number",eJ="color",eQ=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function e0(t){let e=t.toString(),i=[],s={color:[],number:[],var:[]},n=[],r=0,o=e.replace(eQ,t=>(e_.test(t)?(s.color.push(r),n.push(eJ),i.push(e_.parse(t))):t.startsWith("var(")?(s.var.push(r),n.push("var"),i.push(t)):(s.number.push(r),n.push(eZ),i.push(parseFloat(t))),++r,"${}")).split("${}");return{values:i,split:o,indexes:s,types:n}}function e1(t){return e0(t).values}function e5(t){let{split:e,types:i}=e0(t),s=e.length;return t=>{let n="";for(let r=0;r"number"==typeof t?0:t,e3={test:function(t){var e,i;return isNaN(t)&&Z(t)&&((null===(e=t.match(G))||void 0===e?void 0:e.length)||0)+((null===(i=t.match(q))||void 0===i?void 0:i.length)||0)>0},parse:e1,createTransformer:e5,getAnimatableNone:function(t){let e=e1(t);return e5(t)(e.map(e2))}},e9=new Set(["brightness","contrast","saturate","opacity"]);function e6(t){let[e,i]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;let[s]=i.match(G)||[];if(!s)return t;let n=i.replace(s,""),r=e9.has(e)?1:0;return s!==i&&(r*=100),e+"("+r+n+")"}let e4=/\b([a-z-]*)\(.*?\)/gu,e8={...e3,getAnimatableNone:t=>{let e=t.match(e4);return e?e.map(e6).join(" "):t}},e7={...to,color:e_,backgroundColor:e_,outlineColor:e_,fill:e_,stroke:e_,borderColor:e_,borderTopColor:e_,borderRightColor:e_,borderBottomColor:e_,borderLeftColor:e_,filter:e8,WebkitFilter:e8},it=t=>e7[t];function ie(t,e){let i=it(t);return i!==e8&&(i=e3),i.getAnimatableNone?i.getAnimatableNone(e):void 0}let ii=new Set(["auto","none","0"]);class is extends eN{constructor(t,e,i,s,n){super(t,e,i,s,n,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:e,name:i}=this;if(!e||!e.current)return;super.readKeyframes();for(let i=0;i{e.getValue(t).set(i)}),this.resolveNoneKeyframes()}}function ir(t){let e;return()=>(void 0===e&&(e=t()),e)}function io(){s=void 0}let ia={now:()=>(void 0===s&&ia.set(tX.isProcessing||f.useManualTiming?tX.timestamp:performance.now()),s),set:t=>{s=t,queueMicrotask(io)}},il=(t,e)=>"zIndex"!==e&&!!("number"==typeof t||Array.isArray(t)||"string"==typeof t&&(e3.test(t)||"0"===t)&&!t.startsWith("url("));class ih{constructor({autoplay:t=!0,delay:e=0,type:i="keyframes",repeat:s=0,repeatDelay:n=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ia.now(),this.options={autoplay:t,delay:e,type:i,repeat:s,repeatDelay:n,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return this._resolved||this.hasAttemptedResolve||(eW(),e$()),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=ia.now(),this.hasAttemptedResolve=!0;let{name:i,type:s,velocity:n,delay:r,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(t,e,i,s){let n=t[0];if(null===n)return!1;if("display"===e||"visibility"===e)return!0;let r=t[t.length-1],o=il(n,e),a=il(r,e);return tz(o===a,`You are trying to animate ${e} from "${n}" to "${r}". ${n} is not an animatable value - to enable this animation set ${n} to a value animatable to ${r} via the \`style\` property.`),!!o&&!!a&&(function(t){let e=t[0];if(1===t.length)return!0;for(let i=0;i{this.resolveFinishedPromise=t})}}function iu(t,e,i){var s,n;let r=Math.max(e-5,0);return s=i-t(r),(n=e-r)?1e3/n*s:0}function id(t,e){return t*Math.sqrt(1-e*e)}let ic=["duration","bounce"],ip=["stiffness","damping","mass"];function im(t,e){return e.some(e=>void 0!==t[e])}function iv({keyframes:t,restDelta:e,restSpeed:i,...s}){let n;let r=t[0],o=t[t.length-1],a={done:!1,value:r},{stiffness:l,damping:h,mass:u,duration:d,velocity:c,isResolvedFromDuration:p}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!im(t,ip)&&im(t,ic)){let i=function({duration:t=800,bounce:e=.25,velocity:i=0,mass:s=1}){let n,r;tz(t<=ep(10),"Spring duration must be 10 seconds or less");let o=1-e;o=z(.05,1,o),t=z(.01,10,em(t)),o<1?(n=e=>{let s=e*o,n=s*t;return .001-(s-i)/id(e,o)*Math.exp(-n)},r=e=>{let s=e*o*t,r=Math.pow(o,2)*Math.pow(e,2)*t,a=id(Math.pow(e,2),o);return(s*i+i-r)*Math.exp(-s)*(-n(e)+.001>0?-1:1)/a}):(n=e=>-.001+Math.exp(-e*t)*((e-i)*t+1),r=e=>t*t*(i-e)*Math.exp(-e*t));let a=function(t,e,i){let s=i;for(let i=1;i<12;i++)s-=t(s)/e(s);return s}(n,r,5/t);if(t=ep(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{let e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}(t);(e={...e,...i,mass:1}).isResolvedFromDuration=!0}return e}({...s,velocity:-em(s.velocity||0)}),m=c||0,f=h/(2*Math.sqrt(l*u)),v=o-r,g=em(Math.sqrt(l/u)),y=5>Math.abs(v);if(i||(i=y?.01:2),e||(e=y?.005:.5),f<1){let t=id(g,f);n=e=>o-Math.exp(-f*g*e)*((m+f*g*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}else if(1===f)n=t=>o-Math.exp(-g*t)*(v+(m+g*v)*t);else{let t=g*Math.sqrt(f*f-1);n=e=>{let i=Math.exp(-f*g*e),s=Math.min(t*e,300);return o-i*((m+f*g*v)*Math.sinh(s)+t*v*Math.cosh(s))/t}}return{calculatedDuration:p&&d||null,next:t=>{let s=n(t);if(p)a.done=t>=d;else{let r=0;f<1&&(r=0===t?ep(m):iu(n,t,s));let l=Math.abs(r)<=i,h=Math.abs(o-s)<=e;a.done=l&&h}return a.value=a.done?o:s,a}}}function ig({keyframes:t,velocity:e=0,power:i=.8,timeConstant:s=325,bounceDamping:n=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:h=.5,restSpeed:u}){let d,c;let p=t[0],m={done:!1,value:p},f=t=>void 0!==a&&tl,v=t=>void 0===a?l:void 0===l?a:Math.abs(a-t)-g*Math.exp(-t/s),w=t=>x+P(t),T=t=>{let e=P(t),i=w(t);m.done=Math.abs(e)<=h,m.value=m.done?x:i},b=t=>{f(m.value)&&(d=t,c=iv({keyframes:[m.value,v(m.value)],velocity:iu(w,t,m.value),damping:n,stiffness:r,restDelta:h,restSpeed:u}))};return b(0),{calculatedDuration:null,next:t=>{let e=!1;return(c||void 0!==d||(e=!0,T(t),b(t)),void 0!==d&&t>=d)?c.next(t-d):(e||T(t),m)}}}let iy=(t,e,i)=>(((1-3*i+3*e)*t+(3*i-6*e))*t+3*e)*t;function ix(t,e,i,s){if(t===e&&i===s)return tz;let n=e=>(function(t,e,i,s,n){let r,o;let a=0;do(r=iy(o=e+(i-e)/2,s,n)-t)>0?i=o:e=o;while(Math.abs(r)>1e-7&&++a<12);return o})(e,0,1,t,i);return t=>0===t||1===t?t:iy(n(t),e,s)}let iP=ix(.42,0,1,1),iw=ix(0,0,.58,1),iT=ix(.42,0,.58,1),ib=t=>Array.isArray(t)&&"number"!=typeof t[0],iS=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,iA=t=>e=>1-t(1-e),iV=t=>1-Math.sin(Math.acos(t)),iC=iA(iV),iM=iS(iV),iE=ix(.33,1.53,.69,.99),iR=iA(iE),iD=iS(iR),ik={linear:tz,easeIn:iP,easeInOut:iT,easeOut:iw,circIn:iV,circInOut:iM,circOut:iC,backIn:iR,backInOut:iD,backOut:iE,anticipate:t=>(t*=2)<1?.5*iR(t):.5*(2-Math.pow(2,-10*(t-1)))},ij=t=>{if(Array.isArray(t)){tz(4===t.length,"Cubic bezier arrays must contain four numerical values.");let[e,i,s,n]=t;return ix(e,i,s,n)}return"string"==typeof t?(tz(void 0!==ik[t],`Invalid easing type '${t}'`),ik[t]):t},iL=(t,e,i)=>{let s=e-t;return 0===s?1:(i-t)/s},iF=(t,e,i)=>t+(e-t)*i;function iB(t,e,i){return(i<0&&(i+=1),i>1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function iO(t,e){return i=>i>0?e:t}let iU=(t,e,i)=>{let s=t*t,n=i*(e*e-s)+s;return n<0?0:Math.sqrt(n)},iI=[eG,eK,eq],i$=t=>iI.find(e=>e.test(t));function iW(t){let e=i$(t);if(tz(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let i=e.parse(t);return e===eq&&(i=function({hue:t,saturation:e,lightness:i,alpha:s}){t/=360,i/=100;let n=0,r=0,o=0;if(e/=100){let s=i<.5?i*(1+e):i+e-i*e,a=2*i-s;n=iB(a,s,t+1/3),r=iB(a,s,t),o=iB(a,s,t-1/3)}else n=r=o=i;return{red:Math.round(255*n),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(i)),i}let iN=(t,e)=>{let i=iW(t),s=iW(e);if(!i||!s)return iO(t,e);let n={...i};return t=>(n.red=iU(i.red,s.red,t),n.green=iU(i.green,s.green,t),n.blue=iU(i.blue,s.blue,t),n.alpha=iF(i.alpha,s.alpha,t),eK.transform(n))},iz=new Set(["none","hidden"]);function iH(t,e){return i=>iF(t,e,i)}function iY(t){return"number"==typeof t?iH:"string"==typeof t?tc(t)?iO:e_.test(t)?iN:iG:Array.isArray(t)?iX:"object"==typeof t?e_.test(t)?iN:iK:iO}function iX(t,e){let i=[...t],s=i.length,n=t.map((t,i)=>iY(t)(t,e[i]));return t=>{for(let e=0;e{for(let e in s)i[e]=s[e](t);return i}}let iG=(t,e)=>{let i=e3.createTransformer(e),s=e0(t),n=e0(e);return s.indexes.var.length===n.indexes.var.length&&s.indexes.color.length===n.indexes.color.length&&s.indexes.number.length>=n.indexes.number.length?iz.has(t)&&!n.values.length||iz.has(e)&&!s.values.length?iz.has(t)?i=>i<=0?t:e:i=>i>=1?e:t:t5(iX(function(t,e){var i;let s=[],n={color:0,var:0,number:0};for(let r=0;re[0];if(2===r&&t[0]===t[1])return()=>e[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());let o=function(t,e,i){let s=[],n=i||iq,r=t.length-1;for(let i=0;i{let i=0;if(a>1)for(;il(z(t[0],t[r-1],e)):l}((i&&i.length===e.length?i:function(t){let e=[0];return function(t,e){let i=t[t.length-1];for(let s=1;s<=e;s++){let n=iL(0,e,s);t.push(iF(i,1,n))}}(e,t.length-1),e}(e)).map(e=>e*t),e,{ease:Array.isArray(n)?n:e.map(()=>n||iT).splice(0,e.length-1)});return{calculatedDuration:t,next:e=>(r.value=o(e),r.done=e>=t,r)}}let iZ=t=>{let e=({timestamp:e})=>t(e);return{start:()=>tH.update(e,!0),stop:()=>tY(e),now:()=>tX.isProcessing?tX.timestamp:ia.now()}},iJ={decay:ig,inertia:ig,tween:i_,keyframes:i_,spring:iv},iQ=t=>t/100;class i0 extends ih{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();let{onStop:t}=this.options;t&&t()};let{name:e,motionValue:i,element:s,keyframes:n}=this.options,r=(null==s?void 0:s.KeyframeResolver)||eN;this.resolver=new r(n,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}initPlayback(t){let e,i;let{type:s="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:o,velocity:a=0}=this.options,l=iJ[s]||i_;l!==i_&&"number"!=typeof t[0]&&(e=t5(iQ,iq(t[0],t[1])),t=[0,100]);let h=l({...this.options,keyframes:t});"mirror"===o&&(i=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),null===h.calculatedDuration&&(h.calculatedDuration=function(t){let e=0,i=t.next(e);for(;!i.done&&e<2e4;)e+=50,i=t.next(e);return e>=2e4?1/0:e}(h));let{calculatedDuration:u}=h,d=u+r;return{generator:h,mirroredGenerator:i,mapPercentToKeyframes:e,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){let{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){let{resolved:i}=this;if(!i){let{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}let{finalKeyframe:s,generator:n,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:h,resolvedDuration:u}=i;if(null===this.startTime)return n.next(0);let{delay:d,repeat:c,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-h/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;let v=this.currentTime-d*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>h;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=h);let y=this.currentTime,x=n;if(c){let t=Math.min(this.currentTime,h)/u,e=Math.floor(t),i=t%1;!i&&t>=1&&(i=1),1===i&&e--,(e=Math.min(e,c+1))%2&&("reverse"===p?(i=1-i,m&&(i-=m/u)):"mirror"===p&&(x=r)),y=z(0,1,i)*u}let P=g?{done:!1,value:a[0]}:x.next(y);o&&(P.value=o(P.value));let{done:w}=P;g||null===l||(w=this.speed>=0?this.currentTime>=h:this.currentTime<=0);let T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return T&&void 0!==s&&(P.value=eb(a,this.options,s)),f&&f(P.value),T&&this.finish(),P}get duration(){let{resolved:t}=this;return t?em(t.calculatedDuration):0}get time(){return em(this.currentTime)}set time(t){t=ep(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){let e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=em(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:t=iZ,onPlay:e,startTime:i}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),e&&e();let s=this.driver.now();null!==this.holdTime?this.startTime=s-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=s):this.startTime=null!=i?i:this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}let i1=t=>Array.isArray(t)&&"number"==typeof t[0],i5=([t,e,i,s])=>`cubic-bezier(${t}, ${e}, ${i}, ${s})`,i2={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:i5([0,.65,.55,1]),circOut:i5([.55,0,1,.45]),backIn:i5([.31,.01,.66,-.59]),backOut:i5([.33,1.53,.69,.99])};function i3(t){return i9(t)||i2.easeOut}function i9(t){if(t)return i1(t)?i5(t):Array.isArray(t)?t.map(i3):i2[t]}let i6=ir(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class i4 extends ih{constructor(t){super(t);let{name:e,motionValue:i,element:s,keyframes:n}=this.options;this.resolver=new is(n,(t,e)=>this.onKeyframesResolved(t,e),e,i,s),this.resolver.scheduleResolve()}initPlayback(t,e){var i,s;let{duration:n=300,times:r,ease:o,type:a,motionValue:l,name:h,startTime:u}=this.options;if(!(null===(i=l.owner)||void 0===i?void 0:i.current))return!1;if("spring"===(s=this.options).type||!function t(e){return!!(!e||"string"==typeof e&&e in i2||i1(e)||Array.isArray(e)&&e.every(t))}(s.ease)){let{onComplete:e,onUpdate:i,motionValue:s,element:l,...h}=this.options,u=function(t,e){let i=new i0({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0}),s={done:!1,value:t[0]},n=[],r=0;for(;!s.done&&r<2e4;)n.push((s=i.sample(r)).value),r+=10;return{times:void 0,keyframes:n,duration:r-10,ease:"linear"}}(t,h);1===(t=u.keyframes).length&&(t[1]=t[0]),n=u.duration,r=u.times,o=u.ease,a="keyframes"}let d=function(t,e,i,{delay:s=0,duration:n=300,repeat:r=0,repeatType:o="loop",ease:a,times:l}={}){let h={[e]:i};l&&(h.offset=l);let u=i9(a);return Array.isArray(u)&&(h.easing=u),t.animate(h,{delay:s,duration:n,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}(l.owner.current,h,t,{...this.options,duration:n,times:r,ease:o});return d.startTime=null!=u?u:this.calcStartTime(),this.pendingTimeline?(d.timeline=this.pendingTimeline,this.pendingTimeline=void 0):d.onfinish=()=>{let{onComplete:i}=this.options;l.set(eb(t,this.options,e)),i&&i(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:n,times:r,type:a,ease:o,keyframes:t}}get duration(){let{resolved:t}=this;if(!t)return 0;let{duration:e}=t;return em(e)}get time(){let{resolved:t}=this;if(!t)return 0;let{animation:e}=t;return em(e.currentTime||0)}set time(t){let{resolved:e}=this;if(!e)return;let{animation:i}=e;i.currentTime=ep(t)}get speed(){let{resolved:t}=this;if(!t)return 1;let{animation:e}=t;return e.playbackRate}set speed(t){let{resolved:e}=this;if(!e)return;let{animation:i}=e;i.playbackRate=t}get state(){let{resolved:t}=this;if(!t)return"idle";let{animation:e}=t;return e.playState}get startTime(){let{resolved:t}=this;if(!t)return null;let{animation:e}=t;return e.startTime}attachTimeline(t){if(this._resolved){let{resolved:e}=this;if(!e)return tz;let{animation:i}=e;i.timeline=t,i.onfinish=null}else this.pendingTimeline=t;return tz}play(){if(this.isStopped)return;let{resolved:t}=this;if(!t)return;let{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){let{resolved:t}=this;if(!t)return;let{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:t}=this;if(!t)return;let{animation:e,keyframes:i,duration:s,type:n,ease:r,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){let{motionValue:t,onUpdate:e,onComplete:a,element:l,...h}=this.options,u=new i0({...h,keyframes:i,duration:s,type:n,ease:r,times:o,isGenerator:!0}),d=ep(this.time);t.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}let{onStop:a}=this.options;a&&a(),this.cancel()}complete(){let{resolved:t}=this;t&&t.animation.finish()}cancel(){let{resolved:t}=this;t&&t.animation.cancel()}static supports(t){let{motionValue:e,name:i,repeatDelay:s,repeatType:n,damping:r,type:o}=t;return i6()&&i&&tO.has(i)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!s&&"mirror"!==n&&0!==r&&"inertia"!==o}}let i8=ir(()=>void 0!==window.ScrollTimeline);class i7{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let i=0;i{if(!i8()||!e.attachTimeline)return e.pause(),function(t,e){let i;let s=()=>{let{currentTime:s}=e,n=(null===s?0:s.value)/100;i!==n&&t(n),i=n};return tH.update(s,!0),()=>tY(s)}(t=>{e.time=e.duration*t},t);e.attachTimeline(t)});return()=>{e.forEach((t,e)=>{t&&t(),this.animations[e].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;ee[t]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}let st=(t,e,i,s={},n,r,o)=>a=>{let l=eP(s,t)||{},h=l.delay||s.delay||0,{elapsed:u=0}=s;u-=ep(h);let d={keyframes:Array.isArray(i)?i:[null,i],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:t=>{e.set(t),l.onUpdate&&l.onUpdate(t)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),o&&o()},onStop:o,name:t,motionValue:e,element:r?void 0:n};!function({when:t,delay:e,delayChildren:i,staggerChildren:s,staggerDirection:n,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length}(l)&&(d={...d,...ex(t,d)}),d.duration&&(d.duration=ep(d.duration)),d.repeatDelay&&(d.repeatDelay=ep(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let c=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(d.duration=0,0!==d.delay||(c=!0)),(ew.current||f.skipAnimations)&&(c=!0,d.duration=0,d.delay=0),c&&!r&&void 0!==e.get()){let t=eb(d.keyframes,l);if(void 0!==t)return tH.update(()=>{d.onUpdate(t),d.onComplete()}),new i7([])}return!r&&i4.supports(d)?new i4(d):new i0(d)};class se{constructor(){this.subscriptions=[]}add(t){return tI(this.subscriptions,t),()=>t$(this.subscriptions,t)}notify(t,e,i){let s=this.subscriptions.length;if(s){if(1===s)this.subscriptions[0](t,e,i);else for(let n=0;n!isNaN(parseFloat(t)),ss={current:void 0};class sn{constructor(t,e={}){this.version="11.3.30",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{let i=ia.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=ia.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=si(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new se);let i=this.events[t].add(e);return"change"===t?()=>{i(),tH.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,i){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return ss.current&&ss.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){var t;let e=ia.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let i=Math.min(this.updatedAt-this.prevUpdatedAt,30);return t=parseFloat(this.current)-parseFloat(this.prevFrameValue),i?1e3/i*t:0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function sr(t,e){return new sn(t,e)}function so(t){return t.getProps()[m]}class sa extends sn{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(t){let e=tU(t);if(!e)return;let i=this.counts.get(e)||0;this.counts.set(e,i+1),0===i&&(this.output.push(e),this.update());let s=!1;return()=>{if(s)return;s=!0;let t=this.counts.get(e)-1;this.counts.set(e,t),0===t&&(t$(this.output,e),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function sl(t,e){var i,s;if(!t.applyWillChange)return;let n=t.getValue("willChange");if(n||(null===(i=t.props.style)||void 0===i?void 0:i.willChange)||(n=new sa("auto"),t.addValue("willChange",n)),W(s=n)&&s.add)return n.add(e)}function sh(t,e,{delay:i=0,transitionOverride:s,type:n}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(o=s);let h=[],u=n&&t.animationState&&t.animationState.getState()[n];for(let e in l){let s=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),n=l[e];if(void 0===n||u&&function({protectedKeys:t,needsAnimating:e},i){let s=t.hasOwnProperty(i)&&!0!==e[i];return e[i]=!1,s}(u,e))continue;let a={delay:i,...eP(o||{},e)},d=!1;if(window.MotionHandoffAnimation){let i=so(t);if(i){let t=window.MotionHandoffAnimation(i,e,tH);null!==t&&(a.startTime=t,d=!0)}}s.start(st(e,s,n,t.shouldReduceMotion&&I.has(e)?{type:!1}:a,t,d,sl(t,e)));let c=s.animation;c&&h.push(c)}return a&&Promise.all(h).then(()=>{tH.update(()=>{a&&function(t,e){let{transitionEnd:i={},transition:s={},...n}=ec(t,e)||{};for(let e in n={...n,...i}){let i=tF(n[e]);t.hasValue(e)?t.getValue(e).set(i):t.addValue(e,sr(i))}}(t,a)})}),h}function su(t,e,i={}){var s;let n=ec(t,e,"exit"===i.type?null===(s=t.presenceContext)||void 0===s?void 0:s.custom:void 0),{transition:r=t.getDefaultTransition()||{}}=n||{};i.transitionOverride&&(r=i.transitionOverride);let o=n?()=>Promise.all(sh(t,n,i)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(s=0)=>{let{delayChildren:n=0,staggerChildren:o,staggerDirection:a}=r;return function(t,e,i=0,s=0,n=1,r){let o=[],a=(t.variantChildren.size-1)*s,l=1===n?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(sd).forEach((t,s)=>{t.notify("AnimationStart",e),o.push(su(t,e,{...r,delay:i+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,n+s,o,a,i)}:()=>Promise.resolve(),{when:l}=r;if(!l)return Promise.all([o(),a(i.delay)]);{let[t,e]="beforeChildren"===l?[o,a]:[a,o];return t().then(()=>e())}}function sd(t,e){return t.sortNodePosition(e)}let sc=[...V].reverse(),sp=V.length;function sm(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function sf(){return{animate:sm(!0),whileInView:sm(),whileHover:sm(),whileTap:sm(),whileDrag:sm(),whileFocus:sm(),exit:sm()}}class sv extends t8{constructor(t){super(t),t.animationState||(t.animationState=function(t){let e=e=>Promise.all(e.map(({animation:e,options:i})=>(function(t,e,i={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e))s=Promise.all(e.map(e=>su(t,e,i)));else if("string"==typeof e)s=su(t,e,i);else{let n="function"==typeof e?ec(t,e,i.custom):e;s=Promise.all(sh(t,n,i))}return s.then(()=>{t.notify("AnimationComplete",e)})})(t,e,i))),i=sf(),s=!0,n=e=>(i,s)=>{var n;let r=ec(t,s,"exit"===e?null===(n=t.presenceContext)||void 0===n?void 0:n.custom:void 0);if(r){let{transition:t,transitionEnd:e,...s}=r;i={...i,...s,...e}}return i};function r(r){let o=t.getProps(),a=t.getVariantContext(!0)||{},l=[],h=new Set,u={},d=1/0;for(let e=0;ed&&v),P=!1,w=Array.isArray(f)?f:[f],T=w.reduce(n(p),{});!1===g&&(T={});let{prevResolvedValues:b={}}=m,V={...b,...T},C=e=>{x=!0,h.has(e)&&(P=!0,h.delete(e)),m.needsAnimating[e]=!0;let i=t.getValue(e);i&&(i.liveStyle=!1)};for(let t in V){let e=T[t],i=b[t];if(!u.hasOwnProperty(t))(tj(e)&&tj(i)?ed(e,i):e===i)?void 0!==e&&h.has(t)?C(t):m.protectedKeys[t]=!0:null!=e?C(t):h.add(t)}m.prevProp=f,m.prevResolvedValues=T,m.isActive&&(u={...u,...T}),s&&t.blockInitialAnimation&&(x=!1),x&&(!y||P)&&l.push(...w.map(t=>({animation:t,options:{type:p}})))}if(h.size){let e={};h.forEach(i=>{let s=t.getBaseTarget(i),n=t.getValue(i);n&&(n.liveStyle=!0),e[i]=null!=s?s:null}),l.push({animation:e})}let p=!!l.length;return s&&(!1===o.initial||o.initial===o.animate)&&!t.manuallyAnimateOnMount&&(p=!1),s=!1,p?e(l):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){var n;if(i[e].isActive===s)return Promise.resolve();null===(n=t.variantChildren)||void 0===n||n.forEach(t=>{var i;return null===(i=t.animationState)||void 0===i?void 0:i.setActive(e,s)}),i[e].isActive=s;let o=r(e);for(let t in i)i[t].protectedKeys={};return o},setAnimateFunction:function(i){e=i(t)},getState:()=>i,reset:()=>{i=sf(),s=!0}}}(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();A(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),null===(t=this.unmountControls)||void 0===t||t.call(this)}}let sg=0;class sy extends t8{constructor(){super(...arguments),this.id=sg++}update(){if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;let s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>e(this.id))}mount(){let{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}let sx=(t,e)=>Math.abs(t-e);class sP{constructor(t,e,{transformPagePoint:i,contextWindow:s,dragSnapToOrigin:n=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{var t,e;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let i=sb(this.lastMoveEventInfo,this.history),s=null!==this.startEvent,n=(t=i.offset,e={x:0,y:0},Math.sqrt(sx(t.x,e.x)**2+sx(t.y,e.y)**2)>=3);if(!s&&!n)return;let{point:r}=i,{timestamp:o}=tX;this.history.push({...r,timestamp:o});let{onStart:a,onMove:l}=this.handlers;s||(a&&a(this.lastMoveEvent,i),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,i)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=sw(e,this.transformPagePoint),tH.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();let{onEnd:i,onSessionEnd:s,resumeAnimation:n}=this.handlers;if(this.dragSnapToOrigin&&n&&n(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=sb("pointercancel"===t.type?this.lastMoveEventInfo:sw(e,this.transformPagePoint),this.history);this.startEvent&&i&&i(t,r),s&&s(t,r)},!tZ(t))return;this.dragSnapToOrigin=n,this.handlers=e,this.transformPagePoint=i,this.contextWindow=s||window;let r=sw(tJ(t),this.transformPagePoint),{point:o}=r,{timestamp:a}=tX;this.history=[{...o,timestamp:a}];let{onSessionStart:l}=e;l&&l(t,sb(r,this.history)),this.removeListeners=t5(t0(this.contextWindow,"pointermove",this.handlePointerMove),t0(this.contextWindow,"pointerup",this.handlePointerUp),t0(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),tY(this.updatePoint)}}function sw(t,e){return e?{point:e(t.point)}:t}function sT(t,e){return{x:t.x-e.x,y:t.y-e.y}}function sb({point:t},e){return{point:t,delta:sT(t,sS(e)),offset:sT(t,e[0]),velocity:function(t,e){if(t.length<2)return{x:0,y:0};let i=t.length-1,s=null,n=sS(t);for(;i>=0&&(s=t[i],!(n.timestamp-s.timestamp>ep(.1)));)i--;if(!s)return{x:0,y:0};let r=em(n.timestamp-s.timestamp);if(0===r)return{x:0,y:0};let o={x:(n.x-s.x)/r,y:(n.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}(e,0)}}function sS(t){return t[t.length-1]}function sA(t){return t.max-t.min}function sV(t,e,i,s=.5){t.origin=s,t.originPoint=iF(e.min,e.max,t.origin),t.scale=sA(i)/sA(e),t.translate=iF(i.min,i.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function sC(t,e,i,s){sV(t.x,e.x,i.x,s?s.originX:void 0),sV(t.y,e.y,i.y,s?s.originY:void 0)}function sM(t,e,i){t.min=i.min+e.min,t.max=t.min+sA(e)}function sE(t,e,i){t.min=e.min-i.min,t.max=t.min+sA(e)}function sR(t,e,i){sE(t.x,e.x,i.x),sE(t.y,e.y,i.y)}function sD(t,e,i){return{min:void 0!==e?t.min+e:void 0,max:void 0!==i?t.max+i-(t.max-t.min):void 0}}function sk(t,e){let i=e.min-t.min,s=e.max-t.max;return e.max-e.min({translate:0,scale:1,origin:0,originPoint:0}),sB=()=>({x:sF(),y:sF()}),sO=()=>({min:0,max:0}),sU=()=>({x:sO(),y:sO()});function sI(t){return[t("x"),t("y")]}function s$({top:t,left:e,right:i,bottom:s}){return{x:{min:e,max:i},y:{min:t,max:s}}}function sW(t){return void 0===t||1===t}function sN({scale:t,scaleX:e,scaleY:i}){return!sW(t)||!sW(e)||!sW(i)}function sz(t){return sN(t)||sH(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function sH(t){var e,i;return(e=t.x)&&"0%"!==e||(i=t.y)&&"0%"!==i}function sY(t,e,i,s,n){return void 0!==n&&(t=s+n*(t-s)),s+i*(t-s)+e}function sX(t,e=0,i=1,s,n){t.min=sY(t.min,e,i,s,n),t.max=sY(t.max,e,i,s,n)}function sK(t,{x:e,y:i}){sX(t.x,e.translate,e.scale,e.originPoint),sX(t.y,i.translate,i.scale,i.originPoint)}function sG(t,e){t.min=t.min+e,t.max=t.max+e}function sq(t,e,i,s,n=.5){let r=iF(t.min,t.max,n);sX(t,e,i,r,s)}function s_(t,e){sq(t.x,e.x,e.scaleX,e.scale,e.originX),sq(t.y,e.y,e.scaleY,e.scale,e.originY)}function sZ(t,e){return s$(function(t,e){if(!e)return t;let i=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:i.y,left:i.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}let sJ=({current:t})=>t?t.ownerDocument.defaultView:null,sQ=new WeakMap;class s0{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=sU(),this.visualElement=t}start(t,{snapToCursor:e=!1}={}){let{presenceContext:i}=this.visualElement;if(i&&!1===i.isPresent)return;let{dragSnapToOrigin:s}=this.getProps();this.panSession=new sP(t,{onSessionStart:t=>{let{dragSnapToOrigin:i}=this.getProps();i?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(tJ(t,"page").point)},onStart:(t,e)=>{var i;let{drag:s,dragPropagation:n,onDragStart:r}=this.getProps();if(s&&!n&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=t6(s),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),sI(t=>{let e=this.getAxisMotionValue(t).get()||0;if(tt.test(e)){let{projection:i}=this.visualElement;if(i&&i.layout){let s=i.layout.layoutBox[t];if(s){let t=sA(s);e=parseFloat(e)/100*t}}}this.originPoint[t]=e}),r&&tH.postRender(()=>r(t,e)),null===(i=this.removeWillChange)||void 0===i||i.call(this),this.removeWillChange=sl(this.visualElement,"transform");let{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{let{dragPropagation:i,dragDirectionLock:s,onDirectionLock:n,onDrag:r}=this.getProps();if(!i&&!this.openGlobalLock)return;let{offset:o}=e;if(s&&null===this.currentDirection){this.currentDirection=function(t,e=10){let i=null;return Math.abs(t.y)>e?i="y":Math.abs(t.x)>e&&(i="x"),i}(o),null!==this.currentDirection&&n&&n(this.currentDirection);return}this.updateAxis("x",e.point,o),this.updateAxis("y",e.point,o),this.visualElement.render(),r&&r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>sI(t=>{var e;return"paused"===this.getAnimationState(t)&&(null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:sJ(this.visualElement)})}stop(t,e){var i;null===(i=this.removeWillChange)||void 0===i||i.call(this);let s=this.isDragging;if(this.cancel(),!s)return;let{velocity:n}=e;this.startAnimation(n);let{onDragEnd:r}=this.getProps();r&&tH.postRender(()=>r(t,e))}cancel(){this.isDragging=!1;let{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:i}=this.getProps();!i&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,i){let{drag:s}=this.getProps();if(!i||!s1(t,s,this.currentDirection))return;let n=this.getAxisMotionValue(t),r=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:i},s){return void 0!==e&&ti&&(t=s?iF(i,t,s.max):Math.min(t,i)),t}(r,this.constraints[t],this.elastic[t])),n.set(r)}resolveConstraints(){var t;let{dragConstraints:e,dragElastic:i}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(t=this.visualElement.projection)||void 0===t?void 0:t.layout,n=this.constraints;e&&P(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=function(t,{top:e,left:i,bottom:s,right:n}){return{x:sD(t.x,i,n),y:sD(t.y,e,s)}}(s.layoutBox,e):this.constraints=!1,this.elastic=function(t=.35){return!1===t?t=0:!0===t&&(t=.35),{x:sj(t,"left","right"),y:sj(t,"top","bottom")}}(i),n!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&sI(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){let i={};return void 0!==e.min&&(i.min=e.min-t.min),void 0!==e.max&&(i.max=e.max-t.min),i}(s.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){var t;let{dragConstraints:e,onMeasureDragConstraints:i}=this.getProps();if(!e||!P(e))return!1;let s=e.current;tz(null!==s,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:n}=this.visualElement;if(!n||!n.layout)return!1;let r=function(t,e,i){let s=sZ(t,i),{scroll:n}=e;return n&&(sG(s.x,n.offset.x),sG(s.y,n.offset.y)),s}(s,n.root,this.visualElement.getTransformPagePoint()),o={x:sk((t=n.layout.layoutBox).x,r.x),y:sk(t.y,r.y)};if(i){let t=i(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=s$(t))}return o}startAnimation(t){let{drag:e,dragMomentum:i,dragElastic:s,dragTransition:n,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{};return Promise.all(sI(o=>{if(!s1(o,e,this.currentDirection))return;let l=a&&a[o]||{};r&&(l={min:0,max:0});let h={type:"inertia",velocity:i?t[o]:0,bounceStiffness:s?200:1e6,bounceDamping:s?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...n,...l};return this.startAxisValueAnimation(o,h)})).then(o)}startAxisValueAnimation(t,e){let i=this.getAxisMotionValue(t);return i.start(st(t,i,0,e,this.visualElement,!1,sl(this.visualElement,t)))}stopAnimation(){sI(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){sI(t=>{var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.pause()})}getAnimationState(t){var e;return null===(e=this.getAxisMotionValue(t).animation)||void 0===e?void 0:e.state}getAxisMotionValue(t){let e=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps();return i[e]||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){sI(e=>{let{drag:i}=this.getProps();if(!s1(e,i,this.currentDirection))return;let{projection:s}=this.visualElement,n=this.getAxisMotionValue(e);if(s&&s.layout){let{min:i,max:r}=s.layout.layoutBox[e];n.set(t[e]-iF(i,r,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:e}=this.getProps(),{projection:i}=this.visualElement;if(!P(e)||!i||!this.constraints)return;this.stopAnimation();let s={x:0,y:0};sI(t=>{let e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){let i=e.get();s[t]=function(t,e){let i=.5,s=sA(t),n=sA(e);return n>s?i=iL(e.min,e.max-s,t.min):s>n&&(i=iL(t.min,t.max-n,e.min)),z(0,1,i)}({min:i,max:i},this.constraints[t])}});let{transformTemplate:n}=this.visualElement.getProps();this.visualElement.current.style.transform=n?n({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),sI(e=>{if(!s1(e,t,null))return;let i=this.getAxisMotionValue(e),{min:n,max:r}=this.constraints[e];i.set(iF(n,r,s[e]))})}addListeners(){if(!this.visualElement.current)return;sQ.set(this.visualElement,this);let t=t0(this.visualElement.current,"pointerdown",t=>{let{drag:e,dragListener:i=!0}=this.getProps();e&&i&&this.start(t)}),e=()=>{let{dragConstraints:t}=this.getProps();P(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",e);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),tH.read(e);let n=t_(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(sI(e=>{let i=this.getAxisMotionValue(e);i&&(this.originPoint[e]+=t[e].translate,i.set(i.get()+t[e].translate))}),this.visualElement.render())});return()=>{n(),t(),s(),r&&r()}}getProps(){let t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:i=!1,dragPropagation:s=!1,dragConstraints:n=!1,dragElastic:r=.35,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:i,dragPropagation:s,dragConstraints:n,dragElastic:r,dragMomentum:o}}}function s1(t,e,i){return(!0===e||e===t)&&(null===i||i===t)}class s5 extends t8{constructor(t){super(t),this.removeGroupControls=tz,this.removeListeners=tz,this.controls=new s0(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||tz}unmount(){this.removeGroupControls(),this.removeListeners()}}let s2=t=>(e,i)=>{t&&tH.postRender(()=>t(e,i))};class s3 extends t8{constructor(){super(...arguments),this.removePointerDownListener=tz}onPointerDown(t){this.session=new sP(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:sJ(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:e,onPan:i,onPanEnd:s}=this.node.getProps();return{onSessionStart:s2(t),onStart:s2(e),onMove:i,onEnd:(t,e)=>{delete this.session,s&&tH.postRender(()=>s(t,e))}}}mount(){this.removePointerDownListener=t0(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let s9={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function s6(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}let s4={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!te.test(t))return t;t=parseFloat(t)}let i=s6(t,e.target.x),s=s6(t,e.target.y);return`${i}% ${s}%`}};class s8 extends o.Component{componentDidMount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i,layoutId:s}=this.props,{projection:n}=t;Object.assign(O,nt),n&&(e.group&&e.group.add(n),i&&i.register&&s&&i.register(n),n.root.didUpdate(),n.addEventListener("animationComplete",()=>{this.safeToRemove()}),n.setOptions({...n.options,onExitComplete:()=>this.safeToRemove()})),s9.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:e,visualElement:i,drag:s,isPresent:n}=this.props,r=i.projection;return r&&(r.isPresent=n,s||t.layoutDependency!==e||void 0===e?r.willUpdate():this.safeToRemove(),t.isPresent===n||(n?r.promote():r.relegate()||tH.postRender(()=>{let t=r.getStack();t&&t.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),y.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:e,switchLayoutGroup:i}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),i&&i.deregister&&i.deregister(s))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}}function s7(t){let[e,i]=function(){let t=(0,o.useContext)(h);if(null===t)return[!0,null];let{isPresent:e,onExitComplete:i,register:s}=t,n=(0,o.useId)();(0,o.useEffect)(()=>s(n),[]);let r=(0,o.useCallback)(()=>i&&i(n),[n,i]);return!e&&i?[!1,r]:[!0]}(),s=(0,o.useContext)(j);return(0,r.jsx)(s8,{...t,layoutGroup:s,switchLayoutGroup:(0,o.useContext)(w),isPresent:e,safeToRemove:i})}let nt={borderRadius:{...s4,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:s4,borderTopRightRadius:s4,borderBottomLeftRadius:s4,borderBottomRightRadius:s4,boxShadow:{correct:(t,{treeScale:e,projectionDelta:i})=>{let s=e3.parse(t);if(s.length>5)return t;let n=e3.createTransformer(t),r="number"!=typeof s[0]?1:0,o=i.x.scale*e.x,a=i.y.scale*e.y;s[0+r]/=o,s[1+r]/=a;let l=iF(o,a,.5);return"number"==typeof s[2+r]&&(s[2+r]/=l),"number"==typeof s[3+r]&&(s[3+r]/=l),n(s)}}},ne=["TopLeft","TopRight","BottomLeft","BottomRight"],ni=ne.length,ns=t=>"string"==typeof t?parseFloat(t):t,nn=t=>"number"==typeof t||te.test(t);function nr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}let no=nl(0,.5,iC),na=nl(.5,.95,tz);function nl(t,e,i){return s=>se?1:i(iL(t,e,s))}function nh(t,e){t.min=e.min,t.max=e.max}function nu(t,e){nh(t.x,e.x),nh(t.y,e.y)}function nd(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function nc(t,e,i,s,n){return t-=e,t=s+1/i*(t-s),void 0!==n&&(t=s+1/n*(t-s)),t}function np(t,e,[i,s,n],r,o){!function(t,e=0,i=1,s=.5,n,r=t,o=t){if(tt.test(e)&&(e=parseFloat(e),e=iF(o.min,o.max,e/100)-o.min),"number"!=typeof e)return;let a=iF(r.min,r.max,s);t===r&&(a-=e),t.min=nc(t.min,e,i,a,n),t.max=nc(t.max,e,i,a,n)}(t,e[i],e[s],e[n],e.scale,r,o)}let nm=["x","scaleX","originX"],nf=["y","scaleY","originY"];function nv(t,e,i,s){np(t.x,e,nm,i?i.x:void 0,s?s.x:void 0),np(t.y,e,nf,i?i.y:void 0,s?s.y:void 0)}function ng(t){return 0===t.translate&&1===t.scale}function ny(t){return ng(t.x)&&ng(t.y)}function nx(t,e){return t.min===e.min&&t.max===e.max}function nP(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function nw(t,e){return nP(t.x,e.x)&&nP(t.y,e.y)}function nT(t){return sA(t.x)/sA(t.y)}function nb(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class nS{constructor(){this.members=[]}add(t){tI(this.members,t),t.scheduleRender()}remove(t){if(t$(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){let e;let i=this.members.findIndex(e=>t===e);if(0===i)return!1;for(let t=i;t>=0;t--){let i=this.members[t];if(!1!==i.isPresent){e=i;break}}return!!e&&(this.promote(e),!0)}promote(t,e){let i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);let{crossfade:s}=t.options;!1===s&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{let{options:e,resumingFrom:i}=t;e.onExitComplete&&e.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let nA=(t,e)=>t.depth-e.depth;class nV{constructor(){this.children=[],this.isDirty=!1}add(t){tI(this.children,t),this.isDirty=!0}remove(t){t$(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(nA),this.isDirty=!1,this.children.forEach(t)}}let nC={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},nM="undefined"!=typeof window&&void 0!==window.MotionDebug,nE=["","X","Y","Z"],nR={visibility:"hidden"},nD=0;function nk(t,e,i,s){let{latestValues:n}=e;n[t]&&(i[t]=n[t],e.setStaticValue(t,0),s&&(s[t]=0))}function nj({attachResizeListener:t,defaultParent:e,measureScroll:i,checkIsScrollRoot:s,resetTransform:n}){return class{constructor(t={},i=null==e?void 0:e()){this.id=nD++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,nM&&(nC.totalNodes=nC.resolvedTargetDeltas=nC.recalculatedProjection=0),this.nodes.forEach(nB),this.nodes.forEach(nz),this.nodes.forEach(nH),this.nodes.forEach(nO),nM&&window.MotionDebug.record(nC)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0;for(let t=0;tthis.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,i&&i(),i=function(t,e){let i=ia.now(),s=({timestamp:e})=>{let n=e-i;n>=250&&(tY(s),t(n-250))};return tH.read(s,!0),()=>tY(s)}(s,0),s9.hasAnimatedSinceResize&&(s9.hasAnimatedSinceResize=!1,this.nodes.forEach(nN))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||n)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:i,layout:s})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let n=this.options.transition||r.getDefaultTransition()||n_,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!nw(this.targetLayout,s)||i,h=!e&&i;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);let e={...eP(n,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||nN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,tY(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(nY),this.animationId++)}getTransformTemplate(){let{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedTransform&&!this.hasCheckedOptimisedAppear&&function t(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:i}=e.options;if(!i)return;let s=so(i);window.MotionHasOptimisedTransformAnimation(s)&&window.MotionCancelOptimisedTransform(s);let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&t(n)}(this),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t.999999999999&&(e.x=1),e.y<1.0000000000001&&e.y>.999999999999&&(e.y=1)}}(this.layoutCorrected,this.treeScale,this.path,i),e.layout&&!e.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=sU());let{target:l}=e;if(!l){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(nd(this.prevProjectionDelta.x,this.projectionDelta.x),nd(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),sC(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===o&&this.treeScale.y===a&&nb(this.projectionDelta.x,this.prevProjectionDelta.x)&&nb(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),nM&&nC.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e;if(null===(e=this.options.visualElement)||void 0===e||e.scheduleRender(),t){let t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=sB(),this.projectionDelta=sB(),this.projectionDeltaWithTransform=sB()}setAnimationOrigin(t,e=!1){let i;let s=this.snapshot,n=s?s.latestValues:{},r={...this.latestValues},o=sB();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;let a=sU(),l=(s?s.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,d=!!(l&&!u&&!0===this.options.crossfade&&!this.path.some(nq));this.animationProgress=0,this.mixTargetDelta=e=>{let s=e/1e3;if(nK(o.x,t.x,s),nK(o.y,t.y,s),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var h,c,p,m;sR(a,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,nG(p.x,m.x,a.x,s),nG(p.y,m.y,a.y,s),i&&(h=this.relativeTarget,c=i,nx(h.x,c.x)&&nx(h.y,c.y))&&(this.isProjectionDirty=!1),i||(i=sU()),nu(i,this.relativeTarget)}l&&(this.animationValues=r,function(t,e,i,s,n,r){n?(t.opacity=iF(0,void 0!==i.opacity?i.opacity:1,no(s)),t.opacityExit=iF(void 0!==e.opacity?e.opacity:1,0,na(s))):r&&(t.opacity=iF(void 0!==e.opacity?e.opacity:1,void 0!==i.opacity?i.opacity:1,s));for(let n=0;n{s9.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,i){let s=W(0)?0:sr(0);return s.start(st("",s,1e3,i)),s.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let t=this.getLead(),{targetWithTransforms:e,target:i,layout:s,latestValues:n}=t;if(e&&i&&s){if(this!==t&&this.layout&&s&&n0(this.options.animationType,this.layout.layoutBox,s.layoutBox)){i=this.target||sU();let e=sA(this.layout.layoutBox.x);i.x.min=t.target.x.min,i.x.max=i.x.min+e;let s=sA(this.layout.layoutBox.y);i.y.min=t.target.y.min,i.y.max=i.y.min+s}nu(e,i),s_(e,n),sC(this.projectionDeltaWithTransform,this.layoutCorrected,e,n)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new nS),this.sharedNodes.get(t).add(e);let i=e.options.initialPromotionConfig;e.promote({transition:i?i.transition:void 0,preserveFollowOpacity:i&&i.shouldPreserveFollowOpacity?i.shouldPreserveFollowOpacity(e):void 0})}isLead(){let t=this.getStack();return!t||t.lead===this}getLead(){var t;let{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;let{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){let{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:i}={}){let s=this.getStack();s&&s.promote(this,i),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){let t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){let{visualElement:t}=this.options;if(!t)return;let e=!1,{latestValues:i}=t;if((i.z||i.rotate||i.rotateX||i.rotateY||i.rotateZ||i.skewX||i.skewY)&&(e=!0),!e)return;let s={};i.z&&nk("z",t,s,this.animationValues);for(let e=0;e{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(nI),this.root.sharedNodes.clear()}}}function nL(t){t.updateLayout()}function nF(t){var e;let i=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&i&&t.hasListeners("didUpdate")){let{layoutBox:e,measuredBox:s}=t.layout,{animationType:n}=t.options,r=i.source!==t.layout.source;"size"===n?sI(t=>{let s=r?i.measuredBox[t]:i.layoutBox[t],n=sA(s);s.min=e[t].min,s.max=s.min+n}):n0(n,i.layoutBox,e)&&sI(s=>{let n=r?i.measuredBox[s]:i.layoutBox[s],o=sA(e[s]);n.max=n.min+o,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+o)});let o=sB();sC(o,e,i.layoutBox);let a=sB();r?sC(a,t.applyTransform(s,!0),i.measuredBox):sC(a,e,i.layoutBox);let l=!ny(o),h=!1;if(!t.resumeFrom){let s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){let{snapshot:n,layout:r}=s;if(n&&r){let o=sU();sR(o,i.layoutBox,n.layoutBox);let a=sU();sR(a,e,r.layoutBox),nw(o,a)||(h=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=o,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:i,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(t.isLead()){let{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function nB(t){nM&&nC.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function nO(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function nU(t){t.clearSnapshot()}function nI(t){t.clearMeasurements()}function n$(t){t.isLayoutDirty=!1}function nW(t){let{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function nN(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function nz(t){t.resolveTargetDelta()}function nH(t){t.calcProjection()}function nY(t){t.resetSkewAndRotation()}function nX(t){t.removeLeadSnapshot()}function nK(t,e,i){t.translate=iF(e.translate,0,i),t.scale=iF(e.scale,1,i),t.origin=e.origin,t.originPoint=e.originPoint}function nG(t,e,i,s){t.min=iF(e.min,i.min,s),t.max=iF(e.max,i.max,s)}function nq(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}let n_={duration:.45,ease:[.4,0,.1,1]},nZ=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),nJ=nZ("applewebkit/")&&!nZ("chrome/")?Math.round:tz;function nQ(t){t.min=nJ(t.min),t.max=nJ(t.max)}function n0(t,e,i){return"position"===t||"preserve-aspect"===t&&!(.2>=Math.abs(nT(e)-nT(i)))}function n1(t){var e;return t!==t.root&&(null===(e=t.scroll)||void 0===e?void 0:e.wasRoot)}let n5=nj({attachResizeListener:(t,e)=>t_(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),n2={current:void 0},n3=nj({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!n2.current){let t=new n5({});t.mount(window),t.setOptions({layoutScroll:!0}),n2.current=t}return n2.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>"fixed"===window.getComputedStyle(t).position}),n9={current:null},n6={current:!1},n4=new WeakMap,n8=[...eF,e_,e3],n7=t=>n8.find(eL(t)),rt=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],re=C.length;class ri{scrapeMotionValuesFromProps(t,e,i){return{}}constructor({parent:t,props:e,presenceContext:i,reducedMotionConfig:s,blockInitialAnimation:n,visualState:r},o={}){this.applyWillChange=!1,this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=eN,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,tH.render(this.render,!1,!0))};let{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=!!n,this.isControllingVariants=M(e),this.isVariantNode=E(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:h,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(let t in u){let e=u[t];void 0!==a[t]&&W(e)&&e.set(a[t],!1)}}mount(t){this.current=t,n4.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),n6.current||function(){if(n6.current=!0,u){if(window.matchMedia){let t=window.matchMedia("(prefers-reduced-motion)"),e=()=>n9.current=t.matches;t.addListener(e),e()}else n9.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||n9.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let t in n4.delete(this.current),this.projection&&this.projection.unmount(),tY(this.notifyUpdate),tY(this.render),this.valueSubscriptions.forEach(t=>t()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[t].clear();for(let t in this.features){let e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();let i=I.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&tH.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),n=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),n(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in k){let e=k[t];if(!e)continue;let{isEnabled:i,Feature:s}=e;if(!this.features[t]&&s&&i(this.props)&&(this.features[t]=new s(this)),this.features[t]){let e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):sU()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;ee.variantChildren.delete(t)}addValue(t,e){let i=this.values.get(t);e!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);let e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return void 0===i&&void 0!==e&&(i=sr(null===e?void 0:e,{owner:this}),this.addValue(t,i)),i}readValue(t,e){var i;let s=void 0===this.latestValues[t]&&this.current?null!==(i=this.getBaseTargetFromProps(this.props,t))&&void 0!==i?i:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];return null!=s&&("string"==typeof s&&(eA(s)||eS(s))?s=parseFloat(s):!n7(s)&&e3.test(e)&&(s=ie(t,e)),this.setBaseTarget(t,W(s)?s.get():s)),W(s)?s.get():s}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;let i;let{initial:s}=this.props;if("string"==typeof s||"object"==typeof s){let n=tk(this.props,s,null===(e=this.presenceContext)||void 0===e?void 0:e.custom);n&&(i=n[t])}if(s&&void 0!==i)return i;let n=this.getBaseTargetFromProps(this.props,t);return void 0===n||W(n)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:n}on(t,e){return this.events[t]||(this.events[t]=new se),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class rs extends ri{constructor(){super(...arguments),this.KeyframeResolver=is}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:i}){delete e[t],delete i[t]}}class rn extends rs{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=tV}readValueFromInstance(t,e){if(I.has(e)){let t=it(e);return t&&t.default||0}{let i=window.getComputedStyle(t),s=(tu(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:e}){return sZ(t,e)}build(t,e,i){tm(t,e,i.transformTemplate)}scrapeMotionValuesFromProps(t,e,i){return tE(t,e,i)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;W(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class rr extends rs{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=sU}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(I.has(e)){let t=it(e);return t&&t.default||0}return e=tC.has(e)?e:p(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,i){return tR(t,e,i)}build(t,e,i){tb(t,e,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,i,s){tM(t,e,i,s)}mount(t){this.isSVGTag=tA(t.tagName),super.mount(t)}}let ro=(t,e)=>B(t)?new rr(e):new rn(e,{allowProjection:t!==o.Fragment}),ra={animation:{Feature:sv},exit:{Feature:sy},inView:{Feature:eu},tap:{Feature:en},focus:{Feature:ee},hover:{Feature:et},pan:{Feature:s3},drag:{Feature:s5,ProjectionNode:n3,MeasureLayout:s7},layout:{ProjectionNode:n3,MeasureLayout:s7}},rl=function(t){function e(e,i={}){return function({preloadedFeatures:t,createVisualElement:e,useRender:i,useVisualState:s,Component:n}){t&&function(t){for(let e in t)k[e]={...k[e],...t[e]}}(t);let p=(0,o.forwardRef)(function(t,p){var f;let v;let g={...(0,o.useContext)(a),...t,layoutId:function({layoutId:t}){let e=(0,o.useContext)(j).id;return e&&void 0!==t?e+"-"+t:t}(t)},{isStatic:x}=g,A=function(t){let{initial:e,animate:i}=function(t,e){if(M(t)){let{initial:e,animate:i}=t;return{initial:!1===e||S(e)?e:void 0,animate:S(i)?i:void 0}}return!1!==t.inherit?e:{}}(t,(0,o.useContext)(l));return(0,o.useMemo)(()=>({initial:e,animate:i}),[R(e),R(i)])}(t),V=s(t,x);if(!x&&u){(0,o.useContext)(c).strict;let t=function(t){let{drag:e,layout:i}=k;if(!e&&!i)return{};let s={...e,...i};return{MeasureLayout:(null==e?void 0:e.isEnabled(t))||(null==i?void 0:i.isEnabled(t))?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(g);v=t.MeasureLayout,A.visualElement=function(t,e,i,s,n){var r;let{visualElement:u}=(0,o.useContext)(l),p=(0,o.useContext)(c),f=(0,o.useContext)(h),v=(0,o.useContext)(a).reducedMotion,g=(0,o.useRef)();s=s||p.renderer,!g.current&&s&&(g.current=s(t,{visualState:e,parent:u,props:i,presenceContext:f,blockInitialAnimation:!!f&&!1===f.initial,reducedMotionConfig:v}));let x=g.current,S=(0,o.useContext)(w);x&&!x.projection&&n&&("html"===x.type||"svg"===x.type)&&function(t,e,i,s){let{layoutId:n,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:h}=e;t.projection=new i(t.latestValues,e["data-framer-portal-id"]?void 0:function t(e){if(e)return!1!==e.options.allowProjection?e.projection:t(e.parent)}(t.parent)),t.projection.setOptions({layoutId:n,layout:r,alwaysMeasureLayout:!!o||a&&P(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:s,layoutScroll:l,layoutRoot:h})}(g.current,i,n,S),(0,o.useInsertionEffect)(()=>{x&&x.update(i,f)});let A=i[m],V=(0,o.useRef)(!!A&&!window.MotionHandoffIsComplete&&(null===(r=window.MotionHasOptimisedAnimation)||void 0===r?void 0:r.call(window,A)));return d(()=>{x&&(x.updateFeatures(),y.render(x.render),V.current&&x.animationState&&x.animationState.animateChanges())}),(0,o.useEffect)(()=>{x&&(!V.current&&x.animationState&&x.animationState.animateChanges(),V.current=!1,T||(T=!0,queueMicrotask(b)))}),x}(n,V,g,e,t.ProjectionNode)}return(0,r.jsxs)(l.Provider,{value:A,children:[v&&A.visualElement?(0,r.jsx)(v,{visualElement:A.visualElement,...g}):null,i(n,t,(f=A.visualElement,(0,o.useCallback)(t=>{t&&V.mount&&V.mount(t),f&&(t?f.mount(t):f.unmount()),p&&("function"==typeof p?p(t):P(p)&&(p.current=t))},[f])),V,x,A.visualElement)]})});return p[L]=n,p}(t(e,i))}if("undefined"==typeof Proxy)return e;let i=new Map;return new Proxy(e,{get:(t,s)=>(i.has(s)||i.set(s,e(s)),i.get(s))})}((t,e)=>(function(t,{forwardMotionProps:e=!1},i,s){return{...B(t)?tG:tq,preloadedFeatures:i,useRender:function(t=!1){return(e,i,s,{latestValues:n},r)=>{let a=(B(e)?function(t,e,i,s){let n=(0,o.useMemo)(()=>{let i=tS();return tb(i,e,tA(s),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){let e={};tv(e,t.style,t),n.style={...e,...n.style}}return n}:function(t,e){let i={},s=function(t,e){let i=t.style||{},s={};return tv(s,i,t),Object.assign(s,function({transformTemplate:t},e){return(0,o.useMemo)(()=>{let i=tf();return tm(i,e,t),Object.assign({},i.vars,i.style)},[e])}(t,e)),s}(t,e);return t.drag&&!1!==t.dragListener&&(i.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===t.drag?"none":`pan-${"x"===t.drag?"y":"x"}`),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(i.tabIndex=0),i.style=s,i})(i,n,r,e),l=function(t,e,i){let s={};for(let n in t)("values"!==n||"object"!=typeof t.values)&&(tx(n)||!0===i&&ty(n)||!e&&!ty(n)||t.draggable&&n.startsWith("onDrag"))&&(s[n]=t[n]);return s}(i,"string"==typeof e,t),h=e!==o.Fragment?{...l,...a,ref:s}:{},{children:u}=i,d=(0,o.useMemo)(()=>W(u)?u.get():u,[u]);return(0,o.createElement)(e,{...h,children:d})}}(e),createVisualElement:s,Component:t}})(t,e,ra,ro))}}]); \ No newline at end of file diff --git a/_next/static/chunks/app/about/page-d9421d88ee2adad7.js b/_next/static/chunks/app/about/page-d9421d88ee2adad7.js deleted file mode 100644 index 3602696..0000000 --- a/_next/static/chunks/app/about/page-d9421d88ee2adad7.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[301],{7009:function(e,s,t){Promise.resolve().then(t.bind(t,9313))},9313:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return r}});var i=t(2842),l=t(8561),n=t(2741);function r(){let{theme:e}=(0,n.F)();return(0,i.jsxs)("div",{className:"max-w-4xl mx-auto rounded-lg shadow-lg p-8 my-10 \n ".concat("dark"===e?"bg-gray-800 text-white":"bg-gradient-to-br from-blue-50 to-indigo-100 text-gray-800"),children:[(0,i.jsx)("h1",{className:"text-4xl font-bold mb-6 ".concat("dark"===e?"text-indigo-300":"text-indigo-800"),children:"关于我的博客"}),(0,i.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[(0,i.jsxs)("div",{className:"md:col-span-2 prose lg:prose-xl ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:[(0,i.jsx)("p",{children:"欢迎来到我的博客!这里是我分享想法、经验和技术见解的地方。"}),(0,i.jsx)("p",{children:"我是一名热爱编程和技术的开发者,专注于前端和全栈开发。我的目标是通过这个博客与大家分享知识,共同成长。"}),(0,i.jsx)("p",{children:"在这里,你可以找到关于:"}),(0,i.jsxs)("ul",{children:[(0,i.jsx)("li",{children:"Web开发最佳实践"}),(0,i.jsx)("li",{children:"新兴技术趋势分析"}),(0,i.jsx)("li",{children:"编程技巧和工具推荐"}),(0,i.jsx)("li",{children:"个人项目经验分享"})]}),(0,i.jsx)("p",{children:"如果你有任何问题、建议或合作意向,欢迎随时与我联系。让我们一起在编程的世界里探索和创新!"})]}),(0,i.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,i.jsx)(l.default,{src:"/img/avatar.jpg",alt:"博主头像",width:200,height:200,className:"rounded-full shadow-md mb-4"}),(0,i.jsxs)("div",{className:"text-center",children:[(0,i.jsx)("h2",{className:"text-xl font-semibold ".concat("dark"===e?"text-indigo-300":"text-indigo-700"),children:"博主昵称"}),(0,i.jsx)("p",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"前端开发者 / 技术博主"})]})]})]})]})}}},function(e){e.O(0,[469,949,785,744],function(){return e(e.s=7009)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/app/about/page-e36f086028417f1c.js b/_next/static/chunks/app/about/page-e36f086028417f1c.js new file mode 100644 index 0000000..e081da4 --- /dev/null +++ b/_next/static/chunks/app/about/page-e36f086028417f1c.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[301],{7009:function(e,t,n){Promise.resolve().then(n.bind(n,9313))},3855:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return c}});let c=n(8903)._(n(6856)).default.createContext(null)},9313:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return r}});var c=n(2842),a=n(8561),o=n(2741);function r(){let{theme:e}=(0,o.F)();return(0,c.jsxs)("div",{className:"max-w-4xl mx-auto rounded-lg shadow-lg p-8 my-10 \n ".concat("dark"===e?"bg-gray-800 text-white":"bg-gradient-to-br from-blue-50 to-indigo-100 text-gray-800"),children:[(0,c.jsx)("h1",{className:"text-4xl font-bold mb-6 ".concat("dark"===e?"text-indigo-300":"text-indigo-800"),children:"关于我的博客"}),(0,c.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[(0,c.jsxs)("div",{className:"md:col-span-2 prose lg:prose-xl ".concat("dark"===e?"text-gray-300":"text-gray-700"),children:[(0,c.jsx)("p",{children:"欢迎来到我的博客!这里是我分享想法、经验和技术见解的地方。"}),(0,c.jsx)("p",{children:"我是一名热爱编程和技术的开发者,专注于前端和全栈开发。我的目标是通过这个博客与大家分享知识,共同成长。"}),(0,c.jsx)("p",{children:"在这里,你可以找到关于:"}),(0,c.jsxs)("ul",{children:[(0,c.jsx)("li",{children:"Web开发最佳实践"}),(0,c.jsx)("li",{children:"新兴技术趋势分析"}),(0,c.jsx)("li",{children:"编程技巧和工具推荐"}),(0,c.jsx)("li",{children:"个人项目经验分享"})]}),(0,c.jsx)("p",{children:"如果你有任何问题、建议或合作意向,欢迎随时与我联系。让我们一起在编程的世界里探索和创新!"})]}),(0,c.jsxs)("div",{className:"flex flex-col items-center justify-center",children:[(0,c.jsx)(a.default,{src:"/img/avatar.png",alt:"博主头像",width:200,height:200,className:"rounded-full shadow-md mb-4"}),(0,c.jsxs)("div",{className:"text-center",children:[(0,c.jsx)("h2",{className:"text-xl font-semibold ".concat("dark"===e?"text-indigo-300":"text-indigo-700"),children:"Zhuba-Ahhh"}),(0,c.jsx)("p",{className:"dark"===e?"text-gray-400":"text-gray-600",children:"前端开发者 / 技术博主"})]})]})]})]})}},2741:function(e,t,n){"use strict";n.d(t,{F:function(){return i},ThemeProvider:function(){return d}});var c=n(6856),a=["light","dark"],o="(prefers-color-scheme: dark)",r="undefined"==typeof window,l=c.createContext(void 0),s={setTheme:e=>{},themes:[]},i=()=>{var e;return null!=(e=c.useContext(l))?e:s},d=e=>c.useContext(l)?e.children:c.createElement(u,{...e}),m=["light","dark"],u=e=>{let{forcedTheme:t,disableTransitionOnChange:n=!1,enableSystem:r=!0,enableColorScheme:s=!0,storageKey:i="theme",themes:d=m,defaultTheme:u=r?"system":"light",attribute:y="data-theme",value:v,children:b,nonce:p}=e,[j,w]=c.useState(()=>f(i,u)),[k,S]=c.useState(()=>f(i)),C=v?Object.values(v):d,T=c.useCallback(e=>{let t=e;if(!t)return;"system"===e&&r&&(t=x());let c=v?v[t]:t,o=n?g():null,l=document.documentElement;if("class"===y?(l.classList.remove(...C),c&&l.classList.add(c)):c?l.setAttribute(y,c):l.removeAttribute(y),s){let e=a.includes(u)?u:null,n=a.includes(t)?t:e;l.style.colorScheme=n}null==o||o()},[]),E=c.useCallback(e=>{let t="function"==typeof e?e(e):e;w(t);try{localStorage.setItem(i,t)}catch(e){}},[t]),N=c.useCallback(e=>{S(x(e)),"system"===j&&r&&!t&&T("system")},[j,t]);c.useEffect(()=>{let e=window.matchMedia(o);return e.addListener(N),N(e),()=>e.removeListener(N)},[N]),c.useEffect(()=>{let e=e=>{e.key===i&&E(e.newValue||u)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[E]),c.useEffect(()=>{T(null!=t?t:j)},[t,j]);let _=c.useMemo(()=>({theme:j,setTheme:E,forcedTheme:t,resolvedTheme:"system"===j?k:j,themes:r?[...d,"system"]:d,systemTheme:r?k:void 0}),[j,E,t,k,r,d]);return c.createElement(l.Provider,{value:_},c.createElement(h,{forcedTheme:t,disableTransitionOnChange:n,enableSystem:r,enableColorScheme:s,storageKey:i,themes:d,defaultTheme:u,attribute:y,value:v,children:b,attrs:C,nonce:p}),b)},h=c.memo(e=>{let{forcedTheme:t,storageKey:n,attribute:r,enableSystem:l,enableColorScheme:s,defaultTheme:i,value:d,attrs:m,nonce:u}=e,h="system"===i,f="class"===r?"var d=document.documentElement,c=d.classList;".concat("c.remove(".concat(m.map(e=>"'".concat(e,"'")).join(","),")"),";"):"var d=document.documentElement,n='".concat(r,"',s='setAttribute';"),g=s?(a.includes(i)?i:null)?"if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'".concat(i,"'"):"if(e==='light'||e==='dark')d.style.colorScheme=e":"",x=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=!(arguments.length>2)||void 0===arguments[2]||arguments[2],c=d?d[e]:e,o=t?e+"|| ''":"'".concat(c,"'"),l="";return s&&n&&!t&&a.includes(e)&&(l+="d.style.colorScheme = '".concat(e,"';")),"class"===r?t||c?l+="c.add(".concat(o,")"):l+="null":c&&(l+="d[s](n,".concat(o,")")),l},y=t?"!function(){".concat(f).concat(x(t),"}()"):l?"!function(){try{".concat(f,"var e=localStorage.getItem('").concat(n,"');if('system'===e||(!e&&").concat(h,")){var t='").concat(o,"',m=window.matchMedia(t);if(m.media!==t||m.matches){").concat(x("dark"),"}else{").concat(x("light"),"}}else if(e){").concat(d?"var x=".concat(JSON.stringify(d),";"):"").concat(x(d?"x[e]":"e",!0),"}").concat(h?"":"else{"+x(i,!1,!1)+"}").concat(g,"}catch(e){}}()"):"!function(){try{".concat(f,"var e=localStorage.getItem('").concat(n,"');if(e){").concat(d?"var x=".concat(JSON.stringify(d),";"):"").concat(x(d?"x[e]":"e",!0),"}else{").concat(x(i,!1,!1),";}").concat(g,"}catch(t){}}();");return c.createElement("script",{nonce:u,dangerouslySetInnerHTML:{__html:y}})}),f=(e,t)=>{let n;if(!r){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},g=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},x=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light")}},function(e){e.O(0,[561,949,785,744],function(){return e(e.s=7009)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/app/blog/[id]/page-48c48ecea69e735b.js b/_next/static/chunks/app/blog/[id]/page-48c48ecea69e735b.js new file mode 100644 index 0000000..4d101e7 --- /dev/null +++ b/_next/static/chunks/app/blog/[id]/page-48c48ecea69e735b.js @@ -0,0 +1 @@ +(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[548],{2486:function(e,t,r){Promise.resolve().then(r.t.bind(r,1872,23)),Promise.resolve().then(r.bind(r,3145)),Promise.resolve().then(r.bind(r,7442)),Promise.resolve().then(r.bind(r,5575)),Promise.resolve().then(r.bind(r,2996)),Promise.resolve().then(r.bind(r,9966)),Promise.resolve().then(r.bind(r,8064)),Promise.resolve().then(r.bind(r,9414))},3145:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let n=r(9970);function a(e){let{reason:t,children:r}=e;if("undefined"==typeof window)throw new n.BailoutToCSRError(t);return r}},7442:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return i}});let n=r(2842),a=r(9877);function i(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let r=(0,a.getExpectedRequestStore)("next/dynamic css"),i=[];if(r.reactLoadableManifest&&t){let e=r.reactLoadableManifest;for(let r of t){if(!e[r])continue;let t=e[r].files.filter(e=>e.endsWith(".css"));i.push(...t)}}return 0===i.length?null:(0,n.jsx)(n.Fragment,{children:i.map(e=>(0,n.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:r.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},5575:function(e,t,r){"use strict";r.d(t,{default:function(){return d}});var n=r(2842),a=r(6856),i=r(1326),o=r(7058),s=r(3022),l=r(4863);function d(){let[e,t]=(0,a.useState)([]),[r,d]=(0,a.useState)({author:"",content:""}),[c,u]=(0,a.useState)("newest"),f=(0,a.useMemo)(()=>[...e].sort((e,t)=>"newest"===c?new Date(t.date).getTime()-new Date(e.date).getTime():new Date(e.date).getTime()-new Date(t.date).getTime()),[e,c]);(0,a.useCallback)((e,r)=>{t(t=>{let n=[...t],a=n.find(t=>t.id===e);return a&&a.replies.push({id:Date.now(),author:"匿名用户",content:r,date:new Date().toLocaleString(),replies:[]}),n})},[]);let m=(0,a.useCallback)(e=>{e.preventDefault();let n={id:Date.now(),author:r.author.trim(),content:r.content.trim(),date:new Date().toLocaleString(),replies:[]};t(e=>[...e,n]),d({author:"",content:""})},[r]),p=(0,a.useCallback)(e=>{let{name:t,value:r}=e.target;d(e=>({...e,[t]:r}))},[]),g=(0,a.useCallback)(()=>{u(e=>"newest"===e?"oldest":"newest")},[]);return(0,n.jsxs)("div",{className:"mt-12",children:[(0,n.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"评论"}),(0,n.jsxs)("form",{onSubmit:m,className:"mb-8 space-y-4",children:[(0,n.jsx)(i.I,{type:"text",name:"author",placeholder:"您的名字",value:r.author,onChange:p,required:!0}),(0,n.jsx)(o.g,{name:"content",placeholder:"您的评论",value:r.content,onChange:p,rows:4,required:!0}),(0,n.jsx)(s.z,{type:"submit",children:"提交评论"})]}),(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)("h3",{className:"text-xl font-semibold",children:"评论列表"}),(0,n.jsx)(s.z,{onClick:g,variant:"outline",children:"newest"===c?"最新优先":"最早优先"})]}),(0,n.jsx)("div",{className:"space-y-4",children:f.map(e=>(0,n.jsxs)(l.Zb,{children:[(0,n.jsxs)(l.Ol,{children:[(0,n.jsx)(l.ll,{children:e.author}),(0,n.jsx)(l.SZ,{children:e.date})]}),(0,n.jsx)(l.aY,{children:(0,n.jsx)("p",{children:e.content})}),(0,n.jsx)(l.eW,{children:e.replies.map(e=>(0,n.jsxs)(l.Zb,{className:"mt-2 w-full",children:[(0,n.jsxs)(l.Ol,{children:[(0,n.jsx)(l.ll,{children:e.author}),(0,n.jsx)(l.SZ,{children:e.date})]}),(0,n.jsx)(l.aY,{children:(0,n.jsx)("p",{children:e.content})})]},e.id))})]},e.id))})]})}},2996:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return Z}});var n=r(2842),a=r(6856),i=r(8561),o=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},s="object"==typeof global&&global&&global.Object===Object&&global,l="object"==typeof self&&self&&self.Object===Object&&self,d=s||l||Function("return this")(),c=function(){return d.Date.now()},u=/\s/,f=function(e){for(var t=e.length;t--&&u.test(e.charAt(t)););return t},m=/^\s+/,p=d.Symbol,g=Object.prototype,h=g.hasOwnProperty,x=g.toString,b=p?p.toStringTag:void 0,y=function(e){var t=h.call(e,b),r=e[b];try{e[b]=void 0;var n=!0}catch(e){}var a=x.call(e);return n&&(t?e[b]=r:delete e[b]),a},v=Object.prototype.toString,j=p?p.toStringTag:void 0,w=function(e){var t;return"symbol"==typeof e||null!=e&&"object"==typeof e&&"[object Symbol]"==(null==(t=e)?void 0===t?"[object Undefined]":"[object Null]":j&&j in Object(t)?y(t):v.call(t))},N=0/0,S=/^[-+]0x[0-9a-f]+$/i,k=/^0b[01]+$/i,C=/^0o[0-7]+$/i,T=parseInt,R=function(e){if("number"==typeof e)return e;if(w(e))return N;if(o(e)){var t,r="function"==typeof e.valueOf?e.valueOf():e;e=o(r)?r+"":r}if("string"!=typeof e)return 0===e?e:+e;e=(t=e)?t.slice(0,f(t)+1).replace(m,""):t;var n=k.test(e);return n||C.test(e)?T(e.slice(2),n?2:8):S.test(e)?N:+e},O=Math.max,_=Math.min,E=function(e,t,r){var n,a,i,s,l,d,u=0,f=!1,m=!1,p=!0;if("function"!=typeof e)throw TypeError("Expected a function");function g(t){var r=n,i=a;return n=a=void 0,u=t,s=e.apply(i,r)}function h(e){var r=e-d,n=e-u;return void 0===d||r>=t||r<0||m&&n>=i}function x(){var e,r,n,a=c();if(h(a))return b(a);l=setTimeout(x,(e=a-d,r=a-u,n=t-e,m?_(n,i-r):n))}function b(e){return(l=void 0,p&&n)?g(e):(n=a=void 0,s)}function y(){var e,r=c(),i=h(r);if(n=arguments,a=this,d=r,i){if(void 0===l)return u=e=d,l=setTimeout(x,t),f?g(e):s;if(m)return clearTimeout(l),l=setTimeout(x,t),g(d)}return void 0===l&&(l=setTimeout(x,t)),s}return t=R(t)||0,o(r)&&(f=!!r.leading,i=(m="maxWait"in r)?O(R(r.maxWait)||0,t):i,p="trailing"in r?!!r.trailing:p),y.cancel=function(){void 0!==l&&clearTimeout(l),u=0,n=d=a=l=void 0},y.flush=function(){return void 0===l?s:b(c())},y},P=function(e,t,r){var n=!0,a=!0;if("function"!=typeof e)throw TypeError("Expected a function");return o(r)&&(n="leading"in r?!!r.leading:n,a="trailing"in r?!!r.trailing:a),E(e,t,{leading:n,maxWait:t,trailing:a})},Z=e=>{let{text:t,language:r}=e,[o,s]=(0,a.useState)("idle"),l=P(async()=>{if("copied"!==o)try{await navigator.clipboard.writeText(t),s("copied"),setTimeout(()=>s("idle"),1e3)}catch(e){console.error("复制失败:",e),s("idle")}},300),d=(0,a.useCallback)(l,[l,t,o]);return(0,n.jsxs)("button",{onClick:d,onMouseEnter:()=>s(e=>"idle"===e?"copy":e),onMouseLeave:()=>s(e=>"copy"===e?"idle":e),className:"\n absolute top-2 right-2 p-1.5 rounded-md\n bg-gray-200 dark:bg-gray-800\n border border-gray-300 dark:border-gray-700\n hover:bg-gray-300 dark:hover:bg-gray-700\n transition-all duration-300 ease-in-out\n flex items-center justify-center\n shadow-sm hover:shadow-md dark:shadow-gray-900\n ",title:"idle"===o?r:"copy"===o?"复制":"已复制",children:["idle"===o&&(0,n.jsx)("span",{className:"text-xs font-mono text-gray-700 dark:text-gray-300",children:r}),"copy"===o&&(0,n.jsx)(i.default,{src:"/svg/copy.svg",alt:"复制",width:18,height:18,className:"text-gray-700 dark:text-gray-300"}),"copied"===o&&(0,n.jsx)(i.default,{src:"/svg/check.svg",alt:"已复制",width:18,height:18,className:"text-green-600 dark:text-green-400"})]})}},9966:function(e,t,r){"use strict";r.d(t,{default:function(){return i}});var n=r(2842),a=r(6856);function i(){let[e,t]=(0,a.useState)(0),[r,i]=(0,a.useState)(!1),o=()=>document.documentElement.scrollHeight-document.documentElement.clientHeight,s=(0,a.useCallback)(()=>{let e=document.documentElement.scrollTop;t(e/o()*100),i(e>0)},[]);return((0,a.useEffect)(()=>(window.addEventListener("scroll",s),()=>window.removeEventListener("scroll",s)),[s]),r)?(0,n.jsx)("div",{className:"fixed top-0 left-0 w-full h-1 bg-gray-200 z-50",children:(0,n.jsx)("div",{style:{width:"".concat(e,"%")},className:"h-full bg-primary transition-all duration-300 ease-out"})}):null}},3022:function(e,t,r){"use strict";r.d(t,{z:function(){return d}});var n=r(2842),a=r(6856),i=r(6370),o=r(7756),s=r(6134);let l=(0,o.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef((e,t)=>{let{className:r,variant:a,size:o,asChild:d=!1,...c}=e,u=d?i.g7:"button";return(0,n.jsx)(u,{className:(0,s.cn)(l({variant:a,size:o,className:r})),ref:t,...c})});d.displayName="Button"},4863:function(e,t,r){"use strict";r.d(t,{Ol:function(){return s},SZ:function(){return d},Zb:function(){return o},aY:function(){return c},eW:function(){return u},ll:function(){return l}});var n=r(2842),a=r(6856),i=r(6134);let o=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,i.cn)("rounded-lg border bg-card text-card-foreground shadow-sm","transition-transform duration-200 ease-in-out","hover:scale-105 active:scale-95",r),...a})});o.displayName="Card";let s=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,i.cn)("flex flex-col space-y-1.5 p-6",r),...a})});s.displayName="CardHeader";let l=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("h3",{ref:t,className:(0,i.cn)("text-2xl font-semibold leading-none tracking-tight",r),...a})});l.displayName="CardTitle";let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("p",{ref:t,className:(0,i.cn)("text-sm text-muted-foreground",r),...a})});d.displayName="CardDescription";let c=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,i.cn)("p-6 pt-0",r),...a})});c.displayName="CardContent";let u=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,i.cn)("flex items-center p-6 pt-0",r),...a})});u.displayName="CardFooter"},1326:function(e,t,r){"use strict";r.d(t,{I:function(){return o}});var n=r(2842),a=r(6856),i=r(6134);let o=a.forwardRef((e,t)=>{let{className:r,type:a,...o}=e;return(0,n.jsx)("input",{type:a,className:(0,i.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...o})});o.displayName="Input"},8064:function(e,t,r){"use strict";r.r(t),r.d(t,{Label:function(){return d}});var n=r(2842),a=r(6856),i=r(1453),o=r(7756),s=r(6134);let l=(0,o.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(i.f,{ref:t,className:(0,s.cn)(l(),r),...a})});d.displayName=i.f.displayName},9414:function(e,t,r){"use strict";r.r(t),r.d(t,{Select:function(){return c},SelectContent:function(){return h},SelectGroup:function(){return u},SelectItem:function(){return b},SelectLabel:function(){return x},SelectScrollDownButton:function(){return g},SelectScrollUpButton:function(){return p},SelectSeparator:function(){return y},SelectTrigger:function(){return m},SelectValue:function(){return f}});var n=r(2842),a=r(6856),i=r(3832),o=r(6533),s=r(6830),l=r(4972),d=r(6134);let c=i.fC,u=i.ZA,f=i.B4,m=a.forwardRef((e,t)=>{let{className:r,children:a,...s}=e;return(0,n.jsxs)(i.xz,{ref:t,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...s,children:[a,(0,n.jsx)(i.JO,{asChild:!0,children:(0,n.jsx)(o.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=i.xz.displayName;let p=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(i.u_,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",r),...a,children:(0,n.jsx)(s.Z,{className:"h-4 w-4"})})});p.displayName=i.u_.displayName;let g=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(i.$G,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",r),...a,children:(0,n.jsx)(o.Z,{className:"h-4 w-4"})})});g.displayName=i.$G.displayName;let h=a.forwardRef((e,t)=>{let{className:r,children:a,position:o="popper",...s}=e;return(0,n.jsx)(i.h_,{children:(0,n.jsxs)(i.VY,{ref:t,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===o&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:o,...s,children:[(0,n.jsx)(p,{}),(0,n.jsx)(i.l_,{className:(0,d.cn)("p-1","popper"===o&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),(0,n.jsx)(g,{})]})})});h.displayName=i.VY.displayName;let x=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(i.__,{ref:t,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",r),...a})});x.displayName=i.__.displayName;let b=a.forwardRef((e,t)=>{let{className:r,children:a,...o}=e;return(0,n.jsxs)(i.ck,{ref:t,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...o,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(i.wU,{children:(0,n.jsx)(l.Z,{className:"h-4 w-4"})})}),(0,n.jsx)(i.eT,{children:a})]})});b.displayName=i.ck.displayName;let y=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(i.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",r),...a})});y.displayName=i.Z0.displayName},7058:function(e,t,r){"use strict";r.d(t,{g:function(){return o}});var n=r(2842),a=r(6856),i=r(6134);let o=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("textarea",{className:(0,i.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...a})});o.displayName="Textarea"},6134:function(e,t,r){"use strict";r.d(t,{cn:function(){return i}});var n=r(5023),a=r(8453);function i(){for(var e=arguments.length,t=Array(e),r=0;r[...e].sort((e,t)=>"newest"===c?new Date(t.date).getTime()-new Date(e.date).getTime():new Date(e.date).getTime()-new Date(t.date).getTime()),[e,c]);(0,a.useCallback)((e,r)=>{t(t=>{let n=[...t],a=n.find(t=>t.id===e);return a&&a.replies.push({id:Date.now(),author:"匿名用户",content:r,date:new Date().toLocaleString(),replies:[]}),n})},[]);let m=(0,a.useCallback)(e=>{e.preventDefault();let n={id:Date.now(),author:r.author.trim(),content:r.content.trim(),date:new Date().toLocaleString(),replies:[]};t(e=>[...e,n]),d({author:"",content:""})},[r]),p=(0,a.useCallback)(e=>{let{name:t,value:r}=e.target;d(e=>({...e,[t]:r}))},[]),x=(0,a.useCallback)(()=>{u(e=>"newest"===e?"oldest":"newest")},[]);return(0,n.jsxs)("div",{className:"mt-12",children:[(0,n.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"评论"}),(0,n.jsxs)("form",{onSubmit:m,className:"mb-8 space-y-4",children:[(0,n.jsx)(s.I,{type:"text",name:"author",placeholder:"您的名字",value:r.author,onChange:p,required:!0}),(0,n.jsx)(l.g,{name:"content",placeholder:"您的评论",value:r.content,onChange:p,rows:4,required:!0}),(0,n.jsx)(i.z,{type:"submit",children:"提交评论"})]}),(0,n.jsxs)("div",{className:"flex justify-between items-center mb-4",children:[(0,n.jsx)("h3",{className:"text-xl font-semibold",children:"评论列表"}),(0,n.jsx)(i.z,{onClick:x,variant:"outline",children:"newest"===c?"最新优先":"最早优先"})]}),(0,n.jsx)("div",{className:"space-y-4",children:f.map(e=>(0,n.jsxs)(o.Zb,{children:[(0,n.jsxs)(o.Ol,{children:[(0,n.jsx)(o.ll,{children:e.author}),(0,n.jsx)(o.SZ,{children:e.date})]}),(0,n.jsx)(o.aY,{children:(0,n.jsx)("p",{children:e.content})}),(0,n.jsx)(o.eW,{children:e.replies.map(e=>(0,n.jsxs)(o.Zb,{className:"mt-2 w-full",children:[(0,n.jsxs)(o.Ol,{children:[(0,n.jsx)(o.ll,{children:e.author}),(0,n.jsx)(o.SZ,{children:e.date})]}),(0,n.jsx)(o.aY,{children:(0,n.jsx)("p",{children:e.content})})]},e.id))})]},e.id))})]})}},9966:function(e,t,r){"use strict";r.d(t,{default:function(){return s}});var n=r(2842),a=r(6856);function s(){let[e,t]=(0,a.useState)(0),[r,s]=(0,a.useState)(!1),l=()=>document.documentElement.scrollHeight-document.documentElement.clientHeight,i=(0,a.useCallback)(()=>{let e=document.documentElement.scrollTop;t(e/l()*100),s(e>0)},[]);return((0,a.useEffect)(()=>(window.addEventListener("scroll",i),()=>window.removeEventListener("scroll",i)),[i]),r)?(0,n.jsx)("div",{className:"fixed top-0 left-0 w-full h-1 bg-gray-200 z-50",children:(0,n.jsx)("div",{style:{width:"".concat(e,"%")},className:"h-full bg-primary transition-all duration-300 ease-out"})}):null}},3022:function(e,t,r){"use strict";r.d(t,{z:function(){return d}});var n=r(2842),a=r(6856),s=r(6370),l=r(7756),i=r(6134);let o=(0,l.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef((e,t)=>{let{className:r,variant:a,size:l,asChild:d=!1,...c}=e,u=d?s.g7:"button";return(0,n.jsx)(u,{className:(0,i.cn)(o({variant:a,size:l,className:r})),ref:t,...c})});d.displayName="Button"},4863:function(e,t,r){"use strict";r.d(t,{Ol:function(){return i},SZ:function(){return d},Zb:function(){return l},aY:function(){return c},eW:function(){return u},ll:function(){return o}});var n=r(2842),a=r(6856),s=r(6134);let l=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("rounded-lg border bg-card text-card-foreground shadow-sm","transition-transform duration-200 ease-in-out","hover:scale-105 active:scale-95",r),...a})});l.displayName="Card";let i=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("flex flex-col space-y-1.5 p-6",r),...a})});i.displayName="CardHeader";let o=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("h3",{ref:t,className:(0,s.cn)("text-2xl font-semibold leading-none tracking-tight",r),...a})});o.displayName="CardTitle";let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("p",{ref:t,className:(0,s.cn)("text-sm text-muted-foreground",r),...a})});d.displayName="CardDescription";let c=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("p-6 pt-0",r),...a})});c.displayName="CardContent";let u=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("div",{ref:t,className:(0,s.cn)("flex items-center p-6 pt-0",r),...a})});u.displayName="CardFooter"},1326:function(e,t,r){"use strict";r.d(t,{I:function(){return l}});var n=r(2842),a=r(6856),s=r(6134);let l=a.forwardRef((e,t)=>{let{className:r,type:a,...l}=e;return(0,n.jsx)("input",{type:a,className:(0,s.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...l})});l.displayName="Input"},8064:function(e,t,r){"use strict";r.r(t),r.d(t,{Label:function(){return d}});var n=r(2842),a=r(6856),s=r(1453),l=r(7756),i=r(6134);let o=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.f,{ref:t,className:(0,i.cn)(o(),r),...a})});d.displayName=s.f.displayName},9414:function(e,t,r){"use strict";r.r(t),r.d(t,{Select:function(){return c},SelectContent:function(){return h},SelectGroup:function(){return u},SelectItem:function(){return g},SelectLabel:function(){return b},SelectScrollDownButton:function(){return x},SelectScrollUpButton:function(){return p},SelectSeparator:function(){return v},SelectTrigger:function(){return m},SelectValue:function(){return f}});var n=r(2842),a=r(6856),s=r(2459),l=r(6533),i=r(6830),o=r(4972),d=r(6134);let c=s.fC,u=s.ZA,f=s.B4,m=a.forwardRef((e,t)=>{let{className:r,children:a,...i}=e;return(0,n.jsxs)(s.xz,{ref:t,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...i,children:[a,(0,n.jsx)(s.JO,{asChild:!0,children:(0,n.jsx)(l.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=s.xz.displayName;let p=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.u_,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",r),...a,children:(0,n.jsx)(i.Z,{className:"h-4 w-4"})})});p.displayName=s.u_.displayName;let x=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.$G,{ref:t,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",r),...a,children:(0,n.jsx)(l.Z,{className:"h-4 w-4"})})});x.displayName=s.$G.displayName;let h=a.forwardRef((e,t)=>{let{className:r,children:a,position:l="popper",...i}=e;return(0,n.jsx)(s.h_,{children:(0,n.jsxs)(s.VY,{ref:t,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:l,...i,children:[(0,n.jsx)(p,{}),(0,n.jsx)(s.l_,{className:(0,d.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),(0,n.jsx)(x,{})]})})});h.displayName=s.VY.displayName;let b=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.__,{ref:t,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",r),...a})});b.displayName=s.__.displayName;let g=a.forwardRef((e,t)=>{let{className:r,children:a,...l}=e;return(0,n.jsxs)(s.ck,{ref:t,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(s.wU,{children:(0,n.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,n.jsx)(s.eT,{children:a})]})});g.displayName=s.ck.displayName;let v=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)(s.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",r),...a})});v.displayName=s.Z0.displayName},7058:function(e,t,r){"use strict";r.d(t,{g:function(){return l}});var n=r(2842),a=r(6856),s=r(6134);let l=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,n.jsx)("textarea",{className:(0,s.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...a})});l.displayName="Textarea"},6134:function(e,t,r){"use strict";r.d(t,{cn:function(){return s}});var n=r(5023),a=r(8453);function s(){for(var e=arguments.length,t=Array(e),r=0;r{let e=t.get("tag");k(e||null),R(e?i.n.filter(t=>t.tags.includes(e)):i.n)},[t]);(0,s.useEffect)(()=>{V(),z(!1)},[V]);let T=(0,s.useMemo)(()=>{let e=new Set;return i.n.forEach(t=>t.tags.forEach(t=>e.add(t))),Array.from(e)},[]),I=(0,s.useMemo)(()=>{let e=S.filter(e=>(e.title.toLowerCase().includes(c.toLowerCase())||e.content.toLowerCase().includes(c.toLowerCase()))&&(!h||e.tags.includes(h)));return e.sort((e,t)=>"date"===P?new Date(t.date).getTime()-new Date(e.date).getTime():e.title.localeCompare(t.title)),e},[c,h,S,P]),E=(0,s.useMemo)(()=>{let e=6*r;return I.slice(e-6,e)},[r,I]),O=(0,s.useCallback)(e=>o(e),[]),D=(0,s.useCallback)(t=>{k(t),t?e.push("/blog?tag=".concat(encodeURIComponent(t)),{scroll:!1}):e.push("/blog",{scroll:!1})},[e]),F=(0,s.useMemo)(()=>Z?T:T.slice(0,10),[Z,T]),M=(0,s.useCallback)(e=>{let t=e.target.value;d(t),o(1),R(i.n.filter(e=>(e.title.toLowerCase().includes(t.toLowerCase())||e.content.toLowerCase().includes(t.toLowerCase()))&&(!h||e.tags.includes(h))))},[h]);return(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,a.jsx)("h1",{className:"text-4xl font-bold mb-8 text-center",children:"博客文章"}),(0,a.jsxs)("div",{className:"mb-6 flex items-end space-x-4",children:[(0,a.jsxs)("div",{className:"flex-grow",children:[(0,a.jsx)(y.Label,{htmlFor:"search",className:"mb-2 block",children:"搜索文章"}),(0,a.jsx)(m.I,{id:"search",type:"text",placeholder:"输入关键词...",value:c,onChange:M})]}),(0,a.jsxs)("div",{className:"w-40",children:[(0,a.jsx)(y.Label,{htmlFor:"sort",className:"mb-2 block",children:"排序方式"}),(0,a.jsxs)(j.Select,{onValueChange:e=>A(e),defaultValue:P,children:[(0,a.jsx)(j.SelectTrigger,{id:"sort",className:"w-full",children:(0,a.jsx)(j.SelectValue,{placeholder:"选择排序方式"})}),(0,a.jsxs)(j.SelectContent,{children:[(0,a.jsx)(j.SelectItem,{value:"date",children:"按日期排序"}),(0,a.jsx)(j.SelectItem,{value:"title",children:"按标题排序"})]})]})]})]}),(0,a.jsxs)("div",{className:"mb-6 flex flex-wrap items-center gap-2",children:[(0,a.jsx)(u,{variant:null===h?"default":"secondary",className:"cursor-pointer",onClick:()=>D(null),children:"全部"}),F.map(e=>(0,a.jsx)(u,{variant:e===h?"default":"secondary",className:"cursor-pointer",onClick:()=>D(e),children:e},e)),T.length>10&&(0,a.jsx)(f.z,{variant:"ghost",size:"sm",onClick:()=>_(!Z),className:"ml-2",children:Z?(0,a.jsxs)(a.Fragment,{children:["收起 ",(0,a.jsx)(N.Z,{className:"ml-1 h-4 w-4"})]}):(0,a.jsxs)(a.Fragment,{children:["展开 ",(0,a.jsx)(w.Z,{className:"ml-1 h-4 w-4"})]})})]}),(0,a.jsx)("div",{className:"grid gap-8 md:grid-cols-2 lg:grid-cols-3",children:L?Array.from({length:6}).map((e,t)=>(0,a.jsxs)(p.Zb,{children:[(0,a.jsxs)(p.Ol,{children:[(0,a.jsx)(x,{className:"h-6 w-3/4"}),(0,a.jsx)(x,{className:"h-4 w-1/2 mt-2"})]}),(0,a.jsx)(p.aY,{children:(0,a.jsx)(x,{className:"h-20 w-full"})}),(0,a.jsxs)(p.eW,{children:[(0,a.jsx)(x,{className:"h-6 w-1/4 mr-2"}),(0,a.jsx)(x,{className:"h-6 w-1/4"})]})]},t)):E.length>0?E.map(e=>(0,a.jsxs)(p.Zb,{children:[(0,a.jsxs)(p.Ol,{children:[(0,a.jsx)(p.ll,{children:(0,a.jsx)(n.default,{href:"/blog/".concat(e.id),className:"hover:underline",children:e.title})}),(0,a.jsxs)(p.SZ,{children:[e.date," | ",e.author]})]}),(0,a.jsx)(p.aY,{children:(0,a.jsx)("p",{children:e.excerpt})}),(0,a.jsx)(p.eW,{className:"flex flex-wrap gap-2",children:e.tags.map(e=>(0,a.jsx)(u,{variant:"secondary",className:"text-xs px-2 py-1 h-6 cursor-pointer",onClick:()=>D(e),children:e},e))})]},e.id)):(0,a.jsx)("div",{className:"col-span-full",children:(0,a.jsxs)(g,{variant:"default",children:[(0,a.jsx)(C,{className:"h-4 w-4"}),(0,a.jsx)(b,{children:"未找到匹配的文章"}),(0,a.jsxs)(v,{children:["抱歉,没有找到与您的搜索条件相匹配的文章。请尝试以下操作:",(0,a.jsxs)("ul",{className:"list-disc list-inside mt-2",children:[(0,a.jsx)("li",{children:"检查您的拼写"}),(0,a.jsx)("li",{children:"使用不同的关键词"}),(0,a.jsx)("li",{children:"尝试更广泛的搜索词"}),(0,a.jsx)("li",{children:"清除所有筛选条件,重新开始搜索"})]})]})]})})}),I.length>0&&(0,a.jsx)("div",{className:"mt-8 flex justify-center",children:Array.from({length:Math.ceil(I.length/6)},(e,t)=>(0,a.jsx)(f.z,{onClick:()=>O(t+1),variant:r===t+1?"default":"outline",className:"mx-1",children:t+1},t))})]})}},3022:function(e,t,r){"use strict";r.d(t,{z:function(){return c}});var a=r(2842),s=r(6856),n=r(6370),l=r(7756),i=r(6134);let o=(0,l.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),c=s.forwardRef((e,t)=>{let{className:r,variant:s,size:l,asChild:c=!1,...d}=e,u=c?n.g7:"button";return(0,a.jsx)(u,{className:(0,i.cn)(o({variant:s,size:l,className:r})),ref:t,...d})});c.displayName="Button"},4863:function(e,t,r){"use strict";r.d(t,{Ol:function(){return i},SZ:function(){return c},Zb:function(){return l},aY:function(){return d},eW:function(){return u},ll:function(){return o}});var a=r(2842),s=r(6856),n=r(6134);let l=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("rounded-lg border bg-card text-card-foreground shadow-sm","transition-transform duration-200 ease-in-out","hover:scale-105 active:scale-95",r),...s})});l.displayName="Card";let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("flex flex-col space-y-1.5 p-6",r),...s})});i.displayName="CardHeader";let o=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("h3",{ref:t,className:(0,n.cn)("text-2xl font-semibold leading-none tracking-tight",r),...s})});o.displayName="CardTitle";let c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("p",{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",r),...s})});c.displayName="CardDescription";let d=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("p-6 pt-0",r),...s})});d.displayName="CardContent";let u=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("flex items-center p-6 pt-0",r),...s})});u.displayName="CardFooter"},1326:function(e,t,r){"use strict";r.d(t,{I:function(){return l}});var a=r(2842),s=r(6856),n=r(6134);let l=s.forwardRef((e,t)=>{let{className:r,type:s,...l}=e;return(0,a.jsx)("input",{type:s,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...l})});l.displayName="Input"},8064:function(e,t,r){"use strict";r.r(t),r.d(t,{Label:function(){return c}});var a=r(2842),s=r(6856),n=r(1453),l=r(7756),i=r(6134);let o=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.f,{ref:t,className:(0,i.cn)(o(),r),...s})});c.displayName=n.f.displayName},9414:function(e,t,r){"use strict";r.r(t),r.d(t,{Select:function(){return d},SelectContent:function(){return h},SelectGroup:function(){return u},SelectItem:function(){return b},SelectLabel:function(){return g},SelectScrollDownButton:function(){return p},SelectScrollUpButton:function(){return x},SelectSeparator:function(){return v},SelectTrigger:function(){return m},SelectValue:function(){return f}});var a=r(2842),s=r(6856),n=r(2459),l=r(6533),i=r(6830),o=r(4972),c=r(6134);let d=n.fC,u=n.ZA,f=n.B4,m=s.forwardRef((e,t)=>{let{className:r,children:s,...i}=e;return(0,a.jsxs)(n.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...i,children:[s,(0,a.jsx)(n.JO,{asChild:!0,children:(0,a.jsx)(l.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=n.xz.displayName;let x=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",r),...s,children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})});x.displayName=n.u_.displayName;let p=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",r),...s,children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})});p.displayName=n.$G.displayName;let h=s.forwardRef((e,t)=>{let{className:r,children:s,position:l="popper",...i}=e;return(0,a.jsx)(n.h_,{children:(0,a.jsxs)(n.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:l,...i,children:[(0,a.jsx)(x,{}),(0,a.jsx)(n.l_,{className:(0,c.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,a.jsx)(p,{})]})})});h.displayName=n.VY.displayName;let g=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",r),...s})});g.displayName=n.__.displayName;let b=s.forwardRef((e,t)=>{let{className:r,children:s,...l}=e;return(0,a.jsxs)(n.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(n.wU,{children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(n.eT,{children:s})]})});b.displayName=n.ck.displayName;let v=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",r),...s})});v.displayName=n.Z0.displayName},7058:function(e,t,r){"use strict";r.d(t,{g:function(){return l}});var a=r(2842),s=r(6856),n=r(6134);let l=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("textarea",{className:(0,n.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...s})});l.displayName="Textarea"},6134:function(e,t,r){"use strict";r.d(t,{cn:function(){return n}});var a=r(5023),s=r(8453);function n(){for(var e=arguments.length,t=Array(e),r=0;r{let e=t.get("tag");k(e||null),R(e?i.n.filter(t=>t.tags.includes(e)):i.n)},[t]);(0,s.useEffect)(()=>{V(),z(!1)},[V]);let T=(0,s.useMemo)(()=>{let e=new Set;return i.n.forEach(t=>t.tags.forEach(t=>e.add(t))),Array.from(e)},[]),I=(0,s.useMemo)(()=>{let e=S.filter(e=>(e.title.toLowerCase().includes(c.toLowerCase())||e.content.toLowerCase().includes(c.toLowerCase()))&&(!h||e.tags.includes(h)));return e.sort((e,t)=>"date"===P?new Date(t.date).getTime()-new Date(e.date).getTime():e.title.localeCompare(t.title)),e},[c,h,S,P]),E=(0,s.useMemo)(()=>{let e=6*r;return I.slice(e-6,e)},[r,I]),O=(0,s.useCallback)(e=>o(e),[]),D=(0,s.useCallback)(t=>{k(t),t?e.push("/blog?tag=".concat(encodeURIComponent(t)),{scroll:!1}):e.push("/blog",{scroll:!1})},[e]),F=(0,s.useMemo)(()=>Z?T:T.slice(0,10),[Z,T]),M=(0,s.useCallback)(e=>{let t=e.target.value;d(t),o(1),R(i.n.filter(e=>(e.title.toLowerCase().includes(t.toLowerCase())||e.content.toLowerCase().includes(t.toLowerCase()))&&(!h||e.tags.includes(h))))},[h]);return(0,a.jsxs)("div",{className:"container mx-auto px-4 py-8",children:[(0,a.jsx)("h1",{className:"text-4xl font-bold mb-8 text-center",children:"博客文章"}),(0,a.jsxs)("div",{className:"mb-6 flex items-end space-x-4",children:[(0,a.jsxs)("div",{className:"flex-grow",children:[(0,a.jsx)(y.Label,{htmlFor:"search",className:"mb-2 block",children:"搜索文章"}),(0,a.jsx)(m.I,{id:"search",type:"text",placeholder:"输入关键词...",value:c,onChange:M})]}),(0,a.jsxs)("div",{className:"w-40",children:[(0,a.jsx)(y.Label,{htmlFor:"sort",className:"mb-2 block",children:"排序方式"}),(0,a.jsxs)(j.Select,{onValueChange:e=>A(e),defaultValue:P,children:[(0,a.jsx)(j.SelectTrigger,{id:"sort",className:"w-full",children:(0,a.jsx)(j.SelectValue,{placeholder:"选择排序方式"})}),(0,a.jsxs)(j.SelectContent,{children:[(0,a.jsx)(j.SelectItem,{value:"date",children:"按日期排序"}),(0,a.jsx)(j.SelectItem,{value:"title",children:"按标题排序"})]})]})]})]}),(0,a.jsxs)("div",{className:"mb-6 flex flex-wrap items-center gap-2",children:[(0,a.jsx)(u,{variant:null===h?"default":"secondary",className:"cursor-pointer",onClick:()=>D(null),children:"全部"}),F.map(e=>(0,a.jsx)(u,{variant:e===h?"default":"secondary",className:"cursor-pointer",onClick:()=>D(e),children:e},e)),T.length>10&&(0,a.jsx)(f.z,{variant:"ghost",size:"sm",onClick:()=>_(!Z),className:"ml-2",children:Z?(0,a.jsxs)(a.Fragment,{children:["收起 ",(0,a.jsx)(N.Z,{className:"ml-1 h-4 w-4"})]}):(0,a.jsxs)(a.Fragment,{children:["展开 ",(0,a.jsx)(w.Z,{className:"ml-1 h-4 w-4"})]})})]}),(0,a.jsx)("div",{className:"grid gap-8 md:grid-cols-2 lg:grid-cols-3",children:L?Array.from({length:6}).map((e,t)=>(0,a.jsxs)(p.Zb,{children:[(0,a.jsxs)(p.Ol,{children:[(0,a.jsx)(x,{className:"h-6 w-3/4"}),(0,a.jsx)(x,{className:"h-4 w-1/2 mt-2"})]}),(0,a.jsx)(p.aY,{children:(0,a.jsx)(x,{className:"h-20 w-full"})}),(0,a.jsxs)(p.eW,{children:[(0,a.jsx)(x,{className:"h-6 w-1/4 mr-2"}),(0,a.jsx)(x,{className:"h-6 w-1/4"})]})]},t)):E.length>0?E.map(e=>(0,a.jsxs)(p.Zb,{children:[(0,a.jsxs)(p.Ol,{children:[(0,a.jsx)(p.ll,{children:(0,a.jsx)(n.default,{href:"/blog/".concat(e.id),className:"hover:underline",children:e.title})}),(0,a.jsxs)(p.SZ,{children:[e.date," | ",e.author]})]}),(0,a.jsx)(p.aY,{children:(0,a.jsx)("p",{children:e.excerpt})}),(0,a.jsx)(p.eW,{className:"flex flex-wrap gap-2",children:e.tags.map(e=>(0,a.jsx)(u,{variant:"secondary",className:"text-xs px-2 py-1 h-6 cursor-pointer",onClick:()=>D(e),children:e},e))})]},e.id)):(0,a.jsx)("div",{className:"col-span-full",children:(0,a.jsxs)(g,{variant:"default",children:[(0,a.jsx)(C,{className:"h-4 w-4"}),(0,a.jsx)(b,{children:"未找到匹配的文章"}),(0,a.jsxs)(v,{children:["抱歉,没有找到与您的搜索条件相匹配的文章。请尝试以下操作:",(0,a.jsxs)("ul",{className:"list-disc list-inside mt-2",children:[(0,a.jsx)("li",{children:"检查您的拼写"}),(0,a.jsx)("li",{children:"使用不同的关键词"}),(0,a.jsx)("li",{children:"尝试更广泛的搜索词"}),(0,a.jsx)("li",{children:"清除所有筛选条件,重新开始搜索"})]})]})]})})}),I.length>0&&(0,a.jsx)("div",{className:"mt-8 flex justify-center",children:Array.from({length:Math.ceil(I.length/6)},(e,t)=>(0,a.jsx)(f.z,{onClick:()=>O(t+1),variant:r===t+1?"default":"outline",className:"mx-1",children:t+1},t))})]})}},3022:function(e,t,r){"use strict";r.d(t,{z:function(){return c}});var a=r(2842),s=r(6856),n=r(6370),l=r(7756),i=r(6134);let o=(0,l.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),c=s.forwardRef((e,t)=>{let{className:r,variant:s,size:l,asChild:c=!1,...d}=e,u=c?n.g7:"button";return(0,a.jsx)(u,{className:(0,i.cn)(o({variant:s,size:l,className:r})),ref:t,...d})});c.displayName="Button"},4863:function(e,t,r){"use strict";r.d(t,{Ol:function(){return i},SZ:function(){return c},Zb:function(){return l},aY:function(){return d},eW:function(){return u},ll:function(){return o}});var a=r(2842),s=r(6856),n=r(6134);let l=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("rounded-lg border bg-card text-card-foreground shadow-sm","transition-transform duration-200 ease-in-out","hover:scale-105 active:scale-95",r),...s})});l.displayName="Card";let i=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("flex flex-col space-y-1.5 p-6",r),...s})});i.displayName="CardHeader";let o=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("h3",{ref:t,className:(0,n.cn)("text-2xl font-semibold leading-none tracking-tight",r),...s})});o.displayName="CardTitle";let c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("p",{ref:t,className:(0,n.cn)("text-sm text-muted-foreground",r),...s})});c.displayName="CardDescription";let d=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("p-6 pt-0",r),...s})});d.displayName="CardContent";let u=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("div",{ref:t,className:(0,n.cn)("flex items-center p-6 pt-0",r),...s})});u.displayName="CardFooter"},1326:function(e,t,r){"use strict";r.d(t,{I:function(){return l}});var a=r(2842),s=r(6856),n=r(6134);let l=s.forwardRef((e,t)=>{let{className:r,type:s,...l}=e;return(0,a.jsx)("input",{type:s,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...l})});l.displayName="Input"},8064:function(e,t,r){"use strict";r.r(t),r.d(t,{Label:function(){return c}});var a=r(2842),s=r(6856),n=r(1453),l=r(7756),i=r(6134);let o=(0,l.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),c=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.f,{ref:t,className:(0,i.cn)(o(),r),...s})});c.displayName=n.f.displayName},9414:function(e,t,r){"use strict";r.r(t),r.d(t,{Select:function(){return d},SelectContent:function(){return h},SelectGroup:function(){return u},SelectItem:function(){return b},SelectLabel:function(){return g},SelectScrollDownButton:function(){return p},SelectScrollUpButton:function(){return x},SelectSeparator:function(){return v},SelectTrigger:function(){return m},SelectValue:function(){return f}});var a=r(2842),s=r(6856),n=r(3832),l=r(6533),i=r(6830),o=r(4972),c=r(6134);let d=n.fC,u=n.ZA,f=n.B4,m=s.forwardRef((e,t)=>{let{className:r,children:s,...i}=e;return(0,a.jsxs)(n.xz,{ref:t,className:(0,c.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",r),...i,children:[s,(0,a.jsx)(n.JO,{asChild:!0,children:(0,a.jsx)(l.Z,{className:"h-4 w-4 opacity-50"})})]})});m.displayName=n.xz.displayName;let x=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.u_,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",r),...s,children:(0,a.jsx)(i.Z,{className:"h-4 w-4"})})});x.displayName=n.u_.displayName;let p=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.$G,{ref:t,className:(0,c.cn)("flex cursor-default items-center justify-center py-1",r),...s,children:(0,a.jsx)(l.Z,{className:"h-4 w-4"})})});p.displayName=n.$G.displayName;let h=s.forwardRef((e,t)=>{let{className:r,children:s,position:l="popper",...i}=e;return(0,a.jsx)(n.h_,{children:(0,a.jsxs)(n.VY,{ref:t,className:(0,c.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===l&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",r),position:l,...i,children:[(0,a.jsx)(x,{}),(0,a.jsx)(n.l_,{className:(0,c.cn)("p-1","popper"===l&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),(0,a.jsx)(p,{})]})})});h.displayName=n.VY.displayName;let g=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.__,{ref:t,className:(0,c.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",r),...s})});g.displayName=n.__.displayName;let b=s.forwardRef((e,t)=>{let{className:r,children:s,...l}=e;return(0,a.jsxs)(n.ck,{ref:t,className:(0,c.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(n.wU,{children:(0,a.jsx)(o.Z,{className:"h-4 w-4"})})}),(0,a.jsx)(n.eT,{children:s})]})});b.displayName=n.ck.displayName;let v=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)(n.Z0,{ref:t,className:(0,c.cn)("-mx-1 my-1 h-px bg-muted",r),...s})});v.displayName=n.Z0.displayName},7058:function(e,t,r){"use strict";r.d(t,{g:function(){return l}});var a=r(2842),s=r(6856),n=r(6134);let l=s.forwardRef((e,t)=>{let{className:r,...s}=e;return(0,a.jsx)("textarea",{className:(0,n.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...s})});l.displayName="Textarea"},6134:function(e,t,r){"use strict";r.d(t,{cn:function(){return n}});var a=r(5023),s=r(8453);function n(){for(var e=arguments.length,t=Array(e),r=0;rnew Date(i.date).getTime()-new Date(e.date).getTime()).slice(0,2);return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-center bg-gradient-to-br from-indigo-600 via-purple-600 to-pink-500 text-white p-4",children:[(0,a.jsx)(n.E.h1,{className:"text-5xl font-bold mb-4",initial:{opacity:0,y:-50},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:"欢迎来到我的博客"}),(0,a.jsx)(n.E.p,{className:"text-lg mb-6 max-w-2xl",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3,duration:.5},children:"你好,我是[Zhuba-Ahhh]。作为一名前端开发者,我热衷于探索和分享Web开发的最新趋势、技巧和最佳实践。"}),(0,a.jsx)(n.E.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{delay:.6,duration:.5},children:(0,a.jsx)(l.default,{href:"/blog",className:"bg-white text-indigo-600 px-8 py-3 rounded-full text-lg font-semibold hover:bg-opacity-90 transition duration-300 shadow-lg hover:shadow-xl transform hover:-translate-y-1 hover:scale-105",children:"探索博客文章"})}),(0,a.jsxs)(n.E.div,{className:"mt-12 w-full max-w-4xl",initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:.9,duration:.5},children:[(0,a.jsx)("h2",{className:"text-3xl font-semibold mb-4",children:"最新文章"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.map((e,i)=>(0,a.jsx)(l.default,{href:"/blog/".concat(e.id),children:(0,a.jsxs)(n.E.div,{className:"bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-lg cursor-pointer border border-white border-opacity-20",whileHover:{scale:1.03,backgroundColor:"rgba(255,255,255,0.15)"},initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1*i},children:[(0,a.jsx)("h3",{className:"text-xl font-semibold mb-2",children:e.title}),(0,a.jsx)("p",{className:"text-sm opacity-80",children:e.date})]})},e.id))})]}),(0,a.jsxs)(n.E.div,{className:"mt-12 w-full max-w-4xl",initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:1.2,duration:.5},children:[(0,a.jsx)("h2",{className:"text-3xl font-semibold mb-4",children:"技术栈"}),(0,a.jsx)("div",{className:"flex flex-wrap justify-center gap-4",children:["React","Next.js","TypeScript","Tailwind CSS"].map((e,i)=>(0,a.jsx)(n.E.span,{className:"bg-white bg-opacity-10 px-4 py-2 rounded-full text-sm font-medium",whileHover:{scale:1.05,backgroundColor:"rgba(255,255,255,0.2)"},initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1*i},children:e},e))})]}),(0,a.jsx)(n.E.div,{className:"mt-12 text-sm opacity-80",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.5,duration:.5},children:(0,a.jsxs)("p",{children:["联系我: 3477826311@qq.com |"," ",(0,a.jsx)("a",{href:"https://github.com/zhuba-Ahhh",className:"underline",children:"GitHub"})," ","|"," ",(0,a.jsx)("a",{href:"https://twitter.com/yourusername",className:"underline",children:"Twitter"})]})})]})}}},function(e){e.O(0,[872,593,528,949,785,744],function(){return e(e.s=2507)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/_next/static/chunks/app/page-ed8d205204393f7e.js b/_next/static/chunks/app/page-ed8d205204393f7e.js deleted file mode 100644 index 5d4c5ed..0000000 --- a/_next/static/chunks/app/page-ed8d205204393f7e.js +++ /dev/null @@ -1 +0,0 @@ -(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{2507:function(e,i,t){Promise.resolve().then(t.bind(t,4706))},4706:function(e,i,t){"use strict";t.r(i),t.d(i,{default:function(){return r}});var a=t(2842),l=t(4496),n=t(614),s=t(528);function r(){let e=[...s.n].sort((e,i)=>new Date(i.date).getTime()-new Date(e.date).getTime()).slice(0,2);return(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-center bg-gradient-to-br from-indigo-600 via-purple-600 to-pink-500 text-white p-4",children:[(0,a.jsx)(n.E.h1,{className:"text-5xl font-bold mb-4",initial:{opacity:0,y:-50},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:"欢迎来到我的博客"}),(0,a.jsx)(n.E.p,{className:"text-lg mb-6 max-w-2xl",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3,duration:.5},children:"你好,我是[zhuba-Ahhh]。作为一名前端开发者,我热衷于探索和分享Web开发的最新趋势、技巧和最佳实践。"}),(0,a.jsx)(n.E.div,{initial:{opacity:0,scale:.5},animate:{opacity:1,scale:1},transition:{delay:.6,duration:.5},children:(0,a.jsx)(l.default,{href:"/blog",className:"bg-white text-indigo-600 px-8 py-3 rounded-full text-lg font-semibold hover:bg-opacity-90 transition duration-300 shadow-lg hover:shadow-xl transform hover:-translate-y-1 hover:scale-105",children:"探索博客文章"})}),(0,a.jsxs)(n.E.div,{className:"mt-12 w-full max-w-4xl",initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:.9,duration:.5},children:[(0,a.jsx)("h2",{className:"text-3xl font-semibold mb-4",children:"最新文章"}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:e.map((e,i)=>(0,a.jsx)(l.default,{href:"/blog/".concat(e.id),children:(0,a.jsxs)(n.E.div,{className:"bg-white bg-opacity-10 p-6 rounded-xl backdrop-blur-lg cursor-pointer border border-white border-opacity-20",whileHover:{scale:1.03,backgroundColor:"rgba(255,255,255,0.15)"},initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1*i},children:[(0,a.jsx)("h3",{className:"text-xl font-semibold mb-2",children:e.title}),(0,a.jsx)("p",{className:"text-sm opacity-80",children:e.date})]})},e.id))})]}),(0,a.jsxs)(n.E.div,{className:"mt-12 w-full max-w-4xl",initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{delay:1.2,duration:.5},children:[(0,a.jsx)("h2",{className:"text-3xl font-semibold mb-4",children:"技术栈"}),(0,a.jsx)("div",{className:"flex flex-wrap justify-center gap-4",children:["React","Next.js","TypeScript","Tailwind CSS"].map((e,i)=>(0,a.jsx)(n.E.span,{className:"bg-white bg-opacity-10 px-4 py-2 rounded-full text-sm font-medium",whileHover:{scale:1.05,backgroundColor:"rgba(255,255,255,0.2)"},initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1*i},children:e},e))})]}),(0,a.jsx)(n.E.div,{className:"mt-12 text-sm opacity-80",initial:{opacity:0},animate:{opacity:1},transition:{delay:1.5,duration:.5},children:(0,a.jsxs)("p",{children:["联系我: 3477826311@qq.com |"," ",(0,a.jsx)("a",{href:"https://github.com/zhuba-Ahhh",className:"underline",children:"GitHub"})," ","|"," ",(0,a.jsx)("a",{href:"https://twitter.com/yourusername",className:"underline",children:"Twitter"})]})})]})}}},function(e){e.O(0,[872,572,528,949,785,744],function(){return e(e.s=2507)}),_N_E=e.O()}]); \ No newline at end of file diff --git a/_next/static/css/0ca73004e71b7b2a.css b/_next/static/css/0ca73004e71b7b2a.css deleted file mode 100644 index d2a60b2..0000000 --- a/_next/static/css/0ca73004e71b7b2a.css +++ /dev/null @@ -1,5 +0,0 @@ -@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/55c55f0601d81cf3-s.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/26a46d62cd723877-s.woff2) format("woff2");unicode-range:u+0301,u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/97e0cb1ae144a2a9-s.woff2) format("woff2");unicode-range:u+1f??}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/581909926a08bbc8-s.woff2) format("woff2");unicode-range:u+0370-0377,u+037a-037f,u+0384-038a,u+038c,u+038e-03a1,u+03a3-03ff}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/df0a9ae256c0569c-s.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+0300-0301,u+0303-0304,u+0308-0309,u+0323,u+0329,u+1ea0-1ef9,u+20ab}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/6d93bde91c0c2823-s.woff2) format("woff2");unicode-range:u+0100-02af,u+0304,u+0308,u+0329,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c0,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/a34f9d1faa5f3315-s.p.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-family:__Inter_Fallback_36bd41;src:local("Arial");ascent-override:90.49%;descent-override:22.56%;line-gap-override:0.00%;size-adjust:107.06%}.__className_36bd41{font-family:__Inter_36bd41,__Inter_Fallback_36bd41;font-style:normal}.__variable_36bd41{--font-sans:"__Inter_36bd41","__Inter_Fallback_36bd41"} - -/* -! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com -*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:var(--font-sans),ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background:0 0% 100%;--foreground:222.2 84% 4.9%;--card:0 0% 100%;--card-foreground:222.2 84% 4.9%;--popover:0 0% 100%;--popover-foreground:222.2 84% 4.9%;--primary:222.2 47.4% 11.2%;--primary-foreground:210 40% 98%;--secondary:210 40% 96.1%;--secondary-foreground:222.2 47.4% 11.2%;--muted:210 40% 96.1%;--muted-foreground:215.4 16.3% 46.9%;--accent:210 40% 96.1%;--accent-foreground:222.2 47.4% 11.2%;--destructive:0 84.2% 60.2%;--destructive-foreground:210 40% 98%;--border:214.3 31.8% 91.4%;--input:214.3 31.8% 91.4%;--ring:222.2 84% 4.9%;--radius:0.5rem;--chart-1:12 76% 61%;--chart-2:173 58% 39%;--chart-3:197 37% 24%;--chart-4:43 74% 66%;--chart-5:27 87% 67%;--code-bg:#f3f4f6;--code-text:#111827}.dark{--background:222.2 84% 4.9%;--foreground:210 40% 98%;--card:222.2 84% 4.9%;--card-foreground:210 40% 98%;--popover:222.2 84% 4.9%;--popover-foreground:210 40% 98%;--primary:210 40% 98%;--primary-foreground:222.2 47.4% 11.2%;--secondary:217.2 32.6% 17.5%;--secondary-foreground:210 40% 98%;--muted:217.2 32.6% 17.5%;--muted-foreground:215 20.2% 65.1%;--accent:217.2 32.6% 17.5%;--accent-foreground:210 40% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:210 40% 98%;--border:217.2 32.6% 17.5%;--input:217.2 32.6% 17.5%;--ring:212.7 26.8% 83.9%;--chart-1:220 70% 50%;--chart-2:160 60% 45%;--chart-3:30 80% 55%;--chart-4:280 65% 60%;--chart-5:340 75% 55%;--code-bg:#1f2937;--code-text:#f3f4f6}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}a,a:hover{text-decoration:none;text-decoration-line:none!important}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width:1400px){.container{max-width:1400px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\201C""\201D""\2018""\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows)/10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows)/10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-kbd:#111827;--tw-prose-kbd-shadows:17 24 39;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:255 255 255;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgba(0,0,0,.5);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-8{bottom:2rem}.left-0{left:0}.left-2{left:.5rem}.right-2{right:.5rem}.right-8{right:2rem}.top-0{top:0}.top-2{top:.5rem}.top-20{top:5rem}.z-50{z-index:50}.col-span-full{grid-column:1/-1}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mr-6{margin-right:1.5rem}.mt-12{margin-top:3rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-1{height:.25rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-14{height:3.5rem}.h-20{height:5rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:24rem}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.w-1\/2{width:50%}.w-1\/4{width:25%}.w-10{width:2.5rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-\[200px\]{width:200px}.w-\[240px\]{width:240px}.w-\[250px\]{width:250px}.w-\[300px\]{width:300px}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-screen-2xl{max-width:1536px}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{user-select:none}.resize{resize:both}.scroll-mt-20{scroll-margin-top:5rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden,.truncate{overflow:hidden}.truncate{text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-border\/40{border-color:hsl(var(--border)/.4)}.border-destructive\/50{border-color:hsl(var(--destructive)/.5)}.border-input{border-color:hsl(var(--input))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.border-opacity-20{--tw-border-opacity:0.2}.bg-background{background-color:hsl(var(--background))}.bg-background\/95{background-color:hsl(var(--background)/.95)}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity))}.bg-card{background-color:hsl(var(--card))}.bg-code-light{background-color:var(--code-bg)}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-10{--tw-bg-opacity:0.1}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from:#eff6ff var(--tw-gradient-from-position);--tw-gradient-to:rgba(239,246,255,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-indigo-600{--tw-gradient-from:#4f46e5 var(--tw-gradient-from-position);--tw-gradient-to:rgba(79,70,229,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.via-purple-600{--tw-gradient-to:rgba(147,51,234,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),#9333ea var(--tw-gradient-via-position),var(--tw-gradient-to)}.to-indigo-100{--tw-gradient-to:#e0e7ff var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to:#ec4899 var(--tw-gradient-to-position)}.p-1{padding:.25rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem}.pb-8,.py-8{padding-bottom:2rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pt-0{padding-top:0}.pt-4{padding-top:1rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:var(--font-sans),ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-loose{line-height:2}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-code-light{color:var(--code-text)}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/60{color:hsl(var(--foreground)/.6)}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-500{--tw-text-opacity:1;color:rgb(107 114 128/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-indigo-300{--tw-text-opacity:1;color:rgb(165 180 252/var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity:1;color:rgb(79 70 229/var(--tw-text-opacity))}.text-indigo-700{--tw-text-opacity:1;color:rgb(67 56 202/var(--tw-text-opacity))}.text-indigo-800{--tw-text-opacity:1;color:rgb(55 48 163/var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px)}.backdrop-blur,.backdrop-blur-lg{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-lg{--tw-backdrop-blur:blur(16px)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.dark\:prose-invert:is(.dark *){--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-kbd:var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows:var(--tw-prose-invert-kbd-shadows);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-pre-code:var(--tw-prose-invert-pre-code);--tw-prose-pre-bg:var(--tw-prose-invert-pre-bg);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}@media (min-width:1024px){.lg\:prose-xl{font-size:1.25rem;line-height:1.8}.lg\:prose-xl :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em;margin-bottom:1.2em}.lg\:prose-xl :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2em;line-height:1.5;margin-top:1em;margin-bottom:1em}.lg\:prose-xl :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1.0666667em}.lg\:prose-xl :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.8em;margin-top:0;margin-bottom:.8571429em;line-height:1}.lg\:prose-xl :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.8em;margin-top:1.5555556em;margin-bottom:.8888889em;line-height:1.1111111}.lg\:prose-xl :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.5em;margin-top:1.6em;margin-bottom:.6666667em;line-height:1.3333333}.lg\:prose-xl :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.8em;margin-bottom:.6em;line-height:1.6}.lg\:prose-xl :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.lg\:prose-xl :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.lg\:prose-xl :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.lg\:prose-xl :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.lg\:prose-xl :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em;border-radius:.3125rem;padding-top:.25em;padding-inline-end:.4em;padding-bottom:.25em;padding-inline-start:.4em}.lg\:prose-xl :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.lg\:prose-xl :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8611111em}.lg\:prose-xl :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.lg\:prose-xl :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em;line-height:1.7777778;margin-top:2em;margin-bottom:2em;border-radius:.5rem;padding-top:1.1111111em;padding-inline-end:1.3333333em;padding-bottom:1.1111111em;padding-inline-start:1.3333333em}.lg\:prose-xl :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em;margin-bottom:1.2em;padding-inline-start:1.6em}.lg\:prose-xl :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em;margin-bottom:1.2em;padding-inline-start:1.6em}.lg\:prose-xl :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6em;margin-bottom:.6em}.lg\:prose-xl :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4em}.lg\:prose-xl :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4em}.lg\:prose-xl :where(.lg\:prose-xl>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8em;margin-bottom:.8em}.lg\:prose-xl :where(.lg\:prose-xl>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em}.lg\:prose-xl :where(.lg\:prose-xl>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.2em}.lg\:prose-xl :where(.lg\:prose-xl>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em}.lg\:prose-xl :where(.lg\:prose-xl>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.2em}.lg\:prose-xl :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8em;margin-bottom:.8em}.lg\:prose-xl :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em;margin-bottom:1.2em}.lg\:prose-xl :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em}.lg\:prose-xl :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6em;padding-inline-start:1.6em}.lg\:prose-xl :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8em;margin-bottom:2.8em}.lg\:prose-xl :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em;line-height:1.5555556}.lg\:prose-xl :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:.6666667em;padding-bottom:.8888889em;padding-inline-start:.6666667em}.lg\:prose-xl :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.lg\:prose-xl :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.lg\:prose-xl :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.8888889em;padding-inline-end:.6666667em;padding-bottom:.8888889em;padding-inline-start:.6666667em}.lg\:prose-xl :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.lg\:prose-xl :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.lg\:prose-xl :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.lg\:prose-xl :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.lg\:prose-xl :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em;line-height:1.5555556;margin-top:1em}.lg\:prose-xl :where(.lg\:prose-xl>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(.lg\:prose-xl>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}}.file\:border-0::file-selector-button{border-width:0}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:-translate-y-1:hover{--tw-translate-y:-0.25rem}.hover\:-translate-y-1:hover,.hover\:scale-105:hover{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive)/.8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive)/.9)}.hover\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary)/.8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary)/.9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary)/.8)}.hover\:bg-opacity-90:hover{--tw-bg-opacity:0.9}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-blue-500:hover{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity))}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}.hover\:text-foreground\/80:hover{color:hsl(var(--foreground)/.8)}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\:ring-offset-0:focus{--tw-ring-offset-width:0px}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.active\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:bg-accent\/90:active{background-color:hsl(var(--accent)/.9)}.active\:bg-destructive\/70:active{background-color:hsl(var(--destructive)/.7)}.active\:bg-primary\/70:active{background-color:hsl(var(--primary)/.7)}.active\:bg-secondary\/70:active{background-color:hsl(var(--secondary)/.7)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom],.data-\[side\=left\]\:-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\[side\=right\]\:translate-x-1[data-side=right],.data-\[side\=top\]\:-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}@supports (backdrop-filter:var(--tw )){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:hsl(var(--background)/.6)}}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:bg-code-dark:is(.dark *){background-color:var(--code-bg)}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}.dark\:text-code-dark:is(.dark *){color:var(--code-text)}.dark\:text-gray-200:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.dark\:text-white:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}@media (min-width:768px){.md\:col-span-2{grid-column:span 2/span 2}.md\:h-24{height:6rem}.md\:w-1\/4{width:25%}.md\:w-3\/4{width:75%}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:px-0{padding-left:0;padding-right:0}.md\:py-0{padding-top:0;padding-bottom:0}.md\:text-left{text-align:left}}@media (min-width:1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y:-3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625} \ No newline at end of file diff --git a/_next/static/css/ffc10c3bda2f2340.css b/_next/static/css/ffc10c3bda2f2340.css new file mode 100644 index 0000000..d277e83 --- /dev/null +++ b/_next/static/css/ffc10c3bda2f2340.css @@ -0,0 +1,5 @@ +@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/55c55f0601d81cf3-s.woff2) format("woff2");unicode-range:u+0460-052f,u+1c80-1c88,u+20b4,u+2de0-2dff,u+a640-a69f,u+fe2e-fe2f}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/26a46d62cd723877-s.woff2) format("woff2");unicode-range:u+0301,u+0400-045f,u+0490-0491,u+04b0-04b1,u+2116}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/97e0cb1ae144a2a9-s.woff2) format("woff2");unicode-range:u+1f??}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/581909926a08bbc8-s.woff2) format("woff2");unicode-range:u+0370-0377,u+037a-037f,u+0384-038a,u+038c,u+038e-03a1,u+03a3-03ff}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/df0a9ae256c0569c-s.woff2) format("woff2");unicode-range:u+0102-0103,u+0110-0111,u+0128-0129,u+0168-0169,u+01a0-01a1,u+01af-01b0,u+0300-0301,u+0303-0304,u+0308-0309,u+0323,u+0329,u+1ea0-1ef9,u+20ab}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/6d93bde91c0c2823-s.woff2) format("woff2");unicode-range:u+0100-02af,u+0304,u+0308,u+0329,u+1e00-1e9f,u+1ef2-1eff,u+2020,u+20a0-20ab,u+20ad-20c0,u+2113,u+2c60-2c7f,u+a720-a7ff}@font-face{font-family:__Inter_36bd41;font-style:normal;font-weight:100 900;font-display:swap;src:url(/_next/static/media/a34f9d1faa5f3315-s.p.woff2) format("woff2");unicode-range:u+00??,u+0131,u+0152-0153,u+02bb-02bc,u+02c6,u+02da,u+02dc,u+0304,u+0308,u+0329,u+2000-206f,u+2074,u+20ac,u+2122,u+2191,u+2193,u+2212,u+2215,u+feff,u+fffd}@font-face{font-family:__Inter_Fallback_36bd41;src:local("Arial");ascent-override:90.49%;descent-override:22.56%;line-gap-override:0.00%;size-adjust:107.06%}.__className_36bd41{font-family:__Inter_36bd41,__Inter_Fallback_36bd41;font-style:normal}.__variable_36bd41{--font-sans:"__Inter_36bd41","__Inter_Fallback_36bd41"} + +/* +! tailwindcss v3.4.10 | MIT License | https://tailwindcss.com +*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}:host,html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;tab-size:4;font-family:var(--font-sans),ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}:root{--background:0 0% 100%;--foreground:222.2 84% 4.9%;--card:0 0% 100%;--card-foreground:222.2 84% 4.9%;--popover:0 0% 100%;--popover-foreground:222.2 84% 4.9%;--primary:222.2 47.4% 11.2%;--primary-foreground:210 40% 98%;--secondary:210 40% 96.1%;--secondary-foreground:222.2 47.4% 11.2%;--muted:210 40% 96.1%;--muted-foreground:215.4 16.3% 46.9%;--accent:210 40% 96.1%;--accent-foreground:222.2 47.4% 11.2%;--destructive:0 84.2% 60.2%;--destructive-foreground:210 40% 98%;--border:214.3 31.8% 91.4%;--input:214.3 31.8% 91.4%;--ring:222.2 84% 4.9%;--radius:0.5rem;--chart-1:12 76% 61%;--chart-2:173 58% 39%;--chart-3:197 37% 24%;--chart-4:43 74% 66%;--chart-5:27 87% 67%;--code-bg:#f3f4f6;--code-text:#111827}.dark{--background:222.2 84% 4.9%;--foreground:210 40% 98%;--card:222.2 84% 4.9%;--card-foreground:210 40% 98%;--popover:222.2 84% 4.9%;--popover-foreground:210 40% 98%;--primary:210 40% 98%;--primary-foreground:222.2 47.4% 11.2%;--secondary:217.2 32.6% 17.5%;--secondary-foreground:210 40% 98%;--muted:217.2 32.6% 17.5%;--muted-foreground:215 20.2% 65.1%;--accent:217.2 32.6% 17.5%;--accent-foreground:210 40% 98%;--destructive:0 62.8% 30.6%;--destructive-foreground:210 40% 98%;--border:217.2 32.6% 17.5%;--input:217.2 32.6% 17.5%;--ring:212.7 26.8% 83.9%;--chart-1:220 70% 50%;--chart-2:160 60% 45%;--chart-3:30 80% 55%;--chart-4:280 65% 60%;--chart-5:340 75% 55%;--code-bg:#1f2937;--code-text:#f3f4f6}*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}a,a:hover{text-decoration:none;text-decoration-line:none!important}*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }.container{width:100%;margin-right:auto;margin-left:auto;padding-right:2rem;padding-left:2rem}@media (min-width:1400px){.container{max-width:1400px}}.prose{color:var(--tw-prose-body);max-width:65ch}.prose :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-lead);font-size:1.25em;line-height:1.6;margin-top:1.2em;margin-bottom:1.2em}.prose :where(a):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-links);text-decoration:underline;font-weight:500}.prose :where(strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-bold);font-weight:600}.prose :where(a strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th strong):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol[type=A]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=A s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-alpha}.prose :where(ol[type=a s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-alpha}.prose :where(ol[type=I]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type=I s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:upper-roman}.prose :where(ol[type=i s]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:lower-roman}.prose :where(ol[type="1"]):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:decimal}.prose :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){list-style-type:disc;margin-top:1.25em;margin-bottom:1.25em;padding-inline-start:1.625em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{font-weight:400;color:var(--tw-prose-counters)}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *))::marker{color:var(--tw-prose-bullets)}.prose :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.25em}.prose :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){border-color:var(--tw-prose-hr);border-top-width:1px;margin-top:3em;margin-bottom:3em}.prose :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-style:italic;color:var(--tw-prose-quotes);border-inline-start-width:.25rem;border-inline-start-color:var(--tw-prose-quote-borders);quotes:"\201C""\201D""\2018""\2019";margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1em}.prose :where(blockquote p:first-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:open-quote}.prose :where(blockquote p:last-of-type):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:close-quote}.prose :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:800;font-size:2.25em;margin-top:0;margin-bottom:.8888889em;line-height:1.1111111}.prose :where(h1 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:900;color:inherit}.prose :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:700;font-size:1.5em;margin-top:2em;margin-bottom:1em;line-height:1.3333333}.prose :where(h2 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:800;color:inherit}.prose :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;font-size:1.25em;margin-top:1.6em;margin-bottom:.6em;line-height:1.6}.prose :where(h3 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;margin-top:1.5em;margin-bottom:.5em;line-height:1.5}.prose :where(h4 strong):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:700;color:inherit}.prose :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){display:block;margin-top:2em;margin-bottom:2em}.prose :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-weight:500;font-family:inherit;color:var(--tw-prose-kbd);box-shadow:0 0 0 1px rgb(var(--tw-prose-kbd-shadows)/10%),0 3px 0 rgb(var(--tw-prose-kbd-shadows)/10%);font-size:.875em;border-radius:.3125rem;padding-top:.1875em;padding-inline-end:.375em;padding-bottom:.1875em;padding-inline-start:.375em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-code);font-weight:600;font-size:.875em}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:"`"}.prose :where(code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:"`"}.prose :where(a code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h1 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.875em}.prose :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit;font-size:.9em}.prose :where(h4 code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(blockquote code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(thead th code):not(:where([class~=not-prose],[class~=not-prose] *)){color:inherit}.prose :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-pre-code);background-color:var(--tw-prose-pre-bg);overflow-x:auto;font-weight:400;font-size:.875em;line-height:1.7142857;margin-top:1.7142857em;margin-bottom:1.7142857em;border-radius:.375rem;padding-top:.8571429em;padding-inline-end:1.1428571em;padding-bottom:.8571429em;padding-inline-start:1.1428571em}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)){background-color:transparent;border-width:0;border-radius:0;padding:0;font-weight:inherit;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):before{content:none}.prose :where(pre code):not(:where([class~=not-prose],[class~=not-prose] *)):after{content:none}.prose :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){width:100%;table-layout:auto;margin-top:2em;margin-bottom:2em;font-size:.875em;line-height:1.7142857}.prose :where(thead):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-th-borders)}.prose :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-headings);font-weight:600;vertical-align:bottom;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody tr):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:1px;border-bottom-color:var(--tw-prose-td-borders)}.prose :where(tbody tr:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){border-bottom-width:0}.prose :where(tbody td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:baseline}.prose :where(tfoot):not(:where([class~=not-prose],[class~=not-prose] *)){border-top-width:1px;border-top-color:var(--tw-prose-th-borders)}.prose :where(tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){vertical-align:top}.prose :where(th,td):not(:where([class~=not-prose],[class~=not-prose] *)){text-align:start}.prose :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){color:var(--tw-prose-captions);font-size:.875em;line-height:1.4285714;margin-top:.8571429em}.prose{--tw-prose-body:#374151;--tw-prose-headings:#111827;--tw-prose-lead:#4b5563;--tw-prose-links:#111827;--tw-prose-bold:#111827;--tw-prose-counters:#6b7280;--tw-prose-bullets:#d1d5db;--tw-prose-hr:#e5e7eb;--tw-prose-quotes:#111827;--tw-prose-quote-borders:#e5e7eb;--tw-prose-captions:#6b7280;--tw-prose-kbd:#111827;--tw-prose-kbd-shadows:17 24 39;--tw-prose-code:#111827;--tw-prose-pre-code:#e5e7eb;--tw-prose-pre-bg:#1f2937;--tw-prose-th-borders:#d1d5db;--tw-prose-td-borders:#e5e7eb;--tw-prose-invert-body:#d1d5db;--tw-prose-invert-headings:#fff;--tw-prose-invert-lead:#9ca3af;--tw-prose-invert-links:#fff;--tw-prose-invert-bold:#fff;--tw-prose-invert-counters:#9ca3af;--tw-prose-invert-bullets:#4b5563;--tw-prose-invert-hr:#374151;--tw-prose-invert-quotes:#f3f4f6;--tw-prose-invert-quote-borders:#374151;--tw-prose-invert-captions:#9ca3af;--tw-prose-invert-kbd:#fff;--tw-prose-invert-kbd-shadows:255 255 255;--tw-prose-invert-code:#fff;--tw-prose-invert-pre-code:#d1d5db;--tw-prose-invert-pre-bg:rgba(0,0,0,.5);--tw-prose-invert-th-borders:#4b5563;--tw-prose-invert-td-borders:#374151;font-size:1rem;line-height:1.75}.prose :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.prose :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;margin-bottom:.5em}.prose :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.375em}.prose :where(.prose>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(.prose>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(.prose>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em}.prose :where(.prose>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.25em}.prose :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.75em;margin-bottom:.75em}.prose :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.25em;margin-bottom:1.25em}.prose :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.5em;padding-inline-start:1.625em}.prose :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.5714286em;padding-inline-end:.5714286em;padding-bottom:.5714286em;padding-inline-start:.5714286em}.prose :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.prose :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.prose :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.prose :where(.prose>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.prose :where(.prose>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.bottom-8{bottom:2rem}.left-0{left:0}.left-2{left:.5rem}.right-2{right:.5rem}.right-8{right:2rem}.top-0{top:0}.top-2{top:.5rem}.top-20{top:5rem}.z-50{z-index:50}.col-span-full{grid-column:1/-1}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-1{margin-left:.25rem;margin-right:.25rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-10{margin-top:2.5rem;margin-bottom:2.5rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-3{margin-top:.75rem;margin-bottom:.75rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-1{margin-bottom:.25rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-1{margin-left:.25rem}.ml-2{margin-left:.5rem}.mr-2{margin-right:.5rem}.mr-6{margin-right:1.5rem}.mt-12{margin-top:3rem}.mt-16{margin-top:4rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-8{margin-top:2rem}.block{display:block}.flex{display:flex}.inline-flex{display:inline-flex}.grid{display:grid}.h-1{height:.25rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-14{height:3.5rem}.h-20{height:5rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-full{height:100%}.h-px{height:1px}.max-h-96{max-height:24rem}.min-h-\[80px\]{min-height:80px}.min-h-screen{min-height:100vh}.w-1\/2{width:50%}.w-1\/4{width:25%}.w-10{width:2.5rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-40{width:10rem}.w-5{width:1.25rem}.w-\[200px\]{width:200px}.w-\[240px\]{width:240px}.w-\[250px\]{width:250px}.w-\[300px\]{width:300px}.w-full{width:100%}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-4xl{max-width:56rem}.max-w-screen-2xl{max-width:1536px}.flex-1{flex:1 1 0%}.flex-grow{flex-grow:1}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-default{cursor:default}.cursor-pointer{cursor:pointer}.select-none{user-select:none}.resize{resize:both}.scroll-mt-20{scroll-margin-top:5rem}.list-inside{list-style-position:inside}.list-decimal{list-style-type:decimal}.list-disc{list-style-type:disc}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-end{align-items:flex-end}.items-center{align-items:center}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-2{gap:.5rem}.gap-4{gap:1rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-4>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1rem * var(--tw-space-x-reverse));margin-left:calc(1rem * calc(1 - var(--tw-space-x-reverse)))}.space-x-6>:not([hidden])~:not([hidden]){--tw-space-x-reverse:0;margin-right:calc(1.5rem * var(--tw-space-x-reverse));margin-left:calc(1.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden,.truncate{overflow:hidden}.truncate{text-overflow:ellipsis}.truncate,.whitespace-nowrap{white-space:nowrap}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-t{border-top-width:1px}.border-border\/40{border-color:hsl(var(--border)/.4)}.border-destructive\/50{border-color:hsl(var(--destructive)/.5)}.border-gray-300{--tw-border-opacity:1;border-color:rgb(209 213 219/var(--tw-border-opacity))}.border-input{border-color:hsl(var(--input))}.border-transparent{border-color:transparent}.border-white{--tw-border-opacity:1;border-color:rgb(255 255 255/var(--tw-border-opacity))}.border-opacity-20{--tw-border-opacity:0.2}.bg-background{background-color:hsl(var(--background))}.bg-background\/95{background-color:hsl(var(--background)/.95)}.bg-blue-500{--tw-bg-opacity:1;background-color:rgb(59 130 246/var(--tw-bg-opacity))}.bg-card{background-color:hsl(var(--card))}.bg-code-light{background-color:var(--code-bg)}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-100{--tw-bg-opacity:1;background-color:rgb(243 244 246/var(--tw-bg-opacity))}.bg-gray-200{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.bg-gray-50{--tw-bg-opacity:1;background-color:rgb(249 250 251/var(--tw-bg-opacity))}.bg-gray-800{--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-white{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity))}.bg-opacity-10{--tw-bg-opacity:0.1}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.from-blue-50{--tw-gradient-from:#eff6ff var(--tw-gradient-from-position);--tw-gradient-to:rgba(239,246,255,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.from-indigo-600{--tw-gradient-from:#4f46e5 var(--tw-gradient-from-position);--tw-gradient-to:rgba(79,70,229,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),var(--tw-gradient-to)}.via-purple-600{--tw-gradient-to:rgba(147,51,234,0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from),#9333ea var(--tw-gradient-via-position),var(--tw-gradient-to)}.to-indigo-100{--tw-gradient-to:#e0e7ff var(--tw-gradient-to-position)}.to-pink-500{--tw-gradient-to:#ec4899 var(--tw-gradient-to-position)}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem}.pb-8,.py-8{padding-bottom:2rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pt-0{padding-top:0}.pt-4{padding-top:1rem}.text-center{text-align:center}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.font-sans{font-family:var(--font-sans),ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol","Noto Color Emoji"}.text-2xl{font-size:1.5rem;line-height:2rem}.text-3xl{font-size:1.875rem;line-height:2.25rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-5xl{font-size:3rem;line-height:1}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.leading-loose{line-height:2}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.text-blue-400{--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}.text-blue-500{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.text-blue-600{--tw-text-opacity:1;color:rgb(37 99 235/var(--tw-text-opacity))}.text-blue-700{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-code-light{color:var(--code-text)}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/60{color:hsl(var(--foreground)/.6)}.text-gray-300{--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.text-gray-400{--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.text-gray-600{--tw-text-opacity:1;color:rgb(75 85 99/var(--tw-text-opacity))}.text-gray-700{--tw-text-opacity:1;color:rgb(55 65 81/var(--tw-text-opacity))}.text-gray-800{--tw-text-opacity:1;color:rgb(31 41 55/var(--tw-text-opacity))}.text-gray-900{--tw-text-opacity:1;color:rgb(17 24 39/var(--tw-text-opacity))}.text-green-600{--tw-text-opacity:1;color:rgb(22 163 74/var(--tw-text-opacity))}.text-indigo-300{--tw-text-opacity:1;color:rgb(165 180 252/var(--tw-text-opacity))}.text-indigo-600{--tw-text-opacity:1;color:rgb(79 70 229/var(--tw-text-opacity))}.text-indigo-700{--tw-text-opacity:1;color:rgb(67 56 202/var(--tw-text-opacity))}.text-indigo-800{--tw-text-opacity:1;color:rgb(55 48 163/var(--tw-text-opacity))}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-50{opacity:.5}.opacity-80{opacity:.8}.shadow-lg{--tw-shadow:0 10px 15px -3px rgba(0,0,0,.1),0 4px 6px -4px rgba(0,0,0,.1);--tw-shadow-colored:0 10px 15px -3px var(--tw-shadow-color),0 4px 6px -4px var(--tw-shadow-color)}.shadow-lg,.shadow-md{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.shadow-sm{--tw-shadow:0 1px 2px 0 rgba(0,0,0,.05);--tw-shadow-colored:0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-offset-background{--tw-ring-offset-color:hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur{--tw-backdrop-blur:blur(8px)}.backdrop-blur,.backdrop-blur-lg{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-lg{--tw-backdrop-blur:blur(16px)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.duration-300{transition-duration:.3s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}@keyframes enter{0%{opacity:var(--tw-enter-opacity,1);transform:translate3d(var(--tw-enter-translate-x,0),var(--tw-enter-translate-y,0),0) scale3d(var(--tw-enter-scale,1),var(--tw-enter-scale,1),var(--tw-enter-scale,1)) rotate(var(--tw-enter-rotate,0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity,1);transform:translate3d(var(--tw-exit-translate-x,0),var(--tw-exit-translate-y,0),0) scale3d(var(--tw-exit-scale,1),var(--tw-exit-scale,1),var(--tw-exit-scale,1)) rotate(var(--tw-exit-rotate,0))}}.duration-200{animation-duration:.2s}.duration-300{animation-duration:.3s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.dark\:prose-invert:is(.dark *){--tw-prose-body:var(--tw-prose-invert-body);--tw-prose-headings:var(--tw-prose-invert-headings);--tw-prose-lead:var(--tw-prose-invert-lead);--tw-prose-links:var(--tw-prose-invert-links);--tw-prose-bold:var(--tw-prose-invert-bold);--tw-prose-counters:var(--tw-prose-invert-counters);--tw-prose-bullets:var(--tw-prose-invert-bullets);--tw-prose-hr:var(--tw-prose-invert-hr);--tw-prose-quotes:var(--tw-prose-invert-quotes);--tw-prose-quote-borders:var(--tw-prose-invert-quote-borders);--tw-prose-captions:var(--tw-prose-invert-captions);--tw-prose-kbd:var(--tw-prose-invert-kbd);--tw-prose-kbd-shadows:var(--tw-prose-invert-kbd-shadows);--tw-prose-code:var(--tw-prose-invert-code);--tw-prose-pre-code:var(--tw-prose-invert-pre-code);--tw-prose-pre-bg:var(--tw-prose-invert-pre-bg);--tw-prose-th-borders:var(--tw-prose-invert-th-borders);--tw-prose-td-borders:var(--tw-prose-invert-td-borders)}@media (min-width:1024px){.lg\:prose-xl{font-size:1.25rem;line-height:1.8}.lg\:prose-xl :where(p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em;margin-bottom:1.2em}.lg\:prose-xl :where([class~=lead]):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.2em;line-height:1.5;margin-top:1em;margin-bottom:1em}.lg\:prose-xl :where(blockquote):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.6em;margin-bottom:1.6em;padding-inline-start:1.0666667em}.lg\:prose-xl :where(h1):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:2.8em;margin-top:0;margin-bottom:.8571429em;line-height:1}.lg\:prose-xl :where(h2):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.8em;margin-top:1.5555556em;margin-bottom:.8888889em;line-height:1.1111111}.lg\:prose-xl :where(h3):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:1.5em;margin-top:1.6em;margin-bottom:.6666667em;line-height:1.3333333}.lg\:prose-xl :where(h4):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.8em;margin-bottom:.6em;line-height:1.6}.lg\:prose-xl :where(img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.lg\:prose-xl :where(picture):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.lg\:prose-xl :where(picture>img):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.lg\:prose-xl :where(video):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.lg\:prose-xl :where(kbd):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em;border-radius:.3125rem;padding-top:.25em;padding-inline-end:.4em;padding-bottom:.25em;padding-inline-start:.4em}.lg\:prose-xl :where(code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.lg\:prose-xl :where(h2 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.8611111em}.lg\:prose-xl :where(h3 code):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em}.lg\:prose-xl :where(pre):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em;line-height:1.7777778;margin-top:2em;margin-bottom:2em;border-radius:.5rem;padding-top:1.1111111em;padding-inline-end:1.3333333em;padding-bottom:1.1111111em;padding-inline-start:1.3333333em}.lg\:prose-xl :where(ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em;margin-bottom:1.2em;padding-inline-start:1.6em}.lg\:prose-xl :where(ul):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em;margin-bottom:1.2em;padding-inline-start:1.6em}.lg\:prose-xl :where(li):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6em;margin-bottom:.6em}.lg\:prose-xl :where(ol>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4em}.lg\:prose-xl :where(ul>li):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:.4em}.lg\:prose-xl :where(.lg\:prose-xl>ul>li p):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8em;margin-bottom:.8em}.lg\:prose-xl :where(.lg\:prose-xl>ul>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em}.lg\:prose-xl :where(.lg\:prose-xl>ul>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.2em}.lg\:prose-xl :where(.lg\:prose-xl>ol>li>p:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em}.lg\:prose-xl :where(.lg\:prose-xl>ol>li>p:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:1.2em}.lg\:prose-xl :where(ul ul,ul ol,ol ul,ol ol):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.8em;margin-bottom:.8em}.lg\:prose-xl :where(dl):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em;margin-bottom:1.2em}.lg\:prose-xl :where(dt):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:1.2em}.lg\:prose-xl :where(dd):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:.6em;padding-inline-start:1.6em}.lg\:prose-xl :where(hr):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2.8em;margin-bottom:2.8em}.lg\:prose-xl :where(hr+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(h2+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(h3+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(h4+*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(table):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em;line-height:1.5555556}.lg\:prose-xl :where(thead th):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:.6666667em;padding-bottom:.8888889em;padding-inline-start:.6666667em}.lg\:prose-xl :where(thead th:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.lg\:prose-xl :where(thead th:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.lg\:prose-xl :where(tbody td,tfoot td):not(:where([class~=not-prose],[class~=not-prose] *)){padding-top:.8888889em;padding-inline-end:.6666667em;padding-bottom:.8888889em;padding-inline-start:.6666667em}.lg\:prose-xl :where(tbody td:first-child,tfoot td:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-start:0}.lg\:prose-xl :where(tbody td:last-child,tfoot td:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){padding-inline-end:0}.lg\:prose-xl :where(figure):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:2em;margin-bottom:2em}.lg\:prose-xl :where(figure>*):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0;margin-bottom:0}.lg\:prose-xl :where(figcaption):not(:where([class~=not-prose],[class~=not-prose] *)){font-size:.9em;line-height:1.5555556;margin-top:1em}.lg\:prose-xl :where(.lg\:prose-xl>:first-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-top:0}.lg\:prose-xl :where(.lg\:prose-xl>:last-child):not(:where([class~=not-prose],[class~=not-prose] *)){margin-bottom:0}}.file\:border-0::file-selector-button{border-width:0}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.hover\:-translate-y-1:hover{--tw-translate-y:-0.25rem}.hover\:-translate-y-1:hover,.hover\:scale-105:hover{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:scale-105:hover{--tw-scale-x:1.05;--tw-scale-y:1.05}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-blue-600:hover{--tw-bg-opacity:1;background-color:rgb(37 99 235/var(--tw-bg-opacity))}.hover\:bg-destructive\/80:hover{background-color:hsl(var(--destructive)/.8)}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive)/.9)}.hover\:bg-gray-200:hover{--tw-bg-opacity:1;background-color:rgb(229 231 235/var(--tw-bg-opacity))}.hover\:bg-gray-300:hover{--tw-bg-opacity:1;background-color:rgb(209 213 219/var(--tw-bg-opacity))}.hover\:bg-primary\/80:hover{background-color:hsl(var(--primary)/.8)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary)/.9)}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary)/.8)}.hover\:bg-opacity-90:hover{--tw-bg-opacity:0.9}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-blue-500:hover{--tw-text-opacity:1;color:rgb(59 130 246/var(--tw-text-opacity))}.hover\:text-blue-700:hover{--tw-text-opacity:1;color:rgb(29 78 216/var(--tw-text-opacity))}.hover\:text-blue-800:hover{--tw-text-opacity:1;color:rgb(30 64 175/var(--tw-text-opacity))}.hover\:text-foreground\/80:hover{color:hsl(var(--foreground)/.8)}.hover\:underline:hover{text-decoration-line:underline}.hover\:shadow-md:hover{--tw-shadow:0 4px 6px -1px rgba(0,0,0,.1),0 2px 4px -2px rgba(0,0,0,.1);--tw-shadow-colored:0 4px 6px -1px var(--tw-shadow-color),0 2px 4px -2px var(--tw-shadow-color)}.hover\:shadow-md:hover,.hover\:shadow-xl:hover{box-shadow:var(--tw-ring-offset-shadow,0 0 #0000),var(--tw-ring-shadow,0 0 #0000),var(--tw-shadow)}.hover\:shadow-xl:hover{--tw-shadow:0 20px 25px -5px rgba(0,0,0,.1),0 8px 10px -6px rgba(0,0,0,.1);--tw-shadow-colored:0 20px 25px -5px var(--tw-shadow-color),0 8px 10px -6px var(--tw-shadow-color)}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-2:focus{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color:hsl(var(--ring))}.focus\:ring-offset-0:focus{--tw-ring-offset-width:0px}.focus\:ring-offset-2:focus{--tw-ring-offset-width:2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow:var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow:var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow,0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color:hsl(var(--ring))}.focus-visible\:ring-offset-0:focus-visible{--tw-ring-offset-width:0px}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width:2px}.active\:scale-95:active{--tw-scale-x:.95;--tw-scale-y:.95;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.active\:bg-accent\/90:active{background-color:hsl(var(--accent)/.9)}.active\:bg-destructive\/70:active{background-color:hsl(var(--destructive)/.7)}.active\:bg-primary\/70:active{background-color:hsl(var(--primary)/.7)}.active\:bg-secondary\/70:active{background-color:hsl(var(--secondary)/.7)}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y:0.25rem}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom],.data-\[side\=left\]\:-translate-x-1[data-side=left]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x:-0.25rem}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x:0.25rem}.data-\[side\=right\]\:translate-x-1[data-side=right],.data-\[side\=top\]\:-translate-y-1[data-side=top]{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y:-0.25rem}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity:initial;--tw-enter-scale:initial;--tw-enter-rotate:initial;--tw-enter-translate-x:initial;--tw-enter-translate-y:initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity:initial;--tw-exit-scale:initial;--tw-exit-rotate:initial;--tw-exit-translate-x:initial;--tw-exit-translate-y:initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity:0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity:0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale:.95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale:.95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y:-0.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x:0.5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x:-0.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y:0.5rem}@supports (backdrop-filter:var(--tw )){.supports-\[backdrop-filter\]\:bg-background\/60{background-color:hsl(var(--background)/.6)}}.dark\:border-destructive:is(.dark *){border-color:hsl(var(--destructive))}.dark\:border-gray-700:is(.dark *){--tw-border-opacity:1;border-color:rgb(55 65 81/var(--tw-border-opacity))}.dark\:bg-code-dark:is(.dark *){background-color:var(--code-bg)}.dark\:bg-gray-700:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}.dark\:bg-gray-800:is(.dark *){--tw-bg-opacity:1;background-color:rgb(31 41 55/var(--tw-bg-opacity))}.dark\:bg-gray-900:is(.dark *){--tw-bg-opacity:1;background-color:rgb(17 24 39/var(--tw-bg-opacity))}.dark\:text-blue-400:is(.dark *){--tw-text-opacity:1;color:rgb(96 165 250/var(--tw-text-opacity))}.dark\:text-code-dark:is(.dark *){color:var(--code-text)}.dark\:text-gray-200:is(.dark *){--tw-text-opacity:1;color:rgb(229 231 235/var(--tw-text-opacity))}.dark\:text-gray-300:is(.dark *){--tw-text-opacity:1;color:rgb(209 213 219/var(--tw-text-opacity))}.dark\:text-gray-400:is(.dark *){--tw-text-opacity:1;color:rgb(156 163 175/var(--tw-text-opacity))}.dark\:text-green-400:is(.dark *){--tw-text-opacity:1;color:rgb(74 222 128/var(--tw-text-opacity))}.dark\:text-white:is(.dark *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.dark\:shadow-gray-900:is(.dark *){--tw-shadow-color:#111827;--tw-shadow:var(--tw-shadow-colored)}.dark\:hover\:bg-gray-700:hover:is(.dark *){--tw-bg-opacity:1;background-color:rgb(55 65 81/var(--tw-bg-opacity))}@media (min-width:768px){.md\:col-span-2{grid-column:span 2/span 2}.md\:h-24{height:6rem}.md\:w-1\/4{width:25%}.md\:w-3\/4{width:75%}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:gap-2{gap:.5rem}.md\:px-0{padding-left:0;padding-right:0}.md\:py-0{padding-top:0;padding-bottom:0}.md\:text-left{text-align:left}}@media (min-width:1024px){.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.\[\&\>svg\+div\]\:translate-y-\[-3px\]>svg+div{--tw-translate-y:-3px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>svg\]\:absolute>svg{position:absolute}.\[\&\>svg\]\:left-4>svg{left:1rem}.\[\&\>svg\]\:top-4>svg{top:1rem}.\[\&\>svg\]\:text-destructive>svg{color:hsl(var(--destructive))}.\[\&\>svg\]\:text-foreground>svg{color:hsl(var(--foreground))}.\[\&\>svg\~\*\]\:pl-7>svg~*{padding-left:1.75rem}.\[\&_p\]\:leading-relaxed p{line-height:1.625} \ No newline at end of file diff --git a/_next/static/Bf8uc4DZUfl9oSsWkT47R/_buildManifest.js b/_next/static/s1lr8R9KgVSskQ_7e-xpq/_buildManifest.js similarity index 100% rename from _next/static/Bf8uc4DZUfl9oSsWkT47R/_buildManifest.js rename to _next/static/s1lr8R9KgVSskQ_7e-xpq/_buildManifest.js diff --git a/_next/static/Bf8uc4DZUfl9oSsWkT47R/_ssgManifest.js b/_next/static/s1lr8R9KgVSskQ_7e-xpq/_ssgManifest.js similarity index 100% rename from _next/static/Bf8uc4DZUfl9oSsWkT47R/_ssgManifest.js rename to _next/static/s1lr8R9KgVSskQ_7e-xpq/_ssgManifest.js diff --git a/about.html b/about.html index 7880007..46e1ac5 100644 --- a/about.html +++ b/about.html @@ -1,2 +1,2 @@ -我的博客

关于我的博客

欢迎来到我的博客!这里是我分享想法、经验和技术见解的地方。

我是一名热爱编程和技术的开发者,专注于前端和全栈开发。我的目标是通过这个博客与大家分享知识,共同成长。

在这里,你可以找到关于:

  • Web开发最佳实践
  • 新兴技术趋势分析
  • 编程技巧和工具推荐
  • 个人项目经验分享

如果你有任何问题、建议或合作意向,欢迎随时与我联系。让我们一起在编程的世界里探索和创新!

博主头像

博主昵称

前端开发者 / 技术博主

\ No newline at end of file +我的博客

关于我的博客

欢迎来到我的博客!这里是我分享想法、经验和技术见解的地方。

我是一名热爱编程和技术的开发者,专注于前端和全栈开发。我的目标是通过这个博客与大家分享知识,共同成长。

在这里,你可以找到关于:

  • Web开发最佳实践
  • 新兴技术趋势分析
  • 编程技巧和工具推荐
  • 个人项目经验分享

如果你有任何问题、建议或合作意向,欢迎随时与我联系。让我们一起在编程的世界里探索和创新!

博主头像

Zhuba-Ahhh

前端开发者 / 技术博主

\ No newline at end of file diff --git a/about.txt b/about.txt index 93f8091..6b9b58b 100644 --- a/about.txt +++ b/about.txt @@ -1,10 +1,10 @@ 2:I[2178,[],"ClientPageRoot"] -3:I[9313,["469","static/chunks/469-44b568725719917b.js","301","static/chunks/app/about/page-d9421d88ee2adad7.js"],"default"] +3:I[9313,["561","static/chunks/561-8003f6922ee71b30.js","301","static/chunks/app/about/page-e36f086028417f1c.js"],"default"] 4:I[380,[],""] 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] 8:I[1872,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],""] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["about",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["about",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}]],null],null]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","about","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["about",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["about",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}]],null],null]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","about","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/blog.html b/blog.html index 1566668..76034b5 100644 --- a/blog.html +++ b/blog.html @@ -1 +1 @@ -我的博客
\ No newline at end of file +我的博客
\ No newline at end of file diff --git a/blog.txt b/blog.txt index 4244181..39f3c73 100644 --- a/blog.txt +++ b/blog.txt @@ -1,10 +1,10 @@ 2:"$Sreact.suspense" -3:I[3176,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","528","static/chunks/528-51af7a7e17704e0d.js","404","static/chunks/app/blog/page-7311c8463863588e.js"],"default"] +3:I[3176,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","528","static/chunks/528-51af7a7e17704e0d.js","404","static/chunks/app/blog/page-fb95bf63950216a4.js"],"default"] 4:I[380,[],""] 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] 8:I[1872,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],""] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":["__PAGE__",{},[["$L1",["$","$2",null,{"fallback":["$","div",null,{"className":"space-y-4","children":[["$","div",null,{"className":"animate-pulse rounded-md bg-muted h-8 w-[250px]"}],["$","div",null,{"className":"animate-pulse rounded-md bg-muted h-4 w-[200px]"}],["$","div",null,{"className":"animate-pulse rounded-md bg-muted h-4 w-[300px]"}],["$","div",null,{"className":"animate-pulse rounded-md bg-muted h-4 w-[250px]"}]]}],"children":["$","$L3",null,{}]}]],null],null]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":["__PAGE__",{},[["$L1",["$","$2",null,{"fallback":["$","div",null,{"className":"space-y-4","children":[["$","div",null,{"className":"animate-pulse rounded-md bg-muted h-8 w-[250px]"}],["$","div",null,{"className":"animate-pulse rounded-md bg-muted h-4 w-[200px]"}],["$","div",null,{"className":"animate-pulse rounded-md bg-muted h-4 w-[300px]"}],["$","div",null,{"className":"animate-pulse rounded-md bg-muted h-4 w-[250px]"}]]}],"children":["$","$L3",null,{}]}]],null],null]},["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L4",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/blog/1.html b/blog/1.html index fcf0a9b..0430bad 100644 --- a/blog/1.html +++ b/blog/1.html @@ -1,4 +1,4 @@ -我的博客

深入理解React Hooks

2024-03-15 | 张三 |预计阅读时间: 3 分钟

深入理解React Hooks

+我的博客

深入理解React Hooks

2024-03-15 | 张三 |预计阅读时间: 3 分钟

深入理解React Hooks

React Hooks是React 16.8中引入的新特性,它彻底改变了我们编写React组件的方式。本文将深入探讨Hooks的工作原理,包括常用Hooks的实现细节和使用技巧,以及如何创建自定义Hooks。

为什么需要Hooks?

在Hooks出现之前,React组件主要分为类组件和函数组件。类组件可以使用状态和生命周期方法,而函数组件则更简单,但功能有限。Hooks的出现使得函数组件也能够使用状态和其他React特性,从而带来以下优势:

@@ -11,7 +11,7 @@

常用Hooks详解

useState

useState是最基本的Hook,用于在函数组件中添加状态。

-
import React, { useState } from 'react';
+
import React, { useState } from 'react';
 
 function Counter() {
   const [count, setCount] = useState(0);
@@ -25,11 +25,11 @@ 

</div> ); } -

jsx
+

useState返回一个数组,第一个元素是当前状态值,第二个元素是更新状态的函数。

useEffect

useEffect用于处理副作用,如数据获取、订阅或手动修改DOM等。

-
import React, { useState, useEffect } from 'react';
+
import React, { useState, useEffect } from 'react';
 
 function DataFetcher() {
   const [data, setData] = useState(null);
@@ -46,11 +46,11 @@ 

</div> ); } -

jsx
+

useEffect接受两个参数:一个函数和一个依赖数组。函数在组件渲染后执行,依赖数组决定了effect何时重新运行。

useContext

useContext用于访问React的Context API,使得组件可以订阅上下文变化。

-
import React, { useContext } from 'react';
+
import React, { useContext } from 'react';
 
 const ThemeContext = React.createContext('light');
 
@@ -58,10 +58,10 @@ 

const theme = useContext(ThemeContext); return <button className={theme}>I am styled by theme context!</button>; } -

jsx
+

useReducer

useReduceruseState的替代方案,用于管理复杂的状态逻辑。

-
import React, { useReducer } from 'react';
+
import React, { useReducer } from 'react';
 
 function reducer(state, action) {
   switch (action.type) {
@@ -84,10 +84,10 @@ 

</> ); } -

jsx
+

自定义Hooks

创建自定义Hook允许你将组件逻辑提取到可重用的函数中。

-
import { useState, useEffect } from 'react';
+
import { useState, useEffect } from 'react';
 
 function useWindowWidth() {
   const [width, setWidth] = useState(window.innerWidth);
@@ -107,7 +107,7 @@ 

const width = useWindowWidth(); return <div>Window width is {width}</div>; } -

jsx
+

Hooks的使用规则

使用Hooks时需要遵循两个重要规则:

    @@ -126,7 +126,7 @@

    useCallback: 缓存函数
  1. React.memo: 优化函数组件的重渲染
-
import React, { useMemo, useCallback } from 'react';
+
import React, { useMemo, useCallback } from 'react';
 
 function ExpensiveComponent({ data, onItemClick }) {
   const sortedData = useMemo(() => {
@@ -150,7 +150,7 @@ 

} export default React.memo(ExpensiveComponent); -

jsx
+

结论

React Hooks是一个强大的特性,它简化了状态管理和副作用处理,使得函数组件更加灵活和强大。通过深入理解Hooks的工作原理和使用技巧,我们可以编写出更简洁、可维护和高性能的React应用。

-

然而,Hooks并不是银弹。在某些场景下,类组件可能仍然是更好的选择。关键是要根据具体情况选择最合适的工具。随着React的不断发展,我们可以期待看到更多围绕Hooks的创新和最佳实践的出现。

← 返回博客列表

评论

评论列表

\ No newline at end of file +

然而,Hooks并不是银弹。在某些场景下,类组件可能仍然是更好的选择。关键是要根据具体情况选择最合适的工具。随着React的不断发展,我们可以期待看到更多围绕Hooks的创新和最佳实践的出现。

← 返回博客列表

评论

评论列表

\ No newline at end of file diff --git a/blog/1.txt b/blog/1.txt index bd321b5..b469885 100644 --- a/blog/1.txt +++ b/blog/1.txt @@ -2,12 +2,21 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","1","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","1","d"],{"children":["__PAGE__?{\"id\":\"1\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","1","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","1","d"],{"children":["__PAGE__?{\"id\":\"1\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","1","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#深入理解react-hooks","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"深入理解React Hooks","children":"深入理解React Hooks"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#为什么需要hooks?","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"为什么需要Hooks?","children":"为什么需要Hooks?"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#常用hooks详解","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"常用Hooks详解","children":"常用Hooks详解"}]}],["$","li","3",{"className":"ml-2","children":["$","a",null,{"href":"#usestate","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"useState","children":"useState"}]}],["$","li","4",{"className":"ml-2","children":["$","a",null,{"href":"#useeffect","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"useEffect","children":"useEffect"}]}],["$","li","5",{"className":"ml-2","children":["$","a",null,{"href":"#usecontext","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"useContext","children":"useContext"}]}],["$","li","6",{"className":"ml-2","children":["$","a",null,{"href":"#usereducer","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"useReducer","children":"useReducer"}]}],["$","li","7",{"className":"","children":["$","a",null,{"href":"#自定义hooks","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"自定义Hooks","children":"自定义Hooks"}]}],["$","li","8",{"className":"","children":["$","a",null,{"href":"#hooks的使用规则","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Hooks的使用规则","children":"Hooks的使用规则"}]}],["$","li","9",{"className":"","children":["$","a",null,{"href":"#hooks与类组件的对比","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Hooks与类组件的对比","children":"Hooks与类组件的对比"}]}],["$","li","10",{"className":"","children":["$","a",null,{"href":"#性能优化","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"性能优化","children":"性能优化"}]}],["$","li","11",{"className":"","children":["$","a",null,{"href":"#结论","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"结论","children":"结论"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"深入理解React Hooks"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-03-15"}]," | ",["$","span",null,{"children":"张三"}]," |",["$","span",null,{"children":["预计阅读时间: ",3," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","React",{"href":"/blog?tag=React","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"React"}]}],["$","$L8","Hooks",{"href":"/blog?tag=Hooks","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"Hooks"}]}],["$","$L8","前端开发",{"href":"/blog?tag=%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"前端开发"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],["$","div",null,{"className":"rounded-lg border bg-card text-card-foreground shadow-sm transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 mt-12","children":[["$","div",null,{"className":"flex flex-col space-y-1.5 p-6","children":["$","h3",null,{"className":"text-2xl font-semibold leading-none tracking-tight","children":"相关文章"}]}],["$","div",null,{"className":"p-6 pt-0","children":["$","ul",null,{"className":"space-y-2","children":[["$","li","4",{"children":["$","$L8",null,{"href":"/blog/4","className":"text-primary hover:underline","children":"TypeScript高级类型技巧"}]}],["$","li","6",{"children":["$","$L8",null,{"href":"/blog/6","className":"text-primary hover:underline","children":"React性能优化实战指南"}]}],["$","li","8",{"children":["$","$L8",null,{"href":"/blog/8","className":"text-primary hover:underline","children":"AI驱动的前端开发:机遇与挑战"}]}]]}]}]]}],["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/1&text=深入理解React Hooks","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/1","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/1&title=深入理解React Hooks","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"深入理解react-hooks","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#深入理解react-hooks","children":"深入理解React Hooks"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"React Hooks是React 16.8中引入的新特性,它彻底改变了我们编写React组件的方式。本文将深入探讨Hooks的工作原理,包括常用Hooks的实现细节和使用技巧,以及如何创建自定义Hooks。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"为什么需要hooks","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#为什么需要hooks","children":"为什么需要Hooks?"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"在Hooks出现之前,React组件主要分为类组件和函数组件。类组件可以使用状态和生命周期方法,而函数组件则更简单,但功能有限。Hooks的出现使得函数组件也能够使用状态和其他React特性,从而带来以下优势:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"更简洁的代码"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"更容易复用逻辑"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"更好的性能优化"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"更容易理解和维护的组件"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"常用hooks详解","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#常用hooks详解","children":"常用Hooks详解"}]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"usestate","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#usestate","children":"useState"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useState"}],"是最基本的Hook,用于在函数组件中添加状态。"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useState "]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement15",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Counter"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":["count"]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" setCount"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement51",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["p"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement56",{"className":"token plain-text","style":{},"children":["You clicked "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":["count"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement60",{"className":"token plain-text","style":{},"children":[" times"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement64",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement70",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement71",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement72",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement73",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement74",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement75",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement76",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement77",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["setCount"]}],["$","span","code-segement78",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement79",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["count "]}],["$","span","code-segement80",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["+"]}],["$","span","code-segement81",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement82",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement83",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement84",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement86",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement87",{"className":"token plain-text","style":{},"children":[" Click me\n"]}],["$","span","code-segement88",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement92",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement93",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useState"}],"返回一个数组,第一个元素是当前状态值,第二个元素是更新状态的函数。"]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"useeffect","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#useeffect","children":"useEffect"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useEffect"}],"用于处理副作用,如数据获取、订阅或手动修改DOM等。"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useState"]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement8",{"className":"token imports","style":{},"children":[" useEffect "]}],["$","span","code-segement9",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement17",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["DataFetcher"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" setData"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement39",{"className":"token nil","style":{"color":"hsl(301, 63%, 40%)"},"children":["null"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useEffect"]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'https://api.example.com/data'"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement62",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement64",{"className":"token parameter","style":{},"children":["response"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" response"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement69",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["json"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement76",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement78",{"className":"token parameter","style":{},"children":["data"]}],["$","span","code-segement79",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement80",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setData"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// 空数组表示只在组件挂载时执行一次"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement101",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement102",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement103",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement110",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement111",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement113",{"className":"$undefined","style":{},"children":["data "]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["?"]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["pre"]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement120",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["JSON"]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement122",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["stringify"]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement127",{"className":"token nil","style":{"color":"hsl(301, 63%, 40%)"},"children":["null"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement130",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["2"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement133",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement136",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement138",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement139",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Loading...'"]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement141",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement142",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement147",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement151",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement152",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement153",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useEffect"}],"接受两个参数:一个函数和一个依赖数组。函数在组件渲染后执行,依赖数组决定了effect何时重新运行。"]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"usecontext","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#usecontext","children":"useContext"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useContext"}],"用于访问React的Context API,使得组件可以订阅上下文变化。"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useContext "]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement15",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token maybe-class-name","style":{},"children":["ThemeContext"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement24",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["createContext"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'light'"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement31",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement34",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["ThemedButton"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" theme "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useContext"]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement47",{"className":"token maybe-class-name","style":{},"children":["ThemeContext"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement52",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["className"]}],["$","span","code-segement58",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement59",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement60",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["theme"]}],["$","span","code-segement61",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement63",{"className":"token plain-text","style":{},"children":["I am styled by theme context!"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"usereducer","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#usereducer","children":"useReducer"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useReducer"}],"是",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useState"}],"的替代方案,用于管理复杂的状态逻辑。"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useReducer "]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement15",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["reducer"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement20",{"className":"token parameter","style":{},"children":["state"]}],["$","span","code-segement21",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement22",{"className":"token parameter","style":{},"children":[" action"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["switch"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":["action"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement33",{"className":"token property-access","style":{},"children":["type"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["case"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'increment'"]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement48",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["count"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" state"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement52",{"className":"token property-access","style":{},"children":["count"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["+"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["case"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'decrement'"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement70",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["count"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" state"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement74",{"className":"token property-access","style":{},"children":["count"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["-"]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement83",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement87",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["throw"]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Error"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement95",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement103",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Counter"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement109",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement114",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":["state"]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":[" dispatch"]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useReducer"]}],["$","span","code-segement124",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement125",{"className":"$undefined","style":{},"children":["reducer"]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement127",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement130",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["count"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement132",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement133",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement134",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement135",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement138",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement140",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement143",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement144",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement147",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement148",{"className":"token plain-text","style":{},"children":[" Count: "]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":["state"]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement152",{"className":"token property-access","style":{},"children":["count"]}],["$","span","code-segement153",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement154",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement155",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement157",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement158",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement159",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement160",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement161",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement162",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement163",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement164",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement165",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement166",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement167",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["dispatch"]}],["$","span","code-segement168",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement169",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement170",{"className":"token script language-javascript literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement171",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement172",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement173",{"className":"token script language-javascript","style":{"color":"hsl(119, 34%, 47%)"},"children":["'increment'"]}],["$","span","code-segement174",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement175",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement176",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement177",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement178",{"className":"token plain-text","style":{},"children":["+"]}],["$","span","code-segement179",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement182",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement183",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement184",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement185",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement186",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement187",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement188",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement189",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement190",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement191",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement192",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement193",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement194",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement195",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["dispatch"]}],["$","span","code-segement196",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement197",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement198",{"className":"token script language-javascript literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement199",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement200",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement201",{"className":"token script language-javascript","style":{"color":"hsl(119, 34%, 47%)"},"children":["'decrement'"]}],["$","span","code-segement202",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement203",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement204",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement205",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement206",{"className":"token plain-text","style":{},"children":["-"]}],["$","span","code-segement207",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement210",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement211",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement212",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement214",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement215",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement216",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement217",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement218",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement219",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement220",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement221",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"自定义hooks","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#自定义hooks","children":"自定义Hooks"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"创建自定义Hook允许你将组件逻辑提取到可重用的函数中。"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" useState"]}],["$","span","code-segement4",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" useEffect "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement14",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useWindowWidth"]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":["width"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" setWidth"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement36",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement38",{"className":"token property-access","style":{},"children":["innerWidth"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":["\n"]}]," \n",["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useEffect"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement49",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token function-variable","style":{"color":"hsl(221, 87%, 60%)"},"children":["handleResize"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setWidth"]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement67",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement69",{"className":"token property-access","style":{},"children":["innerWidth"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement76",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'resize'"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" handleResize"]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement90",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement97",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["removeEventListener"]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'resize'"]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":[" handleResize"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement109",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement111",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement119",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement120",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement121",{"className":"$undefined","style":{},"children":[" width"]}],["$","span","code-segement122",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement123",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement128",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement129",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement130",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement131",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["MyResponsiveComponent"]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement133",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement134",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement135",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement136",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement137",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement138",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":[" width "]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useWindowWidth"]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement147",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement148",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement149",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement150",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement152",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement153",{"className":"token plain-text","style":{},"children":["Window width is "]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":["width"]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement157",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement160",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement162",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement163",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"hooks的使用规则","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#hooks的使用规则","children":"Hooks的使用规则"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"使用Hooks时需要遵循两个重要规则:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"只在最顶层使用Hooks"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"只在React函数中调用Hooks"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"这些规则确保Hooks在每次渲染时都以相同的顺序被调用,这对于Hooks的正确工作至关重要。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"hooks与类组件的对比","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#hooks与类组件的对比","children":"Hooks与类组件的对比"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Hooks和类组件各有优势。Hooks通常能让代码更简洁,逻辑更容易复用,但类组件在某些场景下仍然有其优势,如错误边界。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"以下是一个简单的对比:"}],"\n",["$","table",null,{"children":[["$","thead",null,{"children":["$","tr",null,{"children":[["$","th",null,{"children":"特性"}],["$","th",null,{"children":"Hooks"}],["$","th",null,{"children":"类组件"}]]}]}],["$","tbody",null,{"children":[["$","tr",null,{"children":[["$","td",null,{"children":"代码简洁性"}],["$","td",null,{"children":"✅"}],["$","td",null,{"children":"❌"}]]}],["$","tr",null,{"children":[["$","td",null,{"children":"逻辑复用"}],["$","td",null,{"children":"✅"}],["$","td",null,{"children":"❌"}]]}],["$","tr",null,{"children":[["$","td",null,{"children":"学习曲线"}],["$","td",null,{"children":"中等"}],["$","td",null,{"children":"较陡"}]]}],["$","tr",null,{"children":[["$","td",null,{"children":"性能"}],["$","td",null,{"children":"✅"}],["$","td",null,{"children":"✅"}]]}]]}]]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"性能优化","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#性能优化","children":"性能优化"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Hooks提供了几种方式来优化组件性能:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useMemo"}],": 缓存计算结果"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useCallback"}],": 缓存函数"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"React.memo"}],": 优化函数组件的重渲染"]}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useMemo"]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement8",{"className":"token imports","style":{},"children":[" useCallback "]}],["$","span","code-segement9",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement17",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["ExpensiveComponent"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement23",{"className":"token parameter","style":{},"children":[" data"]}],["$","span","code-segement24",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement25",{"className":"token parameter","style":{},"children":[" onItemClick "]}],["$","span","code-segement26",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" sortedData "]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useMemo"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" data"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement49",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["sort"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement52",{"className":"token parameter","style":{},"children":["a"]}],["$","span","code-segement53",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement54",{"className":"token parameter","style":{},"children":[" b"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" a"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement60",{"className":"token property-access","style":{},"children":["id"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["-"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement65",{"className":"token property-access","style":{},"children":["id"]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":[" handleClick "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useCallback"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement88",{"className":"token parameter","style":{},"children":["item"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement91",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement95",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement96",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement98",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Item clicked:'"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":[" item"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["onItemClick"]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement109",{"className":"$undefined","style":{},"children":["item"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement111",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement113",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":["onItemClick"]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement120",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement124",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement125",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement128",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement130",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["ul"]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement133",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement134",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement135",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement136",{"className":"$undefined","style":{},"children":["sortedData"]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement138",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["map"]}],["$","span","code-segement139",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement140",{"className":"token parameter","style":{},"children":["item"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement143",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement145",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement147",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["li"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement150",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["key"]}],["$","span","code-segement151",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement152",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement153",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["item"]}],["$","span","code-segement154",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement155",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement156",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement157",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement158",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement159",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement160",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement161",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement162",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement163",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement164",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement165",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement166",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["handleClick"]}],["$","span","code-segement167",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement168",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["item"]}],["$","span","code-segement169",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement170",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement171",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement172",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement173",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement174",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement175",{"className":"$undefined","style":{},"children":["item"]}],["$","span","code-segement176",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement177",{"className":"token property-access","style":{},"children":["name"]}],["$","span","code-segement178",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement179",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement180",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement181",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement184",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement185",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement186",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement187",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement188",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement189",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement190",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement191",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement194",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement195",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement196",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement197",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement198",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement199",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement200",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement201",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement203",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement204",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement205",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement206",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement207",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement208",{"className":"token maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement209",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement210",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["memo"]}],["$","span","code-segement211",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement212",{"className":"token maybe-class-name","style":{},"children":["ExpensiveComponent"]}],["$","span","code-segement213",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement214",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement215",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"结论","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#结论","children":"结论"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"React Hooks是一个强大的特性,它简化了状态管理和副作用处理,使得函数组件更加灵活和强大。通过深入理解Hooks的工作原理和使用技巧,我们可以编写出更简洁、可维护和高性能的React应用。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"然而,Hooks并不是银弹。在某些场景下,类组件可能仍然是更好的选择。关键是要根据具体情况选择最合适的工具。随着React的不断发展,我们可以期待看到更多围绕Hooks的创新和最佳实践的出现。"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"深入理解react-hooks","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#深入理解react-hooks","children":"深入理解React Hooks"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"React Hooks是React 16.8中引入的新特性,它彻底改变了我们编写React组件的方式。本文将深入探讨Hooks的工作原理,包括常用Hooks的实现细节和使用技巧,以及如何创建自定义Hooks。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"为什么需要hooks","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#为什么需要hooks","children":"为什么需要Hooks?"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"在Hooks出现之前,React组件主要分为类组件和函数组件。类组件可以使用状态和生命周期方法,而函数组件则更简单,但功能有限。Hooks的出现使得函数组件也能够使用状态和其他React特性,从而带来以下优势:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"更简洁的代码"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"更容易复用逻辑"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"更好的性能优化"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"更容易理解和维护的组件"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"常用hooks详解","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#常用hooks详解","children":"常用Hooks详解"}]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"usestate","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#usestate","children":"useState"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useState"}],"是最基本的Hook,用于在函数组件中添加状态。"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useState "]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement15",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Counter"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":["count"]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" setCount"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement51",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["p"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement56",{"className":"token plain-text","style":{},"children":["You clicked "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":["count"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement60",{"className":"token plain-text","style":{},"children":[" times"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement64",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement70",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement71",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement72",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement73",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement74",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement75",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement76",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement77",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["setCount"]}],["$","span","code-segement78",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement79",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["count "]}],["$","span","code-segement80",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["+"]}],["$","span","code-segement81",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement82",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement83",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement84",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement86",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement87",{"className":"token plain-text","style":{},"children":[" Click me\n"]}],["$","span","code-segement88",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement92",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement93",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$Lf"}]}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useState"}],"返回一个数组,第一个元素是当前状态值,第二个元素是更新状态的函数。"]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"useeffect","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#useeffect","children":"useEffect"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useEffect"}],"用于处理副作用,如数据获取、订阅或手动修改DOM等。"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useState"]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement8",{"className":"token imports","style":{},"children":[" useEffect "]}],["$","span","code-segement9",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement17",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["DataFetcher"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" setData"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement39",{"className":"token nil","style":{"color":"hsl(301, 63%, 40%)"},"children":["null"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useEffect"]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'https://api.example.com/data'"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement62",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement64",{"className":"token parameter","style":{},"children":["response"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" response"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement69",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["json"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement76",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement78",{"className":"token parameter","style":{},"children":["data"]}],["$","span","code-segement79",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement80",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setData"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// 空数组表示只在组件挂载时执行一次"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement101",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement102",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement103",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement110",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement111",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement113",{"className":"$undefined","style":{},"children":["data "]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["?"]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["pre"]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement120",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["JSON"]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement122",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["stringify"]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement127",{"className":"token nil","style":{"color":"hsl(301, 63%, 40%)"},"children":["null"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement130",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["2"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement133",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement136",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement138",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement139",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Loading...'"]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement141",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement142",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement147",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement151",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement152",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement153",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L10"}]}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useEffect"}],"接受两个参数:一个函数和一个依赖数组。函数在组件渲染后执行,依赖数组决定了effect何时重新运行。"]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"usecontext","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#usecontext","children":"useContext"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useContext"}],"用于访问React的Context API,使得组件可以订阅上下文变化。"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useContext "]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement15",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token maybe-class-name","style":{},"children":["ThemeContext"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement24",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["createContext"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'light'"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement31",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement34",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["ThemedButton"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" theme "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useContext"]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement47",{"className":"token maybe-class-name","style":{},"children":["ThemeContext"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement52",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["className"]}],["$","span","code-segement58",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement59",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement60",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["theme"]}],["$","span","code-segement61",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement63",{"className":"token plain-text","style":{},"children":["I am styled by theme context!"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L11"}]}]]}]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"usereducer","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#usereducer","children":"useReducer"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useReducer"}],"是",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useState"}],"的替代方案,用于管理复杂的状态逻辑。"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useReducer "]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement15",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["reducer"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement20",{"className":"token parameter","style":{},"children":["state"]}],["$","span","code-segement21",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement22",{"className":"token parameter","style":{},"children":[" action"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["switch"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":["action"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement33",{"className":"token property-access","style":{},"children":["type"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["case"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'increment'"]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement48",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["count"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" state"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement52",{"className":"token property-access","style":{},"children":["count"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["+"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["case"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'decrement'"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement70",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["count"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" state"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement74",{"className":"token property-access","style":{},"children":["count"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["-"]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement83",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement87",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["throw"]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Error"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement95",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement103",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Counter"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement109",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement114",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":["state"]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":[" dispatch"]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useReducer"]}],["$","span","code-segement124",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement125",{"className":"$undefined","style":{},"children":["reducer"]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement127",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement130",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["count"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement132",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement133",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement134",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement135",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement138",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement140",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement143",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement144",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement147",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement148",{"className":"token plain-text","style":{},"children":[" Count: "]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":["state"]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement152",{"className":"token property-access","style":{},"children":["count"]}],["$","span","code-segement153",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement154",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement155",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement157",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement158",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement159",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement160",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement161",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement162",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement163",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement164",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement165",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement166",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement167",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["dispatch"]}],["$","span","code-segement168",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement169",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement170",{"className":"token script language-javascript literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement171",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement172",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement173",{"className":"token script language-javascript","style":{"color":"hsl(119, 34%, 47%)"},"children":["'increment'"]}],["$","span","code-segement174",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement175",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement176",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement177",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement178",{"className":"token plain-text","style":{},"children":["+"]}],["$","span","code-segement179",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement182",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement183",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement184",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement185",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement186",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement187",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement188",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement189",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement190",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement191",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement192",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement193",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement194",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement195",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["dispatch"]}],["$","span","code-segement196",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement197",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement198",{"className":"token script language-javascript literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement199",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement200",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement201",{"className":"token script language-javascript","style":{"color":"hsl(119, 34%, 47%)"},"children":["'decrement'"]}],["$","span","code-segement202",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement203",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement204",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement205",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement206",{"className":"token plain-text","style":{},"children":["-"]}],["$","span","code-segement207",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement210",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement211",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement212",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement214",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement215",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement216",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement217",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement218",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement219",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement220",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement221",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L12"}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"自定义hooks","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#自定义hooks","children":"自定义Hooks"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"创建自定义Hook允许你将组件逻辑提取到可重用的函数中。"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" useState"]}],["$","span","code-segement4",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" useEffect "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement14",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useWindowWidth"]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":["width"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" setWidth"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement36",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement38",{"className":"token property-access","style":{},"children":["innerWidth"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":["\n"]}]," \n",["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useEffect"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement49",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token function-variable","style":{"color":"hsl(221, 87%, 60%)"},"children":["handleResize"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setWidth"]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement67",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement69",{"className":"token property-access","style":{},"children":["innerWidth"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement76",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'resize'"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" handleResize"]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement90",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement97",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["removeEventListener"]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'resize'"]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":[" handleResize"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement109",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement111",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement119",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement120",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement121",{"className":"$undefined","style":{},"children":[" width"]}],["$","span","code-segement122",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement123",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement128",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement129",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement130",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement131",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["MyResponsiveComponent"]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement133",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement134",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement135",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement136",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement137",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement138",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":[" width "]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useWindowWidth"]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement147",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement148",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement149",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement150",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement152",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement153",{"className":"token plain-text","style":{},"children":["Window width is "]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":["width"]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement157",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement160",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement162",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement163",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L13"}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"hooks的使用规则","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#hooks的使用规则","children":"Hooks的使用规则"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"使用Hooks时需要遵循两个重要规则:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"只在最顶层使用Hooks"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"只在React函数中调用Hooks"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"这些规则确保Hooks在每次渲染时都以相同的顺序被调用,这对于Hooks的正确工作至关重要。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"hooks与类组件的对比","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#hooks与类组件的对比","children":"Hooks与类组件的对比"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Hooks和类组件各有优势。Hooks通常能让代码更简洁,逻辑更容易复用,但类组件在某些场景下仍然有其优势,如错误边界。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"以下是一个简单的对比:"}],"\n",["$","table",null,{"children":[["$","thead",null,{"children":["$","tr",null,{"children":[["$","th",null,{"children":"特性"}],["$","th",null,{"children":"Hooks"}],["$","th",null,{"children":"类组件"}]]}]}],["$","tbody",null,{"children":[["$","tr",null,{"children":[["$","td",null,{"children":"代码简洁性"}],["$","td",null,{"children":"✅"}],["$","td",null,{"children":"❌"}]]}],["$","tr",null,{"children":[["$","td",null,{"children":"逻辑复用"}],["$","td",null,{"children":"✅"}],["$","td",null,{"children":"❌"}]]}],["$","tr",null,{"children":[["$","td",null,{"children":"学习曲线"}],["$","td",null,{"children":"中等"}],["$","td",null,{"children":"较陡"}]]}],["$","tr",null,{"children":[["$","td",null,{"children":"性能"}],["$","td",null,{"children":"✅"}],["$","td",null,{"children":"✅"}]]}]]}]]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"性能优化","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#性能优化","children":"性能优化"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Hooks提供了几种方式来优化组件性能:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useMemo"}],": 缓存计算结果"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useCallback"}],": 缓存函数"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":[["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"React.memo"}],": 优化函数组件的重渲染"]}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement3",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement4",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" useMemo"]}],["$","span","code-segement7",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement8",{"className":"token imports","style":{},"children":[" useCallback "]}],["$","span","code-segement9",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement17",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["ExpensiveComponent"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement23",{"className":"token parameter","style":{},"children":[" data"]}],["$","span","code-segement24",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement25",{"className":"token parameter","style":{},"children":[" onItemClick "]}],["$","span","code-segement26",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" sortedData "]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useMemo"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" data"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement49",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["sort"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement52",{"className":"token parameter","style":{},"children":["a"]}],["$","span","code-segement53",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement54",{"className":"token parameter","style":{},"children":[" b"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" a"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement60",{"className":"token property-access","style":{},"children":["id"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["-"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement65",{"className":"token property-access","style":{},"children":["id"]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":[" handleClick "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useCallback"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement88",{"className":"token parameter","style":{},"children":["item"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement91",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement95",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement96",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement98",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Item clicked:'"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":[" item"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["onItemClick"]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement109",{"className":"$undefined","style":{},"children":["item"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement111",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement113",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":["onItemClick"]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement120",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement124",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement125",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement128",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement130",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["ul"]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement133",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement134",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement135",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement136",{"className":"$undefined","style":{},"children":["sortedData"]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement138",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["map"]}],["$","span","code-segement139",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement140",{"className":"token parameter","style":{},"children":["item"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement143",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement145",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement147",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["li"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement150",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["key"]}],["$","span","code-segement151",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement152",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement153",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["item"]}],["$","span","code-segement154",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement155",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement156",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement157",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement158",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement159",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement160",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement161",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement162",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement163",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement164",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement165",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement166",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["handleClick"]}],["$","span","code-segement167",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement168",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["item"]}],["$","span","code-segement169",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement170",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement171",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement172",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement173",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement174",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement175",{"className":"$undefined","style":{},"children":["item"]}],["$","span","code-segement176",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement177",{"className":"token property-access","style":{},"children":["name"]}],["$","span","code-segement178",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement179",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement180",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement181",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement184",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement185",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement186",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement187",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement188",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement189",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement190",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement191",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement194",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement195",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement196",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement197",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement198",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement199",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement200",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement201",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement203",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement204",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement205",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement206",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement207",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement208",{"className":"token maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement209",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement210",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["memo"]}],["$","span","code-segement211",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement212",{"className":"token maybe-class-name","style":{},"children":["ExpensiveComponent"]}],["$","span","code-segement213",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement214",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement215",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L14"}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"结论","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#结论","children":"结论"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"React Hooks是一个强大的特性,它简化了状态管理和副作用处理,使得函数组件更加灵活和强大。通过深入理解Hooks的工作原理和使用技巧,我们可以编写出更简洁、可维护和高性能的React应用。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"然而,Hooks并不是银弹。在某些场景下,类组件可能仍然是更好的选择。关键是要根据具体情况选择最合适的工具。随着React的不断发展,我们可以期待看到更多围绕Hooks的创新和最佳实践的出现。"}]] +15:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +f:["$","$L15",null,{"text":"import React, { useState } from 'react';\n\nfunction Counter() {\n const [count, setCount] = useState(0);\n\n return (\n
\n

You clicked {count} times

\n \n
\n );\n}\n","language":"jsx"}] +10:["$","$L15",null,{"text":"import React, { useState, useEffect } from 'react';\n\nfunction DataFetcher() {\n const [data, setData] = useState(null);\n\n useEffect(() => {\n fetch('https://api.example.com/data')\n .then(response => response.json())\n .then(data => setData(data));\n }, []); // 空数组表示只在组件挂载时执行一次\n\n return (\n
\n {data ?
{JSON.stringify(data, null, 2)}
: 'Loading...'}\n
\n );\n}\n","language":"jsx"}] +11:["$","$L15",null,{"text":"import React, { useContext } from 'react';\n\nconst ThemeContext = React.createContext('light');\n\nfunction ThemedButton() {\n const theme = useContext(ThemeContext);\n return ;\n}\n","language":"jsx"}] +12:["$","$L15",null,{"text":"import React, { useReducer } from 'react';\n\nfunction reducer(state, action) {\n switch (action.type) {\n case 'increment':\n return {count: state.count + 1};\n case 'decrement':\n return {count: state.count - 1};\n default:\n throw new Error();\n }\n}\n\nfunction Counter() {\n const [state, dispatch] = useReducer(reducer, { count: 0 });\n return (\n <>\n Count: {state.count}\n \n \n \n );\n}\n","language":"jsx"}] +13:["$","$L15",null,{"text":"import { useState, useEffect } from 'react';\n\nfunction useWindowWidth() {\n const [width, setWidth] = useState(window.innerWidth);\n \n useEffect(() => {\n const handleResize = () => setWidth(window.innerWidth);\n window.addEventListener('resize', handleResize);\n return () => {\n window.removeEventListener('resize', handleResize);\n };\n }, []);\n\n return width;\n}\n\nfunction MyResponsiveComponent() {\n const width = useWindowWidth();\n return
Window width is {width}
;\n}\n","language":"jsx"}] +14:["$","$L15",null,{"text":"import React, { useMemo, useCallback } from 'react';\n\nfunction ExpensiveComponent({ data, onItemClick }) {\n const sortedData = useMemo(() => {\n return data.sort((a, b) => a.id - b.id);\n }, [data]);\n\n const handleClick = useCallback((item) => {\n console.log('Item clicked:', item);\n onItemClick(item);\n }, [onItemClick]);\n\n return (\n
    \n {sortedData.map(item => (\n
  • handleClick(item)}>\n {item.name}\n
  • \n ))}\n
\n );\n}\n\nexport default React.memo(ExpensiveComponent);\n","language":"jsx"}] diff --git a/blog/10.html b/blog/10.html index c3a9853..e3eba77 100644 --- a/blog/10.html +++ b/blog/10.html @@ -1,10 +1,10 @@ -我的博客

微前端架构实践与性能优化

2024-04-30 | 刘十二 |预计阅读时间: 1 分钟

微前端架构实践与性能优化

+我的博客

微前端架构实践与性能优化

2024-04-30 | 刘十二 |预计阅读时间: 1 分钟

微前端架构实践与性能优化

微前端架构允许多个独立开发、部署的前端应用共存于一个页面。本文将详细介绍微前端的实现方法和优化策略。

微前端实现方法

  1. 使用Single-SPA框架:
-
import { registerApplication, start } from 'single-spa';
+
import { registerApplication, start } from 'single-spa';
 
 registerApplication({
   name: 'app1',
@@ -19,11 +19,11 @@ 

}); start(); -

javascript
+
  1. 使用Qiankun框架:
-
import { registerMicroApps, start } from 'qiankun';
+
import { registerMicroApps, start } from 'qiankun';
 
 registerMicroApps([
   {
@@ -41,7 +41,7 @@ 

]); start(); -

javascript
+

微前端通信机制

  1. 基于CustomEvent的发布订阅模式
  2. @@ -66,4 +66,4 @@

    制定明确的应用边界
  3. 建立完善的监控体系
-

微前端架构为大型前端项目提供了灵活的解决方案,但也带来了额外的复杂性。通过合理的架构设计和优化策略,我们可以充分发挥微前端的优势,构建高效、可维护的大型前端应用。

← 返回博客列表

评论

评论列表

\ No newline at end of file +

微前端架构为大型前端项目提供了灵活的解决方案,但也带来了额外的复杂性。通过合理的架构设计和优化策略,我们可以充分发挥微前端的优势,构建高效、可维护的大型前端应用。

← 返回博客列表

评论

评论列表

\ No newline at end of file diff --git a/blog/10.txt b/blog/10.txt index 7d956e0..76c0a44 100644 --- a/blog/10.txt +++ b/blog/10.txt @@ -2,12 +2,15 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","10","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","10","d"],{"children":["__PAGE__?{\"id\":\"10\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","10","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","10","d"],{"children":["__PAGE__?{\"id\":\"10\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","10","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#微前端架构实践与性能优化","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"微前端架构实践与性能优化","children":"微前端架构实践与性能优化"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#微前端实现方法","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"微前端实现方法","children":"微前端实现方法"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#微前端通信机制","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"微前端通信机制","children":"微前端通信机制"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#样式隔离","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"样式隔离","children":"样式隔离"}]}],["$","li","4",{"className":"","children":["$","a",null,{"href":"#性能优化策略","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"性能优化策略","children":"性能优化策略"}]}],["$","li","5",{"className":"","children":["$","a",null,{"href":"#实践经验与注意事项","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"实践经验与注意事项","children":"实践经验与注意事项"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"微前端架构实践与性能优化"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-04-30"}]," | ",["$","span",null,{"children":"刘十二"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","微前端",{"href":"/blog?tag=%E5%BE%AE%E5%89%8D%E7%AB%AF","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"微前端"}]}],["$","$L8","架构设计",{"href":"/blog?tag=%E6%9E%B6%E6%9E%84%E8%AE%BE%E8%AE%A1","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"架构设计"}]}],["$","$L8","性能优化",{"href":"/blog?tag=%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"性能优化"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],["$","div",null,{"className":"rounded-lg border bg-card text-card-foreground shadow-sm transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 mt-12","children":[["$","div",null,{"className":"flex flex-col space-y-1.5 p-6","children":["$","h3",null,{"className":"text-2xl font-semibold leading-none tracking-tight","children":"相关文章"}]}],["$","div",null,{"className":"p-6 pt-0","children":["$","ul",null,{"className":"space-y-2","children":[["$","li","2",{"children":["$","$L8",null,{"href":"/blog/2","className":"text-primary hover:underline","children":"Next.js 13新特性解析"}]}],["$","li","6",{"children":["$","$L8",null,{"href":"/blog/6","className":"text-primary hover:underline","children":"React性能优化实战指南"}]}],["$","li","7",{"children":["$","$L8",null,{"href":"/blog/7","className":"text-primary hover:underline","children":"WebAssembly与前端的未来"}]}]]}]}]]}],["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/10&text=微前端架构实践与性能优化","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/10","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/10&title=微前端架构实践与性能优化","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"微前端架构实践与性能优化","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#微前端架构实践与性能优化","children":"微前端架构实践与性能优化"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"微前端架构允许多个独立开发、部署的前端应用共存于一个页面。本文将详细介绍微前端的实现方法和优化策略。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"微前端实现方法","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#微前端实现方法","children":"微前端实现方法"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Single-SPA框架:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" registerApplication"]}],["$","span","code-segement4",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" start "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'single-spa'"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement14",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["registerApplication"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'app1'"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token function-variable","style":{"color":"hsl(221, 87%, 60%)"},"children":["app"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'./app1/main.js'"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["activeWhen"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/app1'"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement53",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["registerApplication"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'app2'"]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token function-variable","style":{"color":"hsl(221, 87%, 60%)"},"children":["app"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'./app2/main.js'"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement79",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["activeWhen"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/app2'"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement92",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["start"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","start":"2","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Qiankun框架:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" registerMicroApps"]}],["$","span","code-segement4",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" start "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'qiankun'"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement14",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["registerMicroApps"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'app1'"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["entry"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'//localhost:8080'"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["container"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'#container'"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["activeRule"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/app1'"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'app2'"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["entry"]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'//localhost:8081'"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["container"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'#container'"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["activeRule"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/app2'"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement95",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["start"]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"微前端通信机制","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#微前端通信机制","children":"微前端通信机制"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"基于CustomEvent的发布订阅模式"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Props进行父子应用通信"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"全局状态管理(如Redux)"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"样式隔离","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#样式隔离","children":"样式隔离"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"BEM命名约定"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"CSS Modules"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"Shadow DOM"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"性能优化策略","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#性能优化策略","children":"性能优化策略"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"应用预加载"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"公共依赖提取"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"按需加载子应用"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"实践经验与注意事项","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实践经验与注意事项","children":"实践经验与注意事项"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"统一技术栈,降低维护成本"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"制定明确的应用边界"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"建立完善的监控体系"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"微前端架构为大型前端项目提供了灵活的解决方案,但也带来了额外的复杂性。通过合理的架构设计和优化策略,我们可以充分发挥微前端的优势,构建高效、可维护的大型前端应用。"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +f:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"微前端架构实践与性能优化","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#微前端架构实践与性能优化","children":"微前端架构实践与性能优化"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"微前端架构允许多个独立开发、部署的前端应用共存于一个页面。本文将详细介绍微前端的实现方法和优化策略。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"微前端实现方法","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#微前端实现方法","children":"微前端实现方法"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Single-SPA框架:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" registerApplication"]}],["$","span","code-segement4",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" start "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'single-spa'"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement14",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["registerApplication"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'app1'"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token function-variable","style":{"color":"hsl(221, 87%, 60%)"},"children":["app"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'./app1/main.js'"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["activeWhen"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/app1'"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement53",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["registerApplication"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'app2'"]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token function-variable","style":{"color":"hsl(221, 87%, 60%)"},"children":["app"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'./app2/main.js'"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement79",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["activeWhen"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/app2'"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement92",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["start"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"import { registerApplication, start } from 'single-spa';\n\nregisterApplication({\n name: 'app1',\n app: () => import('./app1/main.js'),\n activeWhen: '/app1'\n});\n\nregisterApplication({\n name: 'app2',\n app: () => import('./app2/main.js'),\n activeWhen: '/app2'\n});\n\nstart();\n","language":"javascript"}]}]}]]}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","start":"2","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Qiankun框架:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" registerMicroApps"]}],["$","span","code-segement4",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" start "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'qiankun'"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement14",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["registerMicroApps"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'app1'"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["entry"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'//localhost:8080'"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["container"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'#container'"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["activeRule"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/app1'"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'app2'"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["entry"]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'//localhost:8081'"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["container"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'#container'"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["activeRule"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/app2'"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement95",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["start"]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"import { registerMicroApps, start } from 'qiankun';\n\nregisterMicroApps([\n {\n name: 'app1',\n entry: '//localhost:8080',\n container: '#container',\n activeRule: '/app1',\n },\n {\n name: 'app2',\n entry: '//localhost:8081',\n container: '#container',\n activeRule: '/app2',\n },\n]);\n\nstart();\n","language":"javascript"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"微前端通信机制","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#微前端通信机制","children":"微前端通信机制"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"基于CustomEvent的发布订阅模式"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Props进行父子应用通信"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"全局状态管理(如Redux)"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"样式隔离","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#样式隔离","children":"样式隔离"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"BEM命名约定"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"CSS Modules"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"Shadow DOM"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"性能优化策略","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#性能优化策略","children":"性能优化策略"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"应用预加载"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"公共依赖提取"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"按需加载子应用"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"实践经验与注意事项","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实践经验与注意事项","children":"实践经验与注意事项"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"统一技术栈,降低维护成本"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"制定明确的应用边界"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"建立完善的监控体系"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"微前端架构为大型前端项目提供了灵活的解决方案,但也带来了额外的复杂性。通过合理的架构设计和优化策略,我们可以充分发挥微前端的优势,构建高效、可维护的大型前端应用。"}]] diff --git a/blog/11.html b/blog/11.html index 06d3979..5175535 100644 --- a/blog/11.html +++ b/blog/11.html @@ -1,9 +1,9 @@ -我的博客

前端可视化技术的新趋势

2024-05-05 | 赵十三 |预计阅读时间: 1 分钟

前端可视化技术的新趋势

+我的博客

前端可视化技术的新趋势

2024-05-05 | 赵十三 |预计阅读时间: 1 分钟

前端可视化技术的新趋势

前端可视化技术正在快速发展,本文将介绍最新的3D渲染和数据可视化技术,以及它们的实际应用。

WebGL和Three.js

WebGL是一种用于渲染交互式3D图形的JavaScript API。Three.js是基于WebGL的3D库,大大简化了3D场景的创建过程。

创建一个简单的3D场景:

-
import * as THREE from 'three';
+
import * as THREE from 'three';
 
 const scene = new THREE.Scene();
 const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);
@@ -27,14 +27,14 @@ 

} animate(); -

javascript
+

数据可视化库

  1. D3.js: 强大而灵活的数据可视化库
  2. ECharts: 功能丰富的图表库

使用ECharts创建交互式图表:

-
import * as echarts from 'echarts';
+
import * as echarts from 'echarts';
 
 const chartDom = document.getElementById('main');
 const myChart = echarts.init(chartDom);
@@ -57,7 +57,7 @@ 

}; myChart.setOption(option); -

javascript
+

WebGPU

WebGPU是下一代图形和计算API,有望在未来取代WebGL。它提供了更低级的硬件访问,可以实现更高效的渲染和计算。

实际应用案例

@@ -66,4 +66,4 @@

3D产品展示
  • 虚拟现实(VR)和增强现实(AR)应用
  • -

    前端可视化技术正在不断突破边界,为用户提供更丰富、更直观的数据展示和交互体验。通过掌握这些新兴技术,前端开发者可以创造出令人惊叹的视觉效果和用户体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    前端可视化技术正在不断突破边界,为用户提供更丰富、更直观的数据展示和交互体验。通过掌握这些新兴技术,前端开发者可以创造出令人惊叹的视觉效果和用户体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/11.txt b/blog/11.txt index 70d69e0..f003789 100644 --- a/blog/11.txt +++ b/blog/11.txt @@ -2,12 +2,15 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","11","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","11","d"],{"children":["__PAGE__?{\"id\":\"11\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","11","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","11","d"],{"children":["__PAGE__?{\"id\":\"11\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","11","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#前端可视化技术的新趋势","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"前端可视化技术的新趋势","children":"前端可视化技术的新趋势"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#webgl和three.js","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"WebGL和Three.js","children":"WebGL和Three.js"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#数据可视化库","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"数据可视化库","children":"数据可视化库"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#webgpu","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"WebGPU","children":"WebGPU"}]}],["$","li","4",{"className":"","children":["$","a",null,{"href":"#实际应用案例","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"实际应用案例","children":"实际应用案例"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"前端可视化技术的新趋势"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-05-05"}]," | ",["$","span",null,{"children":"赵十三"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","数据可视化",{"href":"/blog?tag=%E6%95%B0%E6%8D%AE%E5%8F%AF%E8%A7%86%E5%8C%96","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"数据可视化"}]}],["$","$L8","WebGL",{"href":"/blog?tag=WebGL","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"WebGL"}]}],["$","$L8","3D渲染",{"href":"/blog?tag=3D%E6%B8%B2%E6%9F%93","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"3D渲染"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],false,["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/11&text=前端可视化技术的新趋势","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/11","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/11&title=前端可视化技术的新趋势","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"前端可视化技术的新趋势","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#前端可视化技术的新趋势","children":"前端可视化技术的新趋势"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"前端可视化技术正在快速发展,本文将介绍最新的3D渲染和数据可视化技术,以及它们的实际应用。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webgl和threejs","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webgl和threejs","children":"WebGL和Three.js"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebGL是一种用于渲染交互式3D图形的JavaScript API。Three.js是基于WebGL的3D库,大大简化了3D场景的创建过程。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"创建一个简单的3D场景:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["*"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["as"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'three'"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement14",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" scene "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Scene"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" camera "]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["PerspectiveCamera"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["75"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement44",{"className":"token property-access","style":{},"children":["innerWidth"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement48",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement50",{"className":"token property-access","style":{},"children":["innerHeight"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0.1"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1000"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" renderer "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["WebGLRenderer"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement75",{"className":"$undefined","style":{},"children":["renderer"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement77",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["setSize"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement79",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement81",{"className":"token property-access","style":{},"children":["innerWidth"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement86",{"className":"token property-access","style":{},"children":["innerHeight"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement91",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["document"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement93",{"className":"token property-access","style":{},"children":["body"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement95",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["appendChild"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["renderer"]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement99",{"className":"token property-access","style":{},"children":["domElement"]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement104",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement105",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":[" geometry "]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement110",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement111",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["BoxGeometry"]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":[" material "]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["MeshBasicMaterial"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement129",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement130",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement131",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["color"]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement133",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0x00ff00"]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement138",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement140",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement141",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement142",{"className":"$undefined","style":{},"children":[" cube "]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement144",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement147",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Mesh"]}],["$","span","code-segement150",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement151",{"className":"$undefined","style":{},"children":["geometry"]}],["$","span","code-segement152",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement153",{"className":"$undefined","style":{},"children":[" material"]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement155",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement156",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement157",{"className":"$undefined","style":{},"children":["scene"]}],["$","span","code-segement158",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement159",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["add"]}],["$","span","code-segement160",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":["cube"]}],["$","span","code-segement162",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement163",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement166",{"className":"$undefined","style":{},"children":["camera"]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement168",{"className":"token property-access","style":{},"children":["position"]}],["$","span","code-segement169",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement170",{"className":"token property-access","style":{},"children":["z"]}],["$","span","code-segement171",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement172",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement173",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement174",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["5"]}],["$","span","code-segement175",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement176",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement178",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement179",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement180",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement181",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["animate"]}],["$","span","code-segement182",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement183",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement184",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement185",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement186",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement187",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement188",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["requestAnimationFrame"]}],["$","span","code-segement189",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement190",{"className":"$undefined","style":{},"children":["animate"]}],["$","span","code-segement191",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement192",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement193",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement194",{"className":"$undefined","style":{},"children":[" cube"]}],["$","span","code-segement195",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement196",{"className":"token property-access","style":{},"children":["rotation"]}],["$","span","code-segement197",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement198",{"className":"token property-access","style":{},"children":["x"]}],["$","span","code-segement199",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement200",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["+="]}],["$","span","code-segement201",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement202",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0.01"]}],["$","span","code-segement203",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement204",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement205",{"className":"$undefined","style":{},"children":[" cube"]}],["$","span","code-segement206",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement207",{"className":"token property-access","style":{},"children":["rotation"]}],["$","span","code-segement208",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement209",{"className":"token property-access","style":{},"children":["y"]}],["$","span","code-segement210",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement211",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["+="]}],["$","span","code-segement212",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement213",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0.01"]}],["$","span","code-segement214",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement215",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement216",{"className":"$undefined","style":{},"children":[" renderer"]}],["$","span","code-segement217",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement218",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["render"]}],["$","span","code-segement219",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement220",{"className":"$undefined","style":{},"children":["scene"]}],["$","span","code-segement221",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement222",{"className":"$undefined","style":{},"children":[" camera"]}],["$","span","code-segement223",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement224",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement225",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement226",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement227",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement228",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement230",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement231",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["animate"]}],["$","span","code-segement232",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement233",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement234",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement235",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"数据可视化库","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#数据可视化库","children":"数据可视化库"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"D3.js: 强大而灵活的数据可视化库"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"ECharts: 功能丰富的图表库"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"使用ECharts创建交互式图表:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(221, 87%, 60%)"},"children":["*"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token imports module","style":{"color":"hsl(301, 63%, 40%)"},"children":["as"]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" echarts"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'echarts'"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement13",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" chartDom "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["document"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement20",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["getElementById"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'main'"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" myChart "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" echarts"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement32",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["init"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":["chartDom"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement39",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" option "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["title"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["text"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'示例图表'"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["xAxis"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'category'"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["data"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Mon'"]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Tue'"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Wed'"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Thu'"]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Fri'"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Sat'"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Sun'"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["yAxis"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement110",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement114",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'value'"]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement121",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement122",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["series"]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement127",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement128",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement129",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["data"]}],["$","span","code-segement130",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement131",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement133",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["120"]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["200"]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement138",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement139",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["150"]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["80"]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement144",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["70"]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement147",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["110"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["130"]}],["$","span","code-segement152",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement153",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement154",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement156",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement157",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement158",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement159",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'bar'"]}],["$","span","code-segement160",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement162",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement163",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement165",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement166",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement168",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement170",{"className":"$undefined","style":{},"children":["myChart"]}],["$","span","code-segement171",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement172",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["setOption"]}],["$","span","code-segement173",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement174",{"className":"$undefined","style":{},"children":["option"]}],["$","span","code-segement175",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement176",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement177",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webgpu","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webgpu","children":"WebGPU"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebGPU是下一代图形和计算API,有望在未来取代WebGL。它提供了更低级的硬件访问,可以实现更高效的渲染和计算。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"实际应用案例","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实际应用案例","children":"实际应用案例"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"交互式数据仪表板"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"3D产品展示"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"虚拟现实(VR)和增强现实(AR)应用"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"前端可视化技术正在不断突破边界,为用户提供更丰富、更直观的数据展示和交互体验。通过掌握这些新兴技术,前端开发者可以创造出令人惊叹的视觉效果和用户体验。"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +f:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"前端可视化技术的新趋势","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#前端可视化技术的新趋势","children":"前端可视化技术的新趋势"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"前端可视化技术正在快速发展,本文将介绍最新的3D渲染和数据可视化技术,以及它们的实际应用。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webgl和threejs","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webgl和threejs","children":"WebGL和Three.js"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebGL是一种用于渲染交互式3D图形的JavaScript API。Three.js是基于WebGL的3D库,大大简化了3D场景的创建过程。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"创建一个简单的3D场景:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["*"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["as"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'three'"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement14",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" scene "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Scene"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" camera "]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["PerspectiveCamera"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["75"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement44",{"className":"token property-access","style":{},"children":["innerWidth"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement48",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement50",{"className":"token property-access","style":{},"children":["innerHeight"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0.1"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1000"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" renderer "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["WebGLRenderer"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement75",{"className":"$undefined","style":{},"children":["renderer"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement77",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["setSize"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement79",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement81",{"className":"token property-access","style":{},"children":["innerWidth"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement86",{"className":"token property-access","style":{},"children":["innerHeight"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement91",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["document"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement93",{"className":"token property-access","style":{},"children":["body"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement95",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["appendChild"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["renderer"]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement99",{"className":"token property-access","style":{},"children":["domElement"]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement104",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement105",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":[" geometry "]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement110",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement111",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["BoxGeometry"]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":[" material "]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["MeshBasicMaterial"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement129",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement130",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement131",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["color"]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement133",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0x00ff00"]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement138",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement140",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement141",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement142",{"className":"$undefined","style":{},"children":[" cube "]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement144",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement147",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["THREE"]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Mesh"]}],["$","span","code-segement150",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement151",{"className":"$undefined","style":{},"children":["geometry"]}],["$","span","code-segement152",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement153",{"className":"$undefined","style":{},"children":[" material"]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement155",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement156",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement157",{"className":"$undefined","style":{},"children":["scene"]}],["$","span","code-segement158",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement159",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["add"]}],["$","span","code-segement160",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":["cube"]}],["$","span","code-segement162",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement163",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement166",{"className":"$undefined","style":{},"children":["camera"]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement168",{"className":"token property-access","style":{},"children":["position"]}],["$","span","code-segement169",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement170",{"className":"token property-access","style":{},"children":["z"]}],["$","span","code-segement171",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement172",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement173",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement174",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["5"]}],["$","span","code-segement175",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement176",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement178",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement179",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement180",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement181",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["animate"]}],["$","span","code-segement182",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement183",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement184",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement185",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement186",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement187",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement188",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["requestAnimationFrame"]}],["$","span","code-segement189",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement190",{"className":"$undefined","style":{},"children":["animate"]}],["$","span","code-segement191",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement192",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement193",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement194",{"className":"$undefined","style":{},"children":[" cube"]}],["$","span","code-segement195",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement196",{"className":"token property-access","style":{},"children":["rotation"]}],["$","span","code-segement197",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement198",{"className":"token property-access","style":{},"children":["x"]}],["$","span","code-segement199",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement200",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["+="]}],["$","span","code-segement201",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement202",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0.01"]}],["$","span","code-segement203",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement204",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement205",{"className":"$undefined","style":{},"children":[" cube"]}],["$","span","code-segement206",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement207",{"className":"token property-access","style":{},"children":["rotation"]}],["$","span","code-segement208",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement209",{"className":"token property-access","style":{},"children":["y"]}],["$","span","code-segement210",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement211",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["+="]}],["$","span","code-segement212",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement213",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0.01"]}],["$","span","code-segement214",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement215",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement216",{"className":"$undefined","style":{},"children":[" renderer"]}],["$","span","code-segement217",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement218",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["render"]}],["$","span","code-segement219",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement220",{"className":"$undefined","style":{},"children":["scene"]}],["$","span","code-segement221",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement222",{"className":"$undefined","style":{},"children":[" camera"]}],["$","span","code-segement223",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement224",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement225",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement226",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement227",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement228",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement230",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement231",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["animate"]}],["$","span","code-segement232",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement233",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement234",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement235",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"import * as THREE from 'three';\n\nconst scene = new THREE.Scene();\nconst camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 1000);\nconst renderer = new THREE.WebGLRenderer();\n\nrenderer.setSize(window.innerWidth, window.innerHeight);\ndocument.body.appendChild(renderer.domElement);\n\nconst geometry = new THREE.BoxGeometry();\nconst material = new THREE.MeshBasicMaterial({ color: 0x00ff00 });\nconst cube = new THREE.Mesh(geometry, material);\nscene.add(cube);\n\ncamera.position.z = 5;\n\nfunction animate() {\n requestAnimationFrame(animate);\n cube.rotation.x += 0.01;\n cube.rotation.y += 0.01;\n renderer.render(scene, camera);\n}\n\nanimate();\n","language":"javascript"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"数据可视化库","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#数据可视化库","children":"数据可视化库"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"D3.js: 强大而灵活的数据可视化库"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"ECharts: 功能丰富的图表库"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"使用ECharts创建交互式图表:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(221, 87%, 60%)"},"children":["*"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token imports module","style":{"color":"hsl(301, 63%, 40%)"},"children":["as"]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" echarts"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'echarts'"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement13",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" chartDom "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["document"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement20",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["getElementById"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'main'"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" myChart "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" echarts"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement32",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["init"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":["chartDom"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement39",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" option "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["title"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["text"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'示例图表'"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["xAxis"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'category'"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["data"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Mon'"]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Tue'"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Wed'"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Thu'"]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Fri'"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Sat'"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Sun'"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["yAxis"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement110",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement114",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'value'"]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement121",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement122",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["series"]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement127",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement128",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement129",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["data"]}],["$","span","code-segement130",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement131",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement132",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement133",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["120"]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["200"]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement138",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement139",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["150"]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["80"]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement144",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["70"]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement147",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["110"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["130"]}],["$","span","code-segement152",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement153",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement154",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement156",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["type"]}],["$","span","code-segement157",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement158",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement159",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'bar'"]}],["$","span","code-segement160",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement162",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement163",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement165",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement166",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement168",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement170",{"className":"$undefined","style":{},"children":["myChart"]}],["$","span","code-segement171",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement172",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["setOption"]}],["$","span","code-segement173",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement174",{"className":"$undefined","style":{},"children":["option"]}],["$","span","code-segement175",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement176",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement177",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"import * as echarts from 'echarts';\n\nconst chartDom = document.getElementById('main');\nconst myChart = echarts.init(chartDom);\n\nconst option = {\n title: {\n text: '示例图表'\n },\n xAxis: {\n type: 'category',\n data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']\n },\n yAxis: {\n type: 'value'\n },\n series: [{\n data: [120, 200, 150, 80, 70, 110, 130],\n type: 'bar'\n }]\n};\n\nmyChart.setOption(option);\n","language":"javascript"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webgpu","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webgpu","children":"WebGPU"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebGPU是下一代图形和计算API,有望在未来取代WebGL。它提供了更低级的硬件访问,可以实现更高效的渲染和计算。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"实际应用案例","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实际应用案例","children":"实际应用案例"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"交互式数据仪表板"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"3D产品展示"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"虚拟现实(VR)和增强现实(AR)应用"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"前端可视化技术正在不断突破边界,为用户提供更丰富、更直观的数据展示和交互体验。通过掌握这些新兴技术,前端开发者可以创造出令人惊叹的视觉效果和用户体验。"}]] diff --git a/blog/12.html b/blog/12.html index 0feacbd..b202bd1 100644 --- a/blog/12.html +++ b/blog/12.html @@ -1,9 +1,9 @@ -我的博客

    渐进式Web应用(PWA)开发指南

    2024-05-10 | 钱十四 |预计阅读时间: 1 分钟

    渐进式Web应用(PWA)开发指南

    +我的博客

    渐进式Web应用(PWA)开发指南

    2024-05-10 | 钱十四 |预计阅读时间: 1 分钟

    渐进式Web应用(PWA)开发指南

    渐进式Web应用(PWA)结合了Web和原生应用的优点,提供了卓越的用户体验。本文将深入探讨PWA的核心技术和实现方法。

    Service Workers

    Service Workers是PWA的核心,用于实现离线缓存和后台同步。

    注册Service Worker:

    -
    if ('serviceWorker' in navigator) {
    +
    if ('serviceWorker' in navigator) {
       window.addEventListener('load', function() {
         navigator.serviceWorker.register('/sw.js').then(function(registration) {
           console.log('ServiceWorker registration successful');
    @@ -12,9 +12,9 @@ 

    }); }); } -

    javascript
    +

    实现离线缓存:

    -
    // sw.js
    +
    // sw.js
     const CACHE_NAME = 'my-site-cache-v1';
     const urlsToCache = [
       '/',
    @@ -44,10 +44,10 @@ 

    ) ); }); -

    javascript
    +

    Web App Manifest

    Web App Manifest定义了应用的图标、启动行为等信息。

    -
    {
    +
    {
       "name": "My PWA",
       "short_name": "MyPWA",
       "icons": [
    @@ -67,10 +67,10 @@ 

    "background_color": "#ffffff", "theme_color": "#000000" } -

    json
    +

    Push Notifications

    Push Notifications允许应用向用户发送实时通知。

    -
    // 请求推送权限
    +
    // 请求推送权限
     Notification.requestPermission().then(function(permission) {
       if (permission === 'granted') {
         console.log('Notification permission granted.');
    @@ -89,11 +89,11 @@ 

    .registration.showNotification('My PWA', options) ); }); -

    javascript
    +

    PWA的未来发展

    1. Web Bluetooth: 连接蓝牙设备
    2. Web USB: 访问USB设备
    3. Web Share: 共享内容
    -

    PWA正在不断发展,为用户提供更多可能性。通过掌握PWA的核心技术,前端开发者可以构建出类原生的Web应用,为用户带来卓越的体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    PWA正在不断发展,为用户提供更多可能性。通过掌握PWA的核心技术,前端开发者可以构建出类原生的Web应用,为用户带来卓越的体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/12.txt b/blog/12.txt index 1fb5fcd..0fb655e 100644 --- a/blog/12.txt +++ b/blog/12.txt @@ -2,12 +2,15 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","12","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","12","d"],{"children":["__PAGE__?{\"id\":\"12\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","12","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","12","d"],{"children":["__PAGE__?{\"id\":\"12\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","12","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#渐进式web应用(pwa)开发指南","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"渐进式Web应用(PWA)开发指南","children":"渐进式Web应用(PWA)开发指南"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#service-workers","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Service Workers","children":"Service Workers"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#web-app-manifest","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Web App Manifest","children":"Web App Manifest"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#push-notifications","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Push Notifications","children":"Push Notifications"}]}],["$","li","4",{"className":"","children":["$","a",null,{"href":"#pwa的未来发展","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"PWA的未来发展","children":"PWA的未来发展"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"渐进式Web应用(PWA)开发指南"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-05-10"}]," | ",["$","span",null,{"children":"钱十四"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","PWA",{"href":"/blog?tag=PWA","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"PWA"}]}],["$","$L8","离线应用",{"href":"/blog?tag=%E7%A6%BB%E7%BA%BF%E5%BA%94%E7%94%A8","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"离线应用"}]}],["$","$L8","移动Web",{"href":"/blog?tag=%E7%A7%BB%E5%8A%A8Web","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"移动Web"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],false,["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/12&text=渐进式Web应用(PWA)开发指南","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/12","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/12&title=渐进式Web应用(PWA)开发指南","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"渐进式web应用pwa开发指南","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#渐进式web应用pwa开发指南","children":"渐进式Web应用(PWA)开发指南"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"渐进式Web应用(PWA)结合了Web和原生应用的优点,提供了卓越的用户体验。本文将深入探讨PWA的核心技术和实现方法。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"service-workers","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#service-workers","children":"Service Workers"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Service Workers是PWA的核心,用于实现离线缓存和后台同步。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"注册Service Worker:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'serviceWorker'"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["in"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["navigator"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement15",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'load'"]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["navigator"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement29",{"className":"token property-access","style":{},"children":["serviceWorker"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement31",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["register"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/sw.js'"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement36",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement40",{"className":"token parameter","style":{},"children":["registration"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement48",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'ServiceWorker registration successful'"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement60",{"className":"token parameter","style":{},"children":["err"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement68",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'ServiceWorker registration failed: '"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" err"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement76",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"实现离线缓存:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// sw.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["CACHE_NAME"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'my-site-cache-v1'"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":[" urlsToCache "]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/'"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/styles/main.css'"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/script/main.js'"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement35",{"className":"$undefined","style":{},"children":["self"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement37",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'install'"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement44",{"className":"token parameter","style":{},"children":["event"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" event"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement51",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["waitUntil"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" caches"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement56",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["open"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["CACHE_NAME"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement63",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement67",{"className":"token parameter","style":{},"children":["cache"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement75",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Opened cache'"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" cache"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement85",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addAll"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":["urlsToCache"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement95",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement103",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement105",{"className":"$undefined","style":{},"children":["self"]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement107",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'fetch'"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement114",{"className":"token parameter","style":{},"children":["event"]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":[" event"]}],["$","span","code-segement120",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement121",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["respondWith"]}],["$","span","code-segement122",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement123",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":[" caches"]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement126",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["match"]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement128",{"className":"$undefined","style":{},"children":["event"]}],["$","span","code-segement129",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement130",{"className":"token property-access","style":{},"children":["request"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement132",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement133",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement135",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement138",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement139",{"className":"token parameter","style":{},"children":["response"]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement143",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement144",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement145",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement147",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement148",{"className":"$undefined","style":{},"children":["response"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement152",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement153",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement154",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":[" response"]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement157",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement158",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement159",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement160",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement162",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement163",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement164",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement165",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement166",{"className":"$undefined","style":{},"children":["event"]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement168",{"className":"token property-access","style":{},"children":["request"]}],["$","span","code-segement169",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement170",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement171",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement172",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement173",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement174",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement175",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement176",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement177",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement178",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement179",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement180",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement181",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement182",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement183",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement184",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement185",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement186",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"web-app-manifest","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#web-app-manifest","children":"Web App Manifest"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Web App Manifest定义了应用的图标、启动行为等信息。"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"name\""]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"My PWA\""]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"short_name\""]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"MyPWA\""]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"icons\""]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"src\""]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"icons/icon-192x192.png\""]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"sizes\""]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"192x192\""]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"type\""]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"image/png\""]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"src\""]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"icons/icon-512x512.png\""]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"sizes\""]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"512x512\""]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"type\""]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"image/png\""]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement79",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"start_url\""]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"/\""]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"display\""]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"standalone\""]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"background_color\""]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"#ffffff\""]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"theme_color\""]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement103",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"#000000\""]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"json"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"push-notifications","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#push-notifications","children":"Push Notifications"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Push Notifications允许应用向用户发送实时通知。"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// 请求推送权限"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token maybe-class-name","style":{},"children":["Notification"]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement5",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["requestPermission"]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement9",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement13",{"className":"token parameter","style":{},"children":["permission"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["permission "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["==="]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'granted'"]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement31",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement33",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Notification permission granted.'"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement48",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// 监听推送事件"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["self"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement53",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'push'"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement60",{"className":"token parameter","style":{},"children":["event"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" options "]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["body"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" event"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement77",{"className":"token property-access","style":{},"children":["data"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement79",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["text"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["icon"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'icons/icon-192x192.png'"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["badge"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'icons/badge-128x128.png'"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement102",{"className":"$undefined","style":{},"children":[" event"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement104",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["waitUntil"]}],["$","span","code-segement105",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement107",{"className":"$undefined","style":{},"children":[" self"]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement109",{"className":"token property-access","style":{},"children":["registration"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement111",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["showNotification"]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'My PWA'"]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":[" options"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement120",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement121",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement124",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"pwa的未来发展","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#pwa的未来发展","children":"PWA的未来发展"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"Web Bluetooth: 连接蓝牙设备"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"Web USB: 访问USB设备"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"Web Share: 共享内容"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"PWA正在不断发展,为用户提供更多可能性。通过掌握PWA的核心技术,前端开发者可以构建出类原生的Web应用,为用户带来卓越的体验。"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +f:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"渐进式web应用pwa开发指南","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#渐进式web应用pwa开发指南","children":"渐进式Web应用(PWA)开发指南"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"渐进式Web应用(PWA)结合了Web和原生应用的优点,提供了卓越的用户体验。本文将深入探讨PWA的核心技术和实现方法。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"service-workers","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#service-workers","children":"Service Workers"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Service Workers是PWA的核心,用于实现离线缓存和后台同步。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"注册Service Worker:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'serviceWorker'"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["in"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["navigator"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["window"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement15",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'load'"]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token dom","style":{"color":"hsl(221, 87%, 60%)"},"children":["navigator"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement29",{"className":"token property-access","style":{},"children":["serviceWorker"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement31",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["register"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/sw.js'"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement36",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement40",{"className":"token parameter","style":{},"children":["registration"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement48",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'ServiceWorker registration successful'"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement60",{"className":"token parameter","style":{},"children":["err"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement68",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'ServiceWorker registration failed: '"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" err"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement76",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"if ('serviceWorker' in navigator) {\n window.addEventListener('load', function() {\n navigator.serviceWorker.register('/sw.js').then(function(registration) {\n console.log('ServiceWorker registration successful');\n }, function(err) {\n console.log('ServiceWorker registration failed: ', err);\n });\n });\n}\n","language":"javascript"}]}]}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"实现离线缓存:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// sw.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["CACHE_NAME"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'my-site-cache-v1'"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":[" urlsToCache "]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/'"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/styles/main.css'"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'/script/main.js'"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement35",{"className":"$undefined","style":{},"children":["self"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement37",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'install'"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement44",{"className":"token parameter","style":{},"children":["event"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" event"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement51",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["waitUntil"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" caches"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement56",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["open"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["CACHE_NAME"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement63",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement67",{"className":"token parameter","style":{},"children":["cache"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement75",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Opened cache'"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" cache"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement85",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addAll"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":["urlsToCache"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement95",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement103",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement105",{"className":"$undefined","style":{},"children":["self"]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement107",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'fetch'"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement114",{"className":"token parameter","style":{},"children":["event"]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":[" event"]}],["$","span","code-segement120",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement121",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["respondWith"]}],["$","span","code-segement122",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement123",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement124",{"className":"$undefined","style":{},"children":[" caches"]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement126",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["match"]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement128",{"className":"$undefined","style":{},"children":["event"]}],["$","span","code-segement129",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement130",{"className":"token property-access","style":{},"children":["request"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement132",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement133",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement135",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement138",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement139",{"className":"token parameter","style":{},"children":["response"]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement143",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement144",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement145",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement146",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement147",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement148",{"className":"$undefined","style":{},"children":["response"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement152",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement153",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement154",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":[" response"]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement157",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement158",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement159",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement160",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement162",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement163",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement164",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement165",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement166",{"className":"$undefined","style":{},"children":["event"]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement168",{"className":"token property-access","style":{},"children":["request"]}],["$","span","code-segement169",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement170",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement171",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement172",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement173",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement174",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement175",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement176",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement177",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement178",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement179",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement180",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement181",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement182",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement183",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement184",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement185",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement186",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"// sw.js\nconst CACHE_NAME = 'my-site-cache-v1';\nconst urlsToCache = [\n '/',\n '/styles/main.css',\n '/script/main.js'\n];\n\nself.addEventListener('install', function(event) {\n event.waitUntil(\n caches.open(CACHE_NAME)\n .then(function(cache) {\n console.log('Opened cache');\n return cache.addAll(urlsToCache);\n })\n );\n});\n\nself.addEventListener('fetch', function(event) {\n event.respondWith(\n caches.match(event.request)\n .then(function(response) {\n if (response) {\n return response;\n }\n return fetch(event.request);\n }\n )\n );\n});\n","language":"javascript"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"web-app-manifest","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#web-app-manifest","children":"Web App Manifest"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Web App Manifest定义了应用的图标、启动行为等信息。"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"name\""]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"My PWA\""]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"short_name\""]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"MyPWA\""]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"icons\""]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"src\""]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"icons/icon-192x192.png\""]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"sizes\""]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"192x192\""]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"type\""]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"image/png\""]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"src\""]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"icons/icon-512x512.png\""]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"sizes\""]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"512x512\""]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"type\""]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"image/png\""]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement79",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"start_url\""]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"/\""]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"display\""]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"standalone\""]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"background_color\""]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"#ffffff\""]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\"theme_color\""]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement103",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["\"#000000\""]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"{\n \"name\": \"My PWA\",\n \"short_name\": \"MyPWA\",\n \"icons\": [\n {\n \"src\": \"icons/icon-192x192.png\",\n \"sizes\": \"192x192\",\n \"type\": \"image/png\"\n },\n {\n \"src\": \"icons/icon-512x512.png\",\n \"sizes\": \"512x512\",\n \"type\": \"image/png\"\n }\n ],\n \"start_url\": \"/\",\n \"display\": \"standalone\",\n \"background_color\": \"#ffffff\",\n \"theme_color\": \"#000000\"\n}\n","language":"json"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"push-notifications","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#push-notifications","children":"Push Notifications"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Push Notifications允许应用向用户发送实时通知。"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// 请求推送权限"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token maybe-class-name","style":{},"children":["Notification"]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement5",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["requestPermission"]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement9",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement13",{"className":"token parameter","style":{},"children":["permission"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["permission "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["==="]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'granted'"]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement31",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement33",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Notification permission granted.'"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement48",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// 监听推送事件"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["self"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement53",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["addEventListener"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'push'"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement60",{"className":"token parameter","style":{},"children":["event"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" options "]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["body"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" event"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement77",{"className":"token property-access","style":{},"children":["data"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement79",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["text"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["icon"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'icons/icon-192x192.png'"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["badge"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'icons/badge-128x128.png'"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement102",{"className":"$undefined","style":{},"children":[" event"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement104",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["waitUntil"]}],["$","span","code-segement105",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement106",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement107",{"className":"$undefined","style":{},"children":[" self"]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement109",{"className":"token property-access","style":{},"children":["registration"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement111",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["showNotification"]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'My PWA'"]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":[" options"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement119",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement120",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement121",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement124",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"// 请求推送权限\nNotification.requestPermission().then(function(permission) {\n if (permission === 'granted') {\n console.log('Notification permission granted.');\n }\n});\n\n// 监听推送事件\nself.addEventListener('push', function(event) {\n const options = {\n body: event.data.text(),\n icon: 'icons/icon-192x192.png',\n badge: 'icons/badge-128x128.png'\n };\n\n event.waitUntil(\n self.registration.showNotification('My PWA', options)\n );\n});\n","language":"javascript"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"pwa的未来发展","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#pwa的未来发展","children":"PWA的未来发展"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"Web Bluetooth: 连接蓝牙设备"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"Web USB: 访问USB设备"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"Web Share: 共享内容"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"PWA正在不断发展,为用户提供更多可能性。通过掌握PWA的核心技术,前端开发者可以构建出类原生的Web应用,为用户带来卓越的体验。"}]] diff --git a/blog/13.html b/blog/13.html index 3f08035..d240d01 100644 --- a/blog/13.html +++ b/blog/13.html @@ -1,4 +1,4 @@ -我的博客

    GraphQL与现代API设计

    2024-05-15 | 孙十五 |预计阅读时间: 1 分钟

    GraphQL与现代API设计

    +我的博客

    GraphQL与现代API设计

    2024-05-15 | 孙十五 |预计阅读时间: 1 分钟

    GraphQL与现代API设计

    GraphQL正在改变我们设计和使用API的方式。本文将深入讨论GraphQL的核心概念和优势,并指导如何在实际项目中使用GraphQL。

    GraphQL简介

    GraphQL是一种用于API的查询语言,也是一个运行时。它的主要特点包括:

    @@ -11,7 +11,7 @@

  • 定义Schema:
  • -
    type Query {
    +
    type Query {
       getPost(id: ID!): Post
       getAllPosts: [Post]
     }
    @@ -44,11 +44,11 @@ 

    content: String! authorId: ID! } -

    javascript
    +
    1. 使用Apollo Client:
    -
    import { ApolloClient, InMemoryCache, ApolloProvider, useQuery, useMutation } from '@apollo/client';
    +
    import { ApolloClient, InMemoryCache, ApolloProvider, useQuery, useMutation } from '@apollo/client';
     
     const client = new ApolloClient({
       uri: 'http://localhost:4000/graphql',
    @@ -86,7 +86,7 @@ 

    } } `; -

    javascript
    +

    性能优化策略

    1. 查询合并: 将多个查询合并为一个,减少网络请求
    2. @@ -99,4 +99,4 @@

      使用Apollo Client的最佳实践: 如使用useQueryuseMutation钩子
    3. 处理错误和异常: 使用GraphQL错误处理机制,如errors字段和onError回调
    -

    GraphQL为前后端交互带来了新的可能性。通过掌握GraphQL的核心概念和最佳实践,前端开发者可以构建出高性能、可维护的API,为用户提供更好的体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    GraphQL为前后端交互带来了新的可能性。通过掌握GraphQL的核心概念和最佳实践,前端开发者可以构建出高性能、可维护的API,为用户提供更好的体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/13.txt b/blog/13.txt index 82407c3..03e4251 100644 --- a/blog/13.txt +++ b/blog/13.txt @@ -2,12 +2,15 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","13","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","13","d"],{"children":["__PAGE__?{\"id\":\"13\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","13","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","13","d"],{"children":["__PAGE__?{\"id\":\"13\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","13","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#graphql与现代api设计","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"GraphQL与现代API设计","children":"GraphQL与现代API设计"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#graphql简介","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"GraphQL简介","children":"GraphQL简介"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#使用graphql","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"使用GraphQL","children":"使用GraphQL"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#性能优化策略","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"性能优化策略","children":"性能优化策略"}]}],["$","li","4",{"className":"","children":["$","a",null,{"href":"#实践经验与注意事项","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"实践经验与注意事项","children":"实践经验与注意事项"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"GraphQL与现代API设计"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-05-15"}]," | ",["$","span",null,{"children":"孙十五"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","GraphQL",{"href":"/blog?tag=GraphQL","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"GraphQL"}]}],["$","$L8","API设计",{"href":"/blog?tag=API%E8%AE%BE%E8%AE%A1","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"API设计"}]}],["$","$L8","全栈开发",{"href":"/blog?tag=%E5%85%A8%E6%A0%88%E5%BC%80%E5%8F%91","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"全栈开发"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],false,["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/13&text=GraphQL与现代API设计","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/13","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/13&title=GraphQL与现代API设计","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"graphql与现代api设计","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#graphql与现代api设计","children":"GraphQL与现代API设计"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"GraphQL正在改变我们设计和使用API的方式。本文将深入讨论GraphQL的核心概念和优势,并指导如何在实际项目中使用GraphQL。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"graphql简介","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#graphql简介","children":"GraphQL简介"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"GraphQL是一种用于API的查询语言,也是一个运行时。它的主要特点包括:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"类型系统: 强类型定义提高了API的可预测性"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"按需获取: 客户端可以精确指定所需数据,减少过度获取"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"实时更新: Subscriptions支持实时数据流"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"使用graphql","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#使用graphql","children":"使用GraphQL"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"定义Schema:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement1",{"className":"token maybe-class-name","style":{},"children":["Query"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getPost"]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":["id"]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["getAllPosts"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement23",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement30",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement31",{"className":"token maybe-class-name","style":{},"children":["Mutation"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["createPost"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":["input"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token maybe-class-name","style":{},"children":["PostInput"]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["updatePost"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["id"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["input"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token maybe-class-name","style":{},"children":["PostInput"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["deletePost"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["id"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement85",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement86",{"className":"token maybe-class-name","style":{},"children":["Subscription"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement91",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["postCreated"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement94",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement95",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement100",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement101",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement113",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["title"]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement116",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement120",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["content"]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement123",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement124",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement125",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement127",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["author"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement130",{"className":"token maybe-class-name","style":{},"children":["Author"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement132",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement133",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement137",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement138",{"className":"token maybe-class-name","style":{},"children":["Author"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement142",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement143",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement145",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement147",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement148",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement149",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement150",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement152",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement153",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement156",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement157",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["email"]}],["$","span","code-segement158",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement159",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement160",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement161",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement162",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement163",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement164",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement165",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement167",{"className":"$undefined","style":{},"children":["input "]}],["$","span","code-segement168",{"className":"token maybe-class-name","style":{},"children":["PostInput"]}],["$","span","code-segement169",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement170",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement171",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement172",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement173",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["title"]}],["$","span","code-segement174",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement175",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement176",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement177",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement178",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement179",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement180",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["content"]}],["$","span","code-segement181",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement182",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement183",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement184",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement185",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement186",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement187",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["authorId"]}],["$","span","code-segement188",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement189",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement190",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement191",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement192",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement193",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement194",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement195",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","start":"2","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Apollo Client:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token imports maybe-class-name","style":{},"children":["ApolloClient"]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token imports maybe-class-name","style":{},"children":["InMemoryCache"]}],["$","span","code-segement8",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement9",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token imports maybe-class-name","style":{},"children":["ApolloProvider"]}],["$","span","code-segement11",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement12",{"className":"token imports","style":{},"children":[" useQuery"]}],["$","span","code-segement13",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement14",{"className":"token imports","style":{},"children":[" useMutation "]}],["$","span","code-segement15",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'@apollo/client'"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement23",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" client "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ApolloClient"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["uri"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'http://localhost:4000/graphql'"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["cache"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["InMemoryCache"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement57",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["App"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement73",{"className":"token maybe-class-name","style":{},"children":["ApolloProvider"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":[" client"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":["client"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement83",{"className":"token maybe-class-name","style":{},"children":["PostList"]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement91",{"className":"token maybe-class-name","style":{},"children":["ApolloProvider"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement102",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement105",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["PostList"]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement110",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement113",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":[" loading"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":[" error"]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":[" data "]}],["$","span","code-segement120",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement121",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement122",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement123",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement124",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useQuery"]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["GET_ALL_POSTS"]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement131",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement132",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement133",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":["loading"]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement137",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement138",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":["p"]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement143",{"className":"token maybe-class-name","style":{},"children":["Loading"]}],["$","span","code-segement144",{"className":"token spread","style":{"color":"hsl(221, 87%, 60%)"},"children":["..."]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement147",{"className":"$undefined","style":{},"children":["p"]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement151",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement152",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement153",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":["error"]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement157",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement158",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement159",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement160",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":["p"]}],["$","span","code-segement162",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement163",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["Error"]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement165",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement166",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement168",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement169",{"className":"$undefined","style":{},"children":["p"]}],["$","span","code-segement170",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement171",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement172",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement174",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement175",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement176",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement177",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement178",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement179",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement180",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement181",{"className":"$undefined","style":{},"children":["ul"]}],["$","span","code-segement182",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement183",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement184",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement185",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement186",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement187",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement188",{"className":"token property-access","style":{},"children":["getAllPosts"]}],["$","span","code-segement189",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement190",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["map"]}],["$","span","code-segement191",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement192",{"className":"token parameter","style":{},"children":["post"]}],["$","span","code-segement193",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement194",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement195",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement196",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement197",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement198",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement199",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement200",{"className":"$undefined","style":{},"children":["li key"]}],["$","span","code-segement201",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement202",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement203",{"className":"$undefined","style":{},"children":["post"]}],["$","span","code-segement204",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement205",{"className":"token property-access","style":{},"children":["id"]}],["$","span","code-segement206",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement207",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement208",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement209",{"className":"$undefined","style":{},"children":["post"]}],["$","span","code-segement210",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement211",{"className":"token property-access","style":{},"children":["title"]}],["$","span","code-segement212",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement213",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement214",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement215",{"className":"$undefined","style":{},"children":["li"]}],["$","span","code-segement216",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement217",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement218",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement219",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement220",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement221",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement222",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement223",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement224",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement225",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement226",{"className":"$undefined","style":{},"children":["ul"]}],["$","span","code-segement227",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement228",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement229",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement230",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement231",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement232",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement233",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement234",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement235",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement237",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement238",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement239",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement240",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["GET_ALL_POSTS"]}],["$","span","code-segement241",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement242",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement243",{"className":"$undefined","style":{},"children":[" gql"]}],["$","span","code-segement244",{"className":"token template-string template-punctuation","style":{"color":"hsl(119, 34%, 47%)"},"children":["`"]}],["$","span","code-segement245",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement246",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement247",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(301, 63%, 40%)"},"children":["query"]}],["$","span","code-segement248",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement249",{"className":"token template-string graphql language-graphql definition-query","style":{},"children":["GetAllPosts"]}],["$","span","code-segement250",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement251",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement252",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement253",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement254",{"className":"token template-string graphql language-graphql object","style":{},"children":["getAllPosts"]}],["$","span","code-segement255",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement256",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement257",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement258",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement259",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement260",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement261",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement262",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(5, 74%, 59%)"},"children":["title"]}],["$","span","code-segement263",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement264",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement265",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement266",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement267",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement268",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement269",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement270",{"className":"token template-string graphql language-graphql","style":{},"children":[""]}],["$","span","code-segement271",{"className":"token template-string template-punctuation","style":{"color":"hsl(119, 34%, 47%)"},"children":["`"]}],["$","span","code-segement272",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement273",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"性能优化策略","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#性能优化策略","children":"性能优化策略"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"查询合并: 将多个查询合并为一个,减少网络请求"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"缓存管理: 合理使用缓存,避免重复请求"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"分页查询: 对大量数据进行分页查询,提高性能"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"实践经验与注意事项","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实践经验与注意事项","children":"实践经验与注意事项"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"避免过度使用Subscriptions: Subscriptions可能会增加复杂性和性能开销"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["使用Apollo Client的最佳实践: 如使用",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useQuery"}],"和",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useMutation"}],"钩子"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["处理错误和异常: 使用GraphQL错误处理机制,如",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"errors"}],"字段和",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"onError"}],"回调"]}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"GraphQL为前后端交互带来了新的可能性。通过掌握GraphQL的核心概念和最佳实践,前端开发者可以构建出高性能、可维护的API,为用户提供更好的体验。"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +f:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"graphql与现代api设计","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#graphql与现代api设计","children":"GraphQL与现代API设计"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"GraphQL正在改变我们设计和使用API的方式。本文将深入讨论GraphQL的核心概念和优势,并指导如何在实际项目中使用GraphQL。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"graphql简介","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#graphql简介","children":"GraphQL简介"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"GraphQL是一种用于API的查询语言,也是一个运行时。它的主要特点包括:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"类型系统: 强类型定义提高了API的可预测性"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"按需获取: 客户端可以精确指定所需数据,减少过度获取"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"实时更新: Subscriptions支持实时数据流"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"使用graphql","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#使用graphql","children":"使用GraphQL"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"定义Schema:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement1",{"className":"token maybe-class-name","style":{},"children":["Query"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getPost"]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":["id"]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["getAllPosts"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement23",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement30",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement31",{"className":"token maybe-class-name","style":{},"children":["Mutation"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["createPost"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":["input"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token maybe-class-name","style":{},"children":["PostInput"]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["updatePost"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["id"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["input"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token maybe-class-name","style":{},"children":["PostInput"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["deletePost"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":["id"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement85",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement86",{"className":"token maybe-class-name","style":{},"children":["Subscription"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement91",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["postCreated"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement94",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement95",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement100",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement101",{"className":"token maybe-class-name","style":{},"children":["Post"]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement113",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["title"]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement116",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement118",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement120",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["content"]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement123",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement124",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement125",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement126",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement127",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["author"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement130",{"className":"token maybe-class-name","style":{},"children":["Author"]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement132",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement133",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement137",{"className":"$undefined","style":{},"children":["type "]}],["$","span","code-segement138",{"className":"token maybe-class-name","style":{},"children":["Author"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement142",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement143",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement145",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement147",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement148",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement149",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement150",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["name"]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement152",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement153",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement156",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement157",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["email"]}],["$","span","code-segement158",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement159",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement160",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement161",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement162",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement163",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement164",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement165",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement167",{"className":"$undefined","style":{},"children":["input "]}],["$","span","code-segement168",{"className":"token maybe-class-name","style":{},"children":["PostInput"]}],["$","span","code-segement169",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement170",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement171",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement172",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement173",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["title"]}],["$","span","code-segement174",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement175",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement176",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement177",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement178",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement179",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement180",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["content"]}],["$","span","code-segement181",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement182",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement183",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["String"]}],["$","span","code-segement184",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement185",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement186",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement187",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["authorId"]}],["$","span","code-segement188",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement189",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement190",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ID"]}],["$","span","code-segement191",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["!"]}],["$","span","code-segement192",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement193",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement194",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement195",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"type Query {\n getPost(id: ID!): Post\n getAllPosts: [Post]\n}\n\ntype Mutation {\n createPost(input: PostInput!): Post\n updatePost(id: ID!, input: PostInput!): Post\n deletePost(id: ID!): Post\n}\n\ntype Subscription {\n postCreated: Post\n}\n\ntype Post {\n id: ID!\n title: String!\n content: String!\n author: Author!\n}\n\ntype Author {\n id: ID!\n name: String!\n email: String!\n}\n\ninput PostInput {\n title: String!\n content: String!\n authorId: ID!\n}\n","language":"javascript"}]}]}]]}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","start":"2","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Apollo Client:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token imports maybe-class-name","style":{},"children":["ApolloClient"]}],["$","span","code-segement5",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement6",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token imports maybe-class-name","style":{},"children":["InMemoryCache"]}],["$","span","code-segement8",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement9",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token imports maybe-class-name","style":{},"children":["ApolloProvider"]}],["$","span","code-segement11",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement12",{"className":"token imports","style":{},"children":[" useQuery"]}],["$","span","code-segement13",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement14",{"className":"token imports","style":{},"children":[" useMutation "]}],["$","span","code-segement15",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'@apollo/client'"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement23",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" client "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ApolloClient"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["uri"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'http://localhost:4000/graphql'"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["cache"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["InMemoryCache"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement57",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["App"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement73",{"className":"token maybe-class-name","style":{},"children":["ApolloProvider"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":[" client"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":["client"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement83",{"className":"token maybe-class-name","style":{},"children":["PostList"]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement91",{"className":"token maybe-class-name","style":{},"children":["ApolloProvider"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement100",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement102",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement105",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["PostList"]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement110",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement111",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement113",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":[" loading"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement117",{"className":"$undefined","style":{},"children":[" error"]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":[" data "]}],["$","span","code-segement120",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement121",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement122",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement123",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement124",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useQuery"]}],["$","span","code-segement125",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["GET_ALL_POSTS"]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement129",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement131",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement132",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement133",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":["loading"]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement137",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement138",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement139",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement141",{"className":"$undefined","style":{},"children":["p"]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement143",{"className":"token maybe-class-name","style":{},"children":["Loading"]}],["$","span","code-segement144",{"className":"token spread","style":{"color":"hsl(221, 87%, 60%)"},"children":["..."]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement147",{"className":"$undefined","style":{},"children":["p"]}],["$","span","code-segement148",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement150",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement151",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement152",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["if"]}],["$","span","code-segement153",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement155",{"className":"$undefined","style":{},"children":["error"]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement157",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement158",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement159",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement160",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":["p"]}],["$","span","code-segement162",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement163",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["Error"]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement165",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement166",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement168",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement169",{"className":"$undefined","style":{},"children":["p"]}],["$","span","code-segement170",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement171",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement172",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement174",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement175",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement176",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement177",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement178",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement179",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement180",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement181",{"className":"$undefined","style":{},"children":["ul"]}],["$","span","code-segement182",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement183",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement184",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement185",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement186",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement187",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement188",{"className":"token property-access","style":{},"children":["getAllPosts"]}],["$","span","code-segement189",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement190",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["map"]}],["$","span","code-segement191",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement192",{"className":"token parameter","style":{},"children":["post"]}],["$","span","code-segement193",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement194",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement195",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement196",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement197",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement198",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement199",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement200",{"className":"$undefined","style":{},"children":["li key"]}],["$","span","code-segement201",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement202",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement203",{"className":"$undefined","style":{},"children":["post"]}],["$","span","code-segement204",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement205",{"className":"token property-access","style":{},"children":["id"]}],["$","span","code-segement206",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement207",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement208",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement209",{"className":"$undefined","style":{},"children":["post"]}],["$","span","code-segement210",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement211",{"className":"token property-access","style":{},"children":["title"]}],["$","span","code-segement212",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement213",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement214",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement215",{"className":"$undefined","style":{},"children":["li"]}],["$","span","code-segement216",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement217",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement218",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement219",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement220",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement221",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement222",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement223",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement224",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["<"]}],["$","span","code-segement225",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["/"]}],["$","span","code-segement226",{"className":"$undefined","style":{},"children":["ul"]}],["$","span","code-segement227",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[">"]}],["$","span","code-segement228",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement229",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement230",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement231",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement232",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement233",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement234",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement235",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement237",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement238",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement239",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement240",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["GET_ALL_POSTS"]}],["$","span","code-segement241",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement242",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement243",{"className":"$undefined","style":{},"children":[" gql"]}],["$","span","code-segement244",{"className":"token template-string template-punctuation","style":{"color":"hsl(119, 34%, 47%)"},"children":["`"]}],["$","span","code-segement245",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement246",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement247",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(301, 63%, 40%)"},"children":["query"]}],["$","span","code-segement248",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement249",{"className":"token template-string graphql language-graphql definition-query","style":{},"children":["GetAllPosts"]}],["$","span","code-segement250",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement251",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement252",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement253",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement254",{"className":"token template-string graphql language-graphql object","style":{},"children":["getAllPosts"]}],["$","span","code-segement255",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement256",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement257",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement258",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement259",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement260",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement261",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement262",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(5, 74%, 59%)"},"children":["title"]}],["$","span","code-segement263",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement264",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement265",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement266",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement267",{"className":"token template-string graphql language-graphql","style":{},"children":[" "]}],["$","span","code-segement268",{"className":"token template-string graphql language-graphql","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement269",{"className":"token template-string graphql language-graphql","style":{},"children":["\n"]}],["$","span","code-segement270",{"className":"token template-string graphql language-graphql","style":{},"children":[""]}],["$","span","code-segement271",{"className":"token template-string template-punctuation","style":{"color":"hsl(119, 34%, 47%)"},"children":["`"]}],["$","span","code-segement272",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement273",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"import { ApolloClient, InMemoryCache, ApolloProvider, useQuery, useMutation } from '@apollo/client';\n\nconst client = new ApolloClient({\n uri: 'http://localhost:4000/graphql',\n cache: new InMemoryCache()\n});\n\nfunction App() {\n return (\n \n \n \n );\n}\n\nfunction PostList() {\n const { loading, error, data } = useQuery(GET_ALL_POSTS);\n\n if (loading) return

    Loading...

    ;\n if (error) return

    Error :(

    ;\n\n return (\n
      \n {data.getAllPosts.map(post => (\n
    • {post.title}
    • \n ))}\n
    \n );\n}\n\nconst GET_ALL_POSTS = gql`\n query GetAllPosts {\n getAllPosts {\n id\n title\n }\n }\n`;\n","language":"javascript"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"性能优化策略","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#性能优化策略","children":"性能优化策略"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"查询合并: 将多个查询合并为一个,减少网络请求"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"缓存管理: 合理使用缓存,避免重复请求"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"分页查询: 对大量数据进行分页查询,提高性能"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"实践经验与注意事项","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实践经验与注意事项","children":"实践经验与注意事项"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"避免过度使用Subscriptions: Subscriptions可能会增加复杂性和性能开销"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["使用Apollo Client的最佳实践: 如使用",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useQuery"}],"和",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"useMutation"}],"钩子"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["处理错误和异常: 使用GraphQL错误处理机制,如",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"errors"}],"字段和",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"onError"}],"回调"]}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"GraphQL为前后端交互带来了新的可能性。通过掌握GraphQL的核心概念和最佳实践,前端开发者可以构建出高性能、可维护的API,为用户提供更好的体验。"}]] diff --git a/blog/14.html b/blog/14.html index f566653..e77d1b6 100644 --- a/blog/14.html +++ b/blog/14.html @@ -1,4 +1,4 @@ -我的博客

    前端安全最佳实践

    2024-05-20 | 周十六 |预计阅读时间: 1 分钟

    前端安全最佳实践

    +我的博客

    前端安全最佳实践

    2024-05-20 | 周十六 |预计阅读时间: 1 分钟

    前端安全最佳实践

    随着Web应用日益复杂,前端安全变得越来越重要。本文将全面介绍前端安全最佳实践,并指导如何在实际项目中保护Web应用免受常见安全威胁。

    XSS防御

      @@ -31,4 +31,4 @@

      使用安全的编码实践: 如避免使用eval()innerHTML
    1. 使用安全的通信协议: 如使用HTTPS和TLS
    -

    前端安全是一个持续的过程。通过不断学习和实践,前端开发者可以为用户提供更安全的Web应用,保护用户数据和隐私。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    前端安全是一个持续的过程。通过不断学习和实践,前端开发者可以为用户提供更安全的Web应用,保护用户数据和隐私。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/14.txt b/blog/14.txt index a9f7a1f..fa3b58d 100644 --- a/blog/14.txt +++ b/blog/14.txt @@ -2,11 +2,11 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","14","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","14","d"],{"children":["__PAGE__?{\"id\":\"14\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","14","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","14","d"],{"children":["__PAGE__?{\"id\":\"14\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","14","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#前端安全最佳实践","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"前端安全最佳实践","children":"前端安全最佳实践"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#xss防御","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"XSS防御","children":"XSS防御"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#csrf保护","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"CSRF保护","children":"CSRF保护"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#安全的第三方库管理","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"安全的第三方库管理","children":"安全的第三方库管理"}]}],["$","li","4",{"className":"","children":["$","a",null,{"href":"#https","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"HTTPS","children":"HTTPS"}]}],["$","li","5",{"className":"","children":["$","a",null,{"href":"#安全的本地存储","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"安全的本地存储","children":"安全的本地存储"}]}],["$","li","6",{"className":"","children":["$","a",null,{"href":"#实践经验与注意事项","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"实践经验与注意事项","children":"实践经验与注意事项"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"前端安全最佳实践"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-05-20"}]," | ",["$","span",null,{"children":"周十六"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","Web安全",{"href":"/blog?tag=Web%E5%AE%89%E5%85%A8","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"Web安全"}]}],["$","$L8","XSS",{"href":"/blog?tag=XSS","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"XSS"}]}],["$","$L8","CSRF",{"href":"/blog?tag=CSRF","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"CSRF"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],false,["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/14&text=前端安全最佳实践","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/14","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/14&title=前端安全最佳实践","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/blog/15.html b/blog/15.html index 4b59e47..bde8f7c 100644 --- a/blog/15.html +++ b/blog/15.html @@ -1,4 +1,4 @@ -我的博客

    前端工程化与构建优化

    2024-05-25 | 吴十七 |预计阅读时间: 1 分钟

    前端工程化与构建优化

    +我的博客

    前端工程化与构建优化

    2024-05-25 | 吴十七 |预计阅读时间: 1 分钟

    前端工程化与构建优化

    前端工程化对于大型项目的可维护性和性能至关重要。本文将深入探讨前端工程化的各个方面,并指导如何优化构建过程,提高开发效率和应用性能。

    模块化

      @@ -33,4 +33,4 @@

      使用TypeScript: 提高代码可维护性和类型安全
    1. 使用Docker: 确保构建环境的一致性
    -

    前端工程化和构建优化是一个持续的过程。通过不断学习和实践,前端开发者可以构建出高性能、可维护的大型前端应用,为用户提供更好的体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    前端工程化和构建优化是一个持续的过程。通过不断学习和实践,前端开发者可以构建出高性能、可维护的大型前端应用,为用户提供更好的体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/15.txt b/blog/15.txt index 681ce5a..6e37705 100644 --- a/blog/15.txt +++ b/blog/15.txt @@ -2,11 +2,11 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","15","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","15","d"],{"children":["__PAGE__?{\"id\":\"15\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","15","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","15","d"],{"children":["__PAGE__?{\"id\":\"15\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","15","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#前端工程化与构建优化","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"前端工程化与构建优化","children":"前端工程化与构建优化"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#模块化","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"模块化","children":"模块化"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#构建工具","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"构建工具","children":"构建工具"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#代码分割","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"代码分割","children":"代码分割"}]}],["$","li","4",{"className":"","children":["$","a",null,{"href":"#tree-shaking","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Tree Shaking","children":"Tree Shaking"}]}],["$","li","5",{"className":"","children":["$","a",null,{"href":"#持续集成/持续部署(ci/cd)","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"持续集成/持续部署(CI/CD)","children":"持续集成/持续部署(CI/CD)"}]}],["$","li","6",{"className":"","children":["$","a",null,{"href":"#实践经验与注意事项","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"实践经验与注意事项","children":"实践经验与注意事项"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"前端工程化与构建优化"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-05-25"}]," | ",["$","span",null,{"children":"吴十七"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","工程化",{"href":"/blog?tag=%E5%B7%A5%E7%A8%8B%E5%8C%96","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"工程化"}]}],["$","$L8","构建优化",{"href":"/blog?tag=%E6%9E%84%E5%BB%BA%E4%BC%98%E5%8C%96","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"构建优化"}]}],["$","$L8","性能优化",{"href":"/blog?tag=%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"性能优化"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],["$","div",null,{"className":"rounded-lg border bg-card text-card-foreground shadow-sm transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 mt-12","children":[["$","div",null,{"className":"flex flex-col space-y-1.5 p-6","children":["$","h3",null,{"className":"text-2xl font-semibold leading-none tracking-tight","children":"相关文章"}]}],["$","div",null,{"className":"p-6 pt-0","children":["$","ul",null,{"className":"space-y-2","children":[["$","li","2",{"children":["$","$L8",null,{"href":"/blog/2","className":"text-primary hover:underline","children":"Next.js 13新特性解析"}]}],["$","li","6",{"children":["$","$L8",null,{"href":"/blog/6","className":"text-primary hover:underline","children":"React性能优化实战指南"}]}],["$","li","7",{"children":["$","$L8",null,{"href":"/blog/7","className":"text-primary hover:underline","children":"WebAssembly与前端的未来"}]}]]}]}]]}],["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/15&text=前端工程化与构建优化","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/15","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/15&title=前端工程化与构建优化","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/blog/2.html b/blog/2.html index 7febe94..f13b482 100644 --- a/blog/2.html +++ b/blog/2.html @@ -1,4 +1,4 @@ -我的博客

    Next.js 13新特性解析

    2024-03-20 | 李四 |预计阅读时间: 2 分钟

    Next.js 13新特性解析

    +我的博客

    Next.js 13新特性解析

    2024-03-20 | 李四 |预计阅读时间: 2 分钟

    Next.js 13新特性解析

    Next.js 13是一个重大更新,引入了许多激动人心的新特性,如App Router、服务器组件、流式渲染等。本文将详细介绍这些新特性的使用方法和优势,以及如何从Next.js 12迁移到13版本。

    App Router

    App Router是Next.js 13最显著的新特性之一,它彻底改变了路由管理的方式。

    @@ -16,7 +16,7 @@

    在这个结构中,page.js文件定义了路由的主要内容,而layout.js则定义了共享布局。

    嵌套布局

    App Router支持嵌套布局,这使得创建复杂的页面结构变得更加简单:

    -
    // app/layout.js
    +
    // app/layout.js
     export default function RootLayout({ children }) {
       return (
         <html lang="en">
    @@ -34,10 +34,10 @@ 

    </div> ) } -

    jsx
    +

    服务器组件

    默认情况下,App Router中的所有组件都是服务器组件。这意味着它们在服务器上渲染,可以直接访问后端资源,并且不会增加客户端的JavaScript包大小。

    -
    // app/page.js
    +
    // app/page.js
     async function getData() {
       const res = await fetch('https://api.example.com/data')
       return res.json()
    @@ -47,10 +47,10 @@ 

    const data = await getData() return <main>{data.map(item => <div key={item.id}>{item.title}</div>)}</main> } -

    jsx
    +

    客户端组件

    当需要客户端交互时,可以使用客户端组件:

    -
    'use client'
    +
    'use client'
     
     import { useState } from 'react'
     
    @@ -62,7 +62,7 @@ 

    </button> ) } -

    jsx
    +

    服务器组件

    服务器组件是Next.js 13的另一个重要特性,它允许我们在服务器上渲染React组件,从而提高性能和SEO。

    优势

    @@ -79,7 +79,7 @@

    不需要客户端交互的静态内容
  • SEO关键的页面内容
  • -
    // app/products/page.js
    +
    // app/products/page.js
     async function getProducts() {
       const res = await fetch('https://api.example.com/products')
       return res.json()
    @@ -98,12 +98,12 @@ 

    </div> ) } -

    jsx
    +

    流式渲染

    流式渲染允许将页面内容分块传输到客户端,这可以显著改善大型应用的用户体验。

    实现方式

    Next.js 13通过loading.js文件和React的Suspense组件支持流式渲染:

    -
    // app/dashboard/loading.js
    +
    // app/dashboard/loading.js
     export default function Loading() {
       return <div>Loading...</div>
     }
    @@ -126,10 +126,10 @@ 

    </div> ) } -

    jsx
    +

    新的图片组件

    Next.js 13引入了新的Image组件,它提供了更好的性能和用户体验:

    -
    import Image from 'next/image'
    +
    import Image from 'next/image'
     
     export default function Avatar() {
       return (
    @@ -142,7 +142,7 @@ 

    /> ) } -

    jsx
    +

    新的Image组件支持:

    • 自动图片优化
    • @@ -152,7 +152,7 @@

      字体优化

      Next.js 13引入了新的字体系统,它可以自动优化和加载自定义字体:

      -
      import { Inter } from 'next/font/google'
      +
      import { Inter } from 'next/font/google'
       
       const inter = Inter({ subsets: ['latin'] })
       
      @@ -163,7 +163,7 @@ 

      </html> ) } -

      jsx
      +

      这个系统可以:

    \ No newline at end of file +

    随着Next.js的不断发展,我们可以期待看到更多令人兴奋的新特性和改进。如果您还没有尝试过Next.js 13,现在是时候了!

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/2.txt b/blog/2.txt index 73fa4af..e7731e4 100644 --- a/blog/2.txt +++ b/blog/2.txt @@ -2,12 +2,22 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","2","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","2","d"],{"children":["__PAGE__?{\"id\":\"2\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","2","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","2","d"],{"children":["__PAGE__?{\"id\":\"2\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","2","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#next.js-13新特性解析","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Next.js 13新特性解析","children":"Next.js 13新特性解析"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#app-router","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"App Router","children":"App Router"}]}],["$","li","2",{"className":"ml-2","children":["$","a",null,{"href":"#基于文件系统的路由","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"基于文件系统的路由","children":"基于文件系统的路由"}]}],["$","li","3",{"className":"ml-2","children":["$","a",null,{"href":"#嵌套布局","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"嵌套布局","children":"嵌套布局"}]}],["$","li","4",{"className":"ml-2","children":["$","a",null,{"href":"#服务器组件","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"服务器组件","children":"服务器组件"}]}],["$","li","5",{"className":"ml-2","children":["$","a",null,{"href":"#客户端组件","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"客户端组件","children":"客户端组件"}]}],["$","li","6",{"className":"","children":["$","a",null,{"href":"#服务器组件","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"服务器组件","children":"服务器组件"}]}],["$","li","7",{"className":"ml-2","children":["$","a",null,{"href":"#优势","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"优势","children":"优势"}]}],["$","li","8",{"className":"ml-2","children":["$","a",null,{"href":"#使用场景","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"使用场景","children":"使用场景"}]}],["$","li","9",{"className":"","children":["$","a",null,{"href":"#流式渲染","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"流式渲染","children":"流式渲染"}]}],["$","li","10",{"className":"ml-2","children":["$","a",null,{"href":"#实现方式","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"实现方式","children":"实现方式"}]}],["$","li","11",{"className":"","children":["$","a",null,{"href":"#新的图片组件","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"新的图片组件","children":"新的图片组件"}]}],["$","li","12",{"className":"","children":["$","a",null,{"href":"#字体优化","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"字体优化","children":"字体优化"}]}],["$","li","13",{"className":"","children":["$","a",null,{"href":"#从next.js-12迁移到13","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"从Next.js 12迁移到13","children":"从Next.js 12迁移到13"}]}],["$","li","14",{"className":"","children":["$","a",null,{"href":"#结论","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"结论","children":"结论"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"Next.js 13新特性解析"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-03-20"}]," | ",["$","span",null,{"children":"李四"}]," |",["$","span",null,{"children":["预计阅读时间: ",2," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","Next.js",{"href":"/blog?tag=Next.js","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"Next.js"}]}],["$","$L8","服务器组件",{"href":"/blog?tag=%E6%9C%8D%E5%8A%A1%E5%99%A8%E7%BB%84%E4%BB%B6","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"服务器组件"}]}],["$","$L8","性能优化",{"href":"/blog?tag=%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"性能优化"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],["$","div",null,{"className":"rounded-lg border bg-card text-card-foreground shadow-sm transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 mt-12","children":[["$","div",null,{"className":"flex flex-col space-y-1.5 p-6","children":["$","h3",null,{"className":"text-2xl font-semibold leading-none tracking-tight","children":"相关文章"}]}],["$","div",null,{"className":"p-6 pt-0","children":["$","ul",null,{"className":"space-y-2","children":[["$","li","6",{"children":["$","$L8",null,{"href":"/blog/6","className":"text-primary hover:underline","children":"React性能优化实战指南"}]}],["$","li","7",{"children":["$","$L8",null,{"href":"/blog/7","className":"text-primary hover:underline","children":"WebAssembly与前端的未来"}]}],["$","li","10",{"children":["$","$L8",null,{"href":"/blog/10","className":"text-primary hover:underline","children":"微前端架构实践与性能优化"}]}]]}]}]]}],["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/2&text=Next.js 13新特性解析","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/2","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/2&title=Next.js 13新特性解析","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"nextjs-13新特性解析","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#nextjs-13新特性解析","children":"Next.js 13新特性解析"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Next.js 13是一个重大更新,引入了许多激动人心的新特性,如App Router、服务器组件、流式渲染等。本文将详细介绍这些新特性的使用方法和优势,以及如何从Next.js 12迁移到13版本。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"app-router","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#app-router","children":"App Router"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"App Router是Next.js 13最显著的新特性之一,它彻底改变了路由管理的方式。"}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"基于文件系统的路由","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#基于文件系统的路由","children":"基于文件系统的路由"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["App Router延续了Next.js基于文件系统的路由概念,但引入了新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"app"}],"目录结构:"]}],"\n",["$","div",null,{"children":["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"app/\n layout.js\n page.js\n about/\n page.js\n blog/\n [slug]/\n page.js\n"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["在这个结构中,",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"page.js"}],"文件定义了路由的主要内容,而",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"layout.js"}],"则定义了共享布局。"]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"嵌套布局","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#嵌套布局","children":"嵌套布局"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"App Router支持嵌套布局,这使得创建复杂的页面结构变得更加简单:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/layout.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["RootLayout"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement11",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement12",{"className":"token parameter","style":{},"children":[" children "]}],["$","span","code-segement13",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["html"]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["lang"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["="]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["en"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement33",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement34",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["body"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":["children"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement44",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement45",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement57",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/blog/layout.js"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement61",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["BlogLayout"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement69",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement70",{"className":"token parameter","style":{},"children":[" children "]}],["$","span","code-segement71",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement76",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement77",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement85",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["nav"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement90",{"className":"token plain-text","style":{},"children":["Blog Navigation"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement94",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement95",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["children"]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement99",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement100",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement107",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement110",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"服务器组件","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#服务器组件","children":"服务器组件"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"默认情况下,App Router中的所有组件都是服务器组件。这意味着它们在服务器上渲染,可以直接访问后端资源,并且不会增加客户端的JavaScript包大小。"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/page.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getData"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" res "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'https://api.example.com/data'"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" res"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement29",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["json"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement37",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement38",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Page"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" data "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getData"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["main"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement72",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["map"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement74",{"className":"token parameter","style":{},"children":["item"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["key"]}],["$","span","code-segement82",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement83",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement84",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["item"]}],["$","span","code-segement85",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement86",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement87",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["item"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement92",{"className":"token property-access","style":{},"children":["title"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement103",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"客户端组件","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#客户端组件","children":"客户端组件"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"当需要客户端交互时,可以使用客户端组件:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'use client'"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement3",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement4",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement7",{"className":"token imports","style":{},"children":[" useState "]}],["$","span","code-segement8",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement15",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement16",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Counter"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["count"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" setCount"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement54",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement55",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement56",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement57",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement58",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement59",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement60",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement61",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["setCount"]}],["$","span","code-segement62",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement63",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["count "]}],["$","span","code-segement64",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["+"]}],["$","span","code-segement65",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement66",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement67",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement68",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement70",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement71",{"className":"token plain-text","style":{},"children":[" Count: "]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":["count"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement75",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement76",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"服务器组件-1","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#服务器组件-1","children":"服务器组件"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"服务器组件是Next.js 13的另一个重要特性,它允许我们在服务器上渲染React组件,从而提高性能和SEO。"}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"优势","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#优势","children":"优势"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"减少客户端JavaScript包大小"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"直接访问后端资源"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"自动代码分割"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"改善首次加载性能"}],"\n"]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"使用场景","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#使用场景","children":"使用场景"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"服务器组件特别适合于:"}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"需要访问后端资源的组件"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"不需要客户端交互的静态内容"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"SEO关键的页面内容"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/products/page.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getProducts"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" res "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'https://api.example.com/products'"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" res"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement29",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["json"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement37",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement38",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["ProductsPage"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" products "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getProducts"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement72",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement73",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["h1"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement77",{"className":"token plain-text","style":{},"children":["Products"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement81",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement82",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["ul"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement86",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement87",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":["products"]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement91",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["map"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement93",{"className":"token parameter","style":{},"children":["product"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["li"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["key"]}],["$","span","code-segement104",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement105",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement106",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["product"]}],["$","span","code-segement107",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement108",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement109",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement111",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":["product"]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement114",{"className":"token property-access","style":{},"children":["name"]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement122",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement124",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement125",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement129",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement130",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement134",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement137",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement138",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement139",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement140",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"流式渲染","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#流式渲染","children":"流式渲染"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"流式渲染允许将页面内容分块传输到客户端,这可以显著改善大型应用的用户体验。"}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"实现方式","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实现方式","children":"实现方式"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["Next.js 13通过",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"loading.js"}],"文件和React的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"Suspense"}],"组件支持流式渲染:"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/dashboard/loading.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Loading"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement21",{"className":"token plain-text","style":{},"children":["Loading..."]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement30",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/dashboard/page.js"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement34",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement37",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token imports maybe-class-name","style":{},"children":["Suspense"]}],["$","span","code-segement39",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement47",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement49",{"className":"token imports maybe-class-name","style":{},"children":["UserProfile"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'./UserProfile'"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement56",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token imports maybe-class-name","style":{},"children":["UserPosts"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'./UserPosts'"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement65",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement66",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement68",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Dashboard"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement87",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement88",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["h1"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement92",{"className":"token plain-text","style":{},"children":["Dashboard"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement96",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement97",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Suspense"]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["fallback"]}],["$","span","code-segement102",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement103",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement104",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement105",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement106",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement107",{"className":"token script language-javascript plain-text","style":{"color":"hsl(5, 74%, 59%)"},"children":["Loading profile..."]}],["$","span","code-segement108",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement111",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement113",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement114",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["UserProfile"]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["/>"]}],["$","span","code-segement119",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement120",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement124",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement125",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Suspense"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement129",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["fallback"]}],["$","span","code-segement130",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement131",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement132",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement133",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement134",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement135",{"className":"token script language-javascript plain-text","style":{"color":"hsl(5, 74%, 59%)"},"children":["Loading posts..."]}],["$","span","code-segement136",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement139",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement141",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement142",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["UserPosts"]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["/>"]}],["$","span","code-segement147",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement148",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement152",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement153",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement157",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement158",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement159",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement160",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement162",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement163",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"新的图片组件","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#新的图片组件","children":"新的图片组件"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["Next.js 13引入了新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"Image"}],"组件,它提供了更好的性能和用户体验:"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["Image"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'next/image'"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement9",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement10",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Avatar"]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Image"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["src"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["="]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["/avatar.png"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["alt"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["="]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["User Avatar"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["width"]}],["$","span","code-segement47",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement48",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement49",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["64"]}],["$","span","code-segement50",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["height"]}],["$","span","code-segement54",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement55",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement56",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["64"]}],["$","span","code-segement57",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["priority"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["/>"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"Image"}],"组件支持:"]}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"自动图片优化"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"延迟加载"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"响应式图片"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"防止布局偏移"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"字体优化","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#字体优化","children":"字体优化"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Next.js 13引入了新的字体系统,它可以自动优化和加载自定义字体:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token imports maybe-class-name","style":{},"children":["Inter"]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'next/font/google'"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement13",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" inter "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Inter"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["subsets"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'latin'"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement33",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement34",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["RootLayout"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement42",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement43",{"className":"token parameter","style":{},"children":[" children "]}],["$","span","code-segement44",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["html"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["lang"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["="]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["en"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["className"]}],["$","span","code-segement65",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement66",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement67",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["inter"]}],["$","span","code-segement68",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement69",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["className"]}],["$","span","code-segement70",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement72",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement73",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["body"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":["children"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement83",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement84",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"这个系统可以:"}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"自动内联字体CSS"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"消除布局偏移"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"预加载关键字体文件"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"从nextjs-12迁移到13","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#从nextjs-12迁移到13","children":"从Next.js 12迁移到13"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"迁移到Next.js 13需要注意以下几点:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["创建新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"app"}],"目录,逐步迁移路由"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["更新",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"next/image"}],"导入为",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"next/legacy/image"}]]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["将客户端组件标记为",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"'use client'"}]]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["更新API路由到新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"app/api"}],"目录"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["使用新的数据获取方法替代",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"getServerSideProps"}],"和",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"getStaticProps"}]]}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"结论","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#结论","children":"结论"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Next.js 13带来了许多令人兴奋的新特性,这些特性不仅提高了开发效率,还大大改善了应用性能和用户体验。App Router、服务器组件和流式渲染等新特性为我们提供了更灵活、更强大的工具,使得构建现代Web应用变得更加容易。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"随着Next.js的不断发展,我们可以期待看到更多令人兴奋的新特性和改进。如果您还没有尝试过Next.js 13,现在是时候了!"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"nextjs-13新特性解析","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#nextjs-13新特性解析","children":"Next.js 13新特性解析"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Next.js 13是一个重大更新,引入了许多激动人心的新特性,如App Router、服务器组件、流式渲染等。本文将详细介绍这些新特性的使用方法和优势,以及如何从Next.js 12迁移到13版本。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"app-router","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#app-router","children":"App Router"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"App Router是Next.js 13最显著的新特性之一,它彻底改变了路由管理的方式。"}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"基于文件系统的路由","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#基于文件系统的路由","children":"基于文件系统的路由"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["App Router延续了Next.js基于文件系统的路由概念,但引入了新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"app"}],"目录结构:"]}],"\n",["$","div",null,{"children":["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"app/\n layout.js\n page.js\n about/\n page.js\n blog/\n [slug]/\n page.js\n"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["在这个结构中,",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"page.js"}],"文件定义了路由的主要内容,而",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"layout.js"}],"则定义了共享布局。"]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"嵌套布局","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#嵌套布局","children":"嵌套布局"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"App Router支持嵌套布局,这使得创建复杂的页面结构变得更加简单:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/layout.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["RootLayout"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement11",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement12",{"className":"token parameter","style":{},"children":[" children "]}],["$","span","code-segement13",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["html"]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["lang"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["="]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["en"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement33",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement34",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["body"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":["children"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement44",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement45",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement57",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/blog/layout.js"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement61",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["BlogLayout"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement69",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement70",{"className":"token parameter","style":{},"children":[" children "]}],["$","span","code-segement71",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement76",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement77",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement85",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement86",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["nav"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement90",{"className":"token plain-text","style":{},"children":["Blog Navigation"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement94",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement95",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement97",{"className":"$undefined","style":{},"children":["children"]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement99",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement100",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement104",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement107",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement108",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement110",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$Lf"}]}]]}]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"服务器组件","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#服务器组件","children":"服务器组件"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"默认情况下,App Router中的所有组件都是服务器组件。这意味着它们在服务器上渲染,可以直接访问后端资源,并且不会增加客户端的JavaScript包大小。"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/page.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getData"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" res "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'https://api.example.com/data'"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" res"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement29",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["json"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement37",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement38",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Page"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" data "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getData"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["main"]}],["$","span","code-segement68",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["data"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement72",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["map"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement74",{"className":"token parameter","style":{},"children":["item"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["key"]}],["$","span","code-segement82",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement83",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement84",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["item"]}],["$","span","code-segement85",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement86",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement87",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["item"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement92",{"className":"token property-access","style":{},"children":["title"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement102",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement103",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement105",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L10"}]}]]}]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"客户端组件","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#客户端组件","children":"客户端组件"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"当需要客户端交互时,可以使用客户端组件:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'use client'"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement3",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement4",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement7",{"className":"token imports","style":{},"children":[" useState "]}],["$","span","code-segement8",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement15",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement16",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Counter"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["count"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" setCount"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement54",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement55",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement56",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement57",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement58",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement59",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement60",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement61",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["setCount"]}],["$","span","code-segement62",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement63",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["count "]}],["$","span","code-segement64",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["+"]}],["$","span","code-segement65",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement66",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement67",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement68",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement70",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement71",{"className":"token plain-text","style":{},"children":[" Count: "]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":["count"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement75",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement76",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement84",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L11"}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"服务器组件-1","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#服务器组件-1","children":"服务器组件"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"服务器组件是Next.js 13的另一个重要特性,它允许我们在服务器上渲染React组件,从而提高性能和SEO。"}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"优势","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#优势","children":"优势"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"减少客户端JavaScript包大小"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"直接访问后端资源"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"自动代码分割"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"改善首次加载性能"}],"\n"]}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"使用场景","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#使用场景","children":"使用场景"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"服务器组件特别适合于:"}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"需要访问后端资源的组件"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"不需要客户端交互的静态内容"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"SEO关键的页面内容"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/products/page.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getProducts"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" res "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'https://api.example.com/products'"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" res"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement29",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["json"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement37",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement38",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["ProductsPage"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" products "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getProducts"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement72",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement73",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["h1"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement77",{"className":"token plain-text","style":{},"children":["Products"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement81",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement82",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["ul"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement86",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement87",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":["products"]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement91",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["map"]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement93",{"className":"token parameter","style":{},"children":["product"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["li"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["key"]}],["$","span","code-segement104",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement105",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement106",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["product"]}],["$","span","code-segement107",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement108",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["id"]}],["$","span","code-segement109",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement110",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement111",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement112",{"className":"$undefined","style":{},"children":["product"]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement114",{"className":"token property-access","style":{},"children":["name"]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement122",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement123",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement124",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement125",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement129",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement130",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement134",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement135",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement137",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement138",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement139",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement140",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L12"}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"流式渲染","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#流式渲染","children":"流式渲染"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"流式渲染允许将页面内容分块传输到客户端,这可以显著改善大型应用的用户体验。"}],"\n",["$","h3",null,{"className":"text-xl font-medium mt-4 mb-2 text-gray-700 dark:text-gray-300 scroll-mt-20","id":"实现方式","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实现方式","children":"实现方式"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["Next.js 13通过",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"loading.js"}],"文件和React的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"Suspense"}],"组件支持流式渲染:"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/dashboard/loading.js"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement4",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement5",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Loading"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement21",{"className":"token plain-text","style":{},"children":["Loading..."]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement30",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// app/dashboard/page.js"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement34",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement37",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token imports maybe-class-name","style":{},"children":["Suspense"]}],["$","span","code-segement39",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react'"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement47",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement49",{"className":"token imports maybe-class-name","style":{},"children":["UserProfile"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'./UserProfile'"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement56",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token imports maybe-class-name","style":{},"children":["UserPosts"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'./UserPosts'"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement65",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement66",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement68",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Dashboard"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement77",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement79",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement87",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement88",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["h1"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement92",{"className":"token plain-text","style":{},"children":["Dashboard"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement96",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement97",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement98",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement99",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Suspense"]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["fallback"]}],["$","span","code-segement102",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement103",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement104",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement105",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement106",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement107",{"className":"token script language-javascript plain-text","style":{"color":"hsl(5, 74%, 59%)"},"children":["Loading profile..."]}],["$","span","code-segement108",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement111",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement113",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement114",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement115",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement116",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["UserProfile"]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["/>"]}],["$","span","code-segement119",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement120",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement124",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement125",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement126",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement127",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Suspense"]}],["$","span","code-segement128",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement129",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["fallback"]}],["$","span","code-segement130",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement131",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement132",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement133",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement134",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement135",{"className":"token script language-javascript plain-text","style":{"color":"hsl(5, 74%, 59%)"},"children":["Loading posts..."]}],["$","span","code-segement136",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement139",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement140",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement141",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement142",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement143",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["UserPosts"]}],["$","span","code-segement145",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement146",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["/>"]}],["$","span","code-segement147",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement148",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement152",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement153",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement154",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement157",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement158",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement159",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement160",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement161",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement162",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement163",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L13"}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"新的图片组件","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#新的图片组件","children":"新的图片组件"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["Next.js 13引入了新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"Image"}],"组件,它提供了更好的性能和用户体验:"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["Image"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'next/image'"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement9",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement10",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Avatar"]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Image"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["src"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["="]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["/avatar.png"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["alt"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["="]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["User Avatar"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["width"]}],["$","span","code-segement47",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement48",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement49",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["64"]}],["$","span","code-segement50",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["height"]}],["$","span","code-segement54",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement55",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement56",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["64"]}],["$","span","code-segement57",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["priority"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["/>"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L14"}]}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":["新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"Image"}],"组件支持:"]}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"自动图片优化"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"延迟加载"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"响应式图片"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"防止布局偏移"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"字体优化","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#字体优化","children":"字体优化"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Next.js 13引入了新的字体系统,它可以自动优化和加载自定义字体:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token imports maybe-class-name","style":{},"children":["Inter"]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'next/font/google'"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement13",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" inter "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement18",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Inter"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token literal-property","style":{"color":"hsl(5, 74%, 59%)"},"children":["subsets"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'latin'"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement28",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement33",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement34",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["export"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["default"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["RootLayout"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement42",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement43",{"className":"token parameter","style":{},"children":[" children "]}],["$","span","code-segement44",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["html"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["lang"]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["="]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["en"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["\""]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["className"]}],["$","span","code-segement65",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement66",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement67",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["inter"]}],["$","span","code-segement68",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement69",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["className"]}],["$","span","code-segement70",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement72",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement73",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["body"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement78",{"className":"$undefined","style":{},"children":["children"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement83",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement84",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement88",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L15"}]}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"这个系统可以:"}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"自动内联字体CSS"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"消除布局偏移"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"预加载关键字体文件"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"从nextjs-12迁移到13","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#从nextjs-12迁移到13","children":"从Next.js 12迁移到13"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"迁移到Next.js 13需要注意以下几点:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["创建新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"app"}],"目录,逐步迁移路由"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["更新",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"next/image"}],"导入为",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"next/legacy/image"}]]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["将客户端组件标记为",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"'use client'"}]]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["更新API路由到新的",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"app/api"}],"目录"]}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":["使用新的数据获取方法替代",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"getServerSideProps"}],"和",["$","code",null,{"className":"bg-gray-100 dark:bg-gray-800 rounded px-1 py-0.5 font-mono text-sm","children":"getStaticProps"}]]}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"结论","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#结论","children":"结论"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Next.js 13带来了许多令人兴奋的新特性,这些特性不仅提高了开发效率,还大大改善了应用性能和用户体验。App Router、服务器组件和流式渲染等新特性为我们提供了更灵活、更强大的工具,使得构建现代Web应用变得更加容易。"}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"随着Next.js的不断发展,我们可以期待看到更多令人兴奋的新特性和改进。如果您还没有尝试过Next.js 13,现在是时候了!"}]] +16:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +f:["$","$L16",null,{"text":"// app/layout.js\nexport default function RootLayout({ children }) {\n return (\n \n {children}\n \n )\n}\n\n// app/blog/layout.js\nexport default function BlogLayout({ children }) {\n return (\n
    \n \n {children}\n
    \n )\n}\n","language":"jsx"}] +10:["$","$L16",null,{"text":"// app/page.js\nasync function getData() {\n const res = await fetch('https://api.example.com/data')\n return res.json()\n}\n\nexport default async function Page() {\n const data = await getData()\n return
    {data.map(item =>
    {item.title}
    )}
    \n}\n","language":"jsx"}] +11:["$","$L16",null,{"text":"'use client'\n\nimport { useState } from 'react'\n\nexport default function Counter() {\n const [count, setCount] = useState(0)\n return (\n \n )\n}\n","language":"jsx"}] +12:["$","$L16",null,{"text":"// app/products/page.js\nasync function getProducts() {\n const res = await fetch('https://api.example.com/products')\n return res.json()\n}\n\nexport default async function ProductsPage() {\n const products = await getProducts()\n return (\n
    \n

    Products

    \n
      \n {products.map(product => (\n
    • {product.name}
    • \n ))}\n
    \n
    \n )\n}\n","language":"jsx"}] +13:["$","$L16",null,{"text":"// app/dashboard/loading.js\nexport default function Loading() {\n return
    Loading...
    \n}\n\n// app/dashboard/page.js\nimport { Suspense } from 'react'\nimport UserProfile from './UserProfile'\nimport UserPosts from './UserPosts'\n\nexport default function Dashboard() {\n return (\n
    \n

    Dashboard

    \n Loading profile...
    }>\n \n \n Loading posts...}>\n \n \n \n )\n}\n","language":"jsx"}] +14:["$","$L16",null,{"text":"import Image from 'next/image'\n\nexport default function Avatar() {\n return (\n \n )\n}\n","language":"jsx"}] +15:["$","$L16",null,{"text":"import { Inter } from 'next/font/google'\n\nconst inter = Inter({ subsets: ['latin'] })\n\nexport default function RootLayout({ children }) {\n return (\n \n {children}\n \n )\n}\n","language":"jsx"}] diff --git a/blog/3.html b/blog/3.html index 8d91766..6545116 100644 --- a/blog/3.html +++ b/blog/3.html @@ -1,4 +1,4 @@ -我的博客

    CSS-in-JS解决方案对比

    2024-03-25 | 王五 |预计阅读时间: 1 分钟

    CSS-in-JS解决方案对比

    +我的博客

    CSS-in-JS解决方案对比

    2024-03-25 | 王五 |预计阅读时间: 1 分钟

    CSS-in-JS解决方案对比

    CSS-in-JS已成为现代前端开发中的重要工具。本文将对比分析几种流行的CSS-in-JS解决方案,包括styled-components、Emotion、CSS Modules等。我们将从性能、开发体验、维护性等多个角度进行评估,并提供每种方案的最佳使用场景。此外,我们还将探讨CSS-in-JS与传统CSS方法的区别,以及如何在大型项目中有效管理样式。

    styled-components

    styled-components是最流行的CSS-in-JS库之一。它结合了CSS和JavaScript的优点,使得我们可以在React组件中定义样式。

    @@ -66,4 +66,4 @@

    使用CSS-in-JS库的最佳实践: 每个CSS-in-JS库都有自己的最佳实践,例如styled-components的ThemeProvider和Emotion的css函数。

    结论

    -

    CSS-in-JS是一种强大的工具,它可以提供更好的作用域隔离、动态样式支持和主题化。styled-components、Emotion和CSS Modules都是流行的解决方案,每种方案都有自己的优缺点和最佳使用场景。在选择CSS-in-JS库时,应该根据项目的需求和规模来权衡性能、开发体验和维护性。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    CSS-in-JS是一种强大的工具,它可以提供更好的作用域隔离、动态样式支持和主题化。styled-components、Emotion和CSS Modules都是流行的解决方案,每种方案都有自己的优缺点和最佳使用场景。在选择CSS-in-JS库时,应该根据项目的需求和规模来权衡性能、开发体验和维护性。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/3.txt b/blog/3.txt index 4ee8d37..155d9c7 100644 --- a/blog/3.txt +++ b/blog/3.txt @@ -2,11 +2,11 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","3","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","3","d"],{"children":["__PAGE__?{\"id\":\"3\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","3","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","3","d"],{"children":["__PAGE__?{\"id\":\"3\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","3","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#css-in-js解决方案对比","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"CSS-in-JS解决方案对比","children":"CSS-in-JS解决方案对比"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#styled-components","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"styled-components","children":"styled-components"}]}],["$","li","2",{"className":"ml-2","children":["$","a",null,{"href":"#优点","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"优点","children":"优点"}]}],["$","li","3",{"className":"ml-2","children":["$","a",null,{"href":"#缺点","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"缺点","children":"缺点"}]}],["$","li","4",{"className":"ml-2","children":["$","a",null,{"href":"#最佳使用场景","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"最佳使用场景","children":"最佳使用场景"}]}],["$","li","5",{"className":"","children":["$","a",null,{"href":"#emotion","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Emotion","children":"Emotion"}]}],["$","li","6",{"className":"ml-2","children":["$","a",null,{"href":"#优点","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"优点","children":"优点"}]}],["$","li","7",{"className":"ml-2","children":["$","a",null,{"href":"#缺点","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"缺点","children":"缺点"}]}],["$","li","8",{"className":"ml-2","children":["$","a",null,{"href":"#最佳使用场景","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"最佳使用场景","children":"最佳使用场景"}]}],["$","li","9",{"className":"","children":["$","a",null,{"href":"#css-modules","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"CSS Modules","children":"CSS Modules"}]}],["$","li","10",{"className":"ml-2","children":["$","a",null,{"href":"#优点","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"优点","children":"优点"}]}],["$","li","11",{"className":"ml-2","children":["$","a",null,{"href":"#缺点","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"缺点","children":"缺点"}]}],["$","li","12",{"className":"ml-2","children":["$","a",null,{"href":"#最佳使用场景","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"最佳使用场景","children":"最佳使用场景"}]}],["$","li","13",{"className":"","children":["$","a",null,{"href":"#css-in-js与传统css的区别","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"CSS-in-JS与传统CSS的区别","children":"CSS-in-JS与传统CSS的区别"}]}],["$","li","14",{"className":"","children":["$","a",null,{"href":"#在大型项目中管理样式","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"在大型项目中管理样式","children":"在大型项目中管理样式"}]}],["$","li","15",{"className":"","children":["$","a",null,{"href":"#结论","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"结论","children":"结论"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"CSS-in-JS解决方案对比"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-03-25"}]," | ",["$","span",null,{"children":"王五"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","CSS-in-JS",{"href":"/blog?tag=CSS-in-JS","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"CSS-in-JS"}]}],["$","$L8","styled-components",{"href":"/blog?tag=styled-components","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"styled-components"}]}],["$","$L8","Emotion",{"href":"/blog?tag=Emotion","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"Emotion"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],false,["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/3&text=CSS-in-JS解决方案对比","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/3","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/3&title=CSS-in-JS解决方案对比","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/blog/4.html b/blog/4.html index 5c8758c..4f9a1b3 100644 --- a/blog/4.html +++ b/blog/4.html @@ -1,4 +1,4 @@ -我的博客

    TypeScript高级类型技巧

    2024-03-30 | 赵六 |预计阅读时间: 1 分钟

    TypeScript高级类型技巧

    +我的博客

    TypeScript高级类型技巧

    2024-03-30 | 赵六 |预计阅读时间: 1 分钟

    TypeScript高级类型技巧

    TypeScript的类型系统非常强大,但也有一定的学习曲线。本文将深入探讨TypeScript中的高级类型技巧,包括条件类型、映射类型、联合类型和交叉类型等。我们将通过实际子展这些高级类型的应用,如何使用它们来创建更灵活、更安全的代码。同时,我们还将讨论TypeScript的类型推断机制,以及如何编写和使用自定义类型守卫。

    条件类型

    条件类型允许我们根据条件选择不同的类型。它的语法如下:

    @@ -51,4 +51,4 @@

    结论

    -

    TypeScript的高级类型技巧可以帮助我们创建更灵活、更安全的代码。通过掌握条件类型、映射类型、联合类型和交叉类型等高级类型,我们可以更好地表达复杂的类型关系。同时,通过理解TypeScript的类型推断机制和自定义类型守卫,我们可以更好地控制类型检查。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    TypeScript的高级类型技巧可以帮助我们创建更灵活、更安全的代码。通过掌握条件类型、映射类型、联合类型和交叉类型等高级类型,我们可以更好地表达复杂的类型关系。同时,通过理解TypeScript的类型推断机制和自定义类型守卫,我们可以更好地控制类型检查。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/4.txt b/blog/4.txt index 796c73e..584c167 100644 --- a/blog/4.txt +++ b/blog/4.txt @@ -2,11 +2,11 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","4","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","4","d"],{"children":["__PAGE__?{\"id\":\"4\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","4","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","4","d"],{"children":["__PAGE__?{\"id\":\"4\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","4","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#typescript高级类型技巧","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"TypeScript高级类型技巧","children":"TypeScript高级类型技巧"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#条件类型","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"条件类型","children":"条件类型"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#映射类型","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"映射类型","children":"映射类型"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#联合类型和交叉类型","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"联合类型和交叉类型","children":"联合类型和交叉类型"}]}],["$","li","4",{"className":"","children":["$","a",null,{"href":"#类型推断","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"类型推断","children":"类型推断"}]}],["$","li","5",{"className":"","children":["$","a",null,{"href":"#自定义类型守卫","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"自定义类型守卫","children":"自定义类型守卫"}]}],["$","li","6",{"className":"","children":["$","a",null,{"href":"#结论","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"结论","children":"结论"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"TypeScript高级类型技巧"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-03-30"}]," | ",["$","span",null,{"children":"赵六"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","TypeScript",{"href":"/blog?tag=TypeScript","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"TypeScript"}]}],["$","$L8","类型系统",{"href":"/blog?tag=%E7%B1%BB%E5%9E%8B%E7%B3%BB%E7%BB%9F","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"类型系统"}]}],["$","$L8","前端开发",{"href":"/blog?tag=%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"前端开发"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],["$","div",null,{"className":"rounded-lg border bg-card text-card-foreground shadow-sm transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 mt-12","children":[["$","div",null,{"className":"flex flex-col space-y-1.5 p-6","children":["$","h3",null,{"className":"text-2xl font-semibold leading-none tracking-tight","children":"相关文章"}]}],["$","div",null,{"className":"p-6 pt-0","children":["$","ul",null,{"className":"space-y-2","children":[["$","li","1",{"children":["$","$L8",null,{"href":"/blog/1","className":"text-primary hover:underline","children":"深入理解React Hooks"}]}],["$","li","8",{"children":["$","$L8",null,{"href":"/blog/8","className":"text-primary hover:underline","children":"AI驱动的前端开发:机遇与挑战"}]}]]}]}]]}],["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/4&text=TypeScript高级类型技巧","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/4","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/4&title=TypeScript高级类型技巧","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/blog/5.html b/blog/5.html index af87ab3..def3188 100644 --- a/blog/5.html +++ b/blog/5.html @@ -1,8 +1,8 @@ -我的博客

    深入理解JavaScript异步编程

    2024-04-05 | 陈七 |预计阅读时间: 1 分钟

    JavaScript异步编程深度解析

    +我的博客

    深入理解JavaScript异步编程

    2024-04-05 | 陈七 |预计阅读时间: 1 分钟

    JavaScript异步编程深度解析

    JavaScript的异步编程是前端开发中的重要概念。本文将深入探讨各种异步编程模式及其应用。

    回调函数

    回调函数是最基本的异步编程方式:

    -
    function fetchData(callback) {
    +
    function fetchData(callback) {
       setTimeout(() => {
         callback('Data fetched');
       }, 1000);
    @@ -11,10 +11,10 @@ 

    fetchData((result) => { console.log(result); }); -

    javascript
    +

    Promise

    Promise提供了更优雅的异步处理方式:

    -
    function fetchData() {
    +
    function fetchData() {
       return new Promise((resolve, reject) => {
         setTimeout(() => {
           resolve('Data fetched');
    @@ -25,10 +25,10 @@ 

    fetchData() .then(result => console.log(result)) .catch(error => console.error(error)); -

    javascript
    +

    Async/Await

    Async/Await是基于Promise的语法糖,使异步代码更易读:

    -
    async function getData() {
    +
    async function getData() {
       try {
         const result = await fetchData();
         console.log(result);
    @@ -38,5 +38,5 @@ 

    } getData(); -

    javascript
    -

    通过掌握这些异步编程模式,我们可以更好地处理复杂的异步操作,提高代码的可读性和可维护性。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +
    +

    通过掌握这些异步编程模式,我们可以更好地处理复杂的异步操作,提高代码的可读性和可维护性。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/5.txt b/blog/5.txt index 2dd0dfd..389926b 100644 --- a/blog/5.txt +++ b/blog/5.txt @@ -2,12 +2,15 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","5","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","5","d"],{"children":["__PAGE__?{\"id\":\"5\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","5","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","5","d"],{"children":["__PAGE__?{\"id\":\"5\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","5","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#javascript异步编程深度解析","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"JavaScript异步编程深度解析","children":"JavaScript异步编程深度解析"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#回调函数","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"回调函数","children":"回调函数"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#promise","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Promise","children":"Promise"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#async/await","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Async/Await","children":"Async/Await"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"深入理解JavaScript异步编程"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-04-05"}]," | ",["$","span",null,{"children":"陈七"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","JavaScript",{"href":"/blog?tag=JavaScript","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"JavaScript"}]}],["$","$L8","异步编程",{"href":"/blog?tag=%E5%BC%82%E6%AD%A5%E7%BC%96%E7%A8%8B","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"异步编程"}]}],["$","$L8","Promise",{"href":"/blog?tag=Promise","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"Promise"}]}],["$","$L8","Async/Await",{"href":"/blog?tag=Async%2FAwait","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"Async/Await"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],false,["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/5&text=深入理解JavaScript异步编程","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/5","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/5&title=深入理解JavaScript异步编程","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"javascript异步编程深度解析","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#javascript异步编程深度解析","children":"JavaScript异步编程深度解析"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"JavaScript的异步编程是前端开发中的重要概念。本文将深入探讨各种异步编程模式及其应用。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"回调函数","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#回调函数","children":"回调函数"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"回调函数是最基本的异步编程方式:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement4",{"className":"token parameter","style":{},"children":["callback"]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setTimeout"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement15",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["callback"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Data fetched'"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1000"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement38",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement42",{"className":"token parameter","style":{},"children":["result"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement52",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":["result"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"promise","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#promise","children":"Promise"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Promise提供了更优雅的异步处理方式:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Promise"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement16",{"className":"token parameter","style":{},"children":["resolve"]}],["$","span","code-segement17",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement18",{"className":"token parameter","style":{},"children":[" reject"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setTimeout"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement31",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["resolve"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Data fetched'"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1000"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement59",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement66",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement68",{"className":"token parameter","style":{},"children":["result"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement74",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement76",{"className":"$undefined","style":{},"children":["result"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement79",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement82",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["catch"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement84",{"className":"token parameter","style":{},"children":["error"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement86",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement90",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["error"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":["error"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"asyncawait","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#asyncawait","children":"Async/Await"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Async/Await是基于Promise的语法糖,使异步代码更易读:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getData"]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["try"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" result "]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement30",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["result"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement39",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["catch"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":["error"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement48",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement50",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["error"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["error"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement63",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getData"]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"通过掌握这些异步编程模式,我们可以更好地处理复杂的异步操作,提高代码的可读性和可维护性。"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +f:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"javascript异步编程深度解析","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#javascript异步编程深度解析","children":"JavaScript异步编程深度解析"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"JavaScript的异步编程是前端开发中的重要概念。本文将深入探讨各种异步编程模式及其应用。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"回调函数","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#回调函数","children":"回调函数"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"回调函数是最基本的异步编程方式:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement4",{"className":"token parameter","style":{},"children":["callback"]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement6",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setTimeout"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement15",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["callback"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Data fetched'"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1000"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement38",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement42",{"className":"token parameter","style":{},"children":["result"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement50",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement52",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":["result"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"function fetchData(callback) {\n setTimeout(() => {\n callback('Data fetched');\n }, 1000);\n}\n\nfetchData((result) => {\n console.log(result);\n});\n","language":"javascript"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"promise","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#promise","children":"Promise"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Promise提供了更优雅的异步处理方式:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Promise"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement16",{"className":"token parameter","style":{},"children":["resolve"]}],["$","span","code-segement17",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement18",{"className":"token parameter","style":{},"children":[" reject"]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setTimeout"]}],["$","span","code-segement27",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement31",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["resolve"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'Data fetched'"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1000"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement59",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement66",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement68",{"className":"token parameter","style":{},"children":["result"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement70",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement74",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement76",{"className":"$undefined","style":{},"children":["result"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement79",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement82",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["catch"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement84",{"className":"token parameter","style":{},"children":["error"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement86",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement90",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["error"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":["error"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement94",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"function fetchData() {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve('Data fetched');\n }, 1000);\n });\n}\n\nfetchData()\n .then(result => console.log(result))\n .catch(error => console.error(error));\n","language":"javascript"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"asyncawait","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#asyncawait","children":"Async/Await"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Async/Await是基于Promise的语法糖,使异步代码更易读:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getData"]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement9",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["try"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement17",{"className":"$undefined","style":{},"children":[" result "]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetchData"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement30",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":["result"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement39",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["catch"]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement42",{"className":"$undefined","style":{},"children":["error"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement48",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement50",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["error"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["error"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement63",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getData"]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"async function getData() {\n try {\n const result = await fetchData();\n console.log(result);\n } catch (error) {\n console.error(error);\n }\n}\n\ngetData();\n","language":"javascript"}]}]}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"通过掌握这些异步编程模式,我们可以更好地处理复杂的异步操作,提高代码的可读性和可维护性。"}]] diff --git a/blog/6.html b/blog/6.html index 804447a..c094c8d 100644 --- a/blog/6.html +++ b/blog/6.html @@ -1,14 +1,14 @@ -我的博客

    React性能优化实战指南

    2024-04-10 | 林八 |预计阅读时间: 1 分钟

    React性能优化实战指南

    +我的博客

    React性能优化实战指南

    2024-04-10 | 林八 |预计阅读时间: 1 分钟

    React性能优化实战指南

    在构建大型React应用时,性能优化至关重要。本文将介绍一些实用的React性能优化技巧。

    使用React.memo

    React.memo可以帮助我们避免不必要的重渲染:

    -
    const MyComponent = React.memo(function MyComponent(props) {
    +
    const MyComponent = React.memo(function MyComponent(props) {
       /* 渲染使用到的props */
     });
    -
    jsx
    +

    使用useMemo和useCallback

    useMemo和useCallback可以帮助我们缓存计算结果和回调函数:

    -
    const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);
    +
    const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);
     
     const memoizedCallback = useCallback(
       () => {
    @@ -16,10 +16,10 @@ 

    }, [a, b], ); -

    jsx
    +

    虚拟化长列表

    对于长列表,我们可以使用虚拟化技术来提高性能:

    -
    import { FixedSizeList as List } from 'react-window';
    +
    import { FixedSizeList as List } from 'react-window';
     
     function Row({ index, style }) {
       return <div style={style}>Row {index}</div>;
    @@ -37,5 +37,5 @@ 

    </List> ); } -

    jsx
    -

    通过应用这些优化技巧,我们可以显著提升React应用的性能,为用户提供更流畅的体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +
    +

    通过应用这些优化技巧,我们可以显著提升React应用的性能,为用户提供更流畅的体验。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/6.txt b/blog/6.txt index b58f014..0b6733e 100644 --- a/blog/6.txt +++ b/blog/6.txt @@ -2,12 +2,18 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","6","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","6","d"],{"children":["__PAGE__?{\"id\":\"6\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","6","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","6","d"],{"children":["__PAGE__?{\"id\":\"6\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","6","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#react性能优化实战指南","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"React性能优化实战指南","children":"React性能优化实战指南"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#使用react.memo","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"使用React.memo","children":"使用React.memo"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#使用usememo和usecallback","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"使用useMemo和useCallback","children":"使用useMemo和useCallbac..."}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#虚拟化长列表","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"虚拟化长列表","children":"虚拟化长列表"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"React性能优化实战指南"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-04-10"}]," | ",["$","span",null,{"children":"林八"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","React",{"href":"/blog?tag=React","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"React"}]}],["$","$L8","性能优化",{"href":"/blog?tag=%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"性能优化"}]}],["$","$L8","虚拟列表",{"href":"/blog?tag=%E8%99%9A%E6%8B%9F%E5%88%97%E8%A1%A8","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"虚拟列表"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],["$","div",null,{"className":"rounded-lg border bg-card text-card-foreground shadow-sm transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 mt-12","children":[["$","div",null,{"className":"flex flex-col space-y-1.5 p-6","children":["$","h3",null,{"className":"text-2xl font-semibold leading-none tracking-tight","children":"相关文章"}]}],["$","div",null,{"className":"p-6 pt-0","children":["$","ul",null,{"className":"space-y-2","children":[["$","li","1",{"children":["$","$L8",null,{"href":"/blog/1","className":"text-primary hover:underline","children":"深入理解React Hooks"}]}],["$","li","2",{"children":["$","$L8",null,{"href":"/blog/2","className":"text-primary hover:underline","children":"Next.js 13新特性解析"}]}],["$","li","7",{"children":["$","$L8",null,{"href":"/blog/7","className":"text-primary hover:underline","children":"WebAssembly与前端的未来"}]}]]}]}]]}],["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/6&text=React性能优化实战指南","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/6","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/6&title=React性能优化实战指南","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"react性能优化实战指南","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#react性能优化实战指南","children":"React性能优化实战指南"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"在构建大型React应用时,性能优化至关重要。本文将介绍一些实用的React性能优化技巧。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"使用reactmemo","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#使用reactmemo","children":"使用React.memo"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"React.memo可以帮助我们避免不必要的重渲染:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token maybe-class-name","style":{},"children":["MyComponent"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement8",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["memo"]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["MyComponent"]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement14",{"className":"token parameter","style":{},"children":["props"]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["/* 渲染使用到的props */"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"使用usememo和usecallback","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#使用usememo和usecallback","children":"使用useMemo和useCallback"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"useMemo和useCallback可以帮助我们缓存计算结果和回调函数:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" memoizedValue "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useMemo"]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["computeExpensiveValue"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["a"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":["a"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement28",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" memoizedCallback "]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useCallback"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["doSomething"]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":["a"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["a"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"虚拟化长列表","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#虚拟化长列表","children":"虚拟化长列表"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"对于长列表,我们可以使用虚拟化技术来提高性能:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token imports maybe-class-name","style":{},"children":["FixedSizeList"]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token imports module","style":{"color":"hsl(301, 63%, 40%)"},"children":["as"]}],["$","span","code-segement7",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token imports maybe-class-name","style":{},"children":["List"]}],["$","span","code-segement9",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react-window'"]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement18",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Row"]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement23",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement24",{"className":"token parameter","style":{},"children":[" index"]}],["$","span","code-segement25",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement26",{"className":"token parameter","style":{},"children":[" style "]}],["$","span","code-segement27",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["style"]}],["$","span","code-segement39",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement40",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement41",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["style"]}],["$","span","code-segement42",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement44",{"className":"token plain-text","style":{},"children":["Row "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["index"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement57",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Example"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["List"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["height"]}],["$","span","code-segement77",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement78",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement79",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["150"]}],["$","span","code-segement80",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["itemCount"]}],["$","span","code-segement84",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement85",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement86",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["1000"]}],["$","span","code-segement87",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["itemSize"]}],["$","span","code-segement91",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement92",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement93",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["35"]}],["$","span","code-segement94",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["width"]}],["$","span","code-segement98",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement99",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement100",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["300"]}],["$","span","code-segement101",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement105",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement106",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement108",{"className":"token maybe-class-name","style":{},"children":["Row"]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement110",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement111",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"通过应用这些优化技巧,我们可以显著提升React应用的性能,为用户提供更流畅的体验。"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"react性能优化实战指南","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#react性能优化实战指南","children":"React性能优化实战指南"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"在构建大型React应用时,性能优化至关重要。本文将介绍一些实用的React性能优化技巧。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"使用reactmemo","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#使用reactmemo","children":"使用React.memo"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"React.memo可以帮助我们避免不必要的重渲染:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token maybe-class-name","style":{},"children":["MyComponent"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token maybe-class-name","style":{},"children":["React"]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement8",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["memo"]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["MyComponent"]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement14",{"className":"token parameter","style":{},"children":["props"]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement19",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["/* 渲染使用到的props */"]}],["$","span","code-segement21",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$Lf"}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"使用usememo和usecallback","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#使用usememo和usecallback","children":"使用useMemo和useCallback"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"useMemo和useCallback可以帮助我们缓存计算结果和回调函数:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" memoizedValue "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useMemo"]}],["$","span","code-segement5",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["computeExpensiveValue"]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":["a"]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":["a"]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement26",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement28",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement29",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement30",{"className":"$undefined","style":{},"children":[" memoizedCallback "]}],["$","span","code-segement31",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useCallback"]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement40",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["doSomething"]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":["a"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement49",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement55",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["a"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement61",{"className":"$undefined","style":{},"children":[" b"]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L10"}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"虚拟化长列表","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#虚拟化长列表","children":"虚拟化长列表"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"对于长列表,我们可以使用虚拟化技术来提高性能:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement3",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token imports maybe-class-name","style":{},"children":["FixedSizeList"]}],["$","span","code-segement5",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token imports module","style":{"color":"hsl(301, 63%, 40%)"},"children":["as"]}],["$","span","code-segement7",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement8",{"className":"token imports maybe-class-name","style":{},"children":["List"]}],["$","span","code-segement9",{"className":"token imports","style":{},"children":[" "]}],["$","span","code-segement10",{"className":"token imports","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'react-window'"]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement18",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Row"]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement23",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement24",{"className":"token parameter","style":{},"children":[" index"]}],["$","span","code-segement25",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement26",{"className":"token parameter","style":{},"children":[" style "]}],["$","span","code-segement27",{"className":"token parameter","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement32",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement33",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["style"]}],["$","span","code-segement39",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement40",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement41",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["style"]}],["$","span","code-segement42",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement44",{"className":"token plain-text","style":{},"children":["Row "]}],["$","span","code-segement45",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":["index"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement57",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement60",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["Example"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement62",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement71",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["List"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["height"]}],["$","span","code-segement77",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement78",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement79",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["150"]}],["$","span","code-segement80",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["itemCount"]}],["$","span","code-segement84",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement85",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement86",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["1000"]}],["$","span","code-segement87",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement90",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["itemSize"]}],["$","span","code-segement91",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement92",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement93",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["35"]}],["$","span","code-segement94",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["width"]}],["$","span","code-segement98",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement99",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement100",{"className":"token script language-javascript","style":{"color":"hsl(35, 99%, 36%)"},"children":["300"]}],["$","span","code-segement101",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["\n"]}],["$","span","code-segement103",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement104",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement105",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement106",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement108",{"className":"token maybe-class-name","style":{},"children":["Row"]}],["$","span","code-segement109",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement110",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement111",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement112",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement115",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement116",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement117",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement118",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement119",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement120",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement121",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement122",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":"$L11"}]}]]}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"通过应用这些优化技巧,我们可以显著提升React应用的性能,为用户提供更流畅的体验。"}]] +12:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +f:["$","$L12",null,{"text":"const MyComponent = React.memo(function MyComponent(props) {\n /* 渲染使用到的props */\n});\n","language":"jsx"}] +10:["$","$L12",null,{"text":"const memoizedValue = useMemo(() => computeExpensiveValue(a, b), [a, b]);\n\nconst memoizedCallback = useCallback(\n () => {\n doSomething(a, b);\n },\n [a, b],\n);\n","language":"jsx"}] +11:["$","$L12",null,{"text":"import { FixedSizeList as List } from 'react-window';\n\nfunction Row({ index, style }) {\n return
    Row {index}
    ;\n}\n\nfunction Example() {\n return (\n \n {Row}\n \n );\n}\n","language":"jsx"}] diff --git a/blog/7.html b/blog/7.html index 999d9f6..3d900d8 100644 --- a/blog/7.html +++ b/blog/7.html @@ -1,4 +1,4 @@ -我的博客

    WebAssembly与前端的未来

    2024-04-15 | 吴九 |预计阅读时间: 1 分钟

    WebAssembly与前端的未来

    +我的博客

    WebAssembly与前端的未来

    2024-04-15 | 吴九 |预计阅读时间: 1 分钟

    WebAssembly与前端的未来

    WebAssembly (Wasm) 正在改变Web应用的性能界限。本文将深入探讨Wasm的工作原理、与JavaScript的协作方式,以及在前端项目中的实际应用案例。

    WebAssembly简介

    WebAssembly是一种低级的类汇编语言,可以在现代Web浏览器中运行。它的主要特点包括:

    @@ -16,14 +16,14 @@

    与JavaScript的协作

    WebAssembly可以与JavaScript进行双向通信:

    -
    // 加载WebAssembly模块
    +
    // 加载WebAssembly模块
     WebAssembly.instantiateStreaming(fetch('module.wasm'))
       .then(result => {
         const exports = result.instance.exports;
         const result = exports.someFunction(42);
         console.log(result);
       });
    -
    javascript
    +

    实际应用案例

    1. 图像处理: 使用WebAssembly加速滤镜应用
    2. @@ -36,4 +36,4 @@

      垃圾回收: 简化内存管理
    3. 异常处理: 改善错误处理机制
    -

    WebAssembly正在不断发展,为Web应用带来更多可能性。通过掌握WebAssembly,前端开发者可以构建更高性能、更复杂的Web应用。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    WebAssembly正在不断发展,为Web应用带来更多可能性。通过掌握WebAssembly,前端开发者可以构建更高性能、更复杂的Web应用。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/7.txt b/blog/7.txt index 11a94c6..7546a33 100644 --- a/blog/7.txt +++ b/blog/7.txt @@ -2,12 +2,15 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","7","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","7","d"],{"children":["__PAGE__?{\"id\":\"7\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","7","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","7","d"],{"children":["__PAGE__?{\"id\":\"7\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","7","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#webassembly与前端的未来","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"WebAssembly与前端的未来","children":"WebAssembly与前端的未来"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#webassembly简介","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"WebAssembly简介","children":"WebAssembly简介"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#webassembly的工作原理","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"WebAssembly的工作原理","children":"WebAssembly的工作原理"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#与javascript的协作","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"与JavaScript的协作","children":"与JavaScript的协作"}]}],["$","li","4",{"className":"","children":["$","a",null,{"href":"#实际应用案例","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"实际应用案例","children":"实际应用案例"}]}],["$","li","5",{"className":"","children":["$","a",null,{"href":"#webassembly的未来发展","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"WebAssembly的未来发展","children":"WebAssembly的未来发展"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"WebAssembly与前端的未来"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-04-15"}]," | ",["$","span",null,{"children":"吴九"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","WebAssembly",{"href":"/blog?tag=WebAssembly","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"WebAssembly"}]}],["$","$L8","性能优化",{"href":"/blog?tag=%E6%80%A7%E8%83%BD%E4%BC%98%E5%8C%96","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"性能优化"}]}],["$","$L8","前端创新",{"href":"/blog?tag=%E5%89%8D%E7%AB%AF%E5%88%9B%E6%96%B0","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"前端创新"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],["$","div",null,{"className":"rounded-lg border bg-card text-card-foreground shadow-sm transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 mt-12","children":[["$","div",null,{"className":"flex flex-col space-y-1.5 p-6","children":["$","h3",null,{"className":"text-2xl font-semibold leading-none tracking-tight","children":"相关文章"}]}],["$","div",null,{"className":"p-6 pt-0","children":["$","ul",null,{"className":"space-y-2","children":[["$","li","2",{"children":["$","$L8",null,{"href":"/blog/2","className":"text-primary hover:underline","children":"Next.js 13新特性解析"}]}],["$","li","6",{"children":["$","$L8",null,{"href":"/blog/6","className":"text-primary hover:underline","children":"React性能优化实战指南"}]}],["$","li","10",{"children":["$","$L8",null,{"href":"/blog/10","className":"text-primary hover:underline","children":"微前端架构实践与性能优化"}]}]]}]}]]}],["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/7&text=WebAssembly与前端的未来","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/7","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/7&title=WebAssembly与前端的未来","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"webassembly与前端的未来","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webassembly与前端的未来","children":"WebAssembly与前端的未来"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly (Wasm) 正在改变Web应用的性能界限。本文将深入探讨Wasm的工作原理、与JavaScript的协作方式,以及在前端项目中的实际应用案例。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webassembly简介","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webassembly简介","children":"WebAssembly简介"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly是一种低级的类汇编语言,可以在现代Web浏览器中运行。它的主要特点包括:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"近乎原生的执行速度"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"跨平台兼容性"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"与JavaScript的无缝集成"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webassembly的工作原理","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webassembly的工作原理","children":"WebAssembly的工作原理"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly模块通常由C++、Rust等语言编译而来。它的执行过程如下:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"加载.wasm文件"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"实例化WebAssembly模块"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"调用WebAssembly函数"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"与javascript的协作","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#与javascript的协作","children":"与JavaScript的协作"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly可以与JavaScript进行双向通信:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// 加载WebAssembly模块"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["WebAssembly"]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement5",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["instantiateStreaming"]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'module.wasm'"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement15",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement17",{"className":"token parameter","style":{},"children":["result"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" exports "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" result"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement29",{"className":"token property-access","style":{},"children":["instance"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement31",{"className":"token property-access","style":{},"children":["exports"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" result "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":[" exports"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement40",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["someFunction"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["42"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement49",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["result"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"实际应用案例","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实际应用案例","children":"实际应用案例"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"图像处理: 使用WebAssembly加速滤镜应用"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"游戏引擎: 将复杂的游戏逻辑编译为WebAssembly"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"加密算法: 实现高性能的加密/解密操作"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webassembly的未来发展","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webassembly的未来发展","children":"WebAssembly的未来发展"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"多线程支持: 利用Web Workers实现并行计算"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"垃圾回收: 简化内存管理"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"异常处理: 改善错误处理机制"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly正在不断发展,为Web应用带来更多可能性。通过掌握WebAssembly,前端开发者可以构建更高性能、更复杂的Web应用。"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +f:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"webassembly与前端的未来","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webassembly与前端的未来","children":"WebAssembly与前端的未来"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly (Wasm) 正在改变Web应用的性能界限。本文将深入探讨Wasm的工作原理、与JavaScript的协作方式,以及在前端项目中的实际应用案例。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webassembly简介","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webassembly简介","children":"WebAssembly简介"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly是一种低级的类汇编语言,可以在现代Web浏览器中运行。它的主要特点包括:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"近乎原生的执行速度"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"跨平台兼容性"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"与JavaScript的无缝集成"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webassembly的工作原理","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webassembly的工作原理","children":"WebAssembly的工作原理"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly模块通常由C++、Rust等语言编译而来。它的执行过程如下:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"加载.wasm文件"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"实例化WebAssembly模块"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"调用WebAssembly函数"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"与javascript的协作","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#与javascript的协作","children":"与JavaScript的协作"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly可以与JavaScript进行双向通信:"}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(230, 4%, 64%)","fontStyle":"italic"},"children":["// 加载WebAssembly模块"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement2",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement3",{"className":"token known-class-name","style":{"color":"hsl(35, 99%, 36%)"},"children":["WebAssembly"]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement5",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["instantiateStreaming"]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["fetch"]}],["$","span","code-segement8",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'module.wasm'"]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement15",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["then"]}],["$","span","code-segement16",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement17",{"className":"token parameter","style":{},"children":["result"]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token arrow","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement23",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" exports "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" result"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement29",{"className":"token property-access","style":{},"children":["instance"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement31",{"className":"token property-access","style":{},"children":["exports"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement34",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement36",{"className":"$undefined","style":{},"children":[" result "]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement38",{"className":"$undefined","style":{},"children":[" exports"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement40",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["someFunction"]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["42"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement47",{"className":"token console","style":{"color":"hsl(35, 99%, 36%)"},"children":["console"]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement49",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["log"]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":["result"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"// 加载WebAssembly模块\nWebAssembly.instantiateStreaming(fetch('module.wasm'))\n .then(result => {\n const exports = result.instance.exports;\n const result = exports.someFunction(42);\n console.log(result);\n });\n","language":"javascript"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"实际应用案例","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#实际应用案例","children":"实际应用案例"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"图像处理: 使用WebAssembly加速滤镜应用"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"游戏引擎: 将复杂的游戏逻辑编译为WebAssembly"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"加密算法: 实现高性能的加密/解密操作"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"webassembly的未来发展","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#webassembly的未来发展","children":"WebAssembly的未来发展"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"多线程支持: 利用Web Workers实现并行计算"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"垃圾回收: 简化内存管理"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"异常处理: 改善错误处理机制"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"WebAssembly正在不断发展,为Web应用带来更多可能性。通过掌握WebAssembly,前端开发者可以构建更高性能、更复杂的Web应用。"}]] diff --git a/blog/8.html b/blog/8.html index 76734b0..f5c3ce6 100644 --- a/blog/8.html +++ b/blog/8.html @@ -1,4 +1,4 @@ -我的博客

    AI驱动的前端开发:机遇与挑战

    2024-04-20 | 郑十 |预计阅读时间: 1 分钟

    AI驱动的前端开发:机遇与挑战

    +我的博客

    AI驱动的前端开发:机遇与挑战

    2024-04-20 | 郑十 |预计阅读时间: 1 分钟

    AI驱动的前端开发:机遇与挑战

    人工智能正在深刻影响前端开发领域。本文将介绍AI在代码自动补全、UI设计生成、性能优化等方面的应用。

    AI在前端开发中的应用

      @@ -49,4 +49,4 @@

      增强问题解决能力
    1. 持续学习新技术
    -

    AI技术正在改变前端开发的方方面面。开发者需要拥抱这些变化,同时保持批判性思考,以充分利用AI带来的机遇并应对挑战。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    AI技术正在改变前端开发的方方面面。开发者需要拥抱这些变化,同时保持批判性思考,以充分利用AI带来的机遇并应对挑战。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/8.txt b/blog/8.txt index 558ef3d..ad1eb7c 100644 --- a/blog/8.txt +++ b/blog/8.txt @@ -2,11 +2,11 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","8","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","8","d"],{"children":["__PAGE__?{\"id\":\"8\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","8","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","8","d"],{"children":["__PAGE__?{\"id\":\"8\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","8","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#ai驱动的前端开发:机遇与挑战","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"AI驱动的前端开发:机遇与挑战","children":"AI驱动的前端开发:机遇与挑战"}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#ai在前端开发中的应用","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"AI在前端开发中的应用","children":"AI在前端开发中的应用"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#ai编程助手的使用技巧","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"AI编程助手的使用技巧","children":"AI编程助手的使用技巧"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#机器学习优化用户体验","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"机器学习优化用户体验","children":"机器学习优化用户体验"}]}],["$","li","4",{"className":"","children":["$","a",null,{"href":"#ai带来的伦理问题","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"AI带来的伦理问题","children":"AI带来的伦理问题"}]}],["$","li","5",{"className":"","children":["$","a",null,{"href":"#ai对开发者角色的影响","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"AI对开发者角色的影响","children":"AI对开发者角色的影响"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"AI驱动的前端开发:机遇与挑战"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-04-20"}]," | ",["$","span",null,{"children":"郑十"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","AI",{"href":"/blog?tag=AI","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"AI"}]}],["$","$L8","前端开发",{"href":"/blog?tag=%E5%89%8D%E7%AB%AF%E5%BC%80%E5%8F%91","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"前端开发"}]}],["$","$L8","自动化",{"href":"/blog?tag=%E8%87%AA%E5%8A%A8%E5%8C%96","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"自动化"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],["$","div",null,{"className":"rounded-lg border bg-card text-card-foreground shadow-sm transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 mt-12","children":[["$","div",null,{"className":"flex flex-col space-y-1.5 p-6","children":["$","h3",null,{"className":"text-2xl font-semibold leading-none tracking-tight","children":"相关文章"}]}],["$","div",null,{"className":"p-6 pt-0","children":["$","ul",null,{"className":"space-y-2","children":[["$","li","1",{"children":["$","$L8",null,{"href":"/blog/1","className":"text-primary hover:underline","children":"深入理解React Hooks"}]}],["$","li","4",{"children":["$","$L8",null,{"href":"/blog/4","className":"text-primary hover:underline","children":"TypeScript高级类型技巧"}]}]]}]}]]}],["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/8&text=AI驱动的前端开发:机遇与挑战","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/8","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/8&title=AI驱动的前端开发:机遇与挑战","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/blog/9.html b/blog/9.html index 2b54dc9..053a4fb 100644 --- a/blog/9.html +++ b/blog/9.html @@ -1,4 +1,4 @@ -我的博客

    Web3和去中心化应用(DApps)开发入门

    2024-04-25 | 黄十一 |预计阅读时间: 1 分钟

    Web3和去中心化应用(DApps)开发入门

    +我的博客

    Web3和去中心化应用(DApps)开发入门

    2024-04-25 | 黄十一 |预计阅读时间: 1 分钟

    Web3和去中心化应用(DApps)开发入门

    Web3技术正在兴起,为开发者带来新的机遇。本文将介绍Web3的核心概念,并指导如何创建一个简单的DApp。

    Web3核心概念

      @@ -11,7 +11,7 @@

    1. 编写智能合约:
    -
    pragma solidity ^0.8.0;
    +
    pragma solidity ^0.8.0;
     
     contract Voting {
         mapping(string => uint256) public votes;
    @@ -24,11 +24,11 @@ 

    return votes[candidate]; } } -

    solidity
    +
    1. 使用Web3.js与合约交互:
    -
    import Web3 from 'web3';
    +
    import Web3 from 'web3';
     
     const web3 = new Web3(Web3.givenProvider);
     const contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);
    @@ -37,11 +37,11 @@ 

    const accounts = await web3.eth.getAccounts(); await contract.methods.vote(candidate).send({ from: accounts[0] }); } -

    javascript
    +
    1. 集成React前端:
    -
    function VotingApp() {
    +
    function VotingApp() {
         const [candidate, setCandidate] = useState('');
         const [votes, setVotes] = useState(0);
     
    @@ -59,11 +59,11 @@ 

    </div> ); } -

    jsx
    +

    Web3应用面临的挑战

    1. 可扩展性: 处理高并发交易
    2. 用户体验: 简化钱包连接和交易确认
    3. 法律合规: 应对不同地区的监管要求
    -

    Web3技术为开发者提供了创新的机会,但也带来了新的挑战。通过不断学习和实践,我们可以在这个新兴领域中创造出革命性的应用。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file +

    Web3技术为开发者提供了创新的机会,但也带来了新的挑战。通过不断学习和实践,我们可以在这个新兴领域中创造出革命性的应用。

    ← 返回博客列表

    评论

    评论列表

    \ No newline at end of file diff --git a/blog/9.txt b/blog/9.txt index b59dd1e..0e2dd21 100644 --- a/blog/9.txt +++ b/blog/9.txt @@ -2,12 +2,15 @@ 5:I[563,[],""] 6:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 7:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] -8:I[1872,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],""] +8:I[1872,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],""] 4:["id","9","d"] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["blog",{"children":[["id","9","d"],{"children":["__PAGE__?{\"id\":\"9\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","9","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] -a:I[9966,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] -c:I[5575,["872","static/chunks/872-94447e383e603348.js","100","static/chunks/100-48d8e54a6ce3477d.js","548","static/chunks/app/blog/%5Bid%5D/page-a04031201ae67ab1.js"],"default"] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["blog",{"children":[["id","9","d"],{"children":["__PAGE__?{\"id\":\"9\"}",{}]}]}]},"$undefined","$undefined",true],["",{"children":["blog",{"children":[["id","9","d"],{"children":["__PAGE__",{},[["$L1","$L2"],null],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children","$4","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children","blog","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L6",null,{"attribute":"class","children":[["$","$L7",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L3",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L5",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +a:I[9966,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +c:I[5575,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] 2:["$","div",null,{"className":"container mx-auto px-4 py-8","children":[["$","$La",null,{}],["$","div",null,{"className":"flex flex-col md:flex-row gap-8","children":[["$","aside",null,{"className":"md:w-1/4","children":["$","div",null,{"className":"bg-gray-100 dark:bg-gray-700 p-4 rounded-lg sticky top-20 w-[240px] mr-2","children":[["$","h2",null,{"className":"text-lg font-bold mb-3 text-gray-900 dark:text-white","children":"目录"}],["$","nav",null,{"children":["$","ul",null,{"className":"space-y-1","children":[["$","li","0",{"className":"","children":["$","a",null,{"href":"#web3和去中心化应用(dapps)开发入门","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Web3和去中心化应用(DApps)开发入门","children":"Web3和去中心化应用(DApps)开发..."}]}],["$","li","1",{"className":"","children":["$","a",null,{"href":"#web3核心概念","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Web3核心概念","children":"Web3核心概念"}]}],["$","li","2",{"className":"","children":["$","a",null,{"href":"#创建简单dapp","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"创建简单DApp","children":"创建简单DApp"}]}],["$","li","3",{"className":"","children":["$","a",null,{"href":"#web3应用面临的挑战","className":"text-primary dark:text-primary-light hover:underline text-sm block truncate","title":"Web3应用面临的挑战","children":"Web3应用面临的挑战"}]}]]}]}]]}]}],["$","article",null,{"className":"md:w-3/4","children":[["$","h1",null,{"className":"text-4xl font-bold mb-4","children":"Web3和去中心化应用(DApps)开发入门"}],["$","div",null,{"className":"mb-4 text-muted-foreground","children":[["$","span",null,{"children":"2024-04-25"}]," | ",["$","span",null,{"children":"黄十一"}]," |",["$","span",null,{"children":["预计阅读时间: ",1," 分钟"]}]]}],"$Lb",["$","div",null,{"className":"mb-6 flex flex-wrap gap-2","children":[["$","$L8","Web3",{"href":"/blog?tag=Web3","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"Web3"}]}],["$","$L8","区块链",{"href":"/blog?tag=%E5%8C%BA%E5%9D%97%E9%93%BE","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"区块链"}]}],["$","$L8","DApps",{"href":"/blog?tag=DApps","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-secondary text-secondary-foreground active:bg-secondary/70 cursor-pointer hover:bg-secondary-hover","children":"DApps"}]}]]}],["$","$L8",null,{"href":"/blog","children":"← 返回博客列表","className":"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border border-input bg-background hover:bg-accent hover:text-accent-foreground h-10 px-4 py-2"}],false,["$","div",null,{"className":"flex space-x-4 mt-6","children":[["$","a",null,{"href":"https://twitter.com/intent/tweet?url=https://yourblog.com/blog/9&text=Web3和去中心化应用(DApps)开发入门","target":"_blank","rel":"noopener noreferrer","className":"text-blue-400 hover:text-blue-500","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M459.37 151.716c.325 4.548.325 9.097.325 13.645 0 138.72-105.583 298.558-298.558 298.558-59.452 0-114.68-17.219-161.137-47.106 8.447.974 16.568 1.299 25.34 1.299 49.055 0 94.213-16.568 130.274-44.832-46.132-.975-84.792-31.188-98.112-72.772 6.498.974 12.995 1.624 19.818 1.624 9.421 0 18.843-1.3 27.614-3.573-48.081-9.747-84.143-51.98-84.143-102.985v-1.299c13.969 7.797 30.214 12.67 47.431 13.319-28.264-18.843-46.781-51.005-46.781-87.391 0-19.492 5.197-37.36 14.294-52.954 51.655 63.675 129.3 105.258 216.365 109.807-1.624-7.797-2.599-15.918-2.599-24.04 0-57.828 46.782-104.934 104.934-104.934 30.213 0 57.502 12.67 76.67 33.137 23.715-4.548 46.456-13.32 66.599-25.34-7.798 24.366-24.366 44.833-46.132 57.827 21.117-2.273 41.584-8.122 60.426-16.243-14.292 20.791-32.161 39.308-52.628 54.253z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.facebook.com/sharer/sharer.php?u=https://yourblog.com/blog/9","target":"_blank","rel":"noopener noreferrer","className":"text-blue-600 hover:text-blue-700","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 512 512","children":["$undefined",[["$","path","0",{"d":"M504 256C504 119 393 8 256 8S8 119 8 256c0 123.78 90.69 226.38 209.25 245V327.69h-63V256h63v-54.64c0-62.15 37-96.48 93.67-96.48 27.14 0 55.52 4.84 55.52 4.84v61h-31.28c-30.8 0-40.41 19.12-40.41 38.73V256h68.78l-11 71.69h-57.78V501C413.31 482.38 504 379.78 504 256z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}],["$","a",null,{"href":"https://www.linkedin.com/shareArticle?mini=true&url=https://yourblog.com/blog/9&title=Web3和去中心化应用(DApps)开发入门","target":"_blank","rel":"noopener noreferrer","className":"text-blue-700 hover:text-blue-800","children":["$","svg",null,{"stroke":"currentColor","fill":"currentColor","strokeWidth":"0","viewBox":"0 0 448 512","children":["$undefined",[["$","path","0",{"d":"M416 32H31.9C14.3 32 0 46.5 0 64.3v383.4C0 465.5 14.3 480 31.9 480H416c17.6 0 32-14.5 32-32.3V64.3c0-17.8-14.4-32.3-32-32.3zM135.4 416H69V202.2h66.5V416zm-33.2-243c-21.3 0-38.5-17.3-38.5-38.5S80.9 96 102.2 96c21.2 0 38.5 17.3 38.5 38.5 0 21.3-17.2 38.5-38.5 38.5zm282.1 243h-66.4V312c0-24.8-.5-56.7-34.5-56.7-34.6 0-39.9 27-39.9 54.9V416h-66.4V202.2h63.7v29.2h.9c8.9-16.8 30.6-34.5 62.9-34.5 67.2 0 79.7 44.3 79.7 101.9V416z","children":[]}]]],"className":"$undefined","style":{"color":"$undefined"},"height":24,"width":24,"xmlns":"http://www.w3.org/2000/svg"}]}]]}],["$","div",null,{"className":"mt-16","children":["$","$Lc",null,{}]}]]}]]}]]}] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null -b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"web3和去中心化应用dapps开发入门","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#web3和去中心化应用dapps开发入门","children":"Web3和去中心化应用(DApps)开发入门"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Web3技术正在兴起,为开发者带来新的机遇。本文将介绍Web3的核心概念,并指导如何创建一个简单的DApp。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"web3核心概念","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#web3核心概念","children":"Web3核心概念"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"智能合约: 自动执行的程序,运行在区块链上"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"去中心化存储: IPFS, Filecoin等"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"去中心化身份验证: MetaMask, WalletConnect等"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"创建简单dapp","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#创建简单dapp","children":"创建简单DApp"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"使用Ethereum和Solidity创建一个简单的投票DApp:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"编写智能合约:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["pragma"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["solidity"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["^"]}],["$","span","code-segement5",{"className":"token version","style":{"color":"hsl(35, 99%, 36%)"},"children":["0.8.0"]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement9",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["contract"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Voting"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["mapping"]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["string"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["uint256"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["public"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" votes"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["vote"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["string"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["memory"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" candidate"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["public"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" votes"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["+="]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getVotes"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["string"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["memory"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" candidate"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["public"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["view"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["returns"]}],["$","span","code-segement76",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["uint256"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":[" votes"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"solidity"}]]}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","start":"2","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Web3.js与合约交互:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["Web3"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'web3'"]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement10",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" web3 "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Web3"]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement19",{"className":"token maybe-class-name","style":{},"children":["Web3"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement21",{"className":"token property-access","style":{},"children":["givenProvider"]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" contract "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["web3"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["eth"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Contract"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ABI"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["CONTRACT_ADDRESS"]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement46",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["vote"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement53",{"className":"token parameter","style":{},"children":["candidate"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" accounts "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" web3"]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement66",{"className":"token property-access","style":{},"children":["eth"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement68",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["getAccounts"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" contract"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement77",{"className":"token property-access","style":{},"children":["methods"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement79",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["vote"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement84",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["send"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" accounts"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"javascript"}]]}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","start":"3","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"集成React前端:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["VotingApp"]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":[" setCandidate"]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["''"]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["votes"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" setVotes"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["handleVote"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["vote"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" newVotes "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement68",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" contract"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement71",{"className":"token property-access","style":{},"children":["methods"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement73",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["getVotes"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement78",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["call"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setVotes"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":["newVotes"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement103",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement104",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement105",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["input"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["value"]}],["$","span","code-segement109",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement110",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement111",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["candidate"]}],["$","span","code-segement112",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onChange"]}],["$","span","code-segement115",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement116",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement117",{"className":"token script language-javascript parameter","style":{"color":"hsl(5, 74%, 59%)"},"children":["e"]}],["$","span","code-segement118",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement119",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement120",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement121",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["setCandidate"]}],["$","span","code-segement122",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement123",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["e"]}],["$","span","code-segement124",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement125",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["target"]}],["$","span","code-segement126",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement127",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["value"]}],["$","span","code-segement128",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement129",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement130",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["/>"]}],["$","span","code-segement132",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement133",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement135",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement138",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement139",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement140",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["handleVote"]}],["$","span","code-segement141",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement143",{"className":"token plain-text","style":{},"children":["Vote"]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement147",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement148",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement150",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["p"]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement152",{"className":"token plain-text","style":{},"children":["Votes: "]}],["$","span","code-segement153",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement154",{"className":"$undefined","style":{},"children":["votes"]}],["$","span","code-segement155",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement159",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement160",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement161",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement165",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement166",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement168",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement169",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement170",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement171",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","div",null,{"className":"absolute top-2 right-2 text-xs font-mono text-gray-500 dark:text-gray-400","children":"jsx"}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"web3应用面临的挑战","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#web3应用面临的挑战","children":"Web3应用面临的挑战"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"可扩展性: 处理高并发交易"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"用户体验: 简化钱包连接和交易确认"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"法律合规: 应对不同地区的监管要求"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Web3技术为开发者提供了创新的机会,但也带来了新的挑战。通过不断学习和实践,我们可以在这个新兴领域中创造出革命性的应用。"}]] +d:"$Sreact.suspense" +e:I[3145,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"BailoutToCSR"] +f:I[2996,["872","static/chunks/872-94447e383e603348.js","470","static/chunks/470-dd03d5977538fe16.js","561","static/chunks/561-8003f6922ee71b30.js","548","static/chunks/app/blog/%5Bid%5D/page-48c48ecea69e735b.js"],"default"] +b:[["$","h1",null,{"className":"text-3xl font-bold mt-8 mb-4 text-gray-900 dark:text-white scroll-mt-20","id":"web3和去中心化应用dapps开发入门","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#web3和去中心化应用dapps开发入门","children":"Web3和去中心化应用(DApps)开发入门"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Web3技术正在兴起,为开发者带来新的机遇。本文将介绍Web3的核心概念,并指导如何创建一个简单的DApp。"}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"web3核心概念","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#web3核心概念","children":"Web3核心概念"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"智能合约: 自动执行的程序,运行在区块链上"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"去中心化存储: IPFS, Filecoin等"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"去中心化身份验证: MetaMask, WalletConnect等"}],"\n"]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"创建简单dapp","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#创建简单dapp","children":"创建简单DApp"}]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"使用Ethereum和Solidity创建一个简单的投票DApp:"}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"编写智能合约:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["pragma"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["solidity"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["^"]}],["$","span","code-segement5",{"className":"token version","style":{"color":"hsl(35, 99%, 36%)"},"children":["0.8.0"]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement9",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement10",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["contract"]}],["$","span","code-segement11",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement12",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Voting"]}],["$","span","code-segement13",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement14",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement15",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["mapping"]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["string"]}],["$","span","code-segement20",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["=>"]}],["$","span","code-segement22",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["uint256"]}],["$","span","code-segement24",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["public"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" votes"]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["vote"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["string"]}],["$","span","code-segement37",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["memory"]}],["$","span","code-segement39",{"className":"$undefined","style":{},"children":[" candidate"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["public"]}],["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement46",{"className":"$undefined","style":{},"children":[" votes"]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["+="]}],["$","span","code-segement52",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement53",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["1"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["getVotes"]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["string"]}],["$","span","code-segement66",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["memory"]}],["$","span","code-segement68",{"className":"$undefined","style":{},"children":[" candidate"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement70",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["public"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement73",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["view"]}],["$","span","code-segement74",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement75",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["returns"]}],["$","span","code-segement76",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["uint256"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement80",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement85",{"className":"$undefined","style":{},"children":[" votes"]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement91",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement93",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"pragma solidity ^0.8.0;\n\ncontract Voting {\n mapping(string => uint256) public votes;\n\n function vote(string memory candidate) public {\n votes[candidate] += 1;\n }\n\n function getVotes(string memory candidate) public view returns (uint256) {\n return votes[candidate];\n }\n}\n","language":"solidity"}]}]}]]}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","start":"2","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"使用Web3.js与合约交互:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["import"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token imports maybe-class-name","style":{},"children":["Web3"]}],["$","span","code-segement3",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement4",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["'web3'"]}],["$","span","code-segement7",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement10",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":[" web3 "]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Web3"]}],["$","span","code-segement18",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement19",{"className":"token maybe-class-name","style":{},"children":["Web3"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement21",{"className":"token property-access","style":{},"children":["givenProvider"]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" contract "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["new"]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["web3"]}],["$","span","code-segement33",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["eth"]}],["$","span","code-segement35",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["Contract"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["ABI"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement40",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement41",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["CONTRACT_ADDRESS"]}],["$","span","code-segement42",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement43",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement44",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement46",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement47",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement48",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement50",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement51",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["vote"]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement53",{"className":"token parameter","style":{},"children":["candidate"]}],["$","span","code-segement54",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement55",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement56",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement57",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement58",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement59",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement60",{"className":"$undefined","style":{},"children":[" accounts "]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement63",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement64",{"className":"$undefined","style":{},"children":[" web3"]}],["$","span","code-segement65",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement66",{"className":"token property-access","style":{},"children":["eth"]}],["$","span","code-segement67",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement68",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["getAccounts"]}],["$","span","code-segement69",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement71",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement72",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement73",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement74",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":[" contract"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement77",{"className":"token property-access","style":{},"children":["methods"]}],["$","span","code-segement78",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement79",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["vote"]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement81",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement82",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement83",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement84",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["send"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement86",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement87",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement88",{"className":"token module","style":{"color":"hsl(301, 63%, 40%)"},"children":["from"]}],["$","span","code-segement89",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":[":"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" accounts"]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement92",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement93",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement96",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement101",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"import Web3 from 'web3';\n\nconst web3 = new Web3(Web3.givenProvider);\nconst contract = new web3.eth.Contract(ABI, CONTRACT_ADDRESS);\n\nasync function vote(candidate) {\n const accounts = await web3.eth.getAccounts();\n await contract.methods.vote(candidate).send({ from: accounts[0] });\n}\n","language":"javascript"}]}]}]]}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","start":"3","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"集成React前端:"}],"\n"]}],"\n",["$","div",null,{"children":["$","div",null,{"className":"relative group","children":[["$","pre",null,{"className":"bg-code-light dark:bg-code-dark rounded-lg p-4 my-4 overflow-auto","style":{"background":"hsl(230, 1%, 98%)","color":"var(--code-text)","fontFamily":"\"Fira Code\", \"Fira Mono\", Menlo, Consolas, \"DejaVu Sans Mono\", monospace","direction":"ltr","textAlign":"left","whiteSpace":"pre","wordSpacing":"normal","wordBreak":"normal","lineHeight":"1.5","MozTabSize":"2","OTabSize":"2","tabSize":"2","WebkitHyphens":"none","MozHyphens":"none","msHyphens":"none","hyphens":"none","padding":"1em","margin":"0.5em 0","overflow":"auto","borderRadius":"0.3em","backgroundColor":"var(--code-bg)"},"children":["$","code",null,{"className":"text-code-light dark:text-code-dark","style":{"whiteSpace":"pre"},"children":[false,[["$","span","code-segement0",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement1",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement2",{"className":"token maybe-class-name","style":{"color":"hsl(221, 87%, 60%)"},"children":["VotingApp"]}],["$","span","code-segement3",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement4",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement5",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement6",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement7",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement8",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement9",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement10",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement11",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement12",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement13",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement14",{"className":"$undefined","style":{},"children":[" setCandidate"]}],["$","span","code-segement15",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement16",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement17",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement18",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement19",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement20",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement21",{"className":"token","style":{"color":"hsl(119, 34%, 47%)"},"children":["''"]}],["$","span","code-segement22",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement23",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement24",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement25",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement26",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement27",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement28",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["["]}],["$","span","code-segement29",{"className":"$undefined","style":{},"children":["votes"]}],["$","span","code-segement30",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[","]}],["$","span","code-segement31",{"className":"$undefined","style":{},"children":[" setVotes"]}],["$","span","code-segement32",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["]"]}],["$","span","code-segement33",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement34",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement35",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement36",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["useState"]}],["$","span","code-segement37",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement38",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["0"]}],["$","span","code-segement39",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement40",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement41",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement43",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement44",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["async"]}],["$","span","code-segement45",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement46",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["function"]}],["$","span","code-segement47",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement48",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["handleVote"]}],["$","span","code-segement49",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement50",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement51",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement52",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement53",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement54",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement55",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement56",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement57",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["vote"]}],["$","span","code-segement58",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement59",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement60",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement61",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement62",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement63",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement64",{"className":"token","style":{"color":"hsl(301, 63%, 40%)"},"children":["const"]}],["$","span","code-segement65",{"className":"$undefined","style":{},"children":[" newVotes "]}],["$","span","code-segement66",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["="]}],["$","span","code-segement67",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement68",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["await"]}],["$","span","code-segement69",{"className":"$undefined","style":{},"children":[" contract"]}],["$","span","code-segement70",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement71",{"className":"token property-access","style":{},"children":["methods"]}],["$","span","code-segement72",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement73",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["getVotes"]}],["$","span","code-segement74",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement75",{"className":"$undefined","style":{},"children":["candidate"]}],["$","span","code-segement76",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement77",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement78",{"className":"token method property-access","style":{"color":"hsl(221, 87%, 60%)"},"children":["call"]}],["$","span","code-segement79",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement80",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement81",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement82",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement83",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement84",{"className":"token","style":{"color":"hsl(221, 87%, 60%)"},"children":["setVotes"]}],["$","span","code-segement85",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement86",{"className":"$undefined","style":{},"children":["newVotes"]}],["$","span","code-segement87",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement88",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement89",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement90",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement91",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement92",{"className":"$undefined","style":{},"children":["\n"]}],"\n",["$","span","code-segement94",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement95",{"className":"token control-flow","style":{"color":"hsl(301, 63%, 40%)"},"children":["return"]}],["$","span","code-segement96",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement97",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement98",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement99",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement100",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement101",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["div"]}],["$","span","code-segement102",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement103",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement104",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement105",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement106",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["input"]}],["$","span","code-segement107",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement108",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["value"]}],["$","span","code-segement109",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement110",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement111",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["candidate"]}],["$","span","code-segement112",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement113",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement114",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onChange"]}],["$","span","code-segement115",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement116",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement117",{"className":"token script language-javascript parameter","style":{"color":"hsl(5, 74%, 59%)"},"children":["e"]}],["$","span","code-segement118",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement119",{"className":"token script language-javascript arrow","style":{"color":"hsl(5, 74%, 59%)"},"children":["=>"]}],["$","span","code-segement120",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement121",{"className":"token script language-javascript","style":{"color":"hsl(221, 87%, 60%)"},"children":["setCandidate"]}],["$","span","code-segement122",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["("]}],["$","span","code-segement123",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["e"]}],["$","span","code-segement124",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement125",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["target"]}],["$","span","code-segement126",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["."]}],["$","span","code-segement127",{"className":"token script language-javascript property-access","style":{"color":"hsl(5, 74%, 59%)"},"children":["value"]}],["$","span","code-segement128",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement129",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement130",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement131",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["/>"]}],["$","span","code-segement132",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement133",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement134",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement135",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["button"]}],["$","span","code-segement136",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":[" "]}],["$","span","code-segement137",{"className":"token","style":{"color":"hsl(35, 99%, 36%)"},"children":["onClick"]}],["$","span","code-segement138",{"className":"token script language-javascript script-punctuation","style":{"color":"hsl(5, 74%, 59%)"},"children":["="]}],["$","span","code-segement139",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement140",{"className":"token script language-javascript","style":{"color":"hsl(5, 74%, 59%)"},"children":["handleVote"]}],["$","span","code-segement141",{"className":"token script language-javascript","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement142",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement143",{"className":"token plain-text","style":{},"children":["Vote"]}],["$","span","code-segement144",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement147",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement148",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement149",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["<"]}],["$","span","code-segement150",{"className":"token","style":{"color":"hsl(5, 74%, 59%)"},"children":["p"]}],["$","span","code-segement151",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[">"]}],["$","span","code-segement152",{"className":"token plain-text","style":{},"children":["Votes: "]}],["$","span","code-segement153",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["{"]}],["$","span","code-segement154",{"className":"$undefined","style":{},"children":["votes"]}],["$","span","code-segement155",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement156",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement159",{"className":"token plain-text","style":{},"children":["\n"]}],["$","span","code-segement160",{"className":"token plain-text","style":{},"children":[" "]}],["$","span","code-segement161",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[""]}],["$","span","code-segement164",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement165",{"className":"$undefined","style":{},"children":[" "]}],["$","span","code-segement166",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[")"]}],["$","span","code-segement167",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":[";"]}],["$","span","code-segement168",{"className":"$undefined","style":{},"children":["\n"]}],["$","span","code-segement169",{"className":"$undefined","style":{},"children":[""]}],["$","span","code-segement170",{"className":"token","style":{"color":"hsl(230, 8%, 24%)"},"children":["}"]}],["$","span","code-segement171",{"className":"$undefined","style":{},"children":["\n"]}],""]]}]}],["$","$d",null,{"fallback":null,"children":["$","$Le",null,{"reason":"next/dynamic","children":["$","$Lf",null,{"text":"function VotingApp() {\n const [candidate, setCandidate] = useState('');\n const [votes, setVotes] = useState(0);\n\n async function handleVote() {\n await vote(candidate);\n const newVotes = await contract.methods.getVotes(candidate).call();\n setVotes(newVotes);\n }\n\n return (\n
    \n setCandidate(e.target.value)} />\n \n

    Votes: {votes}

    \n
    \n );\n}\n","language":"jsx"}]}]}]]}]}],"\n",["$","h2",null,{"className":"text-2xl font-semibold mt-6 mb-3 text-gray-800 dark:text-gray-200 scroll-mt-20","id":"web3应用面临的挑战","children":["$","a",null,{"className":"text-blue-500 hover:underline dark:text-blue-400","href":"#web3应用面临的挑战","children":"Web3应用面临的挑战"}]}],"\n",["$","ol",null,{"className":"list-decimal list-inside mb-4 text-gray-600 dark:text-gray-400","children":["\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"可扩展性: 处理高并发交易"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"用户体验: 简化钱包连接和交易确认"}],"\n",["$","li",null,{"className":"mb-2 text-gray-600 dark:text-gray-400","children":"法律合规: 应对不同地区的监管要求"}],"\n"]}],"\n",["$","p",null,{"className":"mb-4 text-gray-600 dark:text-gray-400","children":"Web3技术为开发者提供了创新的机会,但也带来了新的挑战。通过不断学习和实践,我们可以在这个新兴领域中创造出革命性的应用。"}]] diff --git a/index.html b/index.html index 49ada78..6667df8 100644 --- a/index.html +++ b/index.html @@ -1 +1 @@ -我的博客

    欢迎来到我的博客

    你好,我是[zhuba-Ahhh]。作为一名前端开发者,我热衷于探索和分享Web开发的最新趋势、技巧和最佳实践。

    技术栈

    ReactNext.jsTypeScriptTailwind CSS

    联系我: 3477826311@qq.com | GitHub | Twitter

    \ No newline at end of file +我的博客

    欢迎来到我的博客

    你好,我是[Zhuba-Ahhh]。作为一名前端开发者,我热衷于探索和分享Web开发的最新趋势、技巧和最佳实践。

    技术栈

    ReactNext.jsTypeScriptTailwind CSS

    联系我: 3477826311@qq.com | GitHub | Twitter

    \ No newline at end of file diff --git a/index.txt b/index.txt index 50d17da..9335e22 100644 --- a/index.txt +++ b/index.txt @@ -1,10 +1,10 @@ 2:I[2178,[],"ClientPageRoot"] -3:I[4706,["872","static/chunks/872-94447e383e603348.js","572","static/chunks/572-0f6e91900f3cfcf0.js","528","static/chunks/528-51af7a7e17704e0d.js","931","static/chunks/app/page-ed8d205204393f7e.js"],"default"] +3:I[4706,["872","static/chunks/872-94447e383e603348.js","593","static/chunks/593-12288599e20618be.js","528","static/chunks/528-51af7a7e17704e0d.js","931","static/chunks/app/page-054f531d458abfcd.js"],"default"] 4:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 5:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] 6:I[380,[],""] 7:I[563,[],""] 8:I[1872,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],""] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}]],null],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L4",null,{"attribute":"class","children":[["$","$L5",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L6",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["__PAGE__",{}]},"$undefined","$undefined",true],["",{"children":["__PAGE__",{},[["$L1",["$","$L2",null,{"props":{"params":{},"searchParams":{}},"Component":"$3"}]],null],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L4",null,{"attribute":"class","children":[["$","$L5",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L6",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L7",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L8",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L8",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L8",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L9"]]]]] 9:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/mdx.html b/mdx.html index cf41133..9c0a676 100644 --- a/mdx.html +++ b/mdx.html @@ -1,4 +1,4 @@ -我的博客

    欢迎来到我的 MDX 页面!

    +我的博客

    欢迎来到我的 MDX 页面!

    这是一些粗体斜体文本。

    这是 markdown 中的列表:

      @@ -6,4 +6,4 @@
    -

    查看我的 React 组件:

    \ No newline at end of file +

    查看我的 React 组件:

    \ No newline at end of file diff --git a/mdx.txt b/mdx.txt index 5a8f416..c0c45d8 100644 --- a/mdx.txt +++ b/mdx.txt @@ -3,6 +3,6 @@ 4:I[2741,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"ThemeProvider"] 5:I[1504,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],"default"] 6:I[1872,["872","static/chunks/872-94447e383e603348.js","185","static/chunks/app/layout-6331908c4533dfa1.js"],""] -0:["Bf8uc4DZUfl9oSsWkT47R",[[["",{"children":["mdx",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["mdx",{"children":["__PAGE__",{},[["$L1",["$","div",null,{"className":"prose dark:prose-invert","children":[["$","h1",null,{"children":"欢迎来到我的 MDX 页面!"}],"\n",["$","p",null,{"children":["这是一些",["$","strong",null,{"children":"粗体"}],"和",["$","em",null,{"children":"斜体"}],"文本。"]}],"\n",["$","p",null,{"children":"这是 markdown 中的列表:"}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"children":"一"}],"\n",["$","li",null,{"children":"二"}],"\n",["$","li",null,{"children":"三"}],"\n"]}],"\n",["$","p",null,{"children":"查看我的 React 组件:"}]]}]],null],null]},["$","$L2",null,{"parallelRouterKey":"children","segmentPath":["children","mdx","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L4",null,{"attribute":"class","children":[["$","$L5",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L2",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L6",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L6",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L6",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/0ca73004e71b7b2a.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L7"]]]]] +0:["s1lr8R9KgVSskQ_7e-xpq",[[["",{"children":["mdx",{"children":["__PAGE__",{}]}]},"$undefined","$undefined",true],["",{"children":["mdx",{"children":["__PAGE__",{},[["$L1",["$","div",null,{"className":"prose dark:prose-invert","children":[["$","h1",null,{"children":"欢迎来到我的 MDX 页面!"}],"\n",["$","p",null,{"children":["这是一些",["$","strong",null,{"children":"粗体"}],"和",["$","em",null,{"children":"斜体"}],"文本。"]}],"\n",["$","p",null,{"children":"这是 markdown 中的列表:"}],"\n",["$","ul",null,{"children":["\n",["$","li",null,{"children":"一"}],"\n",["$","li",null,{"children":"二"}],"\n",["$","li",null,{"children":"三"}],"\n"]}],"\n",["$","p",null,{"children":"查看我的 React 组件:"}]]}]],null],null]},["$","$L2",null,{"parallelRouterKey":"children","segmentPath":["children","mdx","children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":"$undefined","notFoundStyles":"$undefined","styles":null}],null]},[["$","html",null,{"lang":"zh","suppressHydrationWarning":true,"className":"h-full","children":[["$","link",null,{"rel":"icon","href":"/next.svg","type":"image/svg+xml"}],["$","body",null,{"className":"__className_36bd41 flex flex-col bg-background font-sans antialiased h-full __variable_36bd41","children":["$","$L4",null,{"attribute":"class","children":[["$","$L5",null,{}],["$","main",null,{"className":"flex-grow container mx-auto px-4","children":["$","$L2",null,{"parallelRouterKey":"children","segmentPath":["children"],"error":"$undefined","errorStyles":"$undefined","errorScripts":"$undefined","template":["$","$L3",null,{}],"templateStyles":"$undefined","templateScripts":"$undefined","notFound":[["$","title",null,{"children":"404: This page could not be found."}],["$","div",null,{"style":{"fontFamily":"system-ui,\"Segoe UI\",Roboto,Helvetica,Arial,sans-serif,\"Apple Color Emoji\",\"Segoe UI Emoji\"","height":"100vh","textAlign":"center","display":"flex","flexDirection":"column","alignItems":"center","justifyContent":"center"},"children":["$","div",null,{"children":[["$","style",null,{"dangerouslySetInnerHTML":{"__html":"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}],["$","h1",null,{"className":"next-error-h1","style":{"display":"inline-block","margin":"0 20px 0 0","padding":"0 23px 0 0","fontSize":24,"fontWeight":500,"verticalAlign":"top","lineHeight":"49px"},"children":"404"}],["$","div",null,{"style":{"display":"inline-block"},"children":["$","h2",null,{"style":{"fontSize":14,"fontWeight":400,"lineHeight":"49px","margin":0},"children":"This page could not be found."}]}]]}]}]],"notFoundStyles":[],"styles":null}]}],["$","footer",null,{"className":"border-t py-6 md:py-0","children":["$","div",null,{"className":"container flex flex-col items-center justify-between gap-4 md:h-24 md:flex-row","children":[["$","div",null,{"className":"flex flex-col items-center gap-4 px-8 md:flex-row md:gap-2 md:px-0","children":["$","p",null,{"className":"text-center text-sm leading-loose text-muted-foreground md:text-left","children":"© 2024 我的博客. 保留所有权利。"}]}],["$","nav",null,{"className":"flex items-center space-x-4","children":[["$","$L6",null,{"href":"/privacy","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"隐私政策"}]}],["$","$L6",null,{"href":"/terms","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"使用条款"}]}],["$","$L6",null,{"href":"/contact","className":"text-sm text-muted-foreground hover:underline","children":["$","div",null,{"className":"inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 cursor-pointer transition-transform duration-200 ease-in-out hover:scale-105 active:scale-95 border-transparent bg-primary text-primary-foreground hover:bg-primary/80 active:bg-primary/70","children":"联系我们"}]}]]}]]}]}]]}]}]]}],null],null],[[["$","link","0",{"rel":"stylesheet","href":"/_next/static/css/ffc10c3bda2f2340.css","precedence":"next","crossOrigin":"$undefined"}]],[null,"$L7"]]]]] 7:[["$","meta","0",{"name":"viewport","content":"width=device-width, initial-scale=1"}],["$","meta","1",{"charSet":"utf-8"}],["$","title","2",{"children":"我的博客"}],["$","meta","3",{"name":"description","content":"欢迎来到我的博客"}],["$","link","4",{"rel":"icon","href":"/favicon.ico","type":"image/x-icon","sizes":"16x16"}],["$","meta","5",{"name":"next-size-adjust"}]] 1:null diff --git a/svg/check.svg b/svg/check.svg new file mode 100644 index 0000000..c41d431 --- /dev/null +++ b/svg/check.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/svg/copy.svg b/svg/copy.svg new file mode 100644 index 0000000..97c5e85 --- /dev/null +++ b/svg/copy.svg @@ -0,0 +1 @@ + \ No newline at end of file