Files
2026-01-18 20:39:34 +08:00

1 line
11 KiB
JavaScript

(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[909],{1449:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>j});var n=r(5155),a=r(2115),s="(prefers-color-scheme: dark)",o="undefined"==typeof window,i=a.createContext(void 0),l={setTheme:e=>{},themes:[]},d=()=>{var e;return null!=(e=a.useContext(i))?e:l},c=null,u=(e,t)=>{let r;if(!o){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},m=()=>{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(s)),e.matches?"dark":"light"),p=e=>{let{shortname:t,slug:r}=e,{theme:s}=d(),o=(0,a.useCallback)(()=>{window.disqus_config=function(){this.page.url=window.location.href,this.page.identifier=r};let e=document.createElement("script");e.src="https://"+t+".disqus.com/embed.js",e.setAttribute("data-timestamp",Date.now().toString()),e.async=!0,document.body.appendChild(e)},[t,r,s]);return(0,a.useEffect)(()=>{o()},[o]),(0,n.jsx)("div",{className:"disqus-frame",id:"disqus_thread"})};function g({id:e,host:t,repo:s,repoId:o,category:i,categoryId:l,mapping:d,term:c,strict:u,reactionsEnabled:m,emitMetadata:h,inputPosition:p,theme:g,lang:b,loading:v}){let[f,x]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{f||r.e(408).then(r.bind(r,7408)).then(()=>x(!0))},[]),f?(0,n.jsx)("giscus-widget",{id:e,host:t,repo:s,repoid:o,category:i,categoryid:l,mapping:d,term:c,strict:u,reactionsenabled:m,emitmetadata:h,inputposition:p,theme:g,lang:b,loading:v}):null}var b=e=>{let{themeURL:t,theme:r,darkTheme:a,repo:s,repositoryId:o,category:i,categoryId:l,reactions:c,metadata:u,inputPosition:m,lang:h,mapping:p}=e,{theme:b,resolvedTheme:v}=d();return(0,n.jsx)(g,{id:"comments-container",repo:s,repoId:o,category:i,categoryId:l,mapping:p,reactionsEnabled:c,emitMetadata:u,inputPosition:m,theme:""===t?"dark"===b||"dark"===v?a:r:t,lang:h,loading:"lazy"})},v=e=>{let{theme:t,darkTheme:r,repo:s,label:o,issueTerm:i}=e,{theme:l,resolvedTheme:c}=d(),u="dark"===l||"dark"===c?r:t,m="comments-container",h=(0,a.useCallback)(()=>{let e=document.createElement("script");e.src="https://utteranc.es/client.js",e.setAttribute("repo",s),e.setAttribute("issue-term",i),e.setAttribute("label",o),e.setAttribute("theme",u),e.setAttribute("crossorigin","anonymous"),e.async=!0;let t=document.getElementById(m);return t&&t.appendChild(e),()=>{let e=document.getElementById(m);e&&(e.innerHTML="")}},[u,i,o,s]);return(0,a.useEffect)(()=>{h()},[h]),(0,n.jsx)("div",{className:"utterances-frame relative",id:m})},f=r(4175),x=({commentsConfig:e,slug:t})=>{switch(e.provider){case"giscus":return(0,n.jsx)(b,(0,f.IA)({},e.giscusConfig));case"utterances":return(0,n.jsx)(v,(0,f.IA)({},e.utterancesConfig));case"disqus":return(0,n.jsx)(p,(0,f.IA)({slug:t},e.disqusConfig))}},y=r(9327),w=r.n(y);function j(e){var t;let{slug:r}=e,[s,o]=(0,a.useState)(!1);return(null===(t=w().comments)||void 0===t?void 0:t.provider)?(0,n.jsx)(n.Fragment,{children:s?(0,n.jsx)(x,{commentsConfig:w().comments,slug:r}):(0,n.jsx)("button",{onClick:()=>o(!0),children:"Load Comments"})}):null}},1465:()=>{},1637:(e,t,r)=>{Promise.resolve().then(r.bind(r,1449)),Promise.resolve().then(r.bind(r,1839)),Promise.resolve().then(r.t.bind(r,6699,23)),Promise.resolve().then(r.t.bind(r,1465,23)),Promise.resolve().then(r.t.bind(r,6874,23)),Promise.resolve().then(r.t.bind(r,3063,23)),Promise.resolve().then(r.bind(r,8194)),Promise.resolve().then(r.bind(r,2100))},1839:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var n=r(5155),a=r(9327),s=r.n(a),o=r(2115);let i=()=>{var e;let[t,r]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{let e=()=>{window.scrollY>50?r(!0):r(!1)};return window.addEventListener("scroll",e),()=>window.removeEventListener("scroll",e)},[]),(0,n.jsxs)("div",{className:"fixed right-8 bottom-8 hidden flex-col gap-3 ".concat(t?"md:flex":"md:hidden"),children:[(null===(e=s().comments)||void 0===e?void 0:e.provider)&&(0,n.jsx)("button",{"aria-label":"Scroll To Comment",onClick:()=>{var e;null===(e=document.getElementById("comment"))||void 0===e||e.scrollIntoView()},className:"rounded-full bg-gray-200 p-2 text-gray-500 transition-all hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600",children:(0,n.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M18 10c0 3.866-3.582 7-8 7a8.841 8.841 0 01-4.083-.98L2 17l1.338-3.123C2.493 12.767 2 11.434 2 10c0-3.866 3.582-7 8-7s8 3.134 8 7zM7 9H5v2h2V9zm8 0h-2v2h2V9zM9 9h2v2H9V9z",clipRule:"evenodd"})})}),(0,n.jsx)("button",{"aria-label":"Scroll To Top",onClick:()=>{window.scrollTo({top:0})},className:"rounded-full bg-gray-200 p-2 text-gray-500 transition-all hover:bg-gray-300 dark:bg-gray-700 dark:text-gray-400 dark:hover:bg-gray-600",children:(0,n.jsx)("svg",{className:"h-5 w-5",viewBox:"0 0 20 20",fill:"currentColor",children:(0,n.jsx)("path",{fillRule:"evenodd",d:"M3.293 9.707a1 1 0 010-1.414l6-6a1 1 0 011.414 0l6 6a1 1 0 01-1.414 1.414L11 5.414V17a1 1 0 11-2 0V5.414L4.707 9.707a1 1 0 01-1.414 0z",clipRule:"evenodd"})})})]})}},2100:(e,t,r)=>{"use strict";r.d(t,{default:()=>s});var n=r(2115),a=r(5155),s=e=>{let{children:t}=e,r=(0,n.useRef)(null),[s,o]=(0,n.useState)(!1),[i,l]=(0,n.useState)(!1);return(0,a.jsxs)("div",{ref:r,onMouseEnter:()=>{o(!0)},onMouseLeave:()=>{o(!1),l(!1)},className:"relative",children:[s&&(0,a.jsx)("button",{"aria-label":"Copy code",className:"absolute right-2 top-2 h-8 w-8 rounded border-2 bg-gray-700 p-1 dark:bg-gray-800 ".concat(i?"border-green-400 focus:border-green-400 focus:outline-none":"border-gray-300"),onClick:()=>{l(!0),navigator.clipboard.writeText(r.current.textContent),setTimeout(()=>{l(!1)},2e3)},children:(0,a.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",stroke:"currentColor",fill:"none",className:i?"text-green-400":"text-gray-300",children:i?(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"})}):(0,a.jsx)(a.Fragment,{children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"})})})}),(0,a.jsx)("pre",{children:t})]})}},4175:(e,t,r)=>{"use strict";r.d(t,{BU:()=>h,IA:()=>c,YG:()=>m,ko:()=>u});var n=Object.defineProperty,a=Object.defineProperties,s=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,d=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,c=(e,t)=>{for(var r in t||(t={}))i.call(t,r)&&d(e,r,t[r]);if(o)for(var r of o(t))l.call(t,r)&&d(e,r,t[r]);return e},u=(e,t)=>a(e,s(t)),m=(e,t)=>{var r={};for(var n in e)i.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&o)for(var n of o(e))0>t.indexOf(n)&&l.call(e,n)&&(r[n]=e[n]);return r},h=(e,t,r)=>new Promise((n,a)=>{var s=e=>{try{i(r.next(e))}catch(e){a(e)}},o=e=>{try{i(r.throw(e))}catch(e){a(e)}},i=e=>e.done?n(e.value):Promise.resolve(e.value).then(s,o);i((r=r.apply(e,t)).next())})},6699:()=>{},8194:(e,t,r)=>{"use strict";r.d(t,{default:()=>i});var n=r(2115),a=r(5155),s=(e,t,r)=>new Promise((n,a)=>{var s=e=>{try{i(r.next(e))}catch(e){a(e)}},o=e=>{try{i(r.throw(e))}catch(e){a(e)}},i=e=>e.done?n(e.value):Promise.resolve(e.value).then(s,o);i((r=r.apply(e,t)).next())}),o=e=>{let{title:t="Subscribe to the newsletter",apiUrl:r="/api/newsletter"}=e,o=(0,n.useRef)(null),[i,l]=(0,n.useState)(!1),[d,c]=(0,n.useState)(""),[u,m]=(0,n.useState)(!1);return(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"pb-1 text-lg font-semibold text-gray-800 dark:text-gray-100",children:t}),(0,a.jsxs)("form",{className:"flex flex-col sm:flex-row",onSubmit:e=>s(void 0,null,function*(){e.preventDefault();let t=yield fetch(r,{body:JSON.stringify({email:o.current.value}),headers:{"Content-Type":"application/json"},method:"POST"}),{error:n}=yield t.json();if(n){l(!0),c("Your e-mail address is invalid or you are already subscribed!");return}o.current.value="",l(!1),m(!0)}),children:[(0,a.jsx)("div",{children:(0,a.jsxs)("label",{htmlFor:"email-input",children:[(0,a.jsx)("span",{className:"sr-only",children:"Email address"}),(0,a.jsx)("input",{autoComplete:"email",className:"focus:ring-primary-600 w-72 rounded-md px-4 focus:border-transparent focus:outline-none focus:ring-2 dark:bg-black",id:"email-input",name:"email",placeholder:u?"You're subscribed ! \uD83C\uDF89":"Enter your email",ref:o,required:!0,type:"email",disabled:u})]})}),(0,a.jsx)("div",{className:"mt-2 flex w-full rounded-md shadow-sm sm:mt-0 sm:ml-3",children:(0,a.jsx)("button",{className:"bg-primary-500 w-full rounded-md py-2 px-4 font-medium text-white sm:py-0 ".concat(u?"cursor-default":"hover:bg-primary-700 dark:hover:bg-primary-400"," focus:ring-primary-600 focus:outline-none focus:ring-2 focus:ring-offset-2 dark:ring-offset-black"),type:"submit",disabled:u,children:u?"Thank you!":"Sign up"})})]}),i&&(0,a.jsx)("div",{className:"w-72 pt-2 text-sm text-red-500 dark:text-red-400 sm:w-96",children:d})]})},i=e=>{let{title:t,apiUrl:r}=e;return(0,a.jsx)("div",{className:"flex items-center justify-center",children:(0,a.jsx)("div",{className:"bg-gray-100 p-6 dark:bg-gray-800 sm:px-14 sm:py-8",children:(0,a.jsx)(o,{title:t,apiUrl:r})})})}},9327:(e,t,r)=>{"use strict";var n=r(9509);e.exports={title:"Next.js Starter Blog",author:"Tails Azimuth",headerTitle:"TailwindBlog",description:"A blog created with Next.js and Tailwind.css",language:"en-us",theme:"system",siteUrl:"https://tailwind-nextjs-starter-blog.vercel.app",siteRepo:"https://github.com/timlrx/tailwind-nextjs-starter-blog",siteLogo:"".concat(n.env.BASE_PATH||"","/static/images/logo.png"),socialBanner:"".concat(n.env.BASE_PATH||"","/static/images/twitter-card.png"),mastodon:"https://mastodon.social/@mastodonuser",email:"address@yoursite.com",github:"https://github.com",x:"https://twitter.com/x",facebook:"https://facebook.com",youtube:"https://youtube.com",linkedin:"https://www.linkedin.com",threads:"https://www.threads.net",instagram:"https://www.instagram.com",medium:"https://medium.com",bluesky:"https://bsky.app/",locale:"en-US",stickyNav:!1,analytics:{umamiAnalytics:{umamiWebsiteId:n.env.NEXT_UMAMI_ID}},newsletter:{provider:"buttondown"},comments:{provider:"giscus",giscusConfig:{repo:n.env.NEXT_PUBLIC_GISCUS_REPO,repositoryId:n.env.NEXT_PUBLIC_GISCUS_REPOSITORY_ID,category:n.env.NEXT_PUBLIC_GISCUS_CATEGORY,categoryId:n.env.NEXT_PUBLIC_GISCUS_CATEGORY_ID,mapping:"pathname",reactions:"1",metadata:"0",theme:"light",darkTheme:"transparent_dark",themeURL:"",lang:"en"}},search:{provider:"kbar",kbarConfig:{searchDocumentsPath:"".concat(n.env.BASE_PATH||"","/search.json")}}}}},e=>{var t=t=>e(e.s=t);e.O(0,[939,874,63,441,684,358],()=>t(1637)),_N_E=e.O()}]);