3 lines
1.5 KiB
JavaScript
3 lines
1.5 KiB
JavaScript
import{LoadingIcon as d}from"@vuepress/helper/client";import{defineComponent as m,computed as t,ref as c,h as o,onMounted as v}from"vue";import{useLang as g}from"vuepress/client";import"../styles/giscus.css";import{a as f}from"../index-C4kzYjlG.js";import"@vueuse/core";const n=["ar","be","bg","ca","cs","da","de","en","eo","es","eu","fa","fr","gr","hbs","he","hu","id","it","ja","kh","ko","nl","pl","pt","ro","ru","th","tr","uk","uz","vi","zh-CN","zh-HK","zh-TW"];var h=m({name:"GiscusComment",props:{identifier:{type:String,required:!0},darkmode:Boolean},setup(r){const e=f(),a=g(),l=t(()=>!!(e.value.repo&&e.value.repoId&&e.value.category&&e.value.categoryId)),i=c(!1),s=t(()=>{if(n.includes(a.value))return a.value;const u=a.value.split("-")[0];return n.includes(u)?u:"en"}),p=t(()=>({repo:e.value.repo,repoId:e.value.repoId,category:e.value.category,categoryId:e.value.categoryId,lang:s.value,theme:r.darkmode?e.value.darkTheme||"dark":e.value.lightTheme||"light",mapping:e.value.mapping||"pathname",term:r.identifier,inputPosition:e.value.inputPosition||"top",reactionsEnabled:e.value.reactionsEnabled===!1?"0":"1",strict:e.value.strict===!1?"0":"1",loading:e.value.lazyLoading===!1?"eager":"lazy",emitMetadata:"0"}));return v(async()=>{__VUEPRESS_SSR__||(await import("giscus"),i.value=!0)}),()=>l.value?o("div",{id:"comment",class:["giscus-wrapper",{"input-top":e.value.inputPosition!=="bottom"}]},i.value?o("giscus-widget",p.value):o(d)):null}});export{h as default};
|
|
//# sourceMappingURL=GiscusComment.js.map
|