@scalar/api-reference 1.28.13 → 1.28.14

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 (40) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/browser/standalone.js +7124 -7120
  3. package/dist/browser/webpack-stats.json +1 -1
  4. package/dist/components/Card/Card.vue.d.ts.map +1 -1
  5. package/dist/components/Card/Card.vue.js +7 -7
  6. package/dist/components/Content/ClientLibraries/ClientSelector.vue.d.ts.map +1 -1
  7. package/dist/components/Content/ClientLibraries/ClientSelector.vue.js +2 -2
  8. package/dist/components/Content/ClientLibraries/ClientSelector.vue2.js +18 -19
  9. package/dist/components/Content/Lazy/Loading.vue.d.ts +8 -17
  10. package/dist/components/Content/Lazy/Loading.vue.d.ts.map +1 -1
  11. package/dist/components/Content/Lazy/Loading.vue.js +50 -44
  12. package/dist/components/Content/Schema/Schema.vue.d.ts.map +1 -1
  13. package/dist/components/Content/Schema/Schema.vue.js +2 -2
  14. package/dist/components/Content/Schema/Schema.vue2.js +84 -71
  15. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts +1 -0
  16. package/dist/components/Content/Schema/SchemaDiscriminator.vue.d.ts.map +1 -1
  17. package/dist/components/Content/Schema/SchemaDiscriminator.vue.js +1 -1
  18. package/dist/components/Content/Schema/SchemaDiscriminator.vue2.js +23 -20
  19. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts +3 -1
  20. package/dist/components/Content/Schema/SchemaProperty.vue.d.ts.map +1 -1
  21. package/dist/components/Content/Schema/SchemaProperty.vue.js +2 -2
  22. package/dist/components/Content/Schema/SchemaProperty.vue2.js +159 -148
  23. package/dist/features/Operation/components/ParameterListItem.vue.d.ts.map +1 -1
  24. package/dist/features/Operation/components/ParameterListItem.vue.js +2 -2
  25. package/dist/features/Operation/components/ParameterListItem.vue2.js +1 -0
  26. package/dist/features/Operation/components/RequestBody.vue.d.ts.map +1 -1
  27. package/dist/features/Operation/components/RequestBody.vue.js +2 -2
  28. package/dist/features/Operation/components/RequestBody.vue2.js +29 -26
  29. package/dist/features/Search/SearchButton.vue.d.ts.map +1 -1
  30. package/dist/features/Search/SearchButton.vue.js +2 -2
  31. package/dist/features/Search/SearchButton.vue2.js +42 -29
  32. package/dist/features/Search/SearchModal.vue.d.ts.map +1 -1
  33. package/dist/features/Search/SearchModal.vue.js +3 -3
  34. package/dist/features/Search/SearchModal.vue2.js +102 -96
  35. package/dist/features/Search/useSearchIndex.d.ts +2 -1
  36. package/dist/features/Search/useSearchIndex.d.ts.map +1 -1
  37. package/dist/features/Search/useSearchIndex.js +55 -52
  38. package/dist/index.js +1 -1
  39. package/dist/style.css +1 -1
  40. package/package.json +6 -6
@@ -1,7 +1,7 @@
1
1
  import o from "./SearchModal.vue2.js";
2
2
  /* empty css */
3
- import r from "../../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ r(o, [["__scopeId", "data-v-1f1d816c"]]);
3
+ import a from "../../_virtual/_plugin-vue_export-helper.js";
4
+ const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-05a312ab"]]);
5
5
  export {
6
- f as default
6
+ p as default
7
7
  };
