rapidoc 10.0.1 → 10.1.0
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/rapidoc-min.js +142 -141
- package/package.json +6 -4
package/dist/rapidoc-min.js
CHANGED
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* @license
|
|
3
|
-
* rapidoc v10.
|
|
3
|
+
* rapidoc v10.1.0
|
|
4
4
|
* (c) 2026 Mrinmoy Majumdar <mrin9@yahoo.com>
|
|
5
5
|
* SPDX-License-Identifier: MIT
|
|
6
6
|
*/
|
|
7
|
-
var
|
|
7
|
+
var ji=Object.defineProperty,qi=(n,e,t)=>e in n?ji(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,j=(n,e,t)=>qi(n,typeof e!="symbol"?e+"":e,t);/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2019 Google LLC
|
|
10
10
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
11
|
-
*/const
|
|
11
|
+
*/const zt=globalThis,In=zt.ShadowRoot&&(zt.ShadyCSS===void 0||zt.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,jn=Symbol(),Qa=new WeakMap;let er=class{constructor(n,e,t){if(this._$cssResult$=!0,t!==jn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=n,this.t=e}get styleSheet(){let n=this.o;const e=this.t;if(In&&n===void 0){const t=e!==void 0&&e.length===1;t&&(n=Qa.get(e)),n===void 0&&((this.o=n=new CSSStyleSheet).replaceSync(this.cssText),t&&Qa.set(e,n))}return n}toString(){return this.cssText}};const tr=n=>new er(typeof n=="string"?n:n+"",void 0,jn),U=(n,...e)=>{const t=n.length===1?n[0]:e.reduce(((a,r,s)=>a+(i=>{if(i._$cssResult$===!0)return i.cssText;if(typeof i=="number")return i;throw Error("Value passed to 'css' function must be a 'css' function result: "+i+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+n[s+1]),n[0]);return new er(t,n,jn)},zi=(n,e)=>{if(In)n.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const t of e){const a=document.createElement("style"),r=zt.litNonce;r!==void 0&&a.setAttribute("nonce",r),a.textContent=t.cssText,n.appendChild(a)}},nr=In?n=>n:n=>n instanceof CSSStyleSheet?(e=>{let t="";for(const a of e.cssRules)t+=a.cssText;return tr(t)})(n):n;/**
|
|
12
12
|
* @license
|
|
13
13
|
* Copyright 2017 Google LLC
|
|
14
14
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
15
|
-
*/const{is:
|
|
15
|
+
*/const{is:Pi,defineProperty:Ui,getOwnPropertyDescriptor:Mi,getOwnPropertyNames:Hi,getOwnPropertySymbols:Wi,getPrototypeOf:Ki}=Object,Me=globalThis,ar=Me.trustedTypes,Vi=ar?ar.emptyScript:"",rr=Me.reactiveElementPolyfillSupport,pt=(n,e)=>n,qn={toAttribute(n,e){switch(e){case Boolean:n=n?Vi:null;break;case Object:case Array:n=n==null?n:JSON.stringify(n)}return n},fromAttribute(n,e){let t=n;switch(e){case Boolean:t=n!==null;break;case Number:t=n===null?null:Number(n);break;case Object:case Array:try{t=JSON.parse(n)}catch{t=null}}return t}},sr=(n,e)=>!Pi(n,e),ir={attribute:!0,type:String,converter:qn,reflect:!1,hasChanged:sr};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),Me.litPropertyMetadata??(Me.litPropertyMetadata=new WeakMap);class He extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??(this.l=[])).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ir){if(t.state&&(t.attribute=!1),this._$Ei(),this.elementProperties.set(e,t),!t.noAccessor){const a=Symbol(),r=this.getPropertyDescriptor(e,a,t);r!==void 0&&Ui(this.prototype,e,r)}}static getPropertyDescriptor(e,t,a){const{get:r,set:s}=Mi(this.prototype,e)??{get(){return this[t]},set(i){this[t]=i}};return{get(){return r?.call(this)},set(i){const o=r?.call(this);s.call(this,i),this.requestUpdate(e,o,a)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ir}static _$Ei(){if(this.hasOwnProperty(pt("elementProperties")))return;const e=Ki(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(pt("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(pt("properties"))){const t=this.properties,a=[...Hi(t),...Wi(t)];for(const r of a)this.createProperty(r,t[r])}const e=this[Symbol.metadata];if(e!==null){const t=litPropertyMetadata.get(e);if(t!==void 0)for(const[a,r]of t)this.elementProperties.set(a,r)}this._$Eh=new Map;for(const[t,a]of this.elementProperties){const r=this._$Eu(t,a);r!==void 0&&this._$Eh.set(r,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){const t=[];if(Array.isArray(e)){const a=new Set(e.flat(1/0).reverse());for(const r of a)t.unshift(nr(r))}else e!==void 0&&t.push(nr(e));return t}static _$Eu(e,t){const a=t.attribute;return a===!1?void 0:typeof a=="string"?a:typeof e=="string"?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var e;this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),(e=this.constructor.l)==null||e.forEach((t=>t(this)))}addController(e){var t;(this._$EO??(this._$EO=new Set)).add(e),this.renderRoot!==void 0&&this.isConnected&&((t=e.hostConnected)==null||t.call(e))}removeController(e){var t;(t=this._$EO)==null||t.delete(e)}_$E_(){const e=new Map,t=this.constructor.elementProperties;for(const a of t.keys())this.hasOwnProperty(a)&&(e.set(a,this[a]),delete this[a]);e.size>0&&(this._$Ep=e)}createRenderRoot(){const e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return zi(e,this.constructor.elementStyles),e}connectedCallback(){var e;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(e=this._$EO)==null||e.forEach((t=>{var a;return(a=t.hostConnected)==null?void 0:a.call(t)}))}enableUpdating(e){}disconnectedCallback(){var e;(e=this._$EO)==null||e.forEach((t=>{var a;return(a=t.hostDisconnected)==null?void 0:a.call(t)}))}attributeChangedCallback(e,t,a){this._$AK(e,a)}_$EC(e,t){var a;const r=this.constructor.elementProperties.get(e),s=this.constructor._$Eu(e,r);if(s!==void 0&&r.reflect===!0){const i=(((a=r.converter)==null?void 0:a.toAttribute)!==void 0?r.converter:qn).toAttribute(t,r.type);this._$Em=e,i==null?this.removeAttribute(s):this.setAttribute(s,i),this._$Em=null}}_$AK(e,t){var a;const r=this.constructor,s=r._$Eh.get(e);if(s!==void 0&&this._$Em!==s){const i=r.getPropertyOptions(s),o=typeof i.converter=="function"?{fromAttribute:i.converter}:((a=i.converter)==null?void 0:a.fromAttribute)!==void 0?i.converter:qn;this._$Em=s,this[s]=o.fromAttribute(t,i.type),this._$Em=null}}requestUpdate(e,t,a){if(e!==void 0){if(a??(a=this.constructor.getPropertyOptions(e)),!(a.hasChanged??sr)(this[e],t))return;this.P(e,t,a)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(e,t,a){this._$AL.has(e)||this._$AL.set(e,t),a.reflect===!0&&this._$Em!==e&&(this._$Ej??(this._$Ej=new Set)).add(e)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[s,i]of this._$Ep)this[s]=i;this._$Ep=void 0}const r=this.constructor.elementProperties;if(r.size>0)for(const[s,i]of r)i.wrapped!==!0||this._$AL.has(s)||this[s]===void 0||this.P(s,this[s],i)}let t=!1;const a=this._$AL;try{t=this.shouldUpdate(a),t?(this.willUpdate(a),(e=this._$EO)==null||e.forEach((r=>{var s;return(s=r.hostUpdate)==null?void 0:s.call(r)})),this.update(a)):this._$EU()}catch(r){throw t=!1,this._$EU(),r}t&&this._$AE(a)}willUpdate(e){}_$AE(e){var t;(t=this._$EO)==null||t.forEach((a=>{var r;return(r=a.hostUpdated)==null?void 0:r.call(a)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Ej&&(this._$Ej=this._$Ej.forEach((t=>this._$EC(t,this[t])))),this._$EU()}updated(e){}firstUpdated(e){}}He.elementStyles=[],He.shadowRootOptions={mode:"open"},He[pt("elementProperties")]=new Map,He[pt("finalized")]=new Map,rr?.({ReactiveElement:He}),(Me.reactiveElementVersions??(Me.reactiveElementVersions=[])).push("2.0.4");/**
|
|
16
16
|
* @license
|
|
17
17
|
* Copyright 2017 Google LLC
|
|
18
18
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
19
|
-
*/const
|
|
20
|
-
\f\r]`,
|
|
21
|
-
\f\r"'\`<>=]|("|')|))|$)`,"g"),
|
|
19
|
+
*/const Pt=globalThis,Ut=Pt.trustedTypes,or=Ut?Ut.createPolicy("lit-html",{createHTML:n=>n}):void 0,lr="$lit$",ve=`lit$${Math.random().toFixed(9).slice(2)}$`,cr="?"+ve,Zi=`<${cr}>`,Se=document,ut=()=>Se.createComment(""),ht=n=>n===null||typeof n!="object"&&typeof n!="function",zn=Array.isArray,Ji=n=>zn(n)||typeof n?.[Symbol.iterator]=="function",Pn=`[
|
|
20
|
+
\f\r]`,mt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,dr=/-->/g,pr=/>/g,Ee=RegExp(`>|${Pn}(?:([^\\s"'>=/]+)(${Pn}*=${Pn}*(?:[^
|
|
21
|
+
\f\r"'\`<>=]|("|')|))|$)`,"g"),ur=/'/g,hr=/"/g,mr=/^(?:script|style|textarea|title)$/i,Gi=n=>(e,...t)=>({_$litType$:n,strings:e,values:t}),u=Gi(1),Q=Symbol.for("lit-noChange"),P=Symbol.for("lit-nothing"),fr=new WeakMap,Ae=Se.createTreeWalker(Se,129);function gr(n,e){if(!zn(n)||!n.hasOwnProperty("raw"))throw Error("invalid template strings array");return or!==void 0?or.createHTML(e):e}const Xi=(n,e)=>{const t=n.length-1,a=[];let r,s=e===2?"<svg>":e===3?"<math>":"",i=mt;for(let o=0;o<t;o++){const l=n[o];let c,d,p=-1,h=0;for(;h<l.length&&(i.lastIndex=h,d=i.exec(l),d!==null);)h=i.lastIndex,i===mt?d[1]==="!--"?i=dr:d[1]!==void 0?i=pr:d[2]!==void 0?(mr.test(d[2])&&(r=RegExp("</"+d[2],"g")),i=Ee):d[3]!==void 0&&(i=Ee):i===Ee?d[0]===">"?(i=r??mt,p=-1):d[1]===void 0?p=-2:(p=i.lastIndex-d[2].length,c=d[1],i=d[3]===void 0?Ee:d[3]==='"'?hr:ur):i===hr||i===ur?i=Ee:i===dr||i===pr?i=mt:(i=Ee,r=void 0);const m=i===Ee&&n[o+1].startsWith("/>")?" ":"";s+=i===mt?l+Zi:p>=0?(a.push(c),l.slice(0,p)+lr+l.slice(p)+ve+m):l+ve+(p===-2?o:m)}return[gr(n,s+(n[t]||"<?>")+(e===2?"</svg>":e===3?"</math>":"")),a]};class jt{constructor({strings:e,_$litType$:t},a){let r;this.parts=[];let s=0,i=0;const o=e.length-1,l=this.parts,[c,d]=Xi(e,t);if(this.el=jt.createElement(c,a),Ae.currentNode=this.el.content,t===2||t===3){const p=this.el.content.firstChild;p.replaceWith(...p.childNodes)}for(;(r=Ae.nextNode())!==null&&l.length<o;){if(r.nodeType===1){if(r.hasAttributes())for(const p of r.getAttributeNames())if(p.endsWith(lr)){const h=d[i++],m=r.getAttribute(p).split(ve),y=/([.?@])?(.*)/.exec(h);l.push({type:1,index:s,name:y[2],strings:m,ctor:y[1]==="."?Qi:y[1]==="?"?eo:y[1]==="@"?to:Mt}),r.removeAttribute(p)}else p.startsWith(ve)&&(l.push({type:6,index:s}),r.removeAttribute(p));if(mr.test(r.tagName)){const p=r.textContent.split(ve),h=p.length-1;if(h>0){r.textContent=Ut?Ut.emptyScript:"";for(let m=0;m<h;m++)r.append(p[m],ut()),Ae.nextNode(),l.push({type:2,index:++s});r.append(p[h],ut())}}}else if(r.nodeType===8)if(r.data===cr)l.push({type:2,index:s});else{let p=-1;for(;(p=r.data.indexOf(ve,p+1))!==-1;)l.push({type:7,index:s}),p+=ve.length-1}s++}}static createElement(e,t){const a=Se.createElement("template");return a.innerHTML=e,a}}function We(n,e,t=n,a){var r,s;if(e===Q)return e;let i=a!==void 0?(r=t.o)==null?void 0:r[a]:t.l;const o=ht(e)?void 0:e._$litDirective$;return i?.constructor!==o&&((s=i?._$AO)==null||s.call(i,!1),o===void 0?i=void 0:(i=new o(n),i._$AT(n,t,a)),a!==void 0?(t.o??(t.o=[]))[a]=i:t.l=i),i!==void 0&&(e=We(n,i._$AS(n,e.values),i,a)),e}class Yi{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){const{el:{content:t},parts:a}=this._$AD,r=(e?.creationScope??Se).importNode(t,!0);Ae.currentNode=r;let s=Ae.nextNode(),i=0,o=0,l=a[0];for(;l!==void 0;){if(i===l.index){let c;l.type===2?c=new qt(s,s.nextSibling,this,e):l.type===1?c=new l.ctor(s,l.name,l.strings,this,e):l.type===6&&(c=new no(s,this,e)),this._$AV.push(c),l=a[++o]}i!==l?.index&&(s=Ae.nextNode(),i++)}return Ae.currentNode=Se,r}p(e){let t=0;for(const a of this._$AV)a!==void 0&&(a.strings!==void 0?(a._$AI(e,a,t),t+=a.strings.length-2):a._$AI(e[t])),t++}}class qt{get _$AU(){var e;return((e=this._$AM)==null?void 0:e._$AU)??this.v}constructor(e,t,a,r){this.type=2,this._$AH=P,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=a,this.options=r,this.v=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode;const t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=We(this,e,t),ht(e)?e===P||e==null||e===""?(this._$AH!==P&&this._$AR(),this._$AH=P):e!==this._$AH&&e!==Q&&this._(e):e._$litType$!==void 0?this.$(e):e.nodeType!==void 0?this.T(e):Ji(e)?this.k(e):this._(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==P&&ht(this._$AH)?this._$AA.nextSibling.data=e:this.T(Se.createTextNode(e)),this._$AH=e}$(e){var t;const{values:a,_$litType$:r}=e,s=typeof r=="number"?this._$AC(e):(r.el===void 0&&(r.el=jt.createElement(gr(r.h,r.h[0]),this.options)),r);if(((t=this._$AH)==null?void 0:t._$AD)===s)this._$AH.p(a);else{const i=new Yi(s,this),o=i.u(this.options);i.p(a),this.T(o),this._$AH=i}}_$AC(e){let t=fr.get(e.strings);return t===void 0&&fr.set(e.strings,t=new jt(e)),t}k(e){zn(this._$AH)||(this._$AH=[],this._$AR());const t=this._$AH;let a,r=0;for(const s of e)r===t.length?t.push(a=new qt(this.O(ut()),this.O(ut()),this,this.options)):a=t[r],a._$AI(s),r++;r<t.length&&(this._$AR(a&&a._$AB.nextSibling,r),t.length=r)}_$AR(e=this._$AA.nextSibling,t){var a;for((a=this._$AP)==null?void 0:a.call(this,!1,!0,t);e&&e!==this._$AB;){const r=e.nextSibling;e.remove(),e=r}}setConnected(e){var t;this._$AM===void 0&&(this.v=e,(t=this._$AP)==null||t.call(this,e))}}class Mt{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,a,r,s){this.type=1,this._$AH=P,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=s,a.length>2||a[0]!==""||a[1]!==""?(this._$AH=Array(a.length-1).fill(new String),this.strings=a):this._$AH=P}_$AI(e,t=this,a,r){const s=this.strings;let i=!1;if(s===void 0)e=We(this,e,t,0),i=!ht(e)||e!==this._$AH&&e!==Q,i&&(this._$AH=e);else{const o=e;let l,c;for(e=s[0],l=0;l<s.length-1;l++)c=We(this,o[a+l],t,l),c===Q&&(c=this._$AH[l]),i||(i=!ht(c)||c!==this._$AH[l]),c===P?e=P:e!==P&&(e+=(c??"")+s[l+1]),this._$AH[l]=c}i&&!r&&this.j(e)}j(e){e===P?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??"")}}class Qi extends Mt{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===P?void 0:e}}class eo extends Mt{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==P)}}class to extends Mt{constructor(e,t,a,r,s){super(e,t,a,r,s),this.type=5}_$AI(e,t=this){if((e=We(this,e,t,0)??P)===Q)return;const a=this._$AH,r=e===P&&a!==P||e.capture!==a.capture||e.once!==a.once||e.passive!==a.passive,s=e!==P&&(a===P||r);r&&this.element.removeEventListener(this.name,this,a),s&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){var t;typeof this._$AH=="function"?this._$AH.call(((t=this.options)==null?void 0:t.host)??this.element,e):this._$AH.handleEvent(e)}}class no{constructor(e,t,a){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=a}get _$AU(){return this._$AM._$AU}_$AI(e){We(this,e)}}const yr=Pt.litHtmlPolyfillSupport;yr?.(jt,qt),(Pt.litHtmlVersions??(Pt.litHtmlVersions=[])).push("3.2.0");const ao=(n,e,t)=>{const a=t?.renderBefore??e;let r=a._$litPart$;if(r===void 0){const s=t?.renderBefore??null;a._$litPart$=r=new qt(e.insertBefore(ut(),s),s,void 0,t??{})}return r._$AI(n),r};/**
|
|
22
22
|
* @license
|
|
23
23
|
* Copyright 2017 Google LLC
|
|
24
24
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
25
|
-
*/class
|
|
26
|
-
]`).replace("lheading"
|
|
25
|
+
*/class ee extends He{constructor(){super(...arguments),this.renderOptions={host:this},this.o=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this.o=ao(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this.o)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this.o)==null||e.setConnected(!1)}render(){return Q}}var br;ee._$litElement$=!0,ee.finalized=!0,(br=globalThis.litElementHydrateSupport)==null||br.call(globalThis,{LitElement:ee});const vr=globalThis.litElementPolyfillSupport;vr?.({LitElement:ee}),(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.1.0");function Un(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}let De=Un();function xr(n){De=n}const ft={exec:()=>null};function L(n,e=""){let t=typeof n=="string"?n:n.source;const a={replace:(r,s)=>{let i=typeof s=="string"?s:s.source;return i=i.replace(J.caret,"$1"),t=t.replace(r,i),a},getRegex:()=>new RegExp(t,e)};return a}const J={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:n=>new RegExp(`^( {0,3}${n})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}#`),htmlBeginRegex:n=>new RegExp(`^ {0,${Math.min(3,n-1)}}<(?:[a-z].*>|!--)`,"i")},ro=/^(?:[ \t]*(?:\n|$))+/,so=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,io=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,gt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,oo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,wr=/(?:[*+-]|\d{1,9}[.)])/,$r=L(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g,wr).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).getRegex(),Mn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,lo=/^[^\n]+/,Hn=/(?!\s*\])(?:\\.|[^\[\]\\])+/,co=L(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Hn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),po=L(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,wr).getRegex(),Ht="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Wn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,uo=L("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Wn).replace("tag",Ht).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),kr=L(Mn).replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ht).getRegex(),ho=L(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",kr).getRegex(),Kn={blockquote:ho,code:so,def:co,fences:io,heading:oo,hr:gt,html:uo,lheading:$r,list:po,newline:ro,paragraph:kr,table:ft,text:lo},Sr=L("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ht).getRegex(),mo={...Kn,table:Sr,paragraph:L(Mn).replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Sr).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ht).getRegex()},fo={...Kn,html:L(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Wn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:ft,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:L(Mn).replace("hr",gt).replace("heading",` *#{1,6} *[^
|
|
26
|
+
]`).replace("lheading",$r).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},go=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,yo=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Er=/^( {2,}|\\)\n(?!\s*$)/,bo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Wt=/[\p{P}\p{S}]/u,Vn=/[\s\p{P}\p{S}]/u,Ar=/[^\s\p{P}\p{S}]/u,vo=L(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Vn).getRegex(),Dr=/(?!~)[\p{P}\p{S}]/u,xo=/(?!~)[\s\p{P}\p{S}]/u,wo=/(?:[^\s\p{P}\p{S}]|~)/u,$o=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,Cr=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ko=L(Cr,"u").replace(/punct/g,Wt).getRegex(),So=L(Cr,"u").replace(/punct/g,Dr).getRegex(),Fr="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Eo=L(Fr,"gu").replace(/notPunctSpace/g,Ar).replace(/punctSpace/g,Vn).replace(/punct/g,Wt).getRegex(),Ao=L(Fr,"gu").replace(/notPunctSpace/g,wo).replace(/punctSpace/g,xo).replace(/punct/g,Dr).getRegex(),Do=L("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Ar).replace(/punctSpace/g,Vn).replace(/punct/g,Wt).getRegex(),Co=L(/\\(punct)/,"gu").replace(/punct/g,Wt).getRegex(),Fo=L(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),To=L(Wn).replace("(?:-->|$)","-->").getRegex(),Oo=L("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",To).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kt=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,No=L(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label",Kt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Tr=L(/^!?\[(label)\]\[(ref)\]/).replace("label",Kt).replace("ref",Hn).getRegex(),Or=L(/^!?\[(ref)\](?:\[\])?/).replace("ref",Hn).getRegex(),Bo=L("reflink|nolink(?!\\()","g").replace("reflink",Tr).replace("nolink",Or).getRegex(),Zn={_backpedal:ft,anyPunctuation:Co,autolink:Fo,blockSkip:$o,br:Er,code:yo,del:ft,emStrongLDelim:ko,emStrongRDelimAst:Eo,emStrongRDelimUnd:Do,escape:go,link:No,nolink:Or,punctuation:vo,reflink:Tr,reflinkSearch:Bo,tag:Oo,text:bo,url:ft},Lo={...Zn,link:L(/^!?\[(label)\]\((.*?)\)/).replace("label",Kt).getRegex(),reflink:L(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kt).getRegex()},Jn={...Zn,emStrongRDelimAst:Ao,emStrongLDelim:So,url:L(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},_o={...Jn,br:L(Er).replace("{2,}","*").getRegex(),text:L(Jn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Vt={normal:Kn,gfm:mo,pedantic:fo},yt={normal:Zn,gfm:Jn,breaks:_o,pedantic:Lo},Ro={"&":"&","<":"<",">":">",'"':""","'":"'"},Nr=n=>Ro[n];function he(n,e){if(e){if(J.escapeTest.test(n))return n.replace(J.escapeReplace,Nr)}else if(J.escapeTestNoEncode.test(n))return n.replace(J.escapeReplaceNoEncode,Nr);return n}function Br(n){try{n=encodeURI(n).replace(J.percentDecode,"%")}catch{return null}return n}function Lr(n,e){var t;const a=n.replace(J.findPipe,(i,o,l)=>{let c=!1,d=o;for(;--d>=0&&l[d]==="\\";)c=!c;return c?"|":" |"}),r=a.split(J.splitPipe);let s=0;if(r[0].trim()||r.shift(),r.length>0&&!((t=r.at(-1))!=null&&t.trim())&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;s<r.length;s++)r[s]=r[s].trim().replace(J.slashPipe,"|");return r}function bt(n,e,t){const a=n.length;if(a===0)return"";let r=0;for(;r<a&&n.charAt(a-r-1)===e;)r++;return n.slice(0,a-r)}function Io(n,e){if(n.indexOf(e[1])===-1)return-1;let t=0;for(let a=0;a<n.length;a++)if(n[a]==="\\")a++;else if(n[a]===e[0])t++;else if(n[a]===e[1]&&(t--,t<0))return a;return-1}function _r(n,e,t,a,r){const s=e.href,i=e.title||null,o=n[1].replace(r.other.outputLinkReplace,"$1");if(n[0].charAt(0)!=="!"){a.state.inLink=!0;const l={type:"link",raw:t,href:s,title:i,text:o,tokens:a.inlineTokens(o)};return a.state.inLink=!1,l}return{type:"image",raw:t,href:s,title:i,text:o}}function jo(n,e,t){const a=n.match(t.other.indentCodeCompensation);if(a===null)return e;const r=a[1];return e.split(`
|
|
27
27
|
`).map(s=>{const i=s.match(t.other.beginningSpace);if(i===null)return s;const[o]=i;return o.length>=r.length?s.slice(r.length):s}).join(`
|
|
28
|
-
`)}class
|
|
29
|
-
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const a=t[0],r=
|
|
30
|
-
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let a=
|
|
28
|
+
`)}class Zt{constructor(e){j(this,"options"),j(this,"rules"),j(this,"lexer"),this.options=e||De}space(e){const t=this.rules.block.newline.exec(e);if(t&&t[0].length>0)return{type:"space",raw:t[0]}}code(e){const t=this.rules.block.code.exec(e);if(t){const a=t[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:t[0],codeBlockStyle:"indented",text:this.options.pedantic?a:bt(a,`
|
|
29
|
+
`)}}}fences(e){const t=this.rules.block.fences.exec(e);if(t){const a=t[0],r=jo(a,t[3]||"",this.rules);return{type:"code",raw:a,lang:t[2]?t[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):t[2],text:r}}}heading(e){const t=this.rules.block.heading.exec(e);if(t){let a=t[2].trim();if(this.rules.other.endingHash.test(a)){const r=bt(a,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(a=r.trim())}return{type:"heading",raw:t[0],depth:t[1].length,text:a,tokens:this.lexer.inline(a)}}}hr(e){const t=this.rules.block.hr.exec(e);if(t)return{type:"hr",raw:bt(t[0],`
|
|
30
|
+
`)}}blockquote(e){const t=this.rules.block.blockquote.exec(e);if(t){let a=bt(t[0],`
|
|
31
31
|
`).split(`
|
|
32
32
|
`),r="",s="";const i=[];for(;a.length>0;){let o=!1;const l=[];let c;for(c=0;c<a.length;c++)if(this.rules.other.blockquoteStart.test(a[c]))l.push(a[c]),o=!0;else if(!o)l.push(a[c]);else break;a=a.slice(c);const d=l.join(`
|
|
33
33
|
`),p=d.replace(this.rules.other.blockquoteSetextReplace,`
|
|
34
34
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
35
35
|
${d}`:d,s=s?`${s}
|
|
36
|
-
${p}`:p;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=h,a.length===0)break;const m=i.at(-1);if(m?.type==="code")break;if(m?.type==="blockquote"){const
|
|
36
|
+
${p}`:p;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(p,i,!0),this.lexer.state.top=h,a.length===0)break;const m=i.at(-1);if(m?.type==="code")break;if(m?.type==="blockquote"){const y=m,g=y.raw+`
|
|
37
37
|
`+a.join(`
|
|
38
|
-
`),f=this.blockquote(g);i[i.length-1]=f,r=r.substring(0,r.length-
|
|
38
|
+
`),f=this.blockquote(g);i[i.length-1]=f,r=r.substring(0,r.length-y.raw.length)+f.raw,s=s.substring(0,s.length-y.text.length)+f.text;break}else if(m?.type==="list"){const y=m,g=y.raw+`
|
|
39
39
|
`+a.join(`
|
|
40
|
-
`),f=this.list(g);i[i.length-1]=f,r=r.substring(0,r.length-m.raw.length)+f.raw,s=s.substring(0,s.length-
|
|
40
|
+
`),f=this.list(g);i[i.length-1]=f,r=r.substring(0,r.length-m.raw.length)+f.raw,s=s.substring(0,s.length-y.raw.length)+f.raw,a=g.substring(i.at(-1).raw.length).split(`
|
|
41
41
|
`);continue}}return{type:"blockquote",raw:r,tokens:i,text:s}}}list(e){let t=this.rules.block.list.exec(e);if(t){let a=t[1].trim();const r=a.length>1,s={type:"list",raw:"",ordered:r,start:r?+a.slice(0,-1):"",loose:!1,items:[]};a=r?`\\d{1,9}\\${a.slice(-1)}`:`\\${a}`,this.options.pedantic&&(a=r?a:"[*+-]");const i=this.rules.other.listItemRegex(a);let o=!1;for(;e;){let c=!1,d="",p="";if(!(t=i.exec(e))||this.rules.block.hr.test(e))break;d=t[0],e=e.substring(d.length);let h=t[2].split(`
|
|
42
42
|
`,1)[0].replace(this.rules.other.listReplaceTabs,v=>" ".repeat(3*v.length)),m=e.split(`
|
|
43
|
-
`,1)[0],
|
|
44
|
-
`,e=e.substring(m.length+1),c=!0),!c){const v=this.rules.other.nextBulletRegex(g),
|
|
45
|
-
`,1)[0];let E;if(m=S,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),E=m):E=m.replace(this.rules.other.tabCharGlobal," "),
|
|
46
|
-
`+E.slice(g);else{if(
|
|
47
|
-
`+m}!
|
|
48
|
-
`,e=e.substring(S.length+1),h=E.slice(g)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0));let f=null,
|
|
49
|
-
`):[],o={type:"table",raw:a[0],header:[],align:[],rows:[]};if(r.length===s.length){for(const l of s)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<r.length;l++)o.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:o.align[l]});for(const l of i)o.rows.push(
|
|
50
|
-
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:a,tokens:this.lexer.inline(a)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const a=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;const i=
|
|
43
|
+
`,1)[0],y=!h.trim(),g=0;if(this.options.pedantic?(g=2,p=h.trimStart()):y?g=t[1].length+1:(g=t[2].search(this.rules.other.nonSpaceChar),g=g>4?1:g,p=h.slice(g),g+=t[1].length),y&&this.rules.other.blankLine.test(m)&&(d+=m+`
|
|
44
|
+
`,e=e.substring(m.length+1),c=!0),!c){const v=this.rules.other.nextBulletRegex(g),w=this.rules.other.hrRegex(g),x=this.rules.other.fencesBeginRegex(g),k=this.rules.other.headingBeginRegex(g),$=this.rules.other.htmlBeginRegex(g);for(;e;){const S=e.split(`
|
|
45
|
+
`,1)[0];let E;if(m=S,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),E=m):E=m.replace(this.rules.other.tabCharGlobal," "),x.test(m)||k.test(m)||$.test(m)||v.test(m)||w.test(m))break;if(E.search(this.rules.other.nonSpaceChar)>=g||!m.trim())p+=`
|
|
46
|
+
`+E.slice(g);else{if(y||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||x.test(h)||k.test(h)||w.test(h))break;p+=`
|
|
47
|
+
`+m}!y&&!m.trim()&&(y=!0),d+=S+`
|
|
48
|
+
`,e=e.substring(S.length+1),h=E.slice(g)}}s.loose||(o?s.loose=!0:this.rules.other.doubleBlankLine.test(d)&&(o=!0));let f=null,b;this.options.gfm&&(f=this.rules.other.listIsTask.exec(p),f&&(b=f[0]!=="[ ] ",p=p.replace(this.rules.other.listReplaceTask,""))),s.items.push({type:"list_item",raw:d,task:!!f,checked:b,loose:!1,text:p,tokens:[]}),s.raw+=d}const l=s.items.at(-1);if(l)l.raw=l.raw.trimEnd(),l.text=l.text.trimEnd();else return;s.raw=s.raw.trimEnd();for(let c=0;c<s.items.length;c++)if(this.lexer.state.top=!1,s.items[c].tokens=this.lexer.blockTokens(s.items[c].text,[]),!s.loose){const d=s.items[c].tokens.filter(h=>h.type==="space"),p=d.length>0&&d.some(h=>this.rules.other.anyLine.test(h.raw));s.loose=p}if(s.loose)for(let c=0;c<s.items.length;c++)s.items[c].loose=!0;return s}}html(e){const t=this.rules.block.html.exec(e);if(t)return{type:"html",block:!0,raw:t[0],pre:t[1]==="pre"||t[1]==="script"||t[1]==="style",text:t[0]}}def(e){const t=this.rules.block.def.exec(e);if(t){const a=t[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=t[2]?t[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",s=t[3]?t[3].substring(1,t[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):t[3];return{type:"def",tag:a,raw:t[0],href:r,title:s}}}table(e){var t;const a=this.rules.block.table.exec(e);if(!a||!this.rules.other.tableDelimiter.test(a[2]))return;const r=Lr(a[1]),s=a[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=(t=a[3])!=null&&t.trim()?a[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
49
|
+
`):[],o={type:"table",raw:a[0],header:[],align:[],rows:[]};if(r.length===s.length){for(const l of s)this.rules.other.tableAlignRight.test(l)?o.align.push("right"):this.rules.other.tableAlignCenter.test(l)?o.align.push("center"):this.rules.other.tableAlignLeft.test(l)?o.align.push("left"):o.align.push(null);for(let l=0;l<r.length;l++)o.header.push({text:r[l],tokens:this.lexer.inline(r[l]),header:!0,align:o.align[l]});for(const l of i)o.rows.push(Lr(l,o.header.length).map((c,d)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:o.align[d]})));return o}}lheading(e){const t=this.rules.block.lheading.exec(e);if(t)return{type:"heading",raw:t[0],depth:t[2].charAt(0)==="="?1:2,text:t[1],tokens:this.lexer.inline(t[1])}}paragraph(e){const t=this.rules.block.paragraph.exec(e);if(t){const a=t[1].charAt(t[1].length-1)===`
|
|
50
|
+
`?t[1].slice(0,-1):t[1];return{type:"paragraph",raw:t[0],text:a,tokens:this.lexer.inline(a)}}}text(e){const t=this.rules.block.text.exec(e);if(t)return{type:"text",raw:t[0],text:t[0],tokens:this.lexer.inline(t[0])}}escape(e){const t=this.rules.inline.escape.exec(e);if(t)return{type:"escape",raw:t[0],text:t[1]}}tag(e){const t=this.rules.inline.tag.exec(e);if(t)return!this.lexer.state.inLink&&this.rules.other.startATag.test(t[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(t[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(t[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(t[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:t[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:t[0]}}link(e){const t=this.rules.inline.link.exec(e);if(t){const a=t[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(a)){if(!this.rules.other.endAngleBracket.test(a))return;const i=bt(a.slice(0,-1),"\\");if((a.length-i.length)%2===0)return}else{const i=Io(t[2],"()");if(i>-1){const o=(t[0].indexOf("!")===0?5:4)+t[1].length+i;t[2]=t[2].substring(0,i),t[0]=t[0].substring(0,o).trim(),t[3]=""}}let r=t[2],s="";if(this.options.pedantic){const i=this.rules.other.pedanticHrefTitle.exec(r);i&&(r=i[1],s=i[3])}else s=t[3]?t[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(a)?r=r.slice(1):r=r.slice(1,-1)),_r(t,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:s&&s.replace(this.rules.inline.anyPunctuation,"$1")},t[0],this.lexer,this.rules)}}reflink(e,t){let a;if((a=this.rules.inline.reflink.exec(e))||(a=this.rules.inline.nolink.exec(e))){const r=(a[2]||a[1]).replace(this.rules.other.multipleSpaceGlobal," "),s=t[r.toLowerCase()];if(!s){const i=a[0].charAt(0);return{type:"text",raw:i,text:i}}return _r(a,s,a[0],this.lexer,this.rules)}}emStrong(e,t,a=""){let r=this.rules.inline.emStrongLDelim.exec(e);if(!(!r||r[3]&&a.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[2])||!a||this.rules.inline.punctuation.exec(a))){const s=[...r[0]].length-1;let i,o,l=s,c=0;const d=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(d.lastIndex=0,t=t.slice(-1*e.length+s);(r=d.exec(t))!=null;){if(i=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!i)continue;if(o=[...i].length,r[3]||r[4]){l+=o;continue}else if((r[5]||r[6])&&s%3&&!((s+o)%3)){c+=o;continue}if(l-=o,l>0)continue;o=Math.min(o,o+l+c);const p=[...r[0]][0].length,h=e.slice(0,s+r.index+p+o);if(Math.min(s,o)%2){const y=h.slice(1,-1);return{type:"em",raw:h,text:y,tokens:this.lexer.inlineTokens(y)}}const m=h.slice(2,-2);return{type:"strong",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}}}codespan(e){const t=this.rules.inline.code.exec(e);if(t){let a=t[2].replace(this.rules.other.newLineCharGlobal," ");const r=this.rules.other.nonSpaceChar.test(a),s=this.rules.other.startingSpaceChar.test(a)&&this.rules.other.endingSpaceChar.test(a);return r&&s&&(a=a.substring(1,a.length-1)),{type:"codespan",raw:t[0],text:a}}}br(e){const t=this.rules.inline.br.exec(e);if(t)return{type:"br",raw:t[0]}}del(e){const t=this.rules.inline.del.exec(e);if(t)return{type:"del",raw:t[0],text:t[2],tokens:this.lexer.inlineTokens(t[2])}}autolink(e){const t=this.rules.inline.autolink.exec(e);if(t){let a,r;return t[2]==="@"?(a=t[1],r="mailto:"+a):(a=t[1],r=a),{type:"link",raw:t[0],text:a,href:r,tokens:[{type:"text",raw:a,text:a}]}}}url(e){var t;let a;if(a=this.rules.inline.url.exec(e)){let r,s;if(a[2]==="@")r=a[0],s="mailto:"+r;else{let i;do i=a[0],a[0]=((t=this.rules.inline._backpedal.exec(a[0]))==null?void 0:t[0])??"";while(i!==a[0]);r=a[0],a[1]==="www."?s="http://"+a[0]:s=a[0]}return{type:"link",raw:a[0],text:r,href:s,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){const t=this.rules.inline.text.exec(e);if(t){const a=this.lexer.state.inRawBlock;return{type:"text",raw:t[0],text:t[0],escaped:a}}}}class ce{constructor(e){j(this,"tokens"),j(this,"options"),j(this,"state"),j(this,"tokenizer"),j(this,"inlineQueue"),this.tokens=[],this.tokens.links=Object.create(null),this.options=e||De,this.options.tokenizer=this.options.tokenizer||new Zt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};const t={other:J,block:Vt.normal,inline:yt.normal};this.options.pedantic?(t.block=Vt.pedantic,t.inline=yt.pedantic):this.options.gfm&&(t.block=Vt.gfm,this.options.breaks?t.inline=yt.breaks:t.inline=yt.gfm),this.tokenizer.rules=t}static get rules(){return{block:Vt,inline:yt}}static lex(e,t){return new ce(t).lex(e)}static lexInline(e,t){return new ce(t).inlineTokens(e)}lex(e){e=e.replace(J.carriageReturn,`
|
|
51
51
|
`),this.blockTokens(e,this.tokens);for(let t=0;t<this.inlineQueue.length;t++){const a=this.inlineQueue[t];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,t=[],a=!1){var r,s,i;for(this.options.pedantic&&(e=e.replace(J.tabCharGlobal," ").replace(J.spaceLine,""));e;){let o;if((s=(r=this.options.extensions)==null?void 0:r.block)!=null&&s.some(c=>(o=c.call({lexer:this},e,t))?(e=e.substring(o.raw.length),t.push(o),!0):!1))continue;if(o=this.tokenizer.space(e)){e=e.substring(o.raw.length);const c=t.at(-1);o.raw.length===1&&c!==void 0?c.raw+=`
|
|
52
52
|
`:t.push(o);continue}if(o=this.tokenizer.code(e)){e=e.substring(o.raw.length);const c=t.at(-1);c?.type==="paragraph"||c?.type==="text"?(c.raw+=`
|
|
53
53
|
`+o.raw,c.text+=`
|
|
@@ -57,16 +57,16 @@ ${p}`:p;const h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.block
|
|
|
57
57
|
`+o.raw,c.text+=`
|
|
58
58
|
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(o),a=l.length!==e.length,e=e.substring(o.raw.length);continue}if(o=this.tokenizer.text(e)){e=e.substring(o.raw.length);const c=t.at(-1);c?.type==="text"?(c.raw+=`
|
|
59
59
|
`+o.raw,c.text+=`
|
|
60
|
-
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(o);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var a,r,s;let i=e,o=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)d.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l=!1,c="";for(;e;){l||(c=""),l=!1;let d;if((r=(a=this.options.extensions)==null?void 0:a.inline)!=null&&r.some(h=>(d=h.call({lexer:this},e,t))?(e=e.substring(d.raw.length),t.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);const h=t.at(-1);d.type==="text"&&h?.type==="text"?(h.raw+=d.raw,h.text+=d.text):t.push(d);continue}if(d=this.tokenizer.emStrong(e,i,c)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.del(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),t.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),t.push(d);continue}let p=e;if((s=this.options.extensions)!=null&&s.startInline){let h=1/0;const m=e.slice(1);let
|
|
61
|
-
`;return s?'<pre><code class="language-'+
|
|
62
|
-
`:"<pre><code>"+(a?i:
|
|
60
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):t.push(o);continue}if(e){const c="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(c)}}return this.state.top=!0,t}inline(e,t=[]){return this.inlineQueue.push({src:e,tokens:t}),t}inlineTokens(e,t=[]){var a,r,s;let i=e,o=null;if(this.tokens.links){const d=Object.keys(this.tokens.links);if(d.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(i))!=null;)d.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.blockSkip.exec(i))!=null;)i=i.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+i.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(i))!=null;)i=i.slice(0,o.index)+"++"+i.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let l=!1,c="";for(;e;){l||(c=""),l=!1;let d;if((r=(a=this.options.extensions)==null?void 0:a.inline)!=null&&r.some(h=>(d=h.call({lexer:this},e,t))?(e=e.substring(d.raw.length),t.push(d),!0):!1))continue;if(d=this.tokenizer.escape(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.tag(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.link(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(d.raw.length);const h=t.at(-1);d.type==="text"&&h?.type==="text"?(h.raw+=d.raw,h.text+=d.text):t.push(d);continue}if(d=this.tokenizer.emStrong(e,i,c)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.codespan(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.br(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.del(e)){e=e.substring(d.raw.length),t.push(d);continue}if(d=this.tokenizer.autolink(e)){e=e.substring(d.raw.length),t.push(d);continue}if(!this.state.inLink&&(d=this.tokenizer.url(e))){e=e.substring(d.raw.length),t.push(d);continue}let p=e;if((s=this.options.extensions)!=null&&s.startInline){let h=1/0;const m=e.slice(1);let y;this.options.extensions.startInline.forEach(g=>{y=g.call({lexer:this},m),typeof y=="number"&&y>=0&&(h=Math.min(h,y))}),h<1/0&&h>=0&&(p=e.substring(0,h+1))}if(d=this.tokenizer.inlineText(p)){e=e.substring(d.raw.length),d.raw.slice(-1)!=="_"&&(c=d.raw.slice(-1)),l=!0;const h=t.at(-1);h?.type==="text"?(h.raw+=d.raw,h.text+=d.text):t.push(d);continue}if(e){const h="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent)break;throw new Error(h)}}return t}}class Jt{constructor(e){j(this,"options"),j(this,"parser"),this.options=e||De}space(e){return""}code({text:e,lang:t,escaped:a}){var r;const s=(r=(t||"").match(J.notSpaceStart))==null?void 0:r[0],i=e.replace(J.endingNewline,"")+`
|
|
61
|
+
`;return s?'<pre><code class="language-'+he(s)+'">'+(a?i:he(i,!0))+`</code></pre>
|
|
62
|
+
`:"<pre><code>"+(a?i:he(i,!0))+`</code></pre>
|
|
63
63
|
`}blockquote({tokens:e}){return`<blockquote>
|
|
64
64
|
${this.parser.parse(e)}</blockquote>
|
|
65
65
|
`}html({text:e}){return e}heading({tokens:e,depth:t}){return`<h${t}>${this.parser.parseInline(e)}</h${t}>
|
|
66
66
|
`}hr(e){return`<hr>
|
|
67
67
|
`}list(e){const t=e.ordered,a=e.start;let r="";for(let o=0;o<e.items.length;o++){const l=e.items[o];r+=this.listitem(l)}const s=t?"ol":"ul",i=t&&a!==1?' start="'+a+'"':"";return"<"+s+i+`>
|
|
68
68
|
`+r+"</"+s+`>
|
|
69
|
-
`}listitem(e){var t;let a="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((t=e.tokens[0])==null?void 0:t.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+
|
|
69
|
+
`}listitem(e){var t;let a="";if(e.task){const r=this.checkbox({checked:!!e.checked});e.loose?((t=e.tokens[0])==null?void 0:t.type)==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+he(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):a+=r+" "}return a+=this.parser.parse(e.tokens,!!e.loose),`<li>${a}</li>
|
|
70
70
|
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
71
71
|
`}table(e){let t="",a="";for(let s=0;s<e.header.length;s++)a+=this.tablecell(e.header[s]);t+=this.tablerow({text:a});let r="";for(let s=0;s<e.rows.length;s++){const i=e.rows[s];a="";for(let o=0;o<i.length;o++)a+=this.tablecell(i[o]);r+=this.tablerow({text:a})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
72
72
|
<thead>
|
|
@@ -75,146 +75,155 @@ ${this.parser.parse(e)}</blockquote>
|
|
|
75
75
|
`}tablerow({text:e}){return`<tr>
|
|
76
76
|
${e}</tr>
|
|
77
77
|
`}tablecell(e){const t=this.parser.parseInline(e.tokens),a=e.header?"th":"td";return(e.align?`<${a} align="${e.align}">`:`<${a}>`)+t+`</${a}>
|
|
78
|
-
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${
|
|
79
|
-
`+this.renderer.text(c);t?s+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):s+=d;continue}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return"";throw new Error(c)}}}return s}parseInline(e,t=this.renderer){var a,r;let s="";for(let i=0;i<e.length;i++){const o=e[i];if((r=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&r[o.type]){const c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){s+=c||"";continue}}const l=o;switch(l.type){case"escape":{s+=t.text(l);break}case"html":{s+=t.html(l);break}case"link":{s+=t.link(l);break}case"image":{s+=t.image(l);break}case"strong":{s+=t.strong(l);break}case"em":{s+=t.em(l);break}case"codespan":{s+=t.codespan(l);break}case"br":{s+=t.br(l);break}case"del":{s+=t.del(l);break}case"text":{s+=t.text(l);break}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return"";throw new Error(c)}}}return s}}class
|
|
80
|
-
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+ue(a.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(a);throw a}}}const De=new $o;function A(n,e){return De.parse(n,e)}A.options=A.setOptions=function(n){return De.setOptions(n),A.defaults=De.defaults,lr(A.defaults),A},A.getDefaults=Nn,A.defaults=Ae,A.use=function(...n){return De.use(...n),A.defaults=De.defaults,lr(A.defaults),A},A.walkTokens=function(n,e){return De.walkTokens(n,e)},A.parseInline=De.parseInline,A.Parser=ce,A.parser=ce.parse,A.Renderer=Ht,A.TextRenderer=zn,A.Lexer=le,A.lexer=le.lex,A.Tokenizer=Mt,A.Hooks=ft,A.parse=A,A.options,A.setOptions,A.use,A.walkTokens,A.parseInline,ce.parse,le.lex;const ko=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,So=Object.hasOwnProperty;class gt{constructor(){this.occurrences,this.reset()}slug(e,t){const a=this;let r=Eo(e,t===!0);const s=r;for(;So.call(a.occurrences,r);)a.occurrences[s]++,r=s+"-"+a.occurrences[s];return a.occurrences[r]=0,r}reset(){this.occurrences=Object.create(null)}}function Eo(n,e){return typeof n!="string"?"":(e||(n=n.toLowerCase()),n.replace(ko,"").replace(/ /g,"-"))}const Ao={scopeName:"source.astro",dependencies:["html","css","scss","javascript","typescript","tsx"],patterns:[{include:"#frontmatter"},{include:"#script"},{include:"#style"},{include:"#interpolation"},{include:"text.html.basic"}],repository:{frontmatter:{begin:"^---\\s*$",end:"^---\\s*$",beginCaptures:{0:{name:"punctuation.definition.frontmatter.begin.astro"}},endCaptures:{0:{name:"punctuation.definition.frontmatter.end.astro"}},contentName:"meta.embedded.block.astro",patterns:[{include:"source.ts"}]},script:{patterns:[{begin:"<(script)\\s*>",end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.ts.embedded.astro",patterns:[{include:"source.ts"}]},{include:"text.html.basic#embedded-javascript"}]},style:{patterns:[{begin:`<(style)\\b(?=[^>]*\\blang\\s*=\\s*(['"])scss\\2)[^>]*>`,end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.scss.embedded.astro",patterns:[{include:"source.scss"}]},{include:"source.css"}]},interpolation:{begin:"\\{",end:"\\}",beginCaptures:{0:{name:"punctuation.section.embedded.begin.astro"}},endCaptures:{0:{name:"punctuation.section.embedded.end.astro"}},contentName:"meta.embedded.expression.astro",patterns:[{include:"text.html.basic#comments"},{include:"source.tsx"}]}}},Do={scopeName:"source.shell",patterns:[{match:"^#!.*$",name:"comment.line.shebang"},{match:"(?!^#!)#.*$",name:"comment.line.number-sign"},{match:"'(?:[^']*)'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},{match:"\\$[a-zA-Z_][\\w]*|\\$\\d+|\\$[?@*#$!_-]|\\$\\{[^}]+\\}",name:"entity.name.variable"},{match:"\\b([a-zA-Z_][\\w]*)(?==)",captures:{1:{name:"entity.name.variable.assignment"}}},{match:"\\b(?:if|then|else|elif|fi|for|while|until|in|do|done|case|esac|function|select|time|coproc)\\b",name:"keyword.control"},{match:"(?:&&|\\|\\||[|&;])",name:"keyword.operator"},{match:"(?<![\\w-])--?[a-zA-Z][\\w-]*(?:=[^\\s]+)?",name:"constant.language.option"},{match:"(?<![\\w.])-?\\d+(?:\\.\\d+)?\\b",name:"constant.numeric"}]},Co={scopeName:"source.c",patterns:[{include:"#comments"},{include:"#preprocessor"},{include:"#strings"},{include:"#storage-types"},{include:"#keywords"},{include:"#builtin-types"},{include:"#constants"},{include:"#numbers"},{include:"#operators"},{include:"#function-declaration"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},preprocessor:{patterns:[{begin:"^\\s*#\\s*include\\b",end:"$",name:"keyword.control.directive.include",patterns:[{match:"<[^>]*>",name:"string.quoted.other.lt-gt"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"}]},{match:"^\\s*#\\s*(?:define|undef|ifdef|ifndef|if|elif|else|endif|pragma|error|warning|line)\\b.*$",name:"keyword.control.directive"}]},strings:{patterns:[{match:"'(?:\\\\.|[^'\\\\\\r\\n])'",name:"string.quoted.char"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"}]},"storage-types":{match:"\\b(?:auto|const|enum|extern|inline|register|restrict|signed|static|struct|typedef|union|unsigned|volatile)\\b",name:"storage.modifier"},keywords:{match:"\\b(?:break|case|continue|default|do|else|for|goto|if|return|sizeof|switch|while)\\b",name:"keyword.control"},"builtin-types":{match:"\\b(?:char|double|float|int|long|short|void|_Bool|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|size_t|ssize_t|ptrdiff_t|FILE)\\b",name:"support.class.builtin"},constants:{match:"\\b(?:NULL|true|false)\\b",name:"constant.language"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F]+|0[bB][01]+|(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eE][+-]?\\d+)?)[uUlLfF]*\\b",name:"constant.numeric"},operators:{match:"(?:->|\\+\\+|--|&&|\\|\\||<<=?|>>=?|==|!=|<=|>=|[+\\-*/%&|^!~<>=]=?)",name:"keyword.operator"},"function-declaration":{match:"\\b([A-Za-z_]\\w*)(?=\\s*\\()",name:"entity.name.function"}}},Fo={scopeName:"source.cpp",dependencies:["c"],patterns:[{include:"source.c#comments"},{include:"source.c#preprocessor"},{include:"source.c#strings"},{include:"#class-declaration"},{include:"#keywords"},{include:"source.c#storage-types"},{include:"source.c#keywords"},{include:"source.c#builtin-types"},{include:"#stl-types"},{include:"#constants"},{include:"source.c#constants"},{include:"#numbers"},{include:"#operators"},{include:"source.c#function-declaration"}],repository:{"class-declaration":{match:"\\b(class|struct|enum|namespace)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},keywords:{match:"\\b(?:catch|class|const_cast|constexpr|decltype|delete|dynamic_cast|explicit|export|final|friend|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|reinterpret_cast|static_assert|static_cast|template|this|throw|try|typeid|typename|using|virtual)\\b",name:"keyword.control"},"stl-types":{match:"\\bstd::(?:array|deque|forward_list|list|map|multimap|multiset|pair|priority_queue|queue|set|shared_ptr|stack|string|tuple|unique_ptr|unordered_map|unordered_set|vector|weak_ptr)\\b",name:"support.class.builtin"},constants:{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F']+|0[bB][01']+|(?:\\d[\\d']*\\.[\\d']*|\\.\\d[\\d']*|\\d[\\d']*)(?:[eE][+-]?\\d+)?)[uUlLfF]*\\b",name:"constant.numeric"},operators:{match:"(?:->\\*?|::|\\.\\.\\.|<=>|&&|\\|\\||<<=?|>>=?|==|!=|<=|>=|[+\\-*/%&|^!~<>=]=?)",name:"keyword.operator"}}},To={scopeName:"source.cs",patterns:[{include:"#comments"},{include:"#strings"},{include:"#attributes"},{include:"#class-declaration"},{include:"#keywords"},{include:"#builtin-types"},{include:"#constants"},{include:"#numbers"},{include:"#operators"},{include:"#function-declaration"}],repository:{comments:{patterns:[{match:"///.*$",name:"comment.line.documentation"},{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{match:'@"(?:""|[^"])*"',name:"string.quoted.double.verbatim"},{match:'\\$@"(?:""|\\{\\{|\\}\\}|[^"])*"',name:"string.quoted.double.interpolated"},{match:'@\\$"(?:""|\\{\\{|\\}\\}|[^"])*"',name:"string.quoted.double.interpolated"},{match:'\\$"(?:\\\\.|\\{\\{|\\}\\}|[^"\\\\\\r\\n])*"',name:"string.quoted.double.interpolated"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\\\r\\n])'",name:"string.quoted.char"}]},attributes:{match:"\\[[A-Za-z_][\\w.]*\\]",name:"entity.name.decorator"},"class-declaration":{match:"\\b(class|interface|struct|enum|record)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},keywords:{match:"\\b(?:abstract|as|async|await|base|break|case|catch|checked|const|continue|default|delegate|do|else|event|explicit|extern|finally|fixed|for|foreach|goto|if|implicit|in|internal|is|lock|namespace|new|null|operator|out|override|params|partial|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|try|typeof|unchecked|unsafe|using|virtual|volatile|while|yield)\\b",name:"keyword.control"},"builtin-types":{match:"\\b(?:bool|byte|char|decimal|double|dynamic|float|int|long|object|sbyte|short|string|uint|ulong|ushort|var|void)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)[uUlLfFdDmM]*\\b",name:"constant.numeric"},operators:{match:"(?:=>|\\?\\?=?|\\?\\.|::|&&|\\|\\||==|!=|<=|>=|<<=?|>>=?|[+\\-*/%&|^!~<>=]=?)",name:"keyword.operator"},"function-declaration":{match:"\\b([A-Za-z_]\\w*)(?=\\s*(?:<[^>]*>)?\\s*\\()",name:"entity.name.function"}}},Oo={scopeName:"source.css",patterns:[{include:"#comments"},{include:"#strings"},{include:"#keyframes"},{include:"#at-rule-block"},{include:"#at-rule-statement"},{include:"#rule-set"}],repository:{comments:{begin:"/\\*",end:"\\*/",name:"comment.block"},strings:{match:`(['"])(?:\\\\.|(?!\\1)[^\\\\\\r\\n])*\\1`,name:"string.quoted"},keyframes:{begin:"(@(?:-\\w+-)?keyframes)\\s+([a-zA-Z_-][\\w-]*)\\s*\\{",end:"\\}",beginCaptures:{1:{name:"keyword.control.at-rule"},2:{name:"entity.name.animation"}},patterns:[{include:"$self"}]},"at-rule-block":{begin:"(@(?:container|counter-style|document|font-face|font-feature-values|font-palette-values|layer|media|page|position-try|scope|starting-style|supports|view-transition)\\b)[^{;]*\\{",end:"\\}",beginCaptures:{1:{name:"keyword.control.at-rule"}},patterns:[{include:"$self"}]},"at-rule-statement":{begin:"(@(?:charset|custom-media|import|namespace|property)\\b)",end:";",beginCaptures:{1:{name:"keyword.control.at-rule"}},patterns:[{include:"#comments"},{include:"#strings"},{include:"#values"}]},"rule-set":{begin:"([^\\s@{};<][^@{};<]*?)\\s*\\{",end:"\\}",beginCaptures:{1:{name:"entity.name.selector"}},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keyframes"},{include:"#at-rule-block"},{include:"#at-rule-statement"},{include:"#rule-set"},{include:"#declarations"},{include:"#values"}]},declarations:{match:"(--[a-zA-Z0-9_-]+|[a-zA-Z-][\\w-]*)(\\s*:)",captures:{1:{name:"support.type.property-name"}}},values:{patterns:[{match:"!important\\b",name:"keyword.other.important"},{match:"\\b(var)\\(\\s*(--[a-zA-Z0-9_-]+)",captures:{1:{name:"entity.name.function"},2:{name:"variable.other.custom-property"}}},{match:"\\b([a-zA-Z_-][\\w-]*)(?=\\()",captures:{1:{name:"entity.name.function"}}},{match:"#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})\\b",name:"constant.other.color"},{match:"(?<![\\w.-])-?(?:\\d*\\.\\d+|\\d+)(?:[eE][+-]?\\d+)?(?:%|[a-zA-Z]+)?\\b",name:"constant.numeric"},{match:"\\b(?:auto|currentColor|inherit|initial|none|normal|revert|revert-layer|transparent|unset)\\b",name:"constant.language"},{match:"(?:[+*/]|(?<=\\s)-(?!-))",name:"keyword.operator"}]}}},No={scopeName:"source.go",patterns:[{include:"#comments"},{include:"#strings"},{include:"#function-declaration"},{include:"#type-declaration"},{include:"#keywords"},{include:"#constants"},{include:"#builtin-types"},{include:"#builtin-functions"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{begin:"`",end:"`",name:"string.quoted.raw"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\\\r\\n])*'",name:"string.quoted.rune"}]},"function-declaration":{match:"\\b(func)\\s+(?:\\([^)]*\\)\\s*)?([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},"type-declaration":{match:"\\b(type)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type"},2:{name:"entity.name.type.class"}}},keywords:{match:"\\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\b(?:nil|iota)\\b",name:"constant.language"}]},"builtin-types":{match:"\\b(?:any|bool|byte|complex64|complex128|error|float32|float64|int|int8|int16|int32|int64|rune|string|uint|uint8|uint16|uint32|uint64|uintptr)\\b",name:"support.class.builtin"},"builtin-functions":{match:"\\b(?:append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\\b(?=\\s*\\()",name:"entity.name.function"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?i?)\\b",name:"constant.numeric"},operators:{match:"(?::=|\\.\\.\\.|<-|\\|\\||&&|==|!=|<=|>=|<<|>>|[+\\-*/%&|^!<>=]=?)",name:"keyword.operator"}}},Bo={scopeName:"text.html.basic",dependencies:["css","json","javascript"],patterns:[{include:"#comments"},{include:"#doctype"},{include:"#embedded-css"},{include:"#embedded-json"},{include:"#embedded-javascript"},{include:"#raw-text"},{include:"#tags"},{include:"#entities"}],repository:{comments:{begin:"<!--",end:"-->",name:"comment.block"},doctype:{match:"<![Dd][Oo][Cc][Tt][Yy][Pp][Ee]\\b[^>]*>",name:"keyword.control.doctype"},"embedded-css":{begin:`<([Ss][Tt][Yy][Ll][Ee])\\b(?:"[^"]*"|'[^']*'|[^'">])*>`,end:"</([Ss][Tt][Yy][Ll][Ee])[ \\t]*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.embedded.html",patterns:[{include:"source.css"}]},"embedded-json":{begin:`<([Ss][Cc][Rr][Ii][Pp][Tt])\\b(?=[^>]*\\b[Tt][Yy][Pp][Ee]\\s*=\\s*(['"])(?:application/(?:ld\\+)?json|importmap|speculationrules)\\2)(?:"[^"]*"|'[^']*'|[^'">])*>`,end:"</([Ss][Cc][Rr][Ii][Pp][Tt])[ \\t]*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.json.embedded.html",patterns:[{include:"source.json"}]},"embedded-javascript":{begin:`<([Ss][Cc][Rr][Ii][Pp][Tt])\\b(?:(?![^>]*\\b[Tt][Yy][Pp][Ee]\\s*=)|(?=[^>]*\\b[Tt][Yy][Pp][Ee]\\s*=\\s*(['"])(?:module|(?:text|application)/(?:java|ecma)script)\\2))(?:"[^"]*"|'[^']*'|[^'">])*>`,end:"</([Ss][Cc][Rr][Ii][Pp][Tt])[ \\t]*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.js.embedded.html",patterns:[{include:"source.js"}]},"raw-text":{begin:`<([Tt][Ee][Xx][Tt][Aa][Rr][Ee][Aa]|[Tt][Ii][Tt][Ll][Ee])\\b(?:"[^"]*"|'[^']*'|[^'">])*>`,end:"</([Tt][Ee][Xx][Tt][Aa][Rr][Ee][Aa]|[Tt][Ii][Tt][Ll][Ee])[ \\t]*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"string.unquoted.raw-text"},tags:{begin:"<(/?)([a-zA-Z][\\w.-]*)",end:">",beginCaptures:{2:{name:"entity.name.tag"}},patterns:[{include:"#inline-css"},{include:"#inline-javascript"},{include:"#attributes"},{include:"#unquoted-attributes"},{include:"#boolean-attributes"}]},"inline-css":{begin:`[ \\t]+(style)\\s*=\\s*(['"])`,end:"\\2",beginCaptures:{1:{name:"entity.other.attribute-name"},2:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},contentName:"source.css.embedded.inline",patterns:[{include:"source.css#comments"},{include:"source.css#strings"},{include:"source.css#declarations"},{include:"source.css#values"}]},"inline-javascript":{begin:`[ \\t]+(on[a-zA-Z][\\w-]*)\\s*=\\s*(['"])`,end:"\\2",beginCaptures:{1:{name:"entity.other.attribute-name"},2:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},contentName:"source.js.embedded.inline",patterns:[{include:"source.js"}]},attributes:{begin:`[ \\t]+([a-zA-Z_:][\\w:.-]*)\\s*=\\s*(['"])`,end:"\\2",beginCaptures:{1:{name:"entity.other.attribute-name"},2:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},contentName:"string.quoted.attribute-value",patterns:[{include:"#entities"}]},"unquoted-attributes":{match:"[ \\t]+([a-zA-Z_:][\\w:.-]*)\\s*=\\s*([^\\s\"'`=<>]+)",captures:{1:{name:"entity.other.attribute-name"},2:{name:"string.unquoted.attribute-value"}}},"boolean-attributes":{match:"[ \\t]+([a-zA-Z_:][\\w:.-]*)(?=[ \\t]*/?>|[ \\t]+[a-zA-Z_:])",captures:{1:{name:"entity.other.attribute-name"}}},entities:{match:"&(?:#\\d+|#x[0-9a-fA-F]+|[a-zA-Z][\\w]+);",name:"constant.character.entity"}}},Lo={scopeName:"source.java",patterns:[{include:"#comments"},{include:"#strings"},{include:"#annotations"},{include:"#class-declaration"},{include:"#keywords"},{include:"#builtin-types"},{include:"#constants"},{include:"#numbers"},{include:"#operators"},{include:"#function-declaration"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{begin:'"""',end:'"""',name:"string.quoted.triple"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\\\r\\n])'",name:"string.quoted.char"}]},annotations:{match:"@[A-Za-z_][\\w.]*",name:"entity.name.decorator"},"class-declaration":{match:"\\b(class|interface|enum|record)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},keywords:{match:"\\b(?:abstract|assert|break|case|catch|continue|default|do|else|extends|final|finally|for|goto|if|implements|import|instanceof|native|new|non-sealed|package|permits|private|protected|public|return|sealed|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|volatile|while|yield)\\b",name:"keyword.control"},"builtin-types":{match:"\\b(?:boolean|byte|char|double|float|int|long|short|void|Boolean|Byte|Character|Double|Float|Integer|Long|Short|String|Object|List|Map|Set|ArrayList|HashMap|HashSet|Optional)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)[lLfFdD]?\\b",name:"constant.numeric"},operators:{match:"(?:->|::|&&|\\|\\||==|!=|<=|>=|<<=?|>>>?=?|[+\\-*/%&|^!~<>=]=?)",name:"keyword.operator"},"function-declaration":{match:"\\b([A-Za-z_]\\w*)(?=\\s*\\()",name:"entity.name.function"}}},Io={scopeName:"source.js",patterns:[{include:"#comments"},{include:"#strings"},{include:"#template"},{include:"#regexp"},{include:"#jsx-closing-tag"},{include:"#jsx-tag"},{include:"#class-declaration"},{include:"#function-declaration"},{include:"#variable-declaration"},{include:"#keywords"},{include:"#numbers"},{include:"#constants"},{include:"#decorators"},{include:"#private-fields"},{include:"#properties"},{include:"#functions"},{include:"#built-ins"},{include:"#operators"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{match:"'(?:\\\\.|[^'\\\\\\r\\n])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"}]},template:{begin:"`",end:"(?<!\\\\)(?:\\\\\\\\)*`",name:"string.quoted.template",patterns:[{include:"#template-interpolation"}]},"template-interpolation":{begin:"\\$\\{",end:"\\}",patterns:[{include:"#balanced-braces"},{include:"$self"}]},"balanced-braces":{begin:"\\{",end:"\\}",patterns:[{include:"#balanced-braces"},{include:"$self"}]},regexp:{match:"(?<![\\w)$\\]])/(?![/*])(?:\\\\.|\\[(?:\\\\.|[^\\]\\\\])*\\]|[^/\\\\\\r\\n])+/[dgimsuvy]*",name:"string.regexp"},"jsx-closing-tag":{match:"</([A-Za-z][\\w.-]*)\\s*>",captures:{1:{name:"entity.name.tag"}}},"jsx-tag":{begin:"<([A-Za-z][\\w.-]*)",end:"/?>",beginCaptures:{1:{name:"entity.name.tag"}},patterns:[{include:"#jsx-expression"},{include:"#strings"},{include:"#jsx-boolean-attributes"},{include:"#jsx-attributes"}]},"jsx-expression":{begin:"\\{",end:"\\}",patterns:[{include:"#balanced-braces"},{include:"$self"}]},"jsx-attributes":{match:"\\b([a-zA-Z_:][\\w:.-]*)(?=\\s*(?:=|/?>))",captures:{1:{name:"entity.other.attribute-name"}}},"jsx-boolean-attributes":{match:"\\b([a-zA-Z_:][\\w:.-]*)(?=\\s+(?:[a-zA-Z_:][\\w:.-]*\\s*=|/?>))",captures:{1:{name:"entity.other.attribute-name"}}},"class-declaration":{match:"\\b(class)\\s+([A-Za-z_$][\\w$]*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},"function-declaration":{match:"\\b(?:(async)\\s+)?(function)\\s*(\\*)?\\s*([A-Za-z_$][\\w$]*)?",captures:{1:{name:"storage.modifier.async"},2:{name:"storage.type.function"},4:{name:"entity.name.function"}}},"variable-declaration":{match:"\\b(const|let|var)\\s+([A-Za-z_$][\\w$]*)",captures:{1:{name:"storage.type.variable"},2:{name:"variable.other.readwrite"}}},keywords:{match:"\\b(?:as|assert|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b",name:"keyword.control"},numbers:{match:"(?<![\\w$])(?:0[xX][0-9a-fA-F](?:_?[0-9a-fA-F])*n?|0[bB][01](?:_?[01])*n?|0[oO][0-7](?:_?[0-7])*n?|\\d(?:_?\\d)*n|(?:\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?|\\.\\d(?:_?\\d)*)(?:[eE][+-]?\\d(?:_?\\d)*)?)(?![\\w$])",name:"constant.numeric"},constants:{patterns:[{match:"\\b(?:false|true)\\b",name:"constant.language.boolean"},{match:"\\b(?:Infinity|NaN|null|undefined)\\b",name:"constant.language"}]},decorators:{match:"@[A-Za-z_$][\\w$]*",name:"entity.name.decorator"},"private-fields":{match:"#[A-Za-z_$][\\w$]*",name:"variable.other.private"},properties:{match:"(?<=\\.)[A-Za-z_$][\\w$]*|[A-Za-z_$][\\w$]*(?=\\s*:)",name:"entity.name.property"},functions:{match:"\\b[A-Za-z_$][\\w$]*(?=\\s*\\()",name:"entity.name.function"},"built-ins":{match:"\\b(?:Array|BigInt|Boolean|console|customElements|Date|document|Error|JSON|Map|Math|Number|Object|Promise|Reflect|RegExp|Set|String|Symbol|WeakMap|WeakSet|window)\\b",name:"support.class"},operators:{match:"(?:=>|===|!==|==|!=|<=|>=|\\?\\?|\\?\\.|\\+\\+|--|&&|\\|\\||\\*\\*|[+*%&|^!~?:-])",name:"keyword.operator"}}},_o={scopeName:"source.json",patterns:[{match:'"(?:\\\\.|[^"\\\\])*"(?=\\s*:)',name:"entity.name.key"},{match:'"(?:\\\\.|[^"\\\\])*"(?=\\s*[,}\\]])',name:"string.quoted.double"},{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b",name:"constant.language"},{match:"(?<![\\w.])-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric"}]},Ro={scopeName:"source.kotlin",patterns:[{include:"#comments"},{include:"#strings"},{include:"#annotations"},{include:"#class-declaration"},{include:"#function-declaration"},{include:"#keywords"},{include:"#builtin-types"},{include:"#constants"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{begin:'"""',end:'"""',name:"string.quoted.triple"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\\\r\\n])'",name:"string.quoted.char"}]},annotations:{match:"@[A-Za-z_][\\w.]*",name:"entity.name.decorator"},"class-declaration":{match:"\\b(?:(data|sealed|abstract|open|inner|enum|annotation)\\s+)?(class|interface|object)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.modifier"},2:{name:"storage.type.class"},3:{name:"entity.name.type.class"}}},"function-declaration":{match:"\\b(fun)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},keywords:{match:"\\b(?:abstract|actual|annotation|as|break|by|catch|companion|const|constructor|continue|crossinline|data|delegate|do|dynamic|else|enum|expect|external|final|finally|for|get|if|import|in|infix|init|inline|inner|internal|is|lateinit|noinline|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|try|typealias|val|var|vararg|when|where|while)\\b",name:"keyword.control"},"builtin-types":{match:"\\b(?:Any|Array|Boolean|Byte|Char|Double|Float|Int|List|Long|Map|MutableList|MutableMap|MutableSet|Nothing|Set|Short|String|Unit)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)[fFLuU]*\\b",name:"constant.numeric"},operators:{match:"(?:->|\\?:|\\?\\.|!!|\\.\\.|::|&&|\\|\\||==|!=|<=|>=|[+\\-*/%!<>=]=?)",name:"keyword.operator"}}},jo={scopeName:"text.html.markdown",dependencies:["yaml"],patterns:[{include:"#front-matter"},{include:"#comments"},{include:"#fenced-code"},{include:"#headings"},{include:"#quotes"},{include:"#lists"},{include:"#links"},{include:"#inline-code"}],repository:{"front-matter":{begin:"^[ \\t]*---[ \\t]*$",end:"^[ \\t]*(?:---|\\.\\.\\.)[ \\t]*$",patterns:[{include:"source.yaml"}]},comments:{begin:"<!--",end:"-->",name:"comment.block.html"},"fenced-code":{begin:"^[ \\t]*(```+|~~~+).*$",end:"^[ \\t]*\\1[ \\t]*$",name:"string.unquoted.fenced-code"},headings:{match:"^[ \\t]{0,3}#{1,6}[ \\t]+(.+)$",captures:{1:{name:"entity.name.section"}}},quotes:{match:"^[ \\t]*>.*$",name:"comment.blockquote"},lists:{match:"^[ \\t]*(?:[-+*]|\\d+[.)])(?=[ \\t]+)",name:"keyword.control.list"},links:{match:`!?\\[([^\\]]+)\\](\\([^\\s)]+(?:\\s+['"][^'"]*['"])?\\))`,captures:{1:{name:"entity.name.link"},2:{name:"string.other.link"}}},"inline-code":{match:"(`+)(.+?)\\1",captures:{2:{name:"string.other.raw"}}}}},qo={scopeName:"source.objc",dependencies:["c"],patterns:[{include:"source.c#comments"},{include:"source.c#preprocessor"},{include:"#interface-declaration"},{include:"#directives"},{include:"#nsstring"},{include:"source.c#strings"},{include:"#method-declaration"},{include:"#language-variables"},{include:"source.c#storage-types"},{include:"source.c#keywords"},{include:"#property-attributes"},{include:"#builtin-types"},{include:"source.c#builtin-types"},{include:"#constants"},{include:"source.c#constants"},{include:"source.c#numbers"},{include:"source.c#operators"},{include:"source.c#function-declaration"}],repository:{"interface-declaration":{match:"\\b(@interface|@implementation|@protocol)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},directives:{match:"@(?:end|property|synthesize|dynamic|optional|required|class|import|selector|encode|synchronized|autoreleasepool|try|catch|finally|throw)\\b",name:"keyword.control.directive.objc"},nsstring:{match:'@"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},"method-declaration":{match:"^\\s*[-+]\\s*\\([^)]*\\)\\s*([A-Za-z_]\\w*)",captures:{1:{name:"entity.name.function"}}},"language-variables":{match:"\\b(?:self|super)\\b",name:"variable.language.objc"},"property-attributes":{match:"\\b(?:nonatomic|atomic|strong|weak|copy|assign|retain|readonly|readwrite|unsafe_unretained|nullable|nonnull|null_resettable)\\b",name:"storage.modifier"},"builtin-types":{match:"\\b(?:id|instancetype|BOOL|SEL|Class|IMP|NSInteger|NSUInteger|CGFloat|NSString|NSMutableString|NSArray|NSMutableArray|NSDictionary|NSMutableDictionary|NSNumber|NSObject|NSError|NSData|NSURL|NSNotification)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:YES|NO)\\b",name:"constant.language.boolean"},{match:"\\b(?:nil|Nil)\\b",name:"constant.language"}]}}},zo={scopeName:"source.perl",patterns:[{include:"#comments"},{include:"#pod"},{include:"#strings"},{include:"#variables"},{include:"#function-declaration"},{include:"#keywords"},{include:"#builtins"},{include:"#constants"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{match:"#.*$",name:"comment.line.number-sign"},pod:{begin:"^=\\w+",end:"^=cut\\b",name:"comment.block.documentation"},strings:{patterns:[{match:"qw\\s*\\(([^)]*)\\)",name:"string.quoted.other.qw"},{match:"'(?:\\\\.|[^'\\\\])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},{match:"`(?:\\\\.|[^`\\\\])*`",name:"string.interpolated.backtick"}]},variables:{match:"[$@%&][A-Za-z_]\\w*(?:::\\w+)*|\\$\\{[^}]+\\}|\\$[0-9]+|\\$[!@_/\\\\,.;]",name:"entity.name.variable"},"function-declaration":{match:"\\b(sub)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},keywords:{match:"\\b(?:my|our|local|sub|if|elsif|else|unless|while|until|for|foreach|do|return|last|next|redo|use|no|package|require|and|or|not|xor|eq|ne|lt|gt|le|ge|cmp|given|when|default)\\b",name:"keyword.control"},builtins:{match:"\\b(?:print|printf|sprintf|push|pop|shift|unshift|splice|join|split|map|grep|sort|keys|values|each|defined|exists|delete|ref|bless|die|warn|chomp|chop|length|substr|index|lc|uc|lcfirst|ucfirst|wantarray|scalar)\\b",name:"support.class.builtin"},constants:{match:"\\bundef\\b",name:"constant.language"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)\\b",name:"constant.numeric"},operators:{match:"(?:=>|->|::|\\.\\.\\.?|<=>|==|!=|<=|>=|&&|\\|\\||//|=~|!~|\\*\\*|[+\\-*/%.!<>=]=?)",name:"keyword.operator"}}},Po={scopeName:"source.php",patterns:[{match:"<\\?php\\b|<\\?=|\\?>",name:"punctuation.section.embedded"},{include:"#comments"},{include:"#attributes"},{include:"#strings"},{include:"#variables"},{include:"#class-declaration"},{include:"#function-declaration"},{include:"#keywords"},{include:"#constants"},{include:"#numbers"},{include:"#operators"},{include:"#function-call"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{match:"#(?!\\[).*$",name:"comment.line.number-sign"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},attributes:{match:"#\\[[^\\]]*\\]",name:"entity.name.decorator"},strings:{patterns:[{match:"'(?:\\\\.|[^'\\\\])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"}]},variables:{match:"\\$[A-Za-z_]\\w*",name:"entity.name.variable"},"class-declaration":{match:"\\b(class|interface|trait|enum)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},"function-declaration":{match:"\\b(function)\\s+&?([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},keywords:{match:"\\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|finally|fn|for|foreach|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|print|private|protected|public|readonly|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\b(?:true|false|TRUE|FALSE)\\b",name:"constant.language.boolean"},{match:"\\b(?:null|NULL)\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)\\b",name:"constant.numeric"},operators:{match:"(?:->|=>|::|\\?\\?=?|<=>|===|!==|==|!=|<=|>=|\\.=|&&|\\|\\||[+\\-*/%.!<>=]=?)",name:"keyword.operator"},"function-call":{match:"\\b[A-Za-z_]\\w*(?=\\s*\\()",name:"entity.name.function"}}},Uo={scopeName:"source.powershell",patterns:[{include:"#comments"},{include:"#strings"},{include:"#constants"},{include:"#variables"},{include:"#function-declaration"},{include:"#operators"},{include:"#keywords"},{include:"#parameters"},{include:"#cmdlets"},{include:"#numbers"}],repository:{comments:{patterns:[{begin:"<#",end:"#>",name:"comment.block"},{match:"#.*$",name:"comment.line.number-sign"}]},strings:{patterns:[{match:"'(?:''|[^'])*'",name:"string.quoted.single"},{match:'"(?:`.|[^"])*"',name:"string.quoted.double"}]},variables:{match:"\\$(?:\\{[^}]+\\}|[A-Za-z_][\\w:]*)",name:"entity.name.variable"},"function-declaration":{match:"\\b(function|filter)\\s+([A-Za-z_][\\w-]*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},operators:{match:"-(?:eq|ne|gt|lt|ge|le|like|notlike|match|notmatch|contains|notcontains|in|notin|and|or|not|xor|replace|split|join|is|isnot|as)\\b",name:"keyword.operator"},keywords:{match:"\\b(?:begin|break|catch|class|continue|do|dynamicparam|else|elseif|end|exit|finally|for|foreach|if|in|param|process|return|switch|throw|trap|try|until|while)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\$(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\$(?:null)\\b",name:"constant.language"}]},parameters:{match:"(?<![\\w-])-[A-Za-z][\\w]*",name:"constant.language.option"},cmdlets:{match:"\\b[A-Z][a-zA-Z]*-[A-Za-z]+\\b",name:"entity.name.function"},numbers:{match:"(?<![\\w.])-?\\d+(?:\\.\\d+)?(?:[kKmMgGtTpP][bB])?\\b",name:"constant.numeric"}}},Mo={scopeName:"source.python",patterns:[{include:"#comments"},{include:"#strings"},{include:"#decorators"},{include:"#class-declaration"},{include:"#function-declaration"},{include:"#keywords"},{include:"#constants"},{include:"#builtins"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{match:"#.*$",name:"comment.line.number-sign"},strings:{patterns:[{begin:'[rRbBfFuU]{0,2}"""',end:'"""',name:"string.quoted.triple.double"},{begin:"[rRbBfFuU]{0,2}'''",end:"'''",name:"string.quoted.triple.single"},{match:'[rRbBfFuU]{0,2}"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"[rRbBfFuU]{0,2}'(?:\\\\.|[^'\\\\\\r\\n])*'",name:"string.quoted.single"}]},decorators:{match:"@[A-Za-z_][\\w.]*",name:"entity.name.decorator"},"class-declaration":{match:"\\b(class)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},"function-declaration":{match:"\\b(def)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},keywords:{match:"\\b(?:and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\b(?:True|False)\\b",name:"constant.language.boolean"},{match:"\\b(?:None|Ellipsis|NotImplemented|__debug__)\\b",name:"constant.language"},{match:"\\b(?:self|cls)\\b",name:"variable.language.python"}]},builtins:{match:"\\b(?:abs|all|any|bool|bytearray|bytes|callable|chr|classmethod|dict|dir|divmod|enumerate|filter|float|format|frozenset|getattr|hasattr|hash|hex|id|input|int|isinstance|issubclass|iter|len|list|map|max|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip)\\b(?=\\s*\\()",name:"support.class.builtin"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\\d(?:_?\\d)*)?\\.?\\d(?:_?\\d)*(?:[eE][+-]?\\d+)?[jJ]?)\\b",name:"constant.numeric"},operators:{match:"(?::=|\\*\\*|//|<=|>=|==|!=|->|[+\\-*/%@&|^~<>=])",name:"keyword.operator"}}},Ho={scopeName:"source.r",patterns:[{include:"#comments"},{include:"#strings"},{include:"#function-declaration"},{include:"#keywords"},{include:"#builtins"},{include:"#constants"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{match:"#.*$",name:"comment.line.number-sign"},strings:{patterns:[{match:"'(?:\\\\.|[^'\\\\])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"}]},"function-declaration":{match:"\\b([A-Za-z_.][\\w.]*)\\s*(?=<-\\s*function\\b|=\\s*function\\b)",name:"entity.name.function"},keywords:{match:"\\b(?:if|else|repeat|while|function|for|next|break|in)\\b",name:"keyword.control"},builtins:{match:"\\b(?:c|list|vector|matrix|data\\.frame|print|cat|paste|paste0|sprintf|nrow|ncol|length|names|colnames|rownames|sapply|lapply|vapply|mapply|apply|Map|Filter|Reduce|library|require|source|setwd|getwd|summary|str|head|tail|is\\.na|is\\.null|as\\.character|as\\.numeric|as\\.integer|as\\.factor|as\\.data\\.frame)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:TRUE|FALSE|T|F)\\b",name:"constant.language.boolean"},{match:"\\b(?:NULL|NA|NA_integer_|NA_real_|NA_character_|NA_complex_|Inf|NaN)\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F]+|(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eE][+-]?\\d+)?[Li]?)\\b",name:"constant.numeric"},operators:{match:"(?:%[^%\\s]*%|<<-|<-|->>|->|==|!=|<=|>=|&&|\\|\\||[-+*/^!<>=&|~?:])",name:"keyword.operator"}}},Wo={scopeName:"source.ruby",patterns:[{match:"#(?!\\{).*$",name:"comment.line.number-sign"},{begin:`<<[-~]?(['"]?)([A-Z][A-Z0-9_]*)\\1`,end:"^\\2$",name:"string.unquoted.heredoc"},{match:"'(?:\\\\.|[^'\\\\])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},{match:"(?:@@|@|\\$)[a-zA-Z_][\\w]*",name:"entity.name.variable"},{match:":[a-zA-Z_][\\w]*[!?=]?",name:"constant.other.symbol"},{match:"\\b(def)\\s+([a-zA-Z_][\\w]*[!?=]?)",captures:{1:{name:"storage.type.method"},2:{name:"entity.name.function"}}},{match:"\\b(class|module)\\s+([A-Z][\\w]*(?:::[A-Z][\\w]*)*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},{match:"\\b(?:false|true)\\b",name:"constant.language.boolean"},{match:"\\bnil\\b",name:"constant.language"},{match:"\\b(?:BEGIN|END|alias|and|begin|break|case|catch|defined|do|else|elsif|ensure|for|if|in|next|not|or|redo|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\\b",name:"keyword.control"},{match:"\\b[A-Z][\\w]*(?:::[A-Z][\\w]*)*\\b",name:"entity.name.type.constant"},{match:"(?<![\\w.])-?(?:0[xX][0-9a-fA-F]+|0[bB][01]+|\\d+(?:_\\d+)*(?:\\.\\d+)?)\\b",name:"constant.numeric"}]},Ko={scopeName:"source.rust",patterns:[{include:"#comments"},{include:"#strings"},{include:"#attributes"},{include:"#function-declaration"},{include:"#type-declaration"},{include:"#macros"},{include:"#keywords"},{include:"#constants"},{include:"#builtin-types"},{include:"#lifetimes"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{begin:'b?r#"',end:'"#',name:"string.quoted.raw"},{match:'b?r"[^"]*"',name:"string.quoted.raw"},{match:'b?"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\])'",name:"string.quoted.char"}]},attributes:{match:"#!?\\[[^\\]]*\\]",name:"entity.name.decorator"},"function-declaration":{match:"\\b(fn)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},"type-declaration":{match:"\\b(struct|enum|trait|union|type)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type"},2:{name:"entity.name.type.class"}}},macros:{match:"\\b[A-Za-z_]\\w*!(?=\\s*[\\(\\[{])",name:"entity.name.function.macro"},keywords:{match:"\\b(?:as|async|await|break|const|continue|crate|dyn|else|enum|extern|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|type|union|unsafe|use|where|while)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\b(?:None|Some|Ok|Err)\\b",name:"constant.language"}]},"builtin-types":{match:"\\b(?:bool|char|str|String|i8|i16|i32|i64|i128|isize|u8|u16|u32|u64|u128|usize|f32|f64|Vec|Option|Result|Box|Rc|Arc|RefCell|HashMap|HashSet)\\b",name:"support.class.builtin"},lifetimes:{match:"'[a-z_]\\w*\\b",name:"variable.language.lifetime"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)(?:[iuf](?:8|16|32|64|128|size))?\\b",name:"constant.numeric"},operators:{match:"(?:->|=>|::|\\.\\.=?|&&|\\|\\||==|!=|<=|>=|<<|>>|[+\\-*/%&|^!<>=]=?)",name:"keyword.operator"}}},Vo={scopeName:"source.svelte",dependencies:["html","css","scss","javascript","typescript"],patterns:[{include:"#comments"},{include:"#typescript"},{include:"#javascript"},{include:"#scss"},{include:"#css"},{include:"#blocks"},{include:"#interpolation"},{include:"#tags"},{include:"text.html.basic"}],repository:{comments:{begin:"<!--",end:"-->",name:"comment.block"},typescript:{begin:`<(script)\\b(?=[^>]*\\blang\\s*=\\s*(['"])(?:ts|typescript)\\2)[^>]*>`,end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.ts.embedded.svelte",patterns:[{include:"source.ts"}]},javascript:{begin:"<(script)\\b[^>]*>",end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.js.embedded.svelte",patterns:[{include:"source.js"}]},scss:{begin:`<(style)\\b(?=[^>]*\\blang\\s*=\\s*(['"])scss\\2)[^>]*>`,end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.scss.embedded.svelte",patterns:[{include:"source.scss"}]},css:{begin:"<(style)\\b[^>]*>",end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.embedded.svelte",patterns:[{include:"source.css"}]},blocks:{match:"\\{([#/:@])\\s*(if|else|each|key|await|then|catch|snippet|render|html|debug|const)\\b",captures:{1:{name:"punctuation.definition.keyword"},2:{name:"keyword.control"}}},interpolation:{begin:"\\{(?![#/:@])",end:"\\}",beginCaptures:{0:{name:"punctuation.section.embedded.begin"}},endCaptures:{0:{name:"punctuation.section.embedded.end"}},contentName:"source.js.embedded.svelte",patterns:[{include:"source.js"}]},tags:{begin:"<(/?)([a-zA-Z][\\w.:-]*)",end:">",beginCaptures:{2:{name:"entity.name.tag"}},patterns:[{include:"#directive"},{include:"#shorthand"},{include:"text.html.basic#inline-css"},{include:"text.html.basic#attributes"},{include:"text.html.basic#unquoted-attributes"},{include:"text.html.basic#boolean-attributes"}]},directive:{match:"[ \\t]+((?:bind|on|class|use|transition|in|out|animate|let):[\\w-]+(?:\\|[\\w-]+)*)",captures:{1:{name:"entity.other.attribute-name"}}},shorthand:{begin:"[ \\t]+\\{",end:"\\}",contentName:"source.js.embedded.svelte",patterns:[{include:"source.js"}]}}},Zo={scopeName:"source.toml",patterns:[{include:"#comments"},{include:"#table-headers"},{include:"#datetime"},{include:"#strings"},{include:"#keys"},{include:"#constants"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{match:"#.*$",name:"comment.line.number-sign"},"table-headers":{match:"^\\s*(\\[\\[?)([^\\[\\]]+)(\\]\\]?)\\s*$",captures:{1:{name:"punctuation.definition.table"},2:{name:"entity.name.type.class"},3:{name:"punctuation.definition.table"}}},strings:{patterns:[{begin:'"""',end:'"""',name:"string.quoted.triple.double"},{begin:"'''",end:"'''",name:"string.quoted.triple.single"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'[^'\\r\\n]*'",name:"string.quoted.single"}]},keys:{match:`^\\s*((?:[A-Za-z0-9_-]+|"(?:\\\\.|[^"\\\\])*"|'[^']*')(?:\\s*\\.\\s*(?:[A-Za-z0-9_-]+|"(?:\\\\.|[^"\\\\])*"|'[^']*'))*)\\s*(?==)`,captures:{1:{name:"entity.name.key"}}},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\b(?:inf|nan)\\b",name:"constant.language"}]},datetime:{match:"\\b\\d{4}-\\d{2}-\\d{2}(?:[Tt ]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:[Zz]|[+-]\\d{2}:\\d{2})?)?\\b",name:"constant.other.date-time"},numbers:{match:"(?<![\\w.])[+-]?(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)\\b",name:"constant.numeric"},operators:{match:"=",name:"keyword.operator"}}},Jo={scopeName:"source.tsx",dependencies:["javascript","typescript"],patterns:[{include:"source.js#comments"},{include:"source.js#strings"},{include:"source.js#template"},{include:"source.js#regexp"},{include:"source.js#jsx-closing-tag"},{include:"source.js#jsx-tag"},{include:"source.ts#type-declaration"},{include:"source.js#class-declaration"},{include:"source.js#function-declaration"},{include:"source.js#variable-declaration"},{include:"source.ts#type-keywords"},{include:"source.js#keywords"},{include:"source.js#numbers"},{include:"source.js#constants"},{include:"source.ts#builtin-types"},{include:"source.js#decorators"},{include:"source.js#private-fields"},{include:"source.js#properties"},{include:"source.js#functions"},{include:"source.js#built-ins"},{include:"source.js#operators"}]},Go={scopeName:"source.ts",dependencies:["javascript"],patterns:[{include:"source.js#comments"},{include:"source.js#strings"},{include:"source.js#template"},{include:"source.js#regexp"},{include:"#type-declaration"},{include:"source.js#class-declaration"},{include:"source.js#function-declaration"},{include:"source.js#variable-declaration"},{include:"#type-keywords"},{include:"source.js#keywords"},{include:"source.js#numbers"},{include:"source.js#constants"},{include:"#builtin-types"},{include:"source.js#decorators"},{include:"source.js#private-fields"},{include:"source.js#properties"},{include:"source.js#functions"},{include:"source.js#built-ins"},{include:"source.js#operators"}],repository:{"type-declaration":{match:"\\b(interface|enum|namespace|module|type)\\s+([A-Za-z_$][\\w$]*)",captures:{1:{name:"storage.type"},2:{name:"entity.name.type.class"}}},"type-keywords":{match:"\\b(?:abstract|accessor|asserts|declare|infer|keyof|override|readonly|satisfies|unique)\\b",name:"keyword.control.ts"},"builtin-types":{match:"\\b(?:any|bigint|boolean|never|number|object|string|symbol|undefined|unknown|void)\\b",name:"support.class.builtin"}}},Xo={scopeName:"text.html.vue",dependencies:["html","css","scss","javascript","typescript"],patterns:[{include:"#comments"},{include:"#typescript"},{include:"#javascript"},{include:"#scss"},{include:"#css"},{include:"#interpolation"},{include:"#tags"},{include:"text.html.basic"}],repository:{comments:{begin:"<!--",end:"-->",name:"comment.block"},typescript:{begin:`<(script)\\b(?=[^>]*\\blang\\s*=\\s*(['"])(?:ts|typescript)\\2)[^>]*>`,end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.ts.embedded.vue",patterns:[{include:"source.ts"}]},javascript:{begin:"<(script)\\b[^>]*>",end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.js.embedded.vue",patterns:[{include:"source.js"}]},scss:{begin:`<(style)\\b(?=[^>]*\\blang\\s*=\\s*(['"])scss\\2)[^>]*>`,end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.scss.embedded.vue",patterns:[{include:"source.scss"}]},css:{begin:"<(style)\\b[^>]*>",end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.embedded.vue",patterns:[{include:"source.css"}]},interpolation:{begin:"\\{\\{",end:"\\}\\}",beginCaptures:{0:{name:"punctuation.section.embedded.begin"}},endCaptures:{0:{name:"punctuation.section.embedded.end"}},contentName:"source.js.embedded.vue",patterns:[{include:"source.js"}]},tags:{begin:"<(/?)([a-zA-Z][\\w.:-]*)",end:">",beginCaptures:{2:{name:"entity.name.tag"}},patterns:[{include:"#directive-value"},{include:"#directive"},{include:"text.html.basic#inline-css"},{include:"text.html.basic#attributes"},{include:"text.html.basic#unquoted-attributes"},{include:"text.html.basic#boolean-attributes"}]},"directive-value":{begin:`[ \\t]+((?:v-[\\w-]+(?::[\\w-]+)?|[:@#][\\w-]+)(?:\\.[\\w-]+)*)\\s*=\\s*(['"])`,end:"\\2",beginCaptures:{1:{name:"entity.other.attribute-name"},2:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},contentName:"source.js.embedded.vue",patterns:[{include:"source.js"}]},directive:{match:"[ \\t]+((?:v-[\\w-]+(?::[\\w-]+)?|[:@#][\\w-]+)(?:\\.[\\w-]+)*)",captures:{1:{name:"entity.other.attribute-name"}}}}},Yo={scopeName:"source.yaml",patterns:[{match:"#.*$",name:"comment.line.number-sign"},{match:"^(?:---|\\.\\.\\.)\\s*$|^%YAML\\b.*$",name:"keyword.control.document"},{match:"^\\s*(?:-\\s+)?([^#\\s][^\\r\\n:#]*?)(?=\\s*:)",captures:{1:{name:"entity.name.key"}}},{match:"[&*][a-zA-Z_][\\w-]*|![^\\s]+",name:"entity.name.anchor"},{match:`(['"])(?:\\\\.|(?!\\1)[^\\\\\\r\\n]|\\r?\\n[ \\t]+)*\\1`,name:"string.quoted"},{match:"(?<=:\\s)[|>][-+]?\\s*$",name:"keyword.control.block-scalar"},{match:"\\b(?:true|false|yes|no|on|off)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b|~",name:"constant.language"},{match:"(?<![\\w.-])-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:e[+-]?\\d+)?\\b",name:"constant.numeric"}]},Qo={scopeName:"source.http",patterns:[{match:"^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|TRACE|CONNECT)\\s+([^\\s]+)\\s+(HTTP\\/[0-9.]+)",captures:{1:{name:"keyword.control.http"},2:{name:"string.unquoted.http"},3:{name:"keyword.other.http"}}},{match:"^(HTTP\\/[0-9.]+)\\s+([0-9]{3})(?:\\s+(.*))?",captures:{1:{name:"keyword.other.http"},2:{name:"constant.numeric.http"},3:{name:"string.unquoted.http"}}},{match:"^([a-zA-Z0-9_-]+):\\s*(.*)",captures:{1:{name:"support.type.property-name.http"},2:{name:"string.unquoted.http"}}}]},Sr={astro:Ao,bash:Do,c:Co,cpp:Fo,csharp:To,css:Oo,go:No,html:Bo,http:Qo,java:Lo,javascript:Io,json:_o,kotlin:Ro,markdown:jo,"objective-c":qo,perl:zo,php:Po,powershell:Uo,python:Mo,r:Ho,ruby:Wo,rust:Ko,svelte:Vo,toml:Zo,tsx:Jo,typescript:Go,vue:Xo,yaml:Yo},Er=new Map;Object.values(Sr).forEach(n=>{n!=null&&n.scopeName&&Er.set(n.scopeName,n)});const el={"c++":"cpp",cs:"csharp",curl:"bash",js:"javascript",jsx:"javascript",markup:"html",md:"markdown",objc:"objective-c",ps1:"powershell",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"html",ts:"typescript",xml:"html",yml:"yaml",zsh:"bash"},tl={indices:[[1/0,1/0]]},bt=new Map,nl=n=>{const e=n.split("."),[t,a,r]=e,s=e.at(-1);if(t==="markup"&&["quote","inserted","deleted","raw"].includes(a))return a;if(t==="entity"&&a==="name")return r;if(n.startsWith("constant.character.entity"))return"character-entity";if(e.includes("numeric"))return"numeric";if(n.startsWith("support.type.property-name"))return"property";if(e.includes("attribute-value"))return"attribute-value";if(n.startsWith("string.other.link"))return"link";if(["doctype","at-rule","important","regexp","boolean","symbol","operator","attribute-name"].includes(s))return s;if(["comment","string","constant","storage","keyword","variable","punctuation","entity","support"].includes(t))return t},Wt=(n,e,t,a)=>{const r=nl(a);if(!r||e===t)return;const s=new Range;s.setStart(n,e),s.setEnd(n,t),bt.has(r)||bt.set(r,new Highlight),bt.get(r).add(s)},Pn=(n,e,t={})=>{Object.entries(t).forEach(([a,r])=>{const s=e.indices[+a];s&&Wt(n,...s,r.name)})},al=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),rl=(n,e)=>n.replace(/\\(\d+)/g,(t,a)=>e[a]===void 0?t:al(e[a])),Ar=n=>n?Array.isArray(n)?n:n.match||n.begin||n.include?[n]:n.patterns||[]:[],sl=(n,e,t)=>{var a,r;if(n==="$self")return{grammar:e,rules:e.patterns};if(n==="$base")return{grammar:t,rules:t.patterns};if(n[0]==="#")return{grammar:e,rules:Ar((a=e.repository)==null?void 0:a[n.slice(1)])};const[s,i]=n.split("#"),o=Er.get(s);return o?{grammar:o,rules:i?Ar((r=o.repository)==null?void 0:r[i]):o.patterns}:null},Dr=(n,e,t,a=new Set)=>{const r=[];return n.forEach(s=>{if(s.include){const i=`${e.scopeName}:${s.include}`;if(a.has(i))return;const o=sl(s.include,e,t);if(!o)return;const l=new Set(a);l.add(i),r.push(...Dr(o.rules,o.grammar,t,l));return}(s.match||s.begin&&s.end)&&r.push({grammar:e,rule:s})}),r},Un=new Map;let Mn=new Map;const Cr=(n,e,t,a)=>{let r=Mn.get(n);if(!r||r.indices[0][0]<t){Un.has(n)||Un.set(n,new RegExp(n,"dgm"));const s=Un.get(n);s.lastIndex=t,r=s.exec(e.data)||tl,Mn.set(n,r)}return r.indices[0][0]<a&&r.indices[0][1]<=a?r:null},il=(n,e,t,a)=>{let r=null;return e.forEach(s=>{const i=s.rule.match||s.rule.begin,o=Cr(i,n,t,a);o&&(!r||o.indices[0][0]<r.match.indices[0][0])&&(r={...s,match:o})}),r},Fr=(n,e,t,a,r,s=r,i=null)=>{const o=Dr(e,r,s);let l=t;for(;l<a;){const c=il(n,o,l,a),d=i?Cr(i.pattern,n,l,a):null,p=c?.match.indices[0][0]??1/0,h=d?.indices[0][0]??1/0;if(d&&(h<p||h===p&&!(i!=null&&i.applyEndPatternLast)))return{contentEnd:h,end:d.indices[0][1],match:d};if(!c)return{contentEnd:a,end:a,match:null};const{rule:m,match:b,grammar:g}=c;if(m.match){m.name&&Wt(n,...b.indices[0],m.name),Pn(n,b,m.captures),l=b.indices[0][1]>l?b.indices[0][1]:l+1;continue}const f=Fr(n,m.patterns||[],b.indices[0][1],a,g,s,{pattern:rl(m.end,b),applyEndPatternLast:m.applyEndPatternLast});m.name&&Wt(n,b.indices[0][0],f.end,m.name),m.contentName&&Wt(n,b.indices[0][1],f.contentEnd,m.contentName),Pn(n,b,m.beginCaptures||m.captures),f.match&&Pn(n,f.match,m.endCaptures||m.captures),l=f.end>l?f.end:l+1}return{contentEnd:a,end:a,match:null}},Tr=n=>{var e,t,a;const r=n.parentElement,s=i=>{var o;return!i||!i.classList?null:(o=[...i.classList].find(l=>l.startsWith("language-")))==null?void 0:o.slice(9)};return(s(n)||((e=n.dataset)==null?void 0:e.language)||s(r)||((t=r?.dataset)==null?void 0:t.language)||((a=r?.getAttribute)==null?void 0:a.call(r,"lang"))||"").toLowerCase()},ol=n=>el[n]||n,ll=(n=document)=>{const e=[],t=new Set,a=r=>{if(!(!r||t.has(r))&&(t.add(r),r.querySelectorAll)){const s=r.querySelectorAll("pre > code");e.push(...s);const i=r.querySelectorAll("*");for(let o=0;o<i.length;o++){const l=i[o];l.shadowRoot&&a(l.shadowRoot)}}};return a(n),e};let Hn=!1;const cl=(n=document)=>{if(typeof window>"u"||typeof CSS>"u"||!CSS.highlights)return;const e=ll(n).filter(Tr);e.length!==0&&(bt.forEach((t,a)=>{CSS.highlights.get(a)===t&&CSS.highlights.delete(a),t.clear()}),e.forEach(t=>{const a=Tr(t),r=ol(a),s=Sr[r];if(!s)return;Array.from(t.childNodes).forEach(o=>{o.nodeType===Node.COMMENT_NODE&&t.removeChild(o)}),t.normalize();const i=t.firstChild;!i||i.nodeType!==Node.TEXT_NODE||(Mn=new Map,Fr(i,s.patterns,0,i.data.length,s))}),bt.forEach((t,a)=>{t.size&&CSS.highlights.set(a,t)}))},Kt=(n=document)=>{Hn||(Hn=!0,requestAnimationFrame(()=>{Hn=!1,cl(n)}))},Ce=U`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);text-wrap:balance;font-weight:400}.sub-title{text-wrap:balance;font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);text-align:start;text-wrap:balance;margin-bottom:8px;font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{max-height:var(--resp-area-height,400px);color:var(--fg3);overflow:scroll}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.options,.method-fg.head,.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:28px;font-weight:400}h2{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:24px;font-weight:400}h3{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:18px;font-weight:400}h4{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:16px;font-weight:400}h5,h6{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:14px;font-weight:400}h1,h2,h3,h4,h5,h6{text-wrap:balance;margin-block-end:.2em}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);cursor:text;text-decoration:none}code,pre{font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px);margin:0}.m-markdown,.m-markdown-small{display:block}.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 8px)}.m-markdown li{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 10px)}.m-markdown-small p,.m-markdown-small span,.m-markdown-small li{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown-small li{line-height:calc(var(--font-size-small) + 8px)}.m-markdown p:not(:first-child){margin-block-start:24px}.m-markdown-small p:not(:first-child){margin-block-start:12px}.m-markdown-small p:first-child{margin-block-start:0}.m-markdown p,.m-markdown-small p{margin-block-end:0}.m-markdown code span{font-size:var(--font-size-mono)}.m-markdown-small code,.m-markdown code{color:var(--inline-code-fg);font-size:calc(var(--font-size-mono));border-radius:2px;padding:1px 6px;line-height:1.2}.m-markdown-small code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown-small pre,.m-markdown pre{white-space:pre-wrap;border:1px solid var(--code-border-color);border-radius:2px;line-height:normal;overflow-x:auto}.m-markdown pre{background:var(--code-bg);color:var(--code-fg);padding:12px}.m-markdown-small pre{background:var(--bg3);color:var(--fg2);margin-top:4px;padding:2px 4px}.m-markdown-small pre code,.m-markdown pre code{border:none;padding:0}.m-markdown pre code{color:var(--code-fg)}.m-markdown-small pre code{color:var(--fg2);background:var(--bg3)}.m-markdown ul,.m-markdown ol{padding-inline-start:30px}.m-markdown-small ul,.m-markdown-small ol{padding-inline-start:20px}.m-markdown-small a,.m-markdown a{color:var(--blue)}.m-markdown-small img,.m-markdown img{max-width:100%}.m-markdown-small table,.m-markdown table{border-spacing:0;border-collapse:separate;border:1px solid var(--border-color);border-radius:var(--border-radius);font-size:calc(var(--font-size-small) + 1px);line-height:calc(var(--font-size-small) + 4px);max-width:100%;margin:10px 0}.m-markdown-small table{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 2px);margin:8px 0}.m-markdown-small td,.m-markdown-small th,.m-markdown td,.m-markdown th{vertical-align:top;border-top:1px solid var(--border-color);line-height:calc(var(--font-size-small) + 4px)}.m-markdown-small tr:first-child th,.m-markdown tr:first-child th{border-top:0}.m-markdown th,.m-markdown td{padding:10px 12px}.m-markdown-small th,.m-markdown-small td{padding:8px}.m-markdown th,.m-markdown-small th{background:var(--bg2);vertical-align:middle;font-weight:600}.m-markdown-small table code{font-size:calc(var(--font-size-mono) - 2px)}.m-markdown table code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown blockquote,.m-markdown-small blockquote{border-inline-start:3px solid var(--border-color);margin-inline:0;padding:6px 0 6px 6px}.m-markdown hr{border:1px solid var(--border-color)}`,yt=U`.m-btn{border-radius:var(--border-radius);font-weight:600;font-size:var(--font-size-small);text-align:center;white-space:nowrap;border:2px solid var(--primary-color);user-select:none;cursor:pointer;background:0 0;outline:0;padding:6px 16px;line-height:1;transition-duration:.75s;display:inline-block;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d}.m-btn.primary{background:var(--primary-color);color:var(--primary-color-invert)}.m-btn.thin-border{border-width:1px}.m-btn.large{padding:8px 14px}.m-btn.small{padding:5px 12px}.m-btn.tiny{padding:5px 6px}.m-btn.circle{border-radius:50%}.m-btn:hover{background:var(--primary-color);color:var(--primary-color-invert)}.m-btn.nav{border:2px solid var(--nav-accent-color)}.m-btn.nav:hover{background:var(--nav-accent-color)}.m-btn:disabled{background:var(--bg3);color:var(--fg3);border-color:var(--fg3);cursor:not-allowed;opacity:.4}.m-btn:active{filter:brightness(75%);transition:scale;transform:scale(.95)}.toolbar-btn{cursor:pointer;font-size:var(--font-size-small);min-width:50px;color:var(--primary-color-invert);background:var(--primary-color);border:none;border-radius:2px;margin:0 2px;padding:4px}input,textarea,select,button,pre{color:var(--fg);background:var(--input-bg);border:1px solid var(--border-color);border-radius:var(--border-radius);outline:none}button{font-family:var(--font-regular)}pre,select,textarea,input[type=file],input[type=text],input[type=password]{font-family:var(--font-mono);font-weight:400;font-size:var(--font-size-small);padding:6px 5px;transition:border .2s}select{font-family:var(--font-regular);-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;background-image:url(data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20d%3D%22M10.3%203.3L6%207.6%201.7%203.3A1%201%200%2000.3%204.7l5%205a1%201%200%20001.4%200l5-5a1%201%200%2010-1.4-1.4z%22%20fill%3D%22%23777777%22%2F%3E%3C%2Fsvg%3E);background-position:calc(100% - 5px);background-repeat:no-repeat;background-size:10px;padding:5px 30px 5px 5px}select:hover{border-color:var(--primary-color)}textarea::placeholder,input[type=text]::placeholder,input[type=password]::placeholder{color:var(--placeholder-color);opacity:1}input[type=file]{font-family:var(--font-regular);cursor:pointer;border:1px solid var(--primary-color);min-height:calc(var(--font-size-small) + 18px);padding:2px}input[type=file]::file-selector-button,input[type=file]::-webkit-file-upload-button{font-family:var(--font-regular);font-size:var(--font-size-small);cursor:pointer;border:1px solid var(--primary-color);background:var(--primary-color);color:var(--primary-color-invert);border-radius:var(--border-radius);-webkit-appearance:none;outline:none;padding:3px 8px}input[type=file]::file-selector-button,input[type=file]::file-selector-button{font-family:var(--font-regular);font-size:var(--font-size-small);cursor:pointer;border:1px solid var(--primary-color);background:var(--primary-color);color:var(--primary-color-invert);border-radius:var(--border-radius);-webkit-appearance:none;outline:none;padding:3px 8px}pre,textarea{scrollbar-width:thin;scrollbar-color:var(--border-color) var(--input-bg)}pre::-webkit-scrollbar,textarea::-webkit-scrollbar{width:8px;height:8px}pre::-webkit-scrollbar-track,textarea::-webkit-scrollbar-track{background:var(--input-bg)}pre::-webkit-scrollbar-thumb,textarea::-webkit-scrollbar-thumb{background:var(--border-color);border-radius:2px}.link{font-size:var(--font-size-small);color:var(--blue);font-family:var(--font-mono);margin-bottom:2px;text-decoration:underline}input[type=checkbox]{appearance:none;background:var(--light-bg);border:1px solid var(--light-bg);cursor:pointer;vertical-align:top;border-radius:9px;width:36px;min-width:36px;height:18px;transition:border .25s .15s,box-shadow .25s .3s,padding .25s;display:inline-block;position:relative}input[type=checkbox]:after{background:var(--bg);border:1px solid var(--light-bg);content:"";border-radius:8px;height:16px;transition:border .25s .15s,left .25s .1s,right .15s .175s;display:block;position:absolute;top:0;left:0;right:16px}input[type=checkbox]:checked{background:var(--green);border-color:var(--green)}input[type=checkbox]:checked:after{border:1px solid var(--green);transition:border .25s,left .15s .25s,right .25s .175s;left:16px;right:1px}`,Vt=U`.row,.col{display:flex}.row{flex-direction:row;align-items:center}.col{flex-direction:column;align-items:stretch}`,Zt=U`.m-table{border-spacing:0;border-collapse:separate;border:1px solid var(--light-border-color);border-radius:var(--border-radius);direction:ltr;max-width:100%;margin:0}.m-table tr:first-child td,.m-table tr:first-child th{border-top:0}.m-table td,.m-table th{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 4px);vertical-align:top;padding:4px 5px}.m-table.padded-12 td,.m-table.padded-12 th{padding:12px}.m-table td:not([align]),.m-table th:not([align]){text-align:start}.m-table th{color:var(--fg2);font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 18px);letter-spacing:normal;background:var(--bg2);vertical-align:bottom;border-bottom:1px solid var(--light-border-color);font-weight:600}.m-table>tbody>tr>td,.m-table>tr>td{border-top:1px solid var(--light-border-color);text-overflow:ellipsis;overflow:hidden}.table-title{font-size:var(--font-size-small);vertical-align:middle;margin:12px 0 4px;font-weight:700}`,Or=U`.only-large-screen{display:none}.endpoint-head .path{font-family:var(--font-mono);font-size:var(--font-size-small);overflow-wrap:break-word;word-break:break-all;align-items:center;display:flex}.endpoint-head .descr{font-size:var(--font-size-small);color:var(--light-fg);overflow-wrap:break-word;word-break:break-all;align-items:center;font-weight:400;display:none}.m-endpoint.expanded{margin-bottom:16px}.m-endpoint>.endpoint-head{border:1px solid #0000;border-left-width:5px;border-top-color:var(--light-border-color);cursor:pointer;align-items:center;padding:6px 16px;display:flex}.m-endpoint>.endpoint-head.put:hover,.m-endpoint>.endpoint-head.put.expanded{border-color:var(--orange);background:color-mix(in srgb, var(--orange) 10%, transparent)}.m-endpoint>.endpoint-head.post:hover,.m-endpoint>.endpoint-head.post.expanded{border-color:var(--green);background:color-mix(in srgb, var(--green) 10%, transparent)}.m-endpoint>.endpoint-head.get:hover,.m-endpoint>.endpoint-head.get.expanded{border-color:var(--blue);background:color-mix(in srgb, var(--blue) 10%, transparent)}.m-endpoint>.endpoint-head.delete:hover,.m-endpoint>.endpoint-head.delete.expanded{border-color:var(--red);background:color-mix(in srgb, var(--red) 10%, transparent)}.m-endpoint>.endpoint-head.head:hover,.m-endpoint>.endpoint-head.head.expanded,.m-endpoint>.endpoint-head.patch:hover,.m-endpoint>.endpoint-head.patch.expanded,.m-endpoint>.endpoint-head.options:hover,.m-endpoint>.endpoint-head.options.expanded{border-color:var(--yellow);background:color-mix(in srgb, var(--yellow) 10%, transparent)}.m-endpoint>.endpoint-head.deprecated:hover,.m-endpoint>.endpoint-head.deprecated.expanded{border-color:var(--border-color);filter:opacity(.6)}.m-endpoint .endpoint-body{border-style:solid;border-width:0 1px 1px 5px;flex-wrap:wrap;padding:16px 0 0;box-shadow:0 4px 3px -3px #00000026}.m-endpoint .endpoint-body.delete{border-color:var(--red)}.m-endpoint .endpoint-body.put{border-color:var(--orange)}.m-endpoint .endpoint-body.post{border-color:var(--green)}.m-endpoint .endpoint-body.get{border-color:var(--blue)}.m-endpoint .endpoint-body.head,.m-endpoint .endpoint-body.patch,.m-endpoint .endpoint-body.options{border-color:var(--yellow)}.m-endpoint .endpoint-body.deprecated{border-color:var(--border-color);filter:opacity(.6)}.endpoint-head .deprecated{color:var(--light-fg);filter:opacity(.6)}.summary{padding:8px}.summary .title{font-size:calc(var(--font-size-regular) + 2px);word-break:break-all;margin-bottom:6px}.endpoint-head .method{vertical-align:middle;font-size:var(--font-size-small);height:calc(var(--font-size-small) + 16px);line-height:calc(var(--font-size-small) + 8px);text-align:center;text-transform:uppercase;border-radius:2px;width:60px;margin-inline-end:5px;padding:2px 5px;font-weight:700;display:inline-block}.endpoint-head .method.delete{border:2px solid var(--red)}.endpoint-head .method.put{border:2px solid var(--orange)}.endpoint-head .method.post{border:2px solid var(--green)}.endpoint-head .method.get{border:2px solid var(--blue)}.endpoint-head .method.get.deprecated{border:2px solid var(--border-color)}.endpoint-head .method.head,.endpoint-head .method.patch,.endpoint-head .method.options{border:2px solid var(--yellow)}.req-resp-container{border-top:1px solid var(--light-border-color);flex-flow:column wrap;align-items:stretch;margin-top:16px;display:flex}.view-mode-request,api-response.view-mode{flex:1;min-height:100px;padding:16px 8px;overflow:hidden}.view-mode-request{border-style:dashed;border-width:0 0 1px}.head .view-mode-request,.patch .view-mode-request,.options .view-mode-request{border-color:var(--yellow)}.put .view-mode-request{border-color:var(--orange)}.post .view-mode-request{border-color:var(--green)}.get .view-mode-request{border-color:var(--blue)}.delete .view-mode-request{border-color:var(--red)}@container (width>=1024px){.only-large-screen{display:block}.endpoint-head .path{font-size:var(--font-size-regular)}.endpoint-head .descr{display:flex}.endpoint-head .m-markdown-small,.descr .m-markdown-small{display:block}.req-resp-container{flex-direction:var(--layout,row);flex-wrap:nowrap}api-response.view-mode{padding:16px}.view-mode-request.row-layout{border-width:0 1px 0 0;padding:16px}.summary{padding:8px 16px}}`,Wn=U`code[class*=language-],pre[class*=language-]{text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;tab-size:2;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;line-height:1.5}pre[class*=language-]{margin:.5em 0;padding:1em;overflow:auto}:not(pre)>code[class*=language-]{white-space:normal}::highlight(comment),::highlight(quote){color:var(--syntax-comment,#6e7781)}::highlight(keyword),::highlight(storage),::highlight(at-rule),::highlight(doctype),::highlight(important),::highlight(section){color:var(--syntax-keyword,#cf222e)}::highlight(operator),::highlight(punctuation){color:var(--syntax-operator,#24292f)}::highlight(string),::highlight(regexp),::highlight(attribute-value),::highlight(link),::highlight(raw){color:var(--syntax-string,#0a3069)}::highlight(numeric),::highlight(boolean),::highlight(constant),::highlight(symbol),::highlight(character-entity),::highlight(anchor),::highlight(entity){color:var(--syntax-constant,#0550ae)}::highlight(function),::highlight(decorator),::highlight(animation){color:var(--syntax-function,#8250df)}::highlight(type),::highlight(support){color:var(--syntax-type,#8250df)}::highlight(variable),::highlight(interpolation){color:var(--syntax-variable,#953800)}::highlight(property),::highlight(key),::highlight(attribute-name){color:var(--syntax-property,#0550ae)}::highlight(tag){color:var(--syntax-tag,#116329)}::highlight(selector){color:var(--syntax-selector,#8250df)}::highlight(inserted){color:var(--syntax-inserted,#116329)}::highlight(deleted){color:var(--syntax-deleted,#cf222e)}`,Jt=U`.tab-panel{border:none}.tab-buttons{border-bottom:1px solid var(--light-border-color);scrollbar-width:thin;align-items:stretch;height:30px;padding:4px 4px 0;overflow:auto hidden}.tab-buttons::-webkit-scrollbar{background:var(--border-color);height:1px}.tab-btn{color:var(--light-fg);white-space:nowrap;cursor:pointer;font-family:var(--font-regular);font-size:var(--font-size-small);background:0 0;border:none;border-bottom:3px solid #0000;outline:none;margin-inline-end:16px;padding:1px}.tab-btn.active{border-bottom:3px solid var(--primary-color);color:var(--primary-color);font-weight:700}.tab-btn:hover{color:var(--primary-color)}.tab-content{min-height:50px;margin:-1px 0 0;position:relative}`,Nr=U`#advanced-search-btn{display:none}#nav-bar-btn{background:var(--bg2);width:50px;height:50px;color:var(--fg1);border:1px solid var(--border-color);cursor:pointer;z-index:10;border-radius:4px;font-size:36px;line-height:30px;position:absolute;top:16px;right:16px;box-shadow:0 12px 16px #0000003d,0 17px 50px #00000030;&:hover{border-color:var(--primary-color);color:var(--primary-color)}}.nav-bar{width:0;height:100%;color:var(--nav-text-color);background:var(--nav-bg-color);background-blend-mode:multiply;line-height:calc(var(--font-size-small) + 4px);word-break:break-word;flex-flow:column;position:relative;overflow:hidden;&.floating-nav{z-index:5;width:330px;position:absolute;top:0;left:0;overflow:scroll}}.nav-bar-info:focus-visible,.nav-bar-tag:focus-visible,.nav-bar-path:focus-visible{box-shadow:none;outline-offset:-4px;outline:1px solid}.nav-bar-expand-all:focus-visible,.nav-bar-collapse-all:focus-visible,.nav-bar-tag-icon:focus-visible{box-shadow:none;outline-offset:2px;outline:1px solid}::slotted([slot=nav-logo]){object-fit:contain;width:auto;height:60px;padding:16px 16px 0}.nav-scroll{overflow:hidden auto;overflow-y:overlay;scrollbar-width:thin;scrollbar-color:var(--nav-hover-bg-color) transparent}.nav-bar-tag{flex-direction:row;justify-content:space-between;align-items:center;display:flex}.nav-bar.read .nav-bar-tag-icon{display:none}.nav-bar-paths-under-tag{transition:max-height .2s ease-out,visibility .3s;overflow:hidden}.collapsed .nav-bar-paths-under-tag{visibility:hidden;max-height:0}.nav-bar-expand-all{cursor:pointer;margin-inline-end:10px;transform:rotate(90deg)}.nav-bar-collapse-all{cursor:pointer;transform:rotate(270deg)}.nav-bar-expand-all:hover,.nav-bar-collapse-all:hover{color:var(--primary-color)}.nav-bar-tag-icon{color:var(--nav-text-color);font-size:20px}.nav-bar-tag-icon:hover{color:var(--nav-hover-text-color)}.nav-bar.focused .nav-bar-tag-and-paths.collapsed .nav-bar-tag-icon:after{content:"⌵";text-align:center;width:16px;height:16px;transition:transform .2s ease-out;display:inline-block;transform:rotate(-90deg)}.nav-bar.focused .nav-bar-tag-and-paths.expanded .nav-bar-tag-icon:after{content:"⌵";text-align:center;width:16px;height:16px;transition:transform .2s ease-out;display:inline-block}.nav-scroll::-webkit-scrollbar{width:var(--scroll-bar-width,8px)}.nav-scroll::-webkit-scrollbar-track{background:0 0}.nav-scroll::-webkit-scrollbar-thumb{background:var(--nav-hover-bg-color)}.nav-bar-tag{font-size:var(--font-size-regular);color:var(--nav-accent-color);text-transform:capitalize;border-inline-start:4px solid #0000;padding:15px 15px 15px 10px;font-weight:700}.nav-bar-components,.nav-bar-h1,.nav-bar-h2,.nav-bar-info,.nav-bar-tag,.nav-bar-path{cursor:pointer;width:100%;color:var(--nav-text-color);background:0 0;border:none;border-inline-start:4px solid #0000;border-radius:4px;display:flex}.nav-bar-h1,.nav-bar-h2,.nav-bar-path{font-size:calc(var(--font-size-small) + 1px);padding:var(--nav-item-padding)}.nav-bar-path.small-font{font-size:var(--font-size-small)}.nav-bar-info{font-size:var(--font-size-regular);padding:16px 10px;font-weight:700}.nav-bar-section{font-size:var(--font-size-small);color:var(--nav-text-color);padding:var(--nav-item-padding);flex-direction:row;justify-content:space-between;font-weight:700;display:flex}.nav-bar-section.operations{cursor:pointer}.nav-bar-section.operations:hover{color:var(--nav-hover-text-color);background:var(--nav-hover-bg-color)}.nav-bar-section:first-child{display:none}.nav-bar-h2{padding-inline-start:28px}.nav-bar-h1.left-bar.active,.nav-bar-h2.left-bar.active,.nav-bar-info.left-bar.active,.nav-bar-tag.left-bar.active,.nav-bar-path.left-bar.active,.nav-bar-section.left-bar.operations.active{border-inline-start:4px solid var(--nav-accent-color);color:var(--nav-hover-text-color)}.nav-bar-h1.colored-block.active,.nav-bar-h2.colored-block.active,.nav-bar-info.colored-block.active,.nav-bar-tag.colored-block.active,.nav-bar-path.colored-block.active,.nav-bar-section.colored-block.operations.active{background:var(--nav-accent-color);color:var(--nav-accent-text-color);border-radius:0}.nav-bar-h1:hover,.nav-bar-h2:hover,.nav-bar-info:hover,.nav-bar-tag:hover,.nav-bar-path:hover{color:var(--nav-hover-text-color);background:var(--nav-hover-bg-color)}`,Br=U`#api-info{font-size:calc(var(--font-size-regular) - 1px);margin-top:8px}#api-info span:before{content:"|";opacity:.5;text-align:center;width:15px;display:inline-block}#api-info span:first-child:before{content:"";width:0}`,He=U``,dl=U`*,:before,:after{box-sizing:border-box}.dialog-box{background:var(--bg2);color:var(--fg2);border:1px solid var(--border-color);border-radius:4px;width:70vw;max-width:70vw;height:70vh;max-height:70vh;padding:0;position:absolute;top:100px;box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.dialog-box-header{z-index:10;backdrop-filter:blur(12px);border-bottom:1px solid var(--light-border-color);align-self:stretch;align-items:center;min-height:60px;max-height:60px;padding:0 16px;display:flex;position:sticky;top:0;overflow:hidden}.dialog-box-header button{color:var(--fg);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:50%;outline:none;margin-inline-end:-8px;font-size:1.5rem;font-weight:700;line-height:1}.dialog-box-header button:hover{border-color:var(--primary-color)}.dialog-box-content{height:100%;padding:16px;display:block;overflow:auto}.dialog-box-title{flex-grow:1;font-size:24px}`,Gt=/[\s#:?&={}]/g,Fe="_rapidoc_api_key";function Xt(n){return new Promise(e=>setTimeout(e,n))}function vt(n,e){const t=e.target,a=document.createElement("textarea");a.value=n,a.style.position="fixed",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy"),t.innerText="Copied",setTimeout(()=>{t.innerText="Copy"},5e3)}catch{}document.body.removeChild(a)}function pl(n,e){return e.name.toLowerCase().includes(n.toLowerCase())}function xt(n,e,t=""){return`${e.method} ${e.path} ${e.summary||""} ${e.description||""} ${e.operationId||""} ${t}`.toLowerCase().includes(n.toLowerCase())}function Kn(n,e=new Set){return n&&Object.keys(n).forEach(t=>{var a,r;e.add(t),n[t].properties?Kn(n[t].properties,e):(a=n[t].items)!=null&&a.properties&&Kn((r=n[t].items)==null?void 0:r.properties,e)}),e}function ul(n,e,t=[]){if(!n.trim()||t.length===0)return;const a=[];return e.forEach(r=>{r.paths.forEach(s=>{var i,o,l,c;let d="";if(t.includes("search-api-path")&&(d=s.path),t.includes("search-api-descr")&&(d=`${d} ${(s.summary||"")+(s.description||"")}`),t.includes("search-api-params")&&(d=`${d} ${((i=s.parameters)==null?void 0:i.map(p=>p.name).join(" "))||""}`),t.includes("search-api-request-body")&&s.requestBody){let p=new Set;for(const h in(o=s.requestBody)==null?void 0:o.content)(l=s.requestBody.content[h].schema)!=null&&l.properties&&(p=Kn((c=s.requestBody.content[h].schema)==null?void 0:c.properties)),d=`${d} ${[...p].join(" ")}`}t.includes("search-api-resp-descr")&&(d=`${d} ${Object.values(s.responses).map(p=>p.description||"").join(" ")}`),d.toLowerCase().includes(n.trim().toLowerCase())&&a.push({elementId:s.elementId,method:s.method,path:s.path,summary:s.summary||s.description||"",deprecated:s.deprecated})})}),a}function Lr(n,e){if(n){const t=document.createElement("a");document.body.appendChild(t),t.style="display: none",t.href=n,t.download=e,t.click(),t.remove()}}function Ir(n){if(n){const e=document.createElement("a");document.body.appendChild(e),e.style="display: none",e.href=n,e.target="_blank",e.click(),e.remove()}}const _r=n=>{if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e===Object.prototype||e===null},ee=n=>typeof n=="object"&&n!==null;function Te(n,e,t=[]){const a={};for(const[r,s]of Object.entries(n)){const i=[...t,r];if(Array.isArray(s)){a[r]=s.map((o,l)=>typeof o=="object"&&!Array.isArray(o)&&o!==null?Te(o,e,[...i,l.toString()]):o);continue}if(ee(s)){a[r]=Te(s,e,i);continue}a[r]=s}return e(a,t)}const ve="application/json";function Rr(n){const e=n["x-example"],t=n["x-examples"];return delete n["x-example"],delete n["x-examples"],{xExample:e,xExamples:t}}function Oe(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&Object.keys(n).length>0}function hl(n){return Oe(n)&&Object.values(n).every(e=>typeof e=="object"&&e!==null&&!Array.isArray(e))}function ml(n){if(!ee(n))return!0;const e=n,t=["enum","const","not","format","multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","maxProperties","minProperties","required"];return!(e.allOf||e.oneOf||e.anyOf||e.items||e.$ref||"additionalProperties"in e||t.some(a=>a in e)||typeof e.properties=="object"&&e.properties!==null&&Object.keys(e.properties).length>0)}function jr(n){const e=Object.keys(n);if(e.some(t=>{const a=n[t];return ee(a)&&(a.example!==void 0||a.examples!==void 0)}))for(const t of e){const a=n[t];if(!ee(a))continue;const r=a.example!==void 0||a.examples!==void 0;a.schema!==void 0&&!r&&Object.keys(a).length===1&&ml(a.schema)&&delete n[t]}}const fl=new Set(["summary","description","value","externalValue"]);function qr(n){if(typeof n!="object"||n===null)return!1;const e=n,t="value"in e||"externalValue"in e,a=Object.keys(e).every(r=>fl.has(r));return t&&a}function We(n){return qr(n)?n:{value:n}}const gl=/^[a-zA-Z0-9*+.-]+\/[a-zA-Z0-9*+.+-]+$/;function Vn(n){return gl.test(n)}function bl(n){return Object.entries(n).reduce((e,[t,a])=>(e[t]={value:a},e),{})}const yl=n=>{switch(n){case"application":return"clientCredentials";case"accessCode":return"authorizationCode";case"implicit":return"implicit";case"password":return"password";default:return n}};function vl(n){var e,t,a;let r=n;if(r!==null&&typeof r=="object"&&typeof r.swagger=="string"&&(e=r.swagger)!=null&&e.startsWith("2.0"))r.openapi="3.0.4",delete r.swagger;else return r;if(r.host){const s=Array.isArray(r.schemes)&&(t=r.schemes)!=null&&t.length?r.schemes:["http"];r.servers=s.map(i=>({url:`${i}://${r.host}${r.basePath??""}`})),delete r.basePath,delete r.schemes,delete r.host}else r.basePath&&(r.servers=[{url:r.basePath}],delete r.basePath);if(r.definitions){for(const s of Object.values(r.definitions))fe(s);r.components=Object.assign({},r.components,{schemas:r.definitions}),delete r.definitions,r=Te(r,s=>(typeof s.$ref=="string"&&s.$ref.startsWith("#/definitions/")&&(s.$ref=s.$ref.replace(/^#\/definitions\//,"#/components/schemas/")),s))}if(r=Te(r,s=>(s.type==="file"&&(s.type="string",s.format="binary"),s)),Object.hasOwn(r,"parameters")){r=Te(r,l=>{if(typeof l.$ref=="string"&&l.$ref.startsWith("#/parameters/")){const c=l.$ref.split("/")[2];if(!c)return l;const d=ee(r.parameters)&&c in r.parameters?r.parameters[c]:void 0;d&&typeof d=="object"&&"in"in d&&(d.in==="body"||d.in==="formData")?l.$ref=l.$ref.replace(/^#\/parameters\//,"#/components/requestBodies/"):l.$ref=l.$ref.replace(/^#\/parameters\//,"#/components/parameters/")}return l}),r.components??(r.components={});const s={},i={},o=ee(r.parameters)?r.parameters:{};for(const[l,c]of Object.entries(o))if(c&&typeof c=="object"){if("$ref"in c){const d=Jn(c);s[l]=d}else if("in"in c)if(c.in==="body")i[l]=Mr(c,r.consumes??[ve]);else if(c.in==="formData")i[l]=Hr([c],r.consumes);else{const d=Jn(c);s[l]=d}}Object.keys(s).length>0&&(r.components.parameters=s),Object.keys(i).length>0&&(r.components.requestBodies=i),delete r.parameters}if(Object.hasOwn(r,"responses")&&typeof r.responses=="object"&&r.responses!==null){r=Te(r,o=>(typeof o.$ref=="string"&&o.$ref.startsWith("#/responses/")&&(o.$ref=o.$ref.replace(/^#\/responses\//,"#/components/responses/")),o)),r.components??(r.components={});const s={},i=r.responses;for(const[o,l]of Object.entries(i))if(ee(l))if("$ref"in l)s[o]=l;else{const c=l,d=r.produces??[ve];if(c.schema){fe(c.schema),typeof c.content!="object"&&(c.content={});for(const p of d)c.content[p]={schema:c.schema};delete c.schema}if(c.examples&&typeof c.examples=="object"){typeof c.content!="object"&&(c.content={});const p=d[0]??ve;for(const[h,m]of Object.entries(c.examples))if(Vn(h))typeof c.content[h]!="object"&&(c.content[h]={}),c.content[h].example=m;else{typeof c.content[p]!="object"&&(c.content[p]={});const b=c.content[p];typeof b.examples!="object"&&(b.examples={}),b.examples[h]=We(m)}delete c.examples}c.content&&typeof c.content=="object"&&jr(c.content),ee(c.headers)&&(c.headers=Object.entries(c.headers).reduce((p,[h,m])=>m&&typeof m=="object"?{[h]:zr(m),...p}:p,{})),s[o]=c}Object.keys(s).length>0&&(r.components.responses=s),delete r.responses}if(typeof r.paths=="object"){for(const s in r.paths)if(Object.hasOwn(r.paths,s)){const i=ee(r.paths)&&s in r.paths?r.paths[s]:void 0;if(!i||typeof i!="object")continue;let o;for(const l in i)if(l==="parameters"&&Object.hasOwn(i,l)){const c=Wr(i.parameters,r.consumes??[ve]);i.parameters=c.parameters,o=c.requestBody}else if(Object.hasOwn(i,l)){const c=i[l];if(o&&(c.requestBody=o),c.parameters){const d=Wr(c.parameters,c.consumes??r.consumes??[ve]);c.parameters=d.parameters,d.requestBody&&(c.requestBody=d.requestBody)}if(delete c.consumes,c.responses){for(const d in c.responses)if(Object.hasOwn(c.responses,d)){const p=c.responses[d];if(p.headers&&typeof p.headers=="object"&&(p.headers=Object.entries(p.headers).reduce((h,[m,b])=>b&&typeof b=="object"?{[m]:zr(b),...h}:h,{})),p.schema){fe(p.schema);const h=r.produces??c.produces??[ve];typeof p.content!="object"&&(p.content={});for(const m of h)p.content[m]={schema:p.schema};delete p.schema}if(p.examples&&typeof p.examples=="object"){typeof p.content!="object"&&(p.content={});const h=(r.produces??c.produces??[ve])[0]??ve;for(const[m,b]of Object.entries(p.examples))if(Vn(m))typeof p.content[m]!="object"&&(p.content[m]={}),p.content[m].example=b;else{typeof p.content[h]!="object"&&(p.content[h]={});const g=p.content[h];typeof g.examples!="object"&&(g.examples={}),g.examples[m]=We(b)}delete p.examples}p.content&&typeof p.content=="object"&&jr(p.content)}}delete c.produces,((a=c.parameters)==null?void 0:a.length)===0&&delete c.parameters}}}if(r.securityDefinitions){(typeof r.components!="object"||r.components===null)&&(r.components={}),r.components&&typeof r.components=="object"&&Object.assign(r.components,{securitySchemes:{}});for(const[s,i]of Object.entries(r.securityDefinitions))if(typeof i=="object")if("type"in i&&i.type==="oauth2"){const{flow:o,authorizationUrl:l,tokenUrl:c,scopes:d}=i;r.components&&typeof r.components=="object"&&"securitySchemes"in r.components&&r.components.securitySchemes&&Object.assign(r.components.securitySchemes,{[s]:{type:"oauth2",flows:{[yl(o||"implicit")]:Object.assign({},l&&{authorizationUrl:l},c&&{tokenUrl:c},d&&{scopes:d})}}})}else"type"in i&&i.type==="basic"?r.components&&typeof r.components=="object"&&"securitySchemes"in r.components&&r.components.securitySchemes&&Object.assign(r.components.securitySchemes,{[s]:{type:"http",scheme:"basic"}}):r.components&&typeof r.components=="object"&&"securitySchemes"in r.components&&r.components.securitySchemes&&Object.assign(r.components.securitySchemes,{[s]:i});delete r.securityDefinitions}return delete r.consumes,delete r.produces,r}const fe=n=>{if(ee(n)){if(typeof n["x-nullable"]=="boolean"&&(n["x-nullable"]&&(n.nullable=!0),delete n["x-nullable"]),ee(n.properties))for(const e of Object.values(n.properties))fe(e);if(fe(n.items),fe(n.additionalProperties),Array.isArray(n.allOf))for(const e of n.allOf)fe(e)}};function Zn(n){const e=["type","format","default","items","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf","x-nullable"].reduce((t,a)=>(Object.hasOwn(n,a)&&(t[a]=n[a],delete n[a]),t),{});return fe(e),e}function xl(n){if(n==="formData")throw new Error("Encountered a formData parameter which should have been filtered out by the caller");if(n==="body")throw new Error("Encountered a body parameter which should have been filtered out by the caller");return n}function Jn(n){if(Object.hasOwn(n,"$ref")&&typeof n.$ref=="string")return{$ref:n.$ref};const e=wl(n),t=Zn(n),{xExample:a,xExamples:r}=Rr(n);if(Oe(a)?n.examples=bl(a):Oe(r)&&(n.examples=Object.entries(r).reduce((s,[i,o])=>(s[i]=We(o),s),{})),delete n.collectionFormat,delete n.default,!n.in)throw new Error('Parameter object must have an "in" property');return{schema:t,...e,...n,in:xl(n.in)}}function zr(n){if(Object.hasOwn(n,"$ref")&&typeof n.$ref=="string")return{$ref:n.$ref};const e=Zn(n);return{...n,schema:e}}const Pr={ssv:{style:"spaceDelimited",explode:!1},pipes:{style:"pipeDelimited",explode:!1},multi:{style:"form",explode:!0},csv:{style:"form",explode:!1},tsv:{}},Ur={ssv:{},pipes:{},multi:{},csv:{style:"simple",explode:!1},tsv:{}},Gn={header:Ur,query:Pr,path:Ur};function wl(n){if(n.type!=="array"||!(n.in==="query"||n.in==="path"||n.in==="header"))return{};const e=n.collectionFormat??"csv";return n.in in Gn&&e in Gn[n.in]?Gn[n.in][e]:{}}function $l(n){if(n.type!=="array"||typeof n.collectionFormat!="string")return;const e=Pr[n.collectionFormat];if(!(!e||Object.keys(e).length===0))return e}function Mr(n,e){const{xExample:t,xExamples:a}=Rr(n);delete n.name,delete n.in;const{schema:r,...s}=n;fe(r);const i={content:{},...s};if(i.content)for(const o of e){if(i.content[o]={schema:r},Oe(a)&&o in a){const l=a[o];Oe(l)&&Object.values(l).every(c=>qr(c))?i.content[o].examples=l:hl(l)?i.content[o].examples=Object.entries(l).reduce((c,[d,p])=>(c[d]=We(p),c),{}):i.content[o].examples={default:We(l)}}else Oe(a)&&!Object.keys(a).some(Vn)&&(i.content[o].examples=Object.entries(a).reduce((l,[c,d])=>(l[c]=We(d),l),{}));!i.content[o].examples&&Oe(t)&&o in t&&(i.content[o].example=t[o])}return i}function Hr(n,e=["multipart/form-data"]){var t;const a={content:{}},r=e.filter(i=>i==="multipart/form-data"||i==="application/x-www-form-urlencoded"),s=r.length>0?r:["multipart/form-data"];if(a.content)for(const i of s){a.content[i]={schema:{type:"object",properties:{},required:[]}};const o=(t=a.content)==null?void 0:t[i];if(o!=null&&o.schema&&typeof o.schema=="object"&&"properties"in o.schema){for(const l of n)if(l.name&&o.schema.properties){o.schema.properties[l.name]={...Zn(structuredClone(l)),...l.description!==void 0?{description:l.description}:{}};const c=$l(l);c&&(o.encoding??(o.encoding={}),o.encoding[l.name]=c),l.required&&Array.isArray(o.schema.required)&&o.schema.required.push(l.name)}}}return a}function Wr(n,e){const t={parameters:n.filter(s=>!(s.in==="body"||s.in==="formData")).map(s=>Jn(s))},a=structuredClone(n.find(s=>s.in==="body")??{});a&&Object.keys(a).length&&(t.requestBody=Mr(a,e));const r=n.filter(s=>s.in==="formData");if(r.length>0){const s=Hr(r,e);typeof t.requestBody!="object"?t.requestBody=s:t.requestBody={...t.requestBody,content:{...t.requestBody.content,...s.content}},typeof t.requestBody!="object"&&(t.requestBody={content:{}})}return t}const kl=new Set(["properties","items","allOf","anyOf","oneOf","not","additionalProperties","schema","schemas"]),Sl=new Set(["paths","webhooks","responses","content","headers","examples","links","encoding","variables","parameters","requestBodies","securitySchemes","pathItems","scopes"]),El=n=>{if(!n)return!1;const e=n[0]==="x-ext"&&n[1]!==void 0?n.slice(2):n;let t=0;for(const a of e){if(t>0){t--;continue}if(kl.has(a)||a.endsWith("Schema"))return!0;if(a==="callbacks"){t=2;continue}Sl.has(a)&&(t=1)}return!1},Al=new Set(["properties","patternProperties","$defs","definitions"]);function Yt(n){const e=n?.[n.length-1];return e===void 0?!1:e==="schemas"&&n?.[n.length-2]==="components"?!0:Al.has(e)}const Dl=new Set(["example","default","const","enum"]);function Cl(n){if(!n)return!1;for(const[e,t]of n.entries())if(Dl.has(t)&&!Yt(n.slice(0,e))||t==="value"&&n[e-2]==="examples"&&!Yt(n.slice(0,e-2)))return!0;return!1}function Fl(n){let e=n;return e===null||typeof e.openapi!="string"||!e.openapi.startsWith("3.0")||(e.openapi="3.1.1",e=Te(e,Tl)),e}const Tl=(n,e)=>{if(Cl(e))return n;if(n.type!==void 0&&n.nullable===!0)n.type=[n.type,"null"],delete n.nullable;else if(n.nullable===!0&&n.type===void 0){if(typeof n.$ref=="string"){const{nullable:s,$ref:i,...o}=n;return{...o,anyOf:[{$ref:i},{type:"null"}]}}if(Array.isArray(n.allOf)){const{nullable:s,allOf:i,...o}=n,l=i.length===1?i[0]:{allOf:i};return{...o,anyOf:[l,{type:"null"}]}}}n.exclusiveMinimum===!0&&n.minimum!==void 0?(n.exclusiveMinimum=n.minimum,delete n.minimum):typeof n.exclusiveMinimum=="boolean"&&delete n.exclusiveMinimum,n.exclusiveMaximum===!0&&n.maximum!==void 0?(n.exclusiveMaximum=n.maximum,delete n.maximum):typeof n.exclusiveMaximum=="boolean"&&delete n.exclusiveMaximum;const t=e?.some((s,i)=>s==="examples"&&i>0?!Yt(e.slice(0,i)):!1);n.example!==void 0&&!t&&!Yt(e)&&(El(e)?n.examples=[n.example]:n.examples={default:{value:n.example}},delete n.example);const{format:a,...r}=n;if(n.type==="string"||Array.isArray(n.type)&&n.type.includes("string")){if(n.format==="binary"){const{type:s,...i}=r;return e?.at(-1)==="schema"&&e.at(-3)==="content"?i:{contentMediaType:"application/octet-stream",...i}}if(n.format==="base64"||n.format==="byte")return{...r,contentEncoding:"base64"}}return n["x-webhooks"]!==void 0&&(e===void 0||e.length===0)&&(n.webhooks=n["x-webhooks"],delete n["x-webhooks"]),n},Ol=["2.0","3.0","3.1","3.2"],te={EMPTY_OR_INVALID:"Can't find JSON, YAML or filename in data.",OPENAPI_VERSION_NOT_SUPPORTED:"Can't find supported Swagger/OpenAPI version in the provided document, version must be a string.",INVALID_REFERENCE:"Can't resolve reference: %s",EXTERNAL_REFERENCE_NOT_FOUND:"Can't resolve external reference: %s",SELF_REFERENCE:"Can't resolve reference to itself: %s",FILE_DOES_NOT_EXIST:"File does not exist: %s",NO_CONTENT:"No content found"};function Kr(n){if(n===null)return{version:void 0,specificationType:void 0,specificationVersion:void 0};if(_r(n))for(const e of new Set(Ol)){const t=e==="2.0"?"swagger":"openapi",a=n[t];if(typeof a!="string")continue;const[r,s]=a.split(".");if(`${r}.${s}`===e)return{version:e,specificationType:t,specificationVersion:a}}return{version:void 0,specificationType:void 0,specificationVersion:void 0}}function Ne(n){return n?.find(e=>e.isEntrypoint)}function Xn(n,e,t=[]){const a={};for(const[r,s]of Object.entries(n)){const i=[...t,r];if(Array.isArray(s)){a[r]=s.map((o,l)=>typeof o=="object"&&!Array.isArray(o)&&o!==null?Xn(o,e,[...i,l.toString()]):o);continue}if(typeof s=="object"&&s!==null){a[r]=Xn(s,e,i);continue}a[r]=s}return e(a,t)}function Vr(n){const e=[];return!n||typeof n!="object"?e:(Xn(n,t=>(t.$ref&&typeof t.$ref=="string"&&!t.$ref.startsWith("#")&&e.push(t.$ref.split("#")[0]),t)),[...new Set(e)])}function Yn(n){return typeof n<"u"&&Array.isArray(n)&&n.length>0&&n.some(e=>e.isEntrypoint===!0)}const Qn=Symbol.for("yaml.alias"),ea=Symbol.for("yaml.document"),xe=Symbol.for("yaml.map"),Zr=Symbol.for("yaml.pair"),he=Symbol.for("yaml.scalar"),Ke=Symbol.for("yaml.seq"),ne=Symbol.for("yaml.node.type"),Ve=n=>!!n&&typeof n=="object"&&n[ne]===Qn,Qt=n=>!!n&&typeof n=="object"&&n[ne]===ea,wt=n=>!!n&&typeof n=="object"&&n[ne]===xe,M=n=>!!n&&typeof n=="object"&&n[ne]===Zr,q=n=>!!n&&typeof n=="object"&&n[ne]===he,$t=n=>!!n&&typeof n=="object"&&n[ne]===Ke;function H(n){if(n&&typeof n=="object")switch(n[ne]){case xe:case Ke:return!0}return!1}function W(n){if(n&&typeof n=="object")switch(n[ne]){case Qn:case xe:case he:case Ke:return!0}return!1}const Jr=n=>(q(n)||H(n))&&!!n.anchor,Be=Symbol("break visit"),Nl=Symbol("skip children"),kt=Symbol("remove node");function Ze(n,e){const t=Bl(e);Qt(n)?Je(null,n.contents,t,Object.freeze([n]))===kt&&(n.contents=null):Je(null,n,t,Object.freeze([]))}Ze.BREAK=Be,Ze.SKIP=Nl,Ze.REMOVE=kt;function Je(n,e,t,a){const r=Ll(n,e,t,a);if(W(r)||M(r))return Il(n,a,r),Je(n,r,t,a);if(typeof r!="symbol"){if(H(e)){a=Object.freeze(a.concat(e));for(let s=0;s<e.items.length;++s){const i=Je(s,e.items[s],t,a);if(typeof i=="number")s=i-1;else{if(i===Be)return Be;i===kt&&(e.items.splice(s,1),s-=1)}}}else if(M(e)){a=Object.freeze(a.concat(e));const s=Je("key",e.key,t,a);if(s===Be)return Be;s===kt&&(e.key=null);const i=Je("value",e.value,t,a);if(i===Be)return Be;i===kt&&(e.value=null)}}return r}function Bl(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function Ll(n,e,t,a){var r,s,i,o,l;if(typeof t=="function")return t(n,e,a);if(wt(e))return(r=t.Map)==null?void 0:r.call(t,n,e,a);if($t(e))return(s=t.Seq)==null?void 0:s.call(t,n,e,a);if(M(e))return(i=t.Pair)==null?void 0:i.call(t,n,e,a);if(q(e))return(o=t.Scalar)==null?void 0:o.call(t,n,e,a);if(Ve(e))return(l=t.Alias)==null?void 0:l.call(t,n,e,a)}function Il(n,e,t){const a=e[e.length-1];if(H(a))a.items[n]=t;else if(M(a))n==="key"?a.key=t:a.value=t;else if(Qt(a))a.contents=t;else{const r=Ve(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const _l={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Rl=n=>n.replace(/[!,[\]{}]/g,e=>_l[e]);class X{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},X.defaultYaml,e),this.tags=Object.assign({},X.defaultTags,t)}clone(){const e=new X(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new X(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:X.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},X.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:X.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},X.defaultTags),this.atNextDocument=!1);const a=e.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[s,i]=a;return this.tags[s]=i,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[s]=a;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const i=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,i),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const i=e.slice(2,-1);return i==="!"||i==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),i)}const[,a,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[a];if(s)try{return s+decodeURIComponent(r)}catch(i){return t(String(i)),null}return a==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,a]of Object.entries(this.tags))if(e.startsWith(a))return t+Rl(e.substring(a.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(e&&a.length>0&&W(e.contents)){const s={};Ze(e.contents,(i,o)=>{W(o)&&o.tag&&(s[o.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,i]of a)s==="!!"&&i==="tag:yaml.org,2002:"||(!e||r.some(o=>o.startsWith(i)))&&t.push(`%TAG ${s} ${i}`);return t.join(`
|
|
81
|
-
`)}}
|
|
82
|
-
`)?
|
|
78
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${he(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:a}){const r=this.parser.parseInline(a),s=Br(e);if(s===null)return r;e=s;let i='<a href="'+e+'"';return t&&(i+=' title="'+he(t)+'"'),i+=">"+r+"</a>",i}image({href:e,title:t,text:a}){const r=Br(e);if(r===null)return he(a);e=r;let s=`<img src="${e}" alt="${a}"`;return t&&(s+=` title="${he(t)}"`),s+=">",s}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:he(e.text)}}class Gn{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}}class de{constructor(e){j(this,"options"),j(this,"renderer"),j(this,"textRenderer"),this.options=e||De,this.options.renderer=this.options.renderer||new Jt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Gn}static parse(e,t){return new de(t).parse(e)}static parseInline(e,t){return new de(t).parseInline(e)}parse(e,t=!0){var a,r;let s="";for(let i=0;i<e.length;i++){const o=e[i];if((r=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&r[o.type]){const c=o,d=this.options.extensions.renderers[c.type].call({parser:this},c);if(d!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(c.type)){s+=d||"";continue}}const l=o;switch(l.type){case"space":{s+=this.renderer.space(l);continue}case"hr":{s+=this.renderer.hr(l);continue}case"heading":{s+=this.renderer.heading(l);continue}case"code":{s+=this.renderer.code(l);continue}case"table":{s+=this.renderer.table(l);continue}case"blockquote":{s+=this.renderer.blockquote(l);continue}case"list":{s+=this.renderer.list(l);continue}case"html":{s+=this.renderer.html(l);continue}case"paragraph":{s+=this.renderer.paragraph(l);continue}case"text":{let c=l,d=this.renderer.text(c);for(;i+1<e.length&&e[i+1].type==="text";)c=e[++i],d+=`
|
|
79
|
+
`+this.renderer.text(c);t?s+=this.renderer.paragraph({type:"paragraph",raw:d,text:d,tokens:[{type:"text",raw:d,text:d,escaped:!0}]}):s+=d;continue}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return"";throw new Error(c)}}}return s}parseInline(e,t=this.renderer){var a,r;let s="";for(let i=0;i<e.length;i++){const o=e[i];if((r=(a=this.options.extensions)==null?void 0:a.renderers)!=null&&r[o.type]){const c=this.options.extensions.renderers[o.type].call({parser:this},o);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(o.type)){s+=c||"";continue}}const l=o;switch(l.type){case"escape":{s+=t.text(l);break}case"html":{s+=t.html(l);break}case"link":{s+=t.link(l);break}case"image":{s+=t.image(l);break}case"strong":{s+=t.strong(l);break}case"em":{s+=t.em(l);break}case"codespan":{s+=t.codespan(l);break}case"br":{s+=t.br(l);break}case"del":{s+=t.del(l);break}case"text":{s+=t.text(l);break}default:{const c='Token with "'+l.type+'" type was not found.';if(this.options.silent)return"";throw new Error(c)}}}return s}}class vt{constructor(e){j(this,"options"),j(this,"block"),this.options=e||De}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?ce.lex:ce.lexInline}provideParser(){return this.block?de.parse:de.parseInline}}j(vt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"]));class qo{constructor(...e){j(this,"defaults",Un()),j(this,"options",this.setOptions),j(this,"parse",this.parseMarkdown(!0)),j(this,"parseInline",this.parseMarkdown(!1)),j(this,"Parser",de),j(this,"Renderer",Jt),j(this,"TextRenderer",Gn),j(this,"Lexer",ce),j(this,"Tokenizer",Zt),j(this,"Hooks",vt),this.use(...e)}walkTokens(e,t){var a,r;let s=[];for(const i of e)switch(s=s.concat(t.call(this,i)),i.type){case"table":{const o=i;for(const l of o.header)s=s.concat(this.walkTokens(l.tokens,t));for(const l of o.rows)for(const c of l)s=s.concat(this.walkTokens(c.tokens,t));break}case"list":{const o=i;s=s.concat(this.walkTokens(o.items,t));break}default:{const o=i;(r=(a=this.defaults.extensions)==null?void 0:a.childTokens)!=null&&r[o.type]?this.defaults.extensions.childTokens[o.type].forEach(l=>{const c=o[l].flat(1/0);s=s.concat(this.walkTokens(c,t))}):o.tokens&&(s=s.concat(this.walkTokens(o.tokens,t)))}}return s}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(a=>{const r={...a};if(r.async=this.defaults.async||r.async||!1,a.extensions&&(a.extensions.forEach(s=>{if(!s.name)throw new Error("extension name required");if("renderer"in s){const i=t.renderers[s.name];i?t.renderers[s.name]=function(...o){let l=s.renderer.apply(this,o);return l===!1&&(l=i.apply(this,o)),l}:t.renderers[s.name]=s.renderer}if("tokenizer"in s){if(!s.level||s.level!=="block"&&s.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const i=t[s.level];i?i.unshift(s.tokenizer):t[s.level]=[s.tokenizer],s.start&&(s.level==="block"?t.startBlock?t.startBlock.push(s.start):t.startBlock=[s.start]:s.level==="inline"&&(t.startInline?t.startInline.push(s.start):t.startInline=[s.start]))}"childTokens"in s&&s.childTokens&&(t.childTokens[s.name]=s.childTokens)}),r.extensions=t),a.renderer){const s=this.defaults.renderer||new Jt(this.defaults);for(const i in a.renderer){if(!(i in s))throw new Error(`renderer '${i}' does not exist`);if(["options","parser"].includes(i))continue;const o=i,l=a.renderer[o],c=s[o];s[o]=(...d)=>{let p=l.apply(s,d);return p===!1&&(p=c.apply(s,d)),p||""}}r.renderer=s}if(a.tokenizer){const s=this.defaults.tokenizer||new Zt(this.defaults);for(const i in a.tokenizer){if(!(i in s))throw new Error(`tokenizer '${i}' does not exist`);if(["options","rules","lexer"].includes(i))continue;const o=i,l=a.tokenizer[o],c=s[o];s[o]=(...d)=>{let p=l.apply(s,d);return p===!1&&(p=c.apply(s,d)),p}}r.tokenizer=s}if(a.hooks){const s=this.defaults.hooks||new vt;for(const i in a.hooks){if(!(i in s))throw new Error(`hook '${i}' does not exist`);if(["options","block"].includes(i))continue;const o=i,l=a.hooks[o],c=s[o];vt.passThroughHooks.has(i)?s[o]=d=>{if(this.defaults.async)return Promise.resolve(l.call(s,d)).then(h=>c.call(s,h));const p=l.call(s,d);return c.call(s,p)}:s[o]=(...d)=>{let p=l.apply(s,d);return p===!1&&(p=c.apply(s,d)),p}}r.hooks=s}if(a.walkTokens){const s=this.defaults.walkTokens,i=a.walkTokens;r.walkTokens=function(o){let l=[];return l.push(i.call(this,o)),s&&(l=l.concat(s.call(this,o))),l}}this.defaults={...this.defaults,...r}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return ce.lex(e,t??this.defaults)}parser(e,t){return de.parse(e,t??this.defaults)}parseMarkdown(e){return(t,a)=>{const r={...a},s={...this.defaults,...r},i=this.onError(!!s.silent,!!s.async);if(this.defaults.async===!0&&r.async===!1)return i(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof t>"u"||t===null)return i(new Error("marked(): input parameter is undefined or null"));if(typeof t!="string")return i(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(t)+", string expected"));s.hooks&&(s.hooks.options=s,s.hooks.block=e);const o=s.hooks?s.hooks.provideLexer():e?ce.lex:ce.lexInline,l=s.hooks?s.hooks.provideParser():e?de.parse:de.parseInline;if(s.async)return Promise.resolve(s.hooks?s.hooks.preprocess(t):t).then(c=>o(c,s)).then(c=>s.hooks?s.hooks.processAllTokens(c):c).then(c=>s.walkTokens?Promise.all(this.walkTokens(c,s.walkTokens)).then(()=>c):c).then(c=>l(c,s)).then(c=>s.hooks?s.hooks.postprocess(c):c).catch(i);try{s.hooks&&(t=s.hooks.preprocess(t));let c=o(t,s);s.hooks&&(c=s.hooks.processAllTokens(c)),s.walkTokens&&this.walkTokens(c,s.walkTokens);let d=l(c,s);return s.hooks&&(d=s.hooks.postprocess(d)),d}catch(c){return i(c)}}}onError(e,t){return a=>{if(a.message+=`
|
|
80
|
+
Please report this to https://github.com/markedjs/marked.`,e){const r="<p>An error occurred:</p><pre>"+he(a.message+"",!0)+"</pre>";return t?Promise.resolve(r):r}if(t)return Promise.reject(a);throw a}}}const Ce=new qo;function A(n,e){return Ce.parse(n,e)}A.options=A.setOptions=function(n){return Ce.setOptions(n),A.defaults=Ce.defaults,xr(A.defaults),A},A.getDefaults=Un,A.defaults=De,A.use=function(...n){return Ce.use(...n),A.defaults=Ce.defaults,xr(A.defaults),A},A.walkTokens=function(n,e){return Ce.walkTokens(n,e)},A.parseInline=Ce.parseInline,A.Parser=de,A.parser=de.parse,A.Renderer=Jt,A.TextRenderer=Gn,A.Lexer=ce,A.lexer=ce.lex,A.Tokenizer=Zt,A.Hooks=vt,A.parse=A,A.options,A.setOptions,A.use,A.walkTokens,A.parseInline,de.parse,ce.lex;const zo=/[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g,Po=Object.hasOwnProperty;class xt{constructor(){this.occurrences,this.reset()}slug(e,t){const a=this;let r=Uo(e,t===!0);const s=r;for(;Po.call(a.occurrences,r);)a.occurrences[s]++,r=s+"-"+a.occurrences[s];return a.occurrences[r]=0,r}reset(){this.occurrences=Object.create(null)}}function Uo(n,e){return typeof n!="string"?"":(e||(n=n.toLowerCase()),n.replace(zo,"").replace(/ /g,"-"))}const Mo={scopeName:"source.astro",dependencies:["html","css","scss","javascript","typescript","tsx"],patterns:[{include:"#frontmatter"},{include:"#script"},{include:"#style"},{include:"#interpolation"},{include:"text.html.basic"}],repository:{frontmatter:{begin:"^---\\s*$",end:"^---\\s*$",beginCaptures:{0:{name:"punctuation.definition.frontmatter.begin.astro"}},endCaptures:{0:{name:"punctuation.definition.frontmatter.end.astro"}},contentName:"meta.embedded.block.astro",patterns:[{include:"source.ts"}]},script:{patterns:[{begin:"<(script)\\s*>",end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.ts.embedded.astro",patterns:[{include:"source.ts"}]},{include:"text.html.basic#embedded-javascript"}]},style:{patterns:[{begin:`<(style)\\b(?=[^>]*\\blang\\s*=\\s*(['"])scss\\2)[^>]*>`,end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.scss.embedded.astro",patterns:[{include:"source.scss"}]},{include:"source.css"}]},interpolation:{begin:"\\{",end:"\\}",beginCaptures:{0:{name:"punctuation.section.embedded.begin.astro"}},endCaptures:{0:{name:"punctuation.section.embedded.end.astro"}},contentName:"meta.embedded.expression.astro",patterns:[{include:"text.html.basic#comments"},{include:"source.tsx"}]}}},Ho={scopeName:"source.shell",patterns:[{match:"^#!.*$",name:"comment.line.shebang"},{match:"(?!^#!)#.*$",name:"comment.line.number-sign"},{match:"'(?:[^']*)'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},{match:"\\$[a-zA-Z_][\\w]*|\\$\\d+|\\$[?@*#$!_-]|\\$\\{[^}]+\\}",name:"entity.name.variable"},{match:"\\b([a-zA-Z_][\\w]*)(?==)",captures:{1:{name:"entity.name.variable.assignment"}}},{match:"\\b(?:if|then|else|elif|fi|for|while|until|in|do|done|case|esac|function|select|time|coproc)\\b",name:"keyword.control"},{match:"(?:&&|\\|\\||[|&;])",name:"keyword.operator"},{match:"(?<![\\w-])--?[a-zA-Z][\\w-]*(?:=[^\\s]+)?",name:"constant.language.option"},{match:"(?<![\\w.])-?\\d+(?:\\.\\d+)?\\b",name:"constant.numeric"}]},Wo={scopeName:"source.c",patterns:[{include:"#comments"},{include:"#preprocessor"},{include:"#strings"},{include:"#storage-types"},{include:"#keywords"},{include:"#builtin-types"},{include:"#constants"},{include:"#numbers"},{include:"#operators"},{include:"#function-declaration"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},preprocessor:{patterns:[{begin:"^\\s*#\\s*include\\b",end:"$",name:"keyword.control.directive.include",patterns:[{match:"<[^>]*>",name:"string.quoted.other.lt-gt"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"}]},{match:"^\\s*#\\s*(?:define|undef|ifdef|ifndef|if|elif|else|endif|pragma|error|warning|line)\\b.*$",name:"keyword.control.directive"}]},strings:{patterns:[{match:"'(?:\\\\.|[^'\\\\\\r\\n])'",name:"string.quoted.char"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"}]},"storage-types":{match:"\\b(?:auto|const|enum|extern|inline|register|restrict|signed|static|struct|typedef|union|unsigned|volatile)\\b",name:"storage.modifier"},keywords:{match:"\\b(?:break|case|continue|default|do|else|for|goto|if|return|sizeof|switch|while)\\b",name:"keyword.control"},"builtin-types":{match:"\\b(?:char|double|float|int|long|short|void|_Bool|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|size_t|ssize_t|ptrdiff_t|FILE)\\b",name:"support.class.builtin"},constants:{match:"\\b(?:NULL|true|false)\\b",name:"constant.language"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F]+|0[bB][01]+|(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eE][+-]?\\d+)?)[uUlLfF]*\\b",name:"constant.numeric"},operators:{match:"(?:->|\\+\\+|--|&&|\\|\\||<<=?|>>=?|==|!=|<=|>=|[+\\-*/%&|^!~<>=]=?)",name:"keyword.operator"},"function-declaration":{match:"\\b([A-Za-z_]\\w*)(?=\\s*\\()",name:"entity.name.function"}}},Ko={scopeName:"source.cpp",dependencies:["c"],patterns:[{include:"source.c#comments"},{include:"source.c#preprocessor"},{include:"source.c#strings"},{include:"#class-declaration"},{include:"#keywords"},{include:"source.c#storage-types"},{include:"source.c#keywords"},{include:"source.c#builtin-types"},{include:"#stl-types"},{include:"#constants"},{include:"source.c#constants"},{include:"#numbers"},{include:"#operators"},{include:"source.c#function-declaration"}],repository:{"class-declaration":{match:"\\b(class|struct|enum|namespace)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},keywords:{match:"\\b(?:catch|class|const_cast|constexpr|decltype|delete|dynamic_cast|explicit|export|final|friend|mutable|namespace|new|noexcept|nullptr|operator|override|private|protected|public|reinterpret_cast|static_assert|static_cast|template|this|throw|try|typeid|typename|using|virtual)\\b",name:"keyword.control"},"stl-types":{match:"\\bstd::(?:array|deque|forward_list|list|map|multimap|multiset|pair|priority_queue|queue|set|shared_ptr|stack|string|tuple|unique_ptr|unordered_map|unordered_set|vector|weak_ptr)\\b",name:"support.class.builtin"},constants:{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F']+|0[bB][01']+|(?:\\d[\\d']*\\.[\\d']*|\\.\\d[\\d']*|\\d[\\d']*)(?:[eE][+-]?\\d+)?)[uUlLfF]*\\b",name:"constant.numeric"},operators:{match:"(?:->\\*?|::|\\.\\.\\.|<=>|&&|\\|\\||<<=?|>>=?|==|!=|<=|>=|[+\\-*/%&|^!~<>=]=?)",name:"keyword.operator"}}},Vo={scopeName:"source.cs",patterns:[{include:"#comments"},{include:"#strings"},{include:"#attributes"},{include:"#class-declaration"},{include:"#keywords"},{include:"#builtin-types"},{include:"#constants"},{include:"#numbers"},{include:"#operators"},{include:"#function-declaration"}],repository:{comments:{patterns:[{match:"///.*$",name:"comment.line.documentation"},{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{match:'@"(?:""|[^"])*"',name:"string.quoted.double.verbatim"},{match:'\\$@"(?:""|\\{\\{|\\}\\}|[^"])*"',name:"string.quoted.double.interpolated"},{match:'@\\$"(?:""|\\{\\{|\\}\\}|[^"])*"',name:"string.quoted.double.interpolated"},{match:'\\$"(?:\\\\.|\\{\\{|\\}\\}|[^"\\\\\\r\\n])*"',name:"string.quoted.double.interpolated"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\\\r\\n])'",name:"string.quoted.char"}]},attributes:{match:"\\[[A-Za-z_][\\w.]*\\]",name:"entity.name.decorator"},"class-declaration":{match:"\\b(class|interface|struct|enum|record)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},keywords:{match:"\\b(?:abstract|as|async|await|base|break|case|catch|checked|const|continue|default|delegate|do|else|event|explicit|extern|finally|fixed|for|foreach|goto|if|implicit|in|internal|is|lock|namespace|new|null|operator|out|override|params|partial|private|protected|public|readonly|ref|return|sealed|sizeof|stackalloc|static|switch|this|throw|try|typeof|unchecked|unsafe|using|virtual|volatile|while|yield)\\b",name:"keyword.control"},"builtin-types":{match:"\\b(?:bool|byte|char|decimal|double|dynamic|float|int|long|object|sbyte|short|string|uint|ulong|ushort|var|void)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)[uUlLfFdDmM]*\\b",name:"constant.numeric"},operators:{match:"(?:=>|\\?\\?=?|\\?\\.|::|&&|\\|\\||==|!=|<=|>=|<<=?|>>=?|[+\\-*/%&|^!~<>=]=?)",name:"keyword.operator"},"function-declaration":{match:"\\b([A-Za-z_]\\w*)(?=\\s*(?:<[^>]*>)?\\s*\\()",name:"entity.name.function"}}},Zo={scopeName:"source.css",patterns:[{include:"#comments"},{include:"#strings"},{include:"#keyframes"},{include:"#at-rule-block"},{include:"#at-rule-statement"},{include:"#rule-set"}],repository:{comments:{begin:"/\\*",end:"\\*/",name:"comment.block"},strings:{match:`(['"])(?:\\\\.|(?!\\1)[^\\\\\\r\\n])*\\1`,name:"string.quoted"},keyframes:{begin:"(@(?:-\\w+-)?keyframes)\\s+([a-zA-Z_-][\\w-]*)\\s*\\{",end:"\\}",beginCaptures:{1:{name:"keyword.control.at-rule"},2:{name:"entity.name.animation"}},patterns:[{include:"$self"}]},"at-rule-block":{begin:"(@(?:container|counter-style|document|font-face|font-feature-values|font-palette-values|layer|media|page|position-try|scope|starting-style|supports|view-transition)\\b)[^{;]*\\{",end:"\\}",beginCaptures:{1:{name:"keyword.control.at-rule"}},patterns:[{include:"$self"}]},"at-rule-statement":{begin:"(@(?:charset|custom-media|import|namespace|property)\\b)",end:";",beginCaptures:{1:{name:"keyword.control.at-rule"}},patterns:[{include:"#comments"},{include:"#strings"},{include:"#values"}]},"rule-set":{begin:"([^\\s@{};<][^@{};<]*?)\\s*\\{",end:"\\}",beginCaptures:{1:{name:"entity.name.selector"}},patterns:[{include:"#comments"},{include:"#strings"},{include:"#keyframes"},{include:"#at-rule-block"},{include:"#at-rule-statement"},{include:"#rule-set"},{include:"#declarations"},{include:"#values"}]},declarations:{match:"(--[a-zA-Z0-9_-]+|[a-zA-Z-][\\w-]*)(\\s*:)",captures:{1:{name:"support.type.property-name"}}},values:{patterns:[{match:"!important\\b",name:"keyword.other.important"},{match:"\\b(var)\\(\\s*(--[a-zA-Z0-9_-]+)",captures:{1:{name:"entity.name.function"},2:{name:"variable.other.custom-property"}}},{match:"\\b([a-zA-Z_-][\\w-]*)(?=\\()",captures:{1:{name:"entity.name.function"}}},{match:"#(?:[0-9a-fA-F]{8}|[0-9a-fA-F]{6}|[0-9a-fA-F]{4}|[0-9a-fA-F]{3})\\b",name:"constant.other.color"},{match:"(?<![\\w.-])-?(?:\\d*\\.\\d+|\\d+)(?:[eE][+-]?\\d+)?(?:%|[a-zA-Z]+)?\\b",name:"constant.numeric"},{match:"\\b(?:auto|currentColor|inherit|initial|none|normal|revert|revert-layer|transparent|unset)\\b",name:"constant.language"},{match:"(?:[+*/]|(?<=\\s)-(?!-))",name:"keyword.operator"}]}}},Jo={scopeName:"source.go",patterns:[{include:"#comments"},{include:"#strings"},{include:"#function-declaration"},{include:"#type-declaration"},{include:"#keywords"},{include:"#constants"},{include:"#builtin-types"},{include:"#builtin-functions"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{begin:"`",end:"`",name:"string.quoted.raw"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\\\r\\n])*'",name:"string.quoted.rune"}]},"function-declaration":{match:"\\b(func)\\s+(?:\\([^)]*\\)\\s*)?([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},"type-declaration":{match:"\\b(type)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type"},2:{name:"entity.name.type.class"}}},keywords:{match:"\\b(?:break|case|chan|const|continue|default|defer|else|fallthrough|for|func|go|goto|if|import|interface|map|package|range|return|select|struct|switch|type|var)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\b(?:nil|iota)\\b",name:"constant.language"}]},"builtin-types":{match:"\\b(?:any|bool|byte|complex64|complex128|error|float32|float64|int|int8|int16|int32|int64|rune|string|uint|uint8|uint16|uint32|uint64|uintptr)\\b",name:"support.class.builtin"},"builtin-functions":{match:"\\b(?:append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\\b(?=\\s*\\()",name:"entity.name.function"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?i?)\\b",name:"constant.numeric"},operators:{match:"(?::=|\\.\\.\\.|<-|\\|\\||&&|==|!=|<=|>=|<<|>>|[+\\-*/%&|^!<>=]=?)",name:"keyword.operator"}}},Go={scopeName:"text.html.basic",dependencies:["css","json","javascript"],patterns:[{include:"#comments"},{include:"#doctype"},{include:"#embedded-css"},{include:"#embedded-json"},{include:"#embedded-javascript"},{include:"#raw-text"},{include:"#tags"},{include:"#entities"}],repository:{comments:{begin:"<!--",end:"-->",name:"comment.block"},doctype:{match:"<![Dd][Oo][Cc][Tt][Yy][Pp][Ee]\\b[^>]*>",name:"keyword.control.doctype"},"embedded-css":{begin:`<([Ss][Tt][Yy][Ll][Ee])\\b(?:"[^"]*"|'[^']*'|[^'">])*>`,end:"</([Ss][Tt][Yy][Ll][Ee])[ \\t]*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.embedded.html",patterns:[{include:"source.css"}]},"embedded-json":{begin:`<([Ss][Cc][Rr][Ii][Pp][Tt])\\b(?=[^>]*\\b[Tt][Yy][Pp][Ee]\\s*=\\s*(['"])(?:application/(?:ld\\+)?json|importmap|speculationrules)\\2)(?:"[^"]*"|'[^']*'|[^'">])*>`,end:"</([Ss][Cc][Rr][Ii][Pp][Tt])[ \\t]*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.json.embedded.html",patterns:[{include:"source.json"}]},"embedded-javascript":{begin:`<([Ss][Cc][Rr][Ii][Pp][Tt])\\b(?:(?![^>]*\\b[Tt][Yy][Pp][Ee]\\s*=)|(?=[^>]*\\b[Tt][Yy][Pp][Ee]\\s*=\\s*(['"])(?:module|(?:text|application)/(?:java|ecma)script)\\2))(?:"[^"]*"|'[^']*'|[^'">])*>`,end:"</([Ss][Cc][Rr][Ii][Pp][Tt])[ \\t]*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.js.embedded.html",patterns:[{include:"source.js"}]},"raw-text":{begin:`<([Tt][Ee][Xx][Tt][Aa][Rr][Ee][Aa]|[Tt][Ii][Tt][Ll][Ee])\\b(?:"[^"]*"|'[^']*'|[^'">])*>`,end:"</([Tt][Ee][Xx][Tt][Aa][Rr][Ee][Aa]|[Tt][Ii][Tt][Ll][Ee])[ \\t]*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"string.unquoted.raw-text"},tags:{begin:"<(/?)([a-zA-Z][\\w.-]*)",end:">",beginCaptures:{2:{name:"entity.name.tag"}},patterns:[{include:"#inline-css"},{include:"#inline-javascript"},{include:"#attributes"},{include:"#unquoted-attributes"},{include:"#boolean-attributes"}]},"inline-css":{begin:`[ \\t]+(style)\\s*=\\s*(['"])`,end:"\\2",beginCaptures:{1:{name:"entity.other.attribute-name"},2:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},contentName:"source.css.embedded.inline",patterns:[{include:"source.css#comments"},{include:"source.css#strings"},{include:"source.css#declarations"},{include:"source.css#values"}]},"inline-javascript":{begin:`[ \\t]+(on[a-zA-Z][\\w-]*)\\s*=\\s*(['"])`,end:"\\2",beginCaptures:{1:{name:"entity.other.attribute-name"},2:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},contentName:"source.js.embedded.inline",patterns:[{include:"source.js"}]},attributes:{begin:`[ \\t]+([a-zA-Z_:][\\w:.-]*)\\s*=\\s*(['"])`,end:"\\2",beginCaptures:{1:{name:"entity.other.attribute-name"},2:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},contentName:"string.quoted.attribute-value",patterns:[{include:"#entities"}]},"unquoted-attributes":{match:"[ \\t]+([a-zA-Z_:][\\w:.-]*)\\s*=\\s*([^\\s\"'`=<>]+)",captures:{1:{name:"entity.other.attribute-name"},2:{name:"string.unquoted.attribute-value"}}},"boolean-attributes":{match:"[ \\t]+([a-zA-Z_:][\\w:.-]*)(?=[ \\t]*/?>|[ \\t]+[a-zA-Z_:])",captures:{1:{name:"entity.other.attribute-name"}}},entities:{match:"&(?:#\\d+|#x[0-9a-fA-F]+|[a-zA-Z][\\w]+);",name:"constant.character.entity"}}},Xo={scopeName:"source.java",patterns:[{include:"#comments"},{include:"#strings"},{include:"#annotations"},{include:"#class-declaration"},{include:"#keywords"},{include:"#builtin-types"},{include:"#constants"},{include:"#numbers"},{include:"#operators"},{include:"#function-declaration"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{begin:'"""',end:'"""',name:"string.quoted.triple"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\\\r\\n])'",name:"string.quoted.char"}]},annotations:{match:"@[A-Za-z_][\\w.]*",name:"entity.name.decorator"},"class-declaration":{match:"\\b(class|interface|enum|record)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},keywords:{match:"\\b(?:abstract|assert|break|case|catch|continue|default|do|else|extends|final|finally|for|goto|if|implements|import|instanceof|native|new|non-sealed|package|permits|private|protected|public|return|sealed|static|strictfp|super|switch|synchronized|this|throw|throws|transient|try|var|volatile|while|yield)\\b",name:"keyword.control"},"builtin-types":{match:"\\b(?:boolean|byte|char|double|float|int|long|short|void|Boolean|Byte|Character|Double|Float|Integer|Long|Short|String|Object|List|Map|Set|ArrayList|HashMap|HashSet|Optional)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)[lLfFdD]?\\b",name:"constant.numeric"},operators:{match:"(?:->|::|&&|\\|\\||==|!=|<=|>=|<<=?|>>>?=?|[+\\-*/%&|^!~<>=]=?)",name:"keyword.operator"},"function-declaration":{match:"\\b([A-Za-z_]\\w*)(?=\\s*\\()",name:"entity.name.function"}}},Yo={scopeName:"source.js",patterns:[{include:"#comments"},{include:"#strings"},{include:"#template"},{include:"#regexp"},{include:"#jsx-closing-tag"},{include:"#jsx-tag"},{include:"#class-declaration"},{include:"#function-declaration"},{include:"#variable-declaration"},{include:"#keywords"},{include:"#numbers"},{include:"#constants"},{include:"#decorators"},{include:"#private-fields"},{include:"#properties"},{include:"#functions"},{include:"#built-ins"},{include:"#operators"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{match:"'(?:\\\\.|[^'\\\\\\r\\n])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"}]},template:{begin:"`",end:"(?<!\\\\)(?:\\\\\\\\)*`",name:"string.quoted.template",patterns:[{include:"#template-interpolation"}]},"template-interpolation":{begin:"\\$\\{",end:"\\}",patterns:[{include:"#balanced-braces"},{include:"$self"}]},"balanced-braces":{begin:"\\{",end:"\\}",patterns:[{include:"#balanced-braces"},{include:"$self"}]},regexp:{match:"(?<![\\w)$\\]])/(?![/*])(?:\\\\.|\\[(?:\\\\.|[^\\]\\\\])*\\]|[^/\\\\\\r\\n])+/[dgimsuvy]*",name:"string.regexp"},"jsx-closing-tag":{match:"</([A-Za-z][\\w.-]*)\\s*>",captures:{1:{name:"entity.name.tag"}}},"jsx-tag":{begin:"<([A-Za-z][\\w.-]*)",end:"/?>",beginCaptures:{1:{name:"entity.name.tag"}},patterns:[{include:"#jsx-expression"},{include:"#strings"},{include:"#jsx-boolean-attributes"},{include:"#jsx-attributes"}]},"jsx-expression":{begin:"\\{",end:"\\}",patterns:[{include:"#balanced-braces"},{include:"$self"}]},"jsx-attributes":{match:"\\b([a-zA-Z_:][\\w:.-]*)(?=\\s*(?:=|/?>))",captures:{1:{name:"entity.other.attribute-name"}}},"jsx-boolean-attributes":{match:"\\b([a-zA-Z_:][\\w:.-]*)(?=\\s+(?:[a-zA-Z_:][\\w:.-]*\\s*=|/?>))",captures:{1:{name:"entity.other.attribute-name"}}},"class-declaration":{match:"\\b(class)\\s+([A-Za-z_$][\\w$]*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},"function-declaration":{match:"\\b(?:(async)\\s+)?(function)\\s*(\\*)?\\s*([A-Za-z_$][\\w$]*)?",captures:{1:{name:"storage.modifier.async"},2:{name:"storage.type.function"},4:{name:"entity.name.function"}}},"variable-declaration":{match:"\\b(const|let|var)\\s+([A-Za-z_$][\\w$]*)",captures:{1:{name:"storage.type.variable"},2:{name:"variable.other.readwrite"}}},keywords:{match:"\\b(?:as|assert|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\\b",name:"keyword.control"},numbers:{match:"(?<![\\w$])(?:0[xX][0-9a-fA-F](?:_?[0-9a-fA-F])*n?|0[bB][01](?:_?[01])*n?|0[oO][0-7](?:_?[0-7])*n?|\\d(?:_?\\d)*n|(?:\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?|\\.\\d(?:_?\\d)*)(?:[eE][+-]?\\d(?:_?\\d)*)?)(?![\\w$])",name:"constant.numeric"},constants:{patterns:[{match:"\\b(?:false|true)\\b",name:"constant.language.boolean"},{match:"\\b(?:Infinity|NaN|null|undefined)\\b",name:"constant.language"}]},decorators:{match:"@[A-Za-z_$][\\w$]*",name:"entity.name.decorator"},"private-fields":{match:"#[A-Za-z_$][\\w$]*",name:"variable.other.private"},properties:{match:"(?<=\\.)[A-Za-z_$][\\w$]*|[A-Za-z_$][\\w$]*(?=\\s*:)",name:"entity.name.property"},functions:{match:"\\b[A-Za-z_$][\\w$]*(?=\\s*\\()",name:"entity.name.function"},"built-ins":{match:"\\b(?:Array|BigInt|Boolean|console|customElements|Date|document|Error|JSON|Map|Math|Number|Object|Promise|Reflect|RegExp|Set|String|Symbol|WeakMap|WeakSet|window)\\b",name:"support.class"},operators:{match:"(?:=>|===|!==|==|!=|<=|>=|\\?\\?|\\?\\.|\\+\\+|--|&&|\\|\\||\\*\\*|[+*%&|^!~?:-])",name:"keyword.operator"}}},Qo={scopeName:"source.json",patterns:[{match:'"(?:\\\\.|[^"\\\\])*"(?=\\s*:)',name:"entity.name.key"},{match:'"(?:\\\\.|[^"\\\\])*"(?=\\s*[,}\\]])',name:"string.quoted.double"},{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b",name:"constant.language"},{match:"(?<![\\w.])-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?\\b",name:"constant.numeric"}]},el={scopeName:"source.kotlin",patterns:[{include:"#comments"},{include:"#strings"},{include:"#annotations"},{include:"#class-declaration"},{include:"#function-declaration"},{include:"#keywords"},{include:"#builtin-types"},{include:"#constants"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{begin:'"""',end:'"""',name:"string.quoted.triple"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\\\r\\n])'",name:"string.quoted.char"}]},annotations:{match:"@[A-Za-z_][\\w.]*",name:"entity.name.decorator"},"class-declaration":{match:"\\b(?:(data|sealed|abstract|open|inner|enum|annotation)\\s+)?(class|interface|object)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.modifier"},2:{name:"storage.type.class"},3:{name:"entity.name.type.class"}}},"function-declaration":{match:"\\b(fun)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},keywords:{match:"\\b(?:abstract|actual|annotation|as|break|by|catch|companion|const|constructor|continue|crossinline|data|delegate|do|dynamic|else|enum|expect|external|final|finally|for|get|if|import|in|infix|init|inline|inner|internal|is|lateinit|noinline|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|try|typealias|val|var|vararg|when|where|while)\\b",name:"keyword.control"},"builtin-types":{match:"\\b(?:Any|Array|Boolean|Byte|Char|Double|Float|Int|List|Long|Map|MutableList|MutableMap|MutableSet|Nothing|Set|Short|String|Unit)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)[fFLuU]*\\b",name:"constant.numeric"},operators:{match:"(?:->|\\?:|\\?\\.|!!|\\.\\.|::|&&|\\|\\||==|!=|<=|>=|[+\\-*/%!<>=]=?)",name:"keyword.operator"}}},tl={scopeName:"text.html.markdown",dependencies:["yaml"],patterns:[{include:"#front-matter"},{include:"#comments"},{include:"#fenced-code"},{include:"#headings"},{include:"#quotes"},{include:"#lists"},{include:"#links"},{include:"#inline-code"}],repository:{"front-matter":{begin:"^[ \\t]*---[ \\t]*$",end:"^[ \\t]*(?:---|\\.\\.\\.)[ \\t]*$",patterns:[{include:"source.yaml"}]},comments:{begin:"<!--",end:"-->",name:"comment.block.html"},"fenced-code":{begin:"^[ \\t]*(```+|~~~+).*$",end:"^[ \\t]*\\1[ \\t]*$",name:"string.unquoted.fenced-code"},headings:{match:"^[ \\t]{0,3}#{1,6}[ \\t]+(.+)$",captures:{1:{name:"entity.name.section"}}},quotes:{match:"^[ \\t]*>.*$",name:"comment.blockquote"},lists:{match:"^[ \\t]*(?:[-+*]|\\d+[.)])(?=[ \\t]+)",name:"keyword.control.list"},links:{match:`!?\\[([^\\]]+)\\](\\([^\\s)]+(?:\\s+['"][^'"]*['"])?\\))`,captures:{1:{name:"entity.name.link"},2:{name:"string.other.link"}}},"inline-code":{match:"(`+)(.+?)\\1",captures:{2:{name:"string.other.raw"}}}}},nl={scopeName:"source.objc",dependencies:["c"],patterns:[{include:"source.c#comments"},{include:"source.c#preprocessor"},{include:"#interface-declaration"},{include:"#directives"},{include:"#nsstring"},{include:"source.c#strings"},{include:"#method-declaration"},{include:"#language-variables"},{include:"source.c#storage-types"},{include:"source.c#keywords"},{include:"#property-attributes"},{include:"#builtin-types"},{include:"source.c#builtin-types"},{include:"#constants"},{include:"source.c#constants"},{include:"source.c#numbers"},{include:"source.c#operators"},{include:"source.c#function-declaration"}],repository:{"interface-declaration":{match:"\\b(@interface|@implementation|@protocol)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},directives:{match:"@(?:end|property|synthesize|dynamic|optional|required|class|import|selector|encode|synchronized|autoreleasepool|try|catch|finally|throw)\\b",name:"keyword.control.directive.objc"},nsstring:{match:'@"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},"method-declaration":{match:"^\\s*[-+]\\s*\\([^)]*\\)\\s*([A-Za-z_]\\w*)",captures:{1:{name:"entity.name.function"}}},"language-variables":{match:"\\b(?:self|super)\\b",name:"variable.language.objc"},"property-attributes":{match:"\\b(?:nonatomic|atomic|strong|weak|copy|assign|retain|readonly|readwrite|unsafe_unretained|nullable|nonnull|null_resettable)\\b",name:"storage.modifier"},"builtin-types":{match:"\\b(?:id|instancetype|BOOL|SEL|Class|IMP|NSInteger|NSUInteger|CGFloat|NSString|NSMutableString|NSArray|NSMutableArray|NSDictionary|NSMutableDictionary|NSNumber|NSObject|NSError|NSData|NSURL|NSNotification)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:YES|NO)\\b",name:"constant.language.boolean"},{match:"\\b(?:nil|Nil)\\b",name:"constant.language"}]}}},al={scopeName:"source.perl",patterns:[{include:"#comments"},{include:"#pod"},{include:"#strings"},{include:"#variables"},{include:"#function-declaration"},{include:"#keywords"},{include:"#builtins"},{include:"#constants"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{match:"#.*$",name:"comment.line.number-sign"},pod:{begin:"^=\\w+",end:"^=cut\\b",name:"comment.block.documentation"},strings:{patterns:[{match:"qw\\s*\\(([^)]*)\\)",name:"string.quoted.other.qw"},{match:"'(?:\\\\.|[^'\\\\])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},{match:"`(?:\\\\.|[^`\\\\])*`",name:"string.interpolated.backtick"}]},variables:{match:"[$@%&][A-Za-z_]\\w*(?:::\\w+)*|\\$\\{[^}]+\\}|\\$[0-9]+|\\$[!@_/\\\\,.;]",name:"entity.name.variable"},"function-declaration":{match:"\\b(sub)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},keywords:{match:"\\b(?:my|our|local|sub|if|elsif|else|unless|while|until|for|foreach|do|return|last|next|redo|use|no|package|require|and|or|not|xor|eq|ne|lt|gt|le|ge|cmp|given|when|default)\\b",name:"keyword.control"},builtins:{match:"\\b(?:print|printf|sprintf|push|pop|shift|unshift|splice|join|split|map|grep|sort|keys|values|each|defined|exists|delete|ref|bless|die|warn|chomp|chop|length|substr|index|lc|uc|lcfirst|ucfirst|wantarray|scalar)\\b",name:"support.class.builtin"},constants:{match:"\\bundef\\b",name:"constant.language"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)\\b",name:"constant.numeric"},operators:{match:"(?:=>|->|::|\\.\\.\\.?|<=>|==|!=|<=|>=|&&|\\|\\||//|=~|!~|\\*\\*|[+\\-*/%.!<>=]=?)",name:"keyword.operator"}}},rl={scopeName:"source.php",patterns:[{match:"<\\?php\\b|<\\?=|\\?>",name:"punctuation.section.embedded"},{include:"#comments"},{include:"#attributes"},{include:"#strings"},{include:"#variables"},{include:"#class-declaration"},{include:"#function-declaration"},{include:"#keywords"},{include:"#constants"},{include:"#numbers"},{include:"#operators"},{include:"#function-call"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{match:"#(?!\\[).*$",name:"comment.line.number-sign"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},attributes:{match:"#\\[[^\\]]*\\]",name:"entity.name.decorator"},strings:{patterns:[{match:"'(?:\\\\.|[^'\\\\])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"}]},variables:{match:"\\$[A-Za-z_]\\w*",name:"entity.name.variable"},"class-declaration":{match:"\\b(class|interface|trait|enum)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},"function-declaration":{match:"\\b(function)\\s+&?([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},keywords:{match:"\\b(?:abstract|and|array|as|break|callable|case|catch|clone|const|continue|declare|default|do|echo|else|elseif|empty|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|final|finally|fn|for|foreach|global|goto|if|implements|include|include_once|instanceof|insteadof|interface|isset|list|match|namespace|new|or|print|private|protected|public|readonly|require|require_once|return|static|switch|throw|trait|try|unset|use|var|while|xor|yield)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\b(?:true|false|TRUE|FALSE)\\b",name:"constant.language.boolean"},{match:"\\b(?:null|NULL)\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[bB][01_]+|0[oO][0-7_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)\\b",name:"constant.numeric"},operators:{match:"(?:->|=>|::|\\?\\?=?|<=>|===|!==|==|!=|<=|>=|\\.=|&&|\\|\\||[+\\-*/%.!<>=]=?)",name:"keyword.operator"},"function-call":{match:"\\b[A-Za-z_]\\w*(?=\\s*\\()",name:"entity.name.function"}}},sl={scopeName:"source.powershell",patterns:[{include:"#comments"},{include:"#strings"},{include:"#constants"},{include:"#variables"},{include:"#function-declaration"},{include:"#operators"},{include:"#keywords"},{include:"#parameters"},{include:"#cmdlets"},{include:"#numbers"}],repository:{comments:{patterns:[{begin:"<#",end:"#>",name:"comment.block"},{match:"#.*$",name:"comment.line.number-sign"}]},strings:{patterns:[{match:"'(?:''|[^'])*'",name:"string.quoted.single"},{match:'"(?:`.|[^"])*"',name:"string.quoted.double"}]},variables:{match:"\\$(?:\\{[^}]+\\}|[A-Za-z_][\\w:]*)",name:"entity.name.variable"},"function-declaration":{match:"\\b(function|filter)\\s+([A-Za-z_][\\w-]*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},operators:{match:"-(?:eq|ne|gt|lt|ge|le|like|notlike|match|notmatch|contains|notcontains|in|notin|and|or|not|xor|replace|split|join|is|isnot|as)\\b",name:"keyword.operator"},keywords:{match:"\\b(?:begin|break|catch|class|continue|do|dynamicparam|else|elseif|end|exit|finally|for|foreach|if|in|param|process|return|switch|throw|trap|try|until|while)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\$(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\$(?:null)\\b",name:"constant.language"}]},parameters:{match:"(?<![\\w-])-[A-Za-z][\\w]*",name:"constant.language.option"},cmdlets:{match:"\\b[A-Z][a-zA-Z]*-[A-Za-z]+\\b",name:"entity.name.function"},numbers:{match:"(?<![\\w.])-?\\d+(?:\\.\\d+)?(?:[kKmMgGtTpP][bB])?\\b",name:"constant.numeric"}}},il={scopeName:"source.python",patterns:[{include:"#comments"},{include:"#strings"},{include:"#decorators"},{include:"#class-declaration"},{include:"#function-declaration"},{include:"#keywords"},{include:"#constants"},{include:"#builtins"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{match:"#.*$",name:"comment.line.number-sign"},strings:{patterns:[{begin:'[rRbBfFuU]{0,2}"""',end:'"""',name:"string.quoted.triple.double"},{begin:"[rRbBfFuU]{0,2}'''",end:"'''",name:"string.quoted.triple.single"},{match:'[rRbBfFuU]{0,2}"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"[rRbBfFuU]{0,2}'(?:\\\\.|[^'\\\\\\r\\n])*'",name:"string.quoted.single"}]},decorators:{match:"@[A-Za-z_][\\w.]*",name:"entity.name.decorator"},"class-declaration":{match:"\\b(class)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},"function-declaration":{match:"\\b(def)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},keywords:{match:"\\b(?:and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|raise|return|try|while|with|yield)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\b(?:True|False)\\b",name:"constant.language.boolean"},{match:"\\b(?:None|Ellipsis|NotImplemented|__debug__)\\b",name:"constant.language"},{match:"\\b(?:self|cls)\\b",name:"variable.language.python"}]},builtins:{match:"\\b(?:abs|all|any|bool|bytearray|bytes|callable|chr|classmethod|dict|dir|divmod|enumerate|filter|float|format|frozenset|getattr|hasattr|hash|hex|id|input|int|isinstance|issubclass|iter|len|list|map|max|min|next|object|oct|open|ord|pow|print|property|range|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|vars|zip)\\b(?=\\s*\\()",name:"support.class.builtin"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|(?:\\d(?:_?\\d)*)?\\.?\\d(?:_?\\d)*(?:[eE][+-]?\\d+)?[jJ]?)\\b",name:"constant.numeric"},operators:{match:"(?::=|\\*\\*|//|<=|>=|==|!=|->|[+\\-*/%@&|^~<>=])",name:"keyword.operator"}}},ol={scopeName:"source.r",patterns:[{include:"#comments"},{include:"#strings"},{include:"#function-declaration"},{include:"#keywords"},{include:"#builtins"},{include:"#constants"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{match:"#.*$",name:"comment.line.number-sign"},strings:{patterns:[{match:"'(?:\\\\.|[^'\\\\])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"}]},"function-declaration":{match:"\\b([A-Za-z_.][\\w.]*)\\s*(?=<-\\s*function\\b|=\\s*function\\b)",name:"entity.name.function"},keywords:{match:"\\b(?:if|else|repeat|while|function|for|next|break|in)\\b",name:"keyword.control"},builtins:{match:"\\b(?:c|list|vector|matrix|data\\.frame|print|cat|paste|paste0|sprintf|nrow|ncol|length|names|colnames|rownames|sapply|lapply|vapply|mapply|apply|Map|Filter|Reduce|library|require|source|setwd|getwd|summary|str|head|tail|is\\.na|is\\.null|as\\.character|as\\.numeric|as\\.integer|as\\.factor|as\\.data\\.frame)\\b",name:"support.class.builtin"},constants:{patterns:[{match:"\\b(?:TRUE|FALSE|T|F)\\b",name:"constant.language.boolean"},{match:"\\b(?:NULL|NA|NA_integer_|NA_real_|NA_character_|NA_complex_|Inf|NaN)\\b",name:"constant.language"}]},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F]+|(?:\\d+\\.\\d*|\\.\\d+|\\d+)(?:[eE][+-]?\\d+)?[Li]?)\\b",name:"constant.numeric"},operators:{match:"(?:%[^%\\s]*%|<<-|<-|->>|->|==|!=|<=|>=|&&|\\|\\||[-+*/^!<>=&|~?:])",name:"keyword.operator"}}},ll={scopeName:"source.ruby",patterns:[{match:"#(?!\\{).*$",name:"comment.line.number-sign"},{begin:`<<[-~]?(['"]?)([A-Z][A-Z0-9_]*)\\1`,end:"^\\2$",name:"string.unquoted.heredoc"},{match:"'(?:\\\\.|[^'\\\\])*'",name:"string.quoted.single"},{match:'"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},{match:"(?:@@|@|\\$)[a-zA-Z_][\\w]*",name:"entity.name.variable"},{match:":[a-zA-Z_][\\w]*[!?=]?",name:"constant.other.symbol"},{match:"\\b(def)\\s+([a-zA-Z_][\\w]*[!?=]?)",captures:{1:{name:"storage.type.method"},2:{name:"entity.name.function"}}},{match:"\\b(class|module)\\s+([A-Z][\\w]*(?:::[A-Z][\\w]*)*)",captures:{1:{name:"storage.type.class"},2:{name:"entity.name.type.class"}}},{match:"\\b(?:false|true)\\b",name:"constant.language.boolean"},{match:"\\bnil\\b",name:"constant.language"},{match:"\\b(?:BEGIN|END|alias|and|begin|break|case|catch|defined|do|else|elsif|ensure|for|if|in|next|not|or|redo|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\\b",name:"keyword.control"},{match:"\\b[A-Z][\\w]*(?:::[A-Z][\\w]*)*\\b",name:"entity.name.type.constant"},{match:"(?<![\\w.])-?(?:0[xX][0-9a-fA-F]+|0[bB][01]+|\\d+(?:_\\d+)*(?:\\.\\d+)?)\\b",name:"constant.numeric"}]},cl={scopeName:"source.rust",patterns:[{include:"#comments"},{include:"#strings"},{include:"#attributes"},{include:"#function-declaration"},{include:"#type-declaration"},{include:"#macros"},{include:"#keywords"},{include:"#constants"},{include:"#builtin-types"},{include:"#lifetimes"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{patterns:[{match:"//.*$",name:"comment.line.double-slash"},{begin:"/\\*",end:"\\*/",name:"comment.block"}]},strings:{patterns:[{begin:'b?r#"',end:'"#',name:"string.quoted.raw"},{match:'b?r"[^"]*"',name:"string.quoted.raw"},{match:'b?"(?:\\\\.|[^"\\\\])*"',name:"string.quoted.double"},{match:"'(?:\\\\.|[^'\\\\])'",name:"string.quoted.char"}]},attributes:{match:"#!?\\[[^\\]]*\\]",name:"entity.name.decorator"},"function-declaration":{match:"\\b(fn)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type.function"},2:{name:"entity.name.function"}}},"type-declaration":{match:"\\b(struct|enum|trait|union|type)\\s+([A-Za-z_]\\w*)",captures:{1:{name:"storage.type"},2:{name:"entity.name.type.class"}}},macros:{match:"\\b[A-Za-z_]\\w*!(?=\\s*[\\(\\[{])",name:"entity.name.function.macro"},keywords:{match:"\\b(?:as|async|await|break|const|continue|crate|dyn|else|enum|extern|fn|for|if|impl|in|let|loop|match|mod|move|mut|pub|ref|return|self|Self|static|struct|super|trait|type|union|unsafe|use|where|while)\\b",name:"keyword.control"},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\b(?:None|Some|Ok|Err)\\b",name:"constant.language"}]},"builtin-types":{match:"\\b(?:bool|char|str|String|i8|i16|i32|i64|i128|isize|u8|u16|u32|u64|u128|usize|f32|f64|Vec|Option|Result|Box|Rc|Arc|RefCell|HashMap|HashSet)\\b",name:"support.class.builtin"},lifetimes:{match:"'[a-z_]\\w*\\b",name:"variable.language.lifetime"},numbers:{match:"(?<![\\w.])(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)(?:[iuf](?:8|16|32|64|128|size))?\\b",name:"constant.numeric"},operators:{match:"(?:->|=>|::|\\.\\.=?|&&|\\|\\||==|!=|<=|>=|<<|>>|[+\\-*/%&|^!<>=]=?)",name:"keyword.operator"}}},dl={scopeName:"source.svelte",dependencies:["html","css","scss","javascript","typescript"],patterns:[{include:"#comments"},{include:"#typescript"},{include:"#javascript"},{include:"#scss"},{include:"#css"},{include:"#blocks"},{include:"#interpolation"},{include:"#tags"},{include:"text.html.basic"}],repository:{comments:{begin:"<!--",end:"-->",name:"comment.block"},typescript:{begin:`<(script)\\b(?=[^>]*\\blang\\s*=\\s*(['"])(?:ts|typescript)\\2)[^>]*>`,end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.ts.embedded.svelte",patterns:[{include:"source.ts"}]},javascript:{begin:"<(script)\\b[^>]*>",end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.js.embedded.svelte",patterns:[{include:"source.js"}]},scss:{begin:`<(style)\\b(?=[^>]*\\blang\\s*=\\s*(['"])scss\\2)[^>]*>`,end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.scss.embedded.svelte",patterns:[{include:"source.scss"}]},css:{begin:"<(style)\\b[^>]*>",end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.embedded.svelte",patterns:[{include:"source.css"}]},blocks:{match:"\\{([#/:@])\\s*(if|else|each|key|await|then|catch|snippet|render|html|debug|const)\\b",captures:{1:{name:"punctuation.definition.keyword"},2:{name:"keyword.control"}}},interpolation:{begin:"\\{(?![#/:@])",end:"\\}",beginCaptures:{0:{name:"punctuation.section.embedded.begin"}},endCaptures:{0:{name:"punctuation.section.embedded.end"}},contentName:"source.js.embedded.svelte",patterns:[{include:"source.js"}]},tags:{begin:"<(/?)([a-zA-Z][\\w.:-]*)",end:">",beginCaptures:{2:{name:"entity.name.tag"}},patterns:[{include:"#directive"},{include:"#shorthand"},{include:"text.html.basic#inline-css"},{include:"text.html.basic#attributes"},{include:"text.html.basic#unquoted-attributes"},{include:"text.html.basic#boolean-attributes"}]},directive:{match:"[ \\t]+((?:bind|on|class|use|transition|in|out|animate|let):[\\w-]+(?:\\|[\\w-]+)*)",captures:{1:{name:"entity.other.attribute-name"}}},shorthand:{begin:"[ \\t]+\\{",end:"\\}",contentName:"source.js.embedded.svelte",patterns:[{include:"source.js"}]}}},pl={scopeName:"source.toml",patterns:[{include:"#comments"},{include:"#table-headers"},{include:"#datetime"},{include:"#strings"},{include:"#keys"},{include:"#constants"},{include:"#numbers"},{include:"#operators"}],repository:{comments:{match:"#.*$",name:"comment.line.number-sign"},"table-headers":{match:"^\\s*(\\[\\[?)([^\\[\\]]+)(\\]\\]?)\\s*$",captures:{1:{name:"punctuation.definition.table"},2:{name:"entity.name.type.class"},3:{name:"punctuation.definition.table"}}},strings:{patterns:[{begin:'"""',end:'"""',name:"string.quoted.triple.double"},{begin:"'''",end:"'''",name:"string.quoted.triple.single"},{match:'"(?:\\\\.|[^"\\\\\\r\\n])*"',name:"string.quoted.double"},{match:"'[^'\\r\\n]*'",name:"string.quoted.single"}]},keys:{match:`^\\s*((?:[A-Za-z0-9_-]+|"(?:\\\\.|[^"\\\\])*"|'[^']*')(?:\\s*\\.\\s*(?:[A-Za-z0-9_-]+|"(?:\\\\.|[^"\\\\])*"|'[^']*'))*)\\s*(?==)`,captures:{1:{name:"entity.name.key"}}},constants:{patterns:[{match:"\\b(?:true|false)\\b",name:"constant.language.boolean"},{match:"\\b(?:inf|nan)\\b",name:"constant.language"}]},datetime:{match:"\\b\\d{4}-\\d{2}-\\d{2}(?:[Tt ]\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:[Zz]|[+-]\\d{2}:\\d{2})?)?\\b",name:"constant.other.date-time"},numbers:{match:"(?<![\\w.])[+-]?(?:0[xX][0-9a-fA-F_]+|0[oO][0-7_]+|0[bB][01_]+|\\d(?:_?\\d)*(?:\\.\\d(?:_?\\d)*)?(?:[eE][+-]?\\d+)?)\\b",name:"constant.numeric"},operators:{match:"=",name:"keyword.operator"}}},ul={scopeName:"source.tsx",dependencies:["javascript","typescript"],patterns:[{include:"source.js#comments"},{include:"source.js#strings"},{include:"source.js#template"},{include:"source.js#regexp"},{include:"source.js#jsx-closing-tag"},{include:"source.js#jsx-tag"},{include:"source.ts#type-declaration"},{include:"source.js#class-declaration"},{include:"source.js#function-declaration"},{include:"source.js#variable-declaration"},{include:"source.ts#type-keywords"},{include:"source.js#keywords"},{include:"source.js#numbers"},{include:"source.js#constants"},{include:"source.ts#builtin-types"},{include:"source.js#decorators"},{include:"source.js#private-fields"},{include:"source.js#properties"},{include:"source.js#functions"},{include:"source.js#built-ins"},{include:"source.js#operators"}]},hl={scopeName:"source.ts",dependencies:["javascript"],patterns:[{include:"source.js#comments"},{include:"source.js#strings"},{include:"source.js#template"},{include:"source.js#regexp"},{include:"#type-declaration"},{include:"source.js#class-declaration"},{include:"source.js#function-declaration"},{include:"source.js#variable-declaration"},{include:"#type-keywords"},{include:"source.js#keywords"},{include:"source.js#numbers"},{include:"source.js#constants"},{include:"#builtin-types"},{include:"source.js#decorators"},{include:"source.js#private-fields"},{include:"source.js#properties"},{include:"source.js#functions"},{include:"source.js#built-ins"},{include:"source.js#operators"}],repository:{"type-declaration":{match:"\\b(interface|enum|namespace|module|type)\\s+([A-Za-z_$][\\w$]*)",captures:{1:{name:"storage.type"},2:{name:"entity.name.type.class"}}},"type-keywords":{match:"\\b(?:abstract|accessor|asserts|declare|infer|keyof|override|readonly|satisfies|unique)\\b",name:"keyword.control.ts"},"builtin-types":{match:"\\b(?:any|bigint|boolean|never|number|object|string|symbol|undefined|unknown|void)\\b",name:"support.class.builtin"}}},ml={scopeName:"text.html.vue",dependencies:["html","css","scss","javascript","typescript"],patterns:[{include:"#comments"},{include:"#typescript"},{include:"#javascript"},{include:"#scss"},{include:"#css"},{include:"#interpolation"},{include:"#tags"},{include:"text.html.basic"}],repository:{comments:{begin:"<!--",end:"-->",name:"comment.block"},typescript:{begin:`<(script)\\b(?=[^>]*\\blang\\s*=\\s*(['"])(?:ts|typescript)\\2)[^>]*>`,end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.ts.embedded.vue",patterns:[{include:"source.ts"}]},javascript:{begin:"<(script)\\b[^>]*>",end:"</(script)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.js.embedded.vue",patterns:[{include:"source.js"}]},scss:{begin:`<(style)\\b(?=[^>]*\\blang\\s*=\\s*(['"])scss\\2)[^>]*>`,end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.scss.embedded.vue",patterns:[{include:"source.scss"}]},css:{begin:"<(style)\\b[^>]*>",end:"</(style)\\s*>",beginCaptures:{1:{name:"entity.name.tag"}},endCaptures:{1:{name:"entity.name.tag"}},contentName:"source.css.embedded.vue",patterns:[{include:"source.css"}]},interpolation:{begin:"\\{\\{",end:"\\}\\}",beginCaptures:{0:{name:"punctuation.section.embedded.begin"}},endCaptures:{0:{name:"punctuation.section.embedded.end"}},contentName:"source.js.embedded.vue",patterns:[{include:"source.js"}]},tags:{begin:"<(/?)([a-zA-Z][\\w.:-]*)",end:">",beginCaptures:{2:{name:"entity.name.tag"}},patterns:[{include:"#directive-value"},{include:"#directive"},{include:"text.html.basic#inline-css"},{include:"text.html.basic#attributes"},{include:"text.html.basic#unquoted-attributes"},{include:"text.html.basic#boolean-attributes"}]},"directive-value":{begin:`[ \\t]+((?:v-[\\w-]+(?::[\\w-]+)?|[:@#][\\w-]+)(?:\\.[\\w-]+)*)\\s*=\\s*(['"])`,end:"\\2",beginCaptures:{1:{name:"entity.other.attribute-name"},2:{name:"punctuation.definition.string.begin"}},endCaptures:{0:{name:"punctuation.definition.string.end"}},contentName:"source.js.embedded.vue",patterns:[{include:"source.js"}]},directive:{match:"[ \\t]+((?:v-[\\w-]+(?::[\\w-]+)?|[:@#][\\w-]+)(?:\\.[\\w-]+)*)",captures:{1:{name:"entity.other.attribute-name"}}}}},fl={scopeName:"source.yaml",patterns:[{match:"#.*$",name:"comment.line.number-sign"},{match:"^(?:---|\\.\\.\\.)\\s*$|^%YAML\\b.*$",name:"keyword.control.document"},{match:"^\\s*(?:-\\s+)?([^#\\s][^\\r\\n:#]*?)(?=\\s*:)",captures:{1:{name:"entity.name.key"}}},{match:"[&*][a-zA-Z_][\\w-]*|![^\\s]+",name:"entity.name.anchor"},{match:`(['"])(?:\\\\.|(?!\\1)[^\\\\\\r\\n]|\\r?\\n[ \\t]+)*\\1`,name:"string.quoted"},{match:"(?<=:\\s)[|>][-+]?\\s*$",name:"keyword.control.block-scalar"},{match:"\\b(?:true|false|yes|no|on|off)\\b",name:"constant.language.boolean"},{match:"\\bnull\\b|~",name:"constant.language"},{match:"(?<![\\w.-])-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:e[+-]?\\d+)?\\b",name:"constant.numeric"}]},gl={scopeName:"source.http",patterns:[{match:"^(GET|POST|PUT|DELETE|PATCH|HEAD|OPTIONS|TRACE|CONNECT)\\s+([^\\s]+)\\s+(HTTP\\/[0-9.]+)",captures:{1:{name:"keyword.control.http"},2:{name:"string.unquoted.http"},3:{name:"keyword.other.http"}}},{match:"^(HTTP\\/[0-9.]+)\\s+([0-9]{3})(?:\\s+(.*))?",captures:{1:{name:"keyword.other.http"},2:{name:"constant.numeric.http"},3:{name:"string.unquoted.http"}}},{match:"^([a-zA-Z0-9_-]+):\\s*(.*)",captures:{1:{name:"support.type.property-name.http"},2:{name:"string.unquoted.http"}}}]},Rr={astro:Mo,bash:Ho,c:Wo,cpp:Ko,csharp:Vo,css:Zo,go:Jo,html:Go,http:gl,java:Xo,javascript:Yo,json:Qo,kotlin:el,markdown:tl,"objective-c":nl,perl:al,php:rl,powershell:sl,python:il,r:ol,ruby:ll,rust:cl,svelte:dl,toml:pl,tsx:ul,typescript:hl,vue:ml,yaml:fl},Ir=new Map;Object.values(Rr).forEach(n=>{n!=null&&n.scopeName&&Ir.set(n.scopeName,n)});const yl={"c++":"cpp",cs:"csharp",curl:"bash",js:"javascript",jsx:"javascript",markup:"html",md:"markdown",objc:"objective-c",ps1:"powershell",py:"python",rb:"ruby",sh:"bash",shell:"bash",svg:"html",ts:"typescript",xml:"html",yml:"yaml",zsh:"bash"},bl={indices:[[1/0,1/0]]},wt=new Map,vl=n=>{const e=n.split("."),[t,a,r]=e,s=e.at(-1);if(t==="markup"&&["quote","inserted","deleted","raw"].includes(a))return a;if(t==="entity"&&a==="name")return r;if(n.startsWith("constant.character.entity"))return"character-entity";if(e.includes("numeric"))return"numeric";if(n.startsWith("support.type.property-name"))return"property";if(e.includes("attribute-value"))return"attribute-value";if(n.startsWith("string.other.link"))return"link";if(["doctype","at-rule","important","regexp","boolean","symbol","operator","attribute-name"].includes(s))return s;if(["comment","string","constant","storage","keyword","variable","punctuation","entity","support"].includes(t))return t},Gt=(n,e,t,a)=>{const r=vl(a);if(!r||e===t)return;const s=new Range;s.setStart(n,e),s.setEnd(n,t),wt.has(r)||wt.set(r,new Highlight),wt.get(r).add(s)},Xn=(n,e,t={})=>{Object.entries(t).forEach(([a,r])=>{const s=e.indices[+a];s&&Gt(n,...s,r.name)})},xl=n=>n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),wl=(n,e)=>n.replace(/\\(\d+)/g,(t,a)=>e[a]===void 0?t:xl(e[a])),jr=n=>n?Array.isArray(n)?n:n.match||n.begin||n.include?[n]:n.patterns||[]:[],$l=(n,e,t)=>{var a,r;if(n==="$self")return{grammar:e,rules:e.patterns};if(n==="$base")return{grammar:t,rules:t.patterns};if(n[0]==="#")return{grammar:e,rules:jr((a=e.repository)==null?void 0:a[n.slice(1)])};const[s,i]=n.split("#"),o=Ir.get(s);return o?{grammar:o,rules:i?jr((r=o.repository)==null?void 0:r[i]):o.patterns}:null},qr=(n,e,t,a=new Set)=>{const r=[];return n.forEach(s=>{if(s.include){const i=`${e.scopeName}:${s.include}`;if(a.has(i))return;const o=$l(s.include,e,t);if(!o)return;const l=new Set(a);l.add(i),r.push(...qr(o.rules,o.grammar,t,l));return}(s.match||s.begin&&s.end)&&r.push({grammar:e,rule:s})}),r},Yn=new Map;let Qn=new Map;const zr=(n,e,t,a)=>{let r=Qn.get(n);if(!r||r.indices[0][0]<t){Yn.has(n)||Yn.set(n,new RegExp(n,"dgm"));const s=Yn.get(n);s.lastIndex=t,r=s.exec(e.data)||bl,Qn.set(n,r)}return r.indices[0][0]<a&&r.indices[0][1]<=a?r:null},kl=(n,e,t,a)=>{let r=null;return e.forEach(s=>{const i=s.rule.match||s.rule.begin,o=zr(i,n,t,a);o&&(!r||o.indices[0][0]<r.match.indices[0][0])&&(r={...s,match:o})}),r},Pr=(n,e,t,a,r,s=r,i=null)=>{const o=qr(e,r,s);let l=t;for(;l<a;){const c=kl(n,o,l,a),d=i?zr(i.pattern,n,l,a):null,p=c?.match.indices[0][0]??1/0,h=d?.indices[0][0]??1/0;if(d&&(h<p||h===p&&!(i!=null&&i.applyEndPatternLast)))return{contentEnd:h,end:d.indices[0][1],match:d};if(!c)return{contentEnd:a,end:a,match:null};const{rule:m,match:y,grammar:g}=c;if(m.match){m.name&&Gt(n,...y.indices[0],m.name),Xn(n,y,m.captures),l=y.indices[0][1]>l?y.indices[0][1]:l+1;continue}const f=Pr(n,m.patterns||[],y.indices[0][1],a,g,s,{pattern:wl(m.end,y),applyEndPatternLast:m.applyEndPatternLast});m.name&&Gt(n,y.indices[0][0],f.end,m.name),m.contentName&&Gt(n,y.indices[0][1],f.contentEnd,m.contentName),Xn(n,y,m.beginCaptures||m.captures),f.match&&Xn(n,f.match,m.endCaptures||m.captures),l=f.end>l?f.end:l+1}return{contentEnd:a,end:a,match:null}},Ur=n=>{var e,t,a;const r=n.parentElement,s=i=>{var o;return!i||!i.classList?null:(o=[...i.classList].find(l=>l.startsWith("language-")))==null?void 0:o.slice(9)};return(s(n)||((e=n.dataset)==null?void 0:e.language)||s(r)||((t=r?.dataset)==null?void 0:t.language)||((a=r?.getAttribute)==null?void 0:a.call(r,"lang"))||"").toLowerCase()},Sl=n=>yl[n]||n,El=(n=document)=>{const e=[],t=new Set,a=r=>{if(!(!r||t.has(r))&&(t.add(r),r.querySelectorAll)){const s=r.querySelectorAll("pre > code");e.push(...s);const i=r.querySelectorAll("*");for(let o=0;o<i.length;o++){const l=i[o];l.shadowRoot&&a(l.shadowRoot)}}};return a(n),e};let ea=!1;const Al=(n=document)=>{if(typeof window>"u"||typeof CSS>"u"||!CSS.highlights)return;const e=El(n).filter(Ur);e.length!==0&&(wt.forEach((t,a)=>{CSS.highlights.get(a)===t&&CSS.highlights.delete(a),t.clear()}),e.forEach(t=>{const a=Ur(t),r=Sl(a),s=Rr[r];if(!s)return;Array.from(t.childNodes).forEach(o=>{o.nodeType===Node.COMMENT_NODE&&t.removeChild(o)}),t.normalize();const i=t.firstChild;!i||i.nodeType!==Node.TEXT_NODE||(Qn=new Map,Pr(i,s.patterns,0,i.data.length,s))}),wt.forEach((t,a)=>{t.size&&CSS.highlights.set(a,t)}))},Xt=(n=document)=>{ea||(ea=!0,requestAnimationFrame(()=>{ea=!1,Al(n)}))},Fe=U`.hover-bg:hover{background:var(--bg3)}::selection{background:var(--selection-bg);color:var(--selection-fg)}.regular-font{font-family:var(--font-regular)}.mono-font{font-family:var(--font-mono)}.title{font-size:calc(var(--font-size-small) + 18px);text-wrap:balance;font-weight:400}.sub-title{text-wrap:balance;font-size:20px}.req-res-title{font-family:var(--font-regular);font-size:calc(var(--font-size-small) + 4px);text-align:start;text-wrap:balance;margin-bottom:8px;font-weight:700}.tiny-title{font-size:calc(var(--font-size-small) + 1px);font-weight:700}.regular-font-size{font-size:var(--font-size-regular)}.small-font-size{font-size:var(--font-size-small)}.upper{text-transform:uppercase}.primary-text{color:var(--primary-color)}.bold-text{font-weight:700}.gray-text{color:var(--light-fg)}.red-text{color:var(--red)}.blue-text{color:var(--blue)}.multiline{max-height:var(--resp-area-height,400px);color:var(--fg3);overflow:scroll}.method-fg.put{color:var(--orange)}.method-fg.post{color:var(--green)}.method-fg.get{color:var(--blue)}.method-fg.delete{color:var(--red)}.method-fg.options,.method-fg.head,.method-fg.patch{color:var(--yellow)}h1{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:28px;font-weight:400}h2{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:24px;font-weight:400}h3{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:18px;font-weight:400}h4{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:16px;font-weight:400}h5,h6{font-family:var(--font-regular);letter-spacing:normal;padding-top:10px;font-size:14px;font-weight:400}h1,h2,h3,h4,h5,h6{text-wrap:balance;margin-block-end:.2em}p{margin-block-start:.5em}a{color:var(--blue);cursor:pointer}a.inactive-link{color:var(--fg);cursor:text;text-decoration:none}code,pre{font-family:var(--font-mono);font-size:calc(var(--font-size-mono) - 1px);margin:0}.m-markdown,.m-markdown-small{display:block}.m-markdown p,.m-markdown span{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 8px)}.m-markdown li{font-size:var(--font-size-regular);line-height:calc(var(--font-size-regular) + 10px)}.m-markdown-small p,.m-markdown-small span,.m-markdown-small li{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 6px)}.m-markdown-small li{line-height:calc(var(--font-size-small) + 8px)}.m-markdown p:not(:first-child){margin-block-start:24px}.m-markdown-small p:not(:first-child){margin-block-start:12px}.m-markdown-small p:first-child{margin-block-start:0}.m-markdown p,.m-markdown-small p{margin-block-end:0}.m-markdown code span{font-size:var(--font-size-mono)}.m-markdown-small code,.m-markdown code{color:var(--inline-code-fg);font-size:calc(var(--font-size-mono));border-radius:2px;padding:1px 6px;line-height:1.2}.m-markdown-small code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown-small pre,.m-markdown pre{white-space:pre-wrap;border:1px solid var(--code-border-color);border-radius:2px;line-height:normal;overflow-x:auto}.m-markdown pre{background:var(--code-bg);color:var(--code-fg);padding:12px}.m-markdown-small pre{background:var(--bg3);color:var(--fg2);margin-top:4px;padding:2px 4px}.m-markdown-small pre code,.m-markdown pre code{border:none;padding:0}.m-markdown pre code{color:var(--code-fg)}.m-markdown-small pre code{color:var(--fg2);background:var(--bg3)}.m-markdown ul,.m-markdown ol{padding-inline-start:30px}.m-markdown-small ul,.m-markdown-small ol{padding-inline-start:20px}.m-markdown-small a,.m-markdown a{color:var(--blue)}.m-markdown-small img,.m-markdown img{max-width:100%}.m-markdown-small table,.m-markdown table{border-spacing:0;border-collapse:separate;border:1px solid var(--border-color);border-radius:var(--border-radius);font-size:calc(var(--font-size-small) + 1px);line-height:calc(var(--font-size-small) + 4px);max-width:100%;margin:10px 0}.m-markdown-small table{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 2px);margin:8px 0}.m-markdown-small td,.m-markdown-small th,.m-markdown td,.m-markdown th{vertical-align:top;border-top:1px solid var(--border-color);line-height:calc(var(--font-size-small) + 4px)}.m-markdown-small tr:first-child th,.m-markdown tr:first-child th{border-top:0}.m-markdown th,.m-markdown td{padding:10px 12px}.m-markdown-small th,.m-markdown-small td{padding:8px}.m-markdown th,.m-markdown-small th{background:var(--bg2);vertical-align:middle;font-weight:600}.m-markdown-small table code{font-size:calc(var(--font-size-mono) - 2px)}.m-markdown table code{font-size:calc(var(--font-size-mono) - 1px)}.m-markdown blockquote,.m-markdown-small blockquote{border-inline-start:3px solid var(--border-color);margin-inline:0;padding:6px 0 6px 6px}.m-markdown hr{border:1px solid var(--border-color)}`,$t=U`.m-btn{border-radius:var(--border-radius);font-weight:600;font-size:var(--font-size-small);text-align:center;white-space:nowrap;border:2px solid var(--primary-color);user-select:none;cursor:pointer;background:0 0;outline:0;padding:6px 16px;line-height:1;transition-duration:.75s;display:inline-block;box-shadow:0 1px 3px #0000001f,0 1px 2px #0000003d}.m-btn.primary{background:var(--primary-color);color:var(--primary-color-invert)}.m-btn.thin-border{border-width:1px}.m-btn.large{padding:8px 14px}.m-btn.small{padding:5px 12px}.m-btn.tiny{padding:5px 6px}.m-btn.circle{border-radius:50%}.m-btn:hover{background:var(--primary-color);color:var(--primary-color-invert)}.m-btn.nav{border:2px solid var(--nav-accent-color)}.m-btn.nav:hover{background:var(--nav-accent-color)}.m-btn:disabled{background:var(--bg3);color:var(--fg3);border-color:var(--fg3);cursor:not-allowed;opacity:.4}.m-btn:active{filter:brightness(75%);transition:scale;transform:scale(.95)}.toolbar-btn{cursor:pointer;font-size:var(--font-size-small);min-width:50px;color:var(--primary-color-invert);background:var(--primary-color);border:none;border-radius:2px;margin:0 2px;padding:4px}input,textarea,select,button,pre{color:var(--fg);background:var(--input-bg);border:1px solid var(--border-color);border-radius:var(--border-radius);outline:none}button{font-family:var(--font-regular)}pre,select,textarea,input[type=file],input[type=text],input[type=password]{font-family:var(--font-mono);font-weight:400;font-size:var(--font-size-small);padding:6px 5px;transition:border .2s}select{font-family:var(--font-regular);-webkit-appearance:none;-moz-appearance:none;appearance:none;cursor:pointer;background-image:url(data:image/svg+xml;charset=utf8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2212%22%20height%3D%2212%22%3E%3Cpath%20d%3D%22M10.3%203.3L6%207.6%201.7%203.3A1%201%200%2000.3%204.7l5%205a1%201%200%20001.4%200l5-5a1%201%200%2010-1.4-1.4z%22%20fill%3D%22%23777777%22%2F%3E%3C%2Fsvg%3E);background-position:calc(100% - 5px);background-repeat:no-repeat;background-size:10px;padding:5px 30px 5px 5px}select:hover{border-color:var(--primary-color)}textarea::placeholder,input[type=text]::placeholder,input[type=password]::placeholder{color:var(--placeholder-color);opacity:1}input[type=file]{font-family:var(--font-regular);cursor:pointer;border:1px solid var(--primary-color);min-height:calc(var(--font-size-small) + 18px);padding:2px}input[type=file]::file-selector-button,input[type=file]::-webkit-file-upload-button{font-family:var(--font-regular);font-size:var(--font-size-small);cursor:pointer;border:1px solid var(--primary-color);background:var(--primary-color);color:var(--primary-color-invert);border-radius:var(--border-radius);-webkit-appearance:none;outline:none;padding:3px 8px}input[type=file]::file-selector-button,input[type=file]::file-selector-button{font-family:var(--font-regular);font-size:var(--font-size-small);cursor:pointer;border:1px solid var(--primary-color);background:var(--primary-color);color:var(--primary-color-invert);border-radius:var(--border-radius);-webkit-appearance:none;outline:none;padding:3px 8px}pre,textarea{scrollbar-width:thin;scrollbar-color:var(--border-color) var(--input-bg)}pre::-webkit-scrollbar,textarea::-webkit-scrollbar{width:8px;height:8px}pre::-webkit-scrollbar-track,textarea::-webkit-scrollbar-track{background:var(--input-bg)}pre::-webkit-scrollbar-thumb,textarea::-webkit-scrollbar-thumb{background:var(--border-color);border-radius:2px}.link{font-size:var(--font-size-small);color:var(--blue);font-family:var(--font-mono);margin-bottom:2px;text-decoration:underline}input[type=checkbox]{appearance:none;background:var(--light-bg);border:1px solid var(--light-bg);cursor:pointer;vertical-align:top;border-radius:9px;width:36px;min-width:36px;height:18px;transition:border .25s .15s,box-shadow .25s .3s,padding .25s;display:inline-block;position:relative}input[type=checkbox]:after{background:var(--bg);border:1px solid var(--light-bg);content:"";border-radius:8px;height:16px;transition:border .25s .15s,left .25s .1s,right .15s .175s;display:block;position:absolute;top:0;left:0;right:16px}input[type=checkbox]:checked{background:var(--green);border-color:var(--green)}input[type=checkbox]:checked:after{border:1px solid var(--green);transition:border .25s,left .15s .25s,right .25s .175s;left:16px;right:1px}`,Yt=U`.row,.col{display:flex}.row{flex-direction:row;align-items:center}.col{flex-direction:column;align-items:stretch}`,Qt=U`.m-table{border-spacing:0;border-collapse:separate;border:1px solid var(--light-border-color);border-radius:var(--border-radius);direction:ltr;max-width:100%;margin:0}.m-table tr:first-child td,.m-table tr:first-child th{border-top:0}.m-table td,.m-table th{font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 4px);vertical-align:top;padding:4px 5px}.m-table.padded-12 td,.m-table.padded-12 th{padding:12px}.m-table td:not([align]),.m-table th:not([align]){text-align:start}.m-table th{color:var(--fg2);font-size:var(--font-size-small);line-height:calc(var(--font-size-small) + 18px);letter-spacing:normal;background:var(--bg2);vertical-align:bottom;border-bottom:1px solid var(--light-border-color);font-weight:600}.m-table>tbody>tr>td,.m-table>tr>td{border-top:1px solid var(--light-border-color);text-overflow:ellipsis;overflow:hidden}.table-title{font-size:var(--font-size-small);vertical-align:middle;margin:12px 0 4px;font-weight:700}`,Mr=U`.only-large-screen{display:none}.endpoint-head .path{font-family:var(--font-mono);font-size:var(--font-size-small);overflow-wrap:break-word;word-break:break-all;align-items:center;display:flex}.endpoint-head .descr{font-size:var(--font-size-small);color:var(--light-fg);overflow-wrap:break-word;word-break:break-all;align-items:center;font-weight:400;display:none}.m-endpoint.expanded{margin-bottom:16px}.m-endpoint>.endpoint-head{border:1px solid #0000;border-left-width:5px;border-top-color:var(--light-border-color);cursor:pointer;align-items:center;padding:6px 16px;display:flex}.m-endpoint>.endpoint-head.put:hover,.m-endpoint>.endpoint-head.put.expanded{border-color:var(--orange);background:color-mix(in srgb, var(--orange) 10%, transparent)}.m-endpoint>.endpoint-head.post:hover,.m-endpoint>.endpoint-head.post.expanded{border-color:var(--green);background:color-mix(in srgb, var(--green) 10%, transparent)}.m-endpoint>.endpoint-head.get:hover,.m-endpoint>.endpoint-head.get.expanded{border-color:var(--blue);background:color-mix(in srgb, var(--blue) 10%, transparent)}.m-endpoint>.endpoint-head.delete:hover,.m-endpoint>.endpoint-head.delete.expanded{border-color:var(--red);background:color-mix(in srgb, var(--red) 10%, transparent)}.m-endpoint>.endpoint-head.head:hover,.m-endpoint>.endpoint-head.head.expanded,.m-endpoint>.endpoint-head.patch:hover,.m-endpoint>.endpoint-head.patch.expanded,.m-endpoint>.endpoint-head.options:hover,.m-endpoint>.endpoint-head.options.expanded{border-color:var(--yellow);background:color-mix(in srgb, var(--yellow) 10%, transparent)}.m-endpoint>.endpoint-head.deprecated:hover,.m-endpoint>.endpoint-head.deprecated.expanded{border-color:var(--border-color);filter:opacity(.6)}.m-endpoint .endpoint-body{border-style:solid;border-width:0 1px 1px 5px;flex-wrap:wrap;padding:16px 0 0;box-shadow:0 4px 3px -3px #00000026}.m-endpoint .endpoint-body.delete{border-color:var(--red)}.m-endpoint .endpoint-body.put{border-color:var(--orange)}.m-endpoint .endpoint-body.post{border-color:var(--green)}.m-endpoint .endpoint-body.get{border-color:var(--blue)}.m-endpoint .endpoint-body.head,.m-endpoint .endpoint-body.patch,.m-endpoint .endpoint-body.options{border-color:var(--yellow)}.m-endpoint .endpoint-body.deprecated{border-color:var(--border-color);filter:opacity(.6)}.endpoint-head .deprecated{color:var(--light-fg);filter:opacity(.6)}.summary{padding:8px}.summary .title{font-size:calc(var(--font-size-regular) + 2px);word-break:break-all;margin-bottom:6px}.endpoint-head .method{vertical-align:middle;font-size:var(--font-size-small);height:calc(var(--font-size-small) + 16px);line-height:calc(var(--font-size-small) + 8px);text-align:center;text-transform:uppercase;border-radius:2px;width:60px;margin-inline-end:5px;padding:2px 5px;font-weight:700;display:inline-block}.endpoint-head .method.delete{border:2px solid var(--red)}.endpoint-head .method.put{border:2px solid var(--orange)}.endpoint-head .method.post{border:2px solid var(--green)}.endpoint-head .method.get{border:2px solid var(--blue)}.endpoint-head .method.get.deprecated{border:2px solid var(--border-color)}.endpoint-head .method.head,.endpoint-head .method.patch,.endpoint-head .method.options{border:2px solid var(--yellow)}.req-resp-container{border-top:1px solid var(--light-border-color);flex-flow:column wrap;align-items:stretch;margin-top:16px;display:flex}.view-mode-request,api-response.view-mode{flex:1;min-height:100px;padding:16px 8px;overflow:hidden}.view-mode-request{border-style:dashed;border-width:0 0 1px}.head .view-mode-request,.patch .view-mode-request,.options .view-mode-request{border-color:var(--yellow)}.put .view-mode-request{border-color:var(--orange)}.post .view-mode-request{border-color:var(--green)}.get .view-mode-request{border-color:var(--blue)}.delete .view-mode-request{border-color:var(--red)}@container (width>=1024px){.only-large-screen{display:block}.endpoint-head .path{font-size:var(--font-size-regular)}.endpoint-head .descr{display:flex}.endpoint-head .m-markdown-small,.descr .m-markdown-small{display:block}.req-resp-container{flex-direction:var(--layout,row);flex-wrap:nowrap}api-response.view-mode{padding:16px}.view-mode-request.row-layout{border-width:0 1px 0 0;padding:16px}.summary{padding:8px 16px}}`,ta=U`code[class*=language-],pre[class*=language-]{text-align:left;white-space:pre;word-spacing:normal;word-break:normal;word-wrap:normal;tab-size:2;-webkit-hyphens:none;-moz-hyphens:none;-ms-hyphens:none;hyphens:none;line-height:1.5}pre[class*=language-]{margin:.5em 0;padding:1em;overflow:auto}:not(pre)>code[class*=language-]{white-space:normal}::highlight(comment),::highlight(quote){color:var(--syntax-comment,#6e7781)}::highlight(keyword),::highlight(storage),::highlight(at-rule),::highlight(doctype),::highlight(important),::highlight(section){color:var(--syntax-keyword,#cf222e)}::highlight(operator),::highlight(punctuation){color:var(--syntax-operator,#24292f)}::highlight(string),::highlight(regexp),::highlight(attribute-value),::highlight(link),::highlight(raw){color:var(--syntax-string,#0a3069)}::highlight(numeric),::highlight(boolean),::highlight(constant),::highlight(symbol),::highlight(character-entity),::highlight(anchor),::highlight(entity){color:var(--syntax-constant,#0550ae)}::highlight(function),::highlight(decorator),::highlight(animation){color:var(--syntax-function,#8250df)}::highlight(type),::highlight(support){color:var(--syntax-type,#8250df)}::highlight(variable),::highlight(interpolation){color:var(--syntax-variable,#953800)}::highlight(property),::highlight(key),::highlight(attribute-name){color:var(--syntax-property,#0550ae)}::highlight(tag){color:var(--syntax-tag,#116329)}::highlight(selector){color:var(--syntax-selector,#8250df)}::highlight(inserted){color:var(--syntax-inserted,#116329)}::highlight(deleted){color:var(--syntax-deleted,#cf222e)}`,en=U`.tab-panel{border:none}.tab-buttons{border-bottom:1px solid var(--light-border-color);scrollbar-width:thin;align-items:stretch;height:30px;padding:4px 4px 0;overflow:auto hidden}.tab-buttons::-webkit-scrollbar{background:var(--border-color);height:1px}.tab-btn{color:var(--light-fg);white-space:nowrap;cursor:pointer;font-family:var(--font-regular);font-size:var(--font-size-small);background:0 0;border:none;border-bottom:3px solid #0000;outline:none;margin-inline-end:16px;padding:1px}.tab-btn.active{border-bottom:3px solid var(--primary-color);color:var(--primary-color);font-weight:700}.tab-btn:hover{color:var(--primary-color)}.tab-content{min-height:50px;margin:-1px 0 0;position:relative}`,Hr=U`#advanced-search-btn{display:none}#nav-bar-btn{background:var(--bg2);width:50px;height:50px;color:var(--fg1);border:1px solid var(--border-color);cursor:pointer;z-index:10;border-radius:4px;font-size:36px;line-height:30px;position:absolute;top:16px;right:16px;box-shadow:0 12px 16px #0000003d,0 17px 50px #00000030;&:hover{border-color:var(--primary-color);color:var(--primary-color)}}.nav-bar{width:0;height:100%;color:var(--nav-text-color);background:var(--nav-bg-color);background-blend-mode:multiply;line-height:calc(var(--font-size-small) + 4px);word-break:break-word;flex-flow:column;position:relative;overflow:hidden;&.floating-nav{z-index:5;width:330px;position:absolute;top:0;left:0;overflow:scroll}}.nav-bar-info:focus-visible,.nav-bar-tag:focus-visible,.nav-bar-path:focus-visible{box-shadow:none;outline-offset:-4px;outline:1px solid}.nav-bar-expand-all:focus-visible,.nav-bar-collapse-all:focus-visible,.nav-bar-tag-icon:focus-visible{box-shadow:none;outline-offset:2px;outline:1px solid}::slotted([slot=nav-logo]){object-fit:contain;width:auto;height:60px;padding:16px 16px 0}.nav-scroll{overflow:hidden auto;overflow-y:overlay;scrollbar-width:thin;scrollbar-color:var(--nav-hover-bg-color) transparent}.nav-bar-tag{flex-direction:row;justify-content:space-between;align-items:center;display:flex}.nav-bar.read .nav-bar-tag-icon{display:none}.nav-bar-paths-under-tag{transition:max-height .2s ease-out,visibility .3s;overflow:hidden}.collapsed .nav-bar-paths-under-tag{visibility:hidden;max-height:0}.nav-bar-expand-all{cursor:pointer;margin-inline-end:10px;transform:rotate(90deg)}.nav-bar-collapse-all{cursor:pointer;transform:rotate(270deg)}.nav-bar-expand-all:hover,.nav-bar-collapse-all:hover{color:var(--primary-color)}.nav-bar-tag-icon{color:var(--nav-text-color);font-size:20px}.nav-bar-tag-icon:hover{color:var(--nav-hover-text-color)}.nav-bar.focused .nav-bar-tag-and-paths.collapsed .nav-bar-tag-icon:after{content:"⌵";text-align:center;width:16px;height:16px;transition:transform .2s ease-out;display:inline-block;transform:rotate(-90deg)}.nav-bar.focused .nav-bar-tag-and-paths.expanded .nav-bar-tag-icon:after{content:"⌵";text-align:center;width:16px;height:16px;transition:transform .2s ease-out;display:inline-block}.nav-scroll::-webkit-scrollbar{width:var(--scroll-bar-width,8px)}.nav-scroll::-webkit-scrollbar-track{background:0 0}.nav-scroll::-webkit-scrollbar-thumb{background:var(--nav-hover-bg-color)}.nav-bar-tag{font-size:var(--font-size-regular);color:var(--nav-accent-color);text-transform:capitalize;border-inline-start:4px solid #0000;padding:15px 15px 15px 10px;font-weight:700}.nav-bar-components,.nav-bar-h1,.nav-bar-h2,.nav-bar-info,.nav-bar-tag,.nav-bar-path{cursor:pointer;width:100%;color:var(--nav-text-color);background:0 0;border:none;border-inline-start:4px solid #0000;border-radius:4px;display:flex}.nav-bar-h1,.nav-bar-h2,.nav-bar-path{font-size:calc(var(--font-size-small) + 1px);padding:var(--nav-item-padding)}.nav-bar-path.small-font{font-size:var(--font-size-small)}.nav-bar-info{font-size:var(--font-size-regular);padding:16px 10px;font-weight:700}.nav-bar-section{font-size:var(--font-size-small);color:var(--nav-text-color);padding:var(--nav-item-padding);flex-direction:row;justify-content:space-between;font-weight:700;display:flex}.nav-bar-section.operations{cursor:pointer}.nav-bar-section.operations:hover{color:var(--nav-hover-text-color);background:var(--nav-hover-bg-color)}.nav-bar-section:first-child{display:none}.nav-bar-h2{padding-inline-start:28px}.nav-bar-h1.left-bar.active,.nav-bar-h2.left-bar.active,.nav-bar-info.left-bar.active,.nav-bar-tag.left-bar.active,.nav-bar-path.left-bar.active,.nav-bar-section.left-bar.operations.active{border-inline-start:4px solid var(--nav-accent-color);color:var(--nav-hover-text-color)}.nav-bar-h1.colored-block.active,.nav-bar-h2.colored-block.active,.nav-bar-info.colored-block.active,.nav-bar-tag.colored-block.active,.nav-bar-path.colored-block.active,.nav-bar-section.colored-block.operations.active{background:var(--nav-accent-color);color:var(--nav-accent-text-color);border-radius:0}.nav-bar-h1:hover,.nav-bar-h2:hover,.nav-bar-info:hover,.nav-bar-tag:hover,.nav-bar-path:hover{color:var(--nav-hover-text-color);background:var(--nav-hover-bg-color)}`,Wr=U`#api-info{font-size:calc(var(--font-size-regular) - 1px);margin-top:8px}#api-info span:before{content:"|";opacity:.5;text-align:center;width:15px;display:inline-block}#api-info span:first-child:before{content:"";width:0}`,Ke=U``,Dl=U`*,:before,:after{box-sizing:border-box}.dialog-box{background:var(--bg2);color:var(--fg2);border:1px solid var(--border-color);border-radius:4px;width:70vw;max-width:70vw;height:70vh;max-height:70vh;padding:0;position:absolute;top:100px;box-shadow:0 14px 28px #00000040,0 10px 10px #00000038}.dialog-box-header{z-index:10;backdrop-filter:blur(12px);border-bottom:1px solid var(--light-border-color);align-self:stretch;align-items:center;min-height:60px;max-height:60px;padding:0 16px;display:flex;position:sticky;top:0;overflow:hidden}.dialog-box-header button{color:var(--fg);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:50%;outline:none;margin-inline-end:-8px;font-size:1.5rem;font-weight:700;line-height:1}.dialog-box-header button:hover{border-color:var(--primary-color)}.dialog-box-content{height:100%;padding:16px;display:block;overflow:auto}.dialog-box-title{flex-grow:1;font-size:24px}`,tn=/[\s#:?&={}]/g,Te="_rapidoc_api_key";function nn(n){return new Promise(e=>setTimeout(e,n))}function kt(n,e){const t=e.target,a=document.createElement("textarea");a.value=n,a.style.position="fixed",document.body.appendChild(a),a.focus(),a.select();try{document.execCommand("copy"),t.innerText="Copied",setTimeout(()=>{t.innerText="Copy"},5e3)}catch{}document.body.removeChild(a)}function Cl(n,e){return e.name.toLowerCase().includes(n.toLowerCase())}function St(n,e,t=""){return`${e.method} ${e.path} ${e.summary||""} ${e.description||""} ${e.operationId||""} ${t}`.toLowerCase().includes(n.toLowerCase())}function na(n,e=new Set){return n&&Object.keys(n).forEach(t=>{var a,r;e.add(t),n[t].properties?na(n[t].properties,e):(a=n[t].items)!=null&&a.properties&&na((r=n[t].items)==null?void 0:r.properties,e)}),e}function Fl(n,e,t=[]){if(!n.trim()||t.length===0)return;const a=[];return e.forEach(r=>{r.paths.forEach(s=>{var i,o,l,c;let d="";if(t.includes("search-api-path")&&(d=s.path),t.includes("search-api-descr")&&(d=`${d} ${(s.summary||"")+(s.description||"")}`),t.includes("search-api-params")&&(d=`${d} ${((i=s.parameters)==null?void 0:i.map(p=>p.name).join(" "))||""}`),t.includes("search-api-request-body")&&s.requestBody){let p=new Set;for(const h in(o=s.requestBody)==null?void 0:o.content)(l=s.requestBody.content[h].schema)!=null&&l.properties&&(p=na((c=s.requestBody.content[h].schema)==null?void 0:c.properties)),d=`${d} ${[...p].join(" ")}`}t.includes("search-api-resp-descr")&&(d=`${d} ${Object.values(s.responses).map(p=>p.description||"").join(" ")}`),d.toLowerCase().includes(n.trim().toLowerCase())&&a.push({elementId:s.elementId,method:s.method,path:s.path,summary:s.summary||s.description||"",deprecated:s.deprecated})})}),a}function Kr(n,e){if(n){const t=document.createElement("a");document.body.appendChild(t),t.style="display: none",t.href=n,t.download=e,t.click(),t.remove()}}function Vr(n){if(n){const e=document.createElement("a");document.body.appendChild(e),e.style="display: none",e.href=n,e.target="_blank",e.click(),e.remove()}}const Zr=n=>{if(n===null||typeof n!="object")return!1;const e=Object.getPrototypeOf(n);return e===Object.prototype||e===null},te=n=>typeof n=="object"&&n!==null;function Oe(n,e,t=[]){const a={};for(const[r,s]of Object.entries(n)){const i=[...t,r];if(Array.isArray(s)){a[r]=s.map((o,l)=>typeof o=="object"&&!Array.isArray(o)&&o!==null?Oe(o,e,[...i,l.toString()]):o);continue}if(te(s)){a[r]=Oe(s,e,i);continue}a[r]=s}return e(a,t)}const xe="application/json";function Jr(n){const e=n["x-example"],t=n["x-examples"];return delete n["x-example"],delete n["x-examples"],{xExample:e,xExamples:t}}function Ne(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&Object.keys(n).length>0}function Tl(n){return Ne(n)&&Object.values(n).every(e=>typeof e=="object"&&e!==null&&!Array.isArray(e))}function Ol(n){if(!te(n))return!0;const e=n,t=["enum","const","not","format","multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","maxProperties","minProperties","required"];return!(e.allOf||e.oneOf||e.anyOf||e.items||e.$ref||"additionalProperties"in e||t.some(a=>a in e)||typeof e.properties=="object"&&e.properties!==null&&Object.keys(e.properties).length>0)}function Gr(n){const e=Object.keys(n);if(e.some(t=>{const a=n[t];return te(a)&&(a.example!==void 0||a.examples!==void 0)}))for(const t of e){const a=n[t];if(!te(a))continue;const r=a.example!==void 0||a.examples!==void 0;a.schema!==void 0&&!r&&Object.keys(a).length===1&&Ol(a.schema)&&delete n[t]}}const Nl=new Set(["summary","description","value","externalValue"]);function Xr(n){if(typeof n!="object"||n===null)return!1;const e=n,t="value"in e||"externalValue"in e,a=Object.keys(e).every(r=>Nl.has(r));return t&&a}function Ve(n){return Xr(n)?n:{value:n}}const Bl=/^[a-zA-Z0-9*+.-]+\/[a-zA-Z0-9*+.+-]+$/;function aa(n){return Bl.test(n)}function Ll(n){return Object.entries(n).reduce((e,[t,a])=>(e[t]={value:a},e),{})}const _l=n=>{switch(n){case"application":return"clientCredentials";case"accessCode":return"authorizationCode";case"implicit":return"implicit";case"password":return"password";default:return n}};function Rl(n){var e,t,a;let r=n;if(r!==null&&typeof r=="object"&&typeof r.swagger=="string"&&(e=r.swagger)!=null&&e.startsWith("2.0"))r.openapi="3.0.4",delete r.swagger;else return r;if(r.host){const s=Array.isArray(r.schemes)&&(t=r.schemes)!=null&&t.length?r.schemes:["http"];r.servers=s.map(i=>({url:`${i}://${r.host}${r.basePath??""}`})),delete r.basePath,delete r.schemes,delete r.host}else r.basePath&&(r.servers=[{url:r.basePath}],delete r.basePath);if(r.definitions){for(const s of Object.values(r.definitions))ge(s);r.components=Object.assign({},r.components,{schemas:r.definitions}),delete r.definitions,r=Oe(r,s=>(typeof s.$ref=="string"&&s.$ref.startsWith("#/definitions/")&&(s.$ref=s.$ref.replace(/^#\/definitions\//,"#/components/schemas/")),s))}if(r=Oe(r,s=>(s.type==="file"&&(s.type="string",s.format="binary"),s)),Object.hasOwn(r,"parameters")){r=Oe(r,l=>{if(typeof l.$ref=="string"&&l.$ref.startsWith("#/parameters/")){const c=l.$ref.split("/")[2];if(!c)return l;const d=te(r.parameters)&&c in r.parameters?r.parameters[c]:void 0;d&&typeof d=="object"&&"in"in d&&(d.in==="body"||d.in==="formData")?l.$ref=l.$ref.replace(/^#\/parameters\//,"#/components/requestBodies/"):l.$ref=l.$ref.replace(/^#\/parameters\//,"#/components/parameters/")}return l}),r.components??(r.components={});const s={},i={},o=te(r.parameters)?r.parameters:{};for(const[l,c]of Object.entries(o))if(c&&typeof c=="object"){if("$ref"in c){const d=sa(c);s[l]=d}else if("in"in c)if(c.in==="body")i[l]=ts(c,r.consumes??[xe]);else if(c.in==="formData")i[l]=ns([c],r.consumes);else{const d=sa(c);s[l]=d}}Object.keys(s).length>0&&(r.components.parameters=s),Object.keys(i).length>0&&(r.components.requestBodies=i),delete r.parameters}if(Object.hasOwn(r,"responses")&&typeof r.responses=="object"&&r.responses!==null){r=Oe(r,o=>(typeof o.$ref=="string"&&o.$ref.startsWith("#/responses/")&&(o.$ref=o.$ref.replace(/^#\/responses\//,"#/components/responses/")),o)),r.components??(r.components={});const s={},i=r.responses;for(const[o,l]of Object.entries(i))if(te(l))if("$ref"in l)s[o]=l;else{const c=l,d=r.produces??[xe];if(c.schema){ge(c.schema),typeof c.content!="object"&&(c.content={});for(const p of d)c.content[p]={schema:c.schema};delete c.schema}if(c.examples&&typeof c.examples=="object"){typeof c.content!="object"&&(c.content={});const p=d[0]??xe;for(const[h,m]of Object.entries(c.examples))if(aa(h))typeof c.content[h]!="object"&&(c.content[h]={}),c.content[h].example=m;else{typeof c.content[p]!="object"&&(c.content[p]={});const y=c.content[p];typeof y.examples!="object"&&(y.examples={}),y.examples[h]=Ve(m)}delete c.examples}c.content&&typeof c.content=="object"&&Gr(c.content),te(c.headers)&&(c.headers=Object.entries(c.headers).reduce((p,[h,m])=>m&&typeof m=="object"?{[h]:Yr(m),...p}:p,{})),s[o]=c}Object.keys(s).length>0&&(r.components.responses=s),delete r.responses}if(typeof r.paths=="object"){for(const s in r.paths)if(Object.hasOwn(r.paths,s)){const i=te(r.paths)&&s in r.paths?r.paths[s]:void 0;if(!i||typeof i!="object")continue;let o;for(const l in i)if(l==="parameters"&&Object.hasOwn(i,l)){const c=as(i.parameters,r.consumes??[xe]);i.parameters=c.parameters,o=c.requestBody}else if(Object.hasOwn(i,l)){const c=i[l];if(o&&(c.requestBody=o),c.parameters){const d=as(c.parameters,c.consumes??r.consumes??[xe]);c.parameters=d.parameters,d.requestBody&&(c.requestBody=d.requestBody)}if(delete c.consumes,c.responses){for(const d in c.responses)if(Object.hasOwn(c.responses,d)){const p=c.responses[d];if(p.headers&&typeof p.headers=="object"&&(p.headers=Object.entries(p.headers).reduce((h,[m,y])=>y&&typeof y=="object"?{[m]:Yr(y),...h}:h,{})),p.schema){ge(p.schema);const h=r.produces??c.produces??[xe];typeof p.content!="object"&&(p.content={});for(const m of h)p.content[m]={schema:p.schema};delete p.schema}if(p.examples&&typeof p.examples=="object"){typeof p.content!="object"&&(p.content={});const h=(r.produces??c.produces??[xe])[0]??xe;for(const[m,y]of Object.entries(p.examples))if(aa(m))typeof p.content[m]!="object"&&(p.content[m]={}),p.content[m].example=y;else{typeof p.content[h]!="object"&&(p.content[h]={});const g=p.content[h];typeof g.examples!="object"&&(g.examples={}),g.examples[m]=Ve(y)}delete p.examples}p.content&&typeof p.content=="object"&&Gr(p.content)}}delete c.produces,((a=c.parameters)==null?void 0:a.length)===0&&delete c.parameters}}}if(r.securityDefinitions){(typeof r.components!="object"||r.components===null)&&(r.components={}),r.components&&typeof r.components=="object"&&Object.assign(r.components,{securitySchemes:{}});for(const[s,i]of Object.entries(r.securityDefinitions))if(typeof i=="object")if("type"in i&&i.type==="oauth2"){const{flow:o,authorizationUrl:l,tokenUrl:c,scopes:d}=i;r.components&&typeof r.components=="object"&&"securitySchemes"in r.components&&r.components.securitySchemes&&Object.assign(r.components.securitySchemes,{[s]:{type:"oauth2",flows:{[_l(o||"implicit")]:Object.assign({},l&&{authorizationUrl:l},c&&{tokenUrl:c},d&&{scopes:d})}}})}else"type"in i&&i.type==="basic"?r.components&&typeof r.components=="object"&&"securitySchemes"in r.components&&r.components.securitySchemes&&Object.assign(r.components.securitySchemes,{[s]:{type:"http",scheme:"basic"}}):r.components&&typeof r.components=="object"&&"securitySchemes"in r.components&&r.components.securitySchemes&&Object.assign(r.components.securitySchemes,{[s]:i});delete r.securityDefinitions}return delete r.consumes,delete r.produces,r}const ge=n=>{if(te(n)){if(typeof n["x-nullable"]=="boolean"&&(n["x-nullable"]&&(n.nullable=!0),delete n["x-nullable"]),te(n.properties))for(const e of Object.values(n.properties))ge(e);if(ge(n.items),ge(n.additionalProperties),Array.isArray(n.allOf))for(const e of n.allOf)ge(e)}};function ra(n){const e=["type","format","default","items","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf","x-nullable"].reduce((t,a)=>(Object.hasOwn(n,a)&&(t[a]=n[a],delete n[a]),t),{});return ge(e),e}function Il(n){if(n==="formData")throw new Error("Encountered a formData parameter which should have been filtered out by the caller");if(n==="body")throw new Error("Encountered a body parameter which should have been filtered out by the caller");return n}function sa(n){if(Object.hasOwn(n,"$ref")&&typeof n.$ref=="string")return{$ref:n.$ref};const e=jl(n),t=ra(n),{xExample:a,xExamples:r}=Jr(n);if(Ne(a)?n.examples=Ll(a):Ne(r)&&(n.examples=Object.entries(r).reduce((s,[i,o])=>(s[i]=Ve(o),s),{})),delete n.collectionFormat,delete n.default,!n.in)throw new Error('Parameter object must have an "in" property');return{schema:t,...e,...n,in:Il(n.in)}}function Yr(n){if(Object.hasOwn(n,"$ref")&&typeof n.$ref=="string")return{$ref:n.$ref};const e=ra(n);return{...n,schema:e}}const Qr={ssv:{style:"spaceDelimited",explode:!1},pipes:{style:"pipeDelimited",explode:!1},multi:{style:"form",explode:!0},csv:{style:"form",explode:!1},tsv:{}},es={ssv:{},pipes:{},multi:{},csv:{style:"simple",explode:!1},tsv:{}},ia={header:es,query:Qr,path:es};function jl(n){if(n.type!=="array"||!(n.in==="query"||n.in==="path"||n.in==="header"))return{};const e=n.collectionFormat??"csv";return n.in in ia&&e in ia[n.in]?ia[n.in][e]:{}}function ql(n){if(n.type!=="array"||typeof n.collectionFormat!="string")return;const e=Qr[n.collectionFormat];if(!(!e||Object.keys(e).length===0))return e}function ts(n,e){const{xExample:t,xExamples:a}=Jr(n);delete n.name,delete n.in;const{schema:r,...s}=n;ge(r);const i={content:{},...s};if(i.content)for(const o of e){if(i.content[o]={schema:r},Ne(a)&&o in a){const l=a[o];Ne(l)&&Object.values(l).every(c=>Xr(c))?i.content[o].examples=l:Tl(l)?i.content[o].examples=Object.entries(l).reduce((c,[d,p])=>(c[d]=Ve(p),c),{}):i.content[o].examples={default:Ve(l)}}else Ne(a)&&!Object.keys(a).some(aa)&&(i.content[o].examples=Object.entries(a).reduce((l,[c,d])=>(l[c]=Ve(d),l),{}));!i.content[o].examples&&Ne(t)&&o in t&&(i.content[o].example=t[o])}return i}function ns(n,e=["multipart/form-data"]){var t;const a={content:{}},r=e.filter(i=>i==="multipart/form-data"||i==="application/x-www-form-urlencoded"),s=r.length>0?r:["multipart/form-data"];if(a.content)for(const i of s){a.content[i]={schema:{type:"object",properties:{},required:[]}};const o=(t=a.content)==null?void 0:t[i];if(o!=null&&o.schema&&typeof o.schema=="object"&&"properties"in o.schema){for(const l of n)if(l.name&&o.schema.properties){o.schema.properties[l.name]={...ra(structuredClone(l)),...l.description!==void 0?{description:l.description}:{}};const c=ql(l);c&&(o.encoding??(o.encoding={}),o.encoding[l.name]=c),l.required&&Array.isArray(o.schema.required)&&o.schema.required.push(l.name)}}}return a}function as(n,e){const t={parameters:n.filter(s=>!(s.in==="body"||s.in==="formData")).map(s=>sa(s))},a=structuredClone(n.find(s=>s.in==="body")??{});a&&Object.keys(a).length&&(t.requestBody=ts(a,e));const r=n.filter(s=>s.in==="formData");if(r.length>0){const s=ns(r,e);typeof t.requestBody!="object"?t.requestBody=s:t.requestBody={...t.requestBody,content:{...t.requestBody.content,...s.content}},typeof t.requestBody!="object"&&(t.requestBody={content:{}})}return t}const zl=new Set(["properties","items","allOf","anyOf","oneOf","not","additionalProperties","schema","schemas"]),Pl=new Set(["paths","webhooks","responses","content","headers","examples","links","encoding","variables","parameters","requestBodies","securitySchemes","pathItems","scopes"]),Ul=n=>{if(!n)return!1;const e=n[0]==="x-ext"&&n[1]!==void 0?n.slice(2):n;let t=0;for(const a of e){if(t>0){t--;continue}if(zl.has(a)||a.endsWith("Schema"))return!0;if(a==="callbacks"){t=2;continue}Pl.has(a)&&(t=1)}return!1},Ml=new Set(["properties","patternProperties","$defs","definitions"]);function an(n){const e=n?.[n.length-1];return e===void 0?!1:e==="schemas"&&n?.[n.length-2]==="components"?!0:Ml.has(e)}const Hl=new Set(["example","default","const","enum"]);function Wl(n){if(!n)return!1;for(const[e,t]of n.entries())if(Hl.has(t)&&!an(n.slice(0,e))||t==="value"&&n[e-2]==="examples"&&!an(n.slice(0,e-2)))return!0;return!1}function Kl(n){let e=n;return e===null||typeof e.openapi!="string"||!e.openapi.startsWith("3.0")||(e.openapi="3.1.1",e=Oe(e,Vl)),e}const Vl=(n,e)=>{if(Wl(e))return n;if(n.type!==void 0&&n.nullable===!0)n.type=[n.type,"null"],delete n.nullable;else if(n.nullable===!0&&n.type===void 0){if(typeof n.$ref=="string"){const{nullable:s,$ref:i,...o}=n;return{...o,anyOf:[{$ref:i},{type:"null"}]}}if(Array.isArray(n.allOf)){const{nullable:s,allOf:i,...o}=n,l=i.length===1?i[0]:{allOf:i};return{...o,anyOf:[l,{type:"null"}]}}}n.exclusiveMinimum===!0&&n.minimum!==void 0?(n.exclusiveMinimum=n.minimum,delete n.minimum):typeof n.exclusiveMinimum=="boolean"&&delete n.exclusiveMinimum,n.exclusiveMaximum===!0&&n.maximum!==void 0?(n.exclusiveMaximum=n.maximum,delete n.maximum):typeof n.exclusiveMaximum=="boolean"&&delete n.exclusiveMaximum;const t=e?.some((s,i)=>s==="examples"&&i>0?!an(e.slice(0,i)):!1);n.example!==void 0&&!t&&!an(e)&&(Ul(e)?n.examples=[n.example]:n.examples={default:{value:n.example}},delete n.example);const{format:a,...r}=n;if(n.type==="string"||Array.isArray(n.type)&&n.type.includes("string")){if(n.format==="binary"){const{type:s,...i}=r;return e?.at(-1)==="schema"&&e.at(-3)==="content"?i:{contentMediaType:"application/octet-stream",...i}}if(n.format==="base64"||n.format==="byte")return{...r,contentEncoding:"base64"}}return n["x-webhooks"]!==void 0&&(e===void 0||e.length===0)&&(n.webhooks=n["x-webhooks"],delete n["x-webhooks"]),n},Zl=["2.0","3.0","3.1","3.2"],ne={EMPTY_OR_INVALID:"Can't find JSON, YAML or filename in data.",OPENAPI_VERSION_NOT_SUPPORTED:"Can't find supported Swagger/OpenAPI version in the provided document, version must be a string.",INVALID_REFERENCE:"Can't resolve reference: %s",EXTERNAL_REFERENCE_NOT_FOUND:"Can't resolve external reference: %s",SELF_REFERENCE:"Can't resolve reference to itself: %s",FILE_DOES_NOT_EXIST:"File does not exist: %s",NO_CONTENT:"No content found"};function rs(n){if(n===null)return{version:void 0,specificationType:void 0,specificationVersion:void 0};if(Zr(n))for(const e of new Set(Zl)){const t=e==="2.0"?"swagger":"openapi",a=n[t];if(typeof a!="string")continue;const[r,s]=a.split(".");if(`${r}.${s}`===e)return{version:e,specificationType:t,specificationVersion:a}}return{version:void 0,specificationType:void 0,specificationVersion:void 0}}function Be(n){return n?.find(e=>e.isEntrypoint)}function oa(n,e,t=[]){const a={};for(const[r,s]of Object.entries(n)){const i=[...t,r];if(Array.isArray(s)){a[r]=s.map((o,l)=>typeof o=="object"&&!Array.isArray(o)&&o!==null?oa(o,e,[...i,l.toString()]):o);continue}if(typeof s=="object"&&s!==null){a[r]=oa(s,e,i);continue}a[r]=s}return e(a,t)}function ss(n){const e=[];return!n||typeof n!="object"?e:(oa(n,t=>(t.$ref&&typeof t.$ref=="string"&&!t.$ref.startsWith("#")&&e.push(t.$ref.split("#")[0]),t)),[...new Set(e)])}function la(n){return typeof n<"u"&&Array.isArray(n)&&n.length>0&&n.some(e=>e.isEntrypoint===!0)}const ca=Symbol.for("yaml.alias"),da=Symbol.for("yaml.document"),we=Symbol.for("yaml.map"),is=Symbol.for("yaml.pair"),me=Symbol.for("yaml.scalar"),Ze=Symbol.for("yaml.seq"),ae=Symbol.for("yaml.node.type"),Je=n=>!!n&&typeof n=="object"&&n[ae]===ca,rn=n=>!!n&&typeof n=="object"&&n[ae]===da,Et=n=>!!n&&typeof n=="object"&&n[ae]===we,M=n=>!!n&&typeof n=="object"&&n[ae]===is,q=n=>!!n&&typeof n=="object"&&n[ae]===me,At=n=>!!n&&typeof n=="object"&&n[ae]===Ze;function H(n){if(n&&typeof n=="object")switch(n[ae]){case we:case Ze:return!0}return!1}function W(n){if(n&&typeof n=="object")switch(n[ae]){case ca:case we:case me:case Ze:return!0}return!1}const os=n=>(q(n)||H(n))&&!!n.anchor,Le=Symbol("break visit"),Jl=Symbol("skip children"),Dt=Symbol("remove node");function Ge(n,e){const t=Gl(e);rn(n)?Xe(null,n.contents,t,Object.freeze([n]))===Dt&&(n.contents=null):Xe(null,n,t,Object.freeze([]))}Ge.BREAK=Le,Ge.SKIP=Jl,Ge.REMOVE=Dt;function Xe(n,e,t,a){const r=Xl(n,e,t,a);if(W(r)||M(r))return Yl(n,a,r),Xe(n,r,t,a);if(typeof r!="symbol"){if(H(e)){a=Object.freeze(a.concat(e));for(let s=0;s<e.items.length;++s){const i=Xe(s,e.items[s],t,a);if(typeof i=="number")s=i-1;else{if(i===Le)return Le;i===Dt&&(e.items.splice(s,1),s-=1)}}}else if(M(e)){a=Object.freeze(a.concat(e));const s=Xe("key",e.key,t,a);if(s===Le)return Le;s===Dt&&(e.key=null);const i=Xe("value",e.value,t,a);if(i===Le)return Le;i===Dt&&(e.value=null)}}return r}function Gl(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function Xl(n,e,t,a){var r,s,i,o,l;if(typeof t=="function")return t(n,e,a);if(Et(e))return(r=t.Map)==null?void 0:r.call(t,n,e,a);if(At(e))return(s=t.Seq)==null?void 0:s.call(t,n,e,a);if(M(e))return(i=t.Pair)==null?void 0:i.call(t,n,e,a);if(q(e))return(o=t.Scalar)==null?void 0:o.call(t,n,e,a);if(Je(e))return(l=t.Alias)==null?void 0:l.call(t,n,e,a)}function Yl(n,e,t){const a=e[e.length-1];if(H(a))a.items[n]=t;else if(M(a))n==="key"?a.key=t:a.value=t;else if(rn(a))a.contents=t;else{const r=Je(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const Ql={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},ec=n=>n.replace(/[!,[\]{}]/g,e=>Ql[e]);class Y{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Y.defaultYaml,e),this.tags=Object.assign({},Y.defaultTags,t)}clone(){const e=new Y(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new Y(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Y.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Y.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:Y.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Y.defaultTags),this.atNextDocument=!1);const a=e.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[s,i]=a;return this.tags[s]=i,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[s]=a;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const i=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,i),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const i=e.slice(2,-1);return i==="!"||i==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),i)}const[,a,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[a];if(s)try{return s+decodeURIComponent(r)}catch(i){return t(String(i)),null}return a==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,a]of Object.entries(this.tags))if(e.startsWith(a))return t+ec(e.substring(a.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(e&&a.length>0&&W(e.contents)){const s={};Ge(e.contents,(i,o)=>{W(o)&&o.tag&&(s[o.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,i]of a)s==="!!"&&i==="tag:yaml.org,2002:"||(!e||r.some(o=>o.startsWith(i)))&&t.push(`%TAG ${s} ${i}`);return t.join(`
|
|
81
|
+
`)}}Y.defaultYaml={explicit:!1,version:"1.2"},Y.defaultTags={"!!":"tag:yaml.org,2002:"};function ls(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const e=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(e)}return!0}function cs(n){const e=new Set;return Ge(n,{Value(t,a){a.anchor&&e.add(a.anchor)}}),e}function ds(n,e){for(let t=1;;++t){const a=`${n}${t}`;if(!e.has(a))return a}}function tc(n,e){const t=[],a=new Map;let r=null;return{onAnchor:s=>{t.push(s),r??(r=cs(n));const i=ds(e,r);return r.add(i),i},setAnchors:()=>{for(const s of t){const i=a.get(s);if(typeof i=="object"&&i.anchor&&(q(i.node)||H(i.node)))i.node.anchor=i.anchor;else{const o=new Error("Failed to resolve repeated object (this should not happen)");throw o.source=s,o}}},sourceObjects:a}}function Ye(n,e,t,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,s=a.length;r<s;++r){const i=a[r],o=Ye(n,a,String(r),i);o===void 0?delete a[r]:o!==i&&(a[r]=o)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const s=a.get(r),i=Ye(n,a,r,s);i===void 0?a.delete(r):i!==s&&a.set(r,i)}else if(a instanceof Set)for(const r of Array.from(a)){const s=Ye(n,a,r,r);s===void 0?a.delete(r):s!==r&&(a.delete(r),a.add(s))}else for(const[r,s]of Object.entries(a)){const i=Ye(n,a,r,s);i===void 0?delete a[r]:i!==s&&(a[r]=i)}return n.call(e,t,a)}function re(n,e,t){if(Array.isArray(n))return n.map((a,r)=>re(a,String(r),t));if(n&&typeof n.toJSON=="function"){if(!t||!os(n))return n.toJSON(e,t);const a={aliasCount:0,count:1,res:void 0};t.anchors.set(n,a),t.onCreate=s=>{a.res=s,delete t.onCreate};const r=n.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof n=="bigint"&&!(t!=null&&t.keep)?Number(n):n}class pa{constructor(e){Object.defineProperty(this,ae,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:a,onAnchor:r,reviver:s}={}){if(!rn(e))throw new TypeError("A document argument is required");const i={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},o=re(this,"",i);if(typeof r=="function")for(const{count:l,res:c}of i.anchors.values())r(c,l);return typeof s=="function"?Ye(s,{"":o},"",o):o}}class ua extends pa{constructor(e){super(ca),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){if(t?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let a;t!=null&&t.aliasResolveCache?a=t.aliasResolveCache:(a=[],Ge(e,{Node:(s,i)=>{(Je(i)||os(i))&&a.push(i)}}),t&&(t.aliasResolveCache=a));let r;for(const s of a){if(s===this)break;s.anchor===this.source&&(r=s)}if(r&&t){const{anchors:s,doc:i,maxAliasCount:o}=t;let l=s.get(r);if(l||(re(r,null,t),l=s.get(r)),l?.res===void 0){const c="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(c)}if(o>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=sn(i,r,s)),l.count*l.aliasCount>o)){const c="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(c)}}return r}toJSON(e,t){if(!t)return{source:this.source};const a=this.resolve(t.doc,t);if(!a){const r=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(r)}return t.anchors.get(a).res}toString(e,t,a){const r=`*${this.source}`;if(e){if(ls(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}}function sn(n,e,t){if(Je(e)){const a=e.resolve(n),r=t&&a&&t.get(a);return r?r.count*r.aliasCount:0}else if(H(e)){let a=0;for(const r of e.items){const s=sn(n,r,t);s>a&&(a=s)}return a}else if(M(e)){const a=sn(n,e.key,t),r=sn(n,e.value,t);return Math.max(a,r)}return 1}const ps=n=>!n||typeof n!="function"&&typeof n!="object";class O extends pa{constructor(e){super(me),this.value=e}toJSON(e,t){return t!=null&&t.keep?this.value:re(this.value,e,t)}toString(){return String(this.value)}}O.BLOCK_FOLDED="BLOCK_FOLDED",O.BLOCK_LITERAL="BLOCK_LITERAL",O.PLAIN="PLAIN",O.QUOTE_DOUBLE="QUOTE_DOUBLE",O.QUOTE_SINGLE="QUOTE_SINGLE";const nc="tag:yaml.org,2002:";function ac(n,e,t){if(e){const a=t.filter(s=>s.tag===e),r=a.find(s=>!s.format)??a[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(a=>{var r;return((r=a.identify)==null?void 0:r.call(a,n))&&!a.format})}function Ct(n,e,t){var a,r,s;if(rn(n)&&(n=n.contents),W(n))return n;if(M(n)){const y=(r=(a=t.schema[we]).createNode)==null?void 0:r.call(a,t.schema,null,t);return y.items.push(n),y}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:i,onAnchor:o,onTagObj:l,schema:c,sourceObjects:d}=t;let p;if(i&&n&&typeof n=="object"){if(p=d.get(n),p)return p.anchor??(p.anchor=o(n)),new ua(p.anchor);p={anchor:null,node:null},d.set(n,p)}e!=null&&e.startsWith("!!")&&(e=nc+e.slice(2));let h=ac(n,e,c.tags);if(!h){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const y=new O(n);return p&&(p.node=y),y}h=n instanceof Map?c[we]:Symbol.iterator in Object(n)?c[Ze]:c[we]}l&&(l(h),delete t.onTagObj);const m=h!=null&&h.createNode?h.createNode(t.schema,n,t):typeof((s=h?.nodeClass)==null?void 0:s.from)=="function"?h.nodeClass.from(t.schema,n,t):new O(n);return e?m.tag=e:h.default||(m.tag=h.tag),p&&(p.node=m),m}function on(n,e,t){let a=t;for(let r=e.length-1;r>=0;--r){const s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const i=[];i[s]=a,a=i}else a=new Map([[s,a]])}return Ct(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const Ft=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class us extends pa{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(a=>W(a)||M(a)?a.clone(e):a),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Ft(e))this.add(t);else{const[a,...r]=e,s=this.get(a,!0);if(H(s))s.addIn(r,t);else if(s===void 0&&this.schema)this.set(a,on(this.schema,r,t));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}deleteIn(e){const[t,...a]=e;if(a.length===0)return this.delete(t);const r=this.get(t,!0);if(H(r))return r.deleteIn(a);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${a}`)}getIn(e,t){const[a,...r]=e,s=this.get(a,!0);return r.length===0?!t&&q(s)?s.value:s:H(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!M(t))return!1;const a=t.value;return a==null||e&&q(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(e){const[t,...a]=e;if(a.length===0)return this.has(t);const r=this.get(t,!0);return H(r)?r.hasIn(a):!1}setIn(e,t){const[a,...r]=e;if(r.length===0)this.set(a,t);else{const s=this.get(a,!0);if(H(s))s.setIn(r,t);else if(s===void 0&&this.schema)this.set(a,on(this.schema,r,t));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const rc=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function ye(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const _e=(n,e,t)=>n.endsWith(`
|
|
82
|
+
`)?ye(t,e):t.includes(`
|
|
83
83
|
`)?`
|
|
84
|
-
`+
|
|
85
|
-
`)t===
|
|
86
|
-
`&&m!==" "){const
|
|
87
|
-
`&&
|
|
88
|
-
${e}${n.slice(0,k)}`:(t===
|
|
89
|
-
${e}${n.slice(
|
|
90
|
-
`);a=e,r=e+1,s=n[r]}return a}const
|
|
91
|
-
`){if(s-i>a)return!0;if(i=s+1,r-i<=a)return!1}return!0}function
|
|
84
|
+
`+ye(t,e):(n.endsWith(" ")?"":" ")+t,hs="flow",ha="block",ln="quoted";function cn(n,e,t="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:s=20,onFold:i,onOverflow:o}={}){if(!r||r<0)return n;r<s&&(s=0);const l=Math.max(1+s,1+r-e.length);if(n.length<=l)return n;const c=[],d={};let p=r-e.length;typeof a=="number"&&(a>r-Math.max(2,s)?c.push(0):p=r-a);let h,m,y=!1,g=-1,f=-1,b=-1;t===ha&&(g=ms(n,g,e.length),g!==-1&&(p=g+l));for(let w;w=n[g+=1];){if(t===ln&&w==="\\"){switch(f=g,n[g+1]){case"x":g+=3;break;case"u":g+=5;break;case"U":g+=9;break;default:g+=1}b=g}if(w===`
|
|
85
|
+
`)t===ha&&(g=ms(n,g,e.length)),p=g+e.length+l,h=void 0;else{if(w===" "&&m&&m!==" "&&m!==`
|
|
86
|
+
`&&m!==" "){const x=n[g+1];x&&x!==" "&&x!==`
|
|
87
|
+
`&&x!==" "&&(h=g)}if(g>=p)if(h)c.push(h),p=h+l,h=void 0;else if(t===ln){for(;m===" "||m===" ";)m=w,w=n[g+=1],y=!0;const x=g>b+1?g-2:f-1;if(d[x])return n;c.push(x),d[x]=!0,p=x+l,h=void 0}else y=!0}m=w}if(y&&o&&o(),c.length===0)return n;i&&i();let v=n.slice(0,c[0]);for(let w=0;w<c.length;++w){const x=c[w],k=c[w+1]||n.length;x===0?v=`
|
|
88
|
+
${e}${n.slice(0,k)}`:(t===ln&&d[x]&&(v+=`${n[x]}\\`),v+=`
|
|
89
|
+
${e}${n.slice(x+1,k)}`)}return v}function ms(n,e,t){let a=e,r=e+1,s=n[r];for(;s===" "||s===" ";)if(e<r+t)s=n[++e];else{do s=n[++e];while(s&&s!==`
|
|
90
|
+
`);a=e,r=e+1,s=n[r]}return a}const dn=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),pn=n=>/^(%|---|\.\.\.)/m.test(n);function sc(n,e,t){if(!e||e<0)return!1;const a=e-t,r=n.length;if(r<=a)return!1;for(let s=0,i=0;s<r;++s)if(n[s]===`
|
|
91
|
+
`){if(s-i>a)return!0;if(i=s+1,r-i<=a)return!1}return!0}function Tt(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:a}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(pn(n)?" ":"");let i="",o=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(i+=t.slice(o,l)+"\\ ",l+=1,o=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{i+=t.slice(o,l);const d=t.substr(l+2,4);switch(d){case"0000":i+="\\0";break;case"0007":i+="\\a";break;case"000b":i+="\\v";break;case"001b":i+="\\e";break;case"0085":i+="\\N";break;case"00a0":i+="\\_";break;case"2028":i+="\\L";break;case"2029":i+="\\P";break;default:d.substr(0,2)==="00"?i+="\\x"+d.substr(2):i+=t.substr(l,6)}l+=5,o=l+1}break;case"n":if(a||t[l+2]==='"'||t.length<r)l+=1;else{for(i+=t.slice(o,l)+`
|
|
92
92
|
|
|
93
93
|
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)i+=`
|
|
94
|
-
`,l+=2;i+=s,t[l+2]===" "&&(i+="\\"),l+=1,o=l+1}break;default:l+=1}return i=o?i+t.slice(o):t,a?i:
|
|
95
|
-
`)||/[ \t]\n|\n[ \t]/.test(n))return
|
|
96
|
-
${t}`)+"'";return e.implicitKey?a:
|
|
94
|
+
`,l+=2;i+=s,t[l+2]===" "&&(i+="\\"),l+=1,o=l+1}break;default:l+=1}return i=o?i+t.slice(o):t,a?i:cn(i,s,ln,dn(e,!1))}function ma(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
95
|
+
`)||/[ \t]\n|\n[ \t]/.test(n))return Tt(n,e);const t=e.indent||(pn(n)?" ":""),a="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
96
|
+
${t}`)+"'";return e.implicitKey?a:cn(a,t,hs,dn(e,!1))}function Qe(n,e){const{singleQuote:t}=e.options;let a;if(t===!1)a=Tt;else{const r=n.includes('"'),s=n.includes("'");r&&!s?a=ma:s&&!r?a=Tt:a=t?ma:Tt}return a(n,e)}let fa;try{fa=new RegExp(`(^|(?<!
|
|
97
97
|
))
|
|
98
98
|
+(?!
|
|
99
|
-
|$)`,"g")}catch{
|
|
99
|
+
|$)`,"g")}catch{fa=/\n+(?!\n|$)/g}function un({comment:n,type:e,value:t},a,r,s){const{blockQuote:i,commentString:o,lineWidth:l}=a.options;if(!i||/\n[\t ]+$/.test(t))return Qe(t,a);const c=a.indent||(a.forceBlockIndent||pn(t)?" ":""),d=i==="literal"?!0:i==="folded"||e===O.BLOCK_FOLDED?!1:e===O.BLOCK_LITERAL?!0:!sc(t,l,c.length);if(!t)return d?`|
|
|
100
100
|
`:`>
|
|
101
|
-
`;let p,h;for(h=t.length;h>0;--h){const
|
|
102
|
-
`&&
|
|
103
|
-
`);
|
|
104
|
-
`&&(m=m.slice(0,-1)),m=m.replace(
|
|
105
|
-
`)
|
|
106
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let k=!1;const $=
|
|
107
|
-
${c}${S}`}return t=t.replace(/\n+/g,`$&${c}`),`|${
|
|
108
|
-
${c}${v}${t}${m}`}function
|
|
109
|
-
`)||d&&/[[\]{},]/.test(s))return
|
|
110
|
-
`)?
|
|
111
|
-
`))return
|
|
112
|
-
${l}`);if(i){const h=g=>{var f;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((f=g.test)==null?void 0:f.test(p))},{compat:m,tags:
|
|
113
|
-
${e.indent}${l}`:l}function
|
|
114
|
-
${o}:`):(f=`${f}:`,h&&(f+=
|
|
101
|
+
`;let p,h;for(h=t.length;h>0;--h){const x=t[h-1];if(x!==`
|
|
102
|
+
`&&x!==" "&&x!==" ")break}let m=t.substring(h);const y=m.indexOf(`
|
|
103
|
+
`);y===-1?p="-":t===m||y!==m.length-1?(p="+",s&&s()):p="",m&&(t=t.slice(0,-m.length),m[m.length-1]===`
|
|
104
|
+
`&&(m=m.slice(0,-1)),m=m.replace(fa,`$&${c}`));let g=!1,f,b=-1;for(f=0;f<t.length;++f){const x=t[f];if(x===" ")g=!0;else if(x===`
|
|
105
|
+
`)b=f;else break}let v=t.substring(0,b<f?b+1:f);v&&(t=t.substring(v.length),v=v.replace(/\n+/g,`$&${c}`));let w=(g?c?"2":"1":"")+p;if(n&&(w+=" "+o(n.replace(/ ?[\r\n]+/g," ")),r&&r()),!d){const x=t.replace(/\n+/g,`
|
|
106
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let k=!1;const $=dn(a,!0);i!=="folded"&&e!==O.BLOCK_FOLDED&&($.onOverflow=()=>{k=!0});const S=cn(`${v}${x}${m}`,c,ha,$);if(!k)return`>${w}
|
|
107
|
+
${c}${S}`}return t=t.replace(/\n+/g,`$&${c}`),`|${w}
|
|
108
|
+
${c}${v}${t}${m}`}function ic(n,e,t,a){const{type:r,value:s}=n,{actualString:i,implicitKey:o,indent:l,indentStep:c,inFlow:d}=e;if(o&&s.includes(`
|
|
109
|
+
`)||d&&/[[\]{},]/.test(s))return Qe(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return o||d||!s.includes(`
|
|
110
|
+
`)?Qe(s,e):un(n,e,t,a);if(!o&&!d&&r!==O.PLAIN&&s.includes(`
|
|
111
|
+
`))return un(n,e,t,a);if(pn(s)){if(l==="")return e.forceBlockIndent=!0,un(n,e,t,a);if(o&&l===c)return Qe(s,e)}const p=s.replace(/\n+/g,`$&
|
|
112
|
+
${l}`);if(i){const h=g=>{var f;return g.default&&g.tag!=="tag:yaml.org,2002:str"&&((f=g.test)==null?void 0:f.test(p))},{compat:m,tags:y}=e.doc.schema;if(y.some(h)||m!=null&&m.some(h))return Qe(s,e)}return o?p:cn(p,l,hs,dn(e,!1))}function ga(n,e,t,a){const{implicitKey:r,inFlow:s}=e,i=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:o}=n;o!==O.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(i.value)&&(o=O.QUOTE_DOUBLE);const l=d=>{switch(d){case O.BLOCK_FOLDED:case O.BLOCK_LITERAL:return r||s?Qe(i.value,e):un(i,e,t,a);case O.QUOTE_DOUBLE:return Tt(i.value,e);case O.QUOTE_SINGLE:return ma(i.value,e);case O.PLAIN:return ic(i,e,t,a);default:return null}};let c=l(o);if(c===null){const{defaultKeyType:d,defaultStringType:p}=e.options,h=r&&d||p;if(c=l(h),c===null)throw new Error(`Unsupported default string type ${h}`)}return c}function fs(n,e){const t=Object.assign({blockQuote:!0,commentString:rc,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let a;switch(t.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:a,options:t}}function oc(n,e){var t;if(e.tag){const s=n.filter(i=>i.tag===e.tag);if(s.length>0)return s.find(i=>i.format===e.format)??s[0]}let a,r;if(q(e)){r=e.value;let s=n.filter(i=>{var o;return(o=i.identify)==null?void 0:o.call(i,r)});if(s.length>1){const i=s.filter(o=>o.test);i.length>0&&(s=i)}a=s.find(i=>i.format===e.format)??s.find(i=>!i.format)}else r=e,a=n.find(s=>s.nodeClass&&r instanceof s.nodeClass);if(!a){const s=((t=r?.constructor)==null?void 0:t.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${s} value`)}return a}function lc(n,e,{anchors:t,doc:a}){if(!a.directives)return"";const r=[],s=(q(n)||H(n))&&n.anchor;s&&ls(s)&&(t.add(s),r.push(`&${s}`));const i=n.tag??(e.default?null:e.tag);return i&&r.push(a.directives.tagString(i)),r.join(" ")}function et(n,e,t,a){var r;if(M(n))return n.toString(e,t,a);if(Je(n)){if(e.doc.directives)return n.toString(e);if((r=e.resolvedAliases)!=null&&r.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let s;const i=W(n)?n:e.doc.createNode(n,{onTagObj:c=>s=c});s??(s=oc(e.doc.schema.tags,i));const o=lc(i,s,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const l=typeof s.stringify=="function"?s.stringify(i,e,t,a):q(i)?ga(i,e,t,a):i.toString(e,t,a);return o?q(i)||l[0]==="{"||l[0]==="["?`${o} ${l}`:`${o}
|
|
113
|
+
${e.indent}${l}`:l}function cc({key:n,value:e},t,a,r){const{allNullValues:s,doc:i,indent:o,indentStep:l,options:{commentString:c,indentSeq:d,simpleKeys:p}}=t;let h=W(n)&&n.comment||null;if(p){if(h)throw new Error("With simple keys, key nodes cannot have comments");if(H(n)||!W(n)&&typeof n=="object"){const S="With simple keys, collection cannot be used as a key value";throw new Error(S)}}let m=!p&&(!n||h&&e==null&&!t.inFlow||H(n)||(q(n)?n.type===O.BLOCK_FOLDED||n.type===O.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!m&&(p||!s),indent:o+l});let y=!1,g=!1,f=et(n,t,()=>y=!0,()=>g=!0);if(!m&&!t.inFlow&&f.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");m=!0}if(t.inFlow){if(s||e==null)return y&&a&&a(),f===""?"?":m?`? ${f}`:f}else if(s&&!p||e==null&&m)return f=`? ${f}`,h&&!y?f+=_e(f,t.indent,c(h)):g&&r&&r(),f;y&&(h=null),m?(h&&(f+=_e(f,t.indent,c(h))),f=`? ${f}
|
|
114
|
+
${o}:`):(f=`${f}:`,h&&(f+=_e(f,t.indent,c(h))));let b,v,w;W(e)?(b=!!e.spaceBefore,v=e.commentBefore,w=e.comment):(b=!1,v=null,w=null,e&&typeof e=="object"&&(e=i.createNode(e))),t.implicitKey=!1,!m&&!h&&q(e)&&(t.indentAtStart=f.length+1),g=!1,!d&&l.length>=2&&!t.inFlow&&!m&&At(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let x=!1;const k=et(e,t,()=>x=!0,()=>g=!0);let $=" ";if(h||b||v){if($=b?`
|
|
115
115
|
`:"",v){const S=c(v);$+=`
|
|
116
|
-
${
|
|
117
|
-
`&&
|
|
116
|
+
${ye(S,t.indent)}`}k===""&&!t.inFlow?$===`
|
|
117
|
+
`&&w&&($=`
|
|
118
118
|
|
|
119
119
|
`):$+=`
|
|
120
120
|
${t.indent}`}else if(!m&&H(e)){const S=k[0],E=k.indexOf(`
|
|
121
|
-
`),N=E!==-1,
|
|
121
|
+
`),N=E!==-1,R=t.inFlow??e.flow??e.items.length===0;if(N||!R){let V=!1;if(N&&(S==="&"||S==="!")){let D=k.indexOf(" ");S==="&"&&D!==-1&&D<E&&k[D+1]==="!"&&(D=k.indexOf(" ",D+1)),(D===-1||E<D)&&(V=!0)}V||($=`
|
|
122
122
|
${t.indent}`)}}else(k===""||k[0]===`
|
|
123
|
-
`)&&($="");return f+=$+k,t.inFlow?
|
|
123
|
+
`)&&($="");return f+=$+k,t.inFlow?x&&a&&a():w&&!x?f+=_e(f,t.indent,c(w)):g&&r&&r(),f}function sp(n,e){}const hn="<<",be={identify:n=>n===hn||typeof n=="symbol"&&n.description===hn,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new O(Symbol(hn)),{addToJSMap:gs}),stringify:()=>hn},dc=(n,e)=>(be.identify(e)||q(e)&&(!e.type||e.type===O.PLAIN)&&be.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===be.tag&&t.default);function gs(n,e,t){const a=ys(n,t);if(At(a))for(const r of a.items)ya(n,e,r);else if(Array.isArray(a))for(const r of a)ya(n,e,r);else ya(n,e,a)}function ya(n,e,t){const a=ys(n,t);if(!Et(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,n,Map);for(const[s,i]of r)e instanceof Map?e.has(s)||e.set(s,i):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:i,writable:!0,enumerable:!0,configurable:!0});return e}function ys(n,e){return n&&Je(e)?e.resolve(n.doc,n):e}function bs(n,e,{key:t,value:a}){if(W(t)&&t.addToJSMap)t.addToJSMap(n,e,a);else if(dc(n,t))gs(n,e,a);else{const r=re(t,"",n);if(e instanceof Map)e.set(r,re(a,r,n));else if(e instanceof Set)e.add(r);else{const s=pc(t,r,n),i=re(a,s,n);s in e?Object.defineProperty(e,s,{value:i,writable:!0,enumerable:!0,configurable:!0}):e[s]=i}}return e}function pc(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(W(n)&&t!=null&&t.doc){const a=fs(t.doc,{});a.anchors=new Set;for(const s of t.anchors.keys())a.anchors.add(s.anchor);a.inFlow=!0,a.inStringifyKey=!0;const r=n.toString(a);if(!t.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),t.doc.options.logLevel,`${s}`,t.mapKeyWarned=!0}return r}return JSON.stringify(e)}function ba(n,e,t){const a=Ct(n,void 0,t),r=Ct(e,void 0,t);return new X(a,r)}class X{constructor(e,t=null){Object.defineProperty(this,ae,{value:is}),this.key=e,this.value=t}clone(e){let{key:t,value:a}=this;return W(t)&&(t=t.clone(e)),W(a)&&(a=a.clone(e)),new X(t,a)}toJSON(e,t){const a=t!=null&&t.mapAsMap?new Map:{};return bs(t,a,this)}toString(e,t,a){return e!=null&&e.doc?cc(this,e,t,a):JSON.stringify(this)}}function vs(n,e,t){return(e.inFlow??n.flow?hc:uc)(n,e,t)}function uc({comment:n,items:e},t,{blockItemPrefix:a,flowChars:r,itemIndent:s,onChompKeep:i,onComment:o}){const{indent:l,options:{commentString:c}}=t,d=Object.assign({},t,{indent:s,type:null});let p=!1;const h=[];for(let y=0;y<e.length;++y){const g=e[y];let f=null;if(W(g))!p&&g.spaceBefore&&h.push(""),mn(t,h,g.commentBefore,p),g.comment&&(f=g.comment);else if(M(g)){const v=W(g.key)?g.key:null;v&&(!p&&v.spaceBefore&&h.push(""),mn(t,h,v.commentBefore,p))}p=!1;let b=et(g,d,()=>f=null,()=>p=!0);f&&(b+=_e(b,s,c(f))),p&&f&&(p=!1),h.push(a+b)}let m;if(h.length===0)m=r.start+r.end;else{m=h[0];for(let y=1;y<h.length;++y){const g=h[y];m+=g?`
|
|
124
124
|
${l}${g}`:`
|
|
125
125
|
`}}return n?(m+=`
|
|
126
|
-
`+
|
|
127
|
-
`)),
|
|
126
|
+
`+ye(c(n),l),o&&o()):p&&i&&i(),m}function hc({items:n},e,{flowChars:t,itemIndent:a}){const{indent:r,indentStep:s,flowCollectionPadding:i,options:{commentString:o}}=e;a+=s;const l=Object.assign({},e,{indent:a,inFlow:!0,type:null});let c=!1,d=0;const p=[];for(let y=0;y<n.length;++y){const g=n[y];let f=null;if(W(g))g.spaceBefore&&p.push(""),mn(e,p,g.commentBefore,!1),g.comment&&(f=g.comment);else if(M(g)){const v=W(g.key)?g.key:null;v&&(v.spaceBefore&&p.push(""),mn(e,p,v.commentBefore,!1),v.comment&&(c=!0));const w=W(g.value)?g.value:null;w?(w.comment&&(f=w.comment),w.commentBefore&&(c=!0)):g.value==null&&v!=null&&v.comment&&(f=v.comment)}f&&(c=!0);let b=et(g,l,()=>f=null);c||(c=p.length>d||b.includes(`
|
|
127
|
+
`)),y<n.length-1?b+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(c||(c=p.reduce((v,w)=>v+w.length+2,2)+(b.length+2)>e.options.lineWidth)),c&&(b+=",")),f&&(b+=_e(b,a,o(f))),p.push(b),d=p.length}const{start:h,end:m}=t;if(p.length===0)return h+m;if(!c){const y=p.reduce((g,f)=>g+f.length+2,2);c=e.options.lineWidth>0&&y>e.options.lineWidth}if(c){let y=h;for(const g of p)y+=g?`
|
|
128
128
|
${s}${r}${g}`:`
|
|
129
|
-
`;return`${
|
|
130
|
-
${r}${m}`}else return`${h}${i}${p.join(" ")}${i}${m}`}function
|
|
131
|
-
`:" ")}return
|
|
129
|
+
`;return`${y}
|
|
130
|
+
${r}${m}`}else return`${h}${i}${p.join(" ")}${i}${m}`}function mn({indent:n,options:{commentString:e}},t,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const s=ye(e(a),n);t.push(s.trimStart())}}function Re(n,e){const t=q(e)?e.value:e;for(const a of n)if(M(a)&&(a.key===e||a.key===t||q(a.key)&&a.key.value===t))return a}class se extends us{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(we,e),this.items=[]}static from(e,t,a){const{keepUndefined:r,replacer:s}=a,i=new this(e),o=(l,c)=>{if(typeof s=="function")c=s.call(t,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||r)&&i.items.push(ba(l,c,a))};if(t instanceof Map)for(const[l,c]of t)o(l,c);else if(t&&typeof t=="object")for(const l of Object.keys(t))o(l,t[l]);return typeof e.sortMapEntries=="function"&&i.items.sort(e.sortMapEntries),i}add(e,t){var a;let r;M(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new X(e,e?.value):r=new X(e.key,e.value);const s=Re(this.items,r.key),i=(a=this.schema)==null?void 0:a.sortMapEntries;if(s){if(!t)throw new Error(`Key ${r.key} already set`);q(s.value)&&ps(r.value)?s.value.value=r.value:s.value=r.value}else if(i){const o=this.items.findIndex(l=>i(r,l)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){const t=Re(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const a=Re(this.items,e),r=a?.value;return(!t&&q(r)?r.value:r)??void 0}has(e){return!!Re(this.items,e)}set(e,t){this.add(new X(e,t),!0)}toJSON(e,t,a){const r=a?new a:t!=null&&t.mapAsMap?new Map:{};t!=null&&t.onCreate&&t.onCreate(r);for(const s of this.items)bs(t,r,s);return r}toString(e,t,a){if(!e)return JSON.stringify(this);for(const r of this.items)if(!M(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),vs(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:a,onComment:t})}}const tt={collection:"map",default:!0,nodeClass:se,tag:"tag:yaml.org,2002:map",resolve(n,e){return Et(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>se.from(n,e,t)};class Ie extends us{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Ze,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=fn(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const a=fn(e);if(typeof a!="number")return;const r=this.items[a];return!t&&q(r)?r.value:r}has(e){const t=fn(e);return typeof t=="number"&&t<this.items.length}set(e,t){const a=fn(e);if(typeof a!="number")throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[a];q(r)&&ps(t)?r.value=t:this.items[a]=t}toJSON(e,t){const a=[];t!=null&&t.onCreate&&t.onCreate(a);let r=0;for(const s of this.items)a.push(re(s,String(r++),t));return a}toString(e,t,a){return e?vs(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:a,onComment:t}):JSON.stringify(this)}static from(e,t,a){const{replacer:r}=a,s=new this(e);if(t&&Symbol.iterator in Object(t)){let i=0;for(let o of t){if(typeof r=="function"){const l=t instanceof Set?o:String(i++);o=r.call(t,l,o)}s.items.push(Ct(o,void 0,a))}}return s}}function fn(n){let e=q(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const nt={collection:"seq",default:!0,nodeClass:Ie,tag:"tag:yaml.org,2002:seq",resolve(n,e){return At(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>Ie.from(n,e,t)},gn={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,a){return e=Object.assign({actualString:!0},e),ga(n,e,t,a)}},yn={identify:n=>n==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new O(null),stringify:({source:n},e)=>typeof n=="string"&&yn.test.test(n)?n:e.options.nullStr},va={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new O(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&va.test.test(n)){const a=n[0]==="t"||n[0]==="T";if(e===a)return n}return e?t.options.trueStr:t.options.falseStr}};function pe({format:n,minFractionDigits:e,tag:t,value:a}){if(typeof a=="bigint")return String(a);const r=typeof a=="number"?a:Number(a);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(a,-0)?"-0":JSON.stringify(a);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^-?\d/.test(s)&&!s.includes("e")){let i=s.indexOf(".");i<0&&(i=s.length,s+=".");let o=e-(s.length-i-1);for(;o-- >0;)s+="0"}return s}const xs={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:pe},ws={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():pe(n)}},$s={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new O(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:pe},bn=n=>typeof n=="bigint"||Number.isInteger(n),xa=(n,e,t,{intAsBigInt:a})=>a?BigInt(n):parseInt(n.substring(e),t);function ks(n,e,t){const{value:a}=n;return bn(a)&&a>=0?t+a.toString(e):pe(n)}const Ss={identify:n=>bn(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>xa(n,2,8,t),stringify:n=>ks(n,8,"0o")},Es={identify:bn,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>xa(n,0,10,t),stringify:pe},As={identify:n=>bn(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>xa(n,2,16,t),stringify:n=>ks(n,16,"0x")},mc=[tt,nt,gn,yn,va,Ss,Es,As,xs,ws,$s];function Ds(n){return typeof n=="bigint"||Number.isInteger(n)}const vn=({value:n})=>JSON.stringify(n),fc=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:vn},{identify:n=>n==null,createNode:()=>new O(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:vn},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:vn},{identify:Ds,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Ds(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:vn}],gc={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},yc=[tt,nt].concat(fc,gc),wa={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),a=new Uint8Array(t.length);for(let r=0;r<t.length;++r)a[r]=t.charCodeAt(r);return a}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},a,r,s){if(!t)return"";const i=t;let o;if(typeof btoa=="function"){let l="";for(let c=0;c<i.length;++c)l+=String.fromCharCode(i[c]);o=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=O.BLOCK_LITERAL),e!==O.QUOTE_DOUBLE){const l=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),c=Math.ceil(o.length/l),d=new Array(c);for(let p=0,h=0;p<c;++p,h+=l)d[p]=o.substr(h,l);o=d.join(e===O.BLOCK_LITERAL?`
|
|
131
|
+
`:" ")}return ga({comment:n,type:e,value:o},a,r,s)}};function Cs(n,e){if(At(n))for(let t=0;t<n.items.length;++t){let a=n.items[t];if(!M(a)){if(Et(a)){a.items.length>1&&e("Each pair must have its own sequence indicator");const r=a.items[0]||new X(new O(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
|
|
132
132
|
${r.key.commentBefore}`:a.commentBefore),a.comment){const s=r.value??r.key;s.comment=s.comment?`${a.comment}
|
|
133
|
-
${s.comment}`:a.comment}a=r}n.items[t]=M(a)?a:new
|
|
134
|
-
`)?(a.push("..."),a.push(
|
|
133
|
+
${s.comment}`:a.comment}a=r}n.items[t]=M(a)?a:new X(a)}}else e("Expected a sequence for this tag");return n}function Fs(n,e,t){const{replacer:a}=t,r=new Ie(n);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let i of e){typeof a=="function"&&(i=a.call(e,String(s++),i));let o,l;if(Array.isArray(i))if(i.length===2)o=i[0],l=i[1];else throw new TypeError(`Expected [key, value] tuple: ${i}`);else if(i&&i instanceof Object){const c=Object.keys(i);if(c.length===1)o=c[0],l=i[o];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else o=i;r.items.push(ba(o,l,t))}return r}const $a={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Cs,createNode:Fs};class ct extends Ie{constructor(){super(),this.add=se.prototype.add.bind(this),this.delete=se.prototype.delete.bind(this),this.get=se.prototype.get.bind(this),this.has=se.prototype.has.bind(this),this.set=se.prototype.set.bind(this),this.tag=ct.tag}toJSON(e,t){if(!t)return super.toJSON(e);const a=new Map;t!=null&&t.onCreate&&t.onCreate(a);for(const r of this.items){let s,i;if(M(r)?(s=re(r.key,"",t),i=re(r.value,s,t)):s=re(r,"",t),a.has(s))throw new Error("Ordered maps must not include duplicate keys");a.set(s,i)}return a}static from(e,t,a){const r=Fs(e,t,a),s=new this;return s.items=r.items,s}}ct.tag="tag:yaml.org,2002:omap";const ka={collection:"seq",identify:n=>n instanceof Map,nodeClass:ct,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=Cs(n,e),a=[];for(const{key:r}of t.items)q(r)&&(a.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new ct,t)},createNode:(n,e,t)=>ct.from(n,e,t)};function Ts({value:n,source:e},t){return e&&(n?Os:Ns).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const Os={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new O(!0),stringify:Ts},Ns={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new O(!1),stringify:Ts},bc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:pe},vc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():pe(n)}},xc={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new O(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const a=n.substring(t+1).replace(/_/g,"");a[a.length-1]==="0"&&(e.minFractionDigits=a.length)}return e},stringify:pe},Ot=n=>typeof n=="bigint"||Number.isInteger(n);function xn(n,e,t,{intAsBigInt:a}){const r=n[0];if((r==="-"||r==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),a){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const i=BigInt(n);return r==="-"?BigInt(-1)*i:i}const s=parseInt(n,t);return r==="-"?-1*s:s}function Sa(n,e,t){const{value:a}=n;if(Ot(a)){const r=a.toString(e);return a<0?"-"+t+r.substr(1):t+r}return pe(n)}const wc={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>xn(n,2,2,t),stringify:n=>Sa(n,2,"0b")},$c={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>xn(n,1,8,t),stringify:n=>Sa(n,8,"0")},kc={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>xn(n,0,10,t),stringify:pe},Sc={identify:Ot,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>xn(n,2,16,t),stringify:n=>Sa(n,16,"0x")};class dt extends se{constructor(e){super(e),this.tag=dt.tag}add(e){let t;M(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new X(e.key,null):t=new X(e,null),Re(this.items,t.key)||this.items.push(t)}get(e,t){const a=Re(this.items,e);return!t&&M(a)?q(a.key)?a.key.value:a.key:a}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const a=Re(this.items,e);a&&!t?this.items.splice(this.items.indexOf(a),1):!a&&t&&this.items.push(new X(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,a){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,a);throw new Error("Set items must all have null values")}static from(e,t,a){const{replacer:r}=a,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let i of t)typeof r=="function"&&(i=r.call(t,i,i)),s.items.push(ba(i,null,a));return s}}dt.tag="tag:yaml.org,2002:set";const Ea={collection:"map",identify:n=>n instanceof Set,nodeClass:dt,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>dt.from(n,e,t),resolve(n,e){if(Et(n)){if(n.hasAllNullValues(!0))return Object.assign(new dt,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function Aa(n,e){const t=n[0],a=t==="-"||t==="+"?n.substring(1):n,r=i=>e?BigInt(i):Number(i),s=a.replace(/_/g,"").split(":").reduce((i,o)=>i*r(60)+r(o),r(0));return t==="-"?r(-1)*s:s}function Bs(n){let{value:e}=n,t=i=>i;if(typeof e=="bigint")t=i=>BigInt(i);else if(isNaN(e)||!isFinite(e))return pe(n);let a="";e<0&&(a="-",e*=t(-1));const r=t(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),a+s.map(i=>String(i).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Ls={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>Aa(n,t),stringify:Bs},_s={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>Aa(n,!1),stringify:Bs},wn={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(wn.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,a,r,s,i,o]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,a-1,r,s||0,i||0,o||0,l);const d=e[8];if(d&&d!=="Z"){let p=Aa(d,!1);Math.abs(p)<30&&(p*=60),c-=6e4*p}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Rs=[tt,nt,gn,yn,Os,Ns,wc,$c,kc,Sc,bc,vc,xc,wa,be,ka,$a,Ea,Ls,_s,wn],Is=new Map([["core",mc],["failsafe",[tt,nt,gn]],["json",yc],["yaml11",Rs],["yaml-1.1",Rs]]),js={binary:wa,bool:va,float:$s,floatExp:ws,floatNaN:xs,floatTime:_s,int:Es,intHex:As,intOct:Ss,intTime:Ls,map:tt,merge:be,null:yn,omap:ka,pairs:$a,seq:nt,set:Ea,timestamp:wn},Ec={"tag:yaml.org,2002:binary":wa,"tag:yaml.org,2002:merge":be,"tag:yaml.org,2002:omap":ka,"tag:yaml.org,2002:pairs":$a,"tag:yaml.org,2002:set":Ea,"tag:yaml.org,2002:timestamp":wn};function Da(n,e,t){const a=Is.get(e);if(a&&!n)return t&&!a.includes(be)?a.concat(be):a.slice();let r=a;if(!r)if(Array.isArray(n))r=[];else{const s=Array.from(Is.keys()).filter(i=>i!=="yaml11").map(i=>JSON.stringify(i)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(n))for(const s of n)r=r.concat(s);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(be)),r.reduce((s,i)=>{const o=typeof i=="string"?js[i]:i;if(!o){const l=JSON.stringify(i),c=Object.keys(js).map(d=>JSON.stringify(d)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return s.includes(o)||s.push(o),s},[])}const Ac=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;class Xa{constructor({compat:e,customTags:t,merge:a,resolveKnownTags:r,schema:s,sortMapEntries:i,toStringDefaults:o}){this.compat=Array.isArray(e)?Da(e,"compat"):e?Da(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?Ec:{},this.tags=Da(t,this.name,a),this.toStringOptions=o??null,Object.defineProperty(this,we,{value:tt}),Object.defineProperty(this,me,{value:gn}),Object.defineProperty(this,Ze,{value:nt}),this.sortMapEntries=typeof i=="function"?i:i===!0?Ac:null}clone(){const e=Object.create(Xa.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function Dc(n,e){var t;const a=[];let r=e.directives===!0;if(e.directives!==!1&&n.directives){const c=n.directives.toString(n);c?(a.push(c),r=!0):n.directives.docStart&&(r=!0)}r&&a.push("---");const s=fs(n,e),{commentString:i}=s.options;if(n.commentBefore){a.length!==1&&a.unshift("");const c=i(n.commentBefore);a.unshift(ye(c,""))}let o=!1,l=null;if(n.contents){if(W(n.contents)){if(n.contents.spaceBefore&&r&&a.push(""),n.contents.commentBefore){const p=i(n.contents.commentBefore);a.push(ye(p,""))}s.forceBlockIndent=!!n.comment,l=n.contents.comment}const c=l?void 0:()=>o=!0;let d=et(n.contents,s,()=>l=null,c);l&&(d+=_e(d,"",i(l))),(d[0]==="|"||d[0]===">")&&a[a.length-1]==="---"?a[a.length-1]=`--- ${d}`:a.push(d)}else a.push(et(n.contents,s));if((t=n.directives)!=null&&t.docEnd)if(n.comment){const c=i(n.comment);c.includes(`
|
|
134
|
+
`)?(a.push("..."),a.push(ye(c,""))):a.push(`... ${c}`)}else a.push("...");else{let c=n.comment;c&&o&&(c=c.replace(/^\n+/,"")),c&&((!o||l)&&a[a.length-1]!==""&&a.push(""),a.push(ye(i(c),"")))}return a.join(`
|
|
135
135
|
`)+`
|
|
136
|
-
`}let
|
|
136
|
+
`}let qs=class Ii{constructor(e,t,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,ae,{value:da});let r=null;typeof t=="function"||Array.isArray(t)?r=t:a===void 0&&t&&(a=t,t=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=s;let{version:i}=s;a!=null&&a._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(i=this.directives.yaml.version)):this.directives=new Y({version:i}),this.setSchema(i,a),this.contents=e===void 0?null:this.createNode(e,r,a)}clone(){const e=Object.create(Ii.prototype,{[ae]:{value:da}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=W(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){at(this.contents)&&this.contents.add(e)}addIn(e,t){at(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const a=cs(this);e.anchor=!t||a.has(t)?ds(t||"a",a):t}return new ua(e.anchor)}createNode(e,t,a){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){const f=v=>typeof v=="number"||v instanceof String||v instanceof Number,b=t.filter(f).map(String);b.length>0&&(t=t.concat(b)),r=t}else a===void 0&&t&&(a=t,t=void 0);const{aliasDuplicateObjects:s,anchorPrefix:i,flow:o,keepUndefined:l,onTagObj:c,tag:d}=a??{},{onAnchor:p,setAnchors:h,sourceObjects:m}=tc(this,i||"a"),y={aliasDuplicateObjects:s??!0,keepUndefined:l??!1,onAnchor:p,onTagObj:c,replacer:r,schema:this.schema,sourceObjects:m},g=Ct(e,d,y);return o&&H(g)&&(g.flow=!0),h(),g}createPair(e,t,a={}){const r=this.createNode(e,null,a),s=this.createNode(t,null,a);return new X(r,s)}delete(e){return at(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Ft(e)?this.contents==null?!1:(this.contents=null,!0):at(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return H(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Ft(e)?!t&&q(this.contents)?this.contents.value:this.contents:H(this.contents)?this.contents.getIn(e,t):void 0}has(e){return H(this.contents)?this.contents.has(e):!1}hasIn(e){return Ft(e)?this.contents!==void 0:H(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=on(this.schema,[e],t):at(this.contents)&&this.contents.set(e,t)}setIn(e,t){Ft(e)?this.contents=t:this.contents==null?this.contents=on(this.schema,Array.from(e),t):at(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let a;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new Y({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new Y({version:e}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(a)this.schema=new Xa(Object.assign(a,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:a,maxAliasCount:r,onAnchor:s,reviver:i}={}){const o={anchors:new Map,doc:this,keep:!e,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},l=re(this.contents,t??"",o);if(typeof s=="function")for(const{count:c,res:d}of o.anchors.values())s(d,c);return typeof i=="function"?Ye(i,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return Dc(this,e)}};function at(n){if(H(n))return!0;throw new Error("Expected a YAML collection as document contents")}class zs extends Error{constructor(e,t,a,r){super(),this.name=e,this.code=a,this.message=r,this.pos=t}}class Nt extends zs{constructor(e,t,a){super("YAMLParseError",e,t,a)}}class Cc extends zs{constructor(e,t,a){super("YAMLWarning",e,t,a)}}const Ps=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(o=>e.linePos(o));const{line:a,col:r}=t.linePos[0];t.message+=` at line ${a}, column ${r}`;let s=r-1,i=n.substring(e.lineStarts[a-1],e.lineStarts[a]).replace(/[\n\r]+$/,"");if(s>=60&&i.length>80){const o=Math.min(s-39,i.length-79);i="\u2026"+i.substring(o),s-=o-1}if(i.length>80&&(i=i.substring(0,79)+"\u2026"),a>1&&/^ *$/.test(i.substring(0,s))){let o=n.substring(e.lineStarts[a-2],e.lineStarts[a-1]);o.length>80&&(o=o.substring(0,79)+`\u2026
|
|
137
137
|
`),i=o+i}if(/[^ ]/.test(i)){let o=1;const l=t.linePos[1];l?.line===a&&l.col>r&&(o=Math.max(1,Math.min(l.col-r,80-s)));const c=" ".repeat(s)+"^".repeat(o);t.message+=`:
|
|
138
138
|
|
|
139
139
|
${i}
|
|
140
140
|
${c}
|
|
141
|
-
`}};function
|
|
142
|
-
`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(
|
|
143
|
-
`+f.comment:l.comment=f.comment);continue}(f.newlineAfterProp||
|
|
144
|
-
`+
|
|
145
|
-
`+S.comment:d.comment=S.comment),h=S.end;continue}!o&&t.options.strict&&
|
|
146
|
-
`+E:N.comment=E,S.comment=S.comment.substring(E.length+1)}}if(!o&&!k&&!S.found){const E=$?n(t,$,S,r):e(t,S.end,k,null,S,r);d.items.push(E),h=E.range[2],
|
|
147
|
-
`+
|
|
148
|
-
`+
|
|
149
|
-
`.repeat(Math.max(1,i.length-1)):"";let f=a+r.length;return e.source&&(f+=e.source.length),{value:g,type:s,comment:r.comment,range:[a,f,f]}}let l=e.indent+r.indent,c=e.offset+r.length,d=0;for(let g=0;g<o;++g){const[f,
|
|
150
|
-
`;for(let g=d;g<o;++g){let[f,
|
|
151
|
-
`):f.length>l||
|
|
141
|
+
`}};function rt(n,{flow:e,indicator:t,next:a,offset:r,onError:s,parentIndent:i,startOnNewline:o}){let l=!1,c=o,d=o,p="",h="",m=!1,y=!1,g=null,f=null,b=null,v=null,w=null,x=null,k=null;for(const E of n)switch(y&&(E.type!=="space"&&E.type!=="newline"&&E.type!=="comma"&&s(E.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),y=!1),g&&(c&&E.type!=="comment"&&E.type!=="newline"&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),g=null),E.type){case"space":!e&&(t!=="doc-start"||a?.type!=="flow-collection")&&E.source.includes(" ")&&(g=E),d=!0;break;case"comment":{d||s(E,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const N=E.source.substring(1)||" ";p?p+=h+N:p=N,h="",c=!1;break}case"newline":c?p?p+=E.source:(!x||t!=="seq-item-ind")&&(l=!0):h+=E.source,c=!0,m=!0,(f||b)&&(v=E),d=!0;break;case"anchor":f&&s(E,"MULTIPLE_ANCHORS","A node can have at most one anchor"),E.source.endsWith(":")&&s(E.offset+E.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),f=E,k??(k=E.offset),c=!1,d=!1,y=!0;break;case"tag":{b&&s(E,"MULTIPLE_TAGS","A node can have at most one tag"),b=E,k??(k=E.offset),c=!1,d=!1,y=!0;break}case t:(f||b)&&s(E,"BAD_PROP_ORDER",`Anchors and tags must be after the ${E.source} indicator`),x&&s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.source} in ${e??"collection"}`),x=E,c=t==="seq-item-ind"||t==="explicit-key-ind",d=!1;break;case"comma":if(e){w&&s(E,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),w=E,c=!1,d=!1;break}default:s(E,"UNEXPECTED_TOKEN",`Unexpected ${E.type} token`),c=!1,d=!1}const $=n[n.length-1],S=$?$.offset+$.source.length:r;return y&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&s(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),g&&(c&&g.indent<=i||a?.type==="block-map"||a?.type==="block-seq")&&s(g,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:x,spaceBefore:l,comment:p,hasNewline:m,anchor:f,tag:b,newlineAfterProp:v,end:S,start:k??S}}function Bt(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
142
|
+
`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(Bt(e.key)||Bt(e.value))return!0}return!1;default:return!0}}function Ca(n,e,t){if(e?.type==="flow-collection"){const a=e.end[0];a.indent===n&&(a.source==="]"||a.source==="}")&&Bt(e)&&t(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Us(n,e,t){const{uniqueKeys:a}=n.options;if(a===!1)return!1;const r=typeof a=="function"?a:(s,i)=>s===i||q(s)&&q(i)&&s.value===i.value;return e.some(s=>r(s.key,t))}const Ms="All mapping items must start at the same column";function Fc({composeNode:n,composeEmptyNode:e},t,a,r,s){var i;const o=s?.nodeClass??se,l=new o(t.schema);t.atRoot&&(t.atRoot=!1);let c=a.offset,d=null;for(const p of a.items){const{start:h,key:m,sep:y,value:g}=p,f=rt(h,{indicator:"explicit-key-ind",next:m??y?.[0],offset:c,onError:r,parentIndent:a.indent,startOnNewline:!0}),b=!f.found;if(b){if(m&&(m.type==="block-seq"?r(c,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in m&&m.indent!==a.indent&&r(c,"BAD_INDENT",Ms)),!f.anchor&&!f.tag&&!y){d=f.end,f.comment&&(l.comment?l.comment+=`
|
|
143
|
+
`+f.comment:l.comment=f.comment);continue}(f.newlineAfterProp||Bt(m))&&r(m??h[h.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((i=f.found)==null?void 0:i.indent)!==a.indent&&r(c,"BAD_INDENT",Ms);t.atKey=!0;const v=f.end,w=m?n(t,m,f,r):e(t,v,h,null,f,r);t.schema.compat&&Ca(a.indent,m,r),t.atKey=!1,Us(t,l.items,w)&&r(v,"DUPLICATE_KEY","Map keys must be unique");const x=rt(y??[],{indicator:"map-value-ind",next:g,offset:w.range[2],onError:r,parentIndent:a.indent,startOnNewline:!m||m.type==="block-scalar"});if(c=x.end,x.found){b&&(g?.type==="block-map"&&!x.hasNewline&&r(c,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&f.start<x.found.offset-1024&&r(w.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const k=g?n(t,g,x,r):e(t,c,y,null,x,r);t.schema.compat&&Ca(a.indent,g,r),c=k.range[2];const $=new X(w,k);t.options.keepSourceTokens&&($.srcToken=p),l.items.push($)}else{b&&r(w.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),x.comment&&(w.comment?w.comment+=`
|
|
144
|
+
`+x.comment:w.comment=x.comment);const k=new X(w);t.options.keepSourceTokens&&(k.srcToken=p),l.items.push(k)}}return d&&d<c&&r(d,"IMPOSSIBLE","Map comment with trailing content"),l.range=[a.offset,c,d??c],l}function Tc({composeNode:n,composeEmptyNode:e},t,a,r,s){const i=s?.nodeClass??Ie,o=new i(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=a.offset,c=null;for(const{start:d,value:p}of a.items){const h=rt(d,{indicator:"seq-item-ind",next:p,offset:l,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!h.found)if(h.anchor||h.tag||p)p?.type==="block-seq"?r(h.end,"BAD_INDENT","All sequence items must start at the same column"):r(l,"MISSING_CHAR","Sequence item without - indicator");else{c=h.end,h.comment&&(o.comment=h.comment);continue}const m=p?n(t,p,h,r):e(t,h.end,d,null,h,r);t.schema.compat&&Ca(a.indent,p,r),l=m.range[2],o.items.push(m)}return o.range=[a.offset,l,c??l],o}function Lt(n,e,t,a){let r="";if(n){let s=!1,i="";for(const o of n){const{source:l,type:c}=o;switch(c){case"space":s=!0;break;case"comment":{t&&!s&&a(o,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const d=l.substring(1)||" ";r?r+=i+d:r=d,i="";break}case"newline":r&&(i+=l),s=!0;break;default:a(o,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:r,offset:e}}const Fa="Block collections are not allowed within flow collections",Ta=n=>n&&(n.type==="block-map"||n.type==="block-seq");function Oc({composeNode:n,composeEmptyNode:e},t,a,r,s){var i;const o=a.start.source==="{",l=o?"flow map":"flow sequence",c=s?.nodeClass??(o?se:Ie),d=new c(t.schema);d.flow=!0;const p=t.atRoot;p&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let h=a.offset+a.start.source.length;for(let b=0;b<a.items.length;++b){const v=a.items[b],{start:w,key:x,sep:k,value:$}=v,S=rt(w,{flow:l,indicator:"explicit-key-ind",next:x??k?.[0],offset:h,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!S.found){if(!S.anchor&&!S.tag&&!k&&!$){b===0&&S.comma?r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):b<a.items.length-1&&r(S.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),S.comment&&(d.comment?d.comment+=`
|
|
145
|
+
`+S.comment:d.comment=S.comment),h=S.end;continue}!o&&t.options.strict&&Bt(x)&&r(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(b===0)S.comma&&r(S.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(S.comma||r(S.start,"MISSING_CHAR",`Missing , between ${l} items`),S.comment){let E="";e:for(const N of w)switch(N.type){case"comma":case"space":break;case"comment":E=N.source.substring(1);break e;default:break e}if(E){let N=d.items[d.items.length-1];M(N)&&(N=N.value??N.key),N.comment?N.comment+=`
|
|
146
|
+
`+E:N.comment=E,S.comment=S.comment.substring(E.length+1)}}if(!o&&!k&&!S.found){const E=$?n(t,$,S,r):e(t,S.end,k,null,S,r);d.items.push(E),h=E.range[2],Ta($)&&r(E.range,"BLOCK_IN_FLOW",Fa)}else{t.atKey=!0;const E=S.end,N=x?n(t,x,S,r):e(t,E,w,null,S,r);Ta(x)&&r(N.range,"BLOCK_IN_FLOW",Fa),t.atKey=!1;const R=rt(k??[],{flow:l,indicator:"map-value-ind",next:$,offset:N.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(R.found){if(!o&&!S.found&&t.options.strict){if(k)for(const T of k){if(T===R.found)break;if(T.type==="newline"){r(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}S.start<R.found.offset-1024&&r(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else $&&("source"in $&&((i=$.source)==null?void 0:i[0])===":"?r($,"MISSING_CHAR",`Missing space after : in ${l}`):r(R.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const V=$?n(t,$,R,r):R.found?e(t,R.end,k,null,R,r):null;V?Ta($)&&r(V.range,"BLOCK_IN_FLOW",Fa):R.comment&&(N.comment?N.comment+=`
|
|
147
|
+
`+R.comment:N.comment=R.comment);const D=new X(N,V);if(t.options.keepSourceTokens&&(D.srcToken=v),o){const T=d;Us(t,T.items,N)&&r(E,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(D)}else{const T=new se(t.schema);T.flow=!0,T.items.push(D);const C=(V??N).range;T.range=[N.range[0],C[1],C[2]],d.items.push(T)}h=V?V.range[2]:R.end}}const m=o?"}":"]",[y,...g]=a.end;let f=h;if(y?.source===m)f=y.offset+y.source.length;else{const b=l[0].toUpperCase()+l.substring(1),v=p?`${b} must end with a ${m}`:`${b} in block collection must be sufficiently indented and end with a ${m}`;r(h,p?"MISSING_CHAR":"BAD_INDENT",v),y&&y.source.length!==1&&g.unshift(y)}if(g.length>0){const b=Lt(g,f,t.options.strict,r);b.comment&&(d.comment?d.comment+=`
|
|
148
|
+
`+b.comment:d.comment=b.comment),d.range=[a.offset,f,b.offset]}else d.range=[a.offset,f,f];return d}function Oa(n,e,t,a,r,s){const i=t.type==="block-map"?Fc(n,e,t,a,s):t.type==="block-seq"?Tc(n,e,t,a,s):Oc(n,e,t,a,s),o=i.constructor;return r==="!"||r===o.tagName?(i.tag=o.tagName,i):(r&&(i.tag=r),i)}function Nc(n,e,t,a,r){var s;const i=a.tag,o=i?e.directives.tagName(i.source,m=>r(i,"TAG_RESOLVE_FAILED",m)):null;if(t.type==="block-seq"){const{anchor:m,newlineAfterProp:y}=a,g=m&&i?m.offset>i.offset?m:i:m??i;g&&(!y||y.offset<g.offset)&&r(g,"MISSING_CHAR","Missing newline after block sequence props")}const l=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!i||!o||o==="!"||o===se.tagName&&l==="map"||o===Ie.tagName&&l==="seq")return Oa(n,e,t,r,o);let c=e.schema.tags.find(m=>m.tag===o&&m.collection===l);if(!c){const m=e.schema.knownTags[o];if(m?.collection===l)e.schema.tags.push(Object.assign({},m,{default:!1})),c=m;else return m?r(i,"BAD_COLLECTION_TYPE",`${m.tag} used for ${l} collection, but expects ${m.collection??"scalar"}`,!0):r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Oa(n,e,t,r,o)}const d=Oa(n,e,t,r,o,c),p=((s=c.resolve)==null?void 0:s.call(c,d,m=>r(i,"TAG_RESOLVE_FAILED",m),e.options))??d,h=W(p)?p:new O(p);return h.range=d.range,h.tag=o,c!=null&&c.format&&(h.format=c.format),h}function Bc(n,e,t){const a=e.offset,r=Lc(e,n.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const s=r.mode===">"?O.BLOCK_FOLDED:O.BLOCK_LITERAL,i=e.source?_c(e.source):[];let o=i.length;for(let g=i.length-1;g>=0;--g){const f=i[g][1];if(f===""||f==="\r")o=g;else break}if(o===0){const g=r.chomp==="+"&&i.length>0?`
|
|
149
|
+
`.repeat(Math.max(1,i.length-1)):"";let f=a+r.length;return e.source&&(f+=e.source.length),{value:g,type:s,comment:r.comment,range:[a,f,f]}}let l=e.indent+r.indent,c=e.offset+r.length,d=0;for(let g=0;g<o;++g){const[f,b]=i[g];if(b===""||b==="\r")r.indent===0&&f.length>l&&(l=f.length);else{f.length<l&&t(c+f.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(l=f.length),d=g,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=f.length+b.length+1}for(let g=i.length-1;g>=o;--g)i[g][0].length>l&&(o=g+1);let p="",h="",m=!1;for(let g=0;g<d;++g)p+=i[g][0].slice(l)+`
|
|
150
|
+
`;for(let g=d;g<o;++g){let[f,b]=i[g];c+=f.length+b.length+1;const v=b[b.length-1]==="\r";if(v&&(b=b.slice(0,-1)),b&&f.length<l){const w=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(c-b.length-(v?2:1),"BAD_INDENT",w),f=""}s===O.BLOCK_LITERAL?(p+=h+f.slice(l)+b,h=`
|
|
151
|
+
`):f.length>l||b[0]===" "?(h===" "?h=`
|
|
152
152
|
`:!m&&h===`
|
|
153
153
|
`&&(h=`
|
|
154
154
|
|
|
155
|
-
`),p+=h+f.slice(l)+
|
|
156
|
-
`,m=!0):
|
|
155
|
+
`),p+=h+f.slice(l)+b,h=`
|
|
156
|
+
`,m=!0):b===""?h===`
|
|
157
157
|
`?p+=`
|
|
158
158
|
`:h=`
|
|
159
|
-
`:(p+=h+
|
|
159
|
+
`:(p+=h+b,h=" ",m=!1)}switch(r.chomp){case"-":break;case"+":for(let g=o;g<i.length;++g)p+=`
|
|
160
160
|
`+i[g][0].slice(l);p[p.length-1]!==`
|
|
161
161
|
`&&(p+=`
|
|
162
162
|
`);break;default:p+=`
|
|
163
|
-
`}const
|
|
163
|
+
`}const y=a+r.length+e.source.length;return{value:p,type:s,comment:r.comment,range:[a,y,y]}}function Lc({offset:n,props:e},t,a){if(e[0].type!=="block-scalar-header")return a(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=e[0],s=r[0];let i=0,o="",l=-1;for(let h=1;h<r.length;++h){const m=r[h];if(!o&&(m==="-"||m==="+"))o=m;else{const y=Number(m);!i&&y?i=y:l===-1&&(l=n+h)}}l!==-1&&a(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let c=!1,d="",p=r.length;for(let h=1;h<e.length;++h){const m=e[h];switch(m.type){case"space":c=!0;case"newline":p+=m.source.length;break;case"comment":t&&!c&&a(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=m.source.length,d=m.source.substring(1);break;case"error":a(m,"UNEXPECTED_TOKEN",m.message),p+=m.source.length;break;default:{const y=`Unexpected token in block scalar header: ${m.type}`;a(m,"UNEXPECTED_TOKEN",y);const g=m.source;g&&typeof g=="string"&&(p+=g.length)}}}return{mode:s,indent:i,chomp:o,comment:d,length:p}}function _c(n){const e=n.split(/\n( *)/),t=e[0],a=t.match(/^( *)/),r=[a!=null&&a[1]?[a[1],t.slice(a[1].length)]:["",t]];for(let s=1;s<e.length;s+=2)r.push([e[s],e[s+1]]);return r}function Rc(n,e,t){const{offset:a,type:r,source:s,end:i}=n;let o,l;const c=(h,m,y)=>t(a+h,m,y);switch(r){case"scalar":o=O.PLAIN,l=Ic(s,c);break;case"single-quoted-scalar":o=O.QUOTE_SINGLE,l=jc(s,c);break;case"double-quoted-scalar":o=O.QUOTE_DOUBLE,l=qc(s,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+s.length,a+s.length]}}const d=a+s.length,p=Lt(i,d,e,t);return{value:l,type:o,comment:p.comment,range:[a,d,p.offset]}}function Ic(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Hs(n)}function jc(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),Hs(n.slice(1,-1)).replace(/''/g,"'")}function Hs(n){const e=/(.*?)\r?\n/sy;let t=e.exec(n);if(!t)return n;let a,r;try{a=new RegExp("(?<![ ])[ ]+$"),r=new RegExp("^[ ]+|(?<![ ])[ ]+$","g")}catch{a=/[ \t]+$/,r=/^[ \t]+|[ \t]+$/g}let s=t[1].replace(a,""),i=" ",o=e.lastIndex;for(;t=e.exec(n);){const c=t[1].replace(r,"");c===""?i===`
|
|
164
164
|
`?s+=i:i=`
|
|
165
|
-
`:(s+=i+c,i=" "),o=e.lastIndex}const l=/[ \t]*(.*)/sy;return l.lastIndex=o,t=l.exec(n),s+i+(t?.[1]??"")}function
|
|
165
|
+
`:(s+=i+c,i=" "),o=e.lastIndex}const l=/[ \t]*(.*)/sy;return l.lastIndex=o,t=l.exec(n),s+i+(t?.[1]??"")}function qc(n,e){let t="";for(let a=1;a<n.length-1;++a){const r=n[a];if(!(r==="\r"&&n[a+1]===`
|
|
166
166
|
`))if(r===`
|
|
167
|
-
`){const{fold:s,offset:i}=
|
|
167
|
+
`){const{fold:s,offset:i}=zc(n,a);t+=s,a=i}else if(r==="\\"){let s=n[++a];const i=Pc[s];if(i)t+=i;else if(s===`
|
|
168
168
|
`)for(s=n[a+1];s===" "||s===" ";)s=n[++a+1];else if(s==="\r"&&n[a+1]===`
|
|
169
|
-
`)for(s=n[++a+1];s===" "||s===" ";)s=n[++a+1];else if(s==="x"||s==="u"||s==="U"){const o=s==="x"?2:s==="u"?4:8;t+=
|
|
169
|
+
`)for(s=n[++a+1];s===" "||s===" ";)s=n[++a+1];else if(s==="x"||s==="u"||s==="U"){const o=s==="x"?2:s==="u"?4:8;t+=Uc(n,a+1,o,e),a+=o}else{const o=n.substr(a-1,2);e(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${o}`),t+=o}}else if(r===" "||r===" "){const s=a;let i=n[a+1];for(;i===" "||i===" ";)i=n[++a+1];i!==`
|
|
170
170
|
`&&!(i==="\r"&&n[a+2]===`
|
|
171
|
-
`)&&(t+=a>s?n.slice(s,a+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function
|
|
171
|
+
`)&&(t+=a>s?n.slice(s,a+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function zc(n,e){let t="",a=n[e+1];for(;(a===" "||a===" "||a===`
|
|
172
172
|
`||a==="\r")&&!(a==="\r"&&n[e+2]!==`
|
|
173
173
|
`);)a===`
|
|
174
174
|
`&&(t+=`
|
|
175
|
-
`),e+=1,a=n[e+1];return t||(t=" "),{fold:t,offset:e}}const
|
|
176
|
-
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function
|
|
175
|
+
`),e+=1,a=n[e+1];return t||(t=" "),{fold:t,offset:e}}const Pc={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
176
|
+
`,r:"\r",t:" ",v:"\v",N:"\x85",_:"\xA0",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function Uc(n,e,t,a){const r=n.substr(e,t),s=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(s)}catch{const i=n.substr(e-2,t+2);return a(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${i}`),i}}function Ws(n,e,t,a){const{value:r,type:s,comment:i,range:o}=e.type==="block-scalar"?Bc(n,e,a):Rc(e,n.options.strict,a),l=t?n.directives.tagName(t.source,p=>a(t,"TAG_RESOLVE_FAILED",p)):null;let c;n.options.stringKeys&&n.atKey?c=n.schema[me]:l?c=Mc(n.schema,r,l,t,a):e.type==="scalar"?c=Hc(n,r,e,a):c=n.schema[me];let d;try{const p=c.resolve(r,h=>a(t??e,"TAG_RESOLVE_FAILED",h),n.options);d=q(p)?p:new O(p)}catch(p){const h=p instanceof Error?p.message:String(p);a(t??e,"TAG_RESOLVE_FAILED",h),d=new O(r)}return d.range=o,d.source=r,s&&(d.type=s),l&&(d.tag=l),c.format&&(d.format=c.format),i&&(d.comment=i),d}function Mc(n,e,t,a,r){var s;if(t==="!")return n[me];const i=[];for(const l of n.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)i.push(l);else return l;for(const l of i)if((s=l.test)!=null&&s.test(e))return l;const o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[me])}function Hc({atKey:n,directives:e,schema:t},a,r,s){const i=t.tags.find(o=>{var l;return(o.default===!0||n&&o.default==="key")&&((l=o.test)==null?void 0:l.test(a))})||t[me];if(t.compat){const o=t.compat.find(l=>{var c;return l.default&&((c=l.test)==null?void 0:c.test(a))})??t[me];if(i.tag!==o.tag){const l=e.tagString(i.tag),c=e.tagString(o.tag),d=`Value may be parsed as either ${l} or ${c}`;s(r,"TAG_RESOLVE_FAILED",d,!0)}}return i}function Wc(n,e,t){if(e){t??(t=e.length);for(let a=t-1;a>=0;--a){let r=e[a];switch(r.type){case"space":case"comment":case"newline":n-=r.source.length;continue}for(r=e[++a];r?.type==="space";)n+=r.source.length,r=e[++a];break}}return n}const Kc={composeNode:Ks,composeEmptyNode:Na};function Ks(n,e,t,a){const r=n.atKey,{spaceBefore:s,comment:i,anchor:o,tag:l}=t;let c,d=!0;switch(e.type){case"alias":c=Vc(n,e,a),(o||l)&&a(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=Ws(n,e,l,a),o&&(c.anchor=o.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{c=Nc(Kc,n,e,t,a),o&&(c.anchor=o.source.substring(1))}catch(p){const h=p instanceof Error?p.message:String(p);a(e,"RESOURCE_EXHAUSTION",h)}break;default:{const p=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;a(e,"UNEXPECTED_TOKEN",p),d=!1}}return c??(c=Na(n,e.offset,void 0,null,t,a)),o&&c.anchor===""&&a(o,"BAD_ALIAS","Anchor cannot be an empty string"),r&&n.options.stringKeys&&(!q(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&a(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),i&&(e.type==="scalar"&&e.source===""?c.comment=i:c.commentBefore=i),n.options.keepSourceTokens&&d&&(c.srcToken=e),c}function Na(n,e,t,a,{spaceBefore:r,comment:s,anchor:i,tag:o,end:l},c){const d={type:"scalar",offset:Wc(e,t,a),indent:-1,source:""},p=Ws(n,d,o,c);return i&&(p.anchor=i.source.substring(1),p.anchor===""&&c(i,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(p.spaceBefore=!0),s&&(p.comment=s,p.range[2]=l),p}function Vc({options:n},{offset:e,source:t,end:a},r){const s=new ua(t.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const i=e+t.length,o=Lt(a,i,n.strict,r);return s.range=[e,i,o.offset],o.comment&&(s.comment=o.comment),s}function Zc(n,e,{offset:t,start:a,value:r,end:s},i){const o=Object.assign({_directives:e},n),l=new qs(void 0,o),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},d=rt(a,{indicator:"doc-start",next:r??s?.[0],offset:t,onError:i,parentIndent:0,startOnNewline:!0});d.found&&(l.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!d.hasNewline&&i(d.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=r?Ks(c,r,d,i):Na(c,d.end,a,null,d,i);const p=l.contents.range[2],h=Lt(s,p,!1,i);return h.comment&&(l.comment=h.comment),l.range=[t,p,h.offset],l}function _t(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Vs(n){var e;let t="",a=!1,r=!1;for(let s=0;s<n.length;++s){const i=n[s];switch(i[0]){case"#":t+=(t===""?"":r?`
|
|
177
177
|
|
|
178
178
|
`:`
|
|
179
|
-
`)+(i.substring(1)||" "),a=!0,r=!1;break;case"%":((e=n[s+1])==null?void 0:e[0])!=="#"&&(s+=1),a=!1;break;default:a||(r=!0),a=!1}}return{comment:t,afterEmptyLine:r}}class
|
|
179
|
+
`)+(i.substring(1)||" "),a=!0,r=!1;break;case"%":((e=n[s+1])==null?void 0:e[0])!=="#"&&(s+=1),a=!1;break;default:a||(r=!0),a=!1}}return{comment:t,afterEmptyLine:r}}class Jc{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,a,r,s)=>{const i=_t(t);s?this.warnings.push(new Cc(i,a,r)):this.errors.push(new Nt(i,a,r))},this.directives=new Y({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:a,afterEmptyLine:r}=Vs(this.prelude);if(a){const s=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
180
180
|
${a}`:a;else if(r||e.directives.docStart||!s)e.commentBefore=a;else if(H(s)&&!s.flow&&s.items.length>0){let i=s.items[0];M(i)&&(i=i.key);const o=i.commentBefore;i.commentBefore=o?`${a}
|
|
181
181
|
${o}`:a}else{const i=s.commentBefore;s.commentBefore=i?`${a}
|
|
182
|
-
${i}`:a}}if(t){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:
|
|
183
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new
|
|
182
|
+
${i}`:a}}if(t){for(let s=0;s<this.errors.length;++s)e.errors.push(this.errors[s]);for(let s=0;s<this.warnings.length;++s)e.warnings.push(this.warnings[s])}else e.errors=this.errors,e.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Vs(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,a=-1){for(const r of e)yield*this.next(r);yield*this.end(t,a)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,a,r)=>{const s=_t(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",a,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=Zc(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,a=new Nt(_t(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(a):this.doc.errors.push(a);break}case"doc-end":{if(!this.doc){const a="Unexpected doc-end without preceding document";this.errors.push(new Nt(_t(e),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const t=Lt(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
|
|
183
|
+
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Nt(_t(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const a=Object.assign({_directives:this.directives},this.options),r=new qs(void 0,a);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}}const Zs="\uFEFF",Js="",Gs="",Ba="";function Gc(n){switch(n){case Zs:return"byte-order-mark";case Js:return"doc-mode";case Gs:return"flow-error-end";case Ba:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
184
184
|
`:case`\r
|
|
185
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function
|
|
186
|
-
`:case"\r":case" ":return!0;default:return!1}}const
|
|
187
|
-
\r `),
|
|
185
|
+
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function ue(n){switch(n){case void 0:case" ":case`
|
|
186
|
+
`:case"\r":case" ":return!0;default:return!1}}const Xs=new Set("0123456789ABCDEFabcdef"),Xc=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),$n=new Set(",[]{}"),Yc=new Set(` ,[]{}
|
|
187
|
+
\r `),La=n=>!n||Yc.has(n);class Qc{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let a=this.next??"stream";for(;a&&(t||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
188
188
|
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
189
189
|
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let a=0;for(;t===" ";)t=this.buffer[++a+e];if(t==="\r"){const r=this.buffer[a+e+1];if(r===`
|
|
190
190
|
`||!r&&!this.atEnd)return e+a+1}return t===`
|
|
191
|
-
`||a>=this.indentNext||!t&&!this.atEnd?e+a:-1}if(t==="-"||t==="."){const a=this.buffer.substr(e,3);if((a==="---"||a==="...")&&
|
|
192
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===
|
|
191
|
+
`||a>=this.indentNext||!t&&!this.atEnd?e+a:-1}if(t==="-"||t==="."){const a=this.buffer.substr(e,3);if((a==="---"||a==="...")&&ue(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
192
|
+
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Zs&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,a=e.indexOf("#");for(;a!==-1;){const s=e[a-1];if(s===" "||s===" "){t=a-1;break}else a=e.indexOf("#",a+1)}for(;;){const s=e[t-1];if(s===" "||s===" ")t-=1;else break}const r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Js,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&ue(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ue(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&ue(t)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(La),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,a=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=a=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&r[0]!=="#"||a===0&&(r.startsWith("---")||r.startsWith("..."))&&ue(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Gs,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(La),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const i=this.charAt(1);if(this.flowKey||ue(i)||i===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let s=0;for(;this.buffer[t-1-s]==="\\";)s+=1;if(s%2===0)break;t=this.buffer.indexOf('"',t+1)}const a=this.buffer.substring(0,t);let r=a.indexOf(`
|
|
193
193
|
`,this.pos);if(r!==-1){for(;r!==-1;){const s=this.continueScalar(r+1);if(s===-1)break;r=a.indexOf(`
|
|
194
|
-
`,s)}r!==-1&&(t=r-(a[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>
|
|
194
|
+
`,s)}r!==-1&&(t=r-(a[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>ue(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,a;e:for(let s=this.pos;a=this.buffer[s];++s)switch(a){case" ":t+=1;break;case`
|
|
195
195
|
`:e=s,t=0;break;case"\r":{const i=this.buffer[s+1];if(!i&&!this.atEnd)return this.setNext("block-scalar");if(i===`
|
|
196
196
|
`)break}default:break e}if(!a&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
197
197
|
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(a=this.buffer[r];a===" ";)a=this.buffer[++r];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
|
|
198
198
|
`;)a=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,i=this.buffer[s];i==="\r"&&(i=this.buffer[--s]);const o=s;for(;i===" ";)i=this.buffer[--s];if(i===`
|
|
199
|
-
`&&s>=this.pos&&s+1+t>o)e=s;else break}while(!0);return yield
|
|
199
|
+
`&&s>=this.pos&&s+1+t>o)e=s;else break}while(!0);return yield Ba,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,a=this.pos-1,r;for(;r=this.buffer[++a];)if(r===":"){const s=this.buffer[a+1];if(ue(s)||e&&$n.has(s))break;t=a}else if(ue(r)){let s=this.buffer[a+1];if(r==="\r"&&(s===`
|
|
200
200
|
`?(a+=1,r=`
|
|
201
|
-
`,s=this.buffer[a+1]):t=a),s==="#"||e
|
|
202
|
-
`){const i=this.continueScalar(a+1);if(i===-1)break;a=Math.max(a,i-2)}}else{if(e
|
|
201
|
+
`,s=this.buffer[a+1]):t=a),s==="#"||e&&$n.has(s))break;if(r===`
|
|
202
|
+
`){const i=this.continueScalar(a+1);if(i===-1)break;a=Math.max(a,i-2)}}else{if(e&&$n.has(r))break;t=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Ba,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const a=this.buffer.slice(this.pos,e);return a?(yield a,this.pos+=a.length,a.length):(t&&(yield""),0)}*pushIndicators(){let e=0;e:for(;;){switch(this.charAt(0)){case"!":e+=yield*this.pushTag(),e+=yield*this.pushSpaces(!0);continue e;case"&":e+=yield*this.pushUntil(La),e+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const t=this.flowLevel>0,a=this.charAt(1);if(ue(a)||t&&$n.has(a)){t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,e+=yield*this.pushCount(1),e+=yield*this.pushSpaces(!0);continue e}}}break e}return e}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!ue(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(Xc.has(t))t=this.buffer[++e];else if(t==="%"&&Xs.has(this.buffer[e+1])&&Xs.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
203
203
|
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
204
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,a;do a=this.buffer[++t];while(a===" "||e&&a===" ");const r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,a=this.buffer[t];for(;!e(a);)a=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class
|
|
204
|
+
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,a;do a=this.buffer[++t];while(a===" "||e&&a===" ");const r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,a=this.buffer[t];for(;!e(a);)a=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class ed{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,a=this.lineStarts.length;for(;t<a;){const s=t+a>>1;this.lineStarts[s]<e?t=s+1:a=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}function $e(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Ys(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Qs(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function kn(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function st(n){var e;if(n.length===0)return[];let t=n.length;e:for(;--t>=0;)switch(n[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((e=n[++t])==null?void 0:e.type)==="space";);return n.splice(t,n.length)}function Sn(n,e){if(e.length<1e5)Array.prototype.push.apply(n,e);else for(let t=0;t<e.length;++t)n.push(e[t])}function ei(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!$e(e.start,"explicit-key-ind")&&!$e(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Qs(e.value)?e.value.end?Sn(e.value.end,e.sep):e.value.end=e.sep:Sn(e.start,e.sep),delete e.sep)}class td{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Qc,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(e,t))yield*this.next(a);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=Gc(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const a=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:a,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const a=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in a?a.indent:0:t.type==="flow-collection"&&a.type==="document"&&(t.indent=0),t.type==="flow-collection"&&ei(t),a.type){case"document":a.value=t;break;case"block-scalar":a.props.push(t);break;case"block-map":{const r=a.items[a.items.length-1];if(r.value){a.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=a.items[a.items.length-1];r.value?a.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{const r=a.items[a.items.length-1];!r||r.value?a.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Ys(r.start)===-1&&(t.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<t.indent))&&(a.type==="document"?a.end=r.start:a.items.push({start:r.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Ys(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=kn(this.peek(2)),a=st(t);let r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:a,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
205
205
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
206
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var t;const a=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,a.value){const r="end"in a.value?a.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;s?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)e.items.push({start:[this.sourceToken]});else if(a.sep)a.sep.push(this.sourceToken);else{if(this.atIndentedComment(a.start,e.indent)){const r=e.items[e.items.length-2],s=(t=r?.value)==null?void 0:t.end;if(Array.isArray(s)){
|
|
206
|
+
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){var t;const a=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,a.value){const r="end"in a.value?a.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;s?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)e.items.push({start:[this.sourceToken]});else if(a.sep)a.sep.push(this.sourceToken);else{if(this.atIndentedComment(a.start,e.indent)){const r=e.items[e.items.length-2],s=(t=r?.value)==null?void 0:t.end;if(Array.isArray(s)){Sn(s,a.start),s.push(this.sourceToken),e.items.pop();return}}a.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const r=!this.onKeyLine&&this.indent===e.indent,s=r&&(a.sep||a.explicitKey)&&this.type!=="seq-item-ind";let i=[];if(s&&a.sep&&!a.value){const o=[];for(let l=0;l<a.sep.length;++l){const c=a.sep[l];switch(c.type){case"newline":o.push(l);break;case"space":break;case"comment":c.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(i=a.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":s||a.value?(i.push(this.sourceToken),e.items.push({start:i}),this.onKeyLine=!0):a.sep?a.sep.push(this.sourceToken):a.start.push(this.sourceToken);return;case"explicit-key-ind":!a.sep&&!a.explicitKey?(a.start.push(this.sourceToken),a.explicitKey=!0):s||a.value?(i.push(this.sourceToken),e.items.push({start:i,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(a.explicitKey)if(a.sep)if(a.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if($e(a.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]});else if(Qs(a.key)&&!$e(a.sep,"newline")){const o=st(a.start),l=a.key,c=a.sep;c.push(this.sourceToken),delete a.key,delete a.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:l,sep:c}]})}else i.length>0?a.sep=a.sep.concat(i,this.sourceToken):a.sep.push(this.sourceToken);else if($e(a.start,"newline"))Object.assign(a,{key:null,sep:[this.sourceToken]});else{const o=st(a.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else a.sep?a.value||s?e.items.push({start:i,key:null,sep:[this.sourceToken]}):$e(a.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):a.sep.push(this.sourceToken):Object.assign(a,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);s||a.value?(e.items.push({start:i,key:o,sep:[]}),this.onKeyLine=!0):a.sep?this.stack.push(o):(Object.assign(a,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!a.explicitKey&&a.sep&&!$e(a.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:i});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){var t;const a=e.items[e.items.length-1];switch(this.type){case"newline":if(a.value){const r="end"in a.value?a.value.end:void 0,s=Array.isArray(r)?r[r.length-1]:void 0;s?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else a.start.push(this.sourceToken);return;case"space":case"comment":if(a.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(a.start,e.indent)){const r=e.items[e.items.length-2],s=(t=r?.value)==null?void 0:t.end;if(Array.isArray(s)){Sn(s,a.start),s.push(this.sourceToken),e.items.pop();return}}a.start.push(this.sourceToken)}return;case"anchor":case"tag":if(a.value||this.indent<=e.indent)break;a.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;a.value||$e(a.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):a.start.push(this.sourceToken);return}if(this.indent>e.indent){const r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const a=this.startBlockValue(e);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===e.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const r=kn(a),s=st(r);ei(e);const i=e.end.splice(1,e.end.length);i.push(this.sourceToken);const o={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
207
207
|
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
208
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=
|
|
209
|
-
`))}function Vc(n){var e;const t=typeof window<"u"&&(e=window.location)!=null&&e.href?window.location.href:"http://localhost/",a=n?new URL(n,t):new URL(t);return{check(r){return typeof r!="string"||r.startsWith("#")?!1:Ks(r)},resolvePath(r,s){if(s.startsWith("http://")||s.startsWith("https://"))return s;const i=r&&(r.startsWith("http://")||r.startsWith("https://"))?new URL(r):a;return new URL(s,i).href},async get(r){const s=r.startsWith("http://")||r.startsWith("https://")?r:new URL(r,a).href,i=await fetch(s);if(!i.ok){const o=new Error(`Failed to load ${s} (${i.status})`);throw o.status=i.status,o.statusCode=i.status,o.response=i,o.url=s,o}return await i.text()}}}function Vs(n){const e=new WeakMap,t=new WeakSet;function a(r,s=new Set,i=null){if(!r||typeof r!="object")return r;const o=r["x-ref"];if(o&&s.has(o))return{$ref:o};if(t.has(r))return{$ref:o||i||"#/components/schemas/Circular"};if(e.has(r))return e.get(r);t.add(r);let l=s;o&&(l=new Set(s),l.add(o));let c;if(Array.isArray(r)){c=[],e.set(r,c);for(let d=0;d<r.length;d++)c.push(a(r[d],l,o||i))}else{c={},e.set(r,c);for(const d of Object.keys(r))d!=="x-ref"&&(c[d]=a(r[d],l,o||i))}return t.delete(r),c}return a(n)}async function Zs(n,e=!1,t=!1,a=!1,r="none",s="",i="",o="",l="",c="",d="",p=""){var h,m,b,g,f,y,v,x,w,k;let $;try{this.requestUpdate();const D=Vc(typeof n=="string"&&Ks(n)?n:void 0),T=await Ws(n,{plugins:[D]});if(T.errors&&T.errors.length>0&&!T.specification){const Z=T.errors[0],B=new Error(Z.message||"Error loading specification");throw B.status=404,B}const C={onDereference:({schema:Z,ref:B})=>{Z["x-ref"]=B}};let R;if((h=T.specification)!=null&&h.swagger&&String(T.specification.swagger).startsWith("2")){const Z=Kc(T.filesystem),B=await Hs(Z.specification,C);R=Vs(B.schema)}else{const Z=await Hs(T.filesystem,C);R=Vs(Z.schema)}if(await Xt(0),R&&(R.components||R.info||R.servers||R.tags||R.paths))$=Zc(R,c,d,p),this.dispatchEvent(new CustomEvent("before-render",{detail:{spec:$}}));else return{specLoadError:!0,isSpecLoading:!1,info:{title:"Invalid Spec Definition",description:"Invalid Spec Definition",version:""},tags:[]}}catch(D){let T;return D.statusCode===404||D.status===404?T=(m=D.response)!=null&&m.url||D.url?`${((b=D.response)==null?void 0:b.url)||D.url} \u2503 Not Found (${((g=D.response)==null?void 0:g.status)||D.status})`:"Spec Not Found \u2503 404":T=`Unable to load ${((f=D.response)==null?void 0:f.url)||D.url||(typeof n=="string"?n:"")} \u2503 ${((y=D.response)==null?void 0:y.status)||D.status||D.message}`,{specLoadError:!0,isSpecLoading:!1,info:{title:"Error loading the spec",description:T,version:""},tags:[]}}const S=Gc($,r,e,t),E=Jc($,a),N=(v=$.info)!=null&&v.description?Da($.info.description):[],_=[];if((x=$.components)!=null&&x.securitySchemes){const D=new Set;Object.entries($.components.securitySchemes).forEach(T=>{if(!D.has(T[0])){D.add(T[0]);const C={securitySchemeId:T[0],...T[1]};C.in="header",C.name="Authorization",C.nameId=T[1].name||T[0],C.user="",C.password="",C.clientId="",C.clientSecret="",C.value="",C.finalKeyValue="",T[1].type==="apiKey"&&(C.in=T[1].in||"header",C.name=T[1].name||"Authorization"),_.push(C)}})}s&&i&&o&&_.push({securitySchemeId:Fe,description:"api-key provided in rapidoc element attributes",type:"apiKey",oAuthFlow:"",name:s,nameId:s,in:i,value:o,finalKeyValue:o}),_.forEach(D=>{D.type==="http"?D.typeDisplay=D.scheme==="basic"?"HTTP Basic":`HTTP Bearer ${D.nameId}`:D.type==="apiKey"?D.typeDisplay=`API Key (${D.name})`:D.type==="oauth2"?D.typeDisplay=`OAuth (${D.securitySchemeId})`:D.typeDisplay=D.type||"None"});let V=[];return $.servers&&Array.isArray($.servers)&&$.servers.length>0?($.servers.forEach(D=>{var T,C;let R=D.url.trim();R.startsWith("http")||R.startsWith("//")||R.startsWith("{")||typeof window<"u"&&(C=(T=window.location)==null?void 0:T.origin)!=null&&C.startsWith("http")&&(D.url=window.location.origin+D.url,R=D.url),D.variables&&Object.entries(D.variables).forEach(Z=>{const B=new RegExp(`{${Z[0]}}`,"g");R=R.replace(B,Z[1].default||""),Z[1].value=Z[1].default||""}),D.computedUrl=R}),l&&$.servers.push({url:l,computedUrl:l})):l?$.servers=[{url:l,computedUrl:l}]:typeof window<"u"&&(k=(w=window.location)==null?void 0:w.origin)!=null&&k.startsWith("http")?$.servers=[{url:window.location.origin,computedUrl:window.location.origin}]:$.servers=[{url:"http://localhost",computedUrl:"http://localhost"}],V=$.servers,{specLoadError:!1,isSpecLoading:!1,info:$.info,infoDescriptionHeaders:N,tags:S,components:E,externalDocs:$.externalDocs,securitySchemes:_,servers:V}}function Zc(n,e="",t="",a=""){const r={},s=a.split(",").map(l=>l.trim().toLowerCase()).filter(Boolean);function i(l,c){if(!e)return!0;const d=`${c} ${l}`.toLowerCase();return t==="regex"?new RegExp(e,"i").test(d):d.includes(e.toLowerCase())}function o(l){return l.some(c=>s.includes(c?.label.toLowerCase()))}return Object.entries(n.paths).forEach(([l,c])=>{const d={};Object.entries(c).forEach(([p,h])=>{const m=h["x-badges"];i(l,p)&&(m&&Array.isArray(m)&&o(m)||(d[p]=h))}),Object.keys(d).length>0&&(r[l]=d)}),n.paths=r,n}function Da(n){return A.lexer(n).filter(e=>e.type==="heading"&&e.depth<=2)||[]}function Jc(n,e=!1){if(!n.components)return[];const t=[];for(const a in n.components){const r=[];for(const l in n.components[a]){const c={show:!0,id:`${a.toLowerCase()}-${l.toLowerCase()}`.replace(Gt,"-"),name:l,component:n.components[a][l]};r.push(c)}let s=a,i=a;switch(a){case"schemas":e&&r.sort((l,c)=>l.name.localeCompare(c.name)),i="Schemas",s="Schemas allows the definition of input and output data types. These types can be objects, but also primitives and arrays.";break;case"responses":i="Responses",s="Describes responses from an API Operation, including design-time, static links to operations based on the response.";break;case"parameters":i="Parameters",s="Describes operation parameters. A unique parameter is defined by a combination of a name and location.";break;case"examples":i="Examples",s="List of Examples for operations, can be requests, responses and objects examples.";break;case"requestBodies":i="Request Bodies",s="Describes common request bodies that are used across the API operations.";break;case"headers":i="Headers",s='Headers follows the structure of the Parameters but they are explicitly in "header"';break;case"securitySchemes":i="Security Schemes",s="Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), OAuth2's common flows(implicit, password, client credentials and authorization code) as defined in RFC6749, and OpenID Connect Discovery.";break;case"links":i="Links",s="Links represent a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.";break;case"callbacks":i="Callbacks",s="A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.";break;default:i=a,s=a;break}const o={show:!0,name:i,description:s,subComponents:r};t.push(o)}return t||[]}function Gc(n,e="none",t=!1,a=!1){const r=["get","put","post","delete","patch","head","options"],s=n.tags&&Array.isArray(n.tags)&&n.tags.length>0?n.tags.map(l=>({show:!0,elementId:`tag--${l.name.replace(Gt,"-")}`,name:l.name,displayName:l["x-displayName"]||l.name,description:l.description||"",headers:l.description?Da(l.description):[],paths:[],expanded:l["x-tag-expanded"]!==!1})):[],i=n.paths||{};if(n.webhooks)for(const[l,c]of Object.entries(n.webhooks))c._type="webhook",i[l]=c;for(const l in i){const c=i[l].parameters,d={servers:i[l].servers||[],parameters:i[l].parameters||[]},p=i[l]._type==="webhook";r.forEach(h=>{if(i[l][h]){const m=n.paths[l][h],b=m.tags||[];if(b.length===0)if(t){const g=l.replace(/^\/+|\/+$/g,""),f=g.indexOf("/");f===-1?b.push(g):b.push(g.substring(0,f))}else b.push("General \u2982");b.forEach(g=>{let f,y;n.tags&&(y=n.tags.find(w=>w.name.toLowerCase()===g.toLowerCase())),f=s.find(w=>w.name===g),f||(f={show:!0,elementId:`tag--${g.replace(Gt,"-")}`,name:g,description:y?.description||"",headers:y!=null&&y.description?Da(y.description):[],paths:[],expanded:y?y["x-tag-expanded"]!==!1:!0},s.push(f));let v=(m.summary||m.description||`${h.toUpperCase()} ${l}`).trim();v.length>100&&([v]=v.split(/[.|!|?]\s|[\r?\n]/));let x=[];if(c?m.parameters?x=c.filter(w=>{if(!m.parameters.some(k=>w.name===k.name&&w.in===k.in))return w}).concat(m.parameters):x=c.slice(0):x=m.parameters?m.parameters.slice(0):[],m.callbacks)for(const[w,k]of Object.entries(m.callbacks)){const $=Object.entries(k).filter(S=>typeof S[1]=="object")||[];m.callbacks[w]=Object.fromEntries($)}f.paths.push({show:!0,expanded:!1,isWebhook:p,expandedAtLeastOnce:!1,summary:m.summary||"",description:m.description||"",externalDocs:m.externalDocs,shortSummary:v,method:h,path:l,operationId:m.operationId,elementId:`${h}-${l.replace(Gt,"-")}`,servers:m.servers?d.servers.concat(m.servers):d.servers,parameters:x,requestBody:m.requestBody,responses:m.responses,callbacks:m.callbacks,deprecated:m.deprecated,security:m.security,xBadges:m["x-badges"]||void 0,xCodeSamples:m["x-codeSamples"]||m["x-code-samples"]||""})})}})}const o=s.filter(l=>l.paths&&l.paths.length>0);return e!=="none"&&o.forEach(l=>{e==="method"?l.paths.sort((c,d)=>r.indexOf(c.method).toString().localeCompare(r.indexOf(d.method))):e==="summary"?l.paths.sort((c,d)=>c.shortSummary.localeCompare(d.shortSummary)):e==="path"&&l.paths.sort((c,d)=>c.path.localeCompare(d.path)),l.firstPathId=l.paths[0].elementId}),a?o.sort((l,c)=>l.name.localeCompare(c.name)):o}/**
|
|
208
|
+
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=kn(e),a=st(t);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=kn(e),a=st(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function nd(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new ed||null,prettyErrors:e}}function ad(n,e={}){const{lineCounter:t,prettyErrors:a}=nd(e),r=new td(t?.addNewLine),s=new Jc(e);let i=null;for(const o of s.compose(r.parse(n),!0,n.length))if(!i)i=o;else if(i.options.logLevel!=="silent"){i.errors.push(new Nt(o.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&t&&(i.errors.forEach(Ps(n,t)),i.warnings.forEach(Ps(n,t))),i}function rd(n,e,t){let a;typeof e=="function"?a=e:t===void 0&&e&&typeof e=="object"&&(t=e);const r=ad(n,t);if(!r)return null;if(r.warnings.forEach(s=>(r.options.logLevel,void 0)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:a},t))}function En(n){if(n!==null){if(typeof n=="string"){if(n.trim()==="")return;try{return JSON.parse(n)}catch{const e=/^[^:]+:/.test(n),t=n.slice(0,50).trimStart().startsWith("{");return!e||t?void 0:rd(n,{maxAliasCount:1e4,merge:!0})}}return la(n),n}}function _a(n,e={}){if(la(n))return n;const t=En(n);return Array.isArray(t)?t:[{isEntrypoint:!0,specification:t,filename:null,dir:"./",references:ss(t),...e}]}function sd(n){return decodeURI(n.replace(/~1/g,"/").replace(/~0/g,"~"))}function id(n){return n.split("/").slice(1).map(sd)}function od(n,e,t,a=[]){const r=structuredClone(n),s=_a(r),i=Be(s),o=t?.specification??i.specification;if(!Zr(o)){if(e!=null&&e.throwOnError)throw new Error(ne.NO_CONTENT);return{valid:!1,errors:a,schema:o}}return Ra(o,s,i,new WeakSet,a,e),a=a.filter((l,c,d)=>c===d.findIndex(p=>p.message===l.message&&p.code===l.code)),{valid:a.length===0,errors:a,schema:o}}function Ra(n,e,t,a,r,s){var i;if(n===null||a.has(n))return;a.add(n);function o(c){return Ra(c.specification,e,c,a,r,s),c}const l=new Set;for(;n.$ref!==void 0;){if(l.has(n.$ref)){r.push({code:"SELF_REFERENCE",message:ne.SELF_REFERENCE.replace("%s",n.$ref)}),delete n.$ref;break}l.add(n.$ref);const c=ti(n.$ref,s,t,e,o,r);if(typeof c!="object"||c===null)break;const d=n.$ref;delete n.$ref;for(const p of Object.keys(c))n[p]===void 0&&(n[p]=c[p]);d&&((i=s?.onDereference)==null||i.call(s,{schema:n,ref:d,resolved:c}))}for(const c of Object.values(n))typeof c=="object"&&c!==null&&Ra(c,e,t,a,r,s)}function ti(n,e,t,a,r,s){if(typeof n!="string"){if(e!=null&&e.throwOnError)throw new Error(ne.INVALID_REFERENCE.replace("%s",n));s.push({code:"INVALID_REFERENCE",message:ne.INVALID_REFERENCE.replace("%s",n)});return}const[i,o]=n.split("#",2),l=i!==t.filename;if(i&&l){const c=a.find(d=>d.filename===i);if(!c){if(e!=null&&e.throwOnError)throw new Error(ne.EXTERNAL_REFERENCE_NOT_FOUND.replace("%s",i));s.push({code:"EXTERNAL_REFERENCE_NOT_FOUND",message:ne.EXTERNAL_REFERENCE_NOT_FOUND.replace("%s",i)});return}return o===void 0?c.specification:ti(`#${o}`,e,r(c),a,r,s)}try{return id(o).reduce((c,d)=>{if(!te(c)||!(d in c))throw new Error(ne.INVALID_REFERENCE.replace("%s",n));return c[d]},t.specification)}catch{if(e!=null&&e.throwOnError)throw new Error(ne.INVALID_REFERENCE.replace("%s",n));s.push({code:"INVALID_REFERENCE",message:ne.INVALID_REFERENCE.replace("%s",n)})}}function ni(n,e){const t=_a(n),a=Be(t),r=od(t,e);return{specification:a.specification,errors:r.errors,schema:r.schema,...rs(a.specification)}}function ld(n,e,t){const a=Rl(n);return e==="3.0"?a:Kl(a)}function cd(n){if(!n)return{specification:null,version:void 0};const e=ld(la(n)?Be(n).specification:En(n),"3.1"),{version:t}=rs(e);return{specification:e,version:t==="3.1"||t==="3.2"?t:void 0}}async function ai(n,e){var t,a,r,s,i,o;const l=[];if((t=e?.filesystem)!=null&&t.find(m=>m.filename===n))return{specification:(a=Be(e.filesystem))==null?void 0:a.specification,filesystem:e.filesystem,errors:l};const c=(r=e?.plugins)==null?void 0:r.find(m=>m.check(n));let d=En(n);if(c)try{d=En(await c.get(n))}catch{if(e!=null&&e.throwOnError)throw new Error(ne.EXTERNAL_REFERENCE_NOT_FOUND.replace("%s",n));return l.push({code:"EXTERNAL_REFERENCE_NOT_FOUND",message:ne.EXTERNAL_REFERENCE_NOT_FOUND.replace("%s",n)}),{specification:null,filesystem:[],errors:l}}if(d===void 0){if(e!=null&&e.throwOnError)throw new Error("No content to load");return l.push({code:"NO_CONTENT",message:ne.NO_CONTENT}),{specification:null,filesystem:[],errors:l}}let p=_a(d,{filename:e?.filename??null});const h=(e!=null&&e.filename?p.find(m=>m.filename===e?.filename):Be(p)).references??ss(d);if(h.length===0)return{specification:(s=Be(p))==null?void 0:s.specification,filesystem:p,errors:l};for(const m of h){const y=(i=e?.plugins)==null?void 0:i.find(v=>v.check(m));if(!y)continue;const g=y.check(m)&&y.resolvePath?y.resolvePath(n,m):m;if(p.find(v=>v.filename===m))continue;const{filesystem:f,errors:b}=await ai(g,{...e,filename:m});l.push(...b),p=[...p,...f.map(v=>({...v,isEntrypoint:!1}))]}return{specification:(o=Be(p))==null?void 0:o.specification,filesystem:p,errors:l}}function ri(n){if(typeof n!="string")return!1;const e=n.trim();return!(e.startsWith("{")||e.startsWith("[")||e.includes(`
|
|
209
|
+
`))}function dd(n){var e;const t=typeof window<"u"&&(e=window.location)!=null&&e.href?window.location.href:"http://localhost/",a=n?new URL(n,t):new URL(t);return{check(r){return typeof r!="string"||r.startsWith("#")?!1:ri(r)},resolvePath(r,s){if(s.startsWith("http://")||s.startsWith("https://"))return s;const i=r&&(r.startsWith("http://")||r.startsWith("https://"))?new URL(r):a;return new URL(s,i).href},async get(r){const s=r.startsWith("http://")||r.startsWith("https://")?r:new URL(r,a).href,i=await fetch(s);if(!i.ok){const o=new Error(`Failed to load ${s} (${i.status})`);throw o.status=i.status,o.statusCode=i.status,o.response=i,o.url=s,o}return await i.text()}}}function si(n){const e=new WeakMap,t=new WeakSet;function a(r,s=new Set,i=null){if(!r||typeof r!="object")return r;const o=r["x-ref"];if(o&&s.has(o))return{$ref:o};if(t.has(r))return{$ref:o||i||"#/components/schemas/Circular"};if(e.has(r))return e.get(r);t.add(r);let l=s;o&&(l=new Set(s),l.add(o));let c;if(Array.isArray(r)){c=[],e.set(r,c);for(let d=0;d<r.length;d++)c.push(a(r[d],l,o||i))}else{c={},e.set(r,c);for(const d of Object.keys(r))d!=="x-ref"&&(c[d]=a(r[d],l,o||i))}return t.delete(r),c}return a(n)}async function ii(n,e=!1,t=!1,a=!1,r="none",s="",i="",o="",l="",c="",d="",p=""){var h,m,y,g,f,b,v,w,x,k;let $;try{this.requestUpdate();const D=dd(typeof n=="string"&&ri(n)?n:void 0),T=await ai(n,{plugins:[D]});if(T.errors&&T.errors.length>0&&!T.specification){const Z=T.errors[0],B=new Error(Z.message||"Error loading specification");throw B.status=404,B}const C={onDereference:({schema:Z,ref:B})=>{Z["x-ref"]=B}};let I;if((h=T.specification)!=null&&h.swagger&&String(T.specification.swagger).startsWith("2")){const Z=cd(T.filesystem),B=await ni(Z.specification,C);I=si(B.schema)}else{const Z=await ni(T.filesystem,C);I=si(Z.schema)}if(await nn(0),I&&(I.components||I.info||I.servers||I.tags||I.paths))$=pd(I,c,d,p),this.dispatchEvent(new CustomEvent("before-render",{detail:{spec:$}}));else return{specLoadError:!0,isSpecLoading:!1,info:{title:"Invalid Spec Definition",description:"Invalid Spec Definition",version:""},tags:[]}}catch(D){let T;return D.statusCode===404||D.status===404?T=(m=D.response)!=null&&m.url||D.url?`${((y=D.response)==null?void 0:y.url)||D.url} \u2503 Not Found (${((g=D.response)==null?void 0:g.status)||D.status})`:"Spec Not Found \u2503 404":T=`Unable to load ${((f=D.response)==null?void 0:f.url)||D.url||(typeof n=="string"?n:"")} \u2503 ${((b=D.response)==null?void 0:b.status)||D.status||D.message}`,{specLoadError:!0,isSpecLoading:!1,info:{title:"Error loading the spec",description:T,version:""},tags:[]}}const S=hd($,r,e,t),E=ud($,a),N=(v=$.info)!=null&&v.description?Ia($.info.description):[],R=[];if((w=$.components)!=null&&w.securitySchemes){const D=new Set;Object.entries($.components.securitySchemes).forEach(T=>{if(!D.has(T[0])){D.add(T[0]);const C={securitySchemeId:T[0],...T[1]};C.in="header",C.name="Authorization",C.nameId=T[1].name||T[0],C.user="",C.password="",C.clientId="",C.clientSecret="",C.value="",C.finalKeyValue="",T[1].type==="apiKey"&&(C.in=T[1].in||"header",C.name=T[1].name||"Authorization"),R.push(C)}})}s&&i&&o&&R.push({securitySchemeId:Te,description:"api-key provided in rapidoc element attributes",type:"apiKey",oAuthFlow:"",name:s,nameId:s,in:i,value:o,finalKeyValue:o}),R.forEach(D=>{D.type==="http"?D.typeDisplay=D.scheme==="basic"?"HTTP Basic":`HTTP Bearer ${D.nameId}`:D.type==="apiKey"?D.typeDisplay=`API Key (${D.name})`:D.type==="oauth2"?D.typeDisplay=`OAuth (${D.securitySchemeId})`:D.typeDisplay=D.type||"None"});let V=[];return $.servers&&Array.isArray($.servers)&&$.servers.length>0?($.servers.forEach(D=>{var T,C;let I=D.url.trim();I.startsWith("http")||I.startsWith("//")||I.startsWith("{")||typeof window<"u"&&(C=(T=window.location)==null?void 0:T.origin)!=null&&C.startsWith("http")&&(D.url=window.location.origin+D.url,I=D.url),D.variables&&Object.entries(D.variables).forEach(Z=>{const B=new RegExp(`{${Z[0]}}`,"g");I=I.replace(B,Z[1].default||""),Z[1].value=Z[1].default||""}),D.computedUrl=I}),l&&$.servers.push({url:l,computedUrl:l})):l?$.servers=[{url:l,computedUrl:l}]:typeof window<"u"&&(k=(x=window.location)==null?void 0:x.origin)!=null&&k.startsWith("http")?$.servers=[{url:window.location.origin,computedUrl:window.location.origin}]:$.servers=[{url:"http://localhost",computedUrl:"http://localhost"}],V=$.servers,{specLoadError:!1,isSpecLoading:!1,info:$.info,infoDescriptionHeaders:N,tags:S,components:E,externalDocs:$.externalDocs,securitySchemes:R,servers:V}}function pd(n,e="",t="",a=""){const r={},s=a.split(",").map(l=>l.trim().toLowerCase()).filter(Boolean);function i(l,c){if(!e)return!0;const d=`${c} ${l}`.toLowerCase();return t==="regex"?new RegExp(e,"i").test(d):d.includes(e.toLowerCase())}function o(l){return l.some(c=>s.includes(c?.label.toLowerCase()))}return Object.entries(n.paths).forEach(([l,c])=>{const d={};Object.entries(c).forEach(([p,h])=>{const m=h["x-badges"];i(l,p)&&(m&&Array.isArray(m)&&o(m)||(d[p]=h))}),Object.keys(d).length>0&&(r[l]=d)}),n.paths=r,n}function Ia(n){return A.lexer(n).filter(e=>e.type==="heading"&&e.depth<=2)||[]}function ud(n,e=!1){if(!n.components)return[];const t=[];for(const a in n.components){const r=[];for(const l in n.components[a]){const c={show:!0,id:`${a.toLowerCase()}-${l.toLowerCase()}`.replace(tn,"-"),name:l,component:n.components[a][l]};r.push(c)}let s=a,i=a;switch(a){case"schemas":e&&r.sort((l,c)=>l.name.localeCompare(c.name)),i="Schemas",s="Schemas allows the definition of input and output data types. These types can be objects, but also primitives and arrays.";break;case"responses":i="Responses",s="Describes responses from an API Operation, including design-time, static links to operations based on the response.";break;case"parameters":i="Parameters",s="Describes operation parameters. A unique parameter is defined by a combination of a name and location.";break;case"examples":i="Examples",s="List of Examples for operations, can be requests, responses and objects examples.";break;case"requestBodies":i="Request Bodies",s="Describes common request bodies that are used across the API operations.";break;case"headers":i="Headers",s='Headers follows the structure of the Parameters but they are explicitly in "header"';break;case"securitySchemes":i="Security Schemes",s="Defines a security scheme that can be used by the operations. Supported schemes are HTTP authentication, an API key (either as a header, a cookie parameter or as a query parameter), OAuth2's common flows(implicit, password, client credentials and authorization code) as defined in RFC6749, and OpenID Connect Discovery.";break;case"links":i="Links",s="Links represent a possible design-time link for a response. The presence of a link does not guarantee the caller's ability to successfully invoke it, rather it provides a known relationship and traversal mechanism between responses and other operations.";break;case"callbacks":i="Callbacks",s="A map of possible out-of band callbacks related to the parent operation. Each value in the map is a Path Item Object that describes a set of requests that may be initiated by the API provider and the expected responses. The key value used to identify the path item object is an expression, evaluated at runtime, that identifies a URL to use for the callback operation.";break;default:i=a,s=a;break}const o={show:!0,name:i,description:s,subComponents:r};t.push(o)}return t||[]}function hd(n,e="none",t=!1,a=!1){const r=["get","put","post","delete","patch","head","options"],s=n.tags&&Array.isArray(n.tags)&&n.tags.length>0?n.tags.map(l=>({show:!0,elementId:`tag--${l.name.replace(tn,"-")}`,name:l.name,displayName:l["x-displayName"]||l.name,description:l.description||"",headers:l.description?Ia(l.description):[],paths:[],expanded:l["x-tag-expanded"]!==!1})):[],i=n.paths||{};if(n.webhooks)for(const[l,c]of Object.entries(n.webhooks))c._type="webhook",i[l]=c;for(const l in i){const c=i[l].parameters,d={servers:i[l].servers||[],parameters:i[l].parameters||[]},p=i[l]._type==="webhook";r.forEach(h=>{if(i[l][h]){const m=n.paths[l][h],y=m.tags||[];if(y.length===0)if(t){const g=l.replace(/^\/+|\/+$/g,""),f=g.indexOf("/");f===-1?y.push(g):y.push(g.substring(0,f))}else y.push("General \u2982");y.forEach(g=>{let f,b;n.tags&&(b=n.tags.find(x=>x.name.toLowerCase()===g.toLowerCase())),f=s.find(x=>x.name===g),f||(f={show:!0,elementId:`tag--${g.replace(tn,"-")}`,name:g,description:b?.description||"",headers:b!=null&&b.description?Ia(b.description):[],paths:[],expanded:b?b["x-tag-expanded"]!==!1:!0},s.push(f));let v=(m.summary||m.description||`${h.toUpperCase()} ${l}`).trim();v.length>100&&([v]=v.split(/[.|!|?]\s|[\r?\n]/));let w=[];if(c?m.parameters?w=c.filter(x=>{if(!m.parameters.some(k=>x.name===k.name&&x.in===k.in))return x}).concat(m.parameters):w=c.slice(0):w=m.parameters?m.parameters.slice(0):[],m.callbacks)for(const[x,k]of Object.entries(m.callbacks)){const $=Object.entries(k).filter(S=>typeof S[1]=="object")||[];m.callbacks[x]=Object.fromEntries($)}f.paths.push({show:!0,expanded:!1,isWebhook:p,expandedAtLeastOnce:!1,summary:m.summary||"",description:m.description||"",externalDocs:m.externalDocs,shortSummary:v,method:h,path:l,operationId:m.operationId,elementId:`${h}-${l.replace(tn,"-")}`,servers:m.servers?d.servers.concat(m.servers):d.servers,parameters:w,requestBody:m.requestBody,responses:m.responses,callbacks:m.callbacks,deprecated:m.deprecated,security:m.security,xBadges:m["x-badges"]||void 0,xCodeSamples:m["x-codeSamples"]||m["x-code-samples"]||""})})}})}const o=s.filter(l=>l.paths&&l.paths.length>0);return e!=="none"&&o.forEach(l=>{e==="method"?l.paths.sort((c,d)=>r.indexOf(c.method).toString().localeCompare(r.indexOf(d.method))):e==="summary"?l.paths.sort((c,d)=>c.shortSummary.localeCompare(d.shortSummary)):e==="path"&&l.paths.sort((c,d)=>c.path.localeCompare(d.path)),l.firstPathId=l.paths[0].elementId}),a?o.sort((l,c)=>l.name.localeCompare(c.name)):o}function md(n){if(!n||typeof n!="string")return"";try{let e=n.trim();e.startsWith("^")&&(e=e.slice(1)),e.endsWith("$")&&!e.endsWith("\\$")&&(e=e.slice(0,-1)),e=e.replace(/\((?:\?:)?([^()|]+)(?:\|[^()]+)*\)/g,"$1");const t=/(\[[^\]]+\]|\\[dwsDWS]|\\[^]|\.|[^\\[\]{}()+*?|])(?:\{(\d+)(?:,\d*)?\}|([+*?]))?/g;let a="",r;for(;(r=t.exec(e))!==null;){const s=r[1],i=r[2],o=r[3];let l=1;i!==void 0?l=parseInt(i,10):o==="+"?l=1:(o==="*"||o==="?")&&(l=0),l=Math.min(Math.max(0,l),50);let c="a";if(s==="\\d")c="0";else if(s==="\\D")c="a";else if(s==="\\w")c="a";else if(s==="\\W")c="_";else if(s==="\\s")c=" ";else if(s==="\\S")c="a";else if(s===".")c="a";else if(s.startsWith("\\"))c=s.slice(1);else if(s.startsWith("[")){const d=s.slice(1,-1);d.startsWith("^")?c=d.includes("a")?"0":"a":/[1-9]/.test(d)&&!d.includes("0")?c="1":/[0-9]/.test(d)&&!/[a-zA-Z]/.test(d)||/[0-9]/.test(d)&&/[a-fA-F]/.test(d)&&!/[g-zG-Z]/.test(d)?c="0":/[A-Z]/.test(d)&&!/[a-z]/.test(d)?c="A":/[a-z]/.test(d)?c="a":d.length>0&&(c=d[0])}else c=s;a+=c.repeat(l)}return a||n}catch{return n}}function je(n){if(n===void 0)return"";if(n===null)return"null";if(n==="")return"\u2205";if(typeof n=="boolean"||typeof n=="number")return`${n}`;if(Array.isArray(n))return n.map(e=>e===null?"null":e===""?"\u2205":e.toString().replace(/^ +| +$/g,t=>"\u25CF".repeat(t.length))||"").join(", ");if(typeof n=="object"){const e=Object.keys(n);return`{ ${e[0]}:${n[e[0]]}${e.length>1?",":""} ... }`}return n.toString().replace(/^ +| +$/g,e=>"\u25CF".repeat(e.length))||""}function ke(n){var e,t;if(!n)return;let a="",r="";if(n.$ref){const i=n.$ref.lastIndexOf("/");a=`{recursive: ${n.$ref.substring(i+1)}} `}else n.type?(a=Array.isArray(n.type)?n.type.join("\u2503"):n.type,(n.format||n.enum||n.const)&&(a=a.replace("string",n.enum?"enum":n.const?"const":n.format)),n.nullable&&(a+="\u2503null")):n.const?a="const":Object.keys(n).length===0?a="any":a="{missing-type-info}";const s={type:a,format:n.format||"",pattern:n.pattern&&!n.enum?n.pattern:"",readOrWriteOnly:n.readOnly?"\u{1F181}":n.writeOnly?"\u{1F186}":"",deprecated:n.deprecated?"\u274C":"",examples:n.examples||n.example,default:je(n.default),description:n.description||"",constrain:"",allowedValues:"",arrayType:"",html:""};if(s.type==="{recursive}"?s.description=n.$ref.substring(n.$ref.lastIndexOf("/")+1):(s.type==="{missing-type-info}"||s.type==="any")&&(s.description=s.description||""),s.allowedValues=n.const?n.const:Array.isArray(n.enum)?n.enum.map(i=>je(i)).join("\u2503"):"",a==="array"&&n.items){const i=(e=n.items)==null?void 0:e.type,o=je(n.items.default);s.arrayType=`${n.type} of ${Array.isArray(i)?i.join(""):i}`,s.default=o,s.allowedValues=n.items.const?n.const:Array.isArray((t=n.items)==null?void 0:t.enum)?n.items.enum.map(l=>je(l)).join("\u2503"):""}return a.match(/integer|number/g)&&((n.minimum!==void 0||n.exclusiveMinimum!==void 0)&&(r+=n.minimum!==void 0?`Min ${n.minimum}`:`More than ${n.exclusiveMinimum}`),(n.maximum!==void 0||n.exclusiveMaximum!==void 0)&&(r+=n.maximum!==void 0?`${r?"\u2503":""}Max ${n.maximum}`:`${r?"\u2503":""}Less than ${n.exclusiveMaximum}`),n.multipleOf!==void 0&&(r+=`${r?"\u2503":""} multiple of ${n.multipleOf}`)),a.match(/string/g)&&(n.minLength!==void 0&&n.maxLength!==void 0?r+=`${r?"\u2503":""}${n.minLength} to ${n.maxLength} chars`:n.minLength!==void 0?r+=`${r?"\u2503":""}Min ${n.minLength} chars`:n.maxLength!==void 0&&(r+=`Max ${r?"\u2503":""}${n.maxLength} chars`)),s.constrain=r,s.html=`${s.type}~|~${s.readOrWriteOnly}~|~${s.constrain}~|~${s.default}~|~${s.allowedValues}~|~${s.pattern}~|~${s.description}~|~${n.title||""}~|~${s.deprecated?"deprecated":""}`,s}function ie(n){if(typeof n=="object"&&!Array.isArray(n)){if(n.value!==void 0)return{Example:{...n}};const e=Object.entries(n).filter(([t,a])=>a.value!==void 0);return e.length===0?void 0:Object.fromEntries(e)}return Array.isArray(n)?n.reduce((e,t,a)=>(e[`Example${a+1}`]={value:t},e),{}):n?{Example:{value:n}}:void 0}function oi(n,e="string"){if(!n)return{exampleVal:"",exampleList:[]};if(n.constructor===Object){const r=Object.values(n).filter(s=>s["x-example-show-value"]!==!1).map(s=>({value:typeof s.value=="boolean"||typeof s.value=="number"?`${s.value}`:s.value||"",printableValue:je(s.value),summary:s.summary||"",description:s.description||""}));return{exampleVal:r.length>0?r[0].value:"",exampleList:r}}if(Array.isArray(n)||(n=n?[n]:[]),n.length===0)return{exampleVal:"",exampleList:[]};if(e==="array"){const[r]=n,s=n.map(i=>({value:i,printableValue:je(i)}));return{exampleVal:r,exampleList:s}}const t=n[0].toString(),a=n.map(r=>({value:r.toString(),printableValue:je(r)}));return{exampleVal:t,exampleList:a}}function fd(n){return n.some(e=>{var t,a;return((t=e.summary)==null?void 0:t.length)>0||((a=e.description)==null?void 0:a.length)>0})}function oe(n){let e;return n&&(n.examples&&n.examples.length>=1?e=n.examples[0]:e=n.example),e}function An(n){const e=oe(n);if(e==="")return"";if(e===null)return null;if(e===0)return 0;if(e===!1)return!1;if(e instanceof Date)switch(n.format.toLowerCase()){case"date":return e.toISOString().split("T")[0];case"time":return e.toISOString().split("T")[1];default:return e.toISOString()}if(e)return e;if(Object.keys(n).length===0)return null;if(n.$ref)return{};if(n.const===!1||n.const===0||n.const===null||n.const===""||n.const)return n.const;if(n.default)return n.default;const t=Array.isArray(n.type)?n.type[0]:n.type;if(!t)return null;if(t.match(/^integer|^number/g)){const a=Number.isNaN(Number(n.multipleOf))?void 0:Number(n.multipleOf),r=Number.isNaN(Number(n.maximum))?void 0:Number(n.maximum),s=Number.isNaN(Number(n.minimum))?Number.isNaN(Number(n.exclusiveMinimum))?r||0:Number(n.exclusiveMinimum)+(t.startsWith("integer")?1:.001):Number(n.minimum);return a?a>=s?a:s%a===0?s:Math.ceil(s/a)*a:s}if(t.match(/^boolean/g))return!1;if(t.match(/^null/g))return null;if(t.match(/^string/g)){if(n.enum)return n.enum[0];if(n.const)return n.const;if(n.pattern)try{return md(n.pattern)}catch{return n.pattern}if(n.format){const a=`${Date.now().toString(16)}${Math.random().toString(16)}0`.repeat(16);switch(n.format.toLowerCase()){case"url":case"uri":return"http://example.com";case"date":return new Date(0).toISOString().split("T")[0];case"time":return new Date(0).toISOString().split("T")[1];case"date-time":return new Date(0).toISOString();case"duration":return"P3Y6M4DT12H30M5S";case"email":case"idn-email":return"user@example.com";case"hostname":case"idn-hostname":return"www.example.com";case"ipv4":return"198.51.100.42";case"ipv6":return"2001:0db8:5b96:0000:0000:426f:8e17:642a";case"uuid":return[a.substring(0,8),a.substring(8,12),`4000-8${a.substring(13,16)}`,a.substring(16,28)].join("-");case"byte":return"ZXhhbXBsZQ==";default:return""}}else{const a=Number.isNaN(n.minLength)?void 0:Number(n.minLength),r=Number.isNaN(n.maxLength)?void 0:Number(n.maxLength),s=a||(r>6?6:r||void 0);return s?"A".repeat(s):"string"}}return null}function Dn(n,e=1){const t=" ".repeat(e);let a="";if(e===1&&typeof n!="object")return`
|
|
210
|
+
${t}${n.toString()}`;for(const r in n){const s=n[r]["::XML_TAG"]||r;let i="";Array.isArray(n[r])?i=s[0]["::XML_TAG"]||`${r}`:i=s,!r.startsWith("::")&&(Array.isArray(n[r])?a=`${a}
|
|
211
|
+
${t}<${i}>${Dn(n[r],e+1)}
|
|
212
|
+
${t}</${i}>`:typeof n[r]=="object"?a=`${a}
|
|
213
|
+
${t}<${i}>${Dn(n[r],e+1)}
|
|
214
|
+
${t}</${i}>`:a=`${a}
|
|
215
|
+
${t}<${i}>${n[r].toString()}</${i}>`)}return a}function Cn(n,e){var t,a,r,s;typeof e!="object"||e===null||(n.title&&(e["::TITLE"]=n.title),n.description&&(e["::DESCRIPTION"]=n.description),(t=n.xml)!=null&&t.name&&(e["::XML_TAG"]=(a=n.xml)==null?void 0:a.name),(r=n.xml)!=null&&r.wrapped&&(e["::XML_WRAP"]=(s=n.xml)==null?void 0:s.wrapped.toString()))}function li(n){if(!(typeof n!="object"||n===null)){delete n["::TITLE"],delete n["::DESCRIPTION"],delete n["::XML_TAG"],delete n["::XML_WRAP"];for(const e in n)li(n[e])}}function ci(n,e,t){for(const a in e)e[a][t]=n}function qe(n,e,t){let a=0;const r=10,s={};for(const i in n){for(const o in t)if(s[`example-${a}`]={...n[i]},s[`example-${a}`][e]=t[o],a++,a>=r)break;if(a>=r)break}return s}function le(n,e={},t=0){var a,r,s,i,o,l,c,d,p,h,m;let y={};if(!(!n||t>8)){if(n.allOf){const g={};if(n.allOf.length===1&&!((a=n.allOf[0])!=null&&a.properties)&&!((r=n.allOf[0])!=null&&r.items)){if(n.allOf[0].$ref)return"{ }";if(n.allOf[0].readOnly&&e.includeReadOnly){const f=n.allOf[0];return An(f)}return}n.allOf.forEach(f=>{if(f.type==="object"||f.properties||f.allOf||f.anyOf||f.oneOf){const b=le(f,e,t+1);Object.assign(g,b)}else if(f.type==="array"||f.items){const b=[le(f,e,t+1)];Object.assign(g,b)}else if(f.type){const b=`prop${Object.keys(g).length}`;g[b]=An(f)}else return""}),y=g}else if(n.oneOf){const g={};if(n.properties)for(const f in n.properties)n.properties[f].properties||(s=n.properties[f].properties)!=null&&s.items?g[f]=le(n.properties[f],e,t+1):g[f]=An(n.properties[f]);if(n.oneOf.length>0){let f=0;for(const b in n.oneOf){const v=le(n.oneOf[b],e,t+1);for(const w in v){let x;if(Object.keys(g).length>0){if(v[w]===null||typeof v[w]!="object")continue;x=Object.assign(v[w],g)}else x=v[w];y[`example-${f}`]=x,Cn(n.oneOf[b],y[`example-${f}`]),f++}}}}else if(n.anyOf){let g;if(n.type==="object"||n.properties){g={"example-0":{}};for(const b in n.properties){if(oe(n)){g=n;break}n.properties[b].deprecated&&!e.includeDeprecated||n.properties[b].readOnly&&!e.includeReadOnly||n.properties[b].writeOnly&&!e.includeWriteOnly||(g=qe(g,b,le(n.properties[b],e,t+1)))}}let f=0;for(const b in n.anyOf){const v=le(n.anyOf[b],e,t+1);for(const w in v){if(typeof g<"u")for(const x in g)y[`example-${f}`]={...g[x],...v[w]};else y[`example-${f}`]=v[w];Cn(n.anyOf[b],y[`example-${f}`]),f++}}}else if(n.type==="object"||n.properties){y["example-0"]={},Cn(n,y["example-0"]);const g=oe(n);if(g)y["example-0"]=g;else{for(const f in n.properties)if(!((i=n.properties[f])!=null&&i.deprecated&&!e.includeDeprecated)&&!((o=n.properties[f])!=null&&o.readOnly&&!e.includeReadOnly)&&!((l=n.properties[f])!=null&&l.writeOnly&&!e.includeWriteOnly)){if(((c=n.properties[f])==null?void 0:c.type)==="array"||(d=n.properties[f])!=null&&d.items){const b=oe(n.properties[f]);if(b)ci(b,y,f);else if(oe((p=n.properties[f])==null?void 0:p.items))ci([oe(n.properties[f].items)],y,f);else{const v=le(n.properties[f].items,e,t+1);if(e.useXmlTagForProp){const w=((h=n.properties[f].xml)==null?void 0:h.name)||f;if((m=n.properties[f].xml)!=null&&m.wrapped){const x=JSON.parse(`{ "${w}" : { "${w}" : ${JSON.stringify(v["example-0"])} } }`);y=qe(y,w,x)}else y=qe(y,w,v)}else{const w=[];for(const x in v)w[x]=[v[x]];y=qe(y,f,w)}}continue}y=qe(y,f,le(n.properties[f],e,t+1))}if(typeof n.additionalProperties=="object"){const f=n.additionalProperties["x-additionalPropertiesName"]||"property";y=qe(y,`${f}1`,le(n.additionalProperties,e,t+1)),y=qe(y,`${f}2`,le(n.additionalProperties,e,t+1))}}}else if(n.type==="array"||n.items)if(n.items||oe(n))if(oe(n))y["example-0"]=oe(n);else if(oe(n.items))y["example-0"]=[oe(n.items)];else{const g=le(n.items,e,t+1);let f=0;for(const b in g)y[`example-${f}`]=[g[b]],Cn(n.items,y[`example-${f}`]),f++}else y["example-0"]=[];else return{"example-0":An(n)};return y}}function di(n,e=0){var t;let a=(n.description||n.title)&&(n.minItems||n.maxItems)?'<span class="descr-expand-toggle">\u2794</span>':"";if(n.title?n.description?a=`${a} <b>${n.title}:</b> ${n.description}<br/>`:a=`${a} ${n.title}<br/>`:n.description&&(a=`${a} ${n.description}<br/>`),n.minItems&&(a=`${a} <b>Min Items:</b> ${n.minItems}`),n.maxItems&&(a=`${a} <b>Max Items:</b> ${n.maxItems}`),n.uniqueItems===!0&&(a=`${a} <b>Must have unique items</b>`),e>0&&(t=n.items)!=null&&t.description){let r="";n.items.minProperties&&(r=`<b>Min Properties:</b> ${n.items.minProperties}`),n.items.maxProperties&&(r=`${r} <b>Max Properties:</b> ${n.items.maxProperties}`),a=`${a} \u2B95 ${r} [ ${n.items.description} ] `}return a}function K(n,e,t=0,a=""){var r;if(n){if(t>8)return{"::type":n.type||"object","::description":n.description||""};if(n.allOf){const s={};if(n.allOf.length===1&&!n.allOf[0].properties&&!n.allOf[0].items){const i=n.allOf[0];return`${ke(i).html}`}n.allOf.map((i,o)=>{if(i.type==="object"||i.properties||i.allOf||i.anyOf||i.oneOf){const l=(i.anyOf||i.oneOf)&&o>0?o:"",c=K(i,{},t+1,l);Object.assign(s,c)}else if(i.type==="array"||i.items){const l=K(i,{},t+1);Object.assign(s,l)}else if(i.type){const l=`prop${Object.keys(s).length}`,c=ke(i);s[l]=`${c.html}`}else return""}),e=s}else if(n.anyOf||n.oneOf){if(e["::description"]=n.description||"",n.type==="object"||n.properties){e["::description"]=n.description||"",e["::type"]="object";for(const o in n.properties)n.required&&n.required.includes(o)?e[`${o}*`]=K(n.properties[o],{},t+1):e[o]=K(n.properties[o],{},t+1)}const s={},i=n.anyOf?"anyOf":"oneOf";n[i].forEach((o,l)=>{if(o.type==="object"||o.properties||o.allOf||o.anyOf||o.oneOf){const c=K(o,{},t+1);s[`::OPTION~${l+1}${o.title?`~${o.title}`:""}`]=c,s[`::OPTION~${l+1}${o.title?`~${o.title}`:""}`]["::readwrite"]="",s["::type"]="xxx-of-option"}else if(o.type==="array"||o.items){const c=K(o,{},t+1);s[`::OPTION~${l+1}${o.title?`~${o.title}`:""}`]=c,s[`::OPTION~${l+1}${o.title?`~${o.title}`:""}`]["::readwrite"]="",s["::type"]="xxx-of-array"}else{const c=`::OPTION~${l+1}${o.title?`~${o.title}`:""}`;s[c]=`${ke(o).html}`,s["::type"]="xxx-of-option"}}),e[n.anyOf?`::ANY~OF ${a}`:`::ONE~OF ${a}`]=s,e["::type"]="object"}else if(Array.isArray(n.type)){const s=JSON.parse(JSON.stringify(n)),i=[],o=[];s.type.forEach(c=>{var d,p;c.match(/integer|number|string|null|boolean/g)?i.push(c):c==="array"&&typeof((d=s.items)==null?void 0:d.type)=="string"&&(p=s.items)!=null&&p.type.match(/integer|number|string|null|boolean/g)?s.items.type==="string"&&s.items.format?i.push(`[${s.items.format}]`):i.push(`[${s.items.type}]`):o.push(c)});let l;if(i.length>0&&(s.type=i.join("\u2503"),l=ke(s),o.length===0))return`${l?.html||""}`;if(o.length>0){e["::type"]="object";const c={"::type":"xxx-of-option"};o.forEach((d,p)=>{if(d==="null")c[`::OPTION~${p+1}`]="NULL~|~~|~~|~~|~~|~~|~~|~~|~";else if("integer, number, string, boolean,".includes(`${d},`)){s.type=Array.isArray(d)?d.join("\u2503"):d;const h=ke(s);c[`::OPTION~${p+1}`]=h.html}else if(d==="object"){const h={"::title":n.title||"","::description":n.description||"","::type":"object","::deprecated":n.deprecated||!1};for(const m in n.properties)n.required&&n.required.includes(m)?h[`${m}*`]=K(n.properties[m],{},t+1):h[m]=K(n.properties[m],{},t+1);c[`::OPTION~${p+1}`]=h}else d==="array"&&(c[`::OPTION~${p+1}`]={"::title":n.title||"","::description":n.description||"","::type":"array","::props":K(n.items,{},t+1)})}),c[`::OPTION~${o.length+1}`]=l?.html||"",e["::ONE~OF"]=c}}else if(n.type==="object"||n.properties){e["::title"]=n.title||"",e["::description"]=di(n,t),e["::type"]="object",(Array.isArray(n.type)&&n.type.includes("null")||n.nullable)&&(e["::dataTypeLabel"]="object \u2503 null",e["::nullable"]=!0),e["::deprecated"]=n.deprecated||!1,e["::readwrite"]=n.readOnly?"readonly":n.writeOnly?"writeonly":"";for(const s in n.properties)n.required&&n.required.includes(s)?e[`${s}*`]=K(n.properties[s],{},t+1):e[s]=K(n.properties[s],{},t+1);for(const s in n.patternProperties)e[`[pattern: ${s}]`]=K(n.patternProperties[s],{},t+1);n.additionalProperties&&(e["[any-key]"]=K(n.additionalProperties,{},t+1))}else if(n.type==="array"||n.items)e["::title"]=n.title||"",e["::description"]=di(n,t),e["::type"]="array",(Array.isArray(n.type)&&n.type.includes("null")||n.nullable)&&(e["::dataTypeLabel"]="array \u2503 null",e["::nullable"]=!0),e["::deprecated"]=n.deprecated||!1,e["::readwrite"]=n.readOnly?"readonly":n.writeOnly?"writeonly":"",(r=n.items)!=null&&r.items&&(e["::array-type"]=n.items.items.type),e["::props"]=K(n.items,{},t+1);else{const s=ke(n);return s!=null&&s.html?`${s.html}`:""}return e}}function ja(n,e="",t="json"){let a=n,r="text";if(e!=null&&e.toLowerCase().includes("json"))if(t==="text")a=typeof n=="string"?n:JSON.stringify(n,void 0,2),r="text";else if(typeof n=="object"&&n!==null)a=n,r="json";else if(typeof n=="string")try{a=JSON.parse(n),r="json"}catch{a=n,r="text"}else a=n,r="json";else a=typeof n=="object"&&n!==null?JSON.stringify(n,void 0,2):String(n??""),r="text";return{content:a,format:r}}function it(n,e="",t=null,a=null,r=!0,s=!0,i="json",o=!1){var l,c,d,p,h;const m=[],y=e?.toLowerCase().includes("json"),g=e?.toLowerCase().includes("xml");if(t&&typeof t=="object"&&Object.keys(t).length>0)for(const f in t){const b=((l=t[f])==null?void 0:l.value)!==void 0?t[f].value:t[f],{content:v,format:w}=ja(b,e,i);m.push({exampleId:f,exampleSummary:((c=t[f])==null?void 0:c.summary)||f,exampleDescription:((d=t[f])==null?void 0:d.description)||"",exampleType:e,exampleValue:v,exampleFormat:w})}else if(a!=null&&(typeof a!="object"||Object.keys(a).length>0)){const f=a?.value!==void 0?a.value:a,{content:b,format:v}=ja(f,e,i);m.push({exampleId:"Example",exampleSummary:a?.summary||"",exampleDescription:a?.description||"",exampleType:e,exampleValue:b,exampleFormat:v})}if(m.length===0||o===!0)if(n){const f=oe(n);if(f!=null){const{content:b,format:v}=ja(f,e,i);m.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:e,exampleValue:b,exampleFormat:v})}else if(y||g||e!=null&&e.toLowerCase().includes("text")||e!=null&&e.toLowerCase().includes("yaml")||e!=null&&e.toLowerCase().includes("*/*")){let b="",v="",w=i;g&&(b=(p=n.xml)!=null&&p.name?`<${n.xml.name}${n.xml.namespace?` xmlns="${n.xml.namespace}"`:""}>`:"<root>",v=(h=n.xml)!=null&&h.name?`</${n.xml.name}>`:"</root>",w="text");const x=le(n,{includeReadOnly:r,includeWriteOnly:s,useXmlTagForProp:g});let k=0;for(const $ in x){if(!x[$])continue;const S=x[$]["::TITLE"]||`Example ${++k}`,E=x[$]["::DESCRIPTION"]||"";let N="";g?N=`<?xml version="1.0" encoding="UTF-8"?>
|
|
216
|
+
${b}${Dn(x[$],1)}
|
|
217
|
+
${v}`:(li(x[$]),N=i==="text"?JSON.stringify(x[$],null,2):x[$]),m.push({exampleId:$,exampleSummary:S,exampleDescription:E,exampleType:e,exampleFormat:w,exampleValue:N})}}else e!=null&&e.toLowerCase().includes("jose")?m.push({exampleId:"Example",exampleSummary:"Base64 Encoded",exampleDescription:"",exampleType:e,exampleValue:n.pattern||"bXJpbg==",exampleFormat:"text"}):m.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:e,exampleValue:"",exampleFormat:"text"})}else m.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:e,exampleValue:"",exampleFormat:"text"});return m}function gd(n){return n==="application/json"?"json":n==="application/xml"?"xml":null}function yd(n){if(n.schema)return[n.schema,null,null];if(n.content){for(const e of Object.keys(n.content))if(n.content[e].schema)return[n.content[e].schema,gd(e),n.content[e]]}return[null,null,null]}const qa={200:"OK",201:"Created",202:"Accepted",204:"No Content",301:"Moved Permanently",302:"Found",304:"Not Modified",400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",409:"Conflict",422:"Unprocessable Entity",429:"Too Many Requests",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"};let Rt=!1,ze=null,ot=null,It=null,Fn=null,Tn=[],G={statusCode:"",statusStrategy:"first",delay:0,log:"true"};const On=new Map;function pi(n=[]){const e=new Set;return e.add(""),n.forEach(t=>{const a=t.computedUrl||t.url||"";if(a)try{if(a.startsWith("http://")||a.startsWith("https://")){const r=new URL(a).pathname.replace(/\/+$/,"");r&&e.add(r)}else{const r=a.replace(/\/+$/,"");r&&e.add(r.startsWith("/")?r:`/${r}`)}}catch{}}),Array.from(e)}function bd(n,e=""){const t=((e.endsWith("/")?e.slice(0,-1):e)+(n.startsWith("/")?n:`/${n}`)).replace(/\{([a-zA-Z0-9_-]+)\}/g,"__PARAM_$1__").replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&").replace(/__PARAM_([a-zA-Z0-9_-]+)__/g,"(?<$1>[^/?#]+)");return new RegExp(`^${t}(?:\\/)?$`)}function vd(n){const e=[],t=pi(n?.servers);if(!(n!=null&&n.tags)||!Array.isArray(n.tags))return e;const a=new Set;return n.tags.forEach(r=>{(r.paths||[]).forEach(s=>{var i;const o=(s.method||"GET").toUpperCase(),l=s.path||"",c=`${o} ${l}`;if(a.has(c))return;a.add(c);const d=(((i=s.servers)==null?void 0:i.length)>0?pi(s.servers):t).map(p=>bd(l,p));e.push({method:o,pathTemplate:l,routeKey:c,patterns:d,responses:s.responses||{},parameters:s.parameters||[]})})}),e}function ui(n,e){var t;if(!Tn.length||!e)return null;let a;try{const i=typeof window<"u"&&(t=window.location)!=null&&t.href?window.location.href:"http://localhost";a=new URL(e,i)}catch{return null}const r=(n||"GET").toUpperCase(),s=decodeURI(a.pathname);for(const i of Tn)if(i.method===r)for(const o of i.patterns){const l=s.match(o);if(l)return{route:i,pathParams:l.groups||{},url:a}}return null}function hi(n,e,t,a={}){const r=(n||"").split(",").map(s=>s.trim()).filter(Boolean);if(r.length===0)return Object.keys(a).find(i=>i.startsWith("2"))||("default"in a?"default":Object.keys(a)[0]||"200");if(e==="random")return r[Math.floor(Math.random()*r.length)];if(e==="cycle"){const s=On.get(t)||0,i=r[s%r.length];return On.set(t,(s+1)%r.length),i}return r[0]}function mi(n,e){var t,a,r,s;const i=((t=n.responses)==null?void 0:t[e])||((a=n.responses)==null?void 0:a[String(e)])||((r=n.responses)==null?void 0:r.default),o={"X-Mock-Server":"RapiDoc","Access-Control-Allow-Origin":"*"};let l="",c="application/json";if(i!=null&&i.content){const d=Object.keys(i.content);c=d.find(h=>h.includes("json"))||d.find(h=>h.includes("xml"))||d.find(h=>h.includes("text"))||d[0]||"application/json";const p=i.content[c];if(p){if(p.example!==void 0)l=typeof p.example=="object"?JSON.stringify(p.example,null,2):String(p.example);else if(p.examples&&Object.keys(p.examples).length>0){const h=(s=Object.values(p.examples)[0])==null?void 0:s.value;h!==void 0&&(l=typeof h=="object"?JSON.stringify(h,null,2):String(h))}if(!l&&p.schema){const h=it(p.schema,c,null,null,!0,!1,"text",!0);if(h&&h.length>0){const m=h[0].exampleValue;l=typeof m=="object"?JSON.stringify(m,null,2):String(m)}}}}if(!l)if(String(e)==="204")l="";else if(c.includes("json")){const d=Number(e)||200;l=JSON.stringify({status:d,message:qa[d]||"Mock Response"},null,2)}else l=qa[Number(e)]||"OK";return i!=null&&i.headers&&Object.entries(i.headers).forEach(([d,p])=>{var h;((h=p.schema)==null?void 0:h.default)!==void 0?o[d]=String(p.schema.default):p.example!==void 0&&(o[d]=String(p.example))}),String(e)!=="204"&&(o["Content-Type"]=c),{statusCode:Number(e)||200,statusText:qa[Number(e)]||(e==="default"?"OK":"Mock Response"),headers:o,body:l}}function Nn(n,e={}){G={statusCode:e.statusCode||"",statusStrategy:e.statusStrategy||"first",delay:Number(e.delay)||0,log:e.log!=="false"},Tn=vd(n),On.clear(),!Rt&&(typeof window>"u"||(!ze&&window.fetch&&(ze=window.fetch,window.fetch=async function(t,a={}){if(!Rt)return ze.apply(this,arguments);let r="",s="GET";typeof t=="string"?(r=t,s=a?.method||"GET"):t instanceof URL?(r=t.href,s=a?.method||"GET"):t&&typeof t=="object"&&"url"in t&&(r=t.url,s=a?.method||t.method||"GET");const i=ui(s,r);if(!i)return ze.apply(this,arguments);const o=hi(G.statusCode,G.statusStrategy,i.route.routeKey,i.route.responses),l=mi(i.route,o);return G.delay>0&&await new Promise(c=>setTimeout(c,G.delay)),G.log,new Response(l.body,{status:l.statusCode,statusText:l.statusText,headers:l.headers})}),!ot&&window.XMLHttpRequest&&(ot=window.XMLHttpRequest.prototype.open,It=window.XMLHttpRequest.prototype.send,Fn=window.XMLHttpRequest.prototype.setRequestHeader,window.XMLHttpRequest.prototype.open=function(t,a,...r){return this._mockMethod=t,this._mockUrl=a,this._mockHeaders={},ot.apply(this,[t,a,...r])},window.XMLHttpRequest.prototype.setRequestHeader=function(t,a){return this._mockHeaders&&(this._mockHeaders[t]=a),Fn.apply(this,arguments)},window.XMLHttpRequest.prototype.send=function(){if(!Rt)return It.apply(this,arguments);const t=ui(this._mockMethod,this._mockUrl);if(!t)return It.apply(this,arguments);const a=hi(G.statusCode,G.statusStrategy,t.route.routeKey,t.route.responses),r=mi(t.route,a),s=G.delay>0?G.delay:10;setTimeout(()=>{G.log,Object.defineProperty(this,"readyState",{value:4,writable:!0}),Object.defineProperty(this,"status",{value:r.statusCode,writable:!0}),Object.defineProperty(this,"statusText",{value:r.statusText,writable:!0}),Object.defineProperty(this,"responseText",{value:r.body,writable:!0}),Object.defineProperty(this,"response",{value:r.body,writable:!0});const i=Object.entries(r.headers).map(([o,l])=>`${o}: ${l}\r
|
|
218
|
+
`).join("");this.getAllResponseHeaders=()=>i,this.getResponseHeader=o=>{const l=o.toLowerCase(),c=Object.keys(r.headers).find(d=>d.toLowerCase()===l);return c?r.headers[c]:null},this.dispatchEvent(new Event("readystatechange")),this.dispatchEvent(new Event("load")),this.dispatchEvent(new Event("loadend")),typeof this.onreadystatechange=="function"&&this.onreadystatechange(),typeof this.onload=="function"&&this.onload()},s)}),Rt=!0))}function Bn(){Rt=!1,Tn=[],On.clear(),typeof window<"u"&&(ze&&(window.fetch=ze,ze=null),ot&&(window.XMLHttpRequest.prototype.open=ot,window.XMLHttpRequest.prototype.send=It,window.XMLHttpRequest.prototype.setRequestHeader=Fn,ot=null,It=null,Fn=null))}function fi(n={}){n.statusCode!==void 0&&(G.statusCode=n.statusCode),n.statusStrategy!==void 0&&(G.statusStrategy=n.statusStrategy),n.delay!==void 0&&(G.delay=Number(n.delay)||0),n.log!==void 0&&(G.log=n.log!=="false")}/**
|
|
210
219
|
* @license
|
|
211
220
|
* Copyright 2017 Google LLC
|
|
212
221
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
213
|
-
*/const
|
|
222
|
+
*/const Pe={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4},za=n=>(...e)=>({_$litDirective$:n,values:e});class Pa{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,a){this.t=e,this._$AM=t,this.i=a}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/**
|
|
214
223
|
* @license
|
|
215
224
|
* Copyright 2017 Google LLC
|
|
216
225
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
217
|
-
*/class Ta extends Fa{constructor(e){if(super(e),this.it=P,e.type!==Re.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===P||e==null)return this._t=void 0,this.it=e;if(e===Y)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Ta.directiveName="unsafeHTML",Ta.resultType=1;const I=Ca(Ta);function z(n){if(typeof n!="string")return"";if(typeof window<"u"&&window.Sanitizer&&Element.prototype.setHTML)try{const r=document.createElement("div"),s=new window.Sanitizer({allowAttributes:{"*":["*"]}});return r.setHTML(n,{sanitizer:s}),r.innerHTML}catch{}let e;if(typeof DOMParser<"u")e=new DOMParser().parseFromString(n,"text/html");else return n;const t=e.querySelectorAll("script");for(let r=t.length-1;r>=0;r--)t[r].parentNode.removeChild(t[r]);const a=e.querySelectorAll("*");for(let r=0;r<a.length;r++){const s=a[r];for(let i=s.attributes.length-1;i>=0;i--){const o=s.attributes[i],l=o.name.toLowerCase(),c=o.value.toLowerCase();(l.startsWith("on")||(l==="href"||l==="src")&&(c.includes("javascript:")||c.includes("data:text/html")))&&s.removeAttribute(o.name)}}return e.body.innerHTML}const Xc="731DB1C3F7EA533B85E29492D26AA-1234567890-1234567890",Yc="4FatVDBJKPAo4JgLLaaQFMUcQPn5CrPRvLlaob9PTYc",Js="rapidoc";function Gs(n){try{const e=new TextEncoder().encode(n);let t="";for(let a=0;a<e.byteLength;a++)t+=String.fromCharCode(e[a]);return btoa(t)}catch{return btoa(n)}}function je(n,e="",t="",a=""){var r,s,i;const o=(r=this.resolvedSpec.securitySchemes)==null?void 0:r.find(c=>c.securitySchemeId===n);if(!o)return!1;let l="";return((s=o.scheme)==null?void 0:s.toLowerCase())==="basic"?e&&(l=`Basic ${Gs(`${e}:${t}`)}`):a&&(o.value=a,l=`${((i=o.scheme)==null?void 0:i.toLowerCase())==="bearer"?"Bearer ":""}${a}`),l?(o.finalKeyValue=l,this.requestUpdate(),!0):!1}function Oa(){var n;(n=this.resolvedSpec.securitySchemes)==null||n.forEach(e=>{e.user="",e.password="",e.value="",e.finalKeyValue=""}),this.requestUpdate()}function Na(){return JSON.parse(localStorage.getItem(Js))||{}}function Xs(n){localStorage.setItem(Js,JSON.stringify(n))}function Qc(){const n=Na.call(this);Object.values(n).forEach(e=>{je.call(this,e.securitySchemeId,e.username,e.password,e.value)})}function Ba(n){let e="";const t=this.resolvedSpec.securitySchemes.find(a=>a.securitySchemeId===n);if(t){const a=this.shadowRoot.getElementById(`security-scheme-${n}`);if(a){if(t.type&&t.scheme&&t.type==="http"&&t.scheme.toLowerCase()==="basic"){const r=a.querySelector(".api-key-user").value.trim(),s=a.querySelector(".api-key-password").value.trim();je.call(this,n,r,s)}else e=a.querySelector(".api-key-input").value.trim(),je.call(this,n,"","",e);if(this.persistAuth==="true"){const r=Na.call(this);r[n]=t,Xs.call(this,r)}}}}function Ys(n,e,t="Bearer"){const a=this.resolvedSpec.securitySchemes.find(r=>r.securitySchemeId===n);a.finalKeyValue=`${t.toLowerCase()==="bearer"?"Bearer":t.toLowerCase()==="mac"?"MAC":t} ${e}`,this.requestUpdate()}async function La(n,e,t,a,r,s,i,o,l="header",c=null,d=null,p=null){const h=o?o.querySelector(".oauth-resp-display"):void 0,m=new URLSearchParams,b=new Headers;m.append("grant_type",r),r==="authorization_code"&&(m.append("client_id",e),m.append("client_secret",t)),r!=="client_credentials"&&r!=="password"&&m.append("redirect_uri",a),s&&(m.append("code",s),m.append("code_verifier",Xc)),l==="header"?b.set("Authorization",`Basic ${Gs(`${e}:${t}`)}`):r!=="authorization_code"&&(m.append("client_id",e),m.append("client_secret",t)),r==="password"&&(m.append("username",d),m.append("password",p)),c&&m.append("scope",c);try{const g=await fetch(n,{method:"POST",headers:b,body:m}),f=await g.json();if(g.ok){if(f.token_type&&f.access_token)return Ys.call(this,i,f.access_token,f.token_type),h&&(h.innerHTML='<span style="color:var(--green)">Access Token Received</span>'),!0}else return h&&(h.innerHTML=`<span style="color:var(--red)">${f.error_description||f.error_description||"Unable to get access token"}</span>`),!1}catch{return h&&(h.innerHTML='<span style="color:var(--red)">Failed to get access token</span>'),!1}}async function ed(n,e,t,a,r,s,i,o,l,c){sessionStorage.removeItem("winMessageEventActive"),e.close(),!n.data.fake&&(n.data,n.data.error,n.data&&(n.data.responseType==="code"?La.call(this,t,a,r,s,i,n.data.code,l,c,o):n.data.responseType==="token"&&Ys.call(this,l,n.data.access_token,n.data.token_type)))}async function td(n,e,t,a,r){const s=r.target.closest(".oauth-flow"),i=s.querySelector(".oauth-client-id")?s.querySelector(".oauth-client-id").value.trim():"",o=s.querySelector(".oauth-client-secret")?s.querySelector(".oauth-client-secret").value.trim():"",l=s.querySelector(".api-key-user")?s.querySelector(".api-key-user").value.trim():"",c=s.querySelector(".api-key-password")?s.querySelector(".api-key-password").value.trim():"",d=s.querySelector(".oauth-send-client-secret-in")?s.querySelector(".oauth-send-client-secret-in").value.trim():"header",p=[...s.querySelectorAll(".scope-checkbox:checked")],h=s.querySelector(`#${n}-pkce`),m=`${Math.random().toString(36).slice(2,9)}random${Math.random().toString(36).slice(2,9)}`,b=`${Math.random().toString(36).slice(2,9)}random${Math.random().toString(36).slice(2,9)}`,g=new URL(`${window.location.origin}${window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))}/${this.oauthReceiver}`);let f="",y="",v;if([...s.parentNode.querySelectorAll(".oauth-resp-display")].forEach(x=>{x.innerHTML=""}),e==="authorizationCode"||e==="implicit"){const x=new URL(t);e==="authorizationCode"?(f="authorization_code",y="code"):e==="implicit"&&(y="token");const w=new URLSearchParams(x.search),k=p.map($=>$.value).join(" ");k&&w.set("scope",k),w.set("client_id",i),w.set("redirect_uri",g.toString()),w.set("response_type",y),w.set("state",m),w.set("nonce",b),h&&h.checked&&(w.set("code_challenge",Yc),w.set("code_challenge_method","S256")),w.set("show_dialog",!0),x.search=w.toString(),sessionStorage.getItem("winMessageEventActive")==="true"&&window.postMessage({fake:!0},this),setTimeout(()=>{v=window.open(x.toString()),v&&(sessionStorage.setItem("winMessageEventActive","true"),window.addEventListener("message",$=>ed.call(this,$,v,a,i,o,g.toString(),f,d,n,s),{once:!0}))},10)}else if(e==="clientCredentials"){f="client_credentials";const x=p.map(w=>w.value).join(" ");La.call(this,a,i,o,g.toString(),f,"",n,s,d,x)}else if(e==="password"){f="password";const x=p.map(w=>w.value).join(" ");La.call(this,a,i,o,g.toString(),f,"",n,s,d,x,l,c)}}function nd(n,e,t,a,r,s=[],i="header",o=void 0,l="true"){var c,d,p,h,m,b,g;let{authorizationUrl:f,tokenUrl:y,refreshUrl:v}=r;const x=r["x-pkce-only"]||!1,w=S=>S.indexOf("://")>0||S.indexOf("//")===0,k=new URL((c=this.selectedServer)==null?void 0:c.computedUrl).origin;v&&!w(v)&&((d=this.selectedServer)!=null&&d.computedUrl.trim().endsWith("/")&&!v.trim().startsWith("/")?v=`${(p=this.selectedServer)==null?void 0:p.computedUrl.trim()}${y.trim()}`:v=`${k}/${v.replace(/^\//,"")}`),y&&!w(y)&&((h=this.selectedServer)!=null&&h.computedUrl.trim().endsWith("/")&&!y.trim().startsWith("/")?y=`${(m=this.selectedServer)==null?void 0:m.computedUrl.trim()}${y.trim()}`:y=`${k}/${y.replace(/^\//,"")}`),f&&!w(f)&&((b=this.selectedServer)!=null&&b.computedUrl.trim().endsWith("/")&&!f.trim().startsWith("/")?f=`${(g=this.selectedServer)==null?void 0:g.computedUrl.trim()}${f.trim()}`:f=`${k}/${f.replace(/^\//,"")}`);let $;return n==="authorizationCode"?$="Authorization Code Flow":n==="clientCredentials"?$="Client Credentials Flow":n==="implicit"?$="Implicit Flow":n==="password"?$="Password Flow":$=n,u`<div class="oauth-flow ${n}" style="padding:12px 0;margin-bottom:12px"><div class="tiny-title upper" style="margin-bottom:8px">${$}</div>${f?u`<div style="margin-bottom:5px"><span style="width:75px;display:inline-block">Auth URL</span> <span class="mono-font">${f}</span></div>`:""} ${y?u`<div style="margin-bottom:5px"><span style="width:75px;display:inline-block">Token URL</span> <span class="mono-font">${y}</span></div>`:""} ${v?u`<div style="margin-bottom:5px"><span style="width:75px;display:inline-block">Refresh URL</span> <span class="mono-font">${v}</span></div>`:""} ${n==="authorizationCode"||n==="clientCredentials"||n==="implicit"||n==="password"?u`${r.scopes?u`<span>Scopes</span><div class="oauth-scopes" part="section-auth-scopes" style="width:100%;display:flex;flex-direction:column;flex-wrap:wrap;margin:0 0 10px 24px">${Object.entries(r.scopes).map((S,E)=>u`<div class="m-checkbox" style="display:inline-flex;align-items:center"><input type="checkbox" part="checkbox checkbox-auth-scope" class="scope-checkbox" id="${a}${n}${E}" ?checked="${s.includes(S[0])}" value="${S[0]}"> <label for="${a}${n}${E}" style="margin-left:5px;cursor:pointer"><span class="mono-font">${S[0]}</span> ${S[0]!==S[1]?` - ${S[1]||""}`:""}</label></div>`)}</div>`:""} ${n==="password"&&l==="true"?u`<div style="margin:5px 0"><input type="text" placeholder="username" spellcheck="false" class="oauth2 ${n} ${a} api-key-user" part="textbox textbox-username" id="input-${a}-${n}-api-key-user"> <input type="password" placeholder="password" spellcheck="false" class="oauth2 ${n} ${a} api-key-password" style="margin:0 5px" part="textbox textbox-password" id="input-${a}-${n}-api-key-password"></div>`:""} ${l==="true"?u`<div>${n==="authorizationCode"?u`<div style="margin:16px 0 4px"><input type="checkbox" part="checkbox checkbox-auth-scope" id="${a}-pkce" checked="checked" ?disabled="${x}"> <label for="${a}-pkce" style="margin:0 16px 0 4px;line-height:24px;cursor:pointer">Send Proof Key for Code Exchange (PKCE)</label></div>`:""} <input type="text" part="textbox textbox-auth-client-id" value="${e||""}" placeholder="client-id" spellcheck="false" class="oauth2 ${n} ${a} oauth-client-id"> ${n==="authorizationCode"||n==="clientCredentials"||n==="password"?u`<input id="${a}-${n}-oauth-client-secret" type="password" part="textbox textbox-auth-client-secret" value="${t||""}" placeholder="client-secret" spellcheck="false" class="oauth2 ${n} ${a} oauth-client-secret" style="margin:0 5px;${x?"display:none;":""}"> <select style="margin-right:5px;${x?"display:none;":""}" class="${n} ${a} oauth-send-client-secret-in">${!o||o.includes("header")?u`<option value="header" .selected="${i==="header"}">Authorization Header</option>`:""} ${!o||o.includes("request-body")?u`<option value="request-body" .selected="${i==="request-body"}">Request Body</option>`:""}</select>`:""} ${n==="authorizationCode"||n==="clientCredentials"||n==="implicit"||n==="password"?u`<button class="m-btn thin-border" part="btn btn-outline" @click="${S=>{td.call(this,a,n,f,y,S)}}">GET TOKEN</button>`:""}</div><div class="oauth-resp-display red-text small-font-size"></div>`:""}`:""}</div>`}function ad(n){var e;const t=(e=this.resolvedSpec.securitySchemes)==null?void 0:e.find(a=>a.securitySchemeId===n);if(t.user="",t.password="",t.value="",t.finalKeyValue="",this.persistAuth==="true"){const a=Na.call(this);delete a[t.securitySchemeId],Xs.call(this,a)}this.requestUpdate()}function Qs(n="true"){var e;if(!this.resolvedSpec)return"";const t=(e=this.resolvedSpec.securitySchemes)==null?void 0:e.filter(a=>a.finalKeyValue);if(t)return u`<section id="auth" part="section-auth" style="text-align:left;direction:ltr;margin-top:24px;margin-bottom:24px" class="observe-me ${"read focused".includes(this.renderStyle)?"section-gap--read-mode":"section-gap "}"><div class="sub-title regular-font">AUTHENTICATION</div>${n==="true"?u`<div class="small-font-size" style="display:flex;align-items:center;min-height:30px">${t.length>0?u`<div class="blue-text">${t.length} API key applied</div><div style="flex:1"></div><button class="m-btn thin-border" part="btn btn-outline" @click="${()=>{Oa.call(this)}}">CLEAR ALL API KEYS</button>`:u`<div class="red-text">No API key applied</div>`}</div>`:""} ${this.resolvedSpec.securitySchemes&&this.resolvedSpec.securitySchemes.length>0?u`<table role="presentation" id="auth-table" class="m-table padded-12" style="width:100%">${this.resolvedSpec.securitySchemes.filter(a=>a.type).map(a=>{var r,s;return u`<tr id="security-scheme-${a.securitySchemeId}" class="${a.type.toLowerCase()}"><td style="max-width:500px;overflow-wrap:break-word"><div style="line-height:28px;margin-bottom:5px"><span style="font-weight:700;font-size:var(--font-size-regular)">${a.typeDisplay}</span> ${a.finalKeyValue?u`<span class="blue-text">${a.finalKeyValue?"Key Applied":""} </span><button class="m-btn thin-border small" part="btn btn-outline" @click="${()=>{ad.call(this,a.securitySchemeId)}}">REMOVE</button>`:""}</div>${a.description?u`<div class="m-markdown">${I(z(A(a.description||"")))}</div>`:""} ${a.type.toLowerCase()==="apikey"?u`<div style="margin-bottom:5px">Send <code>${a.name}</code> in <code>${a.in}</code></div>${n==="true"?u`<div style="max-height:28px">${a.in!=="cookie"?u`<input type="text" value="${a.value}" class="${a.type} ${a.securitySchemeId} api-key-input" placeholder="api-token" spellcheck="false" id="${a.type}-${a.securitySchemeId}-api-key-input"> <button class="m-btn thin-border" style="margin-left:5px" part="btn btn-outline" @click="${i=>{Ba.call(this,a.securitySchemeId,i)}}">${a.finalKeyValue?"UPDATE":"SET"}</button>`:u`<span class="gray-text" style="font-size::var(--font-size-small)">cookies cannot be set from here</span>`}</div>`:""}`:""} ${a.type.toLowerCase()==="http"&&((r=a.scheme)==null?void 0:r.toLowerCase())==="basic"?u`<div style="margin-bottom:5px">Send <code>Authorization</code> in <code>header</code> containing the word <code>Basic</code> followed by a space and a base64 encoded string of <code>username:password</code>.</div>${n==="true"?u`<div><input type="text" value="${a.user}" placeholder="username" spellcheck="false" class="${a.type} ${a.securitySchemeId} api-key-user" style="width:100px" id="input-${a.type}-${a.securitySchemeId}-api-key-user"> <input type="password" value="${a.password}" placeholder="password" spellcheck="false" class="${a.type} ${a.securitySchemeId} api-key-password" style="width:100px;margin:0 5px" id="input-${a.type}-${a.securitySchemeId}-api-key-password"> <button class="m-btn thin-border" @click="${i=>{Ba.call(this,a.securitySchemeId,i)}}" part="btn btn-outline">${a.finalKeyValue?"UPDATE":"SET"}</button></div>`:""}`:""} ${a.type.toLowerCase()==="http"&&((s=a.scheme)==null?void 0:s.toLowerCase())==="bearer"?u`<div style="margin-bottom:5px">Send <code>Authorization</code> in <code>header</code> containing the word <code>Bearer</code> followed by a space and token value</div>${n==="true"?u`<div style="max-height:28px"><input type="text" value="${a.value}" class="${a.type} ${a.securitySchemeId} api-key-input" placeholder="api-token" spellcheck="false" id="${a.type}-${a.securitySchemeId}-api-key-input"> <button class="m-btn thin-border" style="margin-left:5px" part="btn btn-outline" @click="${i=>{Ba.call(this,a.securitySchemeId,i)}}">${a.finalKeyValue?"UPDATE":"SET"}</button></div>`:""}`:""}</td></tr>${a.type.toLowerCase()==="oauth2"?u`<tr><td style="border:none;padding-left:48px">${Object.keys(a.flows).map(i=>nd.call(this,i,a.flows[i]["x-client-id"]||a["x-client-id"]||"",a.flows[i]["x-client-secret"]||a["x-client-secret"]||"",a.securitySchemeId,a.flows[i],a.flows[i]["x-default-scopes"]||a["x-default-scopes"],a.flows[i]["x-receive-token-in"]||a["x-receive-token-in"],a.flows[i]["x-receive-token-in-options"]||a["x-receive-token-in-options"],n))}</td></tr>`:""}`})}</table>`:""}<slot name="auth"></slot></section>`}function ei(n){if(this.resolvedSpec.securitySchemes&&n){const e=[];if(Array.isArray(n)){if(n.length===0)return""}else return"";return n.forEach(t=>{const a=[],r=[];Object.keys(t).length===0?e.push({securityTypes:"None",securityDefs:[]}):(Object.keys(t).forEach(s=>{let i="";const o=this.resolvedSpec.securitySchemes.find(l=>l.securitySchemeId===s);t[s]&&Array.isArray(t[s])&&(i=t[s].join(", ")),o&&(r.push(o.typeDisplay),a.push({...o,scopes:i}))}),e.push({securityTypes:r.length>1?`${r[0]} + ${r.length-1} more`:r[0],securityDefs:a}))}),u`<div style="position:absolute;top:3px;right:2px;font-size:var(--font-size-small);line-height:1.5"><div style="position:relative;display:flex;min-width:350px;max-width:700px;justify-content:flex-end"><svg width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" fill="none" style="stroke:var(--fg3)"><rect x="5" y="11" width="14" height="10" rx="2"/><circle cx="12" cy="16" r="1"/><path d="M8 11v-4a4 4 0 0 1 8 0v4"/></svg> ${e.map((t,a)=>u`${t.securityTypes?u`${a!==0?u`<div style="padding:3px 4px">OR</div>`:""}<div class="tooltip"><div style="padding:2px 4px;white-space:nowrap;text-overflow:ellipsis;max-width:150px;overflow:hidden">${this.updateRoute==="true"&&this.allowAuthentication==="true"?u`<a part="anchor anchor-operation-security" href="#auth">${t.securityTypes}</a>`:u`${t.securityTypes}`}</div><div class="tooltip-text" style="position:absolute;color:var(--fg);top:26px;right:0;border:1px solid var(--border-color);padding:2px 4px;display:block">${t.securityDefs.length>1?u`<div>Requires <b>all</b> of the following</div>`:""}<div style="padding-left:8px">${t.securityDefs.map((r,s)=>{const i=u`${r.scopes!==""?u`<div><b>Required scopes:</b><br><div style="margin-left:8px">${r.scopes.split(",").map((o,l)=>u`${l===0?"":"\u2503"}<span>${o}</span>`)}</div></div>`:""}`;return u`${r.type==="oauth2"?u`<div>${t.securityDefs.length>1?u`<b>${s+1}.</b> `:"Needs"} OAuth Token <span style="font-family:var(--font-mono);color:var(--primary-color)">${r.securitySchemeId} </span>in <b>Authorization header</b> ${i}</div>`:r.type==="http"?u`<div>${t.securityDefs.length>1?u`<b>${s+1}.</b> `:u`Requires`} ${r.scheme==="basic"?"Base 64 encoded username:password":u`Bearer Token <b>${r.nameId}</b>`} in <b>Authorization header</b> ${i}</div>`:u`<div>${t.securityDefs.length>1?u`<b>${s+1}.</b> `:u`Requires`} ${u`Token in <b>${r.name} ${r.in}</b>`} ${i}</div>`}`})}</div></div></div>`:""}`)}</div></div>`}return""}function ti(n){return u`<section class="table-title" style="margin-top:24px">CODE SAMPLES<div part="tab-panel" class="tab-panel col" @click="${e=>{var t,a;if(!e.target.classList.contains("tab-btn"))return;const r=e.target.dataset.tab,s=[...e.currentTarget.querySelectorAll(".tab-btn")],i=[...e.currentTarget.querySelectorAll(".tab-content")];s.forEach(o=>o.classList[o.dataset.tab===r?"add":"remove"]("active")),i.forEach(o=>{o.style.display=o.dataset.tab===r?"block":"none"}),Kt(((a=(t=e.currentTarget.getRootNode())==null?void 0:t.host)==null?void 0:a.shadowRoot)||e.currentTarget)}}"><div part="tab-btn-row" class="tab-buttons row" style="width:100">${n.map((e,t)=>u`<button part="tab-btn" class="tab-btn ${t===0?"active":""}" data-tab="${e.lang}${t}">${e.label||e.lang}</button>`)}</div>${n.map((e,t)=>{var a;return u`<div class="tab-content m-markdown" style="display:${t===0?"block":"none"}" data-tab="${e.lang}${t}"><button class="toolbar-btn" part="btn btn-fill btn-copy" style="position:absolute;top:12px;right:8px" @click="${r=>{vt(e.source,r)}}">Copy</button><pre><code class="language-${(a=e.lang)==null?void 0:a.toLowerCase()}">${e.source}</code></pre></div>`})}</div></section>`}function ni(n){return u`<div class="req-res-title" style="margin-top:12px">CALLBACKS</div>${Object.entries(n).map(e=>u`<div class="tiny-title" style="padding:12px;border:1px solid var(--light-border-color)">${e[0]} ${Object.entries(e[1]).map(t=>u`<div class="mono-font small-font-size" style="display:flex;margin-left:16px"><div style="width:100%">${Object.entries(t[1]).map(a=>{var r,s,i;return u`<div><div style="margin-top:12px"><div class="method method-fg ${a[0]}" style="width:70px;border:none;margin:0;padding:0;line-height:20px;vertical-align:baseline;text-align:left"><span style="font-size:20px">⥄ </span>${a[0]}</div><span style="line-height:20px;vertical-align:baseline">${t[0]}</span></div><div class="expanded-req-resp-container"><api-request class="${this.renderStyle}-mode callback" style="width:100%" callback="true" method="${a[0]||""}" path="${t[0]||""}" .parameters="${((r=a[1])==null?void 0:r.parameters)||""}" .request_body="${((s=a[1])==null?void 0:s.requestBody)||""}" fill-request-fields-with-example="${this.fillRequestFieldsWithExample}" allow-try="false" render-style="${this.renderStyle}" schema-style="${this.schemaStyle}" active-schema-tab="${this.defaultSchemaTab}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="false" schema-hide-write-only="${this.schemaHideWriteOnly==="never"?"false":"true"}" fetch-credentials="${this.fetchCredentials}" exportparts="wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
|
|
226
|
+
*/class Ua extends Pa{constructor(e){if(super(e),this.it=P,e.type!==Pe.CHILD)throw Error(this.constructor.directiveName+"() can only be used in child bindings")}render(e){if(e===P||e==null)return this._t=void 0,this.it=e;if(e===Q)return e;if(typeof e!="string")throw Error(this.constructor.directiveName+"() called with a non-string value");if(e===this.it)return this._t;this.it=e;const t=[e];return t.raw=t,this._t={_$litType$:this.constructor.resultType,strings:t,values:[]}}}Ua.directiveName="unsafeHTML",Ua.resultType=1;const _=za(Ua);function z(n){if(typeof n!="string")return"";if(typeof window<"u"&&window.Sanitizer&&Element.prototype.setHTML)try{const r=document.createElement("div"),s=new window.Sanitizer({allowAttributes:{"*":["*"]}});return r.setHTML(n,{sanitizer:s}),r.innerHTML}catch{}let e;if(typeof DOMParser<"u")e=new DOMParser().parseFromString(n,"text/html");else return n;const t=e.querySelectorAll("script");for(let r=t.length-1;r>=0;r--)t[r].parentNode.removeChild(t[r]);const a=e.querySelectorAll("*");for(let r=0;r<a.length;r++){const s=a[r];for(let i=s.attributes.length-1;i>=0;i--){const o=s.attributes[i],l=o.name.toLowerCase(),c=o.value.toLowerCase();(l.startsWith("on")||(l==="href"||l==="src")&&(c.includes("javascript:")||c.includes("data:text/html")))&&s.removeAttribute(o.name)}}return e.body.innerHTML}const xd="731DB1C3F7EA533B85E29492D26AA-1234567890-1234567890",wd="4FatVDBJKPAo4JgLLaaQFMUcQPn5CrPRvLlaob9PTYc",gi="rapidoc";function yi(n){try{const e=new TextEncoder().encode(n);let t="";for(let a=0;a<e.byteLength;a++)t+=String.fromCharCode(e[a]);return btoa(t)}catch{return btoa(n)}}function Ue(n,e="",t="",a=""){var r,s,i;const o=(r=this.resolvedSpec.securitySchemes)==null?void 0:r.find(c=>c.securitySchemeId===n);if(!o)return!1;let l="";return((s=o.scheme)==null?void 0:s.toLowerCase())==="basic"?e&&(l=`Basic ${yi(`${e}:${t}`)}`):a&&(o.value=a,l=`${((i=o.scheme)==null?void 0:i.toLowerCase())==="bearer"?"Bearer ":""}${a}`),l?(o.finalKeyValue=l,this.requestUpdate(),!0):!1}function Ma(){var n;(n=this.resolvedSpec.securitySchemes)==null||n.forEach(e=>{e.user="",e.password="",e.value="",e.finalKeyValue=""}),this.requestUpdate()}function Ha(){return JSON.parse(localStorage.getItem(gi))||{}}function bi(n){localStorage.setItem(gi,JSON.stringify(n))}function $d(){const n=Ha.call(this);Object.values(n).forEach(e=>{Ue.call(this,e.securitySchemeId,e.username,e.password,e.value)})}function Wa(n){let e="";const t=this.resolvedSpec.securitySchemes.find(a=>a.securitySchemeId===n);if(t){const a=this.shadowRoot.getElementById(`security-scheme-${n}`);if(a){if(t.type&&t.scheme&&t.type==="http"&&t.scheme.toLowerCase()==="basic"){const r=a.querySelector(".api-key-user").value.trim(),s=a.querySelector(".api-key-password").value.trim();Ue.call(this,n,r,s)}else e=a.querySelector(".api-key-input").value.trim(),Ue.call(this,n,"","",e);if(this.persistAuth==="true"){const r=Ha.call(this);r[n]=t,bi.call(this,r)}}}}function vi(n,e,t="Bearer"){const a=this.resolvedSpec.securitySchemes.find(r=>r.securitySchemeId===n);a.finalKeyValue=`${t.toLowerCase()==="bearer"?"Bearer":t.toLowerCase()==="mac"?"MAC":t} ${e}`,this.requestUpdate()}async function Ka(n,e,t,a,r,s,i,o,l="header",c=null,d=null,p=null){const h=o?o.querySelector(".oauth-resp-display"):void 0,m=new URLSearchParams,y=new Headers;m.append("grant_type",r),r==="authorization_code"&&(m.append("client_id",e),m.append("client_secret",t)),r!=="client_credentials"&&r!=="password"&&m.append("redirect_uri",a),s&&(m.append("code",s),m.append("code_verifier",xd)),l==="header"?y.set("Authorization",`Basic ${yi(`${e}:${t}`)}`):r!=="authorization_code"&&(m.append("client_id",e),m.append("client_secret",t)),r==="password"&&(m.append("username",d),m.append("password",p)),c&&m.append("scope",c);try{const g=await fetch(n,{method:"POST",headers:y,body:m}),f=await g.json();if(g.ok){if(f.token_type&&f.access_token)return vi.call(this,i,f.access_token,f.token_type),h&&(h.innerHTML='<span style="color:var(--green)">Access Token Received</span>'),!0}else return h&&(h.innerHTML=`<span style="color:var(--red)">${f.error_description||f.error_description||"Unable to get access token"}</span>`),!1}catch{return h&&(h.innerHTML='<span style="color:var(--red)">Failed to get access token</span>'),!1}}async function kd(n,e,t,a,r,s,i,o,l,c){sessionStorage.removeItem("winMessageEventActive"),e.close(),!n.data.fake&&(n.data,n.data.error,n.data&&(n.data.responseType==="code"?Ka.call(this,t,a,r,s,i,n.data.code,l,c,o):n.data.responseType==="token"&&vi.call(this,l,n.data.access_token,n.data.token_type)))}async function Sd(n,e,t,a,r){const s=r.target.closest(".oauth-flow"),i=s.querySelector(".oauth-client-id")?s.querySelector(".oauth-client-id").value.trim():"",o=s.querySelector(".oauth-client-secret")?s.querySelector(".oauth-client-secret").value.trim():"",l=s.querySelector(".api-key-user")?s.querySelector(".api-key-user").value.trim():"",c=s.querySelector(".api-key-password")?s.querySelector(".api-key-password").value.trim():"",d=s.querySelector(".oauth-send-client-secret-in")?s.querySelector(".oauth-send-client-secret-in").value.trim():"header",p=[...s.querySelectorAll(".scope-checkbox:checked")],h=s.querySelector(`#${n}-pkce`),m=`${Math.random().toString(36).slice(2,9)}random${Math.random().toString(36).slice(2,9)}`,y=`${Math.random().toString(36).slice(2,9)}random${Math.random().toString(36).slice(2,9)}`,g=new URL(`${window.location.origin}${window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"))}/${this.oauthReceiver}`);let f="",b="",v;if([...s.parentNode.querySelectorAll(".oauth-resp-display")].forEach(w=>{w.innerHTML=""}),e==="authorizationCode"||e==="implicit"){const w=new URL(t);e==="authorizationCode"?(f="authorization_code",b="code"):e==="implicit"&&(b="token");const x=new URLSearchParams(w.search),k=p.map($=>$.value).join(" ");k&&x.set("scope",k),x.set("client_id",i),x.set("redirect_uri",g.toString()),x.set("response_type",b),x.set("state",m),x.set("nonce",y),h&&h.checked&&(x.set("code_challenge",wd),x.set("code_challenge_method","S256")),x.set("show_dialog",!0),w.search=x.toString(),sessionStorage.getItem("winMessageEventActive")==="true"&&window.postMessage({fake:!0},this),setTimeout(()=>{v=window.open(w.toString()),v&&(sessionStorage.setItem("winMessageEventActive","true"),window.addEventListener("message",$=>kd.call(this,$,v,a,i,o,g.toString(),f,d,n,s),{once:!0}))},10)}else if(e==="clientCredentials"){f="client_credentials";const w=p.map(x=>x.value).join(" ");Ka.call(this,a,i,o,g.toString(),f,"",n,s,d,w)}else if(e==="password"){f="password";const w=p.map(x=>x.value).join(" ");Ka.call(this,a,i,o,g.toString(),f,"",n,s,d,w,l,c)}}function Ed(n,e,t,a,r,s=[],i="header",o=void 0,l="true"){var c,d,p,h,m,y,g;let{authorizationUrl:f,tokenUrl:b,refreshUrl:v}=r;const w=r["x-pkce-only"]||!1,x=S=>S.indexOf("://")>0||S.indexOf("//")===0,k=new URL((c=this.selectedServer)==null?void 0:c.computedUrl).origin;v&&!x(v)&&((d=this.selectedServer)!=null&&d.computedUrl.trim().endsWith("/")&&!v.trim().startsWith("/")?v=`${(p=this.selectedServer)==null?void 0:p.computedUrl.trim()}${b.trim()}`:v=`${k}/${v.replace(/^\//,"")}`),b&&!x(b)&&((h=this.selectedServer)!=null&&h.computedUrl.trim().endsWith("/")&&!b.trim().startsWith("/")?b=`${(m=this.selectedServer)==null?void 0:m.computedUrl.trim()}${b.trim()}`:b=`${k}/${b.replace(/^\//,"")}`),f&&!x(f)&&((y=this.selectedServer)!=null&&y.computedUrl.trim().endsWith("/")&&!f.trim().startsWith("/")?f=`${(g=this.selectedServer)==null?void 0:g.computedUrl.trim()}${f.trim()}`:f=`${k}/${f.replace(/^\//,"")}`);let $;return n==="authorizationCode"?$="Authorization Code Flow":n==="clientCredentials"?$="Client Credentials Flow":n==="implicit"?$="Implicit Flow":n==="password"?$="Password Flow":$=n,u`<div class="oauth-flow ${n}" style="padding:12px 0;margin-bottom:12px"><div class="tiny-title upper" style="margin-bottom:8px">${$}</div>${f?u`<div style="margin-bottom:5px"><span style="width:75px;display:inline-block">Auth URL</span> <span class="mono-font">${f}</span></div>`:""} ${b?u`<div style="margin-bottom:5px"><span style="width:75px;display:inline-block">Token URL</span> <span class="mono-font">${b}</span></div>`:""} ${v?u`<div style="margin-bottom:5px"><span style="width:75px;display:inline-block">Refresh URL</span> <span class="mono-font">${v}</span></div>`:""} ${n==="authorizationCode"||n==="clientCredentials"||n==="implicit"||n==="password"?u`${r.scopes?u`<span>Scopes</span><div class="oauth-scopes" part="section-auth-scopes" style="width:100%;display:flex;flex-direction:column;flex-wrap:wrap;margin:0 0 10px 24px">${Object.entries(r.scopes).map((S,E)=>u`<div class="m-checkbox" style="display:inline-flex;align-items:center"><input type="checkbox" part="checkbox checkbox-auth-scope" class="scope-checkbox" id="${a}${n}${E}" ?checked="${s.includes(S[0])}" value="${S[0]}"> <label for="${a}${n}${E}" style="margin-left:5px;cursor:pointer"><span class="mono-font">${S[0]}</span> ${S[0]!==S[1]?` - ${S[1]||""}`:""}</label></div>`)}</div>`:""} ${n==="password"&&l==="true"?u`<div style="margin:5px 0"><input type="text" placeholder="username" spellcheck="false" class="oauth2 ${n} ${a} api-key-user" part="textbox textbox-username" id="input-${a}-${n}-api-key-user"> <input type="password" placeholder="password" spellcheck="false" class="oauth2 ${n} ${a} api-key-password" style="margin:0 5px" part="textbox textbox-password" id="input-${a}-${n}-api-key-password"></div>`:""} ${l==="true"?u`<div>${n==="authorizationCode"?u`<div style="margin:16px 0 4px"><input type="checkbox" part="checkbox checkbox-auth-scope" id="${a}-pkce" checked="checked" ?disabled="${w}"> <label for="${a}-pkce" style="margin:0 16px 0 4px;line-height:24px;cursor:pointer">Send Proof Key for Code Exchange (PKCE)</label></div>`:""} <input type="text" part="textbox textbox-auth-client-id" value="${e||""}" placeholder="client-id" spellcheck="false" class="oauth2 ${n} ${a} oauth-client-id"> ${n==="authorizationCode"||n==="clientCredentials"||n==="password"?u`<input id="${a}-${n}-oauth-client-secret" type="password" part="textbox textbox-auth-client-secret" value="${t||""}" placeholder="client-secret" spellcheck="false" class="oauth2 ${n} ${a} oauth-client-secret" style="margin:0 5px;${w?"display:none;":""}"> <select style="margin-right:5px;${w?"display:none;":""}" class="${n} ${a} oauth-send-client-secret-in">${!o||o.includes("header")?u`<option value="header" .selected="${i==="header"}">Authorization Header</option>`:""} ${!o||o.includes("request-body")?u`<option value="request-body" .selected="${i==="request-body"}">Request Body</option>`:""}</select>`:""} ${n==="authorizationCode"||n==="clientCredentials"||n==="implicit"||n==="password"?u`<button class="m-btn thin-border" part="btn btn-outline" @click="${S=>{Sd.call(this,a,n,f,b,S)}}">GET TOKEN</button>`:""}</div><div class="oauth-resp-display red-text small-font-size"></div>`:""}`:""}</div>`}function Ad(n){var e;const t=(e=this.resolvedSpec.securitySchemes)==null?void 0:e.find(a=>a.securitySchemeId===n);if(t.user="",t.password="",t.value="",t.finalKeyValue="",this.persistAuth==="true"){const a=Ha.call(this);delete a[t.securitySchemeId],bi.call(this,a)}this.requestUpdate()}function xi(n="true"){var e;if(!this.resolvedSpec)return"";const t=(e=this.resolvedSpec.securitySchemes)==null?void 0:e.filter(a=>a.finalKeyValue);if(t)return u`<section id="auth" part="section-auth" style="text-align:left;direction:ltr;margin-top:24px;margin-bottom:24px" class="observe-me ${"read focused".includes(this.renderStyle)?"section-gap--read-mode":"section-gap "}"><div class="sub-title regular-font">AUTHENTICATION</div>${n==="true"?u`<div class="small-font-size" style="display:flex;align-items:center;min-height:30px">${t.length>0?u`<div class="blue-text">${t.length} API key applied</div><div style="flex:1"></div><button class="m-btn thin-border" part="btn btn-outline" @click="${()=>{Ma.call(this)}}">CLEAR ALL API KEYS</button>`:u`<div class="red-text">No API key applied</div>`}</div>`:""} ${this.resolvedSpec.securitySchemes&&this.resolvedSpec.securitySchemes.length>0?u`<table role="presentation" id="auth-table" class="m-table padded-12" style="width:100%">${this.resolvedSpec.securitySchemes.filter(a=>a.type).map(a=>{var r,s;return u`<tr id="security-scheme-${a.securitySchemeId}" class="${a.type.toLowerCase()}"><td style="max-width:500px;overflow-wrap:break-word"><div style="line-height:28px;margin-bottom:5px"><span style="font-weight:700;font-size:var(--font-size-regular)">${a.typeDisplay}</span> ${a.finalKeyValue?u`<span class="blue-text">${a.finalKeyValue?"Key Applied":""} </span><button class="m-btn thin-border small" part="btn btn-outline" @click="${()=>{Ad.call(this,a.securitySchemeId)}}">REMOVE</button>`:""}</div>${a.description?u`<div class="m-markdown">${_(z(A(a.description||"")))}</div>`:""} ${a.type.toLowerCase()==="apikey"?u`<div style="margin-bottom:5px">Send <code>${a.name}</code> in <code>${a.in}</code></div>${n==="true"?u`<div style="max-height:28px">${a.in!=="cookie"?u`<input type="text" value="${a.value}" class="${a.type} ${a.securitySchemeId} api-key-input" placeholder="api-token" spellcheck="false" id="${a.type}-${a.securitySchemeId}-api-key-input"> <button class="m-btn thin-border" style="margin-left:5px" part="btn btn-outline" @click="${i=>{Wa.call(this,a.securitySchemeId,i)}}">${a.finalKeyValue?"UPDATE":"SET"}</button>`:u`<span class="gray-text" style="font-size::var(--font-size-small)">cookies cannot be set from here</span>`}</div>`:""}`:""} ${a.type.toLowerCase()==="http"&&((r=a.scheme)==null?void 0:r.toLowerCase())==="basic"?u`<div style="margin-bottom:5px">Send <code>Authorization</code> in <code>header</code> containing the word <code>Basic</code> followed by a space and a base64 encoded string of <code>username:password</code>.</div>${n==="true"?u`<div><input type="text" value="${a.user}" placeholder="username" spellcheck="false" class="${a.type} ${a.securitySchemeId} api-key-user" style="width:100px" id="input-${a.type}-${a.securitySchemeId}-api-key-user"> <input type="password" value="${a.password}" placeholder="password" spellcheck="false" class="${a.type} ${a.securitySchemeId} api-key-password" style="width:100px;margin:0 5px" id="input-${a.type}-${a.securitySchemeId}-api-key-password"> <button class="m-btn thin-border" @click="${i=>{Wa.call(this,a.securitySchemeId,i)}}" part="btn btn-outline">${a.finalKeyValue?"UPDATE":"SET"}</button></div>`:""}`:""} ${a.type.toLowerCase()==="http"&&((s=a.scheme)==null?void 0:s.toLowerCase())==="bearer"?u`<div style="margin-bottom:5px">Send <code>Authorization</code> in <code>header</code> containing the word <code>Bearer</code> followed by a space and token value</div>${n==="true"?u`<div style="max-height:28px"><input type="text" value="${a.value}" class="${a.type} ${a.securitySchemeId} api-key-input" placeholder="api-token" spellcheck="false" id="${a.type}-${a.securitySchemeId}-api-key-input"> <button class="m-btn thin-border" style="margin-left:5px" part="btn btn-outline" @click="${i=>{Wa.call(this,a.securitySchemeId,i)}}">${a.finalKeyValue?"UPDATE":"SET"}</button></div>`:""}`:""}</td></tr>${a.type.toLowerCase()==="oauth2"?u`<tr><td style="border:none;padding-left:48px">${Object.keys(a.flows).map(i=>Ed.call(this,i,a.flows[i]["x-client-id"]||a["x-client-id"]||"",a.flows[i]["x-client-secret"]||a["x-client-secret"]||"",a.securitySchemeId,a.flows[i],a.flows[i]["x-default-scopes"]||a["x-default-scopes"],a.flows[i]["x-receive-token-in"]||a["x-receive-token-in"],a.flows[i]["x-receive-token-in-options"]||a["x-receive-token-in-options"],n))}</td></tr>`:""}`})}</table>`:""}<slot name="auth"></slot></section>`}function wi(n){if(this.resolvedSpec.securitySchemes&&n){const e=[];if(Array.isArray(n)){if(n.length===0)return""}else return"";return n.forEach(t=>{const a=[],r=[];Object.keys(t).length===0?e.push({securityTypes:"None",securityDefs:[]}):(Object.keys(t).forEach(s=>{let i="";const o=this.resolvedSpec.securitySchemes.find(l=>l.securitySchemeId===s);t[s]&&Array.isArray(t[s])&&(i=t[s].join(", ")),o&&(r.push(o.typeDisplay),a.push({...o,scopes:i}))}),e.push({securityTypes:r.length>1?`${r[0]} + ${r.length-1} more`:r[0],securityDefs:a}))}),u`<div style="position:absolute;top:3px;right:2px;font-size:var(--font-size-small);line-height:1.5"><div style="position:relative;display:flex;min-width:350px;max-width:700px;justify-content:flex-end"><svg width="24" height="24" viewBox="0 0 24 24" stroke-width="1.5" fill="none" style="stroke:var(--fg3)"><rect x="5" y="11" width="14" height="10" rx="2"/><circle cx="12" cy="16" r="1"/><path d="M8 11v-4a4 4 0 0 1 8 0v4"/></svg> ${e.map((t,a)=>u`${t.securityTypes?u`${a!==0?u`<div style="padding:3px 4px">OR</div>`:""}<div class="tooltip"><div style="padding:2px 4px;white-space:nowrap;text-overflow:ellipsis;max-width:150px;overflow:hidden">${this.updateRoute==="true"&&this.allowAuthentication==="true"?u`<a part="anchor anchor-operation-security" href="#auth">${t.securityTypes}</a>`:u`${t.securityTypes}`}</div><div class="tooltip-text" style="position:absolute;color:var(--fg);top:26px;right:0;border:1px solid var(--border-color);padding:2px 4px;display:block">${t.securityDefs.length>1?u`<div>Requires <b>all</b> of the following</div>`:""}<div style="padding-left:8px">${t.securityDefs.map((r,s)=>{const i=u`${r.scopes!==""?u`<div><b>Required scopes:</b><br><div style="margin-left:8px">${r.scopes.split(",").map((o,l)=>u`${l===0?"":"\u2503"}<span>${o}</span>`)}</div></div>`:""}`;return u`${r.type==="oauth2"?u`<div>${t.securityDefs.length>1?u`<b>${s+1}.</b> `:"Needs"} OAuth Token <span style="font-family:var(--font-mono);color:var(--primary-color)">${r.securitySchemeId} </span>in <b>Authorization header</b> ${i}</div>`:r.type==="http"?u`<div>${t.securityDefs.length>1?u`<b>${s+1}.</b> `:u`Requires`} ${r.scheme==="basic"?"Base 64 encoded username:password":u`Bearer Token <b>${r.nameId}</b>`} in <b>Authorization header</b> ${i}</div>`:u`<div>${t.securityDefs.length>1?u`<b>${s+1}.</b> `:u`Requires`} ${u`Token in <b>${r.name} ${r.in}</b>`} ${i}</div>`}`})}</div></div></div>`:""}`)}</div></div>`}return""}function $i(n){return u`<section class="table-title" style="margin-top:24px">CODE SAMPLES<div part="tab-panel" class="tab-panel col" @click="${e=>{var t,a;if(!e.target.classList.contains("tab-btn"))return;const r=e.target.dataset.tab,s=[...e.currentTarget.querySelectorAll(".tab-btn")],i=[...e.currentTarget.querySelectorAll(".tab-content")];s.forEach(o=>o.classList[o.dataset.tab===r?"add":"remove"]("active")),i.forEach(o=>{o.style.display=o.dataset.tab===r?"block":"none"}),Xt(((a=(t=e.currentTarget.getRootNode())==null?void 0:t.host)==null?void 0:a.shadowRoot)||e.currentTarget)}}"><div part="tab-btn-row" class="tab-buttons row" style="width:100">${n.map((e,t)=>u`<button part="tab-btn" class="tab-btn ${t===0?"active":""}" data-tab="${e.lang}${t}">${e.label||e.lang}</button>`)}</div>${n.map((e,t)=>{var a;return u`<div class="tab-content m-markdown" style="display:${t===0?"block":"none"}" data-tab="${e.lang}${t}"><button class="toolbar-btn" part="btn btn-fill btn-copy" style="position:absolute;top:12px;right:8px" @click="${r=>{kt(e.source,r)}}">Copy</button><pre><code class="language-${(a=e.lang)==null?void 0:a.toLowerCase()}">${e.source}</code></pre></div>`})}</div></section>`}function ki(n){return u`<div class="req-res-title" style="margin-top:12px">CALLBACKS</div>${Object.entries(n).map(e=>u`<div class="tiny-title" style="padding:12px;border:1px solid var(--light-border-color)">${e[0]} ${Object.entries(e[1]).map(t=>u`<div class="mono-font small-font-size" style="display:flex;margin-left:16px"><div style="width:100%">${Object.entries(t[1]).map(a=>{var r,s,i;return u`<div><div style="margin-top:12px"><div class="method method-fg ${a[0]}" style="width:70px;border:none;margin:0;padding:0;line-height:20px;vertical-align:baseline;text-align:left"><span style="font-size:20px">⥄ </span>${a[0]}</div><span style="line-height:20px;vertical-align:baseline">${t[0]}</span></div><div class="expanded-req-resp-container"><api-request class="${this.renderStyle}-mode callback" style="width:100%" callback="true" method="${a[0]||""}" path="${t[0]||""}" .parameters="${((r=a[1])==null?void 0:r.parameters)||""}" .request_body="${((s=a[1])==null?void 0:s.requestBody)||""}" fill-request-fields-with-example="${this.fillRequestFieldsWithExample}" allow-try="false" render-style="${this.renderStyle}" schema-style="${this.schemaStyle}" active-schema-tab="${this.defaultSchemaTab}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="false" schema-hide-write-only="${this.schemaHideWriteOnly==="never"?"false":"true"}" fetch-credentials="${this.fetchCredentials}" exportparts="wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
|
|
218
227
|
tab-panel:tab-panel, tab-btn:tab-btn, tab-btn-row:tab-btn-row, tab-coontent:tab-content,
|
|
219
228
|
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
|
|
220
229
|
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></api-request><api-response style="width:100%" class="${this.renderStyle}-mode" callback="true" .responses="${(i=a[1])==null?void 0:i.responses}" render-style="${this.renderStyle}" schema-style="${this.schemaStyle}" active-schema-tab="${this.defaultSchemaTab}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly==="never"?"false":"true"}" schema-hide-write-only="false" exportparts="btn:btn, btn-response-status:btn-response-status, btn-selected-response-status:btn-selected-response-status, btn-fill:btn-fill, btn-copy:btn-copy,
|
|
@@ -223,58 +232,50 @@ ${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.pus
|
|
|
223
232
|
* @license
|
|
224
233
|
* Copyright 2018 Google LLC
|
|
225
234
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
226
|
-
*/const
|
|
235
|
+
*/const Dd={},Ln=za(class extends Pa{constructor(){super(...arguments),this.ot=Dd}render(n,e){return e()}update(n,[e,t]){if(Array.isArray(e)){if(Array.isArray(this.ot)&&this.ot.length===e.length&&e.every(((a,r)=>a===this.ot[r])))return Q}else if(this.ot===e)return Q;return this.ot=Array.isArray(e)?Array.from(e):e,this.render(e,t)}});/**
|
|
227
236
|
* @license
|
|
228
237
|
* Copyright 2020 Google LLC
|
|
229
238
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
230
|
-
*/const
|
|
239
|
+
*/const Cd=n=>n.strings===void 0,Fd={},Td=(n,e=Fd)=>n._$AH=e;/**
|
|
231
240
|
* @license
|
|
232
241
|
* Copyright 2020 Google LLC
|
|
233
242
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
234
|
-
*/const
|
|
243
|
+
*/const Va=za(class extends Pa{constructor(n){if(super(n),n.type!==Pe.PROPERTY&&n.type!==Pe.ATTRIBUTE&&n.type!==Pe.BOOLEAN_ATTRIBUTE)throw Error("The `live` directive is not allowed on child or event bindings");if(!Cd(n))throw Error("`live` bindings can only contain a single expression")}render(n){return n}update(n,[e]){if(e===Q||e===P)return e;const t=n.element,a=n.name;if(n.type===Pe.PROPERTY){if(e===t[a])return Q}else if(n.type===Pe.BOOLEAN_ATTRIBUTE){if(!!e===t.hasAttribute(a))return Q}else if(n.type===Pe.ATTRIBUTE&&t.getAttribute(a)===e+"")return Q;return Td(n),e}});/**
|
|
235
244
|
* @license
|
|
236
245
|
* Copyright 2018 Google LLC
|
|
237
246
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
238
|
-
*/const
|
|
239
|
-
`)}const $n=U`.border-top{border-top:1px solid var(--border-color)}.border{border:1px solid var(--border-color);border-radius:var(--border-radius)}.light-border{border:1px solid var(--light-border-color);border-radius:var(--border-radius)}.pad-8-16{padding:8px 16px}.pad-top-8{padding-top:8px}.mar-top-8{margin-top:8px}`;function dd(n){if(!n||typeof n!="string")return"";try{let e=n.trim();e.startsWith("^")&&(e=e.slice(1)),e.endsWith("$")&&!e.endsWith("\\$")&&(e=e.slice(0,-1)),e=e.replace(/\((?:\?:)?([^()|]+)(?:\|[^()]+)*\)/g,"$1");const t=/(\[[^\]]+\]|\\[dwsDWS]|\\[^]|\.|[^\\[\]{}()+*?|])(?:\{(\d+)(?:,\d*)?\}|([+*?]))?/g;let a="",r;for(;(r=t.exec(e))!==null;){const s=r[1],i=r[2],o=r[3];let l=1;i!==void 0?l=parseInt(i,10):o==="+"?l=1:(o==="*"||o==="?")&&(l=0),l=Math.min(Math.max(0,l),50);let c="a";if(s==="\\d")c="0";else if(s==="\\D")c="a";else if(s==="\\w")c="a";else if(s==="\\W")c="_";else if(s==="\\s")c=" ";else if(s==="\\S")c="a";else if(s===".")c="a";else if(s.startsWith("\\"))c=s.slice(1);else if(s.startsWith("[")){const d=s.slice(1,-1);d.startsWith("^")?c=d.includes("a")?"0":"a":/[1-9]/.test(d)&&!d.includes("0")?c="1":/[0-9]/.test(d)&&!/[a-zA-Z]/.test(d)||/[0-9]/.test(d)&&/[a-fA-F]/.test(d)&&!/[g-zG-Z]/.test(d)?c="0":/[A-Z]/.test(d)&&!/[a-z]/.test(d)?c="A":/[a-z]/.test(d)?c="a":d.length>0&&(c=d[0])}else c=s;a+=c.repeat(l)}return a||n}catch{return n}}function qe(n){if(n===void 0)return"";if(n===null)return"null";if(n==="")return"\u2205";if(typeof n=="boolean"||typeof n=="number")return`${n}`;if(Array.isArray(n))return n.map(e=>e===null?"null":e===""?"\u2205":e.toString().replace(/^ +| +$/g,t=>"\u25CF".repeat(t.length))||"").join(", ");if(typeof n=="object"){const e=Object.keys(n);return`{ ${e[0]}:${n[e[0]]}${e.length>1?",":""} ... }`}return n.toString().replace(/^ +| +$/g,e=>"\u25CF".repeat(e.length))||""}function $e(n){var e,t;if(!n)return;let a="",r="";if(n.$ref){const i=n.$ref.lastIndexOf("/");a=`{recursive: ${n.$ref.substring(i+1)}} `}else n.type?(a=Array.isArray(n.type)?n.type.join("\u2503"):n.type,(n.format||n.enum||n.const)&&(a=a.replace("string",n.enum?"enum":n.const?"const":n.format)),n.nullable&&(a+="\u2503null")):n.const?a="const":Object.keys(n).length===0?a="any":a="{missing-type-info}";const s={type:a,format:n.format||"",pattern:n.pattern&&!n.enum?n.pattern:"",readOrWriteOnly:n.readOnly?"\u{1F181}":n.writeOnly?"\u{1F186}":"",deprecated:n.deprecated?"\u274C":"",examples:n.examples||n.example,default:qe(n.default),description:n.description||"",constrain:"",allowedValues:"",arrayType:"",html:""};if(s.type==="{recursive}"?s.description=n.$ref.substring(n.$ref.lastIndexOf("/")+1):(s.type==="{missing-type-info}"||s.type==="any")&&(s.description=s.description||""),s.allowedValues=n.const?n.const:Array.isArray(n.enum)?n.enum.map(i=>qe(i)).join("\u2503"):"",a==="array"&&n.items){const i=(e=n.items)==null?void 0:e.type,o=qe(n.items.default);s.arrayType=`${n.type} of ${Array.isArray(i)?i.join(""):i}`,s.default=o,s.allowedValues=n.items.const?n.const:Array.isArray((t=n.items)==null?void 0:t.enum)?n.items.enum.map(l=>qe(l)).join("\u2503"):""}return a.match(/integer|number/g)&&((n.minimum!==void 0||n.exclusiveMinimum!==void 0)&&(r+=n.minimum!==void 0?`Min ${n.minimum}`:`More than ${n.exclusiveMinimum}`),(n.maximum!==void 0||n.exclusiveMaximum!==void 0)&&(r+=n.maximum!==void 0?`${r?"\u2503":""}Max ${n.maximum}`:`${r?"\u2503":""}Less than ${n.exclusiveMaximum}`),n.multipleOf!==void 0&&(r+=`${r?"\u2503":""} multiple of ${n.multipleOf}`)),a.match(/string/g)&&(n.minLength!==void 0&&n.maxLength!==void 0?r+=`${r?"\u2503":""}${n.minLength} to ${n.maxLength} chars`:n.minLength!==void 0?r+=`${r?"\u2503":""}Min ${n.minLength} chars`:n.maxLength!==void 0&&(r+=`Max ${r?"\u2503":""}${n.maxLength} chars`)),s.constrain=r,s.html=`${s.type}~|~${s.readOrWriteOnly}~|~${s.constrain}~|~${s.default}~|~${s.allowedValues}~|~${s.pattern}~|~${s.description}~|~${n.title||""}~|~${s.deprecated?"deprecated":""}`,s}function se(n){if(typeof n=="object"&&!Array.isArray(n)){if(n.value!==void 0)return{Example:{...n}};const e=Object.entries(n).filter(([t,a])=>a.value!==void 0);return e.length===0?void 0:Object.fromEntries(e)}return Array.isArray(n)?n.reduce((e,t,a)=>(e[`Example${a+1}`]={value:t},e),{}):n?{Example:{value:n}}:void 0}function ai(n,e="string"){if(!n)return{exampleVal:"",exampleList:[]};if(n.constructor===Object){const r=Object.values(n).filter(s=>s["x-example-show-value"]!==!1).map(s=>({value:typeof s.value=="boolean"||typeof s.value=="number"?`${s.value}`:s.value||"",printableValue:qe(s.value),summary:s.summary||"",description:s.description||""}));return{exampleVal:r.length>0?r[0].value:"",exampleList:r}}if(Array.isArray(n)||(n=n?[n]:[]),n.length===0)return{exampleVal:"",exampleList:[]};if(e==="array"){const[r]=n,s=n.map(i=>({value:i,printableValue:qe(i)}));return{exampleVal:r,exampleList:s}}const t=n[0].toString(),a=n.map(r=>({value:r.toString(),printableValue:qe(r)}));return{exampleVal:t,exampleList:a}}function pd(n){return n.some(e=>{var t,a;return((t=e.summary)==null?void 0:t.length)>0||((a=e.description)==null?void 0:a.length)>0})}function ie(n){let e;return n&&(n.examples&&n.examples.length>=1?e=n.examples[0]:e=n.example),e}function kn(n){const e=ie(n);if(e==="")return"";if(e===null)return null;if(e===0)return 0;if(e===!1)return!1;if(e instanceof Date)switch(n.format.toLowerCase()){case"date":return e.toISOString().split("T")[0];case"time":return e.toISOString().split("T")[1];default:return e.toISOString()}if(e)return e;if(Object.keys(n).length===0)return null;if(n.$ref)return{};if(n.const===!1||n.const===0||n.const===null||n.const===""||n.const)return n.const;if(n.default)return n.default;const t=Array.isArray(n.type)?n.type[0]:n.type;if(!t)return null;if(t.match(/^integer|^number/g)){const a=Number.isNaN(Number(n.multipleOf))?void 0:Number(n.multipleOf),r=Number.isNaN(Number(n.maximum))?void 0:Number(n.maximum),s=Number.isNaN(Number(n.minimum))?Number.isNaN(Number(n.exclusiveMinimum))?r||0:Number(n.exclusiveMinimum)+(t.startsWith("integer")?1:.001):Number(n.minimum);return a?a>=s?a:s%a===0?s:Math.ceil(s/a)*a:s}if(t.match(/^boolean/g))return!1;if(t.match(/^null/g))return null;if(t.match(/^string/g)){if(n.enum)return n.enum[0];if(n.const)return n.const;if(n.pattern)try{return dd(n.pattern)}catch{return n.pattern}if(n.format){const a=`${Date.now().toString(16)}${Math.random().toString(16)}0`.repeat(16);switch(n.format.toLowerCase()){case"url":case"uri":return"http://example.com";case"date":return new Date(0).toISOString().split("T")[0];case"time":return new Date(0).toISOString().split("T")[1];case"date-time":return new Date(0).toISOString();case"duration":return"P3Y6M4DT12H30M5S";case"email":case"idn-email":return"user@example.com";case"hostname":case"idn-hostname":return"www.example.com";case"ipv4":return"198.51.100.42";case"ipv6":return"2001:0db8:5b96:0000:0000:426f:8e17:642a";case"uuid":return[a.substring(0,8),a.substring(8,12),`4000-8${a.substring(13,16)}`,a.substring(16,28)].join("-");case"byte":return"ZXhhbXBsZQ==";default:return""}}else{const a=Number.isNaN(n.minLength)?void 0:Number(n.minLength),r=Number.isNaN(n.maxLength)?void 0:Number(n.maxLength),s=a||(r>6?6:r||void 0);return s?"A".repeat(s):"string"}}return null}function Sn(n,e=1){const t=" ".repeat(e);let a="";if(e===1&&typeof n!="object")return`
|
|
240
|
-
${t}${n.toString()}`;for(const r in n){const s=n[r]["::XML_TAG"]||r;let i="";Array.isArray(n[r])?i=s[0]["::XML_TAG"]||`${r}`:i=s,!r.startsWith("::")&&(Array.isArray(n[r])?a=`${a}
|
|
241
|
-
${t}<${i}>${Sn(n[r],e+1)}
|
|
242
|
-
${t}</${i}>`:typeof n[r]=="object"?a=`${a}
|
|
243
|
-
${t}<${i}>${Sn(n[r],e+1)}
|
|
244
|
-
${t}</${i}>`:a=`${a}
|
|
245
|
-
${t}<${i}>${n[r].toString()}</${i}>`)}return a}function En(n,e){var t,a,r,s;typeof e!="object"||e===null||(n.title&&(e["::TITLE"]=n.title),n.description&&(e["::DESCRIPTION"]=n.description),(t=n.xml)!=null&&t.name&&(e["::XML_TAG"]=(a=n.xml)==null?void 0:a.name),(r=n.xml)!=null&&r.wrapped&&(e["::XML_WRAP"]=(s=n.xml)==null?void 0:s.wrapped.toString()))}function ri(n){if(!(typeof n!="object"||n===null)){delete n["::TITLE"],delete n["::DESCRIPTION"],delete n["::XML_TAG"],delete n["::XML_WRAP"];for(const e in n)ri(n[e])}}function si(n,e,t){for(const a in e)e[a][t]=n}function ze(n,e,t){let a=0;const r=10,s={};for(const i in n){for(const o in t)if(s[`example-${a}`]={...n[i]},s[`example-${a}`][e]=t[o],a++,a>=r)break;if(a>=r)break}return s}function oe(n,e={},t=0){var a,r,s,i,o,l,c,d,p,h,m;let b={};if(!(!n||t>8)){if(n.allOf){const g={};if(n.allOf.length===1&&!((a=n.allOf[0])!=null&&a.properties)&&!((r=n.allOf[0])!=null&&r.items)){if(n.allOf[0].$ref)return"{ }";if(n.allOf[0].readOnly&&e.includeReadOnly){const f=n.allOf[0];return kn(f)}return}n.allOf.forEach(f=>{if(f.type==="object"||f.properties||f.allOf||f.anyOf||f.oneOf){const y=oe(f,e,t+1);Object.assign(g,y)}else if(f.type==="array"||f.items){const y=[oe(f,e,t+1)];Object.assign(g,y)}else if(f.type){const y=`prop${Object.keys(g).length}`;g[y]=kn(f)}else return""}),b=g}else if(n.oneOf){const g={};if(n.properties)for(const f in n.properties)n.properties[f].properties||(s=n.properties[f].properties)!=null&&s.items?g[f]=oe(n.properties[f],e,t+1):g[f]=kn(n.properties[f]);if(n.oneOf.length>0){let f=0;for(const y in n.oneOf){const v=oe(n.oneOf[y],e,t+1);for(const x in v){let w;if(Object.keys(g).length>0){if(v[x]===null||typeof v[x]!="object")continue;w=Object.assign(v[x],g)}else w=v[x];b[`example-${f}`]=w,En(n.oneOf[y],b[`example-${f}`]),f++}}}}else if(n.anyOf){let g;if(n.type==="object"||n.properties){g={"example-0":{}};for(const y in n.properties){if(ie(n)){g=n;break}n.properties[y].deprecated&&!e.includeDeprecated||n.properties[y].readOnly&&!e.includeReadOnly||n.properties[y].writeOnly&&!e.includeWriteOnly||(g=ze(g,y,oe(n.properties[y],e,t+1)))}}let f=0;for(const y in n.anyOf){const v=oe(n.anyOf[y],e,t+1);for(const x in v){if(typeof g<"u")for(const w in g)b[`example-${f}`]={...g[w],...v[x]};else b[`example-${f}`]=v[x];En(n.anyOf[y],b[`example-${f}`]),f++}}}else if(n.type==="object"||n.properties){b["example-0"]={},En(n,b["example-0"]);const g=ie(n);if(g)b["example-0"]=g;else{for(const f in n.properties)if(!((i=n.properties[f])!=null&&i.deprecated&&!e.includeDeprecated)&&!((o=n.properties[f])!=null&&o.readOnly&&!e.includeReadOnly)&&!((l=n.properties[f])!=null&&l.writeOnly&&!e.includeWriteOnly)){if(((c=n.properties[f])==null?void 0:c.type)==="array"||(d=n.properties[f])!=null&&d.items){const y=ie(n.properties[f]);if(y)si(y,b,f);else if(ie((p=n.properties[f])==null?void 0:p.items))si([ie(n.properties[f].items)],b,f);else{const v=oe(n.properties[f].items,e,t+1);if(e.useXmlTagForProp){const x=((h=n.properties[f].xml)==null?void 0:h.name)||f;if((m=n.properties[f].xml)!=null&&m.wrapped){const w=JSON.parse(`{ "${x}" : { "${x}" : ${JSON.stringify(v["example-0"])} } }`);b=ze(b,x,w)}else b=ze(b,x,v)}else{const x=[];for(const w in v)x[w]=[v[w]];b=ze(b,f,x)}}continue}b=ze(b,f,oe(n.properties[f],e,t+1))}if(typeof n.additionalProperties=="object"){const f=n.additionalProperties["x-additionalPropertiesName"]||"property";b=ze(b,`${f}1`,oe(n.additionalProperties,e,t+1)),b=ze(b,`${f}2`,oe(n.additionalProperties,e,t+1))}}}else if(n.type==="array"||n.items)if(n.items||ie(n))if(ie(n))b["example-0"]=ie(n);else if(ie(n.items))b["example-0"]=[ie(n.items)];else{const g=oe(n.items,e,t+1);let f=0;for(const y in g)b[`example-${f}`]=[g[y]],En(n.items,b[`example-${f}`]),f++}else b["example-0"]=[];else return{"example-0":kn(n)};return b}}function ii(n,e=0){var t;let a=(n.description||n.title)&&(n.minItems||n.maxItems)?'<span class="descr-expand-toggle">\u2794</span>':"";if(n.title?n.description?a=`${a} <b>${n.title}:</b> ${n.description}<br/>`:a=`${a} ${n.title}<br/>`:n.description&&(a=`${a} ${n.description}<br/>`),n.minItems&&(a=`${a} <b>Min Items:</b> ${n.minItems}`),n.maxItems&&(a=`${a} <b>Max Items:</b> ${n.maxItems}`),n.uniqueItems===!0&&(a=`${a} <b>Must have unique items</b>`),e>0&&(t=n.items)!=null&&t.description){let r="";n.items.minProperties&&(r=`<b>Min Properties:</b> ${n.items.minProperties}`),n.items.maxProperties&&(r=`${r} <b>Max Properties:</b> ${n.items.maxProperties}`),a=`${a} \u2B95 ${r} [ ${n.items.description} ] `}return a}function K(n,e,t=0,a=""){var r;if(n){if(t>8)return{"::type":n.type||"object","::description":n.description||""};if(n.allOf){const s={};if(n.allOf.length===1&&!n.allOf[0].properties&&!n.allOf[0].items){const i=n.allOf[0];return`${$e(i).html}`}n.allOf.map((i,o)=>{if(i.type==="object"||i.properties||i.allOf||i.anyOf||i.oneOf){const l=(i.anyOf||i.oneOf)&&o>0?o:"",c=K(i,{},t+1,l);Object.assign(s,c)}else if(i.type==="array"||i.items){const l=K(i,{},t+1);Object.assign(s,l)}else if(i.type){const l=`prop${Object.keys(s).length}`,c=$e(i);s[l]=`${c.html}`}else return""}),e=s}else if(n.anyOf||n.oneOf){if(e["::description"]=n.description||"",n.type==="object"||n.properties){e["::description"]=n.description||"",e["::type"]="object";for(const o in n.properties)n.required&&n.required.includes(o)?e[`${o}*`]=K(n.properties[o],{},t+1):e[o]=K(n.properties[o],{},t+1)}const s={},i=n.anyOf?"anyOf":"oneOf";n[i].forEach((o,l)=>{if(o.type==="object"||o.properties||o.allOf||o.anyOf||o.oneOf){const c=K(o,{},t+1);s[`::OPTION~${l+1}${o.title?`~${o.title}`:""}`]=c,s[`::OPTION~${l+1}${o.title?`~${o.title}`:""}`]["::readwrite"]="",s["::type"]="xxx-of-option"}else if(o.type==="array"||o.items){const c=K(o,{},t+1);s[`::OPTION~${l+1}${o.title?`~${o.title}`:""}`]=c,s[`::OPTION~${l+1}${o.title?`~${o.title}`:""}`]["::readwrite"]="",s["::type"]="xxx-of-array"}else{const c=`::OPTION~${l+1}${o.title?`~${o.title}`:""}`;s[c]=`${$e(o).html}`,s["::type"]="xxx-of-option"}}),e[n.anyOf?`::ANY~OF ${a}`:`::ONE~OF ${a}`]=s,e["::type"]="object"}else if(Array.isArray(n.type)){const s=JSON.parse(JSON.stringify(n)),i=[],o=[];s.type.forEach(c=>{var d,p;c.match(/integer|number|string|null|boolean/g)?i.push(c):c==="array"&&typeof((d=s.items)==null?void 0:d.type)=="string"&&(p=s.items)!=null&&p.type.match(/integer|number|string|null|boolean/g)?s.items.type==="string"&&s.items.format?i.push(`[${s.items.format}]`):i.push(`[${s.items.type}]`):o.push(c)});let l;if(i.length>0&&(s.type=i.join("\u2503"),l=$e(s),o.length===0))return`${l?.html||""}`;if(o.length>0){e["::type"]="object";const c={"::type":"xxx-of-option"};o.forEach((d,p)=>{if(d==="null")c[`::OPTION~${p+1}`]="NULL~|~~|~~|~~|~~|~~|~~|~~|~";else if("integer, number, string, boolean,".includes(`${d},`)){s.type=Array.isArray(d)?d.join("\u2503"):d;const h=$e(s);c[`::OPTION~${p+1}`]=h.html}else if(d==="object"){const h={"::title":n.title||"","::description":n.description||"","::type":"object","::deprecated":n.deprecated||!1};for(const m in n.properties)n.required&&n.required.includes(m)?h[`${m}*`]=K(n.properties[m],{},t+1):h[m]=K(n.properties[m],{},t+1);c[`::OPTION~${p+1}`]=h}else d==="array"&&(c[`::OPTION~${p+1}`]={"::title":n.title||"","::description":n.description||"","::type":"array","::props":K(n.items,{},t+1)})}),c[`::OPTION~${o.length+1}`]=l?.html||"",e["::ONE~OF"]=c}}else if(n.type==="object"||n.properties){e["::title"]=n.title||"",e["::description"]=ii(n,t),e["::type"]="object",(Array.isArray(n.type)&&n.type.includes("null")||n.nullable)&&(e["::dataTypeLabel"]="object \u2503 null",e["::nullable"]=!0),e["::deprecated"]=n.deprecated||!1,e["::readwrite"]=n.readOnly?"readonly":n.writeOnly?"writeonly":"";for(const s in n.properties)n.required&&n.required.includes(s)?e[`${s}*`]=K(n.properties[s],{},t+1):e[s]=K(n.properties[s],{},t+1);for(const s in n.patternProperties)e[`[pattern: ${s}]`]=K(n.patternProperties[s],{},t+1);n.additionalProperties&&(e["[any-key]"]=K(n.additionalProperties,{},t+1))}else if(n.type==="array"||n.items)e["::title"]=n.title||"",e["::description"]=ii(n,t),e["::type"]="array",(Array.isArray(n.type)&&n.type.includes("null")||n.nullable)&&(e["::dataTypeLabel"]="array \u2503 null",e["::nullable"]=!0),e["::deprecated"]=n.deprecated||!1,e["::readwrite"]=n.readOnly?"readonly":n.writeOnly?"writeonly":"",(r=n.items)!=null&&r.items&&(e["::array-type"]=n.items.items.type),e["::props"]=K(n.items,{},t+1);else{const s=$e(n);return s!=null&&s.html?`${s.html}`:""}return e}}function Nt(n,e,t={},a={},r=!0,s=!0,i="json",o=!1){var l,c;const d=[];if(t)for(const p in t){let h="",m="json";if(e!=null&&e.toLowerCase().includes("json")){if(i==="text")h=typeof t[p].value=="string"?t[p].value:JSON.stringify(t[p].value,void 0,2),m="text";else if(h=t[p].value,typeof t[p].value=="string")try{const b=t[p].value;h=JSON.parse(b),m="json"}catch{m="text",h=t[p].value}}else h=t[p].value,m="text";d.push({exampleId:p,exampleSummary:t[p].summary||p,exampleDescription:t[p].description||"",exampleType:e,exampleValue:h,exampleFormat:m})}else if(a){let p="",h="json";if(e!=null&&e.toLowerCase().includes("json")){if(i==="text")p=typeof a=="string"?a:JSON.stringify(a,void 0,2),h="text";else if(typeof a=="object")p=a,h="json";else if(typeof a=="string")try{p=JSON.parse(a),h="json"}catch{h="text",p=a}}else p=a,h="text";d.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:e,exampleValue:p,exampleFormat:h})}if(d.length===0||o===!0)if(n){const p=ie(n);if(p)d.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:e,exampleValue:p,exampleFormat:e!=null&&e.toLowerCase().includes("json")&&typeof p=="object"?"json":"text"});else if(e!=null&&e.toLowerCase().includes("json")||e!=null&&e.toLowerCase().includes("text")||e!=null&&e.toLowerCase().includes("*/*")||e!=null&&e.toLowerCase().includes("xml")){let h="",m="",b="",g="";e!=null&&e.toLowerCase().includes("xml")?(h=(l=n.xml)!=null&&l.name?`<${n.xml.name} ${n.xml.namespace?`xmlns="${n.xml.namespace}"`:""}>`:"<root>",m=(c=n.xml)!=null&&c.name?`</${n.xml.name}>`:"</root>",b="text"):b=i;const f=oe(n,{includeReadOnly:r,includeWriteOnly:s,useXmlTagForProp:e?.toLowerCase().includes("xml")});let y=0;for(const v in f){if(!f[v])continue;const x=f[v]["::TITLE"]||`Example ${++y}`,w=f[v]["::DESCRIPTION"]||"";e!=null&&e.toLowerCase().includes("xml")?g=`<?xml version="1.0" encoding="UTF-8"?>
|
|
246
|
-
${h}${Sn(f[v],1)}
|
|
247
|
-
${m}`:(ri(f[v]),g=i==="text"?JSON.stringify(f[v],null,2):f[v]),d.push({exampleId:v,exampleSummary:x,exampleDescription:w,exampleType:e,exampleFormat:b,exampleValue:g})}}else e!=null&&e.toLowerCase().includes("jose")?d.push({exampleId:"Example",exampleSummary:"Base64 Encoded",exampleDescription:"",exampleType:e,exampleValue:n.pattern||"bXJpbg==",exampleFormat:"text"}):d.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:e,exampleValue:"",exampleFormat:"text"})}else d.push({exampleId:"Example",exampleSummary:"",exampleDescription:"",exampleType:e,exampleValue:"",exampleFormat:"text"});return d}function ud(n){return n==="application/json"?"json":n==="application/xml"?"xml":null}function hd(n){if(n.schema)return[n.schema,null,null];if(n.content){for(const e of Object.keys(n.content))if(n.content[e].schema)return[n.content[e].schema,ud(e),n.content[e]]}return[null,null,null]}class md extends Q{static get properties(){return{data:{type:Object},renderStyle:{type:String,attribute:"render-style"}}}static get styles(){return[Ce,$n,yt,U`:host{display:flex}:where(button,input[type=checkbox],[tabindex="0"]):focus-visible{box-shadow:var(--focus-shadow)}:where(input[type=text],input[type=password],select,textarea):focus-visible{border-color:var(--primary-color)}.json-tree{font-family:var(--font-mono);font-size:var(--font-size-small);word-break:break-all;line-height:calc(var(--font-size-small) + 6px);text-align:left;direction:ltr;flex:1;min-height:40px;display:inline-block;position:relative;overflow:hidden}.open-bracket{cursor:pointer;border:1px solid #0000;border-radius:3px;padding:0 20px 0 0;display:inline-block}.close-bracket{border:1px solid #0000;border-radius:3px;display:inline-block}.open-bracket:hover{color:var(--primary-color);background:var(--hover-color);border:1px solid var(--border-color)}.open-bracket.expanded:hover~.inside-bracket{border-left:1px solid var(--fg3)}.open-bracket.expanded:hover~.close-bracket{color:var(--primary-color)}.inside-bracket{border-left:1px dotted var(--border-color);padding-left:12px;overflow:hidden}.open-bracket.collapsed+.inside-bracket,.open-bracket.collapsed+.inside-bracket+.close-bracket{display:none}.string{color:var(--green)}.number{color:var(--blue)}.null{color:var(--red)}.boolean{color:var(--purple)}.object{color:var(--fg)}.toolbar{align-items:center;padding:2px;display:flex;position:absolute;top:5px;right:6px}`,He]}render(){return u`<div class="json-tree" @click="${e=>{e.target.classList.contains("btn-copy")?vt(JSON.stringify(this.data,null,2),e):this.toggleExpand(e)}}"><div class="toolbar"><button class="toolbar-btn btn-copy" part="btn btn-fill btn-copy">Copy</button></div>${this.generateTree(this.data,!0)}</div>`}generateTree(e,t=!1){if(e===null)return u`<span class="null">null</span>${t?"":","}`;if(typeof e=="object"&&!(e instanceof Date)){const a=Array.isArray(e)?"array":"pure_object";return Object.keys(e).length===0?u`${Array.isArray(e)?"[ ],":"{ },"}`:u`<div class="open-bracket expanded ${a==="array"?"array":"object"}">${a==="array"?"[":"{"}</div><div class="inside-bracket">${Object.keys(e).map((r,s,i)=>u`<div class="item">${a==="pure_object"?u`"${r}":`:""} ${this.generateTree(e[r],s===i.length-1)}</div>`)}</div><div class="close-bracket">${a==="array"?"]":"}"}${t?"":","}</div>`}return typeof e=="string"||e instanceof Date?u`<span class="${typeof e}">"${e}"</span>${t?"":","}`:u`<span class="${typeof e}">${e}</span>${t?"":","}`}toggleExpand(e){const t=e.target;e.target.classList.contains("open-bracket")&&(t.classList.contains("expanded")?(t.classList.replace("expanded","collapsed"),e.target.innerHTML=e.target.classList.contains("array")?"[...]":"{...}"):(t.classList.replace("collapsed","expanded"),e.target.innerHTML=e.target.classList.contains("array")?"[":"{"))}}customElements.define("json-tree",md);const oi=U`*,:before,:after{box-sizing:border-box}.tr{box-sizing:content-box;border-bottom:1px dotted #0000;flex:none;width:100%;transition:max-height .3s ease-out;display:flex}.td{flex:none;display:block}.key{font-family:var(--font-mono);white-space:normal;word-break:break-all}.collapsed-all-descr .key{overflow:hidden}.expanded-all-descr .key-descr .descr-expand-toggle{display:none}.key-descr .descr-expand-toggle{user-select:none;color:var(--fg);cursor:pointer;transition:transform .2s;display:inline-block;transform:rotate(45deg)}.expanded-descr .key-descr .descr-expand-toggle{transform:rotate(270deg)}.key-descr .descr-expand-toggle:hover{color:var(--primary-color)}.expanded-descr .more-content{display:none}.key-descr{font-family:var(--font-regular);color:var(--light-fg);text-overflow:ellipsis;flex-shrink:1;display:none;overflow:hidden}.expanded-descr .key-descr{max-height:auto;display:none;overflow:hidden}.xxx-of-key{font-size:calc(var(--font-size-small) - 2px);background:var(--primary-color);color:var(--primary-color-invert);font-weight:700;line-height:calc(var(--font-size-small) + 6px);border-radius:2px;margin-bottom:1px;padding:0 5px;display:inline-block}.xxx-of-descr{font-family:var(--font-regular);color:var(--primary-color);font-size:calc(var(--font-size-small) - 1px);margin-inline-start:2px}.stri,.string,.uri,.url,.byte,.bina,.date,.pass,.ipv4,.ipv4,.uuid,.emai,.host{color:var(--green)}.inte,.numb,.number,.int6,.int3,.floa,.doub,.deci .blue{color:var(--blue)}.null{color:var(--red)}.bool,.boolean{color:var(--orange)}.enum,.cons{color:var(--purple)}.recu{color:var(--brown)}.toolbar{width:100%;color:var(--primary-color);padding:2px 0;display:flex}.toolbar-item{cursor:pointer;margin:0 2px;padding:5px 0}.schema-root-type{cursor:auto;color:var(--fg2);text-transform:uppercase;font-weight:700}.toolbar-item:first-of-type{margin:0 2px 0 0}@container (width>=500px){.key-descr,.expanded-descr .key-descr{display:block}}`;class fd extends Q{static get properties(){return{data:{type:Object},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"}}}connectedCallback(){super.connectedCallback(),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),(!this.schemaDescriptionExpanded||!"true false".includes(this.schemaDescriptionExpanded))&&(this.schemaDescriptionExpanded="false"),(!this.schemaHideReadOnly||!"true false".includes(this.schemaHideReadOnly))&&(this.schemaHideReadOnly="true"),(!this.schemaHideWriteOnly||!"true false".includes(this.schemaHideWriteOnly))&&(this.schemaHideWriteOnly="true")}static get styles(){return[Ce,oi,$n,U`.tree{font-size:var(--font-size-small);text-align:left;line-height:calc(var(--font-size-small) + 6px);direction:ltr}.tree .tr:hover{background:var(--hover-color)}.collapsed-all-descr .tr:not(.expanded-descr){max-height:calc(var(--font-size-small) + 8px);overflow:hidden}.tree .key{max-width:300px}.tr.expanded:hover>.td.key>.open-bracket{color:var(--primary-color)}.tr.expanded:hover+.inside-bracket{border-left:1px solid var(--fg3)}.tr.expanded:hover+.inside-bracket+.close-bracket{color:var(--primary-color)}.inside-bracket.xxx-of-option{border-left:1px solid #0000}.open-bracket{cursor:pointer;border:1px solid #0000;border-radius:3px;padding:0 20px 0 0;display:inline-block}.open-bracket:hover{color:var(--primary-color);background:var(--hover-color);border:1px solid var(--border-color)}.close-bracket{font-family:var(--font-mono);display:inline-block}.tr.collapsed+.inside-bracket,.tr.collapsed+.inside-bracket+.close-bracket{display:none;overflow:hidden}.inside-bracket.object,.inside-bracket.array{border-left:1px dotted var(--border-color)}`,He]}render(){var e,t,a;return u`<div class="tree ${this.schemaDescriptionExpanded==="true"?"expanded-all-descr":"collapsed-all-descr"}" @click="${r=>this.handleAllEvents(r)}"><div class="toolbar"><div class="toolbar-item schema-root-type ${((e=this.data)==null?void 0:e["::type"])||""}">${((t=this.data)==null?void 0:t["::type"])||""}</div>${this.allowSchemaDescriptionExpandToggle==="true"?u`<div style="flex:1"></div><div part="schema-toolbar-item schema-multiline-toggle" class="toolbar-item schema-multiline-toggle">${this.schemaDescriptionExpanded==="true"?"Single line description":"Multiline description"}</div>`:""}</div><span part="schema-description" class="m-markdown">${I(z(A(((a=this.data)==null?void 0:a["::description"])||"")))}</span> ${this.data?u`${this.generateTree(this.data["::type"]==="array"?this.data["::props"]:this.data,this.data["::type"],this.data["::array-type"]||"")}`:u`<span class="mono-font" style="color:var(--red)">Schema not found</span>`}</div>`}generateTree(e,t="object",a="",r="",s="",i=0,o=0,l="",c=!1){var d,p;if(this.schemaHideReadOnly==="true"&&(t==="array"&&l==="readonly"||e?.["::readwrite"]==="readonly")||this.schemaHideWriteOnly==="true"&&(t==="array"&&l==="writeonly"||e?.["::readwrite"]==="writeonly"))return;if(!e)return u`<div class="null" style="display:inline"><span class="key-label xxx-of-key">${r.replace("::OPTION~","")}</span> ${t==="array"?u`<span class="mono-font">[ ]</span>`:t==="object"?u`<span class="mono-font">{ }</span>`:u`<span class="mono-font">schema undefined</span>`}</div>`;if(Object.keys(e).length===0)return u`<span class="key object">${r}:{ }</span>`;let h="",m="";r.startsWith("::ONE~OF")||r.startsWith("::ANY~OF")?h=r.replace("::","").replace("~"," "):r.startsWith("::OPTION")?[,h,m]=r.split("~"):h=r;const b=12,g=400-o*b;let f="",y="";const v=(d=e["::type"])!=null&&d.startsWith("xxx-of")?i:i+1,x=t==="xxx-of-option"||e["::type"]==="xxx-of-option"||r.startsWith("::OPTION")?o:o+1;if(e["::type"]==="object")t==="array"?(i<this.schemaExpandLevel?f=u`<span class="open-bracket array-of-object">[{</span>`:f=u`<span class="open-bracket array-of-object">[{...}]</span>`,y="}]"):(i<this.schemaExpandLevel?f=u`<span class="open-bracket object">${e["::nullable"]?"null\u2503":""}{</span>`:f=u`<span class="open-bracket object">${e["::nullable"]?"null\u2503":""}{...}</span>`,y="}");else if(e["::type"]==="array")if(t==="array"){const B=a!=="object"?a:"";i<this.schemaExpandLevel?f=u`<span class="open-bracket array-of-array" data-array-type="${B}">[[ ${B}</span>`:f=u`<span class="open-bracket array-of-array" data-array-type="${B}">[[...]]</span>`,y="]]"}else i<this.schemaExpandLevel?f=u`<span class="open-bracket array">[</span>`:f=u`<span class="open-bracket array">[...]</span>`,y="]";if(typeof e=="object")return u`<div class="tr ${i<this.schemaExpandLevel||(p=e["::type"])!=null&&p.startsWith("xxx-of")?"expanded":"collapsed"} ${e["::type"]||"no-type-info"}${e["::nullable"]?" nullable":""}" title="${c||e["::deprecated"]?"Deprecated":""}"><div class="td key ${c||e["::deprecated"]?"deprecated":""}" style="min-width:${g}px">${e["::type"]==="xxx-of-option"||e["::type"]==="xxx-of-array"||r.startsWith("::OPTION")?u`<span class="key-label xxx-of-key">${h}</span><span class="xxx-of-descr">${m}</span>`:h==="::props"||h==="::ARRAY~OF"?"":i>0?u`<span class="key-label" title="${l==="readonly"?"Read-Only":l==="writeonly"?"Write-Only":""}">${c||e["::deprecated"]?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${h.replace(/\*$/,"")}${h.endsWith("*")?u`<span style="color:var(--red)">*</span>`:""}${l==="readonly"?u`🆁`:l==="writeonly"?u`🆆`:l}:</span>`:""} ${f}</div><div class="td key-descr m-markdown-small">${I(z(A(s||"")))}</div></div><div class="inside-bracket ${e["::type"]||"no-type-info"}" style="padding-left:${e["::type"]==="xxx-of-option"||e["::type"]==="xxx-of-array"?0:b}px">${Array.isArray(e)&&e[0]?u`${this.generateTree(e[0],"xxx-of-option","","::ARRAY~OF","",v,x,e[0]["::readwrite"],c||e[0]["::deprecated"])}`:u`${Object.keys(e).map(B=>{var za;return u`${["::title","::description","::type","::props","::deprecated","::array-type","::readwrite","::dataTypeLabel","::nullable"].includes(B)?e[B]["::type"]==="array"||e[B]["::type"]==="object"?u`${this.generateTree(e[B]["::type"]==="array"?e[B]["::props"]:e[B],e[B]["::type"],e[B]["::array-type"]||"",B,e[B]["::description"],v,x,e[B]["::readwrite"]?e[B]["::readwrite"]:"",c||e[B]["::deprecated"])}`:"":u`${this.generateTree(e[B]["::type"]==="array"?e[B]["::props"]:e[B],e[B]["::type"],e[B]["::array-type"]||"",B,((za=e[B])==null?void 0:za["::description"])||"",v,x,e[B]["::readwrite"]?e[B]["::readwrite"]:"",c||e[B]["::deprecated"])}`}`})}`}</div>${e["::type"]&&e["::type"].includes("xxx-of")?"":u`<div class="close-bracket">${y}</div>`}`;const[w,k,$,S,E,N,_,V,D]=e.split("~|~");if(k==="\u{1F181}"&&this.schemaHideReadOnly==="true"||k==="\u{1F186}"&&this.schemaHideWriteOnly==="true")return;const T=w.replace(/┃.*/g,"").replace(/[^a-zA-Z0-9+]/g,"").substring(0,4).toLowerCase(),C=`${$||S||E||N?`<span class="descr-expand-toggle ${this.schemaDescriptionExpanded==="true"?"expanded-descr":""}">\u2794</span>`:""}`;let R="",Z="";return t==="array"?l==="readonly"?(R="\u{1F181}",Z="Read-Only"):l==="writeonly"&&(R="\u{1F186}",Z="Write-Only"):k==="\u{1F181}"?(R="\u{1F181}",Z="Read-Only"):k==="\u{1F186}"&&(R="\u{1F186}",Z="Write-Only"),u`<div class="tr primitive" title="${D?"Deprecated":""}"><div class="td key ${c||D}" style="min-width:${g}px">${c||D?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${h.endsWith("*")?u`<span class="key-label">${h.substring(0,h.length-1)}</span><span style="color:var(--red)">*</span>:`:r.startsWith("::OPTION")?u`<span class="key-label xxx-of-key">${h}</span><span class="xxx-of-descr">${m}</span>`:u`<span class="key-label">${h}:</span>`} <span class="${T}" title="${Z}">${t==="array"?`[${w}]`:`${w}`} ${R}</span></div><div class="td key-descr">${s||V||_?u`${u`<span class="m-markdown-small">${I(z(A(t==="array"?`${C} ${s}`:V?`${C} <b>${V}:</b> ${_}`:`${C} ${_}`)))}</span>`}`:""} ${$?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${$}</div>`:""} ${S?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Default: </span>${S}</div>`:""} ${E?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">${w==="const"?"Value":"Allowed"}: </span>${E}</div>`:""} ${N?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Pattern: </span>${N}</div>`:""}</div></div>`}handleAllEvents(e){if(e.target.classList.contains("open-bracket"))this.toggleObjectExpand(e);else if(e.target.classList.contains("schema-multiline-toggle"))this.schemaDescriptionExpanded=this.schemaDescriptionExpanded==="true"?"false":"true";else if(e.target.classList.contains("descr-expand-toggle")){const t=e.target.closest(".tr");t&&(t.classList.toggle("expanded-descr"),t.style.maxHeight=t.scrollHeight)}}toggleObjectExpand(e){const t=e.target.closest(".tr"),a=t.classList.contains("nullable");t.classList.contains("expanded")?(t.classList.replace("expanded","collapsed"),e.target.innerHTML=e.target.classList.contains("array-of-object")?"[{...}]":e.target.classList.contains("array-of-array")?"[[...]]":e.target.classList.contains("array")?"[...]":`${a?"null\u2503":""}{...}`):(t.classList.replace("collapsed","expanded"),e.target.innerHTML=e.target.classList.contains("array-of-object")?"[{":e.target.classList.contains("array-of-array")?`[[ ${e.target.dataset.arrayType}`:e.target.classList.contains("object")?`${a?"null\u2503":""}{`:"[")}}customElements.define("schema-tree",fd);class gd extends Q{render(){let e="";return Array.isArray(this.value)&&(e=u`${this.value.filter(t=>typeof t=="string"&&t.trim()!=="").map(t=>u`<span class="tag">${t}</span>`)}`),u`<div class="tags">${e} <input type="text" class="editor" @paste="${t=>this.afterPaste(t)}" @keydown="${this.afterKeyDown}" @blur="${this.onBlur}" placeholder="${this.placeholder||""}"></div>`}static get properties(){return{placeholder:{type:String},value:{type:Array,attribute:"value"}}}attributeChangedCallback(e,t,a){e==="value"&&a&&t!==a&&(this.value=a.split(",").filter(r=>r.trim()!=="")),super.attributeChangedCallback(e,t,a)}afterPaste(e){const t=(e.clipboardData||window.clipboardData).getData("Text"),a=t?t.split(",").filter(r=>r.trim()!==""):"";a&&(Array.isArray(this.value)?this.value=[...this.value,...a]:this.value=a),e.preventDefault()}afterKeyDown(e){e.keyCode===13?(e.stopPropagation(),e.preventDefault(),e.target.value&&(Array.isArray(this.value)?this.value=[...this.value,e.target.value]:this.value=[e.target.value],e.target.value="")):e.keyCode===8&&e.target.value.length===0&&Array.isArray(this.value)&&this.value.length>0&&(this.value.splice(-1),this.value=[...this.value])}onBlur(e){e.target.value&&(Array.isArray(this.value)?this.value=[...this.value,e.target.value]:this.value=[e.target.value],e.target.value="")}static get styles(){return[U`.tags{border-radius:var(--border-radius);border:1px solid var(--border-color);cursor:text;background:var(--input-bg);outline:none;flex-wrap:wrap;padding:0;display:flex;overflow:hidden}.tag,.editor{margin:2px;padding:3px}.tag{border:1px solid var(--border-color);background:var(--bg3);color:var(--fg3);border-radius:var(--border-radius);word-break:break-all;font-size:var(--font-size-small)}.tag:hover~#cursor{display:block}.editor{color:var(--fg);min-width:60px;line-height:inherit;font-family:inherit;font-size:calc(var(--font-size-small) + 1px);background:0 0;border:1px solid #0000;outline:none;flex:1}.editor:focus-visible{outline:1px solid}.editor::placeholder{color:var(--placeholder-color);opacity:1}`]}}customElements.define("tag-input",gd);class bd extends Q{constructor(){super(),this.responseMessage="",this.responseStatus="success",this.responseHeaders="",this.responseText="",this.responseUrl="",this.curlSyntax="",this.activeResponseTab="response",this.selectedRequestBodyType="",this.selectedRequestBodyExample="",this.activeParameterSchemaTabs={}}static get properties(){return{serverUrl:{type:String,attribute:"server-url"},servers:{type:Array},method:{type:String},path:{type:String},security:{type:Array},parameters:{type:Array},request_body:{type:Object},api_keys:{type:Array},parser:{type:Object},accept:{type:String},callback:{type:String},webhook:{type:String},responseMessage:{type:String,attribute:!1},responseText:{type:String,attribute:!1},responseHeaders:{type:String,attribute:!1},responseStatus:{type:String,attribute:!1},responseUrl:{type:String,attribute:!1},curlSyntax:{type:String,attribute:!1},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},allowTry:{type:String,attribute:"allow-try"},showCurlBeforeTry:{type:String,attribute:"show-curl-before-try"},renderStyle:{type:String,attribute:"render-style"},schemaStyle:{type:String,attribute:"schema-style"},activeSchemaTab:{type:String,attribute:"active-schema-tab"},activeParameterSchemaTabs:{type:Object,converter:{fromAttribute:e=>JSON.parse(e),toAttribute:e=>JSON.stringify(e)},attribute:"active-parameter-schema-tabs"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},fetchCredentials:{type:String,attribute:"fetch-credentials"},activeResponseTab:{type:String},selectedRequestBodyType:{type:String,attribute:"selected-request-body-type"},selectedRequestBodyExample:{type:String,attribute:"selected-request-body-example"}}}static get styles(){return[Zt,yt,Ce,Vt,$n,Jt,Wn,U`*,:before,:after{box-sizing:border-box}:where(button,input[type=checkbox],[tabindex="0"]):focus-visible{box-shadow:var(--focus-shadow)}:where(input[type=text],input[type=password],select,textarea):focus-visible{border-color:var(--primary-color)}tag-input:focus-within{outline:1px solid}.read-mode{margin-top:24px}.param-name,.param-type{text-align:right;line-height:var(--font-size-small);margin:1px 0}.param-name{color:var(--fg);font-family:var(--font-mono)}.param-name.deprecated{color:var(--red)}.param-type{color:var(--light-fg);font-family:var(--font-regular)}.param-constraint{min-width:100px}.param-constraint:empty{display:none}.top-gap{margin-top:24px}.textarea{resize:vertical;direction:ltr;min-height:220px;padding:5px}.example:first-child{margin-top:-9px}.response-message{text-overflow:ellipsis;font-weight:700}.response-message.error{color:var(--red)}.response-message.success{color:var(--blue)}.file-input-container{align-items:flex-end}.file-input-container .input-set:first-child .file-input-remove-btn{visibility:hidden}.file-input-remove-btn{color:var(--red);cursor:pointer;background:0 0;border:none;outline:none;font-size:16px}.v-tab-btn{font-size:var(--smal-font-size);opacity:.3;cursor:pointer;background:0 0;border:none;height:24px;padding:4px 8px}.v-tab-btn.active{background:var(--bg);opacity:1;font-weight:700}@container (width>=768px){.textarea{padding:8px}}@container (width<=470px){.hide-in-small-screen{display:none}}`,He]}render(){return u`<div class="col regular-font request-panel ${"read focused".includes(this.renderStyle)||this.callback==="true"?"read-mode":"view-mode"}"><div class="${this.callback==="true"?"tiny-title":"req-res-title"}">${this.callback==="true"?"CALLBACK REQUEST":"REQUEST"}</div><div>${wn([this.method,this.path,this.allowTry,this.parameters,this.activeParameterSchemaTabs],()=>this.inputParametersTemplate("path"))} ${wn([this.method,this.path,this.allowTry,this.parameters,this.activeParameterSchemaTabs],()=>this.inputParametersTemplate("query"))} ${this.requestBodyTemplate()} ${wn([this.method,this.path,this.allowTry,this.parameters,this.activeParameterSchemaTabs],()=>this.inputParametersTemplate("header"))} ${wn([this.method,this.path,this.allowTry,this.parameters,this.activeParameterSchemaTabs],()=>this.inputParametersTemplate("cookie"))} ${this.allowTry==="false"?"":u`${this.apiCallTemplate()}`}</div></div>`}async updated(){var e,t;this.showCurlBeforeTry==="true"&&this.applyCURLSyntax(this.shadowRoot),Kt(((t=(e=this.getRootNode())==null?void 0:e.host)==null?void 0:t.shadowRoot)||this.shadowRoot),this.webhook==="true"&&(this.allowTry="false")}async saveExampleState(){this.renderStyle==="focused"&&([...this.shadowRoot.querySelectorAll("textarea.request-body-param-user-input")].forEach(e=>{e.dataset.user_example=e.value}),[...this.shadowRoot.querySelectorAll('textarea[data-ptype="form-data"]')].forEach(e=>{e.dataset.user_example=e.value}),this.requestUpdate())}async updateExamplesFromDataAttr(){this.renderStyle==="focused"&&([...this.shadowRoot.querySelectorAll("textarea.request-body-param-user-input")].forEach(e=>{e.value=e.dataset.user_example||e.dataset.example}),[...this.shadowRoot.querySelectorAll('textarea[data-ptype="form-data"]')].forEach(e=>{e.value=e.dataset.user_example||e.dataset.example}),this.requestUpdate())}renderExample(e,t,a){var r,s;return u`${t==="array"?"[":""} <a part="anchor anchor-param-example" style="display:inline-block;min-width:24px;text-align:center" class="${this.allowTry==="true"?"":"inactive-link"}" data-example-type="${t==="array"?t:"string"}" data-example="${e.value&&Array.isArray(e.value)?(r=e.value)==null?void 0:r.join("~|~"):(typeof e.value=="object"?JSON.stringify(e.value,null,2):e.value)||""}" title="${e.value&&Array.isArray(e.value)?(s=e.value)==null?void 0:s.join("~|~"):(typeof e.value=="object"?JSON.stringify(e.value,null,2):e.value)||""}" @click="${i=>{const o=i.target.closest("table").querySelector(`[data-pname="${a}"]`);o&&(o.value=i.target.dataset.exampleType==="array"?i.target.dataset.example.split("~|~"):i.target.dataset.example)}}">${e.printableValue||e.value} </a>${t==="array"?"] ":""}`}renderShortFormatExamples(e,t,a){return u`${e.map((r,s)=>u`${s===0?"":"\u2503"} ${this.renderExample(r,t,a)}`)}`}renderLongFormatExamples(e,t,a){return u`<ul style="list-style-type:disclosure-closed">${e.map(r=>{var s,i;return u`<li>${this.renderExample(r,t,a)} ${((s=r.summary)==null?void 0:s.length)>0?u`<span>(${r.summary})</span>`:""} ${((i=r.description)==null?void 0:i.length)>0?u`<p>${I(z(A(r.description)))}</p>`:""}</li>`})}</ul>`}exampleListTemplate(e,t,a=[]){return u`${a.length>0?u`<span style="font-weight:700">Examples: </span>${pd(a)?this.renderLongFormatExamples(a,t,e):this.renderShortFormatExamples(a,t,e)}`:""}`}inputParametersTemplate(e){var t;const a=this.parameters?this.parameters.filter(i=>i.in===e):[];if(a.length===0)return"";let r="";e==="path"?r="PATH PARAMETERS":e==="query"?r="QUERY-STRING PARAMETERS":e==="header"?r="REQUEST HEADERS":e==="cookie"&&(r="COOKIES");const s=[];for(const i of a){const[o,l,c]=hd(i);if(!o)continue;const d=$e(o);if(!d)continue;const p=K(o,{});let h="form",m=!0,b=!1;(e==="query"||e==="header"||e==="path")&&(i.style&&"form spaceDelimited pipeDelimited".includes(i.style)?h=i.style:l&&(h=l),typeof i.explode=="boolean"&&(m=i.explode),typeof i.allowReserved=="boolean"&&(b=i.allowReserved));const g=ai(se(i.examples)||se(i.example)||se(c?.example)||se(c?.examples)||se(d.examples)||se(d.example),d.type);!g.exampleVal&&d.type==="object"&&(g.exampleVal=((t=Nt(o,l||"json",{},{},this.callback==="true"||this.webhook==="true",!(this.callback==="true"||this.webhook==="true"),!0,"text")[0])==null?void 0:t.exampleValue)||"");const f="read focused".includes(this.renderStyle)?"200px":"160px";s.push(u`<tr title="${i.deprecated?"Deprecated":""}"><td rowspan="${this.allowTry==="true"?"1":"2"}" style="width:${f};min-width:100px"><div class="param-name ${i.deprecated?"deprecated":""}">${i.deprecated?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${i.required?u`<span style="color:var(--red)">*</span>`:""} ${i.name}</div><div class="param-type">${d.type==="array"?`${d.arrayType}`:`${d.format?d.format:d.type}`}</div></td>${this.allowTry==="true"?u`<td style="min-width:100px" colspan="${d.default||d.constrain||d.allowedValues||d.pattern?"1":"2"}">${d.type==="array"?u`<tag-input class="request-param" id="tag-input-request-param-${i.name}" style="width:100%" data-ptype="${e}" data-pname="${i.name}" data-example="${Array.isArray(g.exampleVal)?g.exampleVal.join("~|~"):g.exampleVal}" data-param-serialize-style="${h}" data-param-serialize-explode="${m}" data-param-allow-reserved="${b}" data-x-fill-example="${i["x-fill-example"]||"yes"}" data-array="true" placeholder="add-multiple ↩" .value="${i["x-fill-example"]==="no"?[]:Ia(this.fillRequestFieldsWithExample==="true"?Array.isArray(g.exampleVal)?g.exampleVal:[g.exampleVal]:[])}"></tag-input>`:d.type==="object"?u`<div part="tab-panel" class="tab-panel col" style="border-width:0 0 1px 0"><div part="tab-btn-row" class="tab-buttons row" @click="${y=>{if(y.target.tagName.toLowerCase()==="button"){const v={...this.activeParameterSchemaTabs};v[i.name]=y.target.dataset.tab,this.activeParameterSchemaTabs=v}}}"><button part="tab-btn" class="tab-btn ${this.activeParameterSchemaTabs[i.name]==="example"?"active":""}" data-tab="example">EXAMPLE</button> <button part="tab-btn" class="tab-btn ${this.activeParameterSchemaTabs[i.name]!=="example"?"active":""}" data-tab="schema">SCHEMA</button></div>${u`<div part="tab-content" class="tab-content col" data-tab="example" style="display:${this.activeParameterSchemaTabs[i.name]==="example"?"block":"none"};padding-left:5px;width:100%"><textarea id="textarea-request-param-${i.name}" class="textarea request-param" part="textarea textarea-param" data-ptype="${e}-object" data-pname="${i.name}" data-example="${g.exampleVal}" data-param-serialize-style="${h}" data-param-serialize-explode="${m}" data-param-allow-reserved="${b}" data-x-fill-example="${i["x-fill-example"]||"yes"}" spellcheck="false" .textContent="${i["x-fill-example"]==="no"?"":Ia(this.fillRequestFieldsWithExample==="true"?typeof g.exampleVal=="object"?JSON.stringify(g.exampleVal,null,2):g.exampleVal:"")}" style="resize:vertical;width:100%;height:${"read focused".includes(this.renderStyle)?"180px":"120px"}" @input="${y=>{const v=this.getRequestPanel(y);this.liveCURLSyntaxUpdate(v)}}"></textarea></div>`} ${u`<div part="tab-content" class="tab-content col" data-tab="schema" style="display:${this.activeParameterSchemaTabs[i.name]!=="example"?"block":"none"};padding-left:5px;width:100%"><schema-tree class="json" style="display:block" .data="${p}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly.includes(this.method)}" schema-hide-write-only="${this.schemaHideWriteOnly.includes(this.method)}" exportparts="wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
|
|
247
|
+
*/const Od=n=>n??P;function Nd(n,{indentor:e=" ",textNodesOnSameLine:t=!0}={}){var a,r;if(!n||typeof n!="string")return"";const s=n.split(/(<[^>]+>)/g).map(l=>l.trim()).filter(Boolean);let i=0;const o=[];for(let l=0;l<s.length;l++){const c=s[l],d=/^<\//.test(c),p=/\/>$/.test(c),h=/^<[^/!?]/.test(c)&&!p;d&&(i=Math.max(0,i-1));const m=e.repeat(i);if(t&&h&&l+2<s.length&&!s[l+1].startsWith("<")&&s[l+2].startsWith("</")){const y=(a=c.match(/^<([a-zA-Z0-9_\-:]+)/))==null?void 0:a[1],g=(r=s[l+2].match(/^<\/([a-zA-Z0-9_\-:]+)/))==null?void 0:r[1];if(y&&g&&y===g){o.push(`${m}${c}${s[l+1]}${s[l+2]}`),l+=2;continue}}o.push(`${m}${c}`),h&&i++}return o.join(`
|
|
248
|
+
`)}const _n=U`.border-top{border-top:1px solid var(--border-color)}.border{border:1px solid var(--border-color);border-radius:var(--border-radius)}.light-border{border:1px solid var(--light-border-color);border-radius:var(--border-radius)}.pad-8-16{padding:8px 16px}.pad-top-8{padding-top:8px}.mar-top-8{margin-top:8px}`;class Bd extends ee{static get properties(){return{data:{type:Object},renderStyle:{type:String,attribute:"render-style"}}}static get styles(){return[Fe,_n,$t,U`:host{display:flex}:where(button,input[type=checkbox],[tabindex="0"]):focus-visible{box-shadow:var(--focus-shadow)}:where(input[type=text],input[type=password],select,textarea):focus-visible{border-color:var(--primary-color)}.json-tree{font-family:var(--font-mono);font-size:var(--font-size-small);word-break:break-all;line-height:calc(var(--font-size-small) + 6px);text-align:left;direction:ltr;flex:1;min-height:40px;display:inline-block;position:relative;overflow:hidden}.open-bracket{cursor:pointer;border:1px solid #0000;border-radius:3px;padding:0 20px 0 0;display:inline-block}.close-bracket{border:1px solid #0000;border-radius:3px;display:inline-block}.open-bracket:hover{color:var(--primary-color);background:var(--hover-color);border:1px solid var(--border-color)}.open-bracket.expanded:hover~.inside-bracket{border-left:1px solid var(--fg3)}.open-bracket.expanded:hover~.close-bracket{color:var(--primary-color)}.inside-bracket{border-left:1px dotted var(--border-color);padding-left:12px;overflow:hidden}.open-bracket.collapsed+.inside-bracket,.open-bracket.collapsed+.inside-bracket+.close-bracket{display:none}.string{color:var(--green)}.number{color:var(--blue)}.null{color:var(--red)}.boolean{color:var(--purple)}.object{color:var(--fg)}.toolbar{align-items:center;padding:2px;display:flex;position:absolute;top:5px;right:6px}`,Ke]}render(){return u`<div class="json-tree" @click="${e=>{e.target.classList.contains("btn-copy")?kt(JSON.stringify(this.data,null,2),e):this.toggleExpand(e)}}"><div class="toolbar"><button class="toolbar-btn btn-copy" part="btn btn-fill btn-copy">Copy</button></div>${this.generateTree(this.data,!0)}</div>`}generateTree(e,t=!1){if(e===null)return u`<span class="null">null</span>${t?"":","}`;if(typeof e=="object"&&!(e instanceof Date)){const a=Array.isArray(e)?"array":"pure_object";return Object.keys(e).length===0?u`${Array.isArray(e)?"[ ],":"{ },"}`:u`<div class="open-bracket expanded ${a==="array"?"array":"object"}">${a==="array"?"[":"{"}</div><div class="inside-bracket">${Object.keys(e).map((r,s,i)=>u`<div class="item">${a==="pure_object"?u`"${r}":`:""} ${this.generateTree(e[r],s===i.length-1)}</div>`)}</div><div class="close-bracket">${a==="array"?"]":"}"}${t?"":","}</div>`}return typeof e=="string"||e instanceof Date?u`<span class="${typeof e}">"${e}"</span>${t?"":","}`:u`<span class="${typeof e}">${e}</span>${t?"":","}`}toggleExpand(e){const t=e.target;e.target.classList.contains("open-bracket")&&(t.classList.contains("expanded")?(t.classList.replace("expanded","collapsed"),e.target.innerHTML=e.target.classList.contains("array")?"[...]":"{...}"):(t.classList.replace("collapsed","expanded"),e.target.innerHTML=e.target.classList.contains("array")?"[":"{"))}}customElements.define("json-tree",Bd);const Si=U`*,:before,:after{box-sizing:border-box}.tr{box-sizing:content-box;border-bottom:1px dotted #0000;flex:none;width:100%;transition:max-height .3s ease-out;display:flex}.td{flex:none;display:block}.key{font-family:var(--font-mono);white-space:normal;word-break:break-all}.collapsed-all-descr .key{overflow:hidden}.expanded-all-descr .key-descr .descr-expand-toggle{display:none}.key-descr .descr-expand-toggle{user-select:none;color:var(--fg);cursor:pointer;transition:transform .2s;display:inline-block;transform:rotate(45deg)}.expanded-descr .key-descr .descr-expand-toggle{transform:rotate(270deg)}.key-descr .descr-expand-toggle:hover{color:var(--primary-color)}.expanded-descr .more-content{display:none}.key-descr{font-family:var(--font-regular);color:var(--light-fg);text-overflow:ellipsis;flex-shrink:1;display:none;overflow:hidden}.expanded-descr .key-descr{max-height:auto;display:none;overflow:hidden}.xxx-of-key{font-size:calc(var(--font-size-small) - 2px);background:var(--primary-color);color:var(--primary-color-invert);font-weight:700;line-height:calc(var(--font-size-small) + 6px);border-radius:2px;margin-bottom:1px;padding:0 5px;display:inline-block}.xxx-of-descr{font-family:var(--font-regular);color:var(--primary-color);font-size:calc(var(--font-size-small) - 1px);margin-inline-start:2px}.stri,.string,.uri,.url,.byte,.bina,.date,.pass,.ipv4,.ipv4,.uuid,.emai,.host{color:var(--green)}.inte,.numb,.number,.int6,.int3,.floa,.doub,.deci .blue{color:var(--blue)}.null{color:var(--red)}.bool,.boolean{color:var(--orange)}.enum,.cons{color:var(--purple)}.recu{color:var(--brown)}.toolbar{width:100%;color:var(--primary-color);padding:2px 0;display:flex}.toolbar-item{cursor:pointer;margin:0 2px;padding:5px 0}.schema-root-type{cursor:auto;color:var(--fg2);text-transform:uppercase;font-weight:700}.toolbar-item:first-of-type{margin:0 2px 0 0}@container (width>=500px){.key-descr,.expanded-descr .key-descr{display:block}}`;class Ld extends ee{static get properties(){return{data:{type:Object},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"}}}connectedCallback(){super.connectedCallback(),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),(!this.schemaDescriptionExpanded||!"true false".includes(this.schemaDescriptionExpanded))&&(this.schemaDescriptionExpanded="false"),(!this.schemaHideReadOnly||!"true false".includes(this.schemaHideReadOnly))&&(this.schemaHideReadOnly="true"),(!this.schemaHideWriteOnly||!"true false".includes(this.schemaHideWriteOnly))&&(this.schemaHideWriteOnly="true")}static get styles(){return[Fe,Si,_n,U`.tree{font-size:var(--font-size-small);text-align:left;line-height:calc(var(--font-size-small) + 6px);direction:ltr}.tree .tr:hover{background:var(--hover-color)}.collapsed-all-descr .tr:not(.expanded-descr){max-height:calc(var(--font-size-small) + 8px);overflow:hidden}.tree .key{max-width:300px}.tr.expanded:hover>.td.key>.open-bracket{color:var(--primary-color)}.tr.expanded:hover+.inside-bracket{border-left:1px solid var(--fg3)}.tr.expanded:hover+.inside-bracket+.close-bracket{color:var(--primary-color)}.inside-bracket.xxx-of-option{border-left:1px solid #0000}.open-bracket{cursor:pointer;border:1px solid #0000;border-radius:3px;padding:0 20px 0 0;display:inline-block}.open-bracket:hover{color:var(--primary-color);background:var(--hover-color);border:1px solid var(--border-color)}.close-bracket{font-family:var(--font-mono);display:inline-block}.tr.collapsed+.inside-bracket,.tr.collapsed+.inside-bracket+.close-bracket{display:none;overflow:hidden}.inside-bracket.object,.inside-bracket.array{border-left:1px dotted var(--border-color)}`,Ke]}render(){var e,t,a;return u`<div class="tree ${this.schemaDescriptionExpanded==="true"?"expanded-all-descr":"collapsed-all-descr"}" @click="${r=>this.handleAllEvents(r)}"><div class="toolbar"><div class="toolbar-item schema-root-type ${((e=this.data)==null?void 0:e["::type"])||""}">${((t=this.data)==null?void 0:t["::type"])||""}</div>${this.allowSchemaDescriptionExpandToggle==="true"?u`<div style="flex:1"></div><div part="schema-toolbar-item schema-multiline-toggle" class="toolbar-item schema-multiline-toggle">${this.schemaDescriptionExpanded==="true"?"Single line description":"Multiline description"}</div>`:""}</div><span part="schema-description" class="m-markdown">${_(z(A(((a=this.data)==null?void 0:a["::description"])||"")))}</span> ${this.data?u`${this.generateTree(this.data["::type"]==="array"?this.data["::props"]:this.data,this.data["::type"],this.data["::array-type"]||"")}`:u`<span class="mono-font" style="color:var(--red)">Schema not found</span>`}</div>`}generateTree(e,t="object",a="",r="",s="",i=0,o=0,l="",c=!1){var d,p;if(this.schemaHideReadOnly==="true"&&(t==="array"&&l==="readonly"||e?.["::readwrite"]==="readonly")||this.schemaHideWriteOnly==="true"&&(t==="array"&&l==="writeonly"||e?.["::readwrite"]==="writeonly"))return;if(!e)return u`<div class="null" style="display:inline"><span class="key-label xxx-of-key">${r.replace("::OPTION~","")}</span> ${t==="array"?u`<span class="mono-font">[ ]</span>`:t==="object"?u`<span class="mono-font">{ }</span>`:u`<span class="mono-font">schema undefined</span>`}</div>`;if(Object.keys(e).length===0)return u`<span class="key object">${r}:{ }</span>`;let h="",m="";r.startsWith("::ONE~OF")||r.startsWith("::ANY~OF")?h=r.replace("::","").replace("~"," "):r.startsWith("::OPTION")?[,h,m]=r.split("~"):h=r;const y=12,g=400-o*y;let f="",b="";const v=(d=e["::type"])!=null&&d.startsWith("xxx-of")?i:i+1,w=t==="xxx-of-option"||e["::type"]==="xxx-of-option"||r.startsWith("::OPTION")?o:o+1;if(e["::type"]==="object")t==="array"?(i<this.schemaExpandLevel?f=u`<span class="open-bracket array-of-object">[{</span>`:f=u`<span class="open-bracket array-of-object">[{...}]</span>`,b="}]"):(i<this.schemaExpandLevel?f=u`<span class="open-bracket object">${e["::nullable"]?"null\u2503":""}{</span>`:f=u`<span class="open-bracket object">${e["::nullable"]?"null\u2503":""}{...}</span>`,b="}");else if(e["::type"]==="array")if(t==="array"){const B=a!=="object"?a:"";i<this.schemaExpandLevel?f=u`<span class="open-bracket array-of-array" data-array-type="${B}">[[ ${B}</span>`:f=u`<span class="open-bracket array-of-array" data-array-type="${B}">[[...]]</span>`,b="]]"}else i<this.schemaExpandLevel?f=u`<span class="open-bracket array">[</span>`:f=u`<span class="open-bracket array">[...]</span>`,b="]";if(typeof e=="object")return u`<div class="tr ${i<this.schemaExpandLevel||(p=e["::type"])!=null&&p.startsWith("xxx-of")?"expanded":"collapsed"} ${e["::type"]||"no-type-info"}${e["::nullable"]?" nullable":""}" title="${c||e["::deprecated"]?"Deprecated":""}"><div class="td key ${c||e["::deprecated"]?"deprecated":""}" style="min-width:${g}px">${e["::type"]==="xxx-of-option"||e["::type"]==="xxx-of-array"||r.startsWith("::OPTION")?u`<span class="key-label xxx-of-key">${h}</span><span class="xxx-of-descr">${m}</span>`:h==="::props"||h==="::ARRAY~OF"?"":i>0?u`<span class="key-label" title="${l==="readonly"?"Read-Only":l==="writeonly"?"Write-Only":""}">${c||e["::deprecated"]?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${h.replace(/\*$/,"")}${h.endsWith("*")?u`<span style="color:var(--red)">*</span>`:""}${l==="readonly"?u`🆁`:l==="writeonly"?u`🆆`:l}:</span>`:""} ${f}</div><div class="td key-descr m-markdown-small">${_(z(A(s||"")))}</div></div><div class="inside-bracket ${e["::type"]||"no-type-info"}" style="padding-left:${e["::type"]==="xxx-of-option"||e["::type"]==="xxx-of-array"?0:y}px">${Array.isArray(e)&&e[0]?u`${this.generateTree(e[0],"xxx-of-option","","::ARRAY~OF","",v,w,e[0]["::readwrite"],c||e[0]["::deprecated"])}`:u`${Object.keys(e).map(B=>{var Ya;return u`${["::title","::description","::type","::props","::deprecated","::array-type","::readwrite","::dataTypeLabel","::nullable"].includes(B)?e[B]["::type"]==="array"||e[B]["::type"]==="object"?u`${this.generateTree(e[B]["::type"]==="array"?e[B]["::props"]:e[B],e[B]["::type"],e[B]["::array-type"]||"",B,e[B]["::description"],v,w,e[B]["::readwrite"]?e[B]["::readwrite"]:"",c||e[B]["::deprecated"])}`:"":u`${this.generateTree(e[B]["::type"]==="array"?e[B]["::props"]:e[B],e[B]["::type"],e[B]["::array-type"]||"",B,((Ya=e[B])==null?void 0:Ya["::description"])||"",v,w,e[B]["::readwrite"]?e[B]["::readwrite"]:"",c||e[B]["::deprecated"])}`}`})}`}</div>${e["::type"]&&e["::type"].includes("xxx-of")?"":u`<div class="close-bracket">${b}</div>`}`;const[x,k,$,S,E,N,R,V,D]=e.split("~|~");if(k==="\u{1F181}"&&this.schemaHideReadOnly==="true"||k==="\u{1F186}"&&this.schemaHideWriteOnly==="true")return;const T=x.replace(/┃.*/g,"").replace(/[^a-zA-Z0-9+]/g,"").substring(0,4).toLowerCase(),C=`${$||S||E||N?`<span class="descr-expand-toggle ${this.schemaDescriptionExpanded==="true"?"expanded-descr":""}">\u2794</span>`:""}`;let I="",Z="";return t==="array"?l==="readonly"?(I="\u{1F181}",Z="Read-Only"):l==="writeonly"&&(I="\u{1F186}",Z="Write-Only"):k==="\u{1F181}"?(I="\u{1F181}",Z="Read-Only"):k==="\u{1F186}"&&(I="\u{1F186}",Z="Write-Only"),u`<div class="tr primitive" title="${D?"Deprecated":""}"><div class="td key ${c||D}" style="min-width:${g}px">${c||D?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${h.endsWith("*")?u`<span class="key-label">${h.substring(0,h.length-1)}</span><span style="color:var(--red)">*</span>:`:r.startsWith("::OPTION")?u`<span class="key-label xxx-of-key">${h}</span><span class="xxx-of-descr">${m}</span>`:u`<span class="key-label">${h}:</span>`} <span class="${T}" title="${Z}">${t==="array"?`[${x}]`:`${x}`} ${I}</span></div><div class="td key-descr">${s||V||R?u`${u`<span class="m-markdown-small">${_(z(A(t==="array"?`${C} ${s}`:V?`${C} <b>${V}:</b> ${R}`:`${C} ${R}`)))}</span>`}`:""} ${$?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${$}</div>`:""} ${S?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Default: </span>${S}</div>`:""} ${E?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">${x==="const"?"Value":"Allowed"}: </span>${E}</div>`:""} ${N?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Pattern: </span>${N}</div>`:""}</div></div>`}handleAllEvents(e){if(e.target.classList.contains("open-bracket"))this.toggleObjectExpand(e);else if(e.target.classList.contains("schema-multiline-toggle"))this.schemaDescriptionExpanded=this.schemaDescriptionExpanded==="true"?"false":"true";else if(e.target.classList.contains("descr-expand-toggle")){const t=e.target.closest(".tr");t&&(t.classList.toggle("expanded-descr"),t.style.maxHeight=t.scrollHeight)}}toggleObjectExpand(e){const t=e.target.closest(".tr"),a=t.classList.contains("nullable");t.classList.contains("expanded")?(t.classList.replace("expanded","collapsed"),e.target.innerHTML=e.target.classList.contains("array-of-object")?"[{...}]":e.target.classList.contains("array-of-array")?"[[...]]":e.target.classList.contains("array")?"[...]":`${a?"null\u2503":""}{...}`):(t.classList.replace("collapsed","expanded"),e.target.innerHTML=e.target.classList.contains("array-of-object")?"[{":e.target.classList.contains("array-of-array")?`[[ ${e.target.dataset.arrayType}`:e.target.classList.contains("object")?`${a?"null\u2503":""}{`:"[")}}customElements.define("schema-tree",Ld);class _d extends ee{render(){let e="";return Array.isArray(this.value)&&(e=u`${this.value.filter(t=>typeof t=="string"&&t.trim()!=="").map(t=>u`<span class="tag">${t}</span>`)}`),u`<div class="tags">${e} <input type="text" class="editor" @paste="${t=>this.afterPaste(t)}" @keydown="${this.afterKeyDown}" @blur="${this.onBlur}" placeholder="${this.placeholder||""}"></div>`}static get properties(){return{placeholder:{type:String},value:{type:Array,attribute:"value"}}}attributeChangedCallback(e,t,a){e==="value"&&a&&t!==a&&(this.value=a.split(",").filter(r=>r.trim()!=="")),super.attributeChangedCallback(e,t,a)}afterPaste(e){const t=(e.clipboardData||window.clipboardData).getData("Text"),a=t?t.split(",").filter(r=>r.trim()!==""):"";a&&(Array.isArray(this.value)?this.value=[...this.value,...a]:this.value=a),e.preventDefault()}afterKeyDown(e){e.keyCode===13?(e.stopPropagation(),e.preventDefault(),e.target.value&&(Array.isArray(this.value)?this.value=[...this.value,e.target.value]:this.value=[e.target.value],e.target.value="")):e.keyCode===8&&e.target.value.length===0&&Array.isArray(this.value)&&this.value.length>0&&(this.value.splice(-1),this.value=[...this.value])}onBlur(e){e.target.value&&(Array.isArray(this.value)?this.value=[...this.value,e.target.value]:this.value=[e.target.value],e.target.value="")}static get styles(){return[U`.tags{border-radius:var(--border-radius);border:1px solid var(--border-color);cursor:text;background:var(--input-bg);outline:none;flex-wrap:wrap;padding:0;display:flex;overflow:hidden}.tag,.editor{margin:2px;padding:3px}.tag{border:1px solid var(--border-color);background:var(--bg3);color:var(--fg3);border-radius:var(--border-radius);word-break:break-all;font-size:var(--font-size-small)}.tag:hover~#cursor{display:block}.editor{color:var(--fg);min-width:60px;line-height:inherit;font-family:inherit;font-size:calc(var(--font-size-small) + 1px);background:0 0;border:1px solid #0000;outline:none;flex:1}.editor:focus-visible{outline:1px solid}.editor::placeholder{color:var(--placeholder-color);opacity:1}`]}}customElements.define("tag-input",_d);class Rd extends ee{constructor(){super(),this.responseMessage="",this.responseStatus="success",this.responseHeaders="",this.responseText="",this.responseUrl="",this.curlSyntax="",this.activeResponseTab="response",this.selectedRequestBodyType="",this.selectedRequestBodyExample="",this.activeParameterSchemaTabs={}}static get properties(){return{serverUrl:{type:String,attribute:"server-url"},servers:{type:Array},method:{type:String},path:{type:String},security:{type:Array},parameters:{type:Array},request_body:{type:Object},api_keys:{type:Array},parser:{type:Object},accept:{type:String},callback:{type:String},webhook:{type:String},responseMessage:{type:String,attribute:!1},responseText:{type:String,attribute:!1},responseHeaders:{type:String,attribute:!1},responseStatus:{type:String,attribute:!1},responseUrl:{type:String,attribute:!1},curlSyntax:{type:String,attribute:!1},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},allowTry:{type:String,attribute:"allow-try"},showCurlBeforeTry:{type:String,attribute:"show-curl-before-try"},renderStyle:{type:String,attribute:"render-style"},schemaStyle:{type:String,attribute:"schema-style"},activeSchemaTab:{type:String,attribute:"active-schema-tab"},activeParameterSchemaTabs:{type:Object,converter:{fromAttribute:e=>JSON.parse(e),toAttribute:e=>JSON.stringify(e)},attribute:"active-parameter-schema-tabs"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},fetchCredentials:{type:String,attribute:"fetch-credentials"},activeResponseTab:{type:String},selectedRequestBodyType:{type:String,attribute:"selected-request-body-type"},selectedRequestBodyExample:{type:String,attribute:"selected-request-body-example"}}}static get styles(){return[Qt,$t,Fe,Yt,_n,en,ta,U`*,:before,:after{box-sizing:border-box}:where(button,input[type=checkbox],[tabindex="0"]):focus-visible{box-shadow:var(--focus-shadow)}:where(input[type=text],input[type=password],select,textarea):focus-visible{border-color:var(--primary-color)}tag-input:focus-within{outline:1px solid}.read-mode{margin-top:24px}.param-name,.param-type{text-align:right;line-height:var(--font-size-small);margin:1px 0}.param-name{color:var(--fg);font-family:var(--font-mono)}.param-name.deprecated{color:var(--red)}.param-type{color:var(--light-fg);font-family:var(--font-regular)}.param-constraint{min-width:100px}.param-constraint:empty{display:none}.top-gap{margin-top:24px}.textarea{resize:vertical;direction:ltr;min-height:220px;padding:5px}.example:first-child{margin-top:-9px}.response-message{text-overflow:ellipsis;font-weight:700}.response-message.error{color:var(--red)}.response-message.success{color:var(--blue)}.file-input-container{align-items:flex-end}.file-input-container .input-set:first-child .file-input-remove-btn{visibility:hidden}.file-input-remove-btn{color:var(--red);cursor:pointer;background:0 0;border:none;outline:none;font-size:16px}.v-tab-btn{font-size:var(--smal-font-size);opacity:.3;cursor:pointer;background:0 0;border:none;height:24px;padding:4px 8px}.v-tab-btn.active{background:var(--bg);opacity:1;font-weight:700}@container (width>=768px){.textarea{padding:8px}}@container (width<=470px){.hide-in-small-screen{display:none}}`,Ke]}render(){return u`<div class="col regular-font request-panel ${"read focused".includes(this.renderStyle)||this.callback==="true"?"read-mode":"view-mode"}"><div class="${this.callback==="true"?"tiny-title":"req-res-title"}">${this.callback==="true"?"CALLBACK REQUEST":"REQUEST"}</div><div>${Ln([this.method,this.path,this.allowTry,this.parameters,this.activeParameterSchemaTabs],()=>this.inputParametersTemplate("path"))} ${Ln([this.method,this.path,this.allowTry,this.parameters,this.activeParameterSchemaTabs],()=>this.inputParametersTemplate("query"))} ${this.requestBodyTemplate()} ${Ln([this.method,this.path,this.allowTry,this.parameters,this.activeParameterSchemaTabs],()=>this.inputParametersTemplate("header"))} ${Ln([this.method,this.path,this.allowTry,this.parameters,this.activeParameterSchemaTabs],()=>this.inputParametersTemplate("cookie"))} ${this.allowTry==="false"?"":u`${this.apiCallTemplate()}`}</div></div>`}async updated(){var e,t;this.showCurlBeforeTry==="true"&&this.applyCURLSyntax(this.shadowRoot),Xt(((t=(e=this.getRootNode())==null?void 0:e.host)==null?void 0:t.shadowRoot)||this.shadowRoot),this.webhook==="true"&&(this.allowTry="false")}async saveExampleState(){this.renderStyle==="focused"&&([...this.shadowRoot.querySelectorAll("textarea.request-body-param-user-input")].forEach(e=>{e.dataset.user_example=e.value}),[...this.shadowRoot.querySelectorAll('textarea[data-ptype="form-data"]')].forEach(e=>{e.dataset.user_example=e.value}),this.requestUpdate())}async updateExamplesFromDataAttr(){this.renderStyle==="focused"&&([...this.shadowRoot.querySelectorAll("textarea.request-body-param-user-input")].forEach(e=>{e.value=e.dataset.user_example||e.dataset.example}),[...this.shadowRoot.querySelectorAll('textarea[data-ptype="form-data"]')].forEach(e=>{e.value=e.dataset.user_example||e.dataset.example}),this.requestUpdate())}renderExample(e,t,a){var r,s;return u`${t==="array"?"[":""} <a part="anchor anchor-param-example" style="display:inline-block;min-width:24px;text-align:center" class="${this.allowTry==="true"?"":"inactive-link"}" data-example-type="${t==="array"?t:"string"}" data-example="${e.value&&Array.isArray(e.value)?(r=e.value)==null?void 0:r.join("~|~"):(typeof e.value=="object"?JSON.stringify(e.value,null,2):e.value)||""}" title="${e.value&&Array.isArray(e.value)?(s=e.value)==null?void 0:s.join("~|~"):(typeof e.value=="object"?JSON.stringify(e.value,null,2):e.value)||""}" @click="${i=>{const o=i.target.closest("table").querySelector(`[data-pname="${a}"]`);o&&(o.value=i.target.dataset.exampleType==="array"?i.target.dataset.example.split("~|~"):i.target.dataset.example)}}">${e.printableValue||e.value} </a>${t==="array"?"] ":""}`}renderShortFormatExamples(e,t,a){return u`${e.map((r,s)=>u`${s===0?"":"\u2503"} ${this.renderExample(r,t,a)}`)}`}renderLongFormatExamples(e,t,a){return u`<ul style="list-style-type:disclosure-closed">${e.map(r=>{var s,i;return u`<li>${this.renderExample(r,t,a)} ${((s=r.summary)==null?void 0:s.length)>0?u`<span>(${r.summary})</span>`:""} ${((i=r.description)==null?void 0:i.length)>0?u`<p>${_(z(A(r.description)))}</p>`:""}</li>`})}</ul>`}exampleListTemplate(e,t,a=[]){return u`${a.length>0?u`<span style="font-weight:700">Examples: </span>${fd(a)?this.renderLongFormatExamples(a,t,e):this.renderShortFormatExamples(a,t,e)}`:""}`}inputParametersTemplate(e){var t;const a=this.parameters?this.parameters.filter(i=>i.in===e):[];if(a.length===0)return"";let r="";e==="path"?r="PATH PARAMETERS":e==="query"?r="QUERY-STRING PARAMETERS":e==="header"?r="REQUEST HEADERS":e==="cookie"&&(r="COOKIES");const s=[];for(const i of a){const[o,l,c]=yd(i);if(!o)continue;const d=ke(o);if(!d)continue;const p=K(o,{});let h="form",m=!0,y=!1;(e==="query"||e==="header"||e==="path")&&(i.style&&"form spaceDelimited pipeDelimited".includes(i.style)?h=i.style:l&&(h=l),typeof i.explode=="boolean"&&(m=i.explode),typeof i.allowReserved=="boolean"&&(y=i.allowReserved));const g=oi(ie(i.examples)||ie(i.example)||ie(c?.example)||ie(c?.examples)||ie(d.examples)||ie(d.example),d.type);!g.exampleVal&&d.type==="object"&&(g.exampleVal=((t=it(o,l||"json",{},{},this.callback==="true"||this.webhook==="true",!(this.callback==="true"||this.webhook==="true"),!0,"text")[0])==null?void 0:t.exampleValue)||"");const f="read focused".includes(this.renderStyle)?"200px":"160px";s.push(u`<tr title="${i.deprecated?"Deprecated":""}"><td rowspan="${this.allowTry==="true"?"1":"2"}" style="width:${f};min-width:100px"><div class="param-name ${i.deprecated?"deprecated":""}">${i.deprecated?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${i.required?u`<span style="color:var(--red)">*</span>`:""} ${i.name}</div><div class="param-type">${d.type==="array"?`${d.arrayType}`:`${d.format?d.format:d.type}`}</div></td>${this.allowTry==="true"?u`<td style="min-width:100px" colspan="${d.default||d.constrain||d.allowedValues||d.pattern?"1":"2"}">${d.type==="array"?u`<tag-input class="request-param" id="tag-input-request-param-${i.name}" style="width:100%" data-ptype="${e}" data-pname="${i.name}" data-example="${Array.isArray(g.exampleVal)?g.exampleVal.join("~|~"):g.exampleVal}" data-param-serialize-style="${h}" data-param-serialize-explode="${m}" data-param-allow-reserved="${y}" data-x-fill-example="${i["x-fill-example"]||"yes"}" data-array="true" placeholder="add-multiple ↩" .value="${i["x-fill-example"]==="no"?[]:Va(this.fillRequestFieldsWithExample==="true"?Array.isArray(g.exampleVal)?g.exampleVal:[g.exampleVal]:[])}"></tag-input>`:d.type==="object"?u`<div part="tab-panel" class="tab-panel col" style="border-width:0 0 1px 0"><div part="tab-btn-row" class="tab-buttons row" @click="${b=>{if(b.target.tagName.toLowerCase()==="button"){const v={...this.activeParameterSchemaTabs};v[i.name]=b.target.dataset.tab,this.activeParameterSchemaTabs=v}}}"><button part="tab-btn" class="tab-btn ${this.activeParameterSchemaTabs[i.name]==="example"?"active":""}" data-tab="example">EXAMPLE</button> <button part="tab-btn" class="tab-btn ${this.activeParameterSchemaTabs[i.name]!=="example"?"active":""}" data-tab="schema">SCHEMA</button></div>${u`<div part="tab-content" class="tab-content col" data-tab="example" style="display:${this.activeParameterSchemaTabs[i.name]==="example"?"block":"none"};padding-left:5px;width:100%"><textarea id="textarea-request-param-${i.name}" class="textarea request-param" part="textarea textarea-param" data-ptype="${e}-object" data-pname="${i.name}" data-example="${g.exampleVal}" data-param-serialize-style="${h}" data-param-serialize-explode="${m}" data-param-allow-reserved="${y}" data-x-fill-example="${i["x-fill-example"]||"yes"}" spellcheck="false" .textContent="${i["x-fill-example"]==="no"?"":Va(this.fillRequestFieldsWithExample==="true"?typeof g.exampleVal=="object"?JSON.stringify(g.exampleVal,null,2):g.exampleVal:"")}" style="resize:vertical;width:100%;height:${"read focused".includes(this.renderStyle)?"180px":"120px"}" @input="${b=>{const v=this.getRequestPanel(b);this.liveCURLSyntaxUpdate(v)}}"></textarea></div>`} ${u`<div part="tab-content" class="tab-content col" data-tab="schema" style="display:${this.activeParameterSchemaTabs[i.name]!=="example"?"block":"none"};padding-left:5px;width:100%"><schema-tree class="json" style="display:block" .data="${p}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly.includes(this.method)}" schema-hide-write-only="${this.schemaHideWriteOnly.includes(this.method)}" exportparts="wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
|
|
248
249
|
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
|
|
249
|
-
anchor:anchor, anchor-param-example:anchor-param-example"></schema-tree></div>`}</div>`:u`<input type="${d.format==="password"?"password":"text"}" spellcheck="false" style="width:100%" id="input-request-param-${i.name}" class="request-param" part="textbox textbox-param" data-ptype="${e}" data-pname="${i.name}" data-example="${Array.isArray(g.exampleVal)?g.exampleVal.join("~|~"):g.exampleVal}" data-param-allow-reserved="${
|
|
250
|
-
${p.exampleFormat==="text"?p.exampleValue:JSON.stringify(p.exampleValue,null,2)}</pre><textarea class="textarea request-body-param-user-input" part="textarea textarea-param" spellcheck="false" data-ptype="${l.mimeType}" data-example="${p.exampleFormat==="text"?p.exampleValue:JSON.stringify(p.exampleValue,null,2)}" data-example-format="${p.exampleFormat}" style="width:100%;resize:vertical" .textContent="${this.fillRequestFieldsWithExample==="true"?p.exampleFormat==="text"?p.exampleValue:JSON.stringify(p.exampleValue,null,2):""}" @input="${h=>{const m=this.getRequestPanel(h);this.liveCURLSyntaxUpdate(m)}}" @keydown="${h=>{if((h.keyCode===10||h.keyCode===13)&&h.ctrlKey)return this.onTryClick(h)}}"></textarea></div>`)}</div>`);else if(this.selectedRequestBodyType.includes("form-urlencoded")||this.selectedRequestBodyType.includes("form-data")){if(l.mimeType===this.selectedRequestBodyType){const p=Nt(l.schema,l.mimeType,l.examples,l.example,this.callback==="true"||this.webhook==="true",!(this.callback==="true"||this.webhook==="true"),"text",!1);l.schema&&(a=this.formDataTemplate(l.schema,l.mimeType,p[0]?p[0].exampleValue:""))}}else/^audio\/|^image\/|^video\/|^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$/.test(this.selectedRequestBodyType)&&l.mimeType===this.selectedRequestBodyType&&(t=u`<div class="small-font-size bold-text row"><input id="input-request-body-param-file" type="file" part="file-input" style="max-width:100%" class="request-body-param-file" data-ptype="${l.mimeType}" spellcheck="false"></div>`);(l.mimeType.includes("json")||l.mimeType.includes("xml")||l.mimeType.includes("text")||this.selectedRequestBodyType.includes("jose"))&&(c=K(l.schema,{}),this.schemaStyle==="table"?r=u`${r}<schema-table class="${l.mimeType.substring(l.mimeType.indexOf("/")+1)}" style="display:${this.selectedRequestBodyType===l.mimeType?"block":"none"}" .data="${c}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly}" schema-hide-write-only="${this.schemaHideWriteOnly}" exportparts="schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></schema-table>`:this.schemaStyle==="tree"&&(r=u`${r}<schema-tree class="${l.mimeType.substring(l.mimeType.indexOf("/")+1)}" style="display:${this.selectedRequestBodyType===l.mimeType?"block":"none"}" .data="${c}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly}" schema-hide-write-only="${this.schemaHideWriteOnly}" exportparts="schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></schema-tree>`))}),u`<div class="request-body-container" data-selected-request-body-type="${this.selectedRequestBodyType}"><div class="table-title top-gap row">REQUEST BODY ${this.request_body.required?u`<span class="mono-font" style="color:var(--red)">*</span>`:""} <span style="font-weight:400;margin-left:5px">${this.selectedRequestBodyType}</span> <span style="flex:1"></span> ${e}</div>${this.request_body.description?u`<div class="m-markdown" style="margin-bottom:12px">${I(z(A(this.request_body.description)))}</div>`:""} ${this.selectedRequestBodyType.includes("json")||this.selectedRequestBodyType.includes("xml")||this.selectedRequestBodyType.includes("text")||this.selectedRequestBodyType.includes("jose")?u`<div part="tab-panel" class="tab-panel col" style="border-width:0 0 1px 0"><div part="tab-btn-row" class="tab-buttons row" @click="${l=>{l.target.tagName.toLowerCase()==="button"&&(this.activeSchemaTab=l.target.dataset.tab)}}"><button part="tab-btn" class="tab-btn ${this.activeSchemaTab==="example"?"active":""}" data-tab="example">EXAMPLE</button> <button part="tab-btn" class="tab-btn ${this.activeSchemaTab!=="example"?"active":""}" data-tab="schema">SCHEMA</button></div>${u`<div part="tab-content" class="tab-content col" style="display:${this.activeSchemaTab==="example"?"block":"none"}">${s}</div>`} ${u`<div part="tab-content" class="tab-content col" style="display:${this.activeSchemaTab==="example"?"none":"block"}">${r}</div>`}</div>`:u`${t} ${a}`}</div>`}formDataParamAsObjectTemplate(e,t,a){var r,s;const i=K(t,{}),o=Nt(t,"json",se(t.examples),se(t.example),this.callback==="true"||this.webhook==="true",!(this.callback==="true"||this.webhook==="true"),"text",!1);return u`<div part="tab-panel" class="tab-panel row" style="min-height:220px;border-left:6px solid var(--light-border-color);align-items:stretch"><div style="width:24px;background:var(--light-border-color)"><div class="row" style="flex-direction:row-reverse;width:160px;height:24px;transform:rotate(270deg) translateX(-160px);transform-origin:top left;display:block" @click="${l=>{if(l.target.classList.contains("v-tab-btn")){const{tab:c}=l.target.dataset;if(c){const d=l.target.closest(".tab-panel"),p=d.querySelector(`.v-tab-btn[data-tab="${c}"]`),h=[...d.querySelectorAll(`.v-tab-btn:not([data-tab="${c}"])`)],m=d.querySelector(`.tab-content[data-tab="${c}"]`),b=[...d.querySelectorAll(`.tab-content:not([data-tab="${c}"])`)];p.classList.add("active"),m.style.display="block",h.forEach(g=>{g.classList.remove("active")}),b.forEach(g=>{g.style.display="none"})}}l.target.tagName.toLowerCase()==="button"&&(this.activeSchemaTab=l.target.dataset.tab)}}"><button class="v-tab-btn ${this.activeSchemaTab==="example"?"active":""}" data-tab="example">EXAMPLE</button> <button class="v-tab-btn ${this.activeSchemaTab!=="example"?"active":""}" data-tab="schema">SCHEMA</button></div></div>${u`<div class="tab-content col" data-tab="example" style="display:${this.activeSchemaTab==="example"?"block":"none"};padding-left:5px;width:100%"><textarea class="textarea" part="textarea textarea-param" style="width:100%;border:none;resize:vertical" data-array="false" data-ptype="${a.includes("form-urlencode")?"form-urlencode":"form-data"}" data-pname="${e}" data-example="${((r=o[0])==null?void 0:r.exampleValue)||""}" .textContent="${this.fillRequestFieldsWithExample==="true"&&((s=o[0])==null?void 0:s.exampleValue)||""}" spellcheck="false"></textarea></div>`} ${u`<div class="tab-content col" data-tab="schema" style="display:${this.activeSchemaTab!=="example"?"block":"none"};padding-left:5px;width:100%"><schema-tree .data="${i}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" ,></schema-tree></div>`}</div>`}formDataTemplate(e,t,a=""){var r,s;const i=[];if(e.properties){for(const o in e.properties){const l=e.properties[o];if(l.readOnly)continue;const c=l.examples||l.example||"",d=l.type,p=$e(l),h="read focused".includes(this.renderStyle)?"200px":"160px",m=ai(p.examples||p.example,p.type);i.push(u`<tr title="${l.deprecated?"Deprecated":""}"><td style="width:${h};min-width:100px"><div class="param-name ${l.deprecated?"deprecated":""}">${o}${(r=e.required)!=null&&r.includes(o)||l.required?u`<span style="color:var(--red)">*</span>`:""}</div><div class="param-type">${p.type}</div></td><td style="${d==="object"?"width:100%; padding:0;":this.allowTry==="true"?"":"display:none;"}min-width:100px" colspan="${d==="object"?2:1}">${d==="array"?((s=l.items)==null?void 0:s.format)==="binary"?u`<div class="file-input-container col" style="align-items:flex-end" @click="${b=>this.onAddRemoveFileInput(b,o,t)}"><div class="input-set row"><input type="file" part="file-input" style="width:100%" data-pname="${o}" data-ptype="${t.includes("form-urlencode")?"form-urlencode":"form-data"}" data-array="false" data-file-array="true"> <button class="file-input-remove-btn">✕</button></div><button class="m-btn primary file-input-add-btn" part="btn btn-fill" style="margin:2px 25px 0 0;padding:2px 6px">ADD</button></div>`:u`<tag-input style="width:100%" data-ptype="${t.includes("form-urlencode")?"form-urlencode":"form-data"}" data-pname="${o}" data-example="${Array.isArray(c)?c.join("~|~"):c}" data-array="true" placeholder="add-multiple ↩" .value="${Array.isArray(c)?Array.isArray(c[0])?c[0]:c:[]}"></tag-input>`:u`${d==="object"?this.formDataParamAsObjectTemplate.call(this,o,l,t):u`${this.allowTry==="true"?u`<input .value="${this.fillRequestFieldsWithExample==="true"?m.exampleVal:""}" spellcheck="false" type="${l.format==="binary"?"file":l.format==="password"?"password":"text"}" part="textbox textbox-param" style="width:100%" data-ptype="${t.includes("form-urlencode")?"form-urlencode":"form-data"}" data-pname="${o}" data-example="${Array.isArray(c)?c[0]:c}" data-array="false">`:""}`}`}</td>${d==="object"?"":u`<td>${p.default||p.constrain||p.allowedValues||p.pattern?u`<div class="param-constraint">${p.default?u`<span style="font-weight:700">Default: </span>${p.default}<br>`:""} ${p.pattern?u`<span style="font-weight:700">Pattern: </span>${p.pattern}<br>`:""} ${p.constrain?u`${p.constrain}<br>`:""} ${p.allowedValues&&p.allowedValues.split("\u2503").map((b,g)=>u`${g>0?"\u2503":u`<span style="font-weight:700">Allowed:</span>`} ${u`<a part="anchor anchor-param-constraint" class="${this.allowTry==="true"?"":"inactive-link"}" data-type="${p.type==="array"?p.type:"string"}" data-enum="${b.trim()}" @click="${f=>{const y=f.target.closest("table").querySelector(`[data-pname="${o}"]`);y&&(f.target.dataset.type==="array"?y.value=[f.target.dataset.enum]:y.value=f.target.dataset.enum)}}">${b}</a>`}`)}</div>`:""}</td>`}</tr>${d==="object"?"":u`<tr><td style="border:none"></td><td colspan="2" style="border:none;margin-top:0;padding:0 5px 8px 5px"><span class="m-markdown-small">${I(z(A(l.description||"")))} </span>${this.exampleListTemplate.call(this,o,p.type,m.exampleList)}</td></tr>`}`)}return u`<table role="presentation" style="width:100%" class="m-table">${i}</table>`}return u`<textarea class="textarea dynamic-form-param ${t}" part="textarea textarea-param" spellcheck="false" data-pname="dynamic-form" data-ptype="${t}" .textContent="${a}" style="width:100%"></textarea> ${e.description?u`<span class="m-markdown-small">${I(z(A(e.description)))}</span>`:""}`}curlSyntaxTemplate(e="flex"){return u`<div class="col m-markdown" style="flex:1;display:${e};position:relative;max-width:100%"><button class="toolbar-btn" style="position:absolute;top:12px;right:8px" @click="${t=>{vt(this.curlSyntax.trim().replace(/\\$/,""),t)}}" part="btn btn-fill btn-copy">Copy</button><pre style="white-space:pre"><code class="language-shell">${this.curlSyntax.trim().replace(/\\$/,"")}</code></pre></div>`}apiResponseTabTemplate(){let e="",t="";return this.responseIsBlob||(this.responseHeaders.includes("application/x-ndjson")||this.responseHeaders.includes("json")?e="json":this.responseHeaders.includes("html")||this.responseHeaders.includes("xml")?e="html":e="text",t=u`<code class="language-${e}">${this.responseText}</code>`),u`<div class="row" style="font-size:var(--font-size-small);margin:5px 0"><div class="response-message ${this.responseStatus}">Response Status: ${this.responseMessage}</div><div style="flex:1"></div><button class="m-btn" part="btn btn-outline btn-clear-response" @click="${this.clearResponseData}">CLEAR RESPONSE</button></div><div part="tab-panel" class="tab-panel col" style="border-width:0 0 1px 0"><div id="tab_buttons" part="tab-btn-row" class="tab-buttons row" @click="${a=>{a.target.classList.contains("tab-btn")!==!1&&(this.activeResponseTab=a.target.dataset.tab)}}"><button part="tab-btn" class="tab-btn ${this.activeResponseTab==="response"?"active":""}" data-tab="response">RESPONSE</button> <button part="tab-btn" class="tab-btn ${this.activeResponseTab==="headers"?"active":""}" data-tab="headers">RESPONSE HEADERS</button> ${this.showCurlBeforeTry==="true"?"":u`<button part="tab-btn" class="tab-btn ${this.activeResponseTab==="curl"?"active":""}" data-tab="curl">CURL</button>`}</div>${this.responseIsBlob?u`<div part="tab-content" class="tab-content col" style="flex:1;display:${this.activeResponseTab==="response"?"flex":"none"}">${this.responseBlobType==="image"?u`<img style="max-height:var(--resp-area-height,400px);object-fit:contain" class="mar-top-8" src="${ld(this.responseBlobUrl)}">`:""} <button class="m-btn thin-border mar-top-8" style="width:135px" @click="${a=>{Lr(this.responseBlobUrl,this.respContentDisposition)}}" part="btn btn-outline">DOWNLOAD</button> ${this.responseBlobType==="view"||this.responseBlobType==="image"?u`<button class="m-btn thin-border mar-top-8" style="width:135px" @click="${a=>{Ir(this.responseBlobUrl)}}" part="btn btn-outline">VIEW (NEW TAB)</button>`:""}</div>`:u`<div part="tab-content" class="tab-content col m-markdown" style="flex:1;display:${this.activeResponseTab==="response"?"flex":"none"}"><button class="toolbar-btn" style="position:absolute;top:12px;right:8px" @click="${a=>{vt(this.responseText,a)}}" part="btn btn-fill btn-copy">Copy</button><pre style="white-space:pre;min-height:50px;height:var(--resp-area-height,400px);resize:vertical;overflow:auto">
|
|
251
|
-
${t}</pre></div>`}<div part="tab-content" class="tab-content col m-markdown" style="flex:1;display:${this.activeResponseTab==="headers"?"flex":"none"}"><button class="toolbar-btn" style="position:absolute;top:12px;right:8px" @click="${a=>{
|
|
252
|
-
`});let
|
|
253
|
-
`,t.forEach((p,h)=>{const m=[],
|
|
250
|
+
anchor:anchor, anchor-param-example:anchor-param-example"></schema-tree></div>`}</div>`:u`<input type="${d.format==="password"?"password":"text"}" spellcheck="false" style="width:100%" id="input-request-param-${i.name}" class="request-param" part="textbox textbox-param" data-ptype="${e}" data-pname="${i.name}" data-example="${Array.isArray(g.exampleVal)?g.exampleVal.join("~|~"):g.exampleVal}" data-param-allow-reserved="${y}" data-x-fill-example="${i["x-fill-example"]||"yes"}" data-array="false" .value="${i["x-fill-example"]==="no"?"":Va(this.fillRequestFieldsWithExample==="true"?g.exampleVal:"")}" @input="${b=>{const v=this.getRequestPanel(b);this.liveCURLSyntaxUpdate(v)}}">`}</td>`:""} ${d.default||d.constrain||d.allowedValues||d.pattern?u`<td colspan="${this.allowTry==="true"?"1":"2"}"><div class="param-constraint">${d.default?u`<span style="font-weight:700">Default: </span>${d.default}<br>`:""} ${d.pattern?u`<span style="font-weight:700">Pattern: </span>${d.pattern}<br>`:""} ${d.constrain?u`${d.constrain}<br>`:""} ${d.allowedValues&&d.allowedValues.split("\u2503").map((b,v)=>u`${v>0?"\u2503":u`<span style="font-weight:700">Allowed:</span>`} ${u`<a part="anchor anchor-param-constraint" class="${this.allowTry==="true"?"":"inactive-link"}" data-type="${d.type==="array"?d.type:"string"}" data-enum="${b.trim()}" @click="${w=>{const x=w.target.closest("table").querySelector(`[data-pname="${i.name}"]`);x&&(w.target.dataset.type==="array"?x.value=[w.target.dataset.enum]:x.value=w.target.dataset.enum)}}">${b}</a>`}`)}</div></td>`:u`<td></td>`}</tr><tr>${this.allowTry==="true"?u`<td style="border:none"></td>`:""}<td colspan="2" style="border:none"><span class="m-markdown-small">${_(z(A(i.description||"")))} </span>${this.exampleListTemplate.call(this,i.name,d.type,g.exampleList)}</td></tr>`)}return u`<div class="table-title top-gap">${r}</div><div style="display:block;overflow-x:auto;max-width:100%"><table role="presentation" class="m-table" style="width:100%;word-break:break-word">${s}</table></div>`}async beforeNavigationFocusedMode(){}async afterNavigationFocusedMode(){this.selectedRequestBodyType="",this.selectedRequestBodyExample="",this.updateExamplesFromDataAttr(),this.clearResponseData()}onSelectExample(e){this.selectedRequestBodyExample=e.target.value;const t=e.target;window.setTimeout(a=>{const r=a.closest(".example-panel").querySelector(".request-body-param"),s=a.closest(".example-panel").querySelector(".request-body-param-user-input");s.value=r.innerText;const i=this.getRequestPanel({target:a});this.liveCURLSyntaxUpdate(i)},0,t)}onMimeTypeChange(e){this.selectedRequestBodyType=e.target.value;const t=e.target;this.selectedRequestBodyExample="",window.setTimeout(a=>{const r=a.closest(".request-body-container").querySelector(".request-body-param");if(r){const s=a.closest(".request-body-container").querySelector(".request-body-param-user-input");s.value=r.innerText}},0,t)}requestBodyTemplate(){if(!this.request_body||Object.keys(this.request_body).length===0)return"";let e="",t="",a="",r="",s="";const i=[],{content:o}=this.request_body;for(const l in o)i.push({mimeType:l,schema:o[l].schema,example:o[l].example,examples:o[l].examples}),this.selectedRequestBodyType||(this.selectedRequestBodyType=l);return e=i.length===1?"":u`<select style="min-width:100px;max-width:100%;margin-bottom:-1px" @change="${l=>this.onMimeTypeChange(l)}">${i.map(l=>u`<option value="${l.mimeType}" ?selected="${l.mimeType===this.selectedRequestBodyType}">${l.mimeType}</option>`)}</select>`,i.forEach(l=>{let c,d=[];if(this.selectedRequestBodyType.includes("json")||this.selectedRequestBodyType.includes("xml")||this.selectedRequestBodyType.includes("text")||this.selectedRequestBodyType.includes("jose"))l.mimeType===this.selectedRequestBodyType&&(d=it(l.schema,l.mimeType,ie(l.examples),ie(l.example),this.callback==="true"||this.webhook==="true",!(this.callback==="true"||this.webhook==="true"),"text",!1),this.selectedRequestBodyExample||(this.selectedRequestBodyExample=d.length>0?d[0].exampleId:""),s=u`${s}<div class="example-panel border-top pad-top-8">${d.length===1?"":u`<select style="min-width:100px;max-width:100%;margin-bottom:-1px" @change="${p=>this.onSelectExample(p)}">${d.map(p=>u`<option value="${p.exampleId}" ?selected="${p.exampleId===this.selectedRequestBodyExample}">${p.exampleSummary.length>80?p.exampleId:p.exampleSummary?p.exampleSummary:p.exampleId}</option>`)}</select>`} ${d.filter(p=>p.exampleId===this.selectedRequestBodyExample).map(p=>u`<div class="example ${p.exampleId===this.selectedRequestBodyExample?"example-selected":""}" data-example="${p.exampleId}">${p.exampleSummary&&p.exampleSummary.length>80?u`<div style="padding:4px 0">${p.exampleSummary}</div>`:""} ${p.exampleDescription?u`<div class="m-markdown-small" style="padding:4px 0">${_(z(A(p.exampleDescription||"")))}</div>`:""}<pre class="textarea is-hidden request-body-param ${l.mimeType.substring(l.mimeType.indexOf("/")+1)}" spellcheck="false" data-ptype="${l.mimeType}" style="width:100%;resize:vertical;display:none">
|
|
251
|
+
${p.exampleFormat==="text"?p.exampleValue:JSON.stringify(p.exampleValue,null,2)}</pre><textarea class="textarea request-body-param-user-input" part="textarea textarea-param" spellcheck="false" data-ptype="${l.mimeType}" data-example="${p.exampleFormat==="text"?p.exampleValue:JSON.stringify(p.exampleValue,null,2)}" data-example-format="${p.exampleFormat}" style="width:100%;resize:vertical" .textContent="${this.fillRequestFieldsWithExample==="true"?p.exampleFormat==="text"?p.exampleValue:JSON.stringify(p.exampleValue,null,2):""}" @input="${h=>{const m=this.getRequestPanel(h);this.liveCURLSyntaxUpdate(m)}}" @keydown="${h=>{if((h.keyCode===10||h.keyCode===13)&&h.ctrlKey)return this.onTryClick(h)}}"></textarea></div>`)}</div>`);else if(this.selectedRequestBodyType.includes("form-urlencoded")||this.selectedRequestBodyType.includes("form-data")){if(l.mimeType===this.selectedRequestBodyType){const p=it(l.schema,l.mimeType,l.examples,l.example,this.callback==="true"||this.webhook==="true",!(this.callback==="true"||this.webhook==="true"),"text",!1);l.schema&&(a=this.formDataTemplate(l.schema,l.mimeType,p[0]?p[0].exampleValue:""))}}else/^audio\/|^image\/|^video\/|^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$/.test(this.selectedRequestBodyType)&&l.mimeType===this.selectedRequestBodyType&&(t=u`<div class="small-font-size bold-text row"><input id="input-request-body-param-file" type="file" part="file-input" style="max-width:100%" class="request-body-param-file" data-ptype="${l.mimeType}" spellcheck="false"></div>`);(l.mimeType.includes("json")||l.mimeType.includes("xml")||l.mimeType.includes("text")||this.selectedRequestBodyType.includes("jose"))&&(c=K(l.schema,{}),this.schemaStyle==="table"?r=u`${r}<schema-table class="${l.mimeType.substring(l.mimeType.indexOf("/")+1)}" style="display:${this.selectedRequestBodyType===l.mimeType?"block":"none"}" .data="${c}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly}" schema-hide-write-only="${this.schemaHideWriteOnly}" exportparts="schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></schema-table>`:this.schemaStyle==="tree"&&(r=u`${r}<schema-tree class="${l.mimeType.substring(l.mimeType.indexOf("/")+1)}" style="display:${this.selectedRequestBodyType===l.mimeType?"block":"none"}" .data="${c}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly}" schema-hide-write-only="${this.schemaHideWriteOnly}" exportparts="schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></schema-tree>`))}),u`<div class="request-body-container" data-selected-request-body-type="${this.selectedRequestBodyType}"><div class="table-title top-gap row">REQUEST BODY ${this.request_body.required?u`<span class="mono-font" style="color:var(--red)">*</span>`:""} <span style="font-weight:400;margin-left:5px">${this.selectedRequestBodyType}</span> <span style="flex:1"></span> ${e}</div>${this.request_body.description?u`<div class="m-markdown" style="margin-bottom:12px">${_(z(A(this.request_body.description)))}</div>`:""} ${this.selectedRequestBodyType.includes("json")||this.selectedRequestBodyType.includes("xml")||this.selectedRequestBodyType.includes("text")||this.selectedRequestBodyType.includes("jose")?u`<div part="tab-panel" class="tab-panel col" style="border-width:0 0 1px 0"><div part="tab-btn-row" class="tab-buttons row" @click="${l=>{l.target.tagName.toLowerCase()==="button"&&(this.activeSchemaTab=l.target.dataset.tab)}}"><button part="tab-btn" class="tab-btn ${this.activeSchemaTab==="example"?"active":""}" data-tab="example">EXAMPLE</button> <button part="tab-btn" class="tab-btn ${this.activeSchemaTab!=="example"?"active":""}" data-tab="schema">SCHEMA</button></div>${u`<div part="tab-content" class="tab-content col" style="display:${this.activeSchemaTab==="example"?"block":"none"}">${s}</div>`} ${u`<div part="tab-content" class="tab-content col" style="display:${this.activeSchemaTab==="example"?"none":"block"}">${r}</div>`}</div>`:u`${t} ${a}`}</div>`}formDataParamAsObjectTemplate(e,t,a){var r,s;const i=K(t,{}),o=it(t,"json",ie(t.examples),ie(t.example),this.callback==="true"||this.webhook==="true",!(this.callback==="true"||this.webhook==="true"),"text",!1);return u`<div part="tab-panel" class="tab-panel row" style="min-height:220px;border-left:6px solid var(--light-border-color);align-items:stretch"><div style="width:24px;background:var(--light-border-color)"><div class="row" style="flex-direction:row-reverse;width:160px;height:24px;transform:rotate(270deg) translateX(-160px);transform-origin:top left;display:block" @click="${l=>{if(l.target.classList.contains("v-tab-btn")){const{tab:c}=l.target.dataset;if(c){const d=l.target.closest(".tab-panel"),p=d.querySelector(`.v-tab-btn[data-tab="${c}"]`),h=[...d.querySelectorAll(`.v-tab-btn:not([data-tab="${c}"])`)],m=d.querySelector(`.tab-content[data-tab="${c}"]`),y=[...d.querySelectorAll(`.tab-content:not([data-tab="${c}"])`)];p.classList.add("active"),m.style.display="block",h.forEach(g=>{g.classList.remove("active")}),y.forEach(g=>{g.style.display="none"})}}l.target.tagName.toLowerCase()==="button"&&(this.activeSchemaTab=l.target.dataset.tab)}}"><button class="v-tab-btn ${this.activeSchemaTab==="example"?"active":""}" data-tab="example">EXAMPLE</button> <button class="v-tab-btn ${this.activeSchemaTab!=="example"?"active":""}" data-tab="schema">SCHEMA</button></div></div>${u`<div class="tab-content col" data-tab="example" style="display:${this.activeSchemaTab==="example"?"block":"none"};padding-left:5px;width:100%"><textarea class="textarea" part="textarea textarea-param" style="width:100%;border:none;resize:vertical" data-array="false" data-ptype="${a.includes("form-urlencode")?"form-urlencode":"form-data"}" data-pname="${e}" data-example="${((r=o[0])==null?void 0:r.exampleValue)||""}" .textContent="${this.fillRequestFieldsWithExample==="true"&&((s=o[0])==null?void 0:s.exampleValue)||""}" spellcheck="false"></textarea></div>`} ${u`<div class="tab-content col" data-tab="schema" style="display:${this.activeSchemaTab!=="example"?"block":"none"};padding-left:5px;width:100%"><schema-tree .data="${i}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" ,></schema-tree></div>`}</div>`}formDataTemplate(e,t,a=""){var r,s;const i=[];if(e.properties){for(const o in e.properties){const l=e.properties[o];if(l.readOnly)continue;const c=l.examples||l.example||"",d=l.type,p=ke(l),h="read focused".includes(this.renderStyle)?"200px":"160px",m=oi(p.examples||p.example,p.type);i.push(u`<tr title="${l.deprecated?"Deprecated":""}"><td style="width:${h};min-width:100px"><div class="param-name ${l.deprecated?"deprecated":""}">${o}${(r=e.required)!=null&&r.includes(o)||l.required?u`<span style="color:var(--red)">*</span>`:""}</div><div class="param-type">${p.type}</div></td><td style="${d==="object"?"width:100%; padding:0;":this.allowTry==="true"?"":"display:none;"}min-width:100px" colspan="${d==="object"?2:1}">${d==="array"?((s=l.items)==null?void 0:s.format)==="binary"?u`<div class="file-input-container col" style="align-items:flex-end" @click="${y=>this.onAddRemoveFileInput(y,o,t)}"><div class="input-set row"><input type="file" part="file-input" style="width:100%" data-pname="${o}" data-ptype="${t.includes("form-urlencode")?"form-urlencode":"form-data"}" data-array="false" data-file-array="true"> <button class="file-input-remove-btn">✕</button></div><button class="m-btn primary file-input-add-btn" part="btn btn-fill" style="margin:2px 25px 0 0;padding:2px 6px">ADD</button></div>`:u`<tag-input style="width:100%" data-ptype="${t.includes("form-urlencode")?"form-urlencode":"form-data"}" data-pname="${o}" data-example="${Array.isArray(c)?c.join("~|~"):c}" data-array="true" placeholder="add-multiple ↩" .value="${Array.isArray(c)?Array.isArray(c[0])?c[0]:c:[]}"></tag-input>`:u`${d==="object"?this.formDataParamAsObjectTemplate.call(this,o,l,t):u`${this.allowTry==="true"?u`<input .value="${this.fillRequestFieldsWithExample==="true"?m.exampleVal:""}" spellcheck="false" type="${l.format==="binary"?"file":l.format==="password"?"password":"text"}" part="textbox textbox-param" style="width:100%" data-ptype="${t.includes("form-urlencode")?"form-urlencode":"form-data"}" data-pname="${o}" data-example="${Array.isArray(c)?c[0]:c}" data-array="false">`:""}`}`}</td>${d==="object"?"":u`<td>${p.default||p.constrain||p.allowedValues||p.pattern?u`<div class="param-constraint">${p.default?u`<span style="font-weight:700">Default: </span>${p.default}<br>`:""} ${p.pattern?u`<span style="font-weight:700">Pattern: </span>${p.pattern}<br>`:""} ${p.constrain?u`${p.constrain}<br>`:""} ${p.allowedValues&&p.allowedValues.split("\u2503").map((y,g)=>u`${g>0?"\u2503":u`<span style="font-weight:700">Allowed:</span>`} ${u`<a part="anchor anchor-param-constraint" class="${this.allowTry==="true"?"":"inactive-link"}" data-type="${p.type==="array"?p.type:"string"}" data-enum="${y.trim()}" @click="${f=>{const b=f.target.closest("table").querySelector(`[data-pname="${o}"]`);b&&(f.target.dataset.type==="array"?b.value=[f.target.dataset.enum]:b.value=f.target.dataset.enum)}}">${y}</a>`}`)}</div>`:""}</td>`}</tr>${d==="object"?"":u`<tr><td style="border:none"></td><td colspan="2" style="border:none;margin-top:0;padding:0 5px 8px 5px"><span class="m-markdown-small">${_(z(A(l.description||"")))} </span>${this.exampleListTemplate.call(this,o,p.type,m.exampleList)}</td></tr>`}`)}return u`<table role="presentation" style="width:100%" class="m-table">${i}</table>`}return u`<textarea class="textarea dynamic-form-param ${t}" part="textarea textarea-param" spellcheck="false" data-pname="dynamic-form" data-ptype="${t}" .textContent="${a}" style="width:100%"></textarea> ${e.description?u`<span class="m-markdown-small">${_(z(A(e.description)))}</span>`:""}`}curlSyntaxTemplate(e="flex"){return u`<div class="col m-markdown" style="flex:1;display:${e};position:relative;max-width:100%"><button class="toolbar-btn" style="position:absolute;top:12px;right:8px" @click="${t=>{kt(this.curlSyntax.trim().replace(/\\$/,""),t)}}" part="btn btn-fill btn-copy">Copy</button><pre style="white-space:pre"><code class="language-shell">${this.curlSyntax.trim().replace(/\\$/,"")}</code></pre></div>`}apiResponseTabTemplate(){let e="",t="";return this.responseIsBlob||(this.responseHeaders.includes("application/x-ndjson")||this.responseHeaders.includes("json")?e="json":this.responseHeaders.includes("html")||this.responseHeaders.includes("xml")?e="html":e="text",t=u`<code class="language-${e}">${this.responseText}</code>`),u`<div class="row" style="font-size:var(--font-size-small);margin:5px 0"><div class="response-message ${this.responseStatus}">Response Status: ${this.responseMessage}</div><div style="flex:1"></div><button class="m-btn" part="btn btn-outline btn-clear-response" @click="${this.clearResponseData}">CLEAR RESPONSE</button></div><div part="tab-panel" class="tab-panel col" style="border-width:0 0 1px 0"><div id="tab_buttons" part="tab-btn-row" class="tab-buttons row" @click="${a=>{a.target.classList.contains("tab-btn")!==!1&&(this.activeResponseTab=a.target.dataset.tab)}}"><button part="tab-btn" class="tab-btn ${this.activeResponseTab==="response"?"active":""}" data-tab="response">RESPONSE</button> <button part="tab-btn" class="tab-btn ${this.activeResponseTab==="headers"?"active":""}" data-tab="headers">RESPONSE HEADERS</button> ${this.showCurlBeforeTry==="true"?"":u`<button part="tab-btn" class="tab-btn ${this.activeResponseTab==="curl"?"active":""}" data-tab="curl">CURL</button>`}</div>${this.responseIsBlob?u`<div part="tab-content" class="tab-content col" style="flex:1;display:${this.activeResponseTab==="response"?"flex":"none"}">${this.responseBlobType==="image"?u`<img style="max-height:var(--resp-area-height,400px);object-fit:contain" class="mar-top-8" src="${Od(this.responseBlobUrl)}">`:""} <button class="m-btn thin-border mar-top-8" style="width:135px" @click="${a=>{Kr(this.responseBlobUrl,this.respContentDisposition)}}" part="btn btn-outline">DOWNLOAD</button> ${this.responseBlobType==="view"||this.responseBlobType==="image"?u`<button class="m-btn thin-border mar-top-8" style="width:135px" @click="${a=>{Vr(this.responseBlobUrl)}}" part="btn btn-outline">VIEW (NEW TAB)</button>`:""}</div>`:u`<div part="tab-content" class="tab-content col m-markdown" style="flex:1;display:${this.activeResponseTab==="response"?"flex":"none"}"><button class="toolbar-btn" style="position:absolute;top:12px;right:8px" @click="${a=>{kt(this.responseText,a)}}" part="btn btn-fill btn-copy">Copy</button><pre style="white-space:pre;min-height:50px;height:var(--resp-area-height,400px);resize:vertical;overflow:auto">
|
|
252
|
+
${t}</pre></div>`}<div part="tab-content" class="tab-content col m-markdown" style="flex:1;display:${this.activeResponseTab==="headers"?"flex":"none"}"><button class="toolbar-btn" style="position:absolute;top:12px;right:8px" @click="${a=>{kt(this.responseHeaders,a)}}" part="btn btn-fill btn-copy">Copy</button><pre style="white-space:pre"><code class="language-css">${this.responseHeaders}</code></pre></div>${this.showCurlBeforeTry==="true"?"":this.curlSyntaxTemplate(this.activeResponseTab==="curl"?"flex":"none")}</div>`}apiCallTemplate(){var e,t;const a=u`<div style="display:flex;flex-direction:column">${this.serverUrl?u`<div style="display:flex;align-items:baseline"><div style="font-weight:700;padding-right:5px">API Server</div><span class="gray-text">${this.serverUrl}</span></div>`:""}</div>`;return u`<div style="display:flex;align-items:flex-end;margin:16px 0;font-size:var(--font-size-small)" part="wrap-request-btn"><div class="hide-in-small-screen" style="flex-direction:column;margin:0;width:calc(100% - 60px)"><div style="display:flex;flex-direction:row;align-items:center;overflow:hidden">${a}</div><div style="display:flex"><div style="font-weight:700;padding-right:5px">Authentication</div>${((e=this.security)==null?void 0:e.length)>0?u`${this.api_keys.length>0?u`<div style="color:var(--blue);overflow:hidden">${this.api_keys.length===1?`${(t=this.api_keys[0])==null?void 0:t.typeDisplay} in ${this.api_keys[0].in}`:`${this.api_keys.length} API keys applied`}</div>`:u`<div class="gray-text">Required <span style="color:var(--red)">(None Applied)</span></div>`}`:u`<span class="gray-text">Not Required</span>`}</div></div>${this.parameters.length>0||this.request_body?u`<button class="m-btn thin-border" part="btn btn-outline btn-fill" style="margin-right:5px" @click="${this.onFillRequestData}" title="Fills with example data (if provided)">FILL EXAMPLE</button> <button class="m-btn thin-border" part="btn btn-outline btn-clear" style="margin-right:5px" @click="${this.onClearRequestData}">CLEAR</button>`:""} <button class="m-btn primary thin-border" part="btn btn-try" @click="${this.onTryClick}">TRY</button></div><div class="row" style="font-size:var(--font-size-small);margin:5px 0">${this.showCurlBeforeTry==="true"?this.curlSyntaxTemplate():""}</div>${this.responseMessage===""?"":this.apiResponseTabTemplate()}`}async onFillRequestData(e){[...e.target.closest(".request-panel").querySelectorAll("input, tag-input, textarea:not(.is-hidden)")].forEach(t=>{t.dataset.example&&(t.tagName.toUpperCase()==="TAG-INPUT"?t.value=t.dataset.example.split("~|~"):t.value=t.dataset.example)})}async onClearRequestData(e){[...e.target.closest(".request-panel").querySelectorAll("input, tag-input, textarea:not(.is-hidden)")].forEach(t=>{t.value=""})}buildFetchURL(e){let t;const a=[...e.querySelectorAll("[data-ptype='path']")],r=[...e.querySelectorAll("[data-ptype='query']")],s=[...e.querySelectorAll("[data-ptype='query-object']")];t=this.path,a.map(c=>{t=t.replace(`{${c.dataset.pname}}`,encodeURIComponent(c.value))});const i=new Map,o=[];r.length>0&&r.forEach(c=>{const d=new URLSearchParams;if(c.dataset.paramAllowReserved==="true"&&o.push(c.dataset.pname),c.dataset.array==="false")c.value!==""&&d.append(c.dataset.pname,c.value);else{const{paramSerializeStyle:p,paramSerializeExplode:h}=c.dataset;let m=c.value&&Array.isArray(c.value)?c.value:[];m=Array.isArray(m)?m.filter(y=>y!==""):[],m.length>0&&(p==="spaceDelimited"?d.append(c.dataset.pname,m.join(" ").replace(/^\s|\s$/g,"")):p==="pipeDelimited"?d.append(c.dataset.pname,m.join("|").replace(/^\||\|$/g,"")):h==="true"?m.forEach(y=>{d.append(c.dataset.pname,y)}):d.append(c.dataset.pname,m.join(",").replace(/^,|,$/g,"")))}d.toString()&&i.set(c.dataset.pname,d)}),s.length>0&&s.map(c=>{const d=new URLSearchParams;try{let p={};const{paramSerializeStyle:h,paramSerializeExplode:m,pname:y}=c.dataset;if(p=Object.assign(p,JSON.parse(c.value.replace(/\s+/g," "))),c.dataset.paramAllowReserved==="true"&&o.push(c.dataset.pname),"json xml".includes(h))h==="json"?d.append(c.dataset.pname,JSON.stringify(p)):h==="xml"&&d.append(c.dataset.pname,Dn(p));else for(const g in p){const f=`${y}[${g}]`;typeof p[g]=="object"?Array.isArray(p[g])&&(h==="spaceDelimited"?d.append(f,p[g].join(" ")):h==="pipeDelimited"?d.append(f,p[g].join("|")):m==="true"?p[g].forEach(b=>{d.append(f,b)}):d.append(f,p[g])):d.append(f,p[g])}}catch{}d.toString()&&i.set(c.dataset.pname,d)});let l="";return i.size&&(i.forEach((c,d)=>{o.includes(d)?(l+=`${d}=`,l+=c.getAll(d).join(`&${d}=`),l+="&"):l+=`${c.toString()}&`}),l=l.slice(0,-1)),l.length!==0&&(t=`${t}${t.includes("?")?"&":"?"}${l}`),this.api_keys.filter(c=>c.in==="query").forEach(c=>{t=`${t}${t.includes("?")?"&":"?"}${c.name}=${encodeURIComponent(c.finalKeyValue)}`}),t=`${this.serverUrl.replace(/\/$/,"")}${t}`,t}buildFetchHeaders(e){var t;const a=(t=this.closest(".expanded-req-resp-container, .req-resp-container"))==null?void 0:t.getElementsByTagName("api-response")[0],r=[...e.querySelectorAll("[data-ptype='header'], [data-ptype='header-object']")],s=e.querySelector(".request-body-container"),i=a?.selectedMimeType,o=new Headers;if(i?o.append("Accept",i):this.accept&&o.append("Accept",this.accept),this.api_keys.filter(l=>l.in==="header").forEach(l=>{o.append(l.name,l.finalKeyValue)}),r.map(l=>{if(l.value)if(l.dataset.ptype==="header-object"){const c=JSON.parse(l.value.replace(/\n/g,"").trim()),d=l.dataset.paramSerializeExplode==="true"?"=":",",p=Object.keys(c).map(h=>{const m=c[h];return typeof m=="object"?`${h}${d}${JSON.stringify(m)}`:`${h}${d}${m}`}).join(",");o.append(l.dataset.pname,p)}else o.append(l.dataset.pname,l.value)}),s){const l=s.dataset.selectedRequestBodyType;l.includes("form-data")||o.append("Content-Type",l)}return o}buildFetchBodyOptions(e){const t=e.querySelector(".request-body-container"),a={method:this.method.toUpperCase()};if(t){const r=t.dataset.selectedRequestBodyType;if(r.includes("form-urlencoded")){const s=e.querySelector("[data-ptype='dynamic-form']");if(s){const i=s.value,o=new URLSearchParams;let l=!0,c;if(i)try{c=JSON.parse(i)}catch{l=!1}else l=!1;if(l){for(const d in c)o.append(d,JSON.stringify(c[d]));a.body=o}}else{const i=[...e.querySelectorAll("[data-ptype='form-urlencode']")],o=new URLSearchParams;i.filter(l=>l.type!=="file").forEach(l=>{if(l.dataset.array==="false")l.value&&o.append(l.dataset.pname,l.value);else{const c=l.value&&Array.isArray(l.value)?l.value.join(","):"";o.append(l.dataset.pname,c)}}),a.body=o}}else if(r.includes("form-data")){const s=new FormData;[...e.querySelectorAll("[data-ptype='form-data']")].forEach(i=>{i.dataset.array==="false"?i.type==="file"&&i.files[0]?s.append(i.dataset.pname,i.files[0],i.files[0].name):i.value&&s.append(i.dataset.pname,i.value):i.value&&Array.isArray(i.value)&&s.append(i.dataset.pname,i.value.join(","))}),a.body=s}else if(/^audio\/|^image\/|^video\/|^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$/.test(r)){const s=e.querySelector(".request-body-param-file");s!=null&&s.files[0]&&(a.body=s.files[0])}else if(r.includes("json")||r.includes("xml")||r.includes("text")){const s=e.querySelector(".request-body-param-user-input");s!=null&&s.value&&(a.body=s.value)}}return a}async onTryClick(e){const t=e.target,a=t.closest(".request-panel"),r=this.buildFetchURL(a),s=this.buildFetchBodyOptions(a),i=this.buildFetchHeaders(a);this.responseUrl="",this.responseHeaders=[],this.curlSyntax=this.generateCURLSyntax(r,i,s,a),this.responseStatus="success",this.responseIsBlob=!1,this.respContentDisposition="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl=""),this.fetchCredentials&&(s.credentials=this.fetchCredentials);const o=new AbortController,{signal:l}=o;s.headers=i;const c={url:r,...s};this.dispatchEvent(new CustomEvent("before-try",{bubbles:!0,composed:!0,detail:{request:c,controller:o}}));const d={method:c.method,headers:c.headers,credentials:c.credentials,body:c.body},p=new Request(c.url,d);let h,m;try{let y,g,f;t.disabled=!0,this.responseText="\u231B",this.responseMessage="",this.requestUpdate();const b=performance.now();h=await fetch(p,{signal:l});const v=performance.now();m=h.clone(),t.disabled=!1,this.responseMessage=u`${h.statusText?`${h.statusText}:${h.status}`:h.status}<div style="color:var(--light-fg)">Took ${Math.round(v-b)} milliseconds</div>`,this.responseUrl=h.url;const w={};h.headers.forEach((k,$)=>{w[$]=k,this.responseHeaders=`${this.responseHeaders}${$}: ${k}
|
|
253
|
+
`});let x=h.headers.get("content-type");if((await h.clone().text()).length===0)this.responseText="";else if(x){if(x=x.split(";")[0].trim(),x==="application/x-ndjson")this.responseText=await h.text();else if(x.includes("json"))if(/charset=[^"']+/.test(x)){const k=x.split("charset=")[1],$=await h.arrayBuffer();try{f=new TextDecoder(k).decode($)}catch{f=new TextDecoder("utf-8").decode($)}try{g=JSON.parse(f),this.responseText=JSON.stringify(g,null,2)}catch{this.responseText=f}}else g=await h.json(),this.responseText=JSON.stringify(g,null,2);else/^font\/|tar$|zip$|7z$|rtf$|msword$|excel$|\/pdf$|\/octet-stream$|^application\/vnd\./.test(x)?(this.responseIsBlob=!0,this.responseBlobType="download"):/^image/.test(x)?(this.responseIsBlob=!0,this.responseBlobType="image"):/^audio|^image|^video/.test(x)?(this.responseIsBlob=!0,this.responseBlobType="view"):(f=await h.text(),x.includes("xml")?this.responseText=Nd(f,{textNodesOnSameLine:!0,indentor:" "}):this.responseText=f);if(this.responseIsBlob){const k=h.headers.get("content-disposition")||"";let $="filename";if(k){const S=k.match(/filename\*=\s*UTF-8''([^;]+)/);if(S)$=decodeURIComponent(S[1]);else{const E=k.match(/filename="?([^"]+)"?/);E&&($=E[1])}}this.respContentDisposition=$,y=await h.blob(),this.responseBlobUrl=URL.createObjectURL(y)}}else f=await h.text(),this.responseText=f;this.dispatchEvent(new CustomEvent("after-try",{bubbles:!0,composed:!0,detail:{request:p,response:m,responseHeaders:w,responseBody:g||f||y,responseStatus:m.ok}}))}catch(y){t.disabled=!1,y.name==="AbortError"?(this.dispatchEvent(new CustomEvent("request-aborted",{bubbles:!0,composed:!0,detail:{err:y,request:p}})),this.responseMessage="Request Aborted",this.responseText="Request Aborted"):(this.dispatchEvent(new CustomEvent("after-try",{bubbles:!0,composed:!0,detail:{err:y,request:p}})),this.responseMessage=`${y.message} (CORS or Network Issue)`)}this.requestUpdate()}liveCURLSyntaxUpdate(e){this.applyCURLSyntax(e),this.requestUpdate()}onGenerateCURLClick(e){const t=this.getRequestPanel(e);this.applyCURLSyntax(t)}getRequestPanel(e){return e.target.closest(".request-panel")}applyCURLSyntax(e){const t=this.buildFetchURL(e),a=this.buildFetchBodyOptions(e),r=this.buildFetchHeaders(e);this.curlSyntax=this.generateCURLSyntax(t,r,a,e)}generateCURLSyntax(e,t,a,r){let s,i="",o="",l="",c="";const d=r.querySelector(".request-body-container");if(e.startsWith("http")===!1?s=new URL(e,window.location.href).href:s=e,i=`curl -X ${this.method.toUpperCase()} "${s}" \\
|
|
254
|
+
`,t.forEach((p,h)=>{const m=[],y=p.split(",").map(g=>{const f=g.trim().toLowerCase();return m.includes(f)?null:(m.push(f),g)}).filter(g=>g!==null).join(",");t.set(h,y)}),o=Array.from(t).map(([p,h])=>` -H '${p}: ${h}'`).join(`\\
|
|
254
255
|
`),o&&(o=`${o} \\
|
|
255
256
|
`),a.body instanceof URLSearchParams)l=` -d ${a.body.toString()} \\
|
|
256
257
|
`;else if(a.body instanceof File)l=` --data-binary @${a.body.name} \\
|
|
257
|
-
`;else if(a.body instanceof FormData)c=Array.from(a.body).reduce((p,[h,m])=>{if(m instanceof File)return[...p,` -F "${h}=@${m.name}"`];const
|
|
258
|
+
`;else if(a.body instanceof FormData)c=Array.from(a.body).reduce((p,[h,m])=>{if(m instanceof File)return[...p,` -F "${h}=@${m.name}"`];const y=m.match(/([^,],)/gm);if(y){const g=y.map(f=>`-F "${h}[]=${f}"`);return[...p,...g]}return[...p,` -F "${h}=${m}"`]},[]).join(`\\
|
|
258
259
|
`);else if(d&&d.dataset.selectedRequestBodyType){const p=d.dataset.selectedRequestBodyType,h=r.querySelector(".request-body-param-user-input");if(h!=null&&h.value){if(a.body=h.value,p.includes("json"))try{l=` -d '${JSON.stringify(JSON.parse(h.value.replace(/'/g,"'\\''")))}' \\
|
|
259
260
|
`}catch{}l||(l=` -d '${h.value.replace(/'/g,`'"'"'`)}' \\
|
|
260
|
-
`)}}return`${i}${o}${l}${c}`}onAddRemoveFileInput(e,t,a){if(e.target.tagName.toLowerCase()!=="button")return;if(e.target.classList.contains("file-input-remove-btn")){e.target.closest(".input-set").remove();return}const r=e.target.closest(".file-input-container"),s=document.createElement("div");s.setAttribute("class","input-set row");const i=document.createElement("input");i.type="file",i.style="width:200px; margin-top:2px;",i.setAttribute("data-pname",t),i.setAttribute("data-ptype",a.includes("form-urlencode")?"form-urlencode":"form-data"),i.setAttribute("data-array","false"),i.setAttribute("data-file-array","true");const o=document.createElement("button");o.setAttribute("class","file-input-remove-btn"),o.innerHTML="✕",s.appendChild(i),s.appendChild(o),r.insertBefore(s,e.target)}clearResponseData(){this.responseUrl="",this.responseHeaders="",this.responseText="",this.responseStatus="success",this.responseMessage="",this.responseIsBlob=!1,this.responseBlobType="",this.respContentDisposition="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl="")}disconnectedCallback(){this.curlSyntax="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl=""),super.disconnectedCallback()}}customElements.define("api-request",bd);class yd extends Q{static get properties(){return{schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},data:{type:Object}}}connectedCallback(){super.connectedCallback(),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),(!this.schemaDescriptionExpanded||!"true false".includes(this.schemaDescriptionExpanded))&&(this.schemaDescriptionExpanded="false"),(!this.schemaHideReadOnly||!"true false".includes(this.schemaHideReadOnly))&&(this.schemaHideReadOnly="true"),(!this.schemaHideWriteOnly||!"true false".includes(this.schemaHideWriteOnly))&&(this.schemaHideWriteOnly="true")}static get styles(){return[Ce,oi,U`.table{font-size:var(--font-size-small);text-align:left;line-height:calc(var(--font-size-small) + 6px)}.table .tr{border-bottom:1px dotted var(--light-border-color);width:calc(100% - 5px);padding:0 0 0 5px}.table .td{padding:4px 0}.table .key{width:var(--table-schema-key-width,240px);text-overflow:var(--table-schema-key-text-overflow,ellipsis);white-space:var(--table-schema-key-whitespace,nowrap)}.key .key-label{font-size:var(--font-size-mono)}.key.deprecated .key-label{color:var(--red)}.table .key-type{white-space:normal;width:150px}.collapsed-all-descr .tr:not(.expanded-descr){max-height:calc(var(--font-size-small) + var(--font-size-small))}.obj-toggle{color:var(--primary-color);cursor:pointer;font-size:calc(var(--font-size-small) + 4px);font-family:var(--font-mono);background-clip:border-box;border:1px solid #0000;border-radius:2px;margin-left:-16px;padding:0 2px;display:inline-block}.obj-toggle:hover{border-color:var(--primary-color)}.tr.expanded+.object-body{display:block}.tr.collapsed+.object-body{display:none}`,He]}render(){var e,t,a;return u`<div class="table ${this.schemaDescriptionExpanded==="true"?"expanded-all-descr":"collapsed-all-descr"}" @click="${r=>this.handleAllEvents(r)}"><div class="toolbar"><div class="toolbar-item schema-root-type ${((e=this.data)==null?void 0:e["::type"])||""}">${((t=this.data)==null?void 0:t["::type"])||""}</div>${this.allowSchemaDescriptionExpandToggle==="true"?u`<div style="flex:1"></div><div part="schema-multiline-toggle" class="toolbar-item schema-multiline-toggle">${this.schemaDescriptionExpanded==="true"?"Single line description":"Multiline description"}</div>`:""}</div><span part="schema-description" class="m-markdown">${I(A(((a=this.data)==null?void 0:a["::description"])||""))}</span><div style="border:1px solid var(--light-border-color)"><div style="display:flex;background:var(--bg2);padding:8px 4px;border-bottom:1px solid var(--light-border-color)"><div class="key" style="font-family:var(--font-regular);font-weight:700;color:var(--fg)">Field</div><div class="key-type" style="font-family:var(--font-regular);font-weight:700;color:var(--fg)">Type</div><div class="key-descr" style="font-family:var(--font-regular);font-weight:700;color:var(--fg)">Description</div></div>${this.data?u`${this.generateTree(this.data["::type"]==="array"?this.data["::props"]:this.data,this.data["::type"],this.data["::array-type"])}`:""}</div></div>`}generateTree(e,t="object",a="",r="",s="",i=0,o=0,l="",c=!1){var d;if(this.schemaHideReadOnly==="true"&&(t==="array"&&l==="readonly"||e&&e["::readwrite"]==="readonly")||this.schemaHideWriteOnly==="true"&&(t==="array"&&l==="writeonly"||e&&e["::readwrite"]==="writeonly"))return;if(!e)return u`<div class="null" style="display:inline"><span style="margin-left:${(i+1)*16}px"> </span><span class="key-label xxx-of-key">${r.replace("::OPTION~","")}</span> ${t==="array"?u`<span class="mono-font">[ ]</span>`:t==="object"?u`<span class="mono-font">{ }</span>`:u`<span class="mono-font">schema undefined</span>`}</div>`;const p=(d=e["::type"])!=null&&d.startsWith("xxx-of")?i:i+1,h=t==="xxx-of-option"||e["::type"]==="xxx-of-option"||r.startsWith("::OPTION")?o:o+1,m=16*h;if(Object.keys(e).length===0)return u`<span class="td key object" style="padding-left:${m}px">${r}</span>`;let b="",g="",f=!1;if(r.startsWith("::ONE~OF")||r.startsWith("::ANY~OF"))b=r.replace("::","").replace("~"," "),f=!0;else if(r.startsWith("::OPTION")){const C=r.split("~");b=C[1],g=C[2]}else b=r;let y="";if(e["::type"]==="object"?t==="array"?y="array of object":y=e["::dataTypeLabel"]||e["::type"]:e["::type"]==="array"&&(t==="array"?y=`array of array ${a!=="object"?`of ${a}`:""}`:y=e["::dataTypeLabel"]||e["::type"]),typeof e=="object")return u`${p>=0&&r?u`<div class="tr ${p<=this.schemaExpandLevel?"expanded":"collapsed"} ${e["::type"]}" data-obj="${b}" title="${c||e["::deprecated"]?`Deprecated ${b}`:b}"><div class="td key ${c||e["::deprecated"]?"deprecated":""}" style="padding-left:${m}px">${b||g?u`<span class="obj-toggle ${p<this.schemaExpandLevel?"expanded":"collapsed"}" data-obj="${b}">${i<this.schemaExpandLevel?"-":"+"}</span>`:""} ${e["::type"]==="xxx-of-option"||e["::type"]==="xxx-of-array"||r.startsWith("::OPTION")?u`<span class="xxx-of-key" style="margin-left:-6px">${b}</span><span class="${f?"xxx-of-key":"xxx-of-descr"}">${g}</span>`:b.endsWith("*")?u`<span class="key-label" style="display:inline-block;margin-left:-6px">${c||e["::deprecated"]?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${b.substring(0,b.length-1)}</span><span style="color:var(--red)">*</span>`:u`<span class="key-label" style="display:inline-block;margin-left:-6px">${c||e["::deprecated"]?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${b==="::props"?"":b}</span>`} ${e["::type"]==="xxx-of"&&t==="array"?u`<span style="color:var(--primary-color)">ARRAY</span>`:""}</div><div class="td key-type" title="${e["::readwrite"]==="readonly"?"Read-Only":e["::readwrite"]==="writeonly"?"Write-Only":""}">${(e["::type"]||"").includes("xxx-of")?"":y} ${e["::readwrite"]==="readonly"?" \u{1F181}":e["::readwrite"]==="writeonly"?" \u{1F186}":""}</div><div class="td key-descr m-markdown-small" style="line-height:1.7">${I(A(s||""))}</div></div>`:u`${e["::type"]==="array"&&t==="array"?u`<div class="tr"><div class="td key"></div><div class="td key-type">${a&&a!=="object"?`${t} of ${a}`:t}</div><div class="td key-descr"></div></div>`:""}`}<div class="object-body">${Array.isArray(e)&&e[0]?u`${this.generateTree(e[0],"xxx-of-option","","::ARRAY~OF","",p,h,"")}`:u`${Object.keys(e).map(C=>{var R;return u`${["::title","::description","::type","::props","::deprecated","::array-type","::readwrite","::dataTypeLabel","::nullable"].includes(C)?e[C]["::type"]==="array"||e[C]["::type"]==="object"?u`${this.generateTree(e[C]["::type"]==="array"?e[C]["::props"]:e[C],e[C]["::type"],e[C]["::array-type"]||"",C,e[C]["::description"],p,h,e[C]["::readwrite"]?e[C]["::readwrite"]:"",c||e[C]["::deprecated"])}`:"":u`${this.generateTree(e[C]["::type"]==="array"?e[C]["::props"]:e[C],e[C]["::type"],e[C]["::array-type"]||"",C,((R=e[C])==null?void 0:R["::description"])||"",p,h,e[C]["::readwrite"]?e[C]["::readwrite"]:"",c||e[C]["::deprecated"])}`}`})}`}</div>`;const[v,x,w,k,$,S,E,N,_]=e.split("~|~");if(x==="\u{1F181}"&&this.schemaHideReadOnly==="true"||x==="\u{1F186}"&&this.schemaHideWriteOnly==="true")return;const V=v.replace(/┃.*/g,"").replace(/[^a-zA-Z0-9+]/g,"").substring(0,4).toLowerCase(),D=`${w||k||$||S?'<span class="descr-expand-toggle">\u2794</span>':""}`;let T="";return t==="array"?T=u`<div class="td key-type ${V}" title="${l==="readonly"?"Read-Only":x==="writeonly"?"Write-Only":""}">[${v}] ${l==="readonly"?"\u{1F181}":l==="writeonly"?"\u{1F186}":""}</div>`:T=u`<div class="td key-type ${V}" title="${x==="\u{1F181}"?"Read-Only":x==="\u{1F186}"?"Write-Only":""}">${v} ${x}</div>`,u`<div class="tr primitive" title="${c||_?"Deprecated":""}"><div class="td key ${c||_?"deprecated":""}" style="padding-left:${m}px">${c||_?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${b!=null&&b.endsWith("*")?u`<span class="key-label">${b.substring(0,b.length-1)}</span> <span style="color:var(--red)">*</span>`:r.startsWith("::OPTION")?u`<span class="xxx-of-key">${b}</span><span class="xxx-of-descr">${g}</span>`:u`${b?u`<span class="key-label">${b}</span>`:u`<span class="xxx-of-descr">${N}</span>`}`}</div>${T}<div class="td key-descr" style="font-size:var(--font-size-small)">${u`<span class="m-markdown-small">${I(A(t==="array"?`${D} ${s}`:N?`${D} <b>${N}:</b> ${E}`:`${D} ${E}`))}</span>`} ${w?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${w}</div>`:""} ${k?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Default: </span>${k}</div>`:""} ${$?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">${v==="const"?"Value":"Allowed"}: </span>${$}</div>`:""} ${S?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Pattern: </span>${S}</div>`:""}</div></div>`}handleAllEvents(e){if(e.target.classList.contains("obj-toggle"))this.toggleObjectExpand(e);else if(e.target.classList.contains("schema-multiline-toggle"))this.schemaDescriptionExpanded=this.schemaDescriptionExpanded==="true"?"false":"true";else if(e.target.classList.contains("descr-expand-toggle")){const t=e.target.closest(".tr");t&&(t.classList.toggle("expanded-descr"),t.style.maxHeight=t.scrollHeight)}}toggleObjectExpand(e){const t=e.target.closest(".tr");t.classList.contains("expanded")?(t.classList.add("collapsed"),t.classList.remove("expanded"),e.target.innerText="+"):(t.classList.remove("collapsed"),t.classList.add("expanded"),e.target.innerText="-")}}customElements.define("schema-table",yd);class vd extends Q{constructor(){super(),this.selectedStatus="",this.headersForEachRespStatus={},this.mimeResponsesForEachStatus={},this.activeSchemaTab="schema"}static get properties(){return{callback:{type:String},webhook:{type:String},responses:{type:Object},parser:{type:Object},schemaStyle:{type:String,attribute:"schema-style"},renderStyle:{type:String,attribute:"render-style"},selectedStatus:{type:String,attribute:"selected-status"},selectedMimeType:{type:String,attribute:"selected-mime-type"},activeSchemaTab:{type:String,attribute:"active-schema-tab"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"}}}static get styles(){return[Ce,Vt,Jt,Zt,yt,$n,U`:where(button,input[type=checkbox],[tabindex="0"]):focus-visible{box-shadow:var(--focus-shadow)}:where(input[type=text],input[type=password],select,textarea):focus-visible{border-color:var(--primary-color)}.resp-head{vertical-align:middle;padding:16px 0 8px}.resp-head.divider{border-top:1px solid var(--border-color);margin-top:10px}.resp-status{font-weight:700;font-size:calc(var(--font-size-small) + 1px)}.resp-descr{font-size:calc(var(--font-size-small) + 1px);color:var(--light-fg);text-align:left}.top-gap{margin-top:16px}.example-panel{font-size:var(--font-size-small);margin:0}.focused-mode,.read-mode{border-top:1px dashed var(--border-color);margin-top:12px;padding-top:24px}`,He]}render(){return u`<div class="col regular-font response-panel ${this.renderStyle}-mode"><div class="${this.callback==="true"?"tiny-title":"req-res-title"}">${this.callback==="true"?"CALLBACK RESPONSE":"RESPONSE"}</div><div>${this.responseTemplate()}</div></div>`}resetSelection(){this.selectedStatus="",this.selectedMimeType=""}responseTemplate(){var e,t,a;if(!this.responses)return"";for(const r in this.responses){this.selectedStatus||(this.selectedStatus=r);const s={};for(const o in(e=this.responses[r])==null?void 0:e.content){const l=this.responses[r].content[o];this.selectedMimeType||(this.selectedMimeType=o);const c=K(l.schema,{}),d=Nt(l.schema,o,se(l.examples),se(l.example),!(this.callback==="true"||this.webhook==="true"),this.callback==="true"||this.webhook==="true",o.includes("json")?"json":"text");s[o]={description:this.responses[r].description,examples:d,selectedExample:((t=d[0])==null?void 0:t.exampleId)||"",schemaTree:c}}const i=[];for(const o in(a=this.responses[r])==null?void 0:a.headers)i.push({name:o,...this.responses[r].headers[o]});this.headersForEachRespStatus[r]=i,this.mimeResponsesForEachStatus[r]=s}return u`${Object.keys(this.responses).length>1?u`<div class="row" style="flex-wrap:wrap">${Object.keys(this.responses).map(r=>u`${r==="$$ref"?"":u`<button @click="${()=>{this.selectedStatus=r,this.responses[r].content&&Object.keys(this.responses[r].content)[0]?this.selectedMimeType=Object.keys(this.responses[r].content)[0]:this.selectedMimeType=void 0}}" class="m-btn small ${this.selectedStatus===r?"primary":""}" part="btn ${this.selectedStatus===r?"btn-response-status btn-selected-response-status":" btn-response-status"}" style="margin:8px 4px 0 0">${r}</button>`}`)}</div>`:u`<span>${Object.keys(this.responses)[0]}</span>`} ${Object.keys(this.responses).map(r=>{var s,i;return u`<div style="display:${r===this.selectedStatus?"block":"none"}"><div class="top-gap"><span class="resp-descr m-markdown">${I(z(A(((s=this.responses[r])==null?void 0:s.description)||"")))}</span> ${this.headersForEachRespStatus[r]&&((i=this.headersForEachRespStatus[r])==null?void 0:i.length)>0?u`${this.responseHeaderListTemplate(this.headersForEachRespStatus[r])}`:""}</div>${Object.keys(this.mimeResponsesForEachStatus[r]).length===0?"":u`<div part="tab-panel" class="tab-panel col"><div part="tab-btn-row" class="tab-buttons row" @click="${o=>{o.target.tagName.toLowerCase()==="button"&&(this.activeSchemaTab=o.target.dataset.tab)}}"><button part="tab-btn" class="tab-btn ${this.activeSchemaTab==="example"?"active":""}" data-tab="example">EXAMPLE</button> <button part="tab-btn" class="tab-btn ${this.activeSchemaTab!=="example"?"active":""}" data-tab="schema">SCHEMA</button><div style="flex:1"></div>${Object.keys(this.mimeResponsesForEachStatus[r]).length===1?u`<span class="small-font-size gray-text" style="align-self:center;margin-top:8px">${Object.keys(this.mimeResponsesForEachStatus[r])[0]}</span>`:u`${this.mimeTypeDropdownTemplate(Object.keys(this.mimeResponsesForEachStatus[r]))}`}</div>${this.activeSchemaTab==="example"?u`<div part="tab-content" class="tab-content col" style="flex:1">${this.mimeExampleTemplate(this.mimeResponsesForEachStatus[r][this.selectedMimeType])}</div>`:u`<div part="tab-content" class="tab-content col" style="flex:1">${this.mimeSchemaTemplate(this.mimeResponsesForEachStatus[r][this.selectedMimeType])}</div>`}</div>`}</div>`})}`}responseHeaderListTemplate(e){return u`<div style="padding:16px 0 8px 0" class="resp-headers small-font-size bold-text">RESPONSE HEADERS</div><table role="presentation" style="border-collapse:collapse;margin-bottom:16px;border:1px solid var(--border-color);border-radius:var(--border-radius)" class="small-font-size mono-font">${e.map(t=>{var a,r;return u`<tr><td style="padding:8px;vertical-align:baseline;min-width:120px;border-top:1px solid var(--light-border-color);text-overflow:ellipsis">${t.name||""}</td><td style="padding:4px;vertical-align:baseline;padding:0 5px;border-top:1px solid var(--light-border-color);text-overflow:ellipsis">${((a=t.schema)==null?void 0:a.type)||""}</td><td style="padding:8px;vertical-align:baseline;border-top:1px solid var(--light-border-color);text-overflow:ellipsis"><div class="m-markdown-small regular-font">${I(z(A(t.description||"")))}</div></td><td style="padding:8px;vertical-align:baseline;border-top:1px solid var(--light-border-color);text-overflow:ellipsis">${((r=t.schema)==null?void 0:r.example)||""}</td></tr>`})}</table>`}mimeTypeDropdownTemplate(e){return u`<select aria-label="mime types" @change="${t=>{this.selectedMimeType=t.target.value}}" style="margin-bottom:-1px;z-index:1">${e.map(t=>u`<option value="${t}" ?selected="${t===this.selectedMimeType}">${t}</option>`)}</select>`}onSelectExample(e){[...e.target.closest(".example-panel").querySelectorAll(".example")].forEach(t=>{t.style.display=t.dataset.example===e.target.value?"block":"none"})}mimeExampleTemplate(e){return!e||!e.examples||e.examples.length===0?u`<pre style="color:var(--red)" class="${this.renderStyle==="read"?"read example-panel border pad-8-16":"example-panel border-top"}">
|
|
261
|
-
No example provided </pre>`:u`${e.examples.length===1?u`${e.examples[0].exampleFormat==="json"?u`${e.examples[0].exampleSummary&&e.examples[0].exampleSummary.length>80?u`<div style="padding:4px 0">${e.examples[0].exampleSummary}</div>`:""} ${e.examples[0].exampleDescription?u`<div class="m-markdown-small" style="padding:4px 0">${
|
|
262
|
-
${e.examples[0].exampleValue}</pre>`}`:u`<span class="example-panel ${this.renderStyle==="read"?"border pad-8-16":"border-top pad-top-8"}"><select aria-label="response examples" style="min-width:100px;max-width:100%" @change="${t=>this.onSelectExample(t)}">${e.examples.map(t=>u`<option value="${t.exampleId}" ?selected="${t.exampleId===e.selectedExample}">${t.exampleSummary.length>80?t.exampleId:t.exampleSummary}</option>`)}</select> ${e.examples.map(t=>u`<div class="example" data-example="${t.exampleId}" style="display:${t.exampleId===e.selectedExample?"block":"none"}">${t.exampleSummary&&t.exampleSummary.length>80?u`<div style="padding:4px 0">${t.exampleSummary}</div>`:""} ${t.exampleDescription?u`<div class="m-markdown-small" style="padding:4px 0">${
|
|
261
|
+
`)}}return`${i}${o}${l}${c}`}onAddRemoveFileInput(e,t,a){if(e.target.tagName.toLowerCase()!=="button")return;if(e.target.classList.contains("file-input-remove-btn")){e.target.closest(".input-set").remove();return}const r=e.target.closest(".file-input-container"),s=document.createElement("div");s.setAttribute("class","input-set row");const i=document.createElement("input");i.type="file",i.style="width:200px; margin-top:2px;",i.setAttribute("data-pname",t),i.setAttribute("data-ptype",a.includes("form-urlencode")?"form-urlencode":"form-data"),i.setAttribute("data-array","false"),i.setAttribute("data-file-array","true");const o=document.createElement("button");o.setAttribute("class","file-input-remove-btn"),o.innerHTML="✕",s.appendChild(i),s.appendChild(o),r.insertBefore(s,e.target)}clearResponseData(){this.responseUrl="",this.responseHeaders="",this.responseText="",this.responseStatus="success",this.responseMessage="",this.responseIsBlob=!1,this.responseBlobType="",this.respContentDisposition="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl="")}disconnectedCallback(){this.curlSyntax="",this.responseBlobUrl&&(URL.revokeObjectURL(this.responseBlobUrl),this.responseBlobUrl=""),super.disconnectedCallback()}}customElements.define("api-request",Rd);class Id extends ee{static get properties(){return{schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},data:{type:Object}}}connectedCallback(){super.connectedCallback(),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),(!this.schemaDescriptionExpanded||!"true false".includes(this.schemaDescriptionExpanded))&&(this.schemaDescriptionExpanded="false"),(!this.schemaHideReadOnly||!"true false".includes(this.schemaHideReadOnly))&&(this.schemaHideReadOnly="true"),(!this.schemaHideWriteOnly||!"true false".includes(this.schemaHideWriteOnly))&&(this.schemaHideWriteOnly="true")}static get styles(){return[Fe,Si,U`.table{font-size:var(--font-size-small);text-align:left;line-height:calc(var(--font-size-small) + 6px)}.table .tr{border-bottom:1px dotted var(--light-border-color);width:calc(100% - 5px);padding:0 0 0 5px}.table .td{padding:4px 0}.table .key{width:var(--table-schema-key-width,240px);text-overflow:var(--table-schema-key-text-overflow,ellipsis);white-space:var(--table-schema-key-whitespace,nowrap)}.key .key-label{font-size:var(--font-size-mono)}.key.deprecated .key-label{color:var(--red)}.table .key-type{white-space:normal;width:150px}.collapsed-all-descr .tr:not(.expanded-descr){max-height:calc(var(--font-size-small) + var(--font-size-small))}.obj-toggle{color:var(--primary-color);cursor:pointer;font-size:calc(var(--font-size-small) + 4px);font-family:var(--font-mono);background-clip:border-box;border:1px solid #0000;border-radius:2px;margin-left:-16px;padding:0 2px;display:inline-block}.obj-toggle:hover{border-color:var(--primary-color)}.tr.expanded+.object-body{display:block}.tr.collapsed+.object-body{display:none}`,Ke]}render(){var e,t,a;return u`<div class="table ${this.schemaDescriptionExpanded==="true"?"expanded-all-descr":"collapsed-all-descr"}" @click="${r=>this.handleAllEvents(r)}"><div class="toolbar"><div class="toolbar-item schema-root-type ${((e=this.data)==null?void 0:e["::type"])||""}">${((t=this.data)==null?void 0:t["::type"])||""}</div>${this.allowSchemaDescriptionExpandToggle==="true"?u`<div style="flex:1"></div><div part="schema-multiline-toggle" class="toolbar-item schema-multiline-toggle">${this.schemaDescriptionExpanded==="true"?"Single line description":"Multiline description"}</div>`:""}</div><span part="schema-description" class="m-markdown">${_(A(((a=this.data)==null?void 0:a["::description"])||""))}</span><div style="border:1px solid var(--light-border-color)"><div style="display:flex;background:var(--bg2);padding:8px 4px;border-bottom:1px solid var(--light-border-color)"><div class="key" style="font-family:var(--font-regular);font-weight:700;color:var(--fg)">Field</div><div class="key-type" style="font-family:var(--font-regular);font-weight:700;color:var(--fg)">Type</div><div class="key-descr" style="font-family:var(--font-regular);font-weight:700;color:var(--fg)">Description</div></div>${this.data?u`${this.generateTree(this.data["::type"]==="array"?this.data["::props"]:this.data,this.data["::type"],this.data["::array-type"])}`:""}</div></div>`}generateTree(e,t="object",a="",r="",s="",i=0,o=0,l="",c=!1){var d;if(this.schemaHideReadOnly==="true"&&(t==="array"&&l==="readonly"||e&&e["::readwrite"]==="readonly")||this.schemaHideWriteOnly==="true"&&(t==="array"&&l==="writeonly"||e&&e["::readwrite"]==="writeonly"))return;if(!e)return u`<div class="null" style="display:inline"><span style="margin-left:${(i+1)*16}px"> </span><span class="key-label xxx-of-key">${r.replace("::OPTION~","")}</span> ${t==="array"?u`<span class="mono-font">[ ]</span>`:t==="object"?u`<span class="mono-font">{ }</span>`:u`<span class="mono-font">schema undefined</span>`}</div>`;const p=(d=e["::type"])!=null&&d.startsWith("xxx-of")?i:i+1,h=t==="xxx-of-option"||e["::type"]==="xxx-of-option"||r.startsWith("::OPTION")?o:o+1,m=16*h;if(Object.keys(e).length===0)return u`<span class="td key object" style="padding-left:${m}px">${r}</span>`;let y="",g="",f=!1;if(r.startsWith("::ONE~OF")||r.startsWith("::ANY~OF"))y=r.replace("::","").replace("~"," "),f=!0;else if(r.startsWith("::OPTION")){const C=r.split("~");y=C[1],g=C[2]}else y=r;let b="";if(e["::type"]==="object"?t==="array"?b="array of object":b=e["::dataTypeLabel"]||e["::type"]:e["::type"]==="array"&&(t==="array"?b=`array of array ${a!=="object"?`of ${a}`:""}`:b=e["::dataTypeLabel"]||e["::type"]),typeof e=="object")return u`${p>=0&&r?u`<div class="tr ${p<=this.schemaExpandLevel?"expanded":"collapsed"} ${e["::type"]}" data-obj="${y}" title="${c||e["::deprecated"]?`Deprecated ${y}`:y}"><div class="td key ${c||e["::deprecated"]?"deprecated":""}" style="padding-left:${m}px">${y||g?u`<span class="obj-toggle ${p<this.schemaExpandLevel?"expanded":"collapsed"}" data-obj="${y}">${i<this.schemaExpandLevel?"-":"+"}</span>`:""} ${e["::type"]==="xxx-of-option"||e["::type"]==="xxx-of-array"||r.startsWith("::OPTION")?u`<span class="xxx-of-key" style="margin-left:-6px">${y}</span><span class="${f?"xxx-of-key":"xxx-of-descr"}">${g}</span>`:y.endsWith("*")?u`<span class="key-label" style="display:inline-block;margin-left:-6px">${c||e["::deprecated"]?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${y.substring(0,y.length-1)}</span><span style="color:var(--red)">*</span>`:u`<span class="key-label" style="display:inline-block;margin-left:-6px">${c||e["::deprecated"]?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${y==="::props"?"":y}</span>`} ${e["::type"]==="xxx-of"&&t==="array"?u`<span style="color:var(--primary-color)">ARRAY</span>`:""}</div><div class="td key-type" title="${e["::readwrite"]==="readonly"?"Read-Only":e["::readwrite"]==="writeonly"?"Write-Only":""}">${(e["::type"]||"").includes("xxx-of")?"":b} ${e["::readwrite"]==="readonly"?" \u{1F181}":e["::readwrite"]==="writeonly"?" \u{1F186}":""}</div><div class="td key-descr m-markdown-small" style="line-height:1.7">${_(A(s||""))}</div></div>`:u`${e["::type"]==="array"&&t==="array"?u`<div class="tr"><div class="td key"></div><div class="td key-type">${a&&a!=="object"?`${t} of ${a}`:t}</div><div class="td key-descr"></div></div>`:""}`}<div class="object-body">${Array.isArray(e)&&e[0]?u`${this.generateTree(e[0],"xxx-of-option","","::ARRAY~OF","",p,h,"")}`:u`${Object.keys(e).map(C=>{var I;return u`${["::title","::description","::type","::props","::deprecated","::array-type","::readwrite","::dataTypeLabel","::nullable"].includes(C)?e[C]["::type"]==="array"||e[C]["::type"]==="object"?u`${this.generateTree(e[C]["::type"]==="array"?e[C]["::props"]:e[C],e[C]["::type"],e[C]["::array-type"]||"",C,e[C]["::description"],p,h,e[C]["::readwrite"]?e[C]["::readwrite"]:"",c||e[C]["::deprecated"])}`:"":u`${this.generateTree(e[C]["::type"]==="array"?e[C]["::props"]:e[C],e[C]["::type"],e[C]["::array-type"]||"",C,((I=e[C])==null?void 0:I["::description"])||"",p,h,e[C]["::readwrite"]?e[C]["::readwrite"]:"",c||e[C]["::deprecated"])}`}`})}`}</div>`;const[v,w,x,k,$,S,E,N,R]=e.split("~|~");if(w==="\u{1F181}"&&this.schemaHideReadOnly==="true"||w==="\u{1F186}"&&this.schemaHideWriteOnly==="true")return;const V=v.replace(/┃.*/g,"").replace(/[^a-zA-Z0-9+]/g,"").substring(0,4).toLowerCase(),D=`${x||k||$||S?'<span class="descr-expand-toggle">\u2794</span>':""}`;let T="";return t==="array"?T=u`<div class="td key-type ${V}" title="${l==="readonly"?"Read-Only":w==="writeonly"?"Write-Only":""}">[${v}] ${l==="readonly"?"\u{1F181}":l==="writeonly"?"\u{1F186}":""}</div>`:T=u`<div class="td key-type ${V}" title="${w==="\u{1F181}"?"Read-Only":w==="\u{1F186}"?"Write-Only":""}">${v} ${w}</div>`,u`<div class="tr primitive" title="${c||R?"Deprecated":""}"><div class="td key ${c||R?"deprecated":""}" style="padding-left:${m}px">${c||R?u`<svg viewBox="0 0 10 10" width="10" height="10" style="stroke:var(--red);margin-right:-6px"><path d="M2 2L8 8M2 8L8 2"/></svg>`:""} ${y!=null&&y.endsWith("*")?u`<span class="key-label">${y.substring(0,y.length-1)}</span> <span style="color:var(--red)">*</span>`:r.startsWith("::OPTION")?u`<span class="xxx-of-key">${y}</span><span class="xxx-of-descr">${g}</span>`:u`${y?u`<span class="key-label">${y}</span>`:u`<span class="xxx-of-descr">${N}</span>`}`}</div>${T}<div class="td key-descr" style="font-size:var(--font-size-small)">${u`<span class="m-markdown-small">${_(A(t==="array"?`${D} ${s}`:N?`${D} <b>${N}:</b> ${E}`:`${D} ${E}`))}</span>`} ${x?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Constraints: </span>${x}</div>`:""} ${k?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Default: </span>${k}</div>`:""} ${$?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">${v==="const"?"Value":"Allowed"}: </span>${$}</div>`:""} ${S?u`<div style="display:inline-block;line-break:anywhere;margin-right:8px"><span class="bold-text">Pattern: </span>${S}</div>`:""}</div></div>`}handleAllEvents(e){if(e.target.classList.contains("obj-toggle"))this.toggleObjectExpand(e);else if(e.target.classList.contains("schema-multiline-toggle"))this.schemaDescriptionExpanded=this.schemaDescriptionExpanded==="true"?"false":"true";else if(e.target.classList.contains("descr-expand-toggle")){const t=e.target.closest(".tr");t&&(t.classList.toggle("expanded-descr"),t.style.maxHeight=t.scrollHeight)}}toggleObjectExpand(e){const t=e.target.closest(".tr");t.classList.contains("expanded")?(t.classList.add("collapsed"),t.classList.remove("expanded"),e.target.innerText="+"):(t.classList.remove("collapsed"),t.classList.add("expanded"),e.target.innerText="-")}}customElements.define("schema-table",Id);class jd extends ee{constructor(){super(),this.selectedStatus="",this.headersForEachRespStatus={},this.mimeResponsesForEachStatus={},this.activeSchemaTab="schema"}static get properties(){return{callback:{type:String},webhook:{type:String},responses:{type:Object},parser:{type:Object},schemaStyle:{type:String,attribute:"schema-style"},renderStyle:{type:String,attribute:"render-style"},selectedStatus:{type:String,attribute:"selected-status"},selectedMimeType:{type:String,attribute:"selected-mime-type"},activeSchemaTab:{type:String,attribute:"active-schema-tab"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"}}}static get styles(){return[Fe,Yt,en,Qt,$t,_n,U`:where(button,input[type=checkbox],[tabindex="0"]):focus-visible{box-shadow:var(--focus-shadow)}:where(input[type=text],input[type=password],select,textarea):focus-visible{border-color:var(--primary-color)}.resp-head{vertical-align:middle;padding:16px 0 8px}.resp-head.divider{border-top:1px solid var(--border-color);margin-top:10px}.resp-status{font-weight:700;font-size:calc(var(--font-size-small) + 1px)}.resp-descr{font-size:calc(var(--font-size-small) + 1px);color:var(--light-fg);text-align:left}.top-gap{margin-top:16px}.example-panel{font-size:var(--font-size-small);margin:0}.focused-mode,.read-mode{border-top:1px dashed var(--border-color);margin-top:12px;padding-top:24px}`,Ke]}render(){return u`<div class="col regular-font response-panel ${this.renderStyle}-mode"><div class="${this.callback==="true"?"tiny-title":"req-res-title"}">${this.callback==="true"?"CALLBACK RESPONSE":"RESPONSE"}</div><div>${this.responseTemplate()}</div></div>`}resetSelection(){this.selectedStatus="",this.selectedMimeType=""}responseTemplate(){var e,t,a;if(!this.responses)return"";for(const r in this.responses){this.selectedStatus||(this.selectedStatus=r);const s={};for(const o in(e=this.responses[r])==null?void 0:e.content){const l=this.responses[r].content[o];this.selectedMimeType||(this.selectedMimeType=o);const c=K(l.schema,{}),d=it(l.schema,o,ie(l.examples),ie(l.example),!(this.callback==="true"||this.webhook==="true"),this.callback==="true"||this.webhook==="true",o.includes("json")?"json":"text");s[o]={description:this.responses[r].description,examples:d,selectedExample:((t=d[0])==null?void 0:t.exampleId)||"",schemaTree:c}}const i=[];for(const o in(a=this.responses[r])==null?void 0:a.headers)i.push({name:o,...this.responses[r].headers[o]});this.headersForEachRespStatus[r]=i,this.mimeResponsesForEachStatus[r]=s}return u`${Object.keys(this.responses).length>1?u`<div class="row" style="flex-wrap:wrap">${Object.keys(this.responses).map(r=>u`${r==="$$ref"?"":u`<button @click="${()=>{this.selectedStatus=r,this.responses[r].content&&Object.keys(this.responses[r].content)[0]?this.selectedMimeType=Object.keys(this.responses[r].content)[0]:this.selectedMimeType=void 0}}" class="m-btn small ${this.selectedStatus===r?"primary":""}" part="btn ${this.selectedStatus===r?"btn-response-status btn-selected-response-status":" btn-response-status"}" style="margin:8px 4px 0 0">${r}</button>`}`)}</div>`:u`<span>${Object.keys(this.responses)[0]}</span>`} ${Object.keys(this.responses).map(r=>{var s,i;return u`<div style="display:${r===this.selectedStatus?"block":"none"}"><div class="top-gap"><span class="resp-descr m-markdown">${_(z(A(((s=this.responses[r])==null?void 0:s.description)||"")))}</span> ${this.headersForEachRespStatus[r]&&((i=this.headersForEachRespStatus[r])==null?void 0:i.length)>0?u`${this.responseHeaderListTemplate(this.headersForEachRespStatus[r])}`:""}</div>${Object.keys(this.mimeResponsesForEachStatus[r]).length===0?"":u`<div part="tab-panel" class="tab-panel col"><div part="tab-btn-row" class="tab-buttons row" @click="${o=>{o.target.tagName.toLowerCase()==="button"&&(this.activeSchemaTab=o.target.dataset.tab)}}"><button part="tab-btn" class="tab-btn ${this.activeSchemaTab==="example"?"active":""}" data-tab="example">EXAMPLE</button> <button part="tab-btn" class="tab-btn ${this.activeSchemaTab!=="example"?"active":""}" data-tab="schema">SCHEMA</button><div style="flex:1"></div>${Object.keys(this.mimeResponsesForEachStatus[r]).length===1?u`<span class="small-font-size gray-text" style="align-self:center;margin-top:8px">${Object.keys(this.mimeResponsesForEachStatus[r])[0]}</span>`:u`${this.mimeTypeDropdownTemplate(Object.keys(this.mimeResponsesForEachStatus[r]))}`}</div>${this.activeSchemaTab==="example"?u`<div part="tab-content" class="tab-content col" style="flex:1">${this.mimeExampleTemplate(this.mimeResponsesForEachStatus[r][this.selectedMimeType])}</div>`:u`<div part="tab-content" class="tab-content col" style="flex:1">${this.mimeSchemaTemplate(this.mimeResponsesForEachStatus[r][this.selectedMimeType])}</div>`}</div>`}</div>`})}`}responseHeaderListTemplate(e){return u`<div style="padding:16px 0 8px 0" class="resp-headers small-font-size bold-text">RESPONSE HEADERS</div><table role="presentation" style="border-collapse:collapse;margin-bottom:16px;border:1px solid var(--border-color);border-radius:var(--border-radius)" class="small-font-size mono-font">${e.map(t=>{var a,r;return u`<tr><td style="padding:8px;vertical-align:baseline;min-width:120px;border-top:1px solid var(--light-border-color);text-overflow:ellipsis">${t.name||""}</td><td style="padding:4px;vertical-align:baseline;padding:0 5px;border-top:1px solid var(--light-border-color);text-overflow:ellipsis">${((a=t.schema)==null?void 0:a.type)||""}</td><td style="padding:8px;vertical-align:baseline;border-top:1px solid var(--light-border-color);text-overflow:ellipsis"><div class="m-markdown-small regular-font">${_(z(A(t.description||"")))}</div></td><td style="padding:8px;vertical-align:baseline;border-top:1px solid var(--light-border-color);text-overflow:ellipsis">${((r=t.schema)==null?void 0:r.example)||""}</td></tr>`})}</table>`}mimeTypeDropdownTemplate(e){return u`<select aria-label="mime types" @change="${t=>{this.selectedMimeType=t.target.value}}" style="margin-bottom:-1px;z-index:1">${e.map(t=>u`<option value="${t}" ?selected="${t===this.selectedMimeType}">${t}</option>`)}</select>`}onSelectExample(e){[...e.target.closest(".example-panel").querySelectorAll(".example")].forEach(t=>{t.style.display=t.dataset.example===e.target.value?"block":"none"})}mimeExampleTemplate(e){return!e||!e.examples||e.examples.length===0?u`<pre style="color:var(--red)" class="${this.renderStyle==="read"?"read example-panel border pad-8-16":"example-panel border-top"}">
|
|
262
|
+
No example provided </pre>`:u`${e.examples.length===1?u`${e.examples[0].exampleFormat==="json"?u`${e.examples[0].exampleSummary&&e.examples[0].exampleSummary.length>80?u`<div style="padding:4px 0">${e.examples[0].exampleSummary}</div>`:""} ${e.examples[0].exampleDescription?u`<div class="m-markdown-small" style="padding:4px 0">${_(z(A(e.examples[0].exampleDescription||"")),{USE_PROFILES:{html:!0}})}</div>`:""}<json-tree render-style="${this.renderStyle}" .data="${e.examples[0].exampleValue}" class="example-panel ${this.renderStyle==="read"?"border pad-8-16":"border-top pad-top-8"}" exportparts="btn:btn, btn-fill:btn-fill, btn-copy:btn-copy"></json-tree>`:u`${e.examples[0].exampleSummary&&e.examples[0].exampleSummary.length>80?u`<div style="padding:4px 0">${e.examples[0].exampleSummary}</div>`:""} ${e.examples[0].exampleDescription?u`<div class="m-markdown-small" style="padding:4px 0">${_(z(A(e.examples[0].exampleDescription||"")))}</div>`:""}<pre class="example-panel ${this.renderStyle==="read"?"border pad-8-16":"border-top pad-top-8"}">
|
|
263
|
+
${e.examples[0].exampleValue}</pre>`}`:u`<span class="example-panel ${this.renderStyle==="read"?"border pad-8-16":"border-top pad-top-8"}"><select aria-label="response examples" style="min-width:100px;max-width:100%" @change="${t=>this.onSelectExample(t)}">${e.examples.map(t=>u`<option value="${t.exampleId}" ?selected="${t.exampleId===e.selectedExample}">${t.exampleSummary.length>80?t.exampleId:t.exampleSummary}</option>`)}</select> ${e.examples.map(t=>u`<div class="example" data-example="${t.exampleId}" style="display:${t.exampleId===e.selectedExample?"block":"none"}">${t.exampleSummary&&t.exampleSummary.length>80?u`<div style="padding:4px 0">${t.exampleSummary}</div>`:""} ${t.exampleDescription?u`<div class="m-markdown-small" style="padding:4px 0">${_(z(A(t.exampleDescription||"")))}</div>`:""} ${t.exampleFormat==="json"?u`<json-tree render-style="${this.renderStyle}" .data="${t.exampleValue}" exportparts="btn:btn, btn-fill:btn-fill, btn-copy:btn-copy"></json-tree>`:u`<pre>${t.exampleValue}</pre>`}</div>`)}</span>`}`}mimeSchemaTemplate(e){return e?u`${this.schemaStyle==="table"?u`<schema-table .data="${e.schemaTree}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly}" schema-hide-write-only="${this.schemaHideWriteOnly}" exportparts="schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></schema-table>`:u`<schema-tree .data="${e.schemaTree}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly}" schema-hide-write-only="${this.schemaHideWriteOnly}" exportparts="schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></schema-tree>`}`:u`<pre style="color:var(--red)" class="${this.renderStyle==="read"?"border pad-8-16":"border-top"}"> Schema not found</pre>`}}customElements.define("api-response",jd);function qd(n){const e=new xt,t=new A.Renderer;return t.heading=(a,r,s)=>`<h${r} class="observe-me" id="${n}--${e.slug(s)}">${a}</h${r}>`,t}function zd(n){const e=n.target.closest(".tag-container").querySelector(".tag-description"),t=n.target.closest(".tag-container").querySelector(".tag-icon");e&&t&&(e.classList.contains("expanded")?(e.style.maxHeight=0,e.classList.replace("expanded","collapsed"),t.classList.replace("expanded","collapsed")):(e.style.maxHeight=`${e.scrollHeight}px`,e.classList.replace("collapsed","expanded"),t.classList.replace("collapsed","expanded")))}function Za(n,e="",t=""){var a,r,s,i,o,l,c,d,p,h,m;const y=new Set;for(const w in n.responses)for(const x in(a=n.responses[w])==null?void 0:a.content)y.add(x.trim());const g=[...y].join(", "),f=this.resolvedSpec.securitySchemes.filter(w=>{var x;return w.finalKeyValue&&((x=n.security)==null?void 0:x.some(k=>w.securitySchemeId in k))})||[],b=this.resolvedSpec.securitySchemes.find(w=>w.securitySchemeId===Te&&w.value!=="-");b&&f.push(b);const v=n.xCodeSamples?$i.call(this,n.xCodeSamples):"";return u`${this.renderStyle==="read"?u`<div class="divider" part="operation-divider"></div>`:""}<div class="expanded-endpoint-body observe-me ${n.method} ${n.deprecated?"deprecated":""}" part="section-operation ${n.elementId}" id="${n.elementId}">${this.renderStyle==="focused"&&e!=="General \u2982"?u`<div class="tag-container" part="section-operation-tag"><span class="upper" style="font-weight:700;font-size:18px">${e} </span>${t?u`<svg class="tag-icon collapsed" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" fill="none" style="stroke:var(--primary-color);vertical-align:top;cursor:pointer" @click="${w=>{zd.call(this,w)}}"><path d="M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h8"></path><path d="M18 4v17"></path><path d="M15 18l3 3l3 -3"></path></svg><div class="tag-description collapsed" style="max-height:0;overflow:hidden;margin-top:16px;border:1px solid var(--border-color)"><div class="m-markdown" style="padding:8px">${_(z(A(t)))}</div></div>`:""}</div>`:""} ${n.deprecated?u`<div class="bold-text red-text">DEPRECATED</div>`:""} ${u`${n.xBadges&&((r=n.xBadges)==null?void 0:r.length)>0?u`<div style="display:flex;flex-wrap:wrap;margin-bottom:-24px;font-size:var(--font-size-small)">${n.xBadges.map(w=>w.color==="none"?"":u`<span style="margin:1px;margin-right:5px;padding:1px 8px;font-weight:700;border-radius:12px;background:color-mix(in srgb,var(--${w.color}) 10%,transparent);color:var(--${w.color});border:1px solid var(--${w.color})">${w.label}</span>`)}</div>`:""}<h2 part="section-operation-summary">${n.shortSummary||`${n.method.toUpperCase()} ${n.path}`}</h2>${n.isWebhook?u`<span part="section-operation-webhook" style="color:var(--primary-color);font-weight:700;font-size:var(--font-size-regular)">WEBHOOK</span>`:u`<div part="section-operation-webhook-method" class="mono-font regular-font-size" style="text-align:left;direction:ltr;padding:8px 0;color:var(--fg3)"><span part="label-operation-method" class="regular-font upper method-fg bold-text ${n.method}">${n.method}</span> <span style="overflow-wrap:break-word" part="label-operation-path">${n.path}</span></div>`}<slot name="${n.elementId}"></slot>`} ${n.description?u`<div class="m-markdown">${_(z(A(n.description)))}</div>`:""} ${wi.call(this,n.security)} ${(s=n.externalDocs)!=null&&s.url||(i=n.externalDocs)!=null&&i.description?u`<div style="background:var(--bg3);padding:2px 8px 8px 8px;margin:8px 0;border-radius:var(--border-radius)"><div class="m-markdown">${_(z(A(((o=n.externalDocs)==null?void 0:o.description)||"")))}</div>${(l=n.externalDocs)!=null&&l.url?u`<a style="font-family:var(--font-mono);font-size:var(--font-size-small)" href="${(c=n.externalDocs)==null?void 0:c.url}" target="_blank">${(d=n.externalDocs)==null?void 0:d.url}<div style="transform:rotate(270deg) scale(1.5);display:inline-block;margin-left:5px">⇲</div></a>`:""}</div>`:""} ${v}<div class="expanded-req-resp-container"><api-request class="${this.renderStyle}-mode" style="width:100%" webhook="${n.isWebhook}" method="${n.method}" path="${n.path}" .security="${n.security}" .parameters="${n.parameters}" .request_body="${n.requestBody}" .api_keys="${f}" .servers="${n.servers}" server-url="${((h=(p=n.servers)==null?void 0:p[0])==null?void 0:h.url)||((m=this.selectedServer)==null?void 0:m.computedUrl)}" fill-request-fields-with-example="${this.fillRequestFieldsWithExample}" allow-try="${this.allowTry}" show-curl-before-try="${this.showCurlBeforeTry}" accept="${g}" render-style="${this.renderStyle}" schema-style="${this.schemaStyle}" active-schema-tab="${this.defaultSchemaTab}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly==="never"||n.isWebhook?"false":"true"}" schema-hide-write-only="${this.schemaHideWriteOnly==="never"?"false":n.isWebhook?"true":"false"}" fetch-credentials="${this.fetchCredentials}" exportparts="wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
|
|
263
264
|
tab-panel:tab-panel, tab-btn:tab-btn, tab-btn-row:tab-btn-row, tab-coontent:tab-content,
|
|
264
265
|
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
|
|
265
|
-
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></api-request>${n.callbacks?
|
|
266
|
+
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></api-request>${n.callbacks?ki.call(this,n.callbacks):""}<api-response class="${this.renderStyle}-mode" style="width:100%" webhook="${n.isWebhook}" .responses="${n.responses}" render-style="${this.renderStyle}" schema-style="${this.schemaStyle}" active-schema-tab="${this.defaultSchemaTab}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly==="never"?"false":n.isWebhook?"true":"false"}" schema-hide-write-only="${this.schemaHideWriteOnly==="never"||n.isWebhook?"false":"true"}" selected-status="${Object.keys(n.responses||{})[0]||""}" exportparts="btn:btn, btn-response-status:btn-response-status, btn-selected-response-status:btn-selected-response-status, btn-fill:btn-fill, btn-copy:btn-copy,
|
|
266
267
|
tab-panel:tab-panel, tab-btn:tab-btn, tab-btn-row:tab-btn-row, tab-coontent:tab-content,
|
|
267
|
-
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></api-response></div></div>`}function
|
|
268
|
+
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></api-response></div></div>`}function Pd(){return this.resolvedSpec?u`${this.resolvedSpec.tags.map(n=>u`<section id="${n.elementId}" part="section-tag" class="regular-font section-gap--read-mode observe-me" style="border-top:1px solid var(--primary-color)"><div class="title tag" part="section-tag-title label-tag-title">${n.displayName||n.name}</div><slot name="${n.elementId}"></slot><div class="regular-font-size">${_(`
|
|
268
269
|
<div class="m-markdown regular-font">
|
|
269
|
-
${z(A(n.description||"",this.infoDescriptionHeadingsInNavBar==="true"?{renderer:
|
|
270
|
-
</div>`)}</div></section><section class="regular-font section-gap--read-mode" part="section-operations-in-tag">${n.paths.map(e=>
|
|
271
|
-
${A(this.resolvedSpec.info.description,this.infoDescriptionHeadingsInNavBar==="true"?{renderer:
|
|
272
|
-
</div>`))}`:""}</div>`:""}</section>`}function ja(n){var e;const t=(e=this.resolvedSpec)==null?void 0:e.servers.find(a=>a.url===n);return t?(this.selectedServer=t,this.requestUpdate(),this.dispatchEvent(new CustomEvent("api-server-change",{bubbles:!0,composed:!0,detail:{selectedServer:t}})),!0):!1}function li(n,e){const t=[...n.currentTarget.closest("table").querySelectorAll("input, select")];let a=e.url;t.forEach(r=>{const s=new RegExp(`{${r.dataset.var}}`,"g");a=a.replace(s,r.value)}),e.computedUrl=a,this.requestUpdate()}function Dd(){return this.selectedServer&&this.selectedServer.variables?u`<div class="table-title">SERVER VARIABLES</div><table class="m-table" role="presentation">${Object.entries(this.selectedServer.variables).map(n=>u`<tr><td style="vertical-align:middle">${n[0]}</td><td>${n[1].enum?u`<select data-var="${n[0]}" @input="${e=>{li.call(this,e,this.selectedServer)}}">${Object.entries(n[1].enum).map(e=>n[1].default===e[1]?u`<option selected="selected" label="${e[1]}" value="${e[1]}"></option>`:u`<option label="${e[1]}" value="${e[1]}"></option>`)}</select>`:u`<input type="text" part="textbox textbox-server-var" spellcheck="false" data-var="${n[0]}" value="${n[1].default}" @input="${e=>{li.call(this,e,this.selectedServer)}}">`}</td></tr>${n[1].description?u`<tr><td colspan="2" style="border:none"><span class="m-markdown-small">${I(z(A(n[1].description)))}</span></td></tr>`:""}`)}</table>`:""}function ci(){var n,e,t;return!this.resolvedSpec||this.resolvedSpec.specLoadError?"":u`<section id="servers" part="section-servers" style="text-align:left;direction:ltr;margin-top:24px;margin-bottom:24px" class="regular-font observe-me ${"read focused".includes(this.renderStyle)?"section-gap--read-mode":"section-gap"}"><div part="section-servers-title" class="sub-title">API SERVER</div><div class="mono-font" style="margin:12px 0;font-size:calc(var(--font-size-small) + 1px)">${!this.resolvedSpec.servers||((n=this.resolvedSpec.servers)==null?void 0:n.length)===0?"":u`${(e=this.resolvedSpec)==null?void 0:e.servers.map((a,r)=>u`<input type="radio" name="api_server" id="srvr-opt-${r}" value="${a.url}" @change="${()=>{ja.call(this,a.url)}}" .checked="${this.selectedServer.url===a.url}" style="margin:4px 0;cursor:pointer"> <label style="cursor:pointer" for="srvr-opt-${r}">${a.url} ${a.description?u`- <span class="regular-font">${a.description}</span>`:""}</label><br>`)}`}<div class="table-title primary-text" part="label-selected-server">SELECTED: ${((t=this.selectedServer)==null?void 0:t.computedUrl)||"none"}</div></div><slot name="servers"></slot>${Dd.call(this)}</section>`}function di(n,e="toggle"){const t=n?.closest(".nav-bar-tag-and-paths"),a=t?.querySelector(".nav-bar-paths-under-tag");if(t){const r=t.classList.contains("expanded");r&&(e==="toggle"||e==="collapse")?(a.style.maxHeight=0,t.classList.replace("expanded","collapsed")):!r&&(e==="toggle"||e==="expand")&&(t.classList.replace("collapsed","expanded"),a.style.maxHeight=`${a.scrollHeight}px`)}}function Cd(n,e="expand-all"){if(!(n.type==="click"||n.type==="keyup"&&n.keyCode===13))return;const t=[...n.target.closest(".nav-scroll").querySelectorAll(".nav-bar-tag-and-paths")];e==="expand-all"?t.forEach(a=>{const r=a.querySelector(".nav-bar-paths-under-tag");a.classList.replace("collapsed","expanded"),r.style.maxHeight=`${r?.scrollHeight}px`}):t.forEach(a=>{a.classList.replace("expanded","collapsed")})}function pi(n){var e,t,a,r;if(!(n.type==="click"||n.type==="keyup"&&n.keyCode===13))return;const s=n.target;if(n.stopPropagation(),((e=s.dataset)==null?void 0:e.action)==="navigate"){this.scrollToEventTarget(n,!1);const i=n.currentTarget.closest("#nav-bar");i.classList.contains("floating-nav")&&i.classList.remove("floating-nav")}else((t=s.dataset)==null?void 0:t.action)==="expand-all"||((a=s.dataset)==null?void 0:a.action)==="collapse-all"?Cd(n,s.dataset.action):((r=s.dataset)==null?void 0:r.action)==="expand-collapse-tag"&&di(s,"toggle")}function Fd(){var n,e,t,a;const r=new gt;return!this.resolvedSpec||this.resolvedSpec.specLoadError?u`<nav class="nav-bar" part="section-navbar"><slot name="nav-logo" class="logo"></slot></nav>`:u`<button id="nav-bar-btn" part="btn-navbar" class="btn" @click="${this.onOpenNavBarToggle}">☰</button><nav id="nav-bar" class="nav-bar ${this.renderStyle}" part="section-navbar"><slot name="nav-logo" class="logo"></slot>${this.allowSearch==="false"&&this.allowAdvancedSearch==="false"?"":u`<div style="display:flex;flex-direction:row;justify-content:center;align-items:stretch;padding:8px 24px 12px 24px;${this.allowAdvancedSearch==="false"?"border-bottom: 1px solid var(--nav-hover-bg-color)":""}" part="section-navbar-search">${this.allowSearch==="false"?"":u`<div style="display:flex;flex:1;line-height:22px"><input id="nav-bar-search" part="textbox textbox-nav-filter" style="width:100%;padding-right:20px;color:var(--nav-hover-text-color);border-color:var(--nav-accent-color);background:var(--nav-hover-bg-color)" type="text" placeholder="Filter" @change="${this.onSearchChange}" spellcheck="false"><div style="margin:6px 5px 0 -24px;font-size:var(--font-size-regular);cursor:pointer">↩</div></div>${this.searchVal?u`<button @click="${this.onClearSearch}" class="m-btn thin-border" style="margin-left:5px;color:var(--nav-text-color);width:75px;padding:6px 8px" part="btn btn-outline btn-clear-filter">CLEAR</button>`:""}`} ${this.allowAdvancedSearch==="false"||this.searchVal?"":u`<button id="advanced-search-btn" class="m-btn primary" part="btn btn-fill btn-search" style="margin-left:5px;padding:6px 8px;width:75px" @click="${this.onShowAdvancedSearchClicked}">SEARCH</button>`}</div>`} ${u`<nav class="nav-scroll" tabindex="-1" part="section-navbar-scroll" @click="${s=>pi.call(this,s)}" @keyup="${s=>pi.call(this,s)}">${this.showInfo==="false"||!this.resolvedSpec.info?"":u`${this.infoDescriptionHeadingsInNavBar==="true"?u`${this.resolvedSpec.infoDescriptionHeaders.length>0?u`<div class="nav-bar-info ${this.navActiveItemMarker}" id="link-overview" data-content-id="overview" data-action="navigate" tabindex="0" part="section-navbar-item section-navbar-overview">${((e=(n=this.resolvedSpec.info)==null?void 0:n.title)==null?void 0:e.trim())||"Overview"}</div>`:""}<div class="overview-headers">${this.resolvedSpec.infoDescriptionHeaders.map(s=>{const i=r.slug(s.text);return u`<div class="nav-bar-h${s.depth} ${this.navActiveItemMarker}" id="link-overview--${i}" data-action="navigate" data-content-id="overview--${i}">${s.text}</div>`})}</div>${this.resolvedSpec.infoDescriptionHeaders.length>0?u`<hr style="border-top:1px solid var(--nav-hover-bg-color);border-width:1px 0 0 0;margin:15px 0 0 0">`:""}`:u`<div class="nav-bar-info ${this.navActiveItemMarker}" id="link-overview" data-action="navigate" data-content-id="overview" tabindex="0">${((a=(t=this.resolvedSpec.info)==null?void 0:t.title)==null?void 0:a.trim())||"Overview"}</div>`}`} ${this.allowServerSelection==="false"?"":u`<div class="nav-bar-info ${this.navActiveItemMarker}" id="link-servers" data-action="navigate" data-content-id="servers" tabindex="0" part="section-navbar-item section-navbar-servers">API Servers</div>`} ${this.allowAuthentication==="false"||!this.resolvedSpec.securitySchemes?"":u`<div class="nav-bar-info ${this.navActiveItemMarker}" id="link-auth" data-action="navigate" data-content-id="auth" tabindex="0" part="section-navbar-item section-navbar-auth">Authentication</div>`}<div id="link-operations-top" class="nav-bar-section operations" data-action="navigate" data-content-id="${this.renderStyle==="focused"?"":"operations-top"}" part="section-navbar-item section-navbar-operations-top"><div style="font-size:16px;display:flex;margin-left:10px">${this.renderStyle==="focused"?u`<div class="nav-bar-expand-all" data-action="expand-all" tabindex="0" title="Expand all">▸</div><div class="nav-bar-collapse-all" data-action="collapse-all" tabindex="0" title="Collapse all">▸</div>`:""}</div><div class="nav-bar-section-title">OPERATIONS</div></div>${this.resolvedSpec.tags.filter(s=>s.paths.filter(i=>xt(this.searchVal,i,s.name)).length).map(s=>u`<div class="nav-bar-tag-and-paths ${this.renderStyle==="read"||s.expanded?"expanded":"collapsed"}">${s.name==="General \u2982"?u`<hr style="border:none;border-top:1px dotted var(--nav-text-color);opacity:.3;margin:-1px 0 0 0">`:u`<div class="nav-bar-tag ${this.navActiveItemMarker}" part="section-navbar-item section-navbar-tag" id="link-${s.elementId}" data-action="${this.renderStyle==="read"||this.onNavTagClick==="show-description"?"navigate":"expand-collapse-tag"}" data-content-id="${(this.renderStyle==="read"?`${s.elementId}`:this.onNavTagClick==="show-description")?`${s.elementId}`:""}" data-first-path-id="${s.firstPathId}" tabindex="0"><div style="pointer-events:none">${s.displayName||s.name}</div><div class="nav-bar-tag-icon" tabindex="0" data-action="expand-collapse-tag"></div></div>`} ${this.infoDescriptionHeadingsInNavBar==="true"?u`${this.renderStyle==="focused"&&this.onNavTagClick==="expand-collapse"?"":u`<div class="tag-headers">${s.headers.map(i=>u`<div class="nav-bar-h${i.depth} ${this.navActiveItemMarker}" part="section-navbar-item section-navbar-h${i.depth}" id="link-${s.elementId}--${r.slug(i.text)}" data-action="navigate" data-content-id="${s.elementId}--${r.slug(i.text)}" tabindex="0">${i.text}</div>`)}</div>`}`:""}<div class="nav-bar-paths-under-tag">${s.paths.filter(i=>this.searchVal?xt(this.searchVal,i,s.name):!0).map(i=>u`<div class="nav-bar-path ${this.navActiveItemMarker} ${this.usePathInNavBar==="true"?"small-font":""}" part="section-navbar-item section-navbar-path" data-action="navigate" data-content-id="${i.elementId}" id="link-${i.elementId}" tabindex="0"><span style="display:flex;pointer-events:none;align-items:start;${i.deprecated?"filter:opacity(0.5)":""}">${u`<span class="nav-method ${this.showMethodInNavBar} ${i.method}" style="pointer-events:none">${this.showMethodInNavBar==="as-colored-block"?i.method.substring(0,3).toUpperCase():i.method.toUpperCase()}</span>`} ${i.isWebhook?u`<span style="font-weight:700;pointer-events:none;margin-right:8px;font-size:calc(var(--font-size-small) - 2px)">WEBHOOK</span>`:""} ${this.usePathInNavBar==="true"?u`<span style="pointer-events:none" class="mono-font">${i.path}</span>`:i.summary||i.shortSummary}</span></div>`)}</div></div>`)} ${this.resolvedSpec.components&&this.showComponents==="true"&&this.renderStyle==="focused"?u`<div id="link-components" class="nav-bar-section components"><div></div><div class="nav-bar-section-title">COMPONENTS</div></div>${this.resolvedSpec.components.map(s=>s.subComponents.length?u`<div class="nav-bar-tag" part="section-navbar-item section-navbar-tag" data-action="navigate" data-content-id="cmp--${s.name.toLowerCase()}" id="link-cmp--${s.name.toLowerCase()}">${s.name}</div>${s.subComponents.filter(i=>i.expanded!==!1).map(i=>u`<div class="nav-bar-path" data-action="navigate" data-content-id="cmp--${i.id}" id="link-cmp--${i.id}"><span style="pointer-events:none">${i.name}</span></div>`)}`:"")}`:""}</nav>`}</nav>`}function Td(n){const e=new A.Renderer,t=new gt;return e.heading=({text:a,depth:r})=>`<h${r} class="observe-me" id="${n}--${t.slug(a)}">${a}</h${r}>`,e}function An(n){return u`<div class="regular-font section-gap--focused-mode" part="section-operations-in-tag">${n}</div>`}function ui(){var n;if(this.showInfo==="true")return An(Ra.call(this));const e=this.resolvedSpec.tags[0],t=(n=this.resolvedSpec.tags[0])==null?void 0:n.paths[0];return An(e&&t?_a.call(this,t,e.name):"")}function Od(n){return u`<h1 id="${n.elementId}">${n.displayName||n.name}</h1>${this.onNavTagClick==="show-description"&&n.description?u`<div class="m-markdown">${I(`<div class="m-markdown regular-font">
|
|
273
|
-
${z(A(n.description||"",this.infoDescriptionHeadingsInNavBar==="true"?{renderer:
|
|
274
|
-
</div>`)}</div>`:""}`}function
|
|
270
|
+
${z(A(n.description||"",this.infoDescriptionHeadingsInNavBar==="true"?{renderer:qd(n.elementId)}:void 0))}
|
|
271
|
+
</div>`)}</div></section><section class="regular-font section-gap--read-mode" part="section-operations-in-tag">${n.paths.map(e=>Za.call(this,e))}</section>`)}`:""}function Ud(n){return u`<div class="divider"></div><div class="expanded-endpoint-body observe-me ${n.name}" id="cmp--${n.id}"><div style="font-weight:700">${n.name} <span style="color:var(--light-fg);font-size:var(--font-size-small);font-weight:400">Schema</span></div>${this.schemaStyle==="table"?u`<schema-table .data="${K(n.component,{})}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="false" schema-hide-write-only="${this.schemaHideWriteOnly}" exportparts="schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></schema-table>`:u`<schema-tree .data="${K(n.component,{})}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="false" schema-hide-write-only="${this.schemaHideWriteOnly}" exportparts="schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></schema-tree>`}</div>`}function Md(n,e){return n.id.indexOf("schemas-")!==-1?Ud.call(this,n):u`<div class="divider"></div><div class="expanded-endpoint-body observe-me ${n.name}" id="cmp--${n.id}">${u`<div style="font-weight:700">${n.name} <span style="color:var(--light-fg);font-size:var(--font-size-small);font-weight:400">${e}</span></div>${n.component?u`<div class="mono-font regular-font-size" style="padding:8px 0;color:var(--fg2)"><json-tree class="border tree" render-style="${this.renderStyle}" .data="${n.component}"></json-tree></div>`:""}`}</div>`}function Hd(){return this.resolvedSpec?u`${this.resolvedSpec.components.map(n=>u`<div id="cmp--${n.name.toLowerCase()}" class="regular-font section-gap--read-mode observe-me" style="border-top:1px solid var(--primary-color)"><div class="title tag">${n.name}</div><div class="regular-font-size">${_(`<div class='m-markdown regular-font'>${z(A(n.description||""))}</div>`)}</div></div><div class="regular-font section-gap--read-mode">${n.subComponents.filter(e=>e.expanded!==!1).map(e=>Md.call(this,e,n.name))}</div>`)}`:""}function Wd(){const n=new xt,e=new A.Renderer;return e.heading=({text:t,depth:a})=>`<h${a} class="observe-me" id="overview--${n.slug(t)}">${t}</h${a}>`,e}function Ja(){var n,e,t,a;return u`<section id="overview" part="section-overview" class="observe-me ${this.renderStyle==="view"?"section-gap":"section-gap--read-mode"}">${(n=this.resolvedSpec)!=null&&n.info?u`<div id="api-title" part="section-overview-title" style="font-size:32px">${this.resolvedSpec.info.title} ${this.resolvedSpec.info.version?u`<span style="font-size:var(--font-size-small);font-weight:700">${this.resolvedSpec.info.version}</span>`:""}</div><div id="api-info" style="font-size:calc(var(--font-size-regular) - 1px);margin-top:8px">${(e=this.resolvedSpec.info.contact)!=null&&e.email?u`<span>${this.resolvedSpec.info.contact.name||"Email"}: <a href="mailto:${this.resolvedSpec.info.contact.email}" part="anchor anchor-overview">${this.resolvedSpec.info.contact.email}</a></span>`:""} ${(t=this.resolvedSpec.info.contact)!=null&&t.url?u`<span>URL: <a href="${this.resolvedSpec.info.contact.url}" part="anchor anchor-overview">${this.resolvedSpec.info.contact.url}</a></span>`:""} ${this.resolvedSpec.info.license?u`<span>License: ${this.resolvedSpec.info.license.url?u`<a href="${this.resolvedSpec.info.license.url}" part="anchor anchor-overview">${this.resolvedSpec.info.license.name}</a>`:this.resolvedSpec.info.license.name}</span>`:""} ${this.resolvedSpec.info.termsOfService?u`<span><a href="${this.resolvedSpec.info.termsOfService}" part="anchor anchor-overview">Terms of Service</a></span>`:""} ${this.specUrl&&this.allowSpecFileDownload==="true"?u`<div style="display:flex;margin:12px 0;gap:8px;justify-content:start"><button class="m-btn thin-border" style="min-width:170px" part="btn btn-outline" @click="${r=>{Kr(this.specUrl,"openapi-spec")}}">Download OpenAPI spec</button> ${(a=this.specUrl)!=null&&a.trim().toLowerCase().endsWith("json")?u`<button class="m-btn thin-border" style="width:200px" part="btn btn-outline" @click="${r=>{Vr(this.specUrl)}}">View OpenAPI spec (New Tab)</button>`:""}</div>`:""}</div><slot name="overview"></slot><div id="api-description">${this.resolvedSpec.info.description?u`${_(z(`<div class="m-markdown regular-font">
|
|
272
|
+
${A(this.resolvedSpec.info.description,this.infoDescriptionHeadingsInNavBar==="true"?{renderer:Wd()}:void 0)}
|
|
273
|
+
</div>`))}`:""}</div>`:""}</section>`}function Ga(n){var e;const t=(e=this.resolvedSpec)==null?void 0:e.servers.find(a=>a.url===n);return t?(this.selectedServer=t,this.requestUpdate(),this.dispatchEvent(new CustomEvent("api-server-change",{bubbles:!0,composed:!0,detail:{selectedServer:t}})),!0):!1}function Ei(n,e){const t=[...n.currentTarget.closest("table").querySelectorAll("input, select")];let a=e.url;t.forEach(r=>{const s=new RegExp(`{${r.dataset.var}}`,"g");a=a.replace(s,r.value)}),e.computedUrl=a,this.requestUpdate()}function Kd(){return this.selectedServer&&this.selectedServer.variables?u`<div class="table-title">SERVER VARIABLES</div><table class="m-table" role="presentation">${Object.entries(this.selectedServer.variables).map(n=>u`<tr><td style="vertical-align:middle">${n[0]}</td><td>${n[1].enum?u`<select data-var="${n[0]}" @input="${e=>{Ei.call(this,e,this.selectedServer)}}">${Object.entries(n[1].enum).map(e=>n[1].default===e[1]?u`<option selected="selected" label="${e[1]}" value="${e[1]}"></option>`:u`<option label="${e[1]}" value="${e[1]}"></option>`)}</select>`:u`<input type="text" part="textbox textbox-server-var" spellcheck="false" data-var="${n[0]}" value="${n[1].default}" @input="${e=>{Ei.call(this,e,this.selectedServer)}}">`}</td></tr>${n[1].description?u`<tr><td colspan="2" style="border:none"><span class="m-markdown-small">${_(z(A(n[1].description)))}</span></td></tr>`:""}`)}</table>`:""}function Ai(){var n,e,t;return!this.resolvedSpec||this.resolvedSpec.specLoadError?"":u`<section id="servers" part="section-servers" style="text-align:left;direction:ltr;margin-top:24px;margin-bottom:24px" class="regular-font observe-me ${"read focused".includes(this.renderStyle)?"section-gap--read-mode":"section-gap"}"><div part="section-servers-title" class="sub-title" style="display:flex;align-items:center;gap:8px">API SERVER ${this.mockServer==="true"?u`<span style="font-size:var(--font-size-small);font-weight:700;color:var(--green,#10b981);border:1px solid var(--green,#10b981);border-radius:4px;padding:1px 6px;letter-spacing:.5px" title="In-browser mock server is active">MOCK ACTIVE</span>`:""}</div><div class="mono-font" style="margin:12px 0;font-size:calc(var(--font-size-small) + 1px)">${!this.resolvedSpec.servers||((n=this.resolvedSpec.servers)==null?void 0:n.length)===0?"":u`${(e=this.resolvedSpec)==null?void 0:e.servers.map((a,r)=>u`<input type="radio" name="api_server" id="srvr-opt-${r}" value="${a.url}" @change="${()=>{Ga.call(this,a.url)}}" .checked="${this.selectedServer.url===a.url}" style="margin:4px 0;cursor:pointer"> <label style="cursor:pointer" for="srvr-opt-${r}">${a.url} ${a.description?u`- <span class="regular-font">${a.description}</span>`:""}</label><br>`)}`}<div class="table-title primary-text" part="label-selected-server">SELECTED: ${((t=this.selectedServer)==null?void 0:t.computedUrl)||"none"} ${this.mockServer==="true"?u`<span style="color:var(--green,#10b981);margin-left:6px">(Mocked)</span>`:""}</div></div><slot name="servers"></slot>${Kd.call(this)}</section>`}function Di(n,e="toggle"){const t=n?.closest(".nav-bar-tag-and-paths"),a=t?.querySelector(".nav-bar-paths-under-tag");if(t){const r=t.classList.contains("expanded");r&&(e==="toggle"||e==="collapse")?(a.style.maxHeight=0,t.classList.replace("expanded","collapsed")):!r&&(e==="toggle"||e==="expand")&&(t.classList.replace("collapsed","expanded"),a.style.maxHeight=`${a.scrollHeight}px`)}}function Vd(n,e="expand-all"){if(!(n.type==="click"||n.type==="keyup"&&n.keyCode===13))return;const t=[...n.target.closest(".nav-scroll").querySelectorAll(".nav-bar-tag-and-paths")];e==="expand-all"?t.forEach(a=>{const r=a.querySelector(".nav-bar-paths-under-tag");a.classList.replace("collapsed","expanded"),r.style.maxHeight=`${r?.scrollHeight}px`}):t.forEach(a=>{a.classList.replace("expanded","collapsed")})}function Ci(n){var e,t,a,r;if(!(n.type==="click"||n.type==="keyup"&&n.keyCode===13))return;const s=n.target;if(n.stopPropagation(),((e=s.dataset)==null?void 0:e.action)==="navigate"){this.scrollToEventTarget(n,!1);const i=n.currentTarget.closest("#nav-bar");i.classList.contains("floating-nav")&&i.classList.remove("floating-nav")}else((t=s.dataset)==null?void 0:t.action)==="expand-all"||((a=s.dataset)==null?void 0:a.action)==="collapse-all"?Vd(n,s.dataset.action):((r=s.dataset)==null?void 0:r.action)==="expand-collapse-tag"&&Di(s,"toggle")}function Zd(){var n,e,t,a;const r=new xt;return!this.resolvedSpec||this.resolvedSpec.specLoadError?u`<nav class="nav-bar" part="section-navbar"><slot name="nav-logo" class="logo"></slot></nav>`:u`<button id="nav-bar-btn" part="btn-navbar" class="btn" @click="${this.onOpenNavBarToggle}">☰</button><nav id="nav-bar" class="nav-bar ${this.renderStyle}" part="section-navbar"><slot name="nav-logo" class="logo"></slot>${this.allowSearch==="false"&&this.allowAdvancedSearch==="false"?"":u`<div style="display:flex;flex-direction:row;justify-content:center;align-items:stretch;padding:8px 24px 12px 24px;${this.allowAdvancedSearch==="false"?"border-bottom: 1px solid var(--nav-hover-bg-color)":""}" part="section-navbar-search">${this.allowSearch==="false"?"":u`<div style="display:flex;flex:1;line-height:22px"><input id="nav-bar-search" part="textbox textbox-nav-filter" style="width:100%;padding-right:20px;color:var(--nav-hover-text-color);border-color:var(--nav-accent-color);background:var(--nav-hover-bg-color)" type="text" placeholder="Filter" @change="${this.onSearchChange}" spellcheck="false"><div style="margin:6px 5px 0 -24px;font-size:var(--font-size-regular);cursor:pointer">↩</div></div>${this.searchVal?u`<button @click="${this.onClearSearch}" class="m-btn thin-border" style="margin-left:5px;color:var(--nav-text-color);width:75px;padding:6px 8px" part="btn btn-outline btn-clear-filter">CLEAR</button>`:""}`} ${this.allowAdvancedSearch==="false"||this.searchVal?"":u`<button id="advanced-search-btn" class="m-btn primary" part="btn btn-fill btn-search" style="margin-left:5px;padding:6px 8px;width:75px" @click="${this.onShowAdvancedSearchClicked}">SEARCH</button>`}</div>`} ${u`<nav class="nav-scroll" tabindex="-1" part="section-navbar-scroll" @click="${s=>Ci.call(this,s)}" @keyup="${s=>Ci.call(this,s)}">${this.showInfo==="false"||!this.resolvedSpec.info?"":u`${this.infoDescriptionHeadingsInNavBar==="true"?u`${this.resolvedSpec.infoDescriptionHeaders.length>0?u`<div class="nav-bar-info ${this.navActiveItemMarker}" id="link-overview" data-content-id="overview" data-action="navigate" tabindex="0" part="section-navbar-item section-navbar-overview">${((e=(n=this.resolvedSpec.info)==null?void 0:n.title)==null?void 0:e.trim())||"Overview"}</div>`:""}<div class="overview-headers">${this.resolvedSpec.infoDescriptionHeaders.map(s=>{const i=r.slug(s.text);return u`<div class="nav-bar-h${s.depth} ${this.navActiveItemMarker}" id="link-overview--${i}" data-action="navigate" data-content-id="overview--${i}">${s.text}</div>`})}</div>${this.resolvedSpec.infoDescriptionHeaders.length>0?u`<hr style="border-top:1px solid var(--nav-hover-bg-color);border-width:1px 0 0 0;margin:15px 0 0 0">`:""}`:u`<div class="nav-bar-info ${this.navActiveItemMarker}" id="link-overview" data-action="navigate" data-content-id="overview" tabindex="0">${((a=(t=this.resolvedSpec.info)==null?void 0:t.title)==null?void 0:a.trim())||"Overview"}</div>`}`} ${this.allowServerSelection==="false"?"":u`<div class="nav-bar-info ${this.navActiveItemMarker}" id="link-servers" data-action="navigate" data-content-id="servers" tabindex="0" part="section-navbar-item section-navbar-servers">API Servers</div>`} ${this.allowAuthentication==="false"||!this.resolvedSpec.securitySchemes?"":u`<div class="nav-bar-info ${this.navActiveItemMarker}" id="link-auth" data-action="navigate" data-content-id="auth" tabindex="0" part="section-navbar-item section-navbar-auth">Authentication</div>`}<div id="link-operations-top" class="nav-bar-section operations" data-action="navigate" data-content-id="${this.renderStyle==="focused"?"":"operations-top"}" part="section-navbar-item section-navbar-operations-top"><div style="font-size:16px;display:flex;margin-left:10px">${this.renderStyle==="focused"?u`<div class="nav-bar-expand-all" data-action="expand-all" tabindex="0" title="Expand all">▸</div><div class="nav-bar-collapse-all" data-action="collapse-all" tabindex="0" title="Collapse all">▸</div>`:""}</div><div class="nav-bar-section-title">OPERATIONS</div></div>${this.resolvedSpec.tags.filter(s=>s.paths.filter(i=>St(this.searchVal,i,s.name)).length).map(s=>u`<div class="nav-bar-tag-and-paths ${this.renderStyle==="read"||s.expanded?"expanded":"collapsed"}">${s.name==="General \u2982"?u`<hr style="border:none;border-top:1px dotted var(--nav-text-color);opacity:.3;margin:-1px 0 0 0">`:u`<div class="nav-bar-tag ${this.navActiveItemMarker}" part="section-navbar-item section-navbar-tag" id="link-${s.elementId}" data-action="${this.renderStyle==="read"||this.onNavTagClick==="show-description"?"navigate":"expand-collapse-tag"}" data-content-id="${(this.renderStyle==="read"?`${s.elementId}`:this.onNavTagClick==="show-description")?`${s.elementId}`:""}" data-first-path-id="${s.firstPathId}" tabindex="0"><div style="pointer-events:none">${s.displayName||s.name}</div><div class="nav-bar-tag-icon" tabindex="0" data-action="expand-collapse-tag"></div></div>`} ${this.infoDescriptionHeadingsInNavBar==="true"?u`${this.renderStyle==="focused"&&this.onNavTagClick==="expand-collapse"?"":u`<div class="tag-headers">${s.headers.map(i=>u`<div class="nav-bar-h${i.depth} ${this.navActiveItemMarker}" part="section-navbar-item section-navbar-h${i.depth}" id="link-${s.elementId}--${r.slug(i.text)}" data-action="navigate" data-content-id="${s.elementId}--${r.slug(i.text)}" tabindex="0">${i.text}</div>`)}</div>`}`:""}<div class="nav-bar-paths-under-tag">${s.paths.filter(i=>this.searchVal?St(this.searchVal,i,s.name):!0).map(i=>u`<div class="nav-bar-path ${this.navActiveItemMarker} ${this.usePathInNavBar==="true"?"small-font":""}" part="section-navbar-item section-navbar-path" data-action="navigate" data-content-id="${i.elementId}" id="link-${i.elementId}" tabindex="0"><span style="display:flex;pointer-events:none;align-items:start;${i.deprecated?"filter:opacity(0.5)":""}">${u`<span class="nav-method ${this.showMethodInNavBar} ${i.method}" style="pointer-events:none">${this.showMethodInNavBar==="as-colored-block"?i.method.substring(0,3).toUpperCase():i.method.toUpperCase()}</span>`} ${i.isWebhook?u`<span style="font-weight:700;pointer-events:none;margin-right:8px;font-size:calc(var(--font-size-small) - 2px)">WEBHOOK</span>`:""} ${this.usePathInNavBar==="true"?u`<span style="pointer-events:none" class="mono-font">${i.path}</span>`:i.summary||i.shortSummary}</span></div>`)}</div></div>`)} ${this.resolvedSpec.components&&this.showComponents==="true"&&this.renderStyle==="focused"?u`<div id="link-components" class="nav-bar-section components"><div></div><div class="nav-bar-section-title">COMPONENTS</div></div>${this.resolvedSpec.components.map(s=>s.subComponents.length?u`<div class="nav-bar-tag" part="section-navbar-item section-navbar-tag" data-action="navigate" data-content-id="cmp--${s.name.toLowerCase()}" id="link-cmp--${s.name.toLowerCase()}">${s.name}</div>${s.subComponents.filter(i=>i.expanded!==!1).map(i=>u`<div class="nav-bar-path" data-action="navigate" data-content-id="cmp--${i.id}" id="link-cmp--${i.id}"><span style="pointer-events:none">${i.name}</span></div>`)}`:"")}`:""}</nav>`}</nav>`}function Jd(n){const e=new A.Renderer,t=new xt;return e.heading=({text:a,depth:r})=>`<h${r} class="observe-me" id="${n}--${t.slug(a)}">${a}</h${r}>`,e}function Rn(n){return u`<div class="regular-font section-gap--focused-mode" part="section-operations-in-tag">${n}</div>`}function Fi(){var n;if(this.showInfo==="true")return Rn(Ja.call(this));const e=this.resolvedSpec.tags[0],t=(n=this.resolvedSpec.tags[0])==null?void 0:n.paths[0];return Rn(e&&t?Za.call(this,t,e.name):"")}function Gd(n){return u`<h1 id="${n.elementId}">${n.displayName||n.name}</h1>${this.onNavTagClick==="show-description"&&n.description?u`<div class="m-markdown">${_(`<div class="m-markdown regular-font">
|
|
274
|
+
${z(A(n.description||"",this.infoDescriptionHeadingsInNavBar==="true"?{renderer:Jd(n.elementId)}:void 0))}
|
|
275
|
+
</div>`)}</div>`:""}`}function Xd(){if(!this.focusedElementId||!this.resolvedSpec)return;const n=this.focusedElementId;let e=null,t=null,a,r=0;if(n.startsWith("overview")&&this.showInfo==="true")a=Ja.call(this);else if(n==="auth"&&this.allowAuthentication==="true")a=xi.call(this,this.allowTry);else if(n==="servers"&&this.allowServerSelection==="true")a=Ai.call(this);else if(n==="operations-top")a=u`<div id="operations-top" class="observe-me"><slot name="operations-top"></slot></div>`;else if(n.startsWith("cmp--")&&this.showComponents==="true")a=Hd.call(this);else if(n.startsWith("tag--")){const s=n.indexOf("--",4)>0?n.substring(0,n.indexOf("--",5)):n;t=this.resolvedSpec.tags.find(i=>i.elementId===s),t?a=Rn.call(this,Gd.call(this,t)):a=Fi.call(this)}else{for(r=0;r<this.resolvedSpec.tags.length&&(t=this.resolvedSpec.tags[r],e=this.resolvedSpec.tags[r].paths.find(s=>`${s.elementId}`===n),!e);r+=1);if(e){const s=this.shadowRoot.getElementById(`link-${n}`);Di(s,"expand"),a=Rn.call(this,Za.call(this,e,t.name||"",t.description||""))}else a=Fi.call(this)}return a}function Yd(n){if(n.expanded)n.expanded=!1,this.updateRoute==="true"&&this.replaceHistoryState("");else if(n.expanded=!0,this.updateRoute==="true"){const e=`${this.routePrefix||"#"}${n.elementId}`;window.location.hash!==e&&this.replaceHistoryState(n.elementId)}this.requestUpdate()}function Qd(n,e="expand-all"){const t=[...n.querySelectorAll(".section-tag")];e==="expand-all"?t.map(a=>{a.classList.replace("collapsed","expanded")}):t.map(a=>{a.classList.replace("expanded","collapsed")})}function Ti(n,e="expand-all"){Qd.call(this,n.target.closest(".operations-root"),e)}function Oi(n,e=!1){return u`<summary @click="${t=>{Yd.call(this,n,t)}}" part="section-endpoint-head-${n.expanded?"expanded":"collapsed"}" class="endpoint-head ${n.method} ${n.deprecated?"deprecated":""} ${e||n.expanded?"expanded":"collapsed"}"><div part="section-endpoint-head-method" class="method ${n.method} ${n.deprecated?"deprecated":""}">${n.method}</div><div part="section-endpoint-head-path" class="path ${n.deprecated?"deprecated":""}">${n.path} ${n.isWebhook?u`<span style="font-family:var(--font-regular);font-size:var(--);font-size:var(--font-size-small);color:var(--primary-color);margin-left:16px">Webhook</span>`:""}</div>${n.deprecated?u`<span style="font-size:var(--font-size-small);text-transform:uppercase;font-weight:700;color:var(--red);margin:2px 0 0 5px">deprecated</span>`:""} ${this.showSummaryWhenCollapsed?u`<div class="only-large-screen" style="min-width:60px;flex:1"></div><div part="section-endpoint-head-description" class="descr">${n.summary||n.shortSummary}</div>`:""}</summary>`}function Ni(n){var e,t,a,r,s,i,o,l,c,d;const p=new Set;for(const f in n.responses)for(const b in(e=n.responses[f])==null?void 0:e.content)p.add(b.trim());const h=[...p].join(", "),m=this.resolvedSpec.securitySchemes.filter(f=>{var b;return f.finalKeyValue&&((b=n.security)==null?void 0:b.some(v=>f.securitySchemeId in v))})||[],y=this.resolvedSpec.securitySchemes.find(f=>f.securitySchemeId===Te&&f.value!=="-");y&&m.push(y);const g=n.xCodeSamples?$i(n.xCodeSamples):"";return u`<div part="section-endpoint-body-${n.expanded?"expanded":"collapsed"}" class="endpoint-body ${n.method} ${n.deprecated?"deprecated":""}"><div class="summary">${n.summary?u`<div class="title" part="section-endpoint-body-title">${n.summary}</div>`:n.shortSummary!==n.description?u`<div class="title" part="section-endpoint-body-title">${n.shortSummary}</div>`:""} ${n.xBadges&&((t=n.xBadges)==null?void 0:t.length)>0?u`<div style="display:flex;flex-wrap:wrap;font-size:var(--font-size-small)">${n.xBadges.map(f=>f.color==="none"?"":u`<span part="endpoint-badge" style="margin:1px;margin-right:5px;padding:1px 8px;font-weight:700;border-radius:12px;background:color-mix(in srgb,var(--${f.color}) 10%,transparent);color:var(--${f.color});border:1px solid var(--${f.color})">${f.label}</span>`)}</div>`:""} ${n.description?u`<div part="section-endpoint-body-description" class="m-markdown">${_(z(A(n.description)))}</div>`:""} ${(a=n.externalDocs)!=null&&a.url||(r=n.externalDocs)!=null&&r.description?u`<div style="background:var(--bg3);padding:2px 8px 8px 8px;margin:8px 0;border-radius:var(--border-radius)"><div class="m-markdown">${_(z(A(((s=n.externalDocs)==null?void 0:s.description)||"")))}</div>${(i=n.externalDocs)!=null&&i.url?u`<a style="font-family:var(--font-mono);font-size:var(--font-size-small)" href="${(o=n.externalDocs)==null?void 0:o.url}" target="_blank">${(l=n.externalDocs)==null?void 0:l.url}<div style="transform:rotate(270deg) scale(1.5);display:inline-block;margin-left:5px">⇲</div></a>`:""}</div>`:""}<slot name="${n.elementId}"></slot>${wi.call(this,n.security)} ${g}</div><div class="req-resp-container"><div style="display:flex;flex-direction:column" class="view-mode-request ${this.layout}-layout"><api-request class="${this.renderStyle}-mode ${this.layout}-layout" style="width:100%" webhook="${n.isWebhook}" method="${n.method}" path="${n.path}" .security="${n.security}" .parameters="${n.parameters}" .request_body="${n.requestBody}" .api_keys="${m}" .servers="${n.servers}" server-url="${((c=n.servers)==null?void 0:c.length)>0?n.servers[0].url:(d=this.selectedServer)==null?void 0:d.computedUrl}" active-schema-tab="${this.defaultSchemaTab}" fill-request-fields-with-example="${this.fillRequestFieldsWithExample}" allow-try="${this.allowTry}" show-curl-before-try="${this.showCurlBeforeTry}" accept="${h}" render-style="${this.renderStyle}" schema-style="${this.schemaStyle}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly==="never"||n.isWebhook?"false":"true"}" schema-hide-write-only="${this.schemaHideWriteOnly==="never"?"false":n.isWebhook?"true":"false"}" fetch-credentials="${this.fetchCredentials}" exportparts="wrap-request-btn:wrap-request-btn, btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, btn-clear:btn-clear, btn-clear-resp:btn-clear-resp,
|
|
275
276
|
tab-panel:tab-panel, tab-btn:tab-btn, tab-btn-row:tab-btn-row, tab-coontent:tab-content,
|
|
276
277
|
file-input:file-input, textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param,
|
|
277
|
-
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></api-request>${n.callbacks?
|
|
278
|
+
anchor:anchor, anchor-param-example:anchor-param-example, schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></api-request>${n.callbacks?ki.call(this,n.callbacks):""}</div><api-response class="${this.renderStyle}-mode" style="width:100%" webhook="${n.isWebhook}" .responses="${n.responses}" active-schema-tab="${this.defaultSchemaTab}" render-style="${this.renderStyle}" schema-style="${this.schemaStyle}" schema-expand-level="${this.schemaExpandLevel}" schema-description-expanded="${this.schemaDescriptionExpanded}" allow-schema-description-expand-toggle="${this.allowSchemaDescriptionExpandToggle}" schema-hide-read-only="${this.schemaHideReadOnly==="never"?"false":n.isWebhook?"true":"false"}" schema-hide-write-only="${this.schemaHideWriteOnly==="never"||n.isWebhook?"false":"true"}" selected-status="${Object.keys(n.responses||{})[0]||""}" exportparts="btn:btn, btn-fill:btn-fill, btn-outline:btn-outline, btn-try:btn-try, file-input:file-input,
|
|
278
279
|
textbox:textbox, textbox-param:textbox-param, textarea:textarea, textarea-param:textarea-param, anchor:anchor, anchor-param-example:anchor-param-example, btn-clear-resp:btn-clear-resp,
|
|
279
280
|
tab-panel:tab-panel, tab-btn:tab-btn, tab-btn-row:tab-btn-row, tab-coontent:tab-content,
|
|
280
|
-
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></api-response></div></div>`}function Id(n=!1,e=!1){return this.resolvedSpec?u`${n?"":u`<div style="display:flex;justify-content:flex-end"><span @click="${t=>hi(t,"expand-all")}" style="color:var(--primary-color);cursor:pointer">Expand all </span> | <span @click="${t=>hi(t,"collapse-all")}" style="color:var(--primary-color);cursor:pointer">Collapse all </span> sections</div>`} ${this.resolvedSpec.tags.map(t=>u`${n?u`<div class="section-tag-body">${t.paths.filter(a=>this.searchVal?xt(this.searchVal,a,t.name):!0).map(a=>u`<section id="${a.elementId}" class="m-endpoint regular-font ${a.method} ${e||a.expanded?"expanded":"collapsed"}">${mi.call(this,a,e)} ${e||a.expanded?fi.call(this,a):""}</section>`)}</div>`:u`<div class="regular-font section-gap section-tag ${t.expanded?"expanded":"collapsed"}"><div class="section-tag-header" @click="${()=>{t.expanded=!t.expanded,this.requestUpdate()}}"><div id="${t.elementId}" class="sub-title tag" style="color:var(--primary-color)">${t.displayName||t.name}</div></div><div class="section-tag-body"><slot name="${t.elementId}"></slot><div class="regular-font regular-font-size m-markdown" style="padding-bottom:12px">${I(z(A(t.description||"")))}</div>${t.paths.filter(a=>this.searchVal?xt(this.searchVal,a,t.name):!0).map(a=>u`<section part="section-endpoint" id="${a.elementId}" class="m-endpoint regular-font ${a.method} ${e||a.expanded?"expanded":"collapsed"}">${mi.call(this,a,e)} ${e||a.expanded?fi.call(this,a):""}</section>`)}</div></div>`}`)}`:""}function _d(n){return u`<div style="${n}"><svg viewBox="1 0 511 512"><path d="M351 411a202 202 0 01-350 0 203 203 0 01333-24 203 203 0 0117 24zm0 0" fill="#adc165"/><path d="M334 387a202 202 0 01-216-69 202 202 0 01216 69zm78 32H85a8 8 0 01-8-8 8 8 0 018-8h327a8 8 0 017 8 8 8 0 01-7 8zm0 0" fill="#99aa52"/><path d="M374 338l-5 30a202 202 0 01-248-248 203 203 0 01253 218zm0 0" fill="#ffc73b"/><path d="M374 338a202 202 0 01-100-197 203 203 0 01100 197zm38 81l-6-2-231-231a8 8 0 0111-11l231 230a8 8 0 01-5 14zm0 0" fill="#efb025"/><path d="M311 175c0 75 40 140 101 175a202 202 0 000-350 202 202 0 00-101 175zm0 0" fill="#ff903e"/><path d="M412 419a8 8 0 01-8-8V85a8 8 0 0115 0v326a8 8 0 01-7 8zm0 0" fill="#e87425"/></svg></div>`}function Rd(){return u`<header class="row main-header regular-font" part="section-header" style="padding:8px 4px 8px 4px;min-height:48px"><div class="only-large-screen-flex" style="align-items:center"><slot name="logo" class="logo" part="section-logo">${_d("height:36px;width:36px;margin-left:5px")}</slot><div class="header-title" part="label-header-title">${this.headingText}</div></div><div style="margin:0 8px;display:flex;flex:1">${this.allowSpecUrlLoad==="false"?"":u`<input id="spec-url" type="text" style="font-size:var(--font-size-small)" class="header-input mono-font" part="textbox textbox-spec-url" placeholder="Spec URL" value="${this.specUrl||""}" @change="${this.onSpecUrlChange}" spellcheck="false"><div style="margin:6px 5px 0 -24px;font-size:var(--font-size-regular);cursor:pointer">↩</div>`} ${this.allowSpecFileLoad==="false"?"":u`<input id="spec-file" part="file-input" type="file" style="display:none" value="${this.specFile||""}" @change="${this.onSpecFileChange}" spellcheck="false"> <button class="m-btn primary only-large-screen" style="margin-left:10px" part="btn btn-fill" @click="${this.onFileLoadClick}">LOCAL JSON FILE</button>`}<slot name="header"></slot>${this.allowSearch==="false"||"read focused".includes(this.renderStyle)?"":u`<input id="search" class="header-input" type="text" part="textbox textbox-header-filter" placeholder="Filter" @change="${this.onSearchChange}" style="max-width:130px;margin-left:10px" spellcheck="false"><div style="margin:6px 5px 0 -24px;font-size:var(--font-size-regular);cursor:pointer">↩</div>`} ${this.allowAdvancedSearch==="false"||"read focused".includes(this.renderStyle)?"":u`<button class="m-btn primary only-large-screen" part="btn btn-fill btn-search" style="margin-left:10px" @click="${this.onShowAdvancedSearchClicked}">Search</button>`}</div></header>`}function jd(){var n;return u`<dialog id="advanced-search-dialog" class="dialog-box"><header class="dialog-box-header"><span class="dialog-box-title">Search</span> <button type="button" @click="${e=>this.onAdvancedSearchClose(e)}">×</button></header><div class="dialog-box-content"><span class="advanced-search-options"><input id="input-advanced-search-dialog" style="width:100%;padding-right:20px" type="text" part="textbox textbox-search-dialog" placeholder="search text..." spellcheck="false" @keyup="${e=>this.onAdvancedSearch(e,400)}"><div style="display:flex;gap:16px;flex-wrap:wrap;margin:8px 0 24px"><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-path" checked="checked" @change="${e=>this.onAdvancedSearch(e,0)}"> <label for="search-api-path" style="cursor:pointer">API Path</label></div><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-descr" checked="checked" @change="${e=>this.onAdvancedSearch(e,0)}"> <label style="cursor:pointer" for="search-api-descr">API Description</label></div><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-params" @change="${e=>this.onAdvancedSearch(e,0)}"> <label style="cursor:pointer" for="search-api-params">API Parameters</label></div><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-request-body" @change="${e=>this.onAdvancedSearch(e,0)}"> <label style="cursor:pointer" for="search-api-request-body">Request Body Parameters</label></div><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-resp-descr" @change="${e=>this.onAdvancedSearch(e,0)}"> <label style="cursor:pointer" for="search-api-resp-descr">Response Description</label></div></div></span>${(n=this.advancedSearchMatches)==null?void 0:n.map(e=>u`<div class="mono-font small-font-size hover-bg" style="padding:5px;cursor:pointer;border-bottom:1px solid var(--light-border-color);${e.deprecated?"filter:opacity(0.5);":""}" data-content-id="${e.elementId}" tabindex="0" @click="${t=>{this.searchVal="",this.shadowRoot.getElementById("advanced-search-dialog").close(),this.requestUpdate(),this.scrollToEventTarget(t,!0)}}"><span style="pointer-events:none" class="upper bold-text method-fg ${e.method}">${e.method}</span> <span style="pointer-events:none">${e.path}</span> <span style="pointer-events:none" class="regular-font gray-text">${e.summary}</span></div>`)}</div></dialog>`}const F={color:{inputReverseFg:"#fff",inputReverseBg:"#333",headerBg:"#444",getRgb(n){if(n.indexOf("#")===0&&(n=n.slice(1,7)),(n.length===3||n.length===4)&&(n=n[0]+n[0]+n[1]+n[1]+n[2]+n[2]),n.length!==6)throw new Error("Invalid HEX color.");return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16)}},luminanace(n){const e=this.getRgb(n);return e.r*.299+e.g*.587+e.b*.114},invert(n){return this.luminanace(n)>135?"#000":"#fff"},opacity(n,e){const t=this.getRgb(n);return`rgba(${t.r}, ${t.g}, ${t.b}, ${e})`},brightness(n,e){const t=this.getRgb(n);return t.r+=e,t.g+=e,t.b+=e,t.r>255?t.r=255:t.r<0&&(t.r=0),t.g>255?t.g=255:t.g<0&&(t.g=0),t.b>255?t.b=255:t.b<0&&(t.b=0),`#${t.r.toString(16).padStart(2,"0")}${t.g.toString(16).padStart(2,"0")}${t.b.toString(16).padStart(2,"0")}`},hasGoodContrast(n,e){const t=this.luminanace(n),a=this.luminanace(e);return t-a}}};function me(n){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/i.test(n)}function rt(n,e={}){let t={};const a=e.primaryColor?e.primaryColor:n==="dark"?"#f76b39":"#ff591e",r=F.color.invert(a),s=F.color.opacity(a,"0.4");if(n==="dark"){const i=e.bg1?e.bg1:"#2a2b2c",o=e.fg1?e.fg1:"#bbb",l=e.bg2?e.bg2:F.color.brightness(i,5),c=e.bg3?e.bg3:F.color.brightness(i,17),d=e.bg3?e.bg3:F.color.brightness(i,35),p=e.fg2?e.fg2:F.color.brightness(o,-15),h=e.fg3?e.fg3:F.color.brightness(o,-20),m=e.fg3?e.fg3:F.color.brightness(o,-65),b=e.inlineCodeFg?e.inlineCodeFg:"#c58484",g=p,f=l,y=e.headerColor?e.headerColor:F.color.brightness(i,10),v=e.navBgColor?e.navBgColor:F.color.brightness(i,10),x=e.navTextColor?e.navTextColor:F.color.opacity(F.color.invert(v),"0.50"),w=e.navHoverBgColor?e.navHoverBgColor:F.color.brightness(v,-15),k=e.navHoverTextColor?e.navHoverTextColor:F.color.invert(v),$=e.navAccentColor?e.navAccentColor:F.color.brightness(a,25),S=e.navAccentTextColor?e.navAccenttextColor:F.color.invert($);t={bg1:i,bg2:l,bg3:c,lightBg:d,fg1:o,fg2:p,fg3:h,lightFg:m,inlineCodeFg:b,primaryColor:a,primaryColorTrans:s,primaryColorInvert:r,selectionBg:g,selectionFg:f,overlayBg:"rgba(80, 80, 80, 0.4)",navBgColor:v,navTextColor:x,navHoverBgColor:w,navHoverTextColor:k,navAccentColor:$,navAccentTextColor:S,headerColor:y,headerColorInvert:F.color.invert(y),headerColorDarker:F.color.brightness(y,-20),headerColorBorder:F.color.brightness(y,10),borderColor:e.borderColor||F.color.brightness(i,20),lightBorderColor:e.lightBorderColor||F.color.brightness(i,15),codeBorderColor:e.codeBorderColor||F.color.brightness(i,30),inputBg:e.inputBg||F.color.brightness(i,-5),placeHolder:e.placeHolder||F.color.opacity(o,"0.3"),hoverColor:e.hoverColor||F.color.brightness(i,-10),red:e.red?e.red:"#F06560",pink:e.pink?e.pink:"#ffb2b2",green:e.green||"#7ec699",blue:e.blue||"#71b7ff",orange:e.orange?e.orange:"#f08d49",yellow:e.yellow||"#827717",purple:e.purple||"#786FF1",brown:e.brown||"#D4AC0D",codeBg:e.codeBg||F.color.opacity(F.color.brightness(i,-15),.7),codeFg:e.codeFg||"#aaa",codePropertyColor:e.codePropertyColor||"#79c0ff",codeKeywordColor:e.codeKeywordColor||"#ff7b72",codeOperatorColor:e.codeOperatorColor||"#c9d1d9",syntaxComment:"#8b949e",syntaxKeyword:"#ff7b72",syntaxOperator:"#c9d1d9",syntaxString:"#a5d6ff",syntaxConstant:"#79c0ff",syntaxFunction:"#d2a8ff",syntaxType:"#d2a8ff",syntaxVariable:"#ffa657",syntaxProperty:"#79c0ff",syntaxTag:"#7ee787",syntaxSelector:"#d2a8ff",syntaxInserted:"#7ee787",syntaxDeleted:"#ff7b72"}}else{const i=e.bg1?e.bg1:"#fafbfc",o=e.fg1?e.fg1:"#444444",l=e.bg2?e.bg2:F.color.brightness(i,-5),c=e.bg3?e.bg3:F.color.brightness(i,-15),d=e.bg3?e.bg3:F.color.brightness(i,-45),p=e.fg2?e.fg2:F.color.brightness(o,17),h=e.fg3?e.fg3:F.color.brightness(o,30),m=e.fg3?e.fg3:F.color.brightness(o,70),b=e.inlineCodeFg?e.inlineCodeFg:"brown",g=p,f=l,y=e.headerColor?e.headerColor:F.color.brightness(i,-180),v=e.navBgColor?e.navBgColor:F.color.brightness(i,-200),x=e.navTextColor?e.navTextColor:F.color.opacity(F.color.invert(v),"0.65"),w=e.navHoverBgColor?e.navHoverBgColor:F.color.brightness(v,-15),k=e.navHoverTextColor?e.navHoverTextColor:F.color.invert(v),$=e.navAccentColor?e.navAccentColor:F.color.brightness(a,25),S=e.navAccentTextColor?e.navAccenttextColor:F.color.invert($);t={bg1:i,bg2:l,bg3:c,lightBg:d,fg1:o,fg2:p,fg3:h,lightFg:m,inlineCodeFg:b,primaryColor:a,primaryColorTrans:s,primaryColorInvert:r,selectionBg:g,selectionFg:f,overlayBg:"rgba(0, 0, 0, 0.4)",navBgColor:v,navTextColor:x,navHoverBgColor:w,navHoverTextColor:k,navAccentColor:$,navAccentTextColor:S,headerColor:y,headerColorInvert:F.color.invert(y),headerColorDarker:F.color.brightness(y,-20),headerColorBorder:F.color.brightness(y,10),borderColor:e.borderColor||F.color.brightness(i,-38),lightBorderColor:e.lightBorderColor||F.color.brightness(i,-23),codeBorderColor:e.codeBorderColor||"transparent",inputBg:e.inputBg||F.color.brightness(i,10),placeHolder:e.placeHolder||F.color.brightness(m,20),hoverColor:e.hoverColor||F.color.brightness(i,-5),red:e.red||"#F06560",pink:e.pink?e.pink:"#990055",green:e.green||"#690",blue:e.blue||"#47AFE8",orange:e.orange||"#FF9900",yellow:e.yellow||"#827717",purple:e.purple||"#786FF1",brown:e.brown||"#D4AC0D",codeBg:e.codeBg||F.color.opacity(F.color.brightness(i,-15),.7),codeFg:e.codeFg||"#666",codePropertyColor:e.codePropertyColor||"#0550ae",codeKeywordColor:e.codeKeywordColor||"#cf222e",codeOperatorColor:e.codeOperatorColor||"#24292f",syntaxComment:"#6e7781",syntaxKeyword:"#cf222e",syntaxOperator:"#24292f",syntaxString:"#0a3069",syntaxConstant:"#0550ae",syntaxFunction:"#8250df",syntaxType:"#8250df",syntaxVariable:"#953800",syntaxProperty:"#0550ae",syntaxTag:"#116329",syntaxSelector:"#8250df",syntaxInserted:"#116329",syntaxDeleted:"#cf222e"}}return u`<style>*,:after,:before{box-sizing:border-box}:host{--border-radius:2px;--layout:${this.layout||"row"};--font-mono:${this.monoFont||'Monaco, "Andale Mono", "Roboto Mono", Consolas, monospace'};--font-regular:${this.regularFont||'"Open Sans", Avenir, "Segoe UI", Arial, sans-serif'};--scroll-bar-width:8px;--nav-item-padding:${this.navItemSpacing==="relaxed"?"10px 16px 10px 10px":this.navItemSpacing==="compact"?"5px 16px 5px 10px":"7px 16px 7px 10px"};--resp-area-height:${this.responseAreaHeight};--font-size-small:${this.fontSize==="default"?"12px":this.fontSize==="large"?"13px":"14px"};--font-size-mono:${this.fontSize==="default"?"13px":this.fontSize==="large"?"14px":"15px"};--font-size-regular:${this.fontSize==="default"?"14px":this.fontSize==="large"?"15px":"16px"};--dialog-z-index:1000;--table-schema-key-width:240px;--table-schema-key-text-overflow:ellipsis;--table-schema-key-whitespace:nowrap;--focus-shadow:0 0 0 1px transparent,0 0 0 3px var(--primary-color-trans);--bg:${t.bg1};--bg2:${t.bg2};--bg3:${t.bg3};--light-bg:${t.lightBg};--fg:${t.fg1};--fg2:${t.fg2};--fg3:${t.fg3};--light-fg:${t.lightFg};--selection-bg:${t.selectionBg};--selection-fg:${t.selectionFg};--overlay-bg:${t.overlayBg};--border-color:${t.borderColor};--light-border-color:${t.lightBorderColor};--code-border-color:${t.codeBorderColor};--input-bg:${t.inputBg};--placeholder-color:${t.placeHolder};--hover-color:${t.hoverColor};--red:${t.red};--pink:${t.pink};--green:${t.green};--blue:${t.blue};--orange:${t.orange};--yellow:${t.yellow};--purple:${t.purple};--brown:${t.brown};--header-bg:${t.headerColor};--header-fg:${t.headerColorInvert};--header-color-darker:${t.headerColorDarker};--header-color-border:${t.headerColorBorder};--nav-bg-color:${t.navBgColor};--nav-text-color:${t.navTextColor};--nav-hover-bg-color:${t.navHoverBgColor};--nav-hover-text-color:${t.navHoverTextColor};--nav-accent-color:${t.navAccentColor};--nav-accent-text-color:${t.navAccentTextColor};--nav-get-color:${t.blue};--nav-put-color:${t.orange};--nav-post-color:${t.green};--nav-delete-color:${t.red};--nav-head-color:${t.yellow};--primary-color:${t.primaryColor};--primary-color-invert:${t.primaryColorInvert};--primary-color-trans:${t.primaryColorTrans};--code-bg:${t.codeBg};--code-fg:${t.codeFg};--inline-code-fg:${t.inlineCodeFg};--code-property-color:${t.codePropertyColor};--code-keyword-color:${t.codeKeywordColor};--code-operator-color:${t.codeOperatorColor};--syntax-comment:${t.syntaxComment};--syntax-keyword:${t.syntaxKeyword};--syntax-operator:${t.syntaxOperator};--syntax-string:${t.syntaxString};--syntax-constant:${t.syntaxConstant};--syntax-function:${t.syntaxFunction};--syntax-type:${t.syntaxType};--syntax-variable:${t.syntaxVariable};--syntax-property:${t.syntaxProperty};--syntax-tag:${t.syntaxTag};--syntax-selector:${t.syntaxSelector};--syntax-inserted:${t.syntaxInserted};--syntax-deleted:${t.syntaxDeleted}}</style>`}function gi(n=!1,e=!1){if(!this.resolvedSpec)return"";this.persistAuth==="true"&&Qc.call(this);const t={bg1:me(this.bgColor)?this.bgColor:"",fg1:me(this.textColor)?this.textColor:"",headerColor:me(this.headerColor)?this.headerColor:"",primaryColor:me(this.primaryColor)?this.primaryColor:"",navBgColor:me(this.navBgColor)?this.navBgColor:"",navTextColor:me(this.navTextColor)?this.navTextColor:"",navHoverBgColor:me(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:me(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:me(this.navAccentColor)?this.navAccentColor:"",navAccentTextColor:me(this.navAccentTextColor)?this.navAccentTextColor:""};return this.resolvedSpec.specLoadError?u`${this.theme==="dark"?rt.call(this,"dark",t):rt.call(this,"light",t)}<div id="spec-not-found" style="display:flex;align-items:center;justify-content:center;border:1px dashed var(--border-color);padding:12px;overflow-wrap:anywhere;font-size:var(--font-size-small);color:var(--red);font-family:var(--font-mono)">${this.resolvedSpec.info.description}</div>`:this.resolvedSpec.isSpecLoading?u`${this.theme==="dark"?rt.call(this,"dark",t):rt.call(this,"light",t)}<main class="main-content regular-font" part="section-main-content"><slot></slot><div class="main-content-inner--${this.renderStyle}-mode"><div class="loader"></div></div></main>`:u`${this.theme==="dark"?rt.call(this,"dark",t):rt.call(this,"light",t)}<slot name="fixed-header"></slot>${this.showHeader==="false"?"":Rd.call(this)} ${this.allowAdvancedSearch==="false"?"":jd.call(this)}<div id="the-main-body" class="body ${this.cssClasses}" dir="${this.pageDirection}">${(this.renderStyle==="read"||this.renderStyle==="focused")&&this.showSideNav==="true"&&this.resolvedSpec?Fd.call(this):""}<main class="main-content regular-font" tabindex="-1" part="section-main-content"><slot></slot><div class="main-content-inner--${this.renderStyle}-mode">${this.loading===!0?u`<div class="loader"></div>`:u`${this.loadFailed===!0?u`<div style="text-align:center;margin:16px">Unable to load the Spec</div>`:u`<div class="operations-root" @click="${a=>{this.handleHref(a)}}">${this.renderStyle==="focused"?u`${Nd.call(this)}`:u`${this.showInfo==="true"?Ra.call(this):""} ${this.allowServerSelection==="true"?ci.call(this):""} ${this.allowAuthentication==="true"?Qs.call(this,this.allowTry):""}<div id="operations-top" class="observe-me"><slot name="operations-top"></slot></div>${this.renderStyle==="read"?$d.call(this):Id.call(this,n,e)}`}</div>`}`}</div><slot name="footer"></slot></main></div>`}class bi extends Q{constructor(){super();const e={root:this.getRootNode().host,rootMargin:"-50px 0px -50px 0px",threshold:0};this.showSummaryWhenCollapsed=!0,this.isIntersectionObserverActive=!1,this.intersectionObserver=new IntersectionObserver(t=>{this.onIntersect(t)},e)}static get properties(){return{headingText:{type:String,attribute:"heading-text"},gotoPath:{type:String,attribute:"goto-path"},updateRoute:{type:String,attribute:"update-route"},routePrefix:{type:String,attribute:"route-prefix"},specUrl:{type:String,attribute:"spec-url"},sortTags:{type:String,attribute:"sort-tags"},sortSchemas:{type:String,attribute:"sort-schemas"},generateMissingTags:{type:String,attribute:"generate-missing-tags"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},specFile:{type:String,attribute:!1},layout:{type:String},renderStyle:{type:String,attribute:"render-style"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},onNavTagClick:{type:String,attribute:"on-nav-tag-click"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowAuthentication:{type:String,attribute:"allow-authentication"},allowTry:{type:String,attribute:"allow-try"},showCurlBeforeTry:{type:String,attribute:"show-curl-before-try"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},allowAdvancedSearch:{type:String,attribute:"allow-advanced-search"},allowServerSelection:{type:String,attribute:"allow-server-selection"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showComponents:{type:String,attribute:"show-components"},pageDirection:{type:String,attribute:"page-direction"},scrollBehavior:{type:String,attribute:"scroll-behavior"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},headerColor:{type:String,attribute:"header-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},cssFile:{type:String,attribute:"css-file"},cssClasses:{type:String,attribute:"css-classes"},navBgColor:{type:String,attribute:"nav-bg-color"},navTextColor:{type:String,attribute:"nav-text-color"},navHoverBgColor:{type:String,attribute:"nav-hover-bg-color"},navHoverTextColor:{type:String,attribute:"nav-hover-text-color"},navAccentColor:{type:String,attribute:"nav-accent-color"},navAccentTextColor:{type:String,attribute:"nav-accent-text-color"},navActiveItemMarker:{type:String,attribute:"nav-active-item-marker"},navItemSpacing:{type:String,attribute:"nav-item-spacing"},showMethodInNavBar:{type:String,attribute:"show-method-in-nav-bar"},usePathInNavBar:{type:String,attribute:"use-path-in-nav-bar"},infoDescriptionHeadingsInNavBar:{type:String,attribute:"info-description-headings-in-navbar"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},removeEndpointsWithBadgeLabelAs:{type:String,attribute:"remove-endpoints-with-badge-label-as"},loading:{type:Boolean},focusedElementId:{type:String},advancedSearchMatches:{type:Object},searchVal:{type:String}}}static get styles(){return[Ce,yt,Vt,Zt,Or,Wn,Jt,Nr,Br,dl,U`rapi-doc:not(:defined){display:none}:host{all:initial;letter-spacing:normal;width:100%;min-width:360px;height:100%;color:var(--fg);background:var(--bg);font-family:var(--font-regular);flex-direction:column;margin:0;padding:0;display:flex;overflow:hidden;container-type:inline-size}:where(button,input[type=checkbox],[tabindex="0"]):focus-visible{box-shadow:var(--focus-shadow)}:where(input[type=text],input[type=password],select,textarea):focus-visible{border-color:var(--primary-color)}.body{background:var(--bg);width:100%;height:100%;display:flex;position:relative;overflow:hidden}.main-content{scrollbar-width:thin;scrollbar-color:var(--border-color) transparent;flex:1;height:100%;margin:0;padding:0;display:block;overflow:hidden auto}.main-content-inner--view-mode{padding:0 8px}.main-content::-webkit-scrollbar{width:8px;height:8px}.main-content::-webkit-scrollbar-track{background:0 0}.main-content::-webkit-scrollbar-thumb{background:var(--border-color)}.section-gap.section-tag{border-bottom:1px solid var(--border-color)}.section-gap,.section-gap--focused-mode,.section-gap--read-mode{padding:0 4px}.section-tag-header{cursor:n-resize;padding:12px 0;position:relative}.collapsed .section-tag-header:hover{cursor:s-resize}.section-tag-header:hover{background-image:linear-gradient(to right, #0000, var(--border-color), #0000)}.section-tag-header:hover:after{color:var(--primary-color);content:"⬆";margin-left:-24px;font-size:20px;position:absolute;top:calc(50% - 14px)}.collapsed .section-tag-header:after{color:var(--border-color);content:"⬇";margin-left:-24px;font-size:20px;position:absolute;top:calc(50% - 14px)}.collapsed .section-tag-header:hover:after{color:var(--primary-color)}.collapsed .section-tag-body{display:none}::slotted([slot=fixed-header]){background:var(--header-bg);max-height:40px;color:var(--header-fg);text-align:center;padding:4px 12px;overflow:hidden}::slotted([slot=logo]){object-fit:contain;width:auto;height:36px;margin-left:5px}.only-large-screen-flex,.only-large-screen{display:none}.tag.title{text-transform:uppercase}.main-header{background:var(--header-bg);color:var(--header-fg)}.header-title{font-size:calc(var(--font-size-regular) + 8px);padding:0 8px}input.header-input{background:var(--header-color-darker);color:var(--header-fg);border:1px solid var(--header-color-border);border-radius:3px;flex:1;padding-right:24px}input.header-input::placeholder{opacity:.4}.loader{border:4px solid var(--bg3);border-top:4px solid var(--primary-color);border-radius:50%;width:36px;height:36px;margin:16px auto;animation:2s linear infinite spin}.expanded-endpoint-body{padding:6px 0;position:relative}.expanded-endpoint-body .tag-description{background:var(--code-bg);border-radius:var(--border-radius);transition:max-height .2s ease-out}.expanded-endpoint-body .tag-icon{transition:transform .2s ease-out}.expanded-endpoint-body .tag-icon.expanded{transform:rotate(180deg)}.divider{border-top:2px solid var(--border-color);width:100%;margin:24px 0}.tooltip{cursor:pointer;border:1px solid var(--border-color);border-left-width:4px;margin-left:2px}.tooltip a{color:var(--fg2);text-decoration:none}.tooltip-text{color:var(--fg2);z-index:1;background:var(--bg2);visibility:hidden;overflow-wrap:break-word;max-width:400px;position:absolute}.tooltip:hover{color:var(--primary-color);border-color:var(--primary-color)}.tooltip:hover a:hover{color:var(--primary-color)}.tooltip:hover .tooltip-text{visibility:visible}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.nav-method{font-weight:700;font-size:calc(var(--font-size-small) - 2px);white-space:nowrap;margin-right:4px}.nav-method.false{display:none}.nav-method.as-colored-text.get{color:var(--nav-get-color)}.nav-method.as-colored-text.put{color:var(--nav-put-color)}.nav-method.as-colored-text.post{color:var(--nav-post-color)}.nav-method.as-colored-text.delete{color:var(--nav-delete-color)}.nav-method.as-colored-text.head,.nav-method.as-colored-text.patch,.nav-method.as-colored-text.options{color:var(--nav-head-color)}.nav-method.as-colored-block{color:#000;border-radius:4px 0 0 4px;min-width:30px;padding:1px 4px}.colored-block .nav-method.as-colored-block{outline:1px solid}.nav-method.as-colored-block.get{background:var(--blue)}.nav-method.as-colored-block.put{background:var(--orange)}.nav-method.as-colored-block.post{background:var(--green)}.nav-method.as-colored-block.delete{background:var(--red)}.nav-method.as-colored-block.head,.nav-method.as-colored-block.patch,.nav-method.as-colored-block.options{background:var(--yellow)}@container (width>=768px){.nav-bar{width:260px;display:flex}#nav-bar-btn{display:none}#advanced-search-btn,.only-large-screen{display:block}.only-large-screen-flex{display:flex}.section-gap{padding:0 0 0 24px}.section-gap--focused-mode,.section-gap--read-mode{padding:24px 8px}.endpoint-body{padding:36px 0 48px;position:relative}}@container (width>=1024px){.nav-bar{width:${Ma(this.fontSize==="default"?"300px":this.fontSize==="large"?"315px":"330px")};display:flex}#nav-bar-btn{display:none}#advanced-search-btn{display:block}.section-gap--focused-mode{padding:12px 80px}.section-gap--read-mode{padding:24px 80px 12px}}`,He]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(e.offsetWidth===0&&e.style.width===""&&(e.style.width="100vw"),e.offsetHeight===0&&e.style.height===""&&(e.style.height="100vh"),e.tagName==="BODY"&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),this.loadFonts!=="false"){const t={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},a=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",t);t.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",t);a.load().then(s=>{document.fonts.add(s)}),r.load().then(s=>{document.fonts.add(s)})}(!this.layout||!"row, column,".includes(`${this.layout},`))&&(this.layout="row"),(!this.renderStyle||!"read, view, focused,".includes(`${this.renderStyle},`))&&(this.renderStyle="focused"),(!this.schemaStyle||!"tree, table,".includes(`${this.schemaStyle},`))&&(this.schemaStyle="tree"),(!this.theme||!"light, dark,".includes(`${this.theme},`))&&(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),!this.defaultSchemaTab||!"example, schema, model,".includes(`${this.defaultSchemaTab},`)?this.defaultSchemaTab="example":this.defaultSchemaTab==="model"&&(this.defaultSchemaTab="schema"),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),(!this.schemaDescriptionExpanded||!"true, false,".includes(`${this.schemaDescriptionExpanded},`))&&(this.schemaDescriptionExpanded="false"),(!this.schemaHideReadOnly||!"default, never,".includes(`${this.schemaHideReadOnly},`))&&(this.schemaHideReadOnly="default"),(!this.schemaHideWriteOnly||!"default, never,".includes(`${this.schemaHideWriteOnly},`))&&(this.schemaHideWriteOnly="default"),(!this.fillRequestFieldsWithExample||!"true, false,".includes(`${this.fillRequestFieldsWithExample},`))&&(this.fillRequestFieldsWithExample="true"),(!this.persistAuth||!"true, false,".includes(`${this.persistAuth},`))&&(this.persistAuth="false"),this.responseAreaHeight||(this.responseAreaHeight="400px"),(!this.allowSearch||!"true, false,".includes(`${this.allowSearch},`))&&(this.allowSearch="true"),(!this.allowAdvancedSearch||!"true, false,".includes(`${this.allowAdvancedSearch},`))&&(this.allowAdvancedSearch="true"),(!this.allowTry||!"true, false,".includes(`${this.allowTry},`))&&(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),(!this.updateRoute||!"true, false,".includes(`${this.updateRoute},`))&&(this.updateRoute="true"),this.routePrefix||(this.routePrefix="#"),(!this.sortTags||!"true, false,".includes(`${this.sortTags},`))&&(this.sortTags="false"),(!this.sortSchemas||!"true, false,".includes(`${this.sortSchemas},`))&&(this.sortSchemas="false"),(!this.generateMissingTags||!"true, false,".includes(`${this.generateMissingTags},`))&&(this.generateMissingTags="false"),(!this.sortEndpointsBy||!"method, path, summary, none,".includes(`${this.sortEndpointsBy},`))&&(this.sortEndpointsBy="path"),(!this.onNavTagClick||!"expand-collapse, show-description,".includes(`${this.onNavTagClick},`))&&(this.onNavTagClick="expand-collapse"),(!this.navItemSpacing||!"compact, relaxed, default,".includes(`${this.navItemSpacing},`))&&(this.navItemSpacing="default"),(!this.showMethodInNavBar||!"false, as-plain-text, as-colored-text, as-colored-block,".includes(`${this.showMethodInNavBar},`))&&(this.showMethodInNavBar="false"),(!this.usePathInNavBar||!"true, false,".includes(`${this.usePathInNavBar},`))&&(this.usePathInNavBar="false"),(!this.navActiveItemMarker||!"left-bar, colored-block".includes(`${this.navActiveItemMarker},`))&&(this.navActiveItemMarker="left-bar"),(!this.fontSize||!"default, large, largest,".includes(`${this.fontSize},`))&&(this.fontSize="default"),(!this.showInfo||!"true, false,".includes(`${this.showInfo},`))&&(this.showInfo="true"),(!this.allowServerSelection||!"true, false,".includes(`${this.allowServerSelection},`))&&(this.allowServerSelection="true"),(!this.allowAuthentication||!"true, false,".includes(`${this.allowAuthentication},`))&&(this.allowAuthentication="true"),(!this.allowSchemaDescriptionExpandToggle||!"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`))&&(this.allowSchemaDescriptionExpandToggle="true"),(!this.showSideNav||!"true false".includes(this.showSideNav))&&(this.showSideNav="true"),(!this.showComponents||!"true false".includes(this.showComponents))&&(this.showComponents="false"),(!this.infoDescriptionHeadingsInNavBar||!"true, false,".includes(`${this.infoDescriptionHeadingsInNavBar},`))&&(this.infoDescriptionHeadingsInNavBar="false"),(!this.fetchCredentials||!"omit, same-origin, include,".includes(`${this.fetchCredentials},`))&&(this.fetchCredentials=""),(!this.scrollBehavior||!"smooth, auto,".includes(`${this.scrollBehavior},`))&&(this.scrollBehavior="auto"),(!this.matchType||!"includes regex".includes(this.matchType))&&(this.matchType="includes"),this.matchPaths||(this.matchPaths=""),this.removeEndpointsWithBadgeLabelAs||(this.removeEndpointsWithBadgeLabelAs=""),this.cssFile||(this.cssFile=null),this.cssClasses||(this.cssClasses=""),window.addEventListener("hashchange",()=>{this.scrollToPath(this.getElementIDFromURL())},!0)}disconnectedCallback(){this.intersectionObserver&&this.intersectionObserver.disconnect(),super.disconnectedCallback()}infoDescriptionHeadingRenderer(){const e=new A.Renderer,t=new gt;return e.heading=(a,r,s)=>`<h${r} class="observe-me" id="${t.slug(s)}">${a}</h${r}>`,e}render(){const e=document.querySelector(`link[href*="${this.cssFile}"]`);return e&&this.shadowRoot.appendChild(e.cloneNode()),gi.call(this)}updated(e){var t;(t=super.updated)==null||t.call(this,e),Kt(this.shadowRoot)}observeExpandedContent(){this.shadowRoot.querySelectorAll(".observe-me").forEach(e=>{this.intersectionObserver.observe(e)})}attributeChangedCallback(e,t,a){if(e==="spec-url"&&t!==a&&window.setTimeout(async()=>{await this.loadSpec(a),this.gotoPath&&!window.location.hash&&this.scrollToPath(this.gotoPath)},0),(e==="match-paths"||e==="match-type"||e==="remove-endpoints-with-badge-label-as")&&t!==a&&window.setTimeout(async()=>{await this.loadSpec(this.specUrl)},0),e==="render-style"&&(a==="read"?window.setTimeout(()=>{this.observeExpandedContent()},100):this.intersectionObserver.disconnect()),e==="api-key-name"||e==="api-key-location"||e==="api-key-value"){let r=!1,s="",i="",o="";if(e==="api-key-name"?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(s=a,i=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),r=!0):e==="api-key-location"?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(i=a,s=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),r=!0):e==="api-key-value"&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=a,i=this.getAttribute("api-key-location"),s=this.getAttribute("api-key-name"),r=!0),r&&this.resolvedSpec){const l=this.resolvedSpec.securitySchemes.find(c=>c.securitySchemeId===Fe);l?(l.name=s,l.in=i,l.value=o,l.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({securitySchemeId:Fe,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:s,in:i,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,a)}onSpecUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSpecFileChange(e){this.setAttribute("spec-file",this.shadowRoot.getElementById("spec-file").value);const t=e.target.files[0],a=new FileReader;a.onload=()=>{try{const r=JSON.parse(a.result);this.loadSpec(r),this.shadowRoot.getElementById("spec-url").value=""}catch{}},a.readAsText(t)}onFileLoadClick(){this.shadowRoot.getElementById("spec-file").click()}onSearchChange(e){this.searchVal=e.target.value,this.resolvedSpec.tags.forEach(t=>t.paths.filter(a=>{this.searchVal&&xt(this.searchVal,a,t.name)&&(t.expanded=!0)})),this.resolvedSpec.components.forEach(t=>t.subComponents.filter(a=>{a.expanded=!1,pl(this.searchVal,a)&&(a.expanded=!0)})),this.requestUpdate()}onClearSearch(){const e=this.shadowRoot.getElementById("nav-bar-search");e.value="",this.searchVal="",this.resolvedSpec.components.forEach(t=>t.subComponents.filter(a=>{a.expanded=!0}))}onOpenNavBarToggle(){this.shadowRoot.getElementById("nav-bar").classList.toggle("floating-nav")}onShowAdvancedSearchClicked(){this.shadowRoot.getElementById("advanced-search-dialog").showModal()}onAdvancedSearchClose(){this.shadowRoot.getElementById("advanced-search-dialog").close()}async loadSpec(e){if(e){this.searchVal="";try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1;const t=await Zs.call(this,e,this.generateMissingTags==="true",this.sortTags==="true",this.sortSchemas==="true",this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"),this.matchPaths,this.matchType,this.removeEndpointsWithBadgeLabelAs);this.loading=!1,this.afterSpecParsedAndValidated(t)}catch{this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null}}}async afterSpecParsedAndValidated(e){var t;for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find(s=>s.url===this.defaultApiServerUrl))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const a=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(a),this.intersectionObserver.disconnect(),this.renderStyle==="read"&&(await Xt(100),this.observeExpandedContent()),this.isIntersectionObserverActive=!0;const r=this.getElementIDFromURL();if(r)this.renderStyle==="view"?this.expandAndGotoOperation(r,!0,!0):this.scrollToPath(r);else if(this.renderStyle==="focused"&&!this.gotoPath){const s=this.showInfo?"overview":(t=this.resolvedSpec.tags[0])==null?void 0:t.paths[0];this.scrollToPath(s)}}getComponentBaseURL(){const{href:e}=window.location,t=this.routePrefix.replace(/(#|\/)$/,"");if(!t)return e.split("#")[0];const a=e.lastIndexOf(t);return a===-1?e:e.slice(0,a)}getElementIDFromURL(){const e=this.getComponentBaseURL();return window.location.href.replace(e+this.routePrefix,"")}replaceHistoryState(e){const t=this.getComponentBaseURL();window.history.replaceState(null,null,`${t}${this.routePrefix||"#"}${e}`)}expandAndGotoOperation(e,t=!0){var a,r;if(!this.resolvedSpec)return;let s=!0;const i=e.indexOf("#")===-1?e:e.substring(1);if(i.startsWith("overview")||i==="servers"||i==="auth")s=!1;else for(let o=0;o<((a=this.resolvedSpec.tags)==null?void 0:a.length);o++){const l=this.resolvedSpec.tags[o],c=(r=l.paths)==null?void 0:r.find(d=>d.elementId===e);c&&(c.expanded&&l.expanded?s=!1:(c.expanded=!0,l.expanded=!0))}t&&(s&&this.requestUpdate(),window.setTimeout(()=>{const o=this.shadowRoot.getElementById(i);o&&(o.scrollIntoView({behavior:this.scrollBehavior,block:"start"}),this.updateRoute==="true"&&this.replaceHistoryState(i))},s?150:0))}isValidTopId(e){return e.startsWith("overview")||e==="servers"||e==="auth"}isValidPathId(e){var t,a,r,s;return e==="overview"&&this.showInfo||e==="servers"&&this.allowServerSelection||e==="auth"&&this.allowAuthentication?!0:e.startsWith("tag--")?(a=(t=this.resolvedSpec)==null?void 0:t.tags)==null?void 0:a.find(i=>i.elementId===e):(s=(r=this.resolvedSpec)==null?void 0:r.tags)==null?void 0:s.find(i=>i.paths.find(o=>o.elementId===e))}onIntersect(e){this.isIntersectionObserverActive!==!1&&e.forEach(t=>{if(t.isIntersecting&&t.intersectionRatio>0){const a=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active"),r=this.shadowRoot.getElementById(`link-${t.target.id}`);r&&(this.updateRoute==="true"&&this.replaceHistoryState(t.target.id),r.scrollIntoView({behavior:this.scrollBehavior,block:"center"}),r.classList.add("active"),r.part.add("section-navbar-active-item")),a&&a!==r&&(a.classList.remove("active"),a.part.remove("section-navbar-active-item"))}})}handleHref(e){if(e.target.tagName.toLowerCase()==="a"&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:this.scrollBehavior,block:"start"})}}async scrollToEventTarget(e,t=!0){if(!(e.type==="click"||e.type==="keyup"&&e.keyCode===13))return;const a=e.target;if(a.dataset.contentId){if(this.isIntersectionObserverActive=!1,this.renderStyle==="focused"){const r=this.shadowRoot.querySelector("api-request");r&&r.beforeNavigationFocusedMode()}this.scrollToPath(a.dataset.contentId,!0,t),setTimeout(()=>{this.isIntersectionObserverActive=!0},300)}}async scrollToPath(e,t=!0,a=!0){if(this.renderStyle==="focused"&&(this.focusedElementId=e,await Xt(0)),this.renderStyle==="view")this.expandAndGotoOperation(e,t,!0);else{let r=!1;const s=this.shadowRoot.getElementById(e);if(s?(r=!0,s.scrollIntoView({behavior:this.scrollBehavior,block:"start"})):r=!1,r){if(this.renderStyle==="focused"){const o=this.shadowRoot.querySelector("api-request");o&&o.afterNavigationFocusedMode();const l=this.shadowRoot.querySelector("api-response");l&&l.resetSelection()}this.updateRoute==="true"&&this.replaceHistoryState(e);const i=this.shadowRoot.getElementById(`link-${e}`);if(i){a&&i.scrollIntoView({behavior:this.scrollBehavior,block:"center"}),await Xt(0);const o=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active");o&&(o.classList.remove("active"),o.part.remove("active"),o.part.remove("section-navbar-active-item")),i.classList.add("active"),i.part.add("section-navbar-active-item")}}}}setHttpUserNameAndPassword(e,t,a){return je.call(this,e,t,a)}setApiKey(e,t){return je.call(this,e,"","",t)}removeAllSecurityKeys(){return Oa.call(this)}setApiServer(e){return ja.call(this,e)}onAdvancedSearch(e,t){const a=e.target;clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{let r;a.type==="text"?r=a:r=a.closest(".advanced-search-options").querySelector("input[type=text]");const s=[...a.closest(".advanced-search-options").querySelectorAll("input:checked")].map(i=>i.id);this.advancedSearchMatches=ul(r.value,this.resolvedSpec.tags,s)},t)}}customElements.define("rapi-doc",bi);class yi extends Q{constructor(){super(),this.isMini=!0,this.updateRoute="false",this.renderStyle="view",this.showHeader="false",this.allowAdvancedSearch="false"}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},layout:{type:String},pathsExpanded:{type:String,attribute:"paths-expanded"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},showSummaryWhenCollapsed:{type:String,attribute:"show-summary-when-collapsed"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},allowTry:{type:String,attribute:"allow-try"},showCurlBeforeTry:{type:String,attribute:"show-curl-before-try"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},removeEndpointsWithBadgeLabelAs:{type:String,attribute:"remove-endpoints-with-badge-label-as"},loading:{type:Boolean}}}static get styles(){return[Ce,yt,Vt,Zt,Or,Wn,Jt,Nr,Br,U`:host{all:initial;letter-spacing:normal;width:100%;min-width:360px;height:100%;color:var(--fg);background:var(--bg);font-family:var(--font-regular);flex-direction:column;margin:0;padding:0;display:flex;overflow:hidden;container-type:inline-size}@container (width>=768px){.only-large-screen{display:block}.only-large-screen-flex{display:flex}}`]}connectedCallback(){if(super.connectedCallback(),this.loadFonts!=="false"){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const a=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then(r=>{document.fonts.add(r)}),a.load().then(r=>{document.fonts.add(r)})}(!this.showSummaryWhenCollapsed||!"true, false,".includes(`${this.showSummaryWhenCollapsed},`))&&(this.showSummaryWhenCollapsed="true"),(!this.layout||!"row, column,".includes(`${this.layout},`))&&(this.layout="row"),(!this.schemaStyle||!"tree, table,".includes(`${this.schemaStyle},`))&&(this.schemaStyle="tree"),(!this.theme||!"light, dark,".includes(`${this.theme},`))&&(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),!this.defaultSchemaTab||!"example, schema, model,".includes(`${this.defaultSchemaTab},`)?this.defaultSchemaTab="example":this.defaultSchemaTab==="model"&&(this.defaultSchemaTab="schema"),this.pathsExpanded=this.pathsExpanded==="true",(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),(!this.schemaDescriptionExpanded||!"true, false,".includes(`${this.schemaDescriptionExpanded},`))&&(this.schemaDescriptionExpanded="false"),(!this.fillRequestFieldsWithExample||!"true, false,".includes(`${this.fillRequestFieldsWithExample},`))&&(this.fillRequestFieldsWithExample="true"),(!this.persistAuth||!"true, false,".includes(`${this.persistAuth},`))&&(this.persistAuth="false"),this.responseAreaHeight||(this.responseAreaHeight="300px"),(!this.allowTry||!"true, false,".includes(`${this.allowTry},`))&&(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),(!this.sortTags||!"true, false,".includes(`${this.sortTags},`))&&(this.sortTags="false"),(!this.sortEndpointsBy||!"method, path, summary,".includes(`${this.sortEndpointsBy},`))&&(this.sortEndpointsBy="path"),(!this.fontSize||!"default, large, largest,".includes(`${this.fontSize},`))&&(this.fontSize="default"),(!this.matchType||!"includes regex".includes(this.matchType))&&(this.matchType="includes"),this.matchPaths||(this.matchPaths=""),this.removeEndpointsWithBadgeLabelAs||(this.removeEndpointsWithBadgeLabelAs=""),(!this.allowSchemaDescriptionExpandToggle||!"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`))&&(this.allowSchemaDescriptionExpandToggle="true"),(!this.fetchCredentials||!"omit, same-origin, include,".includes(`${this.fetchCredentials},`))&&(this.fetchCredentials="")}render(){return gi.call(this,!0,this.pathsExpanded)}updated(e){var t;(t=super.updated)==null||t.call(this,e),Kt(this.shadowRoot)}attributeChangedCallback(e,t,a){if(e==="spec-url"&&t!==a&&window.setTimeout(async()=>{await this.loadSpec(a)},0),(e==="match-paths"||e==="match-type"||e==="remove-endpoints-with-badge-label-as")&&t!==a&&window.setTimeout(async()=>{await this.loadSpec(this.specUrl)},0),e==="api-key-name"||e==="api-key-location"||e==="api-key-value"){let r=!1,s="",i="",o="";if(e==="api-key-name"?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(s=a,i=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),r=!0):e==="api-key-location"?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(i=a,s=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),r=!0):e==="api-key-value"&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=a,i=this.getAttribute("api-key-location"),s=this.getAttribute("api-key-name"),r=!0),r&&this.resolvedSpec){const l=this.resolvedSpec.securitySchemes.find(c=>c.securitySchemeId===Fe);l?(l.name=s,l.in=i,l.value=o,l.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({apiKeyId:Fe,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:s,in:i,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,a)}onSpecUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await Zs.call(this,e,this.generateMissingTags==="true",this.sortTags==="true",this.sortSchemas==="true",this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"),this.matchPaths,this.matchType,this.removeEndpointsWithBadgeLabelAs);this.loading=!1,this.afterSpecParsedAndValidated(t)}catch{this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null}}setHttpUserNameAndPassword(e,t,a){return je.call(this,e,t,a)}setApiKey(e,t){return je.call(this,e,"","",t)}removeAllSecurityKeys(){return Oa.call(this)}setApiServer(e){return ja.call(this,e)}async afterSpecParsedAndValidated(e){for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find(a=>a.url===this.defaultApiServerUrl))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t)}handleHref(e){if(e.target.tagName.toLowerCase()==="a"&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}}customElements.define("rapi-doc-mini",yi);class vi extends HTMLElement{connectedCallback(){this.receiveAuthParms(),window.addEventListener("storage",e=>this.receiveStorage(e),!0)}receiveAuthParms(){let e={};if(document.location.search){const t=new URLSearchParams(document.location.search),a=t.get("code"),r=t.get("error"),s=t.get("state");e={code:a,error:r,state:s,responseType:"code"}}else if(window.location.hash){const t=this.parseQueryString(window.location.hash.substring(1),"token_type"),a=this.parseQueryString(window.location.hash.substring(1),"access_token");e={token_type:t,access_token:a,responseType:"token"}}if(window.opener){window.opener.postMessage(e,this.target);return}sessionStorage.setItem("rapidoc-oauth-data",JSON.stringify(e))}relayAuthParams(e){if(window.parent&&e.key==="rapidoc-oauth-data"){const t=JSON.parse(e.newValue);window.parent.postMessage(t,this.target)}}parseQueryString(e,t){const a=e.split("&");for(let r=0;r<a.length;r++){const s=a[r].split("=");if(decodeURIComponent(s[0])===t)return decodeURIComponent(s[1])}}}customElements.define("oauth-receiver",vi);const qd={RapiDoc:bi};export{vi as OAuthReceiver,yi as RapiDocMini,qd as default};
|
|
281
|
+
schema-description:schema-description, schema-multiline-toggle:schema-multiline-toggle"></api-response></div></div>`}function ep(n=!1,e=!1){return this.resolvedSpec?u`${n?"":u`<div style="display:flex;justify-content:flex-end"><span @click="${t=>Ti(t,"expand-all")}" style="color:var(--primary-color);cursor:pointer">Expand all </span> | <span @click="${t=>Ti(t,"collapse-all")}" style="color:var(--primary-color);cursor:pointer">Collapse all </span> sections</div>`} ${this.resolvedSpec.tags.map(t=>u`${n?u`<div class="section-tag-body">${t.paths.filter(a=>this.searchVal?St(this.searchVal,a,t.name):!0).map(a=>u`<section id="${a.elementId}" class="m-endpoint regular-font ${a.method} ${e||a.expanded?"expanded":"collapsed"}">${Oi.call(this,a,e)} ${e||a.expanded?Ni.call(this,a):""}</section>`)}</div>`:u`<div class="regular-font section-gap section-tag ${t.expanded?"expanded":"collapsed"}"><div class="section-tag-header" @click="${()=>{t.expanded=!t.expanded,this.requestUpdate()}}"><div id="${t.elementId}" class="sub-title tag" style="color:var(--primary-color)">${t.displayName||t.name}</div></div><div class="section-tag-body"><slot name="${t.elementId}"></slot><div class="regular-font regular-font-size m-markdown" style="padding-bottom:12px">${_(z(A(t.description||"")))}</div>${t.paths.filter(a=>this.searchVal?St(this.searchVal,a,t.name):!0).map(a=>u`<section part="section-endpoint" id="${a.elementId}" class="m-endpoint regular-font ${a.method} ${e||a.expanded?"expanded":"collapsed"}">${Oi.call(this,a,e)} ${e||a.expanded?Ni.call(this,a):""}</section>`)}</div></div>`}`)}`:""}function tp(n){return u`<div style="${n}"><svg viewBox="1 0 511 512"><path d="M351 411a202 202 0 01-350 0 203 203 0 01333-24 203 203 0 0117 24zm0 0" fill="#adc165"/><path d="M334 387a202 202 0 01-216-69 202 202 0 01216 69zm78 32H85a8 8 0 01-8-8 8 8 0 018-8h327a8 8 0 017 8 8 8 0 01-7 8zm0 0" fill="#99aa52"/><path d="M374 338l-5 30a202 202 0 01-248-248 203 203 0 01253 218zm0 0" fill="#ffc73b"/><path d="M374 338a202 202 0 01-100-197 203 203 0 01100 197zm38 81l-6-2-231-231a8 8 0 0111-11l231 230a8 8 0 01-5 14zm0 0" fill="#efb025"/><path d="M311 175c0 75 40 140 101 175a202 202 0 000-350 202 202 0 00-101 175zm0 0" fill="#ff903e"/><path d="M412 419a8 8 0 01-8-8V85a8 8 0 0115 0v326a8 8 0 01-7 8zm0 0" fill="#e87425"/></svg></div>`}function np(){return u`<header class="row main-header regular-font" part="section-header" style="padding:8px 4px 8px 4px;min-height:48px"><div class="only-large-screen-flex" style="align-items:center"><slot name="logo" class="logo" part="section-logo">${tp("height:36px;width:36px;margin-left:5px")}</slot><div class="header-title" part="label-header-title">${this.headingText}</div></div><div style="margin:0 8px;display:flex;flex:1">${this.allowSpecUrlLoad==="false"?"":u`<input id="spec-url" type="text" style="font-size:var(--font-size-small)" class="header-input mono-font" part="textbox textbox-spec-url" placeholder="Spec URL" value="${this.specUrl||""}" @change="${this.onSpecUrlChange}" spellcheck="false"><div style="margin:6px 5px 0 -24px;font-size:var(--font-size-regular);cursor:pointer">↩</div>`} ${this.allowSpecFileLoad==="false"?"":u`<input id="spec-file" part="file-input" type="file" style="display:none" value="${this.specFile||""}" @change="${this.onSpecFileChange}" spellcheck="false"> <button class="m-btn primary only-large-screen" style="margin-left:10px" part="btn btn-fill" @click="${this.onFileLoadClick}">LOCAL JSON FILE</button>`}<slot name="header"></slot>${this.allowSearch==="false"||"read focused".includes(this.renderStyle)?"":u`<input id="search" class="header-input" type="text" part="textbox textbox-header-filter" placeholder="Filter" @change="${this.onSearchChange}" style="max-width:130px;margin-left:10px" spellcheck="false"><div style="margin:6px 5px 0 -24px;font-size:var(--font-size-regular);cursor:pointer">↩</div>`} ${this.allowAdvancedSearch==="false"||"read focused".includes(this.renderStyle)?"":u`<button class="m-btn primary only-large-screen" part="btn btn-fill btn-search" style="margin-left:10px" @click="${this.onShowAdvancedSearchClicked}">Search</button>`}</div></header>`}function ap(){var n;return u`<dialog id="advanced-search-dialog" class="dialog-box"><header class="dialog-box-header"><span class="dialog-box-title">Search</span> <button type="button" @click="${e=>this.onAdvancedSearchClose(e)}">×</button></header><div class="dialog-box-content"><span class="advanced-search-options"><input id="input-advanced-search-dialog" style="width:100%;padding-right:20px" type="text" part="textbox textbox-search-dialog" placeholder="search text..." spellcheck="false" @keyup="${e=>this.onAdvancedSearch(e,400)}"><div style="display:flex;gap:16px;flex-wrap:wrap;margin:8px 0 24px"><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-path" checked="checked" @change="${e=>this.onAdvancedSearch(e,0)}"> <label for="search-api-path" style="cursor:pointer">API Path</label></div><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-descr" checked="checked" @change="${e=>this.onAdvancedSearch(e,0)}"> <label style="cursor:pointer" for="search-api-descr">API Description</label></div><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-params" @change="${e=>this.onAdvancedSearch(e,0)}"> <label style="cursor:pointer" for="search-api-params">API Parameters</label></div><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-request-body" @change="${e=>this.onAdvancedSearch(e,0)}"> <label style="cursor:pointer" for="search-api-request-body">Request Body Parameters</label></div><div><input style="cursor:pointer" type="checkbox" part="checkbox checkbox-search-dialog" id="search-api-resp-descr" @change="${e=>this.onAdvancedSearch(e,0)}"> <label style="cursor:pointer" for="search-api-resp-descr">Response Description</label></div></div></span>${(n=this.advancedSearchMatches)==null?void 0:n.map(e=>u`<div class="mono-font small-font-size hover-bg" style="padding:5px;cursor:pointer;border-bottom:1px solid var(--light-border-color);${e.deprecated?"filter:opacity(0.5);":""}" data-content-id="${e.elementId}" tabindex="0" @click="${t=>{this.searchVal="",this.shadowRoot.getElementById("advanced-search-dialog").close(),this.requestUpdate(),this.scrollToEventTarget(t,!0)}}"><span style="pointer-events:none" class="upper bold-text method-fg ${e.method}">${e.method}</span> <span style="pointer-events:none">${e.path}</span> <span style="pointer-events:none" class="regular-font gray-text">${e.summary}</span></div>`)}</div></dialog>`}const F={color:{inputReverseFg:"#fff",inputReverseBg:"#333",headerBg:"#444",getRgb(n){if(n.indexOf("#")===0&&(n=n.slice(1,7)),(n.length===3||n.length===4)&&(n=n[0]+n[0]+n[1]+n[1]+n[2]+n[2]),n.length!==6)throw new Error("Invalid HEX color.");return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16)}},luminanace(n){const e=this.getRgb(n);return e.r*.299+e.g*.587+e.b*.114},invert(n){return this.luminanace(n)>135?"#000":"#fff"},opacity(n,e){const t=this.getRgb(n);return`rgba(${t.r}, ${t.g}, ${t.b}, ${e})`},brightness(n,e){const t=this.getRgb(n);return t.r+=e,t.g+=e,t.b+=e,t.r>255?t.r=255:t.r<0&&(t.r=0),t.g>255?t.g=255:t.g<0&&(t.g=0),t.b>255?t.b=255:t.b<0&&(t.b=0),`#${t.r.toString(16).padStart(2,"0")}${t.g.toString(16).padStart(2,"0")}${t.b.toString(16).padStart(2,"0")}`},hasGoodContrast(n,e){const t=this.luminanace(n),a=this.luminanace(e);return t-a}}};function fe(n){return/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3}|[A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/i.test(n)}function lt(n,e={}){let t={};const a=e.primaryColor?e.primaryColor:n==="dark"?"#f76b39":"#ff591e",r=F.color.invert(a),s=F.color.opacity(a,"0.4");if(n==="dark"){const i=e.bg1?e.bg1:"#2a2b2c",o=e.fg1?e.fg1:"#bbb",l=e.bg2?e.bg2:F.color.brightness(i,5),c=e.bg3?e.bg3:F.color.brightness(i,17),d=e.bg3?e.bg3:F.color.brightness(i,35),p=e.fg2?e.fg2:F.color.brightness(o,-15),h=e.fg3?e.fg3:F.color.brightness(o,-20),m=e.fg3?e.fg3:F.color.brightness(o,-65),y=e.inlineCodeFg?e.inlineCodeFg:"#c58484",g=p,f=l,b=e.headerColor?e.headerColor:F.color.brightness(i,10),v=e.navBgColor?e.navBgColor:F.color.brightness(i,10),w=e.navTextColor?e.navTextColor:F.color.opacity(F.color.invert(v),"0.50"),x=e.navHoverBgColor?e.navHoverBgColor:F.color.brightness(v,-15),k=e.navHoverTextColor?e.navHoverTextColor:F.color.invert(v),$=e.navAccentColor?e.navAccentColor:F.color.brightness(a,25),S=e.navAccentTextColor?e.navAccenttextColor:F.color.invert($);t={bg1:i,bg2:l,bg3:c,lightBg:d,fg1:o,fg2:p,fg3:h,lightFg:m,inlineCodeFg:y,primaryColor:a,primaryColorTrans:s,primaryColorInvert:r,selectionBg:g,selectionFg:f,overlayBg:"rgba(80, 80, 80, 0.4)",navBgColor:v,navTextColor:w,navHoverBgColor:x,navHoverTextColor:k,navAccentColor:$,navAccentTextColor:S,headerColor:b,headerColorInvert:F.color.invert(b),headerColorDarker:F.color.brightness(b,-20),headerColorBorder:F.color.brightness(b,10),borderColor:e.borderColor||F.color.brightness(i,20),lightBorderColor:e.lightBorderColor||F.color.brightness(i,15),codeBorderColor:e.codeBorderColor||F.color.brightness(i,30),inputBg:e.inputBg||F.color.brightness(i,-5),placeHolder:e.placeHolder||F.color.opacity(o,"0.3"),hoverColor:e.hoverColor||F.color.brightness(i,-10),red:e.red?e.red:"#F06560",pink:e.pink?e.pink:"#ffb2b2",green:e.green||"#7ec699",blue:e.blue||"#71b7ff",orange:e.orange?e.orange:"#f08d49",yellow:e.yellow||"#827717",purple:e.purple||"#786FF1",brown:e.brown||"#D4AC0D",codeBg:e.codeBg||F.color.opacity(F.color.brightness(i,-15),.7),codeFg:e.codeFg||"#aaa",codePropertyColor:e.codePropertyColor||"#79c0ff",codeKeywordColor:e.codeKeywordColor||"#ff7b72",codeOperatorColor:e.codeOperatorColor||"#c9d1d9",syntaxComment:"#8b949e",syntaxKeyword:"#ff7b72",syntaxOperator:"#c9d1d9",syntaxString:"#a5d6ff",syntaxConstant:"#79c0ff",syntaxFunction:"#d2a8ff",syntaxType:"#d2a8ff",syntaxVariable:"#ffa657",syntaxProperty:"#79c0ff",syntaxTag:"#7ee787",syntaxSelector:"#d2a8ff",syntaxInserted:"#7ee787",syntaxDeleted:"#ff7b72"}}else{const i=e.bg1?e.bg1:"#fafbfc",o=e.fg1?e.fg1:"#444444",l=e.bg2?e.bg2:F.color.brightness(i,-5),c=e.bg3?e.bg3:F.color.brightness(i,-15),d=e.bg3?e.bg3:F.color.brightness(i,-45),p=e.fg2?e.fg2:F.color.brightness(o,17),h=e.fg3?e.fg3:F.color.brightness(o,30),m=e.fg3?e.fg3:F.color.brightness(o,70),y=e.inlineCodeFg?e.inlineCodeFg:"brown",g=p,f=l,b=e.headerColor?e.headerColor:F.color.brightness(i,-180),v=e.navBgColor?e.navBgColor:F.color.brightness(i,-200),w=e.navTextColor?e.navTextColor:F.color.opacity(F.color.invert(v),"0.65"),x=e.navHoverBgColor?e.navHoverBgColor:F.color.brightness(v,-15),k=e.navHoverTextColor?e.navHoverTextColor:F.color.invert(v),$=e.navAccentColor?e.navAccentColor:F.color.brightness(a,25),S=e.navAccentTextColor?e.navAccenttextColor:F.color.invert($);t={bg1:i,bg2:l,bg3:c,lightBg:d,fg1:o,fg2:p,fg3:h,lightFg:m,inlineCodeFg:y,primaryColor:a,primaryColorTrans:s,primaryColorInvert:r,selectionBg:g,selectionFg:f,overlayBg:"rgba(0, 0, 0, 0.4)",navBgColor:v,navTextColor:w,navHoverBgColor:x,navHoverTextColor:k,navAccentColor:$,navAccentTextColor:S,headerColor:b,headerColorInvert:F.color.invert(b),headerColorDarker:F.color.brightness(b,-20),headerColorBorder:F.color.brightness(b,10),borderColor:e.borderColor||F.color.brightness(i,-38),lightBorderColor:e.lightBorderColor||F.color.brightness(i,-23),codeBorderColor:e.codeBorderColor||"transparent",inputBg:e.inputBg||F.color.brightness(i,10),placeHolder:e.placeHolder||F.color.brightness(m,20),hoverColor:e.hoverColor||F.color.brightness(i,-5),red:e.red||"#F06560",pink:e.pink?e.pink:"#990055",green:e.green||"#690",blue:e.blue||"#47AFE8",orange:e.orange||"#FF9900",yellow:e.yellow||"#827717",purple:e.purple||"#786FF1",brown:e.brown||"#D4AC0D",codeBg:e.codeBg||F.color.opacity(F.color.brightness(i,-15),.7),codeFg:e.codeFg||"#666",codePropertyColor:e.codePropertyColor||"#0550ae",codeKeywordColor:e.codeKeywordColor||"#cf222e",codeOperatorColor:e.codeOperatorColor||"#24292f",syntaxComment:"#6e7781",syntaxKeyword:"#cf222e",syntaxOperator:"#24292f",syntaxString:"#0a3069",syntaxConstant:"#0550ae",syntaxFunction:"#8250df",syntaxType:"#8250df",syntaxVariable:"#953800",syntaxProperty:"#0550ae",syntaxTag:"#116329",syntaxSelector:"#8250df",syntaxInserted:"#116329",syntaxDeleted:"#cf222e"}}return u`<style>*,:after,:before{box-sizing:border-box}:host{--border-radius:2px;--layout:${this.layout||"row"};--font-mono:${this.monoFont||'Monaco, "Andale Mono", "Roboto Mono", Consolas, monospace'};--font-regular:${this.regularFont||'"Open Sans", Avenir, "Segoe UI", Arial, sans-serif'};--scroll-bar-width:8px;--nav-item-padding:${this.navItemSpacing==="relaxed"?"10px 16px 10px 10px":this.navItemSpacing==="compact"?"5px 16px 5px 10px":"7px 16px 7px 10px"};--resp-area-height:${this.responseAreaHeight};--font-size-small:${this.fontSize==="default"?"12px":this.fontSize==="large"?"13px":"14px"};--font-size-mono:${this.fontSize==="default"?"13px":this.fontSize==="large"?"14px":"15px"};--font-size-regular:${this.fontSize==="default"?"14px":this.fontSize==="large"?"15px":"16px"};--dialog-z-index:1000;--table-schema-key-width:240px;--table-schema-key-text-overflow:ellipsis;--table-schema-key-whitespace:nowrap;--focus-shadow:0 0 0 1px transparent,0 0 0 3px var(--primary-color-trans);--bg:${t.bg1};--bg2:${t.bg2};--bg3:${t.bg3};--light-bg:${t.lightBg};--fg:${t.fg1};--fg2:${t.fg2};--fg3:${t.fg3};--light-fg:${t.lightFg};--selection-bg:${t.selectionBg};--selection-fg:${t.selectionFg};--overlay-bg:${t.overlayBg};--border-color:${t.borderColor};--light-border-color:${t.lightBorderColor};--code-border-color:${t.codeBorderColor};--input-bg:${t.inputBg};--placeholder-color:${t.placeHolder};--hover-color:${t.hoverColor};--red:${t.red};--pink:${t.pink};--green:${t.green};--blue:${t.blue};--orange:${t.orange};--yellow:${t.yellow};--purple:${t.purple};--brown:${t.brown};--header-bg:${t.headerColor};--header-fg:${t.headerColorInvert};--header-color-darker:${t.headerColorDarker};--header-color-border:${t.headerColorBorder};--nav-bg-color:${t.navBgColor};--nav-text-color:${t.navTextColor};--nav-hover-bg-color:${t.navHoverBgColor};--nav-hover-text-color:${t.navHoverTextColor};--nav-accent-color:${t.navAccentColor};--nav-accent-text-color:${t.navAccentTextColor};--nav-get-color:${t.blue};--nav-put-color:${t.orange};--nav-post-color:${t.green};--nav-delete-color:${t.red};--nav-head-color:${t.yellow};--primary-color:${t.primaryColor};--primary-color-invert:${t.primaryColorInvert};--primary-color-trans:${t.primaryColorTrans};--code-bg:${t.codeBg};--code-fg:${t.codeFg};--inline-code-fg:${t.inlineCodeFg};--code-property-color:${t.codePropertyColor};--code-keyword-color:${t.codeKeywordColor};--code-operator-color:${t.codeOperatorColor};--syntax-comment:${t.syntaxComment};--syntax-keyword:${t.syntaxKeyword};--syntax-operator:${t.syntaxOperator};--syntax-string:${t.syntaxString};--syntax-constant:${t.syntaxConstant};--syntax-function:${t.syntaxFunction};--syntax-type:${t.syntaxType};--syntax-variable:${t.syntaxVariable};--syntax-property:${t.syntaxProperty};--syntax-tag:${t.syntaxTag};--syntax-selector:${t.syntaxSelector};--syntax-inserted:${t.syntaxInserted};--syntax-deleted:${t.syntaxDeleted}}</style>`}function Bi(n=!1,e=!1){if(!this.resolvedSpec)return"";this.persistAuth==="true"&&$d.call(this);const t={bg1:fe(this.bgColor)?this.bgColor:"",fg1:fe(this.textColor)?this.textColor:"",headerColor:fe(this.headerColor)?this.headerColor:"",primaryColor:fe(this.primaryColor)?this.primaryColor:"",navBgColor:fe(this.navBgColor)?this.navBgColor:"",navTextColor:fe(this.navTextColor)?this.navTextColor:"",navHoverBgColor:fe(this.navHoverBgColor)?this.navHoverBgColor:"",navHoverTextColor:fe(this.navHoverTextColor)?this.navHoverTextColor:"",navAccentColor:fe(this.navAccentColor)?this.navAccentColor:"",navAccentTextColor:fe(this.navAccentTextColor)?this.navAccentTextColor:""};return this.resolvedSpec.specLoadError?u`${this.theme==="dark"?lt.call(this,"dark",t):lt.call(this,"light",t)}<div id="spec-not-found" style="display:flex;align-items:center;justify-content:center;border:1px dashed var(--border-color);padding:12px;overflow-wrap:anywhere;font-size:var(--font-size-small);color:var(--red);font-family:var(--font-mono)">${this.resolvedSpec.info.description}</div>`:this.resolvedSpec.isSpecLoading?u`${this.theme==="dark"?lt.call(this,"dark",t):lt.call(this,"light",t)}<main class="main-content regular-font" part="section-main-content"><slot></slot><div class="main-content-inner--${this.renderStyle}-mode"><div class="loader"></div></div></main>`:u`${this.theme==="dark"?lt.call(this,"dark",t):lt.call(this,"light",t)}<slot name="fixed-header"></slot>${this.showHeader==="false"?"":np.call(this)} ${this.allowAdvancedSearch==="false"?"":ap.call(this)}<div id="the-main-body" class="body ${this.cssClasses}" dir="${this.pageDirection}">${(this.renderStyle==="read"||this.renderStyle==="focused")&&this.showSideNav==="true"&&this.resolvedSpec?Zd.call(this):""}<main class="main-content regular-font" tabindex="-1" part="section-main-content"><slot></slot><div class="main-content-inner--${this.renderStyle}-mode">${this.loading===!0?u`<div class="loader"></div>`:u`${this.loadFailed===!0?u`<div style="text-align:center;margin:16px">Unable to load the Spec</div>`:u`<div class="operations-root" @click="${a=>{this.handleHref(a)}}">${this.renderStyle==="focused"?u`${Xd.call(this)}`:u`${this.showInfo==="true"?Ja.call(this):""} ${this.allowServerSelection==="true"?Ai.call(this):""} ${this.allowAuthentication==="true"?xi.call(this,this.allowTry):""}<div id="operations-top" class="observe-me"><slot name="operations-top"></slot></div>${this.renderStyle==="read"?Pd.call(this):ep.call(this,n,e)}`}</div>`}`}</div><slot name="footer"></slot></main></div>`}class Li extends ee{constructor(){super();const e={root:this.getRootNode().host,rootMargin:"-50px 0px -50px 0px",threshold:0};this.showSummaryWhenCollapsed=!0,this.isIntersectionObserverActive=!1,this.intersectionObserver=new IntersectionObserver(t=>{this.onIntersect(t)},e)}static get properties(){return{headingText:{type:String,attribute:"heading-text"},gotoPath:{type:String,attribute:"goto-path"},updateRoute:{type:String,attribute:"update-route"},routePrefix:{type:String,attribute:"route-prefix"},specUrl:{type:String,attribute:"spec-url"},sortTags:{type:String,attribute:"sort-tags"},sortSchemas:{type:String,attribute:"sort-schemas"},generateMissingTags:{type:String,attribute:"generate-missing-tags"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},specFile:{type:String,attribute:!1},layout:{type:String},renderStyle:{type:String,attribute:"render-style"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},onNavTagClick:{type:String,attribute:"on-nav-tag-click"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},schemaHideReadOnly:{type:String,attribute:"schema-hide-read-only"},schemaHideWriteOnly:{type:String,attribute:"schema-hide-write-only"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},mockServer:{type:String,attribute:"mock-server"},mockServerStatusCode:{type:String,attribute:"mock-server-status-code"},mockServerStatusStrategy:{type:String,attribute:"mock-server-status-strategy"},mockServerDelay:{type:Number,attribute:"mock-server-delay"},mockServerLog:{type:String,attribute:"mock-server-log"},showHeader:{type:String,attribute:"show-header"},showSideNav:{type:String,attribute:"show-side-nav"},showInfo:{type:String,attribute:"show-info"},allowAuthentication:{type:String,attribute:"allow-authentication"},allowTry:{type:String,attribute:"allow-try"},showCurlBeforeTry:{type:String,attribute:"show-curl-before-try"},allowSpecUrlLoad:{type:String,attribute:"allow-spec-url-load"},allowSpecFileLoad:{type:String,attribute:"allow-spec-file-load"},allowSpecFileDownload:{type:String,attribute:"allow-spec-file-download"},allowSearch:{type:String,attribute:"allow-search"},allowAdvancedSearch:{type:String,attribute:"allow-advanced-search"},allowServerSelection:{type:String,attribute:"allow-server-selection"},allowSchemaDescriptionExpandToggle:{type:String,attribute:"allow-schema-description-expand-toggle"},showComponents:{type:String,attribute:"show-components"},pageDirection:{type:String,attribute:"page-direction"},scrollBehavior:{type:String,attribute:"scroll-behavior"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},headerColor:{type:String,attribute:"header-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},cssFile:{type:String,attribute:"css-file"},cssClasses:{type:String,attribute:"css-classes"},navBgColor:{type:String,attribute:"nav-bg-color"},navTextColor:{type:String,attribute:"nav-text-color"},navHoverBgColor:{type:String,attribute:"nav-hover-bg-color"},navHoverTextColor:{type:String,attribute:"nav-hover-text-color"},navAccentColor:{type:String,attribute:"nav-accent-color"},navAccentTextColor:{type:String,attribute:"nav-accent-text-color"},navActiveItemMarker:{type:String,attribute:"nav-active-item-marker"},navItemSpacing:{type:String,attribute:"nav-item-spacing"},showMethodInNavBar:{type:String,attribute:"show-method-in-nav-bar"},usePathInNavBar:{type:String,attribute:"use-path-in-nav-bar"},infoDescriptionHeadingsInNavBar:{type:String,attribute:"info-description-headings-in-navbar"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},removeEndpointsWithBadgeLabelAs:{type:String,attribute:"remove-endpoints-with-badge-label-as"},loading:{type:Boolean},focusedElementId:{type:String},advancedSearchMatches:{type:Object},searchVal:{type:String}}}static get styles(){return[Fe,$t,Yt,Qt,Mr,ta,en,Hr,Wr,Dl,U`rapi-doc:not(:defined){display:none}:host{all:initial;letter-spacing:normal;width:100%;min-width:360px;height:100%;color:var(--fg);background:var(--bg);font-family:var(--font-regular);flex-direction:column;margin:0;padding:0;display:flex;overflow:hidden;container-type:inline-size}:where(button,input[type=checkbox],[tabindex="0"]):focus-visible{box-shadow:var(--focus-shadow)}:where(input[type=text],input[type=password],select,textarea):focus-visible{border-color:var(--primary-color)}.body{background:var(--bg);width:100%;height:100%;display:flex;position:relative;overflow:hidden}.main-content{scrollbar-width:thin;scrollbar-color:var(--border-color) transparent;flex:1;height:100%;margin:0;padding:0;display:block;overflow:hidden auto}.main-content-inner--view-mode{padding:0 8px}.main-content::-webkit-scrollbar{width:8px;height:8px}.main-content::-webkit-scrollbar-track{background:0 0}.main-content::-webkit-scrollbar-thumb{background:var(--border-color)}.section-gap.section-tag{border-bottom:1px solid var(--border-color)}.section-gap,.section-gap--focused-mode,.section-gap--read-mode{padding:0 4px}.section-tag-header{cursor:n-resize;padding:12px 0;position:relative}.collapsed .section-tag-header:hover{cursor:s-resize}.section-tag-header:hover{background-image:linear-gradient(to right, #0000, var(--border-color), #0000)}.section-tag-header:hover:after{color:var(--primary-color);content:"⬆";margin-left:-24px;font-size:20px;position:absolute;top:calc(50% - 14px)}.collapsed .section-tag-header:after{color:var(--border-color);content:"⬇";margin-left:-24px;font-size:20px;position:absolute;top:calc(50% - 14px)}.collapsed .section-tag-header:hover:after{color:var(--primary-color)}.collapsed .section-tag-body{display:none}::slotted([slot=fixed-header]){background:var(--header-bg);max-height:40px;color:var(--header-fg);text-align:center;padding:4px 12px;overflow:hidden}::slotted([slot=logo]){object-fit:contain;width:auto;height:36px;margin-left:5px}.only-large-screen-flex,.only-large-screen{display:none}.tag.title{text-transform:uppercase}.main-header{background:var(--header-bg);color:var(--header-fg)}.header-title{font-size:calc(var(--font-size-regular) + 8px);padding:0 8px}input.header-input{background:var(--header-color-darker);color:var(--header-fg);border:1px solid var(--header-color-border);border-radius:3px;flex:1;padding-right:24px}input.header-input::placeholder{opacity:.4}.loader{border:4px solid var(--bg3);border-top:4px solid var(--primary-color);border-radius:50%;width:36px;height:36px;margin:16px auto;animation:2s linear infinite spin}.expanded-endpoint-body{padding:6px 0;position:relative}.expanded-endpoint-body .tag-description{background:var(--code-bg);border-radius:var(--border-radius);transition:max-height .2s ease-out}.expanded-endpoint-body .tag-icon{transition:transform .2s ease-out}.expanded-endpoint-body .tag-icon.expanded{transform:rotate(180deg)}.divider{border-top:2px solid var(--border-color);width:100%;margin:24px 0}.tooltip{cursor:pointer;border:1px solid var(--border-color);border-left-width:4px;margin-left:2px}.tooltip a{color:var(--fg2);text-decoration:none}.tooltip-text{color:var(--fg2);z-index:1;background:var(--bg2);visibility:hidden;overflow-wrap:break-word;max-width:400px;position:absolute}.tooltip:hover{color:var(--primary-color);border-color:var(--primary-color)}.tooltip:hover a:hover{color:var(--primary-color)}.tooltip:hover .tooltip-text{visibility:visible}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.nav-method{font-weight:700;font-size:calc(var(--font-size-small) - 2px);white-space:nowrap;margin-right:4px}.nav-method.false{display:none}.nav-method.as-colored-text.get{color:var(--nav-get-color)}.nav-method.as-colored-text.put{color:var(--nav-put-color)}.nav-method.as-colored-text.post{color:var(--nav-post-color)}.nav-method.as-colored-text.delete{color:var(--nav-delete-color)}.nav-method.as-colored-text.head,.nav-method.as-colored-text.patch,.nav-method.as-colored-text.options{color:var(--nav-head-color)}.nav-method.as-colored-block{color:#000;border-radius:4px 0 0 4px;min-width:30px;padding:1px 4px}.colored-block .nav-method.as-colored-block{outline:1px solid}.nav-method.as-colored-block.get{background:var(--blue)}.nav-method.as-colored-block.put{background:var(--orange)}.nav-method.as-colored-block.post{background:var(--green)}.nav-method.as-colored-block.delete{background:var(--red)}.nav-method.as-colored-block.head,.nav-method.as-colored-block.patch,.nav-method.as-colored-block.options{background:var(--yellow)}@container (width>=768px){.nav-bar{width:260px;display:flex}#nav-bar-btn{display:none}#advanced-search-btn,.only-large-screen{display:block}.only-large-screen-flex{display:flex}.section-gap{padding:0 0 0 24px}.section-gap--focused-mode,.section-gap--read-mode{padding:24px 8px}.endpoint-body{padding:36px 0 48px;position:relative}}@container (width>=1024px){.nav-bar{width:${tr(this.fontSize==="default"?"300px":this.fontSize==="large"?"315px":"330px")};display:flex}#nav-bar-btn{display:none}#advanced-search-btn{display:block}.section-gap--focused-mode{padding:12px 80px}.section-gap--read-mode{padding:24px 80px 12px}}`,Ke]}connectedCallback(){super.connectedCallback();const e=this.parentElement;if(e&&(e.offsetWidth===0&&e.style.width===""&&(e.style.width="100vw"),e.offsetHeight===0&&e.style.height===""&&(e.style.height="100vh"),e.tagName==="BODY"&&(e.style.marginTop||(e.style.marginTop="0"),e.style.marginRight||(e.style.marginRight="0"),e.style.marginBottom||(e.style.marginBottom="0"),e.style.marginLeft||(e.style.marginLeft="0"))),this.loadFonts!=="false"){const t={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},a=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",t);t.weight="600";const r=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",t);a.load().then(s=>{document.fonts.add(s)}),r.load().then(s=>{document.fonts.add(s)})}(!this.layout||!"row, column,".includes(`${this.layout},`))&&(this.layout="row"),(!this.renderStyle||!"read, view, focused,".includes(`${this.renderStyle},`))&&(this.renderStyle="focused"),(!this.schemaStyle||!"tree, table,".includes(`${this.schemaStyle},`))&&(this.schemaStyle="tree"),(!this.theme||!"light, dark,".includes(`${this.theme},`))&&(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),!this.defaultSchemaTab||!"example, schema, model,".includes(`${this.defaultSchemaTab},`)?this.defaultSchemaTab="example":this.defaultSchemaTab==="model"&&(this.defaultSchemaTab="schema"),(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),(!this.schemaDescriptionExpanded||!"true, false,".includes(`${this.schemaDescriptionExpanded},`))&&(this.schemaDescriptionExpanded="false"),(!this.schemaHideReadOnly||!"default, never,".includes(`${this.schemaHideReadOnly},`))&&(this.schemaHideReadOnly="default"),(!this.schemaHideWriteOnly||!"default, never,".includes(`${this.schemaHideWriteOnly},`))&&(this.schemaHideWriteOnly="default"),(!this.fillRequestFieldsWithExample||!"true, false,".includes(`${this.fillRequestFieldsWithExample},`))&&(this.fillRequestFieldsWithExample="true"),(!this.persistAuth||!"true, false,".includes(`${this.persistAuth},`))&&(this.persistAuth="false"),this.responseAreaHeight||(this.responseAreaHeight="400px"),(!this.allowSearch||!"true, false,".includes(`${this.allowSearch},`))&&(this.allowSearch="true"),(!this.allowAdvancedSearch||!"true, false,".includes(`${this.allowAdvancedSearch},`))&&(this.allowAdvancedSearch="true"),(!this.allowTry||!"true, false,".includes(`${this.allowTry},`))&&(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),(!this.updateRoute||!"true, false,".includes(`${this.updateRoute},`))&&(this.updateRoute="true"),this.routePrefix||(this.routePrefix="#"),(!this.sortTags||!"true, false,".includes(`${this.sortTags},`))&&(this.sortTags="false"),(!this.sortSchemas||!"true, false,".includes(`${this.sortSchemas},`))&&(this.sortSchemas="false"),(!this.generateMissingTags||!"true, false,".includes(`${this.generateMissingTags},`))&&(this.generateMissingTags="false"),(!this.sortEndpointsBy||!"method, path, summary, none,".includes(`${this.sortEndpointsBy},`))&&(this.sortEndpointsBy="path"),(!this.onNavTagClick||!"expand-collapse, show-description,".includes(`${this.onNavTagClick},`))&&(this.onNavTagClick="expand-collapse"),(!this.navItemSpacing||!"compact, relaxed, default,".includes(`${this.navItemSpacing},`))&&(this.navItemSpacing="default"),(!this.showMethodInNavBar||!"false, as-plain-text, as-colored-text, as-colored-block,".includes(`${this.showMethodInNavBar},`))&&(this.showMethodInNavBar="false"),(!this.usePathInNavBar||!"true, false,".includes(`${this.usePathInNavBar},`))&&(this.usePathInNavBar="false"),(!this.navActiveItemMarker||!"left-bar, colored-block".includes(`${this.navActiveItemMarker},`))&&(this.navActiveItemMarker="left-bar"),(!this.fontSize||!"default, large, largest,".includes(`${this.fontSize},`))&&(this.fontSize="default"),(!this.showInfo||!"true, false,".includes(`${this.showInfo},`))&&(this.showInfo="true"),(!this.allowServerSelection||!"true, false,".includes(`${this.allowServerSelection},`))&&(this.allowServerSelection="true"),(!this.allowAuthentication||!"true, false,".includes(`${this.allowAuthentication},`))&&(this.allowAuthentication="true"),(!this.allowSchemaDescriptionExpandToggle||!"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`))&&(this.allowSchemaDescriptionExpandToggle="true"),(!this.showSideNav||!"true false".includes(this.showSideNav))&&(this.showSideNav="true"),(!this.showComponents||!"true false".includes(this.showComponents))&&(this.showComponents="false"),(!this.infoDescriptionHeadingsInNavBar||!"true, false,".includes(`${this.infoDescriptionHeadingsInNavBar},`))&&(this.infoDescriptionHeadingsInNavBar="false"),(!this.fetchCredentials||!"omit, same-origin, include,".includes(`${this.fetchCredentials},`))&&(this.fetchCredentials=""),(!this.scrollBehavior||!"smooth, auto,".includes(`${this.scrollBehavior},`))&&(this.scrollBehavior="auto"),(!this.matchType||!"includes regex".includes(this.matchType))&&(this.matchType="includes"),this.matchPaths||(this.matchPaths=""),this.removeEndpointsWithBadgeLabelAs||(this.removeEndpointsWithBadgeLabelAs=""),this.cssFile||(this.cssFile=null),this.cssClasses||(this.cssClasses=""),window.addEventListener("hashchange",()=>{this.scrollToPath(this.getElementIDFromURL())},!0)}disconnectedCallback(){this.intersectionObserver&&this.intersectionObserver.disconnect(),this.mockServer==="true"&&Bn(),super.disconnectedCallback()}infoDescriptionHeadingRenderer(){const e=new A.Renderer,t=new xt;return e.heading=(a,r,s)=>`<h${r} class="observe-me" id="${t.slug(s)}">${a}</h${r}>`,e}render(){const e=document.querySelector(`link[href*="${this.cssFile}"]`);return e&&this.shadowRoot.appendChild(e.cloneNode()),Bi.call(this)}updated(e){var t;(t=super.updated)==null||t.call(this,e),Xt(this.shadowRoot),e.has("mockServer")&&(this.mockServer==="true"&&this.resolvedSpec?Nn(this.resolvedSpec,{statusCode:this.mockServerStatusCode,statusStrategy:this.mockServerStatusStrategy,delay:this.mockServerDelay,log:this.mockServerLog}):this.mockServer!=="true"&&Bn()),(e.has("mockServerStatusCode")||e.has("mockServerStatusStrategy")||e.has("mockServerDelay")||e.has("mockServerLog"))&&fi({statusCode:this.mockServerStatusCode,statusStrategy:this.mockServerStatusStrategy,delay:this.mockServerDelay,log:this.mockServerLog})}observeExpandedContent(){this.shadowRoot.querySelectorAll(".observe-me").forEach(e=>{this.intersectionObserver.observe(e)})}attributeChangedCallback(e,t,a){if(e==="spec-url"&&t!==a&&window.setTimeout(async()=>{await this.loadSpec(a),this.gotoPath&&!window.location.hash&&this.scrollToPath(this.gotoPath)},0),(e==="match-paths"||e==="match-type"||e==="remove-endpoints-with-badge-label-as")&&t!==a&&window.setTimeout(async()=>{await this.loadSpec(this.specUrl)},0),e==="render-style"&&(a==="read"?window.setTimeout(()=>{this.observeExpandedContent()},100):this.intersectionObserver.disconnect()),e==="api-key-name"||e==="api-key-location"||e==="api-key-value"){let r=!1,s="",i="",o="";if(e==="api-key-name"?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(s=a,i=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),r=!0):e==="api-key-location"?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(i=a,s=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),r=!0):e==="api-key-value"&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=a,i=this.getAttribute("api-key-location"),s=this.getAttribute("api-key-name"),r=!0),r&&this.resolvedSpec){const l=this.resolvedSpec.securitySchemes.find(c=>c.securitySchemeId===Te);l?(l.name=s,l.in=i,l.value=o,l.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({securitySchemeId:Te,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:s,in:i,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,a)}onSpecUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}onSpecFileChange(e){this.setAttribute("spec-file",this.shadowRoot.getElementById("spec-file").value);const t=e.target.files[0],a=new FileReader;a.onload=()=>{try{const r=JSON.parse(a.result);this.loadSpec(r),this.shadowRoot.getElementById("spec-url").value=""}catch{}},a.readAsText(t)}onFileLoadClick(){this.shadowRoot.getElementById("spec-file").click()}onSearchChange(e){this.searchVal=e.target.value,this.resolvedSpec.tags.forEach(t=>t.paths.filter(a=>{this.searchVal&&St(this.searchVal,a,t.name)&&(t.expanded=!0)})),this.resolvedSpec.components.forEach(t=>t.subComponents.filter(a=>{a.expanded=!1,Cl(this.searchVal,a)&&(a.expanded=!0)})),this.requestUpdate()}onClearSearch(){const e=this.shadowRoot.getElementById("nav-bar-search");e.value="",this.searchVal="",this.resolvedSpec.components.forEach(t=>t.subComponents.filter(a=>{a.expanded=!0}))}onOpenNavBarToggle(){this.shadowRoot.getElementById("nav-bar").classList.toggle("floating-nav")}onShowAdvancedSearchClicked(){this.shadowRoot.getElementById("advanced-search-dialog").showModal()}onAdvancedSearchClose(){this.shadowRoot.getElementById("advanced-search-dialog").close()}async loadSpec(e){if(e){this.searchVal="";try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1;const t=await ii.call(this,e,this.generateMissingTags==="true",this.sortTags==="true",this.sortSchemas==="true",this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"),this.matchPaths,this.matchType,this.removeEndpointsWithBadgeLabelAs);this.loading=!1,this.afterSpecParsedAndValidated(t)}catch{this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null}}}async afterSpecParsedAndValidated(e){var t;for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find(s=>s.url===this.defaultApiServerUrl))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const a=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(a),this.mockServer==="true"&&Nn(this.resolvedSpec,{statusCode:this.mockServerStatusCode,statusStrategy:this.mockServerStatusStrategy,delay:this.mockServerDelay,log:this.mockServerLog}),this.intersectionObserver.disconnect(),this.renderStyle==="read"&&(await nn(100),this.observeExpandedContent()),this.isIntersectionObserverActive=!0;const r=this.getElementIDFromURL();if(r)this.renderStyle==="view"?this.expandAndGotoOperation(r,!0,!0):this.scrollToPath(r);else if(this.renderStyle==="focused"&&!this.gotoPath){const s=this.showInfo?"overview":(t=this.resolvedSpec.tags[0])==null?void 0:t.paths[0];this.scrollToPath(s)}}getComponentBaseURL(){const{href:e}=window.location,t=this.routePrefix.replace(/(#|\/)$/,"");if(!t)return e.split("#")[0];const a=e.lastIndexOf(t);return a===-1?e:e.slice(0,a)}getElementIDFromURL(){const e=this.getComponentBaseURL();return window.location.href.replace(e+this.routePrefix,"")}replaceHistoryState(e){const t=this.getComponentBaseURL();window.history.replaceState(null,null,`${t}${this.routePrefix||"#"}${e}`)}expandAndGotoOperation(e,t=!0){var a,r;if(!this.resolvedSpec)return;let s=!0;const i=e.indexOf("#")===-1?e:e.substring(1);if(i.startsWith("overview")||i==="servers"||i==="auth")s=!1;else for(let o=0;o<((a=this.resolvedSpec.tags)==null?void 0:a.length);o++){const l=this.resolvedSpec.tags[o],c=(r=l.paths)==null?void 0:r.find(d=>d.elementId===e);c&&(c.expanded&&l.expanded?s=!1:(c.expanded=!0,l.expanded=!0))}t&&(s&&this.requestUpdate(),window.setTimeout(()=>{const o=this.shadowRoot.getElementById(i);o&&(o.scrollIntoView({behavior:this.scrollBehavior,block:"start"}),this.updateRoute==="true"&&this.replaceHistoryState(i))},s?150:0))}isValidTopId(e){return e.startsWith("overview")||e==="servers"||e==="auth"}isValidPathId(e){var t,a,r,s;return e==="overview"&&this.showInfo||e==="servers"&&this.allowServerSelection||e==="auth"&&this.allowAuthentication?!0:e.startsWith("tag--")?(a=(t=this.resolvedSpec)==null?void 0:t.tags)==null?void 0:a.find(i=>i.elementId===e):(s=(r=this.resolvedSpec)==null?void 0:r.tags)==null?void 0:s.find(i=>i.paths.find(o=>o.elementId===e))}onIntersect(e){this.isIntersectionObserverActive!==!1&&e.forEach(t=>{if(t.isIntersecting&&t.intersectionRatio>0){const a=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active"),r=this.shadowRoot.getElementById(`link-${t.target.id}`);r&&(this.updateRoute==="true"&&this.replaceHistoryState(t.target.id),r.scrollIntoView({behavior:this.scrollBehavior,block:"center"}),r.classList.add("active"),r.part.add("section-navbar-active-item")),a&&a!==r&&(a.classList.remove("active"),a.part.remove("section-navbar-active-item"))}})}handleHref(e){if(e.target.tagName.toLowerCase()==="a"&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:this.scrollBehavior,block:"start"})}}async scrollToEventTarget(e,t=!0){if(!(e.type==="click"||e.type==="keyup"&&e.keyCode===13))return;const a=e.target;if(a.dataset.contentId){if(this.isIntersectionObserverActive=!1,this.renderStyle==="focused"){const r=this.shadowRoot.querySelector("api-request");r&&r.beforeNavigationFocusedMode()}this.scrollToPath(a.dataset.contentId,!0,t),setTimeout(()=>{this.isIntersectionObserverActive=!0},300)}}async scrollToPath(e,t=!0,a=!0){if(this.renderStyle==="focused"&&(this.focusedElementId=e,await nn(0)),this.renderStyle==="view")this.expandAndGotoOperation(e,t,!0);else{let r=!1;const s=this.shadowRoot.getElementById(e);if(s?(r=!0,s.scrollIntoView({behavior:this.scrollBehavior,block:"start"})):r=!1,r){if(this.renderStyle==="focused"){const o=this.shadowRoot.querySelector("api-request");o&&o.afterNavigationFocusedMode();const l=this.shadowRoot.querySelector("api-response");l&&l.resetSelection()}this.updateRoute==="true"&&this.replaceHistoryState(e);const i=this.shadowRoot.getElementById(`link-${e}`);if(i){a&&i.scrollIntoView({behavior:this.scrollBehavior,block:"center"}),await nn(0);const o=this.shadowRoot.querySelector(".nav-bar-tag.active, .nav-bar-path.active, .nav-bar-info.active, .nav-bar-h1.active, .nav-bar-h2.active, .operations.active");o&&(o.classList.remove("active"),o.part.remove("active"),o.part.remove("section-navbar-active-item")),i.classList.add("active"),i.part.add("section-navbar-active-item")}}}}setHttpUserNameAndPassword(e,t,a){return Ue.call(this,e,t,a)}setApiKey(e,t){return Ue.call(this,e,"","",t)}removeAllSecurityKeys(){return Ma.call(this)}setApiServer(e){return Ga.call(this,e)}onAdvancedSearch(e,t){const a=e.target;clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{let r;a.type==="text"?r=a:r=a.closest(".advanced-search-options").querySelector("input[type=text]");const s=[...a.closest(".advanced-search-options").querySelectorAll("input:checked")].map(i=>i.id);this.advancedSearchMatches=Fl(r.value,this.resolvedSpec.tags,s)},t)}}customElements.define("rapi-doc",Li);class _i extends ee{constructor(){super(),this.isMini=!0,this.updateRoute="false",this.renderStyle="view",this.showHeader="false",this.allowAdvancedSearch="false"}static get properties(){return{specUrl:{type:String,attribute:"spec-url"},sortEndpointsBy:{type:String,attribute:"sort-endpoints-by"},layout:{type:String},pathsExpanded:{type:String,attribute:"paths-expanded"},defaultSchemaTab:{type:String,attribute:"default-schema-tab"},responseAreaHeight:{type:String,attribute:"response-area-height"},showSummaryWhenCollapsed:{type:String,attribute:"show-summary-when-collapsed"},fillRequestFieldsWithExample:{type:String,attribute:"fill-request-fields-with-example"},persistAuth:{type:String,attribute:"persist-auth"},schemaStyle:{type:String,attribute:"schema-style"},schemaExpandLevel:{type:Number,attribute:"schema-expand-level"},schemaDescriptionExpanded:{type:String,attribute:"schema-description-expanded"},apiKeyName:{type:String,attribute:"api-key-name"},apiKeyLocation:{type:String,attribute:"api-key-location"},apiKeyValue:{type:String,attribute:"api-key-value"},defaultApiServerUrl:{type:String,attribute:"default-api-server"},serverUrl:{type:String,attribute:"server-url"},oauthReceiver:{type:String,attribute:"oauth-receiver"},mockServer:{type:String,attribute:"mock-server"},mockServerStatusCode:{type:String,attribute:"mock-server-status-code"},mockServerStatusStrategy:{type:String,attribute:"mock-server-status-strategy"},mockServerDelay:{type:Number,attribute:"mock-server-delay"},mockServerLog:{type:String,attribute:"mock-server-log"},allowTry:{type:String,attribute:"allow-try"},showCurlBeforeTry:{type:String,attribute:"show-curl-before-try"},theme:{type:String},bgColor:{type:String,attribute:"bg-color"},textColor:{type:String,attribute:"text-color"},primaryColor:{type:String,attribute:"primary-color"},fontSize:{type:String,attribute:"font-size"},regularFont:{type:String,attribute:"regular-font"},monoFont:{type:String,attribute:"mono-font"},loadFonts:{type:String,attribute:"load-fonts"},fetchCredentials:{type:String,attribute:"fetch-credentials"},matchPaths:{type:String,attribute:"match-paths"},matchType:{type:String,attribute:"match-type"},removeEndpointsWithBadgeLabelAs:{type:String,attribute:"remove-endpoints-with-badge-label-as"},loading:{type:Boolean}}}static get styles(){return[Fe,$t,Yt,Qt,Mr,ta,en,Hr,Wr,U`:host{all:initial;letter-spacing:normal;width:100%;min-width:360px;height:100%;color:var(--fg);background:var(--bg);font-family:var(--font-regular);flex-direction:column;margin:0;padding:0;display:flex;overflow:hidden;container-type:inline-size}@container (width>=768px){.only-large-screen{display:block}.only-large-screen-flex{display:flex}}`]}connectedCallback(){if(super.connectedCallback(),this.loadFonts!=="false"){const e={family:"Open Sans",style:"normal",weight:"300",unicodeRange:"U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD"},t=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UN_r8OUuhpKKSTjw.woff2) format('woff2')",e);e.weight="600";const a=new FontFace("Open Sans","url(https://fonts.gstatic.com/s/opensans/v18/mem5YaGs126MiZpBA-UNirkOUuhpKKSTjw.woff2) format('woff2')",e);t.load().then(r=>{document.fonts.add(r)}),a.load().then(r=>{document.fonts.add(r)})}(!this.showSummaryWhenCollapsed||!"true, false,".includes(`${this.showSummaryWhenCollapsed},`))&&(this.showSummaryWhenCollapsed="true"),(!this.layout||!"row, column,".includes(`${this.layout},`))&&(this.layout="row"),(!this.schemaStyle||!"tree, table,".includes(`${this.schemaStyle},`))&&(this.schemaStyle="tree"),(!this.theme||!"light, dark,".includes(`${this.theme},`))&&(this.theme=window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"),!this.defaultSchemaTab||!"example, schema, model,".includes(`${this.defaultSchemaTab},`)?this.defaultSchemaTab="example":this.defaultSchemaTab==="model"&&(this.defaultSchemaTab="schema"),this.pathsExpanded=this.pathsExpanded==="true",(!this.schemaExpandLevel||this.schemaExpandLevel<1)&&(this.schemaExpandLevel=99999),(!this.schemaDescriptionExpanded||!"true, false,".includes(`${this.schemaDescriptionExpanded},`))&&(this.schemaDescriptionExpanded="false"),(!this.fillRequestFieldsWithExample||!"true, false,".includes(`${this.fillRequestFieldsWithExample},`))&&(this.fillRequestFieldsWithExample="true"),(!this.persistAuth||!"true, false,".includes(`${this.persistAuth},`))&&(this.persistAuth="false"),this.responseAreaHeight||(this.responseAreaHeight="300px"),(!this.allowTry||!"true, false,".includes(`${this.allowTry},`))&&(this.allowTry="true"),this.apiKeyValue||(this.apiKeyValue="-"),this.apiKeyLocation||(this.apiKeyLocation="header"),this.apiKeyName||(this.apiKeyName=""),this.oauthReceiver||(this.oauthReceiver="oauth-receiver.html"),(!this.sortTags||!"true, false,".includes(`${this.sortTags},`))&&(this.sortTags="false"),(!this.sortEndpointsBy||!"method, path, summary,".includes(`${this.sortEndpointsBy},`))&&(this.sortEndpointsBy="path"),(!this.fontSize||!"default, large, largest,".includes(`${this.fontSize},`))&&(this.fontSize="default"),(!this.matchType||!"includes regex".includes(this.matchType))&&(this.matchType="includes"),this.matchPaths||(this.matchPaths=""),this.removeEndpointsWithBadgeLabelAs||(this.removeEndpointsWithBadgeLabelAs=""),(!this.allowSchemaDescriptionExpandToggle||!"true, false,".includes(`${this.allowSchemaDescriptionExpandToggle},`))&&(this.allowSchemaDescriptionExpandToggle="true"),(!this.fetchCredentials||!"omit, same-origin, include,".includes(`${this.fetchCredentials},`))&&(this.fetchCredentials="")}disconnectedCallback(){this.mockServer==="true"&&Bn(),super.disconnectedCallback()}render(){return Bi.call(this,!0,this.pathsExpanded)}updated(e){var t;(t=super.updated)==null||t.call(this,e),Xt(this.shadowRoot),e.has("mockServer")&&(this.mockServer==="true"&&this.resolvedSpec?Nn(this.resolvedSpec,{statusCode:this.mockServerStatusCode,statusStrategy:this.mockServerStatusStrategy,delay:this.mockServerDelay,log:this.mockServerLog}):this.mockServer!=="true"&&Bn()),(e.has("mockServerStatusCode")||e.has("mockServerStatusStrategy")||e.has("mockServerDelay")||e.has("mockServerLog"))&&fi({statusCode:this.mockServerStatusCode,statusStrategy:this.mockServerStatusStrategy,delay:this.mockServerDelay,log:this.mockServerLog})}attributeChangedCallback(e,t,a){if(e==="spec-url"&&t!==a&&window.setTimeout(async()=>{await this.loadSpec(a)},0),(e==="match-paths"||e==="match-type"||e==="remove-endpoints-with-badge-label-as")&&t!==a&&window.setTimeout(async()=>{await this.loadSpec(this.specUrl)},0),e==="api-key-name"||e==="api-key-location"||e==="api-key-value"){let r=!1,s="",i="",o="";if(e==="api-key-name"?this.getAttribute("api-key-location")&&this.getAttribute("api-key-value")&&(s=a,i=this.getAttribute("api-key-location"),o=this.getAttribute("api-key-value"),r=!0):e==="api-key-location"?this.getAttribute("api-key-name")&&this.getAttribute("api-key-value")&&(i=a,s=this.getAttribute("api-key-name"),o=this.getAttribute("api-key-value"),r=!0):e==="api-key-value"&&this.getAttribute("api-key-name")&&this.getAttribute("api-key-location")&&(o=a,i=this.getAttribute("api-key-location"),s=this.getAttribute("api-key-name"),r=!0),r&&this.resolvedSpec){const l=this.resolvedSpec.securitySchemes.find(c=>c.securitySchemeId===Te);l?(l.name=s,l.in=i,l.value=o,l.finalKeyValue=o):this.resolvedSpec.securitySchemes.push({apiKeyId:Te,description:"api-key provided in rapidoc element attributes",type:"apiKey",name:s,in:i,value:o,finalKeyValue:o}),this.requestUpdate()}}super.attributeChangedCallback(e,t,a)}onSpecUrlChange(){this.setAttribute("spec-url",this.shadowRoot.getElementById("spec-url").value)}async loadSpec(e){if(e)try{this.resolvedSpec={specLoadError:!1,isSpecLoading:!0,tags:[]},this.loading=!0,this.loadFailed=!1,this.requestUpdate();const t=await ii.call(this,e,this.generateMissingTags==="true",this.sortTags==="true",this.sortSchemas==="true",this.getAttribute("sort-endpoints-by"),this.getAttribute("api-key-name"),this.getAttribute("api-key-location"),this.getAttribute("api-key-value"),this.getAttribute("server-url"),this.matchPaths,this.matchType,this.removeEndpointsWithBadgeLabelAs);this.loading=!1,this.afterSpecParsedAndValidated(t)}catch{this.loading=!1,this.loadFailed=!0,this.resolvedSpec=null}}setHttpUserNameAndPassword(e,t,a){return Ue.call(this,e,t,a)}setApiKey(e,t){return Ue.call(this,e,"","",t)}removeAllSecurityKeys(){return Ma.call(this)}setApiServer(e){return Ga.call(this,e)}async afterSpecParsedAndValidated(e){for(this.resolvedSpec=e,this.selectedServer=void 0,this.defaultApiServerUrl&&(this.defaultApiServerUrl===this.serverUrl?this.selectedServer={url:this.serverUrl,computedUrl:this.serverUrl}:this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers.find(a=>a.url===this.defaultApiServerUrl))),this.selectedServer||this.resolvedSpec.servers&&(this.selectedServer=this.resolvedSpec.servers[0]),this.requestUpdate();!await this.updateComplete;);const t=new CustomEvent("spec-loaded",{detail:e});this.dispatchEvent(t),this.mockServer==="true"&&Nn(this.resolvedSpec,{statusCode:this.mockServerStatusCode,statusStrategy:this.mockServerStatusStrategy,delay:this.mockServerDelay,log:this.mockServerLog})}handleHref(e){if(e.target.tagName.toLowerCase()==="a"&&e.target.getAttribute("href").startsWith("#")){const t=this.shadowRoot.getElementById(e.target.getAttribute("href").replace("#",""));t&&t.scrollIntoView({behavior:"auto",block:"start"})}}}customElements.define("rapi-doc-mini",_i);class Ri extends HTMLElement{connectedCallback(){this.receiveAuthParms(),window.addEventListener("storage",e=>this.receiveStorage(e),!0)}receiveAuthParms(){let e={};if(document.location.search){const t=new URLSearchParams(document.location.search),a=t.get("code"),r=t.get("error"),s=t.get("state");e={code:a,error:r,state:s,responseType:"code"}}else if(window.location.hash){const t=this.parseQueryString(window.location.hash.substring(1),"token_type"),a=this.parseQueryString(window.location.hash.substring(1),"access_token");e={token_type:t,access_token:a,responseType:"token"}}if(window.opener){window.opener.postMessage(e,this.target);return}sessionStorage.setItem("rapidoc-oauth-data",JSON.stringify(e))}relayAuthParams(e){if(window.parent&&e.key==="rapidoc-oauth-data"){const t=JSON.parse(e.newValue);window.parent.postMessage(t,this.target)}}parseQueryString(e,t){const a=e.split("&");for(let r=0;r<a.length;r++){const s=a[r].split("=");if(decodeURIComponent(s[0])===t)return decodeURIComponent(s[1])}}}customElements.define("oauth-receiver",Ri);const rp={RapiDoc:Li};export{Ri as OAuthReceiver,_i as RapiDocMini,rp as default};
|