"use strict";var lc=Object.defineProperty;var cc=(e,t,n)=>t in e?lc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var T=(e,t,n)=>(cc(e,typeof t!="symbol"?t+"":t,n),n);const Lt=require("siyuan");function uc(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const ht=uc(Lt);/**
* @vue/shared v3.5.27
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Ar(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const _e={},Mn=[],Nt=()=>{},Oa=()=>!1,Ni=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Rr=e=>e.startsWith("onUpdate:"),Me=Object.assign,Dr=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},dc=Object.prototype.hasOwnProperty,he=(e,t)=>dc.call(e,t),$=Array.isArray,Hn=e=>Io(e)==="[object Map]",Kn=e=>Io(e)==="[object Set]",gs=e=>Io(e)==="[object Date]",ee=e=>typeof e=="function",He=e=>typeof e=="string",Ot=e=>typeof e=="symbol",Ne=e=>e!==null&&typeof e=="object",Ia=e=>(Ne(e)||ee(e))&&ee(e.then)&&ee(e.catch),Aa=Object.prototype.toString,Io=e=>Aa.call(e),pc=e=>Io(e).slice(8,-1),Ra=e=>Io(e)==="[object Object]",kr=e=>He(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,ao=Ar(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),Ti=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},_c=/-\w/g,Kt=Ti(e=>e.replace(_c,t=>t.slice(1).toUpperCase())),fc=/\B([A-Z])/g,dn=Ti(e=>e.replace(fc,"-$1").toLowerCase()),Da=Ti(e=>e.charAt(0).toUpperCase()+e.slice(1)),Bi=Ti(e=>e?`on${Da(e)}`:""),nt=(e,t)=>!Object.is(e,t),Yo=(e,...t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})},Oi=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let Es;const Ii=()=>Es||(Es=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Sr(e){if($(e)){const t={};for(let n=0;n{if(n){const o=n.split(mc);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function ln(e){let t="";if(He(e))t=e;else if($(e))for(let n=0;nTn(n,t))}const wa=e=>!!(e&&e.__v_isRef===!0),ae=e=>He(e)?e:e==null?"":$(e)||Ne(e)&&(e.toString===Aa||!ee(e.toString))?wa(e)?ae(e.value):JSON.stringify(e,Ca,2):String(e),Ca=(e,t)=>wa(t)?Ca(e,t.value):Hn(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((n,[o,i],r)=>(n[Ui(o,r)+" =>"]=i,n),{})}:Kn(t)?{[`Set(${t.size})`]:[...t.values()].map(n=>Ui(n))}:Ot(t)?Ui(t):Ne(t)&&!$(t)&&!Ra(t)?String(t):t,Ui=(e,t="")=>{var n;return Ot(e)?`Symbol(${(n=e.description)!=null?n:t})`:e};/**
* @vue/reactivity v3.5.27
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let tt;class Nc{constructor(t=!1){this.detached=t,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=tt,!t&&tt&&(this.index=(tt.scopes||(tt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,n;if(this.scopes)for(t=0,n=this.scopes.length;t0&&--this._on===0&&(tt=this.prevScope,this.prevScope=void 0)}stop(t){if(this._active){this._active=!1;let n,o;for(n=0,o=this.effects.length;n0)return;if(co){let t=co;for(co=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;lo;){let t=lo;for(lo=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(o){e||(e=o)}t=n}}if(e)throw e}function xa(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ba(e){let t,n=e.depsTail,o=n;for(;o;){const i=o.prevDep;o.version===-1?(o===n&&(n=i),Mr(o),Oc(o)):t=o,o.dep.activeLink=o.prevActiveLink,o.prevActiveLink=void 0,o=i}e.deps=t,e.depsTail=n}function or(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Ua(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Ua(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===yo)||(e.globalVersion=yo,!e.isSSR&&e.flags&128&&(!e.deps&&!e._dirty||!or(e))))return;e.flags|=2;const t=e.dep,n=be,o=Tt;be=e,Tt=!0;try{xa(e);const i=e.fn(e._value);(t.version===0||nt(i,e._value))&&(e.flags|=128,e._value=i,t.version++)}catch(i){throw t.version++,i}finally{be=n,Tt=o,Ba(e),e.flags&=-3}}function Mr(e,t=!1){const{dep:n,prevSub:o,nextSub:i}=e;if(o&&(o.nextSub=i,e.prevSub=void 0),i&&(i.prevSub=o,e.nextSub=void 0),n.subs===e&&(n.subs=o,!o&&n.computed)){n.computed.flags&=-5;for(let r=n.computed.deps;r;r=r.nextDep)Mr(r,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Oc(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let Tt=!0;const Pa=[];function jt(){Pa.push(Tt),Tt=!1}function $t(){const e=Pa.pop();Tt=e===void 0?!0:e}function ys(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=be;be=void 0;try{t()}finally{be=n}}}let yo=0;class Ic{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ai{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(t){if(!be||!Tt||be===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==be)n=this.activeLink=new Ic(be,this),be.deps?(n.prevDep=be.depsTail,be.depsTail.nextDep=n,be.depsTail=n):be.deps=be.depsTail=n,Ga(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const o=n.nextDep;o.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=o),n.prevDep=be.depsTail,n.nextDep=void 0,be.depsTail.nextDep=n,be.depsTail=n,be.deps===n&&(be.deps=o)}return n}trigger(t){this.version++,yo++,this.notify(t)}notify(t){Cr();try{for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Lr()}}}function Ga(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let o=t.deps;o;o=o.nextDep)Ga(o)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),e.dep.subs=e}}const ir=new WeakMap,yn=Symbol(""),rr=Symbol(""),bo=Symbol("");function Ke(e,t,n){if(Tt&&be){let o=ir.get(e);o||ir.set(e,o=new Map);let i=o.get(n);i||(o.set(n,i=new Ai),i.map=o,i.key=n),i.track()}}function Gt(e,t,n,o,i,r){const s=ir.get(e);if(!s){yo++;return}const a=l=>{l&&l.trigger()};if(Cr(),t==="clear")s.forEach(a);else{const l=$(e),c=l&&kr(n);if(l&&n==="length"){const u=Number(o);s.forEach((d,p)=>{(p==="length"||p===bo||!Ot(p)&&p>=u)&&a(d)})}else switch((n!==void 0||s.has(void 0))&&a(s.get(n)),c&&a(s.get(bo)),t){case"add":l?c&&a(s.get("length")):(a(s.get(yn)),Hn(e)&&a(s.get(rr)));break;case"delete":l||(a(s.get(yn)),Hn(e)&&a(s.get(rr)));break;case"set":Hn(e)&&a(s.get(yn));break}}Lr()}function In(e){const t=fe(e);return t===e?t:(Ke(t,"iterate",bo),gt(e)?t:t.map(It))}function Ri(e){return Ke(e=fe(e),"iterate",bo),e}function tn(e,t){return Yt(e)?Gn(bn(e)?It(t):t):It(t)}const Ac={__proto__:null,[Symbol.iterator](){return Gi(this,Symbol.iterator,e=>tn(this,e))},concat(...e){return In(this).concat(...e.map(t=>$(t)?In(t):t))},entries(){return Gi(this,"entries",e=>(e[1]=tn(this,e[1]),e))},every(e,t){return Ut(this,"every",e,t,void 0,arguments)},filter(e,t){return Ut(this,"filter",e,t,n=>n.map(o=>tn(this,o)),arguments)},find(e,t){return Ut(this,"find",e,t,n=>tn(this,n),arguments)},findIndex(e,t){return Ut(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return Ut(this,"findLast",e,t,n=>tn(this,n),arguments)},findLastIndex(e,t){return Ut(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return Ut(this,"forEach",e,t,void 0,arguments)},includes(...e){return Fi(this,"includes",e)},indexOf(...e){return Fi(this,"indexOf",e)},join(e){return In(this).join(e)},lastIndexOf(...e){return Fi(this,"lastIndexOf",e)},map(e,t){return Ut(this,"map",e,t,void 0,arguments)},pop(){return Zn(this,"pop")},push(...e){return Zn(this,"push",e)},reduce(e,...t){return bs(this,"reduce",e,t)},reduceRight(e,...t){return bs(this,"reduceRight",e,t)},shift(){return Zn(this,"shift")},some(e,t){return Ut(this,"some",e,t,void 0,arguments)},splice(...e){return Zn(this,"splice",e)},toReversed(){return In(this).toReversed()},toSorted(e){return In(this).toSorted(e)},toSpliced(...e){return In(this).toSpliced(...e)},unshift(...e){return Zn(this,"unshift",e)},values(){return Gi(this,"values",e=>tn(this,e))}};function Gi(e,t,n){const o=Ri(e),i=o[t]();return o!==e&&!gt(e)&&(i._next=i.next,i.next=()=>{const r=i._next();return r.done||(r.value=n(r.value)),r}),i}const Rc=Array.prototype;function Ut(e,t,n,o,i,r){const s=Ri(e),a=s!==e&&!gt(e),l=s[t];if(l!==Rc[t]){const d=l.apply(e,r);return a?It(d):d}let c=n;s!==e&&(a?c=function(d,p){return n.call(this,tn(e,d),p,e)}:n.length>2&&(c=function(d,p){return n.call(this,d,p,e)}));const u=l.call(s,c,o);return a&&i?i(u):u}function bs(e,t,n,o){const i=Ri(e);let r=n;return i!==e&&(gt(e)?n.length>3&&(r=function(s,a,l){return n.call(this,s,a,l,e)}):r=function(s,a,l){return n.call(this,s,tn(e,a),l,e)}),i[t](r,...o)}function Fi(e,t,n){const o=fe(e);Ke(o,"iterate",bo);const i=o[t](...n);return(i===-1||i===!1)&&Ur(n[0])?(n[0]=fe(n[0]),o[t](...n)):i}function Zn(e,t,n=[]){jt(),Cr();const o=fe(e)[t].apply(e,n);return Lr(),$t(),o}const Dc=Ar("__proto__,__v_isRef,__isVue"),Fa=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ot));function kc(e){Ot(e)||(e=String(e));const t=fe(this);return Ke(t,"has",e),t.hasOwnProperty(e)}class Xa{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){if(n==="__v_skip")return t.__v_skip;const i=this._isReadonly,r=this._isShallow;if(n==="__v_isReactive")return!i;if(n==="__v_isReadonly")return i;if(n==="__v_isShallow")return r;if(n==="__v_raw")return o===(i?r?Pc:ja:r?Ka:Va).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const s=$(t);if(!i){let l;if(s&&(l=Ac[n]))return l;if(n==="hasOwnProperty")return kc}const a=Reflect.get(t,n,$e(t)?t:o);if((Ot(n)?Fa.has(n):Dc(n))||(i||Ke(t,"get",n),r))return a;if($e(a)){const l=s&&kr(n)?a:a.value;return i&&Ne(l)?ar(l):l}return Ne(a)?i?ar(a):xr(a):a}}class Wa extends Xa{constructor(t=!1){super(!1,t)}set(t,n,o,i){let r=t[n];const s=$(t)&&kr(n);if(!this._isShallow){const c=Yt(r);if(!gt(o)&&!Yt(o)&&(r=fe(r),o=fe(o)),!s&&$e(r)&&!$e(o))return c||(r.value=o),!0}const a=s?Number(n)e,xo=e=>Reflect.getPrototypeOf(e);function Mc(e,t,n){return function(...o){const i=this.__v_raw,r=fe(i),s=Hn(r),a=e==="entries"||e===Symbol.iterator&&s,l=e==="keys"&&s,c=i[e](...o),u=n?sr:t?Gn:It;return!t&&Ke(r,"iterate",l?rr:yn),Me(Object.create(c),{next(){const{value:d,done:p}=c.next();return p?{value:d,done:p}:{value:a?[u(d[0]),u(d[1])]:u(d),done:p}}})}}function Bo(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Hc(e,t){const n={get(i){const r=this.__v_raw,s=fe(r),a=fe(i);e||(nt(i,a)&&Ke(s,"get",i),Ke(s,"get",a));const{has:l}=xo(s),c=t?sr:e?Gn:It;if(l.call(s,i))return c(r.get(i));if(l.call(s,a))return c(r.get(a));r!==s&&r.get(i)},get size(){const i=this.__v_raw;return!e&&Ke(fe(i),"iterate",yn),i.size},has(i){const r=this.__v_raw,s=fe(r),a=fe(i);return e||(nt(i,a)&&Ke(s,"has",i),Ke(s,"has",a)),i===a?r.has(i):r.has(i)||r.has(a)},forEach(i,r){const s=this,a=s.__v_raw,l=fe(a),c=t?sr:e?Gn:It;return!e&&Ke(l,"iterate",yn),a.forEach((u,d)=>i.call(r,c(u),c(d),s))}};return Me(n,e?{add:Bo("add"),set:Bo("set"),delete:Bo("delete"),clear:Bo("clear")}:{add(i){!t&&!gt(i)&&!Yt(i)&&(i=fe(i));const r=fe(this);return xo(r).has.call(r,i)||(r.add(i),Gt(r,"add",i,i)),this},set(i,r){!t&&!gt(r)&&!Yt(r)&&(r=fe(r));const s=fe(this),{has:a,get:l}=xo(s);let c=a.call(s,i);c||(i=fe(i),c=a.call(s,i));const u=l.call(s,i);return s.set(i,r),c?nt(r,u)&&Gt(s,"set",i,r):Gt(s,"add",i,r),this},delete(i){const r=fe(this),{has:s,get:a}=xo(r);let l=s.call(r,i);l||(i=fe(i),l=s.call(r,i)),a&&a.call(r,i);const c=r.delete(i);return l&&Gt(r,"delete",i,void 0),c},clear(){const i=fe(this),r=i.size!==0,s=i.clear();return r&&Gt(i,"clear",void 0,void 0),s}}),["keys","values","entries",Symbol.iterator].forEach(i=>{n[i]=Mc(i,e,t)}),n}function Hr(e,t){const n=Hc(e,t);return(o,i,r)=>i==="__v_isReactive"?!e:i==="__v_isReadonly"?e:i==="__v_raw"?o:Reflect.get(he(n,i)&&i in o?n:o,i,r)}const xc={get:Hr(!1,!1)},Bc={get:Hr(!1,!0)},Uc={get:Hr(!0,!1)};const Va=new WeakMap,Ka=new WeakMap,ja=new WeakMap,Pc=new WeakMap;function Gc(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Fc(e){return e.__v_skip||!Object.isExtensible(e)?0:Gc(pc(e))}function xr(e){return Yt(e)?e:Br(e,!1,wc,xc,Va)}function Xc(e){return Br(e,!1,Lc,Bc,Ka)}function ar(e){return Br(e,!0,Cc,Uc,ja)}function Br(e,t,n,o,i){if(!Ne(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const r=Fc(e);if(r===0)return e;const s=i.get(e);if(s)return s;const a=new Proxy(e,r===2?o:n);return i.set(e,a),a}function bn(e){return Yt(e)?bn(e.__v_raw):!!(e&&e.__v_isReactive)}function Yt(e){return!!(e&&e.__v_isReadonly)}function gt(e){return!!(e&&e.__v_isShallow)}function Ur(e){return e?!!e.__v_raw:!1}function fe(e){const t=e&&e.__v_raw;return t?fe(t):e}function Wc(e){return!he(e,"__v_skip")&&Object.isExtensible(e)&&ka(e,"__v_skip",!0),e}const It=e=>Ne(e)?xr(e):e,Gn=e=>Ne(e)?ar(e):e;function $e(e){return e?e.__v_isRef===!0:!1}function Pe(e){return Vc(e,!1)}function Vc(e,t){return $e(e)?e:new Kc(e,t)}class Kc{constructor(t,n){this.dep=new Ai,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=n?t:fe(t),this._value=n?t:It(t),this.__v_isShallow=n}get value(){return this.dep.track(),this._value}set value(t){const n=this._rawValue,o=this.__v_isShallow||gt(t)||Yt(t);t=o?t:fe(t),nt(t,n)&&(this._rawValue=t,this._value=o?t:It(t),this.dep.trigger())}}function P(e){return $e(e)?e.value:e}const jc={get:(e,t,n)=>t==="__v_raw"?e:P(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const i=e[t];return $e(i)&&!$e(n)?(i.value=n,!0):Reflect.set(e,t,n,o)}};function $a(e){return bn(e)?e:new Proxy(e,jc)}class $c{constructor(t){this.__v_isRef=!0,this._value=void 0;const n=this.dep=new Ai,{get:o,set:i}=t(n.track.bind(n),n.trigger.bind(n));this._get=o,this._set=i}get value(){return this._value=this._get()}set value(t){this._set(t)}}function Yc(e){return new $c(e)}class qc{constructor(t,n,o){this.fn=t,this.setter=n,this._value=void 0,this.dep=new Ai(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=yo-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!n,this.isSSR=o}notify(){if(this.flags|=16,!(this.flags&8)&&be!==this)return Ha(this,!0),!0}get value(){const t=this.dep.track();return Ua(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function Jc(e,t,n=!1){let o,i;return ee(e)?o=e:(o=e.get,i=e.set),new qc(o,i,n)}const Uo={},si=new WeakMap;let gn;function zc(e,t=!1,n=gn){if(n){let o=si.get(n);o||si.set(n,o=[]),o.push(e)}}function Zc(e,t,n=_e){const{immediate:o,deep:i,once:r,scheduler:s,augmentJob:a,call:l}=n,c=k=>i?k:gt(k)||i===!1||i===0?Ft(k,1):Ft(k);let u,d,p,m,g=!1,v=!1;if($e(e)?(d=()=>e.value,g=gt(e)):bn(e)?(d=()=>c(e),g=!0):$(e)?(v=!0,g=e.some(k=>bn(k)||gt(k)),d=()=>e.map(k=>{if($e(k))return k.value;if(bn(k))return c(k);if(ee(k))return l?l(k,2):k()})):ee(e)?t?d=l?()=>l(e,2):e:d=()=>{if(p){jt();try{p()}finally{$t()}}const k=gn;gn=u;try{return l?l(e,3,[m]):e(m)}finally{gn=k}}:d=Nt,t&&i){const k=d,H=i===!0?1/0:i;d=()=>Ft(k(),H)}const G=Tc(),U=()=>{u.stop(),G&&G.active&&Dr(G.effects,u)};if(r&&t){const k=t;t=(...H)=>{k(...H),U()}}let x=v?new Array(e.length).fill(Uo):Uo;const q=k=>{if(!(!(u.flags&1)||!u.dirty&&!k))if(t){const H=u.run();if(i||g||(v?H.some((E,N)=>nt(E,x[N])):nt(H,x))){p&&p();const E=gn;gn=u;try{const N=[H,x===Uo?void 0:v&&x[0]===Uo?[]:x,m];x=H,l?l(t,3,N):t(...N)}finally{gn=E}}}else u.run()};return a&&a(q),u=new La(d),u.scheduler=s?()=>s(q,!1):q,m=k=>zc(k,!1,u),p=u.onStop=()=>{const k=si.get(u);if(k){if(l)l(k,4);else for(const H of k)H();si.delete(u)}},t?o?q(!0):x=u.run():s?s(q.bind(null,!0),!0):u.run(),U.pause=u.pause.bind(u),U.resume=u.resume.bind(u),U.stop=U,U}function Ft(e,t=1/0,n){if(t<=0||!Ne(e)||e.__v_skip||(n=n||new Map,(n.get(e)||0)>=t))return e;if(n.set(e,t),t--,$e(e))Ft(e.value,t,n);else if($(e))for(let o=0;o{Ft(o,t,n)});else if(Ra(e)){for(const o in e)Ft(e[o],t,n);for(const o of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,o)&&Ft(e[o],t,n)}return e}/**
* @vue/runtime-core v3.5.27
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/function Ao(e,t,n,o){try{return o?e(...o):e()}catch(i){Di(i,t,n)}}function Ht(e,t,n,o){if(ee(e)){const i=Ao(e,t,n,o);return i&&Ia(i)&&i.catch(r=>{Di(r,t,n)}),i}if($(e)){const i=[];for(let r=0;r>>1,i=Je[o],r=vo(i);r=vo(n)?Je.push(e):Je.splice(eu(t),0,e),e.flags|=1,Ja()}}function Ja(){ai||(ai=Ya.then(Za))}function tu(e){$(e)?xn.push(...e):nn&&e.id===-1?nn.splice(kn+1,0,e):e.flags&1||(xn.push(e),e.flags|=1),Ja()}function vs(e,t,n=St+1){for(;nvo(n)-vo(o));if(xn.length=0,nn){nn.push(...t);return}for(nn=t,kn=0;kne.id==null?e.flags&2?-1:1/0:e.id;function Za(e){const t=Nt;try{for(St=0;St{o._d&&ks(-1);const r=li(t);let s;try{s=e(...i)}finally{li(r),o._d&&ks(1)}return s};return o._n=!0,o._c=!0,o._d=!0,o}function qt(e,t){if(je===null)return e;const n=Ci(je),o=e.dirs||(e.dirs=[]);for(let i=0;i1)return n&&ee(t)?t.call(o&&o.proxy):t}}const ou=Symbol.for("v-scx"),iu=()=>qo(ou);function ru(e,t){return Gr(e,null,{flush:"sync"})}function Jo(e,t,n){return Gr(e,t,n)}function Gr(e,t,n=_e){const{immediate:o,deep:i,flush:r,once:s}=n,a=Me({},n),l=t&&o||!t&&r!=="post";let c;if(Oo){if(r==="sync"){const m=iu();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!l){const m=()=>{};return m.stop=Nt,m.resume=Nt,m.pause=Nt,m}}const u=ze;a.call=(m,g,v)=>Ht(m,u,g,v);let d=!1;r==="post"?a.scheduler=m=>{ct(m,u&&u.suspense)}:r!=="sync"&&(d=!0,a.scheduler=(m,g)=>{g?m():Pr(m)}),a.augmentJob=m=>{t&&(m.flags|=4),d&&(m.flags|=2,u&&(m.id=u.uid,m.i=u))};const p=Zc(e,t,a);return Oo&&(c?c.push(p):l&&p()),p}function su(e,t,n){const o=this.proxy,i=He(e)?e.includes(".")?el(o,e):()=>o[e]:e.bind(o,o);let r;ee(t)?r=t:(r=t.handler,n=t);const s=Do(this),a=Gr(i,r.bind(o),n);return s(),a}function el(e,t){const n=t.split(".");return()=>{let o=e;for(let i=0;ie.__isTeleport,cu=Symbol("_leaveCb");function Fr(e,t){e.shapeFlag&6&&e.component?(e.transition=t,Fr(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function rt(e,t){return ee(e)?(()=>Me({name:e.name},t,{setup:e}))():e}function tl(e){e.ids=[e.ids[0]+e.ids[2]+++"-",0,0]}const ci=new WeakMap;function uo(e,t,n,o,i=!1){if($(e)){e.forEach((g,v)=>uo(g,t&&($(t)?t[v]:t),n,o,i));return}if(Bn(o)&&!i){o.shapeFlag&512&&o.type.__asyncResolved&&o.component.subTree.component&&uo(e,t,n,o.component.subTree);return}const r=o.shapeFlag&4?Ci(o.component):o.el,s=i?null:r,{i:a,r:l}=e,c=t&&t.r,u=a.refs===_e?a.refs={}:a.refs,d=a.setupState,p=fe(d),m=d===_e?Oa:g=>he(p,g);if(c!=null&&c!==l){if(Ns(t),He(c))u[c]=null,m(c)&&(d[c]=null);else if($e(c)){c.value=null;const g=t;g.k&&(u[g.k]=null)}}if(ee(l))Ao(l,a,12,[s,u]);else{const g=He(l),v=$e(l);if(g||v){const G=()=>{if(e.f){const U=g?m(l)?d[l]:u[l]:l.value;if(i)$(U)&&Dr(U,r);else if($(U))U.includes(r)||U.push(r);else if(g)u[l]=[r],m(l)&&(d[l]=u[l]);else{const x=[r];l.value=x,e.k&&(u[e.k]=x)}}else g?(u[l]=s,m(l)&&(d[l]=s)):v&&(l.value=s,e.k&&(u[e.k]=s))};if(s){const U=()=>{G(),ci.delete(e)};U.id=-1,ci.set(e,U),ct(U,n)}else Ns(e),G()}}}function Ns(e){const t=ci.get(e);t&&(t.flags|=8,ci.delete(e))}Ii().requestIdleCallback;Ii().cancelIdleCallback;const Bn=e=>!!e.type.__asyncLoader,nl=e=>e.type.__isKeepAlive;function uu(e,t){ol(e,"a",t)}function du(e,t){ol(e,"da",t)}function ol(e,t,n=ze){const o=e.__wdc||(e.__wdc=()=>{let i=n;for(;i;){if(i.isDeactivated)return;i=i.parent}return e()});if(ki(t,o,n),n){let i=n.parent;for(;i&&i.parent;)nl(i.parent.vnode)&&pu(o,t,n,i),i=i.parent}}function pu(e,t,n,o){const i=ki(t,e,o,!0);Wr(()=>{Dr(o[t],i)},n)}function ki(e,t,n=ze,o=!1){if(n){const i=n[e]||(n[e]=[]),r=t.__weh||(t.__weh=(...s)=>{jt();const a=Do(n),l=Ht(t,n,e,s);return a(),$t(),l});return o?i.unshift(r):i.push(r),r}}const Zt=e=>(t,n=ze)=>{(!Oo||e==="sp")&&ki(e,(...o)=>t(...o),n)},_u=Zt("bm"),Xr=Zt("m"),fu=Zt("bu"),hu=Zt("u"),mu=Zt("bum"),Wr=Zt("um"),gu=Zt("sp"),Eu=Zt("rtg"),yu=Zt("rtc");function bu(e,t=ze){ki("ec",e,t)}const vu=Symbol.for("v-ndc");function dt(e,t,n,o){let i;const r=n&&n[o],s=$(e);if(s||He(e)){const a=s&&bn(e);let l=!1,c=!1;a&&(l=!gt(e),c=Yt(e),e=Ri(e)),i=new Array(e.length);for(let u=0,d=e.length;ut(a,l,void 0,r&&r[l]));else{const a=Object.keys(e);i=new Array(a.length);for(let l=0,c=a.length;l{const r=o.fn(...i);return r&&(r.key=o.key),r}:o.fn)}return e}function No(e,t,n={},o,i){if(je.ce||je.parent&&Bn(je.parent)&&je.parent.ce){const c=Object.keys(n).length>0;return t!=="default"&&(n.name=t),X(),We(Ee,null,[Ge("slot",n,o&&o())],c?-2:64)}let r=e[t];r&&r._c&&(r._d=!1),X();const s=r&&il(r(n)),a=n.key||s&&s.key,l=We(Ee,{key:(a&&!Ot(a)?a:`_${t}`)+(!s&&o?"_fb":"")},s||(o?o():[]),s&&e._===1?64:-2);return!i&&l.scopeId&&(l.slotScopeIds=[l.scopeId+"-s"]),r&&r._c&&(r._d=!0),l}function il(e){return e.some(t=>Yr(t)?!(t.type===Jt||t.type===Ee&&!il(t.children)):!0)?e:null}const lr=e=>e?Ol(e)?Ci(e):lr(e.parent):null,po=Me(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>lr(e.parent),$root:e=>lr(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>Kr(e),$forceUpdate:e=>e.f||(e.f=()=>{Pr(e.update)}),$nextTick:e=>e.n||(e.n=qa.bind(e.proxy)),$watch:e=>su.bind(e)}),Xi=(e,t)=>e!==_e&&!e.__isScriptSetup&&he(e,t),Tu={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:i,props:r,accessCache:s,type:a,appContext:l}=e;if(t[0]!=="$"){const p=s[t];if(p!==void 0)switch(p){case 1:return o[t];case 2:return i[t];case 4:return n[t];case 3:return r[t]}else{if(Xi(o,t))return s[t]=1,o[t];if(i!==_e&&he(i,t))return s[t]=2,i[t];if(he(r,t))return s[t]=3,r[t];if(n!==_e&&he(n,t))return s[t]=4,n[t];cr&&(s[t]=0)}}const c=po[t];let u,d;if(c)return t==="$attrs"&&Ke(e.attrs,"get",""),c(e);if((u=a.__cssModules)&&(u=u[t]))return u;if(n!==_e&&he(n,t))return s[t]=4,n[t];if(d=l.config.globalProperties,he(d,t))return d[t]},set({_:e},t,n){const{data:o,setupState:i,ctx:r}=e;return Xi(i,t)?(i[t]=n,!0):o!==_e&&he(o,t)?(o[t]=n,!0):he(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(r[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:i,props:r,type:s}},a){let l;return!!(n[a]||e!==_e&&a[0]!=="$"&&he(e,a)||Xi(t,a)||he(r,a)||he(o,a)||he(po,a)||he(i.config.globalProperties,a)||(l=s.__cssModules)&&l[a])},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:he(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function ui(e){return $(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}function Vr(e,t){return!e||!t?e||t:$(e)&&$(t)?e.concat(t):Me({},ui(e),ui(t))}let cr=!0;function Ou(e){const t=Kr(e),n=e.proxy,o=e.ctx;cr=!1,t.beforeCreate&&Ts(t.beforeCreate,e,"bc");const{data:i,computed:r,methods:s,watch:a,provide:l,inject:c,created:u,beforeMount:d,mounted:p,beforeUpdate:m,updated:g,activated:v,deactivated:G,beforeDestroy:U,beforeUnmount:x,destroyed:q,unmounted:k,render:H,renderTracked:E,renderTriggered:N,errorCaptured:F,serverPrefetch:ie,expose:se,inheritAttrs:De,components:Te,directives:Oe,filters:de}=t;if(c&&Iu(c,o,null),s)for(const ge in s){const pe=s[ge];ee(pe)&&(o[ge]=pe.bind(n))}if(i){const ge=i.call(n,n);Ne(ge)&&(e.data=xr(ge))}if(cr=!0,r)for(const ge in r){const pe=r[ge],Bt=ee(pe)?pe.bind(n,n):ee(pe.get)?pe.get.bind(n,n):Nt,qn=!ee(pe)&&ee(pe.set)?pe.set.bind(n):Nt,Rt=vn({get:Bt,set:qn});Object.defineProperty(o,ge,{enumerable:!0,configurable:!0,get:()=>Rt.value,set:_t=>Rt.value=_t})}if(a)for(const ge in a)rl(a[ge],o,n,ge);if(l){const ge=ee(l)?l.call(n):l;Reflect.ownKeys(ge).forEach(pe=>{nu(pe,ge[pe])})}u&&Ts(u,e,"c");function Ie(ge,pe){$(pe)?pe.forEach(Bt=>ge(Bt.bind(n))):pe&&ge(pe.bind(n))}if(Ie(_u,d),Ie(Xr,p),Ie(fu,m),Ie(hu,g),Ie(uu,v),Ie(du,G),Ie(bu,F),Ie(yu,E),Ie(Eu,N),Ie(mu,x),Ie(Wr,k),Ie(gu,ie),$(se))if(se.length){const ge=e.exposed||(e.exposed={});se.forEach(pe=>{Object.defineProperty(ge,pe,{get:()=>n[pe],set:Bt=>n[pe]=Bt,enumerable:!0})})}else e.exposed||(e.exposed={});H&&e.render===Nt&&(e.render=H),De!=null&&(e.inheritAttrs=De),Te&&(e.components=Te),Oe&&(e.directives=Oe),ie&&tl(e)}function Iu(e,t,n=Nt){$(e)&&(e=ur(e));for(const o in e){const i=e[o];let r;Ne(i)?"default"in i?r=qo(i.from||o,i.default,!0):r=qo(i.from||o):r=qo(i),$e(r)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>r.value,set:s=>r.value=s}):t[o]=r}}function Ts(e,t,n){Ht($(e)?e.map(o=>o.bind(t.proxy)):e.bind(t.proxy),t,n)}function rl(e,t,n,o){let i=o.includes(".")?el(n,o):()=>n[o];if(He(e)){const r=t[e];ee(r)&&Jo(i,r)}else if(ee(e))Jo(i,e.bind(n));else if(Ne(e))if($(e))e.forEach(r=>rl(r,t,n,o));else{const r=ee(e.handler)?e.handler.bind(n):t[e.handler];ee(r)&&Jo(i,r,e)}}function Kr(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:i,optionsCache:r,config:{optionMergeStrategies:s}}=e.appContext,a=r.get(t);let l;return a?l=a:!i.length&&!n&&!o?l=t:(l={},i.length&&i.forEach(c=>di(l,c,s,!0)),di(l,t,s)),Ne(t)&&r.set(t,l),l}function di(e,t,n,o=!1){const{mixins:i,extends:r}=t;r&&di(e,r,n,!0),i&&i.forEach(s=>di(e,s,n,!0));for(const s in t)if(!(o&&s==="expose")){const a=Au[s]||n&&n[s];e[s]=a?a(e[s],t[s]):t[s]}return e}const Au={data:Os,props:Is,emits:Is,methods:to,computed:to,beforeCreate:Ye,created:Ye,beforeMount:Ye,mounted:Ye,beforeUpdate:Ye,updated:Ye,beforeDestroy:Ye,beforeUnmount:Ye,destroyed:Ye,unmounted:Ye,activated:Ye,deactivated:Ye,errorCaptured:Ye,serverPrefetch:Ye,components:to,directives:to,watch:Du,provide:Os,inject:Ru};function Os(e,t){return t?e?function(){return Me(ee(e)?e.call(this,this):e,ee(t)?t.call(this,this):t)}:t:e}function Ru(e,t){return to(ur(e),ur(t))}function ur(e){if($(e)){const t={};for(let n=0;n{let u,d=_e,p;return ru(()=>{const m=e[i];nt(u,m)&&(u=m,c())}),{get(){return l(),n.get?n.get(u):u},set(m){const g=n.set?n.set(m):m;if(!nt(g,u)&&!(d!==_e&&nt(m,d)))return;const v=o.vnode.props;v&&(t in v||i in v||r in v)&&(`onUpdate:${t}`in v||`onUpdate:${i}`in v||`onUpdate:${r}`in v)||(u=m,c()),o.emit(`update:${t}`,g),nt(m,g)&&nt(m,d)&&!nt(g,p)&&c(),d=m,p=g}}});return a[Symbol.iterator]=()=>{let l=0;return{next(){return l<2?{value:l++?s||_e:a,done:!1}:{done:!0}}}},a}const al=(e,t)=>t==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Kt(t)}Modifiers`]||e[`${dn(t)}Modifiers`];function wu(e,t,...n){if(e.isUnmounted)return;const o=e.vnode.props||_e;let i=n;const r=t.startsWith("update:"),s=r&&al(o,t.slice(7));s&&(s.trim&&(i=n.map(u=>He(u)?u.trim():u)),s.number&&(i=n.map(Oi)));let a,l=o[a=Bi(t)]||o[a=Bi(Kt(t))];!l&&r&&(l=o[a=Bi(dn(t))]),l&&Ht(l,e,6,i);const c=o[a+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[a])return;e.emitted[a]=!0,Ht(c,e,6,i)}}const Cu=new WeakMap;function ll(e,t,n=!1){const o=n?Cu:t.emitsCache,i=o.get(e);if(i!==void 0)return i;const r=e.emits;let s={},a=!1;if(!ee(e)){const l=c=>{const u=ll(c,t,!0);u&&(a=!0,Me(s,u))};!n&&t.mixins.length&&t.mixins.forEach(l),e.extends&&l(e.extends),e.mixins&&e.mixins.forEach(l)}return!r&&!a?(Ne(e)&&o.set(e,null),null):($(r)?r.forEach(l=>s[l]=null):Me(s,r),Ne(e)&&o.set(e,s),s)}function Si(e,t){return!e||!Ni(t)?!1:(t=t.slice(2).replace(/Once$/,""),he(e,t[0].toLowerCase()+t.slice(1))||he(e,dn(t))||he(e,t))}function Wi(e){const{type:t,vnode:n,proxy:o,withProxy:i,propsOptions:[r],slots:s,attrs:a,emit:l,render:c,renderCache:u,props:d,data:p,setupState:m,ctx:g,inheritAttrs:v}=e,G=li(e);let U,x;try{if(n.shapeFlag&4){const k=i||o,H=k;U=wt(c.call(H,k,u,d,m,p,g)),x=a}else{const k=t;U=wt(k.length>1?k(d,{attrs:a,slots:s,emit:l}):k(d,null)),x=t.props?a:Lu(a)}}catch(k){_o.length=0,Di(k,e,1),U=Ge(Jt)}let q=U;if(x&&v!==!1){const k=Object.keys(x),{shapeFlag:H}=q;k.length&&H&7&&(r&&k.some(Rr)&&(x=Mu(x,r)),q=Fn(q,x,!1,!0))}return n.dirs&&(q=Fn(q,null,!1,!0),q.dirs=q.dirs?q.dirs.concat(n.dirs):n.dirs),n.transition&&Fr(q,n.transition),U=q,li(G),U}const Lu=e=>{let t;for(const n in e)(n==="class"||n==="style"||Ni(n))&&((t||(t={}))[n]=e[n]);return t},Mu=(e,t)=>{const n={};for(const o in e)(!Rr(o)||!(o.slice(9)in t))&&(n[o]=e[o]);return n};function Hu(e,t,n){const{props:o,children:i,component:r}=e,{props:s,children:a,patchFlag:l}=t,c=r.emitsOptions;if(t.dirs||t.transition)return!0;if(n&&l>=0){if(l&1024)return!0;if(l&16)return o?As(o,s,c):!!s;if(l&8){const u=t.dynamicProps;for(let d=0;dObject.create(cl),dl=e=>Object.getPrototypeOf(e)===cl;function Bu(e,t,n,o=!1){const i={},r=ul();e.propsDefaults=Object.create(null),pl(e,t,i,r);for(const s in e.propsOptions[0])s in i||(i[s]=void 0);n?e.props=o?i:Xc(i):e.type.props?e.props=i:e.props=r,e.attrs=r}function Uu(e,t,n,o){const{props:i,attrs:r,vnode:{patchFlag:s}}=e,a=fe(i),[l]=e.propsOptions;let c=!1;if((o||s>0)&&!(s&16)){if(s&8){const u=e.vnode.dynamicProps;for(let d=0;d{l=!0;const[p,m]=_l(d,t,!0);Me(s,p),m&&a.push(...m)};!n&&t.mixins.length&&t.mixins.forEach(u),e.extends&&u(e.extends),e.mixins&&e.mixins.forEach(u)}if(!r&&!l)return Ne(e)&&o.set(e,Mn),Mn;if($(r))for(let u=0;ue==="_"||e==="_ctx"||e==="$stable",$r=e=>$(e)?e.map(wt):[wt(e)],Gu=(e,t,n)=>{if(t._n)return t;const o=Ct((...i)=>$r(t(...i)),n);return o._c=!1,o},fl=(e,t,n)=>{const o=e._ctx;for(const i in e){if(jr(i))continue;const r=e[i];if(ee(r))t[i]=Gu(i,r,o);else if(r!=null){const s=$r(r);t[i]=()=>s}}},hl=(e,t)=>{const n=$r(t);e.slots.default=()=>n},ml=(e,t,n)=>{for(const o in t)(n||!jr(o))&&(e[o]=t[o])},Fu=(e,t,n)=>{const o=e.slots=ul();if(e.vnode.shapeFlag&32){const i=t._;i?(ml(o,t,n),n&&ka(o,"_",i,!0)):fl(t,o)}else t&&hl(e,t)},Xu=(e,t,n)=>{const{vnode:o,slots:i}=e;let r=!0,s=_e;if(o.shapeFlag&32){const a=t._;a?n&&a===1?r=!1:ml(i,t,n):(r=!t.$stable,fl(t,i)),s=t}else t&&(hl(e,t),s={default:1});if(r)for(const a in i)!jr(a)&&s[a]==null&&delete i[a]},ct=$u;function Wu(e){return Vu(e)}function Vu(e,t){const n=Ii();n.__VUE__=!0;const{insert:o,remove:i,patchProp:r,createElement:s,createText:a,createComment:l,setText:c,setElementText:u,parentNode:d,nextSibling:p,setScopeId:m=Nt,insertStaticContent:g}=e,v=(_,f,y,D=null,I=null,A=null,M=void 0,L=null,C=!!f.dynamicChildren)=>{if(_===f)return;_&&!Qn(_,f)&&(D=Ho(_),_t(_,I,A,!0),_=null),f.patchFlag===-2&&(C=!1,f.dynamicChildren=null);const{type:R,ref:Y,shapeFlag:B}=f;switch(R){case wi:G(_,f,y,D);break;case Jt:U(_,f,y,D);break;case zo:_==null&&x(f,y,D,M);break;case Ee:Te(_,f,y,D,I,A,M,L,C);break;default:B&1?H(_,f,y,D,I,A,M,L,C):B&6?Oe(_,f,y,D,I,A,M,L,C):(B&64||B&128)&&R.process(_,f,y,D,I,A,M,L,C,On)}Y!=null&&I?uo(Y,_&&_.ref,A,f||_,!f):Y==null&&_&&_.ref!=null&&uo(_.ref,null,A,_,!0)},G=(_,f,y,D)=>{if(_==null)o(f.el=a(f.children),y,D);else{const I=f.el=_.el;f.children!==_.children&&c(I,f.children)}},U=(_,f,y,D)=>{_==null?o(f.el=l(f.children||""),y,D):f.el=_.el},x=(_,f,y,D)=>{[_.el,_.anchor]=g(_.children,f,y,D,_.el,_.anchor)},q=({el:_,anchor:f},y,D)=>{let I;for(;_&&_!==f;)I=p(_),o(_,y,D),_=I;o(f,y,D)},k=({el:_,anchor:f})=>{let y;for(;_&&_!==f;)y=p(_),i(_),_=y;i(f)},H=(_,f,y,D,I,A,M,L,C)=>{if(f.type==="svg"?M="svg":f.type==="math"&&(M="mathml"),_==null)E(f,y,D,I,A,M,L,C);else{const R=_.el&&_.el._isVueCE?_.el:null;try{R&&R._beginPatch(),ie(_,f,I,A,M,L,C)}finally{R&&R._endPatch()}}},E=(_,f,y,D,I,A,M,L)=>{let C,R;const{props:Y,shapeFlag:B,transition:W,dirs:Z}=_;if(C=_.el=s(_.type,A,Y&&Y.is,Y),B&8?u(C,_.children):B&16&&F(_.children,C,null,D,I,Vi(_,A),M,L),Z&&_n(_,null,D,"created"),N(C,_,_.scopeId,M,D),Y){for(const ye in Y)ye!=="value"&&!ao(ye)&&r(C,ye,null,Y[ye],A,D);"value"in Y&&r(C,"value",null,Y.value,A),(R=Y.onVnodeBeforeMount)&&kt(R,D,_)}Z&&_n(_,null,D,"beforeMount");const ue=Ku(I,W);ue&&W.beforeEnter(C),o(C,f,y),((R=Y&&Y.onVnodeMounted)||ue||Z)&&ct(()=>{R&&kt(R,D,_),ue&&W.enter(C),Z&&_n(_,null,D,"mounted")},I)},N=(_,f,y,D,I)=>{if(y&&m(_,y),D)for(let A=0;A{for(let R=C;R<_.length;R++){const Y=_[R]=L?on(_[R]):wt(_[R]);v(null,Y,f,y,D,I,A,M,L)}},ie=(_,f,y,D,I,A,M)=>{const L=f.el=_.el;let{patchFlag:C,dynamicChildren:R,dirs:Y}=f;C|=_.patchFlag&16;const B=_.props||_e,W=f.props||_e;let Z;if(y&&fn(y,!1),(Z=W.onVnodeBeforeUpdate)&&kt(Z,y,f,_),Y&&_n(f,_,y,"beforeUpdate"),y&&fn(y,!0),(B.innerHTML&&W.innerHTML==null||B.textContent&&W.textContent==null)&&u(L,""),R?se(_.dynamicChildren,R,L,y,D,Vi(f,I),A):M||pe(_,f,L,null,y,D,Vi(f,I),A,!1),C>0){if(C&16)De(L,B,W,y,I);else if(C&2&&B.class!==W.class&&r(L,"class",null,W.class,I),C&4&&r(L,"style",B.style,W.style,I),C&8){const ue=f.dynamicProps;for(let ye=0;ye{Z&&kt(Z,y,f,_),Y&&_n(f,_,y,"updated")},D)},se=(_,f,y,D,I,A,M)=>{for(let L=0;L{if(f!==y){if(f!==_e)for(const A in f)!ao(A)&&!(A in y)&&r(_,A,f[A],null,I,D);for(const A in y){if(ao(A))continue;const M=y[A],L=f[A];M!==L&&A!=="value"&&r(_,A,L,M,I,D)}"value"in y&&r(_,"value",f.value,y.value,I)}},Te=(_,f,y,D,I,A,M,L,C)=>{const R=f.el=_?_.el:a(""),Y=f.anchor=_?_.anchor:a("");let{patchFlag:B,dynamicChildren:W,slotScopeIds:Z}=f;Z&&(L=L?L.concat(Z):Z),_==null?(o(R,y,D),o(Y,y,D),F(f.children||[],y,Y,I,A,M,L,C)):B>0&&B&64&&W&&_.dynamicChildren&&_.dynamicChildren.length===W.length?(se(_.dynamicChildren,W,y,I,A,M,L),(f.key!=null||I&&f===I.subTree)&&gl(_,f,!0)):pe(_,f,y,Y,I,A,M,L,C)},Oe=(_,f,y,D,I,A,M,L,C)=>{f.slotScopeIds=L,_==null?f.shapeFlag&512?I.ctx.activate(f,y,D,M,C):de(f,y,D,I,A,M,C):en(_,f,C)},de=(_,f,y,D,I,A,M)=>{const L=_.component=ed(_,D,I);if(nl(_)&&(L.ctx.renderer=On),td(L,!1,M),L.asyncDep){if(I&&I.registerDep(L,Ie,M),!_.el){const C=L.subTree=Ge(Jt);U(null,C,f,y),_.placeholder=C.el}}else Ie(L,_,f,y,I,A,M)},en=(_,f,y)=>{const D=f.component=_.component;if(Hu(_,f,y))if(D.asyncDep&&!D.asyncResolved){ge(D,f,y);return}else D.next=f,D.update();else f.el=_.el,D.vnode=f},Ie=(_,f,y,D,I,A,M)=>{const L=()=>{if(_.isMounted){let{next:B,bu:W,u:Z,parent:ue,vnode:ye}=_;{const st=El(_);if(st){B&&(B.el=ye.el,ge(_,B,M)),st.asyncDep.then(()=>{_.isUnmounted||L()});return}}let me=B,Qe;fn(_,!1),B?(B.el=ye.el,ge(_,B,M)):B=ye,W&&Yo(W),(Qe=B.props&&B.props.onVnodeBeforeUpdate)&&kt(Qe,ue,B,ye),fn(_,!0);const Fe=Wi(_),yt=_.subTree;_.subTree=Fe,v(yt,Fe,d(yt.el),Ho(yt),_,I,A),B.el=Fe.el,me===null&&xu(_,Fe.el),Z&&ct(Z,I),(Qe=B.props&&B.props.onVnodeUpdated)&&ct(()=>kt(Qe,ue,B,ye),I)}else{let B;const{el:W,props:Z}=f,{bm:ue,m:ye,parent:me,root:Qe,type:Fe}=_,yt=Bn(f);if(fn(_,!1),ue&&Yo(ue),!yt&&(B=Z&&Z.onVnodeBeforeMount)&&kt(B,me,f),fn(_,!0),W&&xi){const st=()=>{_.subTree=Wi(_),xi(W,_.subTree,_,I,null)};yt&&Fe.__asyncHydrate?Fe.__asyncHydrate(W,_,st):st()}else{Qe.ce&&Qe.ce._def.shadowRoot!==!1&&Qe.ce._injectChildStyle(Fe);const st=_.subTree=Wi(_);v(null,st,y,D,_,I,A),f.el=st.el}if(ye&&ct(ye,I),!yt&&(B=Z&&Z.onVnodeMounted)){const st=f;ct(()=>kt(B,me,st),I)}(f.shapeFlag&256||me&&Bn(me.vnode)&&me.vnode.shapeFlag&256)&&_.a&&ct(_.a,I),_.isMounted=!0,f=y=D=null}};_.scope.on();const C=_.effect=new La(L);_.scope.off();const R=_.update=C.run.bind(C),Y=_.job=C.runIfDirty.bind(C);Y.i=_,Y.id=_.uid,C.scheduler=()=>Pr(Y),fn(_,!0),R()},ge=(_,f,y)=>{f.component=_;const D=_.vnode.props;_.vnode=f,_.next=null,Uu(_,f.props,D,y),Xu(_,f.children,y),jt(),vs(_),$t()},pe=(_,f,y,D,I,A,M,L,C=!1)=>{const R=_&&_.children,Y=_?_.shapeFlag:0,B=f.children,{patchFlag:W,shapeFlag:Z}=f;if(W>0){if(W&128){qn(R,B,y,D,I,A,M,L,C);return}else if(W&256){Bt(R,B,y,D,I,A,M,L,C);return}}Z&8?(Y&16&&Jn(R,I,A),B!==R&&u(y,B)):Y&16?Z&16?qn(R,B,y,D,I,A,M,L,C):Jn(R,I,A,!0):(Y&8&&u(y,""),Z&16&&F(B,y,D,I,A,M,L,C))},Bt=(_,f,y,D,I,A,M,L,C)=>{_=_||Mn,f=f||Mn;const R=_.length,Y=f.length,B=Math.min(R,Y);let W;for(W=0;WY?Jn(_,I,A,!0,!1,B):F(f,y,D,I,A,M,L,C,B)},qn=(_,f,y,D,I,A,M,L,C)=>{let R=0;const Y=f.length;let B=_.length-1,W=Y-1;for(;R<=B&&R<=W;){const Z=_[R],ue=f[R]=C?on(f[R]):wt(f[R]);if(Qn(Z,ue))v(Z,ue,y,null,I,A,M,L,C);else break;R++}for(;R<=B&&R<=W;){const Z=_[B],ue=f[W]=C?on(f[W]):wt(f[W]);if(Qn(Z,ue))v(Z,ue,y,null,I,A,M,L,C);else break;B--,W--}if(R>B){if(R<=W){const Z=W+1,ue=ZW)for(;R<=B;)_t(_[R],I,A,!0),R++;else{const Z=R,ue=R,ye=new Map;for(R=ue;R<=W;R++){const at=f[R]=C?on(f[R]):wt(f[R]);at.key!=null&&ye.set(at.key,R)}let me,Qe=0;const Fe=W-ue+1;let yt=!1,st=0;const zn=new Array(Fe);for(R=0;R=Fe){_t(at,I,A,!0);continue}let Dt;if(at.key!=null)Dt=ye.get(at.key);else for(me=ue;me<=W;me++)if(zn[me-ue]===0&&Qn(at,f[me])){Dt=me;break}Dt===void 0?_t(at,I,A,!0):(zn[Dt-ue]=R+1,Dt>=st?st=Dt:yt=!0,v(at,f[Dt],y,null,I,A,M,L,C),Qe++)}const fs=yt?ju(zn):Mn;for(me=fs.length-1,R=Fe-1;R>=0;R--){const at=ue+R,Dt=f[at],hs=f[at+1],ms=at+1{const{el:A,type:M,transition:L,children:C,shapeFlag:R}=_;if(R&6){Rt(_.component.subTree,f,y,D);return}if(R&128){_.suspense.move(f,y,D);return}if(R&64){M.move(_,f,y,On);return}if(M===Ee){o(A,f,y);for(let B=0;BL.enter(A),I);else{const{leave:B,delayLeave:W,afterLeave:Z}=L,ue=()=>{_.ctx.isUnmounted?i(A):o(A,f,y)},ye=()=>{A._isLeaving&&A[cu](!0),B(A,()=>{ue(),Z&&Z()})};W?W(A,ue,ye):ye()}else o(A,f,y)},_t=(_,f,y,D=!1,I=!1)=>{const{type:A,props:M,ref:L,children:C,dynamicChildren:R,shapeFlag:Y,patchFlag:B,dirs:W,cacheIndex:Z}=_;if(B===-2&&(I=!1),L!=null&&(jt(),uo(L,null,y,_,!0),$t()),Z!=null&&(f.renderCache[Z]=void 0),Y&256){f.ctx.deactivate(_);return}const ue=Y&1&&W,ye=!Bn(_);let me;if(ye&&(me=M&&M.onVnodeBeforeUnmount)&&kt(me,f,_),Y&6)ac(_.component,y,D);else{if(Y&128){_.suspense.unmount(y,D);return}ue&&_n(_,null,f,"beforeUnmount"),Y&64?_.type.remove(_,f,y,On,D):R&&!R.hasOnce&&(A!==Ee||B>0&&B&64)?Jn(R,f,y,!1,!0):(A===Ee&&B&384||!I&&Y&16)&&Jn(C,f,y),D&&ps(_)}(ye&&(me=M&&M.onVnodeUnmounted)||ue)&&ct(()=>{me&&kt(me,f,_),ue&&_n(_,null,f,"unmounted")},y)},ps=_=>{const{type:f,el:y,anchor:D,transition:I}=_;if(f===Ee){sc(y,D);return}if(f===zo){k(_);return}const A=()=>{i(y),I&&!I.persisted&&I.afterLeave&&I.afterLeave()};if(_.shapeFlag&1&&I&&!I.persisted){const{leave:M,delayLeave:L}=I,C=()=>M(y,A);L?L(_.el,A,C):C()}else A()},sc=(_,f)=>{let y;for(;_!==f;)y=p(_),i(_),_=y;i(f)},ac=(_,f,y)=>{const{bum:D,scope:I,job:A,subTree:M,um:L,m:C,a:R}=_;Ds(C),Ds(R),D&&Yo(D),I.stop(),A&&(A.flags|=8,_t(M,_,f,y)),L&&ct(L,f),ct(()=>{_.isUnmounted=!0},f)},Jn=(_,f,y,D=!1,I=!1,A=0)=>{for(let M=A;M<_.length;M++)_t(_[M],f,y,D,I)},Ho=_=>{if(_.shapeFlag&6)return Ho(_.component.subTree);if(_.shapeFlag&128)return _.suspense.next();const f=p(_.anchor||_.el),y=f&&f[au];return y?p(y):f};let Mi=!1;const _s=(_,f,y)=>{let D;_==null?f._vnode&&(_t(f._vnode,null,null,!0),D=f._vnode.component):v(f._vnode||null,_,f,null,null,null,y),f._vnode=_,Mi||(Mi=!0,vs(D),za(),Mi=!1)},On={p:v,um:_t,m:Rt,r:ps,mt:de,mc:F,pc:pe,pbc:se,n:Ho,o:e};let Hi,xi;return t&&([Hi,xi]=t(On)),{render:_s,hydrate:Hi,createApp:Su(_s,Hi)}}function Vi({type:e,props:t},n){return n==="svg"&&e==="foreignObject"||n==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:n}function fn({effect:e,job:t},n){n?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Ku(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function gl(e,t,n=!1){const o=e.children,i=t.children;if($(o)&&$(i))for(let r=0;r>1,e[n[a]]0&&(t[o]=n[r-1]),n[r]=o)}}for(r=n.length,s=n[r-1];r-- >0;)n[r]=s,s=t[s];return n}function El(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:El(t)}function Ds(e){if(e)for(let t=0;te.__isSuspense;function $u(e,t){t&&t.pendingBranch?$(e)?t.effects.push(...e):t.effects.push(e):tu(e)}const Ee=Symbol.for("v-fgt"),wi=Symbol.for("v-txt"),Jt=Symbol.for("v-cmt"),zo=Symbol.for("v-stc"),_o=[];let pt=null;function X(e=!1){_o.push(pt=e?null:[])}function Yu(){_o.pop(),pt=_o[_o.length-1]||null}let To=1;function ks(e,t=!1){To+=e,e<0&&pt&&t&&(pt.hasOnce=!0)}function vl(e){return e.dynamicChildren=To>0?pt||Mn:null,Yu(),To>0&&pt&&pt.push(e),e}function ne(e,t,n,o,i,r){return vl(K(e,t,n,o,i,r,!0))}function We(e,t,n,o,i){return vl(Ge(e,t,n,o,i,!0))}function Yr(e){return e?e.__v_isVNode===!0:!1}function Qn(e,t){return e.type===t.type&&e.key===t.key}const Nl=({key:e})=>e??null,Zo=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?He(e)||$e(e)||ee(e)?{i:je,r:e,k:t,f:!!n}:e:null);function K(e,t=null,n=null,o=0,i=null,r=e===Ee?0:1,s=!1,a=!1){const l={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Nl(t),ref:t&&Zo(t),scopeId:Qa,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:r,patchFlag:o,dynamicProps:i,dynamicChildren:null,appContext:null,ctx:je};return a?(qr(l,n),r&128&&e.normalize(l)):n&&(l.shapeFlag|=He(n)?8:16),To>0&&!s&&pt&&(l.patchFlag>0||r&6)&&l.patchFlag!==32&&pt.push(l),l}const Ge=qu;function qu(e,t=null,n=null,o=0,i=null,r=!1){if((!e||e===vu)&&(e=Jt),Yr(e)){const a=Fn(e,t,!0);return n&&qr(a,n),To>0&&!r&&pt&&(a.shapeFlag&6?pt[pt.indexOf(e)]=a:pt.push(a)),a.patchFlag=-2,a}if(rd(e)&&(e=e.__vccOpts),t){t=Ju(t);let{class:a,style:l}=t;a&&!He(a)&&(t.class=ln(a)),Ne(l)&&(Ur(l)&&!$(l)&&(l=Me({},l)),t.style=Sr(l))}const s=He(e)?1:bl(e)?128:lu(e)?64:Ne(e)?4:ee(e)?2:0;return K(e,t,n,o,i,s,r,!0)}function Ju(e){return e?Ur(e)||dl(e)?Me({},e):e:null}function Fn(e,t,n=!1,o=!1){const{props:i,ref:r,patchFlag:s,children:a,transition:l}=e,c=t?zu(i||{},t):i,u={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Nl(c),ref:t&&t.ref?n&&r?$(r)?r.concat(Zo(t)):[r,Zo(t)]:Zo(t):r,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:a,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Ee?s===-1?16:s|16:s,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:l,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Fn(e.ssContent),ssFallback:e.ssFallback&&Fn(e.ssFallback),placeholder:e.placeholder,el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return l&&o&&Fr(u,l.clone(u)),u}function Ve(e=" ",t=0){return Ge(wi,null,e,t)}function Ss(e,t){const n=Ge(zo,null,e);return n.staticCount=t,n}function pr(e="",t=!1){return t?(X(),We(Jt,null,e)):Ge(Jt,null,e)}function wt(e){return e==null||typeof e=="boolean"?Ge(Jt):$(e)?Ge(Ee,null,e.slice()):Yr(e)?on(e):Ge(wi,null,String(e))}function on(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Fn(e)}function qr(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if($(t))n=16;else if(typeof t=="object")if(o&65){const i=t.default;i&&(i._c&&(i._d=!1),qr(e,i()),i._c&&(i._d=!0));return}else{n=32;const i=t._;!i&&!dl(t)?t._ctx=je:i===3&&je&&(je.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else ee(t)?(t={default:t,_ctx:je},n=32):(t=String(t),o&64?(n=16,t=[Ve(t)]):n=8);e.children=t,e.shapeFlag|=n}function zu(...e){const t={};for(let n=0;nze||je;let pi,_r;{const e=Ii(),t=(n,o)=>{let i;return(i=e[n])||(i=e[n]=[]),i.push(o),r=>{i.length>1?i.forEach(s=>s(r)):i[0](r)}};pi=t("__VUE_INSTANCE_SETTERS__",n=>ze=n),_r=t("__VUE_SSR_SETTERS__",n=>Oo=n)}const Do=e=>{const t=ze;return pi(e),e.scope.on(),()=>{e.scope.off(),pi(t)}},ws=()=>{ze&&ze.scope.off(),pi(null)};function Ol(e){return e.vnode.shapeFlag&4}let Oo=!1;function td(e,t=!1,n=!1){t&&_r(t);const{props:o,children:i}=e.vnode,r=Ol(e);Bu(e,o,r,t),Fu(e,i,n||t);const s=r?nd(e,t):void 0;return t&&_r(!1),s}function nd(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,Tu);const{setup:o}=n;if(o){jt();const i=e.setupContext=o.length>1?id(e):null,r=Do(e),s=Ao(o,e,0,[e.props,i]),a=Ia(s);if($t(),r(),(a||e.sp)&&!Bn(e)&&tl(e),a){if(s.then(ws,ws),t)return s.then(l=>{Cs(e,l,t)}).catch(l=>{Di(l,e,0)});e.asyncDep=s}else Cs(e,s,t)}else Il(e,t)}function Cs(e,t,n){ee(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:Ne(t)&&(e.setupState=$a(t)),Il(e,n)}let Ls;function Il(e,t,n){const o=e.type;if(!e.render){if(!t&&Ls&&!o.render){const i=o.template||Kr(e).template;if(i){const{isCustomElement:r,compilerOptions:s}=e.appContext.config,{delimiters:a,compilerOptions:l}=o,c=Me(Me({isCustomElement:r,delimiters:a},s),l);o.render=Ls(i,c)}}e.render=o.render||Nt}{const i=Do(e);jt();try{Ou(e)}finally{$t(),i()}}}const od={get(e,t){return Ke(e,"get",""),e[t]}};function id(e){const t=n=>{e.exposed=n||{}};return{attrs:new Proxy(e.attrs,od),slots:e.slots,emit:e.emit,expose:t}}function Ci(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy($a(Wc(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in po)return po[n](e)},has(t,n){return n in t||n in po}})):e.proxy}function rd(e){return ee(e)&&"__vccOpts"in e}const vn=(e,t)=>Jc(e,t,Oo),sd="3.5.27";/**
* @vue/runtime-dom v3.5.27
* (c) 2018-present Yuxi (Evan) You and Vue contributors
* @license MIT
**/let fr;const Ms=typeof window<"u"&&window.trustedTypes;if(Ms)try{fr=Ms.createPolicy("vue",{createHTML:e=>e})}catch{}const Al=fr?e=>fr.createHTML(e):e=>e,ad="http://www.w3.org/2000/svg",ld="http://www.w3.org/1998/Math/MathML",Pt=typeof document<"u"?document:null,Hs=Pt&&Pt.createElement("template"),cd={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const i=t==="svg"?Pt.createElementNS(ad,e):t==="mathml"?Pt.createElementNS(ld,e):n?Pt.createElement(e,{is:n}):Pt.createElement(e);return e==="select"&&o&&o.multiple!=null&&i.setAttribute("multiple",o.multiple),i},createText:e=>Pt.createTextNode(e),createComment:e=>Pt.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Pt.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,i,r){const s=n?n.previousSibling:t.lastChild;if(i&&(i===r||i.nextSibling))for(;t.insertBefore(i.cloneNode(!0),n),!(i===r||!(i=i.nextSibling)););else{Hs.innerHTML=Al(o==="svg"?``:o==="mathml"?``:e);const a=Hs.content;if(o==="svg"||o==="mathml"){const l=a.firstChild;for(;l.firstChild;)a.appendChild(l.firstChild);a.removeChild(l)}t.insertBefore(a,n)}return[s?s.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},ud=Symbol("_vtc");function dd(e,t,n){const o=e[ud];o&&(t=(t?[t,...o]:[...o]).join(" ")),t==null?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}const _i=Symbol("_vod"),Rl=Symbol("_vsh"),hr={name:"show",beforeMount(e,{value:t},{transition:n}){e[_i]=e.style.display==="none"?"":e.style.display,n&&t?n.beforeEnter(e):eo(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),eo(e,!0),o.enter(e)):o.leave(e,()=>{eo(e,!1)}):eo(e,t))},beforeUnmount(e,{value:t}){eo(e,t)}};function eo(e,t){e.style.display=t?e[_i]:"none",e[Rl]=!t}const pd=Symbol(""),_d=/(?:^|;)\s*display\s*:/;function fd(e,t,n){const o=e.style,i=He(n);let r=!1;if(n&&!i){if(t)if(He(t))for(const s of t.split(";")){const a=s.slice(0,s.indexOf(":")).trim();n[a]==null&&Qo(o,a,"")}else for(const s in t)n[s]==null&&Qo(o,s,"");for(const s in n)s==="display"&&(r=!0),Qo(o,s,n[s])}else if(i){if(t!==n){const s=o[pd];s&&(n+=";"+s),o.cssText=n,r=_d.test(n)}}else t&&e.removeAttribute("style");_i in e&&(e[_i]=r?o.display:"",e[Rl]&&(o.display="none"))}const xs=/\s*!important$/;function Qo(e,t,n){if($(n))n.forEach(o=>Qo(e,t,o));else if(n==null&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=hd(e,t);xs.test(n)?e.setProperty(dn(o),n.replace(xs,""),"important"):e[o]=n}}const Bs=["Webkit","Moz","ms"],Ki={};function hd(e,t){const n=Ki[t];if(n)return n;let o=Kt(t);if(o!=="filter"&&o in e)return Ki[t]=o;o=Da(o);for(let i=0;iji||(yd.then(()=>ji=0),ji=Date.now());function vd(e,t){const n=o=>{if(!o._vts)o._vts=Date.now();else if(o._vts<=n.attached)return;Ht(Nd(o,n.value),t,5,[o])};return n.value=e,n.attached=bd(),n}function Nd(e,t){if($(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map(o=>i=>!i._stopped&&o&&o(i))}else return t}const Ws=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Td=(e,t,n,o,i,r)=>{const s=i==="svg";t==="class"?dd(e,o,s):t==="style"?fd(e,n,o):Ni(t)?Rr(t)||gd(e,t,n,o,r):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Od(e,t,o,s))?(Gs(e,t,o),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&Ps(e,t,o,s,r,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!He(o))?Gs(e,Kt(t),o,r,t):(t==="true-value"?e._trueValue=o:t==="false-value"&&(e._falseValue=o),Ps(e,t,o,s))};function Od(e,t,n,o){if(o)return!!(t==="innerHTML"||t==="textContent"||t in e&&Ws(t)&&ee(n));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="autocorrect"||t==="sandbox"&&e.tagName==="IFRAME"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const i=e.tagName;if(i==="IMG"||i==="VIDEO"||i==="CANVAS"||i==="SOURCE")return!1}return Ws(t)&&He(n)?!1:t in e}const cn=e=>{const t=e.props["onUpdate:modelValue"]||!1;return $(t)?n=>Yo(t,n):t};function Id(e){e.target.composing=!0}function Vs(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Et=Symbol("_assign");function Ks(e,t,n){return t&&(e=e.trim()),n&&(e=Oi(e)),e}const fi={created(e,{modifiers:{lazy:t,trim:n,number:o}},i){e[Et]=cn(i);const r=o||i.props&&i.props.type==="number";Xt(e,t?"change":"input",s=>{s.target.composing||e[Et](Ks(e.value,n,r))}),(n||r)&&Xt(e,"change",()=>{e.value=Ks(e.value,n,r)}),t||(Xt(e,"compositionstart",Id),Xt(e,"compositionend",Vs),Xt(e,"change",Vs))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:n,modifiers:{lazy:o,trim:i,number:r}},s){if(e[Et]=cn(s),e.composing)return;const a=(r||e.type==="number")&&!/^0\d/.test(e.value)?Oi(e.value):e.value,l=t??"";a!==l&&(document.activeElement===e&&e.type!=="range"&&(o&&t===n||i&&e.value.trim()===l)||(e.value=l))}},Dl={deep:!0,created(e,t,n){e[Et]=cn(n),Xt(e,"change",()=>{const o=e._modelValue,i=Xn(e),r=e.checked,s=e[Et];if($(o)){const a=wr(o,i),l=a!==-1;if(r&&!l)s(o.concat(i));else if(!r&&l){const c=[...o];c.splice(a,1),s(c)}}else if(Kn(o)){const a=new Set(o);r?a.add(i):a.delete(i),s(a)}else s(kl(e,r))})},mounted:js,beforeUpdate(e,t,n){e[Et]=cn(n),js(e,t,n)}};function js(e,{value:t,oldValue:n},o){e._modelValue=t;let i;if($(t))i=wr(t,o.props.value)>-1;else if(Kn(t))i=t.has(o.props.value);else{if(t===n)return;i=Tn(t,kl(e,!0))}e.checked!==i&&(e.checked=i)}const Ad={created(e,{value:t},n){e.checked=Tn(t,n.props.value),e[Et]=cn(n),Xt(e,"change",()=>{e[Et](Xn(e))})},beforeUpdate(e,{value:t,oldValue:n},o){e[Et]=cn(o),t!==n&&(e.checked=Tn(t,o.props.value))}},Jr={deep:!0,created(e,{value:t,modifiers:{number:n}},o){const i=Kn(t);Xt(e,"change",()=>{const r=Array.prototype.filter.call(e.options,s=>s.selected).map(s=>n?Oi(Xn(s)):Xn(s));e[Et](e.multiple?i?new Set(r):r:r[0]),e._assigning=!0,qa(()=>{e._assigning=!1})}),e[Et]=cn(o)},mounted(e,{value:t}){$s(e,t)},beforeUpdate(e,t,n){e[Et]=cn(n)},updated(e,{value:t}){e._assigning||$s(e,t)}};function $s(e,t){const n=e.multiple,o=$(t);if(!(n&&!o&&!Kn(t))){for(let i=0,r=e.options.length;iString(c)===String(a)):s.selected=wr(t,a)>-1}else s.selected=t.has(a);else if(Tn(Xn(s),t)){e.selectedIndex!==i&&(e.selectedIndex=i);return}}!n&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Xn(e){return"_value"in e?e._value:e.value}function kl(e,t){const n=t?"_trueValue":"_falseValue";return n in e?e[n]:t}const Rd={created(e,t,n){Po(e,t,n,null,"created")},mounted(e,t,n){Po(e,t,n,null,"mounted")},beforeUpdate(e,t,n,o){Po(e,t,n,o,"beforeUpdate")},updated(e,t,n,o){Po(e,t,n,o,"updated")}};function Dd(e,t){switch(e){case"SELECT":return Jr;case"TEXTAREA":return fi;default:switch(t){case"checkbox":return Dl;case"radio":return Ad;default:return fi}}}function Po(e,t,n,o,i){const s=Dd(e.tagName,n.props&&n.props.type)[i];s&&s(e,t,n,o)}const kd=Me({patchProp:Td},cd);let Ys;function Sd(){return Ys||(Ys=Wu(kd))}const zr=(...e)=>{const t=Sd().createApp(...e),{mount:n}=t;return t.mount=o=>{const i=Cd(o);if(!i)return;const r=t._component;!ee(r)&&!r.render&&!r.template&&(r.template=i.innerHTML),i.nodeType===1&&(i.textContent="");const s=n(i,!1,wd(i));return i instanceof Element&&(i.removeAttribute("v-cloak"),i.setAttribute("data-v-app","")),s},t};function wd(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Cd(e){return He(e)?document.querySelector(e):e}let no=null,qs=[];function Ld(e){no=e}function b(e){return no!=null&&no[e]!=null?no[e]:(no==null&&(qs.push(e),console.error("语言文件未定义该Key",JSON.stringify(qs))),e)}function Md(e){let t=b(`setting_${e}_name`),n=b(`setting_${e}_desp`),o=b(`setting_${e}_btn`);if(t=="Undefined"||n=="Undefined")throw new Error(`设置文本${e}未定义`);return[t,n,o]}function Hd(e){return[b(`settingpage_${e}_name`)]}const xd=rt({__name:"page",props:{hasColumn:{type:Boolean}},setup(e){return(t,n)=>(X(),ne("div",{class:ln({"config__tab-container":!0,"config__tab-container--top":e.hasColumn})},[No(t.$slots,"default")],2))}}),Bd={key:0,class:"fn__flex-column",style:{height:"100%"}},Ud={class:"layout-tab-bar fn__flex"},Pd=["data-type","onClick"],Gd={class:"fn__flex-1"},Fd=["data-type"],Xd=rt({__name:"column",props:{columnKeys:{},columnNames:{},hide:{type:Boolean}},setup(e){const t=e,n=i=>{o.value=i},o=Pe(t.columnKeys[0]);return(i,r)=>e.hide?No(i.$slots,"none",{key:1}):(X(),ne("div",Bd,[K("div",Ud,[(X(!0),ne(Ee,null,dt(t.columnKeys,(s,a)=>(X(),ne("div",{class:ln(["item item--full",{"item--focus":o.value===s}]),"data-type":s,onClick:l=>n(s)},[r[0]||(r[0]=K("span",{class:"fn__flex-1"},null,-1)),K("span",null,ae(t.columnNames[a]),1),r[1]||(r[1]=K("span",{class:"fn__flex-1"},null,-1))],10,Pd))),256))]),K("div",Gd,[(X(!0),ne(Ee,null,dt(t.columnKeys,(s,a)=>(X(),ne("div",{"data-type":s,class:ln({fn__none:o.value!==s})},[No(i.$slots,s)],10,Fd))),256))])]))}}),Wd={class:"b3-label"},Vd={class:"fn__block"},Kd=["innerHTML"],mr=rt({__name:"block",props:{settingKey:{},configName:{},configDesp:{}},setup(e){const t=e;return(n,o)=>(X(),ne("div",Wd,[K("div",Vd,[Ve(ae(t.configName)+" ",1),K("div",{class:"b3-label__text",innerHTML:t.configDesp},null,8,Kd),o[0]||(o[0]=K("div",{class:"fn__hr"},null,-1)),No(n.$slots,"default")])]))}}),jd={class:"fn__flex b3-label config__item"},$d={class:"fn__flex-1 fn__flex-center"},Yd=["innerHTML"],ei=rt({__name:"item",props:{settingKey:{},configName:{},configDesp:{},applyValue:{},defaultValue:{}},setup(e){const t=e,n=vn(()=>t.defaultValue!=t.applyValue?t.configDesp+b("option_modified"):t.configDesp);return(o,i)=>(X(),ne("div",jd,[K("div",$d,[Ve(ae(t.configName)+" ",1),K("div",{class:"b3-label__text",innerHTML:n.value},null,8,Yd)]),i[0]||(i[0]=K("div",{class:"fn__space"},null,-1)),No(o.$slots,"default")]))}}),qd=rt({__name:"button",props:{btnName:{},btndo:{type:Function}},setup(e){const t=e;return(n,o)=>(X(),ne("button",{class:"b3-button b3-button--outline fn__size200",onClick:o[0]||(o[0]=(...i)=>t.btndo&&t.btndo(...i))},ae(t.btnName),1))}}),Jd=rt({__name:"switch",props:{modelValue:{type:Boolean},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=Ro(e,"modelValue");return(n,o)=>qt((X(),ne("input",{class:"b3-switch fn__flex-center",type:"checkbox","onUpdate:modelValue":o[0]||(o[0]=i=>t.value=i)},null,512)),[[Dl,t.value]])}}),zd=["type","min","max"],Js=rt({__name:"input",props:Vr({type:{},min:{},max:{}},{modelValue:{},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=Ro(e,"modelValue");let o=Pe("text");switch(t.type){case"NUMBER":o.value="number";break;case"TEXT":o.value="text";break;default:o.value="text";break}return(i,r)=>qt((X(),ne("input",{class:"b3-text-field fn__flex-center fn__size200",type:P(o),min:t.min,max:t.max,"onUpdate:modelValue":r[0]||(r[0]=s=>n.value=s)},null,8,zd)),[[Rd,n.value]])}}),Zd=["value"],Qd=rt({__name:"select",props:Vr({optionNames:{},optionKeys:{}},{modelValue:{type:String},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=Ro(e,"modelValue");return(o,i)=>qt((X(),ne("select",{class:"b3-select fn__flex-center fn__size200","onUpdate:modelValue":i[0]||(i[0]=r=>n.value=r)},[(X(!0),ne(Ee,null,dt(t.optionNames,(r,s)=>(X(),ne("option",{value:e.optionKeys[s]},ae(r),9,Zd))),256))],512)),[[Jr,n.value]])}}),ep=rt({__name:"textarea",props:{modelValue:{type:String},modelModifiers:{}},emits:["update:modelValue"],setup(e){const t=Ro(e,"modelValue");return(n,o)=>qt((X(),ne("textarea",{class:"b3-text-field fn__block",spellcheck:"false","onUpdate:modelValue":o[0]||(o[0]=i=>t.value=i)},null,512)),[[fi,t.value]])}});class h{}T(h,"RANDOM_DELAY",300),T(h,"STYLE_ID","hierarchy-navigate-plugin-style"),T(h,"ICON_ALL","all"),T(h,"ICON_NONE","none"),T(h,"ICON_CUSTOM_ONLY","custom"),T(h,"PLUGIN_NAME","og_hierachy_navigate"),T(h,"SAVE_TIMEOUT",900),T(h,"TOP_CONTAINER_CLASS_NAME","og-hn-heading-docs-container"),T(h,"HEADING_CLASS_NAME","og-hn-at-doc-top"),T(h,"FOOTER_CLASS_NAME","og-hn-at-doc-end"),T(h,"CONTAINER_CLASS_NAME","og-hierachy-navigate-doc-container"),T(h,"ARROW_CLASS_NAME","og-hierachy-navigate-breadcrumb-arrow"),T(h,"INFO_CONTAINER_CLASS","og-hierachy-navigate-info-container"),T(h,"PARENT_CONTAINER_ID","og-hierachy-navigate-parent-doc-container"),T(h,"CHILD_CONTAINER_ID","og-hierachy-navigate-children-doc-container"),T(h,"SIBLING_CONTAINER_ID","og-hierachy-navigate-sibling-doc-container"),T(h,"PARENT_SIBLING_CONTAINER_ID","og-hierachy-navigate-parent-sibling-doc-container"),T(h,"ON_THIS_DAY_CONTAINER_CLASS_NAME","og-hierachy-navigate-onthisday-doc-container"),T(h,"INDICATOR_CLASS_NAME","og-hierachy-navigate-doc-indicator"),T(h,"BREADCRUMB_CONTAINER_CLASS_NAME","og-hierachy-navigate-breadcrumb-container"),T(h,"MORE_OR_LESS_CONTAINER_CLASS_NAME","og-hierachy-navigate-moreorless-container"),T(h,"MOVE_TOP_AREA_CONTAINER_CLASS_NAME","og-hierachy-navigate-movetoparea-container"),T(h,"CONTAINER_MULTILINE_STYLE_CLASS_NAME","og-hn-container-multiline"),T(h,"COULD_FOLD_CLASS_NAME","og-hn-container-could-fold"),T(h,"IS_FOLDING_CLASS_NAME","og-hn-is-folding"),T(h,"HIDE_COULD_FOLD_STYLE_ID","og-hn-hide-could-fold"),T(h,"REF_LINK_FOR_POP_OUT_CLASS_NAME","og-hn-ref-link-simulate"),T(h,"PLACEHOLDER_FOR_POP_OUT_CLASS_NAME","og-hn-nav-top-placeholder"),T(h,"AREA_NOT_FOLD_CLASS_NAME","og-hn-not-fold"),T(h,"MENU_ITEM_CLASS_NAME","og-hn-breadcrumb-menu-item-container"),T(h,"NONE_CLASS_NAME","og-hierachy-navigate-doc-not-exist"),T(h,"NEXT_CONTAINER_CLASS_NAME","og-hierachy-navigate-next-doc-container"),T(h,"NEXT_PREVIEW_CONSTAINER_CLASS_NAME","og-hierachy-navigate-next-preview-doc-container"),T(h,"BACKLINK_CONTAINER_CLASS_NAME","og-hierachy-navigate-backlink-doc-container"),T(h,"FOWARDLINK_CONTAINER_CLASS_NAME","og-hierachy-navigate-forwardlink-doc-container"),T(h,"TO_THE_TOP_CLASS_NAME","og-hn-container-to-top"),T(h,"POP_NONE","disable"),T(h,"POP_LIMIT","icon_only"),T(h,"POP_ALL","all"),T(h,"BACKLINK_NONE","disable"),T(h,"BACKLINK_NORMAL","show_all_as_doc"),T(h,"BACKLINK_DOC_ONLY","doc_only"),T(h,"REMOVE_CURRENT_TAB_DEFAULT","default"),T(h,"REMOVE_CURRENT_TAB_TRUE","true"),T(h,"REMOVE_CURRENT_TAB_FALSE","false");class re{}T(re,"NAME_ALPHABET_ASC","alphabet_asc"),T(re,"NAME_ALPHABET_DESC","alphabet_desc"),T(re,"NAME_NATURAL_ASC","natural_asc"),T(re,"NAME_NATURAL_DESC","natural_desc"),T(re,"CREATE_TIME_ASC","create_asc"),T(re,"CREATE_TIME_DESC","create_desc"),T(re,"UPDATE_TIME_ASC","update_asc"),T(re,"UPDATE_TIME_DESC","update_desc");class S{}T(S,"PARENT","parent"),T(S,"CHILD","child"),T(S,"SIBLING","sibling"),T(S,"PREV_NEXT","previousAndNext"),T(S,"BACKLINK","backlinks"),T(S,"BREADCRUMB","breadcrumb"),T(S,"INFO","info"),T(S,"WIDGET","widget"),T(S,"BLOCK_BREADCRUMB","blockBreadcrumb"),T(S,"ON_THIS_DAY","onThisDay"),T(S,"FORWARDLINK","forwardlinks"),T(S,"MORE_OR_LESS","moreorless"),T(S,"PREV_NEXT_PREVIEW","previousAndNextPreview"),T(S,"PREVIEW_BOX","previewBox"),T(S,"MOVE_TOP_AREA","moveTopArea"),T(S,"PARENT_SIBLING","parentSibling");/**!
* Sortable 1.15.6
* @author RubaXa
* @author owenm
* @license MIT
*/function zs(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,o)}return n}function xt(e){for(var t=1;t=0)&&(n[i]=e[i]);return n}function op(e,t){if(e==null)return{};var n=np(e,t),o,i;if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);for(i=0;i=0)&&Object.prototype.propertyIsEnumerable.call(e,o)&&(n[o]=e[o])}return n}var ip="1.15.6";function Wt(e){if(typeof window<"u"&&window.navigator)return!!navigator.userAgent.match(e)}var Qt=Wt(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),ko=Wt(/Edge/i),Zs=Wt(/firefox/i),fo=Wt(/safari/i)&&!Wt(/chrome/i)&&!Wt(/android/i),Zr=Wt(/iP(ad|od|hone)/i),Sl=Wt(/chrome/i)&&Wt(/android/i),wl={capture:!1,passive:!1};function ce(e,t,n){e.addEventListener(t,n,!Qt&&wl)}function le(e,t,n){e.removeEventListener(t,n,!Qt&&wl)}function hi(e,t){if(t){if(t[0]===">"&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Cl(e){return e.host&&e!==document&&e.host.nodeType?e.host:e.parentNode}function vt(e,t,n,o){if(e){n=n||document;do{if(t!=null&&(t[0]===">"?e.parentNode===n&&hi(e,t):hi(e,t))||o&&e===n)return e;if(e===n)break}while(e=Cl(e))}return null}var Qs=/\s+/g;function lt(e,t,n){if(e&&t)if(e.classList)e.classList[n?"add":"remove"](t);else{var o=(" "+e.className+" ").replace(Qs," ").replace(" "+t+" "," ");e.className=(o+(n?" "+t:"")).replace(Qs," ")}}function z(e,t,n){var o=e&&e.style;if(o){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,""):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in o)&&t.indexOf("webkit")===-1&&(t="-webkit-"+t),o[t]=n+(typeof n=="string"?"":"px")}}function Pn(e,t){var n="";if(typeof e=="string")n=e;else do{var o=z(e,"transform");o&&o!=="none"&&(n=o+" "+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Ll(e,t,n){if(e){var o=e.getElementsByTagName(t),i=0,r=o.length;if(n)for(;i=r:s=i<=r,!s)return o;if(o===Mt())break;o=an(o,!1)}return!1}function Wn(e,t,n,o){for(var i=0,r=0,s=e.children;r2&&arguments[2]!==void 0?arguments[2]:{},i=o.evt,r=op(o,pp);So.pluginEvent.bind(J)(t,n,xt({dragEl:w,parentEl:ke,ghostEl:Q,rootEl:Ae,nextEl:En,lastDownEl:ni,cloneEl:Re,cloneHidden:sn,dragStarted:oo,putSortable:Ue,activeSortable:J.active,originalEvent:i,oldIndex:wn,oldDraggableIndex:mo,newIndex:ut,newDraggableIndex:rn,hideGhostForTarget:Fl,unhideGhostForTarget:Xl,cloneNowHidden:function(){sn=!0},cloneNowShown:function(){sn=!1},dispatchSortableEvent:function(a){qe({sortable:n,name:a,originalEvent:i})}},r))};function qe(e){dp(xt({putSortable:Ue,cloneEl:Re,targetEl:w,rootEl:Ae,oldIndex:wn,oldDraggableIndex:mo,newIndex:ut,newDraggableIndex:rn},e))}var w,ke,Q,Ae,En,ni,Re,sn,wn,ut,mo,rn,Go,Ue,Sn=!1,mi=!1,gi=[],hn,bt,qi,Ji,na,oa,oo,Rn,go,Eo=!1,Fo=!1,oi,Xe,zi=[],gr=!1,Ei=[],Li=typeof document<"u",Xo=Zr,ia=ko||Qt?"cssFloat":"float",_p=Li&&!Sl&&!Zr&&"draggable"in document.createElement("div"),Ul=function(){if(Li){if(Qt)return!1;var e=document.createElement("x");return e.style.cssText="pointer-events:auto",e.style.pointerEvents==="auto"}}(),Pl=function(t,n){var o=z(t),i=parseInt(o.width)-parseInt(o.paddingLeft)-parseInt(o.paddingRight)-parseInt(o.borderLeftWidth)-parseInt(o.borderRightWidth),r=Wn(t,0,n),s=Wn(t,1,n),a=r&&z(r),l=s&&z(s),c=a&&parseInt(a.marginLeft)+parseInt(a.marginRight)+Ce(r).width,u=l&&parseInt(l.marginLeft)+parseInt(l.marginRight)+Ce(s).width;if(o.display==="flex")return o.flexDirection==="column"||o.flexDirection==="column-reverse"?"vertical":"horizontal";if(o.display==="grid")return o.gridTemplateColumns.split(" ").length<=1?"vertical":"horizontal";if(r&&a.float&&a.float!=="none"){var d=a.float==="left"?"left":"right";return s&&(l.clear==="both"||l.clear===d)?"vertical":"horizontal"}return r&&(a.display==="block"||a.display==="flex"||a.display==="table"||a.display==="grid"||c>=i&&o[ia]==="none"||s&&o[ia]==="none"&&c+u>i)?"vertical":"horizontal"},fp=function(t,n,o){var i=o?t.left:t.top,r=o?t.right:t.bottom,s=o?t.width:t.height,a=o?n.left:n.top,l=o?n.right:n.bottom,c=o?n.width:n.height;return i===a||r===l||i+s/2===a+c/2},hp=function(t,n){var o;return gi.some(function(i){var r=i[ot].options.emptyInsertThreshold;if(!(!r||Qr(i))){var s=Ce(i),a=t>=s.left-r&&t<=s.right+r,l=n>=s.top-r&&n<=s.bottom+r;if(a&&l)return o=i}}),o},Gl=function(t){function n(r,s){return function(a,l,c,u){var d=a.options.group.name&&l.options.group.name&&a.options.group.name===l.options.group.name;if(r==null&&(s||d))return!0;if(r==null||r===!1)return!1;if(s&&r==="clone")return r;if(typeof r=="function")return n(r(a,l,c,u),s)(a,l,c,u);var p=(s?a:l).options.group.name;return r===!0||typeof r=="string"&&r===p||r.join&&r.indexOf(p)>-1}}var o={},i=t.group;(!i||ti(i)!="object")&&(i={name:i}),o.name=i.name,o.checkPull=n(i.pull,!0),o.checkPut=n(i.put),o.revertClone=i.revertClone,t.group=o},Fl=function(){!Ul&&Q&&z(Q,"display","none")},Xl=function(){!Ul&&Q&&z(Q,"display","")};Li&&!Sl&&document.addEventListener("click",function(e){if(mi)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),mi=!1,!1},!0);var mn=function(t){if(w){t=t.touches?t.touches[0]:t;var n=hp(t.clientX,t.clientY);if(n){var o={};for(var i in t)t.hasOwnProperty(i)&&(o[i]=t[i]);o.target=o.rootEl=n,o.preventDefault=void 0,o.stopPropagation=void 0,n[ot]._onDragOver(o)}}},mp=function(t){w&&w.parentNode[ot]._isOutsideThisEl(t.target)};function J(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw"Sortable: `el` must be an HTMLElement, not ".concat({}.toString.call(e));this.el=e,this.options=t=zt({},t),e[ot]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?">li":">*",swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Pl(e,this.options)},ghostClass:"sortable-ghost",chosenClass:"sortable-chosen",dragClass:"sortable-drag",ignore:"a, img",filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(s,a){s.setData("Text",a.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:"data-id",delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:"sortable-fallback",fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:J.supportPointer!==!1&&"PointerEvent"in window&&(!fo||Zr),emptyInsertThreshold:5};So.initializePlugins(this,e,n);for(var o in n)!(o in t)&&(t[o]=n[o]);Gl(t);for(var i in this)i.charAt(0)==="_"&&typeof this[i]=="function"&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:_p,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?ce(e,"pointerdown",this._onTapStart):(ce(e,"mousedown",this._onTapStart),ce(e,"touchstart",this._onTapStart)),this.nativeDraggable&&(ce(e,"dragover",this),ce(e,"dragenter",this)),gi.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),zt(this,lp())}J.prototype={constructor:J,_isOutsideThisEl:function(t){!this.el.contains(t)&&t!==this.el&&(Rn=null)},_getDirection:function(t,n){return typeof this.options.direction=="function"?this.options.direction.call(this,t,n,w):this.options.direction},_onTapStart:function(t){if(t.cancelable){var n=this,o=this.el,i=this.options,r=i.preventOnFilter,s=t.type,a=t.touches&&t.touches[0]||t.pointerType&&t.pointerType==="touch"&&t,l=(a||t).target,c=t.target.shadowRoot&&(t.path&&t.path[0]||t.composedPath&&t.composedPath()[0])||l,u=i.filter;if(Op(o),!w&&!(/mousedown|pointerdown/.test(s)&&t.button!==0||i.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&fo&&l&&l.tagName.toUpperCase()==="SELECT")&&(l=vt(l,i.draggable,o,!1),!(l&&l.animated)&&ni!==l)){if(wn=ft(l),mo=ft(l,i.draggable),typeof u=="function"){if(u.call(this,t,l,this)){qe({sortable:n,rootEl:c,name:"filter",targetEl:l,toEl:o,fromEl:o}),et("filter",n,{evt:t}),r&&t.preventDefault();return}}else if(u&&(u=u.split(",").some(function(d){if(d=vt(c,d.trim(),o,!1),d)return qe({sortable:n,rootEl:d,name:"filter",targetEl:l,fromEl:o,toEl:o}),et("filter",n,{evt:t}),!0}),u)){r&&t.preventDefault();return}i.handle&&!vt(c,i.handle,o,!1)||this._prepareDragStart(t,a,l)}}},_prepareDragStart:function(t,n,o){var i=this,r=i.el,s=i.options,a=r.ownerDocument,l;if(o&&!w&&o.parentNode===r){var c=Ce(o);if(Ae=r,w=o,ke=w.parentNode,En=w.nextSibling,ni=o,Go=s.group,J.dragged=w,hn={target:w,clientX:(n||t).clientX,clientY:(n||t).clientY},na=hn.clientX-c.left,oa=hn.clientY-c.top,this._lastX=(n||t).clientX,this._lastY=(n||t).clientY,w.style["will-change"]="all",l=function(){if(et("delayEnded",i,{evt:t}),J.eventCanceled){i._onDrop();return}i._disableDelayedDragEvents(),!Zs&&i.nativeDraggable&&(w.draggable=!0),i._triggerDragStart(t,n),qe({sortable:i,name:"choose",originalEvent:t}),lt(w,s.chosenClass,!0)},s.ignore.split(",").forEach(function(u){Ll(w,u.trim(),Zi)}),ce(a,"dragover",mn),ce(a,"mousemove",mn),ce(a,"touchmove",mn),s.supportPointer?(ce(a,"pointerup",i._onDrop),!this.nativeDraggable&&ce(a,"pointercancel",i._onDrop)):(ce(a,"mouseup",i._onDrop),ce(a,"touchend",i._onDrop),ce(a,"touchcancel",i._onDrop)),Zs&&this.nativeDraggable&&(this.options.touchStartThreshold=4,w.draggable=!0),et("delayStart",this,{evt:t}),s.delay&&(!s.delayOnTouchOnly||n)&&(!this.nativeDraggable||!(ko||Qt))){if(J.eventCanceled){this._onDrop();return}s.supportPointer?(ce(a,"pointerup",i._disableDelayedDrag),ce(a,"pointercancel",i._disableDelayedDrag)):(ce(a,"mouseup",i._disableDelayedDrag),ce(a,"touchend",i._disableDelayedDrag),ce(a,"touchcancel",i._disableDelayedDrag)),ce(a,"mousemove",i._delayedDragTouchMoveHandler),ce(a,"touchmove",i._delayedDragTouchMoveHandler),s.supportPointer&&ce(a,"pointermove",i._delayedDragTouchMoveHandler),i._dragStartTimer=setTimeout(l,s.delay)}else l()}},_delayedDragTouchMoveHandler:function(t){var n=t.touches?t.touches[0]:t;Math.max(Math.abs(n.clientX-this._lastX),Math.abs(n.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){w&&Zi(w),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var t=this.el.ownerDocument;le(t,"mouseup",this._disableDelayedDrag),le(t,"touchend",this._disableDelayedDrag),le(t,"touchcancel",this._disableDelayedDrag),le(t,"pointerup",this._disableDelayedDrag),le(t,"pointercancel",this._disableDelayedDrag),le(t,"mousemove",this._delayedDragTouchMoveHandler),le(t,"touchmove",this._delayedDragTouchMoveHandler),le(t,"pointermove",this._delayedDragTouchMoveHandler)},_triggerDragStart:function(t,n){n=n||t.pointerType=="touch"&&t,!this.nativeDraggable||n?this.options.supportPointer?ce(document,"pointermove",this._onTouchMove):n?ce(document,"touchmove",this._onTouchMove):ce(document,"mousemove",this._onTouchMove):(ce(w,"dragend",this),ce(Ae,"dragstart",this._onDragStart));try{document.selection?ii(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(t,n){if(Sn=!1,Ae&&w){et("dragStarted",this,{evt:n}),this.nativeDraggable&&ce(document,"dragover",mp);var o=this.options;!t&<(w,o.dragClass,!1),lt(w,o.ghostClass,!0),J.active=this,t&&this._appendGhost(),qe({sortable:this,name:"start",originalEvent:n})}else this._nulling()},_emulateDragOver:function(){if(bt){this._lastX=bt.clientX,this._lastY=bt.clientY,Fl();for(var t=document.elementFromPoint(bt.clientX,bt.clientY),n=t;t&&t.shadowRoot&&(t=t.shadowRoot.elementFromPoint(bt.clientX,bt.clientY),t!==n);)n=t;if(w.parentNode[ot]._isOutsideThisEl(t),n)do{if(n[ot]){var o=void 0;if(o=n[ot]._onDragOver({clientX:bt.clientX,clientY:bt.clientY,target:t,rootEl:n}),o&&!this.options.dragoverBubble)break}t=n}while(n=Cl(n));Xl()}},_onTouchMove:function(t){if(hn){var n=this.options,o=n.fallbackTolerance,i=n.fallbackOffset,r=t.touches?t.touches[0]:t,s=Q&&Pn(Q,!0),a=Q&&s&&s.a,l=Q&&s&&s.d,c=Xo&&Xe&&ta(Xe),u=(r.clientX-hn.clientX+i.x)/(a||1)+(c?c[0]-zi[0]:0)/(a||1),d=(r.clientY-hn.clientY+i.y)/(l||1)+(c?c[1]-zi[1]:0)/(l||1);if(!J.active&&!Sn){if(o&&Math.max(Math.abs(r.clientX-this._lastX),Math.abs(r.clientY-this._lastY))=0&&(qe({rootEl:ke,name:"add",toEl:ke,fromEl:Ae,originalEvent:t}),qe({sortable:this,name:"remove",toEl:ke,originalEvent:t}),qe({rootEl:ke,name:"sort",toEl:ke,fromEl:Ae,originalEvent:t}),qe({sortable:this,name:"sort",toEl:ke,originalEvent:t})),Ue&&Ue.save()):ut!==wn&&ut>=0&&(qe({sortable:this,name:"update",toEl:ke,originalEvent:t}),qe({sortable:this,name:"sort",toEl:ke,originalEvent:t})),J.active&&((ut==null||ut===-1)&&(ut=wn,rn=mo),qe({sortable:this,name:"end",toEl:ke,originalEvent:t}),this.save()))),this._nulling()},_nulling:function(){et("nulling",this),Ae=w=ke=Q=En=Re=ni=sn=hn=bt=oo=ut=rn=wn=mo=Rn=go=Ue=Go=J.dragged=J.ghost=J.clone=J.active=null,Ei.forEach(function(t){t.checked=!0}),Ei.length=qi=Ji=0},handleEvent:function(t){switch(t.type){case"drop":case"dragend":this._onDrop(t);break;case"dragenter":case"dragover":w&&(this._onDragOver(t),gp(t));break;case"selectstart":t.preventDefault();break}},toArray:function(){for(var t=[],n,o=this.el.children,i=0,r=o.length,s=this.options;ii.right+r||e.clientY>o.bottom&&e.clientX>o.left:e.clientY>i.bottom+r||e.clientX>o.right&&e.clientY>o.top}function vp(e,t,n,o,i,r,s,a){var l=o?e.clientY:e.clientX,c=o?n.height:n.width,u=o?n.top:n.left,d=o?n.bottom:n.right,p=!1;if(!s){if(a&&oiu+c*r/2:ld-oi)return-go}else if(l>u+c*(1-i)/2&&ld-c*r/2)?l>u+c/2?1:-1:0}function Np(e){return ft(w)Vl}function O(e,...t){jn()>=5&&console.debug(`${wo}[D] ${new Date().toLocaleTimeString()} ${e}`,...t)}function Ap(e,...t){jn()>=3&&console.info(`${wo}[I] ${new Date().toLocaleTimeString()} ${e}`,...t)}function V(e,...t){jn()>=4&&console.log(`${wo}[L] ${new Date().toLocaleTimeString()} ${e}`,...t)}function Ze(e,...t){jn()>=1&&(console.error(`${wo}[E] ${new Date().toLocaleTimeString()} ${e}`,...t),console.trace(t[0]??void 0))}function Le(e,...t){jn()>=2&&console.warn(`${wo}[W] ${new Date().toLocaleTimeString()} ${e}`,...t)}function oe(e){return!(e==null||e==null||e==="")}function vr(e){return!oe(e)||e.replace(/\s+/g,"")===""}let nr;function Rp(){let e=window.top.siyuan.config.system.os??navigator.platform??"ERROR";e=e.toUpperCase();let t=nr;if(nr==null){for(let n of["DARWIN","MAC","IPAD","IPHONE","IOS"])if(e.includes(n)){t=!0;break}nr=t}return t==null&&(t=!1),t}function aa(e){return Rp()?e.metaKey:e.ctrlKey}const la=e=>!e||typeof e!="string"?[]:e.replace(/[^0-9.]/g,"").split(".").map(Number);function ca(e){const t=la(e),n=la(window.siyuan.config.system.kernelVersion),o=Math.max(n.length,t.length);for(let i=0;is)return!1}return!1}const Dp=["id"],kp={class:"og-hn-setting-order-option-name-container"},Sp={class:"og-hn-order-option-name-text"},wp=["innerHTML"],Cp=["id"],Lp={class:"og-hn-setting-order-option-name-container"},Mp={class:"og-hn-order-option-name-text"},Hp=["innerHTML"],Nr=rt({__name:"order",props:Vr({optionNames:{},optionKeys:{},optionDesps:{},settingKey:{}},{modelValue:{type:Array},modelModifiers:{}}),emits:["update:modelValue"],setup(e){const t=e,n=Ro(e,"modelValue");let o=Pe(t.optionKeys.filter(l=>{var c;return!((c=n.value)!=null&&c.includes(l))})),i,r;const s=Pe(null),a=Pe(null);return Xr(()=>{V("绑定");try{i=new J(s.value,{group:"og-hn-shared-option-"+t.settingKey,animation:150,handle:".og-hn-order-drag-handle",scroll:!0,onEnd:function(l){if(O("移动1",l),l.to.id===h.PLUGIN_NAME+"-"+t.settingKey+"-enable"){let c=n.value[l.oldIndex];n.value.splice(l.oldIndex,1),n.value.splice(l.newIndex,0,c)}else{let c=n.value[l.oldIndex];n.value.splice(l.oldIndex,1),o.value.splice(l.newIndex,0,c)}for(let c=0;c(X(),ne(Ee,null,[K("div",{id:P(h).PLUGIN_NAME+"-"+e.settingKey+"-enable",class:"og-hn-setting-order-enable-container",ref_key:"enableArea",ref:s},[Ve(ae(P(b)("order_panel_enable"))+" ",1),(X(!0),ne(Ee,null,dt(n.value,(u,d)=>(X(),ne("div",{key:u,class:"og-hn-setting-order-option-container"},[K("div",kp,[c[0]||(c[0]=Ss('',1)),K("span",Sp,ae(e.optionNames[e.optionKeys.indexOf(u)]),1)]),qt(K("div",{class:"og-hn-setting-order-option-desp",innerHTML:e.optionDesps[e.optionKeys.indexOf(u)]},null,8,wp),[[hr,P(oe)(e.optionDesps[e.optionKeys.indexOf(u)])]])]))),128))],8,Dp),K("div",{id:P(h).PLUGIN_NAME+"-"+e.settingKey+"-disable",class:"og-hn-setting-order-disable-container",ref_key:"disableArea",ref:a},[Ve(ae(P(b)("order_panel_disable"))+" ",1),(X(!0),ne(Ee,null,dt(P(o),(u,d)=>(X(),ne("div",{key:u,class:"og-hn-setting-order-option-container"},[K("div",Lp,[c[1]||(c[1]=Ss('',1)),K("span",Mp,ae(e.optionNames[e.optionKeys.indexOf(u)]),1)]),qt(K("div",{class:"og-hn-setting-order-option-desp",innerHTML:e.optionDesps[e.optionKeys.indexOf(u)]},null,8,Hp),[[hr,P(oe)(e.optionDesps[e.optionKeys.indexOf(u)])]])]))),128))],8,Cp)],64))}});class j{constructor({key:t,type:n,min:o,max:i,btndo:r,options:s,optionSameAsSettingKey:a}){T(this,"key");T(this,"type");T(this,"min");T(this,"max");T(this,"btndo");T(this,"options");T(this,"configName");T(this,"description");T(this,"tips");T(this,"optionNames");T(this,"optionDesps");this.key=t,this.type=n,this.min=o,this.max=i,this.btndo=r,this.options=s??new Array,this.configName=b(`setting_${t}_name`),this.description=b(`setting_${t}_desp`),this.configName.startsWith("🧪")?this.description=b("setting_experimental")+this.description:this.configName.startsWith("✈")?this.description=b("setting_testing")+this.description:this.configName.startsWith("❌")&&(this.description=b("setting_deprecated")+this.description),this.optionNames=new Array,this.optionDesps=new Array;for(let l of this.options)this.optionNames.push(b(`setting_${a??t}_option_${l}`)),this.optionDesps.push(b(`setting_${a??t}_option_${l}_desp`))}}class Dn{constructor({key:t,props:n,iconKey:o}){T(this,"key");T(this,"iconKey");T(this,"props");T(this,"isColumn",!1);T(this,"columnNames",new Array);T(this,"columnKeys",new Array);this.key=t,oe(o)?this.iconKey=o:this.iconKey="setting",Array.isArray(n)?(this.props={none:n},this.columnNames.push(b("setting_column_none_name")),this.columnKeys.push("none")):(this.isColumn=!0,Object.keys(n).forEach(i=>{this.columnNames.push(b(`setting_column_${i}_name`)),this.columnKeys.push(i)}),this.props=n)}}function xp(e){let t={};return e.forEach(n=>{Object.values(n.props).forEach(o=>{o.forEach(i=>{t[i.key]=i})})}),t}let Kl=null;function Bp(e){Kl=e}function un(){return Kl}function Up(e){let t={mobile:!1,flashCard:!1,notTraditional:!1,originProtyle:e};return e.model==null&&(t.notTraditional=!0),ve()&&(t.mobile=!0),e.element.classList.contains("card__block")&&(t.flashCard=!0),t}function mt(e){if(e==null||e=="")return"";let t=["<",">"," ",""","&"],n=["<",">"," ",'"',"&"];for(let o=0;o{n+=String.fromCodePoint(+("0x"+o))}),n}catch(n){return Ze("emoji处理时发生错误",e,n),t?"📑":"📄"}}function $n({mouseEvent:e,paramDocId:t="",keyParam:n=void 0,openInFocus:o=void 0,g_setting:i}){let r,s=0;i.openDocRemoveCurrentTab=="true"&&(r=!0),i.openDocRemoveCurrentTab=="false"&&(r=!1),i.autoRemoveOldTabJudgeMiliseconds!=0&&Number.isInteger(i.autoRemoveOldTabJudgeMiliseconds)&&(s=i.autoRemoveOldTabJudgeMiliseconds),Xp({mouseEvent:e,paramDocId:t,keyParam:n,openInFocus:o,removeCurrentTab:r,autoRemoveJudgeMiliseconds:s})}function Pp(e){var t,n,o,i,r,s,a,l,c;if(oe(e)||(e=pn(!0)),!oe(e)){O("错误的id或多个匹配id");return}if(ht!=null&&ht.getAllEditor){const u=ht.getAllEditor();let d=null;for(let p=0;pparseInt(s)&&(s=i[c]),parseInt(i[c])":"<"} '${o?s:r}'
ORDER BY
a.value ${o?"ASC":"DESC"}
LIMIT 1`);return O("dailyNote结果",a),a&&a.length>0?a[0]:(O("日记未定位到结果"),null)}function ns(e){return[Se.FILE_NAME_ASC,Se.NAME_NAT_ASC,Se.CREATED_TIME_ASC,Se.MODIFIED_TIME_ASC,Se.REF_COUNT_ASC,Se.DOC_SIZE_ASC,Se.SUB_DOC_COUNT_ASC].includes(e)}function os(e){return[Se.FILE_NAME_ASC,Se.FILE_NAME_DESC,Se.NAME_NAT_ASC,Se.NAME_NAT_DESC,Se.CREATED_TIME_ASC,Se.CREATED_TIME_DESC].includes(e)}function it(e,t,n){const o=b("dialog_panel_plugin_name"),i=`${e} —— ${o}`;Lt.showMessage(i,t,n)}function Or(e){return new Promise(t=>setTimeout(t,e))}function Gp(){const e=Fp();return e==null?null:e.dataset.nodeId}function Fp(){var e,t,n;if(document.activeElement.classList.contains("protyle-wysiwyg")){let o=(t=(e=window.getSelection())==null?void 0:e.focusNode)==null?void 0:t.parentElement;for(;o!=null&&((n=o==null?void 0:o.dataset)==null?void 0:n.nodeId)==null;)o=o.parentElement;return o}else return null}let ua=0;function Xp({mouseEvent:e,paramDocId:t="",keyParam:n={},openInFocus:o=void 0,removeCurrentTab:i=void 0,autoRemoveJudgeMiliseconds:r=0}){var u,d,p,m;let s;if(e&&((u=e.currentTarget)!=null&&u.getAttribute("data-node-id"))?s=(d=e.currentTarget)==null?void 0:d.getAttribute("data-node-id"):(p=e==null?void 0:e.currentTarget)!=null&&p.getAttribute("data-id")?s=(m=e.currentTarget)==null?void 0:m.getAttribute("data-id"):s=t,!oe(s)){O("错误的id",s);return}if(ve()){Lt.openMobileFileById(un().app,s);return}O("openRefLinkEventAPIF",e),e&&(n={},n.ctrlKey=e.ctrlKey,n.shiftKey=e.shiftKey,n.altKey=e.altKey,n.metaKey=e.metaKey);let a;n.altKey?a="right":n.shiftKey&&(a="bottom"),r>0&&(Date.now()-uan.name===e)}function Vp(e){return Lt.getBackend()!=="darwin"?e.replace(/⌥/g,"Alt ").replace(/⌘/g,"Ctrl ").replace(/⇧/g,"Shift ").replace(/⇪/g,"CapsLock ").replace(/⌃/g,"Ctrl "):e}async function At(e,t){let n;return await fetch(t,{body:JSON.stringify(e),method:"POST",headers:{"Content-Type":"application/json"}}).then(o=>{n=o.json()}),n}async function Co(e){const t=await e;return t.code!=0||t.data==null?null:t.data}async function xe(e){let n=await At({stmt:e},"/api/query/sql");if(n.code==0&&n.data!=null)return n.data;if(n.msg!="")throw new Error(`SQL ERROR: ${n.msg}`);return[]}async function Lo({notebook:e,path:t,maxListCount:n=void 0,sort:o=void 0,ignore:i=!0,showHidden:r=null}){let s="/api/filetree/listDocsByPath",a={notebook:e,path:t};n!=null&&n>=0&&(a.maxListCount=n),o!=null&&o!=Se.FOLLOW_DOC_TREE&&o!=Se.UNASSIGNED&&(a.sort=o),i!=null&&(a.ignoreMaxListHint=i),r!=null&&(a.showHidden=r);let l=await At(a,s);return l.code!=0||l.data==null?(Le("listDocsByPath请求错误",l.msg),new Array):l.data.files}async function Kp(e){let n=await At({id:e},"/api/attr/getBlockAttrs");if(n.code!=0)throw Error("获取挂件块参数失败");return n.data}function pn(e=!1){var o,i,r;let t=null;t=(o=window.top.document.querySelector(".layout__wnd--active .protyle.fn__flex-1:not(.fn__none) .protyle-background"))==null?void 0:o.getAttribute("data-node-id"),O("尝试获取当前具有焦点的id",t);let n=null;if(!t&&ve())try{n=(i=window.top.document.querySelector(".protyle-breadcrumb .protyle-breadcrumb__item .popover__block[data-id]"))==null?void 0:i.getAttribute("data-id");let s=window.top.document.querySelectorAll(".protyle-breadcrumb .protyle-breadcrumb__item .popover__block[data-id]");for(let a=0;a0&&l.children[0].getAttribute("xlink:href")=="#iconFile"){n=l.getAttribute("data-id");break}}t=n}catch(s){console.error(s),n=null}return!t&&(t=(r=window.top.document.querySelector(".protyle.fn__flex-1:not(.fn__none) .protyle-background"))==null?void 0:r.getAttribute("data-node-id"),O("获取具有焦点id失败,获取首个打开中的文档",t),e&&window.top.document.querySelectorAll(".protyle.fn__flex-1:not(.fn__none) .protyle-background").length>1)?(O("要求必须唯一确认,但是找到多个打开中的文档"),null):t}function pa(){if(ve())return[pn()];{const e=window.document.querySelectorAll("[data-type=wnd] .protyle.fn__flex-1:not(.fn__none) .protyle-background");return[].map.call(e,function(n){return n.getAttribute("data-node-id")})}}function rs(e=void 0){try{if(!e)return window.top.siyuan.notebooks;for(let t of window.top.siyuan.notebooks)if(t.id==e)return t;return}catch(t){Ze(t);return}}function ss(e=void 0){var t;try{let n=window.top.siyuan.config.fileTree.sort;if(!e)return n;let o=((t=window.document.querySelector(`.file-tree.sy__file ul[data-url='${e}']`))==null?void 0:t.getAttribute("data-sortmode"))??rs(e).sortMode;return typeof o=="string"&&(o=parseInt(o,10)),o==Se.UNASSIGNED||o==Se.FOLLOW_DOC_TREE?n:o}catch(n){Ze(n);return}}async function jp(e){let n=await At({id:e},"/api/export/preview");return n.code==0&&n.data!=null?n.data.html:""}async function _a(e,t,n="Untitled",o=""){return(await At({notebook:e,path:t,md:o,title:n},"/api/filetree/createDoc")).code==0}async function Vn(e){return Co(At({id:e},"/api/block/getDocInfo"))}async function fa(e,t="3",n="3",o="",i=""){return Co(At({id:e,sort:t,msort:n,k:o,mk:i},"/api/ref/getBacklink2"))}async function $p(e){return Co(At({id:e},"/api/block/getTreeStat"))}let Vo=null;function ve(){return Vo??(window.top.document.getElementById("sidebar")?(Vo=!0,!0):(Vo=!1,!1))}function Yp(e,t=[]){return Co(At({id:e,excludeTypes:t},"/api/block/getBlockBreadcrumb"))}async function qp(e){return Co(At({id:e},"/api/filetree/getHPathByID"))}async function Jp({id:e,refMode:t,embedMode:n,yfm:o}){let s=await At({id:e,refMode:t,embedMode:n,yfm:o},"/api/export/exportMdContent");if(s.code==0)return s.data;throw new Error("exportMdContent Failed: "+s.msg)}const Se={FILE_NAME_ASC:0,FILE_NAME_DESC:1,NAME_NAT_ASC:4,NAME_NAT_DESC:5,CREATED_TIME_ASC:9,CREATED_TIME_DESC:10,MODIFIED_TIME_ASC:2,MODIFIED_TIME_DESC:3,REF_COUNT_ASC:7,REF_COUNT_DESC:8,DOC_SIZE_ASC:11,DOC_SIZE_DESC:12,SUB_DOC_COUNT_ASC:13,SUB_DOC_COUNT_DESC:14,CUSTOM_SORT:6,FOLLOW_DOC_TREE:255,FOLLOW_DOC_TREE_ORI:15,UNASSIGNED:256};function jl(){$l();const e=te();V("set styleg_setting",e);const t=ql(),n=document.getElementsByTagName("head")[0],o=document.createElement("style");o.setAttribute("id",h.STYLE_ID);let i=e.sameWidth==0?"":`
.og-hn-heading-docs-container span.docLinksWrapper {
min-width: ${e.sameWidth}em;
}`,r=e.hideIndicator?`
.og-hn-heading-docs-container .og-hierachy-navigate-doc-indicator {
display:none;
}
`:"",s=e.areaBorder?`
.og-hierachy-navigate-doc-container {
border: 1px solid rgba(0, 0, 0, 0);
}
.og-hierachy-navigate-doc-container:hover {
border: 1px solid var(--b3-theme-surface-lighter);
}
`:"",a=e.noneAreaHide?`
.${h.NONE_CLASS_NAME} {
display: none;
}
`:"",l=e.endDocAreaPaddingTop?`/*文档结尾区域*/
.og-hn-heading-docs-container.og-hn-at-doc-end{
border-top: 2px dotted var(--b3-table-border-color);
}`:"",c=`
.og-hn-container-multiline {
text-indent: -2em; /*2.28略微多了*/
padding-left: 2em;
overflow-x: hidden;
/* #30 2.28em与100%导致宽度溢出 */
padding-right: 0em;
width: auto;
}
.og-hn-container-multiline .og-hierachy-navigate-doc-indicator {
}
.og-hn-container-multiline .og-hn-emoji-and-name {
text-indent: 0px;
}
.og-hn-container-multiline .og-hn-doc-none-word {
text-indent: 0px;
}
`,u=`
.${h.TO_THE_TOP_CLASS_NAME} {
z-index: 9;
position: fixed;
top: 10px;
left: 10px;
background: var(--b3-toolbar-background);
border: 1px solid var(--b3-toolbar-blur-background);
max-height: 60vh;
max-width: 50vw;
}
.${h.TO_THE_TOP_CLASS_NAME} .og-hierachy-navigate-movetoparea-container {
cursor: move;
display: block;
}
.og-hierachy-navigate-movetoparea-container {
display: none;
}
`,d=e.sameWidthColumn;ve()&&(d=e.sameWidthColumnMobile);let p=e.docNameCentering?"margin: 0 auto; /*居中显示*/":"";const m=d>0?`
.og-hierachy-navigate-doc-container.og-hierachy-navigate-children-doc-container span.docLinksWrapper,
.og-hierachy-navigate-doc-container.og-hierachy-navigate-sibling-doc-container span.docLinksWrapper,
.og-hierachy-navigate-doc-container.og-hierachy-navigate-onthisday-doc-container span.docLinksWrapper,
.og-hierachy-navigate-doc-container.og-hierachy-navigate-parent-sibling-doc-container span.docLinksWrapper,
.og-hierachy-navigate-doc-container.og-hierachy-navigate-next-doc-container span.docLinksWrapper,
.og-hierachy-navigate-doc-container.og-hierachy-navigate-parent-doc-container span.docLinksWrapper,
.og-hierachy-navigate-doc-container.og-hierachy-navigate-backlink-doc-container span.docLinksWrapper {
width: calc( (100% - ${d} * ${d==1?"0px":"10px"}) / ${d});
${d==1?"margin-right: 0px;":""}/*仅一列时忽略margin-right*/
}
`:"",g=ve()?`.og-hierachy-navigate-doc-container.og-hierachy-navigate-next-doc-container span.docLinksWrapper {
width: 100%;
margin-right: 0px;
}`:"",v=`
.${h.CONTAINER_CLASS_NAME} span.docLinksWrapper{
background-color: var(--b3-protyle-code-background);/*var(--b3-protyle-inline-code-background); --b3-protyle-code-background --b3-theme-surface-light*/
color: var(--b3-protyle-inline-code-color);
/*line-height: calc(1em + 2px);*/ /*此项导致连接上下可滚动*/
font-weight: 400;
display: inline-flex;
align-items: center;
box-sizing: border-box;
padding: 4px 6px;
border-radius: calc(1em + 2px);
transition: var(--b3-transition);
margin-bottom: 3px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
max-width: calc(100% - 10px); /*需要排除margin-right: 10px的影响*/
${ve()?"margin-top: 6px;":""}
}
.${h.CONTAINER_CLASS_NAME} span.docLinksWrapper.og-hn-docLinksWrapper-hl {
background-color: color-mix(in srgb, var(--b3-protyle-code-background) 95%, var(--b3-theme-on-background));
border: 0.55px dashed color-mix(in srgb, var(--b3-protyle-code-background) 35%, var(--b3-theme-on-background));
}
.${h.CONTAINER_CLASS_NAME} span.docLinksWrapper.og-none-click {
color: var(--b3-theme-on-background);
}
.${h.CONTAINER_CLASS_NAME} span.og-hn-emoji-and-name {
${p} /*居中显示*/
text-overflow: ellipsis;
overflow-x: hidden; /* 修复文字下侧被截断的问题 */
}
/* 语义调整 refLinks 的可点击,其他仅样式 https://github.com/OpaqueGlass/syplugin-hierarchyNavigate/issues/61 */
.og-hierachy-navigate-sibling-doc-container span.docLinksWrapper,
.og-hierachy-navigate-children-doc-container span.docLinksWrapper,
.og-hierachy-navigate-next-doc-container span.docLinksWrapper,
.og-hierachy-navigate-backlink-doc-container span.docLinksWrapper {
margin-right: 10px;
}
/* 这里,由于提示词单独占位,导致提示词-链接之间gap一样也有10px,或许可以考虑全都加入gap就不显得突兀了 */
.og-hierachy-navigate-sibling-doc-container,
.og-hierachy-navigate-children-doc-container,
.og-hierachy-navigate-next-doc-container,
.og-hierachy-navigate-backlink-doc-container {
/*display: flex;
flex-wrap: wrap;
gap: 10px;
align-items: flex-start;*/
}
`,G=`
.og-hierachy-navigate-next-preview-doc-container {
max-height: 230px;
overflow: scroll;
}
.og-hn-np-inner-flex {
display: flex;
justify-content: space-between;
margin: 10px 0;
gap: 20px;
height: 100%;
}
.og-hn-np-nav-preview {
flex: 1;
min-width: 0;
cursor: pointer;
display: flex;
}
.og-hn-np-nav-preview-inner {
border: 1px solid var(--b3-table-border-color);
border-radius: 8px;
padding: 15px;
height: 100%;
transition: all 0.3s ease;
display: flex;
flex-direction: column;
width: 100%;
min-height: 0;
box-sizing: border-box;
}
.og-hn-np-nav-preview-inner:hover {
border-color: #888;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
/*background-color: #00000011;*/
}
.og-hn-np-prev .og-hn-np-nav-direction,
.og-hn-np-prev .og-hn-np-nav-post-title,
.og-hn-np-prev .og-hn-np-nav-excerpt {
text-align: left;
}
.og-hn-np-next .og-hn-np-nav-direction,
.og-hn-np-next .og-hn-np-nav-post-title{
text-align: right;
}
.og-hn-np-nav-direction {
font-weight: bold;
color: var(--custom-h2-color);
margin-bottom: 5px;
}
.og-hn-np-nav-post-title {
font-size: 1.1em;
font-weight: bold;
color: var(--custom-h2-color);
margin-bottom: 10px;
word-break: break-all;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.og-hn-np-nav-excerpt {
color: var(--b3-theme-on-surface);
font-size: 1em;
line-height: 1.5;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 3;
-webkit-box-orient: vertical;
flex-grow: 1;
}
.og-hn-np-placeholder {
background-color: #00000001;
color: transparent;
user-select: none;
}
.og-hn-np-placeholder .og-hn-np-nav-excerpt {
background-color: #eee;
color: transparent;
border-radius: 4px;
}
.og-hn-np-placeholder .og-hn-np-nav-direction::after {
content: "${b("no_doc")}";
color: #999;
display: block;
}
.og-hn-np-placeholder .og-hn-np-nav-post-title,
.og-hn-np-placeholder .og-hn-np-nav-excerpt {
visibility: hidden;
}
.og-hn-np-nav-preview.og-hn-np-non-clickable {
cursor: not-allowed;
}
.og-hn-heading-docs-container.og-hn-at-doc-end {
padding-bottom: 20px;
}
.og-hn-np-nav-preview-inner.og-hn-np-placeholder .og-hn-np-nav-direction {
color: #999;
}
`,U=`
/* 主容器 */
.og-hn-pb-container {
display: flex;
flex-wrap: wrap;
gap: 10px;
overflow: scroll;
}
/* 单个文档方块 */
.og-hn-pb-doc-box {
border: 1px solid var(--b3-table-border-color);
flex: 1 0 250px;
max-height: 200px;
overflow: auto;
border-radius: 10px;
padding: 10px 15px 15px 8px;
/*margin: 5px;*/
display: flex;
flex-direction: column;
}
/* 文档标题 */
.og-hn-pb-title {
margin: 10px 0;
font-size: 1.1em;
font-weight: bold;
color: var(--custom-h2-color);
cursor: pointer;
}
/* 文档内容预览 */
.og-hn-pb-content {
margin: 0 0 0 7px;
width: 95%;
white-space: normal;
overflow: hidden;
font-size: 1em;
}
/* 子文档容器 */
.og-hn-pb-child-container {
margin-left: 7px;
width: 95%;
}
/* 子文档项 */
.og-hn-pb-child-item {
margin: 5px 0;
font-size: 0.9em;
white-space: normal;
}
/* 子文档链接 */
.og-hn-pb-child-item {
cursor: pointer;
color: var(--b3-protyle-inline-link-color);
}
.og-hn-pb-child-item:hover {
background-color: #00000010;
}
/* emoji图标 */
.og-hn-pb-emoji {
margin-right: 5px;
}
/* 深色模式适配 */
.dark-mode .og-hn-pb-doc-box {
background-color: #efefef15;
color: #C9D1D9;
}
.dark-mode .og-hn-pb-doc-box:hover {
background-color: #efefef25;
}
.dark-mode .og-hn-pb-content a {
color: #7aa7d4 !important;
}
/* 悬停效果 */
.og-hn-pb-doc-box:hover {
border-color: #888;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
/* 任务列表样式调整 */
.og-hn-pb-content ul:has(> .protyle-task) {
list-style-type: none;
padding-left: 16px;
}
.og-hn-pb-content > ul:has(> .protyle-task) {
padding-left: 0px;
}
.og-hn-pb-content .protyle-task input ~ p {
display: inline-block;
}
/* 图片显示 */
.og-hn-pb-content .img img {
max-width: 100%;
display: inline-block;
}
.og-hn-pb-content .code-block {
background-color: unset;
}
.og-hn-pb-content .code-block .hljs {
overflow: hidden;
}
`,x=e.relativeFontSize&&e.relativeFontSize>0?Math.round(e.relativeFontSize*parseFloat(window.siyuan.config.editor.fontSize??16)):e.fontSize;o.innerHTML=`
.og-hn-doc-none-word {
background-color: #d23f3155;/*var(--b3-protyle-inline-code-background); --b3-protyle-code-background --b3-theme-surface-light*/
width: 2.5em;
text-align: center;
display: inline-grid !important;
color: var(--b3-theme-on-background);
line-height: calc(1em + 2px);
font-weight: 400;
align-items: center;
box-sizing: border-box;
/* #30 调整padding左右,尽量避免换行导致右侧大量留白 */
padding: 4px 4px;
border-radius: calc(1em + 2px);
transition: var(--b3-transition);
margin-bottom: 3px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
}
.og-hn-menu-emojitext, .og-hn-menu-emojipic {
align-self: center;
height: 14px;
width: 14px;
line-height: 14px;
margin-right: 8px;
flex-shrink: 0;
}
img.og-hn-menu-emojipic {
width: 16px;
height: 16px;
}
/* 语义调整 refLink的可点击,其他仅样式 https://github.com/OpaqueGlass/syplugin-hierarchyNavigate/issues/61 */
.og-hn-heading-docs-container span.docLinksWrapper.refLinks:hover {
cursor: pointer;
box-shadow: 0 0 2px var(--b3-list-hover);
opacity: .86;
/*background-color: var(--b3-toolbar-hover);*/
/*text-decoration: underline;*/
}
.og-hn-heading-docs-container .trimDocName {
overflow: hidden;
text-overflow: ellipsis;
}
.og-hn-heading-docs-container {
padding: 0px 6px;
font-size: ${x}px;
}
${i}
${r}
${a}
${e.hideIndicator?"":c}
${m}
${g} /* 移动端下一篇强制一列 */
${s}
${u}
${G}
${U}
${l}
/* 限制相邻文档区域 链接宽度
.og-hierachy-navigate-doc-container.og-hierachy-navigate-next-doc-container span.docLinksWrapper {
width: calc( (100% - 2em - 1 * 10px) / 4);
}*/
.og-hierachy-navigate-doc-container {
max-height: ${ve()?"25vh":e.maxHeightLimit+"em"};
overflow-y: scroll;
}
.og-hierachy-navigate-doc-container.og-hn-not-fold {
max-height: none;
}
.og-hierachy-navigate-doc-container + .og-hierachy-navigate-doc-container {
padding-top: 6px;
}
.og-hn-create-at-wrapper, .og-hn-modify-at-wrapper, .og-hn-child-doc-count-wrapper, .og-hn-child-word-count-wrapper {
margin-right: 8px;
}
.og-hn-create-at-indicator, .og-hn-modify-at-indicator, .og-hn-child-word-count-indicator, .og-hn-child-doc-count-wrapper {
color: var(--b3-theme-on-surface);
}
.og-hn-create-at-content, .og-hn-modify-at-content, .og-hn-child-word-count-content, .og-hn-child-doc-count-content {
font-weight: 600;
color: var(--b3-theme-on-background);
}
.og-hn-notebook-wrapper {
color: var(--b3-theme-on-background);
}
.og-hierachy-navigate-info-container {
margin-bottom: 7px;
}
.${h.CONTAINER_CLASS_NAME} {
text-align: left;
}
/* 面包屑箭头 */
.og-hn-heading-docs-container .og-fake-breadcrumb-arrow-span .${h.ARROW_CLASS_NAME} {
height: 10px;
width: 10px;
color: var(--b3-theme-on-surface-light);
margin: 0 4px;
flex-shrink: 0;
}
/* 块没有>功能,屏蔽 */
.og-hn-heading-docs-container .og-fake-breadcrumb-arrow-span[data-type="FILE"],
.og-hn-heading-docs-container .og-fake-breadcrumb-arrow-span[data-type="NOTEBOOK"] {
display: inline-block;
cursor: pointer;
}
.og-hn-parent-area-replace-with-breadcrumb .docLinksWrapper {
margin: 0 auto;
}
.og-hn-widget-container {
border-bottom: solid 1px var(--b3-border-color);
}
.og-hn-widget-container {
padding: 0px 6px;
}
.og-hn-widget-container.og-hn-mobile {
padding-top: 16px;
padding-left: 24px;
padding-right: 16px;
}
.og-hn-more-less {
color: var(--b3-protyle-inline-link-color);
cursor: pointer;
}
.og-hn-more-less:hover {
text-decoration: underline;
}
${e.docLinkCSS==t.docLinkCSS&&e.docLinkClass==t.docLinkClass?v:""}
.${h.PARENT_CONTAINER_ID} {${Ko(e.parentBoxCSS)}}
.${h.CHILD_CONTAINER_ID} {${Ko(e.childBoxCSS)}}
.${h.SIBLING_CONTAINER_ID} {${Ko(e.siblingBoxCSS)}}
.${h.CONTAINER_CLASS_NAME} span.docLinksWrapper {${Ko(e.docLinkCSS)}}
/* 置顶后占位 */
.${h.PLACEHOLDER_FOR_POP_OUT_CLASS_NAME} {
display: flex;
justify-content: center;
align-items: center;
}
/* 折叠隐藏 */
.og-hn-heading-docs-container .${h.IS_FOLDING_CLASS_NAME} {
display: none !important;
}
`,n.appendChild(o)}function Ko(e){return e?e.replace(new RegExp("<[^<]*style[^>]*>","g"),""):""}function $l(){var e;(e=document.getElementById(h.STYLE_ID))==null||e.remove()}function Yl(){const e=document.createElement("style");e.id=h.HIDE_COULD_FOLD_STYLE_ID,e.innerHTML=`.${h.COULD_FOLD_CLASS_NAME} {display: none !important;}`,document.head.appendChild(e)}function zp(){var e;(e=document.getElementById(h.HIDE_COULD_FOLD_STYLE_ID))==null||e.remove()}const Zp={style:{"word-break":"normal"}},Qp={style:{margin:"10px 0px","list-style-position":"inside"}},e_=rt({__name:"outdatedSetting",props:{outdatedKeys:{},defaultSettings:{}},setup(e){const t=e,n=Pe([]);return t.outdatedKeys.forEach(o=>{n.value.push(b(`setting_${o}_name`))}),(o,i)=>(X(),ne("div",Zp,[K("p",null,ae(P(b)("dialog_panel_outdate_content1")),1),K("ul",Qp,[(X(!0),ne(Ee,null,dt(n.value,(r,s)=>(X(),ne("li",null,ae(r)+" ["+ae(P(b)("default"))+": "+ae(e.defaultSettings[e.outdatedKeys[s]])+"] ",1))),256))]),K("p",null,ae(P(b)("dialog_panel_outdate_content2")),1)]))}});new Array;let Cn=Pe({});const Vt={fontSize:12,relativeFontSize:0,parentBoxCSS:"",siblingBoxCSS:"",childBoxCSS:"",docLinkCSS:"",docLinkClass:"",icon:h.ICON_ALL,sibling:!1,nameMaxLength:20,docMaxNum:128,linkDivider:"● ",popupWindow:h.POP_LIMIT,maxHeightLimit:10,hideIndicator:!1,sameWidth:0,immediatelyUpdate:!0,noneAreaHide:!1,lcdEmptyDocThreshold:0,mainRetry:5,noChildIfHasAv:!1,showBackLinksType:h.BACKLINK_NORMAL,openDocContentGroup:[S.BREADCRUMB,S.CHILD],mobileContentGroup:[S.BREADCRUMB,S.CHILD],flashcardContentGroup:[S.BREADCRUMB,S.BLOCK_BREADCRUMB],normalEndContentGroup:[],childOrder:"FOLLOW_DOC_TREE",showHiddenDoc:!1,hideBlockBreadcrumbInDesktop:!0,sameWidthColumn:6,sameWidthColumnMobile:2,previousAndNextFollowDailynote:!1,mobileBackReplace:!1,mobileRemoveAllArea:!1,doNotAddToTitle:!0,areaBorder:!1,debugMode:!1,showNotebookInBreadcrumb:!1,areaHideFrom:0,removeRegStrListForLinks:"",pinRegStrListForLinks:"",sortForBackLink:re.NAME_NATURAL_ASC,sortForForwardLink:re.NAME_NATURAL_ASC,openDocClickListenerCompatibilityMode:!1,autoRemoveOldTabJudgeMiliseconds:0,openDocRemoveCurrentTab:h.REMOVE_CURRENT_TAB_DEFAULT,requestAllDocIcon:!1,performanceMode:!1,docNameCentering:!0,endDocAreaPaddingTop:!0,keepTempTop:!1};let as=[],jo=null;function t_(){const e=[S.PARENT,S.CHILD,S.SIBLING,S.PARENT_SIBLING,S.PREV_NEXT,S.BACKLINK,S.BREADCRUMB,S.INFO,S.WIDGET,S.ON_THIS_DAY,S.FORWARDLINK,S.PREV_NEXT_PREVIEW,S.PREVIEW_BOX],t=[S.PARENT,S.CHILD,S.SIBLING,S.PARENT_SIBLING,S.PREV_NEXT,S.BACKLINK,S.BREADCRUMB,S.INFO,S.WIDGET,S.BLOCK_BREADCRUMB];as.push(new Dn({key:"content",iconKey:"iconOrderedList",props:{basic:[new j({key:"contentOrderTip",type:"TIPS"}),new j({key:"openDocContentGroup",type:"ORDER",options:e}),new j({key:"mobileContentGroup",type:"ORDER",options:e}),new j({key:"flashcardContentGroup",type:"ORDER",options:t}),new j({key:"normalEndContentGroup",type:"ORDER",options:e})],notebook:[new j({key:"notebookOpenDocContentGroup",type:"CUSTOM_NOTEBOOK"})]}}),new Dn({key:"showType",iconKey:"iconTags",props:{showOrNot:[new j({key:"noChildIfHasAv",type:"SWITCH"}),new j({key:"sibling",type:"SWITCH"}),new j({key:"hideBlockBreadcrumbInDesktop",type:"SWITCH"}),new j({key:"showNotebookInBreadcrumb",type:"SWITCH"}),new j({key:"hideIndicator",type:"SWITCH"}),new j({key:"noneAreaHide",type:"SWITCH"})],order:[new j({key:"childOrder",type:"SELECT",options:Object.keys(Se)}),new j({key:"sortForBackLink",type:"SELECT",options:Object.values(re)})],extend:[new j({key:"showHiddenDoc",type:"SWITCH"}),new j({key:"lcdEmptyDocThreshold",type:"NUMBER",min:-1}),new j({key:"showBackLinksType",type:"SELECT",options:[h.BACKLINK_NORMAL,h.BACKLINK_DOC_ONLY]}),new j({key:"pinRegStrListForLinks",type:"TEXTAREA"}),new j({key:"removeRegStrListForLinks",type:"TEXTAREA"})]}}),new Dn({key:"general",iconKey:"iconSettings",props:[new j({key:"fontSize",type:"NUMBER"}),new j({key:"relativeFontSize",type:"NUMBER",min:0,max:4}),new j({key:"popupWindow",type:"SELECT",options:[h.POP_NONE,h.POP_LIMIT,h.POP_ALL]}),new j({key:"docMaxNum",type:"NUMBER"}),new j({key:"nameMaxLength",type:"NUMBER"}),new j({key:"icon",type:"SELECT",options:[h.ICON_NONE,h.ICON_CUSTOM_ONLY,h.ICON_ALL]}),new j({key:"linkDivider",type:"TEXT"}),new j({key:"areaHideFrom",type:"NUMBER",min:0,max:15}),new j({key:"mobileRemoveAllArea",type:"SWITCH"})]}),new Dn({key:"appearance",iconKey:"iconTheme",props:[new j({key:"maxHeightLimit",type:"NUMBER"}),new j({key:"sameWidthColumn",type:"NUMBER",min:0,max:15}),new j({key:"sameWidthColumnMobile",type:"NUMBER",min:0,max:15}),new j({key:"sameWidth",type:"NUMBER"}),new j({key:"areaBorder",type:"SWITCH"}),new j({key:"docNameCentering",type:"SWITCH"}),new j({key:"endDocAreaPaddingTop",type:"SWITCH"}),new j({key:"docLinkClass",type:"TEXT"}),new j({key:"parentBoxCSS",type:"TEXTAREA"}),new j({key:"siblingBoxCSS",type:"TEXTAREA"}),new j({key:"childBoxCSS",type:"TEXTAREA"}),new j({key:"docLinkCSS",type:"TEXTAREA"})]}),new Dn({key:"lab",iconKey:"iconHelp",props:{ing:[new j({key:"openDocRemoveCurrentTab",type:"SELECT",options:[h.REMOVE_CURRENT_TAB_DEFAULT,h.REMOVE_CURRENT_TAB_TRUE,h.REMOVE_CURRENT_TAB_FALSE]}),new j({key:"autoRemoveOldTabJudgeMiliseconds",type:"NUMBER",min:0,max:5e3}),new j({key:"previousAndNextFollowDailynote",type:"SWITCH"}),new j({key:"requestAllDocIcon",type:"SWITCH"}),new j({key:"immediatelyUpdate",type:"SWITCH"}),new j({key:"performanceMode",type:"SWITCH"}),new j({key:"keepTempTop",type:"SWITCH"})],stop:[new j({key:"mobileBackReplace",type:"SWITCH"})]}}),new Dn({key:"about",iconKey:"iconInfo",props:[new j({key:"aboutAuthor",type:"TIPS"}),new j({key:"settingIconTips",type:"TIPS"}),new j({key:"debugMode",type:"SWITCH"})]}))}function n_(){return as}function o_(e){O("界面调起保存设置项",e),un().saveData("settings_main.json",JSON.stringify(e,null,4))}async function i_(){let e=null;if(e=await un().loadData("settings_main.json"),O("文件载入设置",e),e==null||e==""){let o=await l_();O("oldSettings",o),o!=null?(O("使用转换后的旧设置",o),e=o):e=Vt}const t=20260201;let n=!1;if(!e["@version"]||e["@version"]0&&o[0].count>15e4&&(e.performanceMode=!0,Le("[文档层级导航 HierarchyNavigate]: You have a large number of documents, the plugin will enter performance mode to avoid potential slowdowns."),it(b("default_performance"),5e3),n=!0)}e.relativeFontSize=0}try{e=a_(e)}catch(o){V("设置项类型检查时发生错误",o)}Cn.value=Object.assign(Object.assign({},Vt),e),V("载入设置项",Cn.value),Jo(Cn,o=>{jo&&clearTimeout(jo),V("检查到变化"),jo=setTimeout(()=>{o_(o),jl(),ha(o),jo=null},400)},{deep:!0,immediate:n}),ha(Cn.value)}function r_(e){const t=[];let n=[];for(let o of t)e[o]!=Vt[o]&&n.push(o);return n}function s_(e,t){if(e.length==0)return;const n=zr(e_,{outdatedKeys:e,defaultSettings:t}),o=is();new ht.Dialog({title:b("dialog_panel_plugin_name")+b("dialog_panel_outdate"),content:`
`,width:ve()?"42vw":"520px",height:(ve(),"auto"),destroyCallback:()=>{n.unmount()}}),n.mount(`#og_plugintemplate_${o}`)}function ha(e){e.debugMode===!0?(O("调试模式已开启"),window.top.OpaqueGlassDebug=!0,window.top.OpaqueGlassDebugV2||(window.top.OpaqueGlassDebugV2={}),window.top.OpaqueGlassDebugV2.hn=5):e.debugMode===!1&&(O("调试模式已关闭"),window.top.OpaqueGlassDebugV2&&window.top.OpaqueGlassDebugV2.hn&&delete window.top.OpaqueGlassDebugV2.hn)}function a_(e){const t=xp(as);for(const n of Object.values(t))if(n.type=="SELECT")n.options.includes(e[n.key])||(e[n.key]=Vt[n.key]);else if(n.type=="ORDER"){const o=[];for(const i of e[n.key])Object.values(S).includes(i)&&o.push(i);e[n.key]=o}else n.type=="SWITCH"?e[n.key]==null&&(e[n.key]=Vt[n.key]):n.type=="NUMBER"&&oe(e[n.key])&&(e[n.key]=parseFloat(e[n.key]));return e}async function l_(){const e=await un().loadData("settings.json");let t=Object.assign({},e);if(e==null||e=="")return null;let n=[];if(e.showDocInfo&&(O("旧设置展示了文档信息"),n.push(S.INFO)),e.replaceWithBreadcrumb?(O("旧设置显示了面包屑"),n.push(S.BREADCRUMB)):n.push(S.PARENT),e.alwaysShowSibling&&(O("旧设置:总是同级"),n.push(S.SIBLING),t.sibling=!1),e.previousAndNext&&(O("旧设置:上下"),n.push(S.PREV_NEXT)),e.showBackLinksArea!=null&&e.showBackLinksArea!=0){O("旧设置:反链"),n.push(S.BACKLINK);const r=[h.BACKLINK_NONE,h.BACKLINK_NORMAL,h.BACKLINK_DOC_ONLY];t.showBackLinksType=r[e.showBackLinksArea]}e.listChildDocs?n.push(S.WIDGET):n.push(S.CHILD),t.openDocContentGroup=n,t.mobileContentGroup=n;const o=[h.ICON_NONE,h.ICON_CUSTOM_ONLY,h.ICON_ALL],i=[h.POP_NONE,h.POP_LIMIT,h.POP_ALL];e.icon!=null&&(t.icon=o[e.icon]),e.popupWindow!=null&&(t.popupWindow=i[e.popupWindow]);for(let r of Object.keys(t))r in Vt||delete t[r];return t=Object.assign(Object.assign({},Vt),t),t}function ls(){return Cn}function te(){return Cn._rawValue}function ql(){return Vt}const c_={disabled:"",value:""},u_=["value"],d_=["disabled"],p_=["disabled"],__=rt({__name:"notebookorder",setup(e){const t=Pe(window.siyuan.notebooks.map(m=>({id:m.id,name:m.name,configTopKeyName:"setting_notebook_order_top_"+m.id,configEndKeyName:"setting_notebook_order_end_"+m.id}))),n=[S.PARENT,S.CHILD,S.SIBLING,S.PREV_NEXT,S.BACKLINK,S.BREADCRUMB,S.INFO,S.WIDGET,S.ON_THIS_DAY,S.FORWARDLINK,S.PREV_NEXT_PREVIEW,S.PREVIEW_BOX],o=n.map(m=>b("setting_openDocContentGroup_option_"+m)),i=n.map(m=>""),r=Pe(""),s=vn(()=>t.value.find(m=>m.id===r.value)),a=ls(),l=vn(()=>s.value&&a.value[s.value.configTopKeyName]!==null&&a.value[s.value.configTopKeyName]!==void 0),c=vn(()=>s.value&&a.value[s.value.configEndKeyName]!==null&&a.value[s.value.configEndKeyName]!==void 0);function u(){s.value&&(l.value?a.value[s.value.configTopKeyName]=null:a.value[s.value.configTopKeyName]=[])}function d(){s.value&&(c.value?a.value[s.value.configEndKeyName]=null:a.value[s.value.configEndKeyName]=[])}function p(m){const g=t.value.find(v=>v.id===m);return g?g.name:m}return(m,g)=>(X(),ne("div",null,[Ge(ei,{settingKey:"",configName:P(b)("setting_selectOneNotebookFirst_name"),configDesp:P(b)("setting_selectOneNotebookFirst_desp")},{default:Ct(()=>[qt(K("select",{class:"b3-select fn__flex-center fn__size200","onUpdate:modelValue":g[0]||(g[0]=v=>r.value=v)},[K("option",c_,ae(P(b)("please_select")),1),(X(!0),ne(Ee,null,dt(t.value,v=>(X(),ne("option",{key:v.id,value:v.id},ae(v.name),9,u_))),128))],512),[[Jr,r.value]])]),_:1},8,["configName","configDesp"]),Ge(ei,{settingKey:"",configName:P(b)("setting_notebookTopAreaEnable_name"),configDesp:P(b)("setting_notebookTopAreaEnable_desp")},{default:Ct(()=>[K("button",{class:"b3-button b3-button--outline fn__flex-center fn__size200",onClick:u,disabled:!s.value},ae(P(b)("enable_or_disable")),9,d_)]),_:1},8,["configName","configDesp"]),r.value&&l.value?(X(),We(mr,{key:0,"setting-key":s.value.configTopKeyName,"config-name":p(r.value)+P(b)("setting_notebookTopArea_index_name"),"config-desp":P(b)("setting_notebookTopArea_index_desp")},{default:Ct(()=>[Ge(Nr,{"option-names":P(o),"option-desps":P(i),"option-keys":n,modelValue:P(a)[s.value.configTopKeyName],"onUpdate:modelValue":g[1]||(g[1]=v=>P(a)[s.value.configTopKeyName]=v),"setting-key":s.value.configTopKeyName},null,8,["option-names","option-desps","modelValue","setting-key"])]),_:1},8,["setting-key","config-name","config-desp"])):pr("",!0),Ge(ei,{settingKey:"",configName:P(b)("setting_notebookEndAreaEnable_name"),configDesp:P(b)("setting_notebookEndAreaEnable_desp")},{default:Ct(()=>[K("button",{class:"b3-button b3-button--outline fn__flex-center fn__size200",onClick:d,disabled:!s.value},"启用/禁用",8,p_)]),_:1},8,["configName","configDesp"]),r.value&&c.value?(X(),We(mr,{key:1,"setting-key":s.value.configEndKeyName,"config-name":p(r.value)+P(b)("setting_notebookEndArea_index_name"),"config-desp":P(b)("setting_notebookEndArea_index_desp")},{default:Ct(()=>[Ge(Nr,{"option-names":P(o),"option-desps":P(i),"option-keys":n,modelValue:P(a)[s.value.configEndKeyName],"onUpdate:modelValue":g[2]||(g[2]=v=>P(a)[s.value.configEndKeyName]=v),"setting-key":s.value.configEndKeyName},null,8,["option-names","option-desps","modelValue","setting-key"])]),_:1},8,["setting-key","config-name","config-desp"])):pr("",!0)]))}}),f_={class:"fn__flex-1 fn__flex config__panel",style:{width:"auto",height:"100%","max-width":"1280px"}},h_={class:"b3-tab-bar b3-list b3-list--background"},m_=["onClick"],g_={class:"b3-list-item__graphic"},E_=["xlink:href"],y_={class:"b3-list-item__text"},b_={class:"config__tab-wrap"},v_=rt({__name:"setting",setup(e){const t=ls(),n=ql(),o=n_(),i=Pe(o[0].key);function r(s){i.value=s}return(s,a)=>(X(),ne("div",f_,[K("ul",h_,[(X(!0),ne(Ee,null,dt(P(o),(l,c)=>(X(),ne("li",{key:c,class:ln({"b3-list-item--focus":i.value===l.key,"b3-list-item":!0}),onClick:u=>r(l.key)},[(X(),ne("svg",g_,[K("use",{"xlink:href":"#"+l.iconKey},null,8,E_)])),K("span",y_,ae(P(Hd)(l.key)[0]),1)],10,m_))),128))]),K("div",b_,[(X(!0),ne(Ee,null,dt(P(o),(l,c)=>qt((X(),We(xd,null,{default:Ct(()=>[Ge(Xd,{hide:!l.isColumn,"column-keys":l.columnKeys,"column-names":l.columnNames},Nu({_:2},[dt(l.props,(u,d)=>({name:d,fn:Ct(()=>[(X(!0),ne(Ee,null,dt(u,(p,m)=>(X(),ne(Ee,null,[["TEXTAREA","CUSTOM","ORDER","TIPS","CUSTOM_NOTEBOOK"].indexOf(p.type)==-1?(X(),We(ei,{key:m,"setting-key":p.key,"config-name":p.configName,"config-desp":p.description,"apply-value":P(t)[p.key],"default-value":P(n)[p.key]},{default:Ct(()=>[p.type=="SWITCH"?(X(),We(Jd,{key:0,modelValue:P(t)[p.key],"onUpdate:modelValue":g=>P(t)[p.key]=g},null,8,["modelValue","onUpdate:modelValue"])):p.type=="SELECT"?(X(),We(Qd,{key:1,"option-names":p.optionNames,"option-keys":p.options,modelValue:P(t)[p.key],"onUpdate:modelValue":g=>P(t)[p.key]=g},null,8,["option-names","option-keys","modelValue","onUpdate:modelValue"])):p.type=="NUMBER"?(X(),We(Js,{key:2,min:p.min,max:p.max,type:p.type,modelValue:P(t)[p.key],"onUpdate:modelValue":g=>P(t)[p.key]=g},null,8,["min","max","type","modelValue","onUpdate:modelValue"])):p.type=="TEXT"?(X(),We(Js,{key:3,min:p.min,max:p.max,type:p.type,modelValue:P(t)[p.key],"onUpdate:modelValue":g=>P(t)[p.key]=g},null,8,["min","max","type","modelValue","onUpdate:modelValue"])):p.type=="BUTTON"?(X(),We(qd,{key:4,"btn-name":P(Md)(p.key)[2],btndo:p.btndo},null,8,["btn-name","btndo"])):(X(),ne(Ee,{key:5},[Ve(" 出错啦,不能载入设置项,请检查设置代码实现。 Key: "+ae(p.key)+" ",1),a[0]||(a[0]=K("br",null,null,-1)),Ve(" Oops, can't load settings, check code please. Key: "+ae(p.key),1)],64))]),_:2},1032,["setting-key","config-name","config-desp","apply-value","default-value"])):p.type=="CUSTOM_NOTEBOOK"?(X(),We(__,{key:1,options:p.options},null,8,["options"])):(X(),We(mr,{key:2,"setting-key":p.key,"config-name":p.configName,"config-desp":p.description},{default:Ct(()=>[p.type=="TEXTAREA"?(X(),We(ep,{key:0,modelValue:P(t)[p.key],"onUpdate:modelValue":g=>P(t)[p.key]=g},null,8,["modelValue","onUpdate:modelValue"])):p.type=="ORDER"?(X(),We(Nr,{key:1,"option-names":p.optionNames,"option-desps":p.optionDesps,"option-keys":p.options,"setting-key":p.key,modelValue:P(t)[p.key],"onUpdate:modelValue":g=>P(t)[p.key]=g},null,8,["option-names","option-desps","option-keys","setting-key","modelValue","onUpdate:modelValue"])):pr("",!0)]),_:2},1032,["setting-key","config-name","config-desp"]))],64))),256))])}))]),1032,["hide","column-keys","column-names"])]),_:2},1536)),[[hr,i.value===l.key]])),256))])]))}});async function N_(e,t,n){let o;o={success:!0,docBasicInfo:null,parentDocBasicInfo:null,allSiblingDocInfoList:null,userDemandSiblingDocInfoList:null,childDocInfoList:null,currentDocId:e,currentDocAttrs:{},subDocLimited:!1,siblingDocLimited:!1},o.docBasicInfo=await ma(e,t,n);const i=I_(t);return oe(i)&&(o.parentDocBasicInfo=await ma(i,ds(t),n)),[o.subDocLimited,o.siblingDocLimited]=T_(o.docBasicInfo,o.parentDocBasicInfo),o.currentDocAttrs=o.docBasicInfo.ial,V("BasicProviderFinalR",o),o}async function ma(e,t,n){var r;const o={id:e,path:t??"",ial:{},attrViews:{},name:"",refCount:0,refIDs:[],subFileCount:0,createTime:null,updateTime:null,icon:null,box:n},i=await Vn(e);return Object.assign(o,i),o.icon=((r=o.ial)==null?void 0:r.icon)??o.icon,o.name=o.name+".sy",o.createTime=bi(o.id.substring(0,14)),o.updateTime=bi(o.ial.updated??o.id.substring(0,14)),o}async function Yn(e,t){if(e[t]===null){const n=te();let o=null;const i=e.docBasicInfo;switch(t){case"allSiblingDocInfoList":{o=await Jl(i.path,i.box);break}case"userDemandSiblingDocInfoList":{o=await us(i.path,i.box,Se[n.childOrder],n.showHiddenDoc);break}case"childDocInfoList":{o=await cs(i.path,i.box,Se[n.childOrder],n.showHiddenDoc);break}default:throw new Error("不支持的字段类型")}e[t]=o}}function T_(e,t){let n=ga(e==null?void 0:e.subFileCount),o=ga(t==null?void 0:t.subFileCount);return[n,o]}function ga(e){return e==null?(V("[性能]没有输入文档个数",e),!1):te().performanceMode&&e>512?(V("[性能]性能模式限制",e),!0):!1}async function cs(e,t,n,o){return await Lo({path:e,notebook:t,maxListCount:0,sort:n,showHidden:o})}async function Jl(e,t){const n=ds(e);return await Lo({path:n,notebook:t,maxListCount:0,showHidden:!0})}async function us(e,t,n,o){const i=ds(e);return await Lo({path:i,notebook:t,maxListCount:0,showHidden:o,sort:n})}async function O_(e,t){const n=e.substring(0,e.length-3)+"/";return await xe(`SELECT * FROM blocks WHERE path like "%${n}%" AND box = "${t}" AND type = 'd'`)}function ds(e){if(!oe(e))throw Error("无效的文档路径"+e);const t=e.split("/");return t.length<=2?"/":(t.pop(),t.join("/")+".sy")}function I_(e){if(!oe(e))throw Error("无效的文档路径"+e);const t=e.split("/");if(!(t.length<=2))return t[t.length-2]}async function A_(e){const t=await xe(`SELECT * FROM blocks WHERE id = "${e}"`);return t.length==0?null:t[0]}async function R_(e){const t=await xe(`
SELECT SUM(length) AS count
FROM blocks
WHERE
path like "%/${e}/%"
AND
type in ("p", "h", "c", "t")
`);return t[0].count?t[0].count:0}async function D_(e,t){return await Lo({path:e.path,notebook:e.box,maxListCount:t})}async function k_(e){const t=await xe(`
SELECT * FROM blocks WHERE path like '%${e}/%' LIMIT 3
`);return!!(t&&t.length>0)}async function zl(e){let t=await xe(`
SELECT count(*) as avcount FROM blocks WHERE root_id = '${e}'
AND type = 'av'
`);return t.length>0&&t[0].avcount>0}async function S_(e,t=0){let n=await $p(e);if(t==0&&n.wordCount!=0&&n.imageCount!=0)return O("treeStat判定文档非空,不插入挂件"),!1;if(t!=0){let i=await xe(`SELECT count(*) as bcount FROM blocks WHERE root_id like '${e}' AND type in ('p', 'c', 'iframe', 'html', 'video', 'audio', 'widget', 'query_embed', 't')`);if(i.length>0)return!(i[0].bcount>t)}return(await xe(`SELECT markdown FROM blocks WHERE
root_id like '${e}'
AND type != 'd'
AND (type != 'p'
OR (type = 'p' AND length != 0)
)
LIMIT 5`)).length<=0?!0:(O("sql判定文档非空,不插入挂件"),!1)}function w_(){let e=new Date,t=e.getHours(),n=e.getMinutes(),o=e.getSeconds();return t=r(t),n=r(n),o=r(o),e.toJSON().replace(new RegExp("-","g"),"").substring(0,8)+t+n+o;function r(s){return s<10?"0"+s:s}}function Ea(){var i;if((i=window==null?void 0:window.Lute)!=null&&i.NewNodeID)return window.Lute.NewNodeID();let e=w_(),t=new Array;for(let r=48;r<=57;r++)t.push(String.fromCharCode(r));for(let r=97;r<=122;r++)t.push(String.fromCharCode(r));let n="";for(let r=0;r<7;r++)n+=t[Math.floor(Math.random()*t.length)];return e+"-"+n}var Zl={};Object.defineProperty(Zl,"__esModule",{value:!0});function C_(e){e===void 0&&(e={});var t=/^0/,n=/\s+/g,o=/^\s+|\s+$/g,i=/[^\x00-\x80]/,r=/^0x[0-9a-f]+$/i,s=/(0x[\da-fA-F]+|(^[\+\-]?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?(?=\D|\s|$))|\d+)/g,a=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=String.prototype.toLocaleLowerCase||String.prototype.toLowerCase,c=e.desc?-1:1,u=-c,d=e.insensitive?function(g){return l.call(""+g).replace(o,"")}:function(g){return(""+g).replace(o,"")};function p(g){return g.replace(s,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0")}function m(g,v){return(!g.match(t)||v===1)&&parseFloat(g)||g.replace(n," ").replace(o,"")||0}return function(g,v){var G=d(g),U=d(v);if(!G&&!U)return 0;if(!G&&U)return u;if(G&&!U)return c;var x=p(G),q=p(U),k=G.match(r),H=U.match(r),E=k&&H?parseInt(k[0],16):x.length!==1&&Date.parse(G),N=k&&H?parseInt(H[0],16):E&&U.match(a)&&Date.parse(U)||null;if(N){if(E===N)return 0;if(EN)return c}for(var F=x.length,ie=q.length,se=0,De=Math.max(F,ie);se0)return c;if(de<0)return u;if(se===De-1)return 0}if(TeOe)return c;if(""+Te<""+Oe)return u;if(""+Te>""+Oe)return c}return 0}}var L_=Zl.default=C_;function M_(e,t){let n=t.map(Ql).filter(i=>i!=null),o=[];for(let i of e){let r=!1;for(let s of n)if(s.lastIndex=0,s.test(i.name.slice(0,-3))){r=!0;break}r||o.push(i)}return o}function H_(e,t){let n=t.map(Ql).filter(s=>s!=null),o=[],i=[],r=new Array(e.length).fill(!1);for(let s of n)for(let[a,l]of e.entries())s.lastIndex=0,s.test(l.name.slice(0,-3))&&!r[a]&&(o.push(l),r[e.indexOf(l)]=!0);for(let[s,a]of e.entries())r[s]||i.push(a);return o.concat(i)}function $o(e){const t=te(),n=t.removeRegStrListForLinks,o=vr(n)?[]:n.split(`
`),i=t.pinRegStrListForLinks,r=vr(i)?[]:i.split(`
`),s=M_(e,o);return H_(s,r)}function Ql(e){try{return vr(e)?(Le("跳过正则表达式,因为正则字符串为空"),null):new RegExp(e,"gm")}catch(t){return Le("正则表达式无法解析,正则字符串为:"+e,",错误为:"+t),null}}function ya(e){switch(e){case re.NAME_ALPHABET_ASC:return"0";case re.NAME_ALPHABET_DESC:return"1";case re.NAME_NATURAL_ASC:return"4";case re.NAME_NATURAL_DESC:return"5";case re.CREATE_TIME_ASC:return"9";case re.CREATE_TIME_DESC:return"10";case re.UPDATE_TIME_ASC:return"2";case re.UPDATE_TIME_DESC:return"3";default:return Le("反链未知的排序类型:"+e),"3"}}function vi(e,t,n){const o=L_({insensitive:!0});return e.sort((i,r)=>n?o(r[t],i[t]):o(i[t],r[t]))}function x_(e,t){Mo(),window.OGTempHN.recentMenu={menu:e,id:t}}function Mo(){return window.OGTempHN?!0:(window.OGTempHN={},!1)}function B_(e){Mo(),window.OGTempHN.topElement=e}function U_(){return Mo()?window.OGTempHN.topElement:null}function P_(){Mo(),window.OGTempHN.topElement=null}function G_(e){var t,n;if(!Mo())return!1;if(window.OGTempHN.recentMenu){if(window.OGTempHN.recentMenu.id===e&&document.querySelector("#commonMenu[data-name='og-hn-relative-menu']"))return(t=window.OGTempHN.recentMenu.menu)==null||t.close(),window.OGTempHN.recentMenu=null,!0;(n=window.OGTempHN.recentMenu.menu)==null||n.close(),window.OGTempHN.recentMenu=null}return!1}class F_{constructor(t,n){T(this,"basicInfo");T(this,"protyleBasicInfo");T(this,"printerList",{[S.INFO]:X_,[S.BREADCRUMB]:Ln,[S.PARENT]:W_,[S.SIBLING]:ec,[S.PREV_NEXT]:V_,[S.BACKLINK]:nc,[S.CHILD]:tc,[S.WIDGET]:oc,[S.BLOCK_BREADCRUMB]:K_,[S.ON_THIS_DAY]:j_,[S.FORWARDLINK]:$_,[S.PREV_NEXT_PREVIEW]:Y_,[S.PREVIEW_BOX]:q_,[S.PARENT_SIBLING]:J_});this.basicInfo=t,this.protyleBasicInfo=n}async print(t){new Array,new Array,new Array;const n=te();let o=[];o=ve()?n.mobileContentGroup:n.openDocContentGroup;const i=JSON.stringify(this.basicInfo.docBasicInfo.ial??"");if(i.includes("og-hn-ignore")||i.includes("og文档导航忽略"))return null;if(t){if(o=n.normalEndContentGroup,n["setting_notebook_order_end_"+this.basicInfo.docBasicInfo.box]&&(o=n["setting_notebook_order_end_"+this.basicInfo.docBasicInfo.box],V("选择笔记本排序-end")),this.basicInfo.currentDocAttrs["custom-og-hn-end-content"])try{o=JSON.parse(this.basicInfo.currentDocAttrs["custom-og-hn-end-content"]),V("选择文档排序-end")}catch(l){V("用户自定义顺序读取失败",l)}}else if(n["setting_notebook_order_top_"+this.basicInfo.docBasicInfo.box]&&(o=n["setting_notebook_order_top_"+this.basicInfo.docBasicInfo.box],V("选择笔记本排序-top")),this.basicInfo.currentDocAttrs["custom-og-hn-content"])try{o=JSON.parse(this.basicInfo.currentDocAttrs["custom-og-hn-content"]),V("选择文档排序-top")}catch(l){V("用户自定义顺序读取失败",l)}if(this.protyleBasicInfo.flashCard&&(o=n.flashcardContentGroup,V("选择闪卡排序")),t&&this.protyleBasicInfo.mobile)return null;O("docContentKeyGroup",o),O("g_setting",n);let r=[];o.forEach(function(l){r.indexOf(l)===-1&&r.push(l)}),o=r;const s=[];for(const l of o){const c=this.printerList[l];c&&s.push((async()=>{const u=await c.getBindedElement(this.basicInfo,this.protyleBasicInfo),d=await c.isOnlyOnce(this.basicInfo);return u?(u.dataset.ogContentType=l,{element:u,onlyOnce:d,relateContentKey:l}):null})())}const a=await Promise.all(s);return n.areaHideFrom>0&&a.filter(l=>l!=null).length>=n.areaHideFrom&&a.unshift({element:await va.getMoreOrLessElement(this.basicInfo,this.protyleBasicInfo,a.slice()),onlyOnce:await va.isOnlyOnce(this.basicInfo),relateContentKey:S.MORE_OR_LESS}),a.unshift({element:await ba.getBindedElement(this.basicInfo,this.protyleBasicInfo),onlyOnce:await ba.isOnlyOnce(this.basicInfo),relateContentKey:S.MOVE_TOP_AREA}),{elements:a.filter(l=>l!==null).map(l=>l.element),onlyOnce:a.filter(l=>l!==null).map(l=>l.onlyOnce),relateContentKeys:a.filter(l=>l!==null).map(l=>l.relateContentKey)}}}class Be{constructor(t){T(this,"basicInfo");this.basicInfo=t}static async getBindedElement(t,n){throw new Error("需子类覆盖实现")}static async isOnlyOnce(t){return!1}static bindAction(t){return t}static getBasicElement(t,n,o,i){const r=document.createElement("div");if(r.classList.add(t),oe(i)&&(r.classList.add("ariaLabel"),r.setAttribute("aria-label",i)),n)for(const s of n)r.classList.add(s);else r.classList.add(h.CONTAINER_CLASS_NAME,h.CONTAINER_MULTILINE_STYLE_CLASS_NAME);if(oe(o)){const s=document.createElement("span");s.classList.add(h.INDICATOR_CLASS_NAME),s.innerText=o,r.appendChild(s)}return r}static getNoneElement(){const t=document.createElement("span");return t.classList.add("og-hn-doc-none-word"),t.innerText=b("none"),t}static docLinkGenerator(t,n=!1){let o=te(),i=this.getEmojiHtmlStr(t.icon,(t==null?void 0:t.subFileCount)!=0,o),r="";oe(t.name)?t.name.endsWith(".sy")?r=t.name.substring(0,t.name.length-3):(r=t.name,Le("DEV_WARN: doc.name必须以.sy结尾")):r=t.content,r=mt(r);let s=r;t.ogSimpleName&&(s=t.ogSimpleName);let a=document.createElement("span");a.classList.add("refLinks","docLinksWrapper"),o.docLinkClass&&a.classList.add(d(o.docLinkClass)),a.dataset.subtype="d",a.dataset.id=t.id,oe(r)&&(a.setAttribute("aria-label",r),a.classList.add("ariaLabel"));const l=document.createElement("span");l.classList.add("og-hn-emoji-and-name");const c=document.createElement("span");c.dataset.type="block-ref",c.dataset.subtype="d",c.dataset.id=t.id,c.classList.add(h.REF_LINK_FOR_POP_OUT_CLASS_NAME),c.innerHTML=i;const u=document.createElement("span");switch(u.classList.add("trimDocName"),u.innerText=s,n&&(a.classList.add("og-none-click"),a.classList.remove("refLinks")),o.popupWindow){case h.POP_ALL:{n||(a.dataset.type="block-ref",a.classList.add(h.REF_LINK_FOR_POP_OUT_CLASS_NAME)),l.innerHTML=i;break}case h.POP_LIMIT:{if(n){l.innerHTML=i;break}oe(i)&&l.appendChild(c);break}case h.POP_NONE:{l.innerHTML=i;break}}return l.appendChild(u),a.appendChild(l),a;function d(p){return p?p.replaceAll('"',""):""}}static getEmojiHtmlStr(t,n,o){if(o.icon==h.ICON_NONE||t==null)return o.linkDivider;if(!oe(t)&&o.icon==h.ICON_ALL)return window.siyuan.storage["local-images"]?n?Be.getEmojiHtmlStr(window.siyuan.storage["local-images"].folder,n,o):Be.getEmojiHtmlStr(window.siyuan.storage["local-images"].file,n,o):n?"📑":"📄";if(!oe(t))return o.linkDivider;let i=t;return t.startsWith("api/icon/getDynamicIcon")?i=`
`:t.indexOf(".")!=-1&&!t.match(new RegExp("http(s)?:\\/\\/"))?i=`
`:t.match(new RegExp("http(s)?:\\/\\/"))?i=`
`:i=`${r(t,n)}`,i;function r(s,a=!1){try{let l="";return s.split("-").forEach(c=>{O("element",c),l+=String.fromCodePoint(+("0x"+c))}),l}catch(l){return Ze("emoji处理时发生错误",s,l),a?"📑":"📄"}}}static linkSortTypeToFowardLinkSortSql(t){switch(t){case re.NAME_ALPHABET_ASC:return" ORDER BY content ASC";case re.NAME_ALPHABET_DESC:return" ORDER BY content DESC";case re.NAME_NATURAL_ASC:return" ORDER BY content ASC";case re.NAME_NATURAL_DESC:return" ORDER BY content DESC";case re.CREATE_TIME_ASC:return" ORDER BY created ASC";case re.CREATE_TIME_DESC:return" ORDER BY created DESC";case re.UPDATE_TIME_ASC:return" ORDER BY updated ASC";case re.UPDATE_TIME_DESC:return" ORDER BY updated DESC";default:return Le("未知的排序类型:"+t)," ORDER BY updated DESC"}}}class ba extends Be{static async getBindedElement(t,n){const o=super.getBasicElement(h.MOVE_TOP_AREA_CONTAINER_CLASS_NAME,null,null,null),i=document.createElement("span");i.innerHTML=b("move_temp_top_area"),o.appendChild(i);let r,s,a,l,c=n.originProtyle.element;return o.addEventListener("mousedown",u=>{const d=document.querySelector(".og-hn-heading-docs-container.og-hn-at-doc-top.og-hn-container-to-top");if(!d)return;r=u.clientX-parseFloat(d.style.left),s=u.clientY-parseFloat(d.style.top);let p=null;const m=c.getBoundingClientRect(),g=G=>{p=setTimeout(()=>{clearTimeout(p),a=G.clientX-r,l=G.clientY-s,a=Math.max(a,m.left),a=Math.min(a,m.right-d.offsetWidth),l=Math.max(l,m.top),l=Math.min(l,m.bottom-d.offsetHeight),d.style.left=`${a}px`,d.style.top=`${l}px`},10)},v=()=>{document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",v);const G=ls();G.value.topMovePosition={applyLeft:a,applyTop:l,wndHeight:window.innerHeight,wndWidth:window.innerWidth,protyleHeight:m.height,protyleWidth:m.width,relativeLeft:a/window.innerWidth,relativeTop:l/window.innerHeight,protyleRelativeLeft:(a-m.left)/m.width,protyleRelativeTop:(l-m.top)/m.height}};document.addEventListener("mousemove",g),document.addEventListener("mouseup",v)}),o.dataset.ogContentType=S.MOVE_TOP_AREA,o}static async isOnlyOnce(t){return!1}}class X_ extends Be{static async getBindedElement(t,n){const o=te();let i=null;o.performanceMode||(i=await R_(t.currentDocId));let r,s=-1,a=t.docBasicInfo.subFileCount;t.siblingDocLimited||await Yn(t,"allSiblingDocInfoList");try{o.performanceMode||(r=await xe(`SELECT count(*) as total_count FROM blocks WHERE path like "${t.docBasicInfo.path.replace(".sy","")}/%" AND type = "d"`),s=r[0].total_count)}catch(g){Ze(g)}let l=null;for(const g of t.allSiblingDocInfoList??[])if(g.id==t.currentDocId){l=g;break}l==null&&(l={hCtime:bi(t.docBasicInfo.id.substring(0,14)).toLocaleString(),hMtime:bi(t.docBasicInfo.ial.updated).toLocaleString()},l={hCtime:da(t.docBasicInfo.id.substring(0,14)),hMtime:da(t.docBasicInfo.ial.updated)});let c=document.createElement("div");c.classList.add(h.INFO_CONTAINER_CLASS);let u=rs(t.docBasicInfo.box),d=ve()?"
":"",p=i?`
${b("child_word_count")}
${i}
`:"",m=`
${b("create_at")}
${l.hCtime}
${d}
${b("update_at")}
${l.hMtime}
${d}
${b("child_count").replace("%NUM%",`${a}`).replace("%TOTAL%",s==-1?"":`(${s})`)}
${a==0?"":p}
${u.name}
`;return c.innerHTML=m,c}}class W_ extends Be{static async getBindedElement(t,n){const o=super.getBasicElement(h.PARENT_CONTAINER_ID,null,b("parent_nodes"),b("parent_area"));if(t.docBasicInfo==null||t.parentDocBasicInfo==null){if(te().sibling)return await ec.getBindedElement(t,n);o.appendChild(super.getNoneElement()),o.classList.add(h.NONE_CLASS_NAME)}else t.parentDocBasicInfo?o.appendChild(this.docLinkGenerator(t.parentDocBasicInfo)):(o.appendChild(this.getNoneElement()),o.classList.add(h.NONE_CLASS_NAME));return V("parentAreaOutput",o),o}}class ec extends Be{static async getBindedElement(t,n){const o=te(),i=super.getBasicElement(h.SIBLING_CONTAINER_ID,null,b("sibling_nodes"),b("sibling_area"));if(t.siblingDocLimited)return V("出于性能考虑,本文档的同级文档将不再显示"),null;if(await Yn(t,"userDemandSiblingDocInfoList"),i.children.length>0&&i.children[0].classList.contains(h.INDICATOR_CLASS_NAME)&&i.children[0].setAttribute("title",b("number_count").replace("%NUM%",t.userDemandSiblingDocInfoList.length)),t.userDemandSiblingDocInfoList.length==0)i.appendChild(super.getNoneElement()),i.classList.add(h.NONE_CLASS_NAME);else for(let r=0;r0&&i.children[0].classList.contains(h.INDICATOR_CLASS_NAME)&&i.children[0].setAttribute("title",b("number_count").replace("%NUM%",t.childDocInfoList.length)),t.childDocInfoList.length==0)i.appendChild(super.getNoneElement()),i.classList.add(h.NONE_CLASS_NAME);else for(let r=0;r{r.addEventListener("click",this.openRelativeMenu)}),o}static async generateBreadCrumb(t){const n=await this.parseDocPath(t.docBasicInfo);return await this.generateBreadCrumbElement(n)}static async parseDocPath(t){let n=t.path.substring(0,t.path.length-3).split("/"),o=[],i=rs(t.box),r={name:i.name+".sy",id:i.id,icon:i.icon,box:i.id,path:"/",type:"NOTEBOOK",subFileCount:999};o.push(r);let s="";const a=n.slice(1).map(async c=>{const u=await Vn(c);return u.box=i.id,u.path=`${s}/${c}.sy`,u.type="FILE",u.name=`${u.name}.sy`,s+=`/${c}`,u}),l=await Promise.all(a);return o.push(...l),o}static async generateBreadCrumbElement(t){var r;const n=document.createElement("div");n.classList.add("og-hn-parent-area-replace-with-breadcrumb");const o=te(),i=``;for(let s=0;sn.nameMaxLength?u.name.substring(0,n.nameMaxLength)+"...":u.name,p={accelerator:i==u.id?"<-":void 0,iconHTML:Ln.getEmojiHtmlStrE2(u.icon,u.subFileCount!=0),label:``,click:(m,g)=>{var G;O("menu clickEvent",g);let v=(G=m.querySelector("[og-data-doc-id]"))==null?void 0:G.getAttribute("og-data-doc-id");$n({mouseEvent:g,paramDocId:v,g_setting:te()})}};l.addItem(p)}a.length*30>(window.innerHeight-r.bottom)*.7?l.open({x:r.right,y:r.top,isLeft:!1}):l.open({x:r.left,y:r.bottom,isLeft:!1}),setTimeout(()=>{var c;n.menuKeepCurrentVisible&&((c=l.element.querySelector(".b3-menu__item--selected"))==null||c.scrollIntoView({behavior:"smooth",block:"nearest",inline:"nearest"}))},3),x_(l,o)}static getEmojiHtmlStrE2(t,n){const o=te();if(o.icon==h.ICON_NONE)return"";if((t==null||t==null||t=="")&&o.icon==h.ICON_ALL)return window.siyuan.storage["local-images"]?n?Ln.getEmojiHtmlStrE2(window.siyuan.storage["local-images"].folder,n):Ln.getEmojiHtmlStrE2(window.siyuan.storage["local-images"].file,n):n?'':'';if((t==null||t==null||t=="")&&o.icon==h.ICON_CUSTOM_ONLY)return'';let i=t;return t.startsWith("api/icon/getDynamicIcon")?i=``:t.indexOf(".")!=-1&&!t.match(new RegExp("http(s)?:\\/\\/"))?i=``:t.match(new RegExp("http(s)?:\\/\\/"))?i=``:i=``,i}static emojiIconHandler(t,n=!1){try{let o="";return t.split("-").forEach(i=>{o+=String.fromCodePoint(+("0x"+i))}),o}catch(o){return Ze("emoji处理时发生错误",t,o),n?"📑":"📄"}}}class nc extends Be{static async getBindedElement(t,n){const o=te();let i=null;switch(o.showBackLinksType){case h.BACKLINK_DOC_ONLY:{i=await this.docOnlyBackLinkElement(t);break}case h.BACKLINK_NORMAL:{i=await this.normalBackLinkElement(t);break}default:{Le("BackLink配置项值错误",o.showBackLinksType);break}}return i==null&&(i=super.getBasicElement(h.BACKLINK_CONTAINER_CLASS_NAME,null,b("backlink_nodes"),b("backlink_area")),i.appendChild(super.getNoneElement()),i.classList.add(h.NONE_CLASS_NAME)),i}static async getNormalBackLinks(t,n){let o=await fa(t,ya(n));if(O("backlinkResponse",o),o.backlinks.length==0)return[];const i=[];for(let r=0;r{n.appendChild(this.docLinkGenerator(a))}),s.length==0?null:n}static async getDocOnlyBackLinks(t,n){let o=`SELECT id, content FROM blocks WHERE id in (
SELECT DISTINCT root_id FROM refs WHERE def_block_id = "${t}"
) AND type = "d" `+this.linkSortTypeToFowardLinkSortSql(n),i=await xe(o);if(i!=null&&i.length>0){(n==re.NAME_NATURAL_ASC||n==re.NAME_NATURAL_DESC)&&(i=vi(i.slice(),"content",n==re.NAME_NATURAL_DESC),V("自然排序",i));const r=[];for(let s=0;s0){(o.sortForBackLink==re.NAME_NATURAL_ASC||o.sortForBackLink==re.NAME_NATURAL_DESC)&&(r=vi(r.slice(),"content",o.sortForBackLink==re.NAME_NATURAL_DESC),V("自然排序",r));const s=[];for(let l=0;l{n.appendChild(this.docLinkGenerator(l))}),a.length==0)return null}else return null;return n}}class V_ extends Be{static async getBindedElement(t,n){var U,x,q;const o=te();if(t.siblingDocLimited)return V("出于性能考虑,上一篇下一篇(相邻文档)在本文档不显示"),null;await Yn(t,"allSiblingDocInfoList");const i=t.allSiblingDocInfoList,r=this.getBasicElement(h.NEXT_CONTAINER_CLASS_NAME,null,b("neighbor_nodes"),b("neighbor_area"));let s=-1,a=null,l=null;for(let k=0;kparseInt(u)&&(u=p[k]),parseInt(p[k])=0&&i.length>=1){let k=!1;if(m&&(o.previousAndNextFollowDailynote||s<=0&&v)){let H=!1;!o.previousAndNextFollowDailynote&&!G&&(H=!0);const E=await Nn({ialObject:p,docId:t.docBasicInfo.id,boxId:t.docBasicInfo.box,getNewer:H});if(O("日记组-上一篇",E),E){if(E.ogSimpleName=b("previous_doc")+mt(E.name),E.name=E.name+".sy",o.requestAllDocIcon&&!ve()){const F=await Vn(E.id);E.icon=F.icon,E.subFileCount=F.subFileCount}a=super.docLinkGenerator(E),k=!0}}else if(s>0){let H=b("previous_doc")+mt(i[s-1].name),E=Object.assign({},i[s-1]);E.ogSimpleName=H.substring(0,H.length-3),a=this.docLinkGenerator(E),k=!0}if(m&&(o.previousAndNextFollowDailynote||s+1>=i.length&&v)){let H=!0;!o.previousAndNextFollowDailynote&&!G&&(H=!1);const E=await Nn({ialObject:p,docId:t.docBasicInfo.id,boxId:t.docBasicInfo.box,getNewer:H});if(O("日记组-下一篇",E),E){if(E.ogSimpleName=b("next_doc")+mt(E.name),E.name=E.name+".sy",o.requestAllDocIcon&&!ve()){const F=await Vn(E.id);E.icon=F.icon,E.subFileCount=F.subFileCount}l=super.docLinkGenerator(E),k=!0}}else if(s+1=0&&!await S_(t.currentDocId,o.lcdEmptyDocThreshold))return this.isDoNotUpdate=!1,await tc.getBindedElement(t,n);this.isDoNotUpdate=!0;const i=document.createElement("div");return i.classList.add("og-hn-widget-container"),i.innerHTML=``,oe(i.children[0].dataset)&&(i.children[0].dataset.defaultConfig=JSON.stringify({height_2widget_min:150})),i}static async isOnlyOnce(t){return this.isDoNotUpdate}}T(oc,"isDoNotUpdate",!0);class K_ extends Be{static async getBindedElement(t,n){const o=te();if(O("isMobile",ve(),o.hideBlockBreadceumbInDesktop),!ve()&&o.hideBlockBreadcrumbInDesktop)return null;const i=super.getBasicElement(h.BREADCRUMB_CONTAINER_CLASS_NAME,[h.CONTAINER_CLASS_NAME],null),r=await this.generateBreadCrumb(t,n);return r?(i.appendChild(r),i):null}static async generateBreadCrumb(t,n){const o=await this.parseDocPath(n.originProtyle);return await this.generateBreadCrumbElement(o)}static async parseDocPath(t){var l,c,u;let n=(l=t==null?void 0:t.breadcrumb)==null?void 0:l.id,o=(c=t.element.querySelector(`[data-node-id='${t.block.id}'] .p`))==null?void 0:c.getAttribute("data-node-id");O(`breadblockId ${n} parablockId ${o} blockId ${t.block.id}`),!oe(n)&&oe(o)&&(n=o,O("闪卡id定位,使用选择器结果",n)),oe(n)||(n=t.block.id);const i=await Yp(n,["NodeTextMark-mark"]);O("blockBread",i);const r=i[i.length-1],s=i.slice(1).map(d=>({name:d.name+".sy",id:d.id,icon:a(d.type,d.subType),box:"",path:"",type:"BLOCK",subFileCount:0}));return(r.type=="NodeParagraph"||r.type=="NodeHeading")&&(s.pop(),i.length>=3&&((u=i[i.length-2])==null?void 0:u.name)==r.name&&s.pop()),O("block bread resultArray",s),s;function a(d,p){return d=="NodeListItem"?"2a-fe0f-20e3":p.includes("h")?`3${parseInt(p.substring(1))}-fe0f-20e3`:""}}static async generateBreadCrumbElement(t){const n=document.createElement("div");n.classList.add("og-hn-parent-area-replace-with-breadcrumb");const o=``;if(t.length==0)return null;for(let i=0;i0){(o.sortForBackLink==re.NAME_NATURAL_ASC||o.sortForBackLink==re.NAME_NATURAL_DESC)&&(r=vi(r.slice(),"content",o.sortForBackLink==re.NAME_NATURAL_DESC),V("自然排序",r));for(let s=0;s0){(o.sortForBackLink==re.NAME_NATURAL_ASC||o.sortForBackLink==re.NAME_NATURAL_DESC)&&(r=vi(r.slice(),"content",o.sortForBackLink==re.NAME_NATURAL_DESC),V("自然排序",r));for(let s=0;s0)O("MoreOrLessPrinter 生成时判定原内容区存在,且未折叠,更新后也调整为未折叠"),r.dataset.ogHideFlag="false",s.innerHTML=b("less");else{r.dataset.ogHideFlag="true",s.innerHTML=b("more");for(let u=i.areaHideFrom-1;u{var d;const u=((d=r.parentElement)==null?void 0:d.children)??[];if(u.length<=1&&O("折叠展开判定错误,不存在任何内容区元素"),s.innerHTML===b("more")){for(let p=i.areaHideFrom;p{const r=document.getElementById(h.HIDE_COULD_FOLD_STYLE_ID);r?r.remove():Yl()}),o.dataset.ogContentType=S.MORE_OR_LESS,o}static async isOnlyOnce(t){return!1}}class Y_ extends Be{static async getBindedElement(t,n){var x,q,k;const o=te();if(t.siblingDocLimited)return V("出于性能考虑,上一篇下一篇(相邻文档)在本文档不显示"),null;await Yn(t,"allSiblingDocInfoList");const i=t.allSiblingDocInfoList,r=document.createElement("div");r.classList.add("og-hn-np-inner-flex");const s=document.createElement("div");let a=-1,l=null,c=null;for(let H=0;HparseInt(d)&&(d=m[H]),parseInt(m[H])=0&&i.length>=1){let H=!1;if(g&&(o.previousAndNextFollowDailynote||a<=0&&G)){let E=!1;!o.previousAndNextFollowDailynote&&!U&&(E=!0);const N=await Nn({ialObject:m,docId:t.docBasicInfo.id,boxId:t.docBasicInfo.box,getNewer:E});if(O("日记组-上一篇",N),N){if(N.ogSimpleName=mt(N.name),N.name=N.name+".sy",o.requestAllDocIcon&&!ve()){const F=await Vn(N.id);N.icon=F.icon,N.subFileCount=F.subFileCount}l=N,super.docLinkGenerator(N),H=!0}}else if(a>0){let E=mt(i[a-1].name),N=Object.assign({},i[a-1]);N.ogSimpleName=E.substring(0,E.length-3),l=N,H=!0}if(g&&(o.previousAndNextFollowDailynote||a+1>=i.length&&G)){let E=!0;!o.previousAndNextFollowDailynote&&!U&&(E=!1);const N=await Nn({ialObject:m,docId:t.docBasicInfo.id,boxId:t.docBasicInfo.box,getNewer:E});if(O("日记组-下一篇",N),N){if(N.ogSimpleName=mt(N.name),N.name=N.name+".sy",o.requestAllDocIcon&&!ve()){const F=await Vn(N.id);N.icon=F.icon,N.subFileCount=F.subFileCount}c=N,super.docLinkGenerator(N),H=!0}}else if(a+1","gm"),""),o=o.replace(/!\[([^\]]+)\]\((.*?)\)/g,"[$1]"),o=o.replace(/\[([^\]]+)\]\((.*?)\)/g,"$1"),o}static createNavPreview(t,n,o,i,r=!0){const s=document.createElement("div");s.className=`og-hn-np-nav-preview ${i?"og-hn-np-prev":"og-hn-np-next"} ${r?"refLinks":"og-hn-np-non-clickable"}`,oe(t)&&s.setAttribute("data-id",t);const a=document.createElement("div");a.className="og-hn-np-nav-preview-inner";const l=document.createElement("div");l.className="og-hn-np-nav-direction",l.textContent=i?`< ${b("previous_doc_v2")}`:`${b("next_doc_v2")} >`;const c=document.createElement("div");c.className="og-hn-np-nav-post-title",c.textContent=n;const u=document.createElement("div");return u.className="og-hn-np-nav-excerpt",u.textContent=o,a.appendChild(l),a.appendChild(c),a.appendChild(u),s.appendChild(a),s}static createPlaceholderPreview(t){var o;const n=this.createNavPreview("","","",t,!1);return(o=n.querySelector(".og-hn-np-nav-preview-inner"))==null||o.classList.add("og-hn-np-placeholder"),n}}class q_ extends Be{static async getBindedElement(t,n){const o=te(),i=document.createElement("div");if(i.className="og-hn-pb-container",t.subDocLimited)return V("文档数量过多,停止显示"),null;await Yn(t,"childDocInfoList");const r=t.childDocInfoList;for(const s of r){const a=document.createElement("div");a.className="og-hn-pb-doc-box ",a.setAttribute("data-id",s.id);let l=s.name;l.endsWith(".sy")&&(l=l.slice(0,-3));const c=document.createElement("h4");c.className="og-hn-pb-title refLinks",c.setAttribute("data-id",s.id),c.insertAdjacentHTML("afterbegin",this.getEmojiHtmlStr(s.icon,s.subFileCount>0,o)+l),a.appendChild(c);const[u,d]=await this.generatePreview(s.id);if(d){const p=await this.generateSecond(t.docBasicInfo.box,s.path,o.maxListCount,o.sortBy,o.showHiddenDocs);a.appendChild(p)}else{const p=document.createElement("div");p.className="og-hn-pb-content",p.innerHTML=u,a.appendChild(p)}i.appendChild(a)}return i}static async generatePreview(t){const n=await jp(t),o=2e4;let i=n;if(n.length>o){const l=n.substring(o).search("
");l!==-1&&(i=n.substring(0,o+l+1),V("预览内容过长,强制截断了预览内容"))}const r=this.cleanDocHtml(i),s=r.replace(/|| | | | /g,"").replace(/]*>[\u200d]*<\/p>/g,"").replace(/ |\n/g,"");return[r,!oe(s)]}static async generateSecond(t,n,o,i,r){const s=document.createElement("div");s.className="og-hn-pb-child-container";const a=te(),l=await Lo({notebook:t,path:n,maxListCount:o,sort:i,showHidden:r});for(const c of l){let u=c.name;u.endsWith(".sy")&&(u=u.slice(0,-3));const d=document.createElement("p");d.className="og-hn-pb-child-item refLinks",d.setAttribute("data-id",c.id);const p=document.createElement("span");p.className="og-hn-pb-child-link ",p.innerHTML=this.getEmojiHtmlStr(c.icon,c.subFileCount>0,a),p.appendChild(document.createTextNode(u)),d.appendChild(p),s.appendChild(d)}return s}static cleanDocHtml(t){const n=document.createElement("div");if(n.innerHTML=t,n.querySelectorAll(".iframe").forEach(u=>u.remove()),window.top.siyuan.config.export.addTitle){const u=n.querySelectorAll("h1");u.length>0&&u[0].remove()}return n.querySelectorAll(".emoji").forEach(u=>u.classList.add("iconpic")),n.querySelectorAll("p").forEach(u=>{(!u.innerHTML.trim()||u.innerHTML===String.fromCharCode(8205))&&u.remove()}),n.querySelectorAll("img").forEach(u=>{let d=u.getAttribute("src")||"";d=d.replace(/http(s)*:\/\/[^\/]*\/widgets\/listChildDocs(-dev)*/,""),u.setAttribute("src",d)}),n.querySelectorAll("a").forEach(u=>{var p;const d=document.createTextNode(u.textContent||"");(p=u.parentNode)==null||p.replaceChild(d,u)}),n.querySelectorAll("h1, h2, h3, h4, h5").forEach(u=>{var p;const d=document.createElement("strong");d.textContent=u.textContent,(p=u.parentNode)==null||p.replaceChild(d,u)}),n.querySelectorAll("input").forEach(u=>u.remove()),n.innerHTML}}class J_ extends Be{static async getBindedElement(t,n){const o=te(),i=super.getBasicElement(h.PARENT_SIBLING_CONTAINER_ID,null,b("parent_sibling_nodes"),b("parent_sibling_area"));if(t.siblingDocLimited)return V("出于性能考虑,父级文档的同级文档将不再显示"),null;if(t.docBasicInfo==null||t.parentDocBasicInfo==null)i.appendChild(super.getNoneElement()),i.classList.add(h.NONE_CLASS_NAME);else{V("ParentSiblingContentPrinter 基本信息",t);const r=await us(t.parentDocBasicInfo.path,t.parentDocBasicInfo.box,Se[o.childOrder],o.showHiddenDoc),s=r.length;i.children[0].setAttribute("title",b("number_count").replace("%NUM%",s.toString()));const a=r;for(let l=0;l{const E=await A_(n.docId);i=E,V("data",E);const N=te(),F=await nc.getNormalBackLinks(n.docId,N.sortForBackLink),ie=await Jl(E.path,E.box),se=await cs(E.path,E.box),De=await O_(E.path,E.box);o.value[0].items=ie.map(de=>(de.ogSimpleName=mt(de.name.substring(0,de.name.length-3)),de)),o.value[1].items=se.map(de=>(de.ogSimpleName=mt(de.name.substring(0,de.name.length-3)),de));const Te=new Set(o.value[1].items.map(de=>de.id)),Oe=De.filter(de=>!Te.has(de.id));o.value[1].items.push(...Oe.map(de=>(de.ogSimpleName=mt(de.content.substring(0,de.content.length)),de))),o.value[2].items=F})().then(()=>{V("分类信息",o.value)}).catch(E=>{Ze("创建时出现错误",E)});const s=Pe(""),a=vn(()=>{const E=s.value.trim().toLowerCase().split(/\s+/),N=o.value.map(F=>({name:F.name,items:F.items.filter(ie=>E.every(se=>ie.ogSimpleName.toLowerCase().includes(se)))})).filter(F=>F.items.length>0);return l.value=0,c.value=0,N}),l=Pe(0),c=Pe(0),u=(E,N)=>l.value===E&&c.value===N,d=vn(()=>{var E;return((E=a.value[l.value])==null?void 0:E.items.length)||0}),p=()=>{var E;return(E=a.value[l.value])==null?void 0:E.items[c.value]},m=E=>{const N=a.value.length;switch(E.key){case"ArrowUp":c.value=(c.value-1+d.value)%d.value,E.preventDefault(),g();break;case"ArrowDown":c.value=(c.value+1)%d.value,E.preventDefault(),g();break;case"ArrowLeft":break;case"ArrowRight":break;case"Tab":if(E.shiftKey){l.value=(l.value-1+N)%N,c.value>d.value-1&&d.value>0&&(c.value=d.value-1),g(),E.preventDefault();break}else{l.value=(l.value+1)%N,c.value>d.value-1&&d.value>0&&(c.value=d.value-1),g(),E.preventDefault();break}case"Enter":E.shiftKey?G(s.value):E.ctrlKey?v(s.value):k(p()),E.preventDefault();break;case"F1":oe(s.value)&&(E.preventDefault(),U(s.value));break;case"F2":oe(s.value)&&(E.preventDefault(),x(s.value));break}},g=()=>{const E=t.value;let N=null;const F=E.children[l.value].children[1].children[c.value];if(F){N=F.closest(".b3-list");const ie=N.getBoundingClientRect(),se=F.getBoundingClientRect();se.topie.bottom&&(N.scrollTop+=se.bottom-ie.bottom+se.height)}},v=async E=>{const N=document.querySelector(".dock__items span[data-type=syplugin-document-searchdoc_search_dock]");if(N!=null&&!N.classList.contains("dock__item--active"))N.click(),await Or(300);else if(N==null){O("基于文档搜索插件dock按钮不存在"),it(b("dialog_panel_switchDoc_search_plugin_not_found"));return}const F=document.getElementById("documentSearchInput");F?(F.value=E,F.dispatchEvent(new Event("input"))):O("input不存在"),n.dialog.destroy()},G=async E=>{const N=document.querySelector(".dock__items span[data-type=syplugin-document-searchflat_doc_tree_dock]");if(N!=null&&!N.classList.contains("dock__item--active"))await Or(300),N.click();else if(N==null){O("基于文档搜索插件dock按钮不存在"),it(b("dialog_panel_switchDoc_search_plugin_not_found"));return}const F=document.querySelector(".layout__tab--active.sy__syplugin-document-searchflat_doc_tree_dock[data-id] .search__header input");F?(F.value=E,F.dispatchEvent(new Event("input"))):O("input不存在"),n.dialog.destroy()},U=async E=>{const N=i;if(N==null){Ze("当前文档信息为空");return}const F=Ea(),ie=N.path.split("/").slice(0,-1).join("/")+"/"+F+".sy";debugger;await _a(N.box,ie,E),H(F)},x=async E=>{const N=i;if(N==null){Ze("当前文档信息为空");return}const F=Ea(),ie=N.path.substring(0,N.path.length-3)+"/"+F+".sy";debugger;await _a(N.box,ie,E),H(F)};Xr(()=>{var E;(E=q.value)==null||E.focus(),window.addEventListener("keydown",m,!0)}),Wr(()=>{O("对话框销毁"),window.removeEventListener("keydown",m,!0)});const q=Pe(null),k=E=>{E&&H(E.id)},H=E=>{Lt.openTab({app:un().app,doc:{id:E}}),n.dialog.destroy()};return(E,N)=>(X(),ne("div",z_,[K("div",Z_,[K("div",Q_,[N[1]||(N[1]=K("svg",{class:"b3-form__icon-icon"},[K("use",{"xlink:href":"#iconSearch"})],-1)),qt(K("input",{type:"text",class:"b3-text-field fn__block b3-form__icon-input","onUpdate:modelValue":N[0]||(N[0]=F=>s.value=F),placeholder:"Search...",ref_key:"searchInput",ref:q},null,512),[[fi,s.value]])]),K("div",{class:"og-hn-dialog-categories",ref_key:"categoriesContainer",ref:t},[(X(!0),ne(Ee,null,dt(a.value,(F,ie)=>(X(),ne("div",{key:ie,class:"og-hn-dialog-category-column"},[K("h4",null,ae(F.name),1),K("ul",ef,[(X(!0),ne(Ee,null,dt(F.items,(se,De)=>{var Te;return X(),ne("li",{key:De,class:ln({"b3-list-item--focus":u(ie,De),"b3-list-item":!0}),onClick:Oe=>k(se)},[(Te=se.icon)!=null&&Te.includes(".")?(X(),ne("img",{key:0,class:"b3-list-item__graphic",src:"/emojis/"+se.icon},null,8,nf)):(X(),ne("span",of,ae(se.icon!=null?P(Tr)(se.icon):""),1)),K("span",rf,ae(se.ogSimpleName),1)],10,tf)}),128))])]))),128))],512)]),K("div",sf,[N[2]||(N[2]=K("kbd",null,"↑/↓/Tab/Shift+Tab",-1)),Ve(" "+ae(P(b)("dialog_panel_switchDoc_switch"))+" ",1),K("kbd",null,ae(P(b)("dialog_panel_switchDoc_enter"))+"/"+ae(P(b)("dialog_panel_switchDoc_click")),1),Ve(ae(P(b)("dialog_panel_switchDoc_open"))+" ",1),N[3]||(N[3]=K("kbd",null,"Esc",-1)),Ve(ae(P(b)("dialog_panel_switchDoc_esc"))+" ",1),N[4]||(N[4]=K("kbd",null,"F1",-1)),Ve(ae(P(b)("dialog_panel_switchDoc_f1"))+" ",1),N[5]||(N[5]=K("kbd",null,"F2",-1)),Ve(ae(P(b)("dialog_panel_switchDoc_f2"))+" ",1),N[6]||(N[6]=K("kbd",null,"F3",-1)),N[7]||(N[7]=Ve()),K("span",af,ae(P(b)("dialog_panel_switchDoc_f3")),1),Ve(ae(P(b)("dialog_panel_switchDoc_f3_warn"))+" ",1),K("kbd",null,"Ctrl+"+ae(P(b)("dialog_panel_switchDoc_enter")),1),Ve(ae(P(b)("dialog_panel_switchDoc_ctrl"))+" ",1),K("kbd",null,"Shift+"+ae(P(b)("dialog_panel_switchDoc_enter")),1),Ve(ae(P(b)("dialog_panel_switchDoc_shift")),1)])]))}});const cf=(e,t)=>{const n=e.__vccOpts||e;for(const[o,i]of t)n[o]=i;return n},uf=cf(lf,[["__scopeId","data-v-baf52636"]]);let df=Pe(null);function pf(){return df}function _f(e){e.addCommand({langKey:"go_up",hotkey:"⌥⌘←",callback:()=>{ff()}}),e.addCommand({langKey:"go_down",hotkey:"⌥⌘→",callback:()=>{hf()}}),e.addCommand({langKey:"insert_lcd",hotkey:"",editorCallback:t=>{Ef(t)}}),e.addCommand({langKey:"go_to_previous_doc",hotkey:"⌥⌘↑",callback:()=>{mf()}}),e.addCommand({langKey:"go_to_next_doc",hotkey:"⌥⌘↓",callback:()=>{gf()}}),e.addCommand({langKey:"show_switch_panel",hotkey:"⌥⌘E",callback:()=>{Na()}}),e.addIcons(`
`),(so()||!ve())&&e.addTopBar({icon:"iconOgHnBookUp",title:b("dialog_panel_switchDoc"),position:"right",callback:()=>{Na()}}),e.addCommand({langKey:"make_navigation_top",hotkey:"",callback:()=>{rc()}})}async function Na(){const e=pn();if(!oe(e)){O("未能获取到当前文档id"),it(b("open_doc_first"));return}let t=null;const n=is(),o=pf();if(o.value){o.value.destroy(),o.value=null;return}const i=new ht.Dialog({title:b("dialog_panel_plugin_name")+"--"+b("dialog_panel_switchDoc"),content:`
`,width:ve()?"80vw":"55vw",height:ve()?"75vh":"80vh",destroyCallback:()=>{t.unmount(),o.value=null,O("对话框销毁成功")}});o.value=i,t=zr(uf,{docId:e,dialog:i}),t.mount(`#og_plugintemplate_${n}`)}async function ff(){const e=pn(),t=te();if(!oe(e)){V("未能读取到打开文档的id"),it(b("open_doc_first"));return}let n=await xe(`SELECT * FROM blocks WHERE id = "${e}"`),o;if(n&&n.length>=1)o=n[0].path.split("/");else return;if(!(o.length<2))if(oe(o[o.length-2])){let i=o[o.length-2];i=i.replace(".sy",""),$n({paramDocId:i,keyParam:{ctrlKey:!1,shiftKey:!1,altKey:!1},g_setting:t})}else it(b("is_top_document"),2e3)}async function hf(){const e=pn(),t=te();let n=await xe(`SELECT * FROM blocks WHERE id = "${e}"`);if(n&&n.length>=1){const o=await cs(n[0].path,n[0].box);if(o&&o.length>=1){const i=o[0];$n({paramDocId:i.id,keyParam:{ctrlKey:!1,shiftKey:!1,altKey:!1},g_setting:t})}else it(b("no_child_document"),2e3)}else it(b("canot_open_child_doc"),2e3)}async function mf(){const e=await ic(!1),t=te();O("previousDoc",e),e?$n({paramDocId:e.id,g_setting:t}):it(b("is_first_document"),2e3)}async function gf(){const e=await ic(!0),t=te();O("nextDoc",e),e?$n({paramDocId:e.id,g_setting:t}):it(b("is_last_document"),2e3)}async function ic(e){var s,a,l;let t=null,n;if(n=pn(),!oe(n)){it(b("open_doc_first"));return}let o=await xe(`SELECT * FROM blocks WHERE id = "${n}"`);if(!o||o.length<=0){O("文档似乎是刚刚创建,无法获取上下文信息,停止处理");return}const i=te();if(t=await us(o[0].path,o[0].box,void 0,!0),!((s=o[0].ial)!=null&&s.includes("custom-dailynote"))&&(t==null||t.length==1))return O("仅此一个文档,停止处理"),null;let r=-1;for(let c=0;c=0){if((a=o[0].ial)!=null&&a.includes("custom-dailynote")&&i.previousAndNextFollowDailynote)return await Nn({sqlResult:o,getNewer:e});if(r>0&&e==!1)return t[r-1];if(r+1';O("shortCut,PROTYLE",e);const r=``;(s=e.getInstance())==null||s.insert(r,!0)}async function rc(){const e=window.document.querySelector(".layout__wnd--active .protyle.fn__flex-1:not(.fn__none)");if(!e)return;const t=e.getAttribute("data-id");if(yf()===t){Ir();return}else Ir();const n=window.document.querySelector(".layout__wnd--active .protyle.fn__flex-1:not(.fn__none) .og-hn-heading-docs-container");if(!n)return;const o=n.getBoundingClientRect(),i=document.createElement("div");i.classList.add(h.PLACEHOLDER_FOR_POP_OUT_CLASS_NAME),i.style.width=`${o.width}px`,i.style.height=`${o.height}px`,i.innerHTML=b("make_top_placeholder").replace("##",Vp(window.siyuan.config.keymap.plugin["syplugin-hierarchyNavigate"].make_navigation_top.custom)),n.classList.add(h.TO_THE_TOP_CLASS_NAME),n.parentNode.insertBefore(i,n);const r=window.document.querySelector(".layout__wnd--active .protyle.fn__flex-1:not(.fn__none) .protyle-content"),a=window.document.querySelector(".layout__wnd--active .protyle.fn__flex-1:not(.fn__none)").getBoundingClientRect(),l=r.getBoundingClientRect();let c=l.left,u=l.top;const d=te();d.topMovePosition&&(c=a.left+a.width*d.topMovePosition.protyleRelativeLeft,u=a.top+a.height*d.topMovePosition.protyleRelativeTop),n.style.left=`${c}px`,n.style.top=`${u}px`,B_(!0)}function yf(){let t=window.document.querySelector(`.og-hn-heading-docs-container.${h.TO_THE_TOP_CLASS_NAME}`),n=null;for(let o=0;o<4&&t!=null;o++){if(t.getAttribute("data-id")){n=t;break}t=t.parentElement}return n==null?void 0:n.getAttribute("data-id")}function Ir(){const e=window.document.querySelectorAll(`.og-hn-heading-docs-container.${h.TO_THE_TOP_CLASS_NAME}`);return e&&e.length>0?(window.document.querySelectorAll(`.${h.PLACEHOLDER_FOR_POP_OUT_CLASS_NAME}`).forEach(t=>t.remove()),e.forEach(t=>{t.classList.remove(h.TO_THE_TOP_CLASS_NAME),t.style.left="",t.style.top=""}),P_(),!0):!1}const bf=e=>{const t=te();$n({mouseEvent:e,g_setting:t}),t.keepTempTop||Ir()};class vf{constructor(t,n,o){T(this,"basicInfo");T(this,"protyleEnvInfo");T(this,"protyleElement");T(this,"clickEventHandler");this.basicInfo=t,this.protyleEnvInfo=n,this.protyleElement=o,this.clickEventHandler=bf}validateAndFixMargin(t){return!t||t===""?"0px":t}async apply(t){const n=te(),o=document.createElement("div");o.classList.add("og-hn-heading-docs-container"),o.classList.add(h.HEADING_CLASS_NAME),o.dataset.existContentPart=JSON.stringify(t.relateContentKeys),ve()&&(n.mobileRemoveAllArea?document.querySelectorAll(`.og-hn-heading-docs-container.${h.HEADING_CLASS_NAME}`).forEach(s=>{s.remove()}):this.protyleElement.querySelectorAll(`.og-hn-heading-docs-container.${h.HEADING_CLASS_NAME}`).forEach(s=>{s.remove()}));const i=this.protyleElement.querySelectorAll(`.og-hn-heading-docs-container.${h.HEADING_CLASS_NAME}`),r=i?i[0]:null;if(this._isBlankAllPrinterResult(t)){r&&r.remove(),V("顶部内容区无有效内容");return}if(r){O("已经存在,进入替换模式"),JSON.parse(r.getAttribute("data-exist-content-part")??"[]").forEach(a=>{var l;t.relateContentKeys.includes(a)||((l=r.querySelector(`[data-og-content-type=${a}]`))==null||l.remove(),O("移除新设置中不存在的项目",a))});for(let a=0;a=0?r.children[m].insertAdjacentElement("afterend",l):(Le("似乎不该存在这个情况,在非第一个时,上一个元素应当是存在的"),r.insertAdjacentElement("afterbegin",l))}}r.setAttribute("data-exist-content-part",JSON.stringify(t.relateContentKeys))}else{O("未找到已经存在的,插入新的区域");for(const s of t.elements)o.appendChild(s);this.protyleEnvInfo.flashCard?this.flashcardApply(o):this.protyleEnvInfo.mobile?this.mobileApply(o):(o.addEventListener("pointerdown",s=>{if(s.button!=2)return;let l=s.target,c=10;for(;!l.classList.contains(h.CONTAINER_CLASS_NAME)&&c>0&&l;)l=l.parentElement,c--;l&&l.classList.contains(h.CONTAINER_CLASS_NAME)?(s.preventDefault(),s.stopPropagation(),s.stopImmediatePropagation(),l.classList.contains(h.AREA_NOT_FOLD_CLASS_NAME)?l.classList.remove(h.AREA_NOT_FOLD_CLASS_NAME):l.classList.add(h.AREA_NOT_FOLD_CLASS_NAME)):O("右键折叠无效,源Ele未找到",s)}),this.betaApply(o))}return U_()&&n.keepTempTop&&rc(),r?(this.bindBasicClickEvent(r),null):(this.bindBasicClickEvent(o),o)}async applyToEnd(t){const n=te(),o=document.createElement("div");o.classList.add("og-hn-heading-docs-container"),o.classList.add(h.FOOTER_CLASS_NAME),o.dataset.existContentPart=JSON.stringify(t.relateContentKeys),ve()&&(n.mobileRemoveAllArea?document.querySelectorAll(`.og-hn-heading-docs-container.${h.FOOTER_CLASS_NAME}`).forEach(s=>{s.remove()}):this.protyleElement.querySelectorAll(`.og-hn-heading-docs-container.${h.FOOTER_CLASS_NAME}`).forEach(s=>{s.remove()}));const i=this.protyleElement.querySelectorAll(`.og-hn-heading-docs-container.${h.FOOTER_CLASS_NAME}`),r=i?i[0]:null;if(this._isBlankAllPrinterResult(t)){r&&r.remove(),V("结尾内容区无有效内容");return}if(r){O("已经存在,进入替换模式"),JSON.parse(r.getAttribute("data-exist-content-part")??"[]").forEach(a=>{var l;t.relateContentKeys.includes(a)||((l=r.querySelector(`[data-og-content-type=${a}]`))==null||l.remove(),O("移除新设置中不存在的项目",a))});for(let a=0;a=0?r.children[m].insertAdjacentElement("afterend",l):(Le("似乎不该存在这个情况,在非第一个时,上一个元素应当是存在的"),r.insertAdjacentElement("afterbegin",l))}}r.setAttribute("data-exist-content-part",JSON.stringify(t.relateContentKeys))}else{if(O("未找到已经存在的,插入新的区域"),t.relateContentKeys==null||t.relateContentKeys.length==0){O("空内容区,区域不再置入");return}for(const a of t.elements)o.appendChild(a);const s=document.createElement("div");s.style.height="150px",o.appendChild(s),this.protyleEnvInfo.flashCard?this.flashcardApply(o):this.protyleEnvInfo.mobile?this.mobileApply(o):(o.addEventListener("pointerdown",a=>{if(a.button!=2)return;let c=a.target,u=10;for(;!c.classList.contains(h.CONTAINER_CLASS_NAME)&&u>0&&c;)c=c.parentElement,u--;c&&c.classList.contains(h.CONTAINER_CLASS_NAME)?(a.preventDefault(),a.stopPropagation(),a.stopImmediatePropagation(),c.classList.contains(h.AREA_NOT_FOLD_CLASS_NAME)?c.classList.remove(h.AREA_NOT_FOLD_CLASS_NAME):c.classList.add(h.AREA_NOT_FOLD_CLASS_NAME)):O("右键折叠无效,源Ele未找到",a)}),this.endApply(o))}return r?(this.bindBasicClickEvent(r),null):(this.bindBasicClickEvent(o),o)}_isBlankAllPrinterResult(t){return t.relateContentKeys.length==0||t.relateContentKeys.length==1&&t.relateContentKeys[0]==S.MOVE_TOP_AREA}removeExistElementByOGType(t){var n;(n=this.protyleElement.querySelector(`.og-hn-heading-docs-container [data-og-content-type=${t}]`))==null||n.remove()}findChildElementIndexByOGType(t,n){const o=Array.from(t.children);for(let i=0;i{var H;O("[兼容模式]observer响应宽度更改,observer设定来源",i.basicInfo.currentDocId,(H=i.protyleEnvInfo.originProtyle)==null?void 0:H.id);let x=o.querySelector(".protyle-title");const q=o.querySelector(".og-hn-heading-docs-container.og-hn-at-doc-top"),k=window.getComputedStyle(x);if(q&&k){const E=k.marginRight,N=k.marginLeft;O(`[兼容模式]observer - 检测到margin变化: right=${E}, left=${N}`);const F=i.validateAndFixMargin(E),ie=i.validateAndFixMargin(N);t.style.marginRight=F,t.style.marginLeft=ie}},30)})})}window.og_hn_observe||(window.og_hn_observe={});for(const v in window.og_hn_observe)window.document.querySelector(`[data-id="${v}"]`)||(O("断开先前observer",v),(g=window.og_hn_observe[v])==null||g.disconnect(),delete window.og_hn_observe[v]);oe(this.protyleElement.dataset.id)?O("observer set at ",this.protyleElement.dataset.id):Le("设置observer时没有唯一id,可能无法及时销毁,请@开发者检查此问题",this.protyleElement.dataset.id),window.og_hn_observe[this.protyleElement.dataset.id]=r;let s={attributes:!0,attributeFilter:["style"]};r instanceof ResizeObserver&&(s=null),r instanceof ResizeObserver?r.observe(this.protyleElement):r.observe(n,s)}async defaultApply(t){var o;(o=this.protyleElement.querySelector(".og-hn-heading-docs-container.og-hn-at-doc-top"))==null||o.remove();const n=this.protyleElement.querySelector(".protyle-title .protyle-title__input");n&&n.insertAdjacentElement("afterend",t)}async endApply(t){var i;(i=this.protyleElement.querySelector(".og-hn-heading-docs-container.og-hn-at-doc-end"))==null||i.remove();const n=this.protyleElement.querySelector(".protyle-content"),o=this.protyleElement.querySelector(".protyle-title");if(o){const r=window.getComputedStyle(o).getPropertyValue("margin-right"),s=window.getComputedStyle(o).getPropertyValue("margin-left");t.style.marginRight=r,t.style.marginLeft=s,t.style.transition="margin .3s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0ms"}n&&n.insertAdjacentElement("beforeend",t)}adjustWysiwygPaddingBottom(){var n;const t=this.protyleElement.querySelector(".protyle-wysiwyg");O("paddingBottom",t,t.style.paddingBottom,this.protyleElement.clientHeight/3),(n=t==null?void 0:t.style)!=null&&n.paddingBottom&&(ve()||(t.style.paddingBottom=this.protyleElement.clientHeight/5+"px"))}async mobileApply(t){t.style.paddingTop="16px",t.style.paddingLeft="24px",t.style.paddingRight="16px",window.document.querySelector(".protyle-background[data-node-id]").insertAdjacentElement("afterend",t),O("安卓端写入完成")}async flashcardApply(t){t.style.paddingLeft="24px",t.style.paddingRight="16px",this.protyleElement.querySelector(".protyle-content").insertAdjacentElement("afterbegin",t)}bindBasicClickEvent(t){const n=te();t.querySelectorAll(".og-hn-heading-docs-container .refLinks").forEach(o=>{o.removeEventListener("click",this.clickEventHandler,n.openDocClickListenerCompatibilityMode),o.addEventListener("click",this.clickEventHandler,n.openDocClickListenerCompatibilityMode)})}}class Nf{constructor(){T(this,"isLocked",!1);T(this,"queue",[])}async lock(){return new Promise(t=>{(async()=>{this.isLocked?this.queue.push(()=>{this.isLocked=!0,t()}):(this.isLocked=!0,t())})()})}tryLock(){return this.isLocked?!1:(this.isLocked=!0,!0)}unlock(){this.isLocked=!1;const t=this.queue.shift();t&&t()}}class Tf{constructor(){T(this,"handlerBindList",{"loaded-protyle-static":this.loadedProtyleRetryEntry.bind(this),"switch-protyle":this.loadedProtyleRetryEntry.bind(this),"ws-main":this.wsMainHandler.bind(this)});T(this,"relateGsettingKeyStr",{"loaded-protyle-static":null,"switch-protyle":null,"ws-main":"immediatelyUpdate"});T(this,"loadAndSwitchMutex");T(this,"simpleMutex",0);T(this,"docIdMutex",{});this.loadAndSwitchMutex=new Nf}bindHandler(){const t=un(),n=te();for(let r in this.handlerBindList)(this.relateGsettingKeyStr[r]==null||n[this.relateGsettingKeyStr[r]])&&t.eventBus.on(r,this.handlerBindList[r]);if(ve()&&n.mobileBackReplace&&ca("3.1.25")){const r=window.goBack;window.ogGoBackOri=r,r&&(window.goBack=()=>{if(window.ogGoBackOri){const s=window.ogGoBackOri();t.eventBus.emit("mobile-goback",{detail:{protyle:window.siyuan.mobile.editor.protyle}});const a=new CustomEvent("loaded-protyle-static",{detail:{protyle:window.siyuan.mobile.editor.protyle},bubbles:!0,cancelable:!0});return this.loadedProtyleRetryEntry(a),s}})}if(n.mobileBackReplace&&ca("3.1.25")&&so()&&Le("插件替换移动端返回功能仍在生效,如果思源版本大于3.1.25,这不应该发生!"),ht.getAllEditor==null){Le("不支持的思源版本,请关闭 及时更新 设置项! This version of SiYuan is not supported, please disable the 'immediatelyUpdate' setting!");return}const o=ht.getAllEditor(),i=pa();if(i!=null&&i.length>0){for(let r of o)if(i.includes(r.protyle.block.rootID)){O("由 首次加载触发");const s=new CustomEvent("loaded-protyle-static",{detail:{protyle:r.protyle}});this.loadedProtyleHandler(s).catch(a=>{Ze("Error in movedoc handler",a)})}}}unbindHandler(){const t=un();for(let n in this.handlerBindList)t.eventBus.off(n,this.handlerBindList[n])}async wsMainHandler(t){if(["moveDoc","rename","removeDoc"].indexOf(t.detail.cmd)!=-1)try{if(O("检查刷新中(由重命名、删除或移动触发)"),ht.getAllEditor==null){Le("不支持的思源版本,请关闭 及时更新 设置项! This version of SiYuan is not supported, please disable the 'immediatelyUpdate' setting!");return}const o=ht.getAllEditor(),i=pa();if(i!=null&&i.length>0){for(let r of o)if(i.includes(r.protyle.block.rootID)){O("由重命名、删除或移动触发");const s=new CustomEvent("loaded-protyle-static",{detail:{protyle:r.protyle}});this.loadedProtyleHandler(s).catch(a=>{Ze("Error in movedoc handler",a)})}}}catch(o){Ze(o)}}async loadedProtyleHandler(t){var r,s,a,l;const n=((a=(s=(r=t==null?void 0:t.detail)==null?void 0:r.protyle)==null?void 0:s.block)==null?void 0:a.id)??"undefined",o=(l=t==null?void 0:t.detail)==null?void 0:l.protyle.element.getAttribute("data-id");if(this.docIdMutex[o]>0){const c=await qp(t.detail.protyle.block.id);return V("由于正在运行,部分刷新被停止",t.detail.protyle.block.id,c),!0}else this.docIdMutex[o]||(this.docIdMutex[o]=0);O("mutex",n,this.docIdMutex[o]),this.docIdMutex[o]++;let i=!0;so()&&console.time(h.PLUGIN_NAME+" "+n);try{await this.loadAndSwitchMutex.lock(),V("\x1B[1;36m%s\x1B[0m",">>>>>>>> mutex 新任务开始");let c=t.detail.protyle;V("loadedProtyleHandler",c),V("currentDoc",JSON.stringify(c==null?void 0:c.block));const u=c.block.rootID;c.element.classList.contains("fn__none")&&(so()&&it(`触发更新的文档不可见, ${c.id}, ${u}, ${c.element.children.length}`),O(`当前文档不可见, ${c.id}, ${u}, ${c.element.children.length}`));const d=Up(c);if(V("protyleInfo",d),d.notTraditional&&!d.flashCard&&!d.mobile)return O("非常规情况,且设置不允许,跳过"),!0;!d.flashCard&&ve()&&(c=window.siyuan.mobile.editor.protyle,d.originProtyle=c);const p=await N_(u,c.path,c.notebookId);if(V("basicInfo",p),!p.success)return V("获取文档信息失败"),!1;const m=new F_(p,d),g=await m.print(!1);V("finalElement",g);const v=new vf(p,d,c.element);let G=[];if(g&&G.push(v.apply(g)),!d.flashCard&&!d.notTraditional){const x=await m.print(!0);x&&G.push(v.applyToEnd(x))}(await Promise.all(G)).filter(x=>x).forEach(x=>v.weSetObserver(x))}catch(c){Ze("ERROR",c),i=!0}finally{V("\x1B[1;36m%s\x1B[0m","<<<<<<<< mutex 任务结束"),so()&&console.timeEnd(h.PLUGIN_NAME+" "+n),this.loadAndSwitchMutex.unlock(),this.docIdMutex[o]--}return i}async loadedProtyleRetryEntry(t){let n=!0;te();let o=0;do n=await this.loadedProtyleHandler(t),o++,n==!1&&(V("重试过程中遇到问题"),await Or(300));while(o<2&&!n);n||Ap("多次重试仍然存在异常,请查看Log日志")}}/**
* syplugin-hierarchy-navigate
* Copyright (C) 2024 OpaqueGlass
* @license AGPL-3.0
*/const Of="menu-config",If="custom_tab";class Af extends Lt.Plugin{constructor(){super(...arguments);T(this,"isMobile");T(this,"settingPanel");T(this,"myEventHandler")}async onload(){this.data[Of]={readonlyText:"Readonly"},V("测试",this.i18n),Ld(this.i18n),Bp(this),t_(),_f(this),this.myEventHandler=new Tf;const n=Lt.getFrontend();this.isMobile=n==="mobile"||n==="browser-mobile",document.createElement("textarea"),Yl()}onLayoutReady(){i_().then(()=>{this.myEventHandler.bindHandler(),V("绑定Handler结束"),jl()}).catch(n=>{it("载入设置项失败。Load plugin settings faild. syplugin-hierarchy-navigate"),Ze(n)})}onunload(){var n;if(V("正在卸载插件"),this.myEventHandler.unbindHandler(),document.querySelectorAll(`.${h.TOP_CONTAINER_CLASS_NAME}`).forEach(o=>{o.remove()}),$l(),zp(),window.og_hn_observe){for(const o in window.og_hn_observe)O("插件卸载清理observer",o),(n=window.og_hn_observe[o])==null||n.disconnect();delete window.og_hn_observe}}openSetting(){const n=is(),o=zr(v_);new ht.Dialog({title:this.i18n.setting_panel_title,content:`
`,width:Ta()?"92vw":"1040px",height:Ta()?"70vh":"80vh",destroyCallback:()=>{o.unmount()}}),o.mount(`#og_plugintemplate_${n}`)}openStatisticTab(){Lt.openTab({app:this.app,custom:{icon:"iconTestStatistics",title:"Custom Tab",id:this.name+If}})}}function Ta(){return!!window.top.document.getElementById("sidebar")}module.exports=Af;