@@ -1,33 +1,34 @@
1
- import { defineComponent as Y, toRef as A, ref as W, watch as y, computed as _, openBlock as f, createBlock as B, unref as n, withCtx as i, createElementVNode as a, createVNode as g, isRef as j, withKeys as v, withModifiers as b, createTextVNode as d, toDisplayString as u, createElementBlock as N, Fragment as x, renderList as G, createSlots as J, normalizeClass as Q, createCommentVNode as X } from "vue";
2
- import { ScalarModal as Z, ScalarSearchInput as ee, ScalarSearchResultList as te, ScalarSearchResultItem as oe } from "@scalar/components";
3
- import { nanoid as se } from "nanoid";
1
+ import { defineComponent as Y, toRef as A, ref as W, watch as x, openBlock as h, createBlock as $, unref as s, withCtx as l, createElementVNode as n, createVNode as g, isRef as j, withKeys as b, withModifiers as R, createTextVNode as d, toDisplayString as c, createElementBlock as y, Fragment as E, renderList as G, createSlots as J, normalizeClass as Q, createCommentVNode as X } from "vue";
2
+ import { ScalarModal as Z, ScalarSearchInput as _, ScalarSearchResultList as ee, ScalarSearchResultItem as te } from "@scalar/components";
3
+ import { nanoid as oe } from "nanoid";
4
4
  import { lazyBus as ae } from "../../components/Content/Lazy/lazyBus.js";
