zudoku 0.33.2-local.4 → 0.34.1

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 (150) hide show
  1. package/README.md +121 -0
  2. package/dist/config/loader.d.ts +3 -2
  3. package/dist/config/loader.js +10 -20
  4. package/dist/config/loader.js.map +1 -1
  5. package/dist/config/validators/common.d.ts +346 -346
  6. package/dist/config/validators/validate.d.ts +165 -165
  7. package/dist/lib/components/AnchorLink.d.ts +2 -2
  8. package/dist/lib/components/AnchorLink.js +4 -4
  9. package/dist/lib/components/AnchorLink.js.map +1 -1
  10. package/dist/lib/components/Heading.d.ts +1 -1
  11. package/dist/lib/components/context/ZudokuContext.d.ts +1 -1
  12. package/dist/lib/components/navigation/SidebarItem.js +6 -5
  13. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  14. package/dist/lib/core/ZudokuContext.d.ts +4 -0
  15. package/dist/lib/core/ZudokuContext.js.map +1 -1
  16. package/dist/lib/plugins/openapi/OperationList.js +4 -1
  17. package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
  18. package/dist/lib/plugins/openapi/OperationListItem.d.ts +1 -1
  19. package/dist/lib/plugins/openapi/OperationListItem.js +5 -3
  20. package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -1
  21. package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
  22. package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
  23. package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
  24. package/dist/lib/plugins/openapi/graphql/graphql.d.ts +1 -0
  25. package/dist/lib/plugins/openapi/graphql/graphql.js +2 -0
  26. package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
  27. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.d.ts +2 -2
  28. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js +1 -5
  29. package/dist/lib/plugins/openapi/playground/ExamplesDropdown.js.map +1 -1
  30. package/dist/lib/plugins/openapi/playground/Headers.js +1 -1
  31. package/dist/lib/plugins/openapi/playground/Headers.js.map +1 -1
  32. package/dist/lib/plugins/openapi/playground/IdentityDialog.d.ts +11 -0
  33. package/dist/lib/plugins/openapi/playground/IdentityDialog.js +14 -0
  34. package/dist/lib/plugins/openapi/playground/IdentityDialog.js.map +1 -0
  35. package/dist/lib/plugins/openapi/playground/IdentitySelector.d.ts +7 -0
  36. package/dist/lib/plugins/openapi/playground/IdentitySelector.js +10 -0
  37. package/dist/lib/plugins/openapi/playground/IdentitySelector.js.map +1 -0
  38. package/dist/lib/plugins/openapi/playground/Playground.d.ts +9 -1
  39. package/dist/lib/plugins/openapi/playground/Playground.js +75 -24
  40. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  41. package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
  42. package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
  43. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.d.ts +7 -0
  44. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js +8 -0
  45. package/dist/lib/plugins/openapi/playground/RequestLoginDialog.js.map +1 -0
  46. package/dist/lib/plugins/openapi/playground/rememberedIdentity.d.ts +17 -0
  47. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js +11 -0
  48. package/dist/lib/plugins/openapi/playground/rememberedIdentity.js.map +1 -0
  49. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +19 -13
  50. package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
  51. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.d.ts +6 -4
  52. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js +4 -3
  53. package/dist/lib/plugins/openapi/playground/result-panel/ResultPanel.js.map +1 -1
  54. package/dist/lib/ui/Checkbox.d.ts +2 -8
  55. package/dist/lib/ui/Checkbox.js +1 -13
  56. package/dist/lib/ui/Checkbox.js.map +1 -1
  57. package/dist/lib/ui/Command.d.ts +6 -6
  58. package/dist/lib/ui/Select.js +1 -1
  59. package/dist/lib/ui/Select.js.map +1 -1
  60. package/dist/lib/ui/SyntaxHighlight.d.ts +2 -1
  61. package/dist/lib/ui/SyntaxHighlight.js +19 -15
  62. package/dist/lib/ui/SyntaxHighlight.js.map +1 -1
  63. package/dist/lib/util/MdxComponents.d.ts +1 -1
  64. package/dist/lib/util/MdxComponents.js +2 -2
  65. package/dist/lib/util/MdxComponents.js.map +1 -1
  66. package/dist/vite/config.js +3 -7
  67. package/dist/vite/config.js.map +1 -1
  68. package/lib/{AuthenticationPlugin-BCYuduZ9.js → AuthenticationPlugin-4ip08maU.js} +3 -3
  69. package/lib/{AuthenticationPlugin-BCYuduZ9.js.map → AuthenticationPlugin-4ip08maU.js.map} +1 -1
  70. package/lib/Callout-B_sEhkYd.js +211 -0
  71. package/lib/Callout-B_sEhkYd.js.map +1 -0
  72. package/lib/{Dialog-mi6BrnrM.js → Dialog-sbgekbjb.js} +48 -33
  73. package/lib/{Dialog-mi6BrnrM.js.map → Dialog-sbgekbjb.js.map} +1 -1
  74. package/lib/{Markdown-DofXBcqg.js → Markdown-DZXjQjpH.js} +4099 -3848
  75. package/lib/Markdown-DZXjQjpH.js.map +1 -0
  76. package/lib/{MdxPage-KJcNWIgt.js → MdxPage-52vRwa_7.js} +13 -13
  77. package/lib/{MdxPage-KJcNWIgt.js.map → MdxPage-52vRwa_7.js.map} +1 -1
  78. package/lib/{OasProvider-HcqBeC4H.js → OasProvider-CR2nG1Eg.js} +4 -4
  79. package/lib/{OasProvider-HcqBeC4H.js.map → OasProvider-CR2nG1Eg.js.map} +1 -1
  80. package/lib/{OperationList-C3wnbFxp.js → OperationList-DndcCJUG.js} +1097 -1052
  81. package/lib/{OperationList-C3wnbFxp.js.map → OperationList-DndcCJUG.js.map} +1 -1
  82. package/lib/{Select-Co6MuS4j.js → Select-FAYHOYTy.js} +35 -35
  83. package/lib/{Select-Co6MuS4j.js.map → Select-FAYHOYTy.js.map} +1 -1
  84. package/lib/{SlotletProvider-CYFNHuok.js → SlotletProvider-TydSHROc.js} +4 -4
  85. package/lib/{SlotletProvider-CYFNHuok.js.map → SlotletProvider-TydSHROc.js.map} +1 -1
  86. package/lib/{chunk-IR6S3I6Y-CRDBmIgK.js → chunk-HA7DTUK3-ZGg2W6yV.js} +276 -276
  87. package/lib/chunk-HA7DTUK3-ZGg2W6yV.js.map +1 -0
  88. package/lib/{hook-LTe5qHSc.js → hook-CfCFKZ-2.js} +10 -7
  89. package/lib/{hook-LTe5qHSc.js.map → hook-CfCFKZ-2.js.map} +1 -1
  90. package/lib/index-DK7IuUyR.js +2201 -0
  91. package/lib/index-DK7IuUyR.js.map +1 -0
  92. package/lib/index.esm-CltAN0Tf.js +711 -0
  93. package/lib/index.esm-CltAN0Tf.js.map +1 -0
  94. package/lib/objectEntries-BS7aAgOm.js +12 -0
  95. package/lib/objectEntries-BS7aAgOm.js.map +1 -0
  96. package/lib/ui/Checkbox.js +15 -25
  97. package/lib/ui/Checkbox.js.map +1 -1
  98. package/lib/ui/Command.js +1 -1
  99. package/lib/ui/Select.js +1 -1
  100. package/lib/ui/Select.js.map +1 -1
  101. package/lib/ui/SyntaxHighlight.js +483 -502
  102. package/lib/ui/SyntaxHighlight.js.map +1 -1
  103. package/lib/{useExposedProps-D76yras4.js → useExposedProps-BslIn-FE.js} +2 -2
  104. package/lib/{useExposedProps-D76yras4.js.map → useExposedProps-BslIn-FE.js.map} +1 -1
  105. package/lib/zudoku.auth-auth0.js +1 -1
  106. package/lib/zudoku.auth-clerk.js +2 -2
  107. package/lib/zudoku.auth-openid.js +3 -3
  108. package/lib/zudoku.components.js +1390 -32
  109. package/lib/zudoku.components.js.map +1 -1
  110. package/lib/zudoku.hooks.js +1 -1
  111. package/lib/zudoku.plugin-api-catalog.js +5 -5
  112. package/lib/zudoku.plugin-api-keys.js +4 -4
  113. package/lib/zudoku.plugin-custom-pages.js +2 -2
  114. package/lib/zudoku.plugin-markdown.js +1 -1
  115. package/lib/zudoku.plugin-openapi.js +3 -3
  116. package/lib/zudoku.plugin-redirect.js +1 -1
  117. package/lib/zudoku.plugin-search-pagefind.js +84 -154
  118. package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
  119. package/package.json +5 -5
  120. package/src/lib/components/AnchorLink.tsx +7 -7
  121. package/src/lib/components/navigation/SidebarItem.tsx +8 -23
  122. package/src/lib/core/ZudokuContext.ts +4 -0
  123. package/src/lib/plugins/openapi/OperationList.tsx +73 -33
  124. package/src/lib/plugins/openapi/OperationListItem.tsx +105 -92
  125. package/src/lib/plugins/openapi/graphql/gql.ts +3 -3
  126. package/src/lib/plugins/openapi/graphql/graphql.ts +3 -0
  127. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +30 -32
  128. package/src/lib/plugins/openapi/playground/Headers.tsx +0 -1
  129. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +74 -0
  130. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +54 -0
  131. package/src/lib/plugins/openapi/playground/Playground.tsx +164 -133
  132. package/src/lib/plugins/openapi/playground/QueryParams.tsx +0 -1
  133. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +51 -0
  134. package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -0
  135. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +24 -4
  136. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +66 -45
  137. package/src/lib/ui/Checkbox.tsx +8 -24
  138. package/src/lib/ui/Select.tsx +1 -1
  139. package/src/lib/ui/SyntaxHighlight.tsx +94 -96
  140. package/src/lib/util/MdxComponents.tsx +2 -2
  141. package/lib/Command-CrTA1FX0.js +0 -140
  142. package/lib/Command-CrTA1FX0.js.map +0 -1
  143. package/lib/Markdown-DofXBcqg.js.map +0 -1
  144. package/lib/chunk-IR6S3I6Y-CRDBmIgK.js.map +0 -1
  145. package/lib/index-CtkRMvMw.js +0 -2052
  146. package/lib/index-CtkRMvMw.js.map +0 -1
  147. package/lib/index-vn5bsvmU.js +0 -1399
  148. package/lib/index-vn5bsvmU.js.map +0 -1
  149. package/lib/useScrollToAnchor-DKyrbZoy.js +0 -977
  150. package/lib/useScrollToAnchor-DKyrbZoy.js.map +0 -1
@@ -0,0 +1,711 @@
1
+ var ie = Object.defineProperty;
2
+ var le = (e, t, r) => t in e ? ie(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r;
3
+ var T = (e, t, r) => le(e, typeof t != "symbol" ? t + "" : t, r);
4
+ import m, { Component as F } from "react";
5
+ import { g as U } from "./_commonjsHelpers-BkfeUUK-.js";
6
+ const R = {}, Q = m.createContext(R);
7
+ function ce(e) {
8
+ const t = m.useContext(Q);
9
+ return m.useMemo(
10
+ function() {
11
+ return typeof e == "function" ? e(t) : { ...t, ...e };
12
+ },
13
+ [t, e]
14
+ );
15
+ }
16
+ function Fe(e) {
17
+ let t;
18
+ return e.disableParentContext ? t = typeof e.components == "function" ? e.components(R) : e.components || R : t = ce(e.components), m.createElement(
19
+ Q.Provider,
20
+ { value: t },
21
+ e.children
22
+ );
23
+ }
24
+ var P, V;
25
+ function ue() {
26
+ if (V) return P;
27
+ V = 1;
28
+ var e = typeof Element < "u", t = typeof Map == "function", r = typeof Set == "function", n = typeof ArrayBuffer == "function" && !!ArrayBuffer.isView;
29
+ function i(s, a) {
30
+ if (s === a) return !0;
31
+ if (s && a && typeof s == "object" && typeof a == "object") {
32
+ if (s.constructor !== a.constructor) return !1;
33
+ var l, o, c;
34
+ if (Array.isArray(s)) {
35
+ if (l = s.length, l != a.length) return !1;
36
+ for (o = l; o-- !== 0; )
37
+ if (!i(s[o], a[o])) return !1;
38
+ return !0;
39
+ }
40
+ var u;
41
+ if (t && s instanceof Map && a instanceof Map) {
42
+ if (s.size !== a.size) return !1;
43
+ for (u = s.entries(); !(o = u.next()).done; )
44
+ if (!a.has(o.value[0])) return !1;
45
+ for (u = s.entries(); !(o = u.next()).done; )
46
+ if (!i(o.value[1], a.get(o.value[0]))) return !1;
47
+ return !0;
48
+ }
49
+ if (r && s instanceof Set && a instanceof Set) {
50
+ if (s.size !== a.size) return !1;
51
+ for (u = s.entries(); !(o = u.next()).done; )
52
+ if (!a.has(o.value[0])) return !1;
53
+ return !0;
54
+ }
55
+ if (n && ArrayBuffer.isView(s) && ArrayBuffer.isView(a)) {
56
+ if (l = s.length, l != a.length) return !1;
57
+ for (o = l; o-- !== 0; )
58
+ if (s[o] !== a[o]) return !1;
59
+ return !0;
60
+ }
61
+ if (s.constructor === RegExp) return s.source === a.source && s.flags === a.flags;
62
+ if (s.valueOf !== Object.prototype.valueOf && typeof s.valueOf == "function" && typeof a.valueOf == "function") return s.valueOf() === a.valueOf();
63
+ if (s.toString !== Object.prototype.toString && typeof s.toString == "function" && typeof a.toString == "function") return s.toString() === a.toString();
64
+ if (c = Object.keys(s), l = c.length, l !== Object.keys(a).length) return !1;
65
+ for (o = l; o-- !== 0; )
66
+ if (!Object.prototype.hasOwnProperty.call(a, c[o])) return !1;
67
+ if (e && s instanceof Element) return !1;
68
+ for (o = l; o-- !== 0; )
69
+ if (!((c[o] === "_owner" || c[o] === "__v" || c[o] === "__o") && s.$$typeof) && !i(s[c[o]], a[c[o]]))
70
+ return !1;
71
+ return !0;
72
+ }
73
+ return s !== s && a !== a;
74
+ }
75
+ return P = function(a, l) {
76
+ try {
77
+ return i(a, l);
78
+ } catch (o) {
79
+ if ((o.message || "").match(/stack|recursion/i))
80
+ return console.warn("react-fast-compare cannot handle circular refs"), !1;
81
+ throw o;
82
+ }
83
+ }, P;
84
+ }
85
+ var fe = ue();
86
+ const pe = /* @__PURE__ */ U(fe);
87
+ var $, B;
88
+ function de() {
89
+ if (B) return $;
90
+ B = 1;
91
+ var e = function(t, r, n, i, s, a, l, o) {
92
+ if (process.env.NODE_ENV !== "production" && r === void 0)
93
+ throw new Error("invariant requires an error message argument");
94
+ if (!t) {
95
+ var c;
96
+ if (r === void 0)
97
+ c = new Error(
98
+ "Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings."
99
+ );
100
+ else {
101
+ var u = [n, i, s, a, l, o], f = 0;
102
+ c = new Error(
103
+ r.replace(/%s/g, function() {
104
+ return u[f++];
105
+ })
106
+ ), c.name = "Invariant Violation";
107
+ }
108
+ throw c.framesToPop = 1, c;
109
+ }
110
+ };
111
+ return $ = e, $;
112
+ }
113
+ var me = de();
114
+ const Y = /* @__PURE__ */ U(me);
115
+ var I, X;
116
+ function he() {
117
+ return X || (X = 1, I = function(t, r, n, i) {
118
+ var s = n ? n.call(i, t, r) : void 0;
119
+ if (s !== void 0)
120
+ return !!s;
121
+ if (t === r)
122
+ return !0;
123
+ if (typeof t != "object" || !t || typeof r != "object" || !r)
124
+ return !1;
125
+ var a = Object.keys(t), l = Object.keys(r);
126
+ if (a.length !== l.length)
127
+ return !1;
128
+ for (var o = Object.prototype.hasOwnProperty.bind(r), c = 0; c < a.length; c++) {
129
+ var u = a[c];
130
+ if (!o(u))
131
+ return !1;
132
+ var f = t[u], h = r[u];
133
+ if (s = n ? n.call(i, f, h, u) : void 0, s === !1 || s === void 0 && f !== h)
134
+ return !1;
135
+ }
136
+ return !0;
137
+ }), I;
138
+ }
139
+ var ye = he();
140
+ const Te = /* @__PURE__ */ U(ye);
141
+ var ee = /* @__PURE__ */ ((e) => (e.BASE = "base", e.BODY = "body", e.HEAD = "head", e.HTML = "html", e.LINK = "link", e.META = "meta", e.NOSCRIPT = "noscript", e.SCRIPT = "script", e.STYLE = "style", e.TITLE = "title", e.FRAGMENT = "Symbol(react.fragment)", e))(ee || {}), M = {
142
+ link: { rel: ["amphtml", "canonical", "alternate"] },
143
+ script: { type: ["application/ld+json"] },
144
+ meta: {
145
+ charset: "",
146
+ name: ["generator", "robots", "description"],
147
+ property: [
148
+ "og:type",
149
+ "og:title",
150
+ "og:url",
151
+ "og:image",
152
+ "og:image:alt",
153
+ "og:description",
154
+ "twitter:url",
155
+ "twitter:title",
156
+ "twitter:description",
157
+ "twitter:image",
158
+ "twitter:image:alt",
159
+ "twitter:card",
160
+ "twitter:site"
161
+ ]
162
+ }
163
+ }, Z = Object.values(ee), K = {
164
+ accesskey: "accessKey",
165
+ charset: "charSet",
166
+ class: "className",
167
+ contenteditable: "contentEditable",
168
+ contextmenu: "contextMenu",
169
+ "http-equiv": "httpEquiv",
170
+ itemprop: "itemProp",
171
+ tabindex: "tabIndex"
172
+ }, ve = Object.entries(K).reduce(
173
+ (e, [t, r]) => (e[r] = t, e),
174
+ {}
175
+ ), y = "data-rh", C = {
176
+ DEFAULT_TITLE: "defaultTitle",
177
+ DEFER: "defer",
178
+ ENCODE_SPECIAL_CHARACTERS: "encodeSpecialCharacters",
179
+ ON_CHANGE_CLIENT_STATE: "onChangeClientState",
180
+ TITLE_TEMPLATE: "titleTemplate",
181
+ PRIORITIZE_SEO_TAGS: "prioritizeSeoTags"
182
+ }, E = (e, t) => {
183
+ for (let r = e.length - 1; r >= 0; r -= 1) {
184
+ const n = e[r];
185
+ if (Object.prototype.hasOwnProperty.call(n, t))
186
+ return n[t];
187
+ }
188
+ return null;
189
+ }, ge = (e) => {
190
+ let t = E(
191
+ e,
192
+ "title"
193
+ /* TITLE */
194
+ );
195
+ const r = E(e, C.TITLE_TEMPLATE);
196
+ if (Array.isArray(t) && (t = t.join("")), r && t)
197
+ return r.replace(/%s/g, () => t);
198
+ const n = E(e, C.DEFAULT_TITLE);
199
+ return t || n || void 0;
200
+ }, Ae = (e) => E(e, C.ON_CHANGE_CLIENT_STATE) || (() => {
201
+ }), D = (e, t) => t.filter((r) => typeof r[e] < "u").map((r) => r[e]).reduce((r, n) => ({ ...r, ...n }), {}), Ce = (e, t) => t.filter((r) => typeof r.base < "u").map((r) => r.base).reverse().reduce((r, n) => {
202
+ if (!r.length) {
203
+ const i = Object.keys(n);
204
+ for (let s = 0; s < i.length; s += 1) {
205
+ const l = i[s].toLowerCase();
206
+ if (e.indexOf(l) !== -1 && n[l])
207
+ return r.concat(n);
208
+ }
209
+ }
210
+ return r;
211
+ }, []), Ee = (e) => console && typeof console.warn == "function" && console.warn(e), b = (e, t, r) => {
212
+ const n = {};
213
+ return r.filter((i) => Array.isArray(i[e]) ? !0 : (typeof i[e] < "u" && Ee(
214
+ `Helmet: ${e} should be of type "Array". Instead found type "${typeof i[e]}"`
215
+ ), !1)).map((i) => i[e]).reverse().reduce((i, s) => {
216
+ const a = {};
217
+ s.filter((o) => {
218
+ let c;
219
+ const u = Object.keys(o);
220
+ for (let h = 0; h < u.length; h += 1) {
221
+ const p = u[h], v = p.toLowerCase();
222
+ t.indexOf(v) !== -1 && !(c === "rel" && o[c].toLowerCase() === "canonical") && !(v === "rel" && o[v].toLowerCase() === "stylesheet") && (c = v), t.indexOf(p) !== -1 && (p === "innerHTML" || p === "cssText" || p === "itemprop") && (c = p);
223
+ }
224
+ if (!c || !o[c])
225
+ return !1;
226
+ const f = o[c].toLowerCase();
227
+ return n[c] || (n[c] = {}), a[c] || (a[c] = {}), n[c][f] ? !1 : (a[c][f] = !0, !0);
228
+ }).reverse().forEach((o) => i.push(o));
229
+ const l = Object.keys(a);
230
+ for (let o = 0; o < l.length; o += 1) {
231
+ const c = l[o], u = {
232
+ ...n[c],
233
+ ...a[c]
234
+ };
235
+ n[c] = u;
236
+ }
237
+ return i;
238
+ }, []).reverse();
239
+ }, be = (e, t) => {
240
+ if (Array.isArray(e) && e.length) {
241
+ for (let r = 0; r < e.length; r += 1)
242
+ if (e[r][t])
243
+ return !0;
244
+ }
245
+ return !1;
246
+ }, Oe = (e) => ({
247
+ baseTag: Ce([
248
+ "href"
249
+ /* HREF */
250
+ ], e),
251
+ bodyAttributes: D("bodyAttributes", e),
252
+ defer: E(e, C.DEFER),
253
+ encode: E(e, C.ENCODE_SPECIAL_CHARACTERS),
254
+ htmlAttributes: D("htmlAttributes", e),
255
+ linkTags: b(
256
+ "link",
257
+ [
258
+ "rel",
259
+ "href"
260
+ /* HREF */
261
+ ],
262
+ e
263
+ ),
264
+ metaTags: b(
265
+ "meta",
266
+ [
267
+ "name",
268
+ "charset",
269
+ "http-equiv",
270
+ "property",
271
+ "itemprop"
272
+ /* ITEM_PROP */
273
+ ],
274
+ e
275
+ ),
276
+ noscriptTags: b("noscript", [
277
+ "innerHTML"
278
+ /* INNER_HTML */
279
+ ], e),
280
+ onChangeClientState: Ae(e),
281
+ scriptTags: b(
282
+ "script",
283
+ [
284
+ "src",
285
+ "innerHTML"
286
+ /* INNER_HTML */
287
+ ],
288
+ e
289
+ ),
290
+ styleTags: b("style", [
291
+ "cssText"
292
+ /* CSS_TEXT */
293
+ ], e),
294
+ title: ge(e),
295
+ titleAttributes: D("titleAttributes", e),
296
+ prioritizeSeoTags: be(e, C.PRIORITIZE_SEO_TAGS)
297
+ }), te = (e) => Array.isArray(e) ? e.join("") : e, we = (e, t) => {
298
+ const r = Object.keys(e);
299
+ for (let n = 0; n < r.length; n += 1)
300
+ if (t[r[n]] && t[r[n]].includes(e[r[n]]))
301
+ return !0;
302
+ return !1;
303
+ }, H = (e, t) => Array.isArray(e) ? e.reduce(
304
+ (r, n) => (we(n, t) ? r.priority.push(n) : r.default.push(n), r),
305
+ { priority: [], default: [] }
306
+ ) : { default: e, priority: [] }, G = (e, t) => ({
307
+ ...e,
308
+ [t]: void 0
309
+ }), Se = [
310
+ "noscript",
311
+ "script",
312
+ "style"
313
+ /* STYLE */
314
+ ], k = (e, t = !0) => t === !1 ? String(e) : String(e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;"), re = (e) => Object.keys(e).reduce((t, r) => {
315
+ const n = typeof e[r] < "u" ? `${r}="${e[r]}"` : `${r}`;
316
+ return t ? `${t} ${n}` : n;
317
+ }, ""), xe = (e, t, r, n) => {
318
+ const i = re(r), s = te(t);
319
+ return i ? `<${e} ${y}="true" ${i}>${k(
320
+ s,
321
+ n
322
+ )}</${e}>` : `<${e} ${y}="true">${k(
323
+ s,
324
+ n
325
+ )}</${e}>`;
326
+ }, Pe = (e, t, r = !0) => t.reduce((n, i) => {
327
+ const s = i, a = Object.keys(s).filter(
328
+ (c) => !(c === "innerHTML" || c === "cssText")
329
+ ).reduce((c, u) => {
330
+ const f = typeof s[u] > "u" ? u : `${u}="${k(s[u], r)}"`;
331
+ return c ? `${c} ${f}` : f;
332
+ }, ""), l = s.innerHTML || s.cssText || "", o = Se.indexOf(e) === -1;
333
+ return `${n}<${e} ${y}="true" ${a}${o ? "/>" : `>${l}</${e}>`}`;
334
+ }, ""), ne = (e, t = {}) => Object.keys(e).reduce((r, n) => {
335
+ const i = K[n];
336
+ return r[i || n] = e[n], r;
337
+ }, t), $e = (e, t, r) => {
338
+ const n = {
339
+ key: t,
340
+ [y]: !0
341
+ }, i = ne(r, n);
342
+ return [m.createElement("title", i, t)];
343
+ }, x = (e, t) => t.map((r, n) => {
344
+ const i = {
345
+ key: n,
346
+ [y]: !0
347
+ };
348
+ return Object.keys(r).forEach((s) => {
349
+ const l = K[s] || s;
350
+ if (l === "innerHTML" || l === "cssText") {
351
+ const o = r.innerHTML || r.cssText;
352
+ i.dangerouslySetInnerHTML = { __html: o };
353
+ } else
354
+ i[l] = r[s];
355
+ }), m.createElement(e, i);
356
+ }), d = (e, t, r = !0) => {
357
+ switch (e) {
358
+ case "title":
359
+ return {
360
+ toComponent: () => $e(e, t.title, t.titleAttributes),
361
+ toString: () => xe(e, t.title, t.titleAttributes, r)
362
+ };
363
+ case "bodyAttributes":
364
+ case "htmlAttributes":
365
+ return {
366
+ toComponent: () => ne(t),
367
+ toString: () => re(t)
368
+ };
369
+ default:
370
+ return {
371
+ toComponent: () => x(e, t),
372
+ toString: () => Pe(e, t, r)
373
+ };
374
+ }
375
+ }, Ie = ({ metaTags: e, linkTags: t, scriptTags: r, encode: n }) => {
376
+ const i = H(e, M.meta), s = H(t, M.link), a = H(r, M.script);
377
+ return {
378
+ priorityMethods: {
379
+ toComponent: () => [
380
+ ...x("meta", i.priority),
381
+ ...x("link", s.priority),
382
+ ...x("script", a.priority)
383
+ ],
384
+ toString: () => (
385
+ // generate all the tags as strings and concatenate them
386
+ `${d("meta", i.priority, n)} ${d(
387
+ "link",
388
+ s.priority,
389
+ n
390
+ )} ${d("script", a.priority, n)}`
391
+ )
392
+ },
393
+ metaTags: i.default,
394
+ linkTags: s.default,
395
+ scriptTags: a.default
396
+ };
397
+ }, Me = (e) => {
398
+ const {
399
+ baseTag: t,
400
+ bodyAttributes: r,
401
+ encode: n = !0,
402
+ htmlAttributes: i,
403
+ noscriptTags: s,
404
+ styleTags: a,
405
+ title: l = "",
406
+ titleAttributes: o,
407
+ prioritizeSeoTags: c
408
+ } = e;
409
+ let { linkTags: u, metaTags: f, scriptTags: h } = e, p = {
410
+ toComponent: () => {
411
+ },
412
+ toString: () => ""
413
+ };
414
+ return c && ({ priorityMethods: p, linkTags: u, metaTags: f, scriptTags: h } = Ie(e)), {
415
+ priority: p,
416
+ base: d("base", t, n),
417
+ bodyAttributes: d("bodyAttributes", r, n),
418
+ htmlAttributes: d("htmlAttributes", i, n),
419
+ link: d("link", u, n),
420
+ meta: d("meta", f, n),
421
+ noscript: d("noscript", s, n),
422
+ script: d("script", h, n),
423
+ style: d("style", a, n),
424
+ title: d("title", { title: l, titleAttributes: o }, n)
425
+ };
426
+ }, j = Me, S = [], se = !!(typeof window < "u" && window.document && window.document.createElement), q = class {
427
+ constructor(e, t) {
428
+ T(this, "instances", []);
429
+ T(this, "canUseDOM", se);
430
+ T(this, "context");
431
+ T(this, "value", {
432
+ setHelmet: (e) => {
433
+ this.context.helmet = e;
434
+ },
435
+ helmetInstances: {
436
+ get: () => this.canUseDOM ? S : this.instances,
437
+ add: (e) => {
438
+ (this.canUseDOM ? S : this.instances).push(e);
439
+ },
440
+ remove: (e) => {
441
+ const t = (this.canUseDOM ? S : this.instances).indexOf(e);
442
+ (this.canUseDOM ? S : this.instances).splice(t, 1);
443
+ }
444
+ }
445
+ });
446
+ this.context = e, this.canUseDOM = t || !1, t || (e.helmet = j({
447
+ baseTag: [],
448
+ bodyAttributes: {},
449
+ htmlAttributes: {},
450
+ linkTags: [],
451
+ metaTags: [],
452
+ noscriptTags: [],
453
+ scriptTags: [],
454
+ styleTags: [],
455
+ title: "",
456
+ titleAttributes: {}
457
+ }));
458
+ }
459
+ }, De = {}, oe = m.createContext(De), g, He = (g = class extends F {
460
+ constructor(r) {
461
+ super(r);
462
+ T(this, "helmetData");
463
+ this.helmetData = new q(this.props.context || {}, g.canUseDOM);
464
+ }
465
+ render() {
466
+ return /* @__PURE__ */ m.createElement(oe.Provider, { value: this.helmetData.value }, this.props.children);
467
+ }
468
+ }, T(g, "canUseDOM", se), g), A = (e, t) => {
469
+ const r = document.head || document.querySelector(
470
+ "head"
471
+ /* HEAD */
472
+ ), n = r.querySelectorAll(`${e}[${y}]`), i = [].slice.call(n), s = [];
473
+ let a;
474
+ return t && t.length && t.forEach((l) => {
475
+ const o = document.createElement(e);
476
+ for (const c in l)
477
+ if (Object.prototype.hasOwnProperty.call(l, c))
478
+ if (c === "innerHTML")
479
+ o.innerHTML = l.innerHTML;
480
+ else if (c === "cssText")
481
+ o.styleSheet ? o.styleSheet.cssText = l.cssText : o.appendChild(document.createTextNode(l.cssText));
482
+ else {
483
+ const u = c, f = typeof l[u] > "u" ? "" : l[u];
484
+ o.setAttribute(c, f);
485
+ }
486
+ o.setAttribute(y, "true"), i.some((c, u) => (a = u, o.isEqualNode(c))) ? i.splice(a, 1) : s.push(o);
487
+ }), i.forEach((l) => {
488
+ var o;
489
+ return (o = l.parentNode) == null ? void 0 : o.removeChild(l);
490
+ }), s.forEach((l) => r.appendChild(l)), {
491
+ oldTags: i,
492
+ newTags: s
493
+ };
494
+ }, L = (e, t) => {
495
+ const r = document.getElementsByTagName(e)[0];
496
+ if (!r)
497
+ return;
498
+ const n = r.getAttribute(y), i = n ? n.split(",") : [], s = [...i], a = Object.keys(t);
499
+ for (const l of a) {
500
+ const o = t[l] || "";
501
+ r.getAttribute(l) !== o && r.setAttribute(l, o), i.indexOf(l) === -1 && i.push(l);
502
+ const c = s.indexOf(l);
503
+ c !== -1 && s.splice(c, 1);
504
+ }
505
+ for (let l = s.length - 1; l >= 0; l -= 1)
506
+ r.removeAttribute(s[l]);
507
+ i.length === s.length ? r.removeAttribute(y) : r.getAttribute(y) !== a.join(",") && r.setAttribute(y, a.join(","));
508
+ }, _e = (e, t) => {
509
+ typeof e < "u" && document.title !== e && (document.title = te(e)), L("title", t);
510
+ }, W = (e, t) => {
511
+ const {
512
+ baseTag: r,
513
+ bodyAttributes: n,
514
+ htmlAttributes: i,
515
+ linkTags: s,
516
+ metaTags: a,
517
+ noscriptTags: l,
518
+ onChangeClientState: o,
519
+ scriptTags: c,
520
+ styleTags: u,
521
+ title: f,
522
+ titleAttributes: h
523
+ } = e;
524
+ L("body", n), L("html", i), _e(f, h);
525
+ const p = {
526
+ baseTag: A("base", r),
527
+ linkTags: A("link", s),
528
+ metaTags: A("meta", a),
529
+ noscriptTags: A("noscript", l),
530
+ scriptTags: A("script", c),
531
+ styleTags: A("style", u)
532
+ }, v = {}, z = {};
533
+ Object.keys(p).forEach((w) => {
534
+ const { newTags: N, oldTags: ae } = p[w];
535
+ N.length && (v[w] = N), ae.length && (z[w] = p[w].oldTags);
536
+ }), t && t(), o(e, v, z);
537
+ }, O = null, Re = (e) => {
538
+ O && cancelAnimationFrame(O), e.defer ? O = requestAnimationFrame(() => {
539
+ W(e, () => {
540
+ O = null;
541
+ });
542
+ }) : (W(e), O = null);
543
+ }, ke = Re, J = class extends F {
544
+ constructor() {
545
+ super(...arguments);
546
+ T(this, "rendered", !1);
547
+ }
548
+ shouldComponentUpdate(t) {
549
+ return !Te(t, this.props);
550
+ }
551
+ componentDidUpdate() {
552
+ this.emitChange();
553
+ }
554
+ componentWillUnmount() {
555
+ const { helmetInstances: t } = this.props.context;
556
+ t.remove(this), this.emitChange();
557
+ }
558
+ emitChange() {
559
+ const { helmetInstances: t, setHelmet: r } = this.props.context;
560
+ let n = null;
561
+ const i = Oe(
562
+ t.get().map((s) => {
563
+ const a = { ...s.props };
564
+ return delete a.context, a;
565
+ })
566
+ );
567
+ He.canUseDOM ? ke(i) : j && (n = j(i)), r(n);
568
+ }
569
+ // componentWillMount will be deprecated
570
+ // for SSR, initialize on first render
571
+ // constructor is also unsafe in StrictMode
572
+ init() {
573
+ if (this.rendered)
574
+ return;
575
+ this.rendered = !0;
576
+ const { helmetInstances: t } = this.props.context;
577
+ t.add(this), this.emitChange();
578
+ }
579
+ render() {
580
+ return this.init(), null;
581
+ }
582
+ }, _, Ue = (_ = class extends F {
583
+ shouldComponentUpdate(e) {
584
+ return !pe(G(this.props, "helmetData"), G(e, "helmetData"));
585
+ }
586
+ mapNestedChildrenToProps(e, t) {
587
+ if (!t)
588
+ return null;
589
+ switch (e.type) {
590
+ case "script":
591
+ case "noscript":
592
+ return {
593
+ innerHTML: t
594
+ };
595
+ case "style":
596
+ return {
597
+ cssText: t
598
+ };
599
+ default:
600
+ throw new Error(
601
+ `<${e.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`
602
+ );
603
+ }
604
+ }
605
+ flattenArrayTypeChildren(e, t, r, n) {
606
+ return {
607
+ ...t,
608
+ [e.type]: [
609
+ ...t[e.type] || [],
610
+ {
611
+ ...r,
612
+ ...this.mapNestedChildrenToProps(e, n)
613
+ }
614
+ ]
615
+ };
616
+ }
617
+ mapObjectTypeChildren(e, t, r, n) {
618
+ switch (e.type) {
619
+ case "title":
620
+ return {
621
+ ...t,
622
+ [e.type]: n,
623
+ titleAttributes: { ...r }
624
+ };
625
+ case "body":
626
+ return {
627
+ ...t,
628
+ bodyAttributes: { ...r }
629
+ };
630
+ case "html":
631
+ return {
632
+ ...t,
633
+ htmlAttributes: { ...r }
634
+ };
635
+ default:
636
+ return {
637
+ ...t,
638
+ [e.type]: { ...r }
639
+ };
640
+ }
641
+ }
642
+ mapArrayTypeChildrenToProps(e, t) {
643
+ let r = { ...t };
644
+ return Object.keys(e).forEach((n) => {
645
+ r = {
646
+ ...r,
647
+ [n]: e[n]
648
+ };
649
+ }), r;
650
+ }
651
+ warnOnInvalidChildren(e, t) {
652
+ return Y(
653
+ Z.some((r) => e.type === r),
654
+ typeof e.type == "function" ? "You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information." : `Only elements types ${Z.join(
655
+ ", "
656
+ )} are allowed. Helmet does not support rendering <${e.type}> elements. Refer to our API for more information.`
657
+ ), Y(
658
+ !t || typeof t == "string" || Array.isArray(t) && !t.some((r) => typeof r != "string"),
659
+ `Helmet expects a string as a child of <${e.type}>. Did you forget to wrap your children in braces? ( <${e.type}>{\`\`}</${e.type}> ) Refer to our API for more information.`
660
+ ), !0;
661
+ }
662
+ mapChildrenToProps(e, t) {
663
+ let r = {};
664
+ return m.Children.forEach(e, (n) => {
665
+ if (!n || !n.props)
666
+ return;
667
+ const { children: i, ...s } = n.props, a = Object.keys(s).reduce((o, c) => (o[ve[c] || c] = s[c], o), {});
668
+ let { type: l } = n;
669
+ switch (typeof l == "symbol" ? l = l.toString() : this.warnOnInvalidChildren(n, i), l) {
670
+ case "Symbol(react.fragment)":
671
+ t = this.mapChildrenToProps(i, t);
672
+ break;
673
+ case "link":
674
+ case "meta":
675
+ case "noscript":
676
+ case "script":
677
+ case "style":
678
+ r = this.flattenArrayTypeChildren(
679
+ n,
680
+ r,
681
+ a,
682
+ i
683
+ );
684
+ break;
685
+ default:
686
+ t = this.mapObjectTypeChildren(n, t, a, i);
687
+ break;
688
+ }
689
+ }), this.mapArrayTypeChildrenToProps(r, t);
690
+ }
691
+ render() {
692
+ const { children: e, ...t } = this.props;
693
+ let r = { ...t }, { helmetData: n } = t;
694
+ if (e && (r = this.mapChildrenToProps(e, r)), n && !(n instanceof q)) {
695
+ const i = n;
696
+ n = new q(i.context, !0), delete r.helmetData;
697
+ }
698
+ return n ? /* @__PURE__ */ m.createElement(J, { ...r, context: n.value }) : /* @__PURE__ */ m.createElement(oe.Consumer, null, (i) => /* @__PURE__ */ m.createElement(J, { ...r, context: i }));
699
+ }
700
+ }, T(_, "defaultProps", {
701
+ defer: !0,
702
+ encodeSpecialCharacters: !0,
703
+ prioritizeSeoTags: !1
704
+ }), _);
705
+ export {
706
+ Ue as H,
707
+ Fe as M,
708
+ He as a,
709
+ ce as u
710
+ };
711
+ //# sourceMappingURL=index.esm-CltAN0Tf.js.map