Socket
Socket
Sign inDemoInstall

@waline/client

Package Overview
Dependencies
32
Maintainers
2
Versions
160
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.2 to 3.1.3

2

dist/comment.js

@@ -1,2 +0,2 @@

const i=e=>`${e.replace(/\/?$/,"/")}api/`,h=(e,t="")=>{if(typeof e=="object"&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},g=({serverURL:e,lang:t,paths:r,signal:o})=>fetch(`${i(e)}comment?type=count&url=${encodeURIComponent(r.join(","))}&lang=${t}`,{signal:o}).then(n=>n.json()).then(n=>h(n,"Get comment count").data),p=e=>{try{e=decodeURI(e)}catch{}return e},m=(e="")=>e.replace(/\/$/u,""),u=e=>/^(https?:)?\/\//.test(e),d=e=>{const t=m(e);return u(t)?t:`https://${t}`},$=e=>{e.name!=="AbortError"&&console.error(e.message)},f=e=>e.dataset.path||null,v=({serverURL:e,path:t=window.location.pathname,selector:r=".waline-comment-count",lang:o=navigator.language})=>{const n=new AbortController,a=document.querySelectorAll(r);return a.length&&g({serverURL:d(e),paths:Array.from(a).map(c=>p(f(c)||t)),lang:o,signal:n.signal}).then(c=>{a.forEach((s,l)=>{s.innerText=c[l].toString()})}).catch($),n.abort.bind(n)},w="3.1.2";export{v as commentCount,w as version};
const i=e=>`${e.replace(/\/?$/,"/")}api/`,h=(e,t="")=>{if(typeof e=="object"&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},g=({serverURL:e,lang:t,paths:r,signal:o})=>fetch(`${i(e)}comment?type=count&url=${encodeURIComponent(r.join(","))}&lang=${t}`,{signal:o}).then(n=>n.json()).then(n=>h(n,"Get comment count").data),p=e=>{try{e=decodeURI(e)}catch{}return e},m=(e="")=>e.replace(/\/$/u,""),u=e=>/^(https?:)?\/\//.test(e),d=e=>{const t=m(e);return u(t)?t:`https://${t}`},$=e=>{e.name!=="AbortError"&&console.error(e.message)},f=e=>e.dataset.path||null,v=({serverURL:e,path:t=window.location.pathname,selector:r=".waline-comment-count",lang:o=navigator.language})=>{const n=new AbortController,a=document.querySelectorAll(r);return a.length&&g({serverURL:d(e),paths:Array.from(a).map(c=>p(f(c)||t)),lang:o,signal:n.signal}).then(c=>{a.forEach((s,l)=>{s.innerText=c[l].toString()})}).catch($),n.abort.bind(n)},w="3.1.3";export{v as commentCount,w as version};
//# sourceMappingURL=comment.js.map

@@ -1,2 +0,2 @@

import{h as R,defineComponent as ce,inject as ke,ref as L,computed as W,onMounted as ge,watch as te,onUnmounted as be,openBlock as i,createElementBlock as s,createElementVNode as v,toDisplayString as M,Fragment as D,renderList as J,normalizeClass as q,createBlock as le,unref as w,createCommentVNode as x,onBeforeUnmount as ht,normalizeStyle as Ne,nextTick as ft,reactive as yt,createVNode as Z,withDirectives as he,vModelDynamic as wt,isRef as kt,vModelText as bt,vShow as We,createTextVNode as ae,resolveComponent as Ct,provide as $t}from"vue";import{useStorage as re,useScriptTag as Lt,useDebounceFn as It,useNow as xt,useStyleTag as Et}from"@vueuse/core";import{getArticleCounter as Rt,updateArticleCounter as De,updateComment as fe,addComment as Mt,login as _t,deleteComment as At,getComment as St}from"@waline/api";import Be from"autosize";import{Marked as jt}from"marked";import{markedHighlight as zt}from"marked-highlight";import{load as Ut}from"recaptcha-v3";const Pe=({size:e})=>R("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[R("path",{d:"M697.173 85.333h-369.92c-144.64 0-241.92 101.547-241.92 252.587v348.587c0 150.613 97.28 252.16 241.92 252.16h369.92c144.64 0 241.494-101.547 241.494-252.16V337.92c0-151.04-96.854-252.587-241.494-252.587z",fill:"currentColor"}),R("path",{d:"m640.683 587.52-75.947-75.861 75.904-75.862a37.29 37.29 0 0 0 0-52.778 37.205 37.205 0 0 0-52.779 0l-75.946 75.818-75.862-75.946a37.419 37.419 0 0 0-52.821 0 37.419 37.419 0 0 0 0 52.821l75.947 75.947-75.776 75.733a37.29 37.29 0 1 0 52.778 52.821l75.776-75.776 75.947 75.947a37.376 37.376 0 0 0 52.779-52.821z",fill:"#888"})]),Vt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},R("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),Ht=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},R("path",{d:"M563.2 463.3 677 540c1.7 1.2 3.7 1.8 5.8 1.8.7 0 1.4-.1 2-.2 2.7-.5 5.1-2.1 6.6-4.4l25.3-37.8c1.5-2.3 2.1-5.1 1.6-7.8s-2.1-5.1-4.4-6.6l-73.6-49.1 73.6-49.1c2.3-1.5 3.9-3.9 4.4-6.6.5-2.7 0-5.5-1.6-7.8l-25.3-37.8a10.1 10.1 0 0 0-6.6-4.4c-.7-.1-1.3-.2-2-.2-2.1 0-4.1.6-5.8 1.8l-113.8 76.6c-9.2 6.2-14.7 16.4-14.7 27.5.1 11 5.5 21.3 14.7 27.4zM387 348.8h-45.5c-5.7 0-10.4 4.7-10.4 10.4v153.3c0 5.7 4.7 10.4 10.4 10.4H387c5.7 0 10.4-4.7 10.4-10.4V359.2c0-5.7-4.7-10.4-10.4-10.4zm333.8 241.3-41-20a10.3 10.3 0 0 0-8.1-.5c-2.6.9-4.8 2.9-5.9 5.4-30.1 64.9-93.1 109.1-164.4 115.2-5.7.5-9.9 5.5-9.5 11.2l3.9 45.5c.5 5.3 5 9.5 10.3 9.5h.9c94.8-8 178.5-66.5 218.6-152.7 2.4-5 .3-11.2-4.8-13.6zm186-186.1c-11.9-42-30.5-81.4-55.2-117.1-24.1-34.9-53.5-65.6-87.5-91.2-33.9-25.6-71.5-45.5-111.6-59.2-41.2-14-84.1-21.1-127.8-21.1h-1.2c-75.4 0-148.8 21.4-212.5 61.7-63.7 40.3-114.3 97.6-146.5 165.8-32.2 68.1-44.3 143.6-35.1 218.4 9.3 74.8 39.4 145 87.3 203.3.1.2.3.3.4.5l36.2 38.4c1.1 1.2 2.5 2.1 3.9 2.6 73.3 66.7 168.2 103.5 267.5 103.5 73.3 0 145.2-20.3 207.7-58.7 37.3-22.9 70.3-51.5 98.1-85 27.1-32.7 48.7-69.5 64.2-109.1 15.5-39.7 24.4-81.3 26.6-123.8 2.4-43.6-2.5-87-14.5-129zm-60.5 181.1c-8.3 37-22.8 72-43 104-19.7 31.1-44.3 58.6-73.1 81.7-28.8 23.1-61 41-95.7 53.4-35.6 12.7-72.9 19.1-110.9 19.1-82.6 0-161.7-30.6-222.8-86.2l-34.1-35.8c-23.9-29.3-42.4-62.2-55.1-97.7-12.4-34.7-18.8-71-19.2-107.9-.4-36.9 5.4-73.3 17.1-108.2 12-35.8 30-69.2 53.4-99.1 31.7-40.4 71.1-72 117.2-94.1 44.5-21.3 94-32.6 143.4-32.6 49.3 0 97 10.8 141.8 32 34.3 16.3 65.3 38.1 92 64.8 26.1 26 47.5 56 63.6 89.2 16.2 33.2 26.6 68.5 31 105.1 4.6 37.5 2.7 75.3-5.6 112.3z",fill:"currentColor"})),Tt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[R("path",{d:"M784 112H240c-88 0-160 72-160 160v480c0 88 72 160 160 160h544c88 0 160-72 160-160V272c0-88-72-160-160-160zm96 640c0 52.8-43.2 96-96 96H240c-52.8 0-96-43.2-96-96V272c0-52.8 43.2-96 96-96h544c52.8 0 96 43.2 96 96v480z",fill:"currentColor"}),R("path",{d:"M352 480c52.8 0 96-43.2 96-96s-43.2-96-96-96-96 43.2-96 96 43.2 96 96 96zm0-128c17.6 0 32 14.4 32 32s-14.4 32-32 32-32-14.4-32-32 14.4-32 32-32zm462.4 379.2-3.2-3.2-177.6-177.6c-25.6-25.6-65.6-25.6-91.2 0l-80 80-36.8-36.8c-25.6-25.6-65.6-25.6-91.2 0L200 728c-4.8 6.4-8 14.4-8 24 0 17.6 14.4 32 32 32 9.6 0 16-3.2 22.4-9.6L380.8 640l134.4 134.4c6.4 6.4 14.4 9.6 24 9.6 17.6 0 32-14.4 32-32 0-9.6-4.8-17.6-9.6-24l-52.8-52.8 80-80L769.6 776c6.4 4.8 12.8 8 20.8 8 17.6 0 32-14.4 32-32 0-8-3.2-16-8-20.8z",fill:"currentColor"})]),Ft=({active:e=!1})=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[R("path",{d:`M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z${e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"}`,fill:e?"red":"currentColor"})]),Nt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[R("path",{d:"M710.816 654.301c70.323-96.639 61.084-230.578-23.705-314.843-46.098-46.098-107.183-71.109-172.28-71.109-65.008 0-126.092 25.444-172.28 71.109-45.227 46.098-70.756 107.183-70.756 172.106 0 64.923 25.444 126.007 71.194 172.106 46.099 46.098 107.184 71.109 172.28 71.109 51.414 0 100.648-16.212 142.824-47.404l126.53 126.006c7.058 7.06 16.297 10.979 26.406 10.979 10.105 0 19.343-3.919 26.402-10.979 14.467-14.467 14.467-38.172 0-52.723L710.816 654.301zm-315.107-23.265c-65.88-65.88-65.88-172.54 0-238.42 32.069-32.07 74.245-49.149 119.471-49.149 45.227 0 87.407 17.603 119.472 49.149 65.88 65.879 65.88 172.539 0 238.42-63.612 63.178-175.242 63.178-238.943 0zm0 0",fill:"currentColor"}),R("path",{d:"M703.319 121.603H321.03c-109.8 0-199.469 89.146-199.469 199.38v382.034c0 109.796 89.236 199.38 199.469 199.38h207.397c20.653 0 37.384-16.645 37.384-37.299 0-20.649-16.731-37.296-37.384-37.296H321.03c-68.582 0-124.352-55.77-124.352-124.267V321.421c0-68.496 55.77-124.267 124.352-124.267h382.289c68.582 0 124.352 55.771 124.352 124.267V524.72c0 20.654 16.736 37.299 37.385 37.299 20.654 0 37.384-16.645 37.384-37.299V320.549c-.085-109.8-89.321-198.946-199.121-198.946zm0 0",fill:"currentColor"})]),Wt=()=>R("svg",{width:"16",height:"16",ariaHidden:"true"},R("path",{d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",fill:"currentColor"})),Dt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},R("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),Bt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},R("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),Pt=()=>R("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},R("path",{d:"m894.4 461.56-54.4-63.2c-10.4-12-18.8-34.4-18.8-50.4v-68c0-42.4-34.8-77.2-77.2-77.2h-68c-15.6 0-38.4-8.4-50.4-18.8l-63.2-54.4c-27.6-23.6-72.8-23.6-100.8 0l-62.8 54.8c-12 10-34.8 18.4-50.4 18.4h-69.2c-42.4 0-77.2 34.8-77.2 77.2v68.4c0 15.6-8.4 38-18.4 50l-54 63.6c-23.2 27.6-23.2 72.4 0 100l54 63.6c10 12 18.4 34.4 18.4 50v68.4c0 42.4 34.8 77.2 77.2 77.2h69.2c15.6 0 38.4 8.4 50.4 18.8l63.2 54.4c27.6 23.6 72.8 23.6 100.8 0l63.2-54.4c12-10.4 34.4-18.8 50.4-18.8h68c42.4 0 77.2-34.8 77.2-77.2v-68c0-15.6 8.4-38.4 18.8-50.4l54.4-63.2c23.2-27.6 23.2-73.2-.4-100.8zm-216-25.2-193.2 193.2a30 30 0 0 1-42.4 0l-96.8-96.8a30.16 30.16 0 0 1 0-42.4c11.6-11.6 30.8-11.6 42.4 0l75.6 75.6 172-172c11.6-11.6 30.8-11.6 42.4 0 11.6 11.6 11.6 30.8 0 42.4z",fill:"#27ae60"})),ue=({size:e=100})=>R("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},R("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},R("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Ot=()=>R("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[R("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),R("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})]),qt=()=>re("WALINE_USER_META",{nick:"",mail:"",link:""}),Gt=()=>re("WALINE_COMMENT_BOX_EDITOR",""),Kt="WALINE_LIKE";let Oe=null;const qe=()=>Oe||(Oe=re(Kt,[])),Zt="WALINE_REACTION";let Ge=null;const Xt=()=>Ge??(Ge=re(Zt,{})),Ke={},Jt=e=>{const a=Ke[e]??(Ke[e]=Ut(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:l=>a.then(t=>t.execute(l))}},Yt=e=>({execute:async a=>{const{load:l}=Lt("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await l();const t=window==null?void 0:window.turnstile;return new Promise(u=>{t==null||t.ready(()=>{t==null||t.render(".wl-captcha-container",{sitekey:e,action:a,size:"compact",callback:u})})})}}),Qt="WALINE_USER";let Ze=null;const Ce=()=>Ze??(Ze=re(Qt,{})),el={key:0,class:"wl-reaction"},tl=["textContent"],ll={class:"wl-reaction-list"},al=["onClick"],nl={class:"wl-reaction-img"},il=["src","alt"],ol=["textContent"],rl=["textContent"];var sl=ce({__name:"ArticleReaction",setup(e,{expose:a}){a();const l=Xt(),t=ke("config"),u=L(-1),o=L([]),k=W(()=>t.value.locale),_=W(()=>t.value.reaction.length>0),b=W(()=>{const{reaction:m,path:A}=t.value;return m.map((j,$)=>({icon:j,desc:k.value[`reaction${$}`],active:l.value[A]===$}))});let I;const C=async()=>{if(_.value){const{serverURL:m,lang:A,path:j,reaction:$}=t.value,p=new AbortController;I=p.abort.bind(p);const n=await Rt({serverURL:m,lang:A,paths:[j],type:$.map((d,F)=>`reaction${F}`),signal:p.signal});if(Array.isArray(n)||typeof n=="number")return;o.value=$.map((d,F)=>n[`reaction${F}`])}},V=async m=>{if(u.value===-1){const{serverURL:A,lang:j,path:$}=t.value,p=l.value[$];u.value=m,p!==void 0&&(await De({serverURL:A,lang:j,path:$,type:`reaction${p}`,action:"desc"}),o.value[p]=Math.max(o.value[p]-1,0)),p!==m&&(await De({serverURL:A,lang:j,path:$,type:`reaction${m}`}),o.value[m]=(o.value[m]||0)+1),p===m?delete l.value[$]:l.value[$]=m,u.value=-1}};return ge(()=>{te(()=>[t.value.serverURL,t.value.path],()=>{C()},{immediate:!0})}),be(()=>I==null?void 0:I()),(m,A)=>b.value.length?(i(),s("div",el,[v("div",{class:"wl-reaction-title",textContent:M(k.value.reactionTitle)},null,8,tl),v("ul",ll,[(i(!0),s(D,null,J(b.value,({active:j,icon:$,desc:p},n)=>(i(),s("li",{key:n,class:q(["wl-reaction-item",{active:j}]),onClick:d=>V(n)},[v("div",nl,[v("img",{src:$,alt:p},null,8,il),u.value===n?(i(),le(w(ue),{key:0,class:"wl-reaction-loading"})):(i(),s("div",{key:1,class:"wl-reaction-votes",textContent:M(o.value[n]||0)},null,8,ol))]),v("div",{class:"wl-reaction-text",textContent:M(p)},null,8,rl)],10,al))),128))])])):x("v-if",!0)}}),ve=(e,a)=>{const l=e.__vccOpts||e;for(const[t,u]of a)l[t]=u;return l},cl=ve(sl,[["__file","ArticleReaction.vue"]]);const ul=["data-index"],vl=["src","title","onClick"];var ml=ce({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e,{expose:a}){const l=e;a();let t=null;const u=L(null),o=L({}),k=L([]),_=()=>{const m=Math.floor((u.value.getBoundingClientRect().width+l.gap)/(l.columnWidth+l.gap));return m>0?m:1},b=m=>new Array(m).fill(null).map(()=>[]),I=async m=>{var A;if(m>=l.items.length)return;await ft();const j=Array.from(((A=u.value)==null?void 0:A.children)||[]).reduce(($,p)=>p.getBoundingClientRect().height<$.getBoundingClientRect().height?p:$);k.value[Number(j.dataset.index)].push(m),await I(m+1)},C=async(m=!1)=>{if(k.value.length===_()&&!m)return;k.value=b(_());const A=window.scrollY;await I(0),window.scrollTo({top:A})},V=m=>{o.value[m.target.src]=!0};return ge(()=>{C(!0),t=new ResizeObserver(()=>{C()}),t.observe(u.value),te(()=>[l.items],()=>{o.value={},C(!0)}),te(()=>[l.columnWidth,l.gap],()=>{C()})}),ht(()=>t.unobserve(u.value)),(m,A)=>(i(),s("div",{ref_key:"wall",ref:u,class:"wl-gallery",style:Ne({gap:`${m.gap}px`})},[(i(!0),s(D,null,J(k.value,(j,$)=>(i(),s("div",{key:$,class:"wl-gallery-column","data-index":$,style:Ne({gap:`${m.gap}px`})},[(i(!0),s(D,null,J(j,p=>(i(),s(D,{key:p},[o.value[m.items[p].src]?x("v-if",!0):(i(),le(w(ue),{key:0,size:36,style:{margin:"20px auto"}})),v("img",{class:"wl-gallery-item",src:m.items[p].src,title:m.items[p].title,loading:"lazy",onLoad:V,onClick:n=>m.$emit("insert",`![](${m.items[p].src})`)},null,40,vl)],64))),128))],12,ul))),128))],4))}}),dl=ve(ml,[["__file","ImageWall.vue"]]);const pl=e=>{try{e=decodeURI(e)}catch{}return e},Xe=(e="")=>e.replace(/\/$/u,""),Je=e=>/^(https?:)?\/\//.test(e),gl=["nick","mail","link"],Ye=e=>e.filter(a=>gl.includes(a)),Qe=["//unpkg.com/@waline/emojis@1.1.0/weibo"],hl=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],fl=e=>new Promise((a,l)=>{if(e.size>128*1e3)return l(new Error("File too large! File size limit 128KB"));const t=new FileReader;t.readAsDataURL(e),t.onload=()=>{var u;return a(((u=t.result)==null?void 0:u.toString())||"")},t.onerror=l}),yl=e=>e===!0?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',wl=e=>{const a=async(l,t={})=>fetch(`https://api.giphy.com/v1/gifs/${l}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...t}).toString()}`).then(u=>u.json()).then(({data:u})=>u.map(o=>({title:o.title,src:o.images.downsized_medium.url})));return{search:l=>a("search",{q:l,offset:"0"}),default:()=>a("trending",{}),more:(l,t=0)=>a("search",{q:l,offset:t.toString()})}},kl=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,bl=/</,Cl=/(?:^|\s)\/\/(.+?)$/gm,$l=/\/\*([\S\s]*?)\*\//gm,Ll=new RegExp(`(${kl.source}|${bl.source})|((?:${Cl.source})|(?:${$l.source}))`,"gmi"),et=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],$e={},Il=e=>{let a=0;return e.replace(Ll,(l,t,u)=>{if(u)return`<span style="color: slategray">${u}</span>`;if(t==="<")return"&lt;";let o;$e[t]?o=$e[t]:(o=et[a],$e[t]=o);const k=`<span style="color: #${o}">${t}</span>`;return a=++a%et.length,k})},xl=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],ne=e=>Object.fromEntries(e.map((a,l)=>[xl[l],a]));var tt=ne(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words!
import{h as R,defineComponent as ce,inject as ke,ref as L,computed as W,onMounted as ge,watch as te,onUnmounted as be,openBlock as i,createElementBlock as s,createElementVNode as v,toDisplayString as M,Fragment as D,renderList as J,normalizeClass as q,createBlock as le,unref as w,createCommentVNode as x,onBeforeUnmount as ht,normalizeStyle as Ne,nextTick as ft,reactive as yt,createVNode as Z,withDirectives as he,vModelDynamic as wt,isRef as kt,vModelText as bt,vShow as We,createTextVNode as ae,resolveComponent as Ct,provide as $t}from"vue";import{useStorage as re,useScriptTag as Lt,useDebounceFn as It,useNow as xt,useStyleTag as Et}from"@vueuse/core";import{getArticleCounter as Rt,updateArticleCounter as De,updateComment as fe,addComment as Mt,login as _t,deleteComment as At,getComment as St}from"@waline/api";import Be from"autosize";import{Marked as jt}from"marked";import{markedHighlight as zt}from"marked-highlight";import{load as Ut}from"recaptcha-v3";const Pe=({size:e})=>R("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[R("path",{d:"M697.173 85.333h-369.92c-144.64 0-241.92 101.547-241.92 252.587v348.587c0 150.613 97.28 252.16 241.92 252.16h369.92c144.64 0 241.494-101.547 241.494-252.16V337.92c0-151.04-96.854-252.587-241.494-252.587z",fill:"currentColor"}),R("path",{d:"m640.683 587.52-75.947-75.861 75.904-75.862a37.29 37.29 0 0 0 0-52.778 37.205 37.205 0 0 0-52.779 0l-75.946 75.818-75.862-75.946a37.419 37.419 0 0 0-52.821 0 37.419 37.419 0 0 0 0 52.821l75.947 75.947-75.776 75.733a37.29 37.29 0 1 0 52.778 52.821l75.776-75.776 75.947 75.947a37.376 37.376 0 0 0 52.779-52.821z",fill:"#888"})]),Vt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},R("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),Ht=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},R("path",{d:"M563.2 463.3 677 540c1.7 1.2 3.7 1.8 5.8 1.8.7 0 1.4-.1 2-.2 2.7-.5 5.1-2.1 6.6-4.4l25.3-37.8c1.5-2.3 2.1-5.1 1.6-7.8s-2.1-5.1-4.4-6.6l-73.6-49.1 73.6-49.1c2.3-1.5 3.9-3.9 4.4-6.6.5-2.7 0-5.5-1.6-7.8l-25.3-37.8a10.1 10.1 0 0 0-6.6-4.4c-.7-.1-1.3-.2-2-.2-2.1 0-4.1.6-5.8 1.8l-113.8 76.6c-9.2 6.2-14.7 16.4-14.7 27.5.1 11 5.5 21.3 14.7 27.4zM387 348.8h-45.5c-5.7 0-10.4 4.7-10.4 10.4v153.3c0 5.7 4.7 10.4 10.4 10.4H387c5.7 0 10.4-4.7 10.4-10.4V359.2c0-5.7-4.7-10.4-10.4-10.4zm333.8 241.3-41-20a10.3 10.3 0 0 0-8.1-.5c-2.6.9-4.8 2.9-5.9 5.4-30.1 64.9-93.1 109.1-164.4 115.2-5.7.5-9.9 5.5-9.5 11.2l3.9 45.5c.5 5.3 5 9.5 10.3 9.5h.9c94.8-8 178.5-66.5 218.6-152.7 2.4-5 .3-11.2-4.8-13.6zm186-186.1c-11.9-42-30.5-81.4-55.2-117.1-24.1-34.9-53.5-65.6-87.5-91.2-33.9-25.6-71.5-45.5-111.6-59.2-41.2-14-84.1-21.1-127.8-21.1h-1.2c-75.4 0-148.8 21.4-212.5 61.7-63.7 40.3-114.3 97.6-146.5 165.8-32.2 68.1-44.3 143.6-35.1 218.4 9.3 74.8 39.4 145 87.3 203.3.1.2.3.3.4.5l36.2 38.4c1.1 1.2 2.5 2.1 3.9 2.6 73.3 66.7 168.2 103.5 267.5 103.5 73.3 0 145.2-20.3 207.7-58.7 37.3-22.9 70.3-51.5 98.1-85 27.1-32.7 48.7-69.5 64.2-109.1 15.5-39.7 24.4-81.3 26.6-123.8 2.4-43.6-2.5-87-14.5-129zm-60.5 181.1c-8.3 37-22.8 72-43 104-19.7 31.1-44.3 58.6-73.1 81.7-28.8 23.1-61 41-95.7 53.4-35.6 12.7-72.9 19.1-110.9 19.1-82.6 0-161.7-30.6-222.8-86.2l-34.1-35.8c-23.9-29.3-42.4-62.2-55.1-97.7-12.4-34.7-18.8-71-19.2-107.9-.4-36.9 5.4-73.3 17.1-108.2 12-35.8 30-69.2 53.4-99.1 31.7-40.4 71.1-72 117.2-94.1 44.5-21.3 94-32.6 143.4-32.6 49.3 0 97 10.8 141.8 32 34.3 16.3 65.3 38.1 92 64.8 26.1 26 47.5 56 63.6 89.2 16.2 33.2 26.6 68.5 31 105.1 4.6 37.5 2.7 75.3-5.6 112.3z",fill:"currentColor"})),Tt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[R("path",{d:"M784 112H240c-88 0-160 72-160 160v480c0 88 72 160 160 160h544c88 0 160-72 160-160V272c0-88-72-160-160-160zm96 640c0 52.8-43.2 96-96 96H240c-52.8 0-96-43.2-96-96V272c0-52.8 43.2-96 96-96h544c52.8 0 96 43.2 96 96v480z",fill:"currentColor"}),R("path",{d:"M352 480c52.8 0 96-43.2 96-96s-43.2-96-96-96-96 43.2-96 96 43.2 96 96 96zm0-128c17.6 0 32 14.4 32 32s-14.4 32-32 32-32-14.4-32-32 14.4-32 32-32zm462.4 379.2-3.2-3.2-177.6-177.6c-25.6-25.6-65.6-25.6-91.2 0l-80 80-36.8-36.8c-25.6-25.6-65.6-25.6-91.2 0L200 728c-4.8 6.4-8 14.4-8 24 0 17.6 14.4 32 32 32 9.6 0 16-3.2 22.4-9.6L380.8 640l134.4 134.4c6.4 6.4 14.4 9.6 24 9.6 17.6 0 32-14.4 32-32 0-9.6-4.8-17.6-9.6-24l-52.8-52.8 80-80L769.6 776c6.4 4.8 12.8 8 20.8 8 17.6 0 32-14.4 32-32 0-8-3.2-16-8-20.8z",fill:"currentColor"})]),Ft=({active:e=!1})=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[R("path",{d:`M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z${e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"}`,fill:e?"red":"currentColor"})]),Nt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[R("path",{d:"M710.816 654.301c70.323-96.639 61.084-230.578-23.705-314.843-46.098-46.098-107.183-71.109-172.28-71.109-65.008 0-126.092 25.444-172.28 71.109-45.227 46.098-70.756 107.183-70.756 172.106 0 64.923 25.444 126.007 71.194 172.106 46.099 46.098 107.184 71.109 172.28 71.109 51.414 0 100.648-16.212 142.824-47.404l126.53 126.006c7.058 7.06 16.297 10.979 26.406 10.979 10.105 0 19.343-3.919 26.402-10.979 14.467-14.467 14.467-38.172 0-52.723L710.816 654.301zm-315.107-23.265c-65.88-65.88-65.88-172.54 0-238.42 32.069-32.07 74.245-49.149 119.471-49.149 45.227 0 87.407 17.603 119.472 49.149 65.88 65.879 65.88 172.539 0 238.42-63.612 63.178-175.242 63.178-238.943 0zm0 0",fill:"currentColor"}),R("path",{d:"M703.319 121.603H321.03c-109.8 0-199.469 89.146-199.469 199.38v382.034c0 109.796 89.236 199.38 199.469 199.38h207.397c20.653 0 37.384-16.645 37.384-37.299 0-20.649-16.731-37.296-37.384-37.296H321.03c-68.582 0-124.352-55.77-124.352-124.267V321.421c0-68.496 55.77-124.267 124.352-124.267h382.289c68.582 0 124.352 55.771 124.352 124.267V524.72c0 20.654 16.736 37.299 37.385 37.299 20.654 0 37.384-16.645 37.384-37.299V320.549c-.085-109.8-89.321-198.946-199.121-198.946zm0 0",fill:"currentColor"})]),Wt=()=>R("svg",{width:"16",height:"16",ariaHidden:"true"},R("path",{d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",fill:"currentColor"})),Dt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},R("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),Bt=()=>R("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},R("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),Pt=()=>R("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},R("path",{d:"m894.4 461.56-54.4-63.2c-10.4-12-18.8-34.4-18.8-50.4v-68c0-42.4-34.8-77.2-77.2-77.2h-68c-15.6 0-38.4-8.4-50.4-18.8l-63.2-54.4c-27.6-23.6-72.8-23.6-100.8 0l-62.8 54.8c-12 10-34.8 18.4-50.4 18.4h-69.2c-42.4 0-77.2 34.8-77.2 77.2v68.4c0 15.6-8.4 38-18.4 50l-54 63.6c-23.2 27.6-23.2 72.4 0 100l54 63.6c10 12 18.4 34.4 18.4 50v68.4c0 42.4 34.8 77.2 77.2 77.2h69.2c15.6 0 38.4 8.4 50.4 18.8l63.2 54.4c27.6 23.6 72.8 23.6 100.8 0l63.2-54.4c12-10.4 34.4-18.8 50.4-18.8h68c42.4 0 77.2-34.8 77.2-77.2v-68c0-15.6 8.4-38.4 18.8-50.4l54.4-63.2c23.2-27.6 23.2-73.2-.4-100.8zm-216-25.2-193.2 193.2a30 30 0 0 1-42.4 0l-96.8-96.8a30.16 30.16 0 0 1 0-42.4c11.6-11.6 30.8-11.6 42.4 0l75.6 75.6 172-172c11.6-11.6 30.8-11.6 42.4 0 11.6 11.6 11.6 30.8 0 42.4z",fill:"#27ae60"})),ue=({size:e=100})=>R("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},R("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},R("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Ot=()=>R("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[R("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),R("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})]),qt=()=>re("WALINE_USER_META",{nick:"",mail:"",link:""}),Gt=()=>re("WALINE_COMMENT_BOX_EDITOR",""),Kt="WALINE_LIKE";let Oe=null;const qe=()=>Oe||(Oe=re(Kt,[])),Zt="WALINE_REACTION";let Ge=null;const Xt=()=>Ge??(Ge=re(Zt,{})),Ke={},Jt=e=>{const a=Ke[e]??(Ke[e]=Ut(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:l=>a.then(t=>t.execute(l))}},Yt=e=>({execute:async a=>{const{load:l}=Lt("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await l();const t=window==null?void 0:window.turnstile;return new Promise(u=>{t==null||t.ready(()=>{t==null||t.render(".wl-captcha-container",{sitekey:e,action:a,size:"compact",callback:u})})})}}),Qt="WALINE_USER";let Ze=null;const Ce=()=>Ze??(Ze=re(Qt,{})),el={key:0,class:"wl-reaction"},tl=["textContent"],ll={class:"wl-reaction-list"},al=["onClick"],nl={class:"wl-reaction-img"},il=["src","alt"],ol=["textContent"],rl=["textContent"];var sl=ce({__name:"ArticleReaction",setup(e,{expose:a}){a();const l=Xt(),t=ke("config"),u=L(-1),o=L([]),k=W(()=>t.value.locale),_=W(()=>t.value.reaction.length>0),b=W(()=>{const{reaction:m,path:A}=t.value;return m.map((j,$)=>({icon:j,desc:k.value[`reaction${$}`],active:l.value[A]===$}))});let I;const C=async()=>{if(!_.value)return;const{serverURL:m,lang:A,path:j,reaction:$}=t.value,p=new AbortController;I=p.abort.bind(p);const n=await Rt({serverURL:m,lang:A,paths:[j],type:$.map((d,F)=>`reaction${F}`),signal:p.signal});o.value=$.map((d,F)=>n[0][`reaction${F}`])},V=async m=>{if(u.value===-1){const{serverURL:A,lang:j,path:$}=t.value,p=l.value[$];u.value=m,p!==void 0&&(await De({serverURL:A,lang:j,path:$,type:`reaction${p}`,action:"desc"}),o.value[p]=Math.max(o.value[p]-1,0)),p!==m&&(await De({serverURL:A,lang:j,path:$,type:`reaction${m}`}),o.value[m]=(o.value[m]||0)+1),p===m?delete l.value[$]:l.value[$]=m,u.value=-1}};return ge(()=>{te(()=>[t.value.serverURL,t.value.path],()=>{C()},{immediate:!0})}),be(()=>I==null?void 0:I()),(m,A)=>b.value.length?(i(),s("div",el,[v("div",{class:"wl-reaction-title",textContent:M(k.value.reactionTitle)},null,8,tl),v("ul",ll,[(i(!0),s(D,null,J(b.value,({active:j,icon:$,desc:p},n)=>(i(),s("li",{key:n,class:q(["wl-reaction-item",{active:j}]),onClick:d=>V(n)},[v("div",nl,[v("img",{src:$,alt:p},null,8,il),u.value===n?(i(),le(w(ue),{key:0,class:"wl-reaction-loading"})):(i(),s("div",{key:1,class:"wl-reaction-votes",textContent:M(o.value[n]||0)},null,8,ol))]),v("div",{class:"wl-reaction-text",textContent:M(p)},null,8,rl)],10,al))),128))])])):x("v-if",!0)}}),ve=(e,a)=>{const l=e.__vccOpts||e;for(const[t,u]of a)l[t]=u;return l},cl=ve(sl,[["__file","ArticleReaction.vue"]]);const ul=["data-index"],vl=["src","title","onClick"];var ml=ce({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e,{expose:a}){const l=e;a();let t=null;const u=L(null),o=L({}),k=L([]),_=()=>{const m=Math.floor((u.value.getBoundingClientRect().width+l.gap)/(l.columnWidth+l.gap));return m>0?m:1},b=m=>new Array(m).fill(null).map(()=>[]),I=async m=>{var A;if(m>=l.items.length)return;await ft();const j=Array.from(((A=u.value)==null?void 0:A.children)||[]).reduce(($,p)=>p.getBoundingClientRect().height<$.getBoundingClientRect().height?p:$);k.value[Number(j.dataset.index)].push(m),await I(m+1)},C=async(m=!1)=>{if(k.value.length===_()&&!m)return;k.value=b(_());const A=window.scrollY;await I(0),window.scrollTo({top:A})},V=m=>{o.value[m.target.src]=!0};return ge(()=>{C(!0),t=new ResizeObserver(()=>{C()}),t.observe(u.value),te(()=>[l.items],()=>{o.value={},C(!0)}),te(()=>[l.columnWidth,l.gap],()=>{C()})}),ht(()=>t.unobserve(u.value)),(m,A)=>(i(),s("div",{ref_key:"wall",ref:u,class:"wl-gallery",style:Ne({gap:`${m.gap}px`})},[(i(!0),s(D,null,J(k.value,(j,$)=>(i(),s("div",{key:$,class:"wl-gallery-column","data-index":$,style:Ne({gap:`${m.gap}px`})},[(i(!0),s(D,null,J(j,p=>(i(),s(D,{key:p},[o.value[m.items[p].src]?x("v-if",!0):(i(),le(w(ue),{key:0,size:36,style:{margin:"20px auto"}})),v("img",{class:"wl-gallery-item",src:m.items[p].src,title:m.items[p].title,loading:"lazy",onLoad:V,onClick:n=>m.$emit("insert",`![](${m.items[p].src})`)},null,40,vl)],64))),128))],12,ul))),128))],4))}}),dl=ve(ml,[["__file","ImageWall.vue"]]);const pl=e=>{try{e=decodeURI(e)}catch{}return e},Xe=(e="")=>e.replace(/\/$/u,""),Je=e=>/^(https?:)?\/\//.test(e),gl=["nick","mail","link"],Ye=e=>e.filter(a=>gl.includes(a)),Qe=["//unpkg.com/@waline/emojis@1.1.0/weibo"],hl=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],fl=e=>new Promise((a,l)=>{if(e.size>128*1e3)return l(new Error("File too large! File size limit 128KB"));const t=new FileReader;t.readAsDataURL(e),t.onload=()=>{var u;return a(((u=t.result)==null?void 0:u.toString())||"")},t.onerror=l}),yl=e=>e===!0?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',wl=e=>{const a=async(l,t={})=>fetch(`https://api.giphy.com/v1/gifs/${l}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...t}).toString()}`).then(u=>u.json()).then(({data:u})=>u.map(o=>({title:o.title,src:o.images.downsized_medium.url})));return{search:l=>a("search",{q:l,offset:"0"}),default:()=>a("trending",{}),more:(l,t=0)=>a("search",{q:l,offset:t.toString()})}},kl=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,bl=/</,Cl=/(?:^|\s)\/\/(.+?)$/gm,$l=/\/\*([\S\s]*?)\*\//gm,Ll=new RegExp(`(${kl.source}|${bl.source})|((?:${Cl.source})|(?:${$l.source}))`,"gmi"),et=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],$e={},Il=e=>{let a=0;return e.replace(Ll,(l,t,u)=>{if(u)return`<span style="color: slategray">${u}</span>`;if(t==="<")return"&lt;";let o;$e[t]?o=$e[t]:(o=et[a],$e[t]=o);const k=`<span style="color: #${o}">${t}</span>`;return a=++a%et.length,k})},xl=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],ne=e=>Object.fromEntries(e.map((a,l)=>[xl[l],a]));var tt=ne(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words!
Current word number: $2`,"Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest","What do you think?"]),lt=ne(["Pseudo","Le pseudo ne peut pas faire moins de 3 octets.","E-mail","Veuillez confirmer votre adresse e-mail.","Site Web","Optionnel","Commentez ici...","Aucun commentaire pour l'instant.","Envoyer","J'aime","Annuler le j'aime","Répondre","Annuler la réponse","Commentaires","Actualiser","Charger plus...","Aperçu","Emoji","Télécharger une image","Il y a quelques secondes","Il y a quelques minutes","Il y a quelques heures","Il y a quelques jours","À l'instant","Téléchargement en cours","Connexion","Déconnexion","Admin","Épinglé","Mots",`Veuillez saisir des commentaires entre $0 et $1 mots !

@@ -10,3 +10,3 @@ Nombre actuel de mots : $2`,"Anonyme","Nains","Hobbits","Ents","Mages","Elfes","Maïar","GIF","Rechercher un GIF","Profil","Approuvé","En attente","Indésirable","Détacher","Le plus ancien","Dernier","Le plus populaire","Qu'en pensez-vous ?"]),at=ne(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません!

目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const rt="en-US",Le={zh:ot,"zh-cn":ot,"zh-tw":Rl,en:tt,"en-us":tt,fr:lt,"fr-fr":lt,jp:at,"jp-jp":at,"pt-br":El,ru:nt,"ru-ru":nt,vi:it,"vi-vn":it},Ml=e=>Le[e.toLowerCase()]||Le[rt],_l=e=>Object.keys(Le).includes(e.toLowerCase())?e:rt,Al=e=>{const a=Xe(e);return Je(a)?a:`https://${a}`},Sl=e=>Array.isArray(e)?e:e?[0,e]:!1,Ie=(e,a)=>typeof e=="function"?e:e===!1?!1:a,jl=({serverURL:e,path:a=location.pathname,lang:l=typeof navigator>"u"?"en-US":navigator.language,locale:t,emoji:u=Qe,meta:o=["nick","mail","link"],requiredMeta:k=[],dark:_=!1,pageSize:b=10,wordLimit:I,imageUploader:C,highlighter:V,texRenderer:m,copyright:A=!0,login:j="enable",search:$,reaction:p,recaptchaV3Key:n="",turnstileKey:d="",commentSorting:F="latest",...B})=>({serverURL:Al(e),path:pl(a),lang:_l(l),locale:{...Ml(l),...typeof t=="object"?t:{}},wordLimit:Sl(I),meta:Ye(o),requiredMeta:Ye(k),imageUploader:Ie(C,fl),highlighter:Ie(V,Il),texRenderer:Ie(m,yl),dark:_,emoji:typeof u=="boolean"?u?Qe:[]:u,pageSize:b,login:j,copyright:A,search:$===!1?!1:typeof $=="object"?$:wl(l),recaptchaV3Key:n,turnstileKey:d,reaction:Array.isArray(p)?p:p===!0?hl:[],commentSorting:F,...B}),xe=e=>typeof e=="string",Ee="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bg-color:#1e1e1e;--waline-bg-color-light:#272727;--waline-bg-color-hover: #444;--waline-border-color:#333;--waline-disable-bg-color:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bg-color:#272727;--waline-info-color:#666}",zl=e=>xe(e)?e==="auto"?`@media(prefers-color-scheme:dark){body${Ee}}`:`${e}${Ee}`:e===!0?`:root${Ee}`:"",Re=(e,a)=>{let l=e.toString();for(;l.length<a;)l="0"+l;return l},Ul=e=>{const a=Re(e.getDate(),2),l=Re(e.getMonth()+1,2);return`${Re(e.getFullYear(),2)}-${l}-${a}`},Vl=(e,a,l)=>{if(!e)return"";const t=xe(e)?new Date(e.indexOf(" ")!==-1?e.replace(/-/g,"/"):e):e,u=a.getTime()-t.getTime(),o=Math.floor(u/(24*3600*1e3));if(o===0){const k=u%864e5,_=Math.floor(k/(3600*1e3));if(_===0){const b=k%36e5,I=Math.floor(b/(60*1e3));if(I===0){const C=b%6e4;return`${Math.round(C/1e3)} ${l.seconds}`}return`${I} ${l.minutes}`}return`${_} ${l.hours}`}return o<0?l.now:o<8?`${o} ${l.days}`:Ul(t)},Hl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Tl=e=>Hl.test(e),Fl=e=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(e),Nl=e=>{const a=re("WALINE_EMOJI",{}),l=Fl(e);if(l){const t=a.value[e];if(t)return Promise.resolve(t)}return fetch(`${e}/info.json`).then(t=>t.json()).then(t=>{const u={folder:e,...t};return l&&(a.value[e]=u),u})},st=(e,a="",l="",t="")=>`${a?`${a}/`:""}${l}${e}${t?`.${t}`:""}`,Wl=e=>Promise.all(e.map(a=>xe(a)?Nl(Xe(a)):Promise.resolve(a))).then(a=>{const l={tabs:[],map:{}};return a.forEach(t=>{const{name:u,folder:o,icon:k,prefix:_,type:b,items:I}=t;l.tabs.push({name:u,icon:st(k,o,_,b),items:I.map(C=>{const V=`${_||""}${C}`;return l.map[V]=st(C,o,_,b),V})})}),l}),Dl=e=>e.type.includes("image"),ct=e=>{const a=Array.from(e).find(Dl);return a?a.getAsFile():null},Bl=/\$.*?\$/,Pl=/^\$(.*?)\$/,Ol=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,ql=e=>[{name:"blockMath",level:"block",tokenizer(a){const l=Ol.exec(a);if(l!==null)return{type:"html",raw:l[0],text:e(!0,l[1])}}},{name:"inlineMath",level:"inline",start(a){const l=a.search(Bl);return l!==-1?l:a.length},tokenizer(a){const l=Pl.exec(a);if(l!==null)return{type:"html",raw:l[0],text:e(!1,l[1])}}}],ut=(e="",a={})=>e.replace(/:(.+?):/g,(l,t)=>a[t]?`<img class="wl-emoji" src="${a[t]}" alt="${t}">`:l),Gl=(e,{emojiMap:a,highlighter:l,texRenderer:t})=>{const u=new jt;if(u.setOptions({breaks:!0}),l&&u.use(zt({highlight:l})),t){const o=ql(t);u.use({extensions:o})}return u.parse(ut(e,a))},Kl=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),Zl=e=>e.match(/[\u4E00-\u9FD5]/gu),Xl=e=>{var a,l;return(((a=Kl(e))==null?void 0:a.reduce((t,u)=>t+(["",",","."].includes(u.trim())?0:u.trim().split(/\s+/u).length),0))||0)+(((l=Zl(e))==null?void 0:l.length)||0)},Jl=async()=>{if(!navigator)return"";const{userAgentData:e}=navigator;let a=navigator.userAgent;if(!e||e.platform!=="Windows")return a;const{platformVersion:l}=await e.getHighEntropyValues(["platformVersion"]);return l&&parseInt(l.split(".")[0])>=13&&(a=a.replace("Windows NT 10.0","Windows NT 11.0")),a},Yl={class:"wl-comment"},Ql={key:0,class:"wl-login-info"},ea={class:"wl-avatar"},ta=["title"],la=["title"],aa=["src"],na=["title","textContent"],ia={class:"wl-panel"},oa=["for","textContent"],ra=["id","onUpdate:modelValue","name","type"],sa=["placeholder"],ca={class:"wl-preview"},ua=v("hr",null,null,-1),va=["innerHTML"],ma={class:"wl-footer"},da={class:"wl-actions"},pa={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},ga=["title"],ha=["title"],fa=["title"],ya=["title"],wa={class:"wl-info"},ka=v("div",{class:"wl-captcha-container"},null,-1),ba={class:"wl-text-number"},Ca={key:0},$a=["textContent"],La=["textContent"],Ia=["disabled"],xa=["placeholder"],Ea={key:1,class:"wl-loading"},Ra={key:0,class:"wl-tab-wrapper"},Ma=["title","onClick"],_a=["src","alt"],Aa={key:0,class:"wl-tabs"},Sa=["onClick"],ja=["src","alt","title"],za=["title"];var Ua=ce({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{expose:a,emit:l}){const t=e,u=l;a();const o=ke("config"),k=Gt(),_=qt(),b=Ce(),I=L({}),C=L(null),V=L(null),m=L(null),A=L(null),j=L(null),$=L(null),p=L(null),n=L({tabs:[],map:{}}),d=L(0),F=L(!1),B=L(!1),E=L(!1),z=L(""),oe=L(0),H=yt({loading:!0,list:[]}),ie=L(0),ee=L(!1),me=L(""),Y=L(!1),y=L(!1),g=W(()=>o.value.locale),S=W(()=>{var c;return!!((c=b.value)!=null&&c.token)}),G=W(()=>o.value.imageUploader!==!1),P=c=>{const r=C.value,h=r.selectionStart,U=r.selectionEnd||0,f=r.scrollTop;k.value=r.value.substring(0,h)+c+r.value.substring(U,r.value.length),r.focus(),r.selectionStart=h+c.length,r.selectionEnd=h+c.length,r.scrollTop=f},X=c=>{const r=c.key;(c.ctrlKey||c.metaKey)&&r==="Enter"&&_e()},K=c=>{const r=`![${o.value.locale.uploading} ${c.name}]()`;return P(r),Y.value=!0,Promise.resolve().then(()=>o.value.imageUploader(c)).then(h=>{k.value=k.value.replace(r,`\r
![${c.name}](${h})`)}).catch(h=>{alert(h.message),k.value=k.value.replace(r,"")}).then(()=>{Y.value=!1})},se=c=>{var r;if((r=c.dataTransfer)!=null&&r.items){const h=ct(c.dataTransfer.items);h&&G.value&&(K(h),c.preventDefault())}},Me=c=>{if(c.clipboardData){const r=ct(c.clipboardData.items);r&&G.value&&K(r)}},ye=()=>{const c=V.value;c.files&&G.value&&K(c.files[0]).then(()=>{c.value=""})},_e=async()=>{var c,r,h,U,f,O;const{serverURL:N,lang:Q,login:de,wordLimit:Ve,requiredMeta:He,recaptchaV3Key:Te,turnstileKey:Fe}=o.value,gt=await Jl(),T={comment:me.value,nick:_.value.nick,mail:_.value.mail,link:_.value.link,url:o.value.path,ua:gt};if((c=b.value)!=null&&c.token&&!t.edit)T.nick=b.value.display_name,T.mail=b.value.email,T.link=b.value.url;else{if(de==="force")return;if(He.indexOf("nick")>-1&&!T.nick)return(r=I.value.nick)==null||r.focus(),alert(g.value.nickError);if(He.indexOf("mail")>-1&&!T.mail||T.mail&&!Tl(T.mail))return(h=I.value.mail)==null||h.focus(),alert(g.value.mailError);T.nick||(T.nick=g.value.anonymous)}if(!T.comment){(U=C.value)==null||U.focus();return}if(!ee.value)return alert(g.value.wordHint.replace("$0",Ve[0].toString()).replace("$1",Ve[1].toString()).replace("$2",oe.value.toString()));T.comment=ut(T.comment,n.value.map),t.replyId&&t.rootId&&(T.pid=t.replyId,T.rid=t.rootId,T.at=t.replyUser),Y.value=!0;try{Te&&(T.recaptchaV3=await Jt(Te).execute("social")),Fe&&(T.turnstile=await Yt(Fe).execute("social"));const pe={serverURL:N,lang:Q,token:(f=b.value)==null?void 0:f.token,comment:T},we=await(t.edit?fe({objectId:t.edit.objectId,...pe}):Mt(pe));if(Y.value=!1,we.errmsg)return alert(we.errmsg);u("submit",we.data),k.value="",z.value="",t.replyId&&u("cancelReply"),(O=t.edit)!=null&&O.objectId&&u("cancelEdit")}catch(pe){Y.value=!1,alert(pe.message)}},dt=c=>{c.preventDefault();const{lang:r,serverURL:h}=o.value;_t({serverURL:h,lang:r}).then(U=>{b.value=U,(U.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(U)),u("log")})},pt=()=>{b.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),u("log")},Ae=c=>{c.preventDefault();const{lang:r,serverURL:h}=o.value,U=800,f=800,O=(window.innerWidth-U)/2,N=(window.innerHeight-f)/2,Q=new URLSearchParams({lng:r,token:b.value.token}),de=window.open(`${h}/ui/profile?${Q.toString()}`,"_blank",`width=${U},height=${f},left=${O},top=${N},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);de==null||de.postMessage({type:"TOKEN",data:b.value.token},"*")},Se=c=>{var r,h,U,f;!((r=m.value)!=null&&r.contains(c.target))&&!((h=A.value)!=null&&h.contains(c.target))&&(F.value=!1),!((U=j.value)!=null&&U.contains(c.target))&&!((f=$.value)!=null&&f.contains(c.target))&&(B.value=!1)},je=async c=>{var r;const{scrollTop:h,clientHeight:U,scrollHeight:f}=c.target,O=(U+h)/f,N=o.value.search,Q=((r=p.value)==null?void 0:r.value)||"";O<.9||H.loading||y.value||(H.loading=!0,(N.more&&H.list.length?await N.more(Q,H.list.length):await N.search(Q)).length?H.list=[...H.list,...N.more&&H.list.length?await N.more(Q,H.list.length):await N.search(Q)]:y.value=!0,H.loading=!1,setTimeout(()=>{c.target.scrollTop=h},50))},ze=It(c=>{H.list=[],y.value=!1,je(c)},300);te([o,oe],([c,r])=>{const{wordLimit:h}=c;h?r<h[0]&&h[0]!==0?(ie.value=h[0],ee.value=!1):r>h[1]?(ie.value=h[1],ee.value=!1):(ie.value=h[1],ee.value=!0):(ie.value=0,ee.value=!0)},{immediate:!0});const Ue=({data:c})=>{!c||c.type!=="profile"||(b.value={...b.value,...c.data},[localStorage,sessionStorage].filter(r=>r.getItem("WALINE_USER")).forEach(r=>r.setItem("WALINE_USER",JSON.stringify(b))))};return ge(()=>{var c;document.body.addEventListener("click",Se),window.addEventListener("message",Ue),(c=t.edit)!=null&&c.objectId&&(k.value=t.edit.orig),te(B,async r=>{if(!r)return;const h=o.value.search;p.value&&(p.value.value=""),H.loading=!0,H.list=h.default?await h.default():await h.search(""),H.loading=!1}),te(()=>k.value,r=>{const{highlighter:h,texRenderer:U}=o.value;me.value=r,z.value=Gl(r,{emojiMap:n.value.map,highlighter:h,texRenderer:U}),oe.value=Xl(r),r?Be(C.value):Be.destroy(C.value)},{immediate:!0}),te(()=>o.value.emoji,r=>Wl(r).then(h=>{n.value=h}),{immediate:!0})}),be(()=>{document.body.removeEventListener("click",Se),window.removeEventListener("message",Ue)}),(c,r)=>{var h,U;return i(),s("div",Yl,[w(o).login!=="disable"&&S.value&&!((h=c.edit)!=null&&h.objectId)?(i(),s("div",Ql,[v("div",ea,[v("button",{type:"submit",class:"wl-logout-btn",title:g.value.logout,onClick:pt},[Z(w(Pe),{size:14})],8,ta),v("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:g.value.profile,onClick:Ae},[v("img",{src:w(b).avatar,alt:"avatar"},null,8,aa)],8,la)]),v("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:g.value.profile,onClick:Ae,textContent:M(w(b).display_name)},null,8,na)])):x("v-if",!0),v("div",ia,[w(o).login!=="force"&&w(o).meta.length&&!S.value?(i(),s("div",{key:0,class:q(["wl-header",`item${w(o).meta.length}`])},[(i(!0),s(D,null,J(w(o).meta,f=>(i(),s("div",{key:f,class:"wl-header-item"},[v("label",{for:`wl-${f}`,textContent:M(g.value[f]+(w(o).requiredMeta.includes(f)||!w(o).requiredMeta.length?"":`(${g.value.optional})`))},null,8,oa),he(v("input",{id:`wl-${f}`,ref_for:!0,ref:O=>{O&&(I.value[f]=O)},"onUpdate:modelValue":O=>w(_)[f]=O,class:q(["wl-input",`wl-${f}`]),name:f,type:f==="mail"?"email":"text"},null,10,ra),[[wt,w(_)[f]]])]))),128))],2)):x("v-if",!0),he(v("textarea",{id:"wl-edit",ref_key:"editorRef",ref:C,"onUpdate:modelValue":r[0]||(r[0]=f=>kt(k)?k.value=f:null),class:"wl-editor",placeholder:c.replyUser?`@${c.replyUser}`:g.value.placeholder,onKeydown:X,onDrop:se,onPaste:Me},null,40,sa),[[bt,w(k)]]),he(v("div",ca,[ua,v("h4",null,M(g.value.preview)+":",1),v("div",{class:"wl-content",innerHTML:z.value},null,8,va)],512),[[We,E.value]]),v("div",ma,[v("div",da,[v("a",pa,[Z(w(Wt))]),he(v("button",{ref_key:"emojiButtonRef",ref:m,type:"button",class:q(["wl-action",{active:F.value}]),title:g.value.emoji,onClick:r[1]||(r[1]=f=>F.value=!F.value)},[Z(w(Ht))],10,ga),[[We,n.value.tabs.length]]),w(o).search?(i(),s("button",{key:0,ref_key:"gifButtonRef",ref:j,type:"button",class:q(["wl-action",{active:B.value}]),title:g.value.gif,onClick:r[2]||(r[2]=f=>B.value=!B.value)},[Z(w(Ot))],10,ha)):x("v-if",!0),v("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:V,class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:ye},null,544),G.value?(i(),s("label",{key:1,for:"wl-image-upload",class:"wl-action",title:g.value.uploadImage},[Z(w(Tt))],8,fa)):x("v-if",!0),v("button",{type:"button",class:q(["wl-action",{active:E.value}]),title:g.value.preview,onClick:r[3]||(r[3]=f=>E.value=!E.value)},[Z(w(Nt))],10,ya)]),v("div",wa,[ka,v("div",ba,[ae(M(oe.value)+" ",1),w(o).wordLimit?(i(),s("span",Ca,[ae("  /  "),v("span",{class:q({illegal:!ee.value}),textContent:M(ie.value)},null,10,$a)])):x("v-if",!0),ae("  "+M(g.value.word),1)]),w(o).login!=="disable"&&!S.value?(i(),s("button",{key:0,type:"button",class:"wl-btn",onClick:dt,textContent:M(g.value.login)},null,8,La)):x("v-if",!0),w(o).login!=="force"||S.value?(i(),s("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:Y.value,onClick:_e},[Y.value?(i(),le(w(ue),{key:0,size:16})):(i(),s(D,{key:1},[ae(M(g.value.submit),1)],64))],8,Ia)):x("v-if",!0)]),v("div",{ref_key:"gifPopupRef",ref:$,class:q(["wl-gif-popup",{display:B.value}])},[v("input",{ref_key:"gifSearchInputRef",ref:p,type:"text",placeholder:g.value.gifSearchPlaceholder,onInput:r[4]||(r[4]=(...f)=>w(ze)&&w(ze)(...f))},null,40,xa),H.list.length?(i(),le(dl,{key:0,items:H.list,"column-width":200,gap:6,onInsert:r[5]||(r[5]=f=>P(f)),onScroll:je},null,8,["items"])):x("v-if",!0),H.loading?(i(),s("div",Ea,[Z(w(ue),{size:30})])):x("v-if",!0)],2),v("div",{ref_key:"emojiPopupRef",ref:A,class:q(["wl-emoji-popup",{display:F.value}])},[(i(!0),s(D,null,J(n.value.tabs,(f,O)=>(i(),s(D,{key:f.name},[O===d.value?(i(),s("div",Ra,[(i(!0),s(D,null,J(f.items,N=>(i(),s("button",{key:N,type:"button",title:N,onClick:Q=>P(`:${N}:`)},[F.value?(i(),s("img",{key:0,class:"wl-emoji",src:n.value.map[N],alt:N,loading:"lazy",referrerPolicy:"no-referrer"},null,8,_a)):x("v-if",!0)],8,Ma))),128))])):x("v-if",!0)],64))),128)),n.value.tabs.length>1?(i(),s("div",Aa,[(i(!0),s(D,null,J(n.value.tabs,(f,O)=>(i(),s("button",{key:f.name,type:"button",class:q(["wl-tab",{active:d.value===O}]),onClick:N=>d.value=O},[v("img",{class:"wl-emoji",src:f.icon,alt:f.name,title:f.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,ja)],10,Sa))),128))])):x("v-if",!0)],2)])]),c.replyId||(U=c.edit)!=null&&U.objectId?(i(),s("button",{key:1,type:"button",class:"wl-close",title:g.value.cancelReply,onClick:r[6]||(r[6]=f=>c.$emit(c.replyId?"cancelReply":"cancelEdit"))},[Z(w(Pe),{size:24})],8,za)):x("v-if",!0)])}}}),vt=ve(Ua,[["__file","CommentBox.vue"]]);const Va=["id"],Ha={class:"wl-user","aria-hidden":"true"},Ta=["src"],Fa={class:"wl-card"},Na={class:"wl-head"},Wa=["href"],Da={key:1,class:"wl-nick"},Ba=["textContent"],Pa=["textContent"],Oa=["textContent"],qa=["textContent"],Ga=["textContent"],Ka={class:"wl-comment-actions"},Za=["title"],Xa=["title"],Ja={class:"wl-meta","aria-hidden":"true"},Ya=["data-value","textContent"],Qa=["innerHTML"],en={key:1,class:"wl-admin-actions"},tn={class:"wl-comment-status"},ln=["disabled","onClick","textContent"],an={key:3,class:"wl-quote"};var nn=ce({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(e,{emit:a}){const l=e,t=a,u=["approved","waiting","spam"],o=ke("config"),k=qe(),_=xt(),b=Ce(),I=W(()=>o.value.locale),C=W(()=>{const{link:n}=l.comment;return n?Je(n)?n:`https://${n}`:""}),V=W(()=>k.value.includes(l.comment.objectId)),m=W(()=>Vl(new Date(l.comment.time),_.value,I.value)),A=W(()=>b.value.type==="administrator"),j=W(()=>l.comment.user_id&&b.value.objectId===l.comment.user_id),$=W(()=>{var n;return l.comment.objectId===((n=l.reply)==null?void 0:n.objectId)}),p=W(()=>{var n;return l.comment.objectId===((n=l.edit)==null?void 0:n.objectId)});return(n,d)=>{var F;const B=Ct("CommentCard",!0);return i(),s("div",{id:n.comment.objectId,class:"wl-card-item"},[v("div",Ha,[n.comment.avatar?(i(),s("img",{key:0,class:"wl-user-avatar",src:n.comment.avatar},null,8,Ta)):x("v-if",!0),n.comment.type?(i(),le(w(Pt),{key:1})):x("v-if",!0)]),v("div",Fa,[v("div",Na,[C.value?(i(),s("a",{key:0,class:"wl-nick",href:C.value,target:"_blank",rel:"nofollow noopener noreferrer"},M(n.comment.nick),9,Wa)):(i(),s("span",Da,M(n.comment.nick),1)),n.comment.type==="administrator"?(i(),s("span",{key:2,class:"wl-badge",textContent:M(I.value.admin)},null,8,Ba)):x("v-if",!0),n.comment.label?(i(),s("span",{key:3,class:"wl-badge",textContent:M(n.comment.label)},null,8,Pa)):x("v-if",!0),n.comment.sticky?(i(),s("span",{key:4,class:"wl-badge",textContent:M(I.value.sticky)},null,8,Oa)):x("v-if",!0),typeof n.comment.level=="number"?(i(),s("span",{key:5,class:q(`wl-badge level${n.comment.level}`),textContent:M(I.value[`level${n.comment.level}`]||`Level ${n.comment.level}`)},null,10,qa)):x("v-if",!0),v("span",{class:"wl-time",textContent:M(m.value)},null,8,Ga),v("div",Ka,[A.value||j.value?(i(),s(D,{key:0},[v("button",{type:"button",class:"wl-edit",onClick:d[0]||(d[0]=E=>t("edit",n.comment))},[Z(w(Bt))]),v("button",{type:"button",class:"wl-delete",onClick:d[1]||(d[1]=E=>t("delete",n.comment))},[Z(w(Vt))])],64)):x("v-if",!0),v("button",{type:"button",class:"wl-like",title:V.value?I.value.cancelLike:I.value.like,onClick:d[2]||(d[2]=E=>t("like",n.comment))},[Z(w(Ft),{active:V.value},null,8,["active"]),ae(" "+M("like"in n.comment?n.comment.like:""),1)],8,Za),v("button",{type:"button",class:q(["wl-reply",{active:$.value}]),title:$.value?I.value.cancelReply:I.value.reply,onClick:d[3]||(d[3]=E=>t("reply",$.value?null:n.comment))},[Z(w(Dt))],10,Xa)])]),v("div",Ja,[(i(),s(D,null,J(["addr","browser","os"],E=>(i(),s(D,null,[n.comment[E]?(i(),s("span",{key:E,class:q(`wl-${E}`),"data-value":n.comment[E],textContent:M(n.comment[E])},null,10,Ya)):x("v-if",!0)],64))),64))]),p.value?x("v-if",!0):(i(),s("div",{key:0,class:"wl-content",innerHTML:n.comment.comment},null,8,Qa)),A.value&&!p.value?(i(),s("div",en,[v("span",tn,[(i(),s(D,null,J(u,E=>v("button",{key:E,type:"submit",class:q(`wl-btn wl-${E}`),disabled:n.comment.status===E,onClick:z=>t("status",{status:E,comment:n.comment}),textContent:M(I.value[E])},null,10,ln)),64))]),A.value&&!("rid"in n.comment)?(i(),s("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:d[4]||(d[4]=E=>t("sticky",n.comment))},M(n.comment.sticky?I.value.unsticky:I.value.sticky),1)):x("v-if",!0)])):x("v-if",!0),$.value||p.value?(i(),s("div",{key:2,class:q({"wl-reply-wrapper":$.value,"wl-edit-wrapper":p.value})},[Z(vt,{edit:n.edit,"reply-id":(F=n.reply)==null?void 0:F.objectId,"reply-user":n.comment.nick,"root-id":n.rootId,onLog:d[5]||(d[5]=E=>t("log")),onCancelReply:d[6]||(d[6]=E=>t("reply",null)),onCancelEdit:d[7]||(d[7]=E=>t("edit",null)),onSubmit:d[8]||(d[8]=E=>t("submit",E))},null,8,["edit","reply-id","reply-user","root-id"])],2)):x("v-if",!0),"children"in n.comment?(i(),s("div",an,[(i(!0),s(D,null,J(n.comment.children,E=>(i(),le(B,{key:E.objectId,comment:E,reply:n.reply,edit:n.edit,"root-id":n.rootId,onLog:d[9]||(d[9]=z=>t("log")),onDelete:d[10]||(d[10]=z=>t("delete",z)),onEdit:d[11]||(d[11]=z=>t("edit",z)),onLike:d[12]||(d[12]=z=>t("like",z)),onReply:d[13]||(d[13]=z=>t("reply",z)),onStatus:d[14]||(d[14]=z=>t("status",z)),onSticky:d[15]||(d[15]=z=>t("sticky",z)),onSubmit:d[16]||(d[16]=z=>t("submit",z))},null,8,["comment","reply","edit","root-id"]))),128))])):x("v-if",!0)])],8,Va)}}}),on=ve(nn,[["__file","CommentCard.vue"]]);const mt="3.1.2",rn={"data-waline":""},sn={class:"wl-meta-head"},cn={class:"wl-count"},un=["textContent"],vn={class:"wl-sort"},mn=["onClick"],dn={class:"wl-cards"},pn={key:1,class:"wl-operation"},gn=["textContent"],hn={key:2,class:"wl-loading"},fn=["textContent"],yn={key:4,class:"wl-operation"},wn=["textContent"],kn={key:5,class:"wl-power"},bn=v("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);var Cn=ce({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(e){const a=e,l={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},t=Object.keys(l),u=Ce(),o=qe(),k=L("loading"),_=L(0),b=L(1),I=L(0),C=W(()=>jl(a)),V=L(C.value.commentSorting),m=L([]),A=L(null),j=L(null),$=W(()=>zl(C.value.dark)),p=W(()=>C.value.locale);Et($,{id:"waline-darkmode"});let n;const d=y=>{var g;const{serverURL:S,path:G,pageSize:P}=C.value,X=new AbortController;k.value="loading",n==null||n(),St({serverURL:S,lang:C.value.lang,path:G,pageSize:P,sortBy:l[V.value],page:y,signal:X.signal,token:(g=u.value)==null?void 0:g.token}).then(K=>{k.value="success",_.value=K.count,m.value.push(...K.data),b.value=y,I.value=K.totalPages}).catch(K=>{K.name!=="AbortError"&&(console.error(K.message),k.value="error")}),n=X.abort.bind(X)},F=()=>d(b.value+1),B=()=>{_.value=0,m.value=[],d(1)},E=y=>{V.value!==y&&(V.value=y,B())},z=y=>{A.value=y},oe=y=>{j.value=y},H=y=>{if(j.value)j.value.comment=y.comment,j.value.orig=y.orig;else if("rid"in y){const g=m.value.find(({objectId:S})=>S===y.rid);if(!g)return;Array.isArray(g.children)||(g.children=[]),g.children.push(y)}else m.value.unshift(y),_.value+=1},ie=async({comment:y,status:g})=>{var S;if(y.status===g)return;const{serverURL:G,lang:P}=C.value;await fe({serverURL:G,lang:P,token:(S=u.value)==null?void 0:S.token,objectId:y.objectId,comment:{status:g}}),y.status=g},ee=async y=>{var g;if("rid"in y)return;const{serverURL:S,lang:G}=C.value;await fe({serverURL:S,lang:G,token:(g=u.value)==null?void 0:g.token,objectId:y.objectId,comment:{sticky:y.sticky?0:1}}),y.sticky=!y.sticky},me=async({objectId:y})=>{var g;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:S,lang:G}=C.value;await At({serverURL:S,lang:G,token:(g=u.value)==null?void 0:g.token,objectId:y}),m.value.some((P,X)=>P.objectId===y?(m.value=m.value.filter((K,se)=>se!==X),!0):P.children.some((K,se)=>K.objectId===y?(m.value[X].children=P.children.filter((Me,ye)=>ye!==se),!0):!1))},Y=async y=>{var g;const{serverURL:S,lang:G}=C.value,{objectId:P}=y,X=o.value.includes(P);await fe({serverURL:S,lang:G,objectId:P,token:(g=u.value)==null?void 0:g.token,comment:{like:!X}}),X?o.value=o.value.filter(K=>K!==P):(o.value=[...o.value,P],o.value.length>50&&(o.value=o.value.slice(-50))),y.like=(y.like||0)+(X?-1:1)};return $t("config",C),ge(()=>{te(()=>[a.serverURL,a.path],()=>B(),{immediate:!0})}),be(()=>n==null?void 0:n()),(y,g)=>(i(),s("div",rn,[Z(cl),A.value?x("v-if",!0):(i(),le(vt,{key:0,onLog:B,onSubmit:H})),v("div",sn,[v("div",cn,[_.value?(i(),s("span",{key:0,class:"wl-num",textContent:M(_.value)},null,8,un)):x("v-if",!0),ae(" "+M(p.value.comment),1)]),v("ul",vn,[(i(!0),s(D,null,J(w(t),S=>(i(),s("li",{key:S,class:q([S===V.value?"active":""]),onClick:G=>E(S)},M(p.value[S]),11,mn))),128))])]),v("div",dn,[(i(!0),s(D,null,J(m.value,S=>(i(),le(on,{key:S.objectId,"root-id":S.objectId,comment:S,reply:A.value,edit:j.value,onLog:B,onReply:z,onEdit:oe,onSubmit:H,onStatus:ie,onDelete:me,onSticky:ee,onLike:Y},null,8,["root-id","comment","reply","edit"]))),128))]),k.value==="error"?(i(),s("div",pn,[v("button",{type:"button",class:"wl-btn",onClick:B,textContent:M(p.value.refresh)},null,8,gn)])):k.value==="loading"?(i(),s("div",hn,[Z(w(ue),{size:30})])):m.value.length?b.value<I.value?(i(),s("div",yn,[v("button",{type:"button",class:"wl-btn",onClick:F,textContent:M(p.value.more)},null,8,wn)])):x("v-if",!0):(i(),s("div",{key:3,class:"wl-empty",textContent:M(p.value.sofa)},null,8,fn)),C.value.copyright?(i(),s("div",kn,[ae(" Powered by "),bn,ae(" v"+M(w(mt)),1)])):x("v-if",!0)]))}}),$n=ve(Cn,[["__file","WalineComment.vue"]]);export{$n as Waline,mt as version};
![${c.name}](${h})`)}).catch(h=>{alert(h.message),k.value=k.value.replace(r,"")}).then(()=>{Y.value=!1})},se=c=>{var r;if((r=c.dataTransfer)!=null&&r.items){const h=ct(c.dataTransfer.items);h&&G.value&&(K(h),c.preventDefault())}},Me=c=>{if(c.clipboardData){const r=ct(c.clipboardData.items);r&&G.value&&K(r)}},ye=()=>{const c=V.value;c.files&&G.value&&K(c.files[0]).then(()=>{c.value=""})},_e=async()=>{var c,r,h,U,f,O;const{serverURL:N,lang:Q,login:de,wordLimit:Ve,requiredMeta:He,recaptchaV3Key:Te,turnstileKey:Fe}=o.value,gt=await Jl(),T={comment:me.value,nick:_.value.nick,mail:_.value.mail,link:_.value.link,url:o.value.path,ua:gt};if((c=b.value)!=null&&c.token&&!t.edit)T.nick=b.value.display_name,T.mail=b.value.email,T.link=b.value.url;else{if(de==="force")return;if(He.indexOf("nick")>-1&&!T.nick)return(r=I.value.nick)==null||r.focus(),alert(g.value.nickError);if(He.indexOf("mail")>-1&&!T.mail||T.mail&&!Tl(T.mail))return(h=I.value.mail)==null||h.focus(),alert(g.value.mailError);T.nick||(T.nick=g.value.anonymous)}if(!T.comment){(U=C.value)==null||U.focus();return}if(!ee.value)return alert(g.value.wordHint.replace("$0",Ve[0].toString()).replace("$1",Ve[1].toString()).replace("$2",oe.value.toString()));T.comment=ut(T.comment,n.value.map),t.replyId&&t.rootId&&(T.pid=t.replyId,T.rid=t.rootId,T.at=t.replyUser),Y.value=!0;try{Te&&(T.recaptchaV3=await Jt(Te).execute("social")),Fe&&(T.turnstile=await Yt(Fe).execute("social"));const pe={serverURL:N,lang:Q,token:(f=b.value)==null?void 0:f.token,comment:T},we=await(t.edit?fe({objectId:t.edit.objectId,...pe}):Mt(pe));if(Y.value=!1,we.errmsg)return alert(we.errmsg);u("submit",we.data),k.value="",z.value="",t.replyId&&u("cancelReply"),(O=t.edit)!=null&&O.objectId&&u("cancelEdit")}catch(pe){Y.value=!1,alert(pe.message)}},dt=c=>{c.preventDefault();const{lang:r,serverURL:h}=o.value;_t({serverURL:h,lang:r}).then(U=>{b.value=U,(U.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(U)),u("log")})},pt=()=>{b.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),u("log")},Ae=c=>{c.preventDefault();const{lang:r,serverURL:h}=o.value,U=800,f=800,O=(window.innerWidth-U)/2,N=(window.innerHeight-f)/2,Q=new URLSearchParams({lng:r,token:b.value.token}),de=window.open(`${h}/ui/profile?${Q.toString()}`,"_blank",`width=${U},height=${f},left=${O},top=${N},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);de==null||de.postMessage({type:"TOKEN",data:b.value.token},"*")},Se=c=>{var r,h,U,f;!((r=m.value)!=null&&r.contains(c.target))&&!((h=A.value)!=null&&h.contains(c.target))&&(F.value=!1),!((U=j.value)!=null&&U.contains(c.target))&&!((f=$.value)!=null&&f.contains(c.target))&&(B.value=!1)},je=async c=>{var r;const{scrollTop:h,clientHeight:U,scrollHeight:f}=c.target,O=(U+h)/f,N=o.value.search,Q=((r=p.value)==null?void 0:r.value)||"";O<.9||H.loading||y.value||(H.loading=!0,(N.more&&H.list.length?await N.more(Q,H.list.length):await N.search(Q)).length?H.list=[...H.list,...N.more&&H.list.length?await N.more(Q,H.list.length):await N.search(Q)]:y.value=!0,H.loading=!1,setTimeout(()=>{c.target.scrollTop=h},50))},ze=It(c=>{H.list=[],y.value=!1,je(c)},300);te([o,oe],([c,r])=>{const{wordLimit:h}=c;h?r<h[0]&&h[0]!==0?(ie.value=h[0],ee.value=!1):r>h[1]?(ie.value=h[1],ee.value=!1):(ie.value=h[1],ee.value=!0):(ie.value=0,ee.value=!0)},{immediate:!0});const Ue=({data:c})=>{!c||c.type!=="profile"||(b.value={...b.value,...c.data},[localStorage,sessionStorage].filter(r=>r.getItem("WALINE_USER")).forEach(r=>r.setItem("WALINE_USER",JSON.stringify(b))))};return ge(()=>{var c;document.body.addEventListener("click",Se),window.addEventListener("message",Ue),(c=t.edit)!=null&&c.objectId&&(k.value=t.edit.orig),te(B,async r=>{if(!r)return;const h=o.value.search;p.value&&(p.value.value=""),H.loading=!0,H.list=h.default?await h.default():await h.search(""),H.loading=!1}),te(()=>k.value,r=>{const{highlighter:h,texRenderer:U}=o.value;me.value=r,z.value=Gl(r,{emojiMap:n.value.map,highlighter:h,texRenderer:U}),oe.value=Xl(r),r?Be(C.value):Be.destroy(C.value)},{immediate:!0}),te(()=>o.value.emoji,r=>Wl(r).then(h=>{n.value=h}),{immediate:!0})}),be(()=>{document.body.removeEventListener("click",Se),window.removeEventListener("message",Ue)}),(c,r)=>{var h,U;return i(),s("div",Yl,[w(o).login!=="disable"&&S.value&&!((h=c.edit)!=null&&h.objectId)?(i(),s("div",Ql,[v("div",ea,[v("button",{type:"submit",class:"wl-logout-btn",title:g.value.logout,onClick:pt},[Z(w(Pe),{size:14})],8,ta),v("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:g.value.profile,onClick:Ae},[v("img",{src:w(b).avatar,alt:"avatar"},null,8,aa)],8,la)]),v("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:g.value.profile,onClick:Ae,textContent:M(w(b).display_name)},null,8,na)])):x("v-if",!0),v("div",ia,[w(o).login!=="force"&&w(o).meta.length&&!S.value?(i(),s("div",{key:0,class:q(["wl-header",`item${w(o).meta.length}`])},[(i(!0),s(D,null,J(w(o).meta,f=>(i(),s("div",{key:f,class:"wl-header-item"},[v("label",{for:`wl-${f}`,textContent:M(g.value[f]+(w(o).requiredMeta.includes(f)||!w(o).requiredMeta.length?"":`(${g.value.optional})`))},null,8,oa),he(v("input",{id:`wl-${f}`,ref_for:!0,ref:O=>{O&&(I.value[f]=O)},"onUpdate:modelValue":O=>w(_)[f]=O,class:q(["wl-input",`wl-${f}`]),name:f,type:f==="mail"?"email":"text"},null,10,ra),[[wt,w(_)[f]]])]))),128))],2)):x("v-if",!0),he(v("textarea",{id:"wl-edit",ref_key:"editorRef",ref:C,"onUpdate:modelValue":r[0]||(r[0]=f=>kt(k)?k.value=f:null),class:"wl-editor",placeholder:c.replyUser?`@${c.replyUser}`:g.value.placeholder,onKeydown:X,onDrop:se,onPaste:Me},null,40,sa),[[bt,w(k)]]),he(v("div",ca,[ua,v("h4",null,M(g.value.preview)+":",1),v("div",{class:"wl-content",innerHTML:z.value},null,8,va)],512),[[We,E.value]]),v("div",ma,[v("div",da,[v("a",pa,[Z(w(Wt))]),he(v("button",{ref_key:"emojiButtonRef",ref:m,type:"button",class:q(["wl-action",{active:F.value}]),title:g.value.emoji,onClick:r[1]||(r[1]=f=>F.value=!F.value)},[Z(w(Ht))],10,ga),[[We,n.value.tabs.length]]),w(o).search?(i(),s("button",{key:0,ref_key:"gifButtonRef",ref:j,type:"button",class:q(["wl-action",{active:B.value}]),title:g.value.gif,onClick:r[2]||(r[2]=f=>B.value=!B.value)},[Z(w(Ot))],10,ha)):x("v-if",!0),v("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:V,class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:ye},null,544),G.value?(i(),s("label",{key:1,for:"wl-image-upload",class:"wl-action",title:g.value.uploadImage},[Z(w(Tt))],8,fa)):x("v-if",!0),v("button",{type:"button",class:q(["wl-action",{active:E.value}]),title:g.value.preview,onClick:r[3]||(r[3]=f=>E.value=!E.value)},[Z(w(Nt))],10,ya)]),v("div",wa,[ka,v("div",ba,[ae(M(oe.value)+" ",1),w(o).wordLimit?(i(),s("span",Ca,[ae("  /  "),v("span",{class:q({illegal:!ee.value}),textContent:M(ie.value)},null,10,$a)])):x("v-if",!0),ae("  "+M(g.value.word),1)]),w(o).login!=="disable"&&!S.value?(i(),s("button",{key:0,type:"button",class:"wl-btn",onClick:dt,textContent:M(g.value.login)},null,8,La)):x("v-if",!0),w(o).login!=="force"||S.value?(i(),s("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:Y.value,onClick:_e},[Y.value?(i(),le(w(ue),{key:0,size:16})):(i(),s(D,{key:1},[ae(M(g.value.submit),1)],64))],8,Ia)):x("v-if",!0)]),v("div",{ref_key:"gifPopupRef",ref:$,class:q(["wl-gif-popup",{display:B.value}])},[v("input",{ref_key:"gifSearchInputRef",ref:p,type:"text",placeholder:g.value.gifSearchPlaceholder,onInput:r[4]||(r[4]=(...f)=>w(ze)&&w(ze)(...f))},null,40,xa),H.list.length?(i(),le(dl,{key:0,items:H.list,"column-width":200,gap:6,onInsert:r[5]||(r[5]=f=>P(f)),onScroll:je},null,8,["items"])):x("v-if",!0),H.loading?(i(),s("div",Ea,[Z(w(ue),{size:30})])):x("v-if",!0)],2),v("div",{ref_key:"emojiPopupRef",ref:A,class:q(["wl-emoji-popup",{display:F.value}])},[(i(!0),s(D,null,J(n.value.tabs,(f,O)=>(i(),s(D,{key:f.name},[O===d.value?(i(),s("div",Ra,[(i(!0),s(D,null,J(f.items,N=>(i(),s("button",{key:N,type:"button",title:N,onClick:Q=>P(`:${N}:`)},[F.value?(i(),s("img",{key:0,class:"wl-emoji",src:n.value.map[N],alt:N,loading:"lazy",referrerPolicy:"no-referrer"},null,8,_a)):x("v-if",!0)],8,Ma))),128))])):x("v-if",!0)],64))),128)),n.value.tabs.length>1?(i(),s("div",Aa,[(i(!0),s(D,null,J(n.value.tabs,(f,O)=>(i(),s("button",{key:f.name,type:"button",class:q(["wl-tab",{active:d.value===O}]),onClick:N=>d.value=O},[v("img",{class:"wl-emoji",src:f.icon,alt:f.name,title:f.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,ja)],10,Sa))),128))])):x("v-if",!0)],2)])]),c.replyId||(U=c.edit)!=null&&U.objectId?(i(),s("button",{key:1,type:"button",class:"wl-close",title:g.value.cancelReply,onClick:r[6]||(r[6]=f=>c.$emit(c.replyId?"cancelReply":"cancelEdit"))},[Z(w(Pe),{size:24})],8,za)):x("v-if",!0)])}}}),vt=ve(Ua,[["__file","CommentBox.vue"]]);const Va=["id"],Ha={class:"wl-user","aria-hidden":"true"},Ta=["src"],Fa={class:"wl-card"},Na={class:"wl-head"},Wa=["href"],Da={key:1,class:"wl-nick"},Ba=["textContent"],Pa=["textContent"],Oa=["textContent"],qa=["textContent"],Ga=["textContent"],Ka={class:"wl-comment-actions"},Za=["title"],Xa=["title"],Ja={class:"wl-meta","aria-hidden":"true"},Ya=["data-value","textContent"],Qa=["innerHTML"],en={key:1,class:"wl-admin-actions"},tn={class:"wl-comment-status"},ln=["disabled","onClick","textContent"],an={key:3,class:"wl-quote"};var nn=ce({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(e,{emit:a}){const l=e,t=a,u=["approved","waiting","spam"],o=ke("config"),k=qe(),_=xt(),b=Ce(),I=W(()=>o.value.locale),C=W(()=>{const{link:n}=l.comment;return n?Je(n)?n:`https://${n}`:""}),V=W(()=>k.value.includes(l.comment.objectId)),m=W(()=>Vl(new Date(l.comment.time),_.value,I.value)),A=W(()=>b.value.type==="administrator"),j=W(()=>l.comment.user_id&&b.value.objectId===l.comment.user_id),$=W(()=>{var n;return l.comment.objectId===((n=l.reply)==null?void 0:n.objectId)}),p=W(()=>{var n;return l.comment.objectId===((n=l.edit)==null?void 0:n.objectId)});return(n,d)=>{var F;const B=Ct("CommentCard",!0);return i(),s("div",{id:n.comment.objectId,class:"wl-card-item"},[v("div",Ha,[n.comment.avatar?(i(),s("img",{key:0,class:"wl-user-avatar",src:n.comment.avatar},null,8,Ta)):x("v-if",!0),n.comment.type?(i(),le(w(Pt),{key:1})):x("v-if",!0)]),v("div",Fa,[v("div",Na,[C.value?(i(),s("a",{key:0,class:"wl-nick",href:C.value,target:"_blank",rel:"nofollow noopener noreferrer"},M(n.comment.nick),9,Wa)):(i(),s("span",Da,M(n.comment.nick),1)),n.comment.type==="administrator"?(i(),s("span",{key:2,class:"wl-badge",textContent:M(I.value.admin)},null,8,Ba)):x("v-if",!0),n.comment.label?(i(),s("span",{key:3,class:"wl-badge",textContent:M(n.comment.label)},null,8,Pa)):x("v-if",!0),n.comment.sticky?(i(),s("span",{key:4,class:"wl-badge",textContent:M(I.value.sticky)},null,8,Oa)):x("v-if",!0),typeof n.comment.level=="number"?(i(),s("span",{key:5,class:q(`wl-badge level${n.comment.level}`),textContent:M(I.value[`level${n.comment.level}`]||`Level ${n.comment.level}`)},null,10,qa)):x("v-if",!0),v("span",{class:"wl-time",textContent:M(m.value)},null,8,Ga),v("div",Ka,[A.value||j.value?(i(),s(D,{key:0},[v("button",{type:"button",class:"wl-edit",onClick:d[0]||(d[0]=E=>t("edit",n.comment))},[Z(w(Bt))]),v("button",{type:"button",class:"wl-delete",onClick:d[1]||(d[1]=E=>t("delete",n.comment))},[Z(w(Vt))])],64)):x("v-if",!0),v("button",{type:"button",class:"wl-like",title:V.value?I.value.cancelLike:I.value.like,onClick:d[2]||(d[2]=E=>t("like",n.comment))},[Z(w(Ft),{active:V.value},null,8,["active"]),ae(" "+M("like"in n.comment?n.comment.like:""),1)],8,Za),v("button",{type:"button",class:q(["wl-reply",{active:$.value}]),title:$.value?I.value.cancelReply:I.value.reply,onClick:d[3]||(d[3]=E=>t("reply",$.value?null:n.comment))},[Z(w(Dt))],10,Xa)])]),v("div",Ja,[(i(),s(D,null,J(["addr","browser","os"],E=>(i(),s(D,null,[n.comment[E]?(i(),s("span",{key:E,class:q(`wl-${E}`),"data-value":n.comment[E],textContent:M(n.comment[E])},null,10,Ya)):x("v-if",!0)],64))),64))]),p.value?x("v-if",!0):(i(),s("div",{key:0,class:"wl-content",innerHTML:n.comment.comment},null,8,Qa)),A.value&&!p.value?(i(),s("div",en,[v("span",tn,[(i(),s(D,null,J(u,E=>v("button",{key:E,type:"submit",class:q(`wl-btn wl-${E}`),disabled:n.comment.status===E,onClick:z=>t("status",{status:E,comment:n.comment}),textContent:M(I.value[E])},null,10,ln)),64))]),A.value&&!("rid"in n.comment)?(i(),s("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:d[4]||(d[4]=E=>t("sticky",n.comment))},M(n.comment.sticky?I.value.unsticky:I.value.sticky),1)):x("v-if",!0)])):x("v-if",!0),$.value||p.value?(i(),s("div",{key:2,class:q({"wl-reply-wrapper":$.value,"wl-edit-wrapper":p.value})},[Z(vt,{edit:n.edit,"reply-id":(F=n.reply)==null?void 0:F.objectId,"reply-user":n.comment.nick,"root-id":n.rootId,onLog:d[5]||(d[5]=E=>t("log")),onCancelReply:d[6]||(d[6]=E=>t("reply",null)),onCancelEdit:d[7]||(d[7]=E=>t("edit",null)),onSubmit:d[8]||(d[8]=E=>t("submit",E))},null,8,["edit","reply-id","reply-user","root-id"])],2)):x("v-if",!0),"children"in n.comment?(i(),s("div",an,[(i(!0),s(D,null,J(n.comment.children,E=>(i(),le(B,{key:E.objectId,comment:E,reply:n.reply,edit:n.edit,"root-id":n.rootId,onLog:d[9]||(d[9]=z=>t("log")),onDelete:d[10]||(d[10]=z=>t("delete",z)),onEdit:d[11]||(d[11]=z=>t("edit",z)),onLike:d[12]||(d[12]=z=>t("like",z)),onReply:d[13]||(d[13]=z=>t("reply",z)),onStatus:d[14]||(d[14]=z=>t("status",z)),onSticky:d[15]||(d[15]=z=>t("sticky",z)),onSubmit:d[16]||(d[16]=z=>t("submit",z))},null,8,["comment","reply","edit","root-id"]))),128))])):x("v-if",!0)])],8,Va)}}}),on=ve(nn,[["__file","CommentCard.vue"]]);const mt="3.1.3",rn={"data-waline":""},sn={class:"wl-meta-head"},cn={class:"wl-count"},un=["textContent"],vn={class:"wl-sort"},mn=["onClick"],dn={class:"wl-cards"},pn={key:1,class:"wl-operation"},gn=["textContent"],hn={key:2,class:"wl-loading"},fn=["textContent"],yn={key:4,class:"wl-operation"},wn=["textContent"],kn={key:5,class:"wl-power"},bn=v("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);var Cn=ce({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(e){const a=e,l={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},t=Object.keys(l),u=Ce(),o=qe(),k=L("loading"),_=L(0),b=L(1),I=L(0),C=W(()=>jl(a)),V=L(C.value.commentSorting),m=L([]),A=L(null),j=L(null),$=W(()=>zl(C.value.dark)),p=W(()=>C.value.locale);Et($,{id:"waline-darkmode"});let n;const d=y=>{var g;const{serverURL:S,path:G,pageSize:P}=C.value,X=new AbortController;k.value="loading",n==null||n(),St({serverURL:S,lang:C.value.lang,path:G,pageSize:P,sortBy:l[V.value],page:y,signal:X.signal,token:(g=u.value)==null?void 0:g.token}).then(K=>{k.value="success",_.value=K.count,m.value.push(...K.data),b.value=y,I.value=K.totalPages}).catch(K=>{K.name!=="AbortError"&&(console.error(K.message),k.value="error")}),n=X.abort.bind(X)},F=()=>d(b.value+1),B=()=>{_.value=0,m.value=[],d(1)},E=y=>{V.value!==y&&(V.value=y,B())},z=y=>{A.value=y},oe=y=>{j.value=y},H=y=>{if(j.value)j.value.comment=y.comment,j.value.orig=y.orig;else if("rid"in y){const g=m.value.find(({objectId:S})=>S===y.rid);if(!g)return;Array.isArray(g.children)||(g.children=[]),g.children.push(y)}else m.value.unshift(y),_.value+=1},ie=async({comment:y,status:g})=>{var S;if(y.status===g)return;const{serverURL:G,lang:P}=C.value;await fe({serverURL:G,lang:P,token:(S=u.value)==null?void 0:S.token,objectId:y.objectId,comment:{status:g}}),y.status=g},ee=async y=>{var g;if("rid"in y)return;const{serverURL:S,lang:G}=C.value;await fe({serverURL:S,lang:G,token:(g=u.value)==null?void 0:g.token,objectId:y.objectId,comment:{sticky:y.sticky?0:1}}),y.sticky=!y.sticky},me=async({objectId:y})=>{var g;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:S,lang:G}=C.value;await At({serverURL:S,lang:G,token:(g=u.value)==null?void 0:g.token,objectId:y}),m.value.some((P,X)=>P.objectId===y?(m.value=m.value.filter((K,se)=>se!==X),!0):P.children.some((K,se)=>K.objectId===y?(m.value[X].children=P.children.filter((Me,ye)=>ye!==se),!0):!1))},Y=async y=>{var g;const{serverURL:S,lang:G}=C.value,{objectId:P}=y,X=o.value.includes(P);await fe({serverURL:S,lang:G,objectId:P,token:(g=u.value)==null?void 0:g.token,comment:{like:!X}}),X?o.value=o.value.filter(K=>K!==P):(o.value=[...o.value,P],o.value.length>50&&(o.value=o.value.slice(-50))),y.like=(y.like||0)+(X?-1:1)};return $t("config",C),ge(()=>{te(()=>[a.serverURL,a.path],()=>B(),{immediate:!0})}),be(()=>n==null?void 0:n()),(y,g)=>(i(),s("div",rn,[Z(cl),A.value?x("v-if",!0):(i(),le(vt,{key:0,onLog:B,onSubmit:H})),v("div",sn,[v("div",cn,[_.value?(i(),s("span",{key:0,class:"wl-num",textContent:M(_.value)},null,8,un)):x("v-if",!0),ae(" "+M(p.value.comment),1)]),v("ul",vn,[(i(!0),s(D,null,J(w(t),S=>(i(),s("li",{key:S,class:q([S===V.value?"active":""]),onClick:G=>E(S)},M(p.value[S]),11,mn))),128))])]),v("div",dn,[(i(!0),s(D,null,J(m.value,S=>(i(),le(on,{key:S.objectId,"root-id":S.objectId,comment:S,reply:A.value,edit:j.value,onLog:B,onReply:z,onEdit:oe,onSubmit:H,onStatus:ie,onDelete:me,onSticky:ee,onLike:Y},null,8,["root-id","comment","reply","edit"]))),128))]),k.value==="error"?(i(),s("div",pn,[v("button",{type:"button",class:"wl-btn",onClick:B,textContent:M(p.value.refresh)},null,8,gn)])):k.value==="loading"?(i(),s("div",hn,[Z(w(ue),{size:30})])):m.value.length?b.value<I.value?(i(),s("div",yn,[v("button",{type:"button",class:"wl-btn",onClick:F,textContent:M(p.value.more)},null,8,wn)])):x("v-if",!0):(i(),s("div",{key:3,class:"wl-empty",textContent:M(p.value.sofa)},null,8,fn)),C.value.copyright?(i(),s("div",kn,[ae(" Powered by "),bn,ae(" v"+M(w(mt)),1)])):x("v-if",!0)]))}}),$n=ve(Cn,[["__file","WalineComment.vue"]]);export{$n as Waline,mt as version};
//# sourceMappingURL=component.js.map

@@ -1,2 +0,2 @@

const v="3.1.2",f={"Content-Type":"application/json"},g=e=>`${e.replace(/\/?$/,"/")}api/`,u=(e,t="")=>{if(typeof e=="object"&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},$=({serverURL:e,lang:t,paths:r,type:a,signal:o})=>fetch(`${g(e)}article?path=${encodeURIComponent(r.join(","))}&type=${encodeURIComponent(a.join(","))}&lang=${t}`,{signal:o}).then(n=>n.json()).then(n=>u(n,"Get counter").data),R=({serverURL:e,lang:t,path:r,type:a,action:o})=>fetch(`${g(e)}article?lang=${t}`,{method:"POST",headers:f,body:JSON.stringify({path:r,type:a,action:o})}).then(n=>n.json()).then(n=>u(n,"Update counter").data),U=({serverURL:e,lang:t,paths:r,signal:a})=>$({serverURL:e,lang:t,paths:r,type:["time"],signal:a}),w=e=>R({...e,type:"time",action:"inc"}),L=(e="")=>e.replace(/\/$/u,""),b=e=>/^(https?:)?\/\//.test(e),d=e=>{const t=L(e);return b(t)?t:`https://${t}`},j=e=>{e.name!=="AbortError"&&console.error(e.message)},m=e=>e.dataset.path||null,y=(e,t)=>{t.forEach((r,a)=>{const o=e[a].time;typeof o=="number"&&(r.innerText=o.toString())})},S=({serverURL:e,path:t=window.location.pathname,selector:r=".waline-pageview-count",update:a=!0,lang:o=navigator.language})=>{const n=new AbortController,l=Array.from(document.querySelectorAll(r)),p=i=>{const s=m(i);return s!==null&&t!==s},h=i=>U({serverURL:d(e),paths:i.map(s=>m(s)||t),lang:o,signal:n.signal}).then(s=>y(s,i)).catch(j);if(a){const i=l.filter(c=>!p(c)),s=l.filter(p);w({serverURL:d(e),path:t,lang:o}).then(c=>y(c,i)),s.length&&h(s)}else h(l);return n.abort.bind(n)};export{S as pageviewCount,v as version};
const v="3.1.3",f={"Content-Type":"application/json"},g=e=>`${e.replace(/\/?$/,"/")}api/`,u=(e,t="")=>{if(typeof e=="object"&&e.errno)throw new TypeError(`${t} failed with ${e.errno}: ${e.errmsg}`);return e},$=({serverURL:e,lang:t,paths:r,type:a,signal:o})=>fetch(`${g(e)}article?path=${encodeURIComponent(r.join(","))}&type=${encodeURIComponent(a.join(","))}&lang=${t}`,{signal:o}).then(n=>n.json()).then(n=>u(n,"Get counter").data),R=({serverURL:e,lang:t,path:r,type:a,action:o})=>fetch(`${g(e)}article?lang=${t}`,{method:"POST",headers:f,body:JSON.stringify({path:r,type:a,action:o})}).then(n=>n.json()).then(n=>u(n,"Update counter").data),U=({serverURL:e,lang:t,paths:r,signal:a})=>$({serverURL:e,lang:t,paths:r,type:["time"],signal:a}),w=e=>R({...e,type:"time",action:"inc"}),L=(e="")=>e.replace(/\/$/u,""),b=e=>/^(https?:)?\/\//.test(e),d=e=>{const t=L(e);return b(t)?t:`https://${t}`},j=e=>{e.name!=="AbortError"&&console.error(e.message)},m=e=>e.dataset.path||null,y=(e,t)=>{t.forEach((r,a)=>{const o=e[a].time;typeof o=="number"&&(r.innerText=o.toString())})},S=({serverURL:e,path:t=window.location.pathname,selector:r=".waline-pageview-count",update:a=!0,lang:o=navigator.language})=>{const n=new AbortController,l=Array.from(document.querySelectorAll(r)),p=i=>{const s=m(i);return s!==null&&t!==s},h=i=>U({serverURL:d(e),paths:i.map(s=>m(s)||t),lang:o,signal:n.signal}).then(s=>y(s,i)).catch(j);if(a){const i=l.filter(c=>!p(c)),s=l.filter(p);w({serverURL:d(e),path:t,lang:o}).then(c=>y(c,i)),s.length&&h(s)}else h(l);return n.abort.bind(n)};export{S as pageviewCount,v as version};
//# sourceMappingURL=pageview.js.map

@@ -1,2 +0,2 @@

import{fetchCommentCount as xt,getArticleCounter as Rt,updateArticleCounter as Be,updateComment as he,addComment as At,login as Mt,deleteComment as Ut,getComment as St,updatePageview as _t,getPageview as jt,getRecentComment as zt,getUserList as Vt}from"@waline/api";export*from"@waline/api";import{h as A,defineComponent as ue,inject as Le,ref as I,computed as W,onMounted as fe,watch as te,onUnmounted as Ee,openBlock as r,createElementBlock as u,createElementVNode as h,toDisplayString as U,Fragment as P,renderList as J,normalizeClass as q,createBlock as le,unref as L,createCommentVNode as x,onBeforeUnmount as Ht,normalizeStyle as Oe,nextTick as Tt,reactive as Ie,createVNode as Z,withDirectives as we,vModelDynamic as Ft,isRef as Nt,vModelText as Wt,vShow as qe,createTextVNode as ae,resolveComponent as Pt,provide as Dt,createApp as Bt,watchEffect as Ge}from"vue";import{useStorage as re,useScriptTag as Ot,useDebounceFn as qt,useNow as Gt,useStyleTag as Kt}from"@vueuse/core";import Ke from"autosize";import{Marked as Zt}from"marked";import{markedHighlight as Xt}from"marked-highlight";import{load as Jt}from"recaptcha-v3";const Yt=["nick","mail","link"],Ze=e=>e.filter(a=>Yt.includes(a)),Xe=["//unpkg.com/@waline/emojis@1.1.0/weibo"],Qt=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],el=e=>new Promise((a,l)=>{if(e.size>128*1e3)return l(new Error("File too large! File size limit 128KB"));const t=new FileReader;t.readAsDataURL(e),t.onload=()=>{var i;return a(((i=t.result)==null?void 0:i.toString())||"")},t.onerror=l}),tl=e=>e===!0?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',ll=e=>{const a=async(l,t={})=>fetch(`https://api.giphy.com/v1/gifs/${l}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...t}).toString()}`).then(i=>i.json()).then(({data:i})=>i.map(n=>({title:n.title,src:n.images.downsized_medium.url})));return{search:l=>a("search",{q:l,offset:"0"}),default:()=>a("trending",{}),more:(l,t=0)=>a("search",{q:l,offset:t.toString()})}},al=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,nl=/</,ol=/(?:^|\s)\/\/(.+?)$/gm,il=/\/\*([\S\s]*?)\*\//gm,rl=new RegExp(`(${al.source}|${nl.source})|((?:${ol.source})|(?:${il.source}))`,"gmi"),Je=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],xe={},sl=e=>{let a=0;return e.replace(rl,(l,t,i)=>{if(i)return`<span style="color: slategray">${i}</span>`;if(t==="<")return"&lt;";let n;xe[t]?n=xe[t]:(n=Je[a],xe[t]=n);const m=`<span style="color: #${n}">${t}</span>`;return a=++a%Je.length,m})},cl=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],ne=e=>Object.fromEntries(e.map((a,l)=>[cl[l],a]));var Ye=ne(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words!
import{fetchCommentCount as xt,getArticleCounter as Rt,updateArticleCounter as Be,updateComment as he,addComment as At,login as Mt,deleteComment as Ut,getComment as St,updatePageview as _t,getPageview as jt,getRecentComment as zt,getUserList as Vt}from"@waline/api";export*from"@waline/api";import{h as A,defineComponent as ue,inject as Le,ref as I,computed as W,onMounted as fe,watch as te,onUnmounted as Ee,openBlock as r,createElementBlock as u,createElementVNode as h,toDisplayString as U,Fragment as P,renderList as J,normalizeClass as q,createBlock as le,unref as L,createCommentVNode as x,onBeforeUnmount as Ht,normalizeStyle as Oe,nextTick as Tt,reactive as Ie,createVNode as Z,withDirectives as we,vModelDynamic as Ft,isRef as Nt,vModelText as Wt,vShow as qe,createTextVNode as ae,resolveComponent as Pt,provide as Dt,createApp as Bt,watchEffect as Ge}from"vue";import{useStorage as re,useScriptTag as Ot,useDebounceFn as qt,useNow as Gt,useStyleTag as Kt}from"@vueuse/core";import Ke from"autosize";import{Marked as Zt}from"marked";import{markedHighlight as Xt}from"marked-highlight";import{load as Jt}from"recaptcha-v3";const Yt=["nick","mail","link"],Ze=e=>e.filter(a=>Yt.includes(a)),Xe=["//unpkg.com/@waline/emojis@1.1.0/weibo"],Qt=["//unpkg.com/@waline/emojis/tieba/tieba_agree.png","//unpkg.com/@waline/emojis/tieba/tieba_look_down.png","//unpkg.com/@waline/emojis/tieba/tieba_sunglasses.png","//unpkg.com/@waline/emojis/tieba/tieba_pick_nose.png","//unpkg.com/@waline/emojis/tieba/tieba_awkward.png","//unpkg.com/@waline/emojis/tieba/tieba_sleep.png"],el=e=>new Promise((a,l)=>{if(e.size>128*1e3)return l(new Error("File too large! File size limit 128KB"));const t=new FileReader;t.readAsDataURL(e),t.onload=()=>{var o;return a(((o=t.result)==null?void 0:o.toString())||"")},t.onerror=l}),tl=e=>e===!0?'<p class="wl-tex">TeX is not available in preview</p>':'<span class="wl-tex">TeX is not available in preview</span>',ll=e=>{const a=async(l,t={})=>fetch(`https://api.giphy.com/v1/gifs/${l}?${new URLSearchParams({lang:e,limit:"20",rating:"g",api_key:"6CIMLkNMMOhRcXPoMCPkFy4Ybk2XUiMp",...t}).toString()}`).then(o=>o.json()).then(({data:o})=>o.map(n=>({title:n.title,src:n.images.downsized_medium.url})));return{search:l=>a("search",{q:l,offset:"0"}),default:()=>a("trending",{}),more:(l,t=0)=>a("search",{q:l,offset:t.toString()})}},al=/[\u4E00-\u9FFF\u3400-\u4dbf\uf900-\ufaff\u3040-\u309f\uac00-\ud7af\u0400-\u04FF]+|\w+/,nl=/</,ol=/(?:^|\s)\/\/(.+?)$/gm,il=/\/\*([\S\s]*?)\*\//gm,rl=new RegExp(`(${al.source}|${nl.source})|((?:${ol.source})|(?:${il.source}))`,"gmi"),Je=["23AC69","91C132","F19726","E8552D","1AAB8E","E1147F","2980C1","1BA1E6","9FA0A0","F19726","E30B20","E30B20","A3338B"],xe={},sl=e=>{let a=0;return e.replace(rl,(l,t,o)=>{if(o)return`<span style="color: slategray">${o}</span>`;if(t==="<")return"&lt;";let n;xe[t]?n=xe[t]:(n=Je[a],xe[t]=n);const m=`<span style="color: #${n}">${t}</span>`;return a=++a%Je.length,m})},cl=["nick","nickError","mail","mailError","link","optional","placeholder","sofa","submit","like","cancelLike","reply","cancelReply","comment","refresh","more","preview","emoji","uploadImage","seconds","minutes","hours","days","now","uploading","login","logout","admin","sticky","word","wordHint","anonymous","level0","level1","level2","level3","level4","level5","gif","gifSearchPlaceholder","profile","approved","waiting","spam","unsticky","oldest","latest","hottest","reactionTitle"],ne=e=>Object.fromEntries(e.map((a,l)=>[cl[l],a]));var Ye=ne(["NickName","NickName cannot be less than 3 bytes.","E-Mail","Please confirm your email address.","Website","Optional","Comment here...","No comment yet.","Submit","Like","Cancel like","Reply","Cancel reply","Comments","Refresh","Load More...","Preview","Emoji","Upload Image","seconds ago","minutes ago","hours ago","days ago","just now","Uploading","Login","logout","Admin","Sticky","Words",`Please input comments between $0 and $1 words!
Current word number: $2`,"Anonymous","Dwarves","Hobbits","Ents","Wizards","Elves","Maiar","GIF","Search GIF","Profile","Approved","Waiting","Spam","Unsticky","Oldest","Latest","Hottest","What do you think?"]),Qe=ne(["Pseudo","Le pseudo ne peut pas faire moins de 3 octets.","E-mail","Veuillez confirmer votre adresse e-mail.","Site Web","Optionnel","Commentez ici...","Aucun commentaire pour l'instant.","Envoyer","J'aime","Annuler le j'aime","Répondre","Annuler la réponse","Commentaires","Actualiser","Charger plus...","Aperçu","Emoji","Télécharger une image","Il y a quelques secondes","Il y a quelques minutes","Il y a quelques heures","Il y a quelques jours","À l'instant","Téléchargement en cours","Connexion","Déconnexion","Admin","Épinglé","Mots",`Veuillez saisir des commentaires entre $0 et $1 mots !

@@ -9,4 +9,4 @@ Nombre actuel de mots : $2`,"Anonyme","Nains","Hobbits","Ents","Mages","Elfes","Maïar","GIF","Rechercher un GIF","Profil","Approuvé","En attente","Indésirable","Détacher","Le plus ancien","Dernier","Le plus populaire","Qu'en pensez-vous ?"]),et=ne(["ニックネーム","3バイト以上のニックネームをご入力ください.","メールアドレス","メールアドレスをご確認ください.","サイト","オプション","ここにコメント","コメントしましょう~","提出する","Like","Cancel like","返信する","キャンセル","コメント","更新","さらに読み込む","プレビュー","絵文字","画像をアップロード","秒前","分前","時間前","日前","たっだ今","アップロード","ログインする","ログアウト","管理者","トップに置く","ワード",`コメントは $0 から $1 ワードの間でなければなりません!

当前字数:$2`,"匿名","潜水","冒泡","吐槽","活跃","话痨","传说","表情包","搜索表情包","个人资料","通过","待审核","垃圾","取消置顶","按倒序","按正序","按热度","你认为这篇文章怎么样?"]),vl=ne(["暱稱","暱稱不能少於3個字元","郵箱","請填寫正確的郵件地址","網址","可選","歡迎留言","來發留言吧~","送出","喜歡","取消喜歡","回覆","取消回覆","留言","重整","載入更多...","預覽","表情","上傳圖片","秒前","分鐘前","小時前","天前","剛剛","正在上傳","登入","登出","管理者","置頂","字",`留言字數應在 $0 到 $1 字之間!
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const nt="en-US",ye={zh:at,"zh-cn":at,"zh-tw":vl,en:Ye,"en-us":Ye,fr:Qe,"fr-fr":Qe,jp:et,"jp-jp":et,"pt-br":ul,ru:tt,"ru-ru":tt,vi:lt,"vi-vn":lt},ot=e=>ye[e.toLowerCase()]||ye[nt],ml=e=>Object.keys(ye).includes(e.toLowerCase())?e:nt,it=e=>{try{e=decodeURI(e)}catch{}return e},rt=(e="")=>e.replace(/\/$/u,""),st=e=>/^(https?:)?\/\//.test(e),ke=e=>{const a=rt(e);return st(a)?a:`https://${a}`},dl=e=>Array.isArray(e)?e:e?[0,e]:!1,Re=(e,a)=>typeof e=="function"?e:e===!1?!1:a,pl=({serverURL:e,path:a=location.pathname,lang:l=typeof navigator>"u"?"en-US":navigator.language,locale:t,emoji:i=Xe,meta:n=["nick","mail","link"],requiredMeta:m=[],dark:d=!1,pageSize:g=10,wordLimit:c,imageUploader:f,highlighter:_,texRenderer:p,copyright:M=!0,login:S="enable",search:E,reaction:y,recaptchaV3Key:o="",turnstileKey:w="",commentSorting:F="latest",...D})=>({serverURL:ke(e),path:it(a),lang:ml(l),locale:{...ot(l),...typeof t=="object"?t:{}},wordLimit:dl(c),meta:Ze(n),requiredMeta:Ze(m),imageUploader:Re(f,el),highlighter:Re(_,sl),texRenderer:Re(p,tl),dark:d,emoji:typeof i=="boolean"?i?Xe:[]:i,pageSize:g,login:S,copyright:M,search:E===!1?!1:typeof E=="object"?E:ll(l),recaptchaV3Key:o,turnstileKey:w,reaction:Array.isArray(y)?y:y===!0?Qt:[],commentSorting:F,...D}),se=e=>typeof e=="string",Ae="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bg-color:#1e1e1e;--waline-bg-color-light:#272727;--waline-bg-color-hover: #444;--waline-border-color:#333;--waline-disable-bg-color:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bg-color:#272727;--waline-info-color:#666}",gl=e=>se(e)?e==="auto"?`@media(prefers-color-scheme:dark){body${Ae}}`:`${e}${Ae}`:e===!0?`:root${Ae}`:"",Me=(e,a)=>{let l=e.toString();for(;l.length<a;)l="0"+l;return l},hl=e=>{const a=Me(e.getDate(),2),l=Me(e.getMonth()+1,2);return`${Me(e.getFullYear(),2)}-${l}-${a}`},fl=(e,a,l)=>{if(!e)return"";const t=se(e)?new Date(e.indexOf(" ")!==-1?e.replace(/-/g,"/"):e):e,i=a.getTime()-t.getTime(),n=Math.floor(i/(24*3600*1e3));if(n===0){const m=i%864e5,d=Math.floor(m/(3600*1e3));if(d===0){const g=m%36e5,c=Math.floor(g/(60*1e3));if(c===0){const f=g%6e4;return`${Math.round(f/1e3)} ${l.seconds}`}return`${c} ${l.minutes}`}return`${d} ${l.hours}`}return n<0?l.now:n<8?`${n} ${l.days}`:hl(t)},wl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yl=e=>wl.test(e),kl=e=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(e),bl=e=>{const a=re("WALINE_EMOJI",{}),l=kl(e);if(l){const t=a.value[e];if(t)return Promise.resolve(t)}return fetch(`${e}/info.json`).then(t=>t.json()).then(t=>{const i={folder:e,...t};return l&&(a.value[e]=i),i})},ct=(e,a="",l="",t="")=>`${a?`${a}/`:""}${l}${e}${t?`.${t}`:""}`,Cl=e=>Promise.all(e.map(a=>se(a)?bl(rt(a)):Promise.resolve(a))).then(a=>{const l={tabs:[],map:{}};return a.forEach(t=>{const{name:i,folder:n,icon:m,prefix:d,type:g,items:c}=t;l.tabs.push({name:i,icon:ct(m,n,d,g),items:c.map(f=>{const _=`${d||""}${f}`;return l.map[_]=ct(f,n,d,g),_})})}),l}),ut=e=>{e.name!=="AbortError"&&console.error(e.message)},Ue=e=>e instanceof HTMLElement?e:se(e)?document.querySelector(e):null,$l=e=>e.type.includes("image"),vt=e=>{const a=Array.from(e).find($l);return a?a.getAsFile():null},Ll=/\$.*?\$/,El=/^\$(.*?)\$/,Il=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,xl=e=>[{name:"blockMath",level:"block",tokenizer(a){const l=Il.exec(a);if(l!==null)return{type:"html",raw:l[0],text:e(!0,l[1])}}},{name:"inlineMath",level:"inline",start(a){const l=a.search(Ll);return l!==-1?l:a.length},tokenizer(a){const l=El.exec(a);if(l!==null)return{type:"html",raw:l[0],text:e(!1,l[1])}}}],mt=(e="",a={})=>e.replace(/:(.+?):/g,(l,t)=>a[t]?`<img class="wl-emoji" src="${a[t]}" alt="${t}">`:l),Rl=(e,{emojiMap:a,highlighter:l,texRenderer:t})=>{const i=new Zt;if(i.setOptions({breaks:!0}),l&&i.use(Xt({highlight:l})),t){const n=xl(t);i.use({extensions:n})}return i.parse(mt(e,a))},Se=e=>e.dataset.path||null,Al=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),Ml=e=>e.match(/[\u4E00-\u9FD5]/gu),Ul=e=>{var a,l;return(((a=Al(e))==null?void 0:a.reduce((t,i)=>t+(["",",","."].includes(i.trim())?0:i.trim().split(/\s+/u).length),0))||0)+(((l=Ml(e))==null?void 0:l.length)||0)},Sl=async()=>{if(!navigator)return"";const{userAgentData:e}=navigator;let a=navigator.userAgent;if(!e||e.platform!=="Windows")return a;const{platformVersion:l}=await e.getHighEntropyValues(["platformVersion"]);return l&&parseInt(l.split(".")[0])>=13&&(a=a.replace("Windows NT 10.0","Windows NT 11.0")),a},dt=({serverURL:e,path:a=window.location.pathname,selector:l=".waline-comment-count",lang:t=navigator.language})=>{const i=new AbortController,n=document.querySelectorAll(l);return n.length&&xt({serverURL:ke(e),paths:Array.from(n).map(m=>it(Se(m)||a)),lang:t,signal:i.signal}).then(m=>{n.forEach((d,g)=>{d.innerText=m[g].toString()})}).catch(ut),i.abort.bind(i)},pt=({size:e})=>A("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[A("path",{d:"M697.173 85.333h-369.92c-144.64 0-241.92 101.547-241.92 252.587v348.587c0 150.613 97.28 252.16 241.92 252.16h369.92c144.64 0 241.494-101.547 241.494-252.16V337.92c0-151.04-96.854-252.587-241.494-252.587z",fill:"currentColor"}),A("path",{d:"m640.683 587.52-75.947-75.861 75.904-75.862a37.29 37.29 0 0 0 0-52.778 37.205 37.205 0 0 0-52.779 0l-75.946 75.818-75.862-75.946a37.419 37.419 0 0 0-52.821 0 37.419 37.419 0 0 0 0 52.821l75.947 75.947-75.776 75.733a37.29 37.29 0 1 0 52.778 52.821l75.776-75.776 75.947 75.947a37.376 37.376 0 0 0 52.779-52.821z",fill:"#888"})]),_l=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},A("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),jl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},A("path",{d:"M563.2 463.3 677 540c1.7 1.2 3.7 1.8 5.8 1.8.7 0 1.4-.1 2-.2 2.7-.5 5.1-2.1 6.6-4.4l25.3-37.8c1.5-2.3 2.1-5.1 1.6-7.8s-2.1-5.1-4.4-6.6l-73.6-49.1 73.6-49.1c2.3-1.5 3.9-3.9 4.4-6.6.5-2.7 0-5.5-1.6-7.8l-25.3-37.8a10.1 10.1 0 0 0-6.6-4.4c-.7-.1-1.3-.2-2-.2-2.1 0-4.1.6-5.8 1.8l-113.8 76.6c-9.2 6.2-14.7 16.4-14.7 27.5.1 11 5.5 21.3 14.7 27.4zM387 348.8h-45.5c-5.7 0-10.4 4.7-10.4 10.4v153.3c0 5.7 4.7 10.4 10.4 10.4H387c5.7 0 10.4-4.7 10.4-10.4V359.2c0-5.7-4.7-10.4-10.4-10.4zm333.8 241.3-41-20a10.3 10.3 0 0 0-8.1-.5c-2.6.9-4.8 2.9-5.9 5.4-30.1 64.9-93.1 109.1-164.4 115.2-5.7.5-9.9 5.5-9.5 11.2l3.9 45.5c.5 5.3 5 9.5 10.3 9.5h.9c94.8-8 178.5-66.5 218.6-152.7 2.4-5 .3-11.2-4.8-13.6zm186-186.1c-11.9-42-30.5-81.4-55.2-117.1-24.1-34.9-53.5-65.6-87.5-91.2-33.9-25.6-71.5-45.5-111.6-59.2-41.2-14-84.1-21.1-127.8-21.1h-1.2c-75.4 0-148.8 21.4-212.5 61.7-63.7 40.3-114.3 97.6-146.5 165.8-32.2 68.1-44.3 143.6-35.1 218.4 9.3 74.8 39.4 145 87.3 203.3.1.2.3.3.4.5l36.2 38.4c1.1 1.2 2.5 2.1 3.9 2.6 73.3 66.7 168.2 103.5 267.5 103.5 73.3 0 145.2-20.3 207.7-58.7 37.3-22.9 70.3-51.5 98.1-85 27.1-32.7 48.7-69.5 64.2-109.1 15.5-39.7 24.4-81.3 26.6-123.8 2.4-43.6-2.5-87-14.5-129zm-60.5 181.1c-8.3 37-22.8 72-43 104-19.7 31.1-44.3 58.6-73.1 81.7-28.8 23.1-61 41-95.7 53.4-35.6 12.7-72.9 19.1-110.9 19.1-82.6 0-161.7-30.6-222.8-86.2l-34.1-35.8c-23.9-29.3-42.4-62.2-55.1-97.7-12.4-34.7-18.8-71-19.2-107.9-.4-36.9 5.4-73.3 17.1-108.2 12-35.8 30-69.2 53.4-99.1 31.7-40.4 71.1-72 117.2-94.1 44.5-21.3 94-32.6 143.4-32.6 49.3 0 97 10.8 141.8 32 34.3 16.3 65.3 38.1 92 64.8 26.1 26 47.5 56 63.6 89.2 16.2 33.2 26.6 68.5 31 105.1 4.6 37.5 2.7 75.3-5.6 112.3z",fill:"currentColor"})),zl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[A("path",{d:"M784 112H240c-88 0-160 72-160 160v480c0 88 72 160 160 160h544c88 0 160-72 160-160V272c0-88-72-160-160-160zm96 640c0 52.8-43.2 96-96 96H240c-52.8 0-96-43.2-96-96V272c0-52.8 43.2-96 96-96h544c52.8 0 96 43.2 96 96v480z",fill:"currentColor"}),A("path",{d:"M352 480c52.8 0 96-43.2 96-96s-43.2-96-96-96-96 43.2-96 96 43.2 96 96 96zm0-128c17.6 0 32 14.4 32 32s-14.4 32-32 32-32-14.4-32-32 14.4-32 32-32zm462.4 379.2-3.2-3.2-177.6-177.6c-25.6-25.6-65.6-25.6-91.2 0l-80 80-36.8-36.8c-25.6-25.6-65.6-25.6-91.2 0L200 728c-4.8 6.4-8 14.4-8 24 0 17.6 14.4 32 32 32 9.6 0 16-3.2 22.4-9.6L380.8 640l134.4 134.4c6.4 6.4 14.4 9.6 24 9.6 17.6 0 32-14.4 32-32 0-9.6-4.8-17.6-9.6-24l-52.8-52.8 80-80L769.6 776c6.4 4.8 12.8 8 20.8 8 17.6 0 32-14.4 32-32 0-8-3.2-16-8-20.8z",fill:"currentColor"})]),Vl=({active:e=!1})=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[A("path",{d:`M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z${e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"}`,fill:e?"red":"currentColor"})]),Hl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[A("path",{d:"M710.816 654.301c70.323-96.639 61.084-230.578-23.705-314.843-46.098-46.098-107.183-71.109-172.28-71.109-65.008 0-126.092 25.444-172.28 71.109-45.227 46.098-70.756 107.183-70.756 172.106 0 64.923 25.444 126.007 71.194 172.106 46.099 46.098 107.184 71.109 172.28 71.109 51.414 0 100.648-16.212 142.824-47.404l126.53 126.006c7.058 7.06 16.297 10.979 26.406 10.979 10.105 0 19.343-3.919 26.402-10.979 14.467-14.467 14.467-38.172 0-52.723L710.816 654.301zm-315.107-23.265c-65.88-65.88-65.88-172.54 0-238.42 32.069-32.07 74.245-49.149 119.471-49.149 45.227 0 87.407 17.603 119.472 49.149 65.88 65.879 65.88 172.539 0 238.42-63.612 63.178-175.242 63.178-238.943 0zm0 0",fill:"currentColor"}),A("path",{d:"M703.319 121.603H321.03c-109.8 0-199.469 89.146-199.469 199.38v382.034c0 109.796 89.236 199.38 199.469 199.38h207.397c20.653 0 37.384-16.645 37.384-37.299 0-20.649-16.731-37.296-37.384-37.296H321.03c-68.582 0-124.352-55.77-124.352-124.267V321.421c0-68.496 55.77-124.267 124.352-124.267h382.289c68.582 0 124.352 55.771 124.352 124.267V524.72c0 20.654 16.736 37.299 37.385 37.299 20.654 0 37.384-16.645 37.384-37.299V320.549c-.085-109.8-89.321-198.946-199.121-198.946zm0 0",fill:"currentColor"})]),Tl=()=>A("svg",{width:"16",height:"16",ariaHidden:"true"},A("path",{d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",fill:"currentColor"})),Fl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},A("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),Nl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},A("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),Wl=()=>A("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},A("path",{d:"m894.4 461.56-54.4-63.2c-10.4-12-18.8-34.4-18.8-50.4v-68c0-42.4-34.8-77.2-77.2-77.2h-68c-15.6 0-38.4-8.4-50.4-18.8l-63.2-54.4c-27.6-23.6-72.8-23.6-100.8 0l-62.8 54.8c-12 10-34.8 18.4-50.4 18.4h-69.2c-42.4 0-77.2 34.8-77.2 77.2v68.4c0 15.6-8.4 38-18.4 50l-54 63.6c-23.2 27.6-23.2 72.4 0 100l54 63.6c10 12 18.4 34.4 18.4 50v68.4c0 42.4 34.8 77.2 77.2 77.2h69.2c15.6 0 38.4 8.4 50.4 18.8l63.2 54.4c27.6 23.6 72.8 23.6 100.8 0l63.2-54.4c12-10.4 34.4-18.8 50.4-18.8h68c42.4 0 77.2-34.8 77.2-77.2v-68c0-15.6 8.4-38.4 18.8-50.4l54.4-63.2c23.2-27.6 23.2-73.2-.4-100.8zm-216-25.2-193.2 193.2a30 30 0 0 1-42.4 0l-96.8-96.8a30.16 30.16 0 0 1 0-42.4c11.6-11.6 30.8-11.6 42.4 0l75.6 75.6 172-172c11.6-11.6 30.8-11.6 42.4 0 11.6 11.6 11.6 30.8 0 42.4z",fill:"#27ae60"})),ve=({size:e=100})=>A("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},A("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},A("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Pl=()=>A("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[A("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),A("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})]),Dl=()=>re("WALINE_USER_META",{nick:"",mail:"",link:""}),Bl=()=>re("WALINE_COMMENT_BOX_EDITOR",""),Ol="WALINE_LIKE";let gt=null;const ht=()=>gt||(gt=re(Ol,[])),ql="WALINE_REACTION";let ft=null;const Gl=()=>ft??(ft=re(ql,{})),wt={},Kl=e=>{const a=wt[e]??(wt[e]=Jt(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:l=>a.then(t=>t.execute(l))}},Zl=e=>({execute:async a=>{const{load:l}=Ot("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await l();const t=window==null?void 0:window.turnstile;return new Promise(i=>{t==null||t.ready(()=>{t==null||t.render(".wl-captcha-container",{sitekey:e,action:a,size:"compact",callback:i})})})}}),Xl="WALINE_USER";let yt=null;const be=()=>yt??(yt=re(Xl,{})),Jl={key:0,class:"wl-reaction"},Yl=["textContent"],Ql={class:"wl-reaction-list"},ea=["onClick"],ta={class:"wl-reaction-img"},la=["src","alt"],aa=["textContent"],na=["textContent"];var oa=ue({__name:"ArticleReaction",setup(e,{expose:a}){a();const l=Gl(),t=Le("config"),i=I(-1),n=I([]),m=W(()=>t.value.locale),d=W(()=>t.value.reaction.length>0),g=W(()=>{const{reaction:p,path:M}=t.value;return p.map((S,E)=>({icon:S,desc:m.value[`reaction${E}`],active:l.value[M]===E}))});let c;const f=async()=>{if(d.value){const{serverURL:p,lang:M,path:S,reaction:E}=t.value,y=new AbortController;c=y.abort.bind(y);const o=await Rt({serverURL:p,lang:M,paths:[S],type:E.map((w,F)=>`reaction${F}`),signal:y.signal});if(Array.isArray(o)||typeof o=="number")return;n.value=E.map((w,F)=>o[`reaction${F}`])}},_=async p=>{if(i.value===-1){const{serverURL:M,lang:S,path:E}=t.value,y=l.value[E];i.value=p,y!==void 0&&(await Be({serverURL:M,lang:S,path:E,type:`reaction${y}`,action:"desc"}),n.value[y]=Math.max(n.value[y]-1,0)),y!==p&&(await Be({serverURL:M,lang:S,path:E,type:`reaction${p}`}),n.value[p]=(n.value[p]||0)+1),y===p?delete l.value[E]:l.value[E]=p,i.value=-1}};return fe(()=>{te(()=>[t.value.serverURL,t.value.path],()=>{f()},{immediate:!0})}),Ee(()=>c==null?void 0:c()),(p,M)=>g.value.length?(r(),u("div",Jl,[h("div",{class:"wl-reaction-title",textContent:U(m.value.reactionTitle)},null,8,Yl),h("ul",Ql,[(r(!0),u(P,null,J(g.value,({active:S,icon:E,desc:y},o)=>(r(),u("li",{key:o,class:q(["wl-reaction-item",{active:S}]),onClick:w=>_(o)},[h("div",ta,[h("img",{src:E,alt:y},null,8,la),i.value===o?(r(),le(L(ve),{key:0,class:"wl-reaction-loading"})):(r(),u("div",{key:1,class:"wl-reaction-votes",textContent:U(n.value[o]||0)},null,8,aa))]),h("div",{class:"wl-reaction-text",textContent:U(y)},null,8,na)],10,ea))),128))])])):x("v-if",!0)}}),me=(e,a)=>{const l=e.__vccOpts||e;for(const[t,i]of a)l[t]=i;return l},ia=me(oa,[["__file","ArticleReaction.vue"]]);const ra=["data-index"],sa=["src","title","onClick"];var ca=ue({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e,{expose:a}){const l=e;a();let t=null;const i=I(null),n=I({}),m=I([]),d=()=>{const p=Math.floor((i.value.getBoundingClientRect().width+l.gap)/(l.columnWidth+l.gap));return p>0?p:1},g=p=>new Array(p).fill(null).map(()=>[]),c=async p=>{var M;if(p>=l.items.length)return;await Tt();const S=Array.from(((M=i.value)==null?void 0:M.children)||[]).reduce((E,y)=>y.getBoundingClientRect().height<E.getBoundingClientRect().height?y:E);m.value[Number(S.dataset.index)].push(p),await c(p+1)},f=async(p=!1)=>{if(m.value.length===d()&&!p)return;m.value=g(d());const M=window.scrollY;await c(0),window.scrollTo({top:M})},_=p=>{n.value[p.target.src]=!0};return fe(()=>{f(!0),t=new ResizeObserver(()=>{f()}),t.observe(i.value),te(()=>[l.items],()=>{n.value={},f(!0)}),te(()=>[l.columnWidth,l.gap],()=>{f()})}),Ht(()=>t.unobserve(i.value)),(p,M)=>(r(),u("div",{ref_key:"wall",ref:i,class:"wl-gallery",style:Oe({gap:`${p.gap}px`})},[(r(!0),u(P,null,J(m.value,(S,E)=>(r(),u("div",{key:E,class:"wl-gallery-column","data-index":E,style:Oe({gap:`${p.gap}px`})},[(r(!0),u(P,null,J(S,y=>(r(),u(P,{key:y},[n.value[p.items[y].src]?x("v-if",!0):(r(),le(L(ve),{key:0,size:36,style:{margin:"20px auto"}})),h("img",{class:"wl-gallery-item",src:p.items[y].src,title:p.items[y].title,loading:"lazy",onLoad:_,onClick:o=>p.$emit("insert",`![](${p.items[y].src})`)},null,40,sa)],64))),128))],12,ra))),128))],4))}}),ua=me(ca,[["__file","ImageWall.vue"]]);const va={class:"wl-comment"},ma={key:0,class:"wl-login-info"},da={class:"wl-avatar"},pa=["title"],ga=["title"],ha=["src"],fa=["title","textContent"],wa={class:"wl-panel"},ya=["for","textContent"],ka=["id","onUpdate:modelValue","name","type"],ba=["placeholder"],Ca={class:"wl-preview"},$a=h("hr",null,null,-1),La=["innerHTML"],Ea={class:"wl-footer"},Ia={class:"wl-actions"},xa={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},Ra=["title"],Aa=["title"],Ma=["title"],Ua=["title"],Sa={class:"wl-info"},_a=h("div",{class:"wl-captcha-container"},null,-1),ja={class:"wl-text-number"},za={key:0},Va=["textContent"],Ha=["textContent"],Ta=["disabled"],Fa=["placeholder"],Na={key:1,class:"wl-loading"},Wa={key:0,class:"wl-tab-wrapper"},Pa=["title","onClick"],Da=["src","alt"],Ba={key:0,class:"wl-tabs"},Oa=["onClick"],qa=["src","alt","title"],Ga=["title"];var Ka=ue({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{expose:a,emit:l}){const t=e,i=l;a();const n=Le("config"),m=Bl(),d=Dl(),g=be(),c=I({}),f=I(null),_=I(null),p=I(null),M=I(null),S=I(null),E=I(null),y=I(null),o=I({tabs:[],map:{}}),w=I(0),F=I(!1),D=I(!1),R=I(!1),z=I(""),ie=I(0),H=Ie({loading:!0,list:[]}),oe=I(0),ee=I(!1),de=I(""),Y=I(!1),$=I(!1),k=W(()=>n.value.locale),j=W(()=>{var v;return!!((v=g.value)!=null&&v.token)}),G=W(()=>n.value.imageUploader!==!1),B=v=>{const s=f.value,b=s.selectionStart,V=s.selectionEnd||0,C=s.scrollTop;m.value=s.value.substring(0,b)+v+s.value.substring(V,s.value.length),s.focus(),s.selectionStart=b+v.length,s.selectionEnd=b+v.length,s.scrollTop=C},X=v=>{const s=v.key;(v.ctrlKey||v.metaKey)&&s==="Enter"&&je()},K=v=>{const s=`![${n.value.locale.uploading} ${v.name}]()`;return B(s),Y.value=!0,Promise.resolve().then(()=>n.value.imageUploader(v)).then(b=>{m.value=m.value.replace(s,`\r
![${v.name}](${b})`)}).catch(b=>{alert(b.message),m.value=m.value.replace(s,"")}).then(()=>{Y.value=!1})},ce=v=>{var s;if((s=v.dataTransfer)!=null&&s.items){const b=vt(v.dataTransfer.items);b&&G.value&&(K(b),v.preventDefault())}},_e=v=>{if(v.clipboardData){const s=vt(v.clipboardData.items);s&&G.value&&K(s)}},Ce=()=>{const v=_.value;v.files&&G.value&&K(v.files[0]).then(()=>{v.value=""})},je=async()=>{var v,s,b,V,C,O;const{serverURL:N,lang:Q,login:pe,wordLimit:Ne,requiredMeta:We,recaptchaV3Key:Pe,turnstileKey:De}=n.value,It=await Sl(),T={comment:de.value,nick:d.value.nick,mail:d.value.mail,link:d.value.link,url:n.value.path,ua:It};if((v=g.value)!=null&&v.token&&!t.edit)T.nick=g.value.display_name,T.mail=g.value.email,T.link=g.value.url;else{if(pe==="force")return;if(We.indexOf("nick")>-1&&!T.nick)return(s=c.value.nick)==null||s.focus(),alert(k.value.nickError);if(We.indexOf("mail")>-1&&!T.mail||T.mail&&!yl(T.mail))return(b=c.value.mail)==null||b.focus(),alert(k.value.mailError);T.nick||(T.nick=k.value.anonymous)}if(!T.comment){(V=f.value)==null||V.focus();return}if(!ee.value)return alert(k.value.wordHint.replace("$0",Ne[0].toString()).replace("$1",Ne[1].toString()).replace("$2",ie.value.toString()));T.comment=mt(T.comment,o.value.map),t.replyId&&t.rootId&&(T.pid=t.replyId,T.rid=t.rootId,T.at=t.replyUser),Y.value=!0;try{Pe&&(T.recaptchaV3=await Kl(Pe).execute("social")),De&&(T.turnstile=await Zl(De).execute("social"));const ge={serverURL:N,lang:Q,token:(C=g.value)==null?void 0:C.token,comment:T},$e=await(t.edit?he({objectId:t.edit.objectId,...ge}):At(ge));if(Y.value=!1,$e.errmsg)return alert($e.errmsg);i("submit",$e.data),m.value="",z.value="",t.replyId&&i("cancelReply"),(O=t.edit)!=null&&O.objectId&&i("cancelEdit")}catch(ge){Y.value=!1,alert(ge.message)}},Lt=v=>{v.preventDefault();const{lang:s,serverURL:b}=n.value;Mt({serverURL:b,lang:s}).then(V=>{g.value=V,(V.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(V)),i("log")})},Et=()=>{g.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),i("log")},ze=v=>{v.preventDefault();const{lang:s,serverURL:b}=n.value,V=800,C=800,O=(window.innerWidth-V)/2,N=(window.innerHeight-C)/2,Q=new URLSearchParams({lng:s,token:g.value.token}),pe=window.open(`${b}/ui/profile?${Q.toString()}`,"_blank",`width=${V},height=${C},left=${O},top=${N},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);pe==null||pe.postMessage({type:"TOKEN",data:g.value.token},"*")},Ve=v=>{var s,b,V,C;!((s=p.value)!=null&&s.contains(v.target))&&!((b=M.value)!=null&&b.contains(v.target))&&(F.value=!1),!((V=S.value)!=null&&V.contains(v.target))&&!((C=E.value)!=null&&C.contains(v.target))&&(D.value=!1)},He=async v=>{var s;const{scrollTop:b,clientHeight:V,scrollHeight:C}=v.target,O=(V+b)/C,N=n.value.search,Q=((s=y.value)==null?void 0:s.value)||"";O<.9||H.loading||$.value||(H.loading=!0,(N.more&&H.list.length?await N.more(Q,H.list.length):await N.search(Q)).length?H.list=[...H.list,...N.more&&H.list.length?await N.more(Q,H.list.length):await N.search(Q)]:$.value=!0,H.loading=!1,setTimeout(()=>{v.target.scrollTop=b},50))},Te=qt(v=>{H.list=[],$.value=!1,He(v)},300);te([n,ie],([v,s])=>{const{wordLimit:b}=v;b?s<b[0]&&b[0]!==0?(oe.value=b[0],ee.value=!1):s>b[1]?(oe.value=b[1],ee.value=!1):(oe.value=b[1],ee.value=!0):(oe.value=0,ee.value=!0)},{immediate:!0});const Fe=({data:v})=>{!v||v.type!=="profile"||(g.value={...g.value,...v.data},[localStorage,sessionStorage].filter(s=>s.getItem("WALINE_USER")).forEach(s=>s.setItem("WALINE_USER",JSON.stringify(g))))};return fe(()=>{var v;document.body.addEventListener("click",Ve),window.addEventListener("message",Fe),(v=t.edit)!=null&&v.objectId&&(m.value=t.edit.orig),te(D,async s=>{if(!s)return;const b=n.value.search;y.value&&(y.value.value=""),H.loading=!0,H.list=b.default?await b.default():await b.search(""),H.loading=!1}),te(()=>m.value,s=>{const{highlighter:b,texRenderer:V}=n.value;de.value=s,z.value=Rl(s,{emojiMap:o.value.map,highlighter:b,texRenderer:V}),ie.value=Ul(s),s?Ke(f.value):Ke.destroy(f.value)},{immediate:!0}),te(()=>n.value.emoji,s=>Cl(s).then(b=>{o.value=b}),{immediate:!0})}),Ee(()=>{document.body.removeEventListener("click",Ve),window.removeEventListener("message",Fe)}),(v,s)=>{var b,V;return r(),u("div",va,[L(n).login!=="disable"&&j.value&&!((b=v.edit)!=null&&b.objectId)?(r(),u("div",ma,[h("div",da,[h("button",{type:"submit",class:"wl-logout-btn",title:k.value.logout,onClick:Et},[Z(L(pt),{size:14})],8,pa),h("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:k.value.profile,onClick:ze},[h("img",{src:L(g).avatar,alt:"avatar"},null,8,ha)],8,ga)]),h("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:k.value.profile,onClick:ze,textContent:U(L(g).display_name)},null,8,fa)])):x("v-if",!0),h("div",wa,[L(n).login!=="force"&&L(n).meta.length&&!j.value?(r(),u("div",{key:0,class:q(["wl-header",`item${L(n).meta.length}`])},[(r(!0),u(P,null,J(L(n).meta,C=>(r(),u("div",{key:C,class:"wl-header-item"},[h("label",{for:`wl-${C}`,textContent:U(k.value[C]+(L(n).requiredMeta.includes(C)||!L(n).requiredMeta.length?"":`(${k.value.optional})`))},null,8,ya),we(h("input",{id:`wl-${C}`,ref_for:!0,ref:O=>{O&&(c.value[C]=O)},"onUpdate:modelValue":O=>L(d)[C]=O,class:q(["wl-input",`wl-${C}`]),name:C,type:C==="mail"?"email":"text"},null,10,ka),[[Ft,L(d)[C]]])]))),128))],2)):x("v-if",!0),we(h("textarea",{id:"wl-edit",ref_key:"editorRef",ref:f,"onUpdate:modelValue":s[0]||(s[0]=C=>Nt(m)?m.value=C:null),class:"wl-editor",placeholder:v.replyUser?`@${v.replyUser}`:k.value.placeholder,onKeydown:X,onDrop:ce,onPaste:_e},null,40,ba),[[Wt,L(m)]]),we(h("div",Ca,[$a,h("h4",null,U(k.value.preview)+":",1),h("div",{class:"wl-content",innerHTML:z.value},null,8,La)],512),[[qe,R.value]]),h("div",Ea,[h("div",Ia,[h("a",xa,[Z(L(Tl))]),we(h("button",{ref_key:"emojiButtonRef",ref:p,type:"button",class:q(["wl-action",{active:F.value}]),title:k.value.emoji,onClick:s[1]||(s[1]=C=>F.value=!F.value)},[Z(L(jl))],10,Ra),[[qe,o.value.tabs.length]]),L(n).search?(r(),u("button",{key:0,ref_key:"gifButtonRef",ref:S,type:"button",class:q(["wl-action",{active:D.value}]),title:k.value.gif,onClick:s[2]||(s[2]=C=>D.value=!D.value)},[Z(L(Pl))],10,Aa)):x("v-if",!0),h("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:_,class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:Ce},null,544),G.value?(r(),u("label",{key:1,for:"wl-image-upload",class:"wl-action",title:k.value.uploadImage},[Z(L(zl))],8,Ma)):x("v-if",!0),h("button",{type:"button",class:q(["wl-action",{active:R.value}]),title:k.value.preview,onClick:s[3]||(s[3]=C=>R.value=!R.value)},[Z(L(Hl))],10,Ua)]),h("div",Sa,[_a,h("div",ja,[ae(U(ie.value)+" ",1),L(n).wordLimit?(r(),u("span",za,[ae("  /  "),h("span",{class:q({illegal:!ee.value}),textContent:U(oe.value)},null,10,Va)])):x("v-if",!0),ae("  "+U(k.value.word),1)]),L(n).login!=="disable"&&!j.value?(r(),u("button",{key:0,type:"button",class:"wl-btn",onClick:Lt,textContent:U(k.value.login)},null,8,Ha)):x("v-if",!0),L(n).login!=="force"||j.value?(r(),u("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:Y.value,onClick:je},[Y.value?(r(),le(L(ve),{key:0,size:16})):(r(),u(P,{key:1},[ae(U(k.value.submit),1)],64))],8,Ta)):x("v-if",!0)]),h("div",{ref_key:"gifPopupRef",ref:E,class:q(["wl-gif-popup",{display:D.value}])},[h("input",{ref_key:"gifSearchInputRef",ref:y,type:"text",placeholder:k.value.gifSearchPlaceholder,onInput:s[4]||(s[4]=(...C)=>L(Te)&&L(Te)(...C))},null,40,Fa),H.list.length?(r(),le(ua,{key:0,items:H.list,"column-width":200,gap:6,onInsert:s[5]||(s[5]=C=>B(C)),onScroll:He},null,8,["items"])):x("v-if",!0),H.loading?(r(),u("div",Na,[Z(L(ve),{size:30})])):x("v-if",!0)],2),h("div",{ref_key:"emojiPopupRef",ref:M,class:q(["wl-emoji-popup",{display:F.value}])},[(r(!0),u(P,null,J(o.value.tabs,(C,O)=>(r(),u(P,{key:C.name},[O===w.value?(r(),u("div",Wa,[(r(!0),u(P,null,J(C.items,N=>(r(),u("button",{key:N,type:"button",title:N,onClick:Q=>B(`:${N}:`)},[F.value?(r(),u("img",{key:0,class:"wl-emoji",src:o.value.map[N],alt:N,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Da)):x("v-if",!0)],8,Pa))),128))])):x("v-if",!0)],64))),128)),o.value.tabs.length>1?(r(),u("div",Ba,[(r(!0),u(P,null,J(o.value.tabs,(C,O)=>(r(),u("button",{key:C.name,type:"button",class:q(["wl-tab",{active:w.value===O}]),onClick:N=>w.value=O},[h("img",{class:"wl-emoji",src:C.icon,alt:C.name,title:C.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,qa)],10,Oa))),128))])):x("v-if",!0)],2)])]),v.replyId||(V=v.edit)!=null&&V.objectId?(r(),u("button",{key:1,type:"button",class:"wl-close",title:k.value.cancelReply,onClick:s[6]||(s[6]=C=>v.$emit(v.replyId?"cancelReply":"cancelEdit"))},[Z(L(pt),{size:24})],8,Ga)):x("v-if",!0)])}}}),kt=me(Ka,[["__file","CommentBox.vue"]]);const Za=["id"],Xa={class:"wl-user","aria-hidden":"true"},Ja=["src"],Ya={class:"wl-card"},Qa={class:"wl-head"},en=["href"],tn={key:1,class:"wl-nick"},ln=["textContent"],an=["textContent"],nn=["textContent"],on=["textContent"],rn=["textContent"],sn={class:"wl-comment-actions"},cn=["title"],un=["title"],vn={class:"wl-meta","aria-hidden":"true"},mn=["data-value","textContent"],dn=["innerHTML"],pn={key:1,class:"wl-admin-actions"},gn={class:"wl-comment-status"},hn=["disabled","onClick","textContent"],fn={key:3,class:"wl-quote"};var wn=ue({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(e,{emit:a}){const l=e,t=a,i=["approved","waiting","spam"],n=Le("config"),m=ht(),d=Gt(),g=be(),c=W(()=>n.value.locale),f=W(()=>{const{link:o}=l.comment;return o?st(o)?o:`https://${o}`:""}),_=W(()=>m.value.includes(l.comment.objectId)),p=W(()=>fl(new Date(l.comment.time),d.value,c.value)),M=W(()=>g.value.type==="administrator"),S=W(()=>l.comment.user_id&&g.value.objectId===l.comment.user_id),E=W(()=>{var o;return l.comment.objectId===((o=l.reply)==null?void 0:o.objectId)}),y=W(()=>{var o;return l.comment.objectId===((o=l.edit)==null?void 0:o.objectId)});return(o,w)=>{var F;const D=Pt("CommentCard",!0);return r(),u("div",{id:o.comment.objectId,class:"wl-card-item"},[h("div",Xa,[o.comment.avatar?(r(),u("img",{key:0,class:"wl-user-avatar",src:o.comment.avatar},null,8,Ja)):x("v-if",!0),o.comment.type?(r(),le(L(Wl),{key:1})):x("v-if",!0)]),h("div",Ya,[h("div",Qa,[f.value?(r(),u("a",{key:0,class:"wl-nick",href:f.value,target:"_blank",rel:"nofollow noopener noreferrer"},U(o.comment.nick),9,en)):(r(),u("span",tn,U(o.comment.nick),1)),o.comment.type==="administrator"?(r(),u("span",{key:2,class:"wl-badge",textContent:U(c.value.admin)},null,8,ln)):x("v-if",!0),o.comment.label?(r(),u("span",{key:3,class:"wl-badge",textContent:U(o.comment.label)},null,8,an)):x("v-if",!0),o.comment.sticky?(r(),u("span",{key:4,class:"wl-badge",textContent:U(c.value.sticky)},null,8,nn)):x("v-if",!0),typeof o.comment.level=="number"?(r(),u("span",{key:5,class:q(`wl-badge level${o.comment.level}`),textContent:U(c.value[`level${o.comment.level}`]||`Level ${o.comment.level}`)},null,10,on)):x("v-if",!0),h("span",{class:"wl-time",textContent:U(p.value)},null,8,rn),h("div",sn,[M.value||S.value?(r(),u(P,{key:0},[h("button",{type:"button",class:"wl-edit",onClick:w[0]||(w[0]=R=>t("edit",o.comment))},[Z(L(Nl))]),h("button",{type:"button",class:"wl-delete",onClick:w[1]||(w[1]=R=>t("delete",o.comment))},[Z(L(_l))])],64)):x("v-if",!0),h("button",{type:"button",class:"wl-like",title:_.value?c.value.cancelLike:c.value.like,onClick:w[2]||(w[2]=R=>t("like",o.comment))},[Z(L(Vl),{active:_.value},null,8,["active"]),ae(" "+U("like"in o.comment?o.comment.like:""),1)],8,cn),h("button",{type:"button",class:q(["wl-reply",{active:E.value}]),title:E.value?c.value.cancelReply:c.value.reply,onClick:w[3]||(w[3]=R=>t("reply",E.value?null:o.comment))},[Z(L(Fl))],10,un)])]),h("div",vn,[(r(),u(P,null,J(["addr","browser","os"],R=>(r(),u(P,null,[o.comment[R]?(r(),u("span",{key:R,class:q(`wl-${R}`),"data-value":o.comment[R],textContent:U(o.comment[R])},null,10,mn)):x("v-if",!0)],64))),64))]),y.value?x("v-if",!0):(r(),u("div",{key:0,class:"wl-content",innerHTML:o.comment.comment},null,8,dn)),M.value&&!y.value?(r(),u("div",pn,[h("span",gn,[(r(),u(P,null,J(i,R=>h("button",{key:R,type:"submit",class:q(`wl-btn wl-${R}`),disabled:o.comment.status===R,onClick:z=>t("status",{status:R,comment:o.comment}),textContent:U(c.value[R])},null,10,hn)),64))]),M.value&&!("rid"in o.comment)?(r(),u("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:w[4]||(w[4]=R=>t("sticky",o.comment))},U(o.comment.sticky?c.value.unsticky:c.value.sticky),1)):x("v-if",!0)])):x("v-if",!0),E.value||y.value?(r(),u("div",{key:2,class:q({"wl-reply-wrapper":E.value,"wl-edit-wrapper":y.value})},[Z(kt,{edit:o.edit,"reply-id":(F=o.reply)==null?void 0:F.objectId,"reply-user":o.comment.nick,"root-id":o.rootId,onLog:w[5]||(w[5]=R=>t("log")),onCancelReply:w[6]||(w[6]=R=>t("reply",null)),onCancelEdit:w[7]||(w[7]=R=>t("edit",null)),onSubmit:w[8]||(w[8]=R=>t("submit",R))},null,8,["edit","reply-id","reply-user","root-id"])],2)):x("v-if",!0),"children"in o.comment?(r(),u("div",fn,[(r(!0),u(P,null,J(o.comment.children,R=>(r(),le(D,{key:R.objectId,comment:R,reply:o.reply,edit:o.edit,"root-id":o.rootId,onLog:w[9]||(w[9]=z=>t("log")),onDelete:w[10]||(w[10]=z=>t("delete",z)),onEdit:w[11]||(w[11]=z=>t("edit",z)),onLike:w[12]||(w[12]=z=>t("like",z)),onReply:w[13]||(w[13]=z=>t("reply",z)),onStatus:w[14]||(w[14]=z=>t("status",z)),onSticky:w[15]||(w[15]=z=>t("sticky",z)),onSubmit:w[16]||(w[16]=z=>t("submit",z))},null,8,["comment","reply","edit","root-id"]))),128))])):x("v-if",!0)])],8,Za)}}}),yn=me(wn,[["__file","CommentCard.vue"]]);const bt="3.1.2",kn={"data-waline":""},bn={class:"wl-meta-head"},Cn={class:"wl-count"},$n=["textContent"],Ln={class:"wl-sort"},En=["onClick"],In={class:"wl-cards"},xn={key:1,class:"wl-operation"},Rn=["textContent"],An={key:2,class:"wl-loading"},Mn=["textContent"],Un={key:4,class:"wl-operation"},Sn=["textContent"],_n={key:5,class:"wl-power"},jn=h("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);var zn=ue({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(e){const a=e,l={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},t=Object.keys(l),i=be(),n=ht(),m=I("loading"),d=I(0),g=I(1),c=I(0),f=W(()=>pl(a)),_=I(f.value.commentSorting),p=I([]),M=I(null),S=I(null),E=W(()=>gl(f.value.dark)),y=W(()=>f.value.locale);Kt(E,{id:"waline-darkmode"});let o;const w=$=>{var k;const{serverURL:j,path:G,pageSize:B}=f.value,X=new AbortController;m.value="loading",o==null||o(),St({serverURL:j,lang:f.value.lang,path:G,pageSize:B,sortBy:l[_.value],page:$,signal:X.signal,token:(k=i.value)==null?void 0:k.token}).then(K=>{m.value="success",d.value=K.count,p.value.push(...K.data),g.value=$,c.value=K.totalPages}).catch(K=>{K.name!=="AbortError"&&(console.error(K.message),m.value="error")}),o=X.abort.bind(X)},F=()=>w(g.value+1),D=()=>{d.value=0,p.value=[],w(1)},R=$=>{_.value!==$&&(_.value=$,D())},z=$=>{M.value=$},ie=$=>{S.value=$},H=$=>{if(S.value)S.value.comment=$.comment,S.value.orig=$.orig;else if("rid"in $){const k=p.value.find(({objectId:j})=>j===$.rid);if(!k)return;Array.isArray(k.children)||(k.children=[]),k.children.push($)}else p.value.unshift($),d.value+=1},oe=async({comment:$,status:k})=>{var j;if($.status===k)return;const{serverURL:G,lang:B}=f.value;await he({serverURL:G,lang:B,token:(j=i.value)==null?void 0:j.token,objectId:$.objectId,comment:{status:k}}),$.status=k},ee=async $=>{var k;if("rid"in $)return;const{serverURL:j,lang:G}=f.value;await he({serverURL:j,lang:G,token:(k=i.value)==null?void 0:k.token,objectId:$.objectId,comment:{sticky:$.sticky?0:1}}),$.sticky=!$.sticky},de=async({objectId:$})=>{var k;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:j,lang:G}=f.value;await Ut({serverURL:j,lang:G,token:(k=i.value)==null?void 0:k.token,objectId:$}),p.value.some((B,X)=>B.objectId===$?(p.value=p.value.filter((K,ce)=>ce!==X),!0):B.children.some((K,ce)=>K.objectId===$?(p.value[X].children=B.children.filter((_e,Ce)=>Ce!==ce),!0):!1))},Y=async $=>{var k;const{serverURL:j,lang:G}=f.value,{objectId:B}=$,X=n.value.includes(B);await he({serverURL:j,lang:G,objectId:B,token:(k=i.value)==null?void 0:k.token,comment:{like:!X}}),X?n.value=n.value.filter(K=>K!==B):(n.value=[...n.value,B],n.value.length>50&&(n.value=n.value.slice(-50))),$.like=($.like||0)+(X?-1:1)};return Dt("config",f),fe(()=>{te(()=>[a.serverURL,a.path],()=>D(),{immediate:!0})}),Ee(()=>o==null?void 0:o()),($,k)=>(r(),u("div",kn,[Z(ia),M.value?x("v-if",!0):(r(),le(kt,{key:0,onLog:D,onSubmit:H})),h("div",bn,[h("div",Cn,[d.value?(r(),u("span",{key:0,class:"wl-num",textContent:U(d.value)},null,8,$n)):x("v-if",!0),ae(" "+U(y.value.comment),1)]),h("ul",Ln,[(r(!0),u(P,null,J(L(t),j=>(r(),u("li",{key:j,class:q([j===_.value?"active":""]),onClick:G=>R(j)},U(y.value[j]),11,En))),128))])]),h("div",In,[(r(!0),u(P,null,J(p.value,j=>(r(),le(yn,{key:j.objectId,"root-id":j.objectId,comment:j,reply:M.value,edit:S.value,onLog:D,onReply:z,onEdit:ie,onSubmit:H,onStatus:oe,onDelete:de,onSticky:ee,onLike:Y},null,8,["root-id","comment","reply","edit"]))),128))]),m.value==="error"?(r(),u("div",xn,[h("button",{type:"button",class:"wl-btn",onClick:D,textContent:U(y.value.refresh)},null,8,Rn)])):m.value==="loading"?(r(),u("div",An,[Z(L(ve),{size:30})])):p.value.length?g.value<c.value?(r(),u("div",Un,[h("button",{type:"button",class:"wl-btn",onClick:F,textContent:U(y.value.more)},null,8,Sn)])):x("v-if",!0):(r(),u("div",{key:3,class:"wl-empty",textContent:U(y.value.sofa)},null,8,Mn)),f.value.copyright?(r(),u("div",_n,[ae(" Powered by "),jn,ae(" v"+U(L(bt)),1)])):x("v-if",!0)]))}}),Vn=me(zn,[["__file","WalineComment.vue"]]);const Ct=(e,a)=>{a.forEach((l,t)=>{const i=e[t].time;typeof i=="number"&&(l.innerText=i.toString())})},$t=({serverURL:e,path:a=window.location.pathname,selector:l=".waline-pageview-count",update:t=!0,lang:i=navigator.language})=>{const n=new AbortController,m=Array.from(document.querySelectorAll(l)),d=c=>{const f=Se(c);return f!==null&&a!==f},g=c=>jt({serverURL:ke(e),paths:c.map(f=>Se(f)||a),lang:i,signal:n.signal}).then(f=>Ct(f,c)).catch(ut);if(t){const c=m.filter(_=>!d(_)),f=m.filter(d);_t({serverURL:ke(e),path:a,lang:i}).then(_=>Ct(_,c)),f.length&&g(f)}else g(m);return n.abort.bind(n)},Hn=({el:e="#waline",path:a=window.location.pathname,comment:l=!1,pageview:t=!1,...i})=>{const n=e?Ue(e):null;if(e&&!n)throw new Error("Option 'el' do not match any domElement!");if(!i.serverURL)throw new Error("Option 'serverURL' is missing!");const m=Ie({...i}),d=Ie({comment:l,pageview:t,path:a}),g=()=>{d.comment&&dt({serverURL:m.serverURL,path:d.path,...se(d.comment)?{selector:d.comment}:{}})},c=()=>{d.pageview&&$t({serverURL:m.serverURL,path:d.path,...se(d.pageview)?{selector:d.pageview}:{}})},f=n?Bt(()=>A(Vn,{path:d.path,...m})):null;f&&f.mount(n);const _=Ge(g),p=Ge(c);return{el:n,update:({comment:M,pageview:S,path:E=window.location.pathname,...y}={})=>{Object.entries(y).forEach(([o,w])=>{m[o]=w}),d.path=E,M!==void 0&&(d.comment=M),S!==void 0&&(d.pageview=S)},destroy:()=>{f==null||f.unmount(),_(),p()}}},Tn=({el:e,serverURL:a,count:l,lang:t=navigator.language})=>{var i;const n=be(),m=Ue(e),d=new AbortController;return zt({serverURL:a,count:l,lang:t,signal:d.signal,token:(i=n.value)==null?void 0:i.token}).then(g=>m&&g.length?(m.innerHTML=`<ul class="wl-recent-list">${g.map(c=>`<li class="wl-recent-item"><a href="${c.url}">${c.nick}</a>:${c.comment}</li>`).join("")}</ul>`,{comments:g,destroy:()=>{d.abort(),m.innerHTML=""}}):{comments:g,destroy:()=>d.abort()})},Fn=({el:e,serverURL:a,count:l,locale:t,lang:i=navigator.language,mode:n="list"})=>{const m=Ue(e),d=new AbortController;return Vt({serverURL:a,pageSize:l,lang:i,signal:d.signal}).then(g=>!m||!g.length?{users:g,destroy:()=>d.abort()}:(t={...ot(i),...typeof t=="object"?t:{}},m.innerHTML=`<ul class="wl-user-${n}">${g.map((c,f)=>[`<li class="wl-user-item" aria-label="${c.nick}">`,c.link&&`<a href="${c.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${c.avatar}" alt="${c.nick}">`,`<span class="wl-user-badge">${f+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',c.nick,c.level&&`<span class="wl-badge">${t?t[`level${c.level}`]:`Level ${c.level}`}</span>`,c.label&&`<span class="wl-badge">${c.label}</span>`,"</div>",c.link&&c.link,"</div>",c.link&&"</a>","</li>"].filter(_=>_).join("")).join("")}</ul>`,{users:g,destroy:()=>{d.abort(),m.innerHTML=""}}))};export{Tn as RecentComments,Fn as UserList,dt as commentCount,ye as defaultLocales,Hn as init,$t as pageviewCount,bt as version};
目前字數:$2`,"匿名","潛水","冒泡","吐槽","活躍","多話","傳說","表情包","搜尋表情包","個人資料","通過","待審核","垃圾","取消置頂","最早","最新","熱門","你認為這篇文章怎麼樣?"]);const nt="en-US",ye={zh:at,"zh-cn":at,"zh-tw":vl,en:Ye,"en-us":Ye,fr:Qe,"fr-fr":Qe,jp:et,"jp-jp":et,"pt-br":ul,ru:tt,"ru-ru":tt,vi:lt,"vi-vn":lt},ot=e=>ye[e.toLowerCase()]||ye[nt],ml=e=>Object.keys(ye).includes(e.toLowerCase())?e:nt,it=e=>{try{e=decodeURI(e)}catch{}return e},rt=(e="")=>e.replace(/\/$/u,""),st=e=>/^(https?:)?\/\//.test(e),ke=e=>{const a=rt(e);return st(a)?a:`https://${a}`},dl=e=>Array.isArray(e)?e:e?[0,e]:!1,Re=(e,a)=>typeof e=="function"?e:e===!1?!1:a,pl=({serverURL:e,path:a=location.pathname,lang:l=typeof navigator>"u"?"en-US":navigator.language,locale:t,emoji:o=Xe,meta:n=["nick","mail","link"],requiredMeta:m=[],dark:d=!1,pageSize:g=10,wordLimit:c,imageUploader:f,highlighter:_,texRenderer:p,copyright:M=!0,login:S="enable",search:E,reaction:y,recaptchaV3Key:i="",turnstileKey:w="",commentSorting:F="latest",...D})=>({serverURL:ke(e),path:it(a),lang:ml(l),locale:{...ot(l),...typeof t=="object"?t:{}},wordLimit:dl(c),meta:Ze(n),requiredMeta:Ze(m),imageUploader:Re(f,el),highlighter:Re(_,sl),texRenderer:Re(p,tl),dark:d,emoji:typeof o=="boolean"?o?Xe:[]:o,pageSize:g,login:S,copyright:M,search:E===!1?!1:typeof E=="object"?E:ll(l),recaptchaV3Key:i,turnstileKey:w,reaction:Array.isArray(y)?y:y===!0?Qt:[],commentSorting:F,...D}),se=e=>typeof e=="string",Ae="{--waline-white:#000;--waline-light-grey:#666;--waline-dark-grey:#999;--waline-color:#888;--waline-bg-color:#1e1e1e;--waline-bg-color-light:#272727;--waline-bg-color-hover: #444;--waline-border-color:#333;--waline-disable-bg-color:#444;--waline-disable-color:#272727;--waline-bq-color:#272727;--waline-info-bg-color:#272727;--waline-info-color:#666}",gl=e=>se(e)?e==="auto"?`@media(prefers-color-scheme:dark){body${Ae}}`:`${e}${Ae}`:e===!0?`:root${Ae}`:"",Me=(e,a)=>{let l=e.toString();for(;l.length<a;)l="0"+l;return l},hl=e=>{const a=Me(e.getDate(),2),l=Me(e.getMonth()+1,2);return`${Me(e.getFullYear(),2)}-${l}-${a}`},fl=(e,a,l)=>{if(!e)return"";const t=se(e)?new Date(e.indexOf(" ")!==-1?e.replace(/-/g,"/"):e):e,o=a.getTime()-t.getTime(),n=Math.floor(o/(24*3600*1e3));if(n===0){const m=o%864e5,d=Math.floor(m/(3600*1e3));if(d===0){const g=m%36e5,c=Math.floor(g/(60*1e3));if(c===0){const f=g%6e4;return`${Math.round(f/1e3)} ${l.seconds}`}return`${c} ${l.minutes}`}return`${d} ${l.hours}`}return n<0?l.now:n<8?`${n} ${l.days}`:hl(t)},wl=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,yl=e=>wl.test(e),kl=e=>!!/@[0-9]+\.[0-9]+\.[0-9]+/.test(e),bl=e=>{const a=re("WALINE_EMOJI",{}),l=kl(e);if(l){const t=a.value[e];if(t)return Promise.resolve(t)}return fetch(`${e}/info.json`).then(t=>t.json()).then(t=>{const o={folder:e,...t};return l&&(a.value[e]=o),o})},ct=(e,a="",l="",t="")=>`${a?`${a}/`:""}${l}${e}${t?`.${t}`:""}`,Cl=e=>Promise.all(e.map(a=>se(a)?bl(rt(a)):Promise.resolve(a))).then(a=>{const l={tabs:[],map:{}};return a.forEach(t=>{const{name:o,folder:n,icon:m,prefix:d,type:g,items:c}=t;l.tabs.push({name:o,icon:ct(m,n,d,g),items:c.map(f=>{const _=`${d||""}${f}`;return l.map[_]=ct(f,n,d,g),_})})}),l}),ut=e=>{e.name!=="AbortError"&&console.error(e.message)},Ue=e=>e instanceof HTMLElement?e:se(e)?document.querySelector(e):null,$l=e=>e.type.includes("image"),vt=e=>{const a=Array.from(e).find($l);return a?a.getAsFile():null},Ll=/\$.*?\$/,El=/^\$(.*?)\$/,Il=/^(?:\s{0,3})\$\$((?:[^\n]|\n[^\n])+?)\n{0,1}\$\$/,xl=e=>[{name:"blockMath",level:"block",tokenizer(a){const l=Il.exec(a);if(l!==null)return{type:"html",raw:l[0],text:e(!0,l[1])}}},{name:"inlineMath",level:"inline",start(a){const l=a.search(Ll);return l!==-1?l:a.length},tokenizer(a){const l=El.exec(a);if(l!==null)return{type:"html",raw:l[0],text:e(!1,l[1])}}}],mt=(e="",a={})=>e.replace(/:(.+?):/g,(l,t)=>a[t]?`<img class="wl-emoji" src="${a[t]}" alt="${t}">`:l),Rl=(e,{emojiMap:a,highlighter:l,texRenderer:t})=>{const o=new Zt;if(o.setOptions({breaks:!0}),l&&o.use(Xt({highlight:l})),t){const n=xl(t);o.use({extensions:n})}return o.parse(mt(e,a))},Se=e=>e.dataset.path||null,Al=e=>e.match(/[\w\d\s,.\u00C0-\u024F\u0400-\u04FF]+/giu),Ml=e=>e.match(/[\u4E00-\u9FD5]/gu),Ul=e=>{var a,l;return(((a=Al(e))==null?void 0:a.reduce((t,o)=>t+(["",",","."].includes(o.trim())?0:o.trim().split(/\s+/u).length),0))||0)+(((l=Ml(e))==null?void 0:l.length)||0)},Sl=async()=>{if(!navigator)return"";const{userAgentData:e}=navigator;let a=navigator.userAgent;if(!e||e.platform!=="Windows")return a;const{platformVersion:l}=await e.getHighEntropyValues(["platformVersion"]);return l&&parseInt(l.split(".")[0])>=13&&(a=a.replace("Windows NT 10.0","Windows NT 11.0")),a},dt=({serverURL:e,path:a=window.location.pathname,selector:l=".waline-comment-count",lang:t=navigator.language})=>{const o=new AbortController,n=document.querySelectorAll(l);return n.length&&xt({serverURL:ke(e),paths:Array.from(n).map(m=>it(Se(m)||a)),lang:t,signal:o.signal}).then(m=>{n.forEach((d,g)=>{d.innerText=m[g].toString()})}).catch(ut),o.abort.bind(o)},pt=({size:e})=>A("svg",{class:"wl-close-icon",viewBox:"0 0 1024 1024",width:e,height:e},[A("path",{d:"M697.173 85.333h-369.92c-144.64 0-241.92 101.547-241.92 252.587v348.587c0 150.613 97.28 252.16 241.92 252.16h369.92c144.64 0 241.494-101.547 241.494-252.16V337.92c0-151.04-96.854-252.587-241.494-252.587z",fill:"currentColor"}),A("path",{d:"m640.683 587.52-75.947-75.861 75.904-75.862a37.29 37.29 0 0 0 0-52.778 37.205 37.205 0 0 0-52.779 0l-75.946 75.818-75.862-75.946a37.419 37.419 0 0 0-52.821 0 37.419 37.419 0 0 0 0 52.821l75.947 75.947-75.776 75.733a37.29 37.29 0 1 0 52.778 52.821l75.776-75.776 75.947 75.947a37.376 37.376 0 0 0 52.779-52.821z",fill:"#888"})]),_l=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},A("path",{d:"m341.013 394.667 27.755 393.45h271.83l27.733-393.45h64.106l-28.01 397.952a64 64 0 0 1-63.83 59.498H368.768a64 64 0 0 1-63.83-59.52l-28.053-397.93h64.128zm139.307 19.818v298.667h-64V414.485h64zm117.013 0v298.667h-64V414.485h64zM181.333 288h640v64h-640v-64zm453.483-106.667v64h-256v-64h256z",fill:"red"})),jl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},A("path",{d:"M563.2 463.3 677 540c1.7 1.2 3.7 1.8 5.8 1.8.7 0 1.4-.1 2-.2 2.7-.5 5.1-2.1 6.6-4.4l25.3-37.8c1.5-2.3 2.1-5.1 1.6-7.8s-2.1-5.1-4.4-6.6l-73.6-49.1 73.6-49.1c2.3-1.5 3.9-3.9 4.4-6.6.5-2.7 0-5.5-1.6-7.8l-25.3-37.8a10.1 10.1 0 0 0-6.6-4.4c-.7-.1-1.3-.2-2-.2-2.1 0-4.1.6-5.8 1.8l-113.8 76.6c-9.2 6.2-14.7 16.4-14.7 27.5.1 11 5.5 21.3 14.7 27.4zM387 348.8h-45.5c-5.7 0-10.4 4.7-10.4 10.4v153.3c0 5.7 4.7 10.4 10.4 10.4H387c5.7 0 10.4-4.7 10.4-10.4V359.2c0-5.7-4.7-10.4-10.4-10.4zm333.8 241.3-41-20a10.3 10.3 0 0 0-8.1-.5c-2.6.9-4.8 2.9-5.9 5.4-30.1 64.9-93.1 109.1-164.4 115.2-5.7.5-9.9 5.5-9.5 11.2l3.9 45.5c.5 5.3 5 9.5 10.3 9.5h.9c94.8-8 178.5-66.5 218.6-152.7 2.4-5 .3-11.2-4.8-13.6zm186-186.1c-11.9-42-30.5-81.4-55.2-117.1-24.1-34.9-53.5-65.6-87.5-91.2-33.9-25.6-71.5-45.5-111.6-59.2-41.2-14-84.1-21.1-127.8-21.1h-1.2c-75.4 0-148.8 21.4-212.5 61.7-63.7 40.3-114.3 97.6-146.5 165.8-32.2 68.1-44.3 143.6-35.1 218.4 9.3 74.8 39.4 145 87.3 203.3.1.2.3.3.4.5l36.2 38.4c1.1 1.2 2.5 2.1 3.9 2.6 73.3 66.7 168.2 103.5 267.5 103.5 73.3 0 145.2-20.3 207.7-58.7 37.3-22.9 70.3-51.5 98.1-85 27.1-32.7 48.7-69.5 64.2-109.1 15.5-39.7 24.4-81.3 26.6-123.8 2.4-43.6-2.5-87-14.5-129zm-60.5 181.1c-8.3 37-22.8 72-43 104-19.7 31.1-44.3 58.6-73.1 81.7-28.8 23.1-61 41-95.7 53.4-35.6 12.7-72.9 19.1-110.9 19.1-82.6 0-161.7-30.6-222.8-86.2l-34.1-35.8c-23.9-29.3-42.4-62.2-55.1-97.7-12.4-34.7-18.8-71-19.2-107.9-.4-36.9 5.4-73.3 17.1-108.2 12-35.8 30-69.2 53.4-99.1 31.7-40.4 71.1-72 117.2-94.1 44.5-21.3 94-32.6 143.4-32.6 49.3 0 97 10.8 141.8 32 34.3 16.3 65.3 38.1 92 64.8 26.1 26 47.5 56 63.6 89.2 16.2 33.2 26.6 68.5 31 105.1 4.6 37.5 2.7 75.3-5.6 112.3z",fill:"currentColor"})),zl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[A("path",{d:"M784 112H240c-88 0-160 72-160 160v480c0 88 72 160 160 160h544c88 0 160-72 160-160V272c0-88-72-160-160-160zm96 640c0 52.8-43.2 96-96 96H240c-52.8 0-96-43.2-96-96V272c0-52.8 43.2-96 96-96h544c52.8 0 96 43.2 96 96v480z",fill:"currentColor"}),A("path",{d:"M352 480c52.8 0 96-43.2 96-96s-43.2-96-96-96-96 43.2-96 96 43.2 96 96 96zm0-128c17.6 0 32 14.4 32 32s-14.4 32-32 32-32-14.4-32-32 14.4-32 32-32zm462.4 379.2-3.2-3.2-177.6-177.6c-25.6-25.6-65.6-25.6-91.2 0l-80 80-36.8-36.8c-25.6-25.6-65.6-25.6-91.2 0L200 728c-4.8 6.4-8 14.4-8 24 0 17.6 14.4 32 32 32 9.6 0 16-3.2 22.4-9.6L380.8 640l134.4 134.4c6.4 6.4 14.4 9.6 24 9.6 17.6 0 32-14.4 32-32 0-9.6-4.8-17.6-9.6-24l-52.8-52.8 80-80L769.6 776c6.4 4.8 12.8 8 20.8 8 17.6 0 32-14.4 32-32 0-8-3.2-16-8-20.8z",fill:"currentColor"})]),Vl=({active:e=!1})=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[A("path",{d:`M850.654 323.804c-11.042-25.625-26.862-48.532-46.885-68.225-20.022-19.61-43.258-34.936-69.213-45.73-26.78-11.124-55.124-16.727-84.375-16.727-40.622 0-80.256 11.123-114.698 32.135A214.79 214.79 0 0 0 512 241.819a214.79 214.79 0 0 0-23.483-16.562c-34.442-21.012-74.076-32.135-114.698-32.135-29.25 0-57.595 5.603-84.375 16.727-25.872 10.711-49.19 26.12-69.213 45.73-20.105 19.693-35.843 42.6-46.885 68.225-11.453 26.615-17.303 54.877-17.303 83.963 0 27.439 5.603 56.03 16.727 85.117 9.31 24.307 22.659 49.52 39.715 74.981 27.027 40.293 64.188 82.316 110.33 124.915 76.465 70.615 152.189 119.394 155.402 121.371l19.528 12.525c8.652 5.52 19.776 5.52 28.427 0l19.529-12.525c3.213-2.06 78.854-50.756 155.401-121.371 46.143-42.6 83.304-84.622 110.33-124.915 17.057-25.46 30.487-50.674 39.716-74.981 11.124-29.087 16.727-57.678 16.727-85.117.082-29.086-5.768-57.348-17.221-83.963z${e?"":"M512 761.5S218.665 573.55 218.665 407.767c0-83.963 69.461-152.023 155.154-152.023 60.233 0 112.473 33.618 138.181 82.727 25.708-49.109 77.948-82.727 138.18-82.727 85.694 0 155.155 68.06 155.155 152.023C805.335 573.551 512 761.5 512 761.5z"}`,fill:e?"red":"currentColor"})]),Hl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},[A("path",{d:"M710.816 654.301c70.323-96.639 61.084-230.578-23.705-314.843-46.098-46.098-107.183-71.109-172.28-71.109-65.008 0-126.092 25.444-172.28 71.109-45.227 46.098-70.756 107.183-70.756 172.106 0 64.923 25.444 126.007 71.194 172.106 46.099 46.098 107.184 71.109 172.28 71.109 51.414 0 100.648-16.212 142.824-47.404l126.53 126.006c7.058 7.06 16.297 10.979 26.406 10.979 10.105 0 19.343-3.919 26.402-10.979 14.467-14.467 14.467-38.172 0-52.723L710.816 654.301zm-315.107-23.265c-65.88-65.88-65.88-172.54 0-238.42 32.069-32.07 74.245-49.149 119.471-49.149 45.227 0 87.407 17.603 119.472 49.149 65.88 65.879 65.88 172.539 0 238.42-63.612 63.178-175.242 63.178-238.943 0zm0 0",fill:"currentColor"}),A("path",{d:"M703.319 121.603H321.03c-109.8 0-199.469 89.146-199.469 199.38v382.034c0 109.796 89.236 199.38 199.469 199.38h207.397c20.653 0 37.384-16.645 37.384-37.299 0-20.649-16.731-37.296-37.384-37.296H321.03c-68.582 0-124.352-55.77-124.352-124.267V321.421c0-68.496 55.77-124.267 124.352-124.267h382.289c68.582 0 124.352 55.771 124.352 124.267V524.72c0 20.654 16.736 37.299 37.385 37.299 20.654 0 37.384-16.645 37.384-37.299V320.549c-.085-109.8-89.321-198.946-199.121-198.946zm0 0",fill:"currentColor"})]),Tl=()=>A("svg",{width:"16",height:"16",ariaHidden:"true"},A("path",{d:"M14.85 3H1.15C.52 3 0 3.52 0 4.15v7.69C0 12.48.52 13 1.15 13h13.69c.64 0 1.15-.52 1.15-1.15v-7.7C16 3.52 15.48 3 14.85 3zM9 11H7V8L5.5 9.92 4 8v3H2V5h2l1.5 2L7 5h2v6zm2.99.5L9.5 8H11V5h2v3h1.5l-2.51 3.5z",fill:"currentColor"})),Fl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},A("path",{d:"M810.667 213.333a64 64 0 0 1 64 64V704a64 64 0 0 1-64 64H478.336l-146.645 96.107a21.333 21.333 0 0 1-33.024-17.856V768h-85.334a64 64 0 0 1-64-64V277.333a64 64 0 0 1 64-64h597.334zm0 64H213.333V704h149.334v63.296L459.243 704h351.424V277.333zm-271.36 213.334v64h-176.64v-64h176.64zm122.026-128v64H362.667v-64h298.666z",fill:"currentColor"})),Nl=()=>A("svg",{viewBox:"0 0 1024 1024",width:"24",height:"24"},A("path",{d:"M813.039 318.772L480.53 651.278H360.718V531.463L693.227 198.961C697.904 194.284 704.027 192 710.157 192C716.302 192 722.436 194.284 727.114 198.961L813.039 284.88C817.72 289.561 820 295.684 820 301.825C820 307.95 817.72 314.093 813.039 318.772ZM710.172 261.888L420.624 551.431V591.376H460.561L750.109 301.825L710.172 261.888ZM490.517 291.845H240.906V771.09H720.156V521.479C720.156 504.947 733.559 491.529 750.109 491.529C766.653 491.529 780.063 504.947 780.063 521.479V791.059C780.063 813.118 762.18 831 740.125 831H220.937C198.882 831 181 813.118 181 791.059V271.872C181 249.817 198.882 231.935 220.937 231.935H490.517C507.06 231.935 520.47 245.352 520.47 261.888C520.47 278.424 507.06 291.845 490.517 291.845Z",fill:"currentColor"})),Wl=()=>A("svg",{class:"verified-icon",viewBox:"0 0 1024 1024",width:"14",height:"14"},A("path",{d:"m894.4 461.56-54.4-63.2c-10.4-12-18.8-34.4-18.8-50.4v-68c0-42.4-34.8-77.2-77.2-77.2h-68c-15.6 0-38.4-8.4-50.4-18.8l-63.2-54.4c-27.6-23.6-72.8-23.6-100.8 0l-62.8 54.8c-12 10-34.8 18.4-50.4 18.4h-69.2c-42.4 0-77.2 34.8-77.2 77.2v68.4c0 15.6-8.4 38-18.4 50l-54 63.6c-23.2 27.6-23.2 72.4 0 100l54 63.6c10 12 18.4 34.4 18.4 50v68.4c0 42.4 34.8 77.2 77.2 77.2h69.2c15.6 0 38.4 8.4 50.4 18.8l63.2 54.4c27.6 23.6 72.8 23.6 100.8 0l63.2-54.4c12-10.4 34.4-18.8 50.4-18.8h68c42.4 0 77.2-34.8 77.2-77.2v-68c0-15.6 8.4-38.4 18.8-50.4l54.4-63.2c23.2-27.6 23.2-73.2-.4-100.8zm-216-25.2-193.2 193.2a30 30 0 0 1-42.4 0l-96.8-96.8a30.16 30.16 0 0 1 0-42.4c11.6-11.6 30.8-11.6 42.4 0l75.6 75.6 172-172c11.6-11.6 30.8-11.6 42.4 0 11.6 11.6 11.6 30.8 0 42.4z",fill:"#27ae60"})),ve=({size:e=100})=>A("svg",{width:e,height:e,viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid"},A("circle",{cx:50,cy:50,fill:"none",stroke:"currentColor",strokeWidth:"4",r:"40","stroke-dasharray":"85 30"},A("animateTransform",{attributeName:"transform",type:"rotate",repeatCount:"indefinite",dur:"1s",values:"0 50 50;360 50 50",keyTimes:"0;1"}))),Pl=()=>A("svg",{width:24,height:24,fill:"currentcolor",viewBox:"0 0 24 24"},[A("path",{style:"transform: translateY(0.5px)",d:"M18.968 10.5H15.968V11.484H17.984V12.984H15.968V15H14.468V9H18.968V10.5V10.5ZM8.984 9C9.26533 9 9.49967 9.09367 9.687 9.281C9.87433 9.46833 9.968 9.70267 9.968 9.984V10.5H6.499V13.5H8.468V12H9.968V14.016C9.968 14.2973 9.87433 14.5317 9.687 14.719C9.49967 14.9063 9.26533 15 8.984 15H5.984C5.70267 15 5.46833 14.9063 5.281 14.719C5.09367 14.5317 5 14.2973 5 14.016V9.985C5 9.70367 5.09367 9.46933 5.281 9.282C5.46833 9.09467 5.70267 9.001 5.984 9.001H8.984V9ZM11.468 9H12.968V15H11.468V9V9Z"}),A("path",{d:"M18.5 3H5.75C3.6875 3 2 4.6875 2 6.75V18C2 20.0625 3.6875 21.75 5.75 21.75H18.5C20.5625 21.75 22.25 20.0625 22.25 18V6.75C22.25 4.6875 20.5625 3 18.5 3ZM20.75 18C20.75 19.2375 19.7375 20.25 18.5 20.25H5.75C4.5125 20.25 3.5 19.2375 3.5 18V6.75C3.5 5.5125 4.5125 4.5 5.75 4.5H18.5C19.7375 4.5 20.75 5.5125 20.75 6.75V18Z"})]),Dl=()=>re("WALINE_USER_META",{nick:"",mail:"",link:""}),Bl=()=>re("WALINE_COMMENT_BOX_EDITOR",""),Ol="WALINE_LIKE";let gt=null;const ht=()=>gt||(gt=re(Ol,[])),ql="WALINE_REACTION";let ft=null;const Gl=()=>ft??(ft=re(ql,{})),wt={},Kl=e=>{const a=wt[e]??(wt[e]=Jt(e,{useRecaptchaNet:!0,autoHideBadge:!0}));return{execute:l=>a.then(t=>t.execute(l))}},Zl=e=>({execute:async a=>{const{load:l}=Ot("https://challenges.cloudflare.com/turnstile/v0/api.js",void 0,{async:!1});await l();const t=window==null?void 0:window.turnstile;return new Promise(o=>{t==null||t.ready(()=>{t==null||t.render(".wl-captcha-container",{sitekey:e,action:a,size:"compact",callback:o})})})}}),Xl="WALINE_USER";let yt=null;const be=()=>yt??(yt=re(Xl,{})),Jl={key:0,class:"wl-reaction"},Yl=["textContent"],Ql={class:"wl-reaction-list"},ea=["onClick"],ta={class:"wl-reaction-img"},la=["src","alt"],aa=["textContent"],na=["textContent"];var oa=ue({__name:"ArticleReaction",setup(e,{expose:a}){a();const l=Gl(),t=Le("config"),o=I(-1),n=I([]),m=W(()=>t.value.locale),d=W(()=>t.value.reaction.length>0),g=W(()=>{const{reaction:p,path:M}=t.value;return p.map((S,E)=>({icon:S,desc:m.value[`reaction${E}`],active:l.value[M]===E}))});let c;const f=async()=>{if(!d.value)return;const{serverURL:p,lang:M,path:S,reaction:E}=t.value,y=new AbortController;c=y.abort.bind(y);const i=await Rt({serverURL:p,lang:M,paths:[S],type:E.map((w,F)=>`reaction${F}`),signal:y.signal});n.value=E.map((w,F)=>i[0][`reaction${F}`])},_=async p=>{if(o.value===-1){const{serverURL:M,lang:S,path:E}=t.value,y=l.value[E];o.value=p,y!==void 0&&(await Be({serverURL:M,lang:S,path:E,type:`reaction${y}`,action:"desc"}),n.value[y]=Math.max(n.value[y]-1,0)),y!==p&&(await Be({serverURL:M,lang:S,path:E,type:`reaction${p}`}),n.value[p]=(n.value[p]||0)+1),y===p?delete l.value[E]:l.value[E]=p,o.value=-1}};return fe(()=>{te(()=>[t.value.serverURL,t.value.path],()=>{f()},{immediate:!0})}),Ee(()=>c==null?void 0:c()),(p,M)=>g.value.length?(r(),u("div",Jl,[h("div",{class:"wl-reaction-title",textContent:U(m.value.reactionTitle)},null,8,Yl),h("ul",Ql,[(r(!0),u(P,null,J(g.value,({active:S,icon:E,desc:y},i)=>(r(),u("li",{key:i,class:q(["wl-reaction-item",{active:S}]),onClick:w=>_(i)},[h("div",ta,[h("img",{src:E,alt:y},null,8,la),o.value===i?(r(),le(L(ve),{key:0,class:"wl-reaction-loading"})):(r(),u("div",{key:1,class:"wl-reaction-votes",textContent:U(n.value[i]||0)},null,8,aa))]),h("div",{class:"wl-reaction-text",textContent:U(y)},null,8,na)],10,ea))),128))])])):x("v-if",!0)}}),me=(e,a)=>{const l=e.__vccOpts||e;for(const[t,o]of a)l[t]=o;return l},ia=me(oa,[["__file","ArticleReaction.vue"]]);const ra=["data-index"],sa=["src","title","onClick"];var ca=ue({__name:"ImageWall",props:{items:{default:()=>[]},columnWidth:{default:300},gap:{default:0}},emits:["insert"],setup(e,{expose:a}){const l=e;a();let t=null;const o=I(null),n=I({}),m=I([]),d=()=>{const p=Math.floor((o.value.getBoundingClientRect().width+l.gap)/(l.columnWidth+l.gap));return p>0?p:1},g=p=>new Array(p).fill(null).map(()=>[]),c=async p=>{var M;if(p>=l.items.length)return;await Tt();const S=Array.from(((M=o.value)==null?void 0:M.children)||[]).reduce((E,y)=>y.getBoundingClientRect().height<E.getBoundingClientRect().height?y:E);m.value[Number(S.dataset.index)].push(p),await c(p+1)},f=async(p=!1)=>{if(m.value.length===d()&&!p)return;m.value=g(d());const M=window.scrollY;await c(0),window.scrollTo({top:M})},_=p=>{n.value[p.target.src]=!0};return fe(()=>{f(!0),t=new ResizeObserver(()=>{f()}),t.observe(o.value),te(()=>[l.items],()=>{n.value={},f(!0)}),te(()=>[l.columnWidth,l.gap],()=>{f()})}),Ht(()=>t.unobserve(o.value)),(p,M)=>(r(),u("div",{ref_key:"wall",ref:o,class:"wl-gallery",style:Oe({gap:`${p.gap}px`})},[(r(!0),u(P,null,J(m.value,(S,E)=>(r(),u("div",{key:E,class:"wl-gallery-column","data-index":E,style:Oe({gap:`${p.gap}px`})},[(r(!0),u(P,null,J(S,y=>(r(),u(P,{key:y},[n.value[p.items[y].src]?x("v-if",!0):(r(),le(L(ve),{key:0,size:36,style:{margin:"20px auto"}})),h("img",{class:"wl-gallery-item",src:p.items[y].src,title:p.items[y].title,loading:"lazy",onLoad:_,onClick:i=>p.$emit("insert",`![](${p.items[y].src})`)},null,40,sa)],64))),128))],12,ra))),128))],4))}}),ua=me(ca,[["__file","ImageWall.vue"]]);const va={class:"wl-comment"},ma={key:0,class:"wl-login-info"},da={class:"wl-avatar"},pa=["title"],ga=["title"],ha=["src"],fa=["title","textContent"],wa={class:"wl-panel"},ya=["for","textContent"],ka=["id","onUpdate:modelValue","name","type"],ba=["placeholder"],Ca={class:"wl-preview"},$a=h("hr",null,null,-1),La=["innerHTML"],Ea={class:"wl-footer"},Ia={class:"wl-actions"},xa={href:"https://guides.github.com/features/mastering-markdown/",title:"Markdown Guide","aria-label":"Markdown is supported",class:"wl-action",target:"_blank",rel:"noopener noreferrer"},Ra=["title"],Aa=["title"],Ma=["title"],Ua=["title"],Sa={class:"wl-info"},_a=h("div",{class:"wl-captcha-container"},null,-1),ja={class:"wl-text-number"},za={key:0},Va=["textContent"],Ha=["textContent"],Ta=["disabled"],Fa=["placeholder"],Na={key:1,class:"wl-loading"},Wa={key:0,class:"wl-tab-wrapper"},Pa=["title","onClick"],Da=["src","alt"],Ba={key:0,class:"wl-tabs"},Oa=["onClick"],qa=["src","alt","title"],Ga=["title"];var Ka=ue({__name:"CommentBox",props:{edit:{default:null},rootId:{default:""},replyId:{default:""},replyUser:{default:""}},emits:["log","cancelEdit","cancelReply","submit"],setup(e,{expose:a,emit:l}){const t=e,o=l;a();const n=Le("config"),m=Bl(),d=Dl(),g=be(),c=I({}),f=I(null),_=I(null),p=I(null),M=I(null),S=I(null),E=I(null),y=I(null),i=I({tabs:[],map:{}}),w=I(0),F=I(!1),D=I(!1),R=I(!1),z=I(""),ie=I(0),H=Ie({loading:!0,list:[]}),oe=I(0),ee=I(!1),de=I(""),Y=I(!1),$=I(!1),k=W(()=>n.value.locale),j=W(()=>{var v;return!!((v=g.value)!=null&&v.token)}),G=W(()=>n.value.imageUploader!==!1),B=v=>{const s=f.value,b=s.selectionStart,V=s.selectionEnd||0,C=s.scrollTop;m.value=s.value.substring(0,b)+v+s.value.substring(V,s.value.length),s.focus(),s.selectionStart=b+v.length,s.selectionEnd=b+v.length,s.scrollTop=C},X=v=>{const s=v.key;(v.ctrlKey||v.metaKey)&&s==="Enter"&&je()},K=v=>{const s=`![${n.value.locale.uploading} ${v.name}]()`;return B(s),Y.value=!0,Promise.resolve().then(()=>n.value.imageUploader(v)).then(b=>{m.value=m.value.replace(s,`\r
![${v.name}](${b})`)}).catch(b=>{alert(b.message),m.value=m.value.replace(s,"")}).then(()=>{Y.value=!1})},ce=v=>{var s;if((s=v.dataTransfer)!=null&&s.items){const b=vt(v.dataTransfer.items);b&&G.value&&(K(b),v.preventDefault())}},_e=v=>{if(v.clipboardData){const s=vt(v.clipboardData.items);s&&G.value&&K(s)}},Ce=()=>{const v=_.value;v.files&&G.value&&K(v.files[0]).then(()=>{v.value=""})},je=async()=>{var v,s,b,V,C,O;const{serverURL:N,lang:Q,login:pe,wordLimit:Ne,requiredMeta:We,recaptchaV3Key:Pe,turnstileKey:De}=n.value,It=await Sl(),T={comment:de.value,nick:d.value.nick,mail:d.value.mail,link:d.value.link,url:n.value.path,ua:It};if((v=g.value)!=null&&v.token&&!t.edit)T.nick=g.value.display_name,T.mail=g.value.email,T.link=g.value.url;else{if(pe==="force")return;if(We.indexOf("nick")>-1&&!T.nick)return(s=c.value.nick)==null||s.focus(),alert(k.value.nickError);if(We.indexOf("mail")>-1&&!T.mail||T.mail&&!yl(T.mail))return(b=c.value.mail)==null||b.focus(),alert(k.value.mailError);T.nick||(T.nick=k.value.anonymous)}if(!T.comment){(V=f.value)==null||V.focus();return}if(!ee.value)return alert(k.value.wordHint.replace("$0",Ne[0].toString()).replace("$1",Ne[1].toString()).replace("$2",ie.value.toString()));T.comment=mt(T.comment,i.value.map),t.replyId&&t.rootId&&(T.pid=t.replyId,T.rid=t.rootId,T.at=t.replyUser),Y.value=!0;try{Pe&&(T.recaptchaV3=await Kl(Pe).execute("social")),De&&(T.turnstile=await Zl(De).execute("social"));const ge={serverURL:N,lang:Q,token:(C=g.value)==null?void 0:C.token,comment:T},$e=await(t.edit?he({objectId:t.edit.objectId,...ge}):At(ge));if(Y.value=!1,$e.errmsg)return alert($e.errmsg);o("submit",$e.data),m.value="",z.value="",t.replyId&&o("cancelReply"),(O=t.edit)!=null&&O.objectId&&o("cancelEdit")}catch(ge){Y.value=!1,alert(ge.message)}},Lt=v=>{v.preventDefault();const{lang:s,serverURL:b}=n.value;Mt({serverURL:b,lang:s}).then(V=>{g.value=V,(V.remember?localStorage:sessionStorage).setItem("WALINE_USER",JSON.stringify(V)),o("log")})},Et=()=>{g.value={},localStorage.setItem("WALINE_USER","null"),sessionStorage.setItem("WALINE_USER","null"),o("log")},ze=v=>{v.preventDefault();const{lang:s,serverURL:b}=n.value,V=800,C=800,O=(window.innerWidth-V)/2,N=(window.innerHeight-C)/2,Q=new URLSearchParams({lng:s,token:g.value.token}),pe=window.open(`${b}/ui/profile?${Q.toString()}`,"_blank",`width=${V},height=${C},left=${O},top=${N},scrollbars=no,resizable=no,status=no,location=no,toolbar=no,menubar=no`);pe==null||pe.postMessage({type:"TOKEN",data:g.value.token},"*")},Ve=v=>{var s,b,V,C;!((s=p.value)!=null&&s.contains(v.target))&&!((b=M.value)!=null&&b.contains(v.target))&&(F.value=!1),!((V=S.value)!=null&&V.contains(v.target))&&!((C=E.value)!=null&&C.contains(v.target))&&(D.value=!1)},He=async v=>{var s;const{scrollTop:b,clientHeight:V,scrollHeight:C}=v.target,O=(V+b)/C,N=n.value.search,Q=((s=y.value)==null?void 0:s.value)||"";O<.9||H.loading||$.value||(H.loading=!0,(N.more&&H.list.length?await N.more(Q,H.list.length):await N.search(Q)).length?H.list=[...H.list,...N.more&&H.list.length?await N.more(Q,H.list.length):await N.search(Q)]:$.value=!0,H.loading=!1,setTimeout(()=>{v.target.scrollTop=b},50))},Te=qt(v=>{H.list=[],$.value=!1,He(v)},300);te([n,ie],([v,s])=>{const{wordLimit:b}=v;b?s<b[0]&&b[0]!==0?(oe.value=b[0],ee.value=!1):s>b[1]?(oe.value=b[1],ee.value=!1):(oe.value=b[1],ee.value=!0):(oe.value=0,ee.value=!0)},{immediate:!0});const Fe=({data:v})=>{!v||v.type!=="profile"||(g.value={...g.value,...v.data},[localStorage,sessionStorage].filter(s=>s.getItem("WALINE_USER")).forEach(s=>s.setItem("WALINE_USER",JSON.stringify(g))))};return fe(()=>{var v;document.body.addEventListener("click",Ve),window.addEventListener("message",Fe),(v=t.edit)!=null&&v.objectId&&(m.value=t.edit.orig),te(D,async s=>{if(!s)return;const b=n.value.search;y.value&&(y.value.value=""),H.loading=!0,H.list=b.default?await b.default():await b.search(""),H.loading=!1}),te(()=>m.value,s=>{const{highlighter:b,texRenderer:V}=n.value;de.value=s,z.value=Rl(s,{emojiMap:i.value.map,highlighter:b,texRenderer:V}),ie.value=Ul(s),s?Ke(f.value):Ke.destroy(f.value)},{immediate:!0}),te(()=>n.value.emoji,s=>Cl(s).then(b=>{i.value=b}),{immediate:!0})}),Ee(()=>{document.body.removeEventListener("click",Ve),window.removeEventListener("message",Fe)}),(v,s)=>{var b,V;return r(),u("div",va,[L(n).login!=="disable"&&j.value&&!((b=v.edit)!=null&&b.objectId)?(r(),u("div",ma,[h("div",da,[h("button",{type:"submit",class:"wl-logout-btn",title:k.value.logout,onClick:Et},[Z(L(pt),{size:14})],8,pa),h("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:k.value.profile,onClick:ze},[h("img",{src:L(g).avatar,alt:"avatar"},null,8,ha)],8,ga)]),h("a",{href:"#",class:"wl-login-nick","aria-label":"Profile",title:k.value.profile,onClick:ze,textContent:U(L(g).display_name)},null,8,fa)])):x("v-if",!0),h("div",wa,[L(n).login!=="force"&&L(n).meta.length&&!j.value?(r(),u("div",{key:0,class:q(["wl-header",`item${L(n).meta.length}`])},[(r(!0),u(P,null,J(L(n).meta,C=>(r(),u("div",{key:C,class:"wl-header-item"},[h("label",{for:`wl-${C}`,textContent:U(k.value[C]+(L(n).requiredMeta.includes(C)||!L(n).requiredMeta.length?"":`(${k.value.optional})`))},null,8,ya),we(h("input",{id:`wl-${C}`,ref_for:!0,ref:O=>{O&&(c.value[C]=O)},"onUpdate:modelValue":O=>L(d)[C]=O,class:q(["wl-input",`wl-${C}`]),name:C,type:C==="mail"?"email":"text"},null,10,ka),[[Ft,L(d)[C]]])]))),128))],2)):x("v-if",!0),we(h("textarea",{id:"wl-edit",ref_key:"editorRef",ref:f,"onUpdate:modelValue":s[0]||(s[0]=C=>Nt(m)?m.value=C:null),class:"wl-editor",placeholder:v.replyUser?`@${v.replyUser}`:k.value.placeholder,onKeydown:X,onDrop:ce,onPaste:_e},null,40,ba),[[Wt,L(m)]]),we(h("div",Ca,[$a,h("h4",null,U(k.value.preview)+":",1),h("div",{class:"wl-content",innerHTML:z.value},null,8,La)],512),[[qe,R.value]]),h("div",Ea,[h("div",Ia,[h("a",xa,[Z(L(Tl))]),we(h("button",{ref_key:"emojiButtonRef",ref:p,type:"button",class:q(["wl-action",{active:F.value}]),title:k.value.emoji,onClick:s[1]||(s[1]=C=>F.value=!F.value)},[Z(L(jl))],10,Ra),[[qe,i.value.tabs.length]]),L(n).search?(r(),u("button",{key:0,ref_key:"gifButtonRef",ref:S,type:"button",class:q(["wl-action",{active:D.value}]),title:k.value.gif,onClick:s[2]||(s[2]=C=>D.value=!D.value)},[Z(L(Pl))],10,Aa)):x("v-if",!0),h("input",{id:"wl-image-upload",ref_key:"imageUploadRef",ref:_,class:"upload",type:"file",accept:".png,.jpg,.jpeg,.webp,.bmp,.gif",onChange:Ce},null,544),G.value?(r(),u("label",{key:1,for:"wl-image-upload",class:"wl-action",title:k.value.uploadImage},[Z(L(zl))],8,Ma)):x("v-if",!0),h("button",{type:"button",class:q(["wl-action",{active:R.value}]),title:k.value.preview,onClick:s[3]||(s[3]=C=>R.value=!R.value)},[Z(L(Hl))],10,Ua)]),h("div",Sa,[_a,h("div",ja,[ae(U(ie.value)+" ",1),L(n).wordLimit?(r(),u("span",za,[ae("  /  "),h("span",{class:q({illegal:!ee.value}),textContent:U(oe.value)},null,10,Va)])):x("v-if",!0),ae("  "+U(k.value.word),1)]),L(n).login!=="disable"&&!j.value?(r(),u("button",{key:0,type:"button",class:"wl-btn",onClick:Lt,textContent:U(k.value.login)},null,8,Ha)):x("v-if",!0),L(n).login!=="force"||j.value?(r(),u("button",{key:1,type:"submit",class:"primary wl-btn",title:"Cmd|Ctrl + Enter",disabled:Y.value,onClick:je},[Y.value?(r(),le(L(ve),{key:0,size:16})):(r(),u(P,{key:1},[ae(U(k.value.submit),1)],64))],8,Ta)):x("v-if",!0)]),h("div",{ref_key:"gifPopupRef",ref:E,class:q(["wl-gif-popup",{display:D.value}])},[h("input",{ref_key:"gifSearchInputRef",ref:y,type:"text",placeholder:k.value.gifSearchPlaceholder,onInput:s[4]||(s[4]=(...C)=>L(Te)&&L(Te)(...C))},null,40,Fa),H.list.length?(r(),le(ua,{key:0,items:H.list,"column-width":200,gap:6,onInsert:s[5]||(s[5]=C=>B(C)),onScroll:He},null,8,["items"])):x("v-if",!0),H.loading?(r(),u("div",Na,[Z(L(ve),{size:30})])):x("v-if",!0)],2),h("div",{ref_key:"emojiPopupRef",ref:M,class:q(["wl-emoji-popup",{display:F.value}])},[(r(!0),u(P,null,J(i.value.tabs,(C,O)=>(r(),u(P,{key:C.name},[O===w.value?(r(),u("div",Wa,[(r(!0),u(P,null,J(C.items,N=>(r(),u("button",{key:N,type:"button",title:N,onClick:Q=>B(`:${N}:`)},[F.value?(r(),u("img",{key:0,class:"wl-emoji",src:i.value.map[N],alt:N,loading:"lazy",referrerPolicy:"no-referrer"},null,8,Da)):x("v-if",!0)],8,Pa))),128))])):x("v-if",!0)],64))),128)),i.value.tabs.length>1?(r(),u("div",Ba,[(r(!0),u(P,null,J(i.value.tabs,(C,O)=>(r(),u("button",{key:C.name,type:"button",class:q(["wl-tab",{active:w.value===O}]),onClick:N=>w.value=O},[h("img",{class:"wl-emoji",src:C.icon,alt:C.name,title:C.name,loading:"lazy",referrerPolicy:"no-referrer"},null,8,qa)],10,Oa))),128))])):x("v-if",!0)],2)])]),v.replyId||(V=v.edit)!=null&&V.objectId?(r(),u("button",{key:1,type:"button",class:"wl-close",title:k.value.cancelReply,onClick:s[6]||(s[6]=C=>v.$emit(v.replyId?"cancelReply":"cancelEdit"))},[Z(L(pt),{size:24})],8,Ga)):x("v-if",!0)])}}}),kt=me(Ka,[["__file","CommentBox.vue"]]);const Za=["id"],Xa={class:"wl-user","aria-hidden":"true"},Ja=["src"],Ya={class:"wl-card"},Qa={class:"wl-head"},en=["href"],tn={key:1,class:"wl-nick"},ln=["textContent"],an=["textContent"],nn=["textContent"],on=["textContent"],rn=["textContent"],sn={class:"wl-comment-actions"},cn=["title"],un=["title"],vn={class:"wl-meta","aria-hidden":"true"},mn=["data-value","textContent"],dn=["innerHTML"],pn={key:1,class:"wl-admin-actions"},gn={class:"wl-comment-status"},hn=["disabled","onClick","textContent"],fn={key:3,class:"wl-quote"};var wn=ue({__name:"CommentCard",props:{comment:{},edit:{default:null},rootId:{},reply:{default:null}},emits:["log","submit","delete","edit","like","status","sticky","reply"],setup(e,{emit:a}){const l=e,t=a,o=["approved","waiting","spam"],n=Le("config"),m=ht(),d=Gt(),g=be(),c=W(()=>n.value.locale),f=W(()=>{const{link:i}=l.comment;return i?st(i)?i:`https://${i}`:""}),_=W(()=>m.value.includes(l.comment.objectId)),p=W(()=>fl(new Date(l.comment.time),d.value,c.value)),M=W(()=>g.value.type==="administrator"),S=W(()=>l.comment.user_id&&g.value.objectId===l.comment.user_id),E=W(()=>{var i;return l.comment.objectId===((i=l.reply)==null?void 0:i.objectId)}),y=W(()=>{var i;return l.comment.objectId===((i=l.edit)==null?void 0:i.objectId)});return(i,w)=>{var F;const D=Pt("CommentCard",!0);return r(),u("div",{id:i.comment.objectId,class:"wl-card-item"},[h("div",Xa,[i.comment.avatar?(r(),u("img",{key:0,class:"wl-user-avatar",src:i.comment.avatar},null,8,Ja)):x("v-if",!0),i.comment.type?(r(),le(L(Wl),{key:1})):x("v-if",!0)]),h("div",Ya,[h("div",Qa,[f.value?(r(),u("a",{key:0,class:"wl-nick",href:f.value,target:"_blank",rel:"nofollow noopener noreferrer"},U(i.comment.nick),9,en)):(r(),u("span",tn,U(i.comment.nick),1)),i.comment.type==="administrator"?(r(),u("span",{key:2,class:"wl-badge",textContent:U(c.value.admin)},null,8,ln)):x("v-if",!0),i.comment.label?(r(),u("span",{key:3,class:"wl-badge",textContent:U(i.comment.label)},null,8,an)):x("v-if",!0),i.comment.sticky?(r(),u("span",{key:4,class:"wl-badge",textContent:U(c.value.sticky)},null,8,nn)):x("v-if",!0),typeof i.comment.level=="number"?(r(),u("span",{key:5,class:q(`wl-badge level${i.comment.level}`),textContent:U(c.value[`level${i.comment.level}`]||`Level ${i.comment.level}`)},null,10,on)):x("v-if",!0),h("span",{class:"wl-time",textContent:U(p.value)},null,8,rn),h("div",sn,[M.value||S.value?(r(),u(P,{key:0},[h("button",{type:"button",class:"wl-edit",onClick:w[0]||(w[0]=R=>t("edit",i.comment))},[Z(L(Nl))]),h("button",{type:"button",class:"wl-delete",onClick:w[1]||(w[1]=R=>t("delete",i.comment))},[Z(L(_l))])],64)):x("v-if",!0),h("button",{type:"button",class:"wl-like",title:_.value?c.value.cancelLike:c.value.like,onClick:w[2]||(w[2]=R=>t("like",i.comment))},[Z(L(Vl),{active:_.value},null,8,["active"]),ae(" "+U("like"in i.comment?i.comment.like:""),1)],8,cn),h("button",{type:"button",class:q(["wl-reply",{active:E.value}]),title:E.value?c.value.cancelReply:c.value.reply,onClick:w[3]||(w[3]=R=>t("reply",E.value?null:i.comment))},[Z(L(Fl))],10,un)])]),h("div",vn,[(r(),u(P,null,J(["addr","browser","os"],R=>(r(),u(P,null,[i.comment[R]?(r(),u("span",{key:R,class:q(`wl-${R}`),"data-value":i.comment[R],textContent:U(i.comment[R])},null,10,mn)):x("v-if",!0)],64))),64))]),y.value?x("v-if",!0):(r(),u("div",{key:0,class:"wl-content",innerHTML:i.comment.comment},null,8,dn)),M.value&&!y.value?(r(),u("div",pn,[h("span",gn,[(r(),u(P,null,J(o,R=>h("button",{key:R,type:"submit",class:q(`wl-btn wl-${R}`),disabled:i.comment.status===R,onClick:z=>t("status",{status:R,comment:i.comment}),textContent:U(c.value[R])},null,10,hn)),64))]),M.value&&!("rid"in i.comment)?(r(),u("button",{key:0,type:"submit",class:"wl-btn wl-sticky",onClick:w[4]||(w[4]=R=>t("sticky",i.comment))},U(i.comment.sticky?c.value.unsticky:c.value.sticky),1)):x("v-if",!0)])):x("v-if",!0),E.value||y.value?(r(),u("div",{key:2,class:q({"wl-reply-wrapper":E.value,"wl-edit-wrapper":y.value})},[Z(kt,{edit:i.edit,"reply-id":(F=i.reply)==null?void 0:F.objectId,"reply-user":i.comment.nick,"root-id":i.rootId,onLog:w[5]||(w[5]=R=>t("log")),onCancelReply:w[6]||(w[6]=R=>t("reply",null)),onCancelEdit:w[7]||(w[7]=R=>t("edit",null)),onSubmit:w[8]||(w[8]=R=>t("submit",R))},null,8,["edit","reply-id","reply-user","root-id"])],2)):x("v-if",!0),"children"in i.comment?(r(),u("div",fn,[(r(!0),u(P,null,J(i.comment.children,R=>(r(),le(D,{key:R.objectId,comment:R,reply:i.reply,edit:i.edit,"root-id":i.rootId,onLog:w[9]||(w[9]=z=>t("log")),onDelete:w[10]||(w[10]=z=>t("delete",z)),onEdit:w[11]||(w[11]=z=>t("edit",z)),onLike:w[12]||(w[12]=z=>t("like",z)),onReply:w[13]||(w[13]=z=>t("reply",z)),onStatus:w[14]||(w[14]=z=>t("status",z)),onSticky:w[15]||(w[15]=z=>t("sticky",z)),onSubmit:w[16]||(w[16]=z=>t("submit",z))},null,8,["comment","reply","edit","root-id"]))),128))])):x("v-if",!0)])],8,Za)}}}),yn=me(wn,[["__file","CommentCard.vue"]]);const bt="3.1.3",kn={"data-waline":""},bn={class:"wl-meta-head"},Cn={class:"wl-count"},$n=["textContent"],Ln={class:"wl-sort"},En=["onClick"],In={class:"wl-cards"},xn={key:1,class:"wl-operation"},Rn=["textContent"],An={key:2,class:"wl-loading"},Mn=["textContent"],Un={key:4,class:"wl-operation"},Sn=["textContent"],_n={key:5,class:"wl-power"},jn=h("a",{href:"https://github.com/walinejs/waline",target:"_blank",rel:"noopener noreferrer"}," Waline ",-1);var zn=ue({__name:"WalineComment",props:["serverURL","path","meta","requiredMeta","dark","commentSorting","lang","locale","pageSize","wordLimit","emoji","login","highlighter","texRenderer","imageUploader","search","copyright","recaptchaV3Key","turnstileKey","reaction"],setup(e){const a=e,l={latest:"insertedAt_desc",oldest:"insertedAt_asc",hottest:"like_desc"},t=Object.keys(l),o=be(),n=ht(),m=I("loading"),d=I(0),g=I(1),c=I(0),f=W(()=>pl(a)),_=I(f.value.commentSorting),p=I([]),M=I(null),S=I(null),E=W(()=>gl(f.value.dark)),y=W(()=>f.value.locale);Kt(E,{id:"waline-darkmode"});let i;const w=$=>{var k;const{serverURL:j,path:G,pageSize:B}=f.value,X=new AbortController;m.value="loading",i==null||i(),St({serverURL:j,lang:f.value.lang,path:G,pageSize:B,sortBy:l[_.value],page:$,signal:X.signal,token:(k=o.value)==null?void 0:k.token}).then(K=>{m.value="success",d.value=K.count,p.value.push(...K.data),g.value=$,c.value=K.totalPages}).catch(K=>{K.name!=="AbortError"&&(console.error(K.message),m.value="error")}),i=X.abort.bind(X)},F=()=>w(g.value+1),D=()=>{d.value=0,p.value=[],w(1)},R=$=>{_.value!==$&&(_.value=$,D())},z=$=>{M.value=$},ie=$=>{S.value=$},H=$=>{if(S.value)S.value.comment=$.comment,S.value.orig=$.orig;else if("rid"in $){const k=p.value.find(({objectId:j})=>j===$.rid);if(!k)return;Array.isArray(k.children)||(k.children=[]),k.children.push($)}else p.value.unshift($),d.value+=1},oe=async({comment:$,status:k})=>{var j;if($.status===k)return;const{serverURL:G,lang:B}=f.value;await he({serverURL:G,lang:B,token:(j=o.value)==null?void 0:j.token,objectId:$.objectId,comment:{status:k}}),$.status=k},ee=async $=>{var k;if("rid"in $)return;const{serverURL:j,lang:G}=f.value;await he({serverURL:j,lang:G,token:(k=o.value)==null?void 0:k.token,objectId:$.objectId,comment:{sticky:$.sticky?0:1}}),$.sticky=!$.sticky},de=async({objectId:$})=>{var k;if(!confirm("Are you sure you want to delete this comment?"))return;const{serverURL:j,lang:G}=f.value;await Ut({serverURL:j,lang:G,token:(k=o.value)==null?void 0:k.token,objectId:$}),p.value.some((B,X)=>B.objectId===$?(p.value=p.value.filter((K,ce)=>ce!==X),!0):B.children.some((K,ce)=>K.objectId===$?(p.value[X].children=B.children.filter((_e,Ce)=>Ce!==ce),!0):!1))},Y=async $=>{var k;const{serverURL:j,lang:G}=f.value,{objectId:B}=$,X=n.value.includes(B);await he({serverURL:j,lang:G,objectId:B,token:(k=o.value)==null?void 0:k.token,comment:{like:!X}}),X?n.value=n.value.filter(K=>K!==B):(n.value=[...n.value,B],n.value.length>50&&(n.value=n.value.slice(-50))),$.like=($.like||0)+(X?-1:1)};return Dt("config",f),fe(()=>{te(()=>[a.serverURL,a.path],()=>D(),{immediate:!0})}),Ee(()=>i==null?void 0:i()),($,k)=>(r(),u("div",kn,[Z(ia),M.value?x("v-if",!0):(r(),le(kt,{key:0,onLog:D,onSubmit:H})),h("div",bn,[h("div",Cn,[d.value?(r(),u("span",{key:0,class:"wl-num",textContent:U(d.value)},null,8,$n)):x("v-if",!0),ae(" "+U(y.value.comment),1)]),h("ul",Ln,[(r(!0),u(P,null,J(L(t),j=>(r(),u("li",{key:j,class:q([j===_.value?"active":""]),onClick:G=>R(j)},U(y.value[j]),11,En))),128))])]),h("div",In,[(r(!0),u(P,null,J(p.value,j=>(r(),le(yn,{key:j.objectId,"root-id":j.objectId,comment:j,reply:M.value,edit:S.value,onLog:D,onReply:z,onEdit:ie,onSubmit:H,onStatus:oe,onDelete:de,onSticky:ee,onLike:Y},null,8,["root-id","comment","reply","edit"]))),128))]),m.value==="error"?(r(),u("div",xn,[h("button",{type:"button",class:"wl-btn",onClick:D,textContent:U(y.value.refresh)},null,8,Rn)])):m.value==="loading"?(r(),u("div",An,[Z(L(ve),{size:30})])):p.value.length?g.value<c.value?(r(),u("div",Un,[h("button",{type:"button",class:"wl-btn",onClick:F,textContent:U(y.value.more)},null,8,Sn)])):x("v-if",!0):(r(),u("div",{key:3,class:"wl-empty",textContent:U(y.value.sofa)},null,8,Mn)),f.value.copyright?(r(),u("div",_n,[ae(" Powered by "),jn,ae(" v"+U(L(bt)),1)])):x("v-if",!0)]))}}),Vn=me(zn,[["__file","WalineComment.vue"]]);const Ct=(e,a)=>{a.forEach((l,t)=>{const o=e[t].time;typeof o=="number"&&(l.innerText=o.toString())})},$t=({serverURL:e,path:a=window.location.pathname,selector:l=".waline-pageview-count",update:t=!0,lang:o=navigator.language})=>{const n=new AbortController,m=Array.from(document.querySelectorAll(l)),d=c=>{const f=Se(c);return f!==null&&a!==f},g=c=>jt({serverURL:ke(e),paths:c.map(f=>Se(f)||a),lang:o,signal:n.signal}).then(f=>Ct(f,c)).catch(ut);if(t){const c=m.filter(_=>!d(_)),f=m.filter(d);_t({serverURL:ke(e),path:a,lang:o}).then(_=>Ct(_,c)),f.length&&g(f)}else g(m);return n.abort.bind(n)},Hn=({el:e="#waline",path:a=window.location.pathname,comment:l=!1,pageview:t=!1,...o})=>{const n=e?Ue(e):null;if(e&&!n)throw new Error("Option 'el' do not match any domElement!");if(!o.serverURL)throw new Error("Option 'serverURL' is missing!");const m=Ie({...o}),d=Ie({comment:l,pageview:t,path:a}),g=()=>{d.comment&&dt({serverURL:m.serverURL,path:d.path,...se(d.comment)?{selector:d.comment}:{}})},c=()=>{d.pageview&&$t({serverURL:m.serverURL,path:d.path,...se(d.pageview)?{selector:d.pageview}:{}})},f=n?Bt(()=>A(Vn,{path:d.path,...m})):null;f&&f.mount(n);const _=Ge(g),p=Ge(c);return{el:n,update:({comment:M,pageview:S,path:E=window.location.pathname,...y}={})=>{Object.entries(y).forEach(([i,w])=>{m[i]=w}),d.path=E,M!==void 0&&(d.comment=M),S!==void 0&&(d.pageview=S)},destroy:()=>{f==null||f.unmount(),_(),p()}}},Tn=({el:e,serverURL:a,count:l,lang:t=navigator.language})=>{var o;const n=be(),m=Ue(e),d=new AbortController;return zt({serverURL:a,count:l,lang:t,signal:d.signal,token:(o=n.value)==null?void 0:o.token}).then(g=>m&&g.length?(m.innerHTML=`<ul class="wl-recent-list">${g.map(c=>`<li class="wl-recent-item"><a href="${c.url}">${c.nick}</a>:${c.comment}</li>`).join("")}</ul>`,{comments:g,destroy:()=>{d.abort(),m.innerHTML=""}}):{comments:g,destroy:()=>d.abort()})},Fn=({el:e,serverURL:a,count:l,locale:t,lang:o=navigator.language,mode:n="list"})=>{const m=Ue(e),d=new AbortController;return Vt({serverURL:a,pageSize:l,lang:o,signal:d.signal}).then(g=>!m||!g.length?{users:g,destroy:()=>d.abort()}:(t={...ot(o),...typeof t=="object"?t:{}},m.innerHTML=`<ul class="wl-user-${n}">${g.map((c,f)=>[`<li class="wl-user-item" aria-label="${c.nick}">`,c.link&&`<a href="${c.link}" target="_blank">`,'<div class="wl-user-avatar">',`<img src="${c.avatar}" alt="${c.nick}">`,`<span class="wl-user-badge">${f+1}</span>`,"</div>",'<div class="wl-user-meta">','<div class="wl-user-name">',c.nick,c.level&&`<span class="wl-badge">${t?t[`level${c.level}`]:`Level ${c.level}`}</span>`,c.label&&`<span class="wl-badge">${c.label}</span>`,"</div>",c.link&&c.link,"</div>",c.link&&"</a>","</li>"].filter(_=>_).join("")).join("")}</ul>`,{users:g,destroy:()=>{d.abort(),m.innerHTML=""}}))};export{Tn as RecentComments,Fn as UserList,dt as commentCount,ye as defaultLocales,Hn as init,$t as pageviewCount,bt as version};
//# sourceMappingURL=slim.js.map
{
"name": "@waline/client",
"version": "3.1.2",
"version": "3.1.3",
"description": "client for waline comment system",

@@ -85,3 +85,3 @@ "keywords": [

"dependencies": {
"@vueuse/core": "^10.7.2",
"@vueuse/core": "^10.8.0",
"@waline/api": "1.0.0-alpha.7",

@@ -100,5 +100,5 @@ "autosize": "^6.0.1",

"@types/marked": "5.0.2",
"@vitejs/plugin-vue": "5.0.3",
"@vitejs/plugin-vue": "5.0.4",
"user-agent-data-types": "0.4.2",
"vite": "5.0.12"
"vite": "5.1.3"
},

@@ -105,0 +105,0 @@ "engines": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc