asyncapi-viewer 2.0.0 → 2.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.
Files changed (39) hide show
  1. package/README.md +13 -3
  2. package/dist/asyncapi-viewer.iife.js +22 -22
  3. package/dist/asyncapi-viewer.iife.js.map +1 -1
  4. package/dist/asyncapi-viewer.js +179 -132
  5. package/dist/asyncapi-viewer.js.map +1 -1
  6. package/dist/types/element.d.ts +33 -0
  7. package/dist/types/events.d.ts +99 -0
  8. package/dist/types/index.d.ts +12 -0
  9. package/dist/types/load/loader.d.ts +46 -0
  10. package/dist/types/load/refs.d.ts +62 -0
  11. package/dist/types/model/avro.d.ts +14 -0
  12. package/dist/types/model/context.d.ts +75 -0
  13. package/dist/types/model/invariants.d.ts +7 -0
  14. package/dist/types/model/normalize.d.ts +16 -0
  15. package/dist/types/model/schema.d.ts +16 -0
  16. package/dist/types/model/types.d.ts +324 -0
  17. package/dist/types/model/v2.d.ts +8 -0
  18. package/dist/types/model/v3.d.ts +8 -0
  19. package/dist/types/options.d.ts +56 -0
  20. package/dist/types/render/details.d.ts +23 -0
  21. package/dist/types/render/example.d.ts +36 -0
  22. package/dist/types/render/format.d.ts +2 -0
  23. package/dist/types/render/header.d.ts +19 -0
  24. package/dist/types/render/info.d.ts +4 -0
  25. package/dist/types/render/markdown.d.ts +4 -0
  26. package/dist/types/render/nav.d.ts +69 -0
  27. package/dist/types/render/operation.d.ts +18 -0
  28. package/dist/types/render/sections.d.ts +17 -0
  29. package/dist/types/render/sidebar.d.ts +30 -0
  30. package/dist/types/render/tag.d.ts +7 -0
  31. package/dist/types/render/tree.d.ts +36 -0
  32. package/dist/types/styles/base.d.ts +2 -0
  33. package/dist/types/styles/tokens.d.ts +7 -0
  34. package/dist/types/theme/theme.d.ts +26 -0
  35. package/dist/types/util/color.d.ts +22 -0
  36. package/dist/types/util/example.d.ts +8 -0
  37. package/package.json +12 -3
  38. package/types/react.d.ts +28 -0
  39. package/types/react.js +2 -0
@@ -12099,47 +12099,50 @@ var Ed = 0, Dd = class extends Ve {
12099
12099
  #n;
12100
12100
  #r;
12101
12101
  #i;
12102
- #a = [];
12103
- #o = "light";
12104
- #s = {};
12105
- #c = !1;
12106
- #l;
12107
- #u = /* @__PURE__ */ new Map();
12108
- #d = (e) => {
12109
- let t = this.#u.get(e);
12110
- return t || (t = new ku(() => this.requestUpdate()), this.#u.set(e, t)), t;
12102
+ #a;
12103
+ #o = [];
12104
+ #s;
12105
+ #c = [];
12106
+ #l = "light";
12107
+ #u = {};
12108
+ #d = !1;
12109
+ #f;
12110
+ #p = /* @__PURE__ */ new Map();
12111
+ #m = (e) => {
12112
+ let t = this.#p.get(e);
12113
+ return t || (t = new ku(() => this.requestUpdate()), this.#p.set(e, t)), t;
12111
12114
  };
12112
- #f = /* @__PURE__ */ new Map();
12113
- #p;
12114
- #m = "";
12115
- #h = /* @__PURE__ */ new Set();
12116
- #g = !1;
12117
- #_;
12118
- #v;
12115
+ #h = /* @__PURE__ */ new Map();
12116
+ #g;
12117
+ #_ = "";
12118
+ #v = /* @__PURE__ */ new Set();
12119
12119
  #y = !1;
12120
12120
  #b;
12121
- #x = "";
12122
- #S;
12121
+ #x;
12122
+ #S = !1;
12123
12123
  #C;
12124
- #w = /* @__PURE__ */ new Set();
12125
- #T = /* @__PURE__ */ new Map();
12126
- #E = (e) => {
12127
- let t = this.#T.get(e);
12124
+ #w = "";
12125
+ #T;
12126
+ #E;
12127
+ #D = /* @__PURE__ */ new Set();
12128
+ #O = /* @__PURE__ */ new Map();
12129
+ #k = (e) => {
12130
+ let t = this.#O.get(e);
12128
12131
  return t || (t = {
12129
12132
  tab: "payload",
12130
12133
  index: 0,
12131
12134
  open: void 0,
12132
12135
  copied: void 0
12133
- }, this.#T.set(e, t)), {
12136
+ }, this.#O.set(e, t)), {
12134
12137
  state: t,
12135
12138
  defaultOpen: this.#e.messageExamples,
12136
12139
  onChange: () => this.requestUpdate()
12137
12140
  };
12138
12141
  };
12139
- #D = () => {
12140
- this.#l = void 0, this.#R();
12142
+ #A = () => {
12143
+ this.#f = void 0, this.#V();
12141
12144
  };
12142
- #O = new vd(this, (e) => this.#B(e));
12145
+ #j = new vd(this, (e) => this.#U(e));
12143
12146
  get options() {
12144
12147
  return this.#e;
12145
12148
  }
@@ -12147,7 +12150,7 @@ var Ed = 0, Dd = class extends Ve {
12147
12150
  return this.#r;
12148
12151
  }
12149
12152
  get problems() {
12150
- return this.#a;
12153
+ return this.#c;
12151
12154
  }
12152
12155
  get model() {
12153
12156
  return this.#i;
@@ -12156,34 +12159,34 @@ var Ed = 0, Dd = class extends Ve {
12156
12159
  return this.id;
12157
12160
  }
12158
12161
  connectedCallback() {
12159
- super.connectedCallback(), this.id ||= `asyncapi-viewer-${++Ed}`, this.#z(), this.#t = new MutationObserver(() => this.#z()), this.#t.observe(this, { attributes: !0 }), this.#O.connect(), this.ownerDocument.defaultView?.addEventListener("hashchange", this.#D);
12162
+ super.connectedCallback(), this.id ||= `asyncapi-viewer-${++Ed}`, this.#H(), this.#t = new MutationObserver(() => this.#H()), this.#t.observe(this, { attributes: !0 }), this.#j.connect(), this.ownerDocument.defaultView?.addEventListener("hashchange", this.#A);
12160
12163
  }
12161
12164
  disconnectedCallback() {
12162
- this.#t?.disconnect(), this.#t = void 0, this.#O.disconnect(), this.#C?.disconnect(), this.#C = void 0, this.ownerDocument.defaultView?.removeEventListener("hashchange", this.#D), super.disconnectedCallback();
12165
+ this.#t?.disconnect(), this.#t = void 0, this.#j.disconnect(), this.#E?.disconnect(), this.#E = void 0, this.ownerDocument.defaultView?.removeEventListener("hashchange", this.#A), super.disconnectedCallback();
12163
12166
  }
12164
12167
  firstUpdated() {
12165
- this.#V();
12168
+ this.#W();
12166
12169
  for (let e of this.querySelectorAll(":scope > [data-asyncapi-fallback]")) e.remove();
12167
12170
  }
12168
12171
  updated() {
12169
- this.#R(), this.#M();
12172
+ this.#V(), this.#F();
12170
12173
  let e = this.renderRoot.querySelector(".layout");
12171
- e && (this.#_ === void 0 ? e.style.removeProperty("--_side-width") : e.style.setProperty("--_side-width", `${this.#_}px`));
12174
+ e && (this.#b === void 0 ? e.style.removeProperty("--_side-width") : e.style.setProperty("--_side-width", `${this.#b}px`));
12172
12175
  }
12173
- #k() {
12176
+ #M() {
12174
12177
  return {
12175
12178
  min: 220,
12176
12179
  max: Math.max(220, Math.min(560, Math.floor(this.getBoundingClientRect().width) - 600))
12177
12180
  };
12178
12181
  }
12179
- #A(e) {
12180
- let { min: t, max: n } = this.#k(), r = Math.round(Math.min(n, Math.max(t, e)));
12181
- r !== this.#_ && (this.#_ = r, this.requestUpdate());
12182
+ #N(e) {
12183
+ let { min: t, max: n } = this.#M(), r = Math.round(Math.min(n, Math.max(t, e)));
12184
+ r !== this.#b && (this.#b = r, this.requestUpdate());
12182
12185
  }
12183
- #j() {
12184
- let { min: e, max: t } = this.#k(), n = this.#_ ?? 292;
12186
+ #P() {
12187
+ let { min: e, max: t } = this.#M(), n = this.#b ?? 292;
12185
12188
  return C`<div
12186
- class="side__resize ${this.#v ? "side__resize--active" : ""}"
12189
+ class="side__resize ${this.#x ? "side__resize--active" : ""}"
12187
12190
  role="separator"
12188
12191
  aria-orientation="vertical"
12189
12192
  aria-label="Resize sidebar"
@@ -12193,73 +12196,73 @@ var Ed = 0, Dd = class extends Ve {
12193
12196
  tabindex="0"
12194
12197
  title="Drag to resize the sidebar; double-click to reset"
12195
12198
  @pointerdown=${(e) => {
12196
- e.button === 0 && (e.currentTarget.setPointerCapture(e.pointerId), this.#v = {
12199
+ e.button === 0 && (e.currentTarget.setPointerCapture(e.pointerId), this.#x = {
12197
12200
  x: e.clientX,
12198
12201
  width: n
12199
12202
  }, e.preventDefault(), this.requestUpdate());
12200
12203
  }}
12201
12204
  @pointermove=${(e) => {
12202
- this.#v && this.#A(this.#v.width + e.clientX - this.#v.x);
12205
+ this.#x && this.#N(this.#x.width + e.clientX - this.#x.x);
12203
12206
  }}
12204
12207
  @pointerup=${() => {
12205
- this.#v = void 0, this.requestUpdate();
12208
+ this.#x = void 0, this.requestUpdate();
12206
12209
  }}
12207
12210
  @pointercancel=${() => {
12208
- this.#v = void 0, this.requestUpdate();
12211
+ this.#x = void 0, this.requestUpdate();
12209
12212
  }}
12210
12213
  @dblclick=${() => {
12211
- this.#_ = void 0, this.requestUpdate();
12214
+ this.#b = void 0, this.requestUpdate();
12212
12215
  }}
12213
12216
  @keydown=${(r) => {
12214
- if (r.key === "ArrowLeft") this.#A(n - 16);
12215
- else if (r.key === "ArrowRight") this.#A(n + 16);
12216
- else if (r.key === "Home") this.#A(e);
12217
- else if (r.key === "End") this.#A(t);
12217
+ if (r.key === "ArrowLeft") this.#N(n - 16);
12218
+ else if (r.key === "ArrowRight") this.#N(n + 16);
12219
+ else if (r.key === "Home") this.#N(e);
12220
+ else if (r.key === "End") this.#N(t);
12218
12221
  else return;
12219
12222
  r.preventDefault();
12220
12223
  }}
12221
12224
  ></div>`;
12222
12225
  }
12223
- #M() {
12226
+ #F() {
12224
12227
  if (!this.#e.sidebar || !this.#i) {
12225
- this.#C?.disconnect(), this.#C = void 0;
12228
+ this.#E?.disconnect(), this.#E = void 0;
12226
12229
  return;
12227
12230
  }
12228
12231
  let e = [...this.renderRoot.querySelectorAll("section[aria-labelledby]:not(.ops), article.op")];
12229
- this.#C?.disconnect(), this.#w.clear(), this.#C = new IntersectionObserver((t) => {
12232
+ this.#E?.disconnect(), this.#D.clear(), this.#E = new IntersectionObserver((t) => {
12230
12233
  for (let e of t) {
12231
12234
  let t = e.target.id || e.target.getAttribute("aria-labelledby") || "";
12232
- e.isIntersecting ? this.#w.add(t) : this.#w.delete(t);
12235
+ e.isIntersecting ? this.#D.add(t) : this.#D.delete(t);
12233
12236
  }
12234
- let n = e.map((e) => e.id || e.getAttribute("aria-labelledby") || "").find((e) => this.#w.has(e));
12235
- n !== this.#b && (this.#b = n, this.requestUpdate());
12237
+ let n = e.map((e) => e.id || e.getAttribute("aria-labelledby") || "").find((e) => this.#D.has(e));
12238
+ n !== this.#C && (this.#C = n, this.requestUpdate());
12236
12239
  }, {
12237
12240
  rootMargin: "0px 0px -60% 0px",
12238
12241
  threshold: 0
12239
12242
  });
12240
- for (let t of e) this.#C.observe(t);
12243
+ for (let t of e) this.#E.observe(t);
12241
12244
  }
12242
- #N(e, t, n) {
12243
- this.#m = e, this.#P(t, n);
12245
+ #I(e, t, n) {
12246
+ this.#_ = e, this.#L(t, n);
12244
12247
  }
12245
- #P(e, t) {
12246
- clearTimeout(this.#S), this.#S = setTimeout(() => {
12247
- this.#x = this.#m.trim() === "" && this.#h.size === 0 ? "" : `${e} of ${t} operations shown`, this.requestUpdate();
12248
+ #L(e, t) {
12249
+ clearTimeout(this.#T), this.#T = setTimeout(() => {
12250
+ this.#w = this.#_.trim() === "" && this.#v.size === 0 ? "" : `${e} of ${t} operations shown`, this.requestUpdate();
12248
12251
  }, 300), this.requestUpdate();
12249
12252
  }
12250
- #F() {
12251
- this.#y = !0;
12253
+ #R() {
12254
+ this.#S = !0;
12252
12255
  let e = this.getBoundingClientRect().top;
12253
12256
  e > 0 && this.ownerDocument.defaultView?.scrollBy({
12254
12257
  top: e,
12255
12258
  behavior: "smooth"
12256
12259
  }), this.requestUpdate(), this.updateComplete.then(() => this.renderRoot.querySelector(".side__search")?.focus()).catch(() => void 0);
12257
12260
  }
12258
- #I(e = !1) {
12259
- this.#y && (this.#y = !1, this.requestUpdate(), e || this.updateComplete.then(() => this.renderRoot.querySelector(".menu")?.focus()).catch(() => void 0));
12261
+ #z(e = !1) {
12262
+ this.#S && (this.#S = !1, this.requestUpdate(), e || this.updateComplete.then(() => this.renderRoot.querySelector(".menu")?.focus()).catch(() => void 0));
12260
12263
  }
12261
- #L(e) {
12262
- if (e.key !== "Tab" || !this.#y) return;
12264
+ #B(e) {
12265
+ if (e.key !== "Tab" || !this.#S) return;
12263
12266
  let t = this.renderRoot.querySelector(".side__panel");
12264
12267
  if (!t) return;
12265
12268
  let n = [...t.querySelectorAll("a[href], button, input, select, [tabindex=\"0\"]")].filter((e) => !e.hasAttribute("disabled"));
@@ -12267,69 +12270,113 @@ var Ed = 0, Dd = class extends Ve {
12267
12270
  let r = n[0], i = n[n.length - 1], a = this.renderRoot.activeElement;
12268
12271
  e.shiftKey && a === r ? (i.focus(), e.preventDefault()) : !e.shiftKey && a === i && (r.focus(), e.preventDefault());
12269
12272
  }
12270
- #R() {
12273
+ #V() {
12271
12274
  let e = this.ownerDocument.defaultView?.location.hash ?? "";
12272
- if (!this.#i || e.length < 2 || e === this.#l) return;
12275
+ if (!this.#i || e.length < 2 || e === this.#f) return;
12273
12276
  let t = decodeURIComponent(e.slice(1));
12274
12277
  if (!t.startsWith(`${this.id}--`)) return;
12275
12278
  let n = this.renderRoot.getElementById(t) ?? this.renderRoot.getElementById(`${t}--heading`);
12276
- n && (this.#l = e, n instanceof HTMLDetailsElement && (n.open = !0), n.scrollIntoView({ block: "start" }), (n.querySelector("[tabindex=\"-1\"], summary") ?? n).focus({ preventScroll: !0 }));
12279
+ n && (this.#f = e, n instanceof HTMLDetailsElement && (n.open = !0), n.scrollIntoView({ block: "start" }), (n.querySelector("[tabindex=\"-1\"], summary") ?? n).focus({ preventScroll: !0 }));
12277
12280
  }
12278
- #z() {
12279
- this.#e = Ta(this.getAttributeNames().map((e) => [e, this.getAttribute(e)])), this.#O.mode = this.#e.theme, this.requestUpdate(), this.#H();
12281
+ #H() {
12282
+ this.#e = Ta(this.getAttributeNames().map((e) => [e, this.getAttribute(e)])), this.#j.mode = this.#e.theme, this.requestUpdate(), this.#i && this.#e.src === this.#n && this.#q() !== this.#s && this.#J(), this.#G();
12280
12283
  }
12281
- #B(e) {
12282
- this.#o = e, this.updateComplete.then(() => this.#V()).catch(() => void 0), this.requestUpdate();
12284
+ #U(e) {
12285
+ this.#l = e, this.updateComplete.then(() => this.#W()).catch(() => void 0), this.requestUpdate();
12283
12286
  }
12284
- #V() {
12287
+ #W() {
12285
12288
  let e = this.renderRoot, t = e?.querySelector(".probe");
12286
12289
  if (!t) return;
12287
- let n = (e) => (t.style.color = `var(${e})`, yd(getComputedStyle(t).color)), r = n("--_primary"), i = n("--_secondary"), a = n("--_send"), o = n("--_receive"), s = n("--_head"), c = this.#o === "dark", l = {};
12290
+ let n = (e) => (t.style.color = `var(${e})`, yd(getComputedStyle(t).color)), r = n("--_primary"), i = n("--_secondary"), a = n("--_send"), o = n("--_receive"), s = n("--_head"), c = this.#l === "dark", l = {};
12288
12291
  r && s && (l["--_primary-text"] = bd(wd(r, s, c))), i && s && (l["--_secondary-text"] = bd(wd(i, s, c))), a && (l["--_badge-ink-send"] = Cd(a)), o && (l["--_badge-ink-receive"] = Cd(o));
12289
12292
  let u = getComputedStyle(this).getPropertyValue("--_logo").trim(), d = u !== "" && u !== "none", f = e?.querySelector(".root");
12290
12293
  if (f) for (let [e, t] of Object.entries(l)) f.style.setProperty(e, t);
12291
- (d !== this.#c || JSON.stringify(l) !== JSON.stringify(this.#s)) && (this.#c = d, this.#s = l, this.requestUpdate());
12294
+ (d !== this.#d || JSON.stringify(l) !== JSON.stringify(this.#u)) && (this.#d = d, this.#u = l, this.requestUpdate());
12292
12295
  }
12293
- async #H() {
12296
+ async #G() {
12294
12297
  let e = this.#e.src;
12295
- if (e === this.#n || (this.#n = e, this.#r = void 0, this.#i = void 0, this.#a = [], this.#u.clear(), this.#T.clear(), this.#f.clear(), this.#m = "", this.#h = /* @__PURE__ */ new Set(), this.#g = !1, this.#y = !1, this.#b = void 0, this.#p && URL.revokeObjectURL(this.#p), this.#p = void 0, e === void 0)) return;
12298
+ if (e === this.#n || (this.#n = e, this.#r = void 0, this.#i = void 0, this.#a = void 0, this.#o = [], this.#c = [], this.#p.clear(), this.#O.clear(), this.#h.clear(), this.#_ = "", this.#v = /* @__PURE__ */ new Set(), this.#y = !1, this.#S = !1, this.#C = void 0, this.#g && URL.revokeObjectURL(this.#g), this.#g = void 0, e === void 0)) return;
12296
12299
  let t = await Ci(Si(e, this.ownerDocument.baseURI));
12297
12300
  if (this.#n === e) {
12298
12301
  if (this.#r = t, t.ok) {
12299
- this.#p = URL.createObjectURL(new Blob([t.text], { type: t.format === "json" ? "application/json" : "application/yaml" }));
12302
+ this.#g = URL.createObjectURL(new Blob([t.text], { type: t.format === "json" ? "application/json" : "application/yaml" }));
12300
12303
  let n = new Ai(t.url, t.data), r = await n.preload();
12301
12304
  if (this.#n !== e) return;
12302
- let i = this.#e;
12303
- this.#i = ma({
12304
- resolver: n,
12305
- data: t.data,
12306
- specVersion: t.specVersion,
12307
- specMajor: t.specMajor,
12308
- problems: r,
12309
- options: {
12310
- labels: {
12311
- publish: i.publishLabel,
12312
- subscribe: i.subscribeLabel,
12313
- send: i.sendLabel,
12314
- receive: i.receiveLabel,
12315
- request: i.requestLabel,
12316
- reply: i.replyLabel
12317
- },
12318
- useChannelAddressAsIdentifier: i.useChannelAddressAsIdentifier,
12319
- applyTraits: i.parserOptions.applyTraits
12320
- }
12321
- }), this.#a = this.#i.problems;
12305
+ this.#a = n, this.#o = r, this.#J();
12322
12306
  }
12323
- this.requestUpdate();
12307
+ this.requestUpdate(), await this.updateComplete, this.#n === e && this.#K(t);
12324
12308
  }
12325
12309
  }
12310
+ #K(e) {
12311
+ let t = {
12312
+ bubbles: !0,
12313
+ composed: !0
12314
+ };
12315
+ if (!e.ok) this.dispatchEvent(new CustomEvent("asyncapi-error", {
12316
+ ...t,
12317
+ detail: {
12318
+ url: e.url,
12319
+ error: e.error
12320
+ }
12321
+ }));
12322
+ else if (this.#i) {
12323
+ let n = {
12324
+ url: e.url,
12325
+ specVersion: e.specVersion,
12326
+ specMajor: e.specMajor,
12327
+ model: this.#i,
12328
+ problems: this.#c
12329
+ };
12330
+ this.dispatchEvent(new CustomEvent("asyncapi-load", {
12331
+ ...t,
12332
+ detail: n
12333
+ }));
12334
+ }
12335
+ }
12336
+ #q() {
12337
+ let e = this.#e;
12338
+ return JSON.stringify([
12339
+ e.publishLabel,
12340
+ e.subscribeLabel,
12341
+ e.sendLabel,
12342
+ e.receiveLabel,
12343
+ e.requestLabel,
12344
+ e.replyLabel,
12345
+ e.useChannelAddressAsIdentifier,
12346
+ e.parserOptions.applyTraits
12347
+ ]);
12348
+ }
12349
+ #J() {
12350
+ let e = this.#r;
12351
+ if (!e?.ok || !this.#a) return;
12352
+ let t = this.#e;
12353
+ this.#s = this.#q(), this.#i = ma({
12354
+ resolver: this.#a,
12355
+ data: e.data,
12356
+ specVersion: e.specVersion,
12357
+ specMajor: e.specMajor,
12358
+ problems: [...this.#o],
12359
+ options: {
12360
+ labels: {
12361
+ publish: t.publishLabel,
12362
+ subscribe: t.subscribeLabel,
12363
+ send: t.sendLabel,
12364
+ receive: t.receiveLabel,
12365
+ request: t.requestLabel,
12366
+ reply: t.replyLabel
12367
+ },
12368
+ useChannelAddressAsIdentifier: t.useChannelAddressAsIdentifier,
12369
+ applyTraits: t.parserOptions.applyTraits
12370
+ }
12371
+ }), this.#c = this.#i.problems;
12372
+ }
12326
12373
  render() {
12327
12374
  return C`<div class="root">
12328
12375
  <span class="probe visually-hidden" aria-hidden="true"></span>
12329
- ${this.#U()}
12376
+ ${this.#Y()}
12330
12377
  </div>`;
12331
12378
  }
12332
- #U() {
12379
+ #Y() {
12333
12380
  let e = this.#e.src;
12334
12381
  if (e === void 0) return C`<div class="content"><p class="alert" role="alert">This viewer has no <code>src</code> attribute, so there is nothing to show.</p></div>`;
12335
12382
  let t = this.#r;
@@ -12341,8 +12388,8 @@ var Ed = 0, Dd = class extends Ve {
12341
12388
  if (!n) return C`<div class="content"><p class="summary">Preparing ${e}…</p></div>`;
12342
12389
  let r = this.#e, i = n.operations, a = {
12343
12390
  prefix: this.id,
12344
- tree: this.#d,
12345
- example: this.#E
12391
+ tree: this.#m,
12392
+ example: this.#k
12346
12393
  }, o = r.sidebar ? Xu(n, i, this.id, {
12347
12394
  info: r.info,
12348
12395
  servers: r.servers,
@@ -12350,24 +12397,24 @@ var Ed = 0, Dd = class extends Ve {
12350
12397
  schemas: r.schemas,
12351
12398
  showServers: r.showServers,
12352
12399
  showOperations: r.showOperations
12353
- }) : [], s = ed(o, this.#m, r.searchKeepSections, this.#h), c = (e, t) => ed(o, e, r.searchKeepSections, t).shown, l = r.sidebar ? C`<button
12400
+ }) : [], s = ed(o, this.#_, r.searchKeepSections, this.#v), c = (e, t) => ed(o, e, r.searchKeepSections, t).shown, l = r.sidebar ? C`<button
12354
12401
  class="menu"
12355
12402
  type="button"
12356
12403
  aria-label="Open navigation"
12357
- aria-expanded=${this.#y ? "true" : "false"}
12404
+ aria-expanded=${this.#S ? "true" : "false"}
12358
12405
  aria-controls="${this.id}--sidebar"
12359
- @click=${() => this.#y ? this.#I() : this.#F()}
12406
+ @click=${() => this.#S ? this.#z() : this.#R()}
12360
12407
  >
12361
12408
  ${hd}
12362
12409
  </button>` : w, u = C`
12363
12410
  ${Ma({
12364
12411
  doc: n,
12365
12412
  src: t.url,
12366
- downloadHref: this.#p,
12367
- hasLogo: this.#c,
12413
+ downloadHref: this.#g,
12414
+ hasLogo: this.#d,
12368
12415
  themeToggle: r.themeToggle,
12369
- resolvedTheme: this.#o,
12370
- onToggleTheme: () => this.#O.toggle(),
12416
+ resolvedTheme: this.#l,
12417
+ onToggleTheme: () => this.#j.toggle(),
12371
12418
  menu: l
12372
12419
  })}
12373
12420
  <div class="content">
@@ -12375,50 +12422,50 @@ var Ed = 0, Dd = class extends Ve {
12375
12422
  ${r.servers ? ad(n, this.id) : w}
12376
12423
  ${r.operations ? Yu(n, {
12377
12424
  ...a,
12378
- messageIndex: (e) => this.#f.get(e) ?? 0,
12425
+ messageIndex: (e) => this.#h.get(e) ?? 0,
12379
12426
  selectMessage: (e, t) => {
12380
- this.#f.set(e, t), this.requestUpdate();
12427
+ this.#h.set(e, t), this.requestUpdate();
12381
12428
  }
12382
12429
  }) : w}
12383
12430
  ${r.messages ? sd(n, a, r.showMessageExamples) : w}
12384
12431
  ${r.schemas ? cd(n, a) : w}
12385
- ${r.errors ? ld(this.#a, this.id) : w}
12432
+ ${r.errors ? ld(this.#c, this.id) : w}
12386
12433
  </div>
12387
12434
  `;
12388
12435
  return r.sidebar ? C`<div
12389
- class="layout layout--sidebar ${this.#y ? "layout--open" : ""} ${this.#v ? "layout--resizing" : ""}"
12436
+ class="layout layout--sidebar ${this.#S ? "layout--open" : ""} ${this.#x ? "layout--resizing" : ""}"
12390
12437
  @keydown=${(e) => {
12391
- e.key === "Escape" && this.#y && !e.target.classList?.contains("side__search") && (this.#I(), e.preventDefault()), this.#L(e);
12438
+ e.key === "Escape" && this.#S && !e.target.classList?.contains("side__search") && (this.#z(), e.preventDefault()), this.#B(e);
12392
12439
  }}
12393
12440
  >
12394
12441
  ${fd({
12395
12442
  items: o,
12396
12443
  tags: Qu(n, i),
12397
- selectedTags: this.#h,
12398
- tagsOpen: this.#g,
12444
+ selectedTags: this.#v,
12445
+ tagsOpen: this.#y,
12399
12446
  onTagsToggle: (e) => {
12400
- this.#g = e, this.requestUpdate();
12447
+ this.#y = e, this.requestUpdate();
12401
12448
  },
12402
12449
  onToggleTag: (e) => {
12403
- let t = new Set(this.#h);
12404
- t.has(e) ? t.delete(e) : t.add(e), this.#h = t, this.#P(c(this.#m, t), s.total);
12450
+ let t = new Set(this.#v);
12451
+ t.has(e) ? t.delete(e) : t.add(e), this.#v = t, this.#L(c(this.#_, t), s.total);
12405
12452
  },
12406
12453
  onClearTags: () => {
12407
- this.#h = /* @__PURE__ */ new Set(), this.#P(c(this.#m, this.#h), s.total);
12454
+ this.#v = /* @__PURE__ */ new Set(), this.#L(c(this.#_, this.#v), s.total);
12408
12455
  },
12409
- query: this.#m,
12456
+ query: this.#_,
12410
12457
  keepSections: r.searchKeepSections,
12411
- current: this.#b,
12412
- open: this.#y,
12413
- liveText: this.#x,
12414
- onQuery: (e) => this.#N(e, c(e, this.#h), s.total),
12415
- onEscape: () => this.#I(),
12416
- onChoose: () => this.#I(!0),
12417
- onClose: () => this.#I(),
12458
+ current: this.#C,
12459
+ open: this.#S,
12460
+ liveText: this.#w,
12461
+ onQuery: (e) => this.#I(e, c(e, this.#v), s.total),
12462
+ onEscape: () => this.#z(),
12463
+ onChoose: () => this.#z(!0),
12464
+ onClose: () => this.#z(),
12418
12465
  id: this.id
12419
12466
  })}
12420
- ${this.#j()}
12421
- <div class="main" ?inert=${this.#y}>${u}</div>
12467
+ ${this.#P()}
12468
+ <div class="main" ?inert=${this.#S}>${u}</div>
12422
12469
  </div>` : C`<div class="layout"><div class="main">${u}</div></div>`;
12423
12470
  }
12424
12471
  };