typedoc-theme-oxide 0.2.2 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index.css +86 -1
- package/dist/assets/index.css.map +1 -1
- package/dist/assets/index.js +4182 -33
- package/dist/assets/index.js.map +1 -1
- package/dist/plugin/index.js +0 -54
- package/dist/plugin/index.js.map +1 -1
- package/dist/plugin/theme.js +56 -1
- package/dist/plugin/theme.js.map +1 -1
- package/package.json +2 -1
package/dist/assets/index.js
CHANGED
|
@@ -1,78 +1,4227 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
(function () {
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
5
|
+
/******************************************************************************
|
|
6
|
+
Copyright (c) Microsoft Corporation.
|
|
7
|
+
|
|
8
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
9
|
+
purpose with or without fee is hereby granted.
|
|
10
|
+
|
|
11
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
12
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
13
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
14
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
15
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
16
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
17
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
***************************************************************************** */
|
|
19
|
+
/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
function __esDecorate$4(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
23
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
24
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
25
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
26
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
27
|
+
var _, done = false;
|
|
28
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
29
|
+
var context = {};
|
|
30
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
31
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
32
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
33
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
34
|
+
if (kind === "accessor") {
|
|
35
|
+
if (result === void 0) continue;
|
|
36
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
37
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
38
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
39
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
40
|
+
}
|
|
41
|
+
else if (_ = accept(result)) {
|
|
42
|
+
if (kind === "field") initializers.unshift(_);
|
|
43
|
+
else descriptor[key] = _;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
47
|
+
done = true;
|
|
48
|
+
}
|
|
49
|
+
function __runInitializers$4(thisArg, initializers, value) {
|
|
50
|
+
var useValue = arguments.length > 2;
|
|
51
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
52
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
53
|
+
}
|
|
54
|
+
return useValue ? value : void 0;
|
|
55
|
+
}
|
|
56
|
+
typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
|
|
57
|
+
var e = new Error(message);
|
|
58
|
+
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/**
|
|
3
62
|
* @license
|
|
4
63
|
* Copyright 2019 Google LLC
|
|
5
64
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
6
65
|
*/
|
|
7
|
-
const
|
|
8
|
-
|
|
66
|
+
const t$2=globalThis,e$2=t$2.ShadowRoot&&(void 0===t$2.ShadyCSS||t$2.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$2=Symbol(),o$5=new WeakMap;let n$3 = class n{constructor(t,e,o){if(this._$cssResult$=true,o!==s$2)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$2&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$5.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$5.set(s,t));}return t}toString(){return this.cssText}};const r$3=t=>new n$3("string"==typeof t?t:t+"",void 0,s$2),S$2=(s,o)=>{if(e$2)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$2.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$2=e$2?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$3(e)})(t):t;
|
|
67
|
+
|
|
68
|
+
/**
|
|
9
69
|
* @license
|
|
10
70
|
* Copyright 2017 Google LLC
|
|
11
71
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
12
|
-
|
|
13
|
-
|
|
72
|
+
*/const{is:i$2,defineProperty:e$1,getOwnPropertyDescriptor:h$1,getOwnPropertyNames:r$2,getOwnPropertySymbols:o$4,getPrototypeOf:n$2}=Object,a$1=globalThis,c$1=a$1.trustedTypes,l$1=c$1?c$1.emptyScript:"",p$1=a$1.reactiveElementPolyfillSupport,d$1=(t,s)=>t,u$1={toAttribute(t,s){switch(s){case Boolean:t=t?l$1:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$1=(t,s)=>!i$2(t,s),b={attribute:true,type:String,converter:u$1,reflect:false,useDefault:false,hasChanged:f$1};Symbol.metadata??=Symbol("metadata"),a$1.litPropertyMetadata??=new WeakMap;let y$1 = class y extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=b){if(s.state&&(s.attribute=false),this._$Ei(),this.prototype.hasOwnProperty(t)&&((s=Object.create(s)).wrapped=true),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),h=this.getPropertyDescriptor(t,i,s);void 0!==h&&e$1(this.prototype,t,h);}}static getPropertyDescriptor(t,s,i){const{get:e,set:r}=h$1(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get:e,set(s){const h=e?.call(this);r?.call(this,s),this.requestUpdate(t,h,i);},configurable:true,enumerable:true}}static getPropertyOptions(t){return this.elementProperties.get(t)??b}static _$Ei(){if(this.hasOwnProperty(d$1("elementProperties")))return;const t=n$2(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$1("finalized")))return;if(this.finalized=true,this._$Ei(),this.hasOwnProperty(d$1("properties"))){const t=this.properties,s=[...r$2(t),...o$4(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$2(s));}else void 0!==s&&i.push(c$2(s));return i}static _$Eu(t,s){const i=s.attribute;return false===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=false,this.hasUpdated=false,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$2(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(true),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$ET(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&true===i.reflect){const h=(void 0!==i.converter?.toAttribute?i.converter:u$1).toAttribute(s,i.type);this._$Em=t,null==h?this.removeAttribute(e):this.setAttribute(e,h),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),h="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$1;this._$Em=e,this[e]=h.fromAttribute(s,t.type)??this._$Ej?.get(e)??null,this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){const e=this.constructor,h=this[t];if(i??=e.getPropertyOptions(t),!((i.hasChanged??f$1)(h,s)||i.useDefault&&i.reflect&&h===this._$Ej?.get(t)&&!this.hasAttribute(e._$Eu(t,i))))return;this.C(t,s,i);} false===this.isUpdatePending&&(this._$ES=this._$EP());}C(t,s,{useDefault:i,reflect:e,wrapped:h},r){i&&!(this._$Ej??=new Map).has(t)&&(this._$Ej.set(t,r??s??this[t]),true!==h||void 0!==r)||(this._$AL.has(t)||(this.hasUpdated||i||(s=void 0),this._$AL.set(t,s)),true===e&&this._$Em!==t&&(this._$Eq??=new Set).add(t));}async _$EP(){this.isUpdatePending=true;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t){const{wrapped:t}=i,e=this[s];true!==t||this._$AL.has(s)||void 0===e||this.C(s,void 0,i,e);}}let t=false;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EM();}catch(s){throw t=false,this._$EM(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=true,this.firstUpdated(t)),this.updated(t);}_$EM(){this._$AL=new Map,this.isUpdatePending=false;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return true}update(t){this._$Eq&&=this._$Eq.forEach((t=>this._$ET(t,this[t]))),this._$EM();}updated(t){}firstUpdated(t){}};y$1.elementStyles=[],y$1.shadowRootOptions={mode:"open"},y$1[d$1("elementProperties")]=new Map,y$1[d$1("finalized")]=new Map,p$1?.({ReactiveElement:y$1}),(a$1.reactiveElementVersions??=[]).push("2.1.0");
|
|
73
|
+
|
|
74
|
+
/**
|
|
14
75
|
* @license
|
|
15
76
|
* Copyright 2017 Google LLC
|
|
16
77
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
17
78
|
*/
|
|
18
|
-
const
|
|
19
|
-
|
|
79
|
+
const t$1=globalThis,i$1=t$1.trustedTypes,s$1=i$1?i$1.createPolicy("lit-html",{createHTML:t=>t}):void 0,e="$lit$",h=`lit$${Math.random().toFixed(9).slice(2)}$`,o$3="?"+h,n$1=`<${o$3}>`,r$1=document,l=()=>r$1.createComment(""),c=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a=Array.isArray,u=t=>a(t)||"function"==typeof t?.[Symbol.iterator],d="[ \t\n\f\r]",f=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v=/-->/g,_=/>/g,m=RegExp(`>|${d}(?:([^\\s"'>=/]+)(${d}*=${d}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p=/'/g,g=/"/g,$=/^(?:script|style|textarea|title)$/i,y=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x=y(1),T$1=Symbol.for("lit-noChange"),E=Symbol.for("lit-nothing"),A=new WeakMap,C=r$1.createTreeWalker(r$1,129);function P(t,i){if(!a(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$1?s$1.createHTML(i):i}const V$1=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f?"!--"===u[1]?c=v:void 0!==u[1]?c=_:void 0!==u[2]?($.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m):void 0!==u[3]&&(c=m):c===m?">"===u[0]?(c=r??f,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m:'"'===u[3]?g:p):c===g||c===p?c=m:c===v||c===_?c=f:(c=m,r=void 0);const x=c===m&&t[i+1].startsWith("/>")?" ":"";l+=c===f?s+n$1:d>=0?(o.push(a),s.slice(0,d)+e+s.slice(d)+h+x):s+h+(-2===d?i:x);}return [P(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V$1(t,s);if(this.el=N.createElement(f,n),C.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e)){const i=v[a++],s=r.getAttribute(t).split(h),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H$1:"?"===e[1]?I$1:"@"===e[1]?L:k}),r.removeAttribute(t);}else t.startsWith(h)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($.test(r.tagName)){const t=r.textContent.split(h),s=t.length-1;if(s>0){r.textContent=i$1?i$1.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l()),C.nextNode(),d.push({type:2,index:++c});r.append(t[s],l());}}}else if(8===r.nodeType)if(r.data===o$3)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h,t+1));)d.push({type:7,index:c}),t+=h.length-1;}c++;}}static createElement(t,i){const s=r$1.createElement("template");return s.innerHTML=t,s}}function S$1(t,i,s=t,e){if(i===T$1)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(false),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S$1(t,h._$AS(t,i.values),h,e)),i}let M$1 = class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r$1).importNode(i,true);C.currentNode=e;let h=C.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R$1(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C.nextNode(),o++);}return C.currentNode=r$1,e}p(t){let i=0;for(const s of this._$AV) void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}};let R$1 = class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??true;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S$1(this,t,i),c(t)?t===E||null==t||""===t?(this._$AH!==E&&this._$AR(),this._$AH=E):t!==this._$AH&&t!==T$1&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E&&c(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$1.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N.createElement(P(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M$1(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A.get(t.strings);return void 0===i&&A.set(t.strings,i=new N(t)),i}k(t){a(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l()),this.O(l()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(false,true,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){ void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}};class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E;}_$AI(t,i=this,s,e){const h=this.strings;let o=false;if(void 0===h)t=S$1(this,t,i,0),o=!c(t)||t!==this._$AH&&t!==T$1,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S$1(this,e[s+n],i,n),r===T$1&&(r=this._$AH[n]),o||=!c(r)||r!==this._$AH[n],r===E?t=E:t!==E&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}}let H$1 = class H extends k{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E?void 0:t;}};let I$1 = class I extends k{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E);}};class L extends k{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S$1(this,t,i,0)??E)===T$1)return;const s=this._$AH,e=t===E&&s!==E||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E&&(s===E||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}}class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S$1(this,t);}}const j=t$1.litHtmlPolyfillSupport;j?.(N,R$1),(t$1.litHtmlVersions??=[]).push("3.3.0");const B=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R$1(i.insertBefore(l(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
80
|
+
|
|
81
|
+
/**
|
|
20
82
|
* @license
|
|
21
83
|
* Copyright 2017 Google LLC
|
|
22
84
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
23
|
-
*/class
|
|
24
|
-
|
|
85
|
+
*/const s=globalThis;class i extends y$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const r=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B(r,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(true);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(false);}render(){return T$1}}i._$litElement$=true,i["finalized"]=true,s.litElementHydrateSupport?.({LitElement:i});const o$2=s.litElementPolyfillSupport;o$2?.({LitElement:i});(s.litElementVersions??=[]).push("4.2.0");
|
|
86
|
+
|
|
87
|
+
/**
|
|
25
88
|
* @license
|
|
26
89
|
* Copyright 2017 Google LLC
|
|
27
90
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
91
|
*/
|
|
29
|
-
const
|
|
30
|
-
|
|
92
|
+
const t=t=>(e,o)=>{ void 0!==o?o.addInitializer((()=>{customElements.define(t,e);})):customElements.define(t,e);};
|
|
93
|
+
|
|
94
|
+
/**
|
|
31
95
|
* @license
|
|
32
96
|
* Copyright 2017 Google LLC
|
|
33
97
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
34
|
-
|
|
35
|
-
|
|
98
|
+
*/const o$1={attribute:true,type:String,converter:u$1,reflect:false,hasChanged:f$1},r=(t=o$1,e,r)=>{const{kind:n,metadata:i}=r;let s=globalThis.litPropertyMetadata.get(i);if(void 0===s&&globalThis.litPropertyMetadata.set(i,s=new Map),"setter"===n&&((t=Object.create(t)).wrapped=true),s.set(r.name,t),"accessor"===n){const{name:o}=r;return {set(r){const n=e.get.call(this);e.set.call(this,r),this.requestUpdate(o,n,t);},init(e){return void 0!==e&&this.C(o,void 0,t,e),e}}}if("setter"===n){const{name:o}=r;return function(r){const n=this[o];e.call(this,r),this.requestUpdate(o,n,t);}}throw Error("Unsupported decorator location: "+n)};function n(t){return (e,o)=>"object"==typeof o?r(t,e,o):((t,e,o)=>{const r=e.hasOwnProperty(o);return e.constructor.createProperty(o,t),r?Object.getOwnPropertyDescriptor(e,o):void 0})(t,e,o)}
|
|
99
|
+
|
|
100
|
+
/**
|
|
36
101
|
* @license
|
|
37
102
|
* Copyright 2021 Google LLC
|
|
38
103
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
39
|
-
*/}var dt="object"==typeof global&&global&&global.Object===Object&&global,pt="object"==typeof self&&self&&self.Object===Object&&self,gt=dt||pt||Function("return this")(),mt=gt.Symbol,yt=Object.prototype,bt=yt.hasOwnProperty,vt=yt.toString,wt=mt?mt.toStringTag:void 0;var _t=Object.prototype.toString;var St=mt?mt.toStringTag:void 0;function xt(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":St&&St in Object(t)?function(t){var e=bt.call(t,wt),i=t[wt];try{t[wt]=void 0;var r=!0}catch(t){}var n=vt.call(t);return r&&(e?t[wt]=i:delete t[wt]),n}(t):function(t){return _t.call(t)}(t)}var kt=/\s/;var Tt=/^\s+/;function jt(t){return t?t.slice(0,function(t){for(var e=t.length;e--&&kt.test(t.charAt(e)););return e}(t)+1).replace(Tt,""):t}function At(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}var Pt=/^[-+]0x[0-9a-f]+$/i,$t=/^0b[01]+$/i,Ot=/^0o[0-7]+$/i,It=parseInt;function Ct(t){if("number"==typeof t)return t;if(function(t){return"symbol"==typeof t||function(t){return null!=t&&"object"==typeof t}(t)&&"[object Symbol]"==xt(t)}(t))return NaN;if(At(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=At(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=jt(t);var i=$t.test(t);return i||Ot.test(t)?It(t.slice(2),i?2:8):Pt.test(t)?NaN:+t}var Et=function(){return gt.Date.now()},Mt=Math.max,Rt=Math.min;function Nt(t,e,i){var r,n,s,o,a,l,h=0,c=!1,u=!1,f=!0;if("function"!=typeof t)throw new TypeError("Expected a function");function d(e){var i=r,s=n;return r=n=void 0,h=e,o=t.apply(s,i)}function p(t){var i=t-l;return void 0===l||i>=e||i<0||u&&t-h>=s}function g(){var t=Et();if(p(t))return m(t);a=setTimeout(g,function(t){var i=e-(t-l);return u?Rt(i,s-(t-h)):i}(t))}function m(t){return a=void 0,f&&r?d(t):(r=n=void 0,o)}function y(){var t=Et(),i=p(t);if(r=arguments,n=this,l=t,i){if(void 0===a)return function(t){return h=t,a=setTimeout(g,e),c?d(t):o}(l);if(u)return clearTimeout(a),a=setTimeout(g,e),d(l)}return void 0===a&&(a=setTimeout(g,e)),o}return e=Ct(e)||0,At(i)&&(c=!!i.leading,s=(u="maxWait"in i)?Mt(Ct(i.maxWait)||0,e):s,f="trailing"in i?!!i.trailing:f),y.cancel=function(){void 0!==a&&clearTimeout(a),h=0,r=l=n=a=void 0},y.flush=function(){return void 0===a?o:m(Et())},y}function Dt(t,e){if(!t)return;const i=t.indexOf(e);-1!==i&&t.splice(i,1)}function zt(t){throw new Error(`Expected handling to cover all possible cases, but it didn't cover: ${JSON.stringify(t)}`)}function Ft(t,e="Assertion failed"){if(!t)throw new Error(e)}function Bt(t,e){e.addInitializer((function(){Object.defineProperty(this,e.name,{enumerable:!1,configurable:!0,writable:!0})}))}let qt={};const Lt=new Proxy({},{get:(t,e)=>(...t)=>String(qt[e]||e).replace(/\{(\d+)\}/g,((e,i)=>t[+i]??"(no placeholder)")),has:(t,e)=>Object.prototype.hasOwnProperty.call(qt,e)});class Ut extends Map{creator;constructor(t){super(),this.creator=t}get(t){const e=super.get(t);if(null!=e)return e;const i=this.creator(t);return this.set(t,i),i}getNoInsert(t){return super.get(t)}}class Vt{[Symbol.toStringTag]="StableKeyMap";impl=new Map;get size(){return this.impl.size}set(t,e){return this.impl.set(t.getStableKey(),[t,e]),this}get(t){return this.impl.get(t.getStableKey())?.[1]}has(t){return null!=this.get(t)}clear(){this.impl.clear()}delete(t){return this.impl.delete(t.getStableKey())}forEach(t,e){for(const[i,r]of this.entries())t.apply(e,[r,i,this])}entries(){return this.impl.values()}*keys(){for(const[t]of this.entries())yield t}*values(){for(const[,t]of this.entries())yield t}[Symbol.iterator](){return this.entries()}}var Ht,Gt;function Wt(t,e){if(t.startsWith(e))return Wt(t.substring(e.length),e);if(t.startsWith('"')){const i=t.indexOf('"',1);if(-1===i)return t.split(e);if(i===t.length-1)return[t];{const r=t.substring(i+1);return[t.substring(0,i+1),...Wt(r,e)]}}return t.split(e)}!function(t){t[t.Verbose=0]="Verbose",t[t.Info=1]="Info",t[t.Warn=2]="Warn",t[t.Error=3]="Error",t[t.None=4]="None"}(Ht||(Ht={})),Ht.Error,Ht.Warn,Ht.Info,Ht.Verbose,function(t){function e(t){const e=t.split("/");let i=!1;for(let t=0;t<e.length;)"."==e[t]&&t+1!=e.length?e.splice(t,1):".."==e[t]?i?t-1==0&&/\w:/i.test(e[0])?e.splice(t,1):(e.splice(t-1,2),t-=1):++t:(i=!0,++t);return e.join("/")}function i(t){return/^\/|^\w:\//.test(t)}t.dirname=function(t){let e=t.length-2;for(;e>0&&"/"!==t[e];--e);switch(e){case-2:case-1:return"/"===t[0]?"/":".";case 0:return t.substring(0,t.indexOf("/")+1);default:return t.slice(0,e)}},t.basename=function(t){let e=t.length-2;for(;e>=0&&"/"!==t[e];--e);switch(e){case-2:case-1:return t;default:return t.endsWith("/")?t.slice(e+1,-1):t.slice(e+1)}},t.relative=function(t,e){if(t==e)return"";Ft(i(t)&&i(e),"resolving relative paths without absolute inputs requires a filesystem"),t.endsWith("/")||(t+="/");const r=e.length;e.endsWith("/")||(e+="/");const n=Math.min(t.length,e.length);let s=0,o=0;for(;o<n&&t[o]===e[o];++o)"/"===t[o]&&(s=o);if(s===t.length-1)return e.substring(t.length,r);let a="";for(let e=s+1;e<t.length;++e)"/"!==t[e]&&e+1!==t.length||(a+=a?"/..":"..");return a+e.substring(s,r)},t.normalize=e,t.resolve=function(t,r){return Ft(i(t),"resolving without an absolute path requires a filesystem"),i(r)?r:e(`${t}/${r}`)},t.isAbsolute=i,t.splitFilename=function(t){const e=t.lastIndexOf(".");return e<1?{name:t,ext:""}:{name:t.substring(0,e),ext:t.substring(e)}}}(Gt||(Gt={}));class Kt{static UNKNOWN_PACKAGE="<unknown>";packageName;packagePath;qualifiedName;pos=1/0;transientId=NaN;fileName;constructor(t){this.packageName=t.packageName,this.packagePath=t.packagePath,this.qualifiedName=t.qualifiedName}getStableKey(){return Number.isFinite(this.pos)?`${this.packageName}\0${this.packagePath}\0${this.qualifiedName}\0${this.pos}\0${this.transientId}`:`${this.packageName}\0${this.packagePath}\0${this.qualifiedName}`}toDeclarationReference(){return{resolutionStart:"global",moduleSource:this.packageName,symbolReference:{path:Wt(this.qualifiedName,".").map((t=>({navigation:".",path:t})))}}}toObject(){return{packageName:this.packageName,packagePath:this.packagePath,qualifiedName:this.qualifiedName}}}var Jt=globalThis&&globalThis.__esDecorate||function(t,e,i,r,n,s){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=r.kind,h="getter"===l?"get":"setter"===l?"set":"value",c=!e&&t?r.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f=!1,d=i.length-1;d>=0;d--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(t){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(t||null))};var m=(0,i[d])("accessor"===l?{get:u.get,set:u.set}:u[h],p);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=o(m.get))&&(u.get=a),(a=o(m.set))&&(u.set=a),(a=o(m.init))&&n.unshift(a)}else(a=o(m))&&("field"===l?n.unshift(a):u[h]=a)}c&&Object.defineProperty(c,r.name,u),f=!0},Zt=globalThis&&globalThis.__runInitializers||function(t,e,i){for(var r=arguments.length>2,n=0;n<e.length;n++)i=r?e[n].call(t,i):e[n].call(t);return r?i:void 0};class Qt{tag;name;typeAnnotation;content;skipRendering=!1;constructor(t,e){this.tag=t,this.content=e}similarTo(t){return this.tag===t.tag&&this.name===t.name&&Xt.combineDisplayParts(this.content)===Xt.combineDisplayParts(t.content)}clone(){const t=new Qt(this.tag,Xt.cloneDisplayParts(this.content));return this.name&&(t.name=this.name),this.typeAnnotation&&(t.typeAnnotation=this.typeAnnotation),t}toObject(){return{tag:this.tag,name:this.name,content:Xt.serializeDisplayParts(this.content),typeAnnotation:this.typeAnnotation}}fromObject(t,e){this.name=e.name,this.typeAnnotation=e.typeAnnotation,this.content=Xt.deserializeDisplayParts(t,e.content)}}let Xt=(()=>{let t,e,i,r=[],n=[],s=[],o=[],a=[],l=[];return class h{static{const h="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[Bt],e=[Bt],i=[Bt],Jt(null,null,t,{kind:"field",name:"sourcePath",static:!1,private:!1,access:{has:t=>"sourcePath"in t,get:t=>t.sourcePath,set:(t,e)=>{t.sourcePath=e}},metadata:h},r,n),Jt(null,null,e,{kind:"field",name:"discoveryId",static:!1,private:!1,access:{has:t=>"discoveryId"in t,get:t=>t.discoveryId,set:(t,e)=>{t.discoveryId=e}},metadata:h},s,o),Jt(null,null,i,{kind:"field",name:"inheritedFromParentDeclaration",static:!1,private:!1,access:{has:t=>"inheritedFromParentDeclaration"in t,get:t=>t.inheritedFromParentDeclaration,set:(t,e)=>{t.inheritedFromParentDeclaration=e}},metadata:h},a,l),h&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:h})}static combineDisplayParts(t){let e="";for(const i of t||[])switch(i.kind){case"text":case"code":case"relative-link":e+=i.text;break;case"inline-tag":e+=`{${i.tag} ${i.text}}`;break;default:zt(i)}return e}static cloneDisplayParts(t){return t.map((t=>({...t})))}static serializeDisplayParts(t){return t?.map((t=>{switch(t.kind){case"text":case"code":case"relative-link":return{...t};case"inline-tag":{let e;return"string"==typeof t.target?e=t.target:t.target&&(e="id"in t.target?t.target.id:t.target.toObject()),{...t,target:e}}}}))}static deserializeDisplayParts(t,e){const i=[],r=[],n=e.map((t=>{switch(t.kind){case"text":case"code":return{...t};case"inline-tag":if("number"==typeof t.target){const e={kind:t.kind,tag:t.tag,text:t.text,target:void 0,tsLinkText:t.tsLinkText};return i.push([t.target,e]),e}if("string"==typeof t.target||void 0===t.target)return{kind:"inline-tag",tag:t.tag,text:t.text,target:t.target,tsLinkText:t.tsLinkText};if("object"==typeof t.target)return{kind:"inline-tag",tag:t.tag,text:t.text,target:new Kt(t.target),tsLinkText:t.tsLinkText};zt(t.target);break;case"relative-link":if(t.target){const e={kind:"relative-link",text:t.text,target:null,targetAnchor:t.targetAnchor};return r.push([t.target,e]),e}return{...t,target:void 0,targetAnchor:t.targetAnchor}}}));return(i.length||r.length)&&t.defer((e=>{for(const[e,i]of r)i.target=t.oldFileIdToNewFileId[e];for(const[r,n]of i)n.target=e.getReflectionById(t.oldIdToNewId[r]??-1),n.target||t.logger.warn(Lt.serialized_project_referenced_0_not_part_of_project(r.toString()))})),n}static splitPartsToHeaderAndBody(t){let e=t.findIndex((t=>{switch(t.kind){case"text":case"code":return t.text.includes("\n");case"inline-tag":case"relative-link":return!1}}));if(-1===e)return{header:h.combineDisplayParts(t),body:[]};if("code"===t[e].kind&&--e,-1===e)return{header:"",body:h.cloneDisplayParts(t)};let i=h.combineDisplayParts(t.slice(0,e));const r=t[e].text.indexOf("\n");let n;return-1===r?(i+=t[e].text,n=h.cloneDisplayParts(t.slice(e+1))):(i+=t[e].text.substring(0,r),n=h.cloneDisplayParts(t.slice(e)),n[0].text=n[0].text.substring(r+1)),n[0].text||n.shift(),{header:i.trim(),body:n}}summary;blockTags=[];modifierTags=new Set;label;sourcePath=Zt(this,r,void 0);discoveryId=(Zt(this,n),Zt(this,s,void 0));inheritedFromParentDeclaration=(Zt(this,o),Zt(this,a,void 0));constructor(t=[],e=[],i=new Set){Zt(this,l),this.summary=t,this.blockTags=e,this.modifierTags=i,function(t){const e=t.summary.findIndex((t=>"inline-tag"===t.kind&&"@label"===t.tag));-1!==e&&(t.label=t.summary.splice(e,1)[0].text)}(this)}getShortSummary(t){const e=this.getTag("@summary");if(e)return e.content;if(!t)return[];let i=this.summary.findIndex((t=>{switch(t.kind){case"text":return t.text.includes("\n\n");case"code":return t.text.includes("\n");case"inline-tag":case"relative-link":return!1;default:zt(t)}}));const r=-1!==i;-1===i&&(i=this.summary.length-1);const n=this.summary.slice(0,i);if(-1!==i){const t=this.summary[i].text,e=t.indexOf("\n\n");-1!==e?n.push({...this.summary[i],text:t.slice(0,e)}):r||n.push(this.summary[i])}return n}similarTo(t){if(h.combineDisplayParts(this.summary)!==h.combineDisplayParts(t.summary))return!1;if(this.blockTags.length!==t.blockTags.length)return!1;for(let e=0;e<this.blockTags.length;++e)if(!this.blockTags[e].similarTo(t.blockTags[e]))return!1;return!0}clone(){const t=new h(h.cloneDisplayParts(this.summary),this.blockTags.map((t=>t.clone())),new Set(this.modifierTags));return t.discoveryId=this.discoveryId,t.sourcePath=this.sourcePath,t.inheritedFromParentDeclaration=this.inheritedFromParentDeclaration,t}isEmpty(){return!this.hasVisibleComponent()&&0===this.modifierTags.size}hasVisibleComponent(t){return!!this.summary.some((t=>"text"!==t.kind||""!==t.text))||(t?this.blockTags.some((e=>!t.includes(e.tag))):this.blockTags.length>0)}hasModifier(t){return this.modifierTags.has(t)}removeModifier(t){this.modifierTags.delete(t)}getTag(t){return this.blockTags.find((e=>e.tag===t))}getTags(t){return this.blockTags.filter((e=>e.tag===t))}getIdentifiedTag(t,e){return this.blockTags.find((i=>i.tag===e&&i.name===t))}removeTags(t){!function(t,e){for(let i=0;i<t.length;i++)e(t[i])&&(t.splice(i,1),i--)}(this.blockTags,(e=>e.tag===t))}toObject(t){return{summary:h.serializeDisplayParts(this.summary),blockTags:t.toObjectsOptional(this.blockTags),modifierTags:this.modifierTags.size>0?Array.from(this.modifierTags):void 0,label:this.label}}fromObject(t,e){this.summary=h.deserializeDisplayParts(t,e.summary),this.blockTags=e.blockTags?.map((e=>{const i=new Qt(e.tag,[]);return t.fromObject(i,e),i}))||[],this.modifierTags=new Set(e.modifierTags),this.label=e.label}}})();var Yt;!function(t){t[t.Project=1]="Project",t[t.Module=2]="Module",t[t.Namespace=4]="Namespace",t[t.Enum=8]="Enum",t[t.EnumMember=16]="EnumMember",t[t.Variable=32]="Variable",t[t.Function=64]="Function",t[t.Class=128]="Class",t[t.Interface=256]="Interface",t[t.Constructor=512]="Constructor",t[t.Property=1024]="Property",t[t.Method=2048]="Method",t[t.CallSignature=4096]="CallSignature",t[t.IndexSignature=8192]="IndexSignature",t[t.ConstructorSignature=16384]="ConstructorSignature",t[t.Parameter=32768]="Parameter",t[t.TypeLiteral=65536]="TypeLiteral",t[t.TypeParameter=131072]="TypeParameter",t[t.Accessor=262144]="Accessor",t[t.GetSignature=524288]="GetSignature",t[t.SetSignature=1048576]="SetSignature",t[t.TypeAlias=2097152]="TypeAlias",t[t.Reference=4194304]="Reference",t[t.Document=8388608]="Document"}(Yt||(Yt={})),function(t){t.All=2*t.Reference-1,t.ClassOrInterface=t.Class|t.Interface,t.VariableOrProperty=t.Variable|t.Property,t.FunctionOrMethod=t.Function|t.Method,t.ClassMember=t.Accessor|t.Constructor|t.Method|t.Property,t.SomeSignature=t.CallSignature|t.IndexSignature|t.ConstructorSignature|t.GetSignature|t.SetSignature,t.SomeModule=t.Namespace|t.Module,t.SomeType=t.Interface|t.TypeLiteral|t.TypeParameter|t.TypeAlias,t.SomeValue=t.Variable|t.Function,t.SomeMember=t.EnumMember|t.Property|t.Method|t.Accessor,t.SomeExport=t.Module|t.Namespace|t.Enum|t.Variable|t.Function|t.Class|t.Interface|t.TypeAlias|t.Reference,t.MayContainDocuments=t.SomeExport|t.Project|t.Document,t.ExportContainer=t.SomeModule|t.Project,t.Inheritable=t.Accessor|t.IndexSignature|t.Property|t.Method|t.Constructor,t.ContainsCallSignatures=t.Constructor|t.Function|t.Method,t.TypeReferenceTarget=t.Interface|t.TypeAlias|t.Class|t.Enum,t.ValueReferenceTarget=t.Module|t.Namespace|t.Variable|t.Function,t.SignatureContainer=t.ContainsCallSignatures|t.Accessor,t.VariableContainer=t.SomeModule|t.Project,t.MethodContainer=t.ClassOrInterface|t.VariableOrProperty|t.FunctionOrMethod|t.TypeLiteral,t.singularString=function(e){switch(e){case t.Project:return Lt.kind_project();case t.Module:return Lt.kind_module();case t.Namespace:return Lt.kind_namespace();case t.Enum:return Lt.kind_enum();case t.EnumMember:return Lt.kind_enum_member();case t.Variable:return Lt.kind_variable();case t.Function:return Lt.kind_function();case t.Class:return Lt.kind_class();case t.Interface:return Lt.kind_interface();case t.Constructor:return Lt.kind_constructor();case t.Property:return Lt.kind_property();case t.Method:return Lt.kind_method();case t.CallSignature:return Lt.kind_call_signature();case t.IndexSignature:return Lt.kind_index_signature();case t.ConstructorSignature:return Lt.kind_constructor_signature();case t.Parameter:return Lt.kind_parameter();case t.TypeLiteral:return Lt.kind_type_literal();case t.TypeParameter:return Lt.kind_type_parameter();case t.Accessor:return Lt.kind_accessor();case t.GetSignature:return Lt.kind_get_signature();case t.SetSignature:return Lt.kind_set_signature();case t.TypeAlias:return Lt.kind_type_alias();case t.Reference:return Lt.kind_reference();case t.Document:return Lt.kind_document()}},t.pluralString=function(e){switch(e){case t.Project:return Lt.kind_plural_project();case t.Module:return Lt.kind_plural_module();case t.Namespace:return Lt.kind_plural_namespace();case t.Enum:return Lt.kind_plural_enum();case t.EnumMember:return Lt.kind_plural_enum_member();case t.Variable:return Lt.kind_plural_variable();case t.Function:return Lt.kind_plural_function();case t.Class:return Lt.kind_plural_class();case t.Interface:return Lt.kind_plural_interface();case t.Constructor:return Lt.kind_plural_constructor();case t.Property:return Lt.kind_plural_property();case t.Method:return Lt.kind_plural_method();case t.CallSignature:return Lt.kind_plural_call_signature();case t.IndexSignature:return Lt.kind_plural_index_signature();case t.ConstructorSignature:return Lt.kind_plural_constructor_signature();case t.Parameter:return Lt.kind_plural_parameter();case t.TypeLiteral:return Lt.kind_plural_type_literal();case t.TypeParameter:return Lt.kind_plural_type_parameter();case t.Accessor:return Lt.kind_plural_accessor();case t.GetSignature:return Lt.kind_plural_get_signature();case t.SetSignature:return Lt.kind_plural_set_signature();case t.TypeAlias:return Lt.kind_plural_type_alias();case t.Reference:return Lt.kind_plural_reference();case t.Document:return Lt.kind_plural_document()}},t.classString=function(e){return`tsd-kind-${t[e].replace(/(.)([A-Z])/g,((t,e,i)=>`${e}-${i}`)).toLowerCase()}`}}(Yt||(Yt={}));var te=globalThis&&globalThis.__esDecorate||function(t,e,i,r,n,s){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=r.kind,h="getter"===l?"get":"setter"===l?"set":"value",c=!e&&t?r.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f=!1,d=i.length-1;d>=0;d--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(t){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(t||null))};var m=(0,i[d])("accessor"===l?{get:u.get,set:u.set}:u[h],p);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=o(m.get))&&(u.get=a),(a=o(m.set))&&(u.set=a),(a=o(m.init))&&n.unshift(a)}else(a=o(m))&&("field"===l?n.unshift(a):u[h]=a)}c&&Object.defineProperty(c,r.name,u),f=!0},ee=globalThis&&globalThis.__runInitializers||function(t,e,i){for(var r=arguments.length>2,n=0;n<e.length;n++)i=r?e[n].call(t,i):e[n].call(t);return r?i:void 0};let ie=0;var re;!function(t){t[t.None=0]="None",t[t.Private=1]="Private",t[t.Protected=2]="Protected",t[t.Public=4]="Public",t[t.Static=8]="Static",t[t.External=16]="External",t[t.Optional=32]="Optional",t[t.Rest=64]="Rest",t[t.Abstract=128]="Abstract",t[t.Const=256]="Const",t[t.Readonly=512]="Readonly",t[t.Inherited=1024]="Inherited"}(re||(re={}));const ne=[re.Private,re.Protected,re.Static,re.Optional,re.Abstract,re.Const,re.Readonly];class se{flags=re.None;hasFlag(t){return!!(t&this.flags)}get isPrivate(){return this.hasFlag(re.Private)}get isProtected(){return this.hasFlag(re.Protected)}get isPublic(){return this.hasFlag(re.Public)}get isStatic(){return this.hasFlag(re.Static)}get isExternal(){return this.hasFlag(re.External)}get isOptional(){return this.hasFlag(re.Optional)}get isRest(){return this.hasFlag(re.Rest)}get isAbstract(){return this.hasFlag(re.Abstract)}get isConst(){return this.hasFlag(re.Const)}get isReadonly(){return this.hasFlag(re.Readonly)}get isInherited(){return this.hasFlag(re.Inherited)}setFlag(t,e){switch(t){case re.Private:this.setSingleFlag(re.Private,e),e&&(this.setFlag(re.Protected,!1),this.setFlag(re.Public,!1));break;case re.Protected:this.setSingleFlag(re.Protected,e),e&&(this.setFlag(re.Private,!1),this.setFlag(re.Public,!1));break;case re.Public:this.setSingleFlag(re.Public,e),e&&(this.setFlag(re.Private,!1),this.setFlag(re.Protected,!1));break;default:this.setSingleFlag(t,e)}}static flagString(t){switch(t){case re.None:throw new Error("Should be unreachable");case re.Private:return Lt.flag_private();case re.Protected:return Lt.flag_protected();case re.Public:return Lt.flag_public();case re.Static:return Lt.flag_static();case re.External:return Lt.flag_external();case re.Optional:return Lt.flag_optional();case re.Rest:return Lt.flag_rest();case re.Abstract:return Lt.flag_abstract();case re.Const:return Lt.flag_const();case re.Readonly:return Lt.flag_readonly();case re.Inherited:return Lt.flag_inherited()}}getFlagStrings(){const t=[];for(const e of ne)this.hasFlag(e)&&t.push(se.flagString(e));return t}setSingleFlag(t,e){!e&&this.hasFlag(t)?this.flags^=t:e&&!this.hasFlag(t)&&(this.flags|=t)}static serializedFlags=["isPrivate","isProtected","isPublic","isStatic","isExternal","isOptional","isRest","isAbstract","isConst","isReadonly","isInherited"];toObject(){return Object.fromEntries(se.serializedFlags.filter((t=>this[t])).map((t=>[t,!0])))}fromObject(t){for(const e of Object.keys(t)){const t=e.substring(2);t in re&&this.setFlag(re[t],!0)}}}var oe;!function(t){t[t.Children=0]="Children",t[t.Documents=1]="Documents",t[t.Parameters=2]="Parameters",t[t.TypeLiteral=3]="TypeLiteral",t[t.TypeParameter=4]="TypeParameter",t[t.Signatures=5]="Signatures",t[t.IndexSignature=6]="IndexSignature",t[t.GetSignature=7]="GetSignature",t[t.SetSignature=8]="SetSignature"}(oe||(oe={}));let ae=(()=>{let t,e,i=[],r=[],n=[],s=[];return class{static{const o="function"==typeof Symbol&&Symbol.metadata?Object.create(null):void 0;t=[Bt],e=[Bt],te(null,null,t,{kind:"field",name:"parent",static:!1,private:!1,access:{has:t=>"parent"in t,get:t=>t.parent,set:(t,e)=>{t.parent=e}},metadata:o},i,r),te(null,null,e,{kind:"field",name:"project",static:!1,private:!1,access:{has:t=>"project"in t,get:t=>t.project,set:(t,e)=>{t.project=e}},metadata:o},n,s),o&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:o})}id;name;kind;flags=new se;parent=ee(this,i,void 0);project=(ee(this,r),ee(this,n,void 0));comment=ee(this,s);constructor(t,e,i){this.id=ie++,this.parent=i,this.project=i?.project||this,this.name=t,this.kind=e,i?.flags.isExternal&&this.setFlag(re.External)}kindOf(t){const e=Array.isArray(t)?t.reduce(((t,e)=>t|e),0):t;return!!(this.kind&e)}getFullName(t="."){return this.parent&&!this.parent.isProject()?this.parent.getFullName(t)+t+this.name:this.name}getFriendlyFullName(){return this.parent&&!this.parent.isProject()?this.kindOf(Yt.ConstructorSignature|Yt.CallSignature|Yt.GetSignature|Yt.SetSignature)?this.parent.getFriendlyFullName():this.parent.getFriendlyFullName()+"."+this.name:this.name}setFlag(t,e=!0){this.flags.setFlag(t,e)}hasComment(t){return!!this.comment&&this.comment.hasVisibleComponent(t)}hasGetterOrSetter(){return!1}getChildByName(t){const e=Array.isArray(t)?t:Wt(t,"."),i=e[0];let r;return this.traverse((t=>t.name!==i||(r=e.length<=1?t:t.getChildByName(e.slice(1)),!1))),r}isProject(){return!1}isDeclaration(){return!1}isSignature(){return!1}isTypeParameter(){return!1}isParameter(){return!1}isDocument(){return!1}isReference(){return"reference"===this.variant}isContainer(){return!1}isDeprecated(){let t=!1;return this.visit({declaration(e){e.signatures?.length&&e.signatures.every((t=>t.comment?.getTag("@deprecated")))&&(t=!0)}}),!(!t&&!this.comment?.getTag("@deprecated"))||(this.parent?.isDeprecated()??!1)}visit(t){t[this.variant]?.(this)}toString(){return Yt[this.kind]+" "+this.name}toStringHierarchy(t=""){const e=[t+this.toString()];return t+=" ",this.traverse((i=>(e.push(i.toStringHierarchy(t)),!0))),e.join("\n")}toObject(t){return{id:this.id,name:this.name,variant:this.variant,kind:this.kind,flags:this.flags.toObject(),comment:this.comment&&!this.comment.isEmpty()?t.toObject(this.comment):void 0}}fromObject(t,e){this.name=e.name,this.kind=e.kind,this.flags.fromObject(e.flags),this.comment=t.revive(e.comment,(()=>new Xt))}}})();class le{title;description;children=[];constructor(t){this.title=t}toObject(){return{title:this.title,description:this.description?Xt.serializeDisplayParts(this.description):void 0,children:this.children.length>0?this.children.map((t=>t.id)):void 0}}fromObject(t,e){e.description&&(this.description=Xt.deserializeDisplayParts(t,e.description)),e.children&&t.defer((i=>{for(const r of e.children||[]){const e=i.getReflectionById(t.oldIdToNewId[r]??-1);(e?.isDeclaration()||e?.isDocument())&&this.children.push(e)}}))}}class he{owningReflection;title;description;children=[];categories;constructor(t,e){this.owningReflection=e,this.title=t}toObject(t){return{title:this.title,description:this.description?Xt.serializeDisplayParts(this.description):void 0,children:this.children.length>0?this.children.map((t=>t.id)):void 0,categories:t.toObjectsOptional(this.categories)}}fromObject(t,e){e.description&&(this.description=Xt.deserializeDisplayParts(t,e.description)),e.categories&&(this.categories=e.categories.map((e=>{const i=new le(e.title);return t.fromObject(i,e),i}))),e.children&&t.defer((i=>{for(const r of e.children||[]){const e=i.getReflectionById(t.oldIdToNewId[r]??-1);(e?.isDeclaration()||e?.isDocument())&&this.children.push(e)}}))}}class ce extends ae{children;documents;childrenIncludingDocuments;groups;categories;getChildrenByKind(t){return(this.children||[]).filter((e=>e.kindOf(t)))}addChild(t){if(t.isDeclaration())this.children||=[],this.children.push(t),this.childrenIncludingDocuments||=[],this.childrenIncludingDocuments.push(t);else if(t.isDocument())this.documents||=[],this.documents.push(t),this.childrenIncludingDocuments||=[],this.childrenIncludingDocuments.push(t);else{if(!this.isDeclaration()||!t.isSignature())throw new Error("Unsupported child type: "+Yt[t.kind]);switch(t.kind){case Yt.CallSignature:case Yt.ConstructorSignature:this.signatures||=[],this.signatures.push(t);break;case Yt.IndexSignature:this.indexSignatures||=[],this.indexSignatures.push(t);break;case Yt.GetSignature:case Yt.SetSignature:throw new Error("Unsupported child type: "+Yt[t.kind]);default:zt(t.kind)}}}removeChild(t){t.isDeclaration()?(Dt(this.children,t),0===this.children?.length&&delete this.children):(Dt(this.documents,t),0===this.documents?.length&&delete this.documents),Dt(this.childrenIncludingDocuments,t),0===this.childrenIncludingDocuments?.length&&delete this.childrenIncludingDocuments}isContainer(){return!0}traverse(t){for(const e of this.children?.slice()||[])if(!1===t(e,oe.Children))return;for(const e of this.documents?.slice()||[])if(!1===t(e,oe.Documents))return}toObject(t){return{...super.toObject(t),children:t.toObjectsOptional(this.children),documents:t.toObjectsOptional(this.documents),childrenIncludingDocuments:this.children?.length&&this.documents?.length?this.childrenIncludingDocuments?.map((t=>t.id)):void 0,groups:t.toObjectsOptional(this.groups),categories:t.toObjectsOptional(this.categories)}}fromObject(t,e){super.fromObject(t,e),this.children=t.reviveMany(e.children,(e=>t.constructReflection(e))),this.documents=t.reviveMany(e.documents,(e=>t.constructReflection(e)));const i=new Map;for(const t of this.children||[])i.set(t.id,t);for(const t of this.documents||[])i.set(t.id,t);for(const r of e.childrenIncludingDocuments||[]){const e=i.get(t.oldIdToNewId[r]??-1);e&&(this.childrenIncludingDocuments||=[],this.childrenIncludingDocuments.push(e),i.delete(t.oldIdToNewId[r]??-1))}i.size&&(this.childrenIncludingDocuments||=[],this.childrenIncludingDocuments.push(...i.values())),this.groups=t.reviveMany(e.groups,(t=>new he(t.title,this))),this.categories=t.reviveMany(e.categories,(t=>new le(t.title)))}}var ue=globalThis&&globalThis.__esDecorate||function(t,e,i,r,n,s){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=r.kind,h="getter"===l?"get":"setter"===l?"set":"value",c=!e&&t?r.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f=!1,d=i.length-1;d>=0;d--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(t){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(t||null))};var m=(0,i[d])("accessor"===l?{get:u.get,set:u.set}:u[h],p);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=o(m.get))&&(u.get=a),(a=o(m.set))&&(u.set=a),(a=o(m.init))&&n.unshift(a)}else(a=o(m))&&("field"===l?n.unshift(a):u[h]=a)}c&&Object.defineProperty(c,r.name,u),f=!0},fe=globalThis&&globalThis.__runInitializers||function(t,e,i){for(var r=arguments.length>2,n=0;n<e.length;n++)i=r?e[n].call(t,i):e[n].call(t);return r?i:void 0};class de{toString(){return this.stringify(pe.none)}visit(t,...e){return t[this.type]?.(this,...e)}stringify(t){return this.needsParenthesis(t)?`(${this.getTypeString()})`:this.getTypeString()}fromObject(t,e){}estimatePrintWidth(){return this.getTypeString().length}}const pe={none:"none",arrayElement:"arrayElement",referenceTypeArgument:"referenceTypeArgument",unionElement:"unionElement"};class ge extends de{name;type="intrinsic";constructor(t){super(),this.name=t}getTypeString(){return this.name}toObject(){return{type:this.type,name:this.name}}needsParenthesis(){return!1}}(()=>{let t,e=de,i=[],r=[];(class n extends e{static{const n="function"==typeof Symbol&&Symbol.metadata?Object.create(e[Symbol.metadata]??null):void 0;t=[Bt],ue(null,null,t,{kind:"field",name:"_project",static:!1,private:!1,access:{has:t=>"_project"in t,get:t=>t._project,set:(t,e)=>{t._project=e}},metadata:n},i,r),n&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:n})}type="reference";name;typeArguments;get reflection(){if("number"==typeof this._target)return this._project?.getReflectionById(this._target);const t=this._project?.getReflectionsFromSymbolId(this._target);if(!t?.length)return;const e=this.preferValues?Yt.ValueReferenceTarget:Yt.TypeReferenceTarget;return t.find((t=>t.kindOf(e)))||t.find((t=>t.kindOf(~e)))}highlightedProperties;get symbolId(){if(!this.reflection&&"object"==typeof this._target)return this._target}isIntentionallyBroken(){return!("object"!=typeof this._target||!this._project?.symbolIdHasBeenRemoved(this._target))||(-1===this._target||this.refersToTypeParameter)}toDeclarationReference(){return{resolutionStart:"global",moduleSource:this.package,symbolReference:{path:this.qualifiedName.split(".").map((t=>({path:t,navigation:"."})))}}}qualifiedName;package;externalUrl;refersToTypeParameter=!1;preferValues=!1;_target;_project=fe(this,i,void 0);constructor(t,e,i,n){super(),fe(this,r),this.name=t,this._target="number"==typeof e?e:"variant"in e?e.id:e,this._project=i,this.qualifiedName=n}static createUnresolvedReference(t,e,i,r){return new n(t,e,i,r)}static createResolvedReference(t,e,i){return new n(t,e,i,t)}static createBrokenReference(t,e,i){const r=new n(t,-1,e,t);return r.package=i,r}getTypeString(){const t=this.reflection?this.reflection.name:this.name;let e="";return this.typeArguments&&this.typeArguments.length>0&&(e+="<",e+=this.typeArguments.map((t=>t.stringify(pe.referenceTypeArgument))).join(", "),e+=">"),t+e}needsParenthesis(){return!1}toObject(t){let e;e="number"==typeof this._target?this._target:this._project?.symbolIdHasBeenRemoved(this._target)?-1:this.reflection?this.reflection.id:this._target.toObject();const i={type:this.type,target:e,typeArguments:t.toObjectsOptional(this.typeArguments),name:this.name,package:this.package,externalUrl:this.externalUrl};return this.name!==this.qualifiedName&&(i.qualifiedName=this.qualifiedName),this.refersToTypeParameter&&(i.refersToTypeParameter=!0),"number"!=typeof e&&this.preferValues&&(i.preferValues=!0),this.highlightedProperties&&(i.highlightedProperties=Object.fromEntries(Array.from(this.highlightedProperties.entries(),(([t,e])=>[t,Xt.serializeDisplayParts(e)])))),i}fromObject(t,e){if(this.typeArguments=t.reviveMany(e.typeArguments,(e=>t.constructType(e))),"number"==typeof e.target?-1===e.target?this._target=-1:t.defer((i=>{const r=i.getReflectionById(t.oldIdToNewId[e.target]??-1);r?(this._project=i,this._target=r.id):t.logger.warn(Lt.serialized_project_referenced_0_not_part_of_project(JSON.stringify(e.target)))})):(this._project=t.project,this._target=new Kt(e.target)),this.qualifiedName=e.qualifiedName??e.name,this.package=e.package,this.refersToTypeParameter=!!e.refersToTypeParameter,this.preferValues=!!e.preferValues,e.highlightedProperties){this.highlightedProperties=new Map;for(const[i,r]of Object.entries(e.highlightedProperties))this.highlightedProperties.set(i,Xt.deserializeDisplayParts(t,r))}}})})();class me extends de{declaration;type="reflection";constructor(t){super(),this.declaration=t}getTypeString(){const t=[],e=this.declaration.getNonIndexSignatures();for(const i of e)t.push(ve(i,": "));for(const e of this.declaration.children||[])t.push(`${e.name}${ye(e)} ${be(e.type)}`);for(const e of this.declaration.indexSignatures||[])t.push(ve(e,": ","[]"));return 1===e.length&&1===t.length?ve(e[0]," => "):0===t.length?"{}":`{ ${t.join("; ")} }`}needsParenthesis(t){return!this.declaration.children&&!this.declaration.indexSignatures&&(1===this.declaration.signatures?.length&&(t===pe.arrayElement||t===pe.unionElement))}toObject(t){return{type:this.type,declaration:t.toObject(this.declaration)}}}function ye(t){return t.flags.isOptional?"?:":":"}function be(t){return t?.toString()??"any"}function ve(t,e,i="()"){const r=(n=t.parameters,s=", ",o=t=>`${t.name}${ye(t)} ${be(t.type)}`,n?.length?n.map(o).join(s):"");var n,s,o;return`${i[0]}${r}${i[1]}${e}${be(t.type)}`}class we{fileName;fullFileName;line;character;url;constructor(t,e,i){this.fileName=t,this.fullFileName=t,this.line=e,this.character=i}equals(t){return this.fullFileName==t.fullFileName&&this.line===t.line&&this.character===t.character}toObject(){return{fileName:this.fileName,line:this.line,character:this.character,url:this.url}}fromObject(t,e){this.url=e.url}}class _e extends ce{variant="declaration";sources;relevanceBoost;escapedName;type;typeParameters;signatures;indexSignatures;getSignature;setSignature;defaultValue;overwrites;inheritedFrom;implementationOf;extendedTypes;extendedBy;implementedTypes;implementedBy;typeHierarchy;readme;packageVersion;isDeclaration(){return!0}hasGetterOrSetter(){return!!this.getSignature||!!this.setSignature}getAllSignatures(){let t=[];return this.signatures&&(t=t.concat(this.signatures)),this.indexSignatures&&(t=t.concat(this.indexSignatures)),this.getSignature&&t.push(this.getSignature),this.setSignature&&t.push(this.setSignature),t}getNonIndexSignatures(){return[].concat(this.signatures??[],this.setSignature??[],this.getSignature??[])}getProperties(){return this.children?.length?this.children:"reflection"===this.type?.type?this.type.declaration.children??[]:[]}getChildOrTypePropertyByName(t){if("reflection"===this.type?.type)for(const e of this.type.declaration.children||[])if(t[0]===e.name)return 1===t.length?e:e.getChildOrTypePropertyByName(t.slice(1));for(const e of this.children||[])if(t[0]===e.name)return 1===t.length?e:e.getChildOrTypePropertyByName(t.slice(1))}traverse(t){for(const e of this.typeParameters?.slice()||[])if(!1===t(e,oe.TypeParameter))return;if(!(this.type instanceof me&&!1===t(this.type.declaration,oe.TypeLiteral))){for(const e of this.signatures?.slice()||[])if(!1===t(e,oe.Signatures))return;for(const e of this.indexSignatures?.slice()||[])if(!1===t(e,oe.IndexSignature))return;this.getSignature&&!1===t(this.getSignature,oe.GetSignature)||this.setSignature&&!1===t(this.setSignature,oe.SetSignature)||super.traverse(t)}}toString(){let t=super.toString();if(this.typeParameters){t+="<"+this.typeParameters.map((t=>t.name)).join(", ")+">"}return this.type&&(t+=": "+this.type.toString()),t}toObject(t){return{...super.toObject(t),variant:this.variant,packageVersion:this.packageVersion,sources:t.toObjectsOptional(this.sources),relevanceBoost:1===this.relevanceBoost?void 0:this.relevanceBoost,typeParameters:t.toObjectsOptional(this.typeParameters),type:t.toObject(this.type),signatures:t.toObjectsOptional(this.signatures),indexSignatures:t.toObjectsOptional(this.indexSignatures),getSignature:t.toObject(this.getSignature),setSignature:t.toObject(this.setSignature),defaultValue:this.defaultValue,overwrites:t.toObject(this.overwrites),inheritedFrom:t.toObject(this.inheritedFrom),implementationOf:t.toObject(this.implementationOf),extendedTypes:t.toObjectsOptional(this.extendedTypes),extendedBy:t.toObjectsOptional(this.extendedBy),implementedTypes:t.toObjectsOptional(this.implementedTypes),implementedBy:t.toObjectsOptional(this.implementedBy),readme:Xt.serializeDisplayParts(this.readme)}}fromObject(t,e){if(super.fromObject(t,e),e.readme&&(this.readme=Xt.deserializeDisplayParts(t,e.readme)),"project"===e.variant)return this.kind=Yt.Module,this.packageVersion=e.packageVersion,this.project.files.fromObject(t,e.files||{}),void t.defer((()=>{for(const[i,r]of Object.entries(e.symbolIdMap||{})){const e=this.project.getReflectionById(t.oldIdToNewId[+i]??-1);e?this.project.registerSymbolId(e,new Kt(r)):t.logger.warn(Lt.serialized_project_referenced_0_not_part_of_project(i))}}));this.packageVersion=e.packageVersion,this.sources=t.reviveMany(e.sources,(t=>new we(t.fileName,t.line,t.character))),this.relevanceBoost=e.relevanceBoost,this.typeParameters=t.reviveMany(e.typeParameters,(e=>t.constructReflection(e))),this.type=t.revive(e.type,(e=>t.constructType(e))),this.signatures=t.reviveMany(e.signatures,(e=>t.constructReflection(e))),this.indexSignatures=t.reviveMany(e.indexSignatures,(e=>t.constructReflection(e))),this.getSignature=t.revive(e.getSignature,(e=>t.constructReflection(e))),this.setSignature=t.revive(e.setSignature,(e=>t.constructReflection(e))),this.defaultValue=e.defaultValue,this.overwrites=t.reviveType(e.overwrites),this.inheritedFrom=t.reviveType(e.inheritedFrom),this.implementationOf=t.reviveType(e.implementationOf),this.extendedTypes=t.reviveMany(e.extendedTypes,(e=>t.reviveType(e))),this.extendedBy=t.reviveMany(e.extendedBy,(e=>t.reviveType(e))),this.implementedTypes=t.reviveMany(e.implementedTypes,(e=>t.reviveType(e))),this.implementedBy=t.reviveMany(e.implementedBy,(e=>t.reviveType(e)))}}class Se extends _e{variant="reference";_target;constructor(t,e,i){super(t,Yt.Reference,i),this._target=e.id}tryGetTargetReflection(){return this.project.getReflectionById(this._target)}tryGetTargetReflectionDeep(){let t=this.tryGetTargetReflection();for(;t instanceof Se;)t=t.tryGetTargetReflection();return t}getTargetReflection(){const t=this.tryGetTargetReflection();if(!t)throw new Error("Reference was unresolved.");return t}getTargetReflectionDeep(){let t=this.getTargetReflection();for(;t instanceof Se;)t=t.getTargetReflection();return t}getChildByName(t){return this.getTargetReflection().getChildByName(t)}toObject(t){return{...super.toObject(t),variant:this.variant,target:this.tryGetTargetReflection()?.id??-1}}fromObject(t,e){super.fromObject(t,e),t.defer((i=>{this._target=i.getReflectionById(t.oldIdToNewId[e.target]??-1)?.id??-1}))}}var xe=globalThis&&globalThis.__esDecorate||function(t,e,i,r,n,s){function o(t){if(void 0!==t&&"function"!=typeof t)throw new TypeError("Function expected");return t}for(var a,l=r.kind,h="getter"===l?"get":"setter"===l?"set":"value",c=!e&&t?r.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,r.name):{}),f=!1,d=i.length-1;d>=0;d--){var p={};for(var g in r)p[g]="access"===g?{}:r[g];for(var g in r.access)p.access[g]=r.access[g];p.addInitializer=function(t){if(f)throw new TypeError("Cannot add initializers after decoration has completed");s.push(o(t||null))};var m=(0,i[d])("accessor"===l?{get:u.get,set:u.set}:u[h],p);if("accessor"===l){if(void 0===m)continue;if(null===m||"object"!=typeof m)throw new TypeError("Object expected");(a=o(m.get))&&(u.get=a),(a=o(m.set))&&(u.set=a),(a=o(m.init))&&n.unshift(a)}else(a=o(m))&&("field"===l?n.unshift(a):u[h]=a)}c&&Object.defineProperty(c,r.name,u),f=!0},ke=globalThis&&globalThis.__runInitializers||function(t,e,i){for(var r=arguments.length>2,n=0;n<e.length;n++)i=r?e[n].call(t,i):e[n].call(t);return r?i:void 0};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
var Te;function je(t,e,i){const r=typeof i,n=typeof t;if("undefined"!==r){if("undefined"!==n){if(i){if("function"===n&&r===n)return function(e){return t(i(e))};if((e=t.constructor)===i.constructor){if(e===Array)return i.concat(t);if(e===Map){var s=new Map(i);for(var o of t)s.set(o[0],o[1]);return s}if(e===Set){for(s of(o=new Set(i),t.values()))o.add(s);return o}}}return t}return i}return"undefined"===n?e:t}function Ae(t,e){return void 0===t?e:t}function Pe(){return Object.create(null)}function $e(t){return"string"==typeof t}function Oe(t){return"object"==typeof t}function Ie(t,e){if($e(e))t=t[e];else for(let i=0;t&&i<e.length;i++)t=t[e[i]];return t}(()=>{let t,e,i,r,n,s,o=ce,a=[],l=[],h=[],c=[],u=[],f=[],d=[],p=[],g=[],m=[],y=[],b=[];(class extends o{static{const v="function"==typeof Symbol&&Symbol.metadata?Object.create(o[Symbol.metadata]??null):void 0;t=[Bt],e=[Bt],i=[Bt],r=[Bt],n=[Bt],s=[Bt],xe(null,null,t,{kind:"field",name:"symbolToReflectionIdMap",static:!1,private:!1,access:{has:t=>"symbolToReflectionIdMap"in t,get:t=>t.symbolToReflectionIdMap,set:(t,e)=>{t.symbolToReflectionIdMap=e}},metadata:v},a,l),xe(null,null,e,{kind:"field",name:"reflectionIdToSymbolIdMap",static:!1,private:!1,access:{has:t=>"reflectionIdToSymbolIdMap"in t,get:t=>t.reflectionIdToSymbolIdMap,set:(t,e)=>{t.reflectionIdToSymbolIdMap=e}},metadata:v},h,c),xe(null,null,i,{kind:"field",name:"removedSymbolIds",static:!1,private:!1,access:{has:t=>"removedSymbolIds"in t,get:t=>t.removedSymbolIds,set:(t,e)=>{t.removedSymbolIds=e}},metadata:v},u,f),xe(null,null,r,{kind:"field",name:"referenceGraph",static:!1,private:!1,access:{has:t=>"referenceGraph"in t,get:t=>t.referenceGraph,set:(t,e)=>{t.referenceGraph=e}},metadata:v},d,p),xe(null,null,n,{kind:"field",name:"reflectionChildren",static:!1,private:!1,access:{has:t=>"reflectionChildren"in t,get:t=>t.reflectionChildren,set:(t,e)=>{t.reflectionChildren=e}},metadata:v},g,m),xe(null,null,s,{kind:"field",name:"reflections",static:!1,private:!1,access:{has:t=>"reflections"in t,get:t=>t.reflections,set:(t,e)=>{t.reflections=e}},metadata:v},y,b),v&&Object.defineProperty(this,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:v})}variant="project";symbolToReflectionIdMap=ke(this,a,new Vt);reflectionIdToSymbolIdMap=(ke(this,l),ke(this,h,new Map));removedSymbolIds=(ke(this,c),ke(this,u,new Vt));referenceGraph=(ke(this,f),ke(this,d,void 0));reflectionChildren=(ke(this,p),ke(this,g,new Ut((()=>[]))));reflections=(ke(this,m),ke(this,y,{}));packageName=ke(this,b);packageVersion;readme;files;constructor(t,e){super(t,Yt.Project),this.reflections[this.id]=this,this.files=e}isProject(){return!0}getReflectionsByKind(t){return Object.values(this.reflections).filter((e=>e.kindOf(t)))}registerReflection(t,e,i){this.referenceGraph=void 0,t.parent&&this.reflectionChildren.get(t.parent.id).push(t.id),this.reflections[t.id]=t,e&&this.registerSymbolId(t,e),i&&this.files.registerReflection(i,t)}removeTypeReflections(t){t?.visit(function(t){const e={namedTupleMember(i){t.namedTupleMember?.(i),i.element.visit(e)},templateLiteral(i){t.templateLiteral?.(i);for(const[t]of i.tail)t.visit(e)},array(i){t.array?.(i),i.elementType.visit(e)},conditional(i){t.conditional?.(i),i.checkType.visit(e),i.extendsType.visit(e),i.trueType.visit(e),i.falseType.visit(e)},indexedAccess(i){t.indexedAccess?.(i),i.indexType.visit(e),i.objectType.visit(e)},inferred(i){t.inferred?.(i),i.constraint?.visit(e)},intersection(i){t.intersection?.(i),i.types.forEach((t=>t.visit(e)))},intrinsic(e){t.intrinsic?.(e)},literal(e){t.literal?.(e)},mapped(i){t.mapped?.(i),i.nameType?.visit(e),i.parameterType.visit(e),i.templateType.visit(e)},optional(i){t.optional?.(i),i.elementType.visit(e)},predicate(i){t.predicate?.(i),i.targetType?.visit(e)},query(i){t.query?.(i),i.queryType.visit(e)},reference(i){t.reference?.(i),i.typeArguments?.forEach((t=>t.visit(e)))},reflection(e){t.reflection?.(e)},rest(i){t.rest?.(i),i.elementType.visit(e)},tuple(i){t.tuple?.(i),i.elements.forEach((t=>t.visit(e)))},typeOperator(i){t.typeOperator?.(i),i.target.visit(e)},union(i){t.union?.(i),i.types.forEach((t=>t.visit(e)))},unknown(e){t.unknown?.(e)}};return e}({reflection:t=>{this.removeReflection(t.declaration)}}))}removeReflection(t){this._removeReflection(t);const e=t.parent;e?.traverse(((i,r)=>{if(i!==t)return!0;switch(r){case oe.Children:case oe.Documents:e.removeChild(t);break;case oe.GetSignature:delete e.getSignature;break;case oe.IndexSignature:Dt(e.indexSignatures,t),e.indexSignatures?.length||delete e.indexSignatures;break;case oe.Parameters:Dt(t.parent.parameters,t),t.parent.parameters?.length||delete t.parent.parameters;break;case oe.SetSignature:delete e.setSignature;break;case oe.Signatures:Dt(e.signatures,t),e.signatures?.length||delete e.signatures;break;case oe.TypeLiteral:e.type=new ge("Object");break;case oe.TypeParameter:Dt(e.typeParameters,t),e.typeParameters?.length||delete e.typeParameters;break;default:zt(r)}return!1}))}mergeReflections(t,e){delete this.referenceGraph;const i=this.reflectionChildren.getNoInsert(t.id)||[],r=this.reflectionChildren.get(e.id);for(const n of i){const i=this.getReflectionById(n);i?.parent===t&&(i.parent=e,r.push(n),e.addChild(i))}this.reflectionChildren.delete(t.id),this.removeReflection(t),delete e.groups,delete e.categories}_removeReflection(t){this.files.removeReflection(t);const e=this.getReferenceGraph();for(const i of e.get(t.id)??[]){const t=this.getReflectionById(i);t&&this.removeReflection(t)}e.delete(t.id);for(const e of this.reflectionChildren.getNoInsert(t.id)||[]){const i=this.getReflectionById(e);i?.parent===t&&this._removeReflection(i)}this.reflectionChildren.delete(t.id);const i=this.reflectionIdToSymbolIdMap.get(t.id);if(i){const e=this.symbolToReflectionIdMap.get(i);e===t.id?(this.symbolToReflectionIdMap.delete(i),this.removedSymbolIds.set(i,!0)):"object"==typeof e&&(Dt(e,t.id),0===e.length&&this.removedSymbolIds.set(i,!0))}this.reflectionIdToSymbolIdMap.delete(t.id),delete this.reflections[t.id]}getReflectionById(t){return this.reflections[t]}getReflectionFromSymbolId(t){return this.getReflectionsFromSymbolId(t)[0]}getReflectionsFromSymbolId(t){const e=this.symbolToReflectionIdMap.get(t);return"number"==typeof e?[this.getReflectionById(e)]:"object"==typeof e?e.map((t=>this.getReflectionById(t))):[]}getSymbolIdFromReflection(t){return this.reflectionIdToSymbolIdMap.get(t.id)}registerSymbolId(t,e){this.removedSymbolIds.delete(e),this.reflectionIdToSymbolIdMap.set(t.id,e);const i=this.symbolToReflectionIdMap.get(e);void 0!==i?"number"==typeof i?this.symbolToReflectionIdMap.set(e,[i,t.id]):i.push(t.id):this.symbolToReflectionIdMap.set(e,t.id)}symbolIdHasBeenRemoved(t){return this.removedSymbolIds.has(t)}getReferenceGraph(){if(!this.referenceGraph){this.referenceGraph=new Map;for(const t in this.reflections){const e=this.reflections[t];if(e instanceof Se){const t=e.tryGetTargetReflection();if(t){const i=this.referenceGraph.get(t.id)??[];i.push(e.id),this.referenceGraph.set(t.id,i)}}}}return this.referenceGraph}toObject(t){const e={};return this.reflectionIdToSymbolIdMap.forEach(((t,i)=>{e[i]=t.toObject()})),{schemaVersion:"2.0",...super.toObject(t),variant:this.variant,packageName:this.packageName,packageVersion:this.packageVersion,readme:Xt.serializeDisplayParts(this.readme),symbolIdMap:e,files:t.toObject(this.files)}}fromObject(t,e){super.fromObject(t,e),this.packageName=e.packageName,this.packageVersion=e.packageVersion,e.readme&&(this.readme=Xt.deserializeDisplayParts(t,e.readme)),this.files.fromObject(t,e.files||{}),t.defer((()=>{for(const[i,r]of Object.entries(e.symbolIdMap||{})){const e=this.getReflectionById(t.oldIdToNewId[+i]??-1);e?this.registerSymbolId(e,new Kt(r)):t.logger.warn(Lt.serialized_project_referenced_0_not_part_of_project(i))}}))}})})();const Ce=/[^\p{L}\p{N}]+/u,Ee=/(\d{3})/g,Me=/(\D)(\d{3})/g,Re=/(\d{3})(\D)/g,Ne=/[\u0300-\u036f]/g;function De(t={}){if(!this||this.constructor!==De)return new De(...arguments);if(arguments.length)for(t=0;t<arguments.length;t++)this.assign(arguments[t]);else this.assign(t)}function ze(t){t.F=null,t.B.clear(),t.D.clear()}function Fe(t,e,i){i||(e||"object"!=typeof t?"object"==typeof e&&(i=e,e=0):i=t),i&&(t=i.query||t,e=i.limit||e);let r=""+(e||0);i&&(r+=(i.offset||0)+!!i.context+!!i.suggest+(!1!==i.resolve)+(i.resolution||this.resolution)+(i.boost||0)),t=(""+t).toLowerCase(),this.cache||(this.cache=new Be);let n=this.cache.get(t+r);if(!n){const s=i&&i.cache;s&&(i.cache=!1),n=this.search(t,e,i),s&&(i.cache=s),this.cache.set(t+r,n)}return n}function Be(t){this.limit=t&&!0!==t?t:1e3,this.cache=new Map,this.h=""}(Te=De.prototype).assign=function(t){this.normalize=je(t.normalize,!0,this.normalize);let e,i=t.include,r=i||t.exclude||t.split;if(r||""===r){if("object"==typeof r&&r.constructor!==RegExp){let t="";e=!i,i||(t+="\\p{Z}"),r.letter&&(t+="\\p{L}"),r.number&&(t+="\\p{N}",e=!!i),r.symbol&&(t+="\\p{S}"),r.punctuation&&(t+="\\p{P}"),r.control&&(t+="\\p{C}"),(r=r.char)&&(t+="object"==typeof r?r.join(""):r);try{this.split=new RegExp("["+(i?"^":"")+t+"]+","u")}catch(t){this.split=/\s+/}}else this.split=r,e=!1===r||"a1a".split(r).length<2;this.numeric=je(t.numeric,e)}else{try{this.split=je(this.split,Ce)}catch(t){this.split=/\s+/}this.numeric=je(t.numeric,je(this.numeric,!0))}if(this.prepare=je(t.prepare,null,this.prepare),this.finalize=je(t.finalize,null,this.finalize),r=t.filter,this.filter="function"==typeof r?r:je(r&&new Set(r),null,this.filter),this.dedupe=je(t.dedupe,!0,this.dedupe),this.matcher=je((r=t.matcher)&&new Map(r),null,this.matcher),this.mapper=je((r=t.mapper)&&new Map(r),null,this.mapper),this.stemmer=je((r=t.stemmer)&&new Map(r),null,this.stemmer),this.replacer=je(t.replacer,null,this.replacer),this.minlength=je(t.minlength,1,this.minlength),this.maxlength=je(t.maxlength,1024,this.maxlength),this.rtl=je(t.rtl,!1,this.rtl),(this.cache=r=je(t.cache,!0,this.cache))&&(this.F=null,this.L="number"==typeof r?r:2e5,this.B=new Map,this.D=new Map,this.I=this.H=128),this.h="",this.J=null,this.A="",this.K=null,this.matcher)for(const t of this.matcher.keys())this.h+=(this.h?"|":"")+t;if(this.stemmer)for(const t of this.stemmer.keys())this.A+=(this.A?"|":"")+t;return this},Te.addStemmer=function(t,e){return this.stemmer||(this.stemmer=new Map),this.stemmer.set(t,e),this.A+=(this.A?"|":"")+t,this.K=null,this.cache&&ze(this),this},Te.addFilter=function(t){return"function"==typeof t?this.filter=t:(this.filter||(this.filter=new Set),this.filter.add(t)),this.cache&&ze(this),this},Te.addMapper=function(t,e){return"object"==typeof t?this.addReplacer(t,e):t.length>1?this.addMatcher(t,e):(this.mapper||(this.mapper=new Map),this.mapper.set(t,e),this.cache&&ze(this),this)},Te.addMatcher=function(t,e){return"object"==typeof t?this.addReplacer(t,e):t.length<2&&(this.dedupe||this.mapper)?this.addMapper(t,e):(this.matcher||(this.matcher=new Map),this.matcher.set(t,e),this.h+=(this.h?"|":"")+t,this.J=null,this.cache&&ze(this),this)},Te.addReplacer=function(t,e){return"string"==typeof t?this.addMatcher(t,e):(this.replacer||(this.replacer=[]),this.replacer.push(t,e),this.cache&&ze(this),this)},Te.encode=function(t,e){if(this.cache&&t.length<=this.H)if(this.F){if(this.B.has(t))return this.B.get(t)}else this.F=setTimeout(ze,50,this);this.normalize&&(t="function"==typeof this.normalize?this.normalize(t):Ne?t.normalize("NFKD").replace(Ne,"").toLowerCase():t.toLowerCase()),this.prepare&&(t=this.prepare(t)),this.numeric&&t.length>3&&(t=t.replace(Me,"$1 $2").replace(Re,"$1 $2").replace(Ee,"$1 "));const i=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let r,n,s=[],o=Pe(),a=this.split||""===this.split?t.split(this.split):[t];for(let t,h,c=0;c<a.length;c++)if((t=h=a[c])&&!(t.length<this.minlength||t.length>this.maxlength)){if(e){if(o[t])continue;o[t]=1}else{if(r===t)continue;r=t}if(i)s.push(t);else if(!this.filter||("function"==typeof this.filter?this.filter(t):!this.filter.has(t))){if(this.cache&&t.length<=this.I)if(this.F){var l=this.D.get(t);if(l||""===l){l&&s.push(l);continue}}else this.F=setTimeout(ze,50,this);if(this.stemmer){let e;for(this.K||(this.K=new RegExp("(?!^)("+this.A+")$"));e!==t&&t.length>2;)e=t,t=t.replace(this.K,(t=>this.stemmer.get(t)))}if(t&&(this.mapper||this.dedupe&&t.length>1)){l="";for(let e,i,r=0,n="";r<t.length;r++)e=t.charAt(r),e===n&&this.dedupe||((i=this.mapper&&this.mapper.get(e))||""===i?i===n&&this.dedupe||!(n=i)||(l+=i):l+=n=e);t=l}if(this.matcher&&t.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),t=t.replace(this.J,(t=>this.matcher.get(t)))),t&&this.replacer)for(l=0;t&&l<this.replacer.length;l+=2)t=t.replace(this.replacer[l],this.replacer[l+1]);if(this.cache&&h.length<=this.I&&(this.D.set(h,t),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0)),t){if(t!==h)if(e){if(o[t])continue;o[t]=1}else{if(n===t)continue;n=t}s.push(t)}}}return this.finalize&&(s=this.finalize(s)||s),this.cache&&t.length<=this.H&&(this.B.set(t,s),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0)),s},Be.prototype.set=function(t,e){this.cache.set(this.h=t,e),this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value)},Be.prototype.get=function(t){const e=this.cache.get(t);return e&&this.h!==t&&(this.cache.delete(t),this.cache.set(this.h=t,e)),e},Be.prototype.remove=function(t){for(const e of this.cache){const i=e[0];e[1].includes(t)&&this.cache.delete(i)}},Be.prototype.clear=function(){this.cache.clear(),this.h=""};const qe={normalize:!1,numeric:!1,dedupe:!1},Le={},Ue=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]),Ve=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),He=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"],Ge={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"ß":2,d:3,t:3,l:4,m:5,n:5,r:6};var We={Exact:qe,Default:Le,Normalize:Le,LatinBalance:{mapper:Ue},LatinAdvanced:{mapper:Ue,matcher:Ve,replacer:He},LatinExtra:{mapper:Ue,replacer:He.concat([/(?!^)[aeo]/g,""]),matcher:Ve},LatinSoundex:{dedupe:!1,include:{letter:!0},finalize:function(t){for(let i=0;i<t.length;i++){var e=t[i];let r=e.charAt(0),n=Ge[r];for(let t,i=1;i<e.length&&(t=e.charAt(i),"h"===t||"w"===t||!(t=Ge[t])||t===n||(r+=t,n=t,4!==r.length));i++);t[i]=r}}},CJK:{split:""},LatinExact:qe,LatinDefault:Le,LatinSimple:Le};function Ke(t,e,i,r){let n=[];for(let s,o=0;o<t.index.length;o++)if(s=t.index[o],e>=s.length)e-=s.length;else{const o=(e=s[r?"splice":"slice"](e,i)).length;if(o&&(n=n.length?n.concat(e):e,i-=o,r&&(t.length-=o),!i))break;e=0}return n}function Je(t){if(!this||this.constructor!==Je)return new Je(t);this.index=t?[t]:[],this.length=t?t.length:0;const e=this;return new Proxy([],{get:(t,i)=>"length"===i?e.length:"push"===i?function(t){e.index[e.index.length-1].push(t),e.length++}:"pop"===i?function(){if(e.length)return e.length--,e.index[e.index.length-1].pop()}:"indexOf"===i?function(t){let i=0;for(let r,n,s=0;s<e.index.length;s++){if(r=e.index[s],n=r.indexOf(t),n>=0)return i+n;i+=r.length}return-1}:"includes"===i?function(t){for(let i=0;i<e.index.length;i++)if(e.index[i].includes(t))return!0;return!1}:"slice"===i?function(t,i){return Ke(e,t||0,i||e.length,!1)}:"splice"===i?function(t,i){return Ke(e,t||0,i||e.length,!0)}:"constructor"===i?Array:"symbol"!=typeof i?(t=e.index[i/2**31|0])&&t[i]:void 0,set:(t,i,r)=>(t=i/2**31|0,(e.index[t]||(e.index[t]=[]))[i]=r,e.length++,!0)})}function Ze(t=8){if(!this||this.constructor!==Ze)return new Ze(t);this.index=Pe(),this.h=[],this.size=0,t>32?(this.B=Ye,this.A=BigInt(t)):(this.B=Xe,this.A=t)}function Qe(t=8){if(!this||this.constructor!==Qe)return new Qe(t);this.index=Pe(),this.h=[],this.size=0,t>32?(this.B=Ye,this.A=BigInt(t)):(this.B=Xe,this.A=t)}function Xe(t){let e=2**this.A-1;if("number"==typeof t)return t&e;let i=0,r=this.A+1;for(let n=0;n<t.length;n++)i=(i*r^t.charCodeAt(n))&e;return 32===this.A?i+2**31:i}function Ye(t){let e=BigInt(2)**this.A-BigInt(1);var i=typeof t;if("bigint"===i)return t&e;if("number"===i)return BigInt(t)&e;i=BigInt(0);let r=this.A+BigInt(1);for(let n=0;n<t.length;n++)i=(i*r^BigInt(t.charCodeAt(n)))&e;return i}let ti,ei,ii,ri,ni;async function si(t){var e=(t=t.data).task;const i=t.id;let r=t.args;if("init"===e)ei=t.options||{},(e=t.factory)?(Function("return "+e)()(self),ti=new self.FlexSearch.Index(ei),delete self.FlexSearch):ti=new Ji(ei),postMessage({id:i});else{let n;"export"===e&&(r[1]?(r[0]=ei.export,r[2]=0,r[3]=1):r=null),"import"===e?r[0]&&(t=await ei.import.call(ti,r[0]),ti.import(r[0],t)):((n=r&&ti[e].apply(ti,r))&&n.then&&(n=await n),n&&n.await&&(n=await n.await),"search"===e&&n.result&&(n=n.result)),postMessage("search"===e?{id:i,msg:n}:{id:i})}}function oi(t){li.call(t,"add"),li.call(t,"append"),li.call(t,"search"),li.call(t,"update"),li.call(t,"remove"),li.call(t,"searchCache")}function ai(){ii=ni=0}function li(t){this[t+"Async"]=function(){const e=arguments;var i=e[e.length-1];let r;if("function"==typeof i&&(r=i,delete e[e.length-1]),ii?ni||(ni=Date.now()-ri>=this.priority*this.priority*3):(ii=setTimeout(ai,0),ri=Date.now()),ni){const i=this;return new Promise((r=>{setTimeout((function(){r(i[t+"Async"].apply(i,e))}),0)}))}const n=this[t].apply(this,e);return i=n.then?n:new Promise((t=>t(n))),r&&i.then(r),i}}Je.prototype.clear=function(){this.index.length=0},Je.prototype.push=function(){},Ze.prototype.get=function(t){const e=this.index[this.B(t)];return e&&e.get(t)},Ze.prototype.set=function(t,e){var i=this.B(t);let r=this.index[i];r?(i=r.size,r.set(t,e),(i-=r.size)&&this.size++):(this.index[i]=r=new Map([[t,e]]),this.h.push(r),this.size++)},Qe.prototype.add=function(t){var e=this.B(t);let i=this.index[e];i?(e=i.size,i.add(t),(e-=i.size)&&this.size++):(this.index[e]=i=new Set([t]),this.h.push(i),this.size++)},(Te=Ze.prototype).has=Qe.prototype.has=function(t){const e=this.index[this.B(t)];return e&&e.has(t)},Te.delete=Qe.prototype.delete=function(t){const e=this.index[this.B(t)];e&&e.delete(t)&&this.size--},Te.clear=Qe.prototype.clear=function(){this.index=Pe(),this.h=[],this.size=0},Te.values=Qe.prototype.values=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].values())yield e},Te.keys=Qe.prototype.keys=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].keys())yield e},Te.entries=Qe.prototype.entries=function*(){for(let t=0;t<this.h.length;t++)for(let e of this.h[t].entries())yield e};let hi=0;function ci(e={},i){function r(t){function r(t){const e=(t=t.data||t).id,i=e&&o.h[e];i&&(i(t.msg),delete o.h[e])}if(this.worker=t,this.h=Pe(),this.worker)return s?this.worker.on("message",r):this.worker.onmessage=r,e.config?new Promise((function(t){hi>1e9&&(hi=0),o.h[++hi]=function(){t(o)},o.worker.postMessage({id:hi,task:"init",factory:n,options:e})})):(this.priority=e.priority||4,this.encoder=i||null,this.worker.postMessage({task:"init",factory:n,options:e}),this)}if(!this||this.constructor!==ci)return new ci(e);let n="undefined"!=typeof self?self._factory:"undefined"!=typeof window?window._factory:null;n&&(n=n.toString());const s="undefined"==typeof window,o=this,a=function(e,i,r){return i?"undefined"!=typeof module?new(require("worker_threads").Worker)(__dirname+"/worker/node.js"):import("worker_threads").then((function(t){return new t.Worker(void 0+"/node/node.mjs")})):e?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+si.toString()],{type:"text/javascript"}))):new window.Worker("string"==typeof r?r:(t&&"SCRIPT"===t.tagName.toUpperCase()&&t.src||new URL("index.js",document.baseURI).href).replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js","module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}(n,s,e.worker);return a.then?a.then((function(t){return r.call(o,t)})):r.call(this,a)}function ui(t){ci.prototype[t]=function(){const e=this,i=[].slice.call(arguments);var r=i[i.length-1];let n;return"function"==typeof r&&(n=r,i.pop()),r=new Promise((function(r){"export"===t&&"function"==typeof i[0]&&(i[0]=null),hi>1e9&&(hi=0),e.h[++hi]=r,e.worker.postMessage({task:t,id:hi,args:i})})),n?(r.then(n),this):r}}function fi(t,e,i,r,n,s){if(t=t[n],r===i.length-1)e[n]=s||t;else if(t)if(t.constructor===Array)for(e=e[n]=Array(t.length),n=0;n<t.length;n++)fi(t,e,i,r,n);else e=e[n]||(e[n]=Pe()),n=i[++r],fi(t,e,i,r,n)}function di(t,e,i,r,n,s,o,a){if(t=t[o])if(r===e.length-1){if(t.constructor===Array){if(i[r]){for(e=0;e<t.length;e++)n.add(s,t[e],!0,!0);return}t=t.join(" ")}n.add(s,t,a,!0)}else if(t.constructor===Array)for(o=0;o<t.length;o++)di(t,e,i,r,n,s,o,a);else o=e[++r],di(t,e,i,r,n,s,o,a)}function pi(t,e,i,r){if(!t.length)return t;if(1===t.length)return t=t[0],t=i||t.length>e?t.slice(i,i+e):t,r?$i.call(this,t):t;let n=[];for(let s,o,a=0;a<t.length;a++)if((s=t[a])&&(o=s.length)){if(i){if(i>=o){i-=o;continue}s=s.slice(i,i+e),o=s.length,i=0}if(o>e&&(s=s.slice(0,e),o=e),!n.length&&o>=e)return r?$i.call(this,s):s;if(n.push(s),!(e-=o))break}return n=n.length>1?[].concat.apply([],n):n[0],r?$i.call(this,n):n}function gi(t,e,i,r){var n=r[0];if(n[0]&&n[0].query)return t[e].apply(t,n);if(!("and"!==e&&"not"!==e||t.result.length||t.await||n.suggest))return r.length>1&&(n=r[r.length-1]),(r=n.resolve)?t.await||t.result:t;let s,o,a,l,h,c=[],u=0,f=0;for(e=0;e<r.length;e++)if(n=r[e]){var d=void 0;if(n.constructor===Si)d=n.await||n.result;else if(n.then||n.constructor===Array)d=n;else{u=n.limit||0,f=n.offset||0,a=n.suggest,o=n.resolve,s=((l=n.highlight||t.highlight)||n.enrich)&&o,d=n.queue;let i=n.async||d,r=n.index,p=n.query;if(r?t.index||(t.index=r):r=t.index,p||n.tag){const s=n.field||n.pluck;if(s&&(!p||t.query&&!l||(t.query=p,t.field=s,t.highlight=l),r=r.index.get(s)),d&&(h||t.await)){let s;h=1;const o=t.C.length,a=new Promise((function(t){s=t}));!function(e,r){a.h=function(){r.index=null,r.resolve=!1;let n=i?e.searchAsync(r):e.search(r);return n.then?n.then((function(e){return t.C[o]=e=e.result||e,s(e),e})):(n=n.result||n,s(n),n)}}(r,Object.assign({},n)),t.C.push(a),c[e]=a;continue}n.resolve=!1,n.index=null,d=i?r.searchAsync(n):r.search(n),n.resolve=o,n.index=r}else if(n.and)d=mi(n,"and",r);else if(n.or)d=mi(n,"or",r);else if(n.not)d=mi(n,"not",r);else{if(!n.xor)continue;d=mi(n,"xor",r)}}d.await?(h=1,d=d.await):d.then?(h=1,d=d.then((function(t){return t.result||t}))):d=d.result||d,c[e]=d}if(h&&!t.await&&(t.await=new Promise((function(e){t.return=e}))),h){const e=Promise.all(c).then((function(r){for(let n=0;n<t.C.length;n++)if(t.C[n]===e){t.C[n]=function(){return i.call(t,r,u,f,s,o,a,l)};break}xi(t)}));t.C.push(e)}else{if(!t.await)return i.call(t,c,u,f,s,o,a,l);t.C.push((function(){return i.call(t,c,u,f,s,o,a,l)}))}return o?t.await||t.result:t}function mi(t,e,i){const r=(t=t[e])[0]||t;return r.index||(r.index=i),i=new Si(r),t.length>1&&(i=i[e].apply(i,t.slice(1))),i}function yi(t,e,i,r,n,s,o){return t.length&&(this.result.length&&t.push(this.result),t.length<2?this.result=t[0]:(this.result=Ti(t,e,i,!1,this.h),i=0)),n&&(this.await=null),n?this.resolve(e,i,r,o):this}function bi(t,e,i,r,n,s,o){if(!s&&!this.result.length)return n?this.result:this;let a;if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{let r=0;for(let e,i,n=0;n<t.length;n++)if((e=t[n])&&(i=e.length))r<i&&(r=i);else if(!s){r=0;break}r?(this.result=ki(t,r,e,i,s,this.h,n),a=!0):this.result=[]}else s||(this.result=t);return n&&(this.await=null),n?this.resolve(e,i,r,o,a):this}function vi(t,e,i,r,n,s,o){if(t.length)if(this.result.length&&t.unshift(this.result),t.length<2)this.result=t[0];else{t:{s=i;var a=this.h;const r=[],o=Pe();let l=0;for(let e,i=0;i<t.length;i++)if(e=t[i]){l<e.length&&(l=e.length);for(let t,i=0;i<e.length;i++)if(t=e[i])for(let e,i=0;i<t.length;i++)e=t[i],o[e]=o[e]?2:1}for(let i,h=0,c=0;h<l;h++)for(let l,u=0;u<t.length;u++)if((l=t[u])&&(i=l[h]))for(let l,f=0;f<i.length;f++)if(l=i[f],1===o[l])if(s)s--;else if(n){if(r.push(l),r.length===e){t=r;break t}}else{const i=h+(u?a:0);if(r[i]||(r[i]=[]),r[i].push(l),++c===e){t=r;break t}}t=r}this.result=t,a=!0}else s||(this.result=t);return n&&(this.await=null),n?this.resolve(e,i,r,o,a):this}function wi(t,e,i,r,n,s,o){if(!s&&!this.result.length)return n?this.result:this;if(t.length&&this.result.length){t:{s=i;var a=[];t=new Set(t.flat().flat());for(let i,r=0,o=0;r<this.result.length;r++)if(i=this.result[r])for(let l,h=0;h<i.length;h++)if(l=i[h],!t.has(l))if(s)s--;else if(n){if(a.push(l),a.length===e){t=a;break t}}else if(a[r]||(a[r]=[]),a[r].push(l),++o===e){t=a;break t}t=a}this.result=t,a=!0}return n&&(this.await=null),n?this.resolve(e,i,r,o,a):this}function _i(t,e,i,r,n){let s,o,a;"string"==typeof n?(s=n,n=""):s=n.template,o=s.indexOf("$1"),a=s.substring(o+2),o=s.substring(0,o);let l=n&&n.boundary,h=!n||!1!==n.clip,c=n&&n.merge&&a&&o&&new RegExp(a+" "+o,"g");var u=0;if("object"==typeof(n=n&&n.ellipsis)){var f=n.template;u=f.length-2,n=n.pattern}let d,p;"string"!=typeof n&&(n=!1===n?"":"..."),u&&(n=f.replace("$1",n)),f=n.length-u,"object"==typeof l&&(d=l.before,0===d&&(d=-1),p=l.after,0===p&&(p=-1),l=l.total||9e5),u=new Map;for(let E,M,R,N=0;N<e.length;N++){let D;if(r)D=e,R=r;else{var g=e[N];if(R=g.field,!R)continue;D=g.result}M=i.get(R),E=M.encoder,"string"!=typeof(g=u.get(E))&&(g=E.encode(t),u.set(E,g));for(let t=0;t<D.length;t++){var m=D[t].doc;if(!m)continue;if(!(m=Ie(m,R)))continue;var y=m.trim().split(/\s+/);if(!y.length)continue;m="";var b=[];let e=[];for(var v=-1,w=-1,_=0,S=0;S<y.length;S++){var x=y[S],k=E.encode(x);let t;if((k=k.length>1?k.join(" "):k[0])&&x){for(var T=x.length,j=(E.split?x.replace(E.split,""):x).length-k.length,A="",P=0,$=0;$<g.length;$++){var O=g[$];if(O){var I=O.length;I+=j<0?0:j,P&&I<=P||(O=k.indexOf(O))>-1&&(A=(O?x.substring(0,O):"")+o+x.substring(O,O+I)+a+(O+I<T?x.substring(O+I):""),P=I,t=!0)}}A&&(l&&(v<0&&(v=m.length+(m?1:0)),w=m.length+(m?1:0)+A.length,_+=T,e.push(b.length),b.push({match:A})),m+=(m?" ":"")+A)}if(t){if(l&&_>=l)break}else m+=(m?" ":"")+(x=y[S]),l&&b.push({text:x})}if(_=e.length*(s.length-2),d||p||l&&m.length-_>l)if(S=w-v,d>0&&(S+=d),p>0&&(S+=p),S<=(_=l+_-2*f))y=d?v-(d>0?d:0):v-((_-S)/2|0),b=p?w+(p>0?p:0):y+_,h||(y>0&&" "!==m.charAt(y)&&" "!==m.charAt(y-1)&&((y=m.indexOf(" ",y))<0&&(y=0)),b<m.length&&" "!==m.charAt(b-1)&&" "!==m.charAt(b)&&((b=m.lastIndexOf(" ",b))<w?b=w:++b)),m=(y?n:"")+m.substring(y,b)+(b<m.length?n:"");else{for(w=[],v={},_={},S={},x={},k={},A=j=T=0,$=P=1;;){var C=void 0;for(let t,i=0;i<e.length;i++){if(t=e[i],A)if(j!==A){if(S[i+1])continue;if(t+=A,v[t]){T-=f,_[i+1]=1,S[i+1]=1;continue}if(t>=b.length-1){if(t>=b.length){S[i+1]=1,t>=y.length&&(_[i+1]=1);continue}T-=f}if(m=b[t].text,I=p&&k[i]){if(!(I>0)){S[i+1]=1;continue}if(m.length>I){if(S[i+1]=1,!h)continue;m=m.substring(0,I)}(I-=m.length)||(I=-1),k[i]=I}if(T+m.length+1<=l)m=" "+m,w[i]+=m;else{if(!h){S[i+1]=1;continue}(C=l-T-1)>0&&(m=" "+m.substring(0,C),w[i]+=m),S[i+1]=1}}else{if(S[i])continue;if(t-=j,v[t]){T-=f,S[i]=1,_[i]=1;continue}if(t<=0){if(t<0){S[i]=1,_[i]=1;continue}T-=f}if(m=b[t].text,I=d&&x[i]){if(!(I>0)){S[i]=1;continue}if(m.length>I){if(S[i]=1,!h)continue;m=m.substring(m.length-I)}(I-=m.length)||(I=-1),x[i]=I}if(T+m.length+1<=l)m+=" ",w[i]=m+w[i];else{if(!h){S[i]=1;continue}(C=m.length+1-(l-T))>=0&&C<m.length&&(m=m.substring(C)+" ",w[i]=m+w[i]),S[i]=1}}else{let e;if(m=b[t].match,d&&(x[i]=d),p&&(k[i]=p),i&&T++,t?!i&&f&&(T+=f):(_[i]=1,S[i]=1),t>=y.length-1||t<b.length-1&&b[t+1].match?e=1:f&&(T+=f),T-=s.length-2,i&&!(T+m.length<=l)){C=P=$=_[i]=0;break}w[i]=m,e&&(_[i+1]=1,S[i+1]=1)}T+=m.length,C=v[t]=1}if(C)j===A?A++:j++;else{if(j===A?P=0:$=0,!P&&!$)break;P?A=++j:A++}}m="";for(let t,e=0;e<w.length;e++)t=(_[e]?e?" ":"":(e&&!n?" ":"")+n)+w[e],m+=t;n&&!_[w.length]&&(m+=n)}c&&(m=m.replace(c," ")),D[t].highlight=m}if(r)break}return e}function Si(t,e){if(!this||this.constructor!==Si)return new Si(t,e);let i,r,n,s,o,a,l=0;if(t&&t.index){const i=t;if(e=i.index,l=i.boost||0,r=i.query){n=i.field||i.pluck,s=i.highlight;const r=i.resolve;t=i.async||i.queue,i.resolve=!1,i.index=null,t=t?e.searchAsync(i):e.search(i),i.resolve=r,i.index=e,t=t.result||t}else t=[]}if(t&&t.then){const e=this;t=t.then((function(t){e.C[0]=e.result=t.result||t,xi(e)})),i=[t],t=[],o=new Promise((function(t){a=t}))}this.index=e||null,this.result=t||[],this.h=l,this.C=i||[],this.await=o||null,this.return=a||null,this.highlight=s||null,this.query=r||"",this.field=n||""}function xi(t,e){let i=t.result;var r=t.await;t.await=null;for(let e,n=0;n<t.C.length;n++)if(e=t.C[n])if("function"==typeof e)i=e(),t.C[n]=i=i.result||i,n--;else if(e.h)i=e.h(),t.C[n]=i=i.result||i,n--;else if(e.then)return t.await=r;return r=t.return,t.C=[],t.return=null,e||r(i),i}function ki(t,e,i,r,n,s,o){const a=t.length;let l,h,c=[];l=Pe();for(let u,f,d,p,g=0;g<e;g++)for(let e=0;e<a;e++)if(d=t[e],g<d.length&&(u=d[g]))for(let t=0;t<u.length;t++){if(f=u[t],(h=l[f])?l[f]++:(h=0,l[f]=1),p=c[h]||(c[h]=[]),!o){let t=g+(e||!n?0:s||0);p=p[t]||(p[t]=[])}if(p.push(f),o&&i&&h===a-1&&p.length-r===i)return r?p.slice(r):p}if(t=c.length)if(n)c=c.length>1?Ti(c,i,r,o,s):(c=c[0])&&i&&c.length>i||r?c.slice(r,i+r):c;else{if(t<a)return[];if(c=c[t-1],i||r)if(o)(c.length>i||r)&&(c=c.slice(r,i+r));else{n=[];for(let t,e=0;e<c.length;e++)if(t=c[e])if(r&&t.length>r)r-=t.length;else if((i&&t.length>i||r)&&(t=t.slice(r,i+r),i-=t.length,r&&(r-=t.length)),n.push(t),!i)break;c=n}}return c}function Ti(t,e,i,r,n){const s=[],o=Pe();let a;var l=t.length;let h;if(r){for(n=l-1;n>=0;n--)if(h=(r=t[n])&&r.length)for(l=0;l<h;l++)if(a=r[l],!o[a])if(o[a]=1,i)i--;else if(s.push(a),s.length===e)return s}else for(let c,u=l-1,f=0;u>=0;u--){c=t[u];for(let t=0;t<c.length;t++)if(h=(r=c[t])&&r.length)for(let c=0;c<h;c++)if(a=r[c],!o[a])if(o[a]=1,i)i--;else{let i=(t+(u<l-1&&n||0))/(u+1)|0;if((s[i]||(s[i]=[])).push(a),++f===e)return s}}return s}function ji(t,e,i,r,n){const s=Pe(),o=[];for(let t,i=0;i<e.length;i++){t=e[i];for(let e=0;e<t.length;e++)s[t[e]]=1}if(n){for(let e,n=0;n<t.length;n++)if(e=t[n],s[e])if(r)r--;else if(o.push(e),s[e]=0,i&&0==--i)break}else for(let i,r,n=0;n<t.result.length;n++)for(i=t.result[n],e=0;e<i.length;e++)r=i[e],s[r]&&((o[n]||(o[n]=[])).push(r),s[r]=0);return o}function Ai(t){const e=[],i=Pe(),r=Pe();for(let n,s,o,a,l,h,c,u=0;u<t.length;u++){n=t[u],s=n.field,o=n.result;for(let t=0;t<o.length;t++)l=o[t],"object"!=typeof l?l={id:a=l}:a=l.id,(h=i[a])?h.push(s):(l.field=i[a]=[s],e.push(l)),(c=l.highlight)&&(h=r[a],h||(r[a]=h={},l.highlight=h),h[s]=c)}return e}function Pi(t,e,i,r,n){return(t=this.tag.get(t))&&(t=t.get(e))?((e=t.length-r)>0&&((i&&e>i||r)&&(t=t.slice(r,r+i)),n&&(t=$i.call(this,t))),t):[]}function $i(t){if(!this||!this.store)return t;if(this.db)return this.index.get(this.field[0]).db.enrich(t);const e=Array(t.length);for(let i,r=0;r<t.length;r++)i=t[r],e[r]={id:i,doc:this.store.get(i)};return e}function Oi(t){if(!this||this.constructor!==Oi)return new Oi(t);const e=t.document||t.doc||t;let i,r;if(this.B=[],this.field=[],this.D=[],this.key=(i=e.key||e.id)&&Ci(i,this.D)||"id",(r=t.keystore||0)&&(this.keystore=r),this.fastupdate=!!t.fastupdate,this.reg=!this.fastupdate||t.worker||t.db?r?new Qe(r):new Set:r?new Ze(r):new Map,this.h=(i=e.store||null)&&i&&!0!==i&&[],this.store=i?r?new Ze(r):new Map:null,this.cache=(i=t.cache||null)&&new Be(i),t.cache=!1,this.worker=t.worker||!1,this.priority=t.priority||4,this.index=Ii.call(this,t,e),this.tag=null,(i=e.tag)&&("string"==typeof i&&(i=[i]),i.length)){this.tag=new Map,this.A=[],this.F=[];for(let t,e,r=0;r<i.length;r++){if(t=i[r],e=t.field||t,!e)throw Error("The tag field from the document descriptor is undefined.");t.custom?this.A[r]=t.custom:(this.A[r]=Ci(e,this.D),t.filter&&("string"==typeof this.A[r]&&(this.A[r]=new String(this.A[r])),this.A[r].G=t.filter)),this.F[r]=e,this.tag.set(e,new Map)}}if(this.worker){this.fastupdate=!1,t=[];for(const e of this.index.values())e.then&&t.push(e);if(t.length){const e=this;return Promise.all(t).then((function(t){let i=0;for(const r of e.index.entries()){const n=r[0];let s=r[1];s.then&&(s=t[i],e.index.set(n,s),i++)}return e}))}}else t.db&&(this.fastupdate=!1,this.mount(t.db))}function Ii(t,e){const i=new Map;let r=e.index||e.field||e;$e(r)&&(r=[r]);for(let e,s,o=0;o<r.length;o++){if(e=r[o],$e(e)||(s=e,e=e.field),s=Oe(s)?Object.assign({},t,s):t,this.worker){var n=void 0;n=new ci(s,n=(n=s.encoder)&&n.encode?n:new De("string"==typeof n?We[n]:n||{})),i.set(e,n)}this.worker||i.set(e,new Ji(s,this.reg)),s.custom?this.B[o]=s.custom:(this.B[o]=Ci(e,this.D),s.filter&&("string"==typeof this.B[o]&&(this.B[o]=new String(this.B[o])),this.B[o].G=s.filter)),this.field[o]=e}if(this.h){$e(t=e.store)&&(t=[t]);for(let e,i,r=0;r<t.length;r++)e=t[r],i=e.field||e,e.custom?(this.h[r]=e.custom,e.custom.O=i):(this.h[r]=Ci(i,this.D),e.filter&&("string"==typeof this.h[r]&&(this.h[r]=new String(this.h[r])),this.h[r].G=e.filter))}return i}function Ci(t,e){const i=t.split(":");let r=0;for(let n=0;n<i.length;n++)"]"===(t=i[n])[t.length-1]&&(t=t.substring(0,t.length-2))&&(e[r]=!0),t&&(i[r++]=t);return r<i.length&&(i.length=r),r>1?i:i[0]}function Ei(t,e=0){let i=[],r=[];e&&(e=25e4/e*5e3|0);for(const n of t.entries())r.push(n),r.length===e&&(i.push(r),r=[]);return r.length&&i.push(r),i}function Mi(t,e){e||(e=new Map);for(let i,r=0;r<t.length;r++)i=t[r],e.set(i[0],i[1]);return e}function Ri(t,e=0){let i=[],r=[];e&&(e=25e4/e*1e3|0);for(const n of t.entries())r.push([n[0],Ei(n[1])[0]||[]]),r.length===e&&(i.push(r),r=[]);return r.length&&i.push(r),i}function Ni(t,e){e||(e=new Map);for(let i,r,n=0;n<t.length;n++)i=t[n],r=e.get(i[0]),e.set(i[0],Mi(i[1],r));return e}function Di(t){let e=[],i=[];for(const r of t.keys())i.push(r),25e4===i.length&&(e.push(i),i=[]);return i.length&&e.push(i),e}function zi(t,e){e||(e=new Set);for(let i=0;i<t.length;i++)e.add(t[i]);return e}function Fi(t,e,i,r,n,s,o=0){const a=r&&r.constructor===Array;var l=a?r.shift():r;if(!l)return this.export(t,e,n,s+1);if((l=t((e?e+".":"")+(o+1)+"."+i,JSON.stringify(l)))&&l.then){const h=this;return l.then((function(){return Fi.call(h,t,e,i,a?r:null,n,s,o+1)}))}return Fi.call(this,t,e,i,a?r:null,n,s,o+1)}function Bi(t,e){let i="";for(const r of t.entries()){t=r[0];const n=r[1];let s="";for(let t,i=0;i<n.length;i++){t=n[i]||[""];let r="";for(let i=0;i<t.length;i++)r+=(r?",":"")+("string"===e?'"'+t[i]+'"':t[i]);r="["+r+"]",s+=(s?",":"")+r}s='["'+t+'",['+s+"]]",i+=(i?",":"")+s}return i}function qi(t,e){let i=0;var r=void 0===e;if(t.constructor===Array){for(let n,s,o,a=0;a<t.length;a++)if((n=t[a])&&n.length){if(r)return 1;if(s=n.indexOf(e),s>=0){if(n.length>1)return n.splice(s,1),1;if(delete t[a],i)return 1;o=1}else{if(o)return 1;i++}}}else for(let n of t.entries())r=n[0],qi(n[1],e)?i++:t.delete(r);return i}ui("add"),ui("append"),ui("search"),ui("update"),ui("remove"),ui("clear"),ui("export"),ui("import"),ci.prototype.searchCache=Fe,oi(ci.prototype),Oi.prototype.add=function(t,e,i){if(Oe(t)&&(t=Ie(e=t,this.key)),e&&(t||0===t)){if(!i&&this.reg.has(t))return this.update(t,e);for(let s,o=0;o<this.field.length;o++){s=this.B[o];var r=this.index.get(this.field[o]);if("function"==typeof s){var n=s(e);n&&r.add(t,n,i,!0)}else(!(n=s.G)||n(e))&&(s.constructor===String?s=[""+s]:$e(s)&&(s=[s]),di(e,s,this.D,0,r,t,s[0],i))}if(this.tag)for(r=0;r<this.A.length;r++){var s=this.A[r];n=this.tag.get(this.F[r]);let a=Pe();if("function"==typeof s){if(!(s=s(e)))continue}else{var o=s.G;if(o&&!o(e))continue;s.constructor===String&&(s=""+s),s=Ie(e,s)}if(n&&s){$e(s)&&(s=[s]);for(let e,r,l=0;l<s.length;l++)if(e=s[l],!a[e]&&(a[e]=1,(o=n.get(e))?r=o:n.set(e,r=[]),!i||!r.includes(t))){if(r.length===2**31-1){if(o=new Je(r),this.fastupdate)for(let t of this.reg.values())t.includes(r)&&(t[t.indexOf(r)]=o);n.set(e,r=o)}r.push(t),this.fastupdate&&((o=this.reg.get(t))?o.push(r):this.reg.set(t,[r]))}}}if(this.store&&(!i||!this.store.has(t))){let r;if(this.h){r=Pe();for(let t,n=0;n<this.h.length;n++){if(t=this.h[n],(i=t.G)&&!i(e))continue;let s;if("function"==typeof t){if(s=t(e),!s)continue;t=[t.O]}else if($e(t)||t.constructor===String){r[t]=e[t];continue}fi(e,r,t,0,t[0],s)}}this.store.set(t,r||e)}this.worker&&(this.fastupdate||this.reg.add(t))}return this},Si.prototype.or=function(){return gi(this,"or",yi,arguments)},Si.prototype.and=function(){return gi(this,"and",bi,arguments)},Si.prototype.xor=function(){return gi(this,"xor",vi,arguments)},Si.prototype.not=function(){return gi(this,"not",wi,arguments)},(Te=Si.prototype).limit=function(t){if(this.await){const e=this;this.C.push((function(){return e.limit(t).result}))}else if(this.result.length){const e=[];for(let i,r=0;r<this.result.length;r++)if(i=this.result[r]){if(!(i.length<=t)){e[r]=i.slice(0,t);break}if(e[r]=i,!(t-=i.length))break}this.result=e}return this},Te.offset=function(t){if(this.await){const e=this;this.C.push((function(){return e.offset(t).result}))}else if(this.result.length){const e=[];for(let i,r=0;r<this.result.length;r++)(i=this.result[r])&&(i.length<=t?t-=i.length:(e[r]=i.slice(t),t=0));this.result=e}return this},Te.boost=function(t){if(this.await){const e=this;this.C.push((function(){return e.boost(t).result}))}else this.h+=t;return this},Te.resolve=function(t,e,i,r,n){let s=this.await?xi(this,!0):this.result;if(s.then){const o=this;return s.then((function(){return o.resolve(t,e,i,r,n)}))}return s.length&&("object"==typeof t?(r=t.highlight||this.highlight,i=!!r||t.enrich,e=t.offset,t=t.limit):(r=r||this.highlight,i=!!r||i),s=n?i?$i.call(this.index,s):s:pi.call(this.index,s,t||100,e,i)),this.finalize(s,r)},Te.finalize=function(t,e){if(t.then){const i=this;return t.then((function(t){return i.finalize(t,e)}))}e&&t.length&&this.query&&(t=_i(this.query,t,this.index.index,this.field,e));const i=this.return;return this.highlight=this.index=this.result=this.C=this.await=this.return=null,this.query=this.field="",i&&i(t),t},Oi.prototype.search=function(t,e,i,r){i||(!e&&Oe(t)?(i=t,t=""):Oe(e)&&(i=e,e=0));let n=[];var s=[];let o,a,l,h,c,u,f,d,p=0,g=!0;if(i){i.constructor===Array&&(i={index:i}),t=i.query||t,o=i.pluck,a=i.merge,h=i.boost,u=o||i.field||(u=i.index)&&(u.index?null:u);var m=this.tag&&i.tag;l=i.suggest,g=!1!==i.resolve,c=i.cache,f=g&&this.store&&i.highlight;var y=!!f||g&&this.store&&i.enrich;e=i.limit||e;var b=i.offset||0;if(e||(e=g?100:0),m&&(!this.db||!r)){m.constructor!==Array&&(m=[m]);var v=[];for(let t,e=0;e<m.length;e++)if(t=m[e],t.field&&t.tag){var w=t.tag;if(w.constructor===Array)for(var _=0;_<w.length;_++)v.push(t.field,w[_]);else v.push(t.field,w)}else{w=Object.keys(t);for(let e,i,r=0;r<w.length;r++)if(e=w[r],i=t[e],i.constructor===Array)for(_=0;_<i.length;_++)v.push(e,i[_]);else v.push(e,i)}if(m=v,!t){if(s=[],v.length)for(m=0;m<v.length;m+=2){if(this.db){if(!(r=this.index.get(v[m])))continue;s.push(r=r.db.tag(v[m+1],e,b,y))}else r=Pi.call(this,v[m],v[m+1],e,b,y);n.push(g?{field:v[m],tag:v[m+1],result:r}:[r])}if(s.length){const t=this;return Promise.all(s).then((function(e){for(let t=0;t<e.length;t++)g?n[t].result=e[t]:n[t]=e[t];return g?n:new Si(n.length>1?ki(n,1,0,0,l,h):n[0],t)}))}return g?n:new Si(n.length>1?ki(n,1,0,0,l,h):n[0],this)}}g||o||!(u=u||this.field)||($e(u)?o=u:(u.constructor===Array&&1===u.length&&(u=u[0]),o=u.field||u.index)),u&&u.constructor!==Array&&(u=[u])}u||(u=this.field),v=(this.worker||this.db)&&!r&&[];for(let o,a,h,x=0;x<u.length;x++){if(a=u[x],this.db&&this.tag&&!this.B[x])continue;let k;if($e(a)||(k=a,a=k.field,t=k.query||t,e=Ae(k.limit,e),b=Ae(k.offset,b),l=Ae(k.suggest,l),f=g&&this.store&&Ae(k.highlight,f),y=!!f||g&&this.store&&Ae(k.enrich,y),c=Ae(k.cache,c)),r)o=r[x];else{_=(w=k||i||{}).enrich;var S=this.index.get(a);if(m&&(this.db&&(w.tag=m,w.field=u,d=S.db.support_tag_search),!d&&_&&(w.enrich=!1),d||(w.limit=0,w.offset=0)),o=c?S.searchCache(t,m&&!d?0:e,w):S.search(t,m&&!d?0:e,w),m&&!d&&(w.limit=e,w.offset=b),_&&(w.enrich=_),v){v[x]=o;continue}}if(h=(o=o.result||o)&&o.length,m&&h){if(w=[],_=0,this.db&&r){if(!d)for(S=u.length;S<r.length;S++){let t=r[S];if(t&&t.length)_++,w.push(t);else if(!l)return g?n:new Si(n,this)}}else for(let t,e,i=0;i<m.length;i+=2){if(t=this.tag.get(m[i]),!t){if(l)continue;return g?n:new Si(n,this)}if(e=(t=t&&t.get(m[i+1]))&&t.length)_++,w.push(t);else if(!l)return g?n:new Si(n,this)}if(_){if(o=ji(o,w,e,b,g),h=o.length,!h&&!l)return g?o:new Si(o,this);_--}}if(h)s[p]=a,n.push(o),p++;else if(1===u.length)return g?n:new Si(n,this)}if(v){if(this.db&&m&&m.length&&!d)for(y=0;y<m.length;y+=2){if(!(s=this.index.get(m[y]))){if(l)continue;return g?n:new Si(n,this)}v.push(s.db.tag(m[y+1],e,b,!1))}const r=this;return Promise.all(v).then((function(n){return i&&(i.resolve=g),n.length&&(n=r.search(t,e,i,n)),n}))}if(!p)return g?n:new Si(n,this);if(o&&(!y||!this.store))return n=n[0],g?n:new Si(n,this);for(v=[],b=0;b<s.length;b++){if(m=n[b],y&&m.length&&void 0===m[0].doc&&(this.db?v.push(m=this.index.get(this.field[0]).db.enrich(m)):m=$i.call(this,m)),o)return g?f?_i(t,m,this.index,o,f):m:new Si(m,this);n[b]={field:s[b],result:m}}if(y&&this.db&&v.length){const e=this;return Promise.all(v).then((function(i){for(let t=0;t<i.length;t++)n[t].result=i[t];return f&&(n=_i(t,n,e.index,o,f)),a?Ai(n):n}))}return f&&(n=_i(t,n,this.index,o,f)),a?Ai(n):n},(Te=Oi.prototype).mount=function(t){let e=this.field;if(this.tag)for(let t,r=0;r<this.F.length;r++){t=this.F[r];var i=void 0;this.index.set(t,i=new Ji({},this.reg)),e===this.field&&(e=e.slice(0)),e.push(t),i.tag=this.tag.get(t)}i=[];const r={db:t.db,type:t.type,fastupdate:t.fastupdate};for(let n,s,o=0;o<e.length;o++){r.field=s=e[o],n=this.index.get(s);const a=new t.constructor(t.id,r);a.id=t.id,i[o]=a.mount(n),n.document=!0,o?n.bypass=!0:n.store=this.store}const n=this;return this.db=Promise.all(i).then((function(){n.db=!0}))},Te.commit=async function(){const t=[];for(const e of this.index.values())t.push(e.commit());await Promise.all(t),this.reg.clear()},Te.destroy=function(){const t=[];for(const e of this.index.values())t.push(e.destroy());return Promise.all(t)},Te.append=function(t,e){return this.add(t,e,!0)},Te.update=function(t,e){return this.remove(t).add(t,e)},Te.remove=function(t){for(var e of(Oe(t)&&(t=Ie(t,this.key)),this.index.values()))e.remove(t,!0);if(this.reg.has(t)){if(this.tag&&!this.fastupdate)for(let i of this.tag.values())for(let r of i){e=r[0];const n=r[1],s=n.indexOf(t);s>-1&&(n.length>1?n.splice(s,1):i.delete(e))}this.store&&this.store.delete(t),this.reg.delete(t)}return this.cache&&this.cache.remove(t),this},Te.clear=function(){const t=[];for(const e of this.index.values()){const i=e.clear();i.then&&t.push(i)}if(this.tag)for(const t of this.tag.values())t.clear();return this.store&&this.store.clear(),this.cache&&this.cache.clear(),t.length?Promise.all(t):this},Te.contain=function(t){return this.db?this.index.get(this.field[0]).db.has(t):this.reg.has(t)},Te.cleanup=function(){for(const t of this.index.values())t.cleanup();return this},Te.get=function(t){return this.db?this.index.get(this.field[0]).db.enrich(t).then((function(t){return t[0]&&t[0].doc||null})):this.store.get(t)||null},Te.set=function(t,e){return"object"==typeof t&&(t=Ie(e=t,this.key)),this.store.set(t,e),this},Te.searchCache=Fe,Te.export=function(t,e,i=0,r=0){if(i<this.field.length){const n=this.field[i];if((e=this.index.get(n).export(t,n,i,r=1))&&e.then){const r=this;return e.then((function(){return r.export(t,n,i+1)}))}return this.export(t,n,i+1)}let n,s;switch(r){case 0:n="reg",s=Di(this.reg),e=null;break;case 1:n="tag",s=this.tag&&Ri(this.tag,this.reg.size),e=null;break;case 2:n="doc",s=this.store&&Ei(this.store),e=null;break;default:return}return Fi.call(this,t,e,n,s||null,i,r)},Te.import=function(t,e){var i=t.split(".");"json"===i[i.length-1]&&i.pop();const r=i.length>2?i[0]:"";if(i=i.length>2?i[2]:i[1],this.worker&&r)return this.index.get(r).import(t);if(e){if("string"==typeof e&&(e=JSON.parse(e)),r)return this.index.get(r).import(i,e);switch(i){case"reg":this.fastupdate=!1,this.reg=zi(e,this.reg);for(let t,e=0;e<this.field.length;e++)t=this.index.get(this.field[e]),t.fastupdate=!1,t.reg=this.reg;if(this.worker){e=[];for(const i of this.index.values())e.push(i.import(t));return Promise.all(e)}break;case"tag":this.tag=Ni(e,this.tag);break;case"doc":this.store=Mi(e,this.store)}}},oi(Oi.prototype),Ji.prototype.remove=function(t,e){const i=this.reg.size&&(this.fastupdate?this.reg.get(t):this.reg.has(t));if(i){if(this.fastupdate){for(let e,r,n=0;n<i.length;n++)if((e=i[n])&&(r=e.length))if(e[r-1]===t)e.pop();else{const i=e.indexOf(t);i>=0&&e.splice(i,1)}}else qi(this.map,t),this.depth&&qi(this.ctx,t);e||this.reg.delete(t)}return this.db&&(this.commit_task.push({del:t}),this.M&&Zi(this)),this.cache&&this.cache.remove(t),this};const Li={memory:{resolution:1},performance:{resolution:3,fastupdate:!0,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};function Ui(t,e,i,r,n,s,o){let a,l;if(!(a=e[i])||o&&!a[o]){if(o?((e=a||(e[i]=Pe()))[o]=1,l=t.ctx,(a=l.get(o))?l=a:l.set(o,l=t.keystore?new Ze(t.keystore):new Map)):(l=t.map,e[i]=1),(a=l.get(i))?l=a:l.set(i,l=a=[]),s)for(let i,s=0;s<a.length;s++)if((i=a[s])&&i.includes(n)){if(s<=r)return;i.splice(i.indexOf(n),1),t.fastupdate&&(e=t.reg.get(n))&&e.splice(e.indexOf(i),1);break}if(l=l[r]||(l[r]=[]),l.push(n),l.length===2**31-1){if(e=new Je(l),t.fastupdate)for(let i of t.reg.values())i.includes(l)&&(i[i.indexOf(l)]=e);a[r]=l=e}t.fastupdate&&((r=t.reg.get(n))?r.push(l):t.reg.set(n,[l]))}}function Vi(t,e,i,r,n){return i&&t>1?e+(r||0)<=t?i+(n||0):(t-1)/(e+(r||0))*(i+(n||0))+1|0:0}function Hi(t,e,i,r,n,s,o){let a=t.length,l=t;if(a>1)l=ki(t,e,i,r,n,s,o);else if(1===a)return o?pi.call(null,t[0],i,r):new Si(t[0],this);return o?l:new Si(l,this)}function Gi(t,e,i,r,n,s,o){return t=Ki(this,t,e,i,r,n,s,o),this.db?t.then((function(t){return n?t||[]:new Si(t,this)})):t&&t.length?n?pi.call(this,t,i,r):new Si(t,this):n?[]:new Si([],this)}function Wi(t,e,i,r){let n=[];if(t&&t.length){if(t.length<=r)return void e.push(t);for(let e,i=0;i<r;i++)(e=t[i])&&(n[i]=e);if(n.length)return void e.push(n)}if(!i)return n}function Ki(t,e,i,r,n,s,o,a){let l;return i&&(l=t.bidirectional&&e>i)&&(l=i,i=e,e=l),t.db?t.db.get(e,i,r,n,s,o,a):t=i?(t=t.ctx.get(i))&&t.get(e):t.map.get(e)}function Ji(t,e){if(!this||this.constructor!==Ji)return new Ji(t);if(t){var i=$e(t)?t:t.preset;i&&(t=Object.assign({},Li[i],t))}else t={};const r=!0===(i=t.context)?{depth:1}:i||{},n=$e(t.encoder)?We[t.encoder]:t.encode||t.encoder||{};this.encoder=n.encode?n:"object"==typeof n?new De(n):{encode:n},this.resolution=t.resolution||9,this.tokenize=i=(i=t.tokenize)&&"default"!==i&&"exact"!==i&&i||"strict",this.depth="strict"===i&&r.depth||0,this.bidirectional=!1!==r.bidirectional,this.fastupdate=!!t.fastupdate,this.score=t.score||null,(i=t.keystore||0)&&(this.keystore=i),this.map=i?new Ze(i):new Map,this.ctx=i?new Ze(i):new Map,this.reg=e||(this.fastupdate?i?new Ze(i):new Map:i?new Qe(i):new Set),this.N=r.resolution||3,this.rtl=n.rtl||t.rtl||!1,this.cache=(i=t.cache||null)&&new Be(i),this.resolve=!1!==t.resolve,(i=t.db)&&(this.db=this.mount(i)),this.M=!1!==t.commit,this.commit_task=[],this.commit_timer=null,this.priority=t.priority||4}function Zi(t){t.commit_timer||(t.commit_timer=setTimeout((function(){t.commit_timer=null,t.db.commit(t)}),1))}Ji.prototype.add=function(t,e,i,r){if(e&&(t||0===t)){if(!r&&!i&&this.reg.has(t))return this.update(t,e);r=this.depth;const h=(e=this.encoder.encode(e,!r)).length;if(h){const c=Pe(),u=Pe(),f=this.resolution;for(let d=0;d<h;d++){let p=e[this.rtl?h-1-d:d];var n=p.length;if(n&&(r||!u[p])){var s=this.score?this.score(e,p,d,null,0):Vi(f,h,d),o="";switch(this.tokenize){case"tolerant":if(Ui(this,u,p,s,t,i),n>2){for(let e,r,a,l,h=1;h<n-1;h++)e=p.charAt(h),r=p.charAt(h+1),a=p.substring(0,h)+r,l=p.substring(h+2),Ui(this,u,o=a+e+l,s,t,i),Ui(this,u,o=a+l,s,t,i);Ui(this,u,p.substring(0,p.length-1),s,t,i)}break;case"full":if(n>2){for(let r,l=0;l<n;l++)for(s=n;s>l;s--){o=p.substring(l,s),r=this.rtl?n-1-l:l;var a=this.score?this.score(e,p,d,o,r):Vi(f,h,d,n,r);Ui(this,u,o,a,t,i)}break}case"bidirectional":case"reverse":if(n>1){for(a=n-1;a>0;a--){o=p[this.rtl?n-1-a:a]+o;var l=this.score?this.score(e,p,d,o,a):Vi(f,h,d,n,a);Ui(this,u,o,l,t,i)}o=""}case"forward":if(n>1){for(a=0;a<n;a++)Ui(this,u,o+=p[this.rtl?n-1-a:a],s,t,i);break}default:if(Ui(this,u,p,s,t,i),r&&h>1&&d<h-1)for(n=this.N,o=p,s=Math.min(r+1,this.rtl?d+1:h-d),a=1;a<s;a++){p=e[this.rtl?h-1-d-a:d+a];Ui(this,c,(l=this.bidirectional&&p>o)?o:p,this.score?this.score(e,o,d,p,a-1):Vi(n+(h/2>n?0:1),h,d,s-1,a-1),t,i,l?p:o)}}}}this.fastupdate||this.reg.add(t)}}return this.db&&(this.commit_task.push(i?{ins:t}:{del:t}),this.M&&Zi(this)),this},Ji.prototype.search=function(t,e,i){if(i||(e||"object"!=typeof t?"object"==typeof e&&(i=e,e=0):(i=t,t="")),i&&i.cache)return i.cache=!1,t=this.searchCache(t,e,i),i.cache=!0,t;let r,n,s,o,a,l,h,c,u=[],f=0;i&&(t=i.query||t,e=i.limit||e,f=i.offset||0,n=i.context,s=i.suggest,c=(o=i.resolve)&&i.enrich,l=i.boost,h=i.resolution,a=this.db&&i.tag),void 0===o&&(o=this.resolve),n=this.depth&&!1!==n;let d=this.encoder.encode(t,!n);if(r=d.length,e=e||(o?100:0),1===r)return Gi.call(this,d[0],"",e,f,o,c,a);if(2===r&&n&&!s)return Gi.call(this,d[1],d[0],e,f,o,c,a);let p,g=Pe(),m=0;if(n&&(p=d[0],m=1),h||0===h||(h=p?this.N:this.resolution),this.db){if(this.db.search&&!1!==(i=this.db.search(this,d,e,f,s,o,c,a)))return i;const t=this;return async function(){for(let e,i;m<r;m++){if((i=d[m])&&!g[i]){if(g[i]=1,e=await Ki(t,i,p,0,0,!1,!1),e=Wi(e,u,s,h)){u=e;break}p&&(s&&e&&u.length||(p=i))}s&&p&&m===r-1&&!u.length&&(h=t.resolution,p="",m=-1,g=Pe())}return Hi(u,h,e,f,s,l,o)}()}for(let t,e;m<r;m++){if((e=d[m])&&!g[e]){if(g[e]=1,t=Ki(this,e,p,0,0,!1,!1),t=Wi(t,u,s,h)){u=t;break}p&&(s&&t&&u.length||(p=e))}s&&p&&m===r-1&&!u.length&&(h=this.resolution,p="",m=-1,g=Pe())}return Hi(u,h,e,f,s,l,o)},(Te=Ji.prototype).mount=function(t){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),t.mount(this)},Te.commit=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.commit(this)},Te.destroy=function(){return this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null),this.db.destroy()},Te.clear=function(){return this.map.clear(),this.ctx.clear(),this.reg.clear(),this.cache&&this.cache.clear(),this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this},Te.append=function(t,e){return this.add(t,e,!0)},Te.contain=function(t){return this.db?this.db.has(t):this.reg.has(t)},Te.update=function(t,e){const i=this,r=this.remove(t);return r&&r.then?r.then((()=>i.add(t,e))):this.add(t,e)},Te.cleanup=function(){return this.fastupdate?(qi(this.map),this.depth&&qi(this.ctx),this):this},Te.searchCache=Fe,Te.export=function(t,e,i=0,r=0){let n,s;switch(r){case 0:n="reg",s=Di(this.reg);break;case 1:n="cfg",s=null;break;case 2:n="map",s=Ei(this.map,this.reg.size);break;case 3:n="ctx",s=Ri(this.ctx,this.reg.size);break;default:return}return Fi.call(this,t,e,n,s,i,r)},Te.import=function(t,e){if(e)switch("string"==typeof e&&(e=JSON.parse(e)),t=t.split("."),"json"===t[t.length-1]&&t.pop(),3===t.length&&t.shift(),t=t.length>1?t[1]:t[0],t){case"reg":this.fastupdate=!1,this.reg=zi(e,this.reg);break;case"map":this.map=Mi(e,this.map);break;case"ctx":this.ctx=Ni(e,this.ctx)}},Te.serialize=function(t=!0){let e="",i="",r="";if(this.reg.size){let t;for(var n of this.reg.keys())t||(t=typeof n),e+=(e?",":"")+("string"===t?'"'+n+'"':n);e="index.reg=new Set(["+e+"]);",i=Bi(this.map,t),i="index.map=new Map(["+i+"]);";for(const e of this.ctx.entries()){n=e[0];let i=Bi(e[1],t);i="new Map(["+i+"])",i='["'+n+'",'+i+"]",r+=(r?",":"")+i}r="index.ctx=new Map(["+r+"]);"}return t?"function inject(index){"+e+i+r+"}":e+i+r},oi(Ji.prototype);const Qi="undefined"!=typeof window&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Xi=["map","ctx","tag","reg","cfg"],Yi=Pe();function tr(t,e,i){const r=t.value;let n,s=0;for(let t,o=0;o<r.length;o++){if(t=i?r:r[o]){for(let i,s,a=0;a<e.length;a++)if(s=e[a],i=t.indexOf(s),i>=0){if(n=1,!(t.length>1)){r[o]=[];break}t.splice(i,1)}s+=t.length}if(i)break}s?n&&t.update(r):t.delete(),t.continue()}function er(t,e){return new Promise(((i,r)=>{t.onsuccess=t.oncomplete=function(){e&&e(this.result),e=null,i(this.result)},t.onerror=t.onblocked=r,t=null}))}Te=function t(e,i={}){if(!this||this.constructor!==t)return new t(e,i);"object"==typeof e&&(i=e,e=e.name),e||console.info("Default storage space was used, because a name was not passed."),this.id="flexsearch"+(e?":"+e.toLowerCase().replace(/[^a-z0-9_\-]/g,""):""),this.field=i.field?i.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"",this.type=i.type,this.fastupdate=this.support_tag_search=!1,this.db=null,this.h={}}.prototype,Te.mount=function(t){return t.index?t.mount(this):(t.db=this,this.open())},Te.open=function(){if(this.db)return this.db;let t=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist(),Yi[t.id]||(Yi[t.id]=[]),Yi[t.id].push(t.field);const e=Qi.open(t.id,1);return e.onupgradeneeded=function(){const e=t.db=this.result;for(let i,r=0;r<Xi.length;r++){i=Xi[r];for(let r,n=0;n<Yi[t.id].length;n++)r=Yi[t.id][n],e.objectStoreNames.contains(i+("reg"!==i&&r?":"+r:""))||e.createObjectStore(i+("reg"!==i&&r?":"+r:""))}},t.db=er(e,(function(e){t.db=e,t.db.onversionchange=function(){t.close()}}))},Te.close=function(){this.db&&this.db.close(),this.db=null},Te.destroy=function(){return er(Qi.deleteDatabase(this.id))},Te.clear=function(){const t=[];for(let e,i=0;i<Xi.length;i++){e=Xi[i];for(let i,r=0;r<Yi[this.id].length;r++)i=Yi[this.id][r],t.push(e+("reg"!==e&&i?":"+i:""))}const e=this.db.transaction(t,"readwrite");for(let i=0;i<t.length;i++)e.objectStore(t[i]).clear();return er(e)},Te.get=function(t,e,i=0,r=0,n=!0,s=!1){t=this.db.transaction((e?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((e?"ctx":"map")+(this.field?":"+this.field:"")).get(e?e+":"+t:t);const o=this;return er(t).then((function(t){let e=[];if(!t||!t.length)return e;if(n){if(!i&&!r&&1===t.length)return t[0];for(let n,s=0;s<t.length;s++)if((n=t[s])&&n.length){if(r>=n.length){r-=n.length;continue}const t=i?r+Math.min(n.length-r,i):n.length;for(let i=r;i<t;i++)e.push(n[i]);if(r=0,e.length===i)break}return s?o.enrich(e):e}return t}))},Te.tag=function(t,e=0,i=0,r=!1){t=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(t);const n=this;return er(t).then((function(t){return!t||!t.length||i>=t.length?[]:e||i?(t=t.slice(i,i+e),r?n.enrich(t):t):t}))},Te.enrich=function(t){"object"!=typeof t&&(t=[t]);const e=this.db.transaction("reg","readonly").objectStore("reg"),i=[];for(let r=0;r<t.length;r++)i[r]=er(e.get(t[r]));return Promise.all(i).then((function(e){for(let i=0;i<e.length;i++)e[i]={id:t[i],doc:e[i]?JSON.parse(e[i]):null};return e}))},Te.has=function(t){return er(t=this.db.transaction("reg","readonly").objectStore("reg").getKey(t)).then((function(t){return!!t}))},Te.search=null,Te.info=function(){},Te.transaction=function(t,e,i){t+="reg"!==t&&this.field?":"+this.field:"";let r=this.h[t+":"+e];if(r)return i.call(this,r);let n=this.db.transaction(t,e);this.h[t+":"+e]=r=n.objectStore(t);const s=i.call(this,r);return this.h[t+":"+e]=null,er(n).finally((function(){return s}))},Te.commit=async function(t){let e=t.commit_task,i=[];t.commit_task=[];for(let t,r=0;r<e.length;r++)t=e[r],t.del&&i.push(t.del);i.length&&await this.remove(i),t.reg.size&&(await this.transaction("map","readwrite",(function(e){for(const i of t.map){const t=i[0],r=i[1];r.length&&(e.get(t).onsuccess=function(){let i=this.result;var n;if(i&&i.length){const t=Math.max(i.length,r.length);for(let e,s,o=0;o<t;o++)if((s=r[o])&&s.length){if((e=i[o])&&e.length)for(n=0;n<s.length;n++)e.push(s[n]);else i[o]=s;n=1}}else i=r,n=1;n&&e.put(i,t)})}})),await this.transaction("ctx","readwrite",(function(e){for(const i of t.ctx){const t=i[0],r=i[1];for(const i of r){const r=i[0],n=i[1];n.length&&(e.get(t+":"+r).onsuccess=function(){let i=this.result;var s;if(i&&i.length){const t=Math.max(i.length,n.length);for(let e,r,o=0;o<t;o++)if((r=n[o])&&r.length){if((e=i[o])&&e.length)for(s=0;s<r.length;s++)e.push(r[s]);else i[o]=r;s=1}}else i=n,s=1;s&&e.put(i,t+":"+r)})}}})),t.store?await this.transaction("reg","readwrite",(function(e){for(const i of t.store){const t=i[0],r=i[1];e.put("object"==typeof r?JSON.stringify(r):1,t)}})):t.bypass||await this.transaction("reg","readwrite",(function(e){for(const i of t.reg.keys())e.put(1,i)})),t.tag&&await this.transaction("tag","readwrite",(function(e){for(const i of t.tag){const t=i[0],r=i[1];r.length&&(e.get(t).onsuccess=function(){let i=this.result;i=i&&i.length?i.concat(r):r,e.put(i,t)})}})),t.map.clear(),t.ctx.clear(),t.tag&&t.tag.clear(),t.store&&t.store.clear(),t.document||t.reg.clear())},Te.remove=function(t){return"object"!=typeof t&&(t=[t]),Promise.all([this.transaction("map","readwrite",(function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&tr(e,t)}})),this.transaction("ctx","readwrite",(function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&tr(e,t)}})),this.transaction("tag","readwrite",(function(e){e.openCursor().onsuccess=function(){const e=this.result;e&&tr(e,t,!0)}})),this.transaction("reg","readwrite",(function(e){for(let i=0;i<t.length;i++)e.delete(t[i])}))])};const ir=We,rr=De,nr=Oi;async function sr(){const t=new nr({document:{id:"id",store:!0,index:[{field:"name",tokenize:"bidirectional",priority:9,encoder:new rr(ir.LatinBalance).assign({normalize(t){let e=t.replace(/\d+/g," ").split(/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/);return e.length>1&&e.push(t),e.join(" ").toLowerCase()}})},{field:"comment",tokenize:"default",encoder:ir.LatinSoundex}],tag:[]}}),e=`${document.documentElement.dataset.base}assets/oxide`,i=await async function(t){const e=await fetch(t),i=(await e.blob()).stream().pipeThrough(new DecompressionStream("deflate"));return await new Response(i).json()}(`${e}/search-index.deflate`);for(const[e,r]of Object.entries(i))t.import(e,r);return t}document.addEventListener("DOMContentLoaded",(async()=>{const t=document.querySelector("rustdoc-search .search-form"),e=document.querySelector("rustdoc-search .search-input"),i=document.getElementById("main-content"),r=document.getElementById("alternative-display");let n,s;t.addEventListener("submit",(t=>{t.preventDefault(),t.stopImmediatePropagation(),t.stopPropagation()}),!0),e.addEventListener("focus",(t=>{t.stopImmediatePropagation(),t.stopPropagation()}),!0),e.addEventListener("input",function(t,e,i){var r=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return At(i)&&(r="leading"in i?!!i.leading:r,n="trailing"in i?!!i.trailing:n),Nt(t,e,{leading:r,maxWait:e,trailing:n})}((async t=>{n||(n=sr());const e=t.target.value?.trim(),[o,a]=e?[i,r]:[r,i];o.classList.add("hidden"),a.classList.remove("hidden"),s?.abort(),s=new AbortController;const l=s.signal;await async function(t,e,i){if(e.aborted||!t.length)return;const r=await i.search({query:t,enrich:!0,merge:!0});if(e.aborted)return;const n=document.querySelector('meta[name="rustdoc-vars"]'),s=document.querySelector("oxide-search-results#search");s.loading=!1,s.project=n.dataset.currentCrate,s.query=t,s.items=r.map((t=>t.doc)).filter((t=>null!=t))}(e,l,await n)}),300))})),(()=>{let t,r,n,s,o,a,l=[ht("oxide-search-results")],h=[],c=at,u=[],f=[],d=[],p=[],g=[],m=[],y=[],b=[];var v=class extends c{static{r=this}static{const i="function"==typeof Symbol&&Symbol.metadata?Object.create(c[Symbol.metadata]??null):void 0;n=[ft({attribute:!1})],s=[ft({attribute:!1})],o=[ft({attribute:!1})],a=[ft({attribute:!1})],e(this,null,n,{kind:"accessor",name:"loading",static:!1,private:!1,access:{has:t=>"loading"in t,get:t=>t.loading,set:(t,e)=>{t.loading=e}},metadata:i},u,f),e(this,null,s,{kind:"accessor",name:"project",static:!1,private:!1,access:{has:t=>"project"in t,get:t=>t.project,set:(t,e)=>{t.project=e}},metadata:i},d,p),e(this,null,o,{kind:"accessor",name:"query",static:!1,private:!1,access:{has:t=>"query"in t,get:t=>t.query,set:(t,e)=>{t.query=e}},metadata:i},g,m),e(this,null,a,{kind:"accessor",name:"items",static:!1,private:!1,access:{has:t=>"items"in t,get:t=>t.items,set:(t,e)=>{t.items=e}},metadata:i},y,b),e(null,t={value:r},l,{kind:"class",name:r.name,metadata:i},null,h),v=r=t.value,i&&Object.defineProperty(r,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:i})}static base=document.documentElement.dataset.base;static classes={[Yt.ClassMember]:"fn",[Yt.Function]:"fn",[Yt.Property]:"fn",[Yt.Method]:"fn",[Yt.CallSignature]:"fn",[Yt.IndexSignature]:"fn",[Yt.GetSignature]:"fn",[Yt.SetSignature]:"fn",[Yt.Accessor]:"fn",[Yt.ConstructorSignature]:"primitive",[Yt.Constructor]:"primitive",[Yt.EnumMember]:"macro",[Yt.Variable]:"macro"};#t=i(this,u,!0);get loading(){return this.#t}set loading(t){this.#t=t}#e=(i(this,f),i(this,d,""));get project(){return this.#e}set project(t){this.#e=t}#i=(i(this,p),i(this,g,""));get query(){return this.#i}set query(t){this.#i=t}#r=(i(this,m),i(this,y,[]));get items(){return this.#r}set items(t){this.#r=t}createRenderRoot(){return this}render(){if(this.loading)return U`
|
|
104
|
+
*/
|
|
105
|
+
function*o(o,f){if(void 0!==o){let i=0;for(const t of o)yield f(t,i++);}}
|
|
106
|
+
|
|
107
|
+
/** Detect free variable `global` from Node.js. */
|
|
108
|
+
var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
|
|
109
|
+
|
|
110
|
+
/** Detect free variable `self`. */
|
|
111
|
+
var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
|
|
112
|
+
|
|
113
|
+
/** Used as a reference to the global object. */
|
|
114
|
+
var root = freeGlobal || freeSelf || Function('return this')();
|
|
115
|
+
|
|
116
|
+
/** Built-in value references. */
|
|
117
|
+
var Symbol$1 = root.Symbol;
|
|
118
|
+
|
|
119
|
+
/** Used for built-in method references. */
|
|
120
|
+
var objectProto$1 = Object.prototype;
|
|
121
|
+
|
|
122
|
+
/** Used to check objects for own properties. */
|
|
123
|
+
var hasOwnProperty = objectProto$1.hasOwnProperty;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Used to resolve the
|
|
127
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
128
|
+
* of values.
|
|
129
|
+
*/
|
|
130
|
+
var nativeObjectToString$1 = objectProto$1.toString;
|
|
131
|
+
|
|
132
|
+
/** Built-in value references. */
|
|
133
|
+
var symToStringTag$1 = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.
|
|
137
|
+
*
|
|
138
|
+
* @private
|
|
139
|
+
* @param {*} value The value to query.
|
|
140
|
+
* @returns {string} Returns the raw `toStringTag`.
|
|
141
|
+
*/
|
|
142
|
+
function getRawTag(value) {
|
|
143
|
+
var isOwn = hasOwnProperty.call(value, symToStringTag$1),
|
|
144
|
+
tag = value[symToStringTag$1];
|
|
145
|
+
|
|
146
|
+
try {
|
|
147
|
+
value[symToStringTag$1] = undefined;
|
|
148
|
+
var unmasked = true;
|
|
149
|
+
} catch (e) {}
|
|
150
|
+
|
|
151
|
+
var result = nativeObjectToString$1.call(value);
|
|
152
|
+
if (unmasked) {
|
|
153
|
+
if (isOwn) {
|
|
154
|
+
value[symToStringTag$1] = tag;
|
|
155
|
+
} else {
|
|
156
|
+
delete value[symToStringTag$1];
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
return result;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/** Used for built-in method references. */
|
|
163
|
+
var objectProto = Object.prototype;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Used to resolve the
|
|
167
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
168
|
+
* of values.
|
|
169
|
+
*/
|
|
170
|
+
var nativeObjectToString = objectProto.toString;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Converts `value` to a string using `Object.prototype.toString`.
|
|
174
|
+
*
|
|
175
|
+
* @private
|
|
176
|
+
* @param {*} value The value to convert.
|
|
177
|
+
* @returns {string} Returns the converted string.
|
|
178
|
+
*/
|
|
179
|
+
function objectToString(value) {
|
|
180
|
+
return nativeObjectToString.call(value);
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** `Object#toString` result references. */
|
|
184
|
+
var nullTag = '[object Null]',
|
|
185
|
+
undefinedTag = '[object Undefined]';
|
|
186
|
+
|
|
187
|
+
/** Built-in value references. */
|
|
188
|
+
var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : undefined;
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* The base implementation of `getTag` without fallbacks for buggy environments.
|
|
192
|
+
*
|
|
193
|
+
* @private
|
|
194
|
+
* @param {*} value The value to query.
|
|
195
|
+
* @returns {string} Returns the `toStringTag`.
|
|
196
|
+
*/
|
|
197
|
+
function baseGetTag(value) {
|
|
198
|
+
if (value == null) {
|
|
199
|
+
return value === undefined ? undefinedTag : nullTag;
|
|
200
|
+
}
|
|
201
|
+
return (symToStringTag && symToStringTag in Object(value))
|
|
202
|
+
? getRawTag(value)
|
|
203
|
+
: objectToString(value);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
208
|
+
* and has a `typeof` result of "object".
|
|
209
|
+
*
|
|
210
|
+
* @static
|
|
211
|
+
* @memberOf _
|
|
212
|
+
* @since 4.0.0
|
|
213
|
+
* @category Lang
|
|
214
|
+
* @param {*} value The value to check.
|
|
215
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
216
|
+
* @example
|
|
217
|
+
*
|
|
218
|
+
* _.isObjectLike({});
|
|
219
|
+
* // => true
|
|
220
|
+
*
|
|
221
|
+
* _.isObjectLike([1, 2, 3]);
|
|
222
|
+
* // => true
|
|
223
|
+
*
|
|
224
|
+
* _.isObjectLike(_.noop);
|
|
225
|
+
* // => false
|
|
226
|
+
*
|
|
227
|
+
* _.isObjectLike(null);
|
|
228
|
+
* // => false
|
|
229
|
+
*/
|
|
230
|
+
function isObjectLike(value) {
|
|
231
|
+
return value != null && typeof value == 'object';
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
/** `Object#toString` result references. */
|
|
235
|
+
var symbolTag = '[object Symbol]';
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Checks if `value` is classified as a `Symbol` primitive or object.
|
|
239
|
+
*
|
|
240
|
+
* @static
|
|
241
|
+
* @memberOf _
|
|
242
|
+
* @since 4.0.0
|
|
243
|
+
* @category Lang
|
|
244
|
+
* @param {*} value The value to check.
|
|
245
|
+
* @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
|
|
246
|
+
* @example
|
|
247
|
+
*
|
|
248
|
+
* _.isSymbol(Symbol.iterator);
|
|
249
|
+
* // => true
|
|
250
|
+
*
|
|
251
|
+
* _.isSymbol('abc');
|
|
252
|
+
* // => false
|
|
253
|
+
*/
|
|
254
|
+
function isSymbol(value) {
|
|
255
|
+
return typeof value == 'symbol' ||
|
|
256
|
+
(isObjectLike(value) && baseGetTag(value) == symbolTag);
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** Used to match a single whitespace character. */
|
|
260
|
+
var reWhitespace = /\s/;
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace
|
|
264
|
+
* character of `string`.
|
|
265
|
+
*
|
|
266
|
+
* @private
|
|
267
|
+
* @param {string} string The string to inspect.
|
|
268
|
+
* @returns {number} Returns the index of the last non-whitespace character.
|
|
269
|
+
*/
|
|
270
|
+
function trimmedEndIndex(string) {
|
|
271
|
+
var index = string.length;
|
|
272
|
+
|
|
273
|
+
while (index-- && reWhitespace.test(string.charAt(index))) {}
|
|
274
|
+
return index;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
/** Used to match leading whitespace. */
|
|
278
|
+
var reTrimStart = /^\s+/;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* The base implementation of `_.trim`.
|
|
282
|
+
*
|
|
283
|
+
* @private
|
|
284
|
+
* @param {string} string The string to trim.
|
|
285
|
+
* @returns {string} Returns the trimmed string.
|
|
286
|
+
*/
|
|
287
|
+
function baseTrim(string) {
|
|
288
|
+
return string
|
|
289
|
+
? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')
|
|
290
|
+
: string;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
/**
|
|
294
|
+
* Checks if `value` is the
|
|
295
|
+
* [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
|
|
296
|
+
* of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
|
|
297
|
+
*
|
|
298
|
+
* @static
|
|
299
|
+
* @memberOf _
|
|
300
|
+
* @since 0.1.0
|
|
301
|
+
* @category Lang
|
|
302
|
+
* @param {*} value The value to check.
|
|
303
|
+
* @returns {boolean} Returns `true` if `value` is an object, else `false`.
|
|
304
|
+
* @example
|
|
305
|
+
*
|
|
306
|
+
* _.isObject({});
|
|
307
|
+
* // => true
|
|
308
|
+
*
|
|
309
|
+
* _.isObject([1, 2, 3]);
|
|
310
|
+
* // => true
|
|
311
|
+
*
|
|
312
|
+
* _.isObject(_.noop);
|
|
313
|
+
* // => true
|
|
314
|
+
*
|
|
315
|
+
* _.isObject(null);
|
|
316
|
+
* // => false
|
|
317
|
+
*/
|
|
318
|
+
function isObject(value) {
|
|
319
|
+
var type = typeof value;
|
|
320
|
+
return value != null && (type == 'object' || type == 'function');
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
/** Used as references for various `Number` constants. */
|
|
324
|
+
var NAN = 0 / 0;
|
|
325
|
+
|
|
326
|
+
/** Used to detect bad signed hexadecimal string values. */
|
|
327
|
+
var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
|
|
328
|
+
|
|
329
|
+
/** Used to detect binary string values. */
|
|
330
|
+
var reIsBinary = /^0b[01]+$/i;
|
|
331
|
+
|
|
332
|
+
/** Used to detect octal string values. */
|
|
333
|
+
var reIsOctal = /^0o[0-7]+$/i;
|
|
334
|
+
|
|
335
|
+
/** Built-in method references without a dependency on `root`. */
|
|
336
|
+
var freeParseInt = parseInt;
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* Converts `value` to a number.
|
|
340
|
+
*
|
|
341
|
+
* @static
|
|
342
|
+
* @memberOf _
|
|
343
|
+
* @since 4.0.0
|
|
344
|
+
* @category Lang
|
|
345
|
+
* @param {*} value The value to process.
|
|
346
|
+
* @returns {number} Returns the number.
|
|
347
|
+
* @example
|
|
348
|
+
*
|
|
349
|
+
* _.toNumber(3.2);
|
|
350
|
+
* // => 3.2
|
|
351
|
+
*
|
|
352
|
+
* _.toNumber(Number.MIN_VALUE);
|
|
353
|
+
* // => 5e-324
|
|
354
|
+
*
|
|
355
|
+
* _.toNumber(Infinity);
|
|
356
|
+
* // => Infinity
|
|
357
|
+
*
|
|
358
|
+
* _.toNumber('3.2');
|
|
359
|
+
* // => 3.2
|
|
360
|
+
*/
|
|
361
|
+
function toNumber(value) {
|
|
362
|
+
if (typeof value == 'number') {
|
|
363
|
+
return value;
|
|
364
|
+
}
|
|
365
|
+
if (isSymbol(value)) {
|
|
366
|
+
return NAN;
|
|
367
|
+
}
|
|
368
|
+
if (isObject(value)) {
|
|
369
|
+
var other = typeof value.valueOf == 'function' ? value.valueOf() : value;
|
|
370
|
+
value = isObject(other) ? (other + '') : other;
|
|
371
|
+
}
|
|
372
|
+
if (typeof value != 'string') {
|
|
373
|
+
return value === 0 ? value : +value;
|
|
374
|
+
}
|
|
375
|
+
value = baseTrim(value);
|
|
376
|
+
var isBinary = reIsBinary.test(value);
|
|
377
|
+
return (isBinary || reIsOctal.test(value))
|
|
378
|
+
? freeParseInt(value.slice(2), isBinary ? 2 : 8)
|
|
379
|
+
: (reIsBadHex.test(value) ? NAN : +value);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Gets the timestamp of the number of milliseconds that have elapsed since
|
|
384
|
+
* the Unix epoch (1 January 1970 00:00:00 UTC).
|
|
385
|
+
*
|
|
386
|
+
* @static
|
|
387
|
+
* @memberOf _
|
|
388
|
+
* @since 2.4.0
|
|
389
|
+
* @category Date
|
|
390
|
+
* @returns {number} Returns the timestamp.
|
|
391
|
+
* @example
|
|
392
|
+
*
|
|
393
|
+
* _.defer(function(stamp) {
|
|
394
|
+
* console.log(_.now() - stamp);
|
|
395
|
+
* }, _.now());
|
|
396
|
+
* // => Logs the number of milliseconds it took for the deferred invocation.
|
|
397
|
+
*/
|
|
398
|
+
var now = function() {
|
|
399
|
+
return root.Date.now();
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
/** Error message constants. */
|
|
403
|
+
var FUNC_ERROR_TEXT$1 = 'Expected a function';
|
|
404
|
+
|
|
405
|
+
/* Built-in method references for those with the same name as other `lodash` methods. */
|
|
406
|
+
var nativeMax = Math.max,
|
|
407
|
+
nativeMin = Math.min;
|
|
408
|
+
|
|
409
|
+
/**
|
|
410
|
+
* Creates a debounced function that delays invoking `func` until after `wait`
|
|
411
|
+
* milliseconds have elapsed since the last time the debounced function was
|
|
412
|
+
* invoked. The debounced function comes with a `cancel` method to cancel
|
|
413
|
+
* delayed `func` invocations and a `flush` method to immediately invoke them.
|
|
414
|
+
* Provide `options` to indicate whether `func` should be invoked on the
|
|
415
|
+
* leading and/or trailing edge of the `wait` timeout. The `func` is invoked
|
|
416
|
+
* with the last arguments provided to the debounced function. Subsequent
|
|
417
|
+
* calls to the debounced function return the result of the last `func`
|
|
418
|
+
* invocation.
|
|
419
|
+
*
|
|
420
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
421
|
+
* invoked on the trailing edge of the timeout only if the debounced function
|
|
422
|
+
* is invoked more than once during the `wait` timeout.
|
|
423
|
+
*
|
|
424
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
425
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
426
|
+
*
|
|
427
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
428
|
+
* for details over the differences between `_.debounce` and `_.throttle`.
|
|
429
|
+
*
|
|
430
|
+
* @static
|
|
431
|
+
* @memberOf _
|
|
432
|
+
* @since 0.1.0
|
|
433
|
+
* @category Function
|
|
434
|
+
* @param {Function} func The function to debounce.
|
|
435
|
+
* @param {number} [wait=0] The number of milliseconds to delay.
|
|
436
|
+
* @param {Object} [options={}] The options object.
|
|
437
|
+
* @param {boolean} [options.leading=false]
|
|
438
|
+
* Specify invoking on the leading edge of the timeout.
|
|
439
|
+
* @param {number} [options.maxWait]
|
|
440
|
+
* The maximum time `func` is allowed to be delayed before it's invoked.
|
|
441
|
+
* @param {boolean} [options.trailing=true]
|
|
442
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
443
|
+
* @returns {Function} Returns the new debounced function.
|
|
444
|
+
* @example
|
|
445
|
+
*
|
|
446
|
+
* // Avoid costly calculations while the window size is in flux.
|
|
447
|
+
* jQuery(window).on('resize', _.debounce(calculateLayout, 150));
|
|
448
|
+
*
|
|
449
|
+
* // Invoke `sendMail` when clicked, debouncing subsequent calls.
|
|
450
|
+
* jQuery(element).on('click', _.debounce(sendMail, 300, {
|
|
451
|
+
* 'leading': true,
|
|
452
|
+
* 'trailing': false
|
|
453
|
+
* }));
|
|
454
|
+
*
|
|
455
|
+
* // Ensure `batchLog` is invoked once after 1 second of debounced calls.
|
|
456
|
+
* var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });
|
|
457
|
+
* var source = new EventSource('/stream');
|
|
458
|
+
* jQuery(source).on('message', debounced);
|
|
459
|
+
*
|
|
460
|
+
* // Cancel the trailing debounced invocation.
|
|
461
|
+
* jQuery(window).on('popstate', debounced.cancel);
|
|
462
|
+
*/
|
|
463
|
+
function debounce(func, wait, options) {
|
|
464
|
+
var lastArgs,
|
|
465
|
+
lastThis,
|
|
466
|
+
maxWait,
|
|
467
|
+
result,
|
|
468
|
+
timerId,
|
|
469
|
+
lastCallTime,
|
|
470
|
+
lastInvokeTime = 0,
|
|
471
|
+
leading = false,
|
|
472
|
+
maxing = false,
|
|
473
|
+
trailing = true;
|
|
474
|
+
|
|
475
|
+
if (typeof func != 'function') {
|
|
476
|
+
throw new TypeError(FUNC_ERROR_TEXT$1);
|
|
477
|
+
}
|
|
478
|
+
wait = toNumber(wait) || 0;
|
|
479
|
+
if (isObject(options)) {
|
|
480
|
+
leading = !!options.leading;
|
|
481
|
+
maxing = 'maxWait' in options;
|
|
482
|
+
maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;
|
|
483
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
function invokeFunc(time) {
|
|
487
|
+
var args = lastArgs,
|
|
488
|
+
thisArg = lastThis;
|
|
489
|
+
|
|
490
|
+
lastArgs = lastThis = undefined;
|
|
491
|
+
lastInvokeTime = time;
|
|
492
|
+
result = func.apply(thisArg, args);
|
|
493
|
+
return result;
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function leadingEdge(time) {
|
|
497
|
+
// Reset any `maxWait` timer.
|
|
498
|
+
lastInvokeTime = time;
|
|
499
|
+
// Start the timer for the trailing edge.
|
|
500
|
+
timerId = setTimeout(timerExpired, wait);
|
|
501
|
+
// Invoke the leading edge.
|
|
502
|
+
return leading ? invokeFunc(time) : result;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
function remainingWait(time) {
|
|
506
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
507
|
+
timeSinceLastInvoke = time - lastInvokeTime,
|
|
508
|
+
timeWaiting = wait - timeSinceLastCall;
|
|
509
|
+
|
|
510
|
+
return maxing
|
|
511
|
+
? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke)
|
|
512
|
+
: timeWaiting;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
function shouldInvoke(time) {
|
|
516
|
+
var timeSinceLastCall = time - lastCallTime,
|
|
517
|
+
timeSinceLastInvoke = time - lastInvokeTime;
|
|
518
|
+
|
|
519
|
+
// Either this is the first call, activity has stopped and we're at the
|
|
520
|
+
// trailing edge, the system time has gone backwards and we're treating
|
|
521
|
+
// it as the trailing edge, or we've hit the `maxWait` limit.
|
|
522
|
+
return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||
|
|
523
|
+
(timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
function timerExpired() {
|
|
527
|
+
var time = now();
|
|
528
|
+
if (shouldInvoke(time)) {
|
|
529
|
+
return trailingEdge(time);
|
|
530
|
+
}
|
|
531
|
+
// Restart the timer.
|
|
532
|
+
timerId = setTimeout(timerExpired, remainingWait(time));
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
function trailingEdge(time) {
|
|
536
|
+
timerId = undefined;
|
|
537
|
+
|
|
538
|
+
// Only invoke if we have `lastArgs` which means `func` has been
|
|
539
|
+
// debounced at least once.
|
|
540
|
+
if (trailing && lastArgs) {
|
|
541
|
+
return invokeFunc(time);
|
|
542
|
+
}
|
|
543
|
+
lastArgs = lastThis = undefined;
|
|
544
|
+
return result;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
function cancel() {
|
|
548
|
+
if (timerId !== undefined) {
|
|
549
|
+
clearTimeout(timerId);
|
|
550
|
+
}
|
|
551
|
+
lastInvokeTime = 0;
|
|
552
|
+
lastArgs = lastCallTime = lastThis = timerId = undefined;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function flush() {
|
|
556
|
+
return timerId === undefined ? result : trailingEdge(now());
|
|
557
|
+
}
|
|
558
|
+
|
|
559
|
+
function debounced() {
|
|
560
|
+
var time = now(),
|
|
561
|
+
isInvoking = shouldInvoke(time);
|
|
562
|
+
|
|
563
|
+
lastArgs = arguments;
|
|
564
|
+
lastThis = this;
|
|
565
|
+
lastCallTime = time;
|
|
566
|
+
|
|
567
|
+
if (isInvoking) {
|
|
568
|
+
if (timerId === undefined) {
|
|
569
|
+
return leadingEdge(lastCallTime);
|
|
570
|
+
}
|
|
571
|
+
if (maxing) {
|
|
572
|
+
// Handle invocations in a tight loop.
|
|
573
|
+
clearTimeout(timerId);
|
|
574
|
+
timerId = setTimeout(timerExpired, wait);
|
|
575
|
+
return invokeFunc(lastCallTime);
|
|
576
|
+
}
|
|
577
|
+
}
|
|
578
|
+
if (timerId === undefined) {
|
|
579
|
+
timerId = setTimeout(timerExpired, wait);
|
|
580
|
+
}
|
|
581
|
+
return result;
|
|
582
|
+
}
|
|
583
|
+
debounced.cancel = cancel;
|
|
584
|
+
debounced.flush = flush;
|
|
585
|
+
return debounced;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/** Error message constants. */
|
|
589
|
+
var FUNC_ERROR_TEXT = 'Expected a function';
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Creates a throttled function that only invokes `func` at most once per
|
|
593
|
+
* every `wait` milliseconds. The throttled function comes with a `cancel`
|
|
594
|
+
* method to cancel delayed `func` invocations and a `flush` method to
|
|
595
|
+
* immediately invoke them. Provide `options` to indicate whether `func`
|
|
596
|
+
* should be invoked on the leading and/or trailing edge of the `wait`
|
|
597
|
+
* timeout. The `func` is invoked with the last arguments provided to the
|
|
598
|
+
* throttled function. Subsequent calls to the throttled function return the
|
|
599
|
+
* result of the last `func` invocation.
|
|
600
|
+
*
|
|
601
|
+
* **Note:** If `leading` and `trailing` options are `true`, `func` is
|
|
602
|
+
* invoked on the trailing edge of the timeout only if the throttled function
|
|
603
|
+
* is invoked more than once during the `wait` timeout.
|
|
604
|
+
*
|
|
605
|
+
* If `wait` is `0` and `leading` is `false`, `func` invocation is deferred
|
|
606
|
+
* until to the next tick, similar to `setTimeout` with a timeout of `0`.
|
|
607
|
+
*
|
|
608
|
+
* See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)
|
|
609
|
+
* for details over the differences between `_.throttle` and `_.debounce`.
|
|
610
|
+
*
|
|
611
|
+
* @static
|
|
612
|
+
* @memberOf _
|
|
613
|
+
* @since 0.1.0
|
|
614
|
+
* @category Function
|
|
615
|
+
* @param {Function} func The function to throttle.
|
|
616
|
+
* @param {number} [wait=0] The number of milliseconds to throttle invocations to.
|
|
617
|
+
* @param {Object} [options={}] The options object.
|
|
618
|
+
* @param {boolean} [options.leading=true]
|
|
619
|
+
* Specify invoking on the leading edge of the timeout.
|
|
620
|
+
* @param {boolean} [options.trailing=true]
|
|
621
|
+
* Specify invoking on the trailing edge of the timeout.
|
|
622
|
+
* @returns {Function} Returns the new throttled function.
|
|
623
|
+
* @example
|
|
624
|
+
*
|
|
625
|
+
* // Avoid excessively updating the position while scrolling.
|
|
626
|
+
* jQuery(window).on('scroll', _.throttle(updatePosition, 100));
|
|
627
|
+
*
|
|
628
|
+
* // Invoke `renewToken` when the click event is fired, but not more than once every 5 minutes.
|
|
629
|
+
* var throttled = _.throttle(renewToken, 300000, { 'trailing': false });
|
|
630
|
+
* jQuery(element).on('click', throttled);
|
|
631
|
+
*
|
|
632
|
+
* // Cancel the trailing throttled invocation.
|
|
633
|
+
* jQuery(window).on('popstate', throttled.cancel);
|
|
634
|
+
*/
|
|
635
|
+
function throttle(func, wait, options) {
|
|
636
|
+
var leading = true,
|
|
637
|
+
trailing = true;
|
|
638
|
+
|
|
639
|
+
if (typeof func != 'function') {
|
|
640
|
+
throw new TypeError(FUNC_ERROR_TEXT);
|
|
641
|
+
}
|
|
642
|
+
if (isObject(options)) {
|
|
643
|
+
leading = 'leading' in options ? !!options.leading : leading;
|
|
644
|
+
trailing = 'trailing' in options ? !!options.trailing : trailing;
|
|
645
|
+
}
|
|
646
|
+
return debounce(func, wait, {
|
|
647
|
+
'leading': leading,
|
|
648
|
+
'maxWait': wait,
|
|
649
|
+
'trailing': trailing
|
|
650
|
+
});
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Removes an item from the array if the array exists and the item is included
|
|
655
|
+
* within it.
|
|
656
|
+
* @param arr
|
|
657
|
+
* @param item
|
|
658
|
+
*/
|
|
659
|
+
function removeIfPresent(arr, item) {
|
|
660
|
+
if (!arr) {
|
|
661
|
+
return;
|
|
662
|
+
}
|
|
663
|
+
const index = arr.indexOf(item);
|
|
664
|
+
if (index !== -1) {
|
|
665
|
+
arr.splice(index, 1);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
/**
|
|
669
|
+
* Remove items in an array which match a predicate.
|
|
670
|
+
* @param arr
|
|
671
|
+
* @param predicate
|
|
672
|
+
*/
|
|
673
|
+
function removeIf(arr, predicate) {
|
|
674
|
+
for (let i = 0; i < arr.length; i++) {
|
|
675
|
+
if (predicate(arr[i])) {
|
|
676
|
+
arr.splice(i, 1);
|
|
677
|
+
i--;
|
|
678
|
+
}
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
function joinArray(arr, joiner, mapper) {
|
|
682
|
+
if (arr?.length) {
|
|
683
|
+
return arr.map(mapper).join(joiner);
|
|
684
|
+
}
|
|
685
|
+
return "";
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Utility to help type checking ensure that there is no uncovered case.
|
|
690
|
+
*/
|
|
691
|
+
function assertNever(x) {
|
|
692
|
+
throw new Error(`Expected handling to cover all possible cases, but it didn't cover: ${JSON.stringify(x)}`);
|
|
693
|
+
}
|
|
694
|
+
function assert(x, message = "Assertion failed") {
|
|
695
|
+
if (!x) {
|
|
696
|
+
// eslint-disable-next-line no-debugger
|
|
697
|
+
debugger;
|
|
698
|
+
throw new Error(message);
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
function NonEnumerable(_cls, context) {
|
|
702
|
+
context.addInitializer(function () {
|
|
703
|
+
Object.defineProperty(this, context.name, {
|
|
704
|
+
enumerable: false,
|
|
705
|
+
configurable: true,
|
|
706
|
+
writable: true,
|
|
707
|
+
});
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
let translations = {};
|
|
712
|
+
const i18n = new Proxy({}, {
|
|
713
|
+
get(_, key) {
|
|
714
|
+
return (...args) => {
|
|
715
|
+
const template = String(translations[key] || key);
|
|
716
|
+
return template.replace(/\{(\d+)\}/g, (_, index) => {
|
|
717
|
+
return args[+index] ?? "(no placeholder)";
|
|
718
|
+
});
|
|
719
|
+
};
|
|
720
|
+
},
|
|
721
|
+
has(_, key) {
|
|
722
|
+
return Object.prototype.hasOwnProperty.call(translations, key);
|
|
723
|
+
},
|
|
724
|
+
});
|
|
725
|
+
|
|
726
|
+
class DefaultMap extends Map {
|
|
727
|
+
creator;
|
|
728
|
+
constructor(creator) {
|
|
729
|
+
super();
|
|
730
|
+
this.creator = creator;
|
|
731
|
+
}
|
|
732
|
+
get(key) {
|
|
733
|
+
const saved = super.get(key);
|
|
734
|
+
if (saved != null) {
|
|
735
|
+
return saved;
|
|
736
|
+
}
|
|
737
|
+
const created = this.creator(key);
|
|
738
|
+
this.set(key, created);
|
|
739
|
+
return created;
|
|
740
|
+
}
|
|
741
|
+
getNoInsert(key) {
|
|
742
|
+
return super.get(key);
|
|
743
|
+
}
|
|
744
|
+
}
|
|
745
|
+
class StableKeyMap {
|
|
746
|
+
[Symbol.toStringTag] = "StableKeyMap";
|
|
747
|
+
impl = new Map();
|
|
748
|
+
get size() {
|
|
749
|
+
return this.impl.size;
|
|
750
|
+
}
|
|
751
|
+
set(key, value) {
|
|
752
|
+
this.impl.set(key.getStableKey(), [key, value]);
|
|
753
|
+
return this;
|
|
754
|
+
}
|
|
755
|
+
get(key) {
|
|
756
|
+
return this.impl.get(key.getStableKey())?.[1];
|
|
757
|
+
}
|
|
758
|
+
has(key) {
|
|
759
|
+
return this.get(key) != null;
|
|
760
|
+
}
|
|
761
|
+
clear() {
|
|
762
|
+
this.impl.clear();
|
|
763
|
+
}
|
|
764
|
+
delete(key) {
|
|
765
|
+
return this.impl.delete(key.getStableKey());
|
|
766
|
+
}
|
|
767
|
+
forEach(callbackfn, thisArg) {
|
|
768
|
+
for (const [k, v] of this.entries()) {
|
|
769
|
+
callbackfn.apply(thisArg, [v, k, this]);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
entries() {
|
|
773
|
+
return this.impl.values();
|
|
774
|
+
}
|
|
775
|
+
*keys() {
|
|
776
|
+
for (const [k] of this.entries()) {
|
|
777
|
+
yield k;
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
*values() {
|
|
781
|
+
for (const [, v] of this.entries()) {
|
|
782
|
+
yield v;
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
[Symbol.iterator]() {
|
|
786
|
+
return this.entries();
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
/**
|
|
791
|
+
* List of known log levels. Used to specify the urgency of a log message.
|
|
792
|
+
*/
|
|
793
|
+
var LogLevel;
|
|
794
|
+
(function (LogLevel) {
|
|
795
|
+
LogLevel[LogLevel["Verbose"] = 0] = "Verbose";
|
|
796
|
+
LogLevel[LogLevel["Info"] = 1] = "Info";
|
|
797
|
+
LogLevel[LogLevel["Warn"] = 2] = "Warn";
|
|
798
|
+
LogLevel[LogLevel["Error"] = 3] = "Error";
|
|
799
|
+
LogLevel[LogLevel["None"] = 4] = "None";
|
|
800
|
+
})(LogLevel || (LogLevel = {}));
|
|
801
|
+
({
|
|
802
|
+
[LogLevel.Error]: "[error]",
|
|
803
|
+
[LogLevel.Warn]: "[warning]",
|
|
804
|
+
[LogLevel.Info]: "[info]",
|
|
805
|
+
[LogLevel.Verbose]: "[debug]",
|
|
806
|
+
});
|
|
807
|
+
|
|
808
|
+
var NormalizedPathUtils;
|
|
809
|
+
(function (NormalizedPathUtils) {
|
|
810
|
+
function dirname(path) {
|
|
811
|
+
let end = path.length - 2;
|
|
812
|
+
for (; end > 0; --end) {
|
|
813
|
+
if (path[end] === "/")
|
|
814
|
+
break;
|
|
815
|
+
}
|
|
816
|
+
switch (end) {
|
|
817
|
+
case -2:
|
|
818
|
+
case -1:
|
|
819
|
+
return (path[0] === "/" ? "/" : ".");
|
|
820
|
+
case 0:
|
|
821
|
+
return path.substring(0, path.indexOf("/") + 1);
|
|
822
|
+
default:
|
|
823
|
+
return path.slice(0, end);
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
NormalizedPathUtils.dirname = dirname;
|
|
827
|
+
function basename(path) {
|
|
828
|
+
// We start at length - 2 as /var/typedoc/ should give `typedoc`
|
|
829
|
+
let end = path.length - 2;
|
|
830
|
+
for (; end >= 0; --end) {
|
|
831
|
+
if (path[end] === "/")
|
|
832
|
+
break;
|
|
833
|
+
}
|
|
834
|
+
switch (end) {
|
|
835
|
+
case -2:
|
|
836
|
+
case -1:
|
|
837
|
+
return path;
|
|
838
|
+
default:
|
|
839
|
+
if (path.endsWith("/")) {
|
|
840
|
+
return path.slice(end + 1, -1);
|
|
841
|
+
}
|
|
842
|
+
return path.slice(end + 1);
|
|
843
|
+
}
|
|
844
|
+
}
|
|
845
|
+
NormalizedPathUtils.basename = basename;
|
|
846
|
+
function relative(from, to) {
|
|
847
|
+
if (from == to) {
|
|
848
|
+
return "";
|
|
849
|
+
}
|
|
850
|
+
assert(isAbsolute(from) && isAbsolute(to), "resolving relative paths without absolute inputs requires a filesystem");
|
|
851
|
+
if (!from.endsWith("/")) {
|
|
852
|
+
from += "/";
|
|
853
|
+
}
|
|
854
|
+
const end = to.length;
|
|
855
|
+
if (!to.endsWith("/")) {
|
|
856
|
+
to += "/";
|
|
857
|
+
}
|
|
858
|
+
const minLen = Math.min(from.length, to.length);
|
|
859
|
+
let lastCommonSlash = 0;
|
|
860
|
+
let i = 0;
|
|
861
|
+
for (; i < minLen; ++i) {
|
|
862
|
+
if (from[i] === to[i]) {
|
|
863
|
+
if (from[i] === "/") {
|
|
864
|
+
lastCommonSlash = i;
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
else {
|
|
868
|
+
break;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
if (lastCommonSlash === from.length - 1) {
|
|
872
|
+
return to.substring(from.length, end);
|
|
873
|
+
}
|
|
874
|
+
let prefix = "";
|
|
875
|
+
for (let i = lastCommonSlash + 1; i < from.length; ++i) {
|
|
876
|
+
if (from[i] === "/" || i + 1 === from.length) {
|
|
877
|
+
prefix += prefix ? "/.." : "..";
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
return prefix + to.substring(lastCommonSlash, end);
|
|
881
|
+
}
|
|
882
|
+
NormalizedPathUtils.relative = relative;
|
|
883
|
+
function normalize(path) {
|
|
884
|
+
const parts = path.split("/");
|
|
885
|
+
let canRemoveDotDot = false;
|
|
886
|
+
for (let i = 0; i < parts.length; /* inside loop */) {
|
|
887
|
+
if (parts[i] == "." && i + 1 != parts.length) {
|
|
888
|
+
parts.splice(i, 1);
|
|
889
|
+
}
|
|
890
|
+
else if (parts[i] == "..") {
|
|
891
|
+
if (canRemoveDotDot) {
|
|
892
|
+
if (i - 1 === 0 && /\w:/i.test(parts[0])) {
|
|
893
|
+
parts.splice(i, 1);
|
|
894
|
+
}
|
|
895
|
+
else {
|
|
896
|
+
parts.splice(i - 1, 2);
|
|
897
|
+
i = i - 1;
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
else {
|
|
901
|
+
++i;
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
else {
|
|
905
|
+
canRemoveDotDot = true;
|
|
906
|
+
++i;
|
|
907
|
+
}
|
|
908
|
+
}
|
|
909
|
+
return parts.join("/");
|
|
910
|
+
}
|
|
911
|
+
NormalizedPathUtils.normalize = normalize;
|
|
912
|
+
function resolve(from, to) {
|
|
913
|
+
assert(isAbsolute(from), "resolving without an absolute path requires a filesystem");
|
|
914
|
+
if (isAbsolute(to)) {
|
|
915
|
+
return to;
|
|
916
|
+
}
|
|
917
|
+
return normalize(`${from}/${to}`);
|
|
918
|
+
}
|
|
919
|
+
NormalizedPathUtils.resolve = resolve;
|
|
920
|
+
function isAbsolute(from) {
|
|
921
|
+
return /^\/|^\w:\//.test(from);
|
|
922
|
+
}
|
|
923
|
+
NormalizedPathUtils.isAbsolute = isAbsolute;
|
|
924
|
+
function splitFilename(name) {
|
|
925
|
+
const lastDot = name.lastIndexOf(".");
|
|
926
|
+
if (lastDot < 1) {
|
|
927
|
+
return { name, ext: "" };
|
|
928
|
+
}
|
|
929
|
+
return { name: name.substring(0, lastDot), ext: name.substring(lastDot) };
|
|
930
|
+
}
|
|
931
|
+
NormalizedPathUtils.splitFilename = splitFilename;
|
|
932
|
+
})(NormalizedPathUtils || (NormalizedPathUtils = {}));
|
|
933
|
+
|
|
934
|
+
function splitUnquotedString(input, delimiter) {
|
|
935
|
+
if (input.startsWith(delimiter)) {
|
|
936
|
+
return splitUnquotedString(input.substring(delimiter.length), delimiter);
|
|
937
|
+
}
|
|
938
|
+
if (input.startsWith('"')) {
|
|
939
|
+
// the part inside the quotes should not be split, the rest should
|
|
940
|
+
const closingQuoteIndex = input.indexOf('"', 1);
|
|
941
|
+
if (closingQuoteIndex === -1) {
|
|
942
|
+
// Unmatched quotes, just split it
|
|
943
|
+
return input.split(delimiter);
|
|
944
|
+
}
|
|
945
|
+
if (closingQuoteIndex === input.length - 1) {
|
|
946
|
+
return [input];
|
|
947
|
+
}
|
|
948
|
+
else {
|
|
949
|
+
const remainder = input.substring(closingQuoteIndex + 1);
|
|
950
|
+
return [
|
|
951
|
+
input.substring(0, closingQuoteIndex + 1),
|
|
952
|
+
...splitUnquotedString(remainder, delimiter),
|
|
953
|
+
];
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
else {
|
|
957
|
+
return input.split(delimiter);
|
|
958
|
+
}
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* This exists so that TypeDoc can store a unique identifier for a `ts.Symbol` without
|
|
963
|
+
* keeping a reference to the `ts.Symbol` itself. This identifier should be stable across
|
|
964
|
+
* runs so long as the symbol is exported from the same file.
|
|
965
|
+
*/
|
|
966
|
+
class ReflectionSymbolId {
|
|
967
|
+
/**
|
|
968
|
+
* This will only be used if we somehow cannot find a package.json file for
|
|
969
|
+
* source code. This is very unlikely, but if it occurs then the {@link packageName}
|
|
970
|
+
* will be set to this string, and {@link packagePath} will have the absolute path
|
|
971
|
+
* to the source file.
|
|
972
|
+
*/
|
|
973
|
+
static UNKNOWN_PACKAGE = "<unknown>";
|
|
974
|
+
/**
|
|
975
|
+
* The name of the package which this symbol ID resides within.
|
|
976
|
+
*/
|
|
977
|
+
packageName;
|
|
978
|
+
/**
|
|
979
|
+
* Path to the source file containing this symbol.
|
|
980
|
+
* Note that this is NOT an absolute path, but a package-relative path according
|
|
981
|
+
* to the directory containing package.json for the package name.
|
|
982
|
+
*/
|
|
983
|
+
packagePath;
|
|
984
|
+
/**
|
|
985
|
+
* Qualified name of this symbol within the source file.
|
|
986
|
+
*/
|
|
987
|
+
qualifiedName;
|
|
988
|
+
/**
|
|
989
|
+
* Note: This is **not** serialized. It exists for sorting by declaration order, but
|
|
990
|
+
* should not be needed when deserializing from JSON.
|
|
991
|
+
* Will be set to `Infinity` if the ID was deserialized from JSON.
|
|
992
|
+
*/
|
|
993
|
+
pos = Infinity;
|
|
994
|
+
/**
|
|
995
|
+
* Note: This is **not** serialized. It exists to support detection of the differences between
|
|
996
|
+
* symbols which share declarations, but are instantiated with different type parameters.
|
|
997
|
+
* This will be `NaN` if the symbol reference is not transient.
|
|
998
|
+
* Note: This can only be non-NaN if {@link pos} is finite.
|
|
999
|
+
*/
|
|
1000
|
+
transientId = NaN;
|
|
1001
|
+
/**
|
|
1002
|
+
* Note: This is **not** serialized, only {@link packageName} and {@link packagePath} path
|
|
1003
|
+
* information is preserved when serializing. This is set so that it is available to plugins
|
|
1004
|
+
* when initially converting a project.
|
|
1005
|
+
*
|
|
1006
|
+
* @privateRemarks
|
|
1007
|
+
* This is used by typedoc-plugin-dt-links to determine the path to read to get the source
|
|
1008
|
+
* code of a definitely typed package.
|
|
1009
|
+
*/
|
|
1010
|
+
fileName;
|
|
1011
|
+
constructor(json) {
|
|
1012
|
+
this.packageName = json.packageName;
|
|
1013
|
+
this.packagePath = json.packagePath;
|
|
1014
|
+
this.qualifiedName = json.qualifiedName;
|
|
1015
|
+
}
|
|
1016
|
+
getStableKey() {
|
|
1017
|
+
if (Number.isFinite(this.pos)) {
|
|
1018
|
+
return `${this.packageName}\0${this.packagePath}\0${this.qualifiedName}\0${this.pos}\0${this.transientId}`;
|
|
1019
|
+
}
|
|
1020
|
+
else {
|
|
1021
|
+
return `${this.packageName}\0${this.packagePath}\0${this.qualifiedName}`;
|
|
1022
|
+
}
|
|
1023
|
+
}
|
|
1024
|
+
toDeclarationReference() {
|
|
1025
|
+
return {
|
|
1026
|
+
resolutionStart: "global",
|
|
1027
|
+
moduleSource: this.packageName,
|
|
1028
|
+
symbolReference: {
|
|
1029
|
+
path: splitUnquotedString(this.qualifiedName, ".").map((path) => ({
|
|
1030
|
+
navigation: ".",
|
|
1031
|
+
path,
|
|
1032
|
+
})),
|
|
1033
|
+
},
|
|
1034
|
+
};
|
|
1035
|
+
}
|
|
1036
|
+
toObject() {
|
|
1037
|
+
return {
|
|
1038
|
+
packageName: this.packageName,
|
|
1039
|
+
packagePath: this.packagePath,
|
|
1040
|
+
qualifiedName: this.qualifiedName,
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
var __esDecorate$3 = (globalThis && globalThis.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
1046
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
1047
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
1048
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
1049
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
1050
|
+
var _, done = false;
|
|
1051
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
1052
|
+
var context = {};
|
|
1053
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
1054
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
1055
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
1056
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
1057
|
+
if (kind === "accessor") {
|
|
1058
|
+
if (result === void 0) continue;
|
|
1059
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
1060
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
1061
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
1062
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
1063
|
+
}
|
|
1064
|
+
else if (_ = accept(result)) {
|
|
1065
|
+
if (kind === "field") initializers.unshift(_);
|
|
1066
|
+
else descriptor[key] = _;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
1070
|
+
done = true;
|
|
1071
|
+
};
|
|
1072
|
+
var __runInitializers$3 = (globalThis && globalThis.__runInitializers) || function (thisArg, initializers, value) {
|
|
1073
|
+
var useValue = arguments.length > 2;
|
|
1074
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
1075
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
1076
|
+
}
|
|
1077
|
+
return useValue ? value : void 0;
|
|
1078
|
+
};
|
|
1079
|
+
/**
|
|
1080
|
+
* A model that represents a single TypeDoc comment tag.
|
|
1081
|
+
*
|
|
1082
|
+
* Tags are stored in the {@link Comment.blockTags} property.
|
|
1083
|
+
* @category Comments
|
|
1084
|
+
*/
|
|
1085
|
+
class CommentTag {
|
|
1086
|
+
/**
|
|
1087
|
+
* The name of this tag, e.g. `@returns`, `@example`
|
|
1088
|
+
*/
|
|
1089
|
+
tag;
|
|
1090
|
+
/**
|
|
1091
|
+
* Some tags, (`@typedef`, `@param`, `@property`, etc.) may have a user defined identifier associated with them.
|
|
1092
|
+
* If this tag is one of those, it will be parsed out and included here.
|
|
1093
|
+
*/
|
|
1094
|
+
name;
|
|
1095
|
+
/**
|
|
1096
|
+
* Optional type annotation associated with this tag. TypeDoc will remove type annotations unless explicitly
|
|
1097
|
+
* requested by the user with the `preservedTypeAnnotationTags` option.
|
|
1098
|
+
*/
|
|
1099
|
+
typeAnnotation;
|
|
1100
|
+
/**
|
|
1101
|
+
* The actual body text of this tag.
|
|
1102
|
+
*/
|
|
1103
|
+
content;
|
|
1104
|
+
/**
|
|
1105
|
+
* A flag which may be set by plugins to prevent TypeDoc from rendering this tag, if the plugin provides
|
|
1106
|
+
* custom rendering. Note: This flag is **not** serialized, it is expected to be set just before the comment
|
|
1107
|
+
* is rendered.
|
|
1108
|
+
*/
|
|
1109
|
+
skipRendering = false;
|
|
1110
|
+
/**
|
|
1111
|
+
* Create a new CommentTag instance.
|
|
1112
|
+
*/
|
|
1113
|
+
constructor(tag, text) {
|
|
1114
|
+
this.tag = tag;
|
|
1115
|
+
this.content = text;
|
|
1116
|
+
}
|
|
1117
|
+
/**
|
|
1118
|
+
* Checks if this block tag is roughly equal to the other tag.
|
|
1119
|
+
* This isn't exactly equal, but just "roughly equal" by the tag
|
|
1120
|
+
* text.
|
|
1121
|
+
*/
|
|
1122
|
+
similarTo(other) {
|
|
1123
|
+
return (this.tag === other.tag &&
|
|
1124
|
+
this.name === other.name &&
|
|
1125
|
+
Comment.combineDisplayParts(this.content) ===
|
|
1126
|
+
Comment.combineDisplayParts(other.content));
|
|
1127
|
+
}
|
|
1128
|
+
clone() {
|
|
1129
|
+
const tag = new CommentTag(this.tag, Comment.cloneDisplayParts(this.content));
|
|
1130
|
+
if (this.name) {
|
|
1131
|
+
tag.name = this.name;
|
|
1132
|
+
}
|
|
1133
|
+
if (this.typeAnnotation) {
|
|
1134
|
+
tag.typeAnnotation = this.typeAnnotation;
|
|
1135
|
+
}
|
|
1136
|
+
return tag;
|
|
1137
|
+
}
|
|
1138
|
+
toObject() {
|
|
1139
|
+
return {
|
|
1140
|
+
tag: this.tag,
|
|
1141
|
+
name: this.name,
|
|
1142
|
+
content: Comment.serializeDisplayParts(this.content),
|
|
1143
|
+
typeAnnotation: this.typeAnnotation,
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
fromObject(de, obj) {
|
|
1147
|
+
// tag already set by Comment.fromObject
|
|
1148
|
+
this.name = obj.name;
|
|
1149
|
+
this.typeAnnotation = obj.typeAnnotation;
|
|
1150
|
+
this.content = Comment.deserializeDisplayParts(de, obj.content);
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
/**
|
|
1154
|
+
* A model that represents a comment.
|
|
1155
|
+
*
|
|
1156
|
+
* Instances of this model are created by the CommentPlugin. You can retrieve comments
|
|
1157
|
+
* through the {@link DeclarationReflection.comment} property.
|
|
1158
|
+
* @category Comments
|
|
1159
|
+
*/
|
|
1160
|
+
let Comment = (() => {
|
|
1161
|
+
let _sourcePath_decorators;
|
|
1162
|
+
let _sourcePath_initializers = [];
|
|
1163
|
+
let _sourcePath_extraInitializers = [];
|
|
1164
|
+
let _discoveryId_decorators;
|
|
1165
|
+
let _discoveryId_initializers = [];
|
|
1166
|
+
let _discoveryId_extraInitializers = [];
|
|
1167
|
+
let _inheritedFromParentDeclaration_decorators;
|
|
1168
|
+
let _inheritedFromParentDeclaration_initializers = [];
|
|
1169
|
+
let _inheritedFromParentDeclaration_extraInitializers = [];
|
|
1170
|
+
return class Comment {
|
|
1171
|
+
static {
|
|
1172
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
1173
|
+
_sourcePath_decorators = [NonEnumerable];
|
|
1174
|
+
_discoveryId_decorators = [NonEnumerable];
|
|
1175
|
+
_inheritedFromParentDeclaration_decorators = [NonEnumerable];
|
|
1176
|
+
__esDecorate$3(null, null, _sourcePath_decorators, { kind: "field", name: "sourcePath", static: false, private: false, access: { has: obj => "sourcePath" in obj, get: obj => obj.sourcePath, set: (obj, value) => { obj.sourcePath = value; } }, metadata: _metadata }, _sourcePath_initializers, _sourcePath_extraInitializers);
|
|
1177
|
+
__esDecorate$3(null, null, _discoveryId_decorators, { kind: "field", name: "discoveryId", static: false, private: false, access: { has: obj => "discoveryId" in obj, get: obj => obj.discoveryId, set: (obj, value) => { obj.discoveryId = value; } }, metadata: _metadata }, _discoveryId_initializers, _discoveryId_extraInitializers);
|
|
1178
|
+
__esDecorate$3(null, null, _inheritedFromParentDeclaration_decorators, { kind: "field", name: "inheritedFromParentDeclaration", static: false, private: false, access: { has: obj => "inheritedFromParentDeclaration" in obj, get: obj => obj.inheritedFromParentDeclaration, set: (obj, value) => { obj.inheritedFromParentDeclaration = value; } }, metadata: _metadata }, _inheritedFromParentDeclaration_initializers, _inheritedFromParentDeclaration_extraInitializers);
|
|
1179
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
1180
|
+
}
|
|
1181
|
+
/**
|
|
1182
|
+
* Debugging utility for combining parts into a simple string. Not suitable for
|
|
1183
|
+
* rendering, but can be useful in tests.
|
|
1184
|
+
*/
|
|
1185
|
+
static combineDisplayParts(parts) {
|
|
1186
|
+
let result = "";
|
|
1187
|
+
for (const item of parts || []) {
|
|
1188
|
+
switch (item.kind) {
|
|
1189
|
+
case "text":
|
|
1190
|
+
case "code":
|
|
1191
|
+
case "relative-link":
|
|
1192
|
+
result += item.text;
|
|
1193
|
+
break;
|
|
1194
|
+
case "inline-tag":
|
|
1195
|
+
result += `{${item.tag} ${item.text}}`;
|
|
1196
|
+
break;
|
|
1197
|
+
default:
|
|
1198
|
+
assertNever(item);
|
|
1199
|
+
}
|
|
1200
|
+
}
|
|
1201
|
+
return result;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Helper utility to clone {@link Comment#summary} or {@link CommentTag#content}
|
|
1205
|
+
*/
|
|
1206
|
+
static cloneDisplayParts(parts) {
|
|
1207
|
+
return parts.map((p) => ({ ...p }));
|
|
1208
|
+
}
|
|
1209
|
+
static serializeDisplayParts(parts) {
|
|
1210
|
+
return parts?.map((part) => {
|
|
1211
|
+
switch (part.kind) {
|
|
1212
|
+
case "text":
|
|
1213
|
+
case "code":
|
|
1214
|
+
return { ...part };
|
|
1215
|
+
case "inline-tag": {
|
|
1216
|
+
let target;
|
|
1217
|
+
if (typeof part.target === "string") {
|
|
1218
|
+
target = part.target;
|
|
1219
|
+
}
|
|
1220
|
+
else if (part.target) {
|
|
1221
|
+
if ("id" in part.target) {
|
|
1222
|
+
target = part.target.id;
|
|
1223
|
+
}
|
|
1224
|
+
else {
|
|
1225
|
+
target = part.target.toObject();
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
return {
|
|
1229
|
+
...part,
|
|
1230
|
+
target,
|
|
1231
|
+
};
|
|
1232
|
+
}
|
|
1233
|
+
case "relative-link": {
|
|
1234
|
+
return {
|
|
1235
|
+
...part,
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
});
|
|
1240
|
+
}
|
|
1241
|
+
// Since display parts are plain objects, this lives here
|
|
1242
|
+
static deserializeDisplayParts(de, parts) {
|
|
1243
|
+
const links = [];
|
|
1244
|
+
const files = [];
|
|
1245
|
+
const result = parts.map((part) => {
|
|
1246
|
+
switch (part.kind) {
|
|
1247
|
+
case "text":
|
|
1248
|
+
case "code":
|
|
1249
|
+
return { ...part };
|
|
1250
|
+
case "inline-tag": {
|
|
1251
|
+
if (typeof part.target === "number") {
|
|
1252
|
+
const part2 = {
|
|
1253
|
+
kind: part.kind,
|
|
1254
|
+
tag: part.tag,
|
|
1255
|
+
text: part.text,
|
|
1256
|
+
target: undefined,
|
|
1257
|
+
tsLinkText: part.tsLinkText,
|
|
1258
|
+
};
|
|
1259
|
+
links.push([part.target, part2]);
|
|
1260
|
+
return part2;
|
|
1261
|
+
}
|
|
1262
|
+
else if (typeof part.target === "string" ||
|
|
1263
|
+
part.target === undefined) {
|
|
1264
|
+
return {
|
|
1265
|
+
kind: "inline-tag",
|
|
1266
|
+
tag: part.tag,
|
|
1267
|
+
text: part.text,
|
|
1268
|
+
target: part.target,
|
|
1269
|
+
tsLinkText: part.tsLinkText,
|
|
1270
|
+
};
|
|
1271
|
+
}
|
|
1272
|
+
else if (typeof part.target === "object") {
|
|
1273
|
+
return {
|
|
1274
|
+
kind: "inline-tag",
|
|
1275
|
+
tag: part.tag,
|
|
1276
|
+
text: part.text,
|
|
1277
|
+
target: new ReflectionSymbolId(part.target),
|
|
1278
|
+
tsLinkText: part.tsLinkText,
|
|
1279
|
+
};
|
|
1280
|
+
}
|
|
1281
|
+
else {
|
|
1282
|
+
assertNever(part.target);
|
|
1283
|
+
}
|
|
1284
|
+
break;
|
|
1285
|
+
}
|
|
1286
|
+
case "relative-link": {
|
|
1287
|
+
if (part.target) {
|
|
1288
|
+
const part2 = {
|
|
1289
|
+
kind: "relative-link",
|
|
1290
|
+
text: part.text,
|
|
1291
|
+
target: null,
|
|
1292
|
+
targetAnchor: part.targetAnchor,
|
|
1293
|
+
};
|
|
1294
|
+
files.push([part.target, part2]);
|
|
1295
|
+
return part2;
|
|
1296
|
+
}
|
|
1297
|
+
return {
|
|
1298
|
+
...part,
|
|
1299
|
+
target: undefined,
|
|
1300
|
+
targetAnchor: part.targetAnchor,
|
|
1301
|
+
};
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
if (links.length || files.length) {
|
|
1306
|
+
de.defer((project) => {
|
|
1307
|
+
for (const [oldFileId, part] of files) {
|
|
1308
|
+
part.target = de.oldFileIdToNewFileId[oldFileId];
|
|
1309
|
+
}
|
|
1310
|
+
for (const [oldId, part] of links) {
|
|
1311
|
+
part.target = project.getReflectionById(de.oldIdToNewId[oldId] ?? -1);
|
|
1312
|
+
if (!part.target) {
|
|
1313
|
+
de.logger.warn(i18n.serialized_project_referenced_0_not_part_of_project(oldId.toString()));
|
|
1314
|
+
}
|
|
1315
|
+
}
|
|
1316
|
+
});
|
|
1317
|
+
}
|
|
1318
|
+
return result;
|
|
1319
|
+
}
|
|
1320
|
+
/**
|
|
1321
|
+
* Splits the provided parts into a header (first line, as a string)
|
|
1322
|
+
* and body (remaining lines). If the header line contains inline tags
|
|
1323
|
+
* they will be serialized to a string.
|
|
1324
|
+
*/
|
|
1325
|
+
static splitPartsToHeaderAndBody(parts) {
|
|
1326
|
+
let index = parts.findIndex((part) => {
|
|
1327
|
+
switch (part.kind) {
|
|
1328
|
+
case "text":
|
|
1329
|
+
case "code":
|
|
1330
|
+
return part.text.includes("\n");
|
|
1331
|
+
case "inline-tag":
|
|
1332
|
+
case "relative-link":
|
|
1333
|
+
return false;
|
|
1334
|
+
}
|
|
1335
|
+
});
|
|
1336
|
+
if (index === -1) {
|
|
1337
|
+
return {
|
|
1338
|
+
header: Comment.combineDisplayParts(parts),
|
|
1339
|
+
body: [],
|
|
1340
|
+
};
|
|
1341
|
+
}
|
|
1342
|
+
// Do not split a code block, stop the header at the end of the previous block
|
|
1343
|
+
if (parts[index].kind === "code") {
|
|
1344
|
+
--index;
|
|
1345
|
+
}
|
|
1346
|
+
if (index === -1) {
|
|
1347
|
+
return { header: "", body: Comment.cloneDisplayParts(parts) };
|
|
1348
|
+
}
|
|
1349
|
+
let header = Comment.combineDisplayParts(parts.slice(0, index));
|
|
1350
|
+
const split = parts[index].text.indexOf("\n");
|
|
1351
|
+
let body;
|
|
1352
|
+
if (split === -1) {
|
|
1353
|
+
header += parts[index].text;
|
|
1354
|
+
body = Comment.cloneDisplayParts(parts.slice(index + 1));
|
|
1355
|
+
}
|
|
1356
|
+
else {
|
|
1357
|
+
header += parts[index].text.substring(0, split);
|
|
1358
|
+
body = Comment.cloneDisplayParts(parts.slice(index));
|
|
1359
|
+
body[0].text = body[0].text.substring(split + 1);
|
|
1360
|
+
}
|
|
1361
|
+
if (!body[0].text) {
|
|
1362
|
+
body.shift();
|
|
1363
|
+
}
|
|
1364
|
+
return { header: header.trim(), body };
|
|
1365
|
+
}
|
|
1366
|
+
/**
|
|
1367
|
+
* The content of the comment which is not associated with a block tag.
|
|
1368
|
+
*/
|
|
1369
|
+
summary;
|
|
1370
|
+
/**
|
|
1371
|
+
* All associated block level tags.
|
|
1372
|
+
*/
|
|
1373
|
+
blockTags = [];
|
|
1374
|
+
/**
|
|
1375
|
+
* All modifier tags present on the comment, e.g. `@alpha`, `@beta`.
|
|
1376
|
+
*/
|
|
1377
|
+
modifierTags = new Set();
|
|
1378
|
+
/**
|
|
1379
|
+
* Label associated with this reflection, if any (https://tsdoc.org/pages/tags/label/)
|
|
1380
|
+
*/
|
|
1381
|
+
label;
|
|
1382
|
+
/**
|
|
1383
|
+
* Full path to the file where this comment originated from, if any.
|
|
1384
|
+
* This field will not be serialized, so will not be present when handling JSON-revived reflections.
|
|
1385
|
+
*
|
|
1386
|
+
* Note: This field is non-enumerable to make testing comment contents with `deepEqual` easier.
|
|
1387
|
+
*/
|
|
1388
|
+
sourcePath = __runInitializers$3(this, _sourcePath_initializers, void 0);
|
|
1389
|
+
/**
|
|
1390
|
+
* Internal discovery ID used to prevent symbol comments from
|
|
1391
|
+
* being duplicated on signatures. Only set when the comment was created
|
|
1392
|
+
* from a `ts.CommentRange`.
|
|
1393
|
+
* @internal
|
|
1394
|
+
*/
|
|
1395
|
+
discoveryId = (__runInitializers$3(this, _sourcePath_extraInitializers), __runInitializers$3(this, _discoveryId_initializers, void 0));
|
|
1396
|
+
/**
|
|
1397
|
+
* If the comment was inherited from a different "parent" declaration
|
|
1398
|
+
* (see #2545), then it is desirable to know this as any `@param` tags
|
|
1399
|
+
* which do not apply should not cause warnings. This is not serialized,
|
|
1400
|
+
* and only set when the comment was created from a `ts.CommentRange`.
|
|
1401
|
+
*/
|
|
1402
|
+
inheritedFromParentDeclaration = (__runInitializers$3(this, _discoveryId_extraInitializers), __runInitializers$3(this, _inheritedFromParentDeclaration_initializers, void 0));
|
|
1403
|
+
/**
|
|
1404
|
+
* Creates a new Comment instance.
|
|
1405
|
+
*/
|
|
1406
|
+
constructor(summary = [], blockTags = [], modifierTags = new Set()) {
|
|
1407
|
+
__runInitializers$3(this, _inheritedFromParentDeclaration_extraInitializers);
|
|
1408
|
+
this.summary = summary;
|
|
1409
|
+
this.blockTags = blockTags;
|
|
1410
|
+
this.modifierTags = modifierTags;
|
|
1411
|
+
extractLabelTag(this);
|
|
1412
|
+
}
|
|
1413
|
+
/**
|
|
1414
|
+
* Gets either the `@summary` tag, or a short version of the comment summary
|
|
1415
|
+
* section for rendering in module/namespace pages.
|
|
1416
|
+
*/
|
|
1417
|
+
getShortSummary(useFirstParagraph) {
|
|
1418
|
+
const tag = this.getTag("@summary");
|
|
1419
|
+
if (tag)
|
|
1420
|
+
return tag.content;
|
|
1421
|
+
if (!useFirstParagraph)
|
|
1422
|
+
return [];
|
|
1423
|
+
let partsEnd = this.summary.findIndex((part) => {
|
|
1424
|
+
switch (part.kind) {
|
|
1425
|
+
case "text":
|
|
1426
|
+
return part.text.includes("\n\n");
|
|
1427
|
+
case "code":
|
|
1428
|
+
return part.text.includes("\n");
|
|
1429
|
+
case "inline-tag":
|
|
1430
|
+
case "relative-link":
|
|
1431
|
+
return false;
|
|
1432
|
+
default:
|
|
1433
|
+
assertNever(part);
|
|
1434
|
+
}
|
|
1435
|
+
});
|
|
1436
|
+
const foundEnd = partsEnd !== -1;
|
|
1437
|
+
if (partsEnd === -1) {
|
|
1438
|
+
partsEnd = this.summary.length - 1;
|
|
1439
|
+
}
|
|
1440
|
+
const summaryParts = this.summary.slice(0, partsEnd);
|
|
1441
|
+
if (partsEnd !== -1) {
|
|
1442
|
+
const text = this.summary[partsEnd].text;
|
|
1443
|
+
const paragraphEnd = text.indexOf("\n\n");
|
|
1444
|
+
if (paragraphEnd !== -1) {
|
|
1445
|
+
summaryParts.push({
|
|
1446
|
+
...this.summary[partsEnd],
|
|
1447
|
+
text: text.slice(0, paragraphEnd),
|
|
1448
|
+
});
|
|
1449
|
+
}
|
|
1450
|
+
else if (!foundEnd) {
|
|
1451
|
+
summaryParts.push(this.summary[partsEnd]);
|
|
1452
|
+
}
|
|
1453
|
+
}
|
|
1454
|
+
return summaryParts;
|
|
1455
|
+
}
|
|
1456
|
+
/**
|
|
1457
|
+
* Checks if this comment is roughly equal to the other comment.
|
|
1458
|
+
* This isn't exactly equal, but just "roughly equal" by the comment
|
|
1459
|
+
* text.
|
|
1460
|
+
*/
|
|
1461
|
+
similarTo(other) {
|
|
1462
|
+
if (Comment.combineDisplayParts(this.summary) !==
|
|
1463
|
+
Comment.combineDisplayParts(other.summary)) {
|
|
1464
|
+
return false;
|
|
1465
|
+
}
|
|
1466
|
+
// Ignore modifier tags, as they could cause false negatives
|
|
1467
|
+
// if a cascaded modifier tag is present in one comment but not the other.
|
|
1468
|
+
if (this.blockTags.length !== other.blockTags.length) {
|
|
1469
|
+
return false;
|
|
1470
|
+
}
|
|
1471
|
+
for (let i = 0; i < this.blockTags.length; ++i) {
|
|
1472
|
+
if (!this.blockTags[i].similarTo(other.blockTags[i])) {
|
|
1473
|
+
return false;
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
return true;
|
|
1477
|
+
}
|
|
1478
|
+
/**
|
|
1479
|
+
* Create a deep clone of this comment.
|
|
1480
|
+
*/
|
|
1481
|
+
clone() {
|
|
1482
|
+
const comment = new Comment(Comment.cloneDisplayParts(this.summary), this.blockTags.map((tag) => tag.clone()), new Set(this.modifierTags));
|
|
1483
|
+
comment.discoveryId = this.discoveryId;
|
|
1484
|
+
comment.sourcePath = this.sourcePath;
|
|
1485
|
+
comment.inheritedFromParentDeclaration = this.inheritedFromParentDeclaration;
|
|
1486
|
+
return comment;
|
|
1487
|
+
}
|
|
1488
|
+
/**
|
|
1489
|
+
* Returns true if this comment is completely empty.
|
|
1490
|
+
* @internal
|
|
1491
|
+
*/
|
|
1492
|
+
isEmpty() {
|
|
1493
|
+
return !this.hasVisibleComponent() && this.modifierTags.size === 0;
|
|
1494
|
+
}
|
|
1495
|
+
/**
|
|
1496
|
+
* Checks if this comment contains any visible text.
|
|
1497
|
+
*
|
|
1498
|
+
* @returns TRUE when this reflection has a visible comment.
|
|
1499
|
+
*/
|
|
1500
|
+
hasVisibleComponent(notRenderedTags) {
|
|
1501
|
+
if (this.summary.some((x) => x.kind !== "text" || x.text !== "")) {
|
|
1502
|
+
return true;
|
|
1503
|
+
}
|
|
1504
|
+
if (notRenderedTags) {
|
|
1505
|
+
return this.blockTags.some(tag => !notRenderedTags.includes(tag.tag));
|
|
1506
|
+
}
|
|
1507
|
+
else {
|
|
1508
|
+
return this.blockTags.length > 0;
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
/**
|
|
1512
|
+
* Test whether this comment contains a tag with the given name.
|
|
1513
|
+
*
|
|
1514
|
+
* @param tagName The name of the tag to look for.
|
|
1515
|
+
* @returns TRUE when this comment contains a tag with the given name, otherwise FALSE.
|
|
1516
|
+
*/
|
|
1517
|
+
hasModifier(tagName) {
|
|
1518
|
+
return this.modifierTags.has(tagName);
|
|
1519
|
+
}
|
|
1520
|
+
removeModifier(tagName) {
|
|
1521
|
+
this.modifierTags.delete(tagName);
|
|
1522
|
+
}
|
|
1523
|
+
/**
|
|
1524
|
+
* Return the first tag with the given name.
|
|
1525
|
+
*
|
|
1526
|
+
* @param tagName The name of the tag to look for.
|
|
1527
|
+
* @returns The found tag or undefined.
|
|
1528
|
+
*/
|
|
1529
|
+
getTag(tagName) {
|
|
1530
|
+
return this.blockTags.find((tag) => tag.tag === tagName);
|
|
1531
|
+
}
|
|
1532
|
+
/**
|
|
1533
|
+
* Get all tags with the given tag name.
|
|
1534
|
+
*/
|
|
1535
|
+
getTags(tagName) {
|
|
1536
|
+
return this.blockTags.filter((tag) => tag.tag === tagName);
|
|
1537
|
+
}
|
|
1538
|
+
getIdentifiedTag(identifier, tagName) {
|
|
1539
|
+
return this.blockTags.find((tag) => tag.tag === tagName && tag.name === identifier);
|
|
1540
|
+
}
|
|
1541
|
+
/**
|
|
1542
|
+
* Removes all block tags with the given tag name from the comment.
|
|
1543
|
+
* @param tagName
|
|
1544
|
+
*/
|
|
1545
|
+
removeTags(tagName) {
|
|
1546
|
+
removeIf(this.blockTags, (tag) => tag.tag === tagName);
|
|
1547
|
+
}
|
|
1548
|
+
toObject(serializer) {
|
|
1549
|
+
return {
|
|
1550
|
+
summary: Comment.serializeDisplayParts(this.summary),
|
|
1551
|
+
blockTags: serializer.toObjectsOptional(this.blockTags),
|
|
1552
|
+
modifierTags: this.modifierTags.size > 0
|
|
1553
|
+
? Array.from(this.modifierTags)
|
|
1554
|
+
: undefined,
|
|
1555
|
+
label: this.label,
|
|
1556
|
+
};
|
|
1557
|
+
}
|
|
1558
|
+
fromObject(de, obj) {
|
|
1559
|
+
this.summary = Comment.deserializeDisplayParts(de, obj.summary);
|
|
1560
|
+
this.blockTags = obj.blockTags?.map((tagObj) => {
|
|
1561
|
+
const tag = new CommentTag(tagObj.tag, []);
|
|
1562
|
+
de.fromObject(tag, tagObj);
|
|
1563
|
+
return tag;
|
|
1564
|
+
}) || [];
|
|
1565
|
+
this.modifierTags = new Set(obj.modifierTags);
|
|
1566
|
+
this.label = obj.label;
|
|
1567
|
+
}
|
|
1568
|
+
};
|
|
1569
|
+
})();
|
|
1570
|
+
function extractLabelTag(comment) {
|
|
1571
|
+
const index = comment.summary.findIndex((part) => part.kind === "inline-tag" && part.tag === "@label");
|
|
1572
|
+
if (index !== -1) {
|
|
1573
|
+
comment.label = comment.summary.splice(index, 1)[0].text;
|
|
1574
|
+
}
|
|
1575
|
+
}
|
|
1576
|
+
|
|
1577
|
+
/**
|
|
1578
|
+
* Defines the available reflection kinds.
|
|
1579
|
+
* @category Reflections
|
|
1580
|
+
*/
|
|
1581
|
+
var ReflectionKind;
|
|
1582
|
+
(function (ReflectionKind) {
|
|
1583
|
+
ReflectionKind[ReflectionKind["Project"] = 1] = "Project";
|
|
1584
|
+
ReflectionKind[ReflectionKind["Module"] = 2] = "Module";
|
|
1585
|
+
ReflectionKind[ReflectionKind["Namespace"] = 4] = "Namespace";
|
|
1586
|
+
ReflectionKind[ReflectionKind["Enum"] = 8] = "Enum";
|
|
1587
|
+
ReflectionKind[ReflectionKind["EnumMember"] = 16] = "EnumMember";
|
|
1588
|
+
ReflectionKind[ReflectionKind["Variable"] = 32] = "Variable";
|
|
1589
|
+
ReflectionKind[ReflectionKind["Function"] = 64] = "Function";
|
|
1590
|
+
ReflectionKind[ReflectionKind["Class"] = 128] = "Class";
|
|
1591
|
+
ReflectionKind[ReflectionKind["Interface"] = 256] = "Interface";
|
|
1592
|
+
ReflectionKind[ReflectionKind["Constructor"] = 512] = "Constructor";
|
|
1593
|
+
ReflectionKind[ReflectionKind["Property"] = 1024] = "Property";
|
|
1594
|
+
ReflectionKind[ReflectionKind["Method"] = 2048] = "Method";
|
|
1595
|
+
ReflectionKind[ReflectionKind["CallSignature"] = 4096] = "CallSignature";
|
|
1596
|
+
ReflectionKind[ReflectionKind["IndexSignature"] = 8192] = "IndexSignature";
|
|
1597
|
+
ReflectionKind[ReflectionKind["ConstructorSignature"] = 16384] = "ConstructorSignature";
|
|
1598
|
+
ReflectionKind[ReflectionKind["Parameter"] = 32768] = "Parameter";
|
|
1599
|
+
ReflectionKind[ReflectionKind["TypeLiteral"] = 65536] = "TypeLiteral";
|
|
1600
|
+
ReflectionKind[ReflectionKind["TypeParameter"] = 131072] = "TypeParameter";
|
|
1601
|
+
ReflectionKind[ReflectionKind["Accessor"] = 262144] = "Accessor";
|
|
1602
|
+
ReflectionKind[ReflectionKind["GetSignature"] = 524288] = "GetSignature";
|
|
1603
|
+
ReflectionKind[ReflectionKind["SetSignature"] = 1048576] = "SetSignature";
|
|
1604
|
+
ReflectionKind[ReflectionKind["TypeAlias"] = 2097152] = "TypeAlias";
|
|
1605
|
+
ReflectionKind[ReflectionKind["Reference"] = 4194304] = "Reference";
|
|
1606
|
+
/**
|
|
1607
|
+
* Generic non-ts content to be included in the generated docs as its own page.
|
|
1608
|
+
*/
|
|
1609
|
+
ReflectionKind[ReflectionKind["Document"] = 8388608] = "Document";
|
|
1610
|
+
})(ReflectionKind || (ReflectionKind = {}));
|
|
1611
|
+
/** @category Reflections */
|
|
1612
|
+
(function (ReflectionKind) {
|
|
1613
|
+
/** @internal */
|
|
1614
|
+
ReflectionKind.All = ReflectionKind.Reference * 2 - 1;
|
|
1615
|
+
/** @internal */
|
|
1616
|
+
ReflectionKind.ClassOrInterface = ReflectionKind.Class | ReflectionKind.Interface;
|
|
1617
|
+
/** @internal */
|
|
1618
|
+
ReflectionKind.VariableOrProperty = ReflectionKind.Variable | ReflectionKind.Property;
|
|
1619
|
+
/** @internal */
|
|
1620
|
+
ReflectionKind.FunctionOrMethod = ReflectionKind.Function | ReflectionKind.Method;
|
|
1621
|
+
/** @internal */
|
|
1622
|
+
ReflectionKind.ClassMember = ReflectionKind.Accessor |
|
|
1623
|
+
ReflectionKind.Constructor |
|
|
1624
|
+
ReflectionKind.Method |
|
|
1625
|
+
ReflectionKind.Property;
|
|
1626
|
+
/** @internal */
|
|
1627
|
+
ReflectionKind.SomeSignature = ReflectionKind.CallSignature |
|
|
1628
|
+
ReflectionKind.IndexSignature |
|
|
1629
|
+
ReflectionKind.ConstructorSignature |
|
|
1630
|
+
ReflectionKind.GetSignature |
|
|
1631
|
+
ReflectionKind.SetSignature;
|
|
1632
|
+
/** @internal */
|
|
1633
|
+
ReflectionKind.SomeModule = ReflectionKind.Namespace | ReflectionKind.Module;
|
|
1634
|
+
/** @internal */
|
|
1635
|
+
ReflectionKind.SomeType = ReflectionKind.Interface |
|
|
1636
|
+
ReflectionKind.TypeLiteral |
|
|
1637
|
+
ReflectionKind.TypeParameter |
|
|
1638
|
+
ReflectionKind.TypeAlias;
|
|
1639
|
+
/** @internal */
|
|
1640
|
+
ReflectionKind.SomeValue = ReflectionKind.Variable | ReflectionKind.Function;
|
|
1641
|
+
/** @internal */
|
|
1642
|
+
ReflectionKind.SomeMember = ReflectionKind.EnumMember |
|
|
1643
|
+
ReflectionKind.Property |
|
|
1644
|
+
ReflectionKind.Method |
|
|
1645
|
+
ReflectionKind.Accessor;
|
|
1646
|
+
/** @internal */
|
|
1647
|
+
ReflectionKind.SomeExport = ReflectionKind.Module |
|
|
1648
|
+
ReflectionKind.Namespace |
|
|
1649
|
+
ReflectionKind.Enum |
|
|
1650
|
+
ReflectionKind.Variable |
|
|
1651
|
+
ReflectionKind.Function |
|
|
1652
|
+
ReflectionKind.Class |
|
|
1653
|
+
ReflectionKind.Interface |
|
|
1654
|
+
ReflectionKind.TypeAlias |
|
|
1655
|
+
ReflectionKind.Reference;
|
|
1656
|
+
/** @internal */
|
|
1657
|
+
ReflectionKind.MayContainDocuments = ReflectionKind.SomeExport | ReflectionKind.Project | ReflectionKind.Document;
|
|
1658
|
+
/** @internal */
|
|
1659
|
+
ReflectionKind.ExportContainer = ReflectionKind.SomeModule | ReflectionKind.Project;
|
|
1660
|
+
/** @internal */
|
|
1661
|
+
ReflectionKind.Inheritable = ReflectionKind.Accessor |
|
|
1662
|
+
ReflectionKind.IndexSignature |
|
|
1663
|
+
ReflectionKind.Property |
|
|
1664
|
+
ReflectionKind.Method |
|
|
1665
|
+
ReflectionKind.Constructor;
|
|
1666
|
+
/** @internal */
|
|
1667
|
+
ReflectionKind.ContainsCallSignatures = ReflectionKind.Constructor |
|
|
1668
|
+
ReflectionKind.Function |
|
|
1669
|
+
ReflectionKind.Method;
|
|
1670
|
+
// The differences between Type/Value here only really matter for
|
|
1671
|
+
// possibly merged declarations where we have multiple reflections.
|
|
1672
|
+
/** @internal */
|
|
1673
|
+
ReflectionKind.TypeReferenceTarget = ReflectionKind.Interface |
|
|
1674
|
+
ReflectionKind.TypeAlias |
|
|
1675
|
+
ReflectionKind.Class |
|
|
1676
|
+
ReflectionKind.Enum;
|
|
1677
|
+
/** @internal */
|
|
1678
|
+
ReflectionKind.ValueReferenceTarget = ReflectionKind.Module |
|
|
1679
|
+
ReflectionKind.Namespace |
|
|
1680
|
+
ReflectionKind.Variable |
|
|
1681
|
+
ReflectionKind.Function;
|
|
1682
|
+
/**
|
|
1683
|
+
* Note: This does not include Class/Interface, even though they technically could contain index signatures
|
|
1684
|
+
* @internal
|
|
1685
|
+
*/
|
|
1686
|
+
ReflectionKind.SignatureContainer = ReflectionKind.ContainsCallSignatures | ReflectionKind.Accessor;
|
|
1687
|
+
/** @internal */
|
|
1688
|
+
ReflectionKind.VariableContainer = ReflectionKind.SomeModule | ReflectionKind.Project;
|
|
1689
|
+
/** @internal */
|
|
1690
|
+
ReflectionKind.MethodContainer = ReflectionKind.ClassOrInterface |
|
|
1691
|
+
ReflectionKind.VariableOrProperty |
|
|
1692
|
+
ReflectionKind.FunctionOrMethod |
|
|
1693
|
+
ReflectionKind.TypeLiteral;
|
|
1694
|
+
function singularString(kind) {
|
|
1695
|
+
switch (kind) {
|
|
1696
|
+
case ReflectionKind.Project:
|
|
1697
|
+
return i18n.kind_project();
|
|
1698
|
+
case ReflectionKind.Module:
|
|
1699
|
+
return i18n.kind_module();
|
|
1700
|
+
case ReflectionKind.Namespace:
|
|
1701
|
+
return i18n.kind_namespace();
|
|
1702
|
+
case ReflectionKind.Enum:
|
|
1703
|
+
return i18n.kind_enum();
|
|
1704
|
+
case ReflectionKind.EnumMember:
|
|
1705
|
+
return i18n.kind_enum_member();
|
|
1706
|
+
case ReflectionKind.Variable:
|
|
1707
|
+
return i18n.kind_variable();
|
|
1708
|
+
case ReflectionKind.Function:
|
|
1709
|
+
return i18n.kind_function();
|
|
1710
|
+
case ReflectionKind.Class:
|
|
1711
|
+
return i18n.kind_class();
|
|
1712
|
+
case ReflectionKind.Interface:
|
|
1713
|
+
return i18n.kind_interface();
|
|
1714
|
+
case ReflectionKind.Constructor:
|
|
1715
|
+
return i18n.kind_constructor();
|
|
1716
|
+
case ReflectionKind.Property:
|
|
1717
|
+
return i18n.kind_property();
|
|
1718
|
+
case ReflectionKind.Method:
|
|
1719
|
+
return i18n.kind_method();
|
|
1720
|
+
case ReflectionKind.CallSignature:
|
|
1721
|
+
return i18n.kind_call_signature();
|
|
1722
|
+
case ReflectionKind.IndexSignature:
|
|
1723
|
+
return i18n.kind_index_signature();
|
|
1724
|
+
case ReflectionKind.ConstructorSignature:
|
|
1725
|
+
return i18n.kind_constructor_signature();
|
|
1726
|
+
case ReflectionKind.Parameter:
|
|
1727
|
+
return i18n.kind_parameter();
|
|
1728
|
+
case ReflectionKind.TypeLiteral:
|
|
1729
|
+
return i18n.kind_type_literal();
|
|
1730
|
+
case ReflectionKind.TypeParameter:
|
|
1731
|
+
return i18n.kind_type_parameter();
|
|
1732
|
+
case ReflectionKind.Accessor:
|
|
1733
|
+
return i18n.kind_accessor();
|
|
1734
|
+
case ReflectionKind.GetSignature:
|
|
1735
|
+
return i18n.kind_get_signature();
|
|
1736
|
+
case ReflectionKind.SetSignature:
|
|
1737
|
+
return i18n.kind_set_signature();
|
|
1738
|
+
case ReflectionKind.TypeAlias:
|
|
1739
|
+
return i18n.kind_type_alias();
|
|
1740
|
+
case ReflectionKind.Reference:
|
|
1741
|
+
return i18n.kind_reference();
|
|
1742
|
+
case ReflectionKind.Document:
|
|
1743
|
+
return i18n.kind_document();
|
|
1744
|
+
}
|
|
1745
|
+
}
|
|
1746
|
+
ReflectionKind.singularString = singularString;
|
|
1747
|
+
function pluralString(kind) {
|
|
1748
|
+
switch (kind) {
|
|
1749
|
+
case ReflectionKind.Project:
|
|
1750
|
+
return i18n.kind_plural_project();
|
|
1751
|
+
case ReflectionKind.Module:
|
|
1752
|
+
return i18n.kind_plural_module();
|
|
1753
|
+
case ReflectionKind.Namespace:
|
|
1754
|
+
return i18n.kind_plural_namespace();
|
|
1755
|
+
case ReflectionKind.Enum:
|
|
1756
|
+
return i18n.kind_plural_enum();
|
|
1757
|
+
case ReflectionKind.EnumMember:
|
|
1758
|
+
return i18n.kind_plural_enum_member();
|
|
1759
|
+
case ReflectionKind.Variable:
|
|
1760
|
+
return i18n.kind_plural_variable();
|
|
1761
|
+
case ReflectionKind.Function:
|
|
1762
|
+
return i18n.kind_plural_function();
|
|
1763
|
+
case ReflectionKind.Class:
|
|
1764
|
+
return i18n.kind_plural_class();
|
|
1765
|
+
case ReflectionKind.Interface:
|
|
1766
|
+
return i18n.kind_plural_interface();
|
|
1767
|
+
case ReflectionKind.Constructor:
|
|
1768
|
+
return i18n.kind_plural_constructor();
|
|
1769
|
+
case ReflectionKind.Property:
|
|
1770
|
+
return i18n.kind_plural_property();
|
|
1771
|
+
case ReflectionKind.Method:
|
|
1772
|
+
return i18n.kind_plural_method();
|
|
1773
|
+
case ReflectionKind.CallSignature:
|
|
1774
|
+
return i18n.kind_plural_call_signature();
|
|
1775
|
+
case ReflectionKind.IndexSignature:
|
|
1776
|
+
return i18n.kind_plural_index_signature();
|
|
1777
|
+
case ReflectionKind.ConstructorSignature:
|
|
1778
|
+
return i18n.kind_plural_constructor_signature();
|
|
1779
|
+
case ReflectionKind.Parameter:
|
|
1780
|
+
return i18n.kind_plural_parameter();
|
|
1781
|
+
case ReflectionKind.TypeLiteral:
|
|
1782
|
+
return i18n.kind_plural_type_literal();
|
|
1783
|
+
case ReflectionKind.TypeParameter:
|
|
1784
|
+
return i18n.kind_plural_type_parameter();
|
|
1785
|
+
case ReflectionKind.Accessor:
|
|
1786
|
+
return i18n.kind_plural_accessor();
|
|
1787
|
+
case ReflectionKind.GetSignature:
|
|
1788
|
+
return i18n.kind_plural_get_signature();
|
|
1789
|
+
case ReflectionKind.SetSignature:
|
|
1790
|
+
return i18n.kind_plural_set_signature();
|
|
1791
|
+
case ReflectionKind.TypeAlias:
|
|
1792
|
+
return i18n.kind_plural_type_alias();
|
|
1793
|
+
case ReflectionKind.Reference:
|
|
1794
|
+
return i18n.kind_plural_reference();
|
|
1795
|
+
case ReflectionKind.Document:
|
|
1796
|
+
return i18n.kind_plural_document();
|
|
1797
|
+
}
|
|
1798
|
+
}
|
|
1799
|
+
ReflectionKind.pluralString = pluralString;
|
|
1800
|
+
function classString(kind) {
|
|
1801
|
+
return `tsd-kind-${ReflectionKind[kind]
|
|
1802
|
+
.replace(/(.)([A-Z])/g, (_m, a, b) => `${a}-${b}`)
|
|
1803
|
+
.toLowerCase()}`;
|
|
1804
|
+
}
|
|
1805
|
+
ReflectionKind.classString = classString;
|
|
1806
|
+
})(ReflectionKind || (ReflectionKind = {}));
|
|
1807
|
+
|
|
1808
|
+
var __esDecorate$2 = (globalThis && globalThis.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
1809
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
1810
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
1811
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
1812
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
1813
|
+
var _, done = false;
|
|
1814
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
1815
|
+
var context = {};
|
|
1816
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
1817
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
1818
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
1819
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
1820
|
+
if (kind === "accessor") {
|
|
1821
|
+
if (result === void 0) continue;
|
|
1822
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
1823
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
1824
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
1825
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
1826
|
+
}
|
|
1827
|
+
else if (_ = accept(result)) {
|
|
1828
|
+
if (kind === "field") initializers.unshift(_);
|
|
1829
|
+
else descriptor[key] = _;
|
|
1830
|
+
}
|
|
1831
|
+
}
|
|
1832
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
1833
|
+
done = true;
|
|
1834
|
+
};
|
|
1835
|
+
var __runInitializers$2 = (globalThis && globalThis.__runInitializers) || function (thisArg, initializers, value) {
|
|
1836
|
+
var useValue = arguments.length > 2;
|
|
1837
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
1838
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
1839
|
+
}
|
|
1840
|
+
return useValue ? value : void 0;
|
|
1841
|
+
};
|
|
1842
|
+
/**
|
|
1843
|
+
* Current reflection id.
|
|
1844
|
+
*/
|
|
1845
|
+
let REFLECTION_ID = 0;
|
|
1846
|
+
var ReflectionFlag;
|
|
1847
|
+
(function (ReflectionFlag) {
|
|
1848
|
+
ReflectionFlag[ReflectionFlag["None"] = 0] = "None";
|
|
1849
|
+
ReflectionFlag[ReflectionFlag["Private"] = 1] = "Private";
|
|
1850
|
+
ReflectionFlag[ReflectionFlag["Protected"] = 2] = "Protected";
|
|
1851
|
+
ReflectionFlag[ReflectionFlag["Public"] = 4] = "Public";
|
|
1852
|
+
ReflectionFlag[ReflectionFlag["Static"] = 8] = "Static";
|
|
1853
|
+
ReflectionFlag[ReflectionFlag["External"] = 16] = "External";
|
|
1854
|
+
ReflectionFlag[ReflectionFlag["Optional"] = 32] = "Optional";
|
|
1855
|
+
ReflectionFlag[ReflectionFlag["Rest"] = 64] = "Rest";
|
|
1856
|
+
ReflectionFlag[ReflectionFlag["Abstract"] = 128] = "Abstract";
|
|
1857
|
+
ReflectionFlag[ReflectionFlag["Const"] = 256] = "Const";
|
|
1858
|
+
ReflectionFlag[ReflectionFlag["Readonly"] = 512] = "Readonly";
|
|
1859
|
+
ReflectionFlag[ReflectionFlag["Inherited"] = 1024] = "Inherited";
|
|
1860
|
+
})(ReflectionFlag || (ReflectionFlag = {}));
|
|
1861
|
+
const relevantFlags = [
|
|
1862
|
+
ReflectionFlag.Private,
|
|
1863
|
+
ReflectionFlag.Protected,
|
|
1864
|
+
ReflectionFlag.Static,
|
|
1865
|
+
ReflectionFlag.Optional,
|
|
1866
|
+
ReflectionFlag.Abstract,
|
|
1867
|
+
ReflectionFlag.Const,
|
|
1868
|
+
ReflectionFlag.Readonly,
|
|
1869
|
+
];
|
|
1870
|
+
/**
|
|
1871
|
+
* This must extend Array in order to work with Handlebar's each helper.
|
|
1872
|
+
*/
|
|
1873
|
+
class ReflectionFlags {
|
|
1874
|
+
flags = ReflectionFlag.None;
|
|
1875
|
+
hasFlag(flag) {
|
|
1876
|
+
return (flag & this.flags) !== 0;
|
|
1877
|
+
}
|
|
1878
|
+
/**
|
|
1879
|
+
* Is this a private member?
|
|
1880
|
+
*/
|
|
1881
|
+
get isPrivate() {
|
|
1882
|
+
return this.hasFlag(ReflectionFlag.Private);
|
|
1883
|
+
}
|
|
1884
|
+
/**
|
|
1885
|
+
* Is this a protected member?
|
|
1886
|
+
*/
|
|
1887
|
+
get isProtected() {
|
|
1888
|
+
return this.hasFlag(ReflectionFlag.Protected);
|
|
1889
|
+
}
|
|
1890
|
+
/**
|
|
1891
|
+
* Is this a public member?
|
|
1892
|
+
*/
|
|
1893
|
+
get isPublic() {
|
|
1894
|
+
return this.hasFlag(ReflectionFlag.Public);
|
|
1895
|
+
}
|
|
1896
|
+
/**
|
|
1897
|
+
* Is this a static member?
|
|
1898
|
+
*/
|
|
1899
|
+
get isStatic() {
|
|
1900
|
+
return this.hasFlag(ReflectionFlag.Static);
|
|
1901
|
+
}
|
|
1902
|
+
/**
|
|
1903
|
+
* Is this a declaration from an external document?
|
|
1904
|
+
*/
|
|
1905
|
+
get isExternal() {
|
|
1906
|
+
return this.hasFlag(ReflectionFlag.External);
|
|
1907
|
+
}
|
|
1908
|
+
/**
|
|
1909
|
+
* Whether this reflection is an optional component or not.
|
|
1910
|
+
*
|
|
1911
|
+
* Applies to function parameters and object members.
|
|
1912
|
+
*/
|
|
1913
|
+
get isOptional() {
|
|
1914
|
+
return this.hasFlag(ReflectionFlag.Optional);
|
|
1915
|
+
}
|
|
1916
|
+
/**
|
|
1917
|
+
* Whether it's a rest parameter, like `foo(...params);`.
|
|
1918
|
+
*/
|
|
1919
|
+
get isRest() {
|
|
1920
|
+
return this.hasFlag(ReflectionFlag.Rest);
|
|
1921
|
+
}
|
|
1922
|
+
get isAbstract() {
|
|
1923
|
+
return this.hasFlag(ReflectionFlag.Abstract);
|
|
1924
|
+
}
|
|
1925
|
+
get isConst() {
|
|
1926
|
+
return this.hasFlag(ReflectionFlag.Const);
|
|
1927
|
+
}
|
|
1928
|
+
get isReadonly() {
|
|
1929
|
+
return this.hasFlag(ReflectionFlag.Readonly);
|
|
1930
|
+
}
|
|
1931
|
+
get isInherited() {
|
|
1932
|
+
return this.hasFlag(ReflectionFlag.Inherited);
|
|
1933
|
+
}
|
|
1934
|
+
setFlag(flag, set) {
|
|
1935
|
+
switch (flag) {
|
|
1936
|
+
case ReflectionFlag.Private:
|
|
1937
|
+
this.setSingleFlag(ReflectionFlag.Private, set);
|
|
1938
|
+
if (set) {
|
|
1939
|
+
this.setFlag(ReflectionFlag.Protected, false);
|
|
1940
|
+
this.setFlag(ReflectionFlag.Public, false);
|
|
1941
|
+
}
|
|
1942
|
+
break;
|
|
1943
|
+
case ReflectionFlag.Protected:
|
|
1944
|
+
this.setSingleFlag(ReflectionFlag.Protected, set);
|
|
1945
|
+
if (set) {
|
|
1946
|
+
this.setFlag(ReflectionFlag.Private, false);
|
|
1947
|
+
this.setFlag(ReflectionFlag.Public, false);
|
|
1948
|
+
}
|
|
1949
|
+
break;
|
|
1950
|
+
case ReflectionFlag.Public:
|
|
1951
|
+
this.setSingleFlag(ReflectionFlag.Public, set);
|
|
1952
|
+
if (set) {
|
|
1953
|
+
this.setFlag(ReflectionFlag.Private, false);
|
|
1954
|
+
this.setFlag(ReflectionFlag.Protected, false);
|
|
1955
|
+
}
|
|
1956
|
+
break;
|
|
1957
|
+
default:
|
|
1958
|
+
this.setSingleFlag(flag, set);
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
static flagString(flag) {
|
|
1962
|
+
switch (flag) {
|
|
1963
|
+
case ReflectionFlag.None:
|
|
1964
|
+
throw new Error("Should be unreachable");
|
|
1965
|
+
case ReflectionFlag.Private:
|
|
1966
|
+
return i18n.flag_private();
|
|
1967
|
+
case ReflectionFlag.Protected:
|
|
1968
|
+
return i18n.flag_protected();
|
|
1969
|
+
case ReflectionFlag.Public:
|
|
1970
|
+
return i18n.flag_public();
|
|
1971
|
+
case ReflectionFlag.Static:
|
|
1972
|
+
return i18n.flag_static();
|
|
1973
|
+
case ReflectionFlag.External:
|
|
1974
|
+
return i18n.flag_external();
|
|
1975
|
+
case ReflectionFlag.Optional:
|
|
1976
|
+
return i18n.flag_optional();
|
|
1977
|
+
case ReflectionFlag.Rest:
|
|
1978
|
+
return i18n.flag_rest();
|
|
1979
|
+
case ReflectionFlag.Abstract:
|
|
1980
|
+
return i18n.flag_abstract();
|
|
1981
|
+
case ReflectionFlag.Const:
|
|
1982
|
+
return i18n.flag_const();
|
|
1983
|
+
case ReflectionFlag.Readonly:
|
|
1984
|
+
return i18n.flag_readonly();
|
|
1985
|
+
case ReflectionFlag.Inherited:
|
|
1986
|
+
return i18n.flag_inherited();
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
getFlagStrings() {
|
|
1990
|
+
const strings = [];
|
|
1991
|
+
for (const flag of relevantFlags) {
|
|
1992
|
+
if (this.hasFlag(flag)) {
|
|
1993
|
+
strings.push(ReflectionFlags.flagString(flag));
|
|
1994
|
+
}
|
|
1995
|
+
}
|
|
1996
|
+
return strings;
|
|
1997
|
+
}
|
|
1998
|
+
setSingleFlag(flag, set) {
|
|
1999
|
+
if (!set && this.hasFlag(flag)) {
|
|
2000
|
+
this.flags ^= flag;
|
|
2001
|
+
}
|
|
2002
|
+
else if (set && !this.hasFlag(flag)) {
|
|
2003
|
+
this.flags |= flag;
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
static serializedFlags = [
|
|
2007
|
+
"isPrivate",
|
|
2008
|
+
"isProtected",
|
|
2009
|
+
"isPublic",
|
|
2010
|
+
"isStatic",
|
|
2011
|
+
"isExternal",
|
|
2012
|
+
"isOptional",
|
|
2013
|
+
"isRest",
|
|
2014
|
+
"isAbstract",
|
|
2015
|
+
"isConst",
|
|
2016
|
+
"isReadonly",
|
|
2017
|
+
"isInherited",
|
|
2018
|
+
];
|
|
2019
|
+
toObject() {
|
|
2020
|
+
return Object.fromEntries(ReflectionFlags.serializedFlags
|
|
2021
|
+
.filter((flag) => this[flag])
|
|
2022
|
+
.map((flag) => [flag, true]));
|
|
2023
|
+
}
|
|
2024
|
+
fromObject(obj) {
|
|
2025
|
+
for (const key of Object.keys(obj)) {
|
|
2026
|
+
const flagName = key.substring(2); // isPublic => Public
|
|
2027
|
+
if (flagName in ReflectionFlag) {
|
|
2028
|
+
this.setFlag(ReflectionFlag[flagName], true);
|
|
2029
|
+
}
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
var TraverseProperty;
|
|
2034
|
+
(function (TraverseProperty) {
|
|
2035
|
+
TraverseProperty[TraverseProperty["Children"] = 0] = "Children";
|
|
2036
|
+
TraverseProperty[TraverseProperty["Documents"] = 1] = "Documents";
|
|
2037
|
+
TraverseProperty[TraverseProperty["Parameters"] = 2] = "Parameters";
|
|
2038
|
+
TraverseProperty[TraverseProperty["TypeLiteral"] = 3] = "TypeLiteral";
|
|
2039
|
+
TraverseProperty[TraverseProperty["TypeParameter"] = 4] = "TypeParameter";
|
|
2040
|
+
TraverseProperty[TraverseProperty["Signatures"] = 5] = "Signatures";
|
|
2041
|
+
TraverseProperty[TraverseProperty["IndexSignature"] = 6] = "IndexSignature";
|
|
2042
|
+
TraverseProperty[TraverseProperty["GetSignature"] = 7] = "GetSignature";
|
|
2043
|
+
TraverseProperty[TraverseProperty["SetSignature"] = 8] = "SetSignature";
|
|
2044
|
+
})(TraverseProperty || (TraverseProperty = {}));
|
|
2045
|
+
/**
|
|
2046
|
+
* Base class for all reflection classes.
|
|
2047
|
+
*
|
|
2048
|
+
* While generating a documentation, TypeDoc generates an instance of {@link ProjectReflection}
|
|
2049
|
+
* as the root for all reflections within the project. All other reflections are represented
|
|
2050
|
+
* by the {@link DeclarationReflection} class.
|
|
2051
|
+
*
|
|
2052
|
+
* This base class exposes the basic properties one may use to traverse the reflection tree.
|
|
2053
|
+
* You can use the {@link ContainerReflection.children} and {@link parent} properties to walk the tree. The {@link ContainerReflection.groups} property
|
|
2054
|
+
* contains a list of all children grouped and sorted for rendering.
|
|
2055
|
+
* @category Reflections
|
|
2056
|
+
*/
|
|
2057
|
+
let Reflection = (() => {
|
|
2058
|
+
let _parent_decorators;
|
|
2059
|
+
let _parent_initializers = [];
|
|
2060
|
+
let _parent_extraInitializers = [];
|
|
2061
|
+
let _project_decorators;
|
|
2062
|
+
let _project_initializers = [];
|
|
2063
|
+
let _project_extraInitializers = [];
|
|
2064
|
+
return class Reflection {
|
|
2065
|
+
static {
|
|
2066
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
2067
|
+
_parent_decorators = [NonEnumerable];
|
|
2068
|
+
_project_decorators = [NonEnumerable];
|
|
2069
|
+
__esDecorate$2(null, null, _parent_decorators, { kind: "field", name: "parent", static: false, private: false, access: { has: obj => "parent" in obj, get: obj => obj.parent, set: (obj, value) => { obj.parent = value; } }, metadata: _metadata }, _parent_initializers, _parent_extraInitializers);
|
|
2070
|
+
__esDecorate$2(null, null, _project_decorators, { kind: "field", name: "project", static: false, private: false, access: { has: obj => "project" in obj, get: obj => obj.project, set: (obj, value) => { obj.project = value; } }, metadata: _metadata }, _project_initializers, _project_extraInitializers);
|
|
2071
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2072
|
+
}
|
|
2073
|
+
/**
|
|
2074
|
+
* Unique id of this reflection.
|
|
2075
|
+
*/
|
|
2076
|
+
id;
|
|
2077
|
+
/**
|
|
2078
|
+
* The symbol name of this reflection.
|
|
2079
|
+
*/
|
|
2080
|
+
name;
|
|
2081
|
+
/**
|
|
2082
|
+
* The kind of this reflection.
|
|
2083
|
+
*/
|
|
2084
|
+
kind;
|
|
2085
|
+
flags = new ReflectionFlags();
|
|
2086
|
+
/**
|
|
2087
|
+
* The reflection this reflection is a child of.
|
|
2088
|
+
*/
|
|
2089
|
+
parent = __runInitializers$2(this, _parent_initializers, void 0);
|
|
2090
|
+
project = (__runInitializers$2(this, _parent_extraInitializers), __runInitializers$2(this, _project_initializers, void 0));
|
|
2091
|
+
/**
|
|
2092
|
+
* The parsed documentation comment attached to this reflection.
|
|
2093
|
+
*/
|
|
2094
|
+
comment = __runInitializers$2(this, _project_extraInitializers);
|
|
2095
|
+
constructor(name, kind, parent) {
|
|
2096
|
+
this.id = REFLECTION_ID++;
|
|
2097
|
+
this.parent = parent;
|
|
2098
|
+
this.project = parent?.project || this;
|
|
2099
|
+
this.name = name;
|
|
2100
|
+
this.kind = kind;
|
|
2101
|
+
// If our parent is external, we are too.
|
|
2102
|
+
if (parent?.flags.isExternal) {
|
|
2103
|
+
this.setFlag(ReflectionFlag.External);
|
|
2104
|
+
}
|
|
2105
|
+
}
|
|
2106
|
+
/**
|
|
2107
|
+
* Test whether this reflection is of the given kind.
|
|
2108
|
+
*/
|
|
2109
|
+
kindOf(kind) {
|
|
2110
|
+
const kindFlags = Array.isArray(kind)
|
|
2111
|
+
? kind.reduce((a, b) => a | b, 0)
|
|
2112
|
+
: kind;
|
|
2113
|
+
return (this.kind & kindFlags) !== 0;
|
|
2114
|
+
}
|
|
2115
|
+
/**
|
|
2116
|
+
* Return the full name of this reflection. Intended for use in debugging. For log messages
|
|
2117
|
+
* intended to be displayed to the user for them to fix, prefer {@link getFriendlyFullName} instead.
|
|
2118
|
+
*
|
|
2119
|
+
* The full name contains the name of this reflection and the names of all parent reflections.
|
|
2120
|
+
*
|
|
2121
|
+
* @param separator Separator used to join the names of the reflections.
|
|
2122
|
+
* @returns The full name of this reflection.
|
|
2123
|
+
*/
|
|
2124
|
+
getFullName(separator = ".") {
|
|
2125
|
+
if (this.parent && !this.parent.isProject()) {
|
|
2126
|
+
return this.parent.getFullName(separator) + separator + this.name;
|
|
2127
|
+
}
|
|
2128
|
+
else {
|
|
2129
|
+
return this.name;
|
|
2130
|
+
}
|
|
2131
|
+
}
|
|
2132
|
+
/**
|
|
2133
|
+
* Return the full name of this reflection, with signature names dropped if possible without
|
|
2134
|
+
* introducing ambiguity in the name.
|
|
2135
|
+
*/
|
|
2136
|
+
getFriendlyFullName() {
|
|
2137
|
+
if (this.parent && !this.parent.isProject()) {
|
|
2138
|
+
if (this.kindOf(ReflectionKind.ConstructorSignature |
|
|
2139
|
+
ReflectionKind.CallSignature |
|
|
2140
|
+
ReflectionKind.GetSignature |
|
|
2141
|
+
ReflectionKind.SetSignature)) {
|
|
2142
|
+
return this.parent.getFriendlyFullName();
|
|
2143
|
+
}
|
|
2144
|
+
return this.parent.getFriendlyFullName() + "." + this.name;
|
|
2145
|
+
}
|
|
2146
|
+
else {
|
|
2147
|
+
return this.name;
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
/**
|
|
2151
|
+
* Set a flag on this reflection.
|
|
2152
|
+
*/
|
|
2153
|
+
setFlag(flag, value = true) {
|
|
2154
|
+
this.flags.setFlag(flag, value);
|
|
2155
|
+
}
|
|
2156
|
+
/**
|
|
2157
|
+
* Checks if this reflection has a comment which contains any visible text.
|
|
2158
|
+
*
|
|
2159
|
+
* @returns TRUE when this reflection has a visible comment.
|
|
2160
|
+
*/
|
|
2161
|
+
hasComment(notRenderedTags) {
|
|
2162
|
+
return this.comment ? this.comment.hasVisibleComponent(notRenderedTags) : false;
|
|
2163
|
+
}
|
|
2164
|
+
hasGetterOrSetter() {
|
|
2165
|
+
return false;
|
|
2166
|
+
}
|
|
2167
|
+
/**
|
|
2168
|
+
* Return a child by its name.
|
|
2169
|
+
*
|
|
2170
|
+
* @param arg The name hierarchy of the child to look for.
|
|
2171
|
+
* @returns The found child or undefined.
|
|
2172
|
+
*/
|
|
2173
|
+
getChildByName(arg) {
|
|
2174
|
+
const names = Array.isArray(arg)
|
|
2175
|
+
? arg
|
|
2176
|
+
: splitUnquotedString(arg, ".");
|
|
2177
|
+
const name = names[0];
|
|
2178
|
+
let result;
|
|
2179
|
+
this.traverse((child) => {
|
|
2180
|
+
if (child.name === name) {
|
|
2181
|
+
if (names.length <= 1) {
|
|
2182
|
+
result = child;
|
|
2183
|
+
}
|
|
2184
|
+
else {
|
|
2185
|
+
result = child.getChildByName(names.slice(1));
|
|
2186
|
+
}
|
|
2187
|
+
return false;
|
|
2188
|
+
}
|
|
2189
|
+
return true;
|
|
2190
|
+
});
|
|
2191
|
+
return result;
|
|
2192
|
+
}
|
|
2193
|
+
/**
|
|
2194
|
+
* Return whether this reflection is the root / project reflection.
|
|
2195
|
+
*/
|
|
2196
|
+
isProject() {
|
|
2197
|
+
return false;
|
|
2198
|
+
}
|
|
2199
|
+
isDeclaration() {
|
|
2200
|
+
return false;
|
|
2201
|
+
}
|
|
2202
|
+
isSignature() {
|
|
2203
|
+
return false;
|
|
2204
|
+
}
|
|
2205
|
+
isTypeParameter() {
|
|
2206
|
+
return false;
|
|
2207
|
+
}
|
|
2208
|
+
isParameter() {
|
|
2209
|
+
return false;
|
|
2210
|
+
}
|
|
2211
|
+
isDocument() {
|
|
2212
|
+
return false;
|
|
2213
|
+
}
|
|
2214
|
+
isReference() {
|
|
2215
|
+
return this.variant === "reference";
|
|
2216
|
+
}
|
|
2217
|
+
isContainer() {
|
|
2218
|
+
return false;
|
|
2219
|
+
}
|
|
2220
|
+
/**
|
|
2221
|
+
* Check if this reflection or any of its parents have been marked with the `@deprecated` tag.
|
|
2222
|
+
*/
|
|
2223
|
+
isDeprecated() {
|
|
2224
|
+
let signaturesDeprecated = false;
|
|
2225
|
+
this.visit({
|
|
2226
|
+
declaration(decl) {
|
|
2227
|
+
if (decl.signatures?.length &&
|
|
2228
|
+
decl.signatures.every((sig) => sig.comment?.getTag("@deprecated"))) {
|
|
2229
|
+
signaturesDeprecated = true;
|
|
2230
|
+
}
|
|
2231
|
+
},
|
|
2232
|
+
});
|
|
2233
|
+
if (signaturesDeprecated || this.comment?.getTag("@deprecated")) {
|
|
2234
|
+
return true;
|
|
2235
|
+
}
|
|
2236
|
+
return this.parent?.isDeprecated() ?? false;
|
|
2237
|
+
}
|
|
2238
|
+
visit(visitor) {
|
|
2239
|
+
visitor[this.variant]?.(this);
|
|
2240
|
+
}
|
|
2241
|
+
/**
|
|
2242
|
+
* Return a string representation of this reflection.
|
|
2243
|
+
*/
|
|
2244
|
+
toString() {
|
|
2245
|
+
return ReflectionKind[this.kind] + " " + this.name;
|
|
2246
|
+
}
|
|
2247
|
+
/**
|
|
2248
|
+
* Return a string representation of this reflection and all of its children.
|
|
2249
|
+
*
|
|
2250
|
+
* Note: This is intended as a debug tool only, output may change between patch versions.
|
|
2251
|
+
*
|
|
2252
|
+
* @param indent Used internally to indent child reflections.
|
|
2253
|
+
*/
|
|
2254
|
+
toStringHierarchy(indent = "") {
|
|
2255
|
+
const lines = [indent + this.toString()];
|
|
2256
|
+
indent += " ";
|
|
2257
|
+
this.traverse((child) => {
|
|
2258
|
+
lines.push(child.toStringHierarchy(indent));
|
|
2259
|
+
return true;
|
|
2260
|
+
});
|
|
2261
|
+
return lines.join("\n");
|
|
2262
|
+
}
|
|
2263
|
+
toObject(serializer) {
|
|
2264
|
+
return {
|
|
2265
|
+
id: this.id,
|
|
2266
|
+
name: this.name,
|
|
2267
|
+
variant: this.variant,
|
|
2268
|
+
kind: this.kind,
|
|
2269
|
+
flags: this.flags.toObject(),
|
|
2270
|
+
comment: this.comment && !this.comment.isEmpty()
|
|
2271
|
+
? serializer.toObject(this.comment)
|
|
2272
|
+
: undefined,
|
|
2273
|
+
};
|
|
2274
|
+
}
|
|
2275
|
+
fromObject(de, obj) {
|
|
2276
|
+
// DO NOT copy id from obj. When deserializing reflections
|
|
2277
|
+
// they should be given new ids since they belong to a different project.
|
|
2278
|
+
this.name = obj.name;
|
|
2279
|
+
// Skip copying variant, we know it's already the correct value because the deserializer
|
|
2280
|
+
// will construct the correct class type.
|
|
2281
|
+
this.kind = obj.kind;
|
|
2282
|
+
this.flags.fromObject(obj.flags);
|
|
2283
|
+
// Parent is set during construction, so we don't need to do it here.
|
|
2284
|
+
this.comment = de.revive(obj.comment, () => new Comment());
|
|
2285
|
+
// url, anchor, hasOwnDocument, _alias, _aliases are set during rendering and only relevant during render.
|
|
2286
|
+
// It doesn't make sense to serialize them to json, or restore them.
|
|
2287
|
+
}
|
|
2288
|
+
};
|
|
2289
|
+
})();
|
|
2290
|
+
|
|
2291
|
+
/**
|
|
2292
|
+
* A category of reflections.
|
|
2293
|
+
*
|
|
2294
|
+
* Reflection categories are created by the ´CategoryPlugin´ in the resolving phase
|
|
2295
|
+
* of the dispatcher. The main purpose of categories is to be able to more easily
|
|
2296
|
+
* render human readable children lists in templates.
|
|
2297
|
+
*/
|
|
2298
|
+
class ReflectionCategory {
|
|
2299
|
+
/**
|
|
2300
|
+
* The title, a string representation of this category.
|
|
2301
|
+
*/
|
|
2302
|
+
title;
|
|
2303
|
+
/**
|
|
2304
|
+
* The user specified description, if any, set with `@categoryDescription`
|
|
2305
|
+
*/
|
|
2306
|
+
description;
|
|
2307
|
+
/**
|
|
2308
|
+
* All reflections of this category.
|
|
2309
|
+
*/
|
|
2310
|
+
children = [];
|
|
2311
|
+
/**
|
|
2312
|
+
* Create a new ReflectionCategory instance.
|
|
2313
|
+
*
|
|
2314
|
+
* @param title The title of this category.
|
|
2315
|
+
*/
|
|
2316
|
+
constructor(title) {
|
|
2317
|
+
this.title = title;
|
|
2318
|
+
}
|
|
2319
|
+
toObject() {
|
|
2320
|
+
return {
|
|
2321
|
+
title: this.title,
|
|
2322
|
+
description: this.description
|
|
2323
|
+
? Comment.serializeDisplayParts(this.description)
|
|
2324
|
+
: undefined,
|
|
2325
|
+
children: this.children.length > 0
|
|
2326
|
+
? this.children.map((child) => child.id)
|
|
2327
|
+
: undefined,
|
|
2328
|
+
};
|
|
2329
|
+
}
|
|
2330
|
+
fromObject(de, obj) {
|
|
2331
|
+
if (obj.description) {
|
|
2332
|
+
this.description = Comment.deserializeDisplayParts(de, obj.description);
|
|
2333
|
+
}
|
|
2334
|
+
if (obj.children) {
|
|
2335
|
+
de.defer((project) => {
|
|
2336
|
+
for (const childId of obj.children || []) {
|
|
2337
|
+
const child = project.getReflectionById(de.oldIdToNewId[childId] ?? -1);
|
|
2338
|
+
if (child?.isDeclaration() || child?.isDocument()) {
|
|
2339
|
+
this.children.push(child);
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
});
|
|
2343
|
+
}
|
|
2344
|
+
}
|
|
2345
|
+
}
|
|
2346
|
+
|
|
2347
|
+
/**
|
|
2348
|
+
* A group of reflections. All reflections in a group are of the same kind.
|
|
2349
|
+
*
|
|
2350
|
+
* Reflection groups are created by the ´GroupHandler´ in the resolving phase
|
|
2351
|
+
* of the dispatcher. The main purpose of groups is to be able to more easily
|
|
2352
|
+
* render human readable children lists in templates.
|
|
2353
|
+
*/
|
|
2354
|
+
class ReflectionGroup {
|
|
2355
|
+
owningReflection;
|
|
2356
|
+
/**
|
|
2357
|
+
* The title, a string representation of the typescript kind, of this group.
|
|
2358
|
+
*/
|
|
2359
|
+
title;
|
|
2360
|
+
/**
|
|
2361
|
+
* User specified description via `@groupDescription`, if specified.
|
|
2362
|
+
*/
|
|
2363
|
+
description;
|
|
2364
|
+
/**
|
|
2365
|
+
* All reflections of this group.
|
|
2366
|
+
*/
|
|
2367
|
+
children = [];
|
|
2368
|
+
/**
|
|
2369
|
+
* Categories contained within this group.
|
|
2370
|
+
*/
|
|
2371
|
+
categories;
|
|
2372
|
+
/**
|
|
2373
|
+
* Create a new ReflectionGroup instance.
|
|
2374
|
+
*
|
|
2375
|
+
* @param title The title of this group.
|
|
2376
|
+
* @param owningReflection The reflection containing this group, useful for changing rendering based on a comment on a reflection.
|
|
2377
|
+
*/
|
|
2378
|
+
constructor(title, owningReflection) {
|
|
2379
|
+
this.owningReflection = owningReflection;
|
|
2380
|
+
this.title = title;
|
|
2381
|
+
}
|
|
2382
|
+
toObject(serializer) {
|
|
2383
|
+
return {
|
|
2384
|
+
title: this.title,
|
|
2385
|
+
description: this.description
|
|
2386
|
+
? Comment.serializeDisplayParts(this.description)
|
|
2387
|
+
: undefined,
|
|
2388
|
+
children: this.children.length > 0
|
|
2389
|
+
? this.children.map((child) => child.id)
|
|
2390
|
+
: undefined,
|
|
2391
|
+
categories: serializer.toObjectsOptional(this.categories),
|
|
2392
|
+
};
|
|
2393
|
+
}
|
|
2394
|
+
fromObject(de, obj) {
|
|
2395
|
+
if (obj.description) {
|
|
2396
|
+
this.description = Comment.deserializeDisplayParts(de, obj.description);
|
|
2397
|
+
}
|
|
2398
|
+
if (obj.categories) {
|
|
2399
|
+
this.categories = obj.categories.map((catObj) => {
|
|
2400
|
+
const cat = new ReflectionCategory(catObj.title);
|
|
2401
|
+
de.fromObject(cat, catObj);
|
|
2402
|
+
return cat;
|
|
2403
|
+
});
|
|
2404
|
+
}
|
|
2405
|
+
if (obj.children) {
|
|
2406
|
+
de.defer((project) => {
|
|
2407
|
+
for (const childId of obj.children || []) {
|
|
2408
|
+
const child = project.getReflectionById(de.oldIdToNewId[childId] ?? -1);
|
|
2409
|
+
if (child?.isDeclaration() || child?.isDocument()) {
|
|
2410
|
+
this.children.push(child);
|
|
2411
|
+
}
|
|
2412
|
+
}
|
|
2413
|
+
});
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
}
|
|
2417
|
+
|
|
2418
|
+
/**
|
|
2419
|
+
* @category Reflections
|
|
2420
|
+
*/
|
|
2421
|
+
class ContainerReflection extends Reflection {
|
|
2422
|
+
/**
|
|
2423
|
+
* The children of this reflection. Do not add reflections to this array
|
|
2424
|
+
* manually. Instead call {@link addChild}.
|
|
2425
|
+
*/
|
|
2426
|
+
children;
|
|
2427
|
+
/**
|
|
2428
|
+
* Documents associated with this reflection.
|
|
2429
|
+
*
|
|
2430
|
+
* These are not children as including them as children requires code handle both
|
|
2431
|
+
* types, despite being mostly unrelated and handled separately.
|
|
2432
|
+
*
|
|
2433
|
+
* Including them here in a separate array neatly handles that problem, but also
|
|
2434
|
+
* introduces another one for rendering. When rendering, documents should really
|
|
2435
|
+
* actually be considered part of the "children" of a reflection. For this reason,
|
|
2436
|
+
* we also maintain a list of child declarations with child documents which is used
|
|
2437
|
+
* when rendering.
|
|
2438
|
+
*/
|
|
2439
|
+
documents;
|
|
2440
|
+
/**
|
|
2441
|
+
* Union of the {@link children} and {@link documents} arrays which dictates the
|
|
2442
|
+
* sort order for rendering.
|
|
2443
|
+
*/
|
|
2444
|
+
childrenIncludingDocuments;
|
|
2445
|
+
/**
|
|
2446
|
+
* All children grouped by their kind.
|
|
2447
|
+
*/
|
|
2448
|
+
groups;
|
|
2449
|
+
/**
|
|
2450
|
+
* All children grouped by their category.
|
|
2451
|
+
*/
|
|
2452
|
+
categories;
|
|
2453
|
+
/**
|
|
2454
|
+
* Return a list of all children of a certain kind.
|
|
2455
|
+
*
|
|
2456
|
+
* @param kind The desired kind of children.
|
|
2457
|
+
* @returns An array containing all children with the desired kind.
|
|
2458
|
+
*/
|
|
2459
|
+
getChildrenByKind(kind) {
|
|
2460
|
+
return (this.children || []).filter((child) => child.kindOf(kind));
|
|
2461
|
+
}
|
|
2462
|
+
addChild(child) {
|
|
2463
|
+
if (child.isDeclaration()) {
|
|
2464
|
+
this.children ||= [];
|
|
2465
|
+
this.children.push(child);
|
|
2466
|
+
this.childrenIncludingDocuments ||= [];
|
|
2467
|
+
this.childrenIncludingDocuments.push(child);
|
|
2468
|
+
}
|
|
2469
|
+
else if (child.isDocument()) {
|
|
2470
|
+
this.documents ||= [];
|
|
2471
|
+
this.documents.push(child);
|
|
2472
|
+
this.childrenIncludingDocuments ||= [];
|
|
2473
|
+
this.childrenIncludingDocuments.push(child);
|
|
2474
|
+
}
|
|
2475
|
+
else if (this.isDeclaration() && child.isSignature()) {
|
|
2476
|
+
switch (child.kind) {
|
|
2477
|
+
case ReflectionKind.CallSignature:
|
|
2478
|
+
case ReflectionKind.ConstructorSignature:
|
|
2479
|
+
this.signatures ||= [];
|
|
2480
|
+
this.signatures.push(child);
|
|
2481
|
+
break;
|
|
2482
|
+
case ReflectionKind.IndexSignature:
|
|
2483
|
+
this.indexSignatures ||= [];
|
|
2484
|
+
this.indexSignatures.push(child);
|
|
2485
|
+
break;
|
|
2486
|
+
case ReflectionKind.GetSignature:
|
|
2487
|
+
case ReflectionKind.SetSignature:
|
|
2488
|
+
throw new Error("Unsupported child type: " + ReflectionKind[child.kind]);
|
|
2489
|
+
default:
|
|
2490
|
+
assertNever(child.kind);
|
|
2491
|
+
}
|
|
2492
|
+
}
|
|
2493
|
+
else {
|
|
2494
|
+
throw new Error("Unsupported child type: " + ReflectionKind[child.kind]);
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
removeChild(child) {
|
|
2498
|
+
if (child.isDeclaration()) {
|
|
2499
|
+
removeIfPresent(this.children, child);
|
|
2500
|
+
if (this.children?.length === 0) {
|
|
2501
|
+
delete this.children;
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
else {
|
|
2505
|
+
removeIfPresent(this.documents, child);
|
|
2506
|
+
if (this.documents?.length === 0) {
|
|
2507
|
+
delete this.documents;
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
removeIfPresent(this.childrenIncludingDocuments, child);
|
|
2511
|
+
if (this.childrenIncludingDocuments?.length === 0) {
|
|
2512
|
+
delete this.childrenIncludingDocuments;
|
|
2513
|
+
}
|
|
2514
|
+
}
|
|
2515
|
+
isContainer() {
|
|
2516
|
+
return true;
|
|
2517
|
+
}
|
|
2518
|
+
traverse(callback) {
|
|
2519
|
+
for (const child of this.children?.slice() || []) {
|
|
2520
|
+
if (callback(child, TraverseProperty.Children) === false) {
|
|
2521
|
+
return;
|
|
2522
|
+
}
|
|
2523
|
+
}
|
|
2524
|
+
for (const child of this.documents?.slice() || []) {
|
|
2525
|
+
if (callback(child, TraverseProperty.Documents) === false) {
|
|
2526
|
+
return;
|
|
2527
|
+
}
|
|
2528
|
+
}
|
|
2529
|
+
}
|
|
2530
|
+
toObject(serializer) {
|
|
2531
|
+
return {
|
|
2532
|
+
...super.toObject(serializer),
|
|
2533
|
+
children: serializer.toObjectsOptional(this.children),
|
|
2534
|
+
documents: serializer.toObjectsOptional(this.documents),
|
|
2535
|
+
// If we only have one type of child, don't bother writing the duplicate info about
|
|
2536
|
+
// ordering with documents to the serialized file.
|
|
2537
|
+
childrenIncludingDocuments: this.children?.length && this.documents?.length
|
|
2538
|
+
? this.childrenIncludingDocuments?.map((refl) => refl.id)
|
|
2539
|
+
: undefined,
|
|
2540
|
+
groups: serializer.toObjectsOptional(this.groups),
|
|
2541
|
+
categories: serializer.toObjectsOptional(this.categories),
|
|
2542
|
+
};
|
|
2543
|
+
}
|
|
2544
|
+
fromObject(de, obj) {
|
|
2545
|
+
super.fromObject(de, obj);
|
|
2546
|
+
this.children = de.reviveMany(obj.children, (child) => de.constructReflection(child));
|
|
2547
|
+
this.documents = de.reviveMany(obj.documents, (child) => de.constructReflection(child));
|
|
2548
|
+
const byId = new Map();
|
|
2549
|
+
for (const child of this.children || []) {
|
|
2550
|
+
byId.set(child.id, child);
|
|
2551
|
+
}
|
|
2552
|
+
for (const child of this.documents || []) {
|
|
2553
|
+
byId.set(child.id, child);
|
|
2554
|
+
}
|
|
2555
|
+
for (const id of obj.childrenIncludingDocuments || []) {
|
|
2556
|
+
const child = byId.get(de.oldIdToNewId[id] ?? -1);
|
|
2557
|
+
if (child) {
|
|
2558
|
+
this.childrenIncludingDocuments ||= [];
|
|
2559
|
+
this.childrenIncludingDocuments.push(child);
|
|
2560
|
+
byId.delete(de.oldIdToNewId[id] ?? -1);
|
|
2561
|
+
}
|
|
2562
|
+
}
|
|
2563
|
+
if (byId.size) {
|
|
2564
|
+
// Anything left in byId wasn't included in the childrenIncludingDocuments array.
|
|
2565
|
+
this.childrenIncludingDocuments ||= [];
|
|
2566
|
+
this.childrenIncludingDocuments.push(...byId.values());
|
|
2567
|
+
}
|
|
2568
|
+
this.groups = de.reviveMany(obj.groups, (group) => new ReflectionGroup(group.title, this));
|
|
2569
|
+
this.categories = de.reviveMany(obj.categories, (cat) => new ReflectionCategory(cat.title));
|
|
2570
|
+
}
|
|
2571
|
+
}
|
|
2572
|
+
|
|
2573
|
+
var __esDecorate$1 = (globalThis && globalThis.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
2574
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
2575
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
2576
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
2577
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
2578
|
+
var _, done = false;
|
|
2579
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
2580
|
+
var context = {};
|
|
2581
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
2582
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
2583
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
2584
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
2585
|
+
if (kind === "accessor") {
|
|
2586
|
+
if (result === void 0) continue;
|
|
2587
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
2588
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
2589
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
2590
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
2591
|
+
}
|
|
2592
|
+
else if (_ = accept(result)) {
|
|
2593
|
+
if (kind === "field") initializers.unshift(_);
|
|
2594
|
+
else descriptor[key] = _;
|
|
2595
|
+
}
|
|
2596
|
+
}
|
|
2597
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
2598
|
+
done = true;
|
|
2599
|
+
};
|
|
2600
|
+
var __runInitializers$1 = (globalThis && globalThis.__runInitializers) || function (thisArg, initializers, value) {
|
|
2601
|
+
var useValue = arguments.length > 2;
|
|
2602
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
2603
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
2604
|
+
}
|
|
2605
|
+
return useValue ? value : void 0;
|
|
2606
|
+
};
|
|
2607
|
+
/**
|
|
2608
|
+
* Base class of all type definitions.
|
|
2609
|
+
* @category Types
|
|
2610
|
+
*/
|
|
2611
|
+
class Type {
|
|
2612
|
+
/**
|
|
2613
|
+
* Return a string representation of this type.
|
|
2614
|
+
*/
|
|
2615
|
+
toString() {
|
|
2616
|
+
return this.stringify(TypeContext.none);
|
|
2617
|
+
}
|
|
2618
|
+
visit(visitor, ...args) {
|
|
2619
|
+
return visitor[this.type]?.(this, ...args);
|
|
2620
|
+
}
|
|
2621
|
+
stringify(context) {
|
|
2622
|
+
if (this.needsParenthesis(context)) {
|
|
2623
|
+
return `(${this.getTypeString()})`;
|
|
2624
|
+
}
|
|
2625
|
+
return this.getTypeString();
|
|
2626
|
+
}
|
|
2627
|
+
// Nothing to do for the majority of types.
|
|
2628
|
+
fromObject(_de, _obj) { }
|
|
2629
|
+
/**
|
|
2630
|
+
* Return the estimated size of the type if it was all printed on one line.
|
|
2631
|
+
*/
|
|
2632
|
+
estimatePrintWidth() {
|
|
2633
|
+
return this.getTypeString().length;
|
|
2634
|
+
}
|
|
2635
|
+
}
|
|
2636
|
+
function makeRecursiveVisitor(visitor) {
|
|
2637
|
+
const recursiveVisitor = {
|
|
2638
|
+
namedTupleMember(type) {
|
|
2639
|
+
visitor.namedTupleMember?.(type);
|
|
2640
|
+
type.element.visit(recursiveVisitor);
|
|
2641
|
+
},
|
|
2642
|
+
templateLiteral(type) {
|
|
2643
|
+
visitor.templateLiteral?.(type);
|
|
2644
|
+
for (const [h] of type.tail) {
|
|
2645
|
+
h.visit(recursiveVisitor);
|
|
2646
|
+
}
|
|
2647
|
+
},
|
|
2648
|
+
array(type) {
|
|
2649
|
+
visitor.array?.(type);
|
|
2650
|
+
type.elementType.visit(recursiveVisitor);
|
|
2651
|
+
},
|
|
2652
|
+
conditional(type) {
|
|
2653
|
+
visitor.conditional?.(type);
|
|
2654
|
+
type.checkType.visit(recursiveVisitor);
|
|
2655
|
+
type.extendsType.visit(recursiveVisitor);
|
|
2656
|
+
type.trueType.visit(recursiveVisitor);
|
|
2657
|
+
type.falseType.visit(recursiveVisitor);
|
|
2658
|
+
},
|
|
2659
|
+
indexedAccess(type) {
|
|
2660
|
+
visitor.indexedAccess?.(type);
|
|
2661
|
+
type.indexType.visit(recursiveVisitor);
|
|
2662
|
+
type.objectType.visit(recursiveVisitor);
|
|
2663
|
+
},
|
|
2664
|
+
inferred(type) {
|
|
2665
|
+
visitor.inferred?.(type);
|
|
2666
|
+
type.constraint?.visit(recursiveVisitor);
|
|
2667
|
+
},
|
|
2668
|
+
intersection(type) {
|
|
2669
|
+
visitor.intersection?.(type);
|
|
2670
|
+
type.types.forEach((t) => t.visit(recursiveVisitor));
|
|
2671
|
+
},
|
|
2672
|
+
intrinsic(type) {
|
|
2673
|
+
visitor.intrinsic?.(type);
|
|
2674
|
+
},
|
|
2675
|
+
literal(type) {
|
|
2676
|
+
visitor.literal?.(type);
|
|
2677
|
+
},
|
|
2678
|
+
mapped(type) {
|
|
2679
|
+
visitor.mapped?.(type);
|
|
2680
|
+
type.nameType?.visit(recursiveVisitor);
|
|
2681
|
+
type.parameterType.visit(recursiveVisitor);
|
|
2682
|
+
type.templateType.visit(recursiveVisitor);
|
|
2683
|
+
},
|
|
2684
|
+
optional(type) {
|
|
2685
|
+
visitor.optional?.(type);
|
|
2686
|
+
type.elementType.visit(recursiveVisitor);
|
|
2687
|
+
},
|
|
2688
|
+
predicate(type) {
|
|
2689
|
+
visitor.predicate?.(type);
|
|
2690
|
+
type.targetType?.visit(recursiveVisitor);
|
|
2691
|
+
},
|
|
2692
|
+
query(type) {
|
|
2693
|
+
visitor.query?.(type);
|
|
2694
|
+
type.queryType.visit(recursiveVisitor);
|
|
2695
|
+
},
|
|
2696
|
+
reference(type) {
|
|
2697
|
+
visitor.reference?.(type);
|
|
2698
|
+
type.typeArguments?.forEach((t) => t.visit(recursiveVisitor));
|
|
2699
|
+
},
|
|
2700
|
+
reflection(type) {
|
|
2701
|
+
visitor.reflection?.(type);
|
|
2702
|
+
// Future: This should maybe recurse too?
|
|
2703
|
+
// See the validator in exports.ts for how to do it.
|
|
2704
|
+
},
|
|
2705
|
+
rest(type) {
|
|
2706
|
+
visitor.rest?.(type);
|
|
2707
|
+
type.elementType.visit(recursiveVisitor);
|
|
2708
|
+
},
|
|
2709
|
+
tuple(type) {
|
|
2710
|
+
visitor.tuple?.(type);
|
|
2711
|
+
type.elements.forEach((t) => t.visit(recursiveVisitor));
|
|
2712
|
+
},
|
|
2713
|
+
typeOperator(type) {
|
|
2714
|
+
visitor.typeOperator?.(type);
|
|
2715
|
+
type.target.visit(recursiveVisitor);
|
|
2716
|
+
},
|
|
2717
|
+
union(type) {
|
|
2718
|
+
visitor.union?.(type);
|
|
2719
|
+
type.types.forEach((t) => t.visit(recursiveVisitor));
|
|
2720
|
+
},
|
|
2721
|
+
unknown(type) {
|
|
2722
|
+
visitor.unknown?.(type);
|
|
2723
|
+
},
|
|
2724
|
+
};
|
|
2725
|
+
return recursiveVisitor;
|
|
2726
|
+
}
|
|
2727
|
+
/**
|
|
2728
|
+
* Enumeration that can be used when traversing types to track the location of recursion.
|
|
2729
|
+
* Used by TypeDoc internally to track when to output parenthesis when rendering.
|
|
2730
|
+
* @enum
|
|
2731
|
+
*/
|
|
2732
|
+
const TypeContext = {
|
|
2733
|
+
none: "none",
|
|
2734
|
+
arrayElement: "arrayElement", // here[]
|
|
2735
|
+
referenceTypeArgument: "referenceTypeArgument", // X<here>
|
|
2736
|
+
unionElement: "unionElement", // here | 1
|
|
2737
|
+
};
|
|
2738
|
+
/**
|
|
2739
|
+
* Represents an intrinsic type like `string` or `boolean`.
|
|
2740
|
+
*
|
|
2741
|
+
* ```ts
|
|
2742
|
+
* let value: number;
|
|
2743
|
+
* ```
|
|
2744
|
+
* @category Types
|
|
2745
|
+
*/
|
|
2746
|
+
class IntrinsicType extends Type {
|
|
2747
|
+
name;
|
|
2748
|
+
type = "intrinsic";
|
|
2749
|
+
constructor(name) {
|
|
2750
|
+
super();
|
|
2751
|
+
this.name = name;
|
|
2752
|
+
}
|
|
2753
|
+
getTypeString() {
|
|
2754
|
+
return this.name;
|
|
2755
|
+
}
|
|
2756
|
+
toObject() {
|
|
2757
|
+
return {
|
|
2758
|
+
type: this.type,
|
|
2759
|
+
name: this.name,
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2762
|
+
needsParenthesis() {
|
|
2763
|
+
return false;
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
/**
|
|
2767
|
+
* Represents a type that refers to another reflection like a class, interface or enum.
|
|
2768
|
+
*
|
|
2769
|
+
* ```ts
|
|
2770
|
+
* let value: MyClass<T>;
|
|
2771
|
+
* ```
|
|
2772
|
+
* @category Types
|
|
2773
|
+
*/
|
|
2774
|
+
(() => {
|
|
2775
|
+
let _classSuper = Type;
|
|
2776
|
+
let __project_decorators;
|
|
2777
|
+
let __project_initializers = [];
|
|
2778
|
+
let __project_extraInitializers = [];
|
|
2779
|
+
return class ReferenceType extends _classSuper {
|
|
2780
|
+
static {
|
|
2781
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
2782
|
+
__project_decorators = [NonEnumerable];
|
|
2783
|
+
__esDecorate$1(null, null, __project_decorators, { kind: "field", name: "_project", static: false, private: false, access: { has: obj => "_project" in obj, get: obj => obj._project, set: (obj, value) => { obj._project = value; } }, metadata: _metadata }, __project_initializers, __project_extraInitializers);
|
|
2784
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
2785
|
+
}
|
|
2786
|
+
type = "reference";
|
|
2787
|
+
/**
|
|
2788
|
+
* The name of the referenced type.
|
|
2789
|
+
*
|
|
2790
|
+
* If the symbol cannot be found because it's not part of the documentation this
|
|
2791
|
+
* can be used to represent the type.
|
|
2792
|
+
*/
|
|
2793
|
+
name;
|
|
2794
|
+
/**
|
|
2795
|
+
* The type arguments of this reference.
|
|
2796
|
+
*/
|
|
2797
|
+
typeArguments;
|
|
2798
|
+
/**
|
|
2799
|
+
* The resolved reflection.
|
|
2800
|
+
*/
|
|
2801
|
+
get reflection() {
|
|
2802
|
+
if (typeof this._target === "number") {
|
|
2803
|
+
return this._project?.getReflectionById(this._target);
|
|
2804
|
+
}
|
|
2805
|
+
const resolvePotential = this._project?.getReflectionsFromSymbolId(this._target);
|
|
2806
|
+
if (!resolvePotential?.length) {
|
|
2807
|
+
return;
|
|
2808
|
+
}
|
|
2809
|
+
const kind = this.preferValues
|
|
2810
|
+
? ReflectionKind.ValueReferenceTarget
|
|
2811
|
+
: ReflectionKind.TypeReferenceTarget;
|
|
2812
|
+
const resolved = resolvePotential.find((refl) => refl.kindOf(kind)) ||
|
|
2813
|
+
resolvePotential.find((refl) => refl.kindOf(~kind));
|
|
2814
|
+
// Do not mark the type as resolved at this point so that if it
|
|
2815
|
+
// points to a member which is removed (e.g. by typedoc-plugin-zod)
|
|
2816
|
+
// and then replaced it still ends up pointing at the right reflection.
|
|
2817
|
+
// We will lock type reference resolution when serializing to JSON.
|
|
2818
|
+
// this._target = resolved.id;
|
|
2819
|
+
return resolved;
|
|
2820
|
+
}
|
|
2821
|
+
/**
|
|
2822
|
+
* Sometimes a few properties are more important than the rest
|
|
2823
|
+
* of the properties within a type. This occurs most often with
|
|
2824
|
+
* object parameters, where users want to specify `@param foo.bar`
|
|
2825
|
+
* to highlight something about the `bar` property.
|
|
2826
|
+
*
|
|
2827
|
+
* Does NOT support nested properties.
|
|
2828
|
+
*/
|
|
2829
|
+
highlightedProperties;
|
|
2830
|
+
/**
|
|
2831
|
+
* If not resolved, the symbol id of the reflection, otherwise undefined.
|
|
2832
|
+
*/
|
|
2833
|
+
get symbolId() {
|
|
2834
|
+
if (!this.reflection && typeof this._target === "object") {
|
|
2835
|
+
return this._target;
|
|
2836
|
+
}
|
|
2837
|
+
}
|
|
2838
|
+
/**
|
|
2839
|
+
* Checks if this type is a reference type because it uses a name, but is intentionally not pointing
|
|
2840
|
+
* to a reflection. This happens for type parameters and when representing a mapped type.
|
|
2841
|
+
*/
|
|
2842
|
+
isIntentionallyBroken() {
|
|
2843
|
+
if (typeof this._target === "object" &&
|
|
2844
|
+
this._project?.symbolIdHasBeenRemoved(this._target)) {
|
|
2845
|
+
return true;
|
|
2846
|
+
}
|
|
2847
|
+
return this._target === -1 || this.refersToTypeParameter;
|
|
2848
|
+
}
|
|
2849
|
+
/**
|
|
2850
|
+
* Convert this reference type to a declaration reference used for resolution of external types.
|
|
2851
|
+
*/
|
|
2852
|
+
toDeclarationReference() {
|
|
2853
|
+
return {
|
|
2854
|
+
resolutionStart: "global",
|
|
2855
|
+
moduleSource: this.package,
|
|
2856
|
+
symbolReference: {
|
|
2857
|
+
path: this.qualifiedName
|
|
2858
|
+
.split(".")
|
|
2859
|
+
.map((p) => ({ path: p, navigation: "." })),
|
|
2860
|
+
},
|
|
2861
|
+
};
|
|
2862
|
+
}
|
|
2863
|
+
/**
|
|
2864
|
+
* The fully qualified name of the referenced type, relative to the file it is defined in.
|
|
2865
|
+
* This will usually be the same as `name`, unless namespaces are used.
|
|
2866
|
+
*/
|
|
2867
|
+
qualifiedName;
|
|
2868
|
+
/**
|
|
2869
|
+
* The package that this type is referencing.
|
|
2870
|
+
*/
|
|
2871
|
+
package;
|
|
2872
|
+
/**
|
|
2873
|
+
* If this reference type refers to a reflection defined by a project not being rendered,
|
|
2874
|
+
* points to the url that this type should be linked to.
|
|
2875
|
+
*/
|
|
2876
|
+
externalUrl;
|
|
2877
|
+
/**
|
|
2878
|
+
* If set, no warnings about something not being exported should be created
|
|
2879
|
+
* since this may be referring to a type created with `infer X` which will not
|
|
2880
|
+
* be registered on the project.
|
|
2881
|
+
*/
|
|
2882
|
+
refersToTypeParameter = false;
|
|
2883
|
+
/**
|
|
2884
|
+
* If set, will prefer reflections with {@link ReflectionKind | ReflectionKinds} which represent
|
|
2885
|
+
* values rather than those which represent types.
|
|
2886
|
+
*/
|
|
2887
|
+
preferValues = false;
|
|
2888
|
+
_target;
|
|
2889
|
+
_project = __runInitializers$1(this, __project_initializers, void 0);
|
|
2890
|
+
constructor(name, target, project, qualifiedName) {
|
|
2891
|
+
super();
|
|
2892
|
+
__runInitializers$1(this, __project_extraInitializers);
|
|
2893
|
+
this.name = name;
|
|
2894
|
+
if (typeof target === "number") {
|
|
2895
|
+
this._target = target;
|
|
2896
|
+
}
|
|
2897
|
+
else {
|
|
2898
|
+
this._target = "variant" in target ? target.id : target;
|
|
2899
|
+
}
|
|
2900
|
+
this._project = project;
|
|
2901
|
+
this.qualifiedName = qualifiedName;
|
|
2902
|
+
}
|
|
2903
|
+
static createUnresolvedReference(name, target, project, qualifiedName) {
|
|
2904
|
+
return new ReferenceType(name, target, project, qualifiedName);
|
|
2905
|
+
}
|
|
2906
|
+
static createResolvedReference(name, target, project) {
|
|
2907
|
+
return new ReferenceType(name, target, project, name);
|
|
2908
|
+
}
|
|
2909
|
+
/**
|
|
2910
|
+
* This is used for type parameters, which don't actually point to something,
|
|
2911
|
+
* and also for temporary references which will be cleaned up with real references
|
|
2912
|
+
* later during conversion.
|
|
2913
|
+
* @internal
|
|
2914
|
+
*/
|
|
2915
|
+
static createBrokenReference(name, project, packageName) {
|
|
2916
|
+
const ref = new ReferenceType(name, -1, project, name);
|
|
2917
|
+
ref.package = packageName;
|
|
2918
|
+
return ref;
|
|
2919
|
+
}
|
|
2920
|
+
getTypeString() {
|
|
2921
|
+
const name = this.reflection ? this.reflection.name : this.name;
|
|
2922
|
+
let typeArgs = "";
|
|
2923
|
+
if (this.typeArguments && this.typeArguments.length > 0) {
|
|
2924
|
+
typeArgs += "<";
|
|
2925
|
+
typeArgs += this.typeArguments
|
|
2926
|
+
.map((arg) => arg.stringify(TypeContext.referenceTypeArgument))
|
|
2927
|
+
.join(", ");
|
|
2928
|
+
typeArgs += ">";
|
|
2929
|
+
}
|
|
2930
|
+
return name + typeArgs;
|
|
2931
|
+
}
|
|
2932
|
+
needsParenthesis() {
|
|
2933
|
+
return false;
|
|
2934
|
+
}
|
|
2935
|
+
toObject(serializer) {
|
|
2936
|
+
let target;
|
|
2937
|
+
if (typeof this._target === "number") {
|
|
2938
|
+
target = this._target;
|
|
2939
|
+
}
|
|
2940
|
+
else if (this._project?.symbolIdHasBeenRemoved(this._target)) {
|
|
2941
|
+
target = -1;
|
|
2942
|
+
}
|
|
2943
|
+
else if (this.reflection) {
|
|
2944
|
+
target = this.reflection.id;
|
|
2945
|
+
}
|
|
2946
|
+
else {
|
|
2947
|
+
target = this._target.toObject();
|
|
2948
|
+
}
|
|
2949
|
+
const result = {
|
|
2950
|
+
type: this.type,
|
|
2951
|
+
target,
|
|
2952
|
+
typeArguments: serializer.toObjectsOptional(this.typeArguments),
|
|
2953
|
+
name: this.name,
|
|
2954
|
+
package: this.package,
|
|
2955
|
+
externalUrl: this.externalUrl,
|
|
2956
|
+
};
|
|
2957
|
+
if (this.name !== this.qualifiedName) {
|
|
2958
|
+
result.qualifiedName = this.qualifiedName;
|
|
2959
|
+
}
|
|
2960
|
+
if (this.refersToTypeParameter) {
|
|
2961
|
+
result.refersToTypeParameter = true;
|
|
2962
|
+
}
|
|
2963
|
+
if (typeof target !== "number" && this.preferValues) {
|
|
2964
|
+
result.preferValues = true;
|
|
2965
|
+
}
|
|
2966
|
+
if (this.highlightedProperties) {
|
|
2967
|
+
result.highlightedProperties = Object.fromEntries(Array.from(this.highlightedProperties.entries(), ([key, parts]) => {
|
|
2968
|
+
return [
|
|
2969
|
+
key,
|
|
2970
|
+
Comment.serializeDisplayParts(parts),
|
|
2971
|
+
];
|
|
2972
|
+
}));
|
|
2973
|
+
}
|
|
2974
|
+
return result;
|
|
2975
|
+
}
|
|
2976
|
+
fromObject(de, obj) {
|
|
2977
|
+
this.typeArguments = de.reviveMany(obj.typeArguments, (t) => de.constructType(t));
|
|
2978
|
+
if (typeof obj.target === "number") {
|
|
2979
|
+
if (obj.target === -1) {
|
|
2980
|
+
this._target = -1;
|
|
2981
|
+
}
|
|
2982
|
+
else {
|
|
2983
|
+
de.defer((project) => {
|
|
2984
|
+
const target = project.getReflectionById(de.oldIdToNewId[obj.target] ?? -1);
|
|
2985
|
+
if (target) {
|
|
2986
|
+
this._project = project;
|
|
2987
|
+
this._target = target.id;
|
|
2988
|
+
}
|
|
2989
|
+
else {
|
|
2990
|
+
de.logger.warn(i18n.serialized_project_referenced_0_not_part_of_project(JSON.stringify(obj.target)));
|
|
2991
|
+
}
|
|
2992
|
+
});
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2995
|
+
else {
|
|
2996
|
+
this._project = de.project;
|
|
2997
|
+
this._target = new ReflectionSymbolId(obj.target);
|
|
2998
|
+
}
|
|
2999
|
+
this.qualifiedName = obj.qualifiedName ?? obj.name;
|
|
3000
|
+
this.package = obj.package;
|
|
3001
|
+
this.refersToTypeParameter = !!obj.refersToTypeParameter;
|
|
3002
|
+
this.preferValues = !!obj.preferValues;
|
|
3003
|
+
if (obj.highlightedProperties) {
|
|
3004
|
+
this.highlightedProperties = new Map();
|
|
3005
|
+
for (const [key, parts] of Object.entries(obj.highlightedProperties)) {
|
|
3006
|
+
this.highlightedProperties.set(key, Comment.deserializeDisplayParts(de, parts));
|
|
3007
|
+
}
|
|
3008
|
+
}
|
|
3009
|
+
}
|
|
3010
|
+
};
|
|
3011
|
+
})();
|
|
3012
|
+
/**
|
|
3013
|
+
* Represents a type which has it's own reflection like literal types.
|
|
3014
|
+
* This type will likely go away at some point and be replaced by a dedicated
|
|
3015
|
+
* `ObjectType`. Allowing reflections to be nested within types causes much
|
|
3016
|
+
* pain in the rendering code.
|
|
3017
|
+
*
|
|
3018
|
+
* ```ts
|
|
3019
|
+
* let value: { a: string, b: number };
|
|
3020
|
+
* ```
|
|
3021
|
+
* @category Types
|
|
3022
|
+
*/
|
|
3023
|
+
class ReflectionType extends Type {
|
|
3024
|
+
declaration;
|
|
3025
|
+
type = "reflection";
|
|
3026
|
+
constructor(declaration) {
|
|
3027
|
+
super();
|
|
3028
|
+
this.declaration = declaration;
|
|
3029
|
+
}
|
|
3030
|
+
getTypeString() {
|
|
3031
|
+
const parts = [];
|
|
3032
|
+
const sigs = this.declaration.getNonIndexSignatures();
|
|
3033
|
+
for (const sig of sigs) {
|
|
3034
|
+
parts.push(sigStr(sig, ": "));
|
|
3035
|
+
}
|
|
3036
|
+
for (const p of this.declaration.children || []) {
|
|
3037
|
+
parts.push(`${p.name}${propertySep(p)} ${typeStr(p.type)}`);
|
|
3038
|
+
}
|
|
3039
|
+
for (const s of this.declaration.indexSignatures || []) {
|
|
3040
|
+
parts.push(sigStr(s, ": ", "[]"));
|
|
3041
|
+
}
|
|
3042
|
+
if (sigs.length === 1 && parts.length === 1) {
|
|
3043
|
+
return sigStr(sigs[0], " => ");
|
|
3044
|
+
}
|
|
3045
|
+
if (parts.length === 0) {
|
|
3046
|
+
return "{}";
|
|
3047
|
+
}
|
|
3048
|
+
return `{ ${parts.join("; ")} }`;
|
|
3049
|
+
}
|
|
3050
|
+
needsParenthesis(where) {
|
|
3051
|
+
if (this.declaration.children || this.declaration.indexSignatures) {
|
|
3052
|
+
return false;
|
|
3053
|
+
}
|
|
3054
|
+
if (this.declaration.signatures?.length === 1) {
|
|
3055
|
+
return where === TypeContext.arrayElement || where === TypeContext.unionElement;
|
|
3056
|
+
}
|
|
3057
|
+
return false;
|
|
3058
|
+
}
|
|
3059
|
+
toObject(serializer) {
|
|
3060
|
+
return {
|
|
3061
|
+
type: this.type,
|
|
3062
|
+
declaration: serializer.toObject(this.declaration),
|
|
3063
|
+
};
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
function propertySep(refl) {
|
|
3067
|
+
return refl.flags.isOptional ? "?:" : ":";
|
|
3068
|
+
}
|
|
3069
|
+
function typeStr(type) {
|
|
3070
|
+
return type?.toString() ?? "any";
|
|
3071
|
+
}
|
|
3072
|
+
function sigStr(sig, sep, brackets = "()") {
|
|
3073
|
+
const params = joinArray(sig.parameters, ", ", (p) => `${p.name}${propertySep(p)} ${typeStr(p.type)}`);
|
|
3074
|
+
return `${brackets[0]}${params}${brackets[1]}${sep}${typeStr(sig.type)}`;
|
|
3075
|
+
}
|
|
3076
|
+
|
|
3077
|
+
/**
|
|
3078
|
+
* Represents references of reflections to their defining source files.
|
|
3079
|
+
*
|
|
3080
|
+
* @see {@link DeclarationReflection.sources}
|
|
3081
|
+
*/
|
|
3082
|
+
class SourceReference {
|
|
3083
|
+
/**
|
|
3084
|
+
* The filename of the source file.
|
|
3085
|
+
*/
|
|
3086
|
+
fileName;
|
|
3087
|
+
/**
|
|
3088
|
+
* The absolute filename of the source file.
|
|
3089
|
+
* @internal
|
|
3090
|
+
*/
|
|
3091
|
+
fullFileName;
|
|
3092
|
+
/**
|
|
3093
|
+
* The one based number of the line that emitted the declaration.
|
|
3094
|
+
*/
|
|
3095
|
+
line;
|
|
3096
|
+
/**
|
|
3097
|
+
* The index of the character that emitted the declaration.
|
|
3098
|
+
*/
|
|
3099
|
+
character;
|
|
3100
|
+
/**
|
|
3101
|
+
* URL for displaying the source file.
|
|
3102
|
+
*/
|
|
3103
|
+
url;
|
|
3104
|
+
constructor(fileName, line, character) {
|
|
3105
|
+
this.fileName = fileName;
|
|
3106
|
+
this.fullFileName = fileName;
|
|
3107
|
+
this.line = line;
|
|
3108
|
+
this.character = character;
|
|
3109
|
+
}
|
|
3110
|
+
equals(other) {
|
|
3111
|
+
return (this.fullFileName == other.fullFileName &&
|
|
3112
|
+
this.line === other.line &&
|
|
3113
|
+
this.character === other.character);
|
|
3114
|
+
}
|
|
3115
|
+
toObject() {
|
|
3116
|
+
return {
|
|
3117
|
+
fileName: this.fileName,
|
|
3118
|
+
line: this.line,
|
|
3119
|
+
character: this.character,
|
|
3120
|
+
url: this.url,
|
|
3121
|
+
};
|
|
3122
|
+
}
|
|
3123
|
+
fromObject(_de, obj) {
|
|
3124
|
+
this.url = obj.url;
|
|
3125
|
+
}
|
|
3126
|
+
}
|
|
3127
|
+
|
|
3128
|
+
/**
|
|
3129
|
+
* A reflection that represents a single declaration emitted by the TypeScript compiler.
|
|
3130
|
+
*
|
|
3131
|
+
* All parts of a project are represented by DeclarationReflection instances. The actual
|
|
3132
|
+
* kind of a reflection is stored in its `kind` member.
|
|
3133
|
+
* @category Reflections
|
|
3134
|
+
*/
|
|
3135
|
+
class DeclarationReflection extends ContainerReflection {
|
|
3136
|
+
variant = "declaration";
|
|
3137
|
+
/**
|
|
3138
|
+
* A list of all source files that contributed to this reflection.
|
|
3139
|
+
*/
|
|
3140
|
+
sources;
|
|
3141
|
+
/**
|
|
3142
|
+
* Precomputed boost for search results, may be less than 1 to de-emphasize this member in search results.
|
|
3143
|
+
* Does NOT include group/category values as they are computed when building the JS index.
|
|
3144
|
+
*
|
|
3145
|
+
* This is exposed purely for plugin use, see #3036 for details.
|
|
3146
|
+
*/
|
|
3147
|
+
relevanceBoost;
|
|
3148
|
+
/**
|
|
3149
|
+
* The escaped name of this declaration assigned by the TS compiler if there is an associated symbol.
|
|
3150
|
+
* This is used to retrieve properties for analyzing inherited members.
|
|
3151
|
+
*
|
|
3152
|
+
* Not serialized, only useful during conversion. This is a `ts.__String`.
|
|
3153
|
+
* @internal
|
|
3154
|
+
*/
|
|
3155
|
+
escapedName;
|
|
3156
|
+
/**
|
|
3157
|
+
* The type of the reflection.
|
|
3158
|
+
*
|
|
3159
|
+
* If the reflection represents a variable or a property, this is the value type.<br />
|
|
3160
|
+
* If the reflection represents a signature, this is the return type.
|
|
3161
|
+
*/
|
|
3162
|
+
type;
|
|
3163
|
+
typeParameters;
|
|
3164
|
+
/**
|
|
3165
|
+
* A list of call signatures attached to this declaration.
|
|
3166
|
+
*
|
|
3167
|
+
* TypeDoc creates one declaration per function that may contain one or more
|
|
3168
|
+
* signature reflections.
|
|
3169
|
+
*/
|
|
3170
|
+
signatures;
|
|
3171
|
+
/**
|
|
3172
|
+
* The index signature of this declaration.
|
|
3173
|
+
*/
|
|
3174
|
+
indexSignatures;
|
|
3175
|
+
/**
|
|
3176
|
+
* The get signature of this declaration.
|
|
3177
|
+
*/
|
|
3178
|
+
getSignature;
|
|
3179
|
+
/**
|
|
3180
|
+
* The set signature of this declaration.
|
|
3181
|
+
*/
|
|
3182
|
+
setSignature;
|
|
3183
|
+
/**
|
|
3184
|
+
* The default value of this reflection.
|
|
3185
|
+
*
|
|
3186
|
+
* Applies to function parameters, variables, and properties.
|
|
3187
|
+
*/
|
|
3188
|
+
defaultValue;
|
|
3189
|
+
/**
|
|
3190
|
+
* A type that points to the reflection that has been overwritten by this reflection.
|
|
3191
|
+
*
|
|
3192
|
+
* Applies to interface and class members.
|
|
3193
|
+
*/
|
|
3194
|
+
overwrites;
|
|
3195
|
+
/**
|
|
3196
|
+
* A type that points to the reflection this reflection has been inherited from.
|
|
3197
|
+
*
|
|
3198
|
+
* Applies to interface and class members.
|
|
3199
|
+
*/
|
|
3200
|
+
inheritedFrom;
|
|
3201
|
+
/**
|
|
3202
|
+
* A type that points to the reflection this reflection is the implementation of.
|
|
3203
|
+
*
|
|
3204
|
+
* Applies to class members.
|
|
3205
|
+
*/
|
|
3206
|
+
implementationOf;
|
|
3207
|
+
/**
|
|
3208
|
+
* A list of all types this reflection extends (e.g. the parent classes).
|
|
3209
|
+
*/
|
|
3210
|
+
extendedTypes;
|
|
3211
|
+
/**
|
|
3212
|
+
* A list of all types that extend this reflection (e.g. the subclasses).
|
|
3213
|
+
*/
|
|
3214
|
+
extendedBy;
|
|
3215
|
+
/**
|
|
3216
|
+
* A list of all types this reflection implements.
|
|
3217
|
+
*/
|
|
3218
|
+
implementedTypes;
|
|
3219
|
+
/**
|
|
3220
|
+
* A list of all types that implement this reflection.
|
|
3221
|
+
*/
|
|
3222
|
+
implementedBy;
|
|
3223
|
+
/**
|
|
3224
|
+
* Contains a simplified representation of the type hierarchy suitable for being
|
|
3225
|
+
* rendered in templates.
|
|
3226
|
+
*/
|
|
3227
|
+
typeHierarchy;
|
|
3228
|
+
/**
|
|
3229
|
+
* The contents of the readme file of the module when found.
|
|
3230
|
+
*/
|
|
3231
|
+
readme;
|
|
3232
|
+
/**
|
|
3233
|
+
* The version of the module when found.
|
|
3234
|
+
*/
|
|
3235
|
+
packageVersion;
|
|
3236
|
+
isDeclaration() {
|
|
3237
|
+
return true;
|
|
3238
|
+
}
|
|
3239
|
+
hasGetterOrSetter() {
|
|
3240
|
+
return !!this.getSignature || !!this.setSignature;
|
|
3241
|
+
}
|
|
3242
|
+
getAllSignatures() {
|
|
3243
|
+
let result = [];
|
|
3244
|
+
if (this.signatures) {
|
|
3245
|
+
result = result.concat(this.signatures);
|
|
3246
|
+
}
|
|
3247
|
+
if (this.indexSignatures) {
|
|
3248
|
+
result = result.concat(this.indexSignatures);
|
|
3249
|
+
}
|
|
3250
|
+
if (this.getSignature) {
|
|
3251
|
+
result.push(this.getSignature);
|
|
3252
|
+
}
|
|
3253
|
+
if (this.setSignature) {
|
|
3254
|
+
result.push(this.setSignature);
|
|
3255
|
+
}
|
|
3256
|
+
return result;
|
|
3257
|
+
}
|
|
3258
|
+
getNonIndexSignatures() {
|
|
3259
|
+
return [].concat(this.signatures ?? [], this.setSignature ?? [], this.getSignature ?? []);
|
|
3260
|
+
}
|
|
3261
|
+
getProperties() {
|
|
3262
|
+
if (this.children?.length) {
|
|
3263
|
+
return this.children;
|
|
3264
|
+
}
|
|
3265
|
+
if (this.type?.type === "reflection") {
|
|
3266
|
+
return this.type.declaration.children ?? [];
|
|
3267
|
+
}
|
|
3268
|
+
return [];
|
|
3269
|
+
}
|
|
3270
|
+
getChildOrTypePropertyByName(path) {
|
|
3271
|
+
if (this.type?.type === "reflection") {
|
|
3272
|
+
for (const child of this.type.declaration.children || []) {
|
|
3273
|
+
if (path[0] === child.name) {
|
|
3274
|
+
if (path.length === 1) {
|
|
3275
|
+
return child;
|
|
3276
|
+
}
|
|
3277
|
+
return child.getChildOrTypePropertyByName(path.slice(1));
|
|
3278
|
+
}
|
|
3279
|
+
}
|
|
3280
|
+
}
|
|
3281
|
+
for (const child of this.children || []) {
|
|
3282
|
+
if (path[0] === child.name) {
|
|
3283
|
+
if (path.length === 1) {
|
|
3284
|
+
return child;
|
|
3285
|
+
}
|
|
3286
|
+
return child.getChildOrTypePropertyByName(path.slice(1));
|
|
3287
|
+
}
|
|
3288
|
+
}
|
|
3289
|
+
return undefined;
|
|
3290
|
+
}
|
|
3291
|
+
traverse(callback) {
|
|
3292
|
+
for (const parameter of this.typeParameters?.slice() || []) {
|
|
3293
|
+
if (callback(parameter, TraverseProperty.TypeParameter) === false) {
|
|
3294
|
+
return;
|
|
3295
|
+
}
|
|
3296
|
+
}
|
|
3297
|
+
if (this.type instanceof ReflectionType) {
|
|
3298
|
+
if (callback(this.type.declaration, TraverseProperty.TypeLiteral) === false) {
|
|
3299
|
+
return;
|
|
3300
|
+
}
|
|
3301
|
+
}
|
|
3302
|
+
for (const signature of this.signatures?.slice() || []) {
|
|
3303
|
+
if (callback(signature, TraverseProperty.Signatures) === false) {
|
|
3304
|
+
return;
|
|
3305
|
+
}
|
|
3306
|
+
}
|
|
3307
|
+
for (const signature of this.indexSignatures?.slice() || []) {
|
|
3308
|
+
if (callback(signature, TraverseProperty.IndexSignature) === false) {
|
|
3309
|
+
return;
|
|
3310
|
+
}
|
|
3311
|
+
}
|
|
3312
|
+
if (this.getSignature) {
|
|
3313
|
+
if (callback(this.getSignature, TraverseProperty.GetSignature) ===
|
|
3314
|
+
false) {
|
|
3315
|
+
return;
|
|
3316
|
+
}
|
|
3317
|
+
}
|
|
3318
|
+
if (this.setSignature) {
|
|
3319
|
+
if (callback(this.setSignature, TraverseProperty.SetSignature) ===
|
|
3320
|
+
false) {
|
|
3321
|
+
return;
|
|
3322
|
+
}
|
|
3323
|
+
}
|
|
3324
|
+
super.traverse(callback);
|
|
3325
|
+
}
|
|
3326
|
+
/**
|
|
3327
|
+
* Return a string representation of this reflection.
|
|
3328
|
+
*/
|
|
3329
|
+
toString() {
|
|
3330
|
+
let result = super.toString();
|
|
3331
|
+
if (this.typeParameters) {
|
|
3332
|
+
const parameters = this.typeParameters.map((parameter) => parameter.name);
|
|
3333
|
+
result += "<" + parameters.join(", ") + ">";
|
|
3334
|
+
}
|
|
3335
|
+
if (this.type) {
|
|
3336
|
+
result += ": " + this.type.toString();
|
|
3337
|
+
}
|
|
3338
|
+
return result;
|
|
3339
|
+
}
|
|
3340
|
+
toObject(serializer) {
|
|
3341
|
+
return {
|
|
3342
|
+
...super.toObject(serializer),
|
|
3343
|
+
variant: this.variant,
|
|
3344
|
+
packageVersion: this.packageVersion,
|
|
3345
|
+
sources: serializer.toObjectsOptional(this.sources),
|
|
3346
|
+
relevanceBoost: this.relevanceBoost === 1 ? undefined : this.relevanceBoost,
|
|
3347
|
+
typeParameters: serializer.toObjectsOptional(this.typeParameters),
|
|
3348
|
+
type: serializer.toObject(this.type),
|
|
3349
|
+
signatures: serializer.toObjectsOptional(this.signatures),
|
|
3350
|
+
indexSignatures: serializer.toObjectsOptional(this.indexSignatures),
|
|
3351
|
+
getSignature: serializer.toObject(this.getSignature),
|
|
3352
|
+
setSignature: serializer.toObject(this.setSignature),
|
|
3353
|
+
defaultValue: this.defaultValue,
|
|
3354
|
+
overwrites: serializer.toObject(this.overwrites),
|
|
3355
|
+
inheritedFrom: serializer.toObject(this.inheritedFrom),
|
|
3356
|
+
implementationOf: serializer.toObject(this.implementationOf),
|
|
3357
|
+
extendedTypes: serializer.toObjectsOptional(this.extendedTypes),
|
|
3358
|
+
extendedBy: serializer.toObjectsOptional(this.extendedBy),
|
|
3359
|
+
implementedTypes: serializer.toObjectsOptional(this.implementedTypes),
|
|
3360
|
+
implementedBy: serializer.toObjectsOptional(this.implementedBy),
|
|
3361
|
+
readme: Comment.serializeDisplayParts(this.readme),
|
|
3362
|
+
};
|
|
3363
|
+
}
|
|
3364
|
+
fromObject(de, obj) {
|
|
3365
|
+
super.fromObject(de, obj);
|
|
3366
|
+
if (obj.readme) {
|
|
3367
|
+
this.readme = Comment.deserializeDisplayParts(de, obj.readme);
|
|
3368
|
+
}
|
|
3369
|
+
// This happens when merging multiple projects together.
|
|
3370
|
+
// If updating this, also check ProjectReflection.fromObject.
|
|
3371
|
+
if (obj.variant === "project") {
|
|
3372
|
+
this.kind = ReflectionKind.Module;
|
|
3373
|
+
this.packageVersion = obj.packageVersion;
|
|
3374
|
+
this.project.files.fromObject(de, obj.files || {});
|
|
3375
|
+
de.defer(() => {
|
|
3376
|
+
for (const [id, sid] of Object.entries(obj.symbolIdMap || {})) {
|
|
3377
|
+
const refl = this.project.getReflectionById(de.oldIdToNewId[+id] ?? -1);
|
|
3378
|
+
if (refl) {
|
|
3379
|
+
this.project.registerSymbolId(refl, new ReflectionSymbolId(sid));
|
|
3380
|
+
}
|
|
3381
|
+
else {
|
|
3382
|
+
de.logger.warn(i18n.serialized_project_referenced_0_not_part_of_project(id));
|
|
3383
|
+
}
|
|
3384
|
+
}
|
|
3385
|
+
});
|
|
3386
|
+
return;
|
|
3387
|
+
}
|
|
3388
|
+
this.packageVersion = obj.packageVersion;
|
|
3389
|
+
this.sources = de.reviveMany(obj.sources, (src) => new SourceReference(src.fileName, src.line, src.character));
|
|
3390
|
+
this.relevanceBoost = obj.relevanceBoost;
|
|
3391
|
+
this.typeParameters = de.reviveMany(obj.typeParameters, (tp) => de.constructReflection(tp));
|
|
3392
|
+
this.type = de.revive(obj.type, (t) => de.constructType(t));
|
|
3393
|
+
this.signatures = de.reviveMany(obj.signatures, (r) => de.constructReflection(r));
|
|
3394
|
+
this.indexSignatures = de.reviveMany(obj.indexSignatures, (r) => de.constructReflection(r));
|
|
3395
|
+
this.getSignature = de.revive(obj.getSignature, (r) => de.constructReflection(r));
|
|
3396
|
+
this.setSignature = de.revive(obj.setSignature, (r) => de.constructReflection(r));
|
|
3397
|
+
this.defaultValue = obj.defaultValue;
|
|
3398
|
+
this.overwrites = de.reviveType(obj.overwrites);
|
|
3399
|
+
this.inheritedFrom = de.reviveType(obj.inheritedFrom);
|
|
3400
|
+
this.implementationOf = de.reviveType(obj.implementationOf);
|
|
3401
|
+
this.extendedTypes = de.reviveMany(obj.extendedTypes, (t) => de.reviveType(t));
|
|
3402
|
+
this.extendedBy = de.reviveMany(obj.extendedBy, (t) => de.reviveType(t));
|
|
3403
|
+
this.implementedTypes = de.reviveMany(obj.implementedTypes, (t) => de.reviveType(t));
|
|
3404
|
+
this.implementedBy = de.reviveMany(obj.implementedBy, (t) => de.reviveType(t));
|
|
3405
|
+
}
|
|
3406
|
+
}
|
|
3407
|
+
|
|
3408
|
+
/**
|
|
3409
|
+
* Describes a reflection which does not exist at this location, but is referenced. Used for imported reflections.
|
|
3410
|
+
*
|
|
3411
|
+
* ```ts
|
|
3412
|
+
* // a.ts
|
|
3413
|
+
* export const a = 1;
|
|
3414
|
+
* // b.ts
|
|
3415
|
+
* import { a } from './a';
|
|
3416
|
+
* // Here to avoid extra work we create a reference to the original reflection in module a instead
|
|
3417
|
+
* // of copying the reflection.
|
|
3418
|
+
* export { a };
|
|
3419
|
+
* ```
|
|
3420
|
+
* @category Reflections
|
|
3421
|
+
*/
|
|
3422
|
+
class ReferenceReflection extends DeclarationReflection {
|
|
3423
|
+
variant = "reference";
|
|
3424
|
+
_target;
|
|
3425
|
+
/**
|
|
3426
|
+
* Creates a reference reflection. Should only be used within the factory function.
|
|
3427
|
+
* @internal
|
|
3428
|
+
*/
|
|
3429
|
+
constructor(name, reflection, parent) {
|
|
3430
|
+
super(name, ReflectionKind.Reference, parent);
|
|
3431
|
+
this._target = reflection.id;
|
|
3432
|
+
}
|
|
3433
|
+
/**
|
|
3434
|
+
* Tries to get the reflection that is referenced. This may be another reference reflection.
|
|
3435
|
+
* To fully resolve any references, use {@link tryGetTargetReflectionDeep}.
|
|
3436
|
+
*/
|
|
3437
|
+
tryGetTargetReflection() {
|
|
3438
|
+
return this.project.getReflectionById(this._target);
|
|
3439
|
+
}
|
|
3440
|
+
/**
|
|
3441
|
+
* Tries to get the reflection that is referenced, this will fully resolve references.
|
|
3442
|
+
* To only resolve one reference, use {@link tryGetTargetReflection}.
|
|
3443
|
+
*/
|
|
3444
|
+
tryGetTargetReflectionDeep() {
|
|
3445
|
+
let result = this.tryGetTargetReflection();
|
|
3446
|
+
while (result instanceof ReferenceReflection) {
|
|
3447
|
+
result = result.tryGetTargetReflection();
|
|
3448
|
+
}
|
|
3449
|
+
return result;
|
|
3450
|
+
}
|
|
3451
|
+
/**
|
|
3452
|
+
* Gets the reflection that is referenced. This may be another reference reflection.
|
|
3453
|
+
* To fully resolve any references, use {@link getTargetReflectionDeep}.
|
|
3454
|
+
*/
|
|
3455
|
+
getTargetReflection() {
|
|
3456
|
+
const target = this.tryGetTargetReflection();
|
|
3457
|
+
if (!target) {
|
|
3458
|
+
throw new Error("Reference was unresolved.");
|
|
3459
|
+
}
|
|
3460
|
+
return target;
|
|
3461
|
+
}
|
|
3462
|
+
/**
|
|
3463
|
+
* Gets the reflection that is referenced, this will fully resolve references.
|
|
3464
|
+
* To only resolve one reference, use {@link getTargetReflection}.
|
|
3465
|
+
*/
|
|
3466
|
+
getTargetReflectionDeep() {
|
|
3467
|
+
let result = this.getTargetReflection();
|
|
3468
|
+
while (result instanceof ReferenceReflection) {
|
|
3469
|
+
result = result.getTargetReflection();
|
|
3470
|
+
}
|
|
3471
|
+
return result;
|
|
3472
|
+
}
|
|
3473
|
+
getChildByName(arg) {
|
|
3474
|
+
return this.getTargetReflection().getChildByName(arg);
|
|
3475
|
+
}
|
|
3476
|
+
toObject(serializer) {
|
|
3477
|
+
return {
|
|
3478
|
+
...super.toObject(serializer),
|
|
3479
|
+
variant: this.variant,
|
|
3480
|
+
target: this.tryGetTargetReflection()?.id ?? -1,
|
|
3481
|
+
};
|
|
3482
|
+
}
|
|
3483
|
+
fromObject(de, obj) {
|
|
3484
|
+
super.fromObject(de, obj);
|
|
3485
|
+
de.defer((project) => {
|
|
3486
|
+
this._target = project.getReflectionById(de.oldIdToNewId[obj.target] ?? -1)
|
|
3487
|
+
?.id ?? -1;
|
|
3488
|
+
});
|
|
3489
|
+
}
|
|
3490
|
+
}
|
|
3491
|
+
|
|
3492
|
+
var __esDecorate = (globalThis && globalThis.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
3493
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
3494
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
3495
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
3496
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
3497
|
+
var _, done = false;
|
|
3498
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
3499
|
+
var context = {};
|
|
3500
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
3501
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
3502
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
3503
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
3504
|
+
if (kind === "accessor") {
|
|
3505
|
+
if (result === void 0) continue;
|
|
3506
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
3507
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
3508
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
3509
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
3510
|
+
}
|
|
3511
|
+
else if (_ = accept(result)) {
|
|
3512
|
+
if (kind === "field") initializers.unshift(_);
|
|
3513
|
+
else descriptor[key] = _;
|
|
3514
|
+
}
|
|
3515
|
+
}
|
|
3516
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
3517
|
+
done = true;
|
|
3518
|
+
};
|
|
3519
|
+
var __runInitializers = (globalThis && globalThis.__runInitializers) || function (thisArg, initializers, value) {
|
|
3520
|
+
var useValue = arguments.length > 2;
|
|
3521
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
3522
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
3523
|
+
}
|
|
3524
|
+
return useValue ? value : void 0;
|
|
3525
|
+
};
|
|
3526
|
+
// Keep this in sync with JSONOutput.SCHEMA_VERSION
|
|
3527
|
+
const JSON_SCHEMA_VERSION = "2.0";
|
|
3528
|
+
/**
|
|
3529
|
+
* A reflection that represents the root of the project.
|
|
3530
|
+
*
|
|
3531
|
+
* The project reflection acts as a global index, one may receive all reflections
|
|
3532
|
+
* and source files of the processed project through this reflection.
|
|
3533
|
+
* @category Reflections
|
|
3534
|
+
*/
|
|
3535
|
+
(() => {
|
|
3536
|
+
let _classSuper = ContainerReflection;
|
|
3537
|
+
let _symbolToReflectionIdMap_decorators;
|
|
3538
|
+
let _symbolToReflectionIdMap_initializers = [];
|
|
3539
|
+
let _symbolToReflectionIdMap_extraInitializers = [];
|
|
3540
|
+
let _reflectionIdToSymbolIdMap_decorators;
|
|
3541
|
+
let _reflectionIdToSymbolIdMap_initializers = [];
|
|
3542
|
+
let _reflectionIdToSymbolIdMap_extraInitializers = [];
|
|
3543
|
+
let _removedSymbolIds_decorators;
|
|
3544
|
+
let _removedSymbolIds_initializers = [];
|
|
3545
|
+
let _removedSymbolIds_extraInitializers = [];
|
|
3546
|
+
let _referenceGraph_decorators;
|
|
3547
|
+
let _referenceGraph_initializers = [];
|
|
3548
|
+
let _referenceGraph_extraInitializers = [];
|
|
3549
|
+
let _reflectionChildren_decorators;
|
|
3550
|
+
let _reflectionChildren_initializers = [];
|
|
3551
|
+
let _reflectionChildren_extraInitializers = [];
|
|
3552
|
+
let _reflections_decorators;
|
|
3553
|
+
let _reflections_initializers = [];
|
|
3554
|
+
let _reflections_extraInitializers = [];
|
|
3555
|
+
return class ProjectReflection extends _classSuper {
|
|
3556
|
+
static {
|
|
3557
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
3558
|
+
_symbolToReflectionIdMap_decorators = [NonEnumerable];
|
|
3559
|
+
_reflectionIdToSymbolIdMap_decorators = [NonEnumerable];
|
|
3560
|
+
_removedSymbolIds_decorators = [NonEnumerable];
|
|
3561
|
+
_referenceGraph_decorators = [NonEnumerable];
|
|
3562
|
+
_reflectionChildren_decorators = [NonEnumerable];
|
|
3563
|
+
_reflections_decorators = [NonEnumerable];
|
|
3564
|
+
__esDecorate(null, null, _symbolToReflectionIdMap_decorators, { kind: "field", name: "symbolToReflectionIdMap", static: false, private: false, access: { has: obj => "symbolToReflectionIdMap" in obj, get: obj => obj.symbolToReflectionIdMap, set: (obj, value) => { obj.symbolToReflectionIdMap = value; } }, metadata: _metadata }, _symbolToReflectionIdMap_initializers, _symbolToReflectionIdMap_extraInitializers);
|
|
3565
|
+
__esDecorate(null, null, _reflectionIdToSymbolIdMap_decorators, { kind: "field", name: "reflectionIdToSymbolIdMap", static: false, private: false, access: { has: obj => "reflectionIdToSymbolIdMap" in obj, get: obj => obj.reflectionIdToSymbolIdMap, set: (obj, value) => { obj.reflectionIdToSymbolIdMap = value; } }, metadata: _metadata }, _reflectionIdToSymbolIdMap_initializers, _reflectionIdToSymbolIdMap_extraInitializers);
|
|
3566
|
+
__esDecorate(null, null, _removedSymbolIds_decorators, { kind: "field", name: "removedSymbolIds", static: false, private: false, access: { has: obj => "removedSymbolIds" in obj, get: obj => obj.removedSymbolIds, set: (obj, value) => { obj.removedSymbolIds = value; } }, metadata: _metadata }, _removedSymbolIds_initializers, _removedSymbolIds_extraInitializers);
|
|
3567
|
+
__esDecorate(null, null, _referenceGraph_decorators, { kind: "field", name: "referenceGraph", static: false, private: false, access: { has: obj => "referenceGraph" in obj, get: obj => obj.referenceGraph, set: (obj, value) => { obj.referenceGraph = value; } }, metadata: _metadata }, _referenceGraph_initializers, _referenceGraph_extraInitializers);
|
|
3568
|
+
__esDecorate(null, null, _reflectionChildren_decorators, { kind: "field", name: "reflectionChildren", static: false, private: false, access: { has: obj => "reflectionChildren" in obj, get: obj => obj.reflectionChildren, set: (obj, value) => { obj.reflectionChildren = value; } }, metadata: _metadata }, _reflectionChildren_initializers, _reflectionChildren_extraInitializers);
|
|
3569
|
+
__esDecorate(null, null, _reflections_decorators, { kind: "field", name: "reflections", static: false, private: false, access: { has: obj => "reflections" in obj, get: obj => obj.reflections, set: (obj, value) => { obj.reflections = value; } }, metadata: _metadata }, _reflections_initializers, _reflections_extraInitializers);
|
|
3570
|
+
if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
3571
|
+
}
|
|
3572
|
+
variant = "project";
|
|
3573
|
+
// Used to resolve references.
|
|
3574
|
+
symbolToReflectionIdMap = __runInitializers(this, _symbolToReflectionIdMap_initializers, new StableKeyMap());
|
|
3575
|
+
reflectionIdToSymbolIdMap = (__runInitializers(this, _symbolToReflectionIdMap_extraInitializers), __runInitializers(this, _reflectionIdToSymbolIdMap_initializers, new Map()));
|
|
3576
|
+
removedSymbolIds = (__runInitializers(this, _reflectionIdToSymbolIdMap_extraInitializers), __runInitializers(this, _removedSymbolIds_initializers, new StableKeyMap()));
|
|
3577
|
+
// Maps a reflection ID to all references eventually referring to it.
|
|
3578
|
+
referenceGraph = (__runInitializers(this, _removedSymbolIds_extraInitializers), __runInitializers(this, _referenceGraph_initializers, void 0));
|
|
3579
|
+
// Maps a reflection ID to all reflections with it as their parent.
|
|
3580
|
+
reflectionChildren = (__runInitializers(this, _referenceGraph_extraInitializers), __runInitializers(this, _reflectionChildren_initializers, new DefaultMap(() => [])));
|
|
3581
|
+
/**
|
|
3582
|
+
* A list of all reflections within the project. DO NOT MUTATE THIS OBJECT.
|
|
3583
|
+
* All mutation should be done via {@link registerReflection} and {@link removeReflection}
|
|
3584
|
+
* to ensure that links to reflections remain valid.
|
|
3585
|
+
*
|
|
3586
|
+
* This may be replaced with a `Map<number, Reflection>` someday.
|
|
3587
|
+
*/
|
|
3588
|
+
reflections = (__runInitializers(this, _reflectionChildren_extraInitializers), __runInitializers(this, _reflections_initializers, {}));
|
|
3589
|
+
/**
|
|
3590
|
+
* The name of the package that this reflection documents according to package.json.
|
|
3591
|
+
*/
|
|
3592
|
+
packageName = __runInitializers(this, _reflections_extraInitializers);
|
|
3593
|
+
/**
|
|
3594
|
+
* The version of the package that this reflection documents according to package.json.
|
|
3595
|
+
*/
|
|
3596
|
+
packageVersion;
|
|
3597
|
+
/**
|
|
3598
|
+
* The contents of the readme.md file of the project when found.
|
|
3599
|
+
*/
|
|
3600
|
+
readme;
|
|
3601
|
+
/**
|
|
3602
|
+
* Object which describes where to find content for relative links.
|
|
3603
|
+
*/
|
|
3604
|
+
files;
|
|
3605
|
+
constructor(name, registry) {
|
|
3606
|
+
super(name, ReflectionKind.Project);
|
|
3607
|
+
this.reflections[this.id] = this;
|
|
3608
|
+
this.files = registry;
|
|
3609
|
+
}
|
|
3610
|
+
/**
|
|
3611
|
+
* Return whether this reflection is the root / project reflection.
|
|
3612
|
+
*/
|
|
3613
|
+
isProject() {
|
|
3614
|
+
return true;
|
|
3615
|
+
}
|
|
3616
|
+
/**
|
|
3617
|
+
* Return a list of all reflections in this project of a certain kind.
|
|
3618
|
+
*
|
|
3619
|
+
* @param kind The desired kind of reflection.
|
|
3620
|
+
* @returns An array containing all reflections with the desired kind.
|
|
3621
|
+
*/
|
|
3622
|
+
getReflectionsByKind(kind) {
|
|
3623
|
+
return Object.values(this.reflections).filter((reflection) => reflection.kindOf(kind));
|
|
3624
|
+
}
|
|
3625
|
+
/**
|
|
3626
|
+
* Registers the given reflection so that it can be quickly looked up by helper methods.
|
|
3627
|
+
* Should be called for *every* reflection added to the project.
|
|
3628
|
+
*
|
|
3629
|
+
* Note: During conversion, `Context.registerReflection` should be used instead so
|
|
3630
|
+
* that symbols can be saved for later use.
|
|
3631
|
+
*/
|
|
3632
|
+
registerReflection(reflection, id, filePath) {
|
|
3633
|
+
this.referenceGraph = undefined;
|
|
3634
|
+
if (reflection.parent) {
|
|
3635
|
+
this.reflectionChildren
|
|
3636
|
+
.get(reflection.parent.id)
|
|
3637
|
+
.push(reflection.id);
|
|
3638
|
+
}
|
|
3639
|
+
this.reflections[reflection.id] = reflection;
|
|
3640
|
+
if (id) {
|
|
3641
|
+
this.registerSymbolId(reflection, id);
|
|
3642
|
+
}
|
|
3643
|
+
if (filePath) {
|
|
3644
|
+
this.files.registerReflection(filePath, reflection);
|
|
3645
|
+
}
|
|
3646
|
+
}
|
|
3647
|
+
/**
|
|
3648
|
+
* Removes references to reflections contained within the provided type.
|
|
3649
|
+
* Plugins which overwrite types on reflections should pass the type to this
|
|
3650
|
+
* method before overwriting the property.
|
|
3651
|
+
* @since 0.26.6
|
|
3652
|
+
*/
|
|
3653
|
+
removeTypeReflections(type) {
|
|
3654
|
+
type?.visit(makeRecursiveVisitor({
|
|
3655
|
+
reflection: (type) => {
|
|
3656
|
+
this.removeReflection(type.declaration);
|
|
3657
|
+
},
|
|
3658
|
+
}));
|
|
3659
|
+
}
|
|
3660
|
+
/**
|
|
3661
|
+
* Removes a reflection from the documentation. Can be used by plugins to filter reflections
|
|
3662
|
+
* out of the generated documentation. Has no effect if the reflection is not present in the
|
|
3663
|
+
* project.
|
|
3664
|
+
*/
|
|
3665
|
+
removeReflection(reflection) {
|
|
3666
|
+
// Remove the reflection...
|
|
3667
|
+
this._removeReflection(reflection);
|
|
3668
|
+
// And now try to remove references to it in the parent reflection.
|
|
3669
|
+
// This might not find anything if someone called removeReflection on a member of a union
|
|
3670
|
+
// but I think that could only be caused by a plugin doing something weird, not by a regular
|
|
3671
|
+
// user... so this is probably good enough for now. Reflections that live on types are
|
|
3672
|
+
// kind of half-real anyways.
|
|
3673
|
+
const parent = reflection.parent;
|
|
3674
|
+
parent?.traverse((child, property) => {
|
|
3675
|
+
if (child !== reflection) {
|
|
3676
|
+
return true; // Continue iteration
|
|
3677
|
+
}
|
|
3678
|
+
switch (property) {
|
|
3679
|
+
case TraverseProperty.Children:
|
|
3680
|
+
case TraverseProperty.Documents:
|
|
3681
|
+
parent.removeChild(reflection);
|
|
3682
|
+
break;
|
|
3683
|
+
case TraverseProperty.GetSignature:
|
|
3684
|
+
delete parent.getSignature;
|
|
3685
|
+
break;
|
|
3686
|
+
case TraverseProperty.IndexSignature:
|
|
3687
|
+
removeIfPresent(parent.indexSignatures, reflection);
|
|
3688
|
+
if (!parent.indexSignatures?.length) {
|
|
3689
|
+
delete parent.indexSignatures;
|
|
3690
|
+
}
|
|
3691
|
+
break;
|
|
3692
|
+
case TraverseProperty.Parameters:
|
|
3693
|
+
removeIfPresent(reflection.parent.parameters, reflection);
|
|
3694
|
+
if (!reflection.parent.parameters
|
|
3695
|
+
?.length) {
|
|
3696
|
+
delete reflection.parent
|
|
3697
|
+
.parameters;
|
|
3698
|
+
}
|
|
3699
|
+
break;
|
|
3700
|
+
case TraverseProperty.SetSignature:
|
|
3701
|
+
delete parent.setSignature;
|
|
3702
|
+
break;
|
|
3703
|
+
case TraverseProperty.Signatures:
|
|
3704
|
+
removeIfPresent(parent.signatures, reflection);
|
|
3705
|
+
if (!parent.signatures?.length) {
|
|
3706
|
+
delete parent.signatures;
|
|
3707
|
+
}
|
|
3708
|
+
break;
|
|
3709
|
+
case TraverseProperty.TypeLiteral:
|
|
3710
|
+
parent.type = new IntrinsicType("Object");
|
|
3711
|
+
break;
|
|
3712
|
+
case TraverseProperty.TypeParameter:
|
|
3713
|
+
removeIfPresent(parent.typeParameters, reflection);
|
|
3714
|
+
if (!parent.typeParameters?.length) {
|
|
3715
|
+
delete parent.typeParameters;
|
|
3716
|
+
}
|
|
3717
|
+
break;
|
|
3718
|
+
default:
|
|
3719
|
+
assertNever(property);
|
|
3720
|
+
}
|
|
3721
|
+
return false; // Stop iteration
|
|
3722
|
+
});
|
|
3723
|
+
}
|
|
3724
|
+
/** @internal */
|
|
3725
|
+
mergeReflections(source, target) {
|
|
3726
|
+
// First, tell the children about their new parent
|
|
3727
|
+
delete this.referenceGraph;
|
|
3728
|
+
const oldChildrenIds = this.reflectionChildren.getNoInsert(source.id) || [];
|
|
3729
|
+
const newChildren = this.reflectionChildren.get(target.id);
|
|
3730
|
+
for (const childId of oldChildrenIds) {
|
|
3731
|
+
const childRefl = this.getReflectionById(childId);
|
|
3732
|
+
// To avoid conflicting with some plugins which do this surgery somewhat incorrectly
|
|
3733
|
+
// (typedoc-plugin-merge-modules and likely others I'm not aware of) only move children
|
|
3734
|
+
// which are still children
|
|
3735
|
+
if (childRefl?.parent === source) {
|
|
3736
|
+
childRefl.parent = target;
|
|
3737
|
+
newChildren.push(childId);
|
|
3738
|
+
target.addChild(childRefl);
|
|
3739
|
+
}
|
|
3740
|
+
}
|
|
3741
|
+
// Then remove the now-empty parent
|
|
3742
|
+
this.reflectionChildren.delete(source.id);
|
|
3743
|
+
this.removeReflection(source);
|
|
3744
|
+
// And remove any outdated collections of children on the new parent.
|
|
3745
|
+
// So long as this is used before REVIVE(-100) or EVENT_BEGIN_RESOLVE(-100)
|
|
3746
|
+
// this will make the appropriate plugin rebuild the lists.
|
|
3747
|
+
delete target.groups;
|
|
3748
|
+
delete target.categories;
|
|
3749
|
+
}
|
|
3750
|
+
/**
|
|
3751
|
+
* Remove a reflection without updating the parent reflection to remove references to the removed reflection.
|
|
3752
|
+
*/
|
|
3753
|
+
_removeReflection(reflection) {
|
|
3754
|
+
this.files.removeReflection(reflection);
|
|
3755
|
+
// Remove references pointing to this reflection
|
|
3756
|
+
const graph = this.getReferenceGraph();
|
|
3757
|
+
for (const id of graph.get(reflection.id) ?? []) {
|
|
3758
|
+
const ref = this.getReflectionById(id);
|
|
3759
|
+
if (ref) {
|
|
3760
|
+
this.removeReflection(ref);
|
|
3761
|
+
}
|
|
3762
|
+
}
|
|
3763
|
+
graph.delete(reflection.id);
|
|
3764
|
+
// Remove children of this reflection
|
|
3765
|
+
for (const childId of this.reflectionChildren.getNoInsert(reflection.id) || []) {
|
|
3766
|
+
const child = this.getReflectionById(childId);
|
|
3767
|
+
// Only remove if the child's parent is still actually this reflection.
|
|
3768
|
+
// This might not be the case if a plugin has moved this reflection to another parent.
|
|
3769
|
+
// (typedoc-plugin-merge-modules)
|
|
3770
|
+
if (child?.parent === reflection) {
|
|
3771
|
+
this._removeReflection(child);
|
|
3772
|
+
}
|
|
3773
|
+
}
|
|
3774
|
+
this.reflectionChildren.delete(reflection.id);
|
|
3775
|
+
// Remove references from the TS symbol to this reflection.
|
|
3776
|
+
const symbolId = this.reflectionIdToSymbolIdMap.get(reflection.id);
|
|
3777
|
+
if (symbolId) {
|
|
3778
|
+
const saved = this.symbolToReflectionIdMap.get(symbolId);
|
|
3779
|
+
if (saved === reflection.id) {
|
|
3780
|
+
this.symbolToReflectionIdMap.delete(symbolId);
|
|
3781
|
+
this.removedSymbolIds.set(symbolId, true);
|
|
3782
|
+
}
|
|
3783
|
+
else if (typeof saved === "object") {
|
|
3784
|
+
removeIfPresent(saved, reflection.id);
|
|
3785
|
+
if (saved.length === 0) {
|
|
3786
|
+
this.removedSymbolIds.set(symbolId, true);
|
|
3787
|
+
}
|
|
3788
|
+
}
|
|
3789
|
+
}
|
|
3790
|
+
this.reflectionIdToSymbolIdMap.delete(reflection.id);
|
|
3791
|
+
delete this.reflections[reflection.id];
|
|
3792
|
+
}
|
|
3793
|
+
/**
|
|
3794
|
+
* Gets the reflection registered for the given reflection ID, or undefined if it is not present
|
|
3795
|
+
* in the project.
|
|
3796
|
+
*/
|
|
3797
|
+
getReflectionById(id) {
|
|
3798
|
+
return this.reflections[id];
|
|
3799
|
+
}
|
|
3800
|
+
/**
|
|
3801
|
+
* Gets the reflection associated with the given symbol id, if it exists.
|
|
3802
|
+
* If there are multiple reflections associated with this symbol, gets the first one.
|
|
3803
|
+
* @internal
|
|
3804
|
+
*/
|
|
3805
|
+
getReflectionFromSymbolId(symbolId) {
|
|
3806
|
+
return this.getReflectionsFromSymbolId(symbolId)[0];
|
|
3807
|
+
}
|
|
3808
|
+
/** @internal */
|
|
3809
|
+
getReflectionsFromSymbolId(symbolId) {
|
|
3810
|
+
const id = this.symbolToReflectionIdMap.get(symbolId);
|
|
3811
|
+
if (typeof id === "number") {
|
|
3812
|
+
return [this.getReflectionById(id)];
|
|
3813
|
+
}
|
|
3814
|
+
else if (typeof id === "object") {
|
|
3815
|
+
return id.map((id) => this.getReflectionById(id));
|
|
3816
|
+
}
|
|
3817
|
+
return [];
|
|
3818
|
+
}
|
|
3819
|
+
/** @internal */
|
|
3820
|
+
getSymbolIdFromReflection(reflection) {
|
|
3821
|
+
return this.reflectionIdToSymbolIdMap.get(reflection.id);
|
|
3822
|
+
}
|
|
3823
|
+
/** @internal */
|
|
3824
|
+
registerSymbolId(reflection, id) {
|
|
3825
|
+
this.removedSymbolIds.delete(id);
|
|
3826
|
+
this.reflectionIdToSymbolIdMap.set(reflection.id, id);
|
|
3827
|
+
const previous = this.symbolToReflectionIdMap.get(id);
|
|
3828
|
+
if (typeof previous !== "undefined") {
|
|
3829
|
+
if (typeof previous === "number") {
|
|
3830
|
+
this.symbolToReflectionIdMap.set(id, [previous, reflection.id]);
|
|
3831
|
+
}
|
|
3832
|
+
else {
|
|
3833
|
+
previous.push(reflection.id);
|
|
3834
|
+
}
|
|
3835
|
+
}
|
|
3836
|
+
else {
|
|
3837
|
+
this.symbolToReflectionIdMap.set(id, reflection.id);
|
|
3838
|
+
}
|
|
3839
|
+
}
|
|
3840
|
+
symbolIdHasBeenRemoved(id) {
|
|
3841
|
+
return this.removedSymbolIds.has(id);
|
|
3842
|
+
}
|
|
3843
|
+
getReferenceGraph() {
|
|
3844
|
+
if (!this.referenceGraph) {
|
|
3845
|
+
this.referenceGraph = new Map();
|
|
3846
|
+
for (const id in this.reflections) {
|
|
3847
|
+
const ref = this.reflections[id];
|
|
3848
|
+
if (ref instanceof ReferenceReflection) {
|
|
3849
|
+
const target = ref.tryGetTargetReflection();
|
|
3850
|
+
if (target) {
|
|
3851
|
+
const refs = this.referenceGraph.get(target.id) ?? [];
|
|
3852
|
+
refs.push(ref.id);
|
|
3853
|
+
this.referenceGraph.set(target.id, refs);
|
|
3854
|
+
}
|
|
3855
|
+
}
|
|
3856
|
+
}
|
|
3857
|
+
}
|
|
3858
|
+
return this.referenceGraph;
|
|
3859
|
+
}
|
|
3860
|
+
toObject(serializer) {
|
|
3861
|
+
const symbolIdMap = {};
|
|
3862
|
+
this.reflectionIdToSymbolIdMap.forEach((sid, id) => {
|
|
3863
|
+
symbolIdMap[id] = sid.toObject();
|
|
3864
|
+
});
|
|
3865
|
+
return {
|
|
3866
|
+
schemaVersion: JSON_SCHEMA_VERSION,
|
|
3867
|
+
...super.toObject(serializer),
|
|
3868
|
+
variant: this.variant,
|
|
3869
|
+
packageName: this.packageName,
|
|
3870
|
+
packageVersion: this.packageVersion,
|
|
3871
|
+
readme: Comment.serializeDisplayParts(this.readme),
|
|
3872
|
+
symbolIdMap,
|
|
3873
|
+
files: serializer.toObject(this.files),
|
|
3874
|
+
};
|
|
3875
|
+
}
|
|
3876
|
+
fromObject(de, obj) {
|
|
3877
|
+
super.fromObject(de, obj);
|
|
3878
|
+
// If updating this, also check the block in DeclarationReflection.fromObject.
|
|
3879
|
+
this.packageName = obj.packageName;
|
|
3880
|
+
this.packageVersion = obj.packageVersion;
|
|
3881
|
+
if (obj.readme) {
|
|
3882
|
+
this.readme = Comment.deserializeDisplayParts(de, obj.readme);
|
|
3883
|
+
}
|
|
3884
|
+
this.files.fromObject(de, obj.files || {});
|
|
3885
|
+
de.defer(() => {
|
|
3886
|
+
// Unnecessary conditional in release
|
|
3887
|
+
for (const [id, sid] of Object.entries(obj.symbolIdMap || {})) {
|
|
3888
|
+
const refl = this.getReflectionById(de.oldIdToNewId[+id] ?? -1);
|
|
3889
|
+
if (refl) {
|
|
3890
|
+
this.registerSymbolId(refl, new ReflectionSymbolId(sid));
|
|
3891
|
+
}
|
|
3892
|
+
else {
|
|
3893
|
+
de.logger.warn(i18n.serialized_project_referenced_0_not_part_of_project(id));
|
|
3894
|
+
}
|
|
3895
|
+
}
|
|
3896
|
+
});
|
|
3897
|
+
}
|
|
3898
|
+
};
|
|
3899
|
+
})();
|
|
3900
|
+
|
|
3901
|
+
/**!
|
|
3902
|
+
* FlexSearch.js v0.8.212 (Bundle/Module)
|
|
3903
|
+
* Author and Copyright: Thomas Wilkerling
|
|
3904
|
+
* Licence: Apache-2.0
|
|
3905
|
+
* Hosted by Nextapps GmbH
|
|
3906
|
+
* https://github.com/nextapps-de/flexsearch
|
|
3907
|
+
*/
|
|
3908
|
+
var w;function H(a,c,b){const e=typeof b,d=typeof a;if(e!=="undefined"){if(d!=="undefined"){if(b){if(d==="function"&&e===d)return function(k){return a(b(k))};c=a.constructor;if(c===b.constructor){if(c===Array)return b.concat(a);if(c===Map){var f=new Map(b);for(var g of a)f.set(g[0],g[1]);return f}if(c===Set){g=new Set(b);for(f of a.values())g.add(f);return g}}}return a}return b}return d==="undefined"?c:a}function aa(a,c){return typeof a==="undefined"?c:a}function I(){return Object.create(null)}
|
|
3909
|
+
function M(a){return typeof a==="string"}function ba(a){return typeof a==="object"}function ca(a,c){if(M(c))a=a[c];else for(let b=0;a&&b<c.length;b++)a=a[c[b]];return a}const ea=/[^\p{L}\p{N}]+/u,fa=/(\d{3})/g,ha=/(\D)(\d{3})/g,ia=/(\d{3})(\D)/g,ja=/[\u0300-\u036f]/g;function ka(a={}){if(!this||this.constructor!==ka)return new ka(...arguments);if(arguments.length)for(a=0;a<arguments.length;a++)this.assign(arguments[a]);else this.assign(a);}w=ka.prototype;
|
|
3910
|
+
w.assign=function(a){this.normalize=H(a.normalize,true,this.normalize);let c=a.include,b=c||a.exclude||a.split,e;if(b||b===""){if(typeof b==="object"&&b.constructor!==RegExp){let d="";e=!c;c||(d+="\\p{Z}");b.letter&&(d+="\\p{L}");b.number&&(d+="\\p{N}",e=!!c);b.symbol&&(d+="\\p{S}");b.punctuation&&(d+="\\p{P}");b.control&&(d+="\\p{C}");if(b=b.char)d+=typeof b==="object"?b.join(""):b;try{this.split=new RegExp("["+(c?"^":"")+d+"]+","u");}catch(f){this.split=/\s+/;}}else this.split=b,e=b===false||"a1a".split(b).length<
|
|
3911
|
+
2;this.numeric=H(a.numeric,e);}else {try{this.split=H(this.split,ea);}catch(d){this.split=/\s+/;}this.numeric=H(a.numeric,H(this.numeric,true));}this.prepare=H(a.prepare,null,this.prepare);this.finalize=H(a.finalize,null,this.finalize);b=a.filter;this.filter=typeof b==="function"?b:H(b&&new Set(b),null,this.filter);this.dedupe=H(a.dedupe,true,this.dedupe);this.matcher=H((b=a.matcher)&&new Map(b),null,this.matcher);this.mapper=H((b=a.mapper)&&new Map(b),null,this.mapper);this.stemmer=H((b=a.stemmer)&&new Map(b),
|
|
3912
|
+
null,this.stemmer);this.replacer=H(a.replacer,null,this.replacer);this.minlength=H(a.minlength,1,this.minlength);this.maxlength=H(a.maxlength,1024,this.maxlength);this.rtl=H(a.rtl,false,this.rtl);if(this.cache=b=H(a.cache,true,this.cache))this.F=null,this.L=typeof b==="number"?b:2E5,this.B=new Map,this.D=new Map,this.I=this.H=128;this.h="";this.J=null;this.A="";this.K=null;if(this.matcher)for(const d of this.matcher.keys())this.h+=(this.h?"|":"")+d;if(this.stemmer)for(const d of this.stemmer.keys())this.A+=
|
|
3913
|
+
(this.A?"|":"")+d;return this};w.addStemmer=function(a,c){this.stemmer||(this.stemmer=new Map);this.stemmer.set(a,c);this.A+=(this.A?"|":"")+a;this.K=null;this.cache&&Q(this);return this};w.addFilter=function(a){typeof a==="function"?this.filter=a:(this.filter||(this.filter=new Set),this.filter.add(a));this.cache&&Q(this);return this};
|
|
3914
|
+
w.addMapper=function(a,c){if(typeof a==="object")return this.addReplacer(a,c);if(a.length>1)return this.addMatcher(a,c);this.mapper||(this.mapper=new Map);this.mapper.set(a,c);this.cache&&Q(this);return this};w.addMatcher=function(a,c){if(typeof a==="object")return this.addReplacer(a,c);if(a.length<2&&(this.dedupe||this.mapper))return this.addMapper(a,c);this.matcher||(this.matcher=new Map);this.matcher.set(a,c);this.h+=(this.h?"|":"")+a;this.J=null;this.cache&&Q(this);return this};
|
|
3915
|
+
w.addReplacer=function(a,c){if(typeof a==="string")return this.addMatcher(a,c);this.replacer||(this.replacer=[]);this.replacer.push(a,c);this.cache&&Q(this);return this};
|
|
3916
|
+
w.encode=function(a,c){if(this.cache&&a.length<=this.H)if(this.F){if(this.B.has(a))return this.B.get(a)}else this.F=setTimeout(Q,50,this);this.normalize&&(typeof this.normalize==="function"?a=this.normalize(a):a=ja?a.normalize("NFKD").replace(ja,"").toLowerCase():a.toLowerCase());this.prepare&&(a=this.prepare(a));this.numeric&&a.length>3&&(a=a.replace(ha,"$1 $2").replace(ia,"$1 $2").replace(fa,"$1 "));const b=!(this.dedupe||this.mapper||this.filter||this.matcher||this.stemmer||this.replacer);let e=
|
|
3917
|
+
[],d=I(),f,g,k=this.split||this.split===""?a.split(this.split):[a];for(let l=0,m,p;l<k.length;l++)if((m=p=k[l])&&!(m.length<this.minlength||m.length>this.maxlength)){if(c){if(d[m])continue;d[m]=1;}else {if(f===m)continue;f=m;}if(b)e.push(m);else if(!this.filter||(typeof this.filter==="function"?this.filter(m):!this.filter.has(m))){if(this.cache&&m.length<=this.I)if(this.F){var h=this.D.get(m);if(h||h===""){h&&e.push(h);continue}}else this.F=setTimeout(Q,50,this);if(this.stemmer){this.K||(this.K=new RegExp("(?!^)("+
|
|
3918
|
+
this.A+")$"));let u;for(;u!==m&&m.length>2;)u=m,m=m.replace(this.K,r=>this.stemmer.get(r));}if(m&&(this.mapper||this.dedupe&&m.length>1)){h="";for(let u=0,r="",t,n;u<m.length;u++)t=m.charAt(u),t===r&&this.dedupe||((n=this.mapper&&this.mapper.get(t))||n===""?n===r&&this.dedupe||!(r=n)||(h+=n):h+=r=t);m=h;}this.matcher&&m.length>1&&(this.J||(this.J=new RegExp("("+this.h+")","g")),m=m.replace(this.J,u=>this.matcher.get(u)));if(m&&this.replacer)for(h=0;m&&h<this.replacer.length;h+=2)m=m.replace(this.replacer[h],
|
|
3919
|
+
this.replacer[h+1]);this.cache&&p.length<=this.I&&(this.D.set(p,m),this.D.size>this.L&&(this.D.clear(),this.I=this.I/1.1|0));if(m){if(m!==p)if(c){if(d[m])continue;d[m]=1;}else {if(g===m)continue;g=m;}e.push(m);}}}this.finalize&&(e=this.finalize(e)||e);this.cache&&a.length<=this.H&&(this.B.set(a,e),this.B.size>this.L&&(this.B.clear(),this.H=this.H/1.1|0));return e};function Q(a){a.F=null;a.B.clear();a.D.clear();}function la(a,c,b){b||(c||typeof a!=="object"?typeof c==="object"&&(b=c,c=0):b=a);b&&(a=b.query||a,c=b.limit||c);let e=""+(c||0);b&&(e+=(b.offset||0)+!!b.context+!!b.suggest+(b.resolve!==false)+(b.resolution||this.resolution)+(b.boost||0));a=(""+a).toLowerCase();this.cache||(this.cache=new ma);let d=this.cache.get(a+e);if(!d){const f=b&&b.cache;f&&(b.cache=false);d=this.search(a,c,b);f&&(b.cache=f);this.cache.set(a+e,d);}return d}function ma(a){this.limit=a&&a!==true?a:1E3;this.cache=new Map;this.h="";}
|
|
3920
|
+
ma.prototype.set=function(a,c){this.cache.set(this.h=a,c);this.cache.size>this.limit&&this.cache.delete(this.cache.keys().next().value);};ma.prototype.get=function(a){const c=this.cache.get(a);c&&this.h!==a&&(this.cache.delete(a),this.cache.set(this.h=a,c));return c};ma.prototype.remove=function(a){for(const c of this.cache){const b=c[0];c[1].includes(a)&&this.cache.delete(b);}};ma.prototype.clear=function(){this.cache.clear();this.h="";};const na={normalize:false,numeric:false,dedupe:false};const oa={};const ra=new Map([["b","p"],["v","f"],["w","f"],["z","s"],["x","s"],["d","t"],["n","m"],["c","k"],["g","k"],["j","k"],["q","k"],["i","e"],["y","e"],["u","o"]]);const sa=new Map([["ae","a"],["oe","o"],["sh","s"],["kh","k"],["th","t"],["ph","f"],["pf","f"]]),ta=[/([^aeo])h(.)/g,"$1$2",/([aeo])h([^aeo]|$)/g,"$1$2",/(.)\1+/g,"$1"];const ua={a:"",e:"",i:"",o:"",u:"",y:"",b:1,f:1,p:1,v:1,c:2,g:2,j:2,k:2,q:2,s:2,x:2,z:2,"\u00df":2,d:3,t:3,l:4,m:5,n:5,r:6};var va={Exact:na,Default:oa,Normalize:oa,LatinBalance:{mapper:ra},LatinAdvanced:{mapper:ra,matcher:sa,replacer:ta},LatinExtra:{mapper:ra,replacer:ta.concat([/(?!^)[aeo]/g,""]),matcher:sa},LatinSoundex:{dedupe:false,include:{letter:true},finalize:function(a){for(let b=0;b<a.length;b++){var c=a[b];let e=c.charAt(0),d=ua[e];for(let f=1,g;f<c.length&&(g=c.charAt(f),g==="h"||g==="w"||!(g=ua[g])||g===d||(e+=g,d=g,e.length!==4));f++);a[b]=e;}}},CJK:{split:""},LatinExact:na,LatinDefault:oa,LatinSimple:oa};function wa(a,c,b,e){let d=[];for(let f=0,g;f<a.index.length;f++)if(g=a.index[f],c>=g.length)c-=g.length;else {c=g[e?"splice":"slice"](c,b);const k=c.length;if(k&&(d=d.length?d.concat(c):c,b-=k,e&&(a.length-=k),!b))break;c=0;}return d}
|
|
3921
|
+
function xa(a){if(!this||this.constructor!==xa)return new xa(a);this.index=a?[a]:[];this.length=a?a.length:0;const c=this;return new Proxy([],{get(b,e){if(e==="length")return c.length;if(e==="push")return function(d){c.index[c.index.length-1].push(d);c.length++;};if(e==="pop")return function(){if(c.length)return c.length--,c.index[c.index.length-1].pop()};if(e==="indexOf")return function(d){let f=0;for(let g=0,k,h;g<c.index.length;g++){k=c.index[g];h=k.indexOf(d);if(h>=0)return f+h;f+=k.length;}return -1};
|
|
3922
|
+
if(e==="includes")return function(d){for(let f=0;f<c.index.length;f++)if(c.index[f].includes(d))return true;return false};if(e==="slice")return function(d,f){return wa(c,d||0,f||c.length,false)};if(e==="splice")return function(d,f){return wa(c,d||0,f||c.length,true)};if(e==="constructor")return Array;if(typeof e!=="symbol")return (b=c.index[e/2**31|0])&&b[e]},set(b,e,d){b=e/2**31|0;(c.index[b]||(c.index[b]=[]))[e]=d;c.length++;return true}})}xa.prototype.clear=function(){this.index.length=0;};xa.prototype.push=function(){};
|
|
3923
|
+
function R(a=8){if(!this||this.constructor!==R)return new R(a);this.index=I();this.h=[];this.size=0;a>32?(this.B=Aa,this.A=BigInt(a)):(this.B=Ba,this.A=a);}R.prototype.get=function(a){const c=this.index[this.B(a)];return c&&c.get(a)};R.prototype.set=function(a,c){var b=this.B(a);let e=this.index[b];e?(b=e.size,e.set(a,c),(b-=e.size)&&this.size++):(this.index[b]=e=new Map([[a,c]]),this.h.push(e),this.size++);};
|
|
3924
|
+
function S(a=8){if(!this||this.constructor!==S)return new S(a);this.index=I();this.h=[];this.size=0;a>32?(this.B=Aa,this.A=BigInt(a)):(this.B=Ba,this.A=a);}S.prototype.add=function(a){var c=this.B(a);let b=this.index[c];b?(c=b.size,b.add(a),(c-=b.size)&&this.size++):(this.index[c]=b=new Set([a]),this.h.push(b),this.size++);};w=R.prototype;w.has=S.prototype.has=function(a){const c=this.index[this.B(a)];return c&&c.has(a)};
|
|
3925
|
+
w.delete=S.prototype.delete=function(a){const c=this.index[this.B(a)];c&&c.delete(a)&&this.size--;};w.clear=S.prototype.clear=function(){this.index=I();this.h=[];this.size=0;};w.values=S.prototype.values=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].values())yield c;};w.keys=S.prototype.keys=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].keys())yield c;};w.entries=S.prototype.entries=function*(){for(let a=0;a<this.h.length;a++)for(let c of this.h[a].entries())yield c;};
|
|
3926
|
+
function Ba(a){let c=2**this.A-1;if(typeof a=="number")return a&c;let b=0,e=this.A+1;for(let d=0;d<a.length;d++)b=(b*e^a.charCodeAt(d))&c;return this.A===32?b+2**31:b}function Aa(a){let c=BigInt(2)**this.A-BigInt(1);var b=typeof a;if(b==="bigint")return a&c;if(b==="number")return BigInt(a)&c;b=BigInt(0);let e=this.A+BigInt(1);for(let d=0;d<a.length;d++)b=(b*e^BigInt(a.charCodeAt(d)))&c;return b}let Ca,Da;
|
|
3927
|
+
async function Ea(a){a=a.data;var c=a.task;const b=a.id;let e=a.args;switch(c){case "init":Da=a.options||{};(c=a.factory)?(Function("return "+c)()(self),Ca=new self.FlexSearch.Index(Da),delete self.FlexSearch):Ca=new T(Da);postMessage({id:b});break;default:let d;c==="export"&&(e[1]?(e[0]=Da.export,e[2]=0,e[3]=1):e=null);c==="import"?e[0]&&(a=await Da.import.call(Ca,e[0]),Ca.import(e[0],a)):((d=e&&Ca[c].apply(Ca,e))&&d.then&&(d=await d),d&&d.await&&(d=await d.await),c==="search"&&d.result&&(d=d.result));
|
|
3928
|
+
postMessage(c==="search"?{id:b,msg:d}:{id:b});}}function Fa(a){Ga.call(a,"add");Ga.call(a,"append");Ga.call(a,"search");Ga.call(a,"update");Ga.call(a,"remove");Ga.call(a,"searchCache");}let Ha,Ia,Ja;function Ka(){Ha=Ja=0;}
|
|
3929
|
+
function Ga(a){this[a+"Async"]=function(){const c=arguments;var b=c[c.length-1];let e;typeof b==="function"&&(e=b,delete c[c.length-1]);Ha?Ja||(Ja=Date.now()-Ia>=this.priority*this.priority*3):(Ha=setTimeout(Ka,0),Ia=Date.now());if(Ja){const f=this;return new Promise(g=>{setTimeout(function(){g(f[a+"Async"].apply(f,c));},0);})}const d=this[a].apply(this,c);b=d.then?d:new Promise(f=>f(d));e&&b.then(e);return b};}let V=0;
|
|
3930
|
+
function La(a={},c){function b(k){function h(l){l=l.data||l;const m=l.id,p=m&&f.h[m];p&&(p(l.msg),delete f.h[m]);}this.worker=k;this.h=I();if(this.worker){d?this.worker.on("message",h):this.worker.onmessage=h;if(a.config)return new Promise(function(l){V>1E9&&(V=0);f.h[++V]=function(){l(f);};f.worker.postMessage({id:V,task:"init",factory:e,options:a});});this.priority=a.priority||4;this.encoder=c||null;this.worker.postMessage({task:"init",factory:e,options:a});return this}}if(!this||this.constructor!==La)return new La(a);
|
|
3931
|
+
let e=typeof self!=="undefined"?self._factory:typeof window!=="undefined"?window._factory:null;e&&(e=e.toString());const d=typeof window==="undefined",f=this,g=Ma(e,d,a.worker);return g.then?g.then(function(k){return b.call(f,k)}):b.call(this,g)}W("add");W("append");W("search");W("update");W("remove");W("clear");W("export");W("import");La.prototype.searchCache=la;Fa(La.prototype);
|
|
3932
|
+
function W(a){La.prototype[a]=function(){const c=this,b=[].slice.call(arguments);var e=b[b.length-1];let d;typeof e==="function"&&(d=e,b.pop());e=new Promise(function(f){a==="export"&&typeof b[0]==="function"&&(b[0]=null);V>1E9&&(V=0);c.h[++V]=f;c.worker.postMessage({task:a,id:V,args:b});});return d?(e.then(d),this):e};}
|
|
3933
|
+
function Ma(a,c,b){return c?typeof module!=="undefined"?new(require("worker_threads")["Worker"])(__dirname+"/worker/node.js"):import('worker_threads').then(function(worker){return new worker["Worker"](undefined+"/node/node.mjs")}):a?new window.Worker(URL.createObjectURL(new Blob(["onmessage="+Ea.toString()],{type:"text/javascript"}))):new window.Worker(typeof b==="string"?b:(_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('index.js', document.baseURI).href).replace("/worker.js","/worker/worker.js").replace("flexsearch.bundle.module.min.js",
|
|
3934
|
+
"module/worker/worker.js").replace("flexsearch.bundle.module.min.mjs","module/worker/worker.js"),{type:"module"})}Na.prototype.add=function(a,c,b){ba(a)&&(c=a,a=ca(c,this.key));if(c&&(a||a===0)){if(!b&&this.reg.has(a))return this.update(a,c);for(let k=0,h;k<this.field.length;k++){h=this.B[k];var e=this.index.get(this.field[k]);if(typeof h==="function"){var d=h(c);d&&e.add(a,d,b,true);}else if(d=h.G,!d||d(c))h.constructor===String?h=[""+h]:M(h)&&(h=[h]),Qa(c,h,this.D,0,e,a,h[0],b);}if(this.tag)for(e=0;e<this.A.length;e++){var f=this.A[e];d=this.tag.get(this.F[e]);let k=I();if(typeof f==="function"){if(f=f(c),!f)continue}else {var g=
|
|
3935
|
+
f.G;if(g&&!g(c))continue;f.constructor===String&&(f=""+f);f=ca(c,f);}if(d&&f){M(f)&&(f=[f]);for(let h=0,l,m;h<f.length;h++)if(l=f[h],!k[l]&&(k[l]=1,(g=d.get(l))?m=g:d.set(l,m=[]),!b||!m.includes(a))){if(m.length===2**31-1){g=new xa(m);if(this.fastupdate)for(let p of this.reg.values())p.includes(m)&&(p[p.indexOf(m)]=g);d.set(l,m=g);}m.push(a);this.fastupdate&&((g=this.reg.get(a))?g.push(m):this.reg.set(a,[m]));}}}if(this.store&&(!b||!this.store.has(a))){let k;if(this.h){k=I();for(let h=0,l;h<this.h.length;h++){l=
|
|
3936
|
+
this.h[h];if((b=l.G)&&!b(c))continue;let m;if(typeof l==="function"){m=l(c);if(!m)continue;l=[l.O];}else if(M(l)||l.constructor===String){k[l]=c[l];continue}Ra(c,k,l,0,l[0],m);}}this.store.set(a,k||c);}this.worker&&(this.fastupdate||this.reg.add(a));}return this};function Ra(a,c,b,e,d,f){a=a[d];if(e===b.length-1)c[d]=f||a;else if(a)if(a.constructor===Array)for(c=c[d]=Array(a.length),d=0;d<a.length;d++)Ra(a,c,b,e,d);else c=c[d]||(c[d]=I()),d=b[++e],Ra(a,c,b,e,d);}
|
|
3937
|
+
function Qa(a,c,b,e,d,f,g,k){if(a=a[g])if(e===c.length-1){if(a.constructor===Array){if(b[e]){for(c=0;c<a.length;c++)d.add(f,a[c],true,true);return}a=a.join(" ");}d.add(f,a,k,true);}else if(a.constructor===Array)for(g=0;g<a.length;g++)Qa(a,c,b,e,d,f,g,k);else g=c[++e],Qa(a,c,b,e,d,f,g,k);}function Sa(a,c,b,e){if(!a.length)return a;if(a.length===1)return a=a[0],a=b||a.length>c?a.slice(b,b+c):a,e?Ta.call(this,a):a;let d=[];for(let f=0,g,k;f<a.length;f++)if((g=a[f])&&(k=g.length)){if(b){if(b>=k){b-=k;continue}g=g.slice(b,b+c);k=g.length;b=0;}k>c&&(g=g.slice(0,c),k=c);if(!d.length&&k>=c)return e?Ta.call(this,g):g;d.push(g);c-=k;if(!c)break}d=d.length>1?[].concat.apply([],d):d[0];return e?Ta.call(this,d):d}function Ua(a,c,b,e){var d=e[0];if(d[0]&&d[0].query)return a[c].apply(a,d);if(!(c!=="and"&&c!=="not"||a.result.length||a.await||d.suggest))return e.length>1&&(d=e[e.length-1]),(e=d.resolve)?a.await||a.result:a;let f=[],g=0,k=0,h,l,m,p,u;for(c=0;c<e.length;c++)if(d=e[c]){var r=void 0;if(d.constructor===X)r=d.await||d.result;else if(d.then||d.constructor===Array)r=d;else {g=d.limit||0;k=d.offset||0;m=d.suggest;l=d.resolve;h=((p=d.highlight||a.highlight)||d.enrich)&&l;r=d.queue;let t=d.async||r,n=d.index,
|
|
3938
|
+
q=d.query;n?a.index||(a.index=n):n=a.index;if(q||d.tag){const x=d.field||d.pluck;x&&(!q||a.query&&!p||(a.query=q,a.field=x,a.highlight=p),n=n.index.get(x));if(r&&(u||a.await)){u=1;let v;const A=a.C.length,D=new Promise(function(F){v=F;});(function(F,E){D.h=function(){E.index=null;E.resolve=false;let B=t?F.searchAsync(E):F.search(E);if(B.then)return B.then(function(z){a.C[A]=z=z.result||z;v(z);return z});B=B.result||B;v(B);return B};})(n,Object.assign({},d));a.C.push(D);f[c]=D;continue}else d.resolve=false,
|
|
3939
|
+
d.index=null,r=t?n.searchAsync(d):n.search(d),d.resolve=l,d.index=n;}else if(d.and)r=Va(d,"and",n);else if(d.or)r=Va(d,"or",n);else if(d.not)r=Va(d,"not",n);else if(d.xor)r=Va(d,"xor",n);else continue}r.await?(u=1,r=r.await):r.then?(u=1,r=r.then(function(t){return t.result||t})):r=r.result||r;f[c]=r;}u&&!a.await&&(a.await=new Promise(function(t){a.return=t;}));if(u){const t=Promise.all(f).then(function(n){for(let q=0;q<a.C.length;q++)if(a.C[q]===t){a.C[q]=function(){return b.call(a,n,g,k,h,l,m,p)};break}Wa(a);});
|
|
3940
|
+
a.C.push(t);}else if(a.await)a.C.push(function(){return b.call(a,f,g,k,h,l,m,p)});else return b.call(a,f,g,k,h,l,m,p);return l?a.await||a.result:a}function Va(a,c,b){a=a[c];const e=a[0]||a;e.index||(e.index=b);b=new X(e);a.length>1&&(b=b[c].apply(b,a.slice(1)));return b}X.prototype.or=function(){return Ua(this,"or",Xa,arguments)};function Xa(a,c,b,e,d,f,g){a.length&&(this.result.length&&a.push(this.result),a.length<2?this.result=a[0]:(this.result=Ya(a,c,b,false,this.h),b=0));d&&(this.await=null);return d?this.resolve(c,b,e,g):this}X.prototype.and=function(){return Ua(this,"and",Za,arguments)};function Za(a,c,b,e,d,f,g){if(!f&&!this.result.length)return d?this.result:this;let k;if(a.length)if(this.result.length&&a.unshift(this.result),a.length<2)this.result=a[0];else {let h=0;for(let l=0,m,p;l<a.length;l++)if((m=a[l])&&(p=m.length))h<p&&(h=p);else if(!f){h=0;break}h?(this.result=$a(a,h,c,b,f,this.h,d),k=true):this.result=[];}else f||(this.result=a);d&&(this.await=null);return d?this.resolve(c,b,e,g,k):this}X.prototype.xor=function(){return Ua(this,"xor",ab,arguments)};
|
|
3941
|
+
function ab(a,c,b,e,d,f,g){if(a.length)if(this.result.length&&a.unshift(this.result),a.length<2)this.result=a[0];else {a:{f=b;var k=this.h;const h=[],l=I();let m=0;for(let p=0,u;p<a.length;p++)if(u=a[p]){m<u.length&&(m=u.length);for(let r=0,t;r<u.length;r++)if(t=u[r])for(let n=0,q;n<t.length;n++)q=t[n],l[q]=l[q]?2:1;}for(let p=0,u,r=0;p<m;p++)for(let t=0,n;t<a.length;t++)if(n=a[t])if(u=n[p])for(let q=0,x;q<u.length;q++)if(x=u[q],l[x]===1)if(f)f--;else if(d){if(h.push(x),h.length===c){a=h;break a}}else {const v=
|
|
3942
|
+
p+(t?k:0);h[v]||(h[v]=[]);h[v].push(x);if(++r===c){a=h;break a}}a=h;}this.result=a;k=true;}else f||(this.result=a);d&&(this.await=null);return d?this.resolve(c,b,e,g,k):this}X.prototype.not=function(){return Ua(this,"not",bb,arguments)};
|
|
3943
|
+
function bb(a,c,b,e,d,f,g){if(!f&&!this.result.length)return d?this.result:this;if(a.length&&this.result.length){a:{f=b;var k=[];a=new Set(a.flat().flat());for(let h=0,l,m=0;h<this.result.length;h++)if(l=this.result[h])for(let p=0,u;p<l.length;p++)if(u=l[p],!a.has(u))if(f)f--;else if(d){if(k.push(u),k.length===c){a=k;break a}}else if(k[h]||(k[h]=[]),k[h].push(u),++m===c){a=k;break a}a=k;}this.result=a;k=true;}d&&(this.await=null);return d?this.resolve(c,b,e,g,k):this}function cb(a,c,b,e,d){let f,g,k;typeof d==="string"?(f=d,d=""):f=d.template;g=f.indexOf("$1");k=f.substring(g+2);g=f.substring(0,g);let h=d&&d.boundary,l=!d||d.clip!==false,m=d&&d.merge&&k&&g&&new RegExp(k+" "+g,"g");d=d&&d.ellipsis;var p=0;if(typeof d==="object"){var u=d.template;p=u.length-2;d=d.pattern;}typeof d!=="string"&&(d=d===false?"":"...");p&&(d=u.replace("$1",d));u=d.length-p;let r,t;typeof h==="object"&&(r=h.before,r===0&&(r=-1),t=h.after,t===0&&(t=-1),h=h.total||9E5);p=new Map;for(let Oa=0,
|
|
3944
|
+
da,db,pa;Oa<c.length;Oa++){let qa;if(e)qa=c,pa=e;else {var n=c[Oa];pa=n.field;if(!pa)continue;qa=n.result;}db=b.get(pa);da=db.encoder;n=p.get(da);typeof n!=="string"&&(n=da.encode(a),p.set(da,n));for(let ya=0;ya<qa.length;ya++){var q=qa[ya].doc;if(!q)continue;q=ca(q,pa);if(!q)continue;var x=q.trim().split(/\s+/);if(!x.length)continue;q="";var v=[];let za=[];var A=-1,D=-1,F=0;for(var E=0;E<x.length;E++){var B=x[E],z=da.encode(B);z=z.length>1?z.join(" "):z[0];let y;if(z&&B){var C=B.length,J=(da.split?
|
|
3945
|
+
B.replace(da.split,""):B).length-z.length,G="",N=0;for(var O=0;O<n.length;O++){var P=n[O];if(P){var L=P.length;L+=J<0?0:J;N&&L<=N||(P=z.indexOf(P),P>-1&&(G=(P?B.substring(0,P):"")+g+B.substring(P,P+L)+k+(P+L<C?B.substring(P+L):""),N=L,y=true));}}G&&(h&&(A<0&&(A=q.length+(q?1:0)),D=q.length+(q?1:0)+G.length,F+=C,za.push(v.length),v.push({match:G})),q+=(q?" ":"")+G);}if(!y)B=x[E],q+=(q?" ":"")+B,h&&v.push({text:B});else if(h&&F>=h)break}F=za.length*(f.length-2);if(r||t||h&&q.length-F>h)if(F=h+F-u*2,E=D-
|
|
3946
|
+
A,r>0&&(E+=r),t>0&&(E+=t),E<=F)x=r?A-(r>0?r:0):A-((F-E)/2|0),v=t?D+(t>0?t:0):x+F,l||(x>0&&q.charAt(x)!==" "&&q.charAt(x-1)!==" "&&(x=q.indexOf(" ",x),x<0&&(x=0)),v<q.length&&q.charAt(v-1)!==" "&&q.charAt(v)!==" "&&(v=q.lastIndexOf(" ",v),v<D?v=D:++v)),q=(x?d:"")+q.substring(x,v)+(v<q.length?d:"");else {D=[];A={};F={};E={};B={};z={};G=J=C=0;for(O=N=1;;){var U=void 0;for(let y=0,K;y<za.length;y++){K=za[y];if(G)if(J!==G){if(E[y+1])continue;K+=G;if(A[K]){C-=u;F[y+1]=1;E[y+1]=1;continue}if(K>=v.length-
|
|
3947
|
+
1){if(K>=v.length){E[y+1]=1;K>=x.length&&(F[y+1]=1);continue}C-=u;}q=v[K].text;if(L=t&&z[y])if(L>0){if(q.length>L)if(E[y+1]=1,l)q=q.substring(0,L);else continue;(L-=q.length)||(L=-1);z[y]=L;}else {E[y+1]=1;continue}if(C+q.length+1<=h)q=" "+q,D[y]+=q;else if(l)U=h-C-1,U>0&&(q=" "+q.substring(0,U),D[y]+=q),E[y+1]=1;else {E[y+1]=1;continue}}else {if(E[y])continue;K-=J;if(A[K]){C-=u;E[y]=1;F[y]=1;continue}if(K<=0){if(K<0){E[y]=1;F[y]=1;continue}C-=u;}q=v[K].text;if(L=r&&B[y])if(L>0){if(q.length>L)if(E[y]=1,
|
|
3948
|
+
l)q=q.substring(q.length-L);else continue;(L-=q.length)||(L=-1);B[y]=L;}else {E[y]=1;continue}if(C+q.length+1<=h)q+=" ",D[y]=q+D[y];else if(l)U=q.length+1-(h-C),U>=0&&U<q.length&&(q=q.substring(U)+" ",D[y]=q+D[y]),E[y]=1;else {E[y]=1;continue}}else {q=v[K].match;r&&(B[y]=r);t&&(z[y]=t);y&&C++;let Pa;K?!y&&u&&(C+=u):(F[y]=1,E[y]=1);K>=x.length-1?Pa=1:K<v.length-1&&v[K+1].match?Pa=1:u&&(C+=u);C-=f.length-2;if(!y||C+q.length<=h)D[y]=q;else {U=N=O=F[y]=0;break}Pa&&(F[y+1]=1,E[y+1]=1);}C+=q.length;U=A[K]=1;}if(U)J===
|
|
3949
|
+
G?G++:J++;else {J===G?N=0:O=0;if(!N&&!O)break;N?(J++,G=J):G++;}}q="";for(let y=0,K;y<D.length;y++)K=(F[y]?y?" ":"":(y&&!d?" ":"")+d)+D[y],q+=K;d&&!F[D.length]&&(q+=d);}m&&(q=q.replace(m," "));qa[ya].highlight=q;}if(e)break}return c}function X(a,c){if(!this||this.constructor!==X)return new X(a,c);let b=0,e,d,f,g,k,h;if(a&&a.index){const l=a;c=l.index;b=l.boost||0;if(d=l.query){f=l.field||l.pluck;g=l.highlight;const m=l.resolve;a=l.async||l.queue;l.resolve=false;l.index=null;a=a?c.searchAsync(l):c.search(l);l.resolve=m;l.index=c;a=a.result||a;}else a=[];}if(a&&a.then){const l=this;a=a.then(function(m){l.C[0]=l.result=m.result||m;Wa(l);});e=[a];a=[];k=new Promise(function(m){h=m;});}this.index=c||null;this.result=a||[];this.h=b;this.C=
|
|
3950
|
+
e||[];this.await=k||null;this.return=h||null;this.highlight=g||null;this.query=d||"";this.field=f||"";}w=X.prototype;w.limit=function(a){if(this.await){const c=this;this.C.push(function(){return c.limit(a).result});}else if(this.result.length){const c=[];for(let b=0,e;b<this.result.length;b++)if(e=this.result[b])if(e.length<=a){if(c[b]=e,a-=e.length,!a)break}else {c[b]=e.slice(0,a);break}this.result=c;}return this};
|
|
3951
|
+
w.offset=function(a){if(this.await){const c=this;this.C.push(function(){return c.offset(a).result});}else if(this.result.length){const c=[];for(let b=0,e;b<this.result.length;b++)if(e=this.result[b])e.length<=a?a-=e.length:(c[b]=e.slice(a),a=0);this.result=c;}return this};w.boost=function(a){if(this.await){const c=this;this.C.push(function(){return c.boost(a).result});}else this.h+=a;return this};
|
|
3952
|
+
function Wa(a,c){let b=a.result;var e=a.await;a.await=null;for(let d=0,f;d<a.C.length;d++)if(f=a.C[d])if(typeof f==="function")b=f(),a.C[d]=b=b.result||b,d--;else if(f.h)b=f.h(),a.C[d]=b=b.result||b,d--;else if(f.then)return a.await=e;e=a.return;a.C=[];a.return=null;c||e(b);return b}
|
|
3953
|
+
w.resolve=function(a,c,b,e,d){let f=this.await?Wa(this,true):this.result;if(f.then){const g=this;return f.then(function(){return g.resolve(a,c,b,e,d)})}f.length&&(typeof a==="object"?(e=a.highlight||this.highlight,b=!!e||a.enrich,c=a.offset,a=a.limit):(e=e||this.highlight,b=!!e||b),f=d?b?Ta.call(this.index,f):f:Sa.call(this.index,f,a||100,c,b));return this.finalize(f,e)};
|
|
3954
|
+
w.finalize=function(a,c){if(a.then){const e=this;return a.then(function(d){return e.finalize(d,c)})}c&&a.length&&this.query&&(a=cb(this.query,a,this.index.index,this.field,c));const b=this.return;this.highlight=this.index=this.result=this.C=this.await=this.return=null;this.query=this.field="";b&&b(a);return a};function $a(a,c,b,e,d,f,g){const k=a.length;let h=[],l,m;l=I();for(let p=0,u,r,t,n;p<c;p++)for(let q=0;q<k;q++)if(t=a[q],p<t.length&&(u=t[p]))for(let x=0;x<u.length;x++){r=u[x];(m=l[r])?l[r]++:(m=0,l[r]=1);n=h[m]||(h[m]=[]);if(!g){let v=p+(q||!d?0:f||0);n=n[v]||(n[v]=[]);}n.push(r);if(g&&b&&m===k-1&&n.length-e===b)return e?n.slice(e):n}if(a=h.length)if(d)h=h.length>1?Ya(h,b,e,g,f):(h=h[0])&&b&&h.length>b||e?h.slice(e,b+e):h;else {if(a<k)return [];h=h[a-1];if(b||e)if(g){if(h.length>b||e)h=h.slice(e,b+
|
|
3955
|
+
e);}else {d=[];for(let p=0,u;p<h.length;p++)if(u=h[p])if(e&&u.length>e)e-=u.length;else {if(b&&u.length>b||e)u=u.slice(e,b+e),b-=u.length,e&&(e-=u.length);d.push(u);if(!b)break}h=d;}}return h}
|
|
3956
|
+
function Ya(a,c,b,e,d){const f=[],g=I();let k;var h=a.length;let l;if(e)for(d=h-1;d>=0;d--){if(l=(e=a[d])&&e.length)for(h=0;h<l;h++)if(k=e[h],!g[k])if(g[k]=1,b)b--;else if(f.push(k),f.length===c)return f}else for(let m=h-1,p,u=0;m>=0;m--){p=a[m];for(let r=0;r<p.length;r++)if(l=(e=p[r])&&e.length)for(let t=0;t<l;t++)if(k=e[t],!g[k])if(g[k]=1,b)b--;else {let n=(r+(m<h-1?d||0:0))/(m+1)|0;(f[n]||(f[n]=[])).push(k);if(++u===c)return f}}return f}
|
|
3957
|
+
function eb(a,c,b,e,d){const f=I(),g=[];for(let k=0,h;k<c.length;k++){h=c[k];for(let l=0;l<h.length;l++)f[h[l]]=1;}if(d)for(let k=0,h;k<a.length;k++){if(h=a[k],f[h])if(e)e--;else if(g.push(h),f[h]=0,b&&--b===0)break}else for(let k=0,h,l;k<a.result.length;k++)for(h=a.result[k],c=0;c<h.length;c++)l=h[c],f[l]&&((g[k]||(g[k]=[])).push(l),f[l]=0);return g}Na.prototype.search=function(a,c,b,e){b||(!c&&ba(a)?(b=a,a=""):ba(c)&&(b=c,c=0));let d=[];var f=[];let g;let k,h,l,m,p;let u=0,r=true,t;if(b){b.constructor===Array&&(b={index:b});a=b.query||a;g=b.pluck;k=b.merge;l=b.boost;p=g||b.field||(p=b.index)&&(p.index?null:p);var n=this.tag&&b.tag;h=b.suggest;r=b.resolve!==false;m=b.cache;t=r&&this.store&&b.highlight;var q=!!t||r&&this.store&&b.enrich;c=b.limit||c;var x=b.offset||0;c||(c=r?100:0);if(n&&(!this.db||!e)){n.constructor!==Array&&(n=[n]);var v=[];for(let B=
|
|
3958
|
+
0,z;B<n.length;B++)if(z=n[B],z.field&&z.tag){var A=z.tag;if(A.constructor===Array)for(var D=0;D<A.length;D++)v.push(z.field,A[D]);else v.push(z.field,A);}else {A=Object.keys(z);for(let C=0,J,G;C<A.length;C++)if(J=A[C],G=z[J],G.constructor===Array)for(D=0;D<G.length;D++)v.push(J,G[D]);else v.push(J,G);}n=v;if(!a){f=[];if(v.length)for(n=0;n<v.length;n+=2){if(this.db){e=this.index.get(v[n]);if(!e)continue;f.push(e=e.db.tag(v[n+1],c,x,q));}else e=fb.call(this,v[n],v[n+1],c,x,q);d.push(r?{field:v[n],tag:v[n+
|
|
3959
|
+
1],result:e}:[e]);}if(f.length){const B=this;return Promise.all(f).then(function(z){for(let C=0;C<z.length;C++)r?d[C].result=z[C]:d[C]=z[C];return r?d:new X(d.length>1?$a(d,1,0,0,h,l):d[0],B)})}return r?d:new X(d.length>1?$a(d,1,0,0,h,l):d[0],this)}}r||g||!(p=p||this.field)||(M(p)?g=p:(p.constructor===Array&&p.length===1&&(p=p[0]),g=p.field||p.index));p&&p.constructor!==Array&&(p=[p]);}p||(p=this.field);let F;v=(this.worker||this.db)&&!e&&[];for(let B=0,z,C,J;B<p.length;B++){C=p[B];if(this.db&&this.tag&&
|
|
3960
|
+
!this.B[B])continue;let G;M(C)||(G=C,C=G.field,a=G.query||a,c=aa(G.limit,c),x=aa(G.offset,x),h=aa(G.suggest,h),t=r&&this.store&&aa(G.highlight,t),q=!!t||r&&this.store&&aa(G.enrich,q),m=aa(G.cache,m));if(e)z=e[B];else {A=G||b||{};D=A.enrich;var E=this.index.get(C);n&&(this.db&&(A.tag=n,A.field=p,F=E.db.support_tag_search),!F&&D&&(A.enrich=false),F||(A.limit=0,A.offset=0));z=m?E.searchCache(a,n&&!F?0:c,A):E.search(a,n&&!F?0:c,A);n&&!F&&(A.limit=c,A.offset=x);D&&(A.enrich=D);if(v){v[B]=z;continue}}J=(z=
|
|
3961
|
+
z.result||z)&&z.length;if(n&&J){A=[];D=0;if(this.db&&e){if(!F)for(E=p.length;E<e.length;E++){let N=e[E];if(N&&N.length)D++,A.push(N);else if(!h)return r?d:new X(d,this)}}else for(let N=0,O,P;N<n.length;N+=2){O=this.tag.get(n[N]);if(!O)if(h)continue;else return r?d:new X(d,this);if(P=(O=O&&O.get(n[N+1]))&&O.length)D++,A.push(O);else if(!h)return r?d:new X(d,this)}if(D){z=eb(z,A,c,x,r);J=z.length;if(!J&&!h)return r?z:new X(z,this);D--;}}if(J)f[u]=C,d.push(z),u++;else if(p.length===1)return r?d:new X(d,
|
|
3962
|
+
this)}if(v){if(this.db&&n&&n.length&&!F)for(q=0;q<n.length;q+=2){f=this.index.get(n[q]);if(!f)if(h)continue;else return r?d:new X(d,this);v.push(f.db.tag(n[q+1],c,x,false));}const B=this;return Promise.all(v).then(function(z){b&&(b.resolve=r);z.length&&(z=B.search(a,c,b,z));return z})}if(!u)return r?d:new X(d,this);if(g&&(!q||!this.store))return d=d[0],r?d:new X(d,this);v=[];for(x=0;x<f.length;x++){n=d[x];q&&n.length&&typeof n[0].doc==="undefined"&&(this.db?v.push(n=this.index.get(this.field[0]).db.enrich(n)):
|
|
3963
|
+
n=Ta.call(this,n));if(g)return r?t?cb(a,n,this.index,g,t):n:new X(n,this);d[x]={field:f[x],result:n};}if(q&&this.db&&v.length){const B=this;return Promise.all(v).then(function(z){for(let C=0;C<z.length;C++)d[C].result=z[C];t&&(d=cb(a,d,B.index,g,t));return k?gb(d):d})}t&&(d=cb(a,d,this.index,g,t));return k?gb(d):d};
|
|
3964
|
+
function gb(a){const c=[],b=I(),e=I();for(let d=0,f,g,k,h,l,m,p;d<a.length;d++){f=a[d];g=f.field;k=f.result;for(let u=0;u<k.length;u++)if(l=k[u],typeof l!=="object"?l={id:h=l}:h=l.id,(m=b[h])?m.push(g):(l.field=b[h]=[g],c.push(l)),p=l.highlight)m=e[h],m||(e[h]=m={},l.highlight=m),m[g]=p;}return c}function fb(a,c,b,e,d){a=this.tag.get(a);if(!a)return [];a=a.get(c);if(!a)return [];c=a.length-e;if(c>0){if(b&&c>b||e)a=a.slice(e,e+b);d&&(a=Ta.call(this,a));}return a}
|
|
3965
|
+
function Ta(a){if(!this||!this.store)return a;if(this.db)return this.index.get(this.field[0]).db.enrich(a);const c=Array(a.length);for(let b=0,e;b<a.length;b++)e=a[b],c[b]={id:e,doc:this.store.get(e)};return c}function Na(a){if(!this||this.constructor!==Na)return new Na(a);const c=a.document||a.doc||a;let b,e;this.B=[];this.field=[];this.D=[];this.key=(b=c.key||c.id)&&hb(b,this.D)||"id";(e=a.keystore||0)&&(this.keystore=e);this.fastupdate=!!a.fastupdate;this.reg=!this.fastupdate||a.worker||a.db?e?new S(e):new Set:e?new R(e):new Map;this.h=(b=c.store||null)&&b&&b!==true&&[];this.store=b?e?new R(e):new Map:null;this.cache=(b=a.cache||null)&&new ma(b);a.cache=false;this.worker=a.worker||false;this.priority=a.priority||
|
|
3966
|
+
4;this.index=ib.call(this,a,c);this.tag=null;if(b=c.tag)if(typeof b==="string"&&(b=[b]),b.length){this.tag=new Map;this.A=[];this.F=[];for(let d=0,f,g;d<b.length;d++){f=b[d];g=f.field||f;if(!g)throw Error("The tag field from the document descriptor is undefined.");f.custom?this.A[d]=f.custom:(this.A[d]=hb(g,this.D),f.filter&&(typeof this.A[d]==="string"&&(this.A[d]=new String(this.A[d])),this.A[d].G=f.filter));this.F[d]=g;this.tag.set(g,new Map);}}if(this.worker){this.fastupdate=false;a=[];for(const d of this.index.values())d.then&&
|
|
3967
|
+
a.push(d);if(a.length){const d=this;return Promise.all(a).then(function(f){let g=0;for(const k of d.index.entries()){const h=k[0];let l=k[1];l.then&&(l=f[g],d.index.set(h,l),g++);}return d})}}else a.db&&(this.fastupdate=false,this.mount(a.db));}w=Na.prototype;
|
|
3968
|
+
w.mount=function(a){let c=this.field;if(this.tag)for(let f=0,g;f<this.F.length;f++){g=this.F[f];var b=void 0;this.index.set(g,b=new T({},this.reg));c===this.field&&(c=c.slice(0));c.push(g);b.tag=this.tag.get(g);}b=[];const e={db:a.db,type:a.type,fastupdate:a.fastupdate};for(let f=0,g,k;f<c.length;f++){e.field=k=c[f];g=this.index.get(k);const h=new a.constructor(a.id,e);h.id=a.id;b[f]=h.mount(g);g.document=true;f?g.bypass=true:g.store=this.store;}const d=this;return this.db=Promise.all(b).then(function(){d.db=
|
|
3969
|
+
true;})};w.commit=async function(){const a=[];for(const c of this.index.values())a.push(c.commit());await Promise.all(a);this.reg.clear();};w.destroy=function(){const a=[];for(const c of this.index.values())a.push(c.destroy());return Promise.all(a)};
|
|
3970
|
+
function ib(a,c){const b=new Map;let e=c.index||c.field||c;M(e)&&(e=[e]);for(let f=0,g,k;f<e.length;f++){g=e[f];M(g)||(k=g,g=g.field);k=ba(k)?Object.assign({},a,k):a;if(this.worker){var d=void 0;d=(d=k.encoder)&&d.encode?d:new ka(typeof d==="string"?va[d]:d||{});d=new La(k,d);b.set(g,d);}this.worker||b.set(g,new T(k,this.reg));k.custom?this.B[f]=k.custom:(this.B[f]=hb(g,this.D),k.filter&&(typeof this.B[f]==="string"&&(this.B[f]=new String(this.B[f])),this.B[f].G=k.filter));this.field[f]=g;}if(this.h){a=
|
|
3971
|
+
c.store;M(a)&&(a=[a]);for(let f=0,g,k;f<a.length;f++)g=a[f],k=g.field||g,g.custom?(this.h[f]=g.custom,g.custom.O=k):(this.h[f]=hb(k,this.D),g.filter&&(typeof this.h[f]==="string"&&(this.h[f]=new String(this.h[f])),this.h[f].G=g.filter));}return b}function hb(a,c){const b=a.split(":");let e=0;for(let d=0;d<b.length;d++)a=b[d],a[a.length-1]==="]"&&(a=a.substring(0,a.length-2))&&(c[e]=true),a&&(b[e++]=a);e<b.length&&(b.length=e);return e>1?b:b[0]}w.append=function(a,c){return this.add(a,c,true)};
|
|
3972
|
+
w.update=function(a,c){return this.remove(a).add(a,c)};w.remove=function(a){ba(a)&&(a=ca(a,this.key));for(var c of this.index.values())c.remove(a,true);if(this.reg.has(a)){if(this.tag&&!this.fastupdate)for(let b of this.tag.values())for(let e of b){c=e[0];const d=e[1],f=d.indexOf(a);f>-1&&(d.length>1?d.splice(f,1):b.delete(c));}this.store&&this.store.delete(a);this.reg.delete(a);}this.cache&&this.cache.remove(a);return this};
|
|
3973
|
+
w.clear=function(){const a=[];for(const c of this.index.values()){const b=c.clear();b.then&&a.push(b);}if(this.tag)for(const c of this.tag.values())c.clear();this.store&&this.store.clear();this.cache&&this.cache.clear();return a.length?Promise.all(a):this};w.contain=function(a){return this.db?this.index.get(this.field[0]).db.has(a):this.reg.has(a)};w.cleanup=function(){for(const a of this.index.values())a.cleanup();return this};
|
|
3974
|
+
w.get=function(a){return this.db?this.index.get(this.field[0]).db.enrich(a).then(function(c){return c[0]&&c[0].doc||null}):this.store.get(a)||null};w.set=function(a,c){typeof a==="object"&&(c=a,a=ca(c,this.key));this.store.set(a,c);return this};w.searchCache=la;w.export=jb;w.import=kb;Fa(Na.prototype);function lb(a,c=0){let b=[],e=[];c&&(c=25E4/c*5E3|0);for(const d of a.entries())e.push(d),e.length===c&&(b.push(e),e=[]);e.length&&b.push(e);return b}function mb(a,c){c||(c=new Map);for(let b=0,e;b<a.length;b++)e=a[b],c.set(e[0],e[1]);return c}function nb(a,c=0){let b=[],e=[];c&&(c=25E4/c*1E3|0);for(const d of a.entries())e.push([d[0],lb(d[1])[0]||[]]),e.length===c&&(b.push(e),e=[]);e.length&&b.push(e);return b}
|
|
3975
|
+
function ob(a,c){c||(c=new Map);for(let b=0,e,d;b<a.length;b++)e=a[b],d=c.get(e[0]),c.set(e[0],mb(e[1],d));return c}function pb(a){let c=[],b=[];for(const e of a.keys())b.push(e),b.length===25E4&&(c.push(b),b=[]);b.length&&c.push(b);return c}function qb(a,c){c||(c=new Set);for(let b=0;b<a.length;b++)c.add(a[b]);return c}
|
|
3976
|
+
function rb(a,c,b,e,d,f,g=0){const k=e&&e.constructor===Array;var h=k?e.shift():e;if(!h)return this.export(a,c,d,f+1);if((h=a((c?c+".":"")+(g+1)+"."+b,JSON.stringify(h)))&&h.then){const l=this;return h.then(function(){return rb.call(l,a,c,b,k?e:null,d,f,g+1)})}return rb.call(this,a,c,b,k?e:null,d,f,g+1)}
|
|
3977
|
+
function jb(a,c,b=0,e=0){if(b<this.field.length){const g=this.field[b];if((c=this.index.get(g).export(a,g,b,e=1))&&c.then){const k=this;return c.then(function(){return k.export(a,g,b+1)})}return this.export(a,g,b+1)}let d,f;switch(e){case 0:d="reg";f=pb(this.reg);c=null;break;case 1:d="tag";f=this.tag&&nb(this.tag,this.reg.size);c=null;break;case 2:d="doc";f=this.store&&lb(this.store);c=null;break;default:return}return rb.call(this,a,c,d,f||null,b,e)}
|
|
3978
|
+
function kb(a,c){var b=a.split(".");b[b.length-1]==="json"&&b.pop();const e=b.length>2?b[0]:"";b=b.length>2?b[2]:b[1];if(this.worker&&e)return this.index.get(e).import(a);if(c){typeof c==="string"&&(c=JSON.parse(c));if(e)return this.index.get(e).import(b,c);switch(b){case "reg":this.fastupdate=false;this.reg=qb(c,this.reg);for(let d=0,f;d<this.field.length;d++)f=this.index.get(this.field[d]),f.fastupdate=false,f.reg=this.reg;if(this.worker){c=[];for(const d of this.index.values())c.push(d.import(a));return Promise.all(c)}break;
|
|
3979
|
+
case "tag":this.tag=ob(c,this.tag);break;case "doc":this.store=mb(c,this.store);}}}function sb(a,c){let b="";for(const e of a.entries()){a=e[0];const d=e[1];let f="";for(let g=0,k;g<d.length;g++){k=d[g]||[""];let h="";for(let l=0;l<k.length;l++)h+=(h?",":"")+(c==="string"?'"'+k[l]+'"':k[l]);h="["+h+"]";f+=(f?",":"")+h;}f='["'+a+'",['+f+"]]";b+=(b?",":"")+f;}return b}T.prototype.remove=function(a,c){const b=this.reg.size&&(this.fastupdate?this.reg.get(a):this.reg.has(a));if(b){if(this.fastupdate)for(let e=0,d,f;e<b.length;e++){if((d=b[e])&&(f=d.length))if(d[f-1]===a)d.pop();else {const g=d.indexOf(a);g>=0&&d.splice(g,1);}}else tb(this.map,a),this.depth&&tb(this.ctx,a);c||this.reg.delete(a);}this.db&&(this.commit_task.push({del:a}),this.M&&ub(this));this.cache&&this.cache.remove(a);return this};
|
|
3980
|
+
function tb(a,c){let b=0;var e=typeof c==="undefined";if(a.constructor===Array)for(let d=0,f,g,k;d<a.length;d++){if((f=a[d])&&f.length){if(e)return 1;g=f.indexOf(c);if(g>=0){if(f.length>1)return f.splice(g,1),1;delete a[d];if(b)return 1;k=1;}else {if(k)return 1;b++;}}}else for(let d of a.entries())e=d[0],tb(d[1],c)?b++:a.delete(e);return b}const vb={memory:{resolution:1},performance:{resolution:3,fastupdate:true,context:{depth:1,resolution:1}},match:{tokenize:"forward"},score:{resolution:9,context:{depth:2,resolution:3}}};T.prototype.add=function(a,c,b,e){if(c&&(a||a===0)){if(!e&&!b&&this.reg.has(a))return this.update(a,c);e=this.depth;c=this.encoder.encode(c,!e);const l=c.length;if(l){const m=I(),p=I(),u=this.resolution;for(let r=0;r<l;r++){let t=c[this.rtl?l-1-r:r];var d=t.length;if(d&&(e||!p[t])){var f=this.score?this.score(c,t,r,null,0):wb(u,l,r),g="";switch(this.tokenize){case "tolerant":Y(this,p,t,f,a,b);if(d>2){for(let n=1,q,x,v,A;n<d-1;n++)q=t.charAt(n),x=t.charAt(n+1),v=t.substring(0,n)+x,A=t.substring(n+
|
|
3981
|
+
2),g=v+q+A,Y(this,p,g,f,a,b),g=v+A,Y(this,p,g,f,a,b);Y(this,p,t.substring(0,t.length-1),f,a,b);}break;case "full":if(d>2){for(let n=0,q;n<d;n++)for(f=d;f>n;f--){g=t.substring(n,f);q=this.rtl?d-1-n:n;var k=this.score?this.score(c,t,r,g,q):wb(u,l,r,d,q);Y(this,p,g,k,a,b);}break}case "bidirectional":case "reverse":if(d>1){for(k=d-1;k>0;k--){g=t[this.rtl?d-1-k:k]+g;var h=this.score?this.score(c,t,r,g,k):wb(u,l,r,d,k);Y(this,p,g,h,a,b);}g="";}case "forward":if(d>1){for(k=0;k<d;k++)g+=t[this.rtl?d-1-k:k],Y(this,
|
|
3982
|
+
p,g,f,a,b);break}default:if(Y(this,p,t,f,a,b),e&&l>1&&r<l-1)for(d=this.N,g=t,f=Math.min(e+1,this.rtl?r+1:l-r),k=1;k<f;k++){t=c[this.rtl?l-1-r-k:r+k];h=this.bidirectional&&t>g;const n=this.score?this.score(c,g,r,t,k-1):wb(d+(l/2>d?0:1),l,r,f-1,k-1);Y(this,m,h?g:t,n,a,b,h?t:g);}}}}this.fastupdate||this.reg.add(a);}}this.db&&(this.commit_task.push(b?{ins:a}:{del:a}),this.M&&ub(this));return this};
|
|
3983
|
+
function Y(a,c,b,e,d,f,g){let k,h;if(!(k=c[b])||g&&!k[g]){g?(c=k||(c[b]=I()),c[g]=1,h=a.ctx,(k=h.get(g))?h=k:h.set(g,h=a.keystore?new R(a.keystore):new Map)):(h=a.map,c[b]=1);(k=h.get(b))?h=k:h.set(b,h=k=[]);if(f)for(let l=0,m;l<k.length;l++)if((m=k[l])&&m.includes(d)){if(l<=e)return;m.splice(m.indexOf(d),1);a.fastupdate&&(c=a.reg.get(d))&&c.splice(c.indexOf(m),1);break}h=h[e]||(h[e]=[]);h.push(d);if(h.length===2**31-1){c=new xa(h);if(a.fastupdate)for(let l of a.reg.values())l.includes(h)&&(l[l.indexOf(h)]=
|
|
3984
|
+
c);k[e]=h=c;}a.fastupdate&&((e=a.reg.get(d))?e.push(h):a.reg.set(d,[h]));}}function wb(a,c,b,e,d){return b&&a>1?c+(e||0)<=a?b+(d||0):(a-1)/(c+(e||0))*(b+(d||0))+1|0:0}T.prototype.search=function(a,c,b){b||(c||typeof a!=="object"?typeof c==="object"&&(b=c,c=0):(b=a,a=""));if(b&&b.cache)return b.cache=false,a=this.searchCache(a,c,b),b.cache=true,a;let e=[],d,f,g,k=0,h,l,m,p,u;b&&(a=b.query||a,c=b.limit||c,k=b.offset||0,f=b.context,g=b.suggest,u=(h=b.resolve)&&b.enrich,m=b.boost,p=b.resolution,l=this.db&&b.tag);typeof h==="undefined"&&(h=this.resolve);f=this.depth&&f!==false;let r=this.encoder.encode(a,!f);d=r.length;c=c||(h?100:0);if(d===1)return xb.call(this,r[0],"",c,
|
|
3985
|
+
k,h,u,l);if(d===2&&f&&!g)return xb.call(this,r[1],r[0],c,k,h,u,l);let t=I(),n=0,q;f&&(q=r[0],n=1);p||p===0||(p=q?this.N:this.resolution);if(this.db){if(this.db.search&&(b=this.db.search(this,r,c,k,g,h,u,l),b!==false))return b;const x=this;return async function(){for(let v,A;n<d;n++){if((A=r[n])&&!t[A]){t[A]=1;v=await yb(x,A,q,0,0,false,false);if(v=zb(v,e,g,p)){e=v;break}q&&(g&&v&&e.length||(q=A));}g&&q&&n===d-1&&!e.length&&(p=x.resolution,q="",n=-1,t=I());}return Ab(e,p,c,k,g,m,h)}()}for(let x,v;n<d;n++){if((v=
|
|
3986
|
+
r[n])&&!t[v]){t[v]=1;x=yb(this,v,q,0,0,false,false);if(x=zb(x,e,g,p)){e=x;break}q&&(g&&x&&e.length||(q=v));}g&&q&&n===d-1&&!e.length&&(p=this.resolution,q="",n=-1,t=I());}return Ab(e,p,c,k,g,m,h)};function Ab(a,c,b,e,d,f,g){let k=a.length,h=a;if(k>1)h=$a(a,c,b,e,d,f,g);else if(k===1)return g?Sa.call(null,a[0],b,e):new X(a[0],this);return g?h:new X(h,this)}
|
|
3987
|
+
function xb(a,c,b,e,d,f,g){a=yb(this,a,c,b,e,d,f,g);return this.db?a.then(function(k){return d?k||[]:new X(k,this)}):a&&a.length?d?Sa.call(this,a,b,e):new X(a,this):d?[]:new X([],this)}function zb(a,c,b,e){let d=[];if(a&&a.length){if(a.length<=e){c.push(a);return}for(let f=0,g;f<e;f++)if(g=a[f])d[f]=g;if(d.length){c.push(d);return}}if(!b)return d}
|
|
3988
|
+
function yb(a,c,b,e,d,f,g,k){let h;b&&(h=a.bidirectional&&c>b)&&(h=b,b=c,c=h);if(a.db)return a.db.get(c,b,e,d,f,g,k);a=b?(a=a.ctx.get(b))&&a.get(c):a.map.get(c);return a}function T(a,c){if(!this||this.constructor!==T)return new T(a);if(a){var b=M(a)?a:a.preset;b&&(a=Object.assign({},vb[b],a));}else a={};b=a.context;const e=b===true?{depth:1}:b||{},d=M(a.encoder)?va[a.encoder]:a.encode||a.encoder||{};this.encoder=d.encode?d:typeof d==="object"?new ka(d):{encode:d};this.resolution=a.resolution||9;this.tokenize=b=(b=a.tokenize)&&b!=="default"&&b!=="exact"&&b||"strict";this.depth=b==="strict"&&e.depth||0;this.bidirectional=e.bidirectional!==false;this.fastupdate=!!a.fastupdate;
|
|
3989
|
+
this.score=a.score||null;(b=a.keystore||0)&&(this.keystore=b);this.map=b?new R(b):new Map;this.ctx=b?new R(b):new Map;this.reg=c||(this.fastupdate?b?new R(b):new Map:b?new S(b):new Set);this.N=e.resolution||3;this.rtl=d.rtl||a.rtl||false;this.cache=(b=a.cache||null)&&new ma(b);this.resolve=a.resolve!==false;if(b=a.db)this.db=this.mount(b);this.M=a.commit!==false;this.commit_task=[];this.commit_timer=null;this.priority=a.priority||4;}w=T.prototype;
|
|
3990
|
+
w.mount=function(a){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return a.mount(this)};w.commit=function(){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.commit(this)};w.destroy=function(){this.commit_timer&&(clearTimeout(this.commit_timer),this.commit_timer=null);return this.db.destroy()};function ub(a){a.commit_timer||(a.commit_timer=setTimeout(function(){a.commit_timer=null;a.db.commit(a);},1));}
|
|
3991
|
+
w.clear=function(){this.map.clear();this.ctx.clear();this.reg.clear();this.cache&&this.cache.clear();return this.db?(this.commit_timer&&clearTimeout(this.commit_timer),this.commit_timer=null,this.commit_task=[],this.db.clear()):this};w.append=function(a,c){return this.add(a,c,true)};w.contain=function(a){return this.db?this.db.has(a):this.reg.has(a)};w.update=function(a,c){const b=this,e=this.remove(a);return e&&e.then?e.then(()=>b.add(a,c)):this.add(a,c)};
|
|
3992
|
+
w.cleanup=function(){if(!this.fastupdate)return this;tb(this.map);this.depth&&tb(this.ctx);return this};w.searchCache=la;w.export=function(a,c,b=0,e=0){let d,f;switch(e){case 0:d="reg";f=pb(this.reg);break;case 1:d="cfg";f=null;break;case 2:d="map";f=lb(this.map,this.reg.size);break;case 3:d="ctx";f=nb(this.ctx,this.reg.size);break;default:return}return rb.call(this,a,c,d,f,b,e)};
|
|
3993
|
+
w.import=function(a,c){if(c)switch(typeof c==="string"&&(c=JSON.parse(c)),a=a.split("."),a[a.length-1]==="json"&&a.pop(),a.length===3&&a.shift(),a=a.length>1?a[1]:a[0],a){case "reg":this.fastupdate=false;this.reg=qb(c,this.reg);break;case "map":this.map=mb(c,this.map);break;case "ctx":this.ctx=ob(c,this.ctx);}};
|
|
3994
|
+
w.serialize=function(a=true){let c="",b="",e="";if(this.reg.size){let f;for(var d of this.reg.keys())f||(f=typeof d),c+=(c?",":"")+(f==="string"?'"'+d+'"':d);c="index.reg=new Set(["+c+"]);";b=sb(this.map,f);b="index.map=new Map(["+b+"]);";for(const g of this.ctx.entries()){d=g[0];let k=sb(g[1],f);k="new Map(["+k+"])";k='["'+d+'",'+k+"]";e+=(e?",":"")+k;}e="index.ctx=new Map(["+e+"]);";}return a?"function inject(index){"+c+b+e+"}":c+b+e};Fa(T.prototype);const Bb=typeof window!=="undefined"&&(window.indexedDB||window.mozIndexedDB||window.webkitIndexedDB||window.msIndexedDB),Cb=["map","ctx","tag","reg","cfg"],Db=I();
|
|
3995
|
+
function Eb(a,c={}){if(!this||this.constructor!==Eb)return new Eb(a,c);typeof a==="object"&&(c=a,a=a.name);a||console.info("Default storage space was used, because a name was not passed.");this.id="flexsearch"+(a?":"+a.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"");this.field=c.field?c.field.toLowerCase().replace(/[^a-z0-9_\-]/g,""):"";this.type=c.type;this.fastupdate=this.support_tag_search=false;this.db=null;this.h={};}w=Eb.prototype;w.mount=function(a){if(a.index)return a.mount(this);a.db=this;return this.open()};
|
|
3996
|
+
w.open=function(){if(this.db)return this.db;let a=this;navigator.storage&&navigator.storage.persist&&navigator.storage.persist();Db[a.id]||(Db[a.id]=[]);Db[a.id].push(a.field);const c=Bb.open(a.id,1);c.onupgradeneeded=function(){const b=a.db=this.result;for(let e=0,d;e<Cb.length;e++){d=Cb[e];for(let f=0,g;f<Db[a.id].length;f++)g=Db[a.id][f],b.objectStoreNames.contains(d+(d!=="reg"?g?":"+g:"":""))||b.createObjectStore(d+(d!=="reg"?g?":"+g:"":""));}};return a.db=Z(c,function(b){a.db=b;a.db.onversionchange=
|
|
3997
|
+
function(){a.close();};})};w.close=function(){this.db&&this.db.close();this.db=null;};w.destroy=function(){const a=Bb.deleteDatabase(this.id);return Z(a)};w.clear=function(){const a=[];for(let b=0,e;b<Cb.length;b++){e=Cb[b];for(let d=0,f;d<Db[this.id].length;d++)f=Db[this.id][d],a.push(e+(e!=="reg"?f?":"+f:"":""));}const c=this.db.transaction(a,"readwrite");for(let b=0;b<a.length;b++)c.objectStore(a[b]).clear();return Z(c)};
|
|
3998
|
+
w.get=function(a,c,b=0,e=0,d=true,f=false){a=this.db.transaction((c?"ctx":"map")+(this.field?":"+this.field:""),"readonly").objectStore((c?"ctx":"map")+(this.field?":"+this.field:"")).get(c?c+":"+a:a);const g=this;return Z(a).then(function(k){let h=[];if(!k||!k.length)return h;if(d){if(!b&&!e&&k.length===1)return k[0];for(let l=0,m;l<k.length;l++)if((m=k[l])&&m.length){if(e>=m.length){e-=m.length;continue}const p=b?e+Math.min(m.length-e,b):m.length;for(let u=e;u<p;u++)h.push(m[u]);e=0;if(h.length===b)break}return f?
|
|
3999
|
+
g.enrich(h):h}return k})};w.tag=function(a,c=0,b=0,e=false){a=this.db.transaction("tag"+(this.field?":"+this.field:""),"readonly").objectStore("tag"+(this.field?":"+this.field:"")).get(a);const d=this;return Z(a).then(function(f){if(!f||!f.length||b>=f.length)return [];if(!c&&!b)return f;f=f.slice(b,b+c);return e?d.enrich(f):f})};
|
|
4000
|
+
w.enrich=function(a){typeof a!=="object"&&(a=[a]);const c=this.db.transaction("reg","readonly").objectStore("reg"),b=[];for(let e=0;e<a.length;e++)b[e]=Z(c.get(a[e]));return Promise.all(b).then(function(e){for(let d=0;d<e.length;d++)e[d]={id:a[d],doc:e[d]?JSON.parse(e[d]):null};return e})};w.has=function(a){a=this.db.transaction("reg","readonly").objectStore("reg").getKey(a);return Z(a).then(function(c){return !!c})};w.search=null;w.info=function(){};
|
|
4001
|
+
w.transaction=function(a,c,b){a+=a!=="reg"?this.field?":"+this.field:"":"";let e=this.h[a+":"+c];if(e)return b.call(this,e);let d=this.db.transaction(a,c);this.h[a+":"+c]=e=d.objectStore(a);const f=b.call(this,e);this.h[a+":"+c]=null;return Z(d).finally(function(){return f})};
|
|
4002
|
+
w.commit=async function(a){let c=a.commit_task,b=[];a.commit_task=[];for(let e=0,d;e<c.length;e++)d=c[e],d.del&&b.push(d.del);b.length&&await this.remove(b);a.reg.size&&(await this.transaction("map","readwrite",function(e){for(const d of a.map){const f=d[0],g=d[1];g.length&&(e.get(f).onsuccess=function(){let k=this.result;var h;if(k&&k.length){const l=Math.max(k.length,g.length);for(let m=0,p,u;m<l;m++)if((u=g[m])&&u.length){if((p=k[m])&&p.length)for(h=0;h<u.length;h++)p.push(u[h]);else k[m]=u;h=
|
|
4003
|
+
1;}}else k=g,h=1;h&&e.put(k,f);});}}),await this.transaction("ctx","readwrite",function(e){for(const d of a.ctx){const f=d[0],g=d[1];for(const k of g){const h=k[0],l=k[1];l.length&&(e.get(f+":"+h).onsuccess=function(){let m=this.result;var p;if(m&&m.length){const u=Math.max(m.length,l.length);for(let r=0,t,n;r<u;r++)if((n=l[r])&&n.length){if((t=m[r])&&t.length)for(p=0;p<n.length;p++)t.push(n[p]);else m[r]=n;p=1;}}else m=l,p=1;p&&e.put(m,f+":"+h);});}}}),a.store?await this.transaction("reg","readwrite",
|
|
4004
|
+
function(e){for(const d of a.store){const f=d[0],g=d[1];e.put(typeof g==="object"?JSON.stringify(g):1,f);}}):a.bypass||await this.transaction("reg","readwrite",function(e){for(const d of a.reg.keys())e.put(1,d);}),a.tag&&await this.transaction("tag","readwrite",function(e){for(const d of a.tag){const f=d[0],g=d[1];g.length&&(e.get(f).onsuccess=function(){let k=this.result;k=k&&k.length?k.concat(g):g;e.put(k,f);});}}),a.map.clear(),a.ctx.clear(),a.tag&&a.tag.clear(),a.store&&a.store.clear(),a.document||
|
|
4005
|
+
a.reg.clear());};function Fb(a,c,b){const e=a.value;let d,f=0;for(let g=0,k;g<e.length;g++){if(k=b?e:e[g]){for(let h=0,l,m;h<c.length;h++)if(m=c[h],l=k.indexOf(m),l>=0)if(d=1,k.length>1)k.splice(l,1);else {e[g]=[];break}f+=k.length;}if(b)break}f?d&&a.update(e):a.delete();a.continue();}
|
|
4006
|
+
w.remove=function(a){typeof a!=="object"&&(a=[a]);return Promise.all([this.transaction("map","readwrite",function(c){c.openCursor().onsuccess=function(){const b=this.result;b&&Fb(b,a);};}),this.transaction("ctx","readwrite",function(c){c.openCursor().onsuccess=function(){const b=this.result;b&&Fb(b,a);};}),this.transaction("tag","readwrite",function(c){c.openCursor().onsuccess=function(){const b=this.result;b&&Fb(b,a,true);};}),this.transaction("reg","readwrite",function(c){for(let b=0;b<a.length;b++)c.delete(a[b]);})])};
|
|
4007
|
+
function Z(a,c){return new Promise((b,e)=>{a.onsuccess=a.oncomplete=function(){c&&c(this.result);c=null;b(this.result);};a.onerror=a.onblocked=e;a=null;})}const Charset=va;const Encoder=ka;const Document$1=Na;
|
|
4008
|
+
|
|
4009
|
+
function createSearchDocument() {
|
|
4010
|
+
return new Document$1({
|
|
4011
|
+
document: {
|
|
4012
|
+
id: 'id',
|
|
4013
|
+
store: true,
|
|
4014
|
+
index: [
|
|
4015
|
+
{
|
|
4016
|
+
field: 'name',
|
|
4017
|
+
tokenize: 'bidirectional',
|
|
4018
|
+
priority: 9,
|
|
4019
|
+
encoder: new Encoder(Charset.LatinBalance).assign({
|
|
4020
|
+
normalize(text) {
|
|
4021
|
+
// split the names in camel case
|
|
4022
|
+
let words = text.replace(/\d+/g, ' ').split(/(?<=[a-z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])/);
|
|
4023
|
+
if (words.length > 1) {
|
|
4024
|
+
words.push(text);
|
|
4025
|
+
}
|
|
4026
|
+
return words.join(' ').toLowerCase();
|
|
4027
|
+
},
|
|
4028
|
+
}),
|
|
4029
|
+
},
|
|
4030
|
+
{
|
|
4031
|
+
field: 'comment',
|
|
4032
|
+
tokenize: 'default',
|
|
4033
|
+
encoder: Charset.LatinSoundex,
|
|
4034
|
+
},
|
|
4035
|
+
],
|
|
4036
|
+
tag: [],
|
|
4037
|
+
},
|
|
4038
|
+
});
|
|
4039
|
+
}
|
|
4040
|
+
|
|
4041
|
+
async function loadDeflateData(url) {
|
|
4042
|
+
const response = await fetch(url);
|
|
4043
|
+
const blob = await response.blob();
|
|
4044
|
+
const stream = blob.stream().pipeThrough(new DecompressionStream('deflate'));
|
|
4045
|
+
return await new Response(stream).json();
|
|
4046
|
+
}
|
|
4047
|
+
async function loadSearchIndex() {
|
|
4048
|
+
const index = createSearchDocument();
|
|
4049
|
+
const base = `${document.documentElement.dataset.base}assets/oxide`;
|
|
4050
|
+
const parts = await loadDeflateData(`${base}/search-index.deflate`);
|
|
4051
|
+
for (const [key, data] of Object.entries(parts)) {
|
|
4052
|
+
index.import(key, data);
|
|
4053
|
+
}
|
|
4054
|
+
return index;
|
|
4055
|
+
}
|
|
4056
|
+
function getReflectionKindName(kind) {
|
|
4057
|
+
return ReflectionKind.classString(kind)
|
|
4058
|
+
.replace('tsd-kind-', '')
|
|
4059
|
+
.replace('-', ' ');
|
|
4060
|
+
}
|
|
4061
|
+
|
|
4062
|
+
document.addEventListener('DOMContentLoaded', async () => {
|
|
4063
|
+
const form = document.querySelector('rustdoc-search .search-form');
|
|
4064
|
+
const input = document.querySelector('rustdoc-search .search-input');
|
|
4065
|
+
const main = document.getElementById('main-content');
|
|
4066
|
+
const alt = document.getElementById('alternative-display');
|
|
4067
|
+
// suppress the errors from stock rustdoc search
|
|
4068
|
+
form.addEventListener('submit', (event) => {
|
|
4069
|
+
event.preventDefault();
|
|
4070
|
+
event.stopImmediatePropagation();
|
|
4071
|
+
event.stopPropagation();
|
|
4072
|
+
}, true);
|
|
4073
|
+
input.addEventListener('focus', (event) => {
|
|
4074
|
+
event.stopImmediatePropagation();
|
|
4075
|
+
event.stopPropagation();
|
|
4076
|
+
}, true);
|
|
4077
|
+
let index;
|
|
4078
|
+
let abort;
|
|
4079
|
+
input.addEventListener('input', throttle(async (event) => {
|
|
4080
|
+
if (!index) {
|
|
4081
|
+
index = loadSearchIndex();
|
|
4082
|
+
}
|
|
4083
|
+
const query = event.target.value?.trim();
|
|
4084
|
+
const [hide, show] = query ? [main, alt] : [alt, main];
|
|
4085
|
+
hide.classList.add('hidden');
|
|
4086
|
+
show.classList.remove('hidden');
|
|
4087
|
+
abort?.abort();
|
|
4088
|
+
abort = new AbortController();
|
|
4089
|
+
await performSearch(query, abort.signal, await index);
|
|
4090
|
+
}, 300));
|
|
4091
|
+
});
|
|
4092
|
+
async function performSearch(query, signal, index) {
|
|
4093
|
+
if (signal.aborted || !query.length) {
|
|
4094
|
+
return;
|
|
4095
|
+
}
|
|
4096
|
+
const items = await index.search({ query, enrich: true, merge: true });
|
|
4097
|
+
if (signal.aborted) {
|
|
4098
|
+
return;
|
|
4099
|
+
}
|
|
4100
|
+
const vars = document.querySelector('meta[name="rustdoc-vars"]');
|
|
4101
|
+
const results = document.querySelector('oxide-search-results#search');
|
|
4102
|
+
results.loading = false;
|
|
4103
|
+
results.project = vars.dataset.currentCrate;
|
|
4104
|
+
results.query = query;
|
|
4105
|
+
results.items = items.map((x) => x.doc).filter((x) => x !== null && x !== undefined);
|
|
4106
|
+
}
|
|
4107
|
+
(() => {
|
|
4108
|
+
let _classDecorators = [t('oxide-search-results')];
|
|
4109
|
+
let _classDescriptor;
|
|
4110
|
+
let _classExtraInitializers = [];
|
|
4111
|
+
let _classThis;
|
|
4112
|
+
let _classSuper = i;
|
|
4113
|
+
let _loading_decorators;
|
|
4114
|
+
let _loading_initializers = [];
|
|
4115
|
+
let _loading_extraInitializers = [];
|
|
4116
|
+
let _project_decorators;
|
|
4117
|
+
let _project_initializers = [];
|
|
4118
|
+
let _project_extraInitializers = [];
|
|
4119
|
+
let _query_decorators;
|
|
4120
|
+
let _query_initializers = [];
|
|
4121
|
+
let _query_extraInitializers = [];
|
|
4122
|
+
let _items_decorators;
|
|
4123
|
+
let _items_initializers = [];
|
|
4124
|
+
let _items_extraInitializers = [];
|
|
4125
|
+
var OxideSearchResults = class extends _classSuper {
|
|
4126
|
+
static { _classThis = this; }
|
|
4127
|
+
static {
|
|
4128
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
4129
|
+
_loading_decorators = [n({ attribute: false })];
|
|
4130
|
+
_project_decorators = [n({ attribute: false })];
|
|
4131
|
+
_query_decorators = [n({ attribute: false })];
|
|
4132
|
+
_items_decorators = [n({ attribute: false })];
|
|
4133
|
+
__esDecorate$4(this, null, _loading_decorators, { kind: "accessor", name: "loading", static: false, private: false, access: { has: obj => "loading" in obj, get: obj => obj.loading, set: (obj, value) => { obj.loading = value; } }, metadata: _metadata }, _loading_initializers, _loading_extraInitializers);
|
|
4134
|
+
__esDecorate$4(this, null, _project_decorators, { kind: "accessor", name: "project", static: false, private: false, access: { has: obj => "project" in obj, get: obj => obj.project, set: (obj, value) => { obj.project = value; } }, metadata: _metadata }, _project_initializers, _project_extraInitializers);
|
|
4135
|
+
__esDecorate$4(this, null, _query_decorators, { kind: "accessor", name: "query", static: false, private: false, access: { has: obj => "query" in obj, get: obj => obj.query, set: (obj, value) => { obj.query = value; } }, metadata: _metadata }, _query_initializers, _query_extraInitializers);
|
|
4136
|
+
__esDecorate$4(this, null, _items_decorators, { kind: "accessor", name: "items", static: false, private: false, access: { has: obj => "items" in obj, get: obj => obj.items, set: (obj, value) => { obj.items = value; } }, metadata: _metadata }, _items_initializers, _items_extraInitializers);
|
|
4137
|
+
__esDecorate$4(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
4138
|
+
OxideSearchResults = _classThis = _classDescriptor.value;
|
|
4139
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
4140
|
+
}
|
|
4141
|
+
static base = document.documentElement.dataset.base;
|
|
4142
|
+
static classes = {
|
|
4143
|
+
[ReflectionKind.ClassMember]: 'fn',
|
|
4144
|
+
[ReflectionKind.Function]: 'fn',
|
|
4145
|
+
[ReflectionKind.Property]: 'fn',
|
|
4146
|
+
[ReflectionKind.Method]: 'fn',
|
|
4147
|
+
[ReflectionKind.CallSignature]: 'fn',
|
|
4148
|
+
[ReflectionKind.IndexSignature]: 'fn',
|
|
4149
|
+
[ReflectionKind.GetSignature]: 'fn',
|
|
4150
|
+
[ReflectionKind.SetSignature]: 'fn',
|
|
4151
|
+
[ReflectionKind.Accessor]: 'fn',
|
|
4152
|
+
[ReflectionKind.ConstructorSignature]: 'primitive',
|
|
4153
|
+
[ReflectionKind.Constructor]: 'primitive',
|
|
4154
|
+
[ReflectionKind.EnumMember]: 'macro',
|
|
4155
|
+
[ReflectionKind.Variable]: 'macro',
|
|
4156
|
+
};
|
|
4157
|
+
#loading_accessor_storage = __runInitializers$4(this, _loading_initializers, true);
|
|
4158
|
+
get loading() { return this.#loading_accessor_storage; }
|
|
4159
|
+
set loading(value) { this.#loading_accessor_storage = value; }
|
|
4160
|
+
#project_accessor_storage = (__runInitializers$4(this, _loading_extraInitializers), __runInitializers$4(this, _project_initializers, ''));
|
|
4161
|
+
get project() { return this.#project_accessor_storage; }
|
|
4162
|
+
set project(value) { this.#project_accessor_storage = value; }
|
|
4163
|
+
#query_accessor_storage = (__runInitializers$4(this, _project_extraInitializers), __runInitializers$4(this, _query_initializers, ''));
|
|
4164
|
+
get query() { return this.#query_accessor_storage; }
|
|
4165
|
+
set query(value) { this.#query_accessor_storage = value; }
|
|
4166
|
+
#items_accessor_storage = (__runInitializers$4(this, _query_extraInitializers), __runInitializers$4(this, _items_initializers, []));
|
|
4167
|
+
get items() { return this.#items_accessor_storage; }
|
|
4168
|
+
set items(value) { this.#items_accessor_storage = value; }
|
|
4169
|
+
createRenderRoot() {
|
|
4170
|
+
// Disable Shadow DOM.
|
|
4171
|
+
return this;
|
|
4172
|
+
}
|
|
4173
|
+
render() {
|
|
4174
|
+
if (this.loading) {
|
|
4175
|
+
return x `
|
|
48
4176
|
<h3 class="search-loading">Loading search results...</h3>
|
|
49
|
-
`;
|
|
50
|
-
|
|
4177
|
+
`;
|
|
4178
|
+
}
|
|
4179
|
+
const items = this.items.map((item) => {
|
|
4180
|
+
const classname = OxideSearchResults.classes[item.kind] ?? 'mod';
|
|
4181
|
+
const trace = o(item.parent?.split('.').filter((x) => x) ?? [], (name) => x `<span class="parent">${name}.</span>`);
|
|
4182
|
+
return x `
|
|
4183
|
+
<a class="result-item" href="${OxideSearchResults.base}${item.url}">
|
|
51
4184
|
<span class="result-name">
|
|
52
4185
|
<span class="typename">
|
|
53
|
-
${
|
|
4186
|
+
${getReflectionKindName(item.kind)}
|
|
54
4187
|
</span>
|
|
55
4188
|
|
|
56
4189
|
<div class="path">
|
|
57
|
-
${
|
|
4190
|
+
${trace}<span class="${classname}">${item.name}</span>
|
|
58
4191
|
</div>
|
|
59
4192
|
</span>
|
|
60
4193
|
</a>
|
|
61
|
-
`;
|
|
4194
|
+
`;
|
|
4195
|
+
});
|
|
4196
|
+
const ddgQuery = encodeURIComponent(`${this.project} ${this.query}`);
|
|
4197
|
+
return x `
|
|
62
4198
|
<div class="main-heading">
|
|
63
4199
|
<h1 class="search-results-title">Results</h1>
|
|
64
4200
|
</div>
|
|
65
4201
|
|
|
66
4202
|
<div id="results">
|
|
67
|
-
<div class="search-results ${this.items.length?
|
|
68
|
-
${
|
|
4203
|
+
<div class="search-results ${this.items.length ? 'active' : ''}">
|
|
4204
|
+
${items}
|
|
69
4205
|
</div>
|
|
70
4206
|
|
|
71
|
-
<div class="search-failed ${this.items.length?
|
|
4207
|
+
<div class="search-failed ${this.items.length ? '' : 'active'}">
|
|
72
4208
|
No results :(
|
|
73
4209
|
<br />
|
|
74
|
-
Try on <a href="https://duckduckgo.com/?q=${
|
|
4210
|
+
Try on <a href="https://duckduckgo.com/?q=${ddgQuery}" target="_blank">DuckDuckGo</a>?
|
|
75
4211
|
</div>
|
|
76
4212
|
</div>
|
|
77
|
-
|
|
4213
|
+
`;
|
|
4214
|
+
}
|
|
4215
|
+
constructor() {
|
|
4216
|
+
super(...arguments);
|
|
4217
|
+
__runInitializers$4(this, _items_extraInitializers);
|
|
4218
|
+
}
|
|
4219
|
+
static {
|
|
4220
|
+
__runInitializers$4(_classThis, _classExtraInitializers);
|
|
4221
|
+
}
|
|
4222
|
+
};
|
|
4223
|
+
return OxideSearchResults = _classThis;
|
|
4224
|
+
})();
|
|
4225
|
+
|
|
4226
|
+
})();
|
|
78
4227
|
//# sourceMappingURL=index.js.map
|