代码拉取完成,页面将自动刷新
同步操作将从 Yaohaixiao/outline.js 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).Outline=e()}(this,(function(){"use strict";const t=t=>Object.prototype.toString.apply(t),e=e=>"function"==typeof e||"[object Function]"===t(e),s=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return!!e(t)&&setTimeout((()=>{t()}),s)},i=s=>("[object Object]"===t(s)||"object"==typeof s||e(s))&&null!==s,r=e=>Array.isArray?Array.isArray(e):"[object Array]"===t(e),n=t=>{let e={};return null===t?null:(r(t)?e=Array.from(t):(e=Object.assign({},t),Object.keys(e).forEach((s=>e[s]=i(t[s])?n(t[s]):t[s]))),e)},o=t=>"string"==typeof t,l=t=>!!(i(t)&&t.nodeName&&t.tagName&&1===t.nodeType),a=(t,e)=>{const s=new RegExp("(\\s|^)"+e+"(\\s|$)");let i,r;return!!l(t)&&(i=t.className,!!i&&(r=t.classList,r&&r.contains?t.classList.contains(e):!!s.exec(i)))},h=(t,e)=>{var s;let i,r;if(a(t,e))return!1;i=t.classList,null!==(s=i)&&void 0!==s&&s.add?i.add(e):(r=t.className,r+=r.length>0?" "+e:e,t.className=r)},c=t=>t*t,d=function(){let t,e,s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return s?o(s)?e=document.querySelector(s):l(s)&&(e=s):(t=document.querySelectorAll("html,body"),e=t[0].scrollTop-t[1].scrollTop>=0?t[0]:t[1]),e},u=(t,s,i)=>{const r=d(t);let n=r.scrollTop,o=0;const l=s-n,a=r.scrollHeight,h=s-a<=0?s:a,u=t=>(e(i)&&i(t),!1),m=()=>{if(o+=1,l<0){if(n-=c(o),r.scrollTop=n,n<=s)return r.scrollTop=s,u(s)}else if(n+=c(o),r.scrollTop=n,n>=h)return r.scrollTop=h,u(h);requestAnimationFrame(m)};requestAnimationFrame(m)},m=t=>!!o(t)&&t.replace(/(^\s+)|(\s+$)/g,""),p=function(t){let s=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=1,l=0,a="";const h=[];return t.forEach(((t,s)=>{const r=t.tagName,c=r.replace(/h/i,"");let d=parseInt(c,10),u=-1;var p;d>n?(l+=1,u=1===l?-1:s-1):d===n||d<n&&d>l?1===d?(l=1,u=-1):u=h[s-1].pid:d<=l&&(1===d?l=1:(l-=n-d,l<=1&&(l=1)),u=1===l?-1:((t,e,s)=>{let i,r,n=t[s-1];for(r=0;r<e;r+=1)i=n.pid,n=t[i];return i=n.pid,i})(h,n-d,s)),n=d,p=m(t.innerHTML),a=o(p)?p.replace(/<\/?[^>]+(>|$)/g,""):"",e(i)&&(a=i(a)),h.push({id:s,pid:u,level:l,rel:`heading-${s}`,text:a,tagName:r})})),s?(t=>{const e={};return t.forEach((t=>{const s=JSON.stringify((t=>[t.pid])(t));e[s]=e[s]||[],e[s].push(t),t.index=e[s].length,-1===t.pid&&(t.code=String(t.index))})),Object.keys(e).forEach((t=>{e[t].forEach((t=>{const s=e[`[${t.id}]`];if(!s||!r(s))return!1;s.forEach((e=>{e.code=t.code+"."+e.index}))}))})),t})(h):h},g=t=>{const{articleElement:s,selector:i,showCode:r,chapterTextFilter:n,isTreeStructured:a}=t;let h=document.querySelector("#article"),c=[],d=[],u=t=>t.replace(/\(.*?\)/,"()");return o(s)?h=document.querySelector(s):l(s)&&(h=s),h?(e(n)&&(u=n),c=[...h.querySelectorAll(i||"h1,h2,h3,h4,h5,h6")],d=p(c,r||!0,u),!0===a?((t,e,s)=>{const i={},r=[];return t.forEach(((t,s)=>{i[t[e]]=s,t.children=[]})),t.forEach((e=>{const n=t[i[e[s]]];-1!==e[s]?n.children.push(e):r.push(e)})),r})(d,"id","pid"):d):d},f=(t,e)=>{const s=Object.prototype.hasOwnProperty;return t&&s.call(t,e)},b=(t,e)=>{Object.keys(e).forEach((s=>{f(e,s)&&(t[s]=e[s])}))},v={},y=t=>f(v,t)&&v[t].length>0,$=function(t){return!(arguments.length>1&&void 0!==arguments[1])||arguments[1]?y(t):(t=>{let e=y(t),s=t.lastIndexOf(".");for(;!e&&-1!==s;)s=(t=t.substring(0,s)).lastIndexOf("."),e=y(t);return e})(t)},_=function(e,s){let i=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const r=e=>{if(!y(e))return!1;v[e].forEach((e=>{const i=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object BigInt64Array]","[object BigUint64Array]"].indexOf(t(s))>-1?s.toString():s;e.callback.call(e.context||e,i)}))},n=()=>{let t=e,s=e.lastIndexOf(".");for(;-1!==s;)t=t.substring(0,s),s=t.lastIndexOf("."),r(t);r(e),r("*")};if(!$(e))return!1;i?setTimeout(n,10):n()},x=(()=>{let t=0;return e=>(t+=1,e?e+"-"+t:"guid-"+t)})(),T=t=>{if(!f(v,t))return!1;delete v[t]},w=(t,e)=>{if(!$(t))return!1;e?(t=>{const e=Object.keys(v);if(!t||e.length<1)return!1;e.forEach((e=>{const s=v[e];let i;s.forEach(((e,r)=>{e.callback!==t&&e.token!==t||(i=e.topic,s.splice(-1,r))})),s.length<1&&T(i)}))})(e):T(t)};class E{constructor(t){this.attrs={},t&&this.initialize(t)}initialize(t){return this.attr(t).render().addListeners(),this}attr(t,e){const s=this.attrs;return o(t)?e&&f(s,t)?(s[t]=e,this):s[t]:i(t)?(b(s,t),this):0===arguments.length?s:this}render(){return this}refresh(){return this}destroy(){return this.removeListeners(),this}reload(t){let e=this.attr();return t&&(e=this.attr(t)),this.destroy().initialize(e),this}$emit(t,e){return _(t,e),this}$on(t,s){return function(t,s){let i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const r=x();let n="symbol"==typeof t?t.toString():t;e(s)&&(v[n]||(v[n]=[]),v[n].push({topic:n,callback:s,context:i,token:r}))}(t,s,this),this}$off(t,e){return w(t,e),this}addListeners(){return this}removeListeners(){return this}}const C=[];let S,z;function L(t){for(;t.timeRemaining()>0&&C.length;){const t=C.shift();if(!e(t))return!1;t()}C.length?S=requestIdleCallback(L):(S=0,e(z)&&(z(),z=null))}void 0===window.requestIdleCallback&&(window.requestIdleCallback=function(t){const e=Date.now();return s((function(){t({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-e))}})}),10)},window.cancelIdleCallback=function(t){clearTimeout(t)});const k=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;C.push(t),e(s)&&(z=s),S||requestIdleCallback(L)},M=t=>{let e=t.offsetTop;return null!==t.offsetParent&&(e+=M(t.offsetParent)),e},N=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const s=e.replace(/^>/i,"");return!!(e&&s&&t)&&(t.matches?t.matches(s):!!t.msMatchesSelector&&t.msMatchesSelector(s))},A=t=>t.host&&t!==document&&t.host.nodeType?t.host:t.parentNode,H=["focusout","blur","focusin","focus","load","unload","mouseenter","mouseleave"],O=(t,e,s)=>{const i=H.indexOf(e)>-1;s._delegateListener&&delete(s=s._delegateListener)._delegateListener,function(t,e,s){const i=t._listeners;let r=-1;if(i.length<1)return!1;i.forEach(((t,i)=>{const n=t.fn;e===t.type&&(r=i,n===s&&(r=i))})),r>-1&&i.splice(r,1)}(t,e,s),t.removeEventListener(e,s,i)},D=function(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=o(t)?document.querySelector(t):t,r=i.childNodes,n=((t,e)=>{let s=t._listeners||[];return o(e)&&e&&(s=s.filter((t=>t.type===e))),s})(i,e);n.forEach((t=>{O(i,t.type,t.fn)})),(s||!0===e||1===arguments.length)&&i&&r&&r.forEach((t=>{l(t)&&D(t,e,s)}))},F=(t,s,i)=>{if(!e(i))return D(t,s),!1;O(t,s,i)},q=function(t,e,s,i,r,n){let o=arguments.length>6&&void 0!==arguments[6]&&arguments[6];const l=H.indexOf(s)>-1,a=function(l){const h=function(t){const e=t.target;return(s=e)&&3===s.nodeType?s.parentNode:s;var s}(l),c=((t,e,s,i)=>{const r=s||document;if(!t)return null;do{if(null!=e&&(e.startsWith(">")?t.parentNode===r&&N(t,e):N(t,e))||i&&t===r)return t;if(t===r)break}while(t=A(t))})(h,e,t);let d=n||t;l.delegateTarget=c,!0===n&&(d=r),c&&(!0===o&&F(t,s,a),i.call(d,l,r))};if(!t)return!1;t._listeners||(t._listeners=[]),t._listeners.push({el:t,selector:e,type:s,fn:a,data:r,context:n,capture:l}),i._delegateListener=a,t.addEventListener(s,a,l)},j=function(t){t.stopPropagation(),t.preventDefault()},R=['<symbol id="outline-icon-up" viewBox="0 0 1024 1024"><path d="M494.784 261.696c0.832-0.448 1.536-1.216 2.368-1.536a38.72 38.72 0 0 1 46.08 8.256l277.824 302.272a41.92 41.92 0 0 1-1.536 58.048 39.104 39.104 0 0 1-56.448-1.6L513.728 355.904 260.736 626.048a39.104 39.104 0 0 1-56.448 1.088 41.6 41.6 0 0 1-1.088-57.984L483.84 269.696c0.512-0.512 1.344-0.768 1.92-1.408l1.088-1.344c2.368-2.496 5.312-3.648 8-5.248z"></path></symbol>','<symbol id="outline-icon-down" viewBox="0 0 1024 1024"><path d="M494.784 762.304c0.832 0.448 1.536 1.216 2.368 1.536 15.232 7.488 33.92 4.992 46.08-8.256l277.824-302.272a41.92 41.92 0 0 0-1.536-58.048 39.104 39.104 0 0 0-56.448 1.6l-249.344 271.232-252.992-270.144a39.104 39.104 0 0 0-56.448-1.088 41.6 41.6 0 0 0-1.088 57.984l280.576 299.456c0.512 0.512 1.344 0.768 1.92 1.408l1.088 1.344c2.368 2.496 5.312 3.648 8 5.248z"></path></symbol>','<symbol id="outline-icon-menu" viewBox="0 0 1024 1024"><path d="M320 256h640V128H320zM320 576h640V448H320zM320 896h640v-128H320zM64 256h128V128H64zM64 576h128V448H64zM64 896h128v-128H64z"></path></symbol>','<symbol id="outline-icon-file" viewBox="0 0 1024 1024"><path d="M320 640h256v128H320z"></path><path d="M320 448h384v128H320z"></path><path d="M640 0l320 320v557.696C960 958.528 909.824 1024 848 1024H176C114.176 1024 64 958.528 64 877.696V146.304C64 65.472 114.176 0 176 0H640z m0 128H192v768h640V320h-192V128z"></path></symbol>','<symbol id="outline-icon-hash" viewBox="0 0 24 24"><path d="M14.216 10l-0.444 4h-3.988l0.444-4zM15.006 2.89l-0.568 5.11h-3.988l0.543-4.89c0.061-0.549-0.335-1.043-0.883-1.104s-1.043 0.335-1.104 0.884l-0.568 5.11h-4.438c-0.552 0-1 0.448-1 1s0.448 1 1 1h4.216l-0.444 4h-3.772c-0.552 0-1 0.448-1 1s0.448 1 1 1h3.549l-0.543 4.89c-0.061 0.549 0.335 1.043 0.883 1.104s1.043-0.335 1.104-0.883l0.569-5.111h3.988l-0.543 4.89c-0.061 0.549 0.335 1.043 0.883 1.104s1.043-0.335 1.104-0.883l0.568-5.111h4.438c0.552 0 1-0.448 1-1s-0.448-1-1-1h-4.216l0.444-4h3.772c0.552 0 1-0.448 1-1s-0.448-1-1-1h-3.549l0.543-4.89c0.061-0.549-0.335-1.043-0.883-1.104s-1.043 0.335-1.104 0.883z"></path></symbol>','<symbol id="outline-icon-close" viewBox="0 0 1024 1024"><path d="M536.96 491.648L310.592 265.344a32 32 0 1 0-45.248 45.248L491.584 536.96l-226.304 226.304a32 32 0 0 0 45.312 45.248l226.24-226.304 226.304 226.304a32 32 0 0 0 45.248-45.248L582.144 536.896l226.304-226.24a32 32 0 0 0-45.248-45.248L536.896 491.584z"></path></symbol>','<symbol id="outline-icon-homepage" viewBox="0 0 26 28"><path d="M22 15.5v7.5c0 0.547-0.453 1-1 1h-6v-6h-4v6h-6c-0.547 0-1-0.453-1-1v-7.5c0-0.031 0.016-0.063 0.016-0.094l8.984-7.406 8.984 7.406c0.016 0.031 0.016 0.063 0.016 0.094zM25.484 14.422l-0.969 1.156c-0.078 0.094-0.203 0.156-0.328 0.172h-0.047c-0.125 0-0.234-0.031-0.328-0.109l-10.813-9.016-10.813 9.016c-0.109 0.078-0.234 0.125-0.375 0.109-0.125-0.016-0.25-0.078-0.328-0.172l-0.969-1.156c-0.172-0.203-0.141-0.531 0.063-0.703l11.234-9.359c0.656-0.547 1.719-0.547 2.375 0l3.813 3.187v-3.047c0-0.281 0.219-0.5 0.5-0.5h3c0.281 0 0.5 0.219 0.5 0.5v6.375l3.422 2.844c0.203 0.172 0.234 0.5 0.063 0.703z"></path></symbol>','<symbol id="outline-icon-github" viewBox="0 0 24 28"><path d="M12 2c6.625 0 12 5.375 12 12 0 5.297-3.437 9.797-8.203 11.391-0.609 0.109-0.828-0.266-0.828-0.578 0-0.391 0.016-1.687 0.016-3.297 0-1.125-0.375-1.844-0.812-2.219 2.672-0.297 5.484-1.313 5.484-5.922 0-1.313-0.469-2.375-1.234-3.219 0.125-0.313 0.531-1.531-0.125-3.187-1-0.313-3.297 1.234-3.297 1.234-0.953-0.266-1.984-0.406-3-0.406s-2.047 0.141-3 0.406c0 0-2.297-1.547-3.297-1.234-0.656 1.656-0.25 2.875-0.125 3.187-0.766 0.844-1.234 1.906-1.234 3.219 0 4.594 2.797 5.625 5.469 5.922-0.344 0.313-0.656 0.844-0.766 1.609-0.688 0.313-2.438 0.844-3.484-1-0.656-1.141-1.844-1.234-1.844-1.234-1.172-0.016-0.078 0.734-0.078 0.734 0.781 0.359 1.328 1.75 1.328 1.75 0.703 2.141 4.047 1.422 4.047 1.422 0 1 0.016 1.937 0.016 2.234 0 0.313-0.219 0.688-0.828 0.578-4.766-1.594-8.203-6.094-8.203-11.391 0-6.625 5.375-12 12-12zM4.547 19.234c0.031-0.063-0.016-0.141-0.109-0.187-0.094-0.031-0.172-0.016-0.203 0.031-0.031 0.063 0.016 0.141 0.109 0.187 0.078 0.047 0.172 0.031 0.203-0.031zM5.031 19.766c0.063-0.047 0.047-0.156-0.031-0.25-0.078-0.078-0.187-0.109-0.25-0.047-0.063 0.047-0.047 0.156 0.031 0.25 0.078 0.078 0.187 0.109 0.25 0.047zM5.5 20.469c0.078-0.063 0.078-0.187 0-0.297-0.063-0.109-0.187-0.156-0.266-0.094-0.078 0.047-0.078 0.172 0 0.281s0.203 0.156 0.266 0.109zM6.156 21.125c0.063-0.063 0.031-0.203-0.063-0.297-0.109-0.109-0.25-0.125-0.313-0.047-0.078 0.063-0.047 0.203 0.063 0.297 0.109 0.109 0.25 0.125 0.313 0.047zM7.047 21.516c0.031-0.094-0.063-0.203-0.203-0.25-0.125-0.031-0.266 0.016-0.297 0.109s0.063 0.203 0.203 0.234c0.125 0.047 0.266 0 0.297-0.094zM8.031 21.594c0-0.109-0.125-0.187-0.266-0.172-0.141 0-0.25 0.078-0.25 0.172 0 0.109 0.109 0.187 0.266 0.172 0.141 0 0.25-0.078 0.25-0.172zM8.937 21.438c-0.016-0.094-0.141-0.156-0.281-0.141-0.141 0.031-0.234 0.125-0.219 0.234 0.016 0.094 0.141 0.156 0.281 0.125s0.234-0.125 0.219-0.219z"></path></symbol>','<symbol id="outline-icon-issues" viewBox="0 0 24 28"><path d="M25.5 15c0 0.547-0.453 1-1 1h-3.5c0 1.953-0.422 3.422-1.047 4.531l3.25 3.266c0.391 0.391 0.391 1.016 0 1.406-0.187 0.203-0.453 0.297-0.703 0.297s-0.516-0.094-0.703-0.297l-3.094-3.078s-2.047 1.875-4.703 1.875v-14h-2v14c-2.828 0-4.891-2.063-4.891-2.063l-2.859 3.234c-0.203 0.219-0.469 0.328-0.75 0.328-0.234 0-0.469-0.078-0.672-0.25-0.406-0.375-0.438-1-0.078-1.422l3.156-3.547c-0.547-1.078-0.906-2.469-0.906-4.281h-3.5c-0.547 0-1-0.453-1-1s0.453-1 1-1h3.5v-4.594l-2.703-2.703c-0.391-0.391-0.391-1.016 0-1.406s1.016-0.391 1.406 0l2.703 2.703h13.188l2.703-2.703c0.391-0.391 1.016-0.391 1.406 0s0.391 1.016 0 1.406l-2.703 2.703v4.594h3.5c0.547 0 1 0.453 1 1zM18 6h-10c0-2.766 2.234-5 5-5s5 2.234 5 5z"></path></symbol>','<symbol id="outline-icon-tags" viewBox="0 0 26 28"><path d="M7 7c0-1.109-0.891-2-2-2s-2 0.891-2 2 0.891 2 2 2 2-0.891 2-2zM23.672 16c0 0.531-0.219 1.047-0.578 1.406l-7.672 7.688c-0.375 0.359-0.891 0.578-1.422 0.578s-1.047-0.219-1.406-0.578l-11.172-11.188c-0.797-0.781-1.422-2.297-1.422-3.406v-6.5c0-1.094 0.906-2 2-2h6.5c1.109 0 2.625 0.625 3.422 1.422l11.172 11.156c0.359 0.375 0.578 0.891 0.578 1.422zM29.672 16c0 0.531-0.219 1.047-0.578 1.406l-7.672 7.688c-0.375 0.359-0.891 0.578-1.422 0.578-0.812 0-1.219-0.375-1.75-0.922l7.344-7.344c0.359-0.359 0.578-0.875 0.578-1.406s-0.219-1.047-0.578-1.422l-11.172-11.156c-0.797-0.797-2.312-1.422-3.422-1.422h3.5c1.109 0 2.625 0.625 3.422 1.422l11.172 11.156c0.359 0.375 0.578 0.891 0.578 1.422z"></path></symbol>','<symbol id="outline-icon-print" viewBox="0 0 24 24"><path d="M18 3v3.984h-12v-3.984h12zM18.984 12q0.422 0 0.727-0.281t0.305-0.703-0.305-0.727-0.727-0.305-0.703 0.305-0.281 0.727 0.281 0.703 0.703 0.281zM15.984 18.984v-4.969h-7.969v4.969h7.969zM18.984 8.016q1.219 0 2.109 0.891t0.891 2.109v6h-3.984v3.984h-12v-3.984h-3.984v-6q0-1.219 0.891-2.109t2.109-0.891h13.969z"></path></symbol>','<symbol id="outline-icon-info" viewBox="0 0 1024 1024"><path d="M512 384.295982a95.994 95.994 0 0 1 95.994 95.994V928.006a95.994 95.994 0 0 1-191.988 0V480.289982a95.994 95.994 0 0 1 95.994-95.994z m0-128.375977A127.992 127.992 0 1 1 512 0.063996a127.992 127.992 0 0 1 0 255.984001z"></path></symbol>','<symbol id="outline-icon-warning" viewBox="0 0 1024 1024"><path d="M512 639.704018a95.994 95.994 0 0 1-95.994-95.994V95.994a95.994 95.994 0 0 1 191.988 0v447.716018a95.994 95.994 0 0 1-95.994 95.994z m0 128.375977A127.992 127.992 0 1 1 512 1023.936004a127.992 127.992 0 0 1 0-255.984001z"></path></symbol>','<symbol id="outline-icon-error" viewBox="0 0 1024 1024"><path d="M512.64 376.96L263.744 128 128 263.744l248.96 248.96L128 761.472l135.744 135.808 248.96-248.96 248.832 248.96 135.808-135.808-248.96-248.896 248.96-248.896L761.536 128 512.64 376.96z"></path></symbol>','<symbol id="outline-icon-success" viewBox="0 0 1024 1024"><path d="M426.368 580.864l-226.56-226.56L64 489.984l362.048 362.112 0.32-0.32 0.32 0.32 588.288-588.352L879.36 128 426.304 580.864z"></path></symbol>','<symbol id="outline-icon-circle-info" viewBox="0 0 1024 1024"><path d="M512 810.666667s-42.666667 4.266667-42.666667-42.666667v-341.333333c0-46.933333 42.666667-42.666667 42.666667-42.666667s42.666667-4.266667 42.666667 42.666667v341.333333c0 46.933333-42.666667 42.666667-42.666667 42.666667z m0 213.333333C228.949333 1024 0 795.050667 0 512S228.949333 0 512 0s512 228.949333 512 512-229.674667 512-512 512z m0-938.666667C276.608 85.333333 85.333333 276.608 85.333333 512s191.274667 426.666667 426.666667 426.666667 426.666667-191.274667 426.666667-426.666667S747.392 85.333333 512 85.333333z m0 213.333334c-23.466667 0-42.666667-19.2-42.666667-42.666667s19.2-42.666667 42.666667-42.666667 42.666667 19.2 42.666667 42.666667-19.2 42.666667-42.666667 42.666667z"></path></symbol>','<symbol id="outline-icon-circle-warning" viewBox="0 0 1024 1024"><path d="M512 213.333333s-42.666667-4.266667-42.666667 42.666667v341.333333c0 46.933333 42.666667 42.666667 42.666667 42.666667s42.666667 4.266667 42.666667-42.666667V256c0-46.933333-42.666667-42.666667-42.666667-42.666667z m0-213.333333C228.949333 0 0 228.949333 0 512s228.949333 512 512 512 512-228.949333 512-512S794.325333 0 512 0z m0 938.666667C276.608 938.666667 85.333333 747.392 85.333333 512S276.608 85.333333 512 85.333333s426.666667 191.274667 426.666667 426.666667-191.274667 426.666667-426.666667 426.666667z m0-213.333334c-23.466667 0-42.666667 19.2-42.666667 42.666667s19.2 42.666667 42.666667 42.666667 42.666667-19.2 42.666667-42.666667-19.2-42.666667-42.666667-42.666667z"></path></symbol>','<symbol id="outline-icon-circle-error" viewBox="0 0 1024 1024"><path d="M512 0a512 512 0 1 0 512 512 512 512 0 0 0-512-512z m0 955.776A443.84 443.84 0 0 1 512 68.224a443.904 443.904 0 0 1 0 887.552z"></path><path d="M641.664 326.144a32 32 0 0 1 50.304 39.168l-3.52 4.48-306.112 328.064a32 32 0 0 1-50.304-39.168l3.52-4.48 306.112-328.064z"></path><path d="M324.608 337.088a32 32 0 0 1 40.704-5.12l4.48 3.584 328.064 306.112a32 32 0 0 1-39.168 50.304l-4.48-3.52-328.064-306.112a32 32 0 0 1-1.536-45.248z"></path></symbol>','<symbol id="outline-icon-circle-success" viewBox="0 0 1024 1024"><path d="M512 0C228.949333 0 0 228.949333 0 512s228.949333 512 512 512 512-228.949333 512-512S794.325333 0 512 0z m0 950.869333C269.909333 950.869333 73.130667 754.090667 73.130667 512 73.130667 269.909333 269.909333 73.130667 512 73.130667c242.090667 0 438.869333 196.778667 438.869333 438.869333 0 242.090667-196.778667 438.869333-438.869333 438.869333z"></path><path d="M737.834667 353.834667a42.666667 42.666667 0 0 1 63.872 56.32l-3.541334 4.010666L486.997333 725.333333a85.333333 85.333333 0 0 1-115.242666 4.992L366.336 725.333333l-140.501333-140.501333a42.666667 42.666667 0 0 1 56.32-63.872l4.010666 3.541333L426.666667 665.002667l311.168-311.168z"></path></symbol>','<symbol id="outline-icon-sound" viewBox="0 0 16 16"><path d="M12.757 4.708c-0.406 0.405-1.062 0.405-1.468 0s-0.405-1.062 0-1.468l2.935-2.935c0.406-0.405 1.062-0.405 1.468 0 0.405 0.405 0.405 1.062 0 1.468l-2.935 2.935zM7.996 15.991l-3.996-3.996h-2.997c-0.552 0-0.999-0.447-0.999-0.999v-5.994c0-0.552 0.447-0.999 0.999-0.999h2.997l3.996-3.996c0 0 0.999-0.125 0.999 0.999 0 5.976 0 14.966 0 13.985 0 1.124-0.999 0.999-0.999 0.999zM6.997 4.004l-1.998 1.998h-2.997v3.996h2.997l1.998 1.998v-7.992zM11.992 8.999c-0.552 0-0.999-0.447-0.999-0.999s0.447-0.999 0.999-0.999h2.997c0.552 0 0.999 0.447 0.999 0.999s-0.447 0.999-0.999 0.999h-2.997zM12.757 11.292l2.935 2.935c0.405 0.406 0.405 1.063 0 1.468s-1.062 0.405-1.468 0l-2.935-2.935c-0.405-0.406-0.405-1.063 0-1.468s1.062-0.405 1.468 0z"></path></symbol>'],I=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"icon";return o(t)?function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"icon";const s=/id="(.*?)"/,i=/^(\w+)-/;return R.find((r=>{const n=s.exec(r)[1];return i.exec(n)[1]===e&&n===("icon"===e?`${e}-${t}`:`${e}-icon-${t}`)}))}(t,e):[...R]},U=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const e=document.body;let s=document.querySelector("#outline-icons"),i=[];(t=>{if(!t)return!1;r(t)&&t.length>0?t.forEach((t=>{-1===R.indexOf(t)&&o(t)&&R.push(t)})):o(t)&&R.push(t)})(t),i=I(),s?s.innerHTML=i.join(""):(s=document.createElement("div"),s.innerHTML=`<svg id="outline-icons" aria-hidden="true" style="position:absolute;display:none;width:0;height:0;overflow:hidden;">${i.join("")}</svg>`,e.insertBefore(s.firstChild,e.firstChild))},B=e=>{return!(!i(e)||!(l(e)||(e=>!(!i(e)||"[object NodeList]"!==t(e)))(e)||(s=e,i(s)&&"[object DocumentFragment]"===t(s))||(e=>!(!i(e)||!("[object Text]"===t(e)||e.tagName&&3===e.nodeType)))(e)));var s},P=(t,e,s)=>{let i=t.tagName.toLowerCase();switch(e){case"style":t.style.cssText=s;break;case"value":"input"===i||"textarea"===i?t.value=s:t.setAttribute(e,s);break;case"htmlFor":t.setAttribute("for",s);break;case"className":t.className=s;break;case"innerHTML":t.innerHTML=s;break;case"innerText":t.innerText=s;break;default:t.setAttribute(e,s)}},V=(t,e)=>{if(!t||!i(e))return!1;Object.keys(e).forEach((s=>{const i=e[s];f(e,s)&&P(t,s,i)}))},W=(t,e,s)=>{const n=document.createDocumentFragment(),l=document.createElement(t),a=t=>B(t)||o(t),h=t=>{let e;if(!a(t))return!1;B(t)?e=t:o(t)&&(e=document.createTextNode(t)),n.appendChild(e)};return i(e)?V(l,e):r(e)&&e.every((t=>a(t)))?e.forEach((t=>{h(t)})):B(e)?h(e):o(e)&&h(document.createTextNode(e)),r(s)?s.forEach((t=>{h(t)})):h(s),l.appendChild(n),l},Q=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const s="outline-icon",i=e.size||0,n=e.color||"",l=e.iconSet||"",a=r(i)?i[0]:i,h=r(i)?i[1]:i,c=i?`width:${a}px;height:${h}px;`:"",d=n?c+`color:${n}`:c,u=e.attrs||{},m=document.createElement("i");let p,g="",f="";return o(t)?((t=>{const e=new RegExp("^\\s*(?:<\\?xml[^>]*>\\s*)?(?:<\\!doctype svg[^>]*\\s*(?:\\[?(?:\\s*<![^>]*>\\s*)*\\]?)*[^>]*>\\s*)?<svg[^>]*>[^]*<\\/svg>\\s*$\\s*$","i");return o(t)&&e.test(t)})(t)?f=t:(g=l&&"icon"!==l?`xlink:href="#${l}-icon-${t}"`:`xlink:href="#icon-${t}"`,f=`<svg><use ${g}></use></svg>`),m.innerHTML=f,u.className?u.className=`${s} ${u.className}`:u.className=s,V(m,u),p=m.querySelector("svg"),V(p,{"aria-hidden":!0,xmlns:"http://www.w3.org/2000/svg",class:"outline-icon__svg",width:200,height:200,style:d}),m):null},J=function(t){return Q(t,arguments.length>1&&void 0!==arguments[1]?arguments[1]:{})},Y=(t,e)=>{var s;let i,r=t.className;if(!r||!a(t,e))return!1;i=t.classList,null!==(s=i)&&void 0!==s&&s.remove?i.remove(e):(r=m(r.replace(e,"")),t.className=r)},G=function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i="outline-heading",r=t.innerHTML;let n;if(t.innerHTML=r.replace(/^\d+(\.?\d+)*\s?/gi,""),t.removeAttribute("id"),t.removeAttribute("data-id"),Y(t,i),!e)return!1;var l;n=t.querySelector(`.${i}__anchor`),s&&Y(t,`${i}_start`),l=m(t.className),o(l)&&""===l&&t.removeAttribute("class"),n&&t.removeChild(n)};class K extends E{constructor(t){super(),this._default(),t&&this.initialize(t)}_default(){return this.attrs=n(K.DEFAULTS),this.$articleElement=null,this.$scrollElement=null,this.$headings=[],this}initialize(t){let s,i,r,n;return this.attr(t),n=this.attr("articleElement"),i=this.attr("scrollElement"),s=this.attr("created"),o(n)?r=document.querySelector(n):l(n)&&(r=n),r?(this.$articleElement=r,this.$scrollElement=d(i),this.$headings=this.getHeadings(),this.$headings.length<1||(e(s)&&s.call(this),this.render().addListeners()),this):this}getHeadings(){const t=this.$articleElement,e=this.attr("selector");return[...t.querySelectorAll(e)]}count(){return this.getHeadings().length}render(){const t=this.attr("articleElement"),s=this.attr("selector"),i=this.attr("showCode")||!0,r=this.attr("chapterTextFilter"),n=this.attr("mounted"),o=g({articleElement:t,selector:s,showCode:i,chapterTextFilter:r});return U(),this._paint(o),e(n)&&n.call(this),this}erase(){return this._remove(),this}_paint(t){const e=400,s=this.attr("hasAnchor"),i=this.attr("isAtStart"),r=this.attr("showCode"),n=this.attr("anchorURL"),o=this.count(),l=[...this.$headings],a=(o,l)=>{o.forEach(((o,a)=>{const h=a+l*e,c=t[h].code;((t,e,s)=>{const i="outline-heading",r=s.hasAnchor||!0,n=s.isAtStart||!0,o=s.showCode||!1,l=s.chapterCode||"",a=s.anchorURL||"",h=`heading-${e}`,c={id:h,className:n?`${i} ${i}_start`:i,"data-id":e},d=m(t.innerHTML);let u,p;if(o&&(c.innerHTML=l+" "+d,c["data-code"]=l),V(t,c),!r)return!1;p=J("hash",{iconSet:"outline"}),u=W("a",{id:`anchor-${e}`,className:`${i}__anchor anchor-${e}`,href:a||`#${h}`,target:a?"_blank":"self","data-id":e},p),t.appendChild(u)})(o,h,{hasAnchor:s,isAtStart:i,showCode:r,chapterCode:c,anchorURL:n})}))};let h=-1;if(o>e)for(h+=1,a(l.splice(0,e),0);l.length>0;){const t=l.splice(0,e);k((()=>{a(t,h+=1)}),(()=>{this.$emit("anchors:all:paint")}))}else a(l,0);return this}_remove(){const t=this.attr("hasAnchor"),e=this.attr("isAtStart");return this.$headings.forEach((s=>{G(s,t,e)})),this}refresh(t){const e=this.attr("articleElement"),s=this.attr("selector"),i=this.attr("showCode")||!0,r=this.attr("chapterTextFilter");return this.$headings=this.getHeadings(),this.erase()._paint(t||g({articleElement:e,selector:s,showCode:i,chapterTextFilter:r})),this}scrollTo(t,e){const s=this.$scrollElement;return u(s,t,e),this}destroy(){const t=this.attr("beforeDestroy"),s=this.attr("afterDestroy");return e(t)&&t.call(this),this.removeListeners()._remove()._default(),e(s)&&s.call(this),this}onAnchorTrigger(t){const i=this.attr("anchorURL"),r=this.attr("afterScroll"),n=this.attr("stickyHeight"),o=t.delegateTarget.parentNode,l=M(o)-(n+10),a=this.$scrollElement,h=a.scrollHeight-a.clientHeight;return this.scrollTo(l,(()=>{e(r)&&r.call(this,"anchor"),s((()=>{this.$emit("toolbar:update",{top:l,min:0,max:h})}))})),i||j(t),this}addListeners(){const t=this.$articleElement;return this.count()<1||q(t,".outline-heading__anchor","click",this.onAnchorTrigger,this,!0),this}removeListeners(){const t=this.$articleElement;return this.count()<1||F(t,"click",this.onAnchorTrigger),this}}K.DEFAULTS=n({scrollElement:"html,body",articleElement:"#article",selector:"h1,h2,h3,h4,h5,h6",stickyHeight:0,anchorURL:"",hasAnchor:!0,isAtStart:!0,showCode:!1,created:null,mounted:null,afterScroll:null,beforeDestroy:null,afterDestroy:null,chapterTextFilter:null});const X=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","search","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],Z=t=>{let e,s,i;return!!o(t)&&(e=m(t).slice(0,1e3),s=/\s*<!doctype html>|<html\b[^>]*>|<body\b[^>]*>|<x-[^>]+>/i,i=new RegExp(X.map((t=>`<${t}\\b[^>]*>`)).join("|"),"i"),s.test(e)||i.test(e))},tt=t=>t.replace(/<script[^>]*>.*?<\/script>/gi,""),et=(t,e)=>{document.documentElement.style.setProperty(t,e)};let st=2e3;const it=t=>(t?st=t:st+=1,et("--outline-zIndex",`${st}`),st);class rt extends E{constructor(t){super(),this._default(),this.zIndex=0,t&&this.initialize(t)}_default(){return this.attrs=n(rt.DEFAULTS),this.title="",this.closed=!1,this.$el=null,this.$modal=null,this.$header=null,this.$title=null,this.$close=null,this.$main=null,this.$footer=null,this.$overlay=null,this}initialize(t){let s;return this.attr(t),this.title=this.attr("title"),s=this.attr("created"),e(s)&&s.call(this),this.render().addListeners(),this}setTitle(t){return this.attr("title",t),this.title=t,this.$title.innerHTML=t,this}isClosed(){return this.closed}render(){const t=this.attr("mounted"),s=this.attr("size"),i=this.attr("placement"),r=this.attr("hasClose"),n=this.attr("hasOverlay"),o=this.attr("hasOffset"),l=this.attr("hasPadding"),a=this.attr("autoHeight"),c=this.attr("overflow"),d=this.attr("customClass");let u,m,p,g,f,b,v,y,$="outline-drawer__main";return U(),this.zIndex=it(),g=W("h2",{className:"outline-drawer__title"},this.title),this.$title=g,r&&(f=W("div",{className:"outline-drawer__close"},J("close",{iconSet:"outline",size:20})),this.$close=f),p=W("header",{className:"outline-drawer__header"},[g,f]),this.$header=p,"hidden"===c&&($+=" overflow-hidden"),b=W("div",{className:$}),this.$main=b,l||h(b,"outline-drawer_full"),v=W("footer",{className:"outline-drawer__footer"}),this.$footer=v,m=W("div",{className:`outline-drawer__modal outline-drawer_${i} outline-drawer_${s} outline-drawer_closed`},[p,b,v]),this.$modal=m,o&&h(m,"outline-drawer_offset"),a&&h(m,"outline-drawer_auto"),d&&h(m,d),n&&(y=W("div",{className:"outline-drawer__overlay"}),this.$overlay=y),u=W("div",{className:"outline-drawer"},[m,y]),this.$el=u,document.body.appendChild(u),e(t)&&t.call(this),this}erase(){return this.$main.innerHTML="",this}_paint(t){let s=null;return e(t)?s=t():B(t)?s=t:Z(t)&&(s=((t,e)=>{const s=document.createDocumentFragment();if(!t||!Z(t)&&!o(t)&&!l(t))return null;if(Z(t)){const e=W("div");let i=[];return e.innerHTML=tt(t),i=[...e.childNodes],i.forEach((t=>{s.appendChild(t)})),s}if(!o(e))return t.innerHTML;t.innerHTML=tt(e)})(t)),s&&this.$main.appendChild(s),this}_remove(){return document.body.removeChild(this.$el),this}refresh(t){return this.erase()._paint(t),this}open(){const t=this.attr("afterOpened"),i=this.$modal;return h(this.$el,"outline-drawer_opened"),Y(i,"outline-drawer_closed"),h(i,"outline-drawer_opened"),s((()=>{this.closed=!1,e(t)&&t.call(this)})),this}close(){const t=this.attr("afterClosed"),i=this.$modal;return Y(i,"outline-drawer_opened"),h(i,"outline-drawer_closed"),s((()=>{Y(this.$el,"outline-drawer_opened"),this.closed=!0,e(t)&&t.call(this)})),this}toggle(){const t=this.attr("afterToggle"),i=this.isClosed();return i?this.open():this.close(),e(t)&&s((()=>{t.call(this,i)})),this}destroy(){const t=this.attr("afterDestroy"),s=this.attr("beforeDestroy");let i=this.zIndex;return e(s)&&s.call(this),this.removeListeners()._remove()._default(),i-=1,it(i),this.zIndex=0,e(t)&&t.call(this),this}onClose(){return this.close(),this}addListeners(){const t=this.attr("hasClose"),e=this.attr("hasOverlay"),s=this.attr("closeOnClickModal"),i=this.$el;return t&&q(i,".outline-drawer__close","click",this.onClose,this,!0),e&&s&&q(i,".outline-drawer__overlay","click",this.onClose,this,!0),this}removeListeners(){const t=this.attr("hasClose"),e=this.attr("hasOverlay"),s=this.$el;return t||e?(F(s,"click",this.onClose),this):this}}rt.DEFAULTS=n({placement:"rtl",title:"标题",size:"regular",hasClose:!0,hasOverlay:!0,hasOffset:!1,hasPadding:!0,autoHeight:!0,closeOnClickModal:!0,overflow:"auto",created:null,mounted:null,afterClosed:null,afterOpened:null,afterScroll:null,beforeDestroy:null,afterDestroy:null,afterToggle:null});const nt=function(t,s,i,r,n){let o=arguments.length>5&&void 0!==arguments[5]&&arguments[5];const l=H.indexOf(s)>-1,a=function(e){let l=n||t;!0===n&&(l=r),!0===o&&F(t,s,a),i.call(l,e,r)};if(!e(i))return!1;t._listeners||(t._listeners=[]),t._listeners.push({el:t,type:s,fn:a,data:r,context:n,capture:l}),i._delegateListener=a,t.addEventListener(s,a,l)},ot=(t,e)=>getComputedStyle(t)[e];class lt extends E{constructor(t){super(),this._default(),this.scrollTimer=null,this.resizeTimer=null,this.observerTimer=null,this.Observer=null,t&&this.initialize(t)}_default(){return this.attrs=n(lt.DEFAULTS),this.$el=null,this.$title=null,this.$main=null,this.$list=null,this.$placeholder=null,this.$parentElement=null,this.$scrollElement=null,this.$active=null,this.chapters=[],this.active=0,this.offsetWidth=0,this.offsetTop=0,this.playing=!1,this.closed=!1,this}initialize(t){let s,i,r,n;return this.attr(t),s=this.attr("created"),i=this.attr("parentElement"),r=this.attr("scrollElement"),o(i)?n=document.querySelector(i):l(i)&&(n=i),this.$parentElement=n,this.$scrollElement=d(r),this.chapters=this.attr("chapters"),this.closed=this.attr("closed"),this.active=this.attr("active"),e(s)&&s.call(this),this.chapters.length<1||(this.render().addListeners(),this.$active=document.querySelector(`#chapter-${this.active}`)),this}isClosed(){return this.closed}isSticky(){return"sticky"===this.attr("position")}isFixed(){return"fixed"===this.attr("position")}isInside(){return this.isFixed()||this.isSticky()}isOutside(){return!this.isInside()}count(){return this.chapters.length}_paintEdge(){const t=document.createDocumentFragment(),e=this.attr("title"),s=this.attr("animationCurrent"),i=this.attr("customClass"),r=this.$parentElement,n=[],o=[];let l,a,c,d,u=null;return r?(this.isInside()&&e&&(u=W("h2",{className:"outline-navigator__title"},e),this.$title=u,o.push(u)),c=W("ul",{className:"outline-navigator__list"}),this.$list=c,n.push(c),s&&(d=W("div",{className:"outline-navigator__placeholder"}),this.$placeholder=d,n.push(d)),a=W("div",{className:"outline-navigator__main"},n),this.$main=a,o.push(a),l=W("nav",{id:"outline-navigator",className:"outline-navigator outline-navigator_hidden"},o),this.$el=l,this.isSticky()&&(this.calculateStickyHeight(),h(l,"outline-navigator_sticky")),i&&h(l,i),t.appendChild(l),r.appendChild(t),this):this}render(){const t=this.attr("mounted"),i=this.$parentElement,r=this.chapters,n=this.count();let o;return!i||r.length<1||(this.isInside()&&h(i,"outline-navigator-parent"),this._paintEdge(),o=this.$el,this._paint(r),s((()=>{this.highlight(this.active)}),60),this.offsetTop=M(o),this.offsetWidth=o.offsetWidth,this.isFixed()&&(this.sticky(),et("--outline-navigator-width",`${this.offsetWidth}px`)),e(t)&&t.call(this),n<400&&this.onObserver()),this}erase(){return this.$list.innerHTML="",this}_paint(t){const e=this.attr("showCode"),s=this.$el;return function(t,e){let s=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const i=e.length,r=[...e],n=e=>{const i=e=>t.querySelector(`#${e}`);e.forEach((e=>{const r=e.pid,n=e.id,o=e.code,l=e.rel,a=[],h=W("span",{className:"outline-navigator__text"},e.text);let c,d,u,m,p;s&&(d=W("span",{className:"outline-navigator__code","data-id":n},e.code),a.push(d)),a.push(h),c=W("a",{id:`chapter__anchor-${n}`,className:"outline-navigator__anchor",href:"#"+l,rel:l,"data-id":n,"data-code":o},a),u=W("li",{id:`chapter-${n}`,className:"outline-navigator__item","data-id":n,"data-code":o},c),-1===r?t.appendChild(u):(p=i(`chapter-${r}`),m=i(`subject-${r}`),m?m.appendChild(u):(m=W("ul",{id:"subject-"+r,className:"outline-navigator__subject"},u),p.appendChild(m)))}))};if(i>400)for(n(r.splice(0,400));r.length>0;){const t=r.splice(0,400);k((()=>{n(t)}))}else n(r)}(this.$list,t,e),Y(s,"outline-navigator_hidden"),this}_remove(){return this.$parentElement.removeChild(this.$el),this}refresh(t){const e=this.$el;return Y(e,"outline-navigator_hidden"),this.erase()._paint(t),this}_getPlaceholderOffset(t){const e=this.$main,s=this.$list,i=s.querySelector(".outline-navigator__anchor"),r=parseInt(ot(e,"padding-top"),10),n=parseInt(ot(e,"border-top-width"),10),o=parseInt(ot(s,"padding-top"),10),l=parseInt(ot(s,"margin-top"),10),a=parseInt(ot(s,"border-top-width"),10);let h,c=0;return r&&(c+=r),o&&(c+=o),l&&(c+=l),n&&(c+=n),a&&(c+=a),h=i.offsetHeight*t,c+h}positionPlaceholder(t){const e=this.$list,s=this.$placeholder,i=e.querySelector(".outline-navigator__anchor"),r=this.attr("animationCurrent"),n=i.offsetHeight;let o=0;return r?(o=this._getPlaceholderOffset(t),s.style.cssText=`transform: translateY(${o}px);height:${n}px;`,this):this}highlight(t){const e=this.$el,i=this.attr("animationCurrent"),r="outline-navigator_active",n="outline-navigator_highlight";let o="relative"===this.attr("position")?this.$parentElement:this.$main,a=null,c=0;return e?(a=e.querySelector(`#chapter__anchor-${t}`),a?(this.active=parseInt(a.getAttribute("data-id"),10),this.$active&&(Y(this.$active,n),Y(this.$active,r)),this.$active=a,h(this.$active,r),i?this.positionPlaceholder(this.active):h(this.$active,n),s((()=>{((t,e)=>{let s,i,r=!1;return l(t)&&l(e)?(s=e.getBoundingClientRect(),i=t.getBoundingClientRect(),console.log("parentRect",s),console.log("childRect",i),r=!!(i.top>=s.top&&i.right<=s.right&&i.bottom<=s.bottom&&i.left>=s.left),console.log("isInBounding",r),r):r})(this.$active,o)||(c=this._getPlaceholderOffset(this.active),u(o,c))})),this):this):this}sticky(){const t=this.attr("afterSticky"),s="outline-navigator_fixed",i=this.$el,r=this.offsetTop,n=this.$scrollElement.scrollTop;let o;return this.isFixed()?(o=n>=r,o?h(i,s):Y(i,s),e(t)&&t.call(this,this.isClosed(),o),this):this}calculateStickyHeight(){const t=document.documentElement,e=Math.max(t.clientHeight||0,window.innerHeight||0);return et("--outline-sticky-height",`${e}px`),this}scrollTo(t,e){const s=this.$scrollElement;return u(s,t,e),this}show(){const t="outline-navigator_hidden",i=this.attr("afterOpened"),r=this.count(),n=this.$el,o=this.$parentElement;return this.isInside()?r>800?Y(o,t):(Y(o,t),s((()=>{Y(o,"outline-navigator_folded")}),30)):Y(n,t),this.closed=!1,e(i)&&i.call(this),this}hide(){const t="outline-navigator_hidden",i=this.attr("afterClosed"),r=this.count(),n=this.$el,o=this.$parentElement;return this.isInside()?r>800?h(o,t):(h(o,"outline-navigator_folded"),s((()=>{h(o,t)}))):h(n,t),this.closed=!0,e(i)&&i.call(this),this}toggle(){const t=this.attr("afterToggle"),i=this.offsetTop,r=this.$scrollElement.scrollTop;let n;return this.isClosed()?this.show():this.hide(),e(t)&&s((()=>{n=r>=i,t.call(this,this.isClosed(),n)})),this}destroy(){const t=this.attr("beforeDestroy"),s=this.attr("afterDestroy");return e(t)&&t.call(this),this.removeListeners()._remove()._default(),this.scrollTimer&&(clearTimeout(this.scrollTimer),this.scrollTimer=null),this.resizeTimer&&(clearTimeout(this.resizeTimer),this.resizeTimer=null),this.observerTimer&&(clearTimeout(this.observerTimer),this.observerTimer=null),this.Observer&&(this.Observer=null),e(s)&&s.call(this),this}onObserver(){const t=this.attr("selector");return this.Observer=function(t){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const i=s.root||null,r=s.selector||".outline-heading",n=s.context||null,o={rootMargin:s.rootMargin||"0px 0px -90% 0px"},a=new IntersectionObserver((s=>{s.forEach((s=>{s.intersectionRatio>0&&e(t)&&t.call(n||s.target,s.target)}))}),o),h=l(i)?i:document;return i&&(o.root=i),h.querySelectorAll(r).forEach((t=>{a.observe(t)})),a}((t=>{const e=t.getAttribute("data-id");if(this.playing)return!1;this.observerTimer&&clearTimeout(this.observerTimer),this.observerTimer=s((()=>{this.highlight(e)}),100)}),{selector:t,context:this}),this}onSelect(t){const i=this.attr("stickyHeight"),r=t.delegateTarget,n=r.getAttribute("data-id"),o=r.href.split("#")[1],l=document.querySelector(`#${o}`),a=M(l)-(i+10),h=this.$scrollElement.scrollHeight,c=this.attr("afterScroll"),d=()=>{e(c)&&c.call(this,"chapter"),s((()=>{this.playing=!1,this.$emit("toolbar:update",{top:a,min:0,max:h})}))};return this.playing=!0,this.isFixed()?(this.sticky(),s((()=>{this.scrollTo(a,d),this.highlight(n)}),10)):(this.scrollTo(a,d),this.highlight(n)),j(t),this}onScroll(){const t=this.$scrollElement;return this.scrollTimer&&clearTimeout(this.scrollTimer),this.scrollTimer=s((()=>{const e=t.scrollTop,s=t.scrollHeight-t.clientHeight;this.isFixed()&&this.sticky(),this.$emit("toolbar:update",{top:e,min:0,max:s})}),100),this}onResize(){return this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=s((()=>{this.calculateStickyHeight()})),this}addListeners(){const t=this.$el,e=this.$scrollElement,s=e.tagName.toLowerCase();let i=e;return this.count()<1||("html"!==s&&"body"!==s||(i=window),q(t,".outline-navigator__anchor","click",this.onSelect,this,!0),nt(i,"scroll",this.onScroll,this,!0),this.isSticky()&&nt(window,"resize",this.onResize,this,!0),this.$on("anchors:all:paint",this.onObserver,this)),this}removeListeners(){const t=this.attr("selector"),e=this.$el,s=this.$scrollElement,i=s.tagName.toLowerCase();let r=s;return this.count()<1||("html"!==i&&"body"!==i||(r=window),F(e,"click",this.onSelect),F(r,"scroll",this.onScroll),this.isSticky()&&F(window,"resize",this.onResize),this.$off("anchors:all:paint"),this.Observer&&document.querySelectorAll(t).forEach((t=>{this.Observer.unobserve(t)}))),this}}lt.DEFAULTS=n({parentElement:"",scrollElement:"",selector:".outline-heading",active:0,closed:!1,showCode:!0,animationCurrent:!0,position:"relative",stickyHeight:0,chapters:[],created:null,mounted:null,afterClosed:null,afterOpened:null,afterScroll:null,beforeDestroy:null,afterDestroy:null,afterSticky:null});const at=t=>{const e=Object.getPrototypeOf;let s;if(!(t=>i(t)&&null!==t)(t))return!1;if(s=t.prototype,!s)return!0;for(s=t;null!==e(s);)s=e(s);return e(t)===s},ht=t=>{const e={"&":"&","<":"<",">":">","'":"'",'"':"""};return t.replace(/[&<>'"]/g,(t=>e[t]||t))},ct=[];let dt;U();class ut extends E{constructor(t){super(),this._default(),t&&this.initialize(t)}_default(){return this.attrs=n(ut.DEFAULTS),this.$el=null,this.id="",this.closed=!1,this.visible=!1,this.offset=-50,this.timer=null,this.destroyed=!1,this}initialize(t){return this.attr(t),this.id=this.attr("id"),this.offset=this.attr("offset")||-50,this.$emit("created",{...this.attr()}),this.render().addListeners(),this.attr("visible")&&this.open(),this}isClosed(){return this.closed}isDestroyed(){return this.destroyed}_getClassName(){const t=this.attr("type"),e=this.attr("effect"),s=this.attr("round"),i=this.attr("closable"),r=this.attr("visible"),n=this.attr("customClass"),o=["outline-message",`outline-message_${t}`,`outline-message_${e}`];return s&&o.push("outline-message_round"),i||o.push("outline-message_full-width"),r&&o.push("outline-message_visible"),n&&o.push(n),o}render(){const t=this.attr("type"),e=this.attr("message"),s=this.attr("effect"),i=this.attr("round"),r=this.attr("closable"),n=this.attr("dangerouslyUseHTMLString"),o=this._getClassName(),l=[];let a,c,d,u,m,p=20;return i&&"default"===s&&(p=12),"plain"!==s&&(a=J("light"===s?`circle-${t}`:t,{iconSet:"outline",size:p}),h(a,"outline-message__icon"),l.push(a)),n?(d=document.createDocumentFragment(),d.innerHTML=e):d=document.createTextNode(ht(tt(e))),c=W("p",{className:"outline-message__content"},[d]),l.push(c),r&&(u=J("close",{iconSet:"outline",size:18}),h(u,"outline-message__close"),l.push(u)),m=W("div",{className:o.join(" ")},l),m.style.cssText="top:-50px;",this.$el=m,document.body.appendChild(this.$el),this.$emit("mounted"),this}_refreshIcon(){const t=".outline-message_hidden",e=this.$el;let s,i,r,n,o,l,a,c=20;return this.isDestroyed()?this:(o=e.querySelector(".outline-icon"),o?(s=this.attr("type"),i=this.attr("effect"),r=this.attr("round"),"plain"===i?h(o,t):(Y(o,t),r&&"default"===i&&(c=12)),l=o.querySelector(".outline-icon__svg"),V(l,{style:`width:${c}px;height:${c}px;`}),a=l.querySelector("use"),n="light"===i?`circle-${s}`:s,P(a,"xlink:href",`#outline-icon-${n}`),this):this)}_refreshMessage(){const t=this.$el;let e,s,i,r;return this.isDestroyed()||(e=t.querySelector(".outline-message__content"),s=this.attr("dangerouslyUseHTMLString"),i=this.attr("message"),r=s?i:ht(tt(i)),e.innerHTML=r),this}_refreshClose(){const t=".outline-message_hidden",e=this.$el;let s,i;return this.isDestroyed()||(s=e.querySelector(".outline-message__close"),i=this.attr("closable"),s&&(i?h(s,t):Y(s,t))),this}_refreshEl(){const t=this.$el;let e;return this.isDestroyed()||(e=this._getClassName(),P(t,"className",e.join(" "))),this}refresh(t){return at(t)?(this.attr(t)._refreshIcon()._refreshMessage()._refreshClose()._refreshEl(),this):this}clearTimer(){return this.isDestroyed()||this.timer&&(clearTimeout(this.timer),this.timer=null),this}startTimer(t){return this.isDestroyed()||(this.timer=s((()=>{this.$emit("opened"),this.close()}),1e3*t)),this}open(t){const e=this.$el;let i,r,n,o;return this.isDestroyed()||(this.isClosed()&&this.refresh(t),i=this.attr("offset"),r=this.attr("duration"),n=i&&i>=this.offset?i:this.offset,o=`top:${n}px;`,this.clearTimer(),this.$emit("beforeOpen"),s((()=>{this.visible=!0,h(e,"outline-message_visible"),e.style.cssText=o,r>0&&this.startTimer(r)}),100)),this}close(){const t=this.$el;let i,r;return this.isDestroyed()||(i=this.attr("destroyAfterClosed"),r=this.attr("beforeClose"),e(r)&&r.call(this),t.style.cssText="top:-50px;",Y(t,"outline-message_visible"),this.visible=!1,this.closed=!0,s((()=>{this.$emit("closed"),i&&this.destroy()}),500)),this}destroy(){return this.$emit("beforeDestroy"),this.isDestroyed()||(this.removeListeners(),document.body.removeChild(this.$el),clearTimeout(this.timer),this._default(),this.$emit("afterDestroy")),this}onMouseEnter(){return this.clearTimer(),this}onMouseLeave(){const t=this.attr("duration"),e=this.attr("delay");return t<=0||this.startTimer(e),this}onClose(){return this.clearTimer(),this.close(),this}addListeners(){const t=this.$el;return q(t,".outline-message__content","mouseenter",this.onMouseEnter,this,!0),q(t,".outline-message__content","mouseleave",this.onMouseLeave,this,!0),q(t,".outline-message__close","click",this.onClose,this,!0),this}removeListeners(){const t=this.$el;return F(t,"mouseenter",this.onMouseEnter),F(t,"mouseleave",this.onMouseLeave),F(t,"click",this.onClose),this}}ut.DEFAULTS=n({id:"",type:"info",effect:"default",round:!1,offset:30,duration:3,delay:2,message:"",customClass:"",closable:!0,visible:!0,dangerouslyUseHTMLString:!1,destroyAfterClosed:!0,beforeClose:null}),["info","success","warning","error"].forEach((t=>{ut[t]=e=>{const s={},i=x("outline-message-"),r=e.beforeClose||null;let n=e.offset||30;return o(e)?s.message=e:at(e)&&b(s,e),s.id=i,s.type=t,s.offset=n,s.visible=!1,s.beforeClose=()=>{ut.close(i,r)},dt=new ut(s),ct.forEach((t=>{n+=t.$el.offsetHeight+16})),dt.offset=n,dt.open(),ct.push(dt),dt}})),ut.close=(t,s)=>{const i=ct.length;let r,n,o=-1;if(ct.forEach(((i,r)=>{t===i.id&&(n=i.$el.offsetHeight,o=r,e(s)&&s.call(i),ct.splice(r,1))})),i<=1||-1===o||o>ct.length-1)return!1;for(r=o;r<i-1;r+=1){const t=ct[r].$el;t.style.top=parseInt(t.style.top,10)-n-16+"px"}},ut.clear=()=>{let t=ct.length-1;for(;t>=0;t-=1)ct[t].close()};class mt{constructor(t,s){this.name=t,e(s)&&(this.action=s)}execute(){return this.action(),this}}class pt{constructor(){this.commands=[]}get(t){return this.commands.find((e=>e.name===t))}add(t){return this.commands.push(t),this}del(t){const e=this.commands,s=e.find((e=>e.name===t)),i=s?e.indexOf(s):-1;return i>-1&&e.splice(i,1),this}clear(){return this.commands=[],this}execute(t){const s=this.commands.find((e=>e.name===t));return e(null==s?void 0:s.execute)&&s.execute(),this}}const gt=function(t){let e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];const s=J(t.icon,{iconSet:t.iconSet||"outline",color:t.color||"",size:t.size}),i=W("a",{className:"outline-toolbar__anchor",href:t.link},s),r=W("div",{className:`outline-toolbar__button ${t.name}`,"data-cmd":t.name},[t.link?i:s]);return h(s,"outline-toolbar__icon"),e&&h(r,"outline-toolbar_rounded"),t.disabled&&h(r,"outline-toolbar_disabled"),r},ft="outline-toolbar_disabled",bt="outline-toolbar_hidden";class vt extends E{constructor(t){super(),this._default(),t&&this.initialize(t)}_default(){return this.attrs=n(vt.DEFAULTS),this.disabled=!1,this.closed=!1,this.$el=null,this.buttons=[],this.commands=null,this}initialize(t){let s;return this.attr(t),this.disabled=this.attr("disabled"),this.closed=this.attr("closed"),this.commands=new pt,s=this.attr("created"),e(s)&&s.call(this),this.render().addListeners(),this}isDisabled(t){let e;return t?(e=this.get(t),e.disabled):this.disabled}isExist(t){return!!this.get(t)}isClosed(){return this.closed}_getCommand(t){const s=this,{action:i,name:r}=t;let n,l,a=null,h=null;return i?(h=i.handler,n=i.context||this,e(h)?l=h:o(h)&&(l=function(){s.$emit(h,r)}),e(l)&&(a=new mt(r,l.bind(n))),a):a}get(t){return this.buttons.find((e=>e.name===t))}render(){const t=this.attr("mounted"),s=this.attr("buttons")||[],i=this.attr("placement");return U(),this.$el=W("div",{id:x("outline-toolbar"),className:`outline-toolbar outline-toolbar_${i}`}),this._paint(s),document.body.appendChild(this.$el),this.closed&&this.hide(),this.disabled&&this.disable(),e(t)&&t.call(this),this}erase(){return this.$el.innerHTML="",this}_paint(t){const e=this.attr("rounded"),s=document.createDocumentFragment();return t.forEach((t=>{const i=gt(t,e),r=this._getCommand(t),{name:n,disabled:o,context:l}=t;s.appendChild(i),this.isExist(n)||(this.buttons.push({$el:i,name:n,disabled:o||!1,context:l||this}),r&&this.commands.add(r))})),this.$el.appendChild(s),this}_remove(){return document.body.removeChild(this.$el),this}refresh(t){return this.attr({buttons:t}),this.erase()._paint(t),this}add(t){const e=this.$el,s=document.createDocumentFragment(),n=this.attr("buttons")||[],{name:o,disabled:l,context:a}=t,h=this._getCommand(t),c=t=>{const e=gt(t);s.appendChild(e),n.push(t),this.buttons.push({$el:e,name:o,disabled:l||!1,context:a||this,command:h}),h&&this.commands.add(h)};return i(t)?c(t):r(t)&&t.forEach((t=>{i(t)&&c(t)})),e.appendChild(s),this}remove(t){const e=this.$el,s=this.buttons,i=this.get(t);let r=-1;return i?(r=s.indexOf(i),r>-1&&(s.splice(r,1),this.attrs("buttons").splice(r,1)),this._disable(t),e.removeChild(i.$el),this):this}_disable(t){const e=this.get(t),s=this.commands.get(t);return!e||e.disabled||(e.disabled=!0,s&&this.commands.del(s),h(e.$el,ft)),this}_enable(t){const e=this.get(t),s=this.commands.get(t);return e&&e.disabled?(e.disabled=!1,s&&this.commands.add(s),Y(e.$el,ft),this):this}disable(t){const s=this.attr("afterDisabled");return t?this._disable(t):(h(this.$el,ft),this.removeListeners(),this.disabled=!0,e(s)&&s.call(this)),this}enable(t){const s=this.attr("afterEnabled");return t?this._enable(t):(this.disabled=!1,Y(this.$el,ft),this.addListeners(),e(s)&&s.call(this)),this}show(t){const i=this.attr("afterOpened"),r=this.get(t),n=this.$el;if(t){if(!r)return this;Y(r.$el,bt)}else Y(n,bt),this.closed=!1,e(i)&&s((()=>{i.call(this)}),310);return this}hide(t){const i=this.attr("afterClosed"),r=this.get(t),n=this.$el;if(t){if(!r)return this;h(r.$el,bt)}else h(n,bt),this.closed=!0,e(i)&&s((()=>{i.call(this)}),310);return this}toggle(t){return this.isClosed()?this.show(t):this.hide(t),this}highlight(t){const e=this.get(t),s="outline-toolbar_active";let i;return e?(i=e.$el,a(i,s)?Y(i,s):h(i,s),this):this}destroy(){const t=this.attr("beforeDestroy"),s=this.attr("afterDestroy");return e(t)&&t.call(this),this.commands.clear(),this.removeListeners()._remove()._default(),e(s)&&s.call(this),this}execute(t){return this.isDisabled(t)||this.commands.execute(t),this}onExecute(t){const e=t.delegateTarget;let s="";return e&&(s=e.getAttribute("data-cmd"),s&&this.execute(s)),this}addListeners(){const t=this.attr("buttons")||[],e=this.$el;return!t||t.length<1||q(e,".outline-toolbar__button","click",this.onExecute,this,!0),this}removeListeners(){const t=this.attr("buttons")||[],e=this.$el;return!t||t.length<1||F(e,".outline-toolbar__button",this.onExecute),this}}vt.DEFAULTS=n({placement:"ltr",closed:!1,disabled:!1,rounded:!0,buttons:[],created:null,mounted:null,afterClosed:null,afterOpened:null,afterDisabled:null,afterEnabled:null,beforeDestroy:null,afterDestroy:null});class yt{constructor(t){this.utterance=new SpeechSynthesisUtterance,t&&this.initialize(t)}_initialize(t){return t.lang&&this.setLang(t.lang),t.pitch&&this.setPitch(t.pitch),t.rate&&this.setRate(t.rate),t.text&&this.setText(t.text),t.voice&&this.setVoice(t.voice),t.volume&&this.setVolume(t.volume),this}initialize(t){return this._initialize(t)._addListeners(),this}isSpeaking(){return speechSynthesis.speaking}isPending(){return speechSynthesis.pending}isPaused(){return speechSynthesis.paused}getVoices(){return speechSynthesis.getVoices()}setLang(t){return this.utterance.lang=t,this}setPitch(t){return this.utterance.pitch=t,this}setRate(t){return this.utterance.rate=t,this}setText(t){return this.utterance.text=t,this}setVoice(t){return this.utterance.voice=t,this}setVolume(t){return this.utterance.volume=t,this}speak(t){return t&&this.setText(t),speechSynthesis.speak(this.utterance),this}pause(){return speechSynthesis.pause(),this}resume(){return speechSynthesis.resume(),this}cancel(){return speechSynthesis.cancel(),this.setText(""),this}_addListeners(){const t=this.utterance,e=this;return["boundary","end","error","start","mark","pause","resume"].forEach((s=>{t[`on${s}`]=t=>{_(s,{event:t,speech:e})}})),speechSynthesis.onvoiceschanged=t=>{_("voiceschanged",{event:t,speech:e})},this}}yt.isSupport="speechSynthesis"in window;const $t=(t,e)=>{let s,i=t;for(;i;)s=i.tagName.toLowerCase(),"script"!==s&&"style"!==s&&h(i,"outline-reader_sibling"),i=e?i.previousElementSibling:i.nextElementSibling},_t="进入阅读模式,按 ESC 键可退出阅读模式";class xt extends E{constructor(t){super(),this._default(),t&&this.initialize(t)}_default(){return this.attrs=n(xt.DEFAULTS),this.reading=!1,this.$target=null,this.$paper=null,this.$title=null,this.$article=null,this.$progress=null,this.toolbar=null,this.speech=null,this}initialize(t){let e=null;return this.attr(t),e=this.attr("target"),o(e)?this.$target=document.querySelector(e):l(e)&&(this.$target=e),this.$target?(yt.isSupport&&(this.speech=new yt),this.render().addListeners(),this):this}isSpeaking(){var t;return null==this||null===(t=this.speech)||void 0===t?void 0:t.isSpeaking()}render(){return this._renderEdge()._paint(this.$target),this}erase(){return this.$article.innerHTML="",this}_paint(t){const e=document.createDocumentFragment(),i=[...t.cloneNode(!0).children];return s((()=>{i.forEach((t=>{e.appendChild(t)})),this.$article.appendChild(e)})),this}_remove(){const t=this.$paper,e=this.toolbar;return t&&document.body.removeChild(t),e&&e.destroy(),this}refresh(){return this.erase()._paint(this.$target),this}_renderEdge(){const t=this.$target;let e,i,r,n,o,a=this.attr("title");i=t.querySelector("h1"),l(a)&&(i=a),l(i)&&(a=i.innerText),i=W("h1",{className:"outline-reader__title"},a),this.$title=i,r=W("article",{id:"outline-reader__article",className:"outline-reader__article"}),this.$article=r,n=W("div",{className:"outline-reader__progress"}),this.$progress=n;const h=[];return yt.isSupport&&this.attr("allowSpeak")&&h.push({name:"speak",icon:"sound",size:20,action:{context:this,handler:this.speak}}),h.push({name:"print",icon:"print",size:20,action:{context:this,handler:this.print}},{name:"exit",icon:"close",size:20,action:{context:this,handler:this.exit}}),this.toolbar=new vt({placement:"rtl",buttons:h}),e=W("section",{id:"outline-reader",className:"outline-reader outline-reader_hidden"},[n,i,r,this.toolbar.$el]),this.$paper=e,document.body.appendChild(e),s((()=>{o=e.previousElementSibling,$t(o,!0),o=e.nextElementSibling,$t(o)})),this}enter(){const t="outline-reader",e=`${t}--reading`,s=`${t}_hidden`,i=this.$paper,r=document.querySelectorAll(".outline-reader_sibling"),n=this.attr("enterReadingTip")||_t;return this.reading||!i||(r.forEach((t=>{h(t,s)})),h(i,e),Y(i,s),this.toolbar.show(),this.reading=!0,ut.info({round:!0,message:n}),this.$emit("enterReading")),this}exit(){const t="outline-reader",e=`${t}--reading`,s=`${t}_hidden`,i=this.$paper,r=document.querySelectorAll(".outline-reader_sibling");return this.reading&&i?(h(i,s),Y(i,e),r.forEach((t=>{Y(t,s)})),this.toolbar.hide(),this.reading=!1,this.$emit("exitReading"),this):this}toggle(){return this.reading?this.exit():this.enter(),this}speak(){const t=this.$article.innerText,e=this.speech;return yt.isSupport?(this.toolbar.highlight("speak"),this.isSpeaking()?e.cancel():e.speak(t),this):this}print(){return e(print)?(print(),this):this}destroy(){return this.$paper?(this.removeListeners()._remove()._default(),this):this}onPrint(){return this.print(),this}onEnterReading(){return this.toggle(),this}onExitReading(t){return 27===t.keyCode&&this.reading&&(this.toggle(),j(t)),this}addListeners(){return this.$paper?(nt(document,"keyup",this.onExitReading,this,!0),this.$on("toolbar:action:print",this.onPrint),this.$on("toolbar:action:reading",this.onEnterReading),this):this}removeListeners(){return this.$paper?(F(document,"keyup",this.onExitReading),this.$off("toolbar:action:print"),this.$off("toolbar:action:reading"),this):this}}var Tt;xt.DEFAULTS=n({target:"",title:"",enterReadingTip:_t,allowSpeak:!1});class wt extends E{constructor(t){super(),this._default(),t&&this.initialize(t)}_default(){const t=wt.DEFAULTS;return this.attrs=n(t),this.$article=null,this.$scrollElement=null,this.buttons=[],this.anchors=null,this.drawer=null,this.navigator=null,this.reader=null,this.toolbar=null,this}initialize(t){let e="",s="",i=null;return this.attr(t),e=this.attr("articleElement"),s=this.attr("scrollElement"),o(e)?i=document.querySelector(e):l(e)&&(i=e),this.$article=i,this.$scrollElement=d(s),this.$emit("created",{...this.attr()}),this.render().addListeners(),this}getChapters(){let t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const e=this.$article,s=this.attr("selector"),i=this.attr("showCode")||!0,r=this.attr("chapterTextFilter");return g({articleElement:e,selector:s,showCode:i,chapterTextFilter:r,isTreeStructured:t})}count(){return this.getChapters().length}render(){const t=this.attr("hasToolbar"),e=this.$scrollElement;return this._renderReader()._renderAnchors()._renderNavigator()._renderToolbar(),e&&t&&this._updateToolbar({top:e.scrollTop,min:0,max:e.scrollHeight}),this.$emit("mounted"),this}refresh(){const t=this.getChapters();return this.anchors.refresh(t),this.navigator.refresh(t),this.reader.refresh(),this}_renderReader(){const t=this.attr("reader");return t.target?(h(this.$article,"outline-article"),this.reader=new xt(t),this):this}_renderAnchors(){const t=this.attr("articleElement"),e=this.attr("selector"),s=this.attr("stickyHeight"),i=this.attr("scrollElement"),r=this.attr("showCode"),n=this.attr("anchorURL"),o=this.attr("afterScroll"),l=this.attr("chapterTextFilter");return this.anchors=new K({articleElement:t,stickyHeight:s,scrollElement:i,selector:e,showCode:r,anchorURL:n,afterScroll:o,chapterTextFilter:l}),this}_renderNavigator(){const t=this.attr("title"),e=this.attr("stickyHeight"),s=this.attr("scrollElement"),i=this.attr("customClass"),r=this.attr("showCode"),n=this.attr("animationCurrent"),o=this.attr("closeOnClickModal"),l=this.attr("showNavModalFirst"),a=this.attr("position"),h=this.attr("placement"),c=this.attr("afterSticky"),d=this.attr("afterToggle"),u=this.attr("afterScroll"),m=this.count();let p,g=this.attr("parentElement");return m<1||(p={scrollElement:s,showCode:r,animationCurrent:n,position:a,title:t,stickyHeight:e,chapters:this.getChapters(),afterSticky:c,afterToggle:d,afterScroll:u},"relative"===a?(this.drawer=new rt({placement:h,title:t,size:"tiny",hasOffset:!0,hasPadding:!1,closeOnClickModal:o,customClass:i,afterClosed:()=>{this.toolbar.toggle()}}),g=this.drawer.$main,l&&this.drawer.open()):p.customClass=i,p.parentElement=g,this.navigator=new lt(p)),this}_renderToolbar(){const t=this.attr("position"),s=this.attr("hasToolbar"),i=this.attr("showNavModalFirst"),r=this.attr("placement"),n=this.attr("homepage"),o=this.attr("git"),l=this.attr("tags"),a=this.attr("issues"),h=this.attr("tools"),c=this.attr("reader"),d=this.count(),u={name:"up",icon:"up",size:20,action:{context:this,handler:this.toTop}},m={name:"homepage",icon:"homepage",size:20,link:n},p={name:"github",icon:"github",size:20,link:o},g={name:"tags",icon:"tags",size:20,link:l},f={name:"issues",icon:"issues",size:20,link:a},b={name:"toggle",icon:"menu",size:18,action:{context:this,handler:this.toggle}},v={name:"reading",icon:"file",size:18,action:{context:this,handler:"toolbar:action:reading"}},y={name:"print",icon:"print",size:20,action:{handler:"toolbar:action:print"}},$={name:"down",icon:"down",size:20,action:{context:this,handler:this.toBottom}},_=[];return s?(_.push(u),d>0&&_.push(b),n&&_.push(m),o&&_.push(p),l&&_.push(g),a&&_.push(f),c.target&&(_.push(v),e(print)&&_.push(y)),(null==h?void 0:h.length)>0&&_.push(...h),_.push($),this.buttons=[..._],this.toolbar=new vt({placement:r,buttons:_}),"relative"===t&&i&&this.toolbar.hide(),this):this}addButton(t){const e=this.toolbar,s=this.buttons;return s.splice(-1,0,t),e.attr({buttons:s}),e.refresh(),this}removeButton(t){return this.toolbar.remove(t),this}_updateToolbar(t){let{top:e,min:s,max:i}=t;const r=this.toolbar,n=Math.ceil(e);return n<=s?(r.hide("up"),r.show("down")):n>=i?(r.hide("down"),r.show("up")):n>s&&n<i&&(r.show("up"),r.show("down")),this}toTop(){const t=this.attr("afterScroll"),s=this.toolbar,i=this.navigator,r=this.count();return r>0&&(i.playing=!0),this.scrollTo(0,(()=>{s.hide("up"),s.show("down"),r>0&&(i.highlight(0),i.playing=!1,u(i.$main,0)),e(t)&&t.call(s,"up")})),this}toBottom(){const t=this.attr("afterScroll"),s=this.$scrollElement,i=this.toolbar,r=this.navigator,n=this.count(),o=Math.floor(s.scrollHeight-s.clientHeight);return n>0&&(r.playing=!0),this.scrollTo(o,(()=>{const s=r.$main;i.hide("down"),i.show("up"),n>0&&(r.highlight(n-1),u(s,s.scrollHeight),r.playing=!1),e(t)&&t.call(i,"bottom")})),this}scrollTo(t,e){return u(this.$scrollElement,t,e),this}enterReading(){const t=this.reader;return!t||t.reading||(this.toolbar.toggle(),t.enter()),this}exitReading(){const t=this.reader;return t&&t.reading?(this.toolbar.toggle(),t.exit(),this):this}switchReading(){const t=this.reader;return t?(t.toggle(),this):this}toggle(){const t=this.attr("position"),e=this.toolbar,i=this.drawer,r=this.navigator;return this.count()<1||("relative"!==t?(r.toggle(),e.highlight("toggle")):(e.toggle(),s((()=>{i.toggle()})))),this}print(){return this.reader.print(),this}_destroy(){const t=this.count();let e=this.anchors,s=this.navigator,i=this.drawer,r=this.reader,n=this.toolbar,o=!1;return this.removeListeners(),r&&r.destroy(),t>0&&s&&(o=s.isOutside(),s.destroy(),o&&i&&i.destroy()),e&&e.destroy(),n&&n.destroy(),this}destroy(){return this.$emit("beforeDestroy"),this._destroy()._default(),this.$emit("destroyed"),this}onToolbarUpdate(t){let{top:e,min:s,max:i}=t;return this._updateToolbar({top:e,min:s,max:i}),this}addListeners(){return this.attr("hasToolbar")?(this.$on("toolbar:update",this.onToolbarUpdate),this):this}removeListeners(){return this.attr("hasToolbar")?(this.$off("toolbar:update"),this):this}}if(wt.DEFAULTS=n({articleElement:"#article",selector:"h2,h3,h4,h5,h6",parentElement:"#aside",scrollElement:"html,body",title:"目录",position:"relative",placement:"rtl",animationCurrent:!0,showCode:!0,hasToolbar:!0,closeOnClickModal:!0,showNavModalFirst:!1,anchorURL:"",stickyHeight:0,homepage:"",git:"",tags:"",issues:"",tools:[],reader:{target:"",title:"",enterReadingTip:"进入阅读模式,按 ESC 键可退出阅读模式",allowSpeak:!1},customClass:"",afterSticky:null,afterToggle:null,afterScroll:null,chapterTextFilter:null}),null!==(Tt=window)&&void 0!==Tt&&Tt.jQuery){const t=window.jQuery;t.extend(t.fn,{outline:function(e){let s=t(this);return new wt(t.extend({},e,{articleElement:s}))}})}return wt}));
//# sourceMappingURL=outline.min.js.map
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。