@scalar/api-reference 1.24.42 → 1.24.43

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAojBA,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAggBjB,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
1
+ {"version":3,"file":"ApiReferenceLayout.vue.d.ts","sourceRoot":"","sources":["../../src/components/ApiReferenceLayout.vue"],"names":[],"mappings":"AAsjBA,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EACnB,MAAM,UAAU,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkgBjB,wBAAwG;AAOxG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACpC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC;AAEN,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,GAAG,KAAK,GAAG,CAAC,CAAC;AAC5D,KAAK,uBAAuB,CAAC,CAAC,IAAI;KAChC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,SAAS,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,GACpC;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;KAAE,GAC9D;QAAE,IAAI,EAAE,OAAO,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QAAC,QAAQ,EAAE,IAAI,CAAA;KAAE;CACzD,CAAC"}
@@ -2,7 +2,7 @@ import o from "./ApiReferenceLayout.vue2.js";
2
2
  /* empty css */
3
3
  /* empty css */
4
4
  import e from "../_virtual/_plugin-vue_export-helper.js";
5
- const m = /* @__PURE__ */ e(o, [["__scopeId", "data-v-be93deac"]]);
5
+ const a = /* @__PURE__ */ e(o, [["__scopeId", "data-v-cb23ee71"]]);
6
6
  export {
7
- m as default
7
+ a as default
8
8
  };
@@ -1,29 +1,29 @@
1
- import { defineComponent as J, ref as h, onMounted as D, onBeforeMount as F, computed as b, watch as X, onServerPrefetch as Z, useSSRContext as _, getCurrentInstance as x, provide as M, openBlock as v, createElementBlock as S, Fragment as O, createElementVNode as i, normalizeClass as ee, unref as u, normalizeStyle as oe, renderSlot as l, normalizeProps as d, guardReactiveProps as c, createVNode as f, withCtx as m, createCommentVNode as w, withDirectives as te, vShow as re, createSlots as ae } from "vue";
2
- import { provideUseId as ne } from "@headlessui/vue";
3
- import { addScalarClassesToHeadless as se } from "@scalar/components";
1
+ import { defineComponent as X, ref as h, onMounted as B, onBeforeMount as D, computed as b, watch as Z, onServerPrefetch as _, useSSRContext as x, getCurrentInstance as ee, provide as F, openBlock as v, createElementBlock as S, Fragment as M, createElementVNode as i, normalizeClass as oe, unref as u, normalizeStyle as te, renderSlot as l, normalizeProps as d, guardReactiveProps as c, createVNode as f, withCtx as m, createCommentVNode as w, withDirectives as re, vShow as ae, createSlots as ne } from "vue";
2
+ import { provideUseId as se } from "@headlessui/vue";
3
+ import { addScalarClassesToHeadless as ie } from "@scalar/components";
4
4
  import { defaultStateFactory as P } from "@scalar/oas-utils/helpers";
5
- import { getThemeStyles as ie } from "@scalar/themes";
6
- import { useToasts as le, ScalarToasts as de } from "@scalar/use-toasts";
7
- import { useMediaQuery as ce, useResizeObserver as ue, useDebounceFn as pe } from "@vueuse/core";
8
- import fe from "./ApiClientModal.vue.js";
5
+ import { getThemeStyles as le } from "@scalar/themes";
6
+ import { useToasts as de, ScalarToasts as ce } from "@scalar/use-toasts";
7
+ import { useMediaQuery as ue, useResizeObserver as pe, useDebounceFn as fe } from "@vueuse/core";
8
+ import me from "./ApiClientModal.vue.js";
9
9
  /* empty css */
10
- import me from "./GettingStarted.vue.js";
11
- import { downloadSpecBus as ge, downloadSpecFile as ve } from "../helpers/specDownloads.js";
12
- import { useDeprecationWarnings as Se } from "../hooks/useDeprecationWarnings.js";
13
- import he from "./Sidebar/Sidebar.vue.js";
14
- import be from "./Content/Content.vue.js";
15
- import { GLOBAL_SECURITY_SYMBOL as we, HIDE_DOWNLOAD_BUTTON_SYMBOL as ye } from "../helpers/provideSymbols.js";
16
- import { useSidebar as Te } from "../hooks/useSidebar.js";
17
- import { useNavState as Re } from "../hooks/useNavState.js";
18
- import { scrollToId as $e } from "../helpers/scrollToId.js";
19
- import { sleep as Ce } from "../helpers/sleep.js";
20
- const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
10
+ import ge from "./GettingStarted.vue.js";
11
+ import { downloadSpecBus as ve, downloadSpecFile as Se } from "../helpers/specDownloads.js";
12
+ import { useDeprecationWarnings as he } from "../hooks/useDeprecationWarnings.js";
13
+ import be from "./Sidebar/Sidebar.vue.js";
14
+ import we from "./Content/Content.vue.js";
15
+ import { GLOBAL_SECURITY_SYMBOL as ye, HIDE_DOWNLOAD_BUTTON_SYMBOL as Te } from "../helpers/provideSymbols.js";
16
+ import { useSidebar as Re } from "../hooks/useSidebar.js";
17
+ import { useNavState as $e } from "../hooks/useNavState.js";
18
+ import { scrollToId as Ce } from "../helpers/scrollToId.js";
19
+ import { sleep as Ie } from "../helpers/sleep.js";
20
+ const Le = ["innerHTML"], Ee = { class: "references-header" }, ke = {
21
21
  key: 0,
22
22
  class: "references-navigation t-doc__sidebar"
23
- }, ke = { class: "references-navigation-list" }, Be = { class: "references-editor" }, De = { class: "references-editor-textarea" }, Fe = { class: "references-rendered" }, Me = {
23
+ }, Oe = { class: "references-navigation-list" }, Be = { class: "references-editor" }, De = { class: "references-editor-textarea" }, Fe = { class: "references-rendered" }, Me = {
24
24
  key: 0,
25
25
  class: "references-footer"
26
- }, xe = /* @__PURE__ */ J({
26
+ }, eo = /* @__PURE__ */ X({
27
27
  inheritAttrs: !1,
28
28
  __name: "ApiReferenceLayout",
29
29
  props: {
@@ -33,19 +33,19 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
33
33
  },
34
34
  emits: ["changeTheme", "updateContent", "loadSwaggerFile", "linkSwaggerFile", "toggleDarkMode"],
35
35
  setup(U) {
36
- const t = U, { initializeToasts: A, toast: H } = le();
36
+ const t = U, { initializeToasts: A, toast: H } = de();
37
37
  A((e) => H(e));
38
- const N = ce("(min-width: 1150px)"), z = h("100dvh"), p = h(null);
39
- ue(p, (e) => {
38
+ const N = ue("(min-width: 1150px)"), z = h("100dvh"), p = h(null);
39
+ pe(p, (e) => {
40
40
  z.value = e[0].contentRect.height + "px";
41
41
  });
42
42
  const y = h(0);
43
- D(() => {
43
+ B(() => {
44
44
  var a, r, n;
45
45
  const e = (r = (a = p.value) == null ? void 0 : a.parentElement) == null ? void 0 : r.getBoundingClientRect(), o = (n = p.value) == null ? void 0 : n.getBoundingClientRect();
46
46
  if (e && o) {
47
- const B = o.top - e.top;
48
- y.value = B < 2 ? 0 : B;
47
+ const O = o.top - e.top;
48
+ y.value = O < 2 ? 0 : O;
49
49
  }
50
50
  });
51
51
  const {
@@ -54,29 +54,30 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
54
54
  isSidebarOpen: V,
55
55
  setCollapsedSidebarItem: T,
56
56
  hideModels: G,
57
- setParsedSpec: W
58
- } = Te(), {
57
+ defaultOpenAllTags: W,
58
+ setParsedSpec: j
59
+ } = Re(), {
59
60
  getPathRoutingId: R,
60
- getSectionId: j,
61
- getTagId: K,
61
+ getSectionId: K,
62
+ getTagId: Q,
62
63
  hash: $,
63
64
  isIntersectionEnabled: C,
64
65
  pathRouting: I,
65
66
  updateHash: L
66
- } = Re();
67
- I.value = t.configuration.pathRouting, F(() => L());
67
+ } = $e();
68
+ I.value = t.configuration.pathRouting, D(() => L());
68
69
  const E = async (e) => {
69
70
  var o;
70
- C.value = !1, L(), e ? $e(e) : (o = p.value) == null || o.scrollTo(0, 0), await Ce(100), C.value = !0;
71
+ C.value = !1, L(), e ? Ce(e) : (o = p.value) == null || o.scrollTo(0, 0), await Ie(100), C.value = !0;
71
72
  };
72
- F(() => se()), D(() => {
73
- ge.on(({ specTitle: e }) => {
74
- ve(t.rawSpec, e);
73
+ D(() => ie()), B(() => {
74
+ ve.on(({ specTitle: e }) => {
75
+ Se(t.rawSpec, e);
75
76
  }), window.onhashchange = () => E(decodeURIComponent(window.location.hash.replace(/^#/, ""))), window.onpopstate = () => I.value && E(R(window.location.pathname));
76
77
  });
77
- const Q = b(
78
+ const q = b(
78
79
  () => N.value || !t.configuration.isEditable
79
- ), k = pe((e) => {
80
+ ), k = fe((e) => {
80
81
  if ((e.target.scrollTop ?? 0) < 50) {
81
82
  const a = t.configuration.pathRouting ? t.configuration.pathRouting.basePath : window.location.pathname;
82
83
  window.history.replaceState({}, "", a + window.location.search), $.value = "";
@@ -85,46 +86,46 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
85
86
  breadcrumb: Y.value,
86
87
  spec: t.parsedSpec
87
88
  }));
88
- X(() => t.parsedSpec, W, { deep: !0 }), Z(() => {
89
+ Z(() => t.parsedSpec, j, { deep: !0 }), _(() => {
89
90
  var o, a;
90
- const e = _();
91
+ const e = x();
91
92
  if (e && (e.payload || (e.payload = { data: P() }), (o = e.payload).data || (o.data = P()), t.configuration.pathRouting)) {
92
93
  const r = R(e.url);
93
94
  $.value = r, e.payload.data.hash = r;
94
95
  for (const n in g)
95
96
  Object.hasOwn(g, n) && delete g[n];
96
97
  if (r)
97
- T(j(r), !0);
98
+ T(K(r), !0);
98
99
  else {
99
100
  const n = (a = t.parsedSpec.tags) == null ? void 0 : a[0];
100
- n && T(K(n), !0);
101
+ n && T(Q(n), !0);
101
102
  }
102
103
  e.payload.data["useSidebarContent-collapsedSidebarItems"] = g;
103
104
  }
104
- }), ne(() => {
105
+ }), se(() => {
105
106
  var r;
106
- const e = x(), o = "scalar-instance-id";
107
+ const e = ee(), o = "scalar-instance-id";
107
108
  if (!e) return o;
108
109
  let a = e.uid;
109
110
  return typeof window > "u" ? (e.attrs || (e.attrs = {}), e.attrs[o] = a) : (r = e.vnode.el) != null && r.getAttribute && (a = e.vnode.el.getAttribute(o)), `${o}-${a}`;
110
- }), M(we, () => t.parsedSpec.security), M(
111
- ye,
111
+ }), F(ye, () => t.parsedSpec.security), F(
112
+ Te,
112
113
  () => t.configuration.hideDownloadButton
113
- ), G.value = t.configuration.hideModels ?? !1, Se(t.configuration);
114
- const q = b(
114
+ ), G.value = t.configuration.hideModels ?? !1, W.value = t.configuration.defaultOpenAllTags ?? !1, he(t.configuration);
115
+ const J = b(
115
116
  () => `<style>
116
- ${ie(t.configuration.theme, {
117
+ ${le(t.configuration.theme, {
117
118
  fonts: t.configuration.withDefaultFonts
118
119
  })}</style>`
119
120
  );
120
121
  return (e, o) => {
121
122
  var a;
122
- return v(), S(O, null, [
123
- i("div", { innerHTML: q.value }, null, 8, Ie),
123
+ return v(), S(M, null, [
124
+ i("div", { innerHTML: J.value }, null, 8, Le),
124
125
  i("div", {
125
126
  ref_key: "documentEl",
126
127
  ref: p,
127
- class: ee(["scalar-app scalar-api-reference references-layout", [
128
+ class: oe(["scalar-app scalar-api-reference references-layout", [
128
129
  {
129
130
  "references-editable": e.configuration.isEditable,
130
131
  "references-sidebar": e.configuration.showSidebar,
@@ -133,18 +134,18 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
133
134
  },
134
135
  e.$attrs.class
135
136
  ]]),
136
- style: oe({
137
+ style: te({
137
138
  "--scalar-y-offset": `var(--scalar-custom-header-height, ${y.value}px)`
138
139
  }),
139
140
  onScrollPassive: o[4] || (o[4] = //@ts-ignore
140
141
  (...r) => u(k) && u(k)(...r))
141
142
  }, [
142
- i("div", Le, [
143
+ i("div", Ee, [
143
144
  l(e.$slots, "header", d(c(s.value)), void 0, !0)
144
145
  ]),
145
- e.configuration.showSidebar ? (v(), S("aside", Ee, [
146
- i("div", ke, [
147
- f(u(he), { parsedSpec: e.parsedSpec }, {
146
+ e.configuration.showSidebar ? (v(), S("aside", ke, [
147
+ i("div", Oe, [
148
+ f(u(be), { parsedSpec: e.parsedSpec }, {
148
149
  "sidebar-start": m(() => [
149
150
  l(e.$slots, "sidebar-start", d(c(s.value)), void 0, !0)
150
151
  ]),
@@ -155,22 +156,22 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
155
156
  }, 8, ["parsedSpec"])
156
157
  ])
157
158
  ])) : w("", !0),
158
- te(i("div", Be, [
159
+ re(i("div", Be, [
159
160
  i("div", De, [
160
161
  l(e.$slots, "editor", d(c(s.value)), void 0, !0)
161
162
  ])
162
163
  ], 512), [
163
- [re, e.configuration.isEditable]
164
+ [ae, e.configuration.isEditable]
164
165
  ]),
165
- Q.value ? (v(), S(O, { key: 1 }, [
166
+ q.value ? (v(), S(M, { key: 1 }, [
166
167
  i("div", Fe, [
167
- f(u(be), {
168
+ f(u(we), {
168
169
  baseServerURL: e.configuration.baseServerURL,
169
170
  layout: e.configuration.layout === "classic" ? "accordion" : "default",
170
171
  parsedSpec: e.parsedSpec,
171
172
  proxy: e.configuration.proxy,
172
173
  servers: e.configuration.servers
173
- }, ae({
174
+ }, ne({
174
175
  start: m(() => [
175
176
  l(e.$slots, "content-start", d(c(s.value)), void 0, !0)
176
177
  ]),
@@ -184,7 +185,7 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
184
185
  fn: m(() => {
185
186
  var r;
186
187
  return [
187
- f(me, {
188
+ f(ge, {
188
189
  theme: ((r = e.configuration) == null ? void 0 : r.theme) || "default",
189
190
  onChangeTheme: o[0] || (o[0] = (n) => e.$emit("changeTheme", n)),
190
191
  onLinkSwaggerFile: o[1] || (o[1] = (n) => e.$emit("linkSwaggerFile")),
@@ -201,16 +202,16 @@ const Ie = ["innerHTML"], Le = { class: "references-header" }, Ee = {
201
202
  l(e.$slots, "footer", d(c(s.value)), void 0, !0)
202
203
  ])) : w("", !0)
203
204
  ], 64)) : w("", !0),
204
- f(fe, {
205
+ f(me, {
205
206
  proxyUrl: e.configuration.proxy,
206
207
  spec: e.configuration.spec
207
208
  }, null, 8, ["proxyUrl", "spec"])
208
209
  ], 38),
209
- f(u(de))
210
+ f(u(ce))
210
211
  ], 64);
211
212
  };
212
213
  }
213
214
  });
214
215
  export {
215
- xe as default
216
+ eo as default
216
217
  };
@@ -31,6 +31,7 @@ export declare function useSidebar(options?: {
31
31
  setCollapsedSidebarItem: typeof setCollapsedSidebarItem;
32
32
  hideModels: import("vue").Ref<boolean>;
33
33
  setParsedSpec: typeof setParsedSpec;
34
+ defaultOpenAllTags: import("vue").Ref<boolean>;
34
35
  };
35
36
  export {};
36
37
  //# sourceMappingURL=useSidebar.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAA6B,MAAM,mBAAmB,CAAA;AAexE,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAeD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAEhC;AAKD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAMpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AAkOD;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE;;;;;;;;;;;;EA2CxD"}
1
+ {"version":3,"file":"useSidebar.d.ts","sourceRoot":"","sources":["../../src/hooks/useSidebar.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAA6B,MAAM,mBAAmB,CAAA;AAexE,MAAM,MAAM,YAAY,GAAG;IACzB,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAA;IACzB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAA;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;IACb,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,CAAA;AAeD,iBAAS,aAAa,CAAC,IAAI,EAAE,IAAI,QAEhC;AAMD,KAAK,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAMpD,iBAAS,0BAA0B,CAAC,GAAG,EAAE,MAAM,QAE9C;AAED,iBAAS,uBAAuB,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,QAE3D;AA2OD;;GAEG;AACH,wBAAgB,UAAU,CAAC,OAAO,CAAC,EAAE;IAAE,UAAU,EAAE,IAAI,CAAA;CAAE;;;;;;;;;;;;;EA4CxD"}
@@ -1,91 +1,91 @@
1
- import { ssrState as Q } from "@scalar/oas-utils/helpers";
2
- import { ref as g, reactive as R, computed as P, watch as L } from "vue";
3
- import { useNavState as U } from "./useNavState.js";
4
- import { getLowestHeadingLevel as q } from "../helpers/getLowestHeadingLevel.js";
5
- import { openClientFor as W } from "../helpers/openClientFor.js";
6
- import { hasModels as X } from "../helpers/hasModels.js";
7
- import { getModels as D } from "../helpers/getModels.js";
8
- import { hasWebhooks as Y } from "../helpers/hasWebhooks.js";
9
- import { getHeadingsFromMarkdown as Z } from "../helpers/getHeadingsFromMarkdown.js";
10
- import { useApiClientStore as _ } from "../legacy/stores/useApiClientStore.js";
11
- import { useOpenApiStore as $ } from "../legacy/stores/useOpenApiStore.js";
1
+ import { ssrState as U } from "@scalar/oas-utils/helpers";
2
+ import { ref as p, reactive as X, computed as q, watch as W } from "vue";
3
+ import { useNavState as Y } from "./useNavState.js";
4
+ import { getLowestHeadingLevel as z } from "../helpers/getLowestHeadingLevel.js";
5
+ import { openClientFor as D } from "../helpers/openClientFor.js";
6
+ import { hasModels as Z } from "../helpers/hasModels.js";
7
+ import { getModels as F } from "../helpers/getModels.js";
8
+ import { hasWebhooks as _ } from "../helpers/hasWebhooks.js";
9
+ import { getHeadingsFromMarkdown as $ } from "../helpers/getHeadingsFromMarkdown.js";
10
+ import { useApiClientStore as ee } from "../legacy/stores/useApiClientStore.js";
11
+ import { useOpenApiStore as te } from "../legacy/stores/useOpenApiStore.js";
12
12
  const {
13
- getHeadingId: F,
14
- getModelId: V,
15
- getOperationId: B,
16
- getSectionId: ee,
17
- getTagId: z,
18
- getWebhookId: S,
19
- hash: I
20
- } = U(), o = g(void 0);
21
- function te(t) {
13
+ getHeadingId: V,
14
+ getModelId: B,
15
+ getOperationId: P,
16
+ getSectionId: se,
17
+ getTagId: J,
18
+ getWebhookId: C,
19
+ hash: A
20
+ } = Y(), o = p(void 0);
21
+ function ie(t) {
22
22
  return o.value = t;
23
23
  }
24
- const J = g(!1), w = R(
25
- Q["useSidebarContent-collapsedSidebarItems"] ?? {}
24
+ const K = p(!1), N = p(!1), g = X(
25
+ U["useSidebarContent-collapsedSidebarItems"] ?? {}
26
26
  );
27
- function se(t) {
28
- w[t] = !w[t];
27
+ function oe(t) {
28
+ g[t] = !g[t];
29
29
  }
30
- function C(t, s) {
31
- w[t] = s;
30
+ function b(t, s) {
31
+ g[t] = s;
32
32
  }
33
- const b = g([]), ie = async (t) => {
34
- const s = await Z(t), l = q(s);
33
+ const S = p([]), le = async (t) => {
34
+ const s = await $(t), l = z(s);
35
35
  return s.filter((n) => (
36
36
  // highest level, eg. # Introduction
37
37
  n.depth === l || // second highest level, eg. ## Authentication
38
38
  n.depth === l + 1
39
39
  ));
40
- }, K = P(() => {
41
- var k, A, O, y, T, H, M, x, j, E;
42
- const { state: t } = _(), s = {}, {
40
+ }, Q = q(() => {
41
+ var k, O, T, y, H, M, x, E, j, G;
42
+ const { state: t } = ee(), s = {}, {
43
43
  openApi: { globalSecurity: l }
44
- } = $(), n = [];
45
- let p = null;
46
- b.value.forEach((e) => {
44
+ } = te(), n = [];
45
+ let h = null;
46
+ S.value.forEach((e) => {
47
47
  var i;
48
- e.depth === q(b.value) ? (p = {
49
- id: F(e),
48
+ e.depth === z(S.value) ? (h = {
49
+ id: V(e),
50
50
  title: e.value,
51
51
  show: !t.showApiClient,
52
52
  children: []
53
- }, n.push(p)) : p && ((i = p.children) == null || i.push({
54
- id: F(e),
53
+ }, n.push(h)) : h && ((i = h.children) == null || i.push({
54
+ id: V(e),
55
55
  title: e.value,
56
56
  show: !t.showApiClient
57
57
  }));
58
58
  });
59
- const c = (A = (k = o.value) == null ? void 0 : k.tags) == null ? void 0 : A[0], h = c && ((e) => (e == null ? void 0 : e.length) !== 1 || e[0].name !== "default" || e[0].description !== "")((O = o.value) == null ? void 0 : O.tags) ? (T = (y = o.value) == null ? void 0 : y.tags) == null ? void 0 : T.filter((e) => {
59
+ const c = (O = (k = o.value) == null ? void 0 : k.tags) == null ? void 0 : O[0], f = c && ((e) => (e == null ? void 0 : e.length) !== 1 || e[0].name !== "default" || e[0].description !== "")((T = o.value) == null ? void 0 : T.tags) ? (H = (y = o.value) == null ? void 0 : y.tags) == null ? void 0 : H.filter((e) => {
60
60
  var i;
61
61
  return ((i = e.operations) == null ? void 0 : i.length) > 0;
62
62
  }).map((e) => {
63
63
  var i;
64
64
  return {
65
- id: z(e),
65
+ id: J(e),
66
66
  title: e.name,
67
67
  displayTitle: e["x-displayName"] ?? e.name,
68
68
  show: !0,
69
69
  children: (i = e.operations) == null ? void 0 : i.map(
70
70
  (r) => {
71
- var u;
72
- const a = B(r, e), d = r.name ?? r.path;
73
- return s[a] = d, {
71
+ var d;
72
+ const a = P(r, e), u = r.name ?? r.path;
73
+ return s[a] = u, {
74
74
  id: a,
75
- title: d,
75
+ title: u,
76
76
  httpVerb: r.httpVerb,
77
- deprecated: ((u = r.information) == null ? void 0 : u.deprecated) ?? !1,
77
+ deprecated: ((d = r.information) == null ? void 0 : d.deprecated) ?? !1,
78
78
  show: !0,
79
79
  select: () => {
80
- t.showApiClient && W(r, l);
80
+ t.showApiClient && D(r, l);
81
81
  }
82
82
  };
83
83
  }
84
84
  )
85
85
  };
86
- }) : (H = c == null ? void 0 : c.operations) == null ? void 0 : H.map((e) => {
86
+ }) : (M = c == null ? void 0 : c.operations) == null ? void 0 : M.map((e) => {
87
87
  var a;
88
- const i = B(e, c), r = e.name ?? e.path;
88
+ const i = P(e, c), r = e.name ?? e.path;
89
89
  return s[i] = r, {
90
90
  id: i,
91
91
  title: r,
@@ -93,62 +93,62 @@ const b = g([]), ie = async (t) => {
93
93
  deprecated: ((a = e.information) == null ? void 0 : a.deprecated) ?? !1,
94
94
  show: !0,
95
95
  select: () => {
96
- t.showApiClient && W(e, l);
96
+ t.showApiClient && D(e, l);
97
97
  }
98
98
  };
99
99
  });
100
- let f = X(o.value) && !J.value ? [
100
+ let m = Z(o.value) && !K.value ? [
101
101
  {
102
- id: V(),
102
+ id: B(),
103
103
  title: "Models",
104
104
  show: !t.showApiClient,
105
- children: Object.keys(D(o.value) ?? {}).map(
105
+ children: Object.keys(F(o.value) ?? {}).map(
106
106
  (e) => {
107
107
  var r;
108
- const i = V(e);
108
+ const i = B(e);
109
109
  return s[i] = e, {
110
110
  id: i,
111
- title: ((r = D(o.value)) == null ? void 0 : r[e]).title ?? e,
111
+ title: ((r = F(o.value)) == null ? void 0 : r[e]).title ?? e,
112
112
  show: !t.showApiClient
113
113
  };
114
114
  }
115
115
  )
116
116
  }
117
- ] : [], m = Y(o.value) ? [
117
+ ] : [], v = _(o.value) ? [
118
118
  {
119
- id: S(),
119
+ id: C(),
120
120
  title: "Webhook",
121
121
  show: !t.showApiClient,
122
- children: Object.keys(((M = o.value) == null ? void 0 : M.webhooks) ?? {}).map((e) => {
122
+ children: Object.keys(((x = o.value) == null ? void 0 : x.webhooks) ?? {}).map((e) => {
123
123
  var r, a;
124
- const i = S(e);
124
+ const i = C(e);
125
125
  return s[i] = e, Object.keys(
126
126
  ((a = (r = o.value) == null ? void 0 : r.webhooks) == null ? void 0 : a[e]) ?? {}
127
- ).map((d) => {
128
- var u, v, G;
127
+ ).map((u) => {
128
+ var d, w, L;
129
129
  return {
130
- id: S(e, d),
131
- title: (G = (v = (u = o.value) == null ? void 0 : u.webhooks) == null ? void 0 : v[e][d]) == null ? void 0 : G.name,
132
- httpVerb: d,
130
+ id: C(e, u),
131
+ title: (L = (w = (d = o.value) == null ? void 0 : d.webhooks) == null ? void 0 : w[e][u]) == null ? void 0 : L.name,
132
+ httpVerb: u,
133
133
  show: !t.showApiClient
134
134
  };
135
135
  });
136
136
  }).flat()
137
137
  }
138
138
  ] : [];
139
- const N = (x = o.value) != null && x["x-tagGroups"] ? (E = (j = o.value) == null ? void 0 : j["x-tagGroups"]) == null ? void 0 : E.map((e) => {
139
+ const R = (E = o.value) != null && E["x-tagGroups"] ? (G = (j = o.value) == null ? void 0 : j["x-tagGroups"]) == null ? void 0 : G.map((e) => {
140
140
  var a;
141
141
  const i = [];
142
- return (a = e.tags) == null || a.map((d) => {
143
- if (d === "models" && f.length > 0)
144
- i.push(f[0]), f = [];
145
- else if (d === "webhooks" && m.length > 0)
142
+ return (a = e.tags) == null || a.map((u) => {
143
+ if (u === "models" && m.length > 0)
146
144
  i.push(m[0]), m = [];
145
+ else if (u === "webhooks" && v.length > 0)
146
+ i.push(v[0]), v = [];
147
147
  else {
148
- const u = h == null ? void 0 : h.find(
149
- (v) => v.title === d
148
+ const d = f == null ? void 0 : f.find(
149
+ (w) => w.title === u
150
150
  );
151
- u && i.push(u);
151
+ d && i.push(d);
152
152
  }
153
153
  }), {
154
154
  id: e.name,
@@ -157,37 +157,39 @@ const b = g([]), ie = async (t) => {
157
157
  show: !0,
158
158
  isGroup: !0
159
159
  };
160
- }) : void 0;
161
- return {
162
- entries: [
163
- ...n,
164
- ...N ?? h ?? [],
165
- ...m,
166
- ...f
167
- ],
160
+ }) : void 0, I = [
161
+ ...n,
162
+ ...R ?? f ?? [],
163
+ ...v,
164
+ ...m
165
+ ];
166
+ return N.value && I.forEach((e) => {
167
+ b(e.id, !0), e.show = !0;
168
+ }), {
169
+ entries: I,
168
170
  titles: s
169
171
  };
170
- }), oe = g(!1), le = P(() => {
172
+ }), re = p(!1), ne = q(() => {
171
173
  var t, s;
172
- return ((s = (t = K.value) == null ? void 0 : t.titles) == null ? void 0 : s[I.value]) ?? "";
174
+ return ((s = (t = Q.value) == null ? void 0 : t.titles) == null ? void 0 : s[A.value]) ?? "";
173
175
  });
174
- function be(t) {
175
- return t != null && t.parsedSpec && (o.value = t.parsedSpec, L(
176
+ function Se(t) {
177
+ return t != null && t.parsedSpec && (o.value = t.parsedSpec, W(
176
178
  () => {
177
179
  var s, l;
178
180
  return (l = (s = o.value) == null ? void 0 : s.tags) == null ? void 0 : l.length;
179
181
  },
180
182
  () => {
181
183
  var s, l;
182
- if (I.value) {
183
- const n = ee(I.value);
184
- n && C(n, !0);
184
+ if (A.value) {
185
+ const n = se(A.value);
186
+ n && b(n, !0);
185
187
  } else {
186
188
  const n = (l = (s = o.value) == null ? void 0 : s.tags) == null ? void 0 : l[0];
187
- n && C(z(n), !0);
189
+ n && b(J(n), !0);
188
190
  }
189
191
  }
190
- ), L(
192
+ ), W(
191
193
  () => {
192
194
  var s, l;
193
195
  return (l = (s = o.value) == null ? void 0 : s.info) == null ? void 0 : l.description;
@@ -195,19 +197,20 @@ function be(t) {
195
197
  async () => {
196
198
  var l, n;
197
199
  const s = (n = (l = o.value) == null ? void 0 : l.info) == null ? void 0 : n.description;
198
- return s ? b.value = await ie(s) : b.value = [];
200
+ return s ? S.value = await le(s) : S.value = [];
199
201
  }
200
202
  )), {
201
- breadcrumb: le,
202
- items: K,
203
- isSidebarOpen: oe,
204
- collapsedSidebarItems: w,
205
- toggleCollapsedSidebarItem: se,
206
- setCollapsedSidebarItem: C,
207
- hideModels: J,
208
- setParsedSpec: te
203
+ breadcrumb: ne,
204
+ items: Q,
205
+ isSidebarOpen: re,
206
+ collapsedSidebarItems: g,
207
+ toggleCollapsedSidebarItem: oe,
208
+ setCollapsedSidebarItem: b,
209
+ hideModels: K,
210
+ setParsedSpec: ie,
211
+ defaultOpenAllTags: N
209
212
  };
210
213
  }
211
214
  export {
212
- be as useSidebar
215
+ Se as useSidebar
213
216
  };