5
- import ne from "../../components/Sidebar/SidebarHttpBadge.vue.js";
6
- import { useSearchIndex as re } from "./useSearchIndex.js";
7
- import { useSidebar as le } from "../../hooks/useSidebar.js";
8
- import { scrollToId as E } from "../../helpers/scrollToId.js";
9
- const ie = { class: "sr-only" }, ce = { class: "sr-only" }, ve = /* @__PURE__ */ Y({
5
+ import se from "../../components/Sidebar/SidebarHttpBadge.vue.js";
6
+ import { useSearchIndex as ne } from "./useSearchIndex.js";
7
+ import { useSidebar as re } from "../../hooks/useSidebar.js";
8
+ import { scrollToId as N } from "../../helpers/scrollToId.js";
9
+ const le = { class: "sr-only" }, ie = { class: "sr-only" }, ve = /* @__PURE__ */ Y({
10
10
  __name: "SearchModal",
11
11
  props: {
12
12
  parsedSpec: {},
13
13
  modalState: {}
14
14
  },
15
- setup(L) {
16
- const m = L, F = A(m, "parsedSpec"), S = se(), R = `${S}-search-result`, w = `${S}-search-instructions`, I = (o) => `${S}${o}`, {
17
- resetSearch: P,
18
- fuseSearch: q,
19
- selectedSearchResult: l,
20
- searchResultsWithPlaceholderResults: c,
15
+ setup(F) {
16
+ const m = F, q = A(m, "parsedSpec"), S = oe(), I = `${S}-search-result`, w = `${S}-search-instructions`, v = (o) => `${S}${o}`, {
17
+ resetSearch: D,
18
+ fuseSearch: L,
19
+ selectedSearchIndex: r,
20
+ selectedSearchResult: k,
21
+ searchResultsWithPlaceholderResults: u,
21
22
  searchText: p
22
- } = re({
23
- specification: F
24
- }), D = {
23
+ } = ne({
24
+ specification: q
25
+ }), M = {
25
26
  heading: "DocsPage",
26
27
  model: "Brackets",
27
28
  req: "Terminal",
28
29
  tag: "CodeFolder",
29
30
  webhook: "Terminal"
30
- }, $ = {
31
+ }, P = {
31
32
  heading: "Document Heading",
32
33
  req: "Request",
33
34
  tag: "Tag",
@@ -35,114 +36,119 @@ const ie = { class: "sr-only" }, ce = { class: "sr-only" }, ve = /* @__PURE__ */
35
36
  // The title of the entry is already "Model"
36
37
  webhook: ""
37
38
  // The title of the entry is already "Webhook"
38
- }, M = W(null);
39
- y(
39
+ }, H = W(null);
40
+ x(
40
41
  () => m.modalState.open,
41
42
  (o) => {
42
- o && P();
43
+ o && D();
43
44
  }
44
45
  );
45
- const { setCollapsedSidebarItem: H } = le(), U = /#(tag\/[^/]*)/;
46
- function k(o) {
46
+ const { setCollapsedSidebarItem: U } = re(), K = /#(tag\/[^/]*)/;
47
+ function V(o) {
47
48
  let t = "models";
48
- const e = o.item.href.match(U);
49
- e != null && e.length && e.length > 1 && (t = e[1]), H(t, !0);
50
- const s = o.item.href.replace("#", "");
51
- if (document.getElementById(s))
52
- E(s), m.modalState.hide();
49
+ const e = o.item.href.match(K);
50
+ e != null && e.length && e.length > 1 && (t = e[1]), U(t, !0);
51
+ const a = o.item.href.replace("#", "");
52
+ if (document.getElementById(a))
53
+ N(a), m.modalState.hide();
53
54
  else {
54
- const r = ae.on((h) => {
55
- h.id === s && (E(s), r(), m.modalState.hide());
55
+ const i = ae.on((f) => {
56
+ f.id === a && (N(a), i(), m.modalState.hide());
56
57
  });
57
58
  }
58
59
  }
59
- y(l, (o) => {
60
- var s;
61
- const t = c.value[o], e = I(t == null ? void 0 : t.item.href);
62
- (s = document.getElementById(e)) == null || s.scrollIntoView({
60
+ x(r, (o) => {
61
+ var a;
62
+ if (typeof o != "number")
63
+ return;
64
+ const t = u.value[o], e = v(t == null ? void 0 : t.item.href);
65
+ (a = document.getElementById(e)) == null || a.scrollIntoView({
63
66
  behavior: "smooth",
64
67
  block: "nearest"
65
68
  });
66
69
  });
67
- const K = _(() => {
68
- const o = c.value;
69
- if (!o.length)
70
- return "No results found";
71
- const t = o[l.value].item, e = p.value.length ? `${o.length} result${o.length === 1 ? "" : "s"} found, ` : "", s = t.type === "tag" ? "" : t.type === "req" ? `, HTTP Method ${t.httpVerb}, Path ${t.path}` : `, ${t.description}`, r = `${$[t.type]} ${t.title} ${s}`;
72
- return `${e}Selected: ${r}`;
73
- }), T = (o) => {
74
- const t = o === "up" ? -1 : 1, e = c.value.length, s = (l.value + t + e) % e;
75
- l.value = s;
70
+ const B = (o) => {
71
+ const t = o === "up" ? -1 : 1, e = u.value.length;
72
+ if (typeof r.value == "number") {
73
+ const a = (r.value + t + e) % e;
74
+ r.value = a;
75
+ } else
76
+ r.value = t === -1 ? e - 1 : 0;
76
77
  };
77
78
  function z(o) {
78
79
  const t = new URL(window.location.href);
79
80
  return t.hash = o, t.toString();
80
81
  }
81
82
  function O() {
82
- const o = c.value;
83
- k(o[l.value]);
83
+ if (!r.value)
84
+ return;
85
+ const o = u.value;
86
+ V(o[r.value]);
84
87
  }
85
- return (o, t) => (f(), B(n(Z), {
88
+ return (o, t) => (h(), $(s(Z), {
89
+ "aria-label": "Reference Search",
86
90
  state: o.modalState,
87
91
  variant: "search"
88
92
  }, {
89
- default: i(() => [
90
- a("div", {
93
+ default: l(() => [
94
+ n("div", {
91
95
  ref_key: "searchModalRef",
92
- ref: M,
93
- "aria-label": "Reference Search",
96
+ ref: H,
94
97
  class: "ref-search-container",
95
98
  role: "search"
96
99
  }, [
97
- g(n(ee), {
98
- modelValue: n(p),
100
+ g(s(_), {
101
+ modelValue: s(p),
99
102
  "onUpdate:modelValue": t[0] || (t[0] = (e) => j(p) ? p.value = e : null),
100
- "aria-controls": R,
103
+ "aria-activedescendant": s(k) ? v(s(k).item.href) : void 0,
104
+ "aria-autocomplete": "list",
105
+ "aria-controls": I,
101
106
  "aria-describedby": w,
102
- label: K.value,
103
- onInput: n(q),
107
+ role: "combobox",
108
+ onBlur: t[1] || (t[1] = (e) => r.value = void 0),
109
+ onInput: s(L),
104
110
  onKeydown: [
105
- t[1] || (t[1] = v(b((e) => T("down"), ["stop", "prevent"]), ["down"])),
106
- v(b(O, ["stop", "prevent"]), ["enter"]),
107
- t[2] || (t[2] = v(b((e) => T("up"), ["stop", "prevent"]), ["up"]))
111
+ t[2] || (t[2] = b(R((e) => B("down"), ["stop", "prevent"]), ["down"])),
112
+ b(R(O, ["stop", "prevent"]), ["enter"]),
113
+ t[3] || (t[3] = b(R((e) => B("up"), ["stop", "prevent"]), ["up"]))
108
114
  ]
109
- }, null, 8, ["modelValue", "label", "onInput", "onKeydown"])
115
+ }, null, 8, ["modelValue", "aria-activedescendant", "onInput", "onKeydown"])
110
116
  ], 512),
111
- g(n(te), {
112
- id: R,
117
+ g(s(ee), {
118
+ id: I,
113
119
  "aria-label": "Reference Search Results",
114
120
  class: "ref-search-results custom-scroll",
115
- noResults: !n(c).length
121
+ noResults: !s(u).length
116
122
  }, {
117
- query: i(() => [
118
- d(u(n(p)), 1)
123
+ query: l(() => [
124
+ d(c(s(p)), 1)
119
125
  ]),
120
- default: i(() => [
121
- (f(!0), N(x, null, G(n(c), (e, s) => (f(), B(n(oe), {
122
- id: I(e.item.href),
126
+ default: l(() => [
127
+ (h(!0), y(E, null, G(s(u), (e, a) => (h(), $(s(te), {
128
+ id: v(e.item.href),
123
129
  key: e.refIndex,
124
- active: n(l) === s,
125
130
  href: z(e.item.href),
126
- icon: D[e.item.type],
127
- onClick: (r) => k(e),
128
- onFocus: (r) => l.value = s
131
+ icon: M[e.item.type],
132
+ selected: s(r) === a,
133
+ onClick: (i) => V(e),
134
+ onFocus: (i) => r.value = a
129
135
  }, J({
130
- default: i(() => {
131
- var r, h, V, C;
136
+ default: l(() => {
137
+ var i, f, C, T;
132
138
  return [
133
- a("span", {
139
+ n("span", {
134
140
  class: Q({
135
- deprecated: (h = (r = e.item.operation) == null ? void 0 : r.information) == null ? void 0 : h.deprecated
141
+ deprecated: (f = (i = e.item.operation) == null ? void 0 : i.information) == null ? void 0 : f.deprecated
136
142
  })
137
143
  }, [
138
- a("span", ie, [
139
- d(u($[e.item.type]) + ":  ", 1),
140
- (C = (V = e.item.operation) == null ? void 0 : V.information) != null && C.deprecated ? (f(), N(x, { key: 0 }, [
144
+ n("span", le, [
145
+ d(c(P[e.item.type]) + ":  ", 1),
146
+ (T = (C = e.item.operation) == null ? void 0 : C.information) != null && T.deprecated ? (h(), y(E, { key: 0 }, [
141
147
  d(" (Deprecated)  ")
142
148
  ], 64)) : X("", !0)
143
149
  ]),
144
- d(" " + u(e.item.title) + " ", 1),
145
- t[3] || (t[3] = a("span", { class: "sr-only" }, ",", -1))
150
+ d(" " + c(e.item.title) + " ", 1),
151
+ t[4] || (t[4] = n("span", { class: "sr-only" }, ",", -1))
146
152
  ], 2)
147
153
  ];
148
154
  }),
@@ -150,46 +156,46 @@ const ie = { class: "sr-only" }, ce = { class: "sr-only" }, ve = /* @__PURE__ */
150
156
  }, [
151
157
  e.item.type !== "webhook" && (e.item.httpVerb || e.item.path) && e.item.path !== e.item.title ? {
152
158
  name: "description",
153
- fn: i(() => [
154
- t[4] || (t[4] = a("span", { class: "sr-only" }, "Path: ", -1)),
155
- d(" " + u(e.item.path), 1)
159
+ fn: l(() => [
160
+ t[5] || (t[5] = n("span", { class: "sr-only" }, "Path: ", -1)),
161
+ d(" " + c(e.item.path), 1)
156
162
  ]),
157
163
  key: "0"
158
164
  } : e.item.description ? {
159
165
  name: "description",
160
- fn: i(() => [
161
- t[5] || (t[5] = a("span", { class: "sr-only" }, "Description: ", -1)),
162
- d(" " + u(e.item.description), 1)
166
+ fn: l(() => [
167
+ t[6] || (t[6] = n("span", { class: "sr-only" }, "Description: ", -1)),
168
+ d(" " + c(e.item.description), 1)
163
169
  ]),
164
170
  key: "1"
165
171
  } : void 0,
166
172
  e.item.type === "req" ? {
167
173
  name: "addon",
168
- fn: i(() => [
169
- g(ne, {
174
+ fn: l(() => [
175
+ g(se, {
170
176
  "aria-hidden": "true",
171
177
  method: e.item.httpVerb ?? "get"
172
178
  }, null, 8, ["method"]),
173
- a("span", ce, " HTTP Method: " + u(e.item.httpVerb ?? "get") + ", ", 1)
179
+ n("span", ie, " HTTP Method: " + c(e.item.httpVerb ?? "get") + ", ", 1)
174
180
  ]),
175
181
  key: "2"
176
182
  } : void 0
177
- ]), 1032, ["id", "active", "href", "icon", "onClick", "onFocus"]))), 128))
183
+ ]), 1032, ["id", "href", "icon", "selected", "onClick", "onFocus"]))), 128))
178
184
  ]),
179
185
  _: 1
180
186
  }, 8, ["noResults"]),
181
- a("div", {
187
+ n("div", {
182
188
  id: w,
183
189
  class: "ref-search-meta"
184
- }, t[6] || (t[6] = [
185
- a("span", {
190
+ }, t[7] || (t[7] = [
191
+ n("span", {
186
192
  "aria-hidden": "true",
187
193
  class: "contents"
188
194
  }, [
189
- a("span", null, "↑↓ Navigate"),
190
- a("span", null, "⏎ Select")
195
+ n("span", null, "↑↓ Navigate"),
196
+ n("span", null, "⏎ Select")
191
197
  ], -1),
192
- a("span", { class: "sr-only" }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ", -1)
198
+ n("span", { class: "sr-only" }, " Press up arrow / down arrow to navigate, enter to select, type to filter results ", -1)
193
199
  ]))
194
200
  ]),
195
201
  _: 1
@@ -23,7 +23,8 @@ export declare function useSearchIndex({ specification, }: {
23
23
  }): {
24
24
  resetSearch: () => void;
25
25
  fuseSearch: () => void;
26
- selectedSearchResult: Ref<number, number>;
26
+ selectedSearchIndex: Ref<number | undefined, number | undefined>;
27
+ selectedSearchResult: import("vue").ComputedRef<FuseResult<FuseData> | undefined>;
27
28
  searchResultsWithPlaceholderResults: import("vue").ComputedRef<FuseResult<FuseData>[]>;
28
29
  searchText: Ref<string, string>;
29
30
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,OAAO,EAAE,KAAK,QAAQ,EAAyC,MAAM,aAAa,CAAA;AAElF,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,GACd,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;CACzB;uBA0ByB,IAAI;sBAbL,IAAI;;;;EAmK5B"}
1
+ {"version":3,"file":"useSearchIndex.d.ts","sourceRoot":"","sources":["../../../src/features/Search/useSearchIndex.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AACtE,OAAa,EAAE,KAAK,UAAU,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,EAAE,KAAK,GAAG,EAAwB,MAAM,KAAK,CAAA;AAIpD,OAAO,EAAE,KAAK,QAAQ,EAAyC,MAAM,aAAa,CAAA;AAElF,MAAM,MAAM,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,KAAK,CAAA;AAEvE,MAAM,MAAM,QAAQ,GAAG;IACrB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,SAAS,CAAA;IACf,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,EAAE,MAAM,CAAA;IACnB,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,QAAQ,CAAA;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,CAAA;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,aAAa,GACd,EAAE;IACD,aAAa,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;CACzB;uBA0ByB,IAAI;sBAbL,IAAI;;;;;EA0K5B"}
@@ -1,63 +1,65 @@
1
- import F from "fuse.js";
2
- import { ref as h, watch as E, computed as H } from "vue";
3
- import { extractRequestBody as N } from "../../helpers/specHelpers.js";
4
- import { useOperation as V } from "../../hooks/useOperation.js";
5
- import { useSidebar as A } from "../../hooks/useSidebar.js";
6
- import { useNavState as B } from "../../hooks/useNavState.js";
7
- import { getHeadingsFromMarkdown as P } from "../../helpers/getHeadingsFromMarkdown.js";
8
- import { getModels as z } from "../../helpers/getModels.js";
9
- function _({
10
- specification: x
1
+ import N from "fuse.js";
2
+ import { ref as d, watch as E, computed as O } from "vue";
3
+ import { extractRequestBody as V } from "../../helpers/specHelpers.js";
4
+ import { useOperation as A } from "../../hooks/useOperation.js";
5
+ import { useSidebar as B } from "../../hooks/useSidebar.js";
6
+ import { useNavState as P } from "../../hooks/useNavState.js";
7
+ import { getHeadingsFromMarkdown as z } from "../../helpers/getHeadingsFromMarkdown.js";
8
+ import { getModels as G } from "../../helpers/getModels.js";
9
+ function w({
10
+ specification: R
11
11
  }) {
12
- const { hideModels: O } = A(), { getHeadingId: R, getWebhookId: T, getModelId: j, getOperationId: L, getTagId: W } = B(), s = h([]), r = h([]), d = h(0), a = h(""), c = new F(s.value, {
12
+ const { hideModels: T } = B(), { getHeadingId: j, getWebhookId: L, getModelId: W, getOperationId: q, getTagId: C } = P(), s = d([]), l = d([]), a = d(), r = d(""), c = new N(s.value, {
13
13
  keys: ["title", "description", "body"]
14
14
  }), m = () => {
15
- d.value = 0, r.value = c.search(a.value);
15
+ a.value = 0, l.value = c.search(r.value);
16
16
  };
17
- E(a, (e) => {
18
- e.length ? m() : r.value = [];
17
+ E(r, (e) => {
18
+ e.length ? m() : l.value = [];
19
19
  });
20
- function q() {
21
- a.value = "", d.value = 0, r.value = [];
20
+ function F() {
21
+ r.value = "", a.value = void 0, l.value = [];
22
22
  }
23
- const C = H(() => a.value.length === 0 ? s.value.slice(0, 25).map((l) => ({
24
- item: l
25
- })) : r.value.slice(0, 25));
23
+ const v = O(() => r.value.length === 0 ? s.value.slice(0, 25).map((i) => ({
24
+ item: i
25
+ })) : l.value.slice(0, 25)), H = O(
26
+ () => typeof a.value == "number" ? v.value[a.value] : void 0
27
+ );
26
28
  return E(
27
- x,
29
+ R,
28
30
  (e) => {
29
- var g, I, p, k;
30
- if (s.value = [], !((g = e == null ? void 0 : e.tags) != null && g.length) && !((I = e == null ? void 0 : e.webhooks) != null && I.length)) {
31
+ var I, p, k, M;
32
+ if (s.value = [], !((I = e == null ? void 0 : e.tags) != null && I.length) && !((p = e == null ? void 0 : e.webhooks) != null && p.length)) {
31
33
  c.setCollection([]);
32
34
  return;
33
35
  }
34
- const l = [], v = P(((p = e == null ? void 0 : e.info) == null ? void 0 : p.description) ?? "");
35
- v.length && (v.forEach((t) => {
36
- l.push({
36
+ const i = [], b = z(((k = e == null ? void 0 : e.info) == null ? void 0 : k.description) ?? "");
37
+ b.length && (b.forEach((t) => {
38
+ i.push({
37
39
  type: "heading",
38
40
  title: `Info > ${t.value}`,
39
41
  description: "",
40
- href: `#${R(t)}`,
42
+ href: `#${j(t)}`,
41
43
  tag: t.slug,
42
44
  body: ""
43
45
  });
44
- }), s.value = s.value.concat(l)), (k = e == null ? void 0 : e.tags) == null || k.forEach((t) => {
45
- const M = {
46
+ }), s.value = s.value.concat(i)), (M = e == null ? void 0 : e.tags) == null || M.forEach((t) => {
47
+ const D = {
46
48
  title: t["x-displayName"] ?? t.name,
47
- href: `#${W(t)}`,
49
+ href: `#${C(t)}`,
48
50
  description: t.description,
49
51
  type: "tag",
50
52
  tag: t.name,
51
53
  body: ""
52
54
  };
53
- s.value.push(M), t.operations && t.operations.forEach((o) => {
54
- const { parameterMap: u } = V(o), D = N(o) || u.value;
55
+ s.value.push(D), t.operations && t.operations.forEach((o) => {
56
+ const { parameterMap: h } = A(o), $ = V(o) || h.value;
55
57
  let n = null;
56
- typeof D != "boolean" && (n = D);
57
- const $ = {
58
+ typeof $ != "boolean" && (n = $);
59
+ const x = {
58
60
  type: "req",
59
61
  title: o.name ?? o.path,
60
- href: `#${L(o, t)}`,
62
+ href: `#${q(o, t)}`,
61
63
  operationId: o.operationId,
62
64
  description: o.description ?? "",
63
65
  httpVerb: o.httpVerb,
@@ -65,45 +67,46 @@ function _({
65
67
  tag: t.name,
66
68
  operation: o
67
69
  };
68
- n && ($.body = n), s.value.push($);
70
+ n && (x.body = n), s.value.push(x);
69
71
  });
70
72
  });
71
- const i = e == null ? void 0 : e.webhooks, b = [];
72
- i && Object.keys(i).forEach((t) => {
73
- Object.keys(i[t]).forEach((o) => {
74
- var u;
75
- b.push({
73
+ const u = e == null ? void 0 : e.webhooks, y = [];
74
+ u && Object.keys(u).forEach((t) => {
75
+ Object.keys(u[t]).forEach((o) => {
76
+ var h;
77
+ y.push({
76
78
  type: "webhook",
77
79
  title: "Webhook",
78
- href: `#${T({ name: t, method: o })}`,
79
- description: `${(u = i[t][o]) == null ? void 0 : u.name}`,
80
+ href: `#${L({ name: t, method: o })}`,
81
+ description: `${(h = u[t][o]) == null ? void 0 : h.name}`,
80
82
  httpVerb: o,
81
83
  tag: t,
82
84
  body: ""
83
85
  });
84
- }), s.value = s.value.concat(b);
86
+ }), s.value = s.value.concat(y);
85
87
  });
86
- const f = O.value ? {} : z(e), y = [];
88
+ const f = T.value ? {} : G(e), g = [];
87
89
  f && (Object.keys(f).forEach((t) => {
88
- y.push({
90
+ g.push({
89
91
  type: "model",
90
92
  title: "Model",
91
- href: `#${j({ name: t })}`,
93
+ href: `#${W({ name: t })}`,
92
94
  description: f[t].title ?? t,
93
95
  tag: t,
94
96
  body: ""
95
97
  });
96
- }), s.value = s.value.concat(y)), c.setCollection(s.value);
98
+ }), s.value = s.value.concat(g)), c.setCollection(s.value);
97
99
  },
98
100
  { immediate: !0 }
99
101
  ), {
100
- resetSearch: q,
102
+ resetSearch: F,
101
103
  fuseSearch: m,
102
- selectedSearchResult: d,
103
- searchResultsWithPlaceholderResults: C,
104
- searchText: a
104
+ selectedSearchIndex: a,
105
+ selectedSearchResult: H,
106
+ searchResultsWithPlaceholderResults: v,
107
+ searchText: r
105
108
  };
106
109
  }
107
110
  export {
108
- _ as useSearchIndex
111
+ w as useSearchIndex
109
112
  };