@epam/ai-dial-chat-hooks 1.1.0-dev.423 → 1.1.0-dev.430

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 (178) hide show
  1. package/{api-error-DuLNy43N.js → api-error/api-error.js} +1 -1
  2. package/api-transport/create-csrf-middleware.js +21 -0
  3. package/api-transport/create-unauthorized-middleware.js +41 -0
  4. package/attachment/useAttachmentAction/useAttachmentAction.js +74 -0
  5. package/attachment/useAttachmentValidation/useAttachmentValidation.js +35 -0
  6. package/attachments.js +3 -2
  7. package/catalog/catalog-derivations.js +10 -0
  8. package/catalog/catalog-primary-action.js +21 -0
  9. package/catalog/create-publish-api.js +27 -0
  10. package/catalog/deployment-endpoint-url.js +34 -0
  11. package/{deployment-id-CxWgJTs9.js → catalog/deployment-id.js} +1 -1
  12. package/catalog/entity-details.js +6 -0
  13. package/catalog/map-deployment-limits-to-catalog.js +73 -0
  14. package/catalog/map-deployment-limits-to-input.js +14 -0
  15. package/catalog/map-deployment-to-catalog-item.js +92 -0
  16. package/catalog/map-entity-details-to-catalog.js +350 -0
  17. package/catalog/map-prompt-to-catalog-item.js +49 -0
  18. package/catalog/map-skill-to-catalog-item.js +123 -0
  19. package/catalog/mcp-endpoint-url.js +26 -0
  20. package/catalog/publish.js +18 -0
  21. package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +109 -0
  22. package/catalog/useCatalogItemDetails.js +101 -0
  23. package/catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js +146 -0
  24. package/catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js +50 -0
  25. package/catalog/usePublishFolders/usePublishFolders.js +72 -0
  26. package/catalog.js +22 -3
  27. package/conversation/announcement-message.js +42 -0
  28. package/conversation/conversation-transfer/async.js +18 -0
  29. package/conversation/conversation-transfer/attachment-refs.js +11 -0
  30. package/conversation/conversation-transfer/build-upload-path.js +27 -0
  31. package/{date-BeuD8G79.js → conversation/conversation-transfer/date.js} +1 -1
  32. package/conversation/conversation-transfer/dial-file-resolve.js +18 -0
  33. package/conversation/conversation-transfer/export-conversation.js +32 -0
  34. package/conversation/conversation-transfer/import-conversation.js +93 -0
  35. package/conversation/conversation-transfer/progress.js +39 -0
  36. package/conversation/conversation-transfer/queue.js +84 -0
  37. package/conversation/conversation-transfer/types.js +9 -0
  38. package/conversation/conversation-transfer/zip-export.js +19 -0
  39. package/conversation/conversation-transfer/zip-import.js +29 -0
  40. package/conversation/create-chat-stream-api.js +96 -0
  41. package/conversation/deriveConversationRowActionState/deriveConversationRowActionState.js +14 -0
  42. package/conversation/display-name-watch.js +5 -0
  43. package/conversation/footer-message.js +23 -0
  44. package/conversation/get-model-id-from-conversation-id.js +14 -0
  45. package/conversation/greeting.js +7 -0
  46. package/conversation/message-factory.js +19 -0
  47. package/conversation/message-utils.js +13 -0
  48. package/conversation/overlay-messages.js +8 -0
  49. package/conversation/quick-app-conversation-starters.js +29 -0
  50. package/conversation/starter-option.js +27 -0
  51. package/conversation/useActiveConversationSync/useActiveConversationSync.js +19 -0
  52. package/conversation/useAsyncConfirmDialog/useAsyncConfirmDialog.js +39 -0
  53. package/conversation/useAttachmentUpload/useAttachmentUpload.js +33 -0
  54. package/conversation/useConversationExport/useConversationExport.js +285 -0
  55. package/conversation/useConversationHandlers/attachment-to-dto.js +13 -0
  56. package/conversation/useConversationHandlers/message-factory.js +21 -0
  57. package/conversation/useConversationHandlers/message-utils.js +8 -0
  58. package/conversation/useConversationHandlers/starter-option.js +11 -0
  59. package/conversation/useConversationHandlers/useConversationHandlers.js +263 -0
  60. package/conversation/useConversationImport/useConversationImport.js +239 -0
  61. package/conversation/useConversationLookupMaps/useConversationLookupMaps.js +11 -0
  62. package/conversation/useConversationPanelItems/useConversationPanelItems.js +35 -0
  63. package/{useConversationScroll-CliIMnjP.js → conversation/useConversationScroll/useConversationScroll.js} +1 -1
  64. package/conversation/useConversationStream/apply-chunk.js +78 -0
  65. package/conversation/useConversationStream/buffered-generation.js +18 -0
  66. package/conversation/useConversationStream/conversation-path.js +8 -0
  67. package/conversation/useConversationStream/generation-resume.js +126 -0
  68. package/conversation/useConversationStream/useConversationStream.js +148 -0
  69. package/conversation/useImportFilePicker/useImportFilePicker.js +20 -0
  70. package/conversation/useTranscribeAudio/audio-transcription-error.js +12 -0
  71. package/conversation/useTranscribeAudio/transcription-retry.js +38 -0
  72. package/conversation/useTranscribeAudio/useTranscribeAudio.js +41 -0
  73. package/{useConversationSources-DKaKvjXZ.js → conversation-sources/useConversationSources/useConversationSources.js} +1 -1
  74. package/conversation-sources.js +1 -1
  75. package/conversation-transfer.js +7 -3
  76. package/conversation.d.ts +66 -0
  77. package/conversation.js +31 -2
  78. package/file-manager.d.ts +3 -4
  79. package/file-manager.js +28 -3
  80. package/files/annotation.js +15 -0
  81. package/files/attachment-canvas.js +218 -0
  82. package/files/attachment-dto-to-display.js +15 -0
  83. package/files/attachment-types.js +16 -0
  84. package/files/create-files-api.js +40 -0
  85. package/files/create-upload-file-with-progress.js +42 -0
  86. package/files/dial-file-manager-copy-move.util.js +55 -0
  87. package/files/dial-file-manager-mapping.util.js +140 -0
  88. package/files/dial-file-manager-path.util.js +72 -0
  89. package/files/dial-file-manager.model.js +25 -0
  90. package/files/dial-file-manager.types.js +10 -0
  91. package/files/dial-file-to-attachment.js +37 -0
  92. package/files/dial-file.js +30 -0
  93. package/files/dial-files-api.js +6 -0
  94. package/files/download-destination.js +6 -0
  95. package/files/file-manager-variant.js +11 -0
  96. package/files/file-name.js +19 -0
  97. package/files/prepare-download-destination.js +24 -0
  98. package/files/resolve-dial-file-api-path.js +33 -0
  99. package/files/source-content.js +37 -0
  100. package/files/useDialFileListing/useDialFileListing.js +295 -0
  101. package/files/useDialFileManager/useDialFileManager.js +146 -0
  102. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +23 -0
  103. package/files/useDialFileMetadata/useDialFileMetadata.js +42 -0
  104. package/files/useDialFileMutations/useDialFileMutations.js +359 -0
  105. package/files/useDialFileSharing/useDialFileSharing.js +70 -0
  106. package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +156 -0
  107. package/index.d.ts +69 -4
  108. package/index.js +134 -28
  109. package/mcp-apps/mcp-apps-api-client.js +48 -0
  110. package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +26 -0
  111. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +26 -0
  112. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +71 -0
  113. package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +58 -0
  114. package/mcp-apps.js +6 -2
  115. package/oauth/authorize-url.js +12 -0
  116. package/oauth/handshake.js +65 -0
  117. package/oauth/popup.js +29 -0
  118. package/oauth/toolset-id.js +10 -0
  119. package/oauth/types.js +24 -0
  120. package/oauth/useOAuthCallbackCompletion/useOAuthCallbackCompletion.js +94 -0
  121. package/oauth/useToolsetLogin/useToolsetLogin.js +73 -0
  122. package/oauth.js +9 -3
  123. package/package.json +35 -23
  124. package/prompt/export-prompt.js +28 -0
  125. package/prompt/prompt-resource.js +15 -0
  126. package/prompt/prompt.js +12 -0
  127. package/prompt/usePromptsState/usePromptsState.js +42 -0
  128. package/scheduled-task/scheduled-task-mapping.js +6 -0
  129. package/{scheduled-task-trigger-D9RZCk52.js → scheduled-task/scheduled-task-trigger.js} +39 -40
  130. package/scheduled-tasks.js +3 -2
  131. package/scroll-anchoring.js +1 -1
  132. package/shared/application-schema.js +4 -0
  133. package/shared/browser-timezone.js +10 -0
  134. package/{cron-weekday-B4w29eAC.js → shared/cron-weekday.js} +1 -1
  135. package/shared/custom-apps.js +30 -0
  136. package/shared/external-services.js +18 -0
  137. package/{formatting-CZyyxBG3.js → shared/formatting.js} +1 -1
  138. package/{prompt-resource-Bt1I-8ri.js → shared/locale.js} +2 -13
  139. package/{string-utils-iBi2Y55C.js → shared/string-utils.js} +1 -1
  140. package/shared/toolset-login-events.js +13 -0
  141. package/sharing.js +3 -3
  142. package/skill/skill-file-batch-validation.js +48 -0
  143. package/skill/skill-file-preview.js +15 -0
  144. package/skill/skill-manifest.js +70 -0
  145. package/skill/skill-types.js +15 -0
  146. package/skill/skill.js +48 -0
  147. package/skill/useSkillEditorLoad.js +103 -0
  148. package/skill/useSkillEditorSubmit.js +135 -0
  149. package/skill/useSkillFileActions.js +99 -0
  150. package/skill/useSkillFilePreview.js +29 -0
  151. package/{useSkillsState-BoLlwmzb.js → skill/useSkillsState/useSkillsState.js} +1 -1
  152. package/skill-editor.js +8 -3
  153. package/skills-state.js +1 -1
  154. package/source-content.d.ts +29 -0
  155. package/source-content.js +2 -0
  156. package/usage/useUsageData/useUsageData.js +32 -0
  157. package/useChatSettingsFormConfig/useChatSettingsFormConfig.js +74 -0
  158. package/{usePanelMaxWidth-BEZYuqF9.js → usePageFileDrag/usePageFileDrag.js} +1 -11
  159. package/usePanelMaxWidth/usePanelMaxWidth.js +8 -0
  160. package/{useShareLink-xkiaxATt.js → useShareLink/useShareLink.js} +1 -1
  161. package/{useShareRecipientsCount-BgwCLKY0.js → useShareRecipientsCount/useShareRecipientsCount.js} +1 -1
  162. package/useToolsMenu/useToolsMenu.js +50 -0
  163. package/useViewportWidth/useViewportWidth.js +12 -0
  164. package/utils.js +17 -7
  165. package/viewport-layout.js +4 -2
  166. package/attachment-types-AAoN9E95.js +0 -7760
  167. package/browser-Btsa0Lmr.js +0 -607
  168. package/skill-manifest-CeG6-WSK.js +0 -4056
  169. package/useAttachmentValidation-CkMTd5lA.js +0 -102
  170. package/useConversationImport-CDRs7JF1.js +0 -826
  171. package/useDialFileManagerTabConfig-CjI46lMo.js +0 -2291
  172. package/useOAuthCallbackCompletion-CvyTKLER.js +0 -93
  173. package/useOpenMcpAppCanvas-C7-AMseH.js +0 -207
  174. package/useSkillFileActions-B-VaGD20.js +0 -373
  175. package/useSkillFilePreview-B5o1n_0F.js +0 -1244
  176. package/useToolsMenu-zURpMEn1.js +0 -1882
  177. package/useToolsetLogin-B05m134e.js +0 -195
  178. package/useUsageData-D7BxloKZ.js +0 -201
