mirror of
https://github.com/bspeice/speice.io
synced 2024-12-22 08:38:09 -05:00
1 line
6.2 KiB
JavaScript
1 line
6.2 KiB
JavaScript
"use strict";(self.webpackChunkspeice_io=self.webpackChunkspeice_io||[]).push([["9555"],{13549:function(e,t,n){n.r(t),n.d(t,{default:()=>I});var r=n("85893"),i=n("67294"),l=n("67026"),s=n("82743"),a=n("84681"),o=n("41835"),c=n("40979"),d=n("14378"),u=n("28127");function m(){let{assets:e,metadata:t}=(0,o.nO)(),{title:n,description:i,date:l,tags:a,authors:c,frontMatter:d}=t,{keywords:u}=d,m=e.image??d.image;return(0,r.jsxs)(s.d,{title:d.title_meta??n,description:i,keywords:u,image:m,children:[(0,r.jsx)("meta",{property:"og:type",content:"article"}),(0,r.jsx)("meta",{property:"article:published_time",content:l}),c.some(e=>e.url)&&(0,r.jsx)("meta",{property:"article:author",content:c.map(e=>e.url).filter(Boolean).join(",")}),a.length>0&&(0,r.jsx)("meta",{property:"article:tag",content:a.map(e=>e.label).join(",")})]})}var f=n("94819");function h(){let e=(0,o.iZ)();return(0,r.jsx)(f.Z,{children:(0,r.jsx)("script",{type:"application/ld+json",children:JSON.stringify(e)})})}var x=n("30140");function p(e){let t=e.getBoundingClientRect();return t.top===t.bottom?p(e.parentNode):t}var j=n("83012");let g=i.memo(function e(t){let{toc:n,className:i,linkClassName:l,isChild:s}=t;return n.length?(0,r.jsx)("ul",{className:s?void 0:i,children:n.map(t=>(0,r.jsxs)("li",{children:[(0,r.jsx)(j.Z,{to:`#${t.id}`,className:l??void 0,dangerouslySetInnerHTML:{__html:t.value}}),(0,r.jsx)(e,{isChild:!0,toc:t.children,className:i,linkClassName:l})]},t.id))}):null});function v(e){let{toc:t,className:n="table-of-contents table-of-contents__left-border",linkClassName:l="table-of-contents__link",linkActiveClassName:s,minHeadingLevel:a,maxHeadingLevel:o,...c}=e,d=(0,x.L)(),u=a??d.tableOfContents.minHeadingLevel,m=o??d.tableOfContents.maxHeadingLevel,f=function(e){let{toc:t,minHeadingLevel:n,maxHeadingLevel:r}=e;return(0,i.useMemo)(()=>(function e(t){let{toc:n,minHeadingLevel:r,maxHeadingLevel:i}=t;return n.flatMap(t=>{var n;let l=e({toc:t.children,minHeadingLevel:r,maxHeadingLevel:i});return(n=t).level>=r&&n.level<=i?[{...t,children:l}]:l})})({toc:function(e){let t=e.map(e=>({...e,parentIndex:-1,children:[]})),n=Array(7).fill(-1);t.forEach((e,t)=>{let r=n.slice(2,e.level);e.parentIndex=Math.max(...r),n[e.level]=t});let r=[];return t.forEach(e=>{let{parentIndex:n,...i}=e;n>=0?t[n].children.push(i):r.push(i)}),r}(t),minHeadingLevel:n,maxHeadingLevel:r}),[t,n,r])}({toc:t,minHeadingLevel:u,maxHeadingLevel:m});return!function(e){let t=(0,i.useRef)(void 0),n=function(){let e=(0,i.useRef)(0),{navbar:{hideOnScroll:t}}=(0,x.L)();return(0,i.useEffect)(()=>{e.current=t?0:document.querySelector(".navbar").clientHeight},[t]),e}();(0,i.useEffect)(()=>{if(!e)return()=>{};let{linkClassName:r,linkActiveClassName:i,minHeadingLevel:l,maxHeadingLevel:s}=e;function a(){var e;let a=(e=r,Array.from(document.getElementsByClassName(e))),o=function(e,t){let{anchorTopOffset:n}=t,r=e.find(e=>p(e).top>=n);if(r){var i;return(i=p(r)).top>0&&i.bottom<window.innerHeight/2?r:e[e.indexOf(r)-1]??null}return e[e.length-1]??null}(function(e){let{minHeadingLevel:t,maxHeadingLevel:n}=e,r=[];for(let e=t;e<=n;e+=1)r.push(`h${e}.anchor`);return Array.from(document.querySelectorAll(r.join()))}({minHeadingLevel:l,maxHeadingLevel:s}),{anchorTopOffset:n.current}),c=a.find(e=>{var t;return o&&o.id===decodeURIComponent((t=e).href.substring(t.href.indexOf("#")+1))});a.forEach(e=>{var n;n=e,e===c?(t.current&&t.current!==n&&t.current.classList.remove(i),n.classList.add(i),t.current=n):n.classList.remove(i)})}return document.addEventListener("scroll",a),document.addEventListener("resize",a),a(),()=>{document.removeEventListener("scroll",a),document.removeEventListener("resize",a)}},[e,n])}((0,i.useMemo)(()=>{if(l&&s)return{linkClassName:l,linkActiveClassName:s,minHeadingLevel:u,maxHeadingLevel:m}},[l,s,u,m])),(0,r.jsx)(g,{toc:f,className:n,linkClassName:l,...c})}let b="tableOfContents_bqdL";function _(e){let{className:t,...n}=e;return(0,r.jsx)("div",{className:(0,l.Z)(b,"thin-scrollbar",t),children:(0,r.jsx)(v,{...n,linkClassName:"table-of-contents__link toc-highlight",linkActiveClassName:"table-of-contents__link--active"})})}var y=n("96025");function k(){return(0,r.jsx)(y.Z,{id:"theme.contentVisibility.unlistedBanner.title",description:"The unlisted content banner title",children:"Unlisted page"})}function L(){return(0,r.jsx)(y.Z,{id:"theme.contentVisibility.unlistedBanner.message",description:"The unlisted content banner message",children:"This page is unlisted. Search engines will not index it, and only users having a direct link can access it."})}function Z(){return(0,r.jsx)(f.Z,{children:(0,r.jsx)("meta",{name:"robots",content:"noindex, nofollow"})})}function N(){return(0,r.jsx)(y.Z,{id:"theme.contentVisibility.draftBanner.title",description:"The draft content banner title",children:"Draft page"})}function C(){return(0,r.jsx)(y.Z,{id:"theme.contentVisibility.draftBanner.message",description:"The draft content banner message",children:"This page is a draft. It will only be visible in dev and be excluded from the production build."})}var B=n("75094");function E(e){let{className:t}=e;return(0,r.jsx)(B.Z,{type:"caution",title:(0,r.jsx)(N,{}),className:(0,l.Z)(t,a.k.common.draftBanner),children:(0,r.jsx)(C,{})})}function w(e){let{className:t}=e;return(0,r.jsx)(B.Z,{type:"caution",title:(0,r.jsx)(k,{}),className:(0,l.Z)(t,a.k.common.unlistedBanner),children:(0,r.jsx)(L,{})})}function H(e){return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(Z,{}),(0,r.jsx)(w,{...e})]})}function O(e){let{metadata:t}=e,{unlisted:n,frontMatter:i}=t;return(0,r.jsxs)(r.Fragment,{children:[(n||i.unlisted)&&(0,r.jsx)(H,{}),i.draft&&(0,r.jsx)(E,{})]})}function T(e){let{sidebar:t,children:n}=e,{metadata:i,toc:l}=(0,o.nO)(),{nextItem:s,prevItem:a,frontMatter:m}=i,{hide_table_of_contents:f,toc_min_heading_level:h,toc_max_heading_level:x}=m;return(0,r.jsxs)(c.Z,{sidebar:t,toc:!f&&l.length>0?(0,r.jsx)(_,{toc:l,minHeadingLevel:h,maxHeadingLevel:x}):void 0,children:[(0,r.jsx)(O,{metadata:i}),(0,r.jsx)(d.Z,{children:n}),(s||a)&&(0,r.jsx)(u.Z,{nextItem:s,prevItem:a})]})}function I(e){let t=e.content;return(0,r.jsx)(o.n4,{content:e.content,isBlogPostPage:!0,children:(0,r.jsxs)(s.FG,{className:(0,l.Z)(a.k.wrapper.blogPages,a.k.page.blogPostPage),children:[(0,r.jsx)(m,{}),(0,r.jsx)(h,{}),(0,r.jsx)(T,{sidebar:e.sidebar,children:(0,r.jsx)(t,{})})]})})}}}]); |