@@ -1,4056 +0,0 @@
1
- import { r as e } from "./browser-Btsa0Lmr.js";
2
- import { SkillFileNodeKind as t } from "@epam/ai-dial-skill-editor";
3
- //#region ../../node_modules/yaml/browser/dist/nodes/identity.js
4
- var n = Symbol.for("yaml.alias"), r = Symbol.for("yaml.document"), i = Symbol.for("yaml.map"), a = Symbol.for("yaml.pair"), o = Symbol.for("yaml.scalar"), s = Symbol.for("yaml.seq"), c = Symbol.for("yaml.node.type"), l = (e) => !!e && typeof e == "object" && e[c] === n, u = (e) => !!e && typeof e == "object" && e[c] === r, d = (e) => !!e && typeof e == "object" && e[c] === i, f = (e) => !!e && typeof e == "object" && e[c] === a, p = (e) => !!e && typeof e == "object" && e[c] === o, m = (e) => !!e && typeof e == "object" && e[c] === s;
5
- function h(e) {
6
- if (e && typeof e == "object") switch (e[c]) {
7
- case i:
8
- case s: return !0;
9
- }
10
- return !1;
11
- }
12
- function g(e) {
13
- if (e && typeof e == "object") switch (e[c]) {
14
- case n:
15
- case i:
16
- case o:
17
- case s: return !0;
18
- }
19
- return !1;
20
- }
21
- var _ = (e) => (p(e) || h(e)) && !!e.anchor, v = Symbol("break visit"), y = Symbol("skip children"), b = Symbol("remove node");
22
- function x(e, t) {
23
- let n = T(t);
24
- u(e) ? S(null, e.contents, n, Object.freeze([e])) === b && (e.contents = null) : S(null, e, n, Object.freeze([]));
25
- }
26
- x.BREAK = v, x.SKIP = y, x.REMOVE = b;
27
- function S(e, t, n, r) {
28
- let i = E(e, t, n, r);
29
- if (g(i) || f(i)) return ee(e, r, i), S(e, i, n, r);
30
- if (typeof i != "symbol") {
31
- if (h(t)) {
32
- r = Object.freeze(r.concat(t));
33
- for (let e = 0; e < t.items.length; ++e) {
34
- let i = S(e, t.items[e], n, r);
35
- if (typeof i == "number") e = i - 1;
36
- else if (i === v) return v;
37
- else i === b && (t.items.splice(e, 1), --e);
38
- }
39
- } else if (f(t)) {
40
- r = Object.freeze(r.concat(t));
41
- let e = S("key", t.key, n, r);
42
- if (e === v) return v;
43
- e === b && (t.key = null);
44
- let i = S("value", t.value, n, r);
45
- if (i === v) return v;
46
- i === b && (t.value = null);
47
- }
48
- }
49
- return i;
50
- }
51
- async function C(e, t) {
52
- let n = T(t);
53
- u(e) ? await w(null, e.contents, n, Object.freeze([e])) === b && (e.contents = null) : await w(null, e, n, Object.freeze([]));
54
- }
55
- C.BREAK = v, C.SKIP = y, C.REMOVE = b;
56
- async function w(e, t, n, r) {
57
- let i = await E(e, t, n, r);
58
- if (g(i) || f(i)) return ee(e, r, i), w(e, i, n, r);
59
- if (typeof i != "symbol") {
60
- if (h(t)) {
61
- r = Object.freeze(r.concat(t));
62
- for (let e = 0; e < t.items.length; ++e) {
63
- let i = await w(e, t.items[e], n, r);
64
- if (typeof i == "number") e = i - 1;
65
- else if (i === v) return v;
66
- else i === b && (t.items.splice(e, 1), --e);
67
- }
68
- } else if (f(t)) {
69
- r = Object.freeze(r.concat(t));
70
- let e = await w("key", t.key, n, r);
71
- if (e === v) return v;
72
- e === b && (t.key = null);
73
- let i = await w("value", t.value, n, r);
74
- if (i === v) return v;
75
- i === b && (t.value = null);
76
- }
77
- }
78
- return i;
79
- }
80
- function T(e) {
81
- return typeof e == "object" && (e.Collection || e.Node || e.Value) ? Object.assign({
82
- Alias: e.Node,
83
- Map: e.Node,
84
- Scalar: e.Node,
85
- Seq: e.Node
86
- }, e.Value && {
87
- Map: e.Value,
88
- Scalar: e.Value,
89
- Seq: e.Value
90
- }, e.Collection && {
91
- Map: e.Collection,
92
- Seq: e.Collection
93
- }, e) : e;
94
- }
95
- function E(e, t, n, r) {
96
- if (typeof n == "function") return n(e, t, r);
97
- if (d(t)) return n.Map?.(e, t, r);
98
- if (m(t)) return n.Seq?.(e, t, r);
99
- if (f(t)) return n.Pair?.(e, t, r);
100
- if (p(t)) return n.Scalar?.(e, t, r);
101
- if (l(t)) return n.Alias?.(e, t, r);
102
- }
103
- function ee(e, t, n) {
104
- let r = t[t.length - 1];
105
- if (h(r)) r.items[e] = n;
106
- else if (f(r)) e === "key" ? r.key = n : r.value = n;
107
- else if (u(r)) r.contents = n;
108
- else {
109
- let e = l(r) ? "alias" : "scalar";
110
- throw Error(`Cannot replace node with ${e} parent`);
111
- }
112
- }
113
- //#endregion
114
- //#region ../../node_modules/yaml/browser/dist/doc/directives.js
115
- var te = {
116
- "!": "%21",
117
- ",": "%2C",
118
- "[": "%5B",
119
- "]": "%5D",
120
- "{": "%7B",
121
- "}": "%7D"
122
- }, ne = (e) => e.replace(/[!,[\]{}]/g, (e) => te[e]), D = class e {
123
- constructor(t, n) {
124
- this.docStart = null, this.docEnd = !1, this.yaml = Object.assign({}, e.defaultYaml, t), this.tags = Object.assign({}, e.defaultTags, n);
125
- }
126
- clone() {
127
- let t = new e(this.yaml, this.tags);
128
- return t.docStart = this.docStart, t;
129
- }
130
- atDocument() {
131
- let t = new e(this.yaml, this.tags);
132
- switch (this.yaml.version) {
133
- case "1.1":
134
- this.atNextDocument = !0;
135
- break;
136
- case "1.2":
137
- this.atNextDocument = !1, this.yaml = {
138
- explicit: e.defaultYaml.explicit,
139
- version: "1.2"
140
- }, this.tags = Object.assign({}, e.defaultTags);
141
- break;
142
- }
143
- return t;
144
- }
145
- add(t, n) {
146
- this.atNextDocument &&= (this.yaml = {
147
- explicit: e.defaultYaml.explicit,
148
- version: "1.1"
149
- }, this.tags = Object.assign({}, e.defaultTags), !1);
150
- let r = t.trim().split(/[ \t]+/), i = r.shift();
151
- switch (i) {
152
- case "%TAG": {
153
- if (r.length !== 2 && (n(0, "%TAG directive should contain exactly two parts"), r.length < 2)) return !1;
154
- let [e, t] = r;
155
- return this.tags[e] = t, !0;
156
- }
157
- case "%YAML": {
158
- if (this.yaml.explicit = !0, r.length !== 1) return n(0, "%YAML directive should contain exactly one part"), !1;
159
- let [e] = r;
160
- if (e === "1.1" || e === "1.2") return this.yaml.version = e, !0;
161
- {
162
- let t = /^\d+\.\d+$/.test(e);
163
- return n(6, `Unsupported YAML version ${e}`, t), !1;
164
- }
165
- }
166
- default: return n(0, `Unknown directive ${i}`, !0), !1;
167
- }
168
- }
169
- tagName(e, t) {
170
- if (e === "!") return "!";
171
- if (e[0] !== "!") return t(`Not a valid tag: ${e}`), null;
172
- if (e[1] === "<") {
173
- let n = e.slice(2, -1);
174
- return n === "!" || n === "!!" ? (t(`Verbatim tags aren't resolved, so ${e} is invalid.`), null) : (e[e.length - 1] !== ">" && t("Verbatim tags must end with a >"), n);
175
- }
176
- let [, n, r] = e.match(/^(.*!)([^!]*)$/s);
177
- r || t(`The ${e} tag has no suffix`);
178
- let i = this.tags[n];
179
- if (i) try {
180
- return i + decodeURIComponent(r);
181
- } catch (e) {
182
- return t(String(e)), null;
183
- }
184
- return n === "!" ? e : (t(`Could not resolve tag: ${e}`), null);
185
- }
186
- tagString(e) {
187
- for (let [t, n] of Object.entries(this.tags)) if (e.startsWith(n)) return t + ne(e.substring(n.length));
188
- return e[0] === "!" ? e : `!<${e}>`;
189
- }
190
- toString(e) {
191
- let t = this.yaml.explicit ? [`%YAML ${this.yaml.version || "1.2"}`] : [], n = Object.entries(this.tags), r;
192
- if (e && n.length > 0 && g(e.contents)) {
193
- let t = {};
194
- x(e.contents, (e, n) => {
195
- g(n) && n.tag && (t[n.tag] = !0);
196
- }), r = Object.keys(t);
197
- } else r = [];
198
- for (let [i, a] of n) i === "!!" && a === "tag:yaml.org,2002:" || (!e || r.some((e) => e.startsWith(a))) && t.push(`%TAG ${i} ${a}`);
199
- return t.join("\n");
200
- }
201
- };
202
- D.defaultYaml = {
203
- explicit: !1,
204
- version: "1.2"
205
- }, D.defaultTags = { "!!": "tag:yaml.org,2002:" };
206
- //#endregion
207
- //#region ../../node_modules/yaml/browser/dist/doc/anchors.js
208
- function re(e) {
209
- if (/[\x00-\x19\s,[\]{}]/.test(e)) {
210
- let t = `Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;
211
- throw Error(t);
212
- }
213
- return !0;
214
- }
215
- function ie(e) {
216
- let t = /* @__PURE__ */ new Set();
217
- return x(e, { Value(e, n) {
218
- n.anchor && t.add(n.anchor);
219
- } }), t;
220
- }
221
- function ae(e, t) {
222
- for (let n = 1;; ++n) {
223
- let r = `${e}${n}`;
224
- if (!t.has(r)) return r;
225
- }
226
- }
227
- function oe(e, t) {
228
- let n = [], r = /* @__PURE__ */ new Map(), i = null;
229
- return {
230
- onAnchor: (r) => {
231
- n.push(r), i ??= ie(e);
232
- let a = ae(t, i);
233
- return i.add(a), a;
234
- },
235
- setAnchors: () => {
236
- for (let e of n) {
237
- let t = r.get(e);
238
- if (typeof t == "object" && t.anchor && (p(t.node) || h(t.node))) t.node.anchor = t.anchor;
239
- else {
240
- let t = /* @__PURE__ */ Error("Failed to resolve repeated object (this should not happen)");
241
- throw t.source = e, t;
242
- }
243
- }
244
- },
245
- sourceObjects: r
246
- };
247
- }
248
- //#endregion
249
- //#region ../../node_modules/yaml/browser/dist/doc/applyReviver.js
250
- function O(e, t, n, r) {
251
- if (r && typeof r == "object") if (Array.isArray(r)) for (let t = 0, n = r.length; t < n; ++t) {
252
- let n = r[t], i = O(e, r, String(t), n);
253
- i === void 0 ? delete r[t] : i !== n && (r[t] = i);
254
- }
255
- else if (r instanceof Map) for (let t of Array.from(r.keys())) {
256
- let n = r.get(t), i = O(e, r, t, n);
257
- i === void 0 ? r.delete(t) : i !== n && r.set(t, i);
258
- }
259
- else if (r instanceof Set) for (let t of Array.from(r)) {
260
- let n = O(e, r, t, t);
261
- n === void 0 ? r.delete(t) : n !== t && (r.delete(t), r.add(n));
262
- }
263
- else for (let [t, n] of Object.entries(r)) {
264
- let i = O(e, r, t, n);
265
- i === void 0 ? delete r[t] : i !== n && (r[t] = i);
266
- }
267
- return e.call(t, n, r);
268
- }
269
- //#endregion
270
- //#region ../../node_modules/yaml/browser/dist/nodes/toJS.js
271
- function k(e, t, n) {
272
- if (Array.isArray(e)) return e.map((e, t) => k(e, String(t), n));
273
- if (e && typeof e.toJSON == "function") {
274
- if (!n || !_(e)) return e.toJSON(t, n);
275
- let r = {
276
- aliasCount: 0,
277
- count: 1,
278
- res: void 0
279
- };
280
- n.anchors.set(e, r), n.onCreate = (e) => {
281
- r.res = e, delete n.onCreate;
282
- };
283
- let i = e.toJSON(t, n);
284
- return n.onCreate && n.onCreate(i), i;
285
- }
286
- return typeof e == "bigint" && !n?.keep ? Number(e) : e;
287
- }
288
- //#endregion
289
- //#region ../../node_modules/yaml/browser/dist/nodes/Node.js
290
- var se = class {
291
- constructor(e) {
292
- Object.defineProperty(this, c, { value: e });
293
- }
294
- clone() {
295
- let e = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
296
- return this.range && (e.range = this.range.slice()), e;
297
- }
298
- toJS(e, { mapAsMap: t, maxAliasCount: n, onAnchor: r, reviver: i } = {}) {
299
- if (!u(e)) throw TypeError("A document argument is required");
300
- let a = {
301
- anchors: /* @__PURE__ */ new Map(),
302
- doc: e,
303
- keep: !0,
304
- mapAsMap: t === !0,
305
- mapKeyWarned: !1,
306
- maxAliasCount: typeof n == "number" ? n : 100
307
- }, o = k(this, "", a);
308
- if (typeof r == "function") for (let { count: e, res: t } of a.anchors.values()) r(t, e);
309
- return typeof i == "function" ? O(i, { "": o }, "", o) : o;
310
- }
311
- }, ce = class extends se {
312
- constructor(e) {
313
- super(n), this.source = e, Object.defineProperty(this, "tag", { set() {
314
- throw Error("Alias nodes cannot have tags");
315
- } });
316
- }
317
- resolve(e, t) {
318
- if (t?.maxAliasCount === 0) throw ReferenceError("Alias resolution is disabled");
319
- let n;
320
- t?.aliasResolveCache ? n = t.aliasResolveCache : (n = [], x(e, { Node: (e, t) => {
321
- (l(t) || _(t)) && n.push(t);
322
- } }), t && (t.aliasResolveCache = n));
323
- let r;
324
- for (let e of n) {
325
- if (e === this) break;
326
- e.anchor === this.source && (r = e);
327
- }
328
- return r;
329
- }
330
- toJSON(e, t) {
331
- if (!t) return { source: this.source };
332
- let { anchors: n, doc: r, maxAliasCount: i } = t, a = this.resolve(r, t);
333
- if (!a) {
334
- let e = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
335
- throw ReferenceError(e);
336
- }
337
- let o = n.get(a);
338
- /* istanbul ignore if */
339
- if (o ||= (k(a, null, t), n.get(a)), o?.res === void 0) throw ReferenceError("This should not happen: Alias anchor was not resolved?");
340
- if (i >= 0 && (o.count += 1, o.aliasCount === 0 && (o.aliasCount = le(r, a, n)), o.count * o.aliasCount > i)) throw ReferenceError("Excessive alias count indicates a resource exhaustion attack");
341
- return o.res;
342
- }
343
- toString(e, t, n) {
344
- let r = `*${this.source}`;
345
- if (e) {
346
- if (re(this.source), e.options.verifyAliasOrder && !e.anchors.has(this.source)) {
347
- let e = `Unresolved alias (the anchor must be set before the alias): ${this.source}`;
348
- throw Error(e);
349
- }
350
- if (e.implicitKey) return `${r} `;
351
- }
352
- return r;
353
- }
354
- };
355
- function le(e, t, n) {
356
- if (l(t)) {
357
- let r = t.resolve(e), i = n && r && n.get(r);
358
- return i ? i.count * i.aliasCount : 0;
359
- } else if (h(t)) {
360
- let r = 0;
361
- for (let i of t.items) {
362
- let t = le(e, i, n);
363
- t > r && (r = t);
364
- }
365
- return r;
366
- } else if (f(t)) {
367
- let r = le(e, t.key, n), i = le(e, t.value, n);
368
- return Math.max(r, i);
369
- }
370
- return 1;
371
- }
372
- //#endregion
373
- //#region ../../node_modules/yaml/browser/dist/nodes/Scalar.js
374
- var ue = (e) => !e || typeof e != "function" && typeof e != "object", A = class extends se {
375
- constructor(e) {
376
- super(o), this.value = e;
377
- }
378
- toJSON(e, t) {
379
- return t?.keep ? this.value : k(this.value, e, t);
380
- }
381
- toString() {
382
- return String(this.value);
383
- }
384
- };
385
- A.BLOCK_FOLDED = "BLOCK_FOLDED", A.BLOCK_LITERAL = "BLOCK_LITERAL", A.PLAIN = "PLAIN", A.QUOTE_DOUBLE = "QUOTE_DOUBLE", A.QUOTE_SINGLE = "QUOTE_SINGLE";
386
- //#endregion
387
- //#region ../../node_modules/yaml/browser/dist/doc/createNode.js
388
- var de = "tag:yaml.org,2002:";
389
- function fe(e, t, n) {
390
- if (t) {
391
- let e = n.filter((e) => e.tag === t), r = e.find((e) => !e.format) ?? e[0];
392
- if (!r) throw Error(`Tag ${t} not found`);
393
- return r;
394
- }
395
- return n.find((t) => t.identify?.(e) && !t.format);
396
- }
397
- function j(e, t, n) {
398
- if (u(e) && (e = e.contents), g(e)) return e;
399
- if (f(e)) {
400
- let t = n.schema[i].createNode?.(n.schema, null, n);
401
- return t.items.push(e), t;
402
- }
403
- (e instanceof String || e instanceof Number || e instanceof Boolean || typeof BigInt < "u" && e instanceof BigInt) && (e = e.valueOf());
404
- let { aliasDuplicateObjects: r, onAnchor: a, onTagObj: o, schema: c, sourceObjects: l } = n, d;
405
- if (r && e && typeof e == "object") {
406
- if (d = l.get(e), d) return d.anchor ??= a(e), new ce(d.anchor);
407
- d = {
408
- anchor: null,
409
- node: null
410
- }, l.set(e, d);
411
- }
412
- t?.startsWith("!!") && (t = de + t.slice(2));
413
- let p = fe(e, t, c.tags);
414
- if (!p) {
415
- if (e && typeof e.toJSON == "function" && (e = e.toJSON()), !e || typeof e != "object") {
416
- let t = new A(e);
417
- return d && (d.node = t), t;
418
- }
419
- p = e instanceof Map ? c[i] : Symbol.iterator in Object(e) ? c[s] : c[i];
420
- }
421
- o && (o(p), delete n.onTagObj);
422
- let m = p?.createNode ? p.createNode(n.schema, e, n) : typeof p?.nodeClass?.from == "function" ? p.nodeClass.from(n.schema, e, n) : new A(e);
423
- return t ? m.tag = t : p.default || (m.tag = p.tag), d && (d.node = m), m;
424
- }
425
- //#endregion
426
- //#region ../../node_modules/yaml/browser/dist/nodes/Collection.js
427
- function pe(e, t, n) {
428
- let r = n;
429
- for (let e = t.length - 1; e >= 0; --e) {
430
- let n = t[e];
431
- if (typeof n == "number" && Number.isInteger(n) && n >= 0) {
432
- let e = [];
433
- e[n] = r, r = e;
434
- } else r = new Map([[n, r]]);
435
- }
436
- return j(r, void 0, {
437
- aliasDuplicateObjects: !1,
438
- keepUndefined: !1,
439
- onAnchor: () => {
440
- throw Error("This should not happen, please report a bug.");
441
- },
442
- schema: e,
443
- sourceObjects: /* @__PURE__ */ new Map()
444
- });
445
- }
446
- var M = (e) => e == null || typeof e == "object" && !!e[Symbol.iterator]().next().done, me = class extends se {
447
- constructor(e, t) {
448
- super(e), Object.defineProperty(this, "schema", {
449
- value: t,
450
- configurable: !0,
451
- enumerable: !1,
452
- writable: !0
453
- });
454
- }
455
- clone(e) {
456
- let t = Object.create(Object.getPrototypeOf(this), Object.getOwnPropertyDescriptors(this));
457
- return e && (t.schema = e), t.items = t.items.map((t) => g(t) || f(t) ? t.clone(e) : t), this.range && (t.range = this.range.slice()), t;
458
- }
459
- addIn(e, t) {
460
- if (M(e)) this.add(t);
461
- else {
462
- let [n, ...r] = e, i = this.get(n, !0);
463
- if (h(i)) i.addIn(r, t);
464
- else if (i === void 0 && this.schema) this.set(n, pe(this.schema, r, t));
465
- else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);
466
- }
467
- }
468
- deleteIn(e) {
469
- let [t, ...n] = e;
470
- if (n.length === 0) return this.delete(t);
471
- let r = this.get(t, !0);
472
- if (h(r)) return r.deleteIn(n);
473
- throw Error(`Expected YAML collection at ${t}. Remaining path: ${n}`);
474
- }
475
- getIn(e, t) {
476
- let [n, ...r] = e, i = this.get(n, !0);
477
- return r.length === 0 ? !t && p(i) ? i.value : i : h(i) ? i.getIn(r, t) : void 0;
478
- }
479
- hasAllNullValues(e) {
480
- return this.items.every((t) => {
481
- if (!f(t)) return !1;
482
- let n = t.value;
483
- return n == null || e && p(n) && n.value == null && !n.commentBefore && !n.comment && !n.tag;
484
- });
485
- }
486
- hasIn(e) {
487
- let [t, ...n] = e;
488
- if (n.length === 0) return this.has(t);
489
- let r = this.get(t, !0);
490
- return h(r) ? r.hasIn(n) : !1;
491
- }
492
- setIn(e, t) {
493
- let [n, ...r] = e;
494
- if (r.length === 0) this.set(n, t);
495
- else {
496
- let e = this.get(n, !0);
497
- if (h(e)) e.setIn(r, t);
498
- else if (e === void 0 && this.schema) this.set(n, pe(this.schema, r, t));
499
- else throw Error(`Expected YAML collection at ${n}. Remaining path: ${r}`);
500
- }
501
- }
502
- }, he = (e) => e.replace(/^(?!$)(?: $)?/gm, "#");
503
- function N(e, t) {
504
- return /^\n+$/.test(e) ? e.substring(1) : t ? e.replace(/^(?! *$)/gm, t) : e;
505
- }
506
- var P = (e, t, n) => e.endsWith("\n") ? N(n, t) : n.includes("\n") ? "\n" + N(n, t) : (e.endsWith(" ") ? "" : " ") + n, ge = "flow", _e = "block", ve = "quoted";
507
- function ye(e, t, n = "flow", { indentAtStart: r, lineWidth: i = 80, minContentWidth: a = 20, onFold: o, onOverflow: s } = {}) {
508
- if (!i || i < 0) return e;
509
- i < a && (a = 0);
510
- let c = Math.max(1 + a, 1 + i - t.length);
511
- if (e.length <= c) return e;
512
- let l = [], u = {}, d = i - t.length;
513
- typeof r == "number" && (r > i - Math.max(2, a) ? l.push(0) : d = i - r);
514
- let f, p, m = !1, h = -1, g = -1, _ = -1;
515
- n === "block" && (h = be(e, h, t.length), h !== -1 && (d = h + c));
516
- for (let r; r = e[h += 1];) {
517
- if (n === "quoted" && r === "\\") {
518
- switch (g = h, e[h + 1]) {
519
- case "x":
520
- h += 3;
521
- break;
522
- case "u":
523
- h += 5;
524
- break;
525
- case "U":
526
- h += 9;
527
- break;
528
- default: h += 1;
529
- }
530
- _ = h;
531
- }
532
- if (r === "\n") n === "block" && (h = be(e, h, t.length)), d = h + t.length + c, f = void 0;
533
- else {
534
- if (r === " " && p && p !== " " && p !== "\n" && p !== " ") {
535
- let t = e[h + 1];
536
- t && t !== " " && t !== "\n" && t !== " " && (f = h);
537
- }
538
- if (h >= d) if (f) l.push(f), d = f + c, f = void 0;
539
- else if (n === "quoted") {
540
- for (; p === " " || p === " ";) p = r, r = e[h += 1], m = !0;
541
- let t = h > _ + 1 ? h - 2 : g - 1;
542
- if (u[t]) return e;
543
- l.push(t), u[t] = !0, d = t + c, f = void 0;
544
- } else m = !0;
545
- }
546
- p = r;
547
- }
548
- if (m && s && s(), l.length === 0) return e;
549
- o && o();
550
- let v = e.slice(0, l[0]);
551
- for (let r = 0; r < l.length; ++r) {
552
- let i = l[r], a = l[r + 1] || e.length;
553
- i === 0 ? v = `\n${t}${e.slice(0, a)}` : (n === "quoted" && u[i] && (v += `${e[i]}\\`), v += `\n${t}${e.slice(i + 1, a)}`);
554
- }
555
- return v;
556
- }
557
- function be(e, t, n) {
558
- let r = t, i = t + 1, a = e[i];
559
- for (; a === " " || a === " ";) if (t < i + n) a = e[++t];
560
- else {
561
- do
562
- a = e[++t];
563
- while (a && a !== "\n");
564
- r = t, i = t + 1, a = e[i];
565
- }
566
- return r;
567
- }
568
- //#endregion
569
- //#region ../../node_modules/yaml/browser/dist/stringify/stringifyString.js
570
- var xe = (e, t) => ({
571
- indentAtStart: t ? e.indent.length : e.indentAtStart,
572
- lineWidth: e.options.lineWidth,
573
- minContentWidth: e.options.minContentWidth
574
- }), Se = (e) => /^(%|---|\.\.\.)/m.test(e);
575
- function Ce(e, t, n) {
576
- if (!t || t < 0) return !1;
577
- let r = t - n, i = e.length;
578
- if (i <= r) return !1;
579
- for (let t = 0, n = 0; t < i; ++t) if (e[t] === "\n") {
580
- if (t - n > r) return !0;
581
- if (n = t + 1, i - n <= r) return !1;
582
- }
583
- return !0;
584
- }
585
- function F(e, t) {
586
- let n = JSON.stringify(e);
587
- if (t.options.doubleQuotedAsJSON) return n;
588
- let { implicitKey: r } = t, i = t.options.doubleQuotedMinMultiLineLength, a = t.indent || (Se(e) ? " " : ""), o = "", s = 0;
589
- for (let e = 0, t = n[e]; t; t = n[++e]) if (t === " " && n[e + 1] === "\\" && n[e + 2] === "n" && (o += n.slice(s, e) + "\\ ", e += 1, s = e, t = "\\"), t === "\\") switch (n[e + 1]) {
590
- case "u":
591
- {
592
- o += n.slice(s, e);
593
- let t = n.substr(e + 2, 4);
594
- switch (t) {
595
- case "0000":
596
- o += "\\0";
597
- break;
598
- case "0007":
599
- o += "\\a";
600
- break;
601
- case "000b":
602
- o += "\\v";
603
- break;
604
- case "001b":
605
- o += "\\e";
606
- break;
607
- case "0085":
608
- o += "\\N";
609
- break;
610
- case "00a0":
611
- o += "\\_";
612
- break;
613
- case "2028":
614
- o += "\\L";
615
- break;
616
- case "2029":
617
- o += "\\P";
618
- break;
619
- default: t.substr(0, 2) === "00" ? o += "\\x" + t.substr(2) : o += n.substr(e, 6);
620
- }
621
- e += 5, s = e + 1;
622
- }
623
- break;
624
- case "n":
625
- if (r || n[e + 2] === "\"" || n.length < i) e += 1;
626
- else {
627
- for (o += n.slice(s, e) + "\n\n"; n[e + 2] === "\\" && n[e + 3] === "n" && n[e + 4] !== "\"";) o += "\n", e += 2;
628
- o += a, n[e + 2] === " " && (o += "\\"), e += 1, s = e + 1;
629
- }
630
- break;
631
- default: e += 1;
632
- }
633
- return o = s ? o + n.slice(s) : n, r ? o : ye(o, a, ve, xe(t, !1));
634
- }
635
- function we(e, t) {
636
- if (t.options.singleQuote === !1 || t.implicitKey && e.includes("\n") || /[ \t]\n|\n[ \t]/.test(e)) return F(e, t);
637
- let n = t.indent || (Se(e) ? " " : ""), r = "'" + e.replace(/'/g, "''").replace(/\n+/g, `$&\n${n}`) + "'";
638
- return t.implicitKey ? r : ye(r, n, ge, xe(t, !1));
639
- }
640
- function I(e, t) {
641
- let { singleQuote: n } = t.options, r;
642
- if (n === !1) r = F;
643
- else {
644
- let t = e.includes("\""), i = e.includes("'");
645
- r = t && !i ? we : i && !t ? F : n ? we : F;
646
- }
647
- return r(e, t);
648
- }
649
- var Te;
650
- try {
651
- Te = /* @__PURE__ */ RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
652
- } catch {
653
- Te = /\n+(?!\n|$)/g;
654
- }
655
- function Ee({ comment: e, type: t, value: n }, r, i, a) {
656
- let { blockQuote: o, commentString: s, lineWidth: c } = r.options;
657
- if (!o || /\n[\t ]+$/.test(n)) return I(n, r);
658
- let l = r.indent || (r.forceBlockIndent || Se(n) ? " " : ""), u = o === "literal" ? !0 : o === "folded" || t === A.BLOCK_FOLDED ? !1 : t === A.BLOCK_LITERAL ? !0 : !Ce(n, c, l.length);
659
- if (!n) return u ? "|\n" : ">\n";
660
- let d, f;
661
- for (f = n.length; f > 0; --f) {
662
- let e = n[f - 1];
663
- if (e !== "\n" && e !== " " && e !== " ") break;
664
- }
665
- let p = n.substring(f), m = p.indexOf("\n");
666
- m === -1 ? d = "-" : n === p || m !== p.length - 1 ? (d = "+", a && a()) : d = "", p &&= (n = n.slice(0, -p.length), p[p.length - 1] === "\n" && (p = p.slice(0, -1)), p.replace(Te, `$&${l}`));
667
- let h = !1, g, _ = -1;
668
- for (g = 0; g < n.length; ++g) {
669
- let e = n[g];
670
- if (e === " ") h = !0;
671
- else if (e === "\n") _ = g;
672
- else break;
673
- }
674
- let v = n.substring(0, _ < g ? _ + 1 : g);
675
- v &&= (n = n.substring(v.length), v.replace(/\n+/g, `$&${l}`));
676
- let y = (h ? l ? "2" : "1" : "") + d;
677
- if (e && (y += " " + s(e.replace(/ ?[\r\n]+/g, " ")), i && i()), !u) {
678
- let e = n.replace(/\n+/g, "\n$&").replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g, "$1$2").replace(/\n+/g, `$&${l}`), i = !1, a = xe(r, !0);
679
- o !== "folded" && t !== A.BLOCK_FOLDED && (a.onOverflow = () => {
680
- i = !0;
681
- });
682
- let s = ye(`${v}${e}${p}`, l, _e, a);
683
- if (!i) return `>${y}\n${l}${s}`;
684
- }
685
- return n = n.replace(/\n+/g, `$&${l}`), `|${y}\n${l}${v}${n}${p}`;
686
- }
687
- function De(e, t, n, r) {
688
- let { type: i, value: a } = e, { actualString: o, implicitKey: s, indent: c, indentStep: l, inFlow: u } = t;
689
- if (s && a.includes("\n") || u && /[[\]{},]/.test(a)) return I(a, t);
690
- if (/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(a)) return s || u || !a.includes("\n") ? I(a, t) : Ee(e, t, n, r);
691
- if (!s && !u && i !== A.PLAIN && a.includes("\n")) return Ee(e, t, n, r);
692
- if (Se(a)) {
693
- if (c === "") return t.forceBlockIndent = !0, Ee(e, t, n, r);
694
- if (s && c === l) return I(a, t);
695
- }
696
- let d = a.replace(/\n+/g, `$&\n${c}`);
697
- if (o) {
698
- let e = (e) => e.default && e.tag !== "tag:yaml.org,2002:str" && e.test?.test(d), { compat: n, tags: r } = t.doc.schema;
699
- if (r.some(e) || n?.some(e)) return I(a, t);
700
- }
701
- return s ? d : ye(d, c, ge, xe(t, !1));
702
- }
703
- function Oe(e, t, n, r) {
704
- let { implicitKey: i, inFlow: a } = t, o = typeof e.value == "string" ? e : Object.assign({}, e, { value: String(e.value) }), { type: s } = e;
705
- s !== A.QUOTE_DOUBLE && /[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value) && (s = A.QUOTE_DOUBLE);
706
- let c = (e) => {
707
- switch (e) {
708
- case A.BLOCK_FOLDED:
709
- case A.BLOCK_LITERAL: return i || a ? I(o.value, t) : Ee(o, t, n, r);
710
- case A.QUOTE_DOUBLE: return F(o.value, t);
711
- case A.QUOTE_SINGLE: return we(o.value, t);
712
- case A.PLAIN: return De(o, t, n, r);
713
- default: return null;
714
- }
715
- }, l = c(s);
716
- if (l === null) {
717
- let { defaultKeyType: e, defaultStringType: n } = t.options, r = i && e || n;
718
- if (l = c(r), l === null) throw Error(`Unsupported default string type ${r}`);
719
- }
720
- return l;
721
- }
722
- //#endregion
723
- //#region ../../node_modules/yaml/browser/dist/stringify/stringify.js
724
- function ke(e, t) {
725
- let n = Object.assign({
726
- blockQuote: !0,
727
- commentString: he,
728
- defaultKeyType: null,
729
- defaultStringType: "PLAIN",
730
- directives: null,
731
- doubleQuotedAsJSON: !1,
732
- doubleQuotedMinMultiLineLength: 40,
733
- falseStr: "false",
734
- flowCollectionPadding: !0,
735
- indentSeq: !0,
736
- lineWidth: 80,
737
- minContentWidth: 20,
738
- nullStr: "null",
739
- simpleKeys: !1,
740
- singleQuote: null,
741
- trailingComma: !1,
742
- trueStr: "true",
743
- verifyAliasOrder: !0
744
- }, e.schema.toStringOptions, t), r;
745
- switch (n.collectionStyle) {
746
- case "block":
747
- r = !1;
748
- break;
749
- case "flow":
750
- r = !0;
751
- break;
752
- default: r = null;
753
- }
754
- return {
755
- anchors: /* @__PURE__ */ new Set(),
756
- doc: e,
757
- flowCollectionPadding: n.flowCollectionPadding ? " " : "",
758
- indent: "",
759
- indentStep: typeof n.indent == "number" ? " ".repeat(n.indent) : " ",
760
- inFlow: r,
761
- options: n
762
- };
763
- }
764
- function Ae(e, t) {
765
- if (t.tag) {
766
- let n = e.filter((e) => e.tag === t.tag);
767
- if (n.length > 0) return n.find((e) => e.format === t.format) ?? n[0];
768
- }
769
- let n, r;
770
- if (p(t)) {
771
- r = t.value;
772
- let i = e.filter((e) => e.identify?.(r));
773
- if (i.length > 1) {
774
- let e = i.filter((e) => e.test);
775
- e.length > 0 && (i = e);
776
- }
777
- n = i.find((e) => e.format === t.format) ?? i.find((e) => !e.format);
778
- } else r = t, n = e.find((e) => e.nodeClass && r instanceof e.nodeClass);
779
- if (!n) {
780
- let e = r?.constructor?.name ?? (r === null ? "null" : typeof r);
781
- throw Error(`Tag not resolved for ${e} value`);
782
- }
783
- return n;
784
- }
785
- function je(e, t, { anchors: n, doc: r }) {
786
- if (!r.directives) return "";
787
- let i = [], a = (p(e) || h(e)) && e.anchor;
788
- a && re(a) && (n.add(a), i.push(`&${a}`));
789
- let o = e.tag ?? (t.default ? null : t.tag);
790
- return o && i.push(r.directives.tagString(o)), i.join(" ");
791
- }
792
- function L(e, t, n, r) {
793
- if (f(e)) return e.toString(t, n, r);
794
- if (l(e)) {
795
- if (t.doc.directives) return e.toString(t);
796
- if (t.resolvedAliases?.has(e)) throw TypeError("Cannot stringify circular structure without alias nodes");
797
- t.resolvedAliases ? t.resolvedAliases.add(e) : t.resolvedAliases = new Set([e]), e = e.resolve(t.doc);
798
- }
799
- let i, a = g(e) ? e : t.doc.createNode(e, { onTagObj: (e) => i = e });
800
- i ??= Ae(t.doc.schema.tags, a);
801
- let o = je(a, i, t);
802
- o.length > 0 && (t.indentAtStart = (t.indentAtStart ?? 0) + o.length + 1);
803
- let s = typeof i.stringify == "function" ? i.stringify(a, t, n, r) : p(a) ? Oe(a, t, n, r) : a.toString(t, n, r);
804
- return o ? p(a) || s[0] === "{" || s[0] === "[" ? `${o} ${s}` : `${o}\n${t.indent}${s}` : s;
805
- }
806
- //#endregion
807
- //#region ../../node_modules/yaml/browser/dist/stringify/stringifyPair.js
808
- function Me({ key: e, value: t }, n, r, i) {
809
- let { allNullValues: a, doc: o, indent: s, indentStep: c, options: { commentString: l, indentSeq: u, simpleKeys: d } } = n, f = g(e) && e.comment || null;
810
- if (d) {
811
- if (f) throw Error("With simple keys, key nodes cannot have comments");
812
- if (h(e) || !g(e) && typeof e == "object") throw Error("With simple keys, collection cannot be used as a key value");
813
- }
814
- let _ = !d && (!e || f && t == null && !n.inFlow || h(e) || (p(e) ? e.type === A.BLOCK_FOLDED || e.type === A.BLOCK_LITERAL : typeof e == "object"));
815
- n = Object.assign({}, n, {
816
- allNullValues: !1,
817
- implicitKey: !_ && (d || !a),
818
- indent: s + c
819
- });
820
- let v = !1, y = !1, b = L(e, n, () => v = !0, () => y = !0);
821
- if (!_ && !n.inFlow && b.length > 1024) {
822
- if (d) throw Error("With simple keys, single line scalar must not span more than 1024 characters");
823
- _ = !0;
824
- }
825
- if (n.inFlow) {
826
- if (a || t == null) return v && r && r(), b === "" ? "?" : _ ? `? ${b}` : b;
827
- } else if (a && !d || t == null && _) return b = `? ${b}`, f && !v ? b += P(b, n.indent, l(f)) : y && i && i(), b;
828
- v && (f = null), _ ? (f && (b += P(b, n.indent, l(f))), b = `? ${b}\n${s}:`) : (b = `${b}:`, f && (b += P(b, n.indent, l(f))));
829
- let x, S, C;
830
- g(t) ? (x = !!t.spaceBefore, S = t.commentBefore, C = t.comment) : (x = !1, S = null, C = null, t && typeof t == "object" && (t = o.createNode(t))), n.implicitKey = !1, !_ && !f && p(t) && (n.indentAtStart = b.length + 1), y = !1, !u && c.length >= 2 && !n.inFlow && !_ && m(t) && !t.flow && !t.tag && !t.anchor && (n.indent = n.indent.substring(2));
831
- let w = !1, T = L(t, n, () => w = !0, () => y = !0), E = " ";
832
- if (f || x || S) {
833
- if (E = x ? "\n" : "", S) {
834
- let e = l(S);
835
- E += `\n${N(e, n.indent)}`;
836
- }
837
- T === "" && !n.inFlow ? E === "\n" && C && (E = "\n\n") : E += `\n${n.indent}`;
838
- } else if (!_ && h(t)) {
839
- let e = T[0], r = T.indexOf("\n"), i = r !== -1, a = n.inFlow ?? t.flow ?? t.items.length === 0;
840
- if (i || !a) {
841
- let t = !1;
842
- if (i && (e === "&" || e === "!")) {
843
- let n = T.indexOf(" ");
844
- e === "&" && n !== -1 && n < r && T[n + 1] === "!" && (n = T.indexOf(" ", n + 1)), (n === -1 || r < n) && (t = !0);
845
- }
846
- t || (E = `\n${n.indent}`);
847
- }
848
- } else (T === "" || T[0] === "\n") && (E = "");
849
- return b += E + T, n.inFlow ? w && r && r() : C && !w ? b += P(b, n.indent, l(C)) : y && i && i(), b;
850
- }
851
- //#endregion
852
- //#region ../../node_modules/yaml/browser/dist/log.js
853
- function Ne(e, t) {
854
- (e === "debug" || e === "warn") && console.warn(t);
855
- }
856
- //#endregion
857
- //#region ../../node_modules/yaml/browser/dist/schema/yaml-1.1/merge.js
858
- var Pe = "<<", R = {
859
- identify: (e) => e === Pe || typeof e == "symbol" && e.description === Pe,
860
- default: "key",
861
- tag: "tag:yaml.org,2002:merge",
862
- test: /^<<$/,
863
- resolve: () => Object.assign(new A(Symbol(Pe)), { addToJSMap: Ie }),
864
- stringify: () => Pe
865
- }, Fe = (e, t) => (R.identify(t) || p(t) && (!t.type || t.type === A.PLAIN) && R.identify(t.value)) && e?.doc.schema.tags.some((e) => e.tag === R.tag && e.default);
866
- function Ie(e, t, n) {
867
- let r = Re(e, n);
868
- if (m(r)) for (let n of r.items) Le(e, t, n);
869
- else if (Array.isArray(r)) for (let n of r) Le(e, t, n);
870
- else Le(e, t, r);
871
- }
872
- function Le(e, t, n) {
873
- let r = Re(e, n);
874
- if (!d(r)) throw Error("Merge sources must be maps or map aliases");
875
- let i = r.toJSON(null, e, Map);
876
- for (let [e, n] of i) t instanceof Map ? t.has(e) || t.set(e, n) : t instanceof Set ? t.add(e) : Object.prototype.hasOwnProperty.call(t, e) || Object.defineProperty(t, e, {
877
- value: n,
878
- writable: !0,
879
- enumerable: !0,
880
- configurable: !0
881
- });
882
- return t;
883
- }
884
- function Re(e, t) {
885
- return e && l(t) ? t.resolve(e.doc, e) : t;
886
- }
887
- //#endregion
888
- //#region ../../node_modules/yaml/browser/dist/nodes/addPairToJSMap.js
889
- function ze(e, t, { key: n, value: r }) {
890
- if (g(n) && n.addToJSMap) n.addToJSMap(e, t, r);
891
- else if (Fe(e, n)) Ie(e, t, r);
892
- else {
893
- let i = k(n, "", e);
894
- if (t instanceof Map) t.set(i, k(r, i, e));
895
- else if (t instanceof Set) t.add(i);
896
- else {
897
- let a = Be(n, i, e), o = k(r, a, e);
898
- a in t ? Object.defineProperty(t, a, {
899
- value: o,
900
- writable: !0,
901
- enumerable: !0,
902
- configurable: !0
903
- }) : t[a] = o;
904
- }
905
- }
906
- return t;
907
- }
908
- function Be(e, t, n) {
909
- if (t === null) return "";
910
- if (typeof t != "object") return String(t);
911
- if (g(e) && n?.doc) {
912
- let t = ke(n.doc, {});
913
- t.anchors = /* @__PURE__ */ new Set();
914
- for (let e of n.anchors.keys()) t.anchors.add(e.anchor);
915
- t.inFlow = !0, t.inStringifyKey = !0;
916
- let r = e.toString(t);
917
- if (!n.mapKeyWarned) {
918
- let e = JSON.stringify(r);
919
- e.length > 40 && (e = e.substring(0, 36) + "...\""), Ne(n.doc.options.logLevel, `Keys with collection values will be stringified due to JS Object restrictions: ${e}. Set mapAsMap: true to use object keys.`), n.mapKeyWarned = !0;
920
- }
921
- return r;
922
- }
923
- return JSON.stringify(t);
924
- }
925
- //#endregion
926
- //#region ../../node_modules/yaml/browser/dist/nodes/Pair.js
927
- function Ve(e, t, n) {
928
- return new z(j(e, void 0, n), j(t, void 0, n));
929
- }
930
- var z = class e {
931
- constructor(e, t = null) {
932
- Object.defineProperty(this, c, { value: a }), this.key = e, this.value = t;
933
- }
934
- clone(t) {
935
- let { key: n, value: r } = this;
936
- return g(n) && (n = n.clone(t)), g(r) && (r = r.clone(t)), new e(n, r);
937
- }
938
- toJSON(e, t) {
939
- return ze(t, t?.mapAsMap ? /* @__PURE__ */ new Map() : {}, this);
940
- }
941
- toString(e, t, n) {
942
- return e?.doc ? Me(this, e, t, n) : JSON.stringify(this);
943
- }
944
- };
945
- //#endregion
946
- //#region ../../node_modules/yaml/browser/dist/stringify/stringifyCollection.js
947
- function He(e, t, n) {
948
- return (t.inFlow ?? e.flow ? We : Ue)(e, t, n);
949
- }
950
- function Ue({ comment: e, items: t }, n, { blockItemPrefix: r, flowChars: i, itemIndent: a, onChompKeep: o, onComment: s }) {
951
- let { indent: c, options: { commentString: l } } = n, u = Object.assign({}, n, {
952
- indent: a,
953
- type: null
954
- }), d = !1, p = [];
955
- for (let e = 0; e < t.length; ++e) {
956
- let i = t[e], o = null;
957
- if (g(i)) !d && i.spaceBefore && p.push(""), Ge(n, p, i.commentBefore, d), i.comment && (o = i.comment);
958
- else if (f(i)) {
959
- let e = g(i.key) ? i.key : null;
960
- e && (!d && e.spaceBefore && p.push(""), Ge(n, p, e.commentBefore, d));
961
- }
962
- d = !1;
963
- let s = L(i, u, () => o = null, () => d = !0);
964
- o && (s += P(s, a, l(o))), d && o && (d = !1), p.push(r + s);
965
- }
966
- let m;
967
- if (p.length === 0) m = i.start + i.end;
968
- else {
969
- m = p[0];
970
- for (let e = 1; e < p.length; ++e) {
971
- let t = p[e];
972
- m += t ? `\n${c}${t}` : "\n";
973
- }
974
- }
975
- return e ? (m += "\n" + N(l(e), c), s && s()) : d && o && o(), m;
976
- }
977
- function We({ items: e }, t, { flowChars: n, itemIndent: r }) {
978
- let { indent: i, indentStep: a, flowCollectionPadding: o, options: { commentString: s } } = t;
979
- r += a;
980
- let c = Object.assign({}, t, {
981
- indent: r,
982
- inFlow: !0,
983
- type: null
984
- }), l = !1, u = 0, d = [];
985
- for (let n = 0; n < e.length; ++n) {
986
- let i = e[n], a = null;
987
- if (g(i)) i.spaceBefore && d.push(""), Ge(t, d, i.commentBefore, !1), i.comment && (a = i.comment);
988
- else if (f(i)) {
989
- let e = g(i.key) ? i.key : null;
990
- e && (e.spaceBefore && d.push(""), Ge(t, d, e.commentBefore, !1), e.comment && (l = !0));
991
- let n = g(i.value) ? i.value : null;
992
- n ? (n.comment && (a = n.comment), n.commentBefore && (l = !0)) : i.value == null && e?.comment && (a = e.comment);
993
- }
994
- a && (l = !0);
995
- let o = L(i, c, () => a = null);
996
- l ||= d.length > u || o.includes("\n"), n < e.length - 1 ? o += "," : t.options.trailingComma && (t.options.lineWidth > 0 && (l ||= d.reduce((e, t) => e + t.length + 2, 2) + (o.length + 2) > t.options.lineWidth), l && (o += ",")), a && (o += P(o, r, s(a))), d.push(o), u = d.length;
997
- }
998
- let { start: p, end: m } = n;
999
- if (d.length === 0) return p + m;
1000
- if (!l) {
1001
- let e = d.reduce((e, t) => e + t.length + 2, 2);
1002
- l = t.options.lineWidth > 0 && e > t.options.lineWidth;
1003
- }
1004
- if (l) {
1005
- let e = p;
1006
- for (let t of d) e += t ? `\n${a}${i}${t}` : "\n";
1007
- return `${e}\n${i}${m}`;
1008
- } else return `${p}${o}${d.join(" ")}${o}${m}`;
1009
- }
1010
- function Ge({ indent: e, options: { commentString: t } }, n, r, i) {
1011
- if (r && i && (r = r.replace(/^\n+/, "")), r) {
1012
- let i = N(t(r), e);
1013
- n.push(i.trimStart());
1014
- }
1015
- }
1016
- //#endregion
1017
- //#region ../../node_modules/yaml/browser/dist/nodes/YAMLMap.js
1018
- function B(e, t) {
1019
- let n = p(t) ? t.value : t;
1020
- for (let r of e) if (f(r) && (r.key === t || r.key === n || p(r.key) && r.key.value === n)) return r;
1021
- }
1022
- var V = class extends me {
1023
- static get tagName() {
1024
- return "tag:yaml.org,2002:map";
1025
- }
1026
- constructor(e) {
1027
- super(i, e), this.items = [];
1028
- }
1029
- static from(e, t, n) {
1030
- let { keepUndefined: r, replacer: i } = n, a = new this(e), o = (e, o) => {
1031
- if (typeof i == "function") o = i.call(t, e, o);
1032
- else if (Array.isArray(i) && !i.includes(e)) return;
1033
- (o !== void 0 || r) && a.items.push(Ve(e, o, n));
1034
- };
1035
- if (t instanceof Map) for (let [e, n] of t) o(e, n);
1036
- else if (t && typeof t == "object") for (let e of Object.keys(t)) o(e, t[e]);
1037
- return typeof e.sortMapEntries == "function" && a.items.sort(e.sortMapEntries), a;
1038
- }
1039
- add(e, t) {
1040
- let n;
1041
- n = f(e) ? e : !e || typeof e != "object" || !("key" in e) ? new z(e, e?.value) : new z(e.key, e.value);
1042
- let r = B(this.items, n.key), i = this.schema?.sortMapEntries;
1043
- if (r) {
1044
- if (!t) throw Error(`Key ${n.key} already set`);
1045
- p(r.value) && ue(n.value) ? r.value.value = n.value : r.value = n.value;
1046
- } else if (i) {
1047
- let e = this.items.findIndex((e) => i(n, e) < 0);
1048
- e === -1 ? this.items.push(n) : this.items.splice(e, 0, n);
1049
- } else this.items.push(n);
1050
- }
1051
- delete(e) {
1052
- let t = B(this.items, e);
1053
- return t ? this.items.splice(this.items.indexOf(t), 1).length > 0 : !1;
1054
- }
1055
- get(e, t) {
1056
- let n = B(this.items, e)?.value;
1057
- return (!t && p(n) ? n.value : n) ?? void 0;
1058
- }
1059
- has(e) {
1060
- return !!B(this.items, e);
1061
- }
1062
- set(e, t) {
1063
- this.add(new z(e, t), !0);
1064
- }
1065
- toJSON(e, t, n) {
1066
- let r = n ? new n() : t?.mapAsMap ? /* @__PURE__ */ new Map() : {};
1067
- t?.onCreate && t.onCreate(r);
1068
- for (let e of this.items) ze(t, r, e);
1069
- return r;
1070
- }
1071
- toString(e, t, n) {
1072
- if (!e) return JSON.stringify(this);
1073
- for (let e of this.items) if (!f(e)) throw Error(`Map items must all be pairs; found ${JSON.stringify(e)} instead`);
1074
- return !e.allNullValues && this.hasAllNullValues(!1) && (e = Object.assign({}, e, { allNullValues: !0 })), He(this, e, {
1075
- blockItemPrefix: "",
1076
- flowChars: {
1077
- start: "{",
1078
- end: "}"
1079
- },
1080
- itemIndent: e.indent || "",
1081
- onChompKeep: n,
1082
- onComment: t
1083
- });
1084
- }
1085
- }, H = {
1086
- collection: "map",
1087
- default: !0,
1088
- nodeClass: V,
1089
- tag: "tag:yaml.org,2002:map",
1090
- resolve(e, t) {
1091
- return d(e) || t("Expected a mapping for this tag"), e;
1092
- },
1093
- createNode: (e, t, n) => V.from(e, t, n)
1094
- }, U = class extends me {
1095
- static get tagName() {
1096
- return "tag:yaml.org,2002:seq";
1097
- }
1098
- constructor(e) {
1099
- super(s, e), this.items = [];
1100
- }
1101
- add(e) {
1102
- this.items.push(e);
1103
- }
1104
- delete(e) {
1105
- let t = Ke(e);
1106
- return typeof t == "number" ? this.items.splice(t, 1).length > 0 : !1;
1107
- }
1108
- get(e, t) {
1109
- let n = Ke(e);
1110
- if (typeof n != "number") return;
1111
- let r = this.items[n];
1112
- return !t && p(r) ? r.value : r;
1113
- }
1114
- has(e) {
1115
- let t = Ke(e);
1116
- return typeof t == "number" && t < this.items.length;
1117
- }
1118
- set(e, t) {
1119
- let n = Ke(e);
1120
- if (typeof n != "number") throw Error(`Expected a valid index, not ${e}.`);
1121
- let r = this.items[n];
1122
- p(r) && ue(t) ? r.value = t : this.items[n] = t;
1123
- }
1124
- toJSON(e, t) {
1125
- let n = [];
1126
- t?.onCreate && t.onCreate(n);
1127
- let r = 0;
1128
- for (let e of this.items) n.push(k(e, String(r++), t));
1129
- return n;
1130
- }
1131
- toString(e, t, n) {
1132
- return e ? He(this, e, {
1133
- blockItemPrefix: "- ",
1134
- flowChars: {
1135
- start: "[",
1136
- end: "]"
1137
- },
1138
- itemIndent: (e.indent || "") + " ",
1139
- onChompKeep: n,
1140
- onComment: t
1141
- }) : JSON.stringify(this);
1142
- }
1143
- static from(e, t, n) {
1144
- let { replacer: r } = n, i = new this(e);
1145
- if (t && Symbol.iterator in Object(t)) {
1146
- let e = 0;
1147
- for (let a of t) {
1148
- if (typeof r == "function") {
1149
- let n = t instanceof Set ? a : String(e++);
1150
- a = r.call(t, n, a);
1151
- }
1152
- i.items.push(j(a, void 0, n));
1153
- }
1154
- }
1155
- return i;
1156
- }
1157
- };
1158
- function Ke(e) {
1159
- let t = p(e) ? e.value : e;
1160
- return t && typeof t == "string" && (t = Number(t)), typeof t == "number" && Number.isInteger(t) && t >= 0 ? t : null;
1161
- }
1162
- //#endregion
1163
- //#region ../../node_modules/yaml/browser/dist/schema/common/seq.js
1164
- var W = {
1165
- collection: "seq",
1166
- default: !0,
1167
- nodeClass: U,
1168
- tag: "tag:yaml.org,2002:seq",
1169
- resolve(e, t) {
1170
- return m(e) || t("Expected a sequence for this tag"), e;
1171
- },
1172
- createNode: (e, t, n) => U.from(e, t, n)
1173
- }, qe = {
1174
- identify: (e) => typeof e == "string",
1175
- default: !0,
1176
- tag: "tag:yaml.org,2002:str",
1177
- resolve: (e) => e,
1178
- stringify(e, t, n, r) {
1179
- return t = Object.assign({ actualString: !0 }, t), Oe(e, t, n, r);
1180
- }
1181
- }, Je = {
1182
- identify: (e) => e == null,
1183
- createNode: () => new A(null),
1184
- default: !0,
1185
- tag: "tag:yaml.org,2002:null",
1186
- test: /^(?:~|[Nn]ull|NULL)?$/,
1187
- resolve: () => new A(null),
1188
- stringify: ({ source: e }, t) => typeof e == "string" && Je.test.test(e) ? e : t.options.nullStr
1189
- }, Ye = {
1190
- identify: (e) => typeof e == "boolean",
1191
- default: !0,
1192
- tag: "tag:yaml.org,2002:bool",
1193
- test: /^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,
1194
- resolve: (e) => new A(e[0] === "t" || e[0] === "T"),
1195
- stringify({ source: e, value: t }, n) {
1196
- return e && Ye.test.test(e) && t === (e[0] === "t" || e[0] === "T") ? e : t ? n.options.trueStr : n.options.falseStr;
1197
- }
1198
- };
1199
- //#endregion
1200
- //#region ../../node_modules/yaml/browser/dist/stringify/stringifyNumber.js
1201
- function G({ format: e, minFractionDigits: t, tag: n, value: r }) {
1202
- if (typeof r == "bigint") return String(r);
1203
- let i = typeof r == "number" ? r : Number(r);
1204
- if (!isFinite(i)) return isNaN(i) ? ".nan" : i < 0 ? "-.inf" : ".inf";
1205
- let a = Object.is(r, -0) ? "-0" : JSON.stringify(r);
1206
- if (!e && t && (!n || n === "tag:yaml.org,2002:float") && /^-?\d/.test(a) && !a.includes("e")) {
1207
- let e = a.indexOf(".");
1208
- e < 0 && (e = a.length, a += ".");
1209
- let n = t - (a.length - e - 1);
1210
- for (; n-- > 0;) a += "0";
1211
- }
1212
- return a;
1213
- }
1214
- //#endregion
1215
- //#region ../../node_modules/yaml/browser/dist/schema/core/float.js
1216
- var Xe = {
1217
- identify: (e) => typeof e == "number",
1218
- default: !0,
1219
- tag: "tag:yaml.org,2002:float",
1220
- test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1221
- resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
1222
- stringify: G
1223
- }, Ze = {
1224
- identify: (e) => typeof e == "number",
1225
- default: !0,
1226
- tag: "tag:yaml.org,2002:float",
1227
- format: "EXP",
1228
- test: /^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,
1229
- resolve: (e) => parseFloat(e),
1230
- stringify(e) {
1231
- let t = Number(e.value);
1232
- return isFinite(t) ? t.toExponential() : G(e);
1233
- }
1234
- }, Qe = {
1235
- identify: (e) => typeof e == "number",
1236
- default: !0,
1237
- tag: "tag:yaml.org,2002:float",
1238
- test: /^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,
1239
- resolve(e) {
1240
- let t = new A(parseFloat(e)), n = e.indexOf(".");
1241
- return n !== -1 && e[e.length - 1] === "0" && (t.minFractionDigits = e.length - n - 1), t;
1242
- },
1243
- stringify: G
1244
- }, $e = (e) => typeof e == "bigint" || Number.isInteger(e), et = (e, t, n, { intAsBigInt: r }) => r ? BigInt(e) : parseInt(e.substring(t), n);
1245
- function tt(e, t, n) {
1246
- let { value: r } = e;
1247
- return $e(r) && r >= 0 ? n + r.toString(t) : G(e);
1248
- }
1249
- var nt = {
1250
- identify: (e) => $e(e) && e >= 0,
1251
- default: !0,
1252
- tag: "tag:yaml.org,2002:int",
1253
- format: "OCT",
1254
- test: /^0o[0-7]+$/,
1255
- resolve: (e, t, n) => et(e, 2, 8, n),
1256
- stringify: (e) => tt(e, 8, "0o")
1257
- }, rt = {
1258
- identify: $e,
1259
- default: !0,
1260
- tag: "tag:yaml.org,2002:int",
1261
- test: /^[-+]?[0-9]+$/,
1262
- resolve: (e, t, n) => et(e, 0, 10, n),
1263
- stringify: G
1264
- }, it = {
1265
- identify: (e) => $e(e) && e >= 0,
1266
- default: !0,
1267
- tag: "tag:yaml.org,2002:int",
1268
- format: "HEX",
1269
- test: /^0x[0-9a-fA-F]+$/,
1270
- resolve: (e, t, n) => et(e, 2, 16, n),
1271
- stringify: (e) => tt(e, 16, "0x")
1272
- }, at = [
1273
- H,
1274
- W,
1275
- qe,
1276
- Je,
1277
- Ye,
1278
- nt,
1279
- rt,
1280
- it,
1281
- Xe,
1282
- Ze,
1283
- Qe
1284
- ];
1285
- //#endregion
1286
- //#region ../../node_modules/yaml/browser/dist/schema/json/schema.js
1287
- function ot(e) {
1288
- return typeof e == "bigint" || Number.isInteger(e);
1289
- }
1290
- var st = ({ value: e }) => JSON.stringify(e), ct = [
1291
- {
1292
- identify: (e) => typeof e == "string",
1293
- default: !0,
1294
- tag: "tag:yaml.org,2002:str",
1295
- resolve: (e) => e,
1296
- stringify: st
1297
- },
1298
- {
1299
- identify: (e) => e == null,
1300
- createNode: () => new A(null),
1301
- default: !0,
1302
- tag: "tag:yaml.org,2002:null",
1303
- test: /^null$/,
1304
- resolve: () => null,
1305
- stringify: st
1306
- },
1307
- {
1308
- identify: (e) => typeof e == "boolean",
1309
- default: !0,
1310
- tag: "tag:yaml.org,2002:bool",
1311
- test: /^true$|^false$/,
1312
- resolve: (e) => e === "true",
1313
- stringify: st
1314
- },
1315
- {
1316
- identify: ot,
1317
- default: !0,
1318
- tag: "tag:yaml.org,2002:int",
1319
- test: /^-?(?:0|[1-9][0-9]*)$/,
1320
- resolve: (e, t, { intAsBigInt: n }) => n ? BigInt(e) : parseInt(e, 10),
1321
- stringify: ({ value: e }) => ot(e) ? e.toString() : JSON.stringify(e)
1322
- },
1323
- {
1324
- identify: (e) => typeof e == "number",
1325
- default: !0,
1326
- tag: "tag:yaml.org,2002:float",
1327
- test: /^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,
1328
- resolve: (e) => parseFloat(e),
1329
- stringify: st
1330
- }
1331
- ], lt = [H, W].concat(ct, {
1332
- default: !0,
1333
- tag: "",
1334
- test: /^/,
1335
- resolve(e, t) {
1336
- return t(`Unresolved plain scalar ${JSON.stringify(e)}`), e;
1337
- }
1338
- }), ut = {
1339
- identify: (e) => e instanceof Uint8Array,
1340
- default: !1,
1341
- tag: "tag:yaml.org,2002:binary",
1342
- resolve(e, t) {
1343
- if (typeof atob == "function") {
1344
- let t = atob(e.replace(/[\n\r]/g, "")), n = new Uint8Array(t.length);
1345
- for (let e = 0; e < t.length; ++e) n[e] = t.charCodeAt(e);
1346
- return n;
1347
- } else return t("This environment does not support reading binary tags; either Buffer or atob is required"), e;
1348
- },
1349
- stringify({ comment: e, type: t, value: n }, r, i, a) {
1350
- if (!n) return "";
1351
- let o = n, s;
1352
- if (typeof btoa == "function") {
1353
- let e = "";
1354
- for (let t = 0; t < o.length; ++t) e += String.fromCharCode(o[t]);
1355
- s = btoa(e);
1356
- } else throw Error("This environment does not support writing binary tags; either Buffer or btoa is required");
1357
- if (t ??= A.BLOCK_LITERAL, t !== A.QUOTE_DOUBLE) {
1358
- let e = Math.max(r.options.lineWidth - r.indent.length, r.options.minContentWidth), n = Math.ceil(s.length / e), i = Array(n);
1359
- for (let t = 0, r = 0; t < n; ++t, r += e) i[t] = s.substr(r, e);
1360
- s = i.join(t === A.BLOCK_LITERAL ? "\n" : " ");
1361
- }
1362
- return Oe({
1363
- comment: e,
1364
- type: t,
1365
- value: s
1366
- }, r, i, a);
1367
- }
1368
- };
1369
- //#endregion
1370
- //#region ../../node_modules/yaml/browser/dist/schema/yaml-1.1/pairs.js
1371
- function dt(e, t) {
1372
- if (m(e)) for (let n = 0; n < e.items.length; ++n) {
1373
- let r = e.items[n];
1374
- if (!f(r)) {
1375
- if (d(r)) {
1376
- r.items.length > 1 && t("Each pair must have its own sequence indicator");
1377
- let e = r.items[0] || new z(new A(null));
1378
- if (r.commentBefore && (e.key.commentBefore = e.key.commentBefore ? `${r.commentBefore}\n${e.key.commentBefore}` : r.commentBefore), r.comment) {
1379
- let t = e.value ?? e.key;
1380
- t.comment = t.comment ? `${r.comment}\n${t.comment}` : r.comment;
1381
- }
1382
- r = e;
1383
- }
1384
- e.items[n] = f(r) ? r : new z(r);
1385
- }
1386
- }
1387
- else t("Expected a sequence for this tag");
1388
- return e;
1389
- }
1390
- function ft(e, t, n) {
1391
- let { replacer: r } = n, i = new U(e);
1392
- i.tag = "tag:yaml.org,2002:pairs";
1393
- let a = 0;
1394
- if (t && Symbol.iterator in Object(t)) for (let e of t) {
1395
- typeof r == "function" && (e = r.call(t, String(a++), e));
1396
- let o, s;
1397
- if (Array.isArray(e)) if (e.length === 2) o = e[0], s = e[1];
1398
- else throw TypeError(`Expected [key, value] tuple: ${e}`);
1399
- else if (e && e instanceof Object) {
1400
- let t = Object.keys(e);
1401
- if (t.length === 1) o = t[0], s = e[o];
1402
- else throw TypeError(`Expected tuple with one key, not ${t.length} keys`);
1403
- } else o = e;
1404
- i.items.push(Ve(o, s, n));
1405
- }
1406
- return i;
1407
- }
1408
- var pt = {
1409
- collection: "seq",
1410
- default: !1,
1411
- tag: "tag:yaml.org,2002:pairs",
1412
- resolve: dt,
1413
- createNode: ft
1414
- }, mt = class e extends U {
1415
- constructor() {
1416
- super(), this.add = V.prototype.add.bind(this), this.delete = V.prototype.delete.bind(this), this.get = V.prototype.get.bind(this), this.has = V.prototype.has.bind(this), this.set = V.prototype.set.bind(this), this.tag = e.tag;
1417
- }
1418
- toJSON(e, t) {
1419
- if (!t) return super.toJSON(e);
1420
- let n = /* @__PURE__ */ new Map();
1421
- t?.onCreate && t.onCreate(n);
1422
- for (let e of this.items) {
1423
- let r, i;
1424
- if (f(e) ? (r = k(e.key, "", t), i = k(e.value, r, t)) : r = k(e, "", t), n.has(r)) throw Error("Ordered maps must not include duplicate keys");
1425
- n.set(r, i);
1426
- }
1427
- return n;
1428
- }
1429
- static from(e, t, n) {
1430
- let r = ft(e, t, n), i = new this();
1431
- return i.items = r.items, i;
1432
- }
1433
- };
1434
- mt.tag = "tag:yaml.org,2002:omap";
1435
- var ht = {
1436
- collection: "seq",
1437
- identify: (e) => e instanceof Map,
1438
- nodeClass: mt,
1439
- default: !1,
1440
- tag: "tag:yaml.org,2002:omap",
1441
- resolve(e, t) {
1442
- let n = dt(e, t), r = [];
1443
- for (let { key: e } of n.items) p(e) && (r.includes(e.value) ? t(`Ordered maps must not include duplicate keys: ${e.value}`) : r.push(e.value));
1444
- return Object.assign(new mt(), n);
1445
- },
1446
- createNode: (e, t, n) => mt.from(e, t, n)
1447
- };
1448
- //#endregion
1449
- //#region ../../node_modules/yaml/browser/dist/schema/yaml-1.1/bool.js
1450
- function gt({ value: e, source: t }, n) {
1451
- return t && (e ? _t : vt).test.test(t) ? t : e ? n.options.trueStr : n.options.falseStr;
1452
- }
1453
- var _t = {
1454
- identify: (e) => e === !0,
1455
- default: !0,
1456
- tag: "tag:yaml.org,2002:bool",
1457
- test: /^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,
1458
- resolve: () => new A(!0),
1459
- stringify: gt
1460
- }, vt = {
1461
- identify: (e) => e === !1,
1462
- default: !0,
1463
- tag: "tag:yaml.org,2002:bool",
1464
- test: /^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,
1465
- resolve: () => new A(!1),
1466
- stringify: gt
1467
- }, yt = {
1468
- identify: (e) => typeof e == "number",
1469
- default: !0,
1470
- tag: "tag:yaml.org,2002:float",
1471
- test: /^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,
1472
- resolve: (e) => e.slice(-3).toLowerCase() === "nan" ? NaN : e[0] === "-" ? -Infinity : Infinity,
1473
- stringify: G
1474
- }, bt = {
1475
- identify: (e) => typeof e == "number",
1476
- default: !0,
1477
- tag: "tag:yaml.org,2002:float",
1478
- format: "EXP",
1479
- test: /^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,
1480
- resolve: (e) => parseFloat(e.replace(/_/g, "")),
1481
- stringify(e) {
1482
- let t = Number(e.value);
1483
- return isFinite(t) ? t.toExponential() : G(e);
1484
- }
1485
- }, xt = {
1486
- identify: (e) => typeof e == "number",
1487
- default: !0,
1488
- tag: "tag:yaml.org,2002:float",
1489
- test: /^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,
1490
- resolve(e) {
1491
- let t = new A(parseFloat(e.replace(/_/g, ""))), n = e.indexOf(".");
1492
- if (n !== -1) {
1493
- let r = e.substring(n + 1).replace(/_/g, "");
1494
- r[r.length - 1] === "0" && (t.minFractionDigits = r.length);
1495
- }
1496
- return t;
1497
- },
1498
- stringify: G
1499
- }, K = (e) => typeof e == "bigint" || Number.isInteger(e);
1500
- function St(e, t, n, { intAsBigInt: r }) {
1501
- let i = e[0];
1502
- if ((i === "-" || i === "+") && (t += 1), e = e.substring(t).replace(/_/g, ""), r) {
1503
- switch (n) {
1504
- case 2:
1505
- e = `0b${e}`;
1506
- break;
1507
- case 8:
1508
- e = `0o${e}`;
1509
- break;
1510
- case 16:
1511
- e = `0x${e}`;
1512
- break;
1513
- }
1514
- let t = BigInt(e);
1515
- return i === "-" ? BigInt(-1) * t : t;
1516
- }
1517
- let a = parseInt(e, n);
1518
- return i === "-" ? -1 * a : a;
1519
- }
1520
- function Ct(e, t, n) {
1521
- let { value: r } = e;
1522
- if (K(r)) {
1523
- let e = r.toString(t);
1524
- return r < 0 ? "-" + n + e.substr(1) : n + e;
1525
- }
1526
- return G(e);
1527
- }
1528
- var wt = {
1529
- identify: K,
1530
- default: !0,
1531
- tag: "tag:yaml.org,2002:int",
1532
- format: "BIN",
1533
- test: /^[-+]?0b[0-1_]+$/,
1534
- resolve: (e, t, n) => St(e, 2, 2, n),
1535
- stringify: (e) => Ct(e, 2, "0b")
1536
- }, Tt = {
1537
- identify: K,
1538
- default: !0,
1539
- tag: "tag:yaml.org,2002:int",
1540
- format: "OCT",
1541
- test: /^[-+]?0[0-7_]+$/,
1542
- resolve: (e, t, n) => St(e, 1, 8, n),
1543
- stringify: (e) => Ct(e, 8, "0")
1544
- }, Et = {
1545
- identify: K,
1546
- default: !0,
1547
- tag: "tag:yaml.org,2002:int",
1548
- test: /^[-+]?[0-9][0-9_]*$/,
1549
- resolve: (e, t, n) => St(e, 0, 10, n),
1550
- stringify: G
1551
- }, Dt = {
1552
- identify: K,
1553
- default: !0,
1554
- tag: "tag:yaml.org,2002:int",
1555
- format: "HEX",
1556
- test: /^[-+]?0x[0-9a-fA-F_]+$/,
1557
- resolve: (e, t, n) => St(e, 2, 16, n),
1558
- stringify: (e) => Ct(e, 16, "0x")
1559
- }, Ot = class e extends V {
1560
- constructor(t) {
1561
- super(t), this.tag = e.tag;
1562
- }
1563
- add(e) {
1564
- let t;
1565
- t = f(e) ? e : e && typeof e == "object" && "key" in e && "value" in e && e.value === null ? new z(e.key, null) : new z(e, null), B(this.items, t.key) || this.items.push(t);
1566
- }
1567
- get(e, t) {
1568
- let n = B(this.items, e);
1569
- return !t && f(n) ? p(n.key) ? n.key.value : n.key : n;
1570
- }
1571
- set(e, t) {
1572
- if (typeof t != "boolean") throw Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);
1573
- let n = B(this.items, e);
1574
- n && !t ? this.items.splice(this.items.indexOf(n), 1) : !n && t && this.items.push(new z(e));
1575
- }
1576
- toJSON(e, t) {
1577
- return super.toJSON(e, t, Set);
1578
- }
1579
- toString(e, t, n) {
1580
- if (!e) return JSON.stringify(this);
1581
- if (this.hasAllNullValues(!0)) return super.toString(Object.assign({}, e, { allNullValues: !0 }), t, n);
1582
- throw Error("Set items must all have null values");
1583
- }
1584
- static from(e, t, n) {
1585
- let { replacer: r } = n, i = new this(e);
1586
- if (t && Symbol.iterator in Object(t)) for (let e of t) typeof r == "function" && (e = r.call(t, e, e)), i.items.push(Ve(e, null, n));
1587
- return i;
1588
- }
1589
- };
1590
- Ot.tag = "tag:yaml.org,2002:set";
1591
- var kt = {
1592
- collection: "map",
1593
- identify: (e) => e instanceof Set,
1594
- nodeClass: Ot,
1595
- default: !1,
1596
- tag: "tag:yaml.org,2002:set",
1597
- createNode: (e, t, n) => Ot.from(e, t, n),
1598
- resolve(e, t) {
1599
- if (d(e)) {
1600
- if (e.hasAllNullValues(!0)) return Object.assign(new Ot(), e);
1601
- t("Set items must all have null values");
1602
- } else t("Expected a mapping for this tag");
1603
- return e;
1604
- }
1605
- };
1606
- //#endregion
1607
- //#region ../../node_modules/yaml/browser/dist/schema/yaml-1.1/timestamp.js
1608
- function At(e, t) {
1609
- let n = e[0], r = n === "-" || n === "+" ? e.substring(1) : e, i = (e) => t ? BigInt(e) : Number(e), a = r.replace(/_/g, "").split(":").reduce((e, t) => e * i(60) + i(t), i(0));
1610
- return n === "-" ? i(-1) * a : a;
1611
- }
1612
- function jt(e) {
1613
- let { value: t } = e, n = (e) => e;
1614
- if (typeof t == "bigint") n = (e) => BigInt(e);
1615
- else if (isNaN(t) || !isFinite(t)) return G(e);
1616
- let r = "";
1617
- t < 0 && (r = "-", t *= n(-1));
1618
- let i = n(60), a = [t % i];
1619
- return t < 60 ? a.unshift(0) : (t = (t - a[0]) / i, a.unshift(t % i), t >= 60 && (t = (t - a[0]) / i, a.unshift(t))), r + a.map((e) => String(e).padStart(2, "0")).join(":").replace(/000000\d*$/, "");
1620
- }
1621
- var Mt = {
1622
- identify: (e) => typeof e == "bigint" || Number.isInteger(e),
1623
- default: !0,
1624
- tag: "tag:yaml.org,2002:int",
1625
- format: "TIME",
1626
- test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,
1627
- resolve: (e, t, { intAsBigInt: n }) => At(e, n),
1628
- stringify: jt
1629
- }, Nt = {
1630
- identify: (e) => typeof e == "number",
1631
- default: !0,
1632
- tag: "tag:yaml.org,2002:float",
1633
- format: "TIME",
1634
- test: /^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,
1635
- resolve: (e) => At(e, !1),
1636
- stringify: jt
1637
- }, Pt = {
1638
- identify: (e) => e instanceof Date,
1639
- default: !0,
1640
- tag: "tag:yaml.org,2002:timestamp",
1641
- test: RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),
1642
- resolve(e) {
1643
- let t = e.match(Pt.test);
1644
- if (!t) throw Error("!!timestamp expects a date, starting with yyyy-mm-dd");
1645
- let [, n, r, i, a, o, s] = t.map(Number), c = t[7] ? Number((t[7] + "00").substr(1, 3)) : 0, l = Date.UTC(n, r - 1, i, a || 0, o || 0, s || 0, c), u = t[8];
1646
- if (u && u !== "Z") {
1647
- let e = At(u, !1);
1648
- Math.abs(e) < 30 && (e *= 60), l -= 6e4 * e;
1649
- }
1650
- return new Date(l);
1651
- },
1652
- stringify: ({ value: e }) => e?.toISOString().replace(/(T00:00:00)?\.000Z$/, "") ?? ""
1653
- }, Ft = [
1654
- H,
1655
- W,
1656
- qe,
1657
- Je,
1658
- _t,
1659
- vt,
1660
- wt,
1661
- Tt,
1662
- Et,
1663
- Dt,
1664
- yt,
1665
- bt,
1666
- xt,
1667
- ut,
1668
- R,
1669
- ht,
1670
- pt,
1671
- kt,
1672
- Mt,
1673
- Nt,
1674
- Pt
1675
- ], It = new Map([
1676
- ["core", at],
1677
- ["failsafe", [
1678
- H,
1679
- W,
1680
- qe
1681
- ]],
1682
- ["json", lt],
1683
- ["yaml11", Ft],
1684
- ["yaml-1.1", Ft]
1685
- ]), Lt = {
1686
- binary: ut,
1687
- bool: Ye,
1688
- float: Qe,
1689
- floatExp: Ze,
1690
- floatNaN: Xe,
1691
- floatTime: Nt,
1692
- int: rt,
1693
- intHex: it,
1694
- intOct: nt,
1695
- intTime: Mt,
1696
- map: H,
1697
- merge: R,
1698
- null: Je,
1699
- omap: ht,
1700
- pairs: pt,
1701
- seq: W,
1702
- set: kt,
1703
- timestamp: Pt
1704
- }, Rt = {
1705
- "tag:yaml.org,2002:binary": ut,
1706
- "tag:yaml.org,2002:merge": R,
1707
- "tag:yaml.org,2002:omap": ht,
1708
- "tag:yaml.org,2002:pairs": pt,
1709
- "tag:yaml.org,2002:set": kt,
1710
- "tag:yaml.org,2002:timestamp": Pt
1711
- };
1712
- function zt(e, t, n) {
1713
- let r = It.get(t);
1714
- if (r && !e) return n && !r.includes(R) ? r.concat(R) : r.slice();
1715
- let i = r;
1716
- if (!i) if (Array.isArray(e)) i = [];
1717
- else {
1718
- let e = Array.from(It.keys()).filter((e) => e !== "yaml11").map((e) => JSON.stringify(e)).join(", ");
1719
- throw Error(`Unknown schema "${t}"; use one of ${e} or define customTags array`);
1720
- }
1721
- if (Array.isArray(e)) for (let t of e) i = i.concat(t);
1722
- else typeof e == "function" && (i = e(i.slice()));
1723
- return n && (i = i.concat(R)), i.reduce((e, t) => {
1724
- let n = typeof t == "string" ? Lt[t] : t;
1725
- if (!n) {
1726
- let e = JSON.stringify(t), n = Object.keys(Lt).map((e) => JSON.stringify(e)).join(", ");
1727
- throw Error(`Unknown custom tag ${e}; use one of ${n}`);
1728
- }
1729
- return e.includes(n) || e.push(n), e;
1730
- }, []);
1731
- }
1732
- //#endregion
1733
- //#region ../../node_modules/yaml/browser/dist/schema/Schema.js
1734
- var Bt = (e, t) => e.key < t.key ? -1 : +(e.key > t.key), Vt = class e {
1735
- constructor({ compat: e, customTags: t, merge: n, resolveKnownTags: r, schema: a, sortMapEntries: c, toStringDefaults: l }) {
1736
- this.compat = Array.isArray(e) ? zt(e, "compat") : e ? zt(null, e) : null, this.name = typeof a == "string" && a || "core", this.knownTags = r ? Rt : {}, this.tags = zt(t, this.name, n), this.toStringOptions = l ?? null, Object.defineProperty(this, i, { value: H }), Object.defineProperty(this, o, { value: qe }), Object.defineProperty(this, s, { value: W }), this.sortMapEntries = typeof c == "function" ? c : c === !0 ? Bt : null;
1737
- }
1738
- clone() {
1739
- let t = Object.create(e.prototype, Object.getOwnPropertyDescriptors(this));
1740
- return t.tags = this.tags.slice(), t;
1741
- }
1742
- };
1743
- //#endregion
1744
- //#region ../../node_modules/yaml/browser/dist/stringify/stringifyDocument.js
1745
- function Ht(e, t) {
1746
- let n = [], r = t.directives === !0;
1747
- if (t.directives !== !1 && e.directives) {
1748
- let t = e.directives.toString(e);
1749
- t ? (n.push(t), r = !0) : e.directives.docStart && (r = !0);
1750
- }
1751
- r && n.push("---");
1752
- let i = ke(e, t), { commentString: a } = i.options;
1753
- if (e.commentBefore) {
1754
- n.length !== 1 && n.unshift("");
1755
- let t = a(e.commentBefore);
1756
- n.unshift(N(t, ""));
1757
- }
1758
- let o = !1, s = null;
1759
- if (e.contents) {
1760
- if (g(e.contents)) {
1761
- if (e.contents.spaceBefore && r && n.push(""), e.contents.commentBefore) {
1762
- let t = a(e.contents.commentBefore);
1763
- n.push(N(t, ""));
1764
- }
1765
- i.forceBlockIndent = !!e.comment, s = e.contents.comment;
1766
- }
1767
- let t = s ? void 0 : () => o = !0, c = L(e.contents, i, () => s = null, t);
1768
- s && (c += P(c, "", a(s))), (c[0] === "|" || c[0] === ">") && n[n.length - 1] === "---" ? n[n.length - 1] = `--- ${c}` : n.push(c);
1769
- } else n.push(L(e.contents, i));
1770
- if (e.directives?.docEnd) if (e.comment) {
1771
- let t = a(e.comment);
1772
- t.includes("\n") ? (n.push("..."), n.push(N(t, ""))) : n.push(`... ${t}`);
1773
- } else n.push("...");
1774
- else {
1775
- let t = e.comment;
1776
- t && o && (t = t.replace(/^\n+/, "")), t && ((!o || s) && n[n.length - 1] !== "" && n.push(""), n.push(N(a(t), "")));
1777
- }
1778
- return n.join("\n") + "\n";
1779
- }
1780
- //#endregion
1781
- //#region ../../node_modules/yaml/browser/dist/doc/Document.js
1782
- var Ut = class e {
1783
- constructor(e, t, n) {
1784
- this.commentBefore = null, this.comment = null, this.errors = [], this.warnings = [], Object.defineProperty(this, c, { value: r });
1785
- let i = null;
1786
- typeof t == "function" || Array.isArray(t) ? i = t : n === void 0 && t && (n = t, t = void 0);
1787
- let a = Object.assign({
1788
- intAsBigInt: !1,
1789
- keepSourceTokens: !1,
1790
- logLevel: "warn",
1791
- prettyErrors: !0,
1792
- strict: !0,
1793
- stringKeys: !1,
1794
- uniqueKeys: !0,
1795
- version: "1.2"
1796
- }, n);
1797
- this.options = a;
1798
- let { version: o } = a;
1799
- n?._directives ? (this.directives = n._directives.atDocument(), this.directives.yaml.explicit && (o = this.directives.yaml.version)) : this.directives = new D({ version: o }), this.setSchema(o, n), this.contents = e === void 0 ? null : this.createNode(e, i, n);
1800
- }
1801
- clone() {
1802
- let t = Object.create(e.prototype, { [c]: { value: r } });
1803
- return t.commentBefore = this.commentBefore, t.comment = this.comment, t.errors = this.errors.slice(), t.warnings = this.warnings.slice(), t.options = Object.assign({}, this.options), this.directives && (t.directives = this.directives.clone()), t.schema = this.schema.clone(), t.contents = g(this.contents) ? this.contents.clone(t.schema) : this.contents, this.range && (t.range = this.range.slice()), t;
1804
- }
1805
- add(e) {
1806
- q(this.contents) && this.contents.add(e);
1807
- }
1808
- addIn(e, t) {
1809
- q(this.contents) && this.contents.addIn(e, t);
1810
- }
1811
- createAlias(e, t) {
1812
- if (!e.anchor) {
1813
- let n = ie(this);
1814
- e.anchor = !t || n.has(t) ? ae(t || "a", n) : t;
1815
- }
1816
- return new ce(e.anchor);
1817
- }
1818
- createNode(e, t, n) {
1819
- let r;
1820
- if (typeof t == "function") e = t.call({ "": e }, "", e), r = t;
1821
- else if (Array.isArray(t)) {
1822
- let e = t.filter((e) => typeof e == "number" || e instanceof String || e instanceof Number).map(String);
1823
- e.length > 0 && (t = t.concat(e)), r = t;
1824
- } else n === void 0 && t && (n = t, t = void 0);
1825
- let { aliasDuplicateObjects: i, anchorPrefix: a, flow: o, keepUndefined: s, onTagObj: c, tag: l } = n ?? {}, { onAnchor: u, setAnchors: d, sourceObjects: f } = oe(this, a || "a"), p = {
1826
- aliasDuplicateObjects: i ?? !0,
1827
- keepUndefined: s ?? !1,
1828
- onAnchor: u,
1829
- onTagObj: c,
1830
- replacer: r,
1831
- schema: this.schema,
1832
- sourceObjects: f
1833
- }, m = j(e, l, p);
1834
- return o && h(m) && (m.flow = !0), d(), m;
1835
- }
1836
- createPair(e, t, n = {}) {
1837
- return new z(this.createNode(e, null, n), this.createNode(t, null, n));
1838
- }
1839
- delete(e) {
1840
- return q(this.contents) ? this.contents.delete(e) : !1;
1841
- }
1842
- deleteIn(e) {
1843
- return M(e) ? this.contents == null ? !1 : (this.contents = null, !0) : q(this.contents) ? this.contents.deleteIn(e) : !1;
1844
- }
1845
- get(e, t) {
1846
- return h(this.contents) ? this.contents.get(e, t) : void 0;
1847
- }
1848
- getIn(e, t) {
1849
- return M(e) ? !t && p(this.contents) ? this.contents.value : this.contents : h(this.contents) ? this.contents.getIn(e, t) : void 0;
1850
- }
1851
- has(e) {
1852
- return h(this.contents) ? this.contents.has(e) : !1;
1853
- }
1854
- hasIn(e) {
1855
- return M(e) ? this.contents !== void 0 : h(this.contents) ? this.contents.hasIn(e) : !1;
1856
- }
1857
- set(e, t) {
1858
- this.contents == null ? this.contents = pe(this.schema, [e], t) : q(this.contents) && this.contents.set(e, t);
1859
- }
1860
- setIn(e, t) {
1861
- M(e) ? this.contents = t : this.contents == null ? this.contents = pe(this.schema, Array.from(e), t) : q(this.contents) && this.contents.setIn(e, t);
1862
- }
1863
- setSchema(e, t = {}) {
1864
- typeof e == "number" && (e = String(e));
1865
- let n;
1866
- switch (e) {
1867
- case "1.1":
1868
- this.directives ? this.directives.yaml.version = "1.1" : this.directives = new D({ version: "1.1" }), n = {
1869
- resolveKnownTags: !1,
1870
- schema: "yaml-1.1"
1871
- };
1872
- break;
1873
- case "1.2":
1874
- case "next":
1875
- this.directives ? this.directives.yaml.version = e : this.directives = new D({ version: e }), n = {
1876
- resolveKnownTags: !0,
1877
- schema: "core"
1878
- };
1879
- break;
1880
- case null:
1881
- this.directives && delete this.directives, n = null;
1882
- break;
1883
- default: {
1884
- let t = JSON.stringify(e);
1885
- throw Error(`Expected '1.1', '1.2' or null as first argument, but found: ${t}`);
1886
- }
1887
- }
1888
- if (t.schema instanceof Object) this.schema = t.schema;
1889
- else if (n) this.schema = new Vt(Object.assign(n, t));
1890
- else throw Error("With a null YAML version, the { schema: Schema } option is required");
1891
- }
1892
- toJS({ json: e, jsonArg: t, mapAsMap: n, maxAliasCount: r, onAnchor: i, reviver: a } = {}) {
1893
- let o = {
1894
- anchors: /* @__PURE__ */ new Map(),
1895
- doc: this,
1896
- keep: !e,
1897
- mapAsMap: n === !0,
1898
- mapKeyWarned: !1,
1899
- maxAliasCount: typeof r == "number" ? r : 100
1900
- }, s = k(this.contents, t ?? "", o);
1901
- if (typeof i == "function") for (let { count: e, res: t } of o.anchors.values()) i(t, e);
1902
- return typeof a == "function" ? O(a, { "": s }, "", s) : s;
1903
- }
1904
- toJSON(e, t) {
1905
- return this.toJS({
1906
- json: !0,
1907
- jsonArg: e,
1908
- mapAsMap: !1,
1909
- onAnchor: t
1910
- });
1911
- }
1912
- toString(e = {}) {
1913
- if (this.errors.length > 0) throw Error("Document with errors cannot be stringified");
1914
- if ("indent" in e && (!Number.isInteger(e.indent) || Number(e.indent) <= 0)) {
1915
- let t = JSON.stringify(e.indent);
1916
- throw Error(`"indent" option must be a positive integer, not ${t}`);
1917
- }
1918
- return Ht(this, e);
1919
- }
1920
- };
1921
- function q(e) {
1922
- if (h(e)) return !0;
1923
- throw Error("Expected a YAML collection as document contents");
1924
- }
1925
- //#endregion
1926
- //#region ../../node_modules/yaml/browser/dist/errors.js
1927
- var Wt = class extends Error {
1928
- constructor(e, t, n, r) {
1929
- super(), this.name = e, this.code = n, this.message = r, this.pos = t;
1930
- }
1931
- }, J = class extends Wt {
1932
- constructor(e, t, n) {
1933
- super("YAMLParseError", e, t, n);
1934
- }
1935
- }, Gt = class extends Wt {
1936
- constructor(e, t, n) {
1937
- super("YAMLWarning", e, t, n);
1938
- }
1939
- }, Kt = (e, t) => (n) => {
1940
- if (n.pos[0] === -1) return;
1941
- n.linePos = n.pos.map((e) => t.linePos(e));
1942
- let { line: r, col: i } = n.linePos[0];
1943
- n.message += ` at line ${r}, column ${i}`;
1944
- let a = i - 1, o = e.substring(t.lineStarts[r - 1], t.lineStarts[r]).replace(/[\n\r]+$/, "");
1945
- if (a >= 60 && o.length > 80) {
1946
- let e = Math.min(a - 39, o.length - 79);
1947
- o = "…" + o.substring(e), a -= e - 1;
1948
- }
1949
- if (o.length > 80 && (o = o.substring(0, 79) + "…"), r > 1 && /^ *$/.test(o.substring(0, a))) {
1950
- let n = e.substring(t.lineStarts[r - 2], t.lineStarts[r - 1]);
1951
- n.length > 80 && (n = n.substring(0, 79) + "…\n"), o = n + o;
1952
- }
1953
- if (/[^ ]/.test(o)) {
1954
- let e = 1, t = n.linePos[1];
1955
- t?.line === r && t.col > i && (e = Math.max(1, Math.min(t.col - i, 80 - a)));
1956
- let s = " ".repeat(a) + "^".repeat(e);
1957
- n.message += `:\n\n${o}\n${s}\n`;
1958
- }
1959
- };
1960
- //#endregion
1961
- //#region ../../node_modules/yaml/browser/dist/compose/resolve-props.js
1962
- function Y(e, { flow: t, indicator: n, next: r, offset: i, onError: a, parentIndent: o, startOnNewline: s }) {
1963
- let c = !1, l = s, u = s, d = "", f = "", p = !1, m = !1, h = null, g = null, _ = null, v = null, y = null, b = null, x = null;
1964
- for (let i of e) switch (m &&= (i.type !== "space" && i.type !== "newline" && i.type !== "comma" && a(i.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), !1), h &&= (l && i.type !== "comment" && i.type !== "newline" && a(h, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), null), i.type) {
1965
- case "space":
1966
- !t && (n !== "doc-start" || r?.type !== "flow-collection") && i.source.includes(" ") && (h = i), u = !0;
1967
- break;
1968
- case "comment": {
1969
- u || a(i, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
1970
- let e = i.source.substring(1) || " ";
1971
- d ? d += f + e : d = e, f = "", l = !1;
1972
- break;
1973
- }
1974
- case "newline":
1975
- l ? d ? d += i.source : (!b || n !== "seq-item-ind") && (c = !0) : f += i.source, l = !0, p = !0, (g || _) && (v = i), u = !0;
1976
- break;
1977
- case "anchor":
1978
- g && a(i, "MULTIPLE_ANCHORS", "A node can have at most one anchor"), i.source.endsWith(":") && a(i.offset + i.source.length - 1, "BAD_ALIAS", "Anchor ending in : is ambiguous", !0), g = i, x ??= i.offset, l = !1, u = !1, m = !0;
1979
- break;
1980
- case "tag":
1981
- _ && a(i, "MULTIPLE_TAGS", "A node can have at most one tag"), _ = i, x ??= i.offset, l = !1, u = !1, m = !0;
1982
- break;
1983
- case n:
1984
- (g || _) && a(i, "BAD_PROP_ORDER", `Anchors and tags must be after the ${i.source} indicator`), b && a(i, "UNEXPECTED_TOKEN", `Unexpected ${i.source} in ${t ?? "collection"}`), b = i, l = n === "seq-item-ind" || n === "explicit-key-ind", u = !1;
1985
- break;
1986
- case "comma": if (t) {
1987
- y && a(i, "UNEXPECTED_TOKEN", `Unexpected , in ${t}`), y = i, l = !1, u = !1;
1988
- break;
1989
- }
1990
- default: a(i, "UNEXPECTED_TOKEN", `Unexpected ${i.type} token`), l = !1, u = !1;
1991
- }
1992
- let S = e[e.length - 1], C = S ? S.offset + S.source.length : i;
1993
- return m && r && r.type !== "space" && r.type !== "newline" && r.type !== "comma" && (r.type !== "scalar" || r.source !== "") && a(r.offset, "MISSING_CHAR", "Tags and anchors must be separated from the next token by white space"), h && (l && h.indent <= o || r?.type === "block-map" || r?.type === "block-seq") && a(h, "TAB_AS_INDENT", "Tabs are not allowed as indentation"), {
1994
- comma: y,
1995
- found: b,
1996
- spaceBefore: c,
1997
- comment: d,
1998
- hasNewline: p,
1999
- anchor: g,
2000
- tag: _,
2001
- newlineAfterProp: v,
2002
- end: C,
2003
- start: x ?? C
2004
- };
2005
- }
2006
- //#endregion
2007
- //#region ../../node_modules/yaml/browser/dist/compose/util-contains-newline.js
2008
- function qt(e) {
2009
- if (!e) return null;
2010
- switch (e.type) {
2011
- case "alias":
2012
- case "scalar":
2013
- case "double-quoted-scalar":
2014
- case "single-quoted-scalar":
2015
- if (e.source.includes("\n")) return !0;
2016
- if (e.end) {
2017
- for (let t of e.end) if (t.type === "newline") return !0;
2018
- }
2019
- return !1;
2020
- case "flow-collection":
2021
- for (let t of e.items) {
2022
- for (let e of t.start) if (e.type === "newline") return !0;
2023
- if (t.sep) {
2024
- for (let e of t.sep) if (e.type === "newline") return !0;
2025
- }
2026
- if (qt(t.key) || qt(t.value)) return !0;
2027
- }
2028
- return !1;
2029
- default: return !0;
2030
- }
2031
- }
2032
- //#endregion
2033
- //#region ../../node_modules/yaml/browser/dist/compose/util-flow-indent-check.js
2034
- function Jt(e, t, n) {
2035
- if (t?.type === "flow-collection") {
2036
- let r = t.end[0];
2037
- r.indent === e && (r.source === "]" || r.source === "}") && qt(t) && n(r, "BAD_INDENT", "Flow end indicator should be more indented than parent", !0);
2038
- }
2039
- }
2040
- //#endregion
2041
- //#region ../../node_modules/yaml/browser/dist/compose/util-map-includes.js
2042
- function Yt(e, t, n) {
2043
- let { uniqueKeys: r } = e.options;
2044
- if (r === !1) return !1;
2045
- let i = typeof r == "function" ? r : (e, t) => e === t || p(e) && p(t) && e.value === t.value;
2046
- return t.some((e) => i(e.key, n));
2047
- }
2048
- //#endregion
2049
- //#region ../../node_modules/yaml/browser/dist/compose/resolve-block-map.js
2050
- var Xt = "All mapping items must start at the same column";
2051
- function Zt({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
2052
- let o = new (a?.nodeClass ?? V)(n.schema);
2053
- n.atRoot &&= !1;
2054
- let s = r.offset, c = null;
2055
- for (let a of r.items) {
2056
- let { start: l, key: u, sep: d, value: f } = a, p = Y(l, {
2057
- indicator: "explicit-key-ind",
2058
- next: u ?? d?.[0],
2059
- offset: s,
2060
- onError: i,
2061
- parentIndent: r.indent,
2062
- startOnNewline: !0
2063
- }), m = !p.found;
2064
- if (m) {
2065
- if (u && (u.type === "block-seq" ? i(s, "BLOCK_AS_IMPLICIT_KEY", "A block sequence may not be used as an implicit map key") : "indent" in u && u.indent !== r.indent && i(s, "BAD_INDENT", Xt)), !p.anchor && !p.tag && !d) {
2066
- c = p.end, p.comment && (o.comment ? o.comment += "\n" + p.comment : o.comment = p.comment);
2067
- continue;
2068
- }
2069
- (p.newlineAfterProp || qt(u)) && i(u ?? l[l.length - 1], "MULTILINE_IMPLICIT_KEY", "Implicit keys need to be on a single line");
2070
- } else p.found?.indent !== r.indent && i(s, "BAD_INDENT", Xt);
2071
- n.atKey = !0;
2072
- let h = p.end, g = u ? e(n, u, p, i) : t(n, h, l, null, p, i);
2073
- n.schema.compat && Jt(r.indent, u, i), n.atKey = !1, Yt(n, o.items, g) && i(h, "DUPLICATE_KEY", "Map keys must be unique");
2074
- let _ = Y(d ?? [], {
2075
- indicator: "map-value-ind",
2076
- next: f,
2077
- offset: g.range[2],
2078
- onError: i,
2079
- parentIndent: r.indent,
2080
- startOnNewline: !u || u.type === "block-scalar"
2081
- });
2082
- if (s = _.end, _.found) {
2083
- m && (f?.type === "block-map" && !_.hasNewline && i(s, "BLOCK_AS_IMPLICIT_KEY", "Nested mappings are not allowed in compact mappings"), n.options.strict && p.start < _.found.offset - 1024 && i(g.range, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));
2084
- let c = f ? e(n, f, _, i) : t(n, s, d, null, _, i);
2085
- n.schema.compat && Jt(r.indent, f, i), s = c.range[2];
2086
- let l = new z(g, c);
2087
- n.options.keepSourceTokens && (l.srcToken = a), o.items.push(l);
2088
- } else {
2089
- m && i(g.range, "MISSING_CHAR", "Implicit map keys need to be followed by map values"), _.comment && (g.comment ? g.comment += "\n" + _.comment : g.comment = _.comment);
2090
- let e = new z(g);
2091
- n.options.keepSourceTokens && (e.srcToken = a), o.items.push(e);
2092
- }
2093
- }
2094
- return c && c < s && i(c, "IMPOSSIBLE", "Map comment with trailing content"), o.range = [
2095
- r.offset,
2096
- s,
2097
- c ?? s
2098
- ], o;
2099
- }
2100
- //#endregion
2101
- //#region ../../node_modules/yaml/browser/dist/compose/resolve-block-seq.js
2102
- function Qt({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
2103
- let o = new (a?.nodeClass ?? U)(n.schema);
2104
- n.atRoot &&= !1, n.atKey &&= !1;
2105
- let s = r.offset, c = null;
2106
- for (let { start: a, value: l } of r.items) {
2107
- let u = Y(a, {
2108
- indicator: "seq-item-ind",
2109
- next: l,
2110
- offset: s,
2111
- onError: i,
2112
- parentIndent: r.indent,
2113
- startOnNewline: !0
2114
- });
2115
- if (!u.found) if (u.anchor || u.tag || l) l?.type === "block-seq" ? i(u.end, "BAD_INDENT", "All sequence items must start at the same column") : i(s, "MISSING_CHAR", "Sequence item without - indicator");
2116
- else {
2117
- c = u.end, u.comment && (o.comment = u.comment);
2118
- continue;
2119
- }
2120
- let d = l ? e(n, l, u, i) : t(n, u.end, a, null, u, i);
2121
- n.schema.compat && Jt(r.indent, l, i), s = d.range[2], o.items.push(d);
2122
- }
2123
- return o.range = [
2124
- r.offset,
2125
- s,
2126
- c ?? s
2127
- ], o;
2128
- }
2129
- //#endregion
2130
- //#region ../../node_modules/yaml/browser/dist/compose/resolve-end.js
2131
- function $t(e, t, n, r) {
2132
- let i = "";
2133
- if (e) {
2134
- let a = !1, o = "";
2135
- for (let s of e) {
2136
- let { source: e, type: c } = s;
2137
- switch (c) {
2138
- case "space":
2139
- a = !0;
2140
- break;
2141
- case "comment": {
2142
- n && !a && r(s, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters");
2143
- let t = e.substring(1) || " ";
2144
- i ? i += o + t : i = t, o = "";
2145
- break;
2146
- }
2147
- case "newline":
2148
- i && (o += e), a = !0;
2149
- break;
2150
- default: r(s, "UNEXPECTED_TOKEN", `Unexpected ${c} at node end`);
2151
- }
2152
- t += e.length;
2153
- }
2154
- }
2155
- return {
2156
- comment: i,
2157
- offset: t
2158
- };
2159
- }
2160
- //#endregion
2161
- //#region ../../node_modules/yaml/browser/dist/compose/resolve-flow-collection.js
2162
- var en = "Block collections are not allowed within flow collections", tn = (e) => e && (e.type === "block-map" || e.type === "block-seq");
2163
- function nn({ composeNode: e, composeEmptyNode: t }, n, r, i, a) {
2164
- let o = r.start.source === "{", s = o ? "flow map" : "flow sequence", c = new (a?.nodeClass ?? (o ? V : U))(n.schema);
2165
- c.flow = !0;
2166
- let l = n.atRoot;
2167
- l && (n.atRoot = !1), n.atKey &&= !1;
2168
- let u = r.offset + r.start.source.length;
2169
- for (let a = 0; a < r.items.length; ++a) {
2170
- let l = r.items[a], { start: d, key: p, sep: m, value: h } = l, g = Y(d, {
2171
- flow: s,
2172
- indicator: "explicit-key-ind",
2173
- next: p ?? m?.[0],
2174
- offset: u,
2175
- onError: i,
2176
- parentIndent: r.indent,
2177
- startOnNewline: !1
2178
- });
2179
- if (!g.found) {
2180
- if (!g.anchor && !g.tag && !m && !h) {
2181
- a === 0 && g.comma ? i(g.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${s}`) : a < r.items.length - 1 && i(g.start, "UNEXPECTED_TOKEN", `Unexpected empty item in ${s}`), g.comment && (c.comment ? c.comment += "\n" + g.comment : c.comment = g.comment), u = g.end;
2182
- continue;
2183
- }
2184
- !o && n.options.strict && qt(p) && i(p, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
2185
- }
2186
- if (a === 0) g.comma && i(g.comma, "UNEXPECTED_TOKEN", `Unexpected , in ${s}`);
2187
- else if (g.comma || i(g.start, "MISSING_CHAR", `Missing , between ${s} items`), g.comment) {
2188
- let e = "";
2189
- loop: for (let t of d) switch (t.type) {
2190
- case "comma":
2191
- case "space": break;
2192
- case "comment":
2193
- e = t.source.substring(1);
2194
- break loop;
2195
- default: break loop;
2196
- }
2197
- if (e) {
2198
- let t = c.items[c.items.length - 1];
2199
- f(t) && (t = t.value ?? t.key), t.comment ? t.comment += "\n" + e : t.comment = e, g.comment = g.comment.substring(e.length + 1);
2200
- }
2201
- }
2202
- if (!o && !m && !g.found) {
2203
- let r = h ? e(n, h, g, i) : t(n, g.end, m, null, g, i);
2204
- c.items.push(r), u = r.range[2], tn(h) && i(r.range, "BLOCK_IN_FLOW", en);
2205
- } else {
2206
- n.atKey = !0;
2207
- let a = g.end, f = p ? e(n, p, g, i) : t(n, a, d, null, g, i);
2208
- tn(p) && i(f.range, "BLOCK_IN_FLOW", en), n.atKey = !1;
2209
- let _ = Y(m ?? [], {
2210
- flow: s,
2211
- indicator: "map-value-ind",
2212
- next: h,
2213
- offset: f.range[2],
2214
- onError: i,
2215
- parentIndent: r.indent,
2216
- startOnNewline: !1
2217
- });
2218
- if (_.found) {
2219
- if (!o && !g.found && n.options.strict) {
2220
- if (m) for (let e of m) {
2221
- if (e === _.found) break;
2222
- if (e.type === "newline") {
2223
- i(e, "MULTILINE_IMPLICIT_KEY", "Implicit keys of flow sequence pairs need to be on a single line");
2224
- break;
2225
- }
2226
- }
2227
- g.start < _.found.offset - 1024 && i(_.found, "KEY_OVER_1024_CHARS", "The : indicator must be at most 1024 chars after the start of an implicit flow sequence key");
2228
- }
2229
- } else h && ("source" in h && h.source?.[0] === ":" ? i(h, "MISSING_CHAR", `Missing space after : in ${s}`) : i(_.start, "MISSING_CHAR", `Missing , or : between ${s} items`));
2230
- let v = h ? e(n, h, _, i) : _.found ? t(n, _.end, m, null, _, i) : null;
2231
- v ? tn(h) && i(v.range, "BLOCK_IN_FLOW", en) : _.comment && (f.comment ? f.comment += "\n" + _.comment : f.comment = _.comment);
2232
- let y = new z(f, v);
2233
- if (n.options.keepSourceTokens && (y.srcToken = l), o) {
2234
- let e = c;
2235
- Yt(n, e.items, f) && i(a, "DUPLICATE_KEY", "Map keys must be unique"), e.items.push(y);
2236
- } else {
2237
- let e = new V(n.schema);
2238
- e.flow = !0, e.items.push(y);
2239
- let t = (v ?? f).range;
2240
- e.range = [
2241
- f.range[0],
2242
- t[1],
2243
- t[2]
2244
- ], c.items.push(e);
2245
- }
2246
- u = v ? v.range[2] : _.end;
2247
- }
2248
- }
2249
- let d = o ? "}" : "]", [p, ...m] = r.end, h = u;
2250
- if (p?.source === d) h = p.offset + p.source.length;
2251
- else {
2252
- let e = s[0].toUpperCase() + s.substring(1), t = l ? `${e} must end with a ${d}` : `${e} in block collection must be sufficiently indented and end with a ${d}`;
2253
- i(u, l ? "MISSING_CHAR" : "BAD_INDENT", t), p && p.source.length !== 1 && m.unshift(p);
2254
- }
2255
- if (m.length > 0) {
2256
- let e = $t(m, h, n.options.strict, i);
2257
- e.comment && (c.comment ? c.comment += "\n" + e.comment : c.comment = e.comment), c.range = [
2258
- r.offset,
2259
- h,
2260
- e.offset
2261
- ];
2262
- } else c.range = [
2263
- r.offset,
2264
- h,
2265
- h
2266
- ];
2267
- return c;
2268
- }
2269
- //#endregion
2270
- //#region ../../node_modules/yaml/browser/dist/compose/compose-collection.js
2271
- function rn(e, t, n, r, i, a) {
2272
- let o = n.type === "block-map" ? Zt(e, t, n, r, a) : n.type === "block-seq" ? Qt(e, t, n, r, a) : nn(e, t, n, r, a), s = o.constructor;
2273
- return i === "!" || i === s.tagName ? (o.tag = s.tagName, o) : (i && (o.tag = i), o);
2274
- }
2275
- function an(e, t, n, r, i) {
2276
- let a = r.tag, o = a ? t.directives.tagName(a.source, (e) => i(a, "TAG_RESOLVE_FAILED", e)) : null;
2277
- if (n.type === "block-seq") {
2278
- let { anchor: e, newlineAfterProp: t } = r, n = e && a ? e.offset > a.offset ? e : a : e ?? a;
2279
- n && (!t || t.offset < n.offset) && i(n, "MISSING_CHAR", "Missing newline after block sequence props");
2280
- }
2281
- let s = n.type === "block-map" ? "map" : n.type === "block-seq" ? "seq" : n.start.source === "{" ? "map" : "seq";
2282
- if (!a || !o || o === "!" || o === V.tagName && s === "map" || o === U.tagName && s === "seq") return rn(e, t, n, i, o);
2283
- let c = t.schema.tags.find((e) => e.tag === o && e.collection === s);
2284
- if (!c) {
2285
- let r = t.schema.knownTags[o];
2286
- if (r?.collection === s) t.schema.tags.push(Object.assign({}, r, { default: !1 })), c = r;
2287
- else return r ? i(a, "BAD_COLLECTION_TYPE", `${r.tag} used for ${s} collection, but expects ${r.collection ?? "scalar"}`, !0) : i(a, "TAG_RESOLVE_FAILED", `Unresolved tag: ${o}`, !0), rn(e, t, n, i, o);
2288
- }
2289
- let l = rn(e, t, n, i, o, c), u = c.resolve?.(l, (e) => i(a, "TAG_RESOLVE_FAILED", e), t.options) ?? l, d = g(u) ? u : new A(u);
2290
- return d.range = l.range, d.tag = o, c?.format && (d.format = c.format), d;
2291
- }
2292
- //#endregion
2293
- //#region ../../node_modules/yaml/browser/dist/compose/resolve-block-scalar.js
2294
- function on(e, t, n) {
2295
- let r = t.offset, i = sn(t, e.options.strict, n);
2296
- if (!i) return {
2297
- value: "",
2298
- type: null,
2299
- comment: "",
2300
- range: [
2301
- r,
2302
- r,
2303
- r
2304
- ]
2305
- };
2306
- let a = i.mode === ">" ? A.BLOCK_FOLDED : A.BLOCK_LITERAL, o = t.source ? cn(t.source) : [], s = o.length;
2307
- for (let e = o.length - 1; e >= 0; --e) {
2308
- let t = o[e][1];
2309
- if (t === "" || t === "\r") s = e;
2310
- else break;
2311
- }
2312
- if (s === 0) {
2313
- let e = i.chomp === "+" && o.length > 0 ? "\n".repeat(Math.max(1, o.length - 1)) : "", n = r + i.length;
2314
- return t.source && (n += t.source.length), {
2315
- value: e,
2316
- type: a,
2317
- comment: i.comment,
2318
- range: [
2319
- r,
2320
- n,
2321
- n
2322
- ]
2323
- };
2324
- }
2325
- let c = t.indent + i.indent, l = t.offset + i.length, u = 0;
2326
- for (let t = 0; t < s; ++t) {
2327
- let [r, a] = o[t];
2328
- if (a === "" || a === "\r") i.indent === 0 && r.length > c && (c = r.length);
2329
- else {
2330
- r.length < c && n(l + r.length, "MISSING_CHAR", "Block scalars with more-indented leading empty lines must use an explicit indentation indicator"), i.indent === 0 && (c = r.length), u = t, c === 0 && !e.atRoot && n(l, "BAD_INDENT", "Block scalar values in collections must be indented");
2331
- break;
2332
- }
2333
- l += r.length + a.length + 1;
2334
- }
2335
- for (let e = o.length - 1; e >= s; --e) o[e][0].length > c && (s = e + 1);
2336
- let d = "", f = "", p = !1;
2337
- for (let e = 0; e < u; ++e) d += o[e][0].slice(c) + "\n";
2338
- for (let e = u; e < s; ++e) {
2339
- let [t, r] = o[e];
2340
- l += t.length + r.length + 1;
2341
- let s = r[r.length - 1] === "\r";
2342
- /* istanbul ignore if already caught in lexer */
2343
- if (s && (r = r.slice(0, -1)), r && t.length < c) {
2344
- let e = `Block scalar lines must not be less indented than their ${i.indent ? "explicit indentation indicator" : "first line"}`;
2345
- n(l - r.length - (s ? 2 : 1), "BAD_INDENT", e), t = "";
2346
- }
2347
- a === A.BLOCK_LITERAL ? (d += f + t.slice(c) + r, f = "\n") : t.length > c || r[0] === " " ? (f === " " ? f = "\n" : !p && f === "\n" && (f = "\n\n"), d += f + t.slice(c) + r, f = "\n", p = !0) : r === "" ? f === "\n" ? d += "\n" : f = "\n" : (d += f + r, f = " ", p = !1);
2348
- }
2349
- switch (i.chomp) {
2350
- case "-": break;
2351
- case "+":
2352
- for (let e = s; e < o.length; ++e) d += "\n" + o[e][0].slice(c);
2353
- d[d.length - 1] !== "\n" && (d += "\n");
2354
- break;
2355
- default: d += "\n";
2356
- }
2357
- let m = r + i.length + t.source.length;
2358
- return {
2359
- value: d,
2360
- type: a,
2361
- comment: i.comment,
2362
- range: [
2363
- r,
2364
- m,
2365
- m
2366
- ]
2367
- };
2368
- }
2369
- function sn({ offset: e, props: t }, n, r) {
2370
- /* istanbul ignore if should not happen */
2371
- if (t[0].type !== "block-scalar-header") return r(t[0], "IMPOSSIBLE", "Block scalar header not found"), null;
2372
- let { source: i } = t[0], a = i[0], o = 0, s = "", c = -1;
2373
- for (let t = 1; t < i.length; ++t) {
2374
- let n = i[t];
2375
- if (!s && (n === "-" || n === "+")) s = n;
2376
- else {
2377
- let r = Number(n);
2378
- !o && r ? o = r : c === -1 && (c = e + t);
2379
- }
2380
- }
2381
- c !== -1 && r(c, "UNEXPECTED_TOKEN", `Block scalar header includes extra characters: ${i}`);
2382
- let l = !1, u = "", d = i.length;
2383
- for (let e = 1; e < t.length; ++e) {
2384
- let i = t[e];
2385
- switch (i.type) {
2386
- case "space": l = !0;
2387
- case "newline":
2388
- d += i.source.length;
2389
- break;
2390
- case "comment":
2391
- n && !l && r(i, "MISSING_CHAR", "Comments must be separated from other tokens by white space characters"), d += i.source.length, u = i.source.substring(1);
2392
- break;
2393
- case "error":
2394
- r(i, "UNEXPECTED_TOKEN", i.message), d += i.source.length;
2395
- break;
2396
- /* istanbul ignore next should not happen */
2397
- default: {
2398
- r(i, "UNEXPECTED_TOKEN", `Unexpected token in block scalar header: ${i.type}`);
2399
- let e = i.source;
2400
- e && typeof e == "string" && (d += e.length);
2401
- }
2402
- }
2403
- }
2404
- return {
2405
- mode: a,
2406
- indent: o,
2407
- chomp: s,
2408
- comment: u,
2409
- length: d
2410
- };
2411
- }
2412
- function cn(e) {
2413
- let t = e.split(/\n( *)/), n = t[0], r = n.match(/^( *)/), i = [r?.[1] ? [r[1], n.slice(r[1].length)] : ["", n]];
2414
- for (let e = 1; e < t.length; e += 2) i.push([t[e], t[e + 1]]);
2415
- return i;
2416
- }
2417
- //#endregion
2418
- //#region ../../node_modules/yaml/browser/dist/compose/resolve-flow-scalar.js
2419
- function ln(e, t, n) {
2420
- let { offset: r, type: i, source: a, end: o } = e, s, c, l = (e, t, i) => n(r + e, t, i);
2421
- switch (i) {
2422
- case "scalar":
2423
- s = A.PLAIN, c = un(a, l);
2424
- break;
2425
- case "single-quoted-scalar":
2426
- s = A.QUOTE_SINGLE, c = dn(a, l);
2427
- break;
2428
- case "double-quoted-scalar":
2429
- s = A.QUOTE_DOUBLE, c = pn(a, l);
2430
- break;
2431
- /* istanbul ignore next should not happen */
2432
- default: return n(e, "UNEXPECTED_TOKEN", `Expected a flow scalar value, but found: ${i}`), {
2433
- value: "",
2434
- type: null,
2435
- comment: "",
2436
- range: [
2437
- r,
2438
- r + a.length,
2439
- r + a.length
2440
- ]
2441
- };
2442
- }
2443
- let u = r + a.length, d = $t(o, u, t, n);
2444
- return {
2445
- value: c,
2446
- type: s,
2447
- comment: d.comment,
2448
- range: [
2449
- r,
2450
- u,
2451
- d.offset
2452
- ]
2453
- };
2454
- }
2455
- function un(e, t) {
2456
- let n = "";
2457
- switch (e[0]) {
2458
- /* istanbul ignore next should not happen */
2459
- case " ":
2460
- n = "a tab character";
2461
- break;
2462
- case ",":
2463
- n = "flow indicator character ,";
2464
- break;
2465
- case "%":
2466
- n = "directive indicator character %";
2467
- break;
2468
- case "|":
2469
- case ">":
2470
- n = `block scalar indicator ${e[0]}`;
2471
- break;
2472
- case "@":
2473
- case "`":
2474
- n = `reserved character ${e[0]}`;
2475
- break;
2476
- }
2477
- return n && t(0, "BAD_SCALAR_START", `Plain value cannot start with ${n}`), fn(e);
2478
- }
2479
- function dn(e, t) {
2480
- return (e[e.length - 1] !== "'" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing 'quote"), fn(e.slice(1, -1)).replace(/''/g, "'");
2481
- }
2482
- function fn(e) {
2483
- let t, n;
2484
- try {
2485
- t = /* @__PURE__ */ RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy"), n = /* @__PURE__ */ RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
2486
- } catch {
2487
- t = /(.*?)[ \t]*\r?\n/sy, n = /[ \t]*(.*?)[ \t]*\r?\n/sy;
2488
- }
2489
- let r = t.exec(e);
2490
- if (!r) return e;
2491
- let i = r[1], a = " ", o = t.lastIndex;
2492
- for (n.lastIndex = o; r = n.exec(e);) r[1] === "" ? a === "\n" ? i += a : a = "\n" : (i += a + r[1], a = " "), o = n.lastIndex;
2493
- let s = /[ \t]*(.*)/sy;
2494
- return s.lastIndex = o, r = s.exec(e), i + a + (r?.[1] ?? "");
2495
- }
2496
- function pn(e, t) {
2497
- let n = "";
2498
- for (let r = 1; r < e.length - 1; ++r) {
2499
- let i = e[r];
2500
- if (!(i === "\r" && e[r + 1] === "\n")) if (i === "\n") {
2501
- let { fold: t, offset: i } = mn(e, r);
2502
- n += t, r = i;
2503
- } else if (i === "\\") {
2504
- let i = e[++r], a = hn[i];
2505
- if (a) n += a;
2506
- else if (i === "\n") for (i = e[r + 1]; i === " " || i === " ";) i = e[++r + 1];
2507
- else if (i === "\r" && e[r + 1] === "\n") for (i = e[++r + 1]; i === " " || i === " ";) i = e[++r + 1];
2508
- else if (i === "x" || i === "u" || i === "U") {
2509
- let a = i === "x" ? 2 : i === "u" ? 4 : 8;
2510
- n += gn(e, r + 1, a, t), r += a;
2511
- } else {
2512
- let i = e.substr(r - 1, 2);
2513
- t(r - 1, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), n += i;
2514
- }
2515
- } else if (i === " " || i === " ") {
2516
- let t = r, a = e[r + 1];
2517
- for (; a === " " || a === " ";) a = e[++r + 1];
2518
- a !== "\n" && !(a === "\r" && e[r + 2] === "\n") && (n += r > t ? e.slice(t, r + 1) : i);
2519
- } else n += i;
2520
- }
2521
- return (e[e.length - 1] !== "\"" || e.length === 1) && t(e.length, "MISSING_CHAR", "Missing closing \"quote"), n;
2522
- }
2523
- function mn(e, t) {
2524
- let n = "", r = e[t + 1];
2525
- for (; (r === " " || r === " " || r === "\n" || r === "\r") && !(r === "\r" && e[t + 2] !== "\n");) r === "\n" && (n += "\n"), t += 1, r = e[t + 1];
2526
- return n ||= " ", {
2527
- fold: n,
2528
- offset: t
2529
- };
2530
- }
2531
- var hn = {
2532
- 0: "\0",
2533
- a: "\x07",
2534
- b: "\b",
2535
- e: "\x1B",
2536
- f: "\f",
2537
- n: "\n",
2538
- r: "\r",
2539
- t: " ",
2540
- v: "\v",
2541
- N: "…",
2542
- _: "\xA0",
2543
- L: "\u2028",
2544
- P: "\u2029",
2545
- " ": " ",
2546
- "\"": "\"",
2547
- "/": "/",
2548
- "\\": "\\",
2549
- " ": " "
2550
- };
2551
- function gn(e, t, n, r) {
2552
- let i = e.substr(t, n), a = i.length === n && /^[0-9a-fA-F]+$/.test(i) ? parseInt(i, 16) : NaN;
2553
- try {
2554
- return String.fromCodePoint(a);
2555
- } catch {
2556
- let i = e.substr(t - 2, n + 2);
2557
- return r(t - 2, "BAD_DQ_ESCAPE", `Invalid escape sequence ${i}`), i;
2558
- }
2559
- }
2560
- //#endregion
2561
- //#region ../../node_modules/yaml/browser/dist/compose/compose-scalar.js
2562
- function _n(e, t, n, r) {
2563
- let { value: i, type: a, comment: s, range: c } = t.type === "block-scalar" ? on(e, t, r) : ln(t, e.options.strict, r), l = n ? e.directives.tagName(n.source, (e) => r(n, "TAG_RESOLVE_FAILED", e)) : null, u;
2564
- u = e.options.stringKeys && e.atKey ? e.schema[o] : l ? vn(e.schema, i, l, n, r) : t.type === "scalar" ? yn(e, i, t, r) : e.schema[o];
2565
- let d;
2566
- try {
2567
- let a = u.resolve(i, (e) => r(n ?? t, "TAG_RESOLVE_FAILED", e), e.options);
2568
- d = p(a) ? a : new A(a);
2569
- } catch (e) {
2570
- let a = e instanceof Error ? e.message : String(e);
2571
- r(n ?? t, "TAG_RESOLVE_FAILED", a), d = new A(i);
2572
- }
2573
- return d.range = c, d.source = i, a && (d.type = a), l && (d.tag = l), u.format && (d.format = u.format), s && (d.comment = s), d;
2574
- }
2575
- function vn(e, t, n, r, i) {
2576
- if (n === "!") return e[o];
2577
- let a = [];
2578
- for (let t of e.tags) if (!t.collection && t.tag === n) if (t.default && t.test) a.push(t);
2579
- else return t;
2580
- for (let e of a) if (e.test?.test(t)) return e;
2581
- let s = e.knownTags[n];
2582
- return s && !s.collection ? (e.tags.push(Object.assign({}, s, {
2583
- default: !1,
2584
- test: void 0
2585
- })), s) : (i(r, "TAG_RESOLVE_FAILED", `Unresolved tag: ${n}`, n !== "tag:yaml.org,2002:str"), e[o]);
2586
- }
2587
- function yn({ atKey: e, directives: t, schema: n }, r, i, a) {
2588
- let s = n.tags.find((t) => (t.default === !0 || e && t.default === "key") && t.test?.test(r)) || n[o];
2589
- if (n.compat) {
2590
- let e = n.compat.find((e) => e.default && e.test?.test(r)) ?? n[o];
2591
- s.tag !== e.tag && a(i, "TAG_RESOLVE_FAILED", `Value may be parsed as either ${t.tagString(s.tag)} or ${t.tagString(e.tag)}`, !0);
2592
- }
2593
- return s;
2594
- }
2595
- //#endregion
2596
- //#region ../../node_modules/yaml/browser/dist/compose/util-empty-scalar-position.js
2597
- function bn(e, t, n) {
2598
- if (t) {
2599
- n ??= t.length;
2600
- for (let r = n - 1; r >= 0; --r) {
2601
- let n = t[r];
2602
- switch (n.type) {
2603
- case "space":
2604
- case "comment":
2605
- case "newline":
2606
- e -= n.source.length;
2607
- continue;
2608
- }
2609
- for (n = t[++r]; n?.type === "space";) e += n.source.length, n = t[++r];
2610
- break;
2611
- }
2612
- }
2613
- return e;
2614
- }
2615
- //#endregion
2616
- //#region ../../node_modules/yaml/browser/dist/compose/compose-node.js
2617
- var xn = {
2618
- composeNode: Sn,
2619
- composeEmptyNode: Cn
2620
- };
2621
- function Sn(e, t, n, r) {
2622
- let i = e.atKey, { spaceBefore: a, comment: o, anchor: s, tag: c } = n, l, u = !0;
2623
- switch (t.type) {
2624
- case "alias":
2625
- l = wn(e, t, r), (s || c) && r(t, "ALIAS_PROPS", "An alias node must not specify any properties");
2626
- break;
2627
- case "scalar":
2628
- case "single-quoted-scalar":
2629
- case "double-quoted-scalar":
2630
- case "block-scalar":
2631
- l = _n(e, t, c, r), s && (l.anchor = s.source.substring(1));
2632
- break;
2633
- case "block-map":
2634
- case "block-seq":
2635
- case "flow-collection":
2636
- try {
2637
- l = an(xn, e, t, n, r), s && (l.anchor = s.source.substring(1));
2638
- } catch (e) {
2639
- r(t, "RESOURCE_EXHAUSTION", e instanceof Error ? e.message : String(e));
2640
- }
2641
- break;
2642
- default: r(t, "UNEXPECTED_TOKEN", t.type === "error" ? t.message : `Unsupported token (type: ${t.type})`), u = !1;
2643
- }
2644
- return l ??= Cn(e, t.offset, void 0, null, n, r), s && l.anchor === "" && r(s, "BAD_ALIAS", "Anchor cannot be an empty string"), i && e.options.stringKeys && (!p(l) || typeof l.value != "string" || l.tag && l.tag !== "tag:yaml.org,2002:str") && r(c ?? t, "NON_STRING_KEY", "With stringKeys, all keys must be strings"), a && (l.spaceBefore = !0), o && (t.type === "scalar" && t.source === "" ? l.comment = o : l.commentBefore = o), e.options.keepSourceTokens && u && (l.srcToken = t), l;
2645
- }
2646
- function Cn(e, t, n, r, { spaceBefore: i, comment: a, anchor: o, tag: s, end: c }, l) {
2647
- let u = _n(e, {
2648
- type: "scalar",
2649
- offset: bn(t, n, r),
2650
- indent: -1,
2651
- source: ""
2652
- }, s, l);
2653
- return o && (u.anchor = o.source.substring(1), u.anchor === "" && l(o, "BAD_ALIAS", "Anchor cannot be an empty string")), i && (u.spaceBefore = !0), a && (u.comment = a, u.range[2] = c), u;
2654
- }
2655
- function wn({ options: e }, { offset: t, source: n, end: r }, i) {
2656
- let a = new ce(n.substring(1));
2657
- a.source === "" && i(t, "BAD_ALIAS", "Alias cannot be an empty string"), a.source.endsWith(":") && i(t + n.length - 1, "BAD_ALIAS", "Alias ending in : is ambiguous", !0);
2658
- let o = t + n.length, s = $t(r, o, e.strict, i);
2659
- return a.range = [
2660
- t,
2661
- o,
2662
- s.offset
2663
- ], s.comment && (a.comment = s.comment), a;
2664
- }
2665
- //#endregion
2666
- //#region ../../node_modules/yaml/browser/dist/compose/compose-doc.js
2667
- function Tn(e, t, { offset: n, start: r, value: i, end: a }, o) {
2668
- let s = new Ut(void 0, Object.assign({ _directives: t }, e)), c = {
2669
- atKey: !1,
2670
- atRoot: !0,
2671
- directives: s.directives,
2672
- options: s.options,
2673
- schema: s.schema
2674
- }, l = Y(r, {
2675
- indicator: "doc-start",
2676
- next: i ?? a?.[0],
2677
- offset: n,
2678
- onError: o,
2679
- parentIndent: 0,
2680
- startOnNewline: !0
2681
- });
2682
- l.found && (s.directives.docStart = !0, i && (i.type === "block-map" || i.type === "block-seq") && !l.hasNewline && o(l.end, "MISSING_CHAR", "Block collection cannot start on same line with directives-end marker")), s.contents = i ? Sn(c, i, l, o) : Cn(c, l.end, r, null, l, o);
2683
- let u = s.contents.range[2], d = $t(a, u, !1, o);
2684
- return d.comment && (s.comment = d.comment), s.range = [
2685
- n,
2686
- u,
2687
- d.offset
2688
- ], s;
2689
- }
2690
- //#endregion
2691
- //#region ../../node_modules/yaml/browser/dist/compose/composer.js
2692
- function En(e) {
2693
- if (typeof e == "number") return [e, e + 1];
2694
- if (Array.isArray(e)) return e.length === 2 ? e : [e[0], e[1]];
2695
- let { offset: t, source: n } = e;
2696
- return [t, t + (typeof n == "string" ? n.length : 1)];
2697
- }
2698
- function Dn(e) {
2699
- let t = "", n = !1, r = !1;
2700
- for (let i = 0; i < e.length; ++i) {
2701
- let a = e[i];
2702
- switch (a[0]) {
2703
- case "#":
2704
- t += (t === "" ? "" : r ? "\n\n" : "\n") + (a.substring(1) || " "), n = !0, r = !1;
2705
- break;
2706
- case "%":
2707
- e[i + 1]?.[0] !== "#" && (i += 1), n = !1;
2708
- break;
2709
- default: n || (r = !0), n = !1;
2710
- }
2711
- }
2712
- return {
2713
- comment: t,
2714
- afterEmptyLine: r
2715
- };
2716
- }
2717
- var On = class {
2718
- constructor(e = {}) {
2719
- this.doc = null, this.atDirectives = !1, this.prelude = [], this.errors = [], this.warnings = [], this.onError = (e, t, n, r) => {
2720
- let i = En(e);
2721
- r ? this.warnings.push(new Gt(i, t, n)) : this.errors.push(new J(i, t, n));
2722
- }, this.directives = new D({ version: e.version || "1.2" }), this.options = e;
2723
- }
2724
- decorate(e, t) {
2725
- let { comment: n, afterEmptyLine: r } = Dn(this.prelude);
2726
- if (n) {
2727
- let i = e.contents;
2728
- if (t) e.comment = e.comment ? `${e.comment}\n${n}` : n;
2729
- else if (r || e.directives.docStart || !i) e.commentBefore = n;
2730
- else if (h(i) && !i.flow && i.items.length > 0) {
2731
- let e = i.items[0];
2732
- f(e) && (e = e.key);
2733
- let t = e.commentBefore;
2734
- e.commentBefore = t ? `${n}\n${t}` : n;
2735
- } else {
2736
- let e = i.commentBefore;
2737
- i.commentBefore = e ? `${n}\n${e}` : n;
2738
- }
2739
- }
2740
- if (t) {
2741
- for (let t = 0; t < this.errors.length; ++t) e.errors.push(this.errors[t]);
2742
- for (let t = 0; t < this.warnings.length; ++t) e.warnings.push(this.warnings[t]);
2743
- } else e.errors = this.errors, e.warnings = this.warnings;
2744
- this.prelude = [], this.errors = [], this.warnings = [];
2745
- }
2746
- streamInfo() {
2747
- return {
2748
- comment: Dn(this.prelude).comment,
2749
- directives: this.directives,
2750
- errors: this.errors,
2751
- warnings: this.warnings
2752
- };
2753
- }
2754
- *compose(e, t = !1, n = -1) {
2755
- for (let t of e) yield* this.next(t);
2756
- yield* this.end(t, n);
2757
- }
2758
- *next(e) {
2759
- switch (e.type) {
2760
- case "directive":
2761
- this.directives.add(e.source, (t, n, r) => {
2762
- let i = En(e);
2763
- i[0] += t, this.onError(i, "BAD_DIRECTIVE", n, r);
2764
- }), this.prelude.push(e.source), this.atDirectives = !0;
2765
- break;
2766
- case "document": {
2767
- let t = Tn(this.options, this.directives, e, this.onError);
2768
- this.atDirectives && !t.directives.docStart && this.onError(e, "MISSING_CHAR", "Missing directives-end/doc-start indicator line"), this.decorate(t, !1), this.doc && (yield this.doc), this.doc = t, this.atDirectives = !1;
2769
- break;
2770
- }
2771
- case "byte-order-mark":
2772
- case "space": break;
2773
- case "comment":
2774
- case "newline":
2775
- this.prelude.push(e.source);
2776
- break;
2777
- case "error": {
2778
- let t = e.source ? `${e.message}: ${JSON.stringify(e.source)}` : e.message, n = new J(En(e), "UNEXPECTED_TOKEN", t);
2779
- this.atDirectives || !this.doc ? this.errors.push(n) : this.doc.errors.push(n);
2780
- break;
2781
- }
2782
- case "doc-end": {
2783
- if (!this.doc) {
2784
- this.errors.push(new J(En(e), "UNEXPECTED_TOKEN", "Unexpected doc-end without preceding document"));
2785
- break;
2786
- }
2787
- this.doc.directives.docEnd = !0;
2788
- let t = $t(e.end, e.offset + e.source.length, this.doc.options.strict, this.onError);
2789
- if (this.decorate(this.doc, !0), t.comment) {
2790
- let e = this.doc.comment;
2791
- this.doc.comment = e ? `${e}\n${t.comment}` : t.comment;
2792
- }
2793
- this.doc.range[2] = t.offset;
2794
- break;
2795
- }
2796
- default: this.errors.push(new J(En(e), "UNEXPECTED_TOKEN", `Unsupported token ${e.type}`));
2797
- }
2798
- }
2799
- *end(e = !1, t = -1) {
2800
- if (this.doc) this.decorate(this.doc, !0), yield this.doc, this.doc = null;
2801
- else if (e) {
2802
- let e = new Ut(void 0, Object.assign({ _directives: this.directives }, this.options));
2803
- this.atDirectives && this.onError(t, "MISSING_CHAR", "Missing directives-end indicator line"), e.range = [
2804
- 0,
2805
- t,
2806
- t
2807
- ], this.decorate(e, !1), yield e;
2808
- }
2809
- }
2810
- }, kn = Symbol("break visit"), An = Symbol("skip children"), jn = Symbol("remove item");
2811
- function X(e, t) {
2812
- "type" in e && e.type === "document" && (e = {
2813
- start: e.start,
2814
- value: e.value
2815
- }), Mn(Object.freeze([]), e, t);
2816
- }
2817
- X.BREAK = kn, X.SKIP = An, X.REMOVE = jn, X.itemAtPath = (e, t) => {
2818
- let n = e;
2819
- for (let [e, r] of t) {
2820
- let t = n?.[e];
2821
- if (t && "items" in t) n = t.items[r];
2822
- else return;
2823
- }
2824
- return n;
2825
- }, X.parentCollection = (e, t) => {
2826
- let n = X.itemAtPath(e, t.slice(0, -1)), r = t[t.length - 1][0], i = n?.[r];
2827
- if (i && "items" in i) return i;
2828
- throw Error("Parent collection not found");
2829
- };
2830
- function Mn(e, t, n) {
2831
- let r = n(t, e);
2832
- if (typeof r == "symbol") return r;
2833
- for (let i of ["key", "value"]) {
2834
- let a = t[i];
2835
- if (a && "items" in a) {
2836
- for (let t = 0; t < a.items.length; ++t) {
2837
- let r = Mn(Object.freeze(e.concat([[i, t]])), a.items[t], n);
2838
- if (typeof r == "number") t = r - 1;
2839
- else if (r === kn) return kn;
2840
- else r === jn && (a.items.splice(t, 1), --t);
2841
- }
2842
- typeof r == "function" && i === "key" && (r = r(t, e));
2843
- }
2844
- }
2845
- return typeof r == "function" ? r(t, e) : r;
2846
- }
2847
- function Nn(e) {
2848
- switch (e) {
2849
- case "": return "byte-order-mark";
2850
- case "": return "doc-mode";
2851
- case "": return "flow-error-end";
2852
- case "": return "scalar";
2853
- case "---": return "doc-start";
2854
- case "...": return "doc-end";
2855
- case "":
2856
- case "\n":
2857
- case "\r\n": return "newline";
2858
- case "-": return "seq-item-ind";
2859
- case "?": return "explicit-key-ind";
2860
- case ":": return "map-value-ind";
2861
- case "{": return "flow-map-start";
2862
- case "}": return "flow-map-end";
2863
- case "[": return "flow-seq-start";
2864
- case "]": return "flow-seq-end";
2865
- case ",": return "comma";
2866
- }
2867
- switch (e[0]) {
2868
- case " ":
2869
- case " ": return "space";
2870
- case "#": return "comment";
2871
- case "%": return "directive-line";
2872
- case "*": return "alias";
2873
- case "&": return "anchor";
2874
- case "!": return "tag";
2875
- case "'": return "single-quoted-scalar";
2876
- case "\"": return "double-quoted-scalar";
2877
- case "|":
2878
- case ">": return "block-scalar-header";
2879
- }
2880
- return null;
2881
- }
2882
- //#endregion
2883
- //#region ../../node_modules/yaml/browser/dist/parse/lexer.js
2884
- function Z(e) {
2885
- switch (e) {
2886
- case void 0:
2887
- case " ":
2888
- case "\n":
2889
- case "\r":
2890
- case " ": return !0;
2891
- default: return !1;
2892
- }
2893
- }
2894
- var Pn = /* @__PURE__ */ new Set("0123456789ABCDEFabcdef"), Fn = /* @__PURE__ */ new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"), In = /* @__PURE__ */ new Set(",[]{}"), Ln = /* @__PURE__ */ new Set(" ,[]{}\n\r "), Rn = (e) => !e || Ln.has(e), zn = class {
2895
- constructor() {
2896
- this.atEnd = !1, this.blockScalarIndent = -1, this.blockScalarKeep = !1, this.buffer = "", this.flowKey = !1, this.flowLevel = 0, this.indentNext = 0, this.indentValue = 0, this.lineEndPos = null, this.next = null, this.pos = 0;
2897
- }
2898
- *lex(e, t = !1) {
2899
- if (e) {
2900
- if (typeof e != "string") throw TypeError("source is not a string");
2901
- this.buffer = this.buffer ? this.buffer + e : e, this.lineEndPos = null;
2902
- }
2903
- this.atEnd = !t;
2904
- let n = this.next ?? "stream";
2905
- for (; n && (t || this.hasChars(1));) n = yield* this.parseNext(n);
2906
- }
2907
- atLineEnd() {
2908
- let e = this.pos, t = this.buffer[e];
2909
- for (; t === " " || t === " ";) t = this.buffer[++e];
2910
- return !t || t === "#" || t === "\n" ? !0 : t === "\r" ? this.buffer[e + 1] === "\n" : !1;
2911
- }
2912
- charAt(e) {
2913
- return this.buffer[this.pos + e];
2914
- }
2915
- continueScalar(e) {
2916
- let t = this.buffer[e];
2917
- if (this.indentNext > 0) {
2918
- let n = 0;
2919
- for (; t === " ";) t = this.buffer[++n + e];
2920
- if (t === "\r") {
2921
- let t = this.buffer[n + e + 1];
2922
- if (t === "\n" || !t && !this.atEnd) return e + n + 1;
2923
- }
2924
- return t === "\n" || n >= this.indentNext || !t && !this.atEnd ? e + n : -1;
2925
- }
2926
- if (t === "-" || t === ".") {
2927
- let t = this.buffer.substr(e, 3);
2928
- if ((t === "---" || t === "...") && Z(this.buffer[e + 3])) return -1;
2929
- }
2930
- return e;
2931
- }
2932
- getLine() {
2933
- let e = this.lineEndPos;
2934
- return (typeof e != "number" || e !== -1 && e < this.pos) && (e = this.buffer.indexOf("\n", this.pos), this.lineEndPos = e), e === -1 ? this.atEnd ? this.buffer.substring(this.pos) : null : (this.buffer[e - 1] === "\r" && --e, this.buffer.substring(this.pos, e));
2935
- }
2936
- hasChars(e) {
2937
- return this.pos + e <= this.buffer.length;
2938
- }
2939
- setNext(e) {
2940
- return this.buffer = this.buffer.substring(this.pos), this.pos = 0, this.lineEndPos = null, this.next = e, null;
2941
- }
2942
- peek(e) {
2943
- return this.buffer.substr(this.pos, e);
2944
- }
2945
- *parseNext(e) {
2946
- switch (e) {
2947
- case "stream": return yield* this.parseStream();
2948
- case "line-start": return yield* this.parseLineStart();
2949
- case "block-start": return yield* this.parseBlockStart();
2950
- case "doc": return yield* this.parseDocument();
2951
- case "flow": return yield* this.parseFlowCollection();
2952
- case "quoted-scalar": return yield* this.parseQuotedScalar();
2953
- case "block-scalar": return yield* this.parseBlockScalar();
2954
- case "plain-scalar": return yield* this.parsePlainScalar();
2955
- }
2956
- }
2957
- *parseStream() {
2958
- let e = this.getLine();
2959
- if (e === null) return this.setNext("stream");
2960
- if (e[0] === "" && (yield* this.pushCount(1), e = e.substring(1)), e[0] === "%") {
2961
- let t = e.length, n = e.indexOf("#");
2962
- for (; n !== -1;) {
2963
- let r = e[n - 1];
2964
- if (r === " " || r === " ") {
2965
- t = n - 1;
2966
- break;
2967
- } else n = e.indexOf("#", n + 1);
2968
- }
2969
- for (;;) {
2970
- let n = e[t - 1];
2971
- if (n === " " || n === " ") --t;
2972
- else break;
2973
- }
2974
- let r = (yield* this.pushCount(t)) + (yield* this.pushSpaces(!0));
2975
- return yield* this.pushCount(e.length - r), this.pushNewline(), "stream";
2976
- }
2977
- if (this.atLineEnd()) {
2978
- let t = yield* this.pushSpaces(!0);
2979
- return yield* this.pushCount(e.length - t), yield* this.pushNewline(), "stream";
2980
- }
2981
- return yield "", yield* this.parseLineStart();
2982
- }
2983
- *parseLineStart() {
2984
- let e = this.charAt(0);
2985
- if (!e && !this.atEnd) return this.setNext("line-start");
2986
- if (e === "-" || e === ".") {
2987
- if (!this.atEnd && !this.hasChars(4)) return this.setNext("line-start");
2988
- let e = this.peek(3);
2989
- if ((e === "---" || e === "...") && Z(this.charAt(3))) return yield* this.pushCount(3), this.indentValue = 0, this.indentNext = 0, e === "---" ? "doc" : "stream";
2990
- }
2991
- return this.indentValue = yield* this.pushSpaces(!1), this.indentNext > this.indentValue && !Z(this.charAt(1)) && (this.indentNext = this.indentValue), yield* this.parseBlockStart();
2992
- }
2993
- *parseBlockStart() {
2994
- let [e, t] = this.peek(2);
2995
- if (!t && !this.atEnd) return this.setNext("block-start");
2996
- if ((e === "-" || e === "?" || e === ":") && Z(t)) {
2997
- let e = (yield* this.pushCount(1)) + (yield* this.pushSpaces(!0));
2998
- return this.indentNext = this.indentValue + 1, this.indentValue += e, "block-start";
2999
- }
3000
- return "doc";
3001
- }
3002
- *parseDocument() {
3003
- yield* this.pushSpaces(!0);
3004
- let e = this.getLine();
3005
- if (e === null) return this.setNext("doc");
3006
- let t = yield* this.pushIndicators();
3007
- switch (e[t]) {
3008
- case "#": yield* this.pushCount(e.length - t);
3009
- case void 0: return yield* this.pushNewline(), yield* this.parseLineStart();
3010
- case "{":
3011
- case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel = 1, "flow";
3012
- case "}":
3013
- case "]": return yield* this.pushCount(1), "doc";
3014
- case "*": return yield* this.pushUntil(Rn), "doc";
3015
- case "\"":
3016
- case "'": return yield* this.parseQuotedScalar();
3017
- case "|":
3018
- case ">": return t += yield* this.parseBlockScalarHeader(), t += yield* this.pushSpaces(!0), yield* this.pushCount(e.length - t), yield* this.pushNewline(), yield* this.parseBlockScalar();
3019
- default: return yield* this.parsePlainScalar();
3020
- }
3021
- }
3022
- *parseFlowCollection() {
3023
- let e, t, n = -1;
3024
- do
3025
- e = yield* this.pushNewline(), e > 0 ? (t = yield* this.pushSpaces(!1), this.indentValue = n = t) : t = 0, t += yield* this.pushSpaces(!0);
3026
- while (e + t > 0);
3027
- let r = this.getLine();
3028
- if (r === null) return this.setNext("flow");
3029
- if ((n !== -1 && n < this.indentNext && r[0] !== "#" || n === 0 && (r.startsWith("---") || r.startsWith("...")) && Z(r[3])) && !(n === this.indentNext - 1 && this.flowLevel === 1 && (r[0] === "]" || r[0] === "}"))) return this.flowLevel = 0, yield "", yield* this.parseLineStart();
3030
- let i = 0;
3031
- for (; r[i] === ",";) i += yield* this.pushCount(1), i += yield* this.pushSpaces(!0), this.flowKey = !1;
3032
- switch (i += yield* this.pushIndicators(), r[i]) {
3033
- case void 0: return "flow";
3034
- case "#": return yield* this.pushCount(r.length - i), "flow";
3035
- case "{":
3036
- case "[": return yield* this.pushCount(1), this.flowKey = !1, this.flowLevel += 1, "flow";
3037
- case "}":
3038
- case "]": return yield* this.pushCount(1), this.flowKey = !0, --this.flowLevel, this.flowLevel ? "flow" : "doc";
3039
- case "*": return yield* this.pushUntil(Rn), "flow";
3040
- case "\"":
3041
- case "'": return this.flowKey = !0, yield* this.parseQuotedScalar();
3042
- case ":": {
3043
- let e = this.charAt(1);
3044
- if (this.flowKey || Z(e) || e === ",") return this.flowKey = !1, yield* this.pushCount(1), yield* this.pushSpaces(!0), "flow";
3045
- }
3046
- default: return this.flowKey = !1, yield* this.parsePlainScalar();
3047
- }
3048
- }
3049
- *parseQuotedScalar() {
3050
- let e = this.charAt(0), t = this.buffer.indexOf(e, this.pos + 1);
3051
- if (e === "'") for (; t !== -1 && this.buffer[t + 1] === "'";) t = this.buffer.indexOf("'", t + 2);
3052
- else for (; t !== -1;) {
3053
- let e = 0;
3054
- for (; this.buffer[t - 1 - e] === "\\";) e += 1;
3055
- if (e % 2 == 0) break;
3056
- t = this.buffer.indexOf("\"", t + 1);
3057
- }
3058
- let n = this.buffer.substring(0, t), r = n.indexOf("\n", this.pos);
3059
- if (r !== -1) {
3060
- for (; r !== -1;) {
3061
- let e = this.continueScalar(r + 1);
3062
- if (e === -1) break;
3063
- r = n.indexOf("\n", e);
3064
- }
3065
- r !== -1 && (t = r - (n[r - 1] === "\r" ? 2 : 1));
3066
- }
3067
- if (t === -1) {
3068
- if (!this.atEnd) return this.setNext("quoted-scalar");
3069
- t = this.buffer.length;
3070
- }
3071
- return yield* this.pushToIndex(t + 1, !1), this.flowLevel ? "flow" : "doc";
3072
- }
3073
- *parseBlockScalarHeader() {
3074
- this.blockScalarIndent = -1, this.blockScalarKeep = !1;
3075
- let e = this.pos;
3076
- for (;;) {
3077
- let t = this.buffer[++e];
3078
- if (t === "+") this.blockScalarKeep = !0;
3079
- else if (t > "0" && t <= "9") this.blockScalarIndent = Number(t) - 1;
3080
- else if (t !== "-") break;
3081
- }
3082
- return yield* this.pushUntil((e) => Z(e) || e === "#");
3083
- }
3084
- *parseBlockScalar() {
3085
- let e = this.pos - 1, t = 0, n;
3086
- loop: for (let r = this.pos; n = this.buffer[r]; ++r) switch (n) {
3087
- case " ":
3088
- t += 1;
3089
- break;
3090
- case "\n":
3091
- e = r, t = 0;
3092
- break;
3093
- case "\r": {
3094
- let e = this.buffer[r + 1];
3095
- if (!e && !this.atEnd) return this.setNext("block-scalar");
3096
- if (e === "\n") break;
3097
- }
3098
- default: break loop;
3099
- }
3100
- if (!n && !this.atEnd) return this.setNext("block-scalar");
3101
- if (t >= this.indentNext) {
3102
- this.blockScalarIndent === -1 ? this.indentNext = t : this.indentNext = this.blockScalarIndent + (this.indentNext === 0 ? 1 : this.indentNext);
3103
- do {
3104
- let t = this.continueScalar(e + 1);
3105
- if (t === -1) break;
3106
- e = this.buffer.indexOf("\n", t);
3107
- } while (e !== -1);
3108
- if (e === -1) {
3109
- if (!this.atEnd) return this.setNext("block-scalar");
3110
- e = this.buffer.length;
3111
- }
3112
- }
3113
- let r = e + 1;
3114
- for (n = this.buffer[r]; n === " ";) n = this.buffer[++r];
3115
- if (n === " ") {
3116
- for (; n === " " || n === " " || n === "\r" || n === "\n";) n = this.buffer[++r];
3117
- e = r - 1;
3118
- } else if (!this.blockScalarKeep) do {
3119
- let n = e - 1, r = this.buffer[n];
3120
- r === "\r" && (r = this.buffer[--n]);
3121
- let i = n;
3122
- for (; r === " ";) r = this.buffer[--n];
3123
- if (r === "\n" && n >= this.pos && n + 1 + t > i) e = n;
3124
- else break;
3125
- } while (!0);
3126
- return yield "", yield* this.pushToIndex(e + 1, !0), yield* this.parseLineStart();
3127
- }
3128
- *parsePlainScalar() {
3129
- let e = this.flowLevel > 0, t = this.pos - 1, n = this.pos - 1, r;
3130
- for (; r = this.buffer[++n];) if (r === ":") {
3131
- let r = this.buffer[n + 1];
3132
- if (Z(r) || e && In.has(r)) break;
3133
- t = n;
3134
- } else if (Z(r)) {
3135
- let i = this.buffer[n + 1];
3136
- if (r === "\r" && (i === "\n" ? (n += 1, r = "\n", i = this.buffer[n + 1]) : t = n), i === "#" || e && In.has(i)) break;
3137
- if (r === "\n") {
3138
- let e = this.continueScalar(n + 1);
3139
- if (e === -1) break;
3140
- n = Math.max(n, e - 2);
3141
- }
3142
- } else {
3143
- if (e && In.has(r)) break;
3144
- t = n;
3145
- }
3146
- return !r && !this.atEnd ? this.setNext("plain-scalar") : (yield "", yield* this.pushToIndex(t + 1, !0), e ? "flow" : "doc");
3147
- }
3148
- *pushCount(e) {
3149
- return e > 0 ? (yield this.buffer.substr(this.pos, e), this.pos += e, e) : 0;
3150
- }
3151
- *pushToIndex(e, t) {
3152
- let n = this.buffer.slice(this.pos, e);
3153
- return n ? (yield n, this.pos += n.length, n.length) : (t && (yield ""), 0);
3154
- }
3155
- *pushIndicators() {
3156
- let e = 0;
3157
- loop: for (;;) {
3158
- switch (this.charAt(0)) {
3159
- case "!":
3160
- e += yield* this.pushTag(), e += yield* this.pushSpaces(!0);
3161
- continue loop;
3162
- case "&":
3163
- e += yield* this.pushUntil(Rn), e += yield* this.pushSpaces(!0);
3164
- continue loop;
3165
- case "-":
3166
- case "?":
3167
- case ":": {
3168
- let t = this.flowLevel > 0, n = this.charAt(1);
3169
- if (Z(n) || t && In.has(n)) {
3170
- t ? this.flowKey &&= !1 : this.indentNext = this.indentValue + 1, e += yield* this.pushCount(1), e += yield* this.pushSpaces(!0);
3171
- continue loop;
3172
- }
3173
- }
3174
- }
3175
- break loop;
3176
- }
3177
- return e;
3178
- }
3179
- *pushTag() {
3180
- if (this.charAt(1) === "<") {
3181
- let e = this.pos + 2, t = this.buffer[e];
3182
- for (; !Z(t) && t !== ">";) t = this.buffer[++e];
3183
- return yield* this.pushToIndex(t === ">" ? e + 1 : e, !1);
3184
- } else {
3185
- let e = this.pos + 1, t = this.buffer[e];
3186
- for (; t;) if (Fn.has(t)) t = this.buffer[++e];
3187
- else if (t === "%" && Pn.has(this.buffer[e + 1]) && Pn.has(this.buffer[e + 2])) t = this.buffer[e += 3];
3188
- else break;
3189
- return yield* this.pushToIndex(e, !1);
3190
- }
3191
- }
3192
- *pushNewline() {
3193
- let e = this.buffer[this.pos];
3194
- return e === "\n" ? yield* this.pushCount(1) : e === "\r" && this.charAt(1) === "\n" ? yield* this.pushCount(2) : 0;
3195
- }
3196
- *pushSpaces(e) {
3197
- let t = this.pos - 1, n;
3198
- do
3199
- n = this.buffer[++t];
3200
- while (n === " " || e && n === " ");
3201
- let r = t - this.pos;
3202
- return r > 0 && (yield this.buffer.substr(this.pos, r), this.pos = t), r;
3203
- }
3204
- *pushUntil(e) {
3205
- let t = this.pos, n = this.buffer[t];
3206
- for (; !e(n);) n = this.buffer[++t];
3207
- return yield* this.pushToIndex(t, !1);
3208
- }
3209
- }, Bn = class {
3210
- constructor() {
3211
- this.lineStarts = [], this.addNewLine = (e) => this.lineStarts.push(e), this.linePos = (e) => {
3212
- let t = 0, n = this.lineStarts.length;
3213
- for (; t < n;) {
3214
- let r = t + n >> 1;
3215
- this.lineStarts[r] < e ? t = r + 1 : n = r;
3216
- }
3217
- if (this.lineStarts[t] === e) return {
3218
- line: t + 1,
3219
- col: 1
3220
- };
3221
- if (t === 0) return {
3222
- line: 0,
3223
- col: e
3224
- };
3225
- let r = this.lineStarts[t - 1];
3226
- return {
3227
- line: t,
3228
- col: e - r + 1
3229
- };
3230
- };
3231
- }
3232
- };
3233
- //#endregion
3234
- //#region ../../node_modules/yaml/browser/dist/parse/parser.js
3235
- function Q(e, t) {
3236
- for (let n = 0; n < e.length; ++n) if (e[n].type === t) return !0;
3237
- return !1;
3238
- }
3239
- function Vn(e) {
3240
- for (let t = 0; t < e.length; ++t) switch (e[t].type) {
3241
- case "space":
3242
- case "comment":
3243
- case "newline": break;
3244
- default: return t;
3245
- }
3246
- return -1;
3247
- }
3248
- function Hn(e) {
3249
- switch (e?.type) {
3250
- case "alias":
3251
- case "scalar":
3252
- case "single-quoted-scalar":
3253
- case "double-quoted-scalar":
3254
- case "flow-collection": return !0;
3255
- default: return !1;
3256
- }
3257
- }
3258
- function Un(e) {
3259
- switch (e.type) {
3260
- case "document": return e.start;
3261
- case "block-map": {
3262
- let t = e.items[e.items.length - 1];
3263
- return t.sep ?? t.start;
3264
- }
3265
- case "block-seq": return e.items[e.items.length - 1].start;
3266
- /* istanbul ignore next should not happen */
3267
- default: return [];
3268
- }
3269
- }
3270
- function $(e) {
3271
- if (e.length === 0) return [];
3272
- let t = e.length;
3273
- loop: for (; --t >= 0;) switch (e[t].type) {
3274
- case "doc-start":
3275
- case "explicit-key-ind":
3276
- case "map-value-ind":
3277
- case "seq-item-ind":
3278
- case "newline": break loop;
3279
- }
3280
- for (; e[++t]?.type === "space";);
3281
- return e.splice(t, e.length);
3282
- }
3283
- function Wn(e, t) {
3284
- if (t.length < 1e5) Array.prototype.push.apply(e, t);
3285
- else for (let n = 0; n < t.length; ++n) e.push(t[n]);
3286
- }
3287
- function Gn(e) {
3288
- if (e.start.type === "flow-seq-start") for (let t of e.items) t.sep && !t.value && !Q(t.start, "explicit-key-ind") && !Q(t.sep, "map-value-ind") && (t.key && (t.value = t.key), delete t.key, Hn(t.value) ? t.value.end ? Wn(t.value.end, t.sep) : t.value.end = t.sep : Wn(t.start, t.sep), delete t.sep);
3289
- }
3290
- var Kn = class {
3291
- constructor(e) {
3292
- this.atNewLine = !0, this.atScalar = !1, this.indent = 0, this.offset = 0, this.onKeyLine = !1, this.stack = [], this.source = "", this.type = "", this.lexer = new zn(), this.onNewLine = e;
3293
- }
3294
- *parse(e, t = !1) {
3295
- this.onNewLine && this.offset === 0 && this.onNewLine(0);
3296
- for (let n of this.lexer.lex(e, t)) yield* this.next(n);
3297
- t || (yield* this.end());
3298
- }
3299
- *next(e) {
3300
- if (this.source = e, this.atScalar) {
3301
- this.atScalar = !1, yield* this.step(), this.offset += e.length;
3302
- return;
3303
- }
3304
- let t = Nn(e);
3305
- if (!t) {
3306
- let t = `Not a YAML token: ${e}`;
3307
- yield* this.pop({
3308
- type: "error",
3309
- offset: this.offset,
3310
- message: t,
3311
- source: e
3312
- }), this.offset += e.length;
3313
- } else if (t === "scalar") this.atNewLine = !1, this.atScalar = !0, this.type = "scalar";
3314
- else {
3315
- switch (this.type = t, yield* this.step(), t) {
3316
- case "newline":
3317
- this.atNewLine = !0, this.indent = 0, this.onNewLine && this.onNewLine(this.offset + e.length);
3318
- break;
3319
- case "space":
3320
- this.atNewLine && e[0] === " " && (this.indent += e.length);
3321
- break;
3322
- case "explicit-key-ind":
3323
- case "map-value-ind":
3324
- case "seq-item-ind":
3325
- this.atNewLine && (this.indent += e.length);
3326
- break;
3327
- case "doc-mode":
3328
- case "flow-error-end": return;
3329
- default: this.atNewLine = !1;
3330
- }
3331
- this.offset += e.length;
3332
- }
3333
- }
3334
- *end() {
3335
- for (; this.stack.length > 0;) yield* this.pop();
3336
- }
3337
- get sourceToken() {
3338
- return {
3339
- type: this.type,
3340
- offset: this.offset,
3341
- indent: this.indent,
3342
- source: this.source
3343
- };
3344
- }
3345
- *step() {
3346
- let e = this.peek(1);
3347
- if (this.type === "doc-end" && e?.type !== "doc-end") {
3348
- for (; this.stack.length > 0;) yield* this.pop();
3349
- this.stack.push({
3350
- type: "doc-end",
3351
- offset: this.offset,
3352
- source: this.source
3353
- });
3354
- return;
3355
- }
3356
- if (!e) return yield* this.stream();
3357
- switch (e.type) {
3358
- case "document": return yield* this.document(e);
3359
- case "alias":
3360
- case "scalar":
3361
- case "single-quoted-scalar":
3362
- case "double-quoted-scalar": return yield* this.scalar(e);
3363
- case "block-scalar": return yield* this.blockScalar(e);
3364
- case "block-map": return yield* this.blockMap(e);
3365
- case "block-seq": return yield* this.blockSequence(e);
3366
- case "flow-collection": return yield* this.flowCollection(e);
3367
- case "doc-end": return yield* this.documentEnd(e);
3368
- }
3369
- /* istanbul ignore next should not happen */
3370
- yield* this.pop();
3371
- }
3372
- peek(e) {
3373
- return this.stack[this.stack.length - e];
3374
- }
3375
- *pop(e) {
3376
- let t = e ?? this.stack.pop();
3377
- /* istanbul ignore if should not happen */
3378
- if (!t) yield {
3379
- type: "error",
3380
- offset: this.offset,
3381
- source: "",
3382
- message: "Tried to pop an empty stack"
3383
- };
3384
- else if (this.stack.length === 0) yield t;
3385
- else {
3386
- let e = this.peek(1);
3387
- switch (t.type === "block-scalar" ? t.indent = "indent" in e ? e.indent : 0 : t.type === "flow-collection" && e.type === "document" && (t.indent = 0), t.type === "flow-collection" && Gn(t), e.type) {
3388
- case "document":
3389
- e.value = t;
3390
- break;
3391
- case "block-scalar":
3392
- e.props.push(t);
3393
- break;
3394
- case "block-map": {
3395
- let n = e.items[e.items.length - 1];
3396
- if (n.value) {
3397
- e.items.push({
3398
- start: [],
3399
- key: t,
3400
- sep: []
3401
- }), this.onKeyLine = !0;
3402
- return;
3403
- } else if (n.sep) n.value = t;
3404
- else {
3405
- Object.assign(n, {
3406
- key: t,
3407
- sep: []
3408
- }), this.onKeyLine = !n.explicitKey;
3409
- return;
3410
- }
3411
- break;
3412
- }
3413
- case "block-seq": {
3414
- let n = e.items[e.items.length - 1];
3415
- n.value ? e.items.push({
3416
- start: [],
3417
- value: t
3418
- }) : n.value = t;
3419
- break;
3420
- }
3421
- case "flow-collection": {
3422
- let n = e.items[e.items.length - 1];
3423
- !n || n.value ? e.items.push({
3424
- start: [],
3425
- key: t,
3426
- sep: []
3427
- }) : n.sep ? n.value = t : Object.assign(n, {
3428
- key: t,
3429
- sep: []
3430
- });
3431
- return;
3432
- }
3433
- /* istanbul ignore next should not happen */
3434
- default: yield* this.pop(), yield* this.pop(t);
3435
- }
3436
- if ((e.type === "document" || e.type === "block-map" || e.type === "block-seq") && (t.type === "block-map" || t.type === "block-seq")) {
3437
- let n = t.items[t.items.length - 1];
3438
- n && !n.sep && !n.value && n.start.length > 0 && Vn(n.start) === -1 && (t.indent === 0 || n.start.every((e) => e.type !== "comment" || e.indent < t.indent)) && (e.type === "document" ? e.end = n.start : e.items.push({ start: n.start }), t.items.splice(-1, 1));
3439
- }
3440
- }
3441
- }
3442
- *stream() {
3443
- switch (this.type) {
3444
- case "directive-line":
3445
- yield {
3446
- type: "directive",
3447
- offset: this.offset,
3448
- source: this.source
3449
- };
3450
- return;
3451
- case "byte-order-mark":
3452
- case "space":
3453
- case "comment":
3454
- case "newline":
3455
- yield this.sourceToken;
3456
- return;
3457
- case "doc-mode":
3458
- case "doc-start": {
3459
- let e = {
3460
- type: "document",
3461
- offset: this.offset,
3462
- start: []
3463
- };
3464
- this.type === "doc-start" && e.start.push(this.sourceToken), this.stack.push(e);
3465
- return;
3466
- }
3467
- }
3468
- yield {
3469
- type: "error",
3470
- offset: this.offset,
3471
- message: `Unexpected ${this.type} token in YAML stream`,
3472
- source: this.source
3473
- };
3474
- }
3475
- *document(e) {
3476
- if (e.value) return yield* this.lineEnd(e);
3477
- switch (this.type) {
3478
- case "doc-start":
3479
- Vn(e.start) === -1 ? e.start.push(this.sourceToken) : (yield* this.pop(), yield* this.step());
3480
- return;
3481
- case "anchor":
3482
- case "tag":
3483
- case "space":
3484
- case "comment":
3485
- case "newline":
3486
- e.start.push(this.sourceToken);
3487
- return;
3488
- }
3489
- let t = this.startBlockValue(e);
3490
- t ? this.stack.push(t) : yield {
3491
- type: "error",
3492
- offset: this.offset,
3493
- message: `Unexpected ${this.type} token in YAML document`,
3494
- source: this.source
3495
- };
3496
- }
3497
- *scalar(e) {
3498
- if (this.type === "map-value-ind") {
3499
- let t = $(Un(this.peek(2))), n;
3500
- e.end ? (n = e.end, n.push(this.sourceToken), delete e.end) : n = [this.sourceToken];
3501
- let r = {
3502
- type: "block-map",
3503
- offset: e.offset,
3504
- indent: e.indent,
3505
- items: [{
3506
- start: t,
3507
- key: e,
3508
- sep: n
3509
- }]
3510
- };
3511
- this.onKeyLine = !0, this.stack[this.stack.length - 1] = r;
3512
- } else yield* this.lineEnd(e);
3513
- }
3514
- *blockScalar(e) {
3515
- switch (this.type) {
3516
- case "space":
3517
- case "comment":
3518
- case "newline":
3519
- e.props.push(this.sourceToken);
3520
- return;
3521
- case "scalar":
3522
- if (e.source = this.source, this.atNewLine = !0, this.indent = 0, this.onNewLine) {
3523
- let e = this.source.indexOf("\n") + 1;
3524
- for (; e !== 0;) this.onNewLine(this.offset + e), e = this.source.indexOf("\n", e) + 1;
3525
- }
3526
- yield* this.pop();
3527
- break;
3528
- /* istanbul ignore next should not happen */
3529
- default: yield* this.pop(), yield* this.step();
3530
- }
3531
- }
3532
- *blockMap(e) {
3533
- let t = e.items[e.items.length - 1];
3534
- switch (this.type) {
3535
- case "newline":
3536
- if (this.onKeyLine = !1, t.value) {
3537
- let n = "end" in t.value ? t.value.end : void 0;
3538
- (Array.isArray(n) ? n[n.length - 1] : void 0)?.type === "comment" ? n?.push(this.sourceToken) : e.items.push({ start: [this.sourceToken] });
3539
- } else t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
3540
- return;
3541
- case "space":
3542
- case "comment":
3543
- if (t.value) e.items.push({ start: [this.sourceToken] });
3544
- else if (t.sep) t.sep.push(this.sourceToken);
3545
- else {
3546
- if (this.atIndentedComment(t.start, e.indent)) {
3547
- let n = e.items[e.items.length - 2]?.value?.end;
3548
- if (Array.isArray(n)) {
3549
- Wn(n, t.start), n.push(this.sourceToken), e.items.pop();
3550
- return;
3551
- }
3552
- }
3553
- t.start.push(this.sourceToken);
3554
- }
3555
- return;
3556
- }
3557
- if (this.indent >= e.indent) {
3558
- let n = !this.onKeyLine && this.indent === e.indent, r = n && (t.sep || t.explicitKey) && this.type !== "seq-item-ind", i = [];
3559
- if (r && t.sep && !t.value) {
3560
- let n = [];
3561
- for (let r = 0; r < t.sep.length; ++r) {
3562
- let i = t.sep[r];
3563
- switch (i.type) {
3564
- case "newline":
3565
- n.push(r);
3566
- break;
3567
- case "space": break;
3568
- case "comment":
3569
- i.indent > e.indent && (n.length = 0);
3570
- break;
3571
- default: n.length = 0;
3572
- }
3573
- }
3574
- n.length >= 2 && (i = t.sep.splice(n[1]));
3575
- }
3576
- switch (this.type) {
3577
- case "anchor":
3578
- case "tag":
3579
- r || t.value ? (i.push(this.sourceToken), e.items.push({ start: i }), this.onKeyLine = !0) : t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
3580
- return;
3581
- case "explicit-key-ind":
3582
- !t.sep && !t.explicitKey ? (t.start.push(this.sourceToken), t.explicitKey = !0) : r || t.value ? (i.push(this.sourceToken), e.items.push({
3583
- start: i,
3584
- explicitKey: !0
3585
- })) : this.stack.push({
3586
- type: "block-map",
3587
- offset: this.offset,
3588
- indent: this.indent,
3589
- items: [{
3590
- start: [this.sourceToken],
3591
- explicitKey: !0
3592
- }]
3593
- }), this.onKeyLine = !0;
3594
- return;
3595
- case "map-value-ind":
3596
- if (t.explicitKey) if (!t.sep) if (Q(t.start, "newline")) Object.assign(t, {
3597
- key: null,
3598
- sep: [this.sourceToken]
3599
- });
3600
- else {
3601
- let e = $(t.start);
3602
- this.stack.push({
3603
- type: "block-map",
3604
- offset: this.offset,
3605
- indent: this.indent,
3606
- items: [{
3607
- start: e,
3608
- key: null,
3609
- sep: [this.sourceToken]
3610
- }]
3611
- });
3612
- }
3613
- else if (t.value) e.items.push({
3614
- start: [],
3615
- key: null,
3616
- sep: [this.sourceToken]
3617
- });
3618
- else if (Q(t.sep, "map-value-ind")) this.stack.push({
3619
- type: "block-map",
3620
- offset: this.offset,
3621
- indent: this.indent,
3622
- items: [{
3623
- start: i,
3624
- key: null,
3625
- sep: [this.sourceToken]
3626
- }]
3627
- });
3628
- else if (Hn(t.key) && !Q(t.sep, "newline")) {
3629
- let e = $(t.start), n = t.key, r = t.sep;
3630
- r.push(this.sourceToken), delete t.key, delete t.sep, this.stack.push({
3631
- type: "block-map",
3632
- offset: this.offset,
3633
- indent: this.indent,
3634
- items: [{
3635
- start: e,
3636
- key: n,
3637
- sep: r
3638
- }]
3639
- });
3640
- } else i.length > 0 ? t.sep = t.sep.concat(i, this.sourceToken) : t.sep.push(this.sourceToken);
3641
- else t.sep ? t.value || r ? e.items.push({
3642
- start: i,
3643
- key: null,
3644
- sep: [this.sourceToken]
3645
- }) : Q(t.sep, "map-value-ind") ? this.stack.push({
3646
- type: "block-map",
3647
- offset: this.offset,
3648
- indent: this.indent,
3649
- items: [{
3650
- start: [],
3651
- key: null,
3652
- sep: [this.sourceToken]
3653
- }]
3654
- }) : t.sep.push(this.sourceToken) : Object.assign(t, {
3655
- key: null,
3656
- sep: [this.sourceToken]
3657
- });
3658
- this.onKeyLine = !0;
3659
- return;
3660
- case "alias":
3661
- case "scalar":
3662
- case "single-quoted-scalar":
3663
- case "double-quoted-scalar": {
3664
- let n = this.flowScalar(this.type);
3665
- r || t.value ? (e.items.push({
3666
- start: i,
3667
- key: n,
3668
- sep: []
3669
- }), this.onKeyLine = !0) : t.sep ? this.stack.push(n) : (Object.assign(t, {
3670
- key: n,
3671
- sep: []
3672
- }), this.onKeyLine = !0);
3673
- return;
3674
- }
3675
- default: {
3676
- let r = this.startBlockValue(e);
3677
- if (r) {
3678
- if (r.type === "block-seq") {
3679
- if (!t.explicitKey && t.sep && !Q(t.sep, "newline")) {
3680
- yield* this.pop({
3681
- type: "error",
3682
- offset: this.offset,
3683
- message: "Unexpected block-seq-ind on same line with key",
3684
- source: this.source
3685
- });
3686
- return;
3687
- }
3688
- } else n && e.items.push({ start: i });
3689
- this.stack.push(r);
3690
- return;
3691
- }
3692
- }
3693
- }
3694
- }
3695
- yield* this.pop(), yield* this.step();
3696
- }
3697
- *blockSequence(e) {
3698
- let t = e.items[e.items.length - 1];
3699
- switch (this.type) {
3700
- case "newline":
3701
- if (t.value) {
3702
- let n = "end" in t.value ? t.value.end : void 0;
3703
- (Array.isArray(n) ? n[n.length - 1] : void 0)?.type === "comment" ? n?.push(this.sourceToken) : e.items.push({ start: [this.sourceToken] });
3704
- } else t.start.push(this.sourceToken);
3705
- return;
3706
- case "space":
3707
- case "comment":
3708
- if (t.value) e.items.push({ start: [this.sourceToken] });
3709
- else {
3710
- if (this.atIndentedComment(t.start, e.indent)) {
3711
- let n = e.items[e.items.length - 2]?.value?.end;
3712
- if (Array.isArray(n)) {
3713
- Wn(n, t.start), n.push(this.sourceToken), e.items.pop();
3714
- return;
3715
- }
3716
- }
3717
- t.start.push(this.sourceToken);
3718
- }
3719
- return;
3720
- case "anchor":
3721
- case "tag":
3722
- if (t.value || this.indent <= e.indent) break;
3723
- t.start.push(this.sourceToken);
3724
- return;
3725
- case "seq-item-ind":
3726
- if (this.indent !== e.indent) break;
3727
- t.value || Q(t.start, "seq-item-ind") ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
3728
- return;
3729
- }
3730
- if (this.indent > e.indent) {
3731
- let t = this.startBlockValue(e);
3732
- if (t) {
3733
- this.stack.push(t);
3734
- return;
3735
- }
3736
- }
3737
- yield* this.pop(), yield* this.step();
3738
- }
3739
- *flowCollection(e) {
3740
- let t = e.items[e.items.length - 1];
3741
- if (this.type === "flow-error-end") {
3742
- let e;
3743
- do
3744
- yield* this.pop(), e = this.peek(1);
3745
- while (e?.type === "flow-collection");
3746
- } else if (e.end.length === 0) {
3747
- switch (this.type) {
3748
- case "comma":
3749
- case "explicit-key-ind":
3750
- !t || t.sep ? e.items.push({ start: [this.sourceToken] }) : t.start.push(this.sourceToken);
3751
- return;
3752
- case "map-value-ind":
3753
- !t || t.value ? e.items.push({
3754
- start: [],
3755
- key: null,
3756
- sep: [this.sourceToken]
3757
- }) : t.sep ? t.sep.push(this.sourceToken) : Object.assign(t, {
3758
- key: null,
3759
- sep: [this.sourceToken]
3760
- });
3761
- return;
3762
- case "space":
3763
- case "comment":
3764
- case "newline":
3765
- case "anchor":
3766
- case "tag":
3767
- !t || t.value ? e.items.push({ start: [this.sourceToken] }) : t.sep ? t.sep.push(this.sourceToken) : t.start.push(this.sourceToken);
3768
- return;
3769
- case "alias":
3770
- case "scalar":
3771
- case "single-quoted-scalar":
3772
- case "double-quoted-scalar": {
3773
- let n = this.flowScalar(this.type);
3774
- !t || t.value ? e.items.push({
3775
- start: [],
3776
- key: n,
3777
- sep: []
3778
- }) : t.sep ? this.stack.push(n) : Object.assign(t, {
3779
- key: n,
3780
- sep: []
3781
- });
3782
- return;
3783
- }
3784
- case "flow-map-end":
3785
- case "flow-seq-end":
3786
- e.end.push(this.sourceToken);
3787
- return;
3788
- }
3789
- let n = this.startBlockValue(e);
3790
- /* istanbul ignore else should not happen */
3791
- n ? this.stack.push(n) : (yield* this.pop(), yield* this.step());
3792
- } else {
3793
- let t = this.peek(2);
3794
- if (t.type === "block-map" && (this.type === "map-value-ind" && t.indent === e.indent || this.type === "newline" && !t.items[t.items.length - 1].sep)) yield* this.pop(), yield* this.step();
3795
- else if (this.type === "map-value-ind" && t.type !== "flow-collection") {
3796
- let n = $(Un(t));
3797
- Gn(e);
3798
- let r = e.end.splice(1, e.end.length);
3799
- r.push(this.sourceToken);
3800
- let i = {
3801
- type: "block-map",
3802
- offset: e.offset,
3803
- indent: e.indent,
3804
- items: [{
3805
- start: n,
3806
- key: e,
3807
- sep: r
3808
- }]
3809
- };
3810
- this.onKeyLine = !0, this.stack[this.stack.length - 1] = i;
3811
- } else yield* this.lineEnd(e);
3812
- }
3813
- }
3814
- flowScalar(e) {
3815
- if (this.onNewLine) {
3816
- let e = this.source.indexOf("\n") + 1;
3817
- for (; e !== 0;) this.onNewLine(this.offset + e), e = this.source.indexOf("\n", e) + 1;
3818
- }
3819
- return {
3820
- type: e,
3821
- offset: this.offset,
3822
- indent: this.indent,
3823
- source: this.source
3824
- };
3825
- }
3826
- startBlockValue(e) {
3827
- switch (this.type) {
3828
- case "alias":
3829
- case "scalar":
3830
- case "single-quoted-scalar":
3831
- case "double-quoted-scalar": return this.flowScalar(this.type);
3832
- case "block-scalar-header": return {
3833
- type: "block-scalar",
3834
- offset: this.offset,
3835
- indent: this.indent,
3836
- props: [this.sourceToken],
3837
- source: ""
3838
- };
3839
- case "flow-map-start":
3840
- case "flow-seq-start": return {
3841
- type: "flow-collection",
3842
- offset: this.offset,
3843
- indent: this.indent,
3844
- start: this.sourceToken,
3845
- items: [],
3846
- end: []
3847
- };
3848
- case "seq-item-ind": return {
3849
- type: "block-seq",
3850
- offset: this.offset,
3851
- indent: this.indent,
3852
- items: [{ start: [this.sourceToken] }]
3853
- };
3854
- case "explicit-key-ind": {
3855
- this.onKeyLine = !0;
3856
- let t = $(Un(e));
3857
- return t.push(this.sourceToken), {
3858
- type: "block-map",
3859
- offset: this.offset,
3860
- indent: this.indent,
3861
- items: [{
3862
- start: t,
3863
- explicitKey: !0
3864
- }]
3865
- };
3866
- }
3867
- case "map-value-ind": {
3868
- this.onKeyLine = !0;
3869
- let t = $(Un(e));
3870
- return {
3871
- type: "block-map",
3872
- offset: this.offset,
3873
- indent: this.indent,
3874
- items: [{
3875
- start: t,
3876
- key: null,
3877
- sep: [this.sourceToken]
3878
- }]
3879
- };
3880
- }
3881
- }
3882
- return null;
3883
- }
3884
- atIndentedComment(e, t) {
3885
- return this.type !== "comment" || this.indent <= t ? !1 : e.every((e) => e.type === "newline" || e.type === "space");
3886
- }
3887
- *documentEnd(e) {
3888
- this.type !== "doc-mode" && (e.end ? e.end.push(this.sourceToken) : e.end = [this.sourceToken], this.type === "newline" && (yield* this.pop()));
3889
- }
3890
- *lineEnd(e) {
3891
- switch (this.type) {
3892
- case "comma":
3893
- case "doc-start":
3894
- case "doc-end":
3895
- case "flow-seq-end":
3896
- case "flow-map-end":
3897
- case "map-value-ind":
3898
- yield* this.pop(), yield* this.step();
3899
- break;
3900
- case "newline": this.onKeyLine = !1;
3901
- default: e.end ? e.end.push(this.sourceToken) : e.end = [this.sourceToken], this.type === "newline" && (yield* this.pop());
3902
- }
3903
- }
3904
- };
3905
- //#endregion
3906
- //#region ../../node_modules/yaml/browser/dist/public-api.js
3907
- function qn(e) {
3908
- let t = e.prettyErrors !== !1;
3909
- return {
3910
- lineCounter: e.lineCounter || t && new Bn() || null,
3911
- prettyErrors: t
3912
- };
3913
- }
3914
- function Jn(e, t = {}) {
3915
- let { lineCounter: n, prettyErrors: r } = qn(t), i = new Kn(n?.addNewLine), a = new On(t), o = null;
3916
- for (let t of a.compose(i.parse(e), !0, e.length)) if (!o) o = t;
3917
- else if (o.options.logLevel !== "silent") {
3918
- o.errors.push(new J(t.range.slice(0, 2), "MULTIPLE_DOCS", "Source contains multiple documents; please use YAML.parseAllDocuments()"));
3919
- break;
3920
- }
3921
- return r && n && (o.errors.forEach(Kt(e, n)), o.warnings.forEach(Kt(e, n))), o;
3922
- }
3923
- function Yn(e, t, n) {
3924
- let r;
3925
- typeof t == "function" ? r = t : n === void 0 && t && typeof t == "object" && (n = t);
3926
- let i = Jn(e, n);
3927
- if (!i) return null;
3928
- if (i.warnings.forEach((e) => Ne(i.options.logLevel, e)), i.errors.length > 0) {
3929
- if (i.options.logLevel !== "silent") throw i.errors[0];
3930
- i.errors = [];
3931
- }
3932
- return i.toJS(Object.assign({ reviver: r }, n));
3933
- }
3934
- function Xn(e, t, n) {
3935
- let r = null;
3936
- if (typeof t == "function" || Array.isArray(t) ? r = t : n === void 0 && t && (n = t), typeof n == "string" && (n = n.length), typeof n == "number") {
3937
- let e = Math.round(n);
3938
- n = e < 1 ? void 0 : e > 8 ? { indent: 8 } : { indent: e };
3939
- }
3940
- if (e === void 0) {
3941
- let { keepUndefined: e } = n ?? t ?? {};
3942
- if (!e) return;
3943
- }
3944
- return u(e) && !r ? e.toString(n) : new Ut(e, r, n).toString(n);
3945
- }
3946
- //#endregion
3947
- //#region src/skill/skill.ts
3948
- var Zn = "SKILL.md", Qn = 1048576, $n = 16777216, er = 100, tr = new Set([".dial-resource", ".dial-folder"]), nr = new Set(["files", "v"]), rr = /^[a-zA-Z]:/, ir = /[\x00-\x1f]/, ar = (e) => {
3949
- if (e === "" || e.startsWith("/") || rr.test(e) || e.includes("\\") || ir.test(e)) return !1;
3950
- let t = e.split("/");
3951
- return !(t.some((e) => e === "" || e === "." || e === "..") || t.some((e) => tr.has(e)) || nr.has(t[0]));
3952
- }, or = (e) => e.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, ""), sr = ({ name: e, description: t, instructions: n }) => `---\n${Xn({
3953
- name: e,
3954
- description: t
3955
- }).trimEnd()}\n---\n\n${n}`, cr = (e, t, n, r) => `---\n${Xn({
3956
- ...e,
3957
- name: t,
3958
- description: n
3959
- }).trimEnd()}\n---\n\n${r}`, lr = /^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/, ur = (e) => {
3960
- let t = lr.exec(e);
3961
- if (!t) throw Error("SKILL.md is missing its YAML frontmatter block");
3962
- let [, n, r] = t;
3963
- return {
3964
- frontmatter: Yn(n) ?? {},
3965
- instructions: r.replace(/^\r?\n/, "")
3966
- };
3967
- }, dr = (t) => {
3968
- let n = e(t), r = n[Zn];
3969
- if (r == null) throw Error(`Skill archive is missing a root ${Zn} file`);
3970
- let i = /* @__PURE__ */ new Map();
3971
- for (let [e, t] of Object.entries(n)) e === "SKILL.md" || e.endsWith("/") || i.set(e, t);
3972
- return {
3973
- manifestText: new TextDecoder().decode(r),
3974
- files: i
3975
- };
3976
- }, fr = (e) => {
3977
- let t = e.lastIndexOf("/");
3978
- return t === -1 ? e : e.slice(t + 1);
3979
- }, pr = (e) => new Blob([new Uint8Array(e)]), mr = (e, t, n, r) => Object.keys(e).length > 0 ? cr(e, t, n, r) : sr({
3980
- name: t,
3981
- description: n,
3982
- instructions: r
3983
- }), hr = (e, n) => {
3984
- let r = e.filter((e) => e.kind === t.File);
3985
- return {
3986
- filePaths: r.map((e) => e.path),
3987
- files: r.map((e) => pr(n.get(e.path)?.bytes ?? new Uint8Array()))
3988
- };
3989
- }, gr = /^---[ \t]*$/, _r = {
3990
- whenToUse: [
3991
- "when_to_use",
3992
- "when-to-use",
3993
- "whenToUse"
3994
- ],
3995
- allowedTools: [
3996
- "allowed_tools",
3997
- "allowed-tools",
3998
- "allowedTools"
3999
- ],
4000
- bundledResources: [
4001
- "bundled_resources",
4002
- "bundled-resources",
4003
- "bundledResources"
4004
- ],
4005
- skillPrompt: [
4006
- "skill_prompt",
4007
- "skill-prompt",
4008
- "skillPrompt"
4009
- ]
4010
- }, vr = (e, t) => {
4011
- for (let n of t) {
4012
- let t = e[n];
4013
- if (typeof t == "string" && t !== "") return t;
4014
- }
4015
- }, yr = (e, t) => {
4016
- for (let n of t) {
4017
- let t = e[n];
4018
- if (typeof t == "string" && t !== "") return [t];
4019
- if (!Array.isArray(t)) continue;
4020
- let r = t.filter((e) => typeof e == "string" && e !== "");
4021
- if (r.length > 0) return r;
4022
- }
4023
- }, br = (e) => {
4024
- let t = {}, n = vr(e, _r.whenToUse);
4025
- n != null && (t.whenToUse = n);
4026
- let r = yr(e, _r.allowedTools);
4027
- r != null && (t.allowedTools = r);
4028
- let i = yr(e, _r.bundledResources);
4029
- i != null && (t.bundledResources = i);
4030
- let a = vr(e, _r.skillPrompt);
4031
- return a != null && (t.skillPrompt = a), Object.keys(t).length > 0 ? t : void 0;
4032
- }, xr = (e) => {
4033
- let t = e.replace(/^\uFEFF/, "").replace(/\r\n/g, "\n").split("\n"), n = t.findIndex((e) => e.trim() !== "");
4034
- if (n === -1 || !gr.test(t[n].trim())) return { body: e };
4035
- let r = t.findIndex((e, t) => t > n && gr.test(e.trim()));
4036
- if (r === -1) return { body: e };
4037
- let i;
4038
- try {
4039
- i = Yn(t.slice(n + 1, r).join("\n"));
4040
- } catch {
4041
- return { body: e };
4042
- }
4043
- let a = t.slice(r + 1);
4044
- a[0] === "" && a.shift();
4045
- let o = a.join("\n");
4046
- if (typeof i != "object" || !i) return { body: o };
4047
- let s = i, c = vr(s, ["name"]), l = vr(s, ["description"]), u = br(s);
4048
- return {
4049
- ...c == null ? {} : { name: c },
4050
- ...l == null ? {} : { description: l },
4051
- ...u == null ? {} : { about: u },
4052
- body: o
4053
- };
4054
- };
4055
- //#endregion
4056
- export { $n as a, mr as c, fr as d, or as f, dr as h, er as i, cr as l, pr as m, Qn as n, hr as o, ur as p, Zn as r, sr as s, xr as t, ar as u };