vitepress-openapi
Version:
Generate VitePress API Documentation from OpenAPI Specification.
6,128 lines • 260 kB
JavaScript
var Go = Object.defineProperty;
var zo = (e, t, n) => t in e ? Go(e, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : e[t] = n;
var Q = (e, t, n) => zo(e, typeof t != "symbol" ? t + "" : t, n);
import { toRef as Wo, readonly as Xn, ref as B, customRef as Yo, onMounted as Zn, nextTick as Ut, getCurrentInstance as rt, watch as xe, hasInjectionContext as er, inject as Ko, getCurrentScope as tr, onScopeDispose as Qo, computed as re, shallowRef as Ne, toValue as le, watchEffect as Xo, unref as Ce, isRef as nr } from "vue";
const Zo = Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#4d9375","activityBar.background":"#121212","activityBar.border":"#191919","activityBar.foreground":"#dbd7caee","activityBar.inactiveForeground":"#dedcd550","activityBarBadge.background":"#bfbaaa","activityBarBadge.foreground":"#121212","badge.background":"#dedcd590","badge.foreground":"#121212","breadcrumb.activeSelectionForeground":"#eeeeee18","breadcrumb.background":"#181818","breadcrumb.focusForeground":"#dbd7caee","breadcrumb.foreground":"#959da5","breadcrumbPicker.background":"#121212","button.background":"#4d9375","button.foreground":"#121212","button.hoverBackground":"#4d9375","checkbox.background":"#181818","checkbox.border":"#2f363d","debugToolBar.background":"#121212","descriptionForeground":"#dedcd590","diffEditor.insertedTextBackground":"#4d937550","diffEditor.removedTextBackground":"#ab595950","dropdown.background":"#121212","dropdown.border":"#191919","dropdown.foreground":"#dbd7caee","dropdown.listBackground":"#181818","editor.background":"#121212","editor.findMatchBackground":"#e6cc7722","editor.findMatchHighlightBackground":"#e6cc7744","editor.focusedStackFrameHighlightBackground":"#b808","editor.foldBackground":"#eeeeee10","editor.foreground":"#dbd7caee","editor.inactiveSelectionBackground":"#eeeeee10","editor.lineHighlightBackground":"#181818","editor.selectionBackground":"#eeeeee18","editor.selectionHighlightBackground":"#eeeeee10","editor.stackFrameHighlightBackground":"#a707","editor.wordHighlightBackground":"#1c6b4805","editor.wordHighlightStrongBackground":"#1c6b4810","editorBracketHighlight.foreground1":"#5eaab5","editorBracketHighlight.foreground2":"#4d9375","editorBracketHighlight.foreground3":"#d4976c","editorBracketHighlight.foreground4":"#d9739f","editorBracketHighlight.foreground5":"#e6cc77","editorBracketHighlight.foreground6":"#6394bf","editorBracketMatch.background":"#4d937520","editorError.foreground":"#cb7676","editorGroup.border":"#191919","editorGroupHeader.tabsBackground":"#121212","editorGroupHeader.tabsBorder":"#191919","editorGutter.addedBackground":"#4d9375","editorGutter.commentRangeForeground":"#dedcd550","editorGutter.deletedBackground":"#cb7676","editorGutter.foldingControlForeground":"#dedcd590","editorGutter.modifiedBackground":"#6394bf","editorHint.foreground":"#4d9375","editorIndentGuide.activeBackground":"#ffffff30","editorIndentGuide.background":"#ffffff15","editorInfo.foreground":"#6394bf","editorInlayHint.background":"#181818","editorInlayHint.foreground":"#666666","editorLineNumber.activeForeground":"#bfbaaa","editorLineNumber.foreground":"#dedcd550","editorOverviewRuler.border":"#111","editorStickyScroll.background":"#181818","editorStickyScrollHover.background":"#181818","editorWarning.foreground":"#d4976c","editorWhitespace.foreground":"#ffffff15","editorWidget.background":"#121212","errorForeground":"#cb7676","focusBorder":"#00000000","foreground":"#dbd7caee","gitDecoration.addedResourceForeground":"#4d9375","gitDecoration.conflictingResourceForeground":"#d4976c","gitDecoration.deletedResourceForeground":"#cb7676","gitDecoration.ignoredResourceForeground":"#dedcd550","gitDecoration.modifiedResourceForeground":"#6394bf","gitDecoration.submoduleResourceForeground":"#dedcd590","gitDecoration.untrackedResourceForeground":"#5eaab5","input.background":"#181818","input.border":"#191919","input.foreground":"#dbd7caee","input.placeholderForeground":"#dedcd590","inputOption.activeBackground":"#dedcd550","list.activeSelectionBackground":"#181818","list.activeSelectionForeground":"#dbd7caee","list.focusBackground":"#181818","list.highlightForeground":"#4d9375","list.hoverBackground":"#181818","list.hoverForeground":"#dbd7caee","list.inactiveFocusBackground":"#121212","list.inactiveSelectionBackground":"#181818","list.inactiveSelectionForeground":"#dbd7caee","menu.separatorBackground":"#191919","notificationCenterHeader.background":"#121212","notificationCenterHeader.foreground":"#959da5","notifications.background":"#121212","notifications.border":"#191919","notifications.foreground":"#dbd7caee","notificationsErrorIcon.foreground":"#cb7676","notificationsInfoIcon.foreground":"#6394bf","notificationsWarningIcon.foreground":"#d4976c","panel.background":"#121212","panel.border":"#191919","panelInput.border":"#2f363d","panelTitle.activeBorder":"#4d9375","panelTitle.activeForeground":"#dbd7caee","panelTitle.inactiveForeground":"#959da5","peekViewEditor.background":"#121212","peekViewEditor.matchHighlightBackground":"#ffd33d33","peekViewResult.background":"#121212","peekViewResult.matchHighlightBackground":"#ffd33d33","pickerGroup.border":"#191919","pickerGroup.foreground":"#dbd7caee","problemsErrorIcon.foreground":"#cb7676","problemsInfoIcon.foreground":"#6394bf","problemsWarningIcon.foreground":"#d4976c","progressBar.background":"#4d9375","quickInput.background":"#121212","quickInput.foreground":"#dbd7caee","quickInputList.focusBackground":"#181818","scrollbar.shadow":"#0000","scrollbarSlider.activeBackground":"#dedcd550","scrollbarSlider.background":"#dedcd510","scrollbarSlider.hoverBackground":"#dedcd550","settings.headerForeground":"#dbd7caee","settings.modifiedItemIndicator":"#4d9375","sideBar.background":"#121212","sideBar.border":"#191919","sideBar.foreground":"#bfbaaa","sideBarSectionHeader.background":"#121212","sideBarSectionHeader.border":"#191919","sideBarSectionHeader.foreground":"#dbd7caee","sideBarTitle.foreground":"#dbd7caee","statusBar.background":"#121212","statusBar.border":"#191919","statusBar.debuggingBackground":"#181818","statusBar.debuggingForeground":"#bfbaaa","statusBar.foreground":"#bfbaaa","statusBar.noFolderBackground":"#121212","statusBarItem.prominentBackground":"#181818","tab.activeBackground":"#121212","tab.activeBorder":"#191919","tab.activeBorderTop":"#dedcd590","tab.activeForeground":"#dbd7caee","tab.border":"#191919","tab.hoverBackground":"#181818","tab.inactiveBackground":"#121212","tab.inactiveForeground":"#959da5","tab.unfocusedActiveBorder":"#191919","tab.unfocusedActiveBorderTop":"#191919","tab.unfocusedHoverBackground":"#121212","terminal.ansiBlack":"#393a34","terminal.ansiBlue":"#6394bf","terminal.ansiBrightBlack":"#777777","terminal.ansiBrightBlue":"#6394bf","terminal.ansiBrightCyan":"#5eaab5","terminal.ansiBrightGreen":"#4d9375","terminal.ansiBrightMagenta":"#d9739f","terminal.ansiBrightRed":"#cb7676","terminal.ansiBrightWhite":"#ffffff","terminal.ansiBrightYellow":"#e6cc77","terminal.ansiCyan":"#5eaab5","terminal.ansiGreen":"#4d9375","terminal.ansiMagenta":"#d9739f","terminal.ansiRed":"#cb7676","terminal.ansiWhite":"#dbd7ca","terminal.ansiYellow":"#e6cc77","terminal.foreground":"#dbd7caee","terminal.selectionBackground":"#eeeeee18","textBlockQuote.background":"#121212","textBlockQuote.border":"#191919","textCodeBlock.background":"#121212","textLink.activeForeground":"#4d9375","textLink.foreground":"#4d9375","textPreformat.foreground":"#d1d5da","textSeparator.foreground":"#586069","titleBar.activeBackground":"#121212","titleBar.activeForeground":"#bfbaaa","titleBar.border":"#181818","titleBar.inactiveBackground":"#121212","titleBar.inactiveForeground":"#959da5","tree.indentGuidesStroke":"#2f363d","welcomePage.buttonBackground":"#2f363d","welcomePage.buttonHoverBackground":"#444d56"},"displayName":"Vitesse Dark","name":"vitesse-dark","semanticHighlighting":true,"semanticTokenColors":{"class":"#6872ab","interface":"#5d99a9","namespace":"#db889a","property":"#b8a965","type":"#5d99a9"},"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#758575dd"}},{"scope":["delimiter.bracket","delimiter","invalid.illegal.character-not-allowed-here.html","keyword.operator.rest","keyword.operator.spread","keyword.operator.type.annotation","keyword.operator.relational","keyword.operator.assignment","keyword.operator.type","meta.brace","meta.tag.block.any.html","meta.tag.inline.any.html","meta.tag.structure.input.void.html","meta.type.annotation","meta.embedded.block.github-actions-expression","storage.type.function.arrow","meta.objectliteral.ts","punctuation","punctuation.definition.string.begin.html.vue","punctuation.definition.string.end.html.vue"],"settings":{"foreground":"#666666"}},{"scope":["constant","entity.name.constant","variable.language","meta.definition.variable"],"settings":{"foreground":"#c99076"}},{"scope":["entity","entity.name"],"settings":{"foreground":"#80a665"}},{"scope":"variable.parameter.function","settings":{"foreground":"#dbd7caee"}},{"scope":["entity.name.tag","tag.html"],"settings":{"foreground":"#4d9375"}},{"scope":"entity.name.function","settings":{"foreground":"#80a665"}},{"scope":["keyword","storage.type.class.jsdoc","punctuation.definition.template-expression"],"settings":{"foreground":"#4d9375"}},{"scope":["storage","storage.type","support.type.builtin","constant.language.undefined","constant.language.null","constant.language.import-export-all.ts"],"settings":{"foreground":"#cb7676"}},{"scope":["text.html.derivative","storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#dbd7caee"}},{"scope":["string","string punctuation.section.embedded source","attribute.value"],"settings":{"foreground":"#c98a7d"}},{"scope":["punctuation.definition.string"],"settings":{"foreground":"#c98a7d77"}},{"scope":["punctuation.support.type.property-name"],"settings":{"foreground":"#b8a96577"}},{"scope":"support","settings":{"foreground":"#b8a965"}},{"scope":["property","meta.property-name","meta.object-literal.key","entity.name.tag.yaml","attribute.name"],"settings":{"foreground":"#b8a965"}},{"scope":["entity.other.attribute-name","invalid.deprecated.entity.other.attribute-name.html"],"settings":{"foreground":"#bd976a"}},{"scope":["variable","identifier"],"settings":{"foreground":"#bd976a"}},{"scope":["support.type.primitive","entity.name.type"],"settings":{"foreground":"#5DA994"}},{"scope":"namespace","settings":{"foreground":"#db889a"}},{"scope":["keyword.operator","keyword.operator.assignment.compound","meta.var.expr.ts"],"settings":{"foreground":"#cb7676"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#fdaeb7"}},{"scope":"carriage-return","settings":{"background":"#f97583","content":"^M","fontStyle":"italic underline","foreground":"#24292e"}},{"scope":"message.error","settings":{"foreground":"#fdaeb7"}},{"scope":"string variable","settings":{"foreground":"#c98a7d"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#c4704f"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#c98a7d"}},{"scope":"string.regexp constant.character.escape","settings":{"foreground":"#e6cc77"}},{"scope":["support.constant"],"settings":{"foreground":"#c99076"}},{"scope":["keyword.operator.quantifier.regexp","constant.numeric","number"],"settings":{"foreground":"#4C9A91"}},{"scope":["keyword.other.unit"],"settings":{"foreground":"#cb7676"}},{"scope":["constant.language.boolean","constant.language"],"settings":{"foreground":"#4d9375"}},{"scope":"meta.module-reference","settings":{"foreground":"#4d9375"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#d4976c"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#4d9375"}},{"scope":"markup.quote","settings":{"foreground":"#5d99a9"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#dbd7caee"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#dbd7caee"}},{"scope":"markup.raw","settings":{"foreground":"#4d9375"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#86181d","foreground":"#fdaeb7"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#144620","foreground":"#85e89d"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#c24e00","foreground":"#ffab70"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#79b8ff","foreground":"#2f363d"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#b392f0"}},{"scope":"meta.diff.header","settings":{"foreground":"#79b8ff"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#79b8ff"}},{"scope":"meta.output","settings":{"foreground":"#79b8ff"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#d1d5da"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#fdaeb7"}},{"scope":["constant.other.reference.link","string.other.link","punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown"],"settings":{"foreground":"#c98a7d"}},{"scope":["markup.underline.link.markdown","markup.underline.link.image.markdown"],"settings":{"fontStyle":"underline","foreground":"#dedcd590"}},{"scope":["type.identifier","constant.other.character-class.regexp"],"settings":{"foreground":"#6872ab"}},{"scope":["entity.other.attribute-name.html.vue"],"settings":{"foreground":"#80a665"}},{"scope":["invalid.illegal.unrecognized-tag.html"],"settings":{"fontStyle":"normal"}}],"type":"dark"}')), ei = Object.freeze(JSON.parse('{"colors":{"activityBar.activeBorder":"#1c6b48","activityBar.background":"#ffffff","activityBar.border":"#f0f0f0","activityBar.foreground":"#393a34","activityBar.inactiveForeground":"#393a3450","activityBarBadge.background":"#4e4f47","activityBarBadge.foreground":"#ffffff","badge.background":"#393a3490","badge.foreground":"#ffffff","breadcrumb.activeSelectionForeground":"#22222218","breadcrumb.background":"#f7f7f7","breadcrumb.focusForeground":"#393a34","breadcrumb.foreground":"#6a737d","breadcrumbPicker.background":"#ffffff","button.background":"#1c6b48","button.foreground":"#ffffff","button.hoverBackground":"#1c6b48","checkbox.background":"#f7f7f7","checkbox.border":"#d1d5da","debugToolBar.background":"#ffffff","descriptionForeground":"#393a3490","diffEditor.insertedTextBackground":"#1c6b4830","diffEditor.removedTextBackground":"#ab595940","dropdown.background":"#ffffff","dropdown.border":"#f0f0f0","dropdown.foreground":"#393a34","dropdown.listBackground":"#f7f7f7","editor.background":"#ffffff","editor.findMatchBackground":"#e6cc7744","editor.findMatchHighlightBackground":"#e6cc7766","editor.focusedStackFrameHighlightBackground":"#fff5b1","editor.foldBackground":"#22222210","editor.foreground":"#393a34","editor.inactiveSelectionBackground":"#22222210","editor.lineHighlightBackground":"#f7f7f7","editor.selectionBackground":"#22222218","editor.selectionHighlightBackground":"#22222210","editor.stackFrameHighlightBackground":"#fffbdd","editor.wordHighlightBackground":"#1c6b4805","editor.wordHighlightStrongBackground":"#1c6b4810","editorBracketHighlight.foreground1":"#2993a3","editorBracketHighlight.foreground2":"#1e754f","editorBracketHighlight.foreground3":"#a65e2b","editorBracketHighlight.foreground4":"#a13865","editorBracketHighlight.foreground5":"#bda437","editorBracketHighlight.foreground6":"#296aa3","editorBracketMatch.background":"#1c6b4820","editorError.foreground":"#ab5959","editorGroup.border":"#f0f0f0","editorGroupHeader.tabsBackground":"#ffffff","editorGroupHeader.tabsBorder":"#f0f0f0","editorGutter.addedBackground":"#1e754f","editorGutter.commentRangeForeground":"#393a3450","editorGutter.deletedBackground":"#ab5959","editorGutter.foldingControlForeground":"#393a3490","editorGutter.modifiedBackground":"#296aa3","editorHint.foreground":"#1e754f","editorIndentGuide.activeBackground":"#00000030","editorIndentGuide.background":"#00000015","editorInfo.foreground":"#296aa3","editorInlayHint.background":"#f7f7f7","editorInlayHint.foreground":"#999999","editorLineNumber.activeForeground":"#4e4f47","editorLineNumber.foreground":"#393a3450","editorOverviewRuler.border":"#fff","editorStickyScroll.background":"#f7f7f7","editorStickyScrollHover.background":"#f7f7f7","editorWarning.foreground":"#a65e2b","editorWhitespace.foreground":"#00000015","editorWidget.background":"#ffffff","errorForeground":"#ab5959","focusBorder":"#00000000","foreground":"#393a34","gitDecoration.addedResourceForeground":"#1e754f","gitDecoration.conflictingResourceForeground":"#a65e2b","gitDecoration.deletedResourceForeground":"#ab5959","gitDecoration.ignoredResourceForeground":"#393a3450","gitDecoration.modifiedResourceForeground":"#296aa3","gitDecoration.submoduleResourceForeground":"#393a3490","gitDecoration.untrackedResourceForeground":"#2993a3","input.background":"#f7f7f7","input.border":"#f0f0f0","input.foreground":"#393a34","input.placeholderForeground":"#393a3490","inputOption.activeBackground":"#393a3450","list.activeSelectionBackground":"#f7f7f7","list.activeSelectionForeground":"#393a34","list.focusBackground":"#f7f7f7","list.highlightForeground":"#1c6b48","list.hoverBackground":"#f7f7f7","list.hoverForeground":"#393a34","list.inactiveFocusBackground":"#ffffff","list.inactiveSelectionBackground":"#f7f7f7","list.inactiveSelectionForeground":"#393a34","menu.separatorBackground":"#f0f0f0","notificationCenterHeader.background":"#ffffff","notificationCenterHeader.foreground":"#6a737d","notifications.background":"#ffffff","notifications.border":"#f0f0f0","notifications.foreground":"#393a34","notificationsErrorIcon.foreground":"#ab5959","notificationsInfoIcon.foreground":"#296aa3","notificationsWarningIcon.foreground":"#a65e2b","panel.background":"#ffffff","panel.border":"#f0f0f0","panelInput.border":"#e1e4e8","panelTitle.activeBorder":"#1c6b48","panelTitle.activeForeground":"#393a34","panelTitle.inactiveForeground":"#6a737d","peekViewEditor.background":"#ffffff","peekViewResult.background":"#ffffff","pickerGroup.border":"#f0f0f0","pickerGroup.foreground":"#393a34","problemsErrorIcon.foreground":"#ab5959","problemsInfoIcon.foreground":"#296aa3","problemsWarningIcon.foreground":"#a65e2b","progressBar.background":"#1c6b48","quickInput.background":"#ffffff","quickInput.foreground":"#393a34","quickInputList.focusBackground":"#f7f7f7","scrollbar.shadow":"#6a737d33","scrollbarSlider.activeBackground":"#393a3450","scrollbarSlider.background":"#393a3410","scrollbarSlider.hoverBackground":"#393a3450","settings.headerForeground":"#393a34","settings.modifiedItemIndicator":"#1c6b48","sideBar.background":"#ffffff","sideBar.border":"#f0f0f0","sideBar.foreground":"#4e4f47","sideBarSectionHeader.background":"#ffffff","sideBarSectionHeader.border":"#f0f0f0","sideBarSectionHeader.foreground":"#393a34","sideBarTitle.foreground":"#393a34","statusBar.background":"#ffffff","statusBar.border":"#f0f0f0","statusBar.debuggingBackground":"#f7f7f7","statusBar.debuggingForeground":"#4e4f47","statusBar.foreground":"#4e4f47","statusBar.noFolderBackground":"#ffffff","statusBarItem.prominentBackground":"#f7f7f7","tab.activeBackground":"#ffffff","tab.activeBorder":"#f0f0f0","tab.activeBorderTop":"#393a3490","tab.activeForeground":"#393a34","tab.border":"#f0f0f0","tab.hoverBackground":"#f7f7f7","tab.inactiveBackground":"#ffffff","tab.inactiveForeground":"#6a737d","tab.unfocusedActiveBorder":"#f0f0f0","tab.unfocusedActiveBorderTop":"#f0f0f0","tab.unfocusedHoverBackground":"#ffffff","terminal.ansiBlack":"#121212","terminal.ansiBlue":"#296aa3","terminal.ansiBrightBlack":"#aaaaaa","terminal.ansiBrightBlue":"#296aa3","terminal.ansiBrightCyan":"#2993a3","terminal.ansiBrightGreen":"#1e754f","terminal.ansiBrightMagenta":"#a13865","terminal.ansiBrightRed":"#ab5959","terminal.ansiBrightWhite":"#dddddd","terminal.ansiBrightYellow":"#bda437","terminal.ansiCyan":"#2993a3","terminal.ansiGreen":"#1e754f","terminal.ansiMagenta":"#a13865","terminal.ansiRed":"#ab5959","terminal.ansiWhite":"#dbd7ca","terminal.ansiYellow":"#bda437","terminal.foreground":"#393a34","terminal.selectionBackground":"#22222218","textBlockQuote.background":"#ffffff","textBlockQuote.border":"#f0f0f0","textCodeBlock.background":"#ffffff","textLink.activeForeground":"#1c6b48","textLink.foreground":"#1c6b48","textPreformat.foreground":"#586069","textSeparator.foreground":"#d1d5da","titleBar.activeBackground":"#ffffff","titleBar.activeForeground":"#4e4f47","titleBar.border":"#f7f7f7","titleBar.inactiveBackground":"#ffffff","titleBar.inactiveForeground":"#6a737d","tree.indentGuidesStroke":"#e1e4e8","welcomePage.buttonBackground":"#f6f8fa","welcomePage.buttonHoverBackground":"#e1e4e8"},"displayName":"Vitesse Light","name":"vitesse-light","semanticHighlighting":true,"semanticTokenColors":{"class":"#5a6aa6","interface":"#2e808f","namespace":"#b05a78","property":"#998418","type":"#2e808f"},"tokenColors":[{"scope":["comment","punctuation.definition.comment","string.comment"],"settings":{"foreground":"#a0ada0"}},{"scope":["delimiter.bracket","delimiter","invalid.illegal.character-not-allowed-here.html","keyword.operator.rest","keyword.operator.spread","keyword.operator.type.annotation","keyword.operator.relational","keyword.operator.assignment","keyword.operator.type","meta.brace","meta.tag.block.any.html","meta.tag.inline.any.html","meta.tag.structure.input.void.html","meta.type.annotation","meta.embedded.block.github-actions-expression","storage.type.function.arrow","meta.objectliteral.ts","punctuation","punctuation.definition.string.begin.html.vue","punctuation.definition.string.end.html.vue"],"settings":{"foreground":"#999999"}},{"scope":["constant","entity.name.constant","variable.language","meta.definition.variable"],"settings":{"foreground":"#a65e2b"}},{"scope":["entity","entity.name"],"settings":{"foreground":"#59873a"}},{"scope":"variable.parameter.function","settings":{"foreground":"#393a34"}},{"scope":["entity.name.tag","tag.html"],"settings":{"foreground":"#1e754f"}},{"scope":"entity.name.function","settings":{"foreground":"#59873a"}},{"scope":["keyword","storage.type.class.jsdoc","punctuation.definition.template-expression"],"settings":{"foreground":"#1e754f"}},{"scope":["storage","storage.type","support.type.builtin","constant.language.undefined","constant.language.null","constant.language.import-export-all.ts"],"settings":{"foreground":"#ab5959"}},{"scope":["text.html.derivative","storage.modifier.package","storage.modifier.import","storage.type.java"],"settings":{"foreground":"#393a34"}},{"scope":["string","string punctuation.section.embedded source","attribute.value"],"settings":{"foreground":"#b56959"}},{"scope":["punctuation.definition.string"],"settings":{"foreground":"#b5695977"}},{"scope":["punctuation.support.type.property-name"],"settings":{"foreground":"#99841877"}},{"scope":"support","settings":{"foreground":"#998418"}},{"scope":["property","meta.property-name","meta.object-literal.key","entity.name.tag.yaml","attribute.name"],"settings":{"foreground":"#998418"}},{"scope":["entity.other.attribute-name","invalid.deprecated.entity.other.attribute-name.html"],"settings":{"foreground":"#b07d48"}},{"scope":["variable","identifier"],"settings":{"foreground":"#b07d48"}},{"scope":["support.type.primitive","entity.name.type"],"settings":{"foreground":"#2e8f82"}},{"scope":"namespace","settings":{"foreground":"#b05a78"}},{"scope":["keyword.operator","keyword.operator.assignment.compound","meta.var.expr.ts"],"settings":{"foreground":"#ab5959"}},{"scope":"invalid.broken","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.deprecated","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.illegal","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"invalid.unimplemented","settings":{"fontStyle":"italic","foreground":"#b31d28"}},{"scope":"carriage-return","settings":{"background":"#d73a49","content":"^M","fontStyle":"italic underline","foreground":"#fafbfc"}},{"scope":"message.error","settings":{"foreground":"#b31d28"}},{"scope":"string variable","settings":{"foreground":"#b56959"}},{"scope":["source.regexp","string.regexp"],"settings":{"foreground":"#ab5e3f"}},{"scope":["string.regexp.character-class","string.regexp constant.character.escape","string.regexp source.ruby.embedded","string.regexp string.regexp.arbitrary-repitition"],"settings":{"foreground":"#b56959"}},{"scope":"string.regexp constant.character.escape","settings":{"foreground":"#bda437"}},{"scope":["support.constant"],"settings":{"foreground":"#a65e2b"}},{"scope":["keyword.operator.quantifier.regexp","constant.numeric","number"],"settings":{"foreground":"#2f798a"}},{"scope":["keyword.other.unit"],"settings":{"foreground":"#ab5959"}},{"scope":["constant.language.boolean","constant.language"],"settings":{"foreground":"#1e754f"}},{"scope":"meta.module-reference","settings":{"foreground":"#1c6b48"}},{"scope":"punctuation.definition.list.begin.markdown","settings":{"foreground":"#a65e2b"}},{"scope":["markup.heading","markup.heading entity.name"],"settings":{"fontStyle":"bold","foreground":"#1c6b48"}},{"scope":"markup.quote","settings":{"foreground":"#2e808f"}},{"scope":"markup.italic","settings":{"fontStyle":"italic","foreground":"#393a34"}},{"scope":"markup.bold","settings":{"fontStyle":"bold","foreground":"#393a34"}},{"scope":"markup.raw","settings":{"foreground":"#1c6b48"}},{"scope":["markup.deleted","meta.diff.header.from-file","punctuation.definition.deleted"],"settings":{"background":"#ffeef0","foreground":"#b31d28"}},{"scope":["markup.inserted","meta.diff.header.to-file","punctuation.definition.inserted"],"settings":{"background":"#f0fff4","foreground":"#22863a"}},{"scope":["markup.changed","punctuation.definition.changed"],"settings":{"background":"#ffebda","foreground":"#e36209"}},{"scope":["markup.ignored","markup.untracked"],"settings":{"background":"#005cc5","foreground":"#f6f8fa"}},{"scope":"meta.diff.range","settings":{"fontStyle":"bold","foreground":"#6f42c1"}},{"scope":"meta.diff.header","settings":{"foreground":"#005cc5"}},{"scope":"meta.separator","settings":{"fontStyle":"bold","foreground":"#005cc5"}},{"scope":"meta.output","settings":{"foreground":"#005cc5"}},{"scope":["brackethighlighter.tag","brackethighlighter.curly","brackethighlighter.round","brackethighlighter.square","brackethighlighter.angle","brackethighlighter.quote"],"settings":{"foreground":"#586069"}},{"scope":"brackethighlighter.unmatched","settings":{"foreground":"#b31d28"}},{"scope":["constant.other.reference.link","string.other.link","punctuation.definition.string.begin.markdown","punctuation.definition.string.end.markdown"],"settings":{"foreground":"#b56959"}},{"scope":["markup.underline.link.markdown","markup.underline.link.image.markdown"],"settings":{"fontStyle":"underline","foreground":"#393a3490"}},{"scope":["type.identifier","constant.other.character-class.regexp"],"settings":{"foreground":"#5a6aa6"}},{"scope":["entity.other.attribute-name.html.vue"],"settings":{"foreground":"#59873a"}},{"scope":["invalid.illegal.unrecognized-tag.html"],"settings":{"fontStyle":"normal"}}],"type":"light"}'));
function ti(e) {
return tr() ? (Qo(e), !0) : !1;
}
const lt = /* @__PURE__ */ new WeakMap(), ni = (...e) => {
var t;
const n = e[0], r = (t = rt()) == null ? void 0 : t.proxy;
if (r == null && !er())
throw new Error("injectLocal must be called in setup");
return r && lt.has(r) && n in lt.get(r) ? lt.get(r)[n] : Ko(...e);
}, ri = typeof window < "u" && typeof document < "u";
typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
const oi = (e) => typeof e < "u", ii = Object.prototype.toString, ai = (e) => ii.call(e) === "[object Object]", si = () => {
};
function rr(...e) {
if (e.length !== 1)
return Wo(...e);
const t = e[0];
return typeof t == "function" ? Xn(Yo(() => ({ get: t, set: si }))) : B(t);
}
function ci(e, t) {
function n(...r) {
return new Promise((o, s) => {
Promise.resolve(e(() => t.apply(this, r), { fn: t, thisArg: this, args: r })).then(o).catch(s);
});
}
return n;
}
const or = (e) => e();
function li(e = or, t = {}) {
const {
initialState: n = "active"
} = t, r = rr(n === "active");
function o() {
r.value = !1;
}
function s() {
r.value = !0;
}
const a = (...i) => {
r.value && e(...i);
};
return { isActive: Xn(r), pause: o, resume: s, eventFilter: a };
}
function kn(e) {
return e.endsWith("rem") ? Number.parseFloat(e) * 16 : Number.parseFloat(e);
}
function ut(e) {
return Array.isArray(e) ? e : [e];
}
function ui(e) {
return rt();
}
function di(e, t, n = {}) {
const {
eventFilter: r = or,
...o
} = n;
return xe(
e,
ci(
r,
t
),
o
);
}
function fi(e, t, n = {}) {
const {
eventFilter: r,
initialState: o = "active",
...s
} = n, { eventFilter: a, pause: i, resume: c, isActive: l } = li(r, { initialState: o });
return { stop: di(
e,
t,
{
...s,
eventFilter: a
}
), pause: i, resume: c, isActive: l };
}
function ir(e, t = !0, n) {
ui() ? Zn(e, n) : t ? e() : Ut(e);
}
function pi(e, t, n) {
return xe(
e,
t,
{
...n,
immediate: !0
}
);
}
const De = ri ? window : void 0;
function ar(e) {
var t;
const n = le(e);
return (t = n == null ? void 0 : n.$el) != null ? t : n;
}
function xt(...e) {
const t = [], n = () => {
t.forEach((i) => i()), t.length = 0;
}, r = (i, c, l, d) => (i.addEventListener(c, l, d), () => i.removeEventListener(c, l, d)), o = re(() => {
const i = ut(le(e[0])).filter((c) => c != null);
return i.every((c) => typeof c != "string") ? i : void 0;
}), s = pi(
() => {
var i, c;
return [
(c = (i = o.value) == null ? void 0 : i.map((l) => ar(l))) != null ? c : [De].filter((l) => l != null),
ut(le(o.value ? e[1] : e[0])),
ut(Ce(o.value ? e[2] : e[1])),
// @ts-expect-error - TypeScript gets the correct types, but somehow still complains
le(o.value ? e[3] : e[2])
];
},
([i, c, l, d]) => {
if (n(), !(i != null && i.length) || !(c != null && c.length) || !(l != null && l.length))
return;
const f = ai(d) ? { ...d } : d;
t.push(
...i.flatMap(
(g) => c.flatMap(
(p) => l.map((h) => r(g, p, h, f))
)
)
);
},
{ flush: "post" }
), a = () => {
s(), n();
};
return ti(n), a;
}
function gi() {
const e = Ne(!1), t = rt();
return t && Zn(() => {
e.value = !0;
}, t), e;
}
function hi(e) {
const t = gi();
return re(() => (t.value, !!e()));
}
const mi = Symbol("vueuse-ssr-width");
function yi() {
const e = er() ? ni(mi, null) : null;
return typeof e == "number" ? e : void 0;
}
function bi(e, t = {}) {
const { window: n = De, ssrWidth: r = yi() } = t, o = hi(() => n && "matchMedia" in n && typeof n.matchMedia == "function"), s = Ne(typeof r == "number"), a = Ne(), i = Ne(!1), c = (l) => {
i.value = l.matches;
};
return Xo(() => {
if (s.value) {
s.value = !o.value;
const l = le(e).split(",");
i.value = l.some((d) => {
const f = d.includes("not all"), g = d.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/), p = d.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
let h = !!(g || p);
return g && h && (h = r >= kn(g[1])), p && h && (h = r <= kn(p[1])), f ? !h : h;
});
return;
}
o.value && (a.value = n.matchMedia(le(e)), i.value = a.value.matches);
}), xt(a, "change", c, { passive: !0 }), re(() => i.value);
}
function vi(e) {
return JSON.parse(JSON.stringify(e));
}
const Ge = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, ze = "__vueuse_ssr_handlers__", Si = /* @__PURE__ */ $i();
function $i() {
return ze in Ge || (Ge[ze] = Ge[ze] || {}), Ge[ze];
}
function sr(e, t) {
return Si[e] || t;
}
function ki(e) {
return bi("(prefers-color-scheme: dark)", e);
}
function Ti(e) {
return e == null ? "any" : e instanceof Set ? "set" : e instanceof Map ? "map" : e instanceof Date ? "date" : typeof e == "boolean" ? "boolean" : typeof e == "string" ? "string" : typeof e == "object" ? "object" : Number.isNaN(e) ? "any" : "number";
}
const Oi = {
boolean: {
read: (e) => e === "true",
write: (e) => String(e)
},
object: {
read: (e) => JSON.parse(e),
write: (e) => JSON.stringify(e)
},
number: {
read: (e) => Number.parseFloat(e),
write: (e) => String(e)
},
any: {
read: (e) => e,
write: (e) => String(e)
},
string: {
read: (e) => e,
write: (e) => String(e)
},
map: {
read: (e) => new Map(JSON.parse(e)),
write: (e) => JSON.stringify(Array.from(e.entries()))
},
set: {
read: (e) => new Set(JSON.parse(e)),
write: (e) => JSON.stringify(Array.from(e))
},
date: {
read: (e) => new Date(e),
write: (e) => e.toISOString()
}
}, Tn = "vueuse-storage";
function wi(e, t, n, r = {}) {
var o;
const {
flush: s = "pre",
deep: a = !0,
listenToStorageChanges: i = !0,
writeDefaults: c = !0,
mergeDefaults: l = !1,
shallow: d,
window: f = De,
eventFilter: g,
onError: p = (k) => {
console.error(k);
},
initOnMounted: h
} = r, b = (d ? Ne : B)(typeof t == "function" ? t() : t), m = re(() => le(e));
if (!n)
try {
n = sr("getDefaultStorage", () => {
var k;
return (k = De) == null ? void 0 : k.localStorage;
})();
} catch (k) {
p(k);
}
if (!n)
return b;
const S = le(t), v = Ti(S), T = (o = r.serializer) != null ? o : Oi[v], { pause: A, resume: P } = fi(
b,
() => N(b.value),
{ flush: s, deep: a, eventFilter: g }
);
xe(m, () => O(), { flush: s }), f && i && ir(() => {
n instanceof Storage ? xt(f, "storage", O, { passive: !0 }) : xt(f, Tn, E), h && O();
}), h || O();
function L(k, x) {
if (f) {
const C = {
key: m.value,
oldValue: k,
newValue: x,
storageArea: n
};
f.dispatchEvent(n instanceof Storage ? new StorageEvent("storage", C) : new CustomEvent(Tn, {
detail: C
}));
}
}
function N(k) {
try {
const x = n.getItem(m.value);
if (k == null)
L(x, null), n.removeItem(m.value);
else {
const C = T.write(k);
x !== C && (n.setItem(m.value, C), L(x, C));
}
} catch (x) {
p(x);
}
}
function U(k) {
const x = k ? k.newValue : n.getItem(m.value);
if (x == null)
return c && S != null && n.setItem(m.value, T.write(S)), S;
if (!k && l) {
const C = T.read(x);
return typeof l == "function" ? l(C, S) : v === "object" && !Array.isArray(C) ? { ...S, ...C } : C;
} else return typeof x != "string" ? x : T.read(x);
}
function O(k) {
if (!(k && k.storageArea !== n)) {
if (k && k.key == null) {
b.value = S;
return;
}
if (!(k && k.key !== m.value)) {
A();
try {
(k == null ? void 0 : k.newValue) !== T.write(b.value) && (b.value = U(k));
} catch (x) {
p(x);
} finally {
k ? Ut(P) : P();
}
}
}
}
function E(k) {
O(k.detail);
}
return b;
}
const Ei = "*,*::before,*::after{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";
function xi(e = {}) {
const {
selector: t = "html",
attribute: n = "class",
initialValue: r = "auto",
window: o = De,
storage: s,
storageKey: a = "vueuse-color-scheme",
listenToStorageChanges: i = !0,
storageRef: c,
emitAuto: l,
disableTransition: d = !0
} = e, f = {
auto: "",
light: "light",
dark: "dark",
...e.modes || {}
}, g = ki({ window: o }), p = re(() => g.value ? "dark" : "light"), h = c || (a == null ? rr(r) : wi(a, r, s, { window: o, listenToStorageChanges: i })), b = re(() => h.value === "auto" ? p.value : h.value), m = sr(
"updateHTMLAttrs",
(A, P, L) => {
const N = typeof A == "string" ? o == null ? void 0 : o.document.querySelector(A) : ar(A);
if (!N)
return;
const U = /* @__PURE__ */ new Set(), O = /* @__PURE__ */ new Set();
let E = null;
if (P === "class") {
const x = L.split(/\s/g);
Object.values(f).flatMap((C) => (C || "").split(/\s/g)).filter(Boolean).forEach((C) => {
x.includes(C) ? U.add(C) : O.add(C);
});
} else
E = { key: P, value: L };
if (U.size === 0 && O.size === 0 && E === null)
return;
let k;
d && (k = o.document.createElement("style"), k.appendChild(document.createTextNode(Ei)), o.document.head.appendChild(k));
for (const x of U)
N.classList.add(x);
for (const x of O)
N.classList.remove(x);
E && N.setAttribute(E.key, E.value), d && (o.getComputedStyle(k).opacity, document.head.removeChild(k));
}
);
function S(A) {
var P;
m(t, n, (P = f[A]) != null ? P : A);
}
function v(A) {
e.onChanged ? e.onChanged(A, S) : S(A);
}
xe(b, v, { flush: "post", immediate: !0 }), ir(() => v(b.value));
const T = re({
get() {
return l ? h.value : b.value;
},
set(A) {
h.value = A;
}
});
return Object.assign(T, { store: h, system: p, state: b });
}
function ji(e = {}) {
const {
valueDark: t = "dark",
valueLight: n = ""
} = e, r = xi({
...e,
onChanged: (a, i) => {
var c;
e.onChanged ? (c = e.onChanged) == null || c.call(e, a === "dark", i, a) : i(a);
},
modes: {
dark: t,
light: n
}
}), o = re(() => r.system.value);
return re({
get() {
return r.value === "dark";
},
set(a) {
const i = a ? "dark" : "light";
o.value === i ? r.value = "auto" : r.value = i;
}
});
}
const Le = /* @__PURE__ */ new Map();
function Rp(e) {
const t = tr();
function n(i) {
var c;
const l = Le.get(e) || /* @__PURE__ */ new Set();
l.add(i), Le.set(e, l);
const d = () => o(i);
return (c = t == null ? void 0 : t.cleanups) == null || c.push(d), d;
}
function r(i) {
function c(...l) {
o(c), i(...l);
}
return n(c);
}
function o(i) {
const c = Le.get(e);
c && (c.delete(i), c.size || s());
}
function s() {
Le.delete(e);
}
function a(i, c) {
var l;
(l = Le.get(e)) == null || l.forEach((d) => d(i, c));
}
return { on: n, once: r, off: o, emit: a, reset: s };
}
function Np(e, t, n, r = {}) {
var o, s, a;
const {
clone: i = !1,
passive: c = !1,
eventName: l,
deep: d = !1,
defaultValue: f,
shouldEmit: g
} = r, p = rt(), h = n || (p == null ? void 0 : p.emit) || ((o = p == null ? void 0 : p.$emit) == null ? void 0 : o.bind(p)) || ((a = (s = p == null ? void 0 : p.proxy) == null ? void 0 : s.$emit) == null ? void 0 : a.bind(p == null ? void 0 : p.proxy));
let b = l;
t || (t = "modelValue"), b = b || `update:${t.toString()}`;
const m = (T) => i ? typeof i == "function" ? i(T) : vi(T) : T, S = () => oi(e[t]) ? m(e[t]) : f, v = (T) => {
g ? g(T) && h(b, T) : h(b, T);
};
if (c) {
const T = S(), A = B(T);
let P = !1;
return xe(
() => e[t],
(L) => {
P || (P = !0, A.value = m(L), Ut(() => P = !1));
}
), xe(
A,
(L) => {
!P && (L !== e[t] || d) && v(L);
},
{ deep: d }
), A;
} else
return re({
get() {
return S();
},
set(T) {
v(T);
}
});
}
const On = "", wn = `
`;
class D {
/**
* Helper object to format and aggragate lines of code.
* Lines are aggregated in a `code` array, and need to be joined to obtain a proper code snippet.
*/
constructor({ indent: t, join: n } = {}) {
this.postProcessors = [], this.code = [], this.indentationCharacter = On, this.lineJoin = wn, this.indentLine = (r, o = 0) => `${this.indentationCharacter.repeat(o)}${r}`, this.unshift = (r, o) => {
const s = this.indentLine(r, o);
this.code.unshift(s);
}, this.push = (r, o) => {
const s = this.indentLine(r, o);
this.code.push(s);
}, this.blank = () => {
this.code.push("");
}, this.join = () => {
const r = this.code.join(this.lineJoin);
return this.postProcessors.reduce((s, a) => a(s), r);
}, this.addPostProcessor = (r) => {
this.postProcessors = [...this.postProcessors, r];
}, this.indentationCharacter = t || On, this.lineJoin = n ?? wn;
}
}
function Qe(e, t = {}) {
const { delimiter: n = '"', escapeChar: r = "\\", escapeNewlines: o = !0 } = t;
return [...e.toString()].map((a) => a === "\b" ? `${r}b` : a === " " ? `${r}t` : a === `
` ? o ? `${r}n` : a : a === "\f" ? `${r}f` : a === "\r" ? o ? `${r}r` : a : a === r ? r + r : a === n ? r + n : a < " " || a > "~" ? JSON.stringify(a).slice(1, -1) : a).join("");
}
const Mt = (e) => Qe(e, { delimiter: "'" }), V = (e) => Qe(e, { delimiter: '"' }), Ai = {
info: {
key: "libcurl",
title: "Libcurl",
link: "http://curl.haxx.se/libcurl",
description: "Simple REST and HTTP API Client for C"
},
convert: ({ method: e, fullUrl: t, headersObj: n, allHeaders: r, postData: o }) => {
const { push: s, blank: a, join: i } = new D();
s("CURL *hnd = curl_easy_init();"), a(), s(`curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "${e.toUpperCase()}");`), s(`curl_easy_setopt(hnd, CURLOPT_URL, "${t}");`);
const c = Object.keys(n);
return c.length && (a(), s("struct curl_slist *headers = NULL;"), c.forEach((l) => {
s(`headers = curl_slist_append(headers, "${l}: ${V(n[l])}");`);
}), s("curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);")), r.cookie && (a(), s(`curl_easy_setopt(hnd, CURLOPT_COOKIE, "${r.cookie}");`)), o != null && o.text && (a(), s(`curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, ${JSON.stringify(o.text)});`)), a(), s("CURLcode ret = curl_easy_perform(hnd);"), i();
}
};
function M(e, t) {
var f, g, p, h;
const n = new URL((t == null ? void 0 : t.url) ?? ""), r = n.pathname === "/" ? n.origin : n.toString(), o = {
method: (t == null ? void 0 : t.method) ?? "GET",
url: r,
httpVersion: "HTTP/1.1",
cookies: [],
// Cookies are handled through headers
headers: (t == null ? void 0 : t.headers) ?? [],
headersSize: -1,
bodySize: -1,
queryString: Array.from(n.searchParams.entries()).map(([b, m]) => ({
name: b,
value: m
})),
postData: t == null ? void 0 : t.postData
}, s = ((o == null ? void 0 : o.headers) ?? []).reduce((b, m) => ({
...b,
[m.name]: m.value
}), {}), a = (o.queryString ?? []).reduce((b, m) => ({
...b,
[m.name]: m.value
}), {}), i = (o.cookies ?? []).reduce((b, m) => ({
...b,
[m.name]: m.value
}), {}), c = new URL(o.url), l = {
protocol: c.protocol,
hostname: c.hostname,
host: c.hostname,
port: c.port,
pathname: c.pathname.split("/").map((b) => encodeURIComponent(decodeURIComponent(b))).join("/") + c.search,
path: c.pathname.split("/").map((b) => encodeURIComponent(decodeURIComponent(b))).join("/") + c.search,
search: c.search,
hash: c.hash,
href: c.href,
origin: c.origin,
password: c.password,
searchParams: c.searchParams,
username: c.username,
toString: c.toString,
toJSON: () => c.toJSON()
}, d = {
url: o.url,
uriObj: l,
method: ((f = o.method) == null ? void 0 : f.toLocaleUpperCase()) ?? "GET",
httpVersion: o.httpVersion,
cookies: o.cookies ?? [],
headers: o.headers ?? [],
headersSize: o.headersSize,
headersObj: s ?? {},
bodySize: o.bodySize,
queryString: o.queryString ?? [],
postData: o.postData ? {
mimeType: o.postData.mimeType ?? "application/json",
text: o.postData.text ?? "",
params: o.postData.params ?? [],
paramsObj: ((g = o.postData.params) == null ? void 0 : g.reduce((b, m) => (m.name && m.value !== void 0 && (b[m.name] = m.value), b), {})) ?? {}
} : void 0,
allHeaders: s ?? {},
fullUrl: o.url,
queryObj: a ?? {},
cookiesObj: i ?? {}
};
if (((p = d.postData) == null ? void 0 : p.mimeType) === "application/json" && ((h = d.postData) != null && h.text))
try {
d.postData.jsonObj = JSON.parse(d.postData.text);
} catch (b) {
console.error("Error parsing JSON:", b);
}
return typeof e.convert == "function" ? e.convert(d) : "";
}
const Ci = {
target: "c",
client: "libcurl",
title: "Libcurl",
generate(e) {
return M(Ai, e);
}
}, Pi = {
info: {
key: "nethttp",
title: "java.net.http",
link: "https://openjdk.java.net/groups/net/httpclient/intro.html",
description: "Java Standardized HTTP Client API"
},
convert: ({ allHeaders: e, fullUrl: t, method: n, postData: r }, o) => {
const s = {
indent: " ",
...o
}, { push: a, join: i } = new D({ indent: s.indent });
return a("HttpRequest request = HttpRequest.newBuilder()"), a(`.uri(URI.create("${t}"))`, 2), Object.keys(e).forEach((c) => {
a(`.header("${c}", "${V(e[c])}")`, 2);
}), r != null && r.text ? a(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.ofString(${JSON.stringify(r.text)}))`, 2) : a(`.method("${n.toUpperCase()}", HttpRequest.BodyPublishers.noBody())`, 2), a(".build();", 2), a("HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());"), a("System.out.println(response.body());"), i();
}
}, Li = {
target: "java",
client: "nethttp",
title: "java.net.http",
generate(e) {
return M(Pi, e);
}
}, Ii = {
info: {
key: "okhttp",
title: "OkHttp",
link: "http://square.github.io/okhttp/",
description: "An HTTP Request Client Library"
},
convert: ({ postData: e, method: t, fullUrl: n, allHeaders: r }, o) => {
const s = {
indent: " ",
...o
}, { push: a, blank: i, join: c } = new D({ indent: s.indent }), l = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], d = ["POST", "PUT", "DELETE", "PATCH"];
return a("OkHttpClient client = new OkHttpClient();"), i(), e != null && e.text && (e.boundary ? a(`MediaType mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}");`) : a(`MediaType mediaType = MediaType.parse("${e.mimeType}");`), a(`RequestBody body = RequestBody.create(mediaType, ${JSON.stringify(e.text)});`)), a("Request request = new Request.Builder()"), a(`.url("${n}")`, 1), l.includes(t.toUpperCase()) ? d.includes(t.toUpperCase()) ? e != null && e.text ? a(`.${t.toLowerCase()}(body)`, 1) : a(`.${t.toLowerCase()}(null)`, 1) : a(`.${t.toLowerCase()}()`, 1) : e != null && e.text ? a(`.method("${t.toUpperCase()}", body)`, 1) : a(`.method("${t.toUpperCase()}", null)`, 1), Object.keys(r).forEach((f) => {
a(`.addHeader("${f}", "${V(r[f])}")`, 1);
}), a(".build();", 1), i(), a("Response response = client.newCall(request).execute();"), c();
}
}, Bi = {
target: "java",
client: "okhttp",
title: "OkHttp",
generate(e) {
return M(Ii, e);
}
}, Ri = {
info: {
key: "unirest",
title: "Unirest",
link: "http://unirest.io/java.html",
description: "Lightweight HTTP Request Client Library"
},
convert: ({ method: e, allHeaders: t, postData: n, fullUrl: r }, o) => {
const s = {
indent: " ",
...o
}, { join: a, push: i } = new D({ indent: s.indent });
return ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(e.toUpperCase()) ? i(`HttpResponse<String> response = Unirest.${e.toLowerCase()}("${r}")`) : i(`HttpResponse<String> response = Unirest.customMethod("${e.toUpperCase()}","${r}")`), Object.keys(t).forEach((l) => {
i(`.header("${l}", "${V(t[l])}")`, 1);
}), n != null && n.text && i(`.body(${JSON.stringify(n.text)})`, 1), i(".asString();", 1), a();
}
}, Ni = {
target: "java",
client: "unirest",
title: "Unirest",
generate(e) {
return M(Ri, e);
}
}, ae = (e, t) => Object.keys(e).find((n) => n.toLowerCase() === t.toLowerCase()), de = (e, t) => {
const n = ae(e, t);
if (n)
return e[n];
}, cr = (e, t) => !!ae(e, t), Ui = (e) => {
let t = de(e, "accept-encoding");
if (!t)
return [];
const n = {
gzip: "DecompressionMethods.GZip",
deflate: "DecompressionMethods.Deflate"
}, r = [];
return typeof t == "string" && (t = [t]), t.forEach((o) => {
o.split(",").forEach((s) => {
const a = /\s*([^;\s]+)/.exec(s);
if (a) {
const i = n[a[1]];
i && r.push(i);
}
});
}), r;
}, Mi = {
info: {
key: "httpclient",
title: "HttpClient",
link: "https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient",
description: ".NET Standard HTTP Client"
},
convert: ({ allHeaders: e, postData: t, method: n, fullUrl: r }, o) => {
let s, a;
const i = {
indent: " ",
...o
}, { push: c, join: l } = new D({ indent: i.indent });
c("using System.Net.Http.Headers;");
let d = "";
const f = !!e.cookie, g = Ui(e);
(f || g.length) && (d = "clientHandler", c("var clientHandler = new HttpClientHandler"), c("{"), f && c("UseCookies = false,", 1), g.length && c(`AutomaticDecompression = ${g.join(" | ")},`, 1), c("};")), c(`var client = new HttpClient(${d});`), c("var request = new HttpRequestMessage"), c("{");
const p = [
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS",
"TRACE"
];
n = n.toUpperCase(), n && p.includes(n) ? n = `HttpMethod.${n[0]}${n.substring(1).toLowerCase()}` : n = `new HttpMethod("${n}")`, c(`Method = ${n},`, 1), c(`RequestUri = new Uri("${r}"),`, 1);
const h = Object.keys(e).filter((b) => {
switch (b.toLowerCase()) {
case "content-type":
case "content-length":
case "accept-encoding":
return !1;
default:
return !0;
}
});
if (h.length && (c("Headers =", 1), c("{", 1), h.forEach((b) => {
c(`{ "${b}", "${V(e[b])}" },`, 2);
}), c("},", 1)), t != null && t.text) {
const b = t.mimeType;
switch (b) {
case "application/x-www-form-urlencoded":
c("Content = new FormUrlEncodedContent(new Dictionary<string, string>", 1), c("{", 1), (s = t.params) === null || s === void 0 || s.forEach((m) => {
c(`{ "${m.name}", "${m.value}" },`, 2);
}), c("}),", 1);
break;
case "multipart/form-data":
c("Content = new MultipartFormDataContent", 1), c("{", 1), (a = t.params) === null || a === void 0 || a.forEach((m) => {
c(`new StringContent(${JSON.stringify(m.value || "")})`, 2), c("{", 2), c("Headers =", 3), c("{", 3), m.contentType && c(`ContentType = new MediaTypeHeaderValue("${m.contentType}"),`, 4), c('ContentDisposition = new ContentDispositionHeaderValue("form-data")', 4), c("{", 4), c(`Name = "${m.name}",`, 5), m.fileName && c(`FileName = "${m.fileName}",`, 5), c("}", 4), c("}", 3), c("},", 2);
}), c("},", 1);
break;
default:
c(`Content = new StringContent(${JSON.stringify((t == null ? void 0 : t.text) || "")})`, 1), c("{", 1), c("Headers =", 2), c("{", 2), c(`ContentType = new MediaTypeHeaderValue("${b}")`, 3), c("}", 2), c("}", 1);
break;
}
}
return c("};"), c("using (var response = await client.SendAsync(request))"), c("{"), c("response.EnsureSuccessStatusCode();", 1), c("var body = await response.Content.ReadAsStringAsync();", 1), c("Console.WriteLine(body);", 1), c("}"), l();
}
}, Di = {
target: "csharp",
client: "httpclient",
title: "HttpClient",
generate(e) {
return M(Mi, e);
}
}, Hi = {
info: {
key: "restsharp",
title: "RestSharp",
link: "http://restsharp.org/",
description: "Simple REST and HTTP API Client for .NET"
},
convert: ({ allHeaders: e, method: t, fullUrl: n, headersObj: r, cookies: o, postData: s }) => {
const { push: a, join: i } = new D();
if (![
"GET",
"POST",
"PUT",
"DELETE",
"PATCH",
"HEAD",
"OPTIONS"
].includes(t.toUpperCase()))
return "Method not supported";
if (a(`var client = new RestClient("${n}");`), a(`var request = new RestRequest(Method.${t.toUpperCase()});`), Object.keys(r).forEach((l) => {
a(`request.AddHeader("${l}", "${V(r[l])}");`);
}), o == null || o.forEach(({ name: l, value: d }) => {
a(`request.AddCookie("${l}", "${d}");`);
}), s != null && s.text) {
const l = de(e, "content-type"), d = JSON.stringify(s.text);
a(`request.AddParameter("${l}", ${d}, ParameterType.RequestBody);`);
}
return a("IRestResponse response = client.Execute(request);"), i();
}
}, _i = {
target: "csharp",
client: "restsharp",
title: "RestSharp",
generate(e) {
return M(Hi, e);
}
};
class En {
constructor(t) {
this.name = "", this.toString = () => `:${this.name}`, this.name = t;
}
}
let Fi = class {
constructor(t) {
this.path = "", this.toString = () => `(clojure.java.io/file "${this.path}")`, this.path = t;
}
};
const lr = (e) => e === void 0 ? null : e === null ? "null" : e.constructor.name.toLowerCase(), ur = (e) => lr(e) === "object" ? Object.keys(e).length === 0 : !1, xn = (e) => (Object.keys(e).filter((t) => ur(e[t])).forEach((t) => {
delete e[t];
}), e), Ye = (e, t) => {
const n = " ".repeat(e);
return t.replace(/\n/g, `
${n}`);
}, jt = (e) => {
switch (lr(e)) {
case "string":
return `"${e.replace(/"/g, '\\"')}"`;
case "file":
return e.toString();
case "keyword":
return e.toString();
case "null":
return "nil";
case "regexp":
return `#"${e.source}"`;
case "object": {
const t = Object.keys(e).reduce((n, r) => {
const o = Ye(r.length + 2, jt(e[r]));
return `${n}:${r} ${o}
`;
}, "").trim();
return `{${Ye(1, t)}}`;
}
case "array": {
const t = e.reduce((n, r) => `${n} ${jt(r)}`, "").trim();
return `[${Ye(1, t)}]`;
}
default:
return e.toString();
}
}, qi = {
info: {
key: "clj_http",
title: "clj-http",
link: "https://github.com/dakrone/clj-http",
description: "An idiomatic clojure http client wrapping the apache client."
},
convert: ({ queryObj: e, method: t, postData: n, url: r, allHeaders: o }, s) => {
const { push: a, join: i } = new D({
indent: s == null ? void 0 : s.indent
}), c = ["get", "post", "put", "delete", "patch", "head", "options"];
if (t = t.toLowerCase(), !c.includes(t))
return a("Method not supported"), i();
const l = {
headers: o,
"query-params": e
};
switch (e && Object.keys(e).length > 0 && (r = r.split("?")[0]), n == null ? void 0 : n.mimeType) {
case "application/json":
{
l["content-type"] = new En("json"), l["form-params"] = n.jsonObj;
const d = ae(l.headers, "content-type");
d && delete l.headers[d];
}
break;
case "application/x-www-form-urlencoded":
{
l["form-params"] = n.paramsObj;
const d = ae(l.headers, "content-type");
d && delete l.headers[d];
}
break;
case "text/plain":
{
l.body = n.text;
const d = ae(l.headers, "content-type");
d && delete l.headers[d];
}
break;
case "multipart/form-data": {
if (n.params) {
l.multipart = n.params.map((f) => f.fileName && !f.value ? {
name: f.name,
content: new Fi(f.fileName)
} : {
name: f.name,
content: f.value
});
const d = ae(l.headers, "content-type");
d && delete l.headers[d];
}
break;
}
}
switch (de(l.headers, "accept")) {
case "application/json":
{
l.accept = new En("json");
const d = ae(l.headers, "accept");
d && delete l.headers[d];
}
break;
}
if (a(`(require '[clj-http.client :as client])
`), ur(xn(l)))
a(`(client/${t} "${r}")`);
else {
const d = 11 + t.length + r.length, f = Ye(d, jt(xn(l)));
a(`(client/${t} "${r}" ${f})`);
}
return i();
}
}, Vi = {
target: "clojure",
client: "clj_http",
title: "clj-http",
generate(e) {
return M(qi, e);
}
}, Ji = {
target: "dart",
client: "http",
title: "Http",
generate(e, t) {
var p, h, b;
const n = {
method: "GET",
...e
};
n.method = n.method.toUpperCase();
let r = `import 'package:http/http.dart' as http;
void main() async {
`, o = "", s = "";
n.cookies && n.cookies.length > 0 && (s = n.cookies.map((m) => `${encodeURIComponent(m.name)}=${encodeURIComponent(m.value)}`).join("; "), o = ` "Cookie": "${s}",
`);
const a = ((p = n.headers) == null ? void 0 : p.reduce((m, S) => (S.value && !/[; ]/.test(S.name) && (m[S.name] = S.value), m), {})) || {};
if (t != null && t.auth) {
const { username: m, password: S } = t.auth;
if (m && S) {
const v = `${m}:${S}`;
a.Authorization = `'Basic ' + base64Encode(utf8.encode('${v}'))`;
}
}
if (o && (a.Cookie = s), Object.keys(a).length > 0) {
r += ` final headers = <String,String>{
`;
for (const [m, S] of Object.entries(a))
S.includes("utf8.encode") ? r += ` '${m}': ${S},
` : r += ` '${m}': '${S}',
`;
r += ` };
`;
}
const i = (h = n.queryString) != null && h.length ? "?" + n.queryString.map((m) => `${encodeURIComponent(m.name)}=${encodeURIComponent(m.value)}`).join("&") : "", c = `${n.url}${i}`;
let l = "";
if (n.postData)
if (n.postData.mimeType === "application/json")
l = ` final body = r'${n.postData.text}';
`;
else if (n.postData.mimeType === "application/x-www-form-urlencoded")
l = ` final body = '${((b = n.postData.params) == null ? void 0 : b.map((m) => `${encodeURIComponent(m.name)}=${encodeURIComponent(m.value ?? "")}`).join("&")) || ""}';
`;
else if (n.postData.mimeType === "multipart/form-data") {
l = ` final body = <String,String>{
`;
for (const m of n.postData.params || []) {
const S = m.value || "", v = m.fileName || "";
l += ` '${m.name}': '${v || S}',
`;
}
l += ` };
`;
} else n.postData.mimeType === "application/octet-stream" && (l = ` final body = '${n.postData.text}';
`);
l && (r += l);
const d = n.method.toLowerCase(), f = Object.keys(a).length > 0 ? ", headers: headers" : "";
return r += ` final response = await http.${d}(Uri.parse('${c}')${f}${l ? ", body: body" : ""});
`, r += ` print(response.body);
`, r += "}", r;
}
}, Gi = {
info: {
key: "native",
title: "NewRequest",
link: "http://golang.org/pkg/net/http/#NewRequest",
description: "Golang HTTP client request"
},
convert: ({ postData: e, method: t, allHeaders: n, fullUrl: r }, o = {}) => {
const { blank: s, push: a, join: i } = new D({ indent: " " }), { showBoilerplate: c = !0, checkErrors: l = !1, printBody: d = !0, timeout: f = -1, insecureSkipVerify: g = !1 } = o, p = l ? "err" : "_", h = c ? 1 : 0, b = () => {
l && (a("if err != nil {", h), a("panic(err)", h + 1), a("}", h));
};
c && (a("package main"), s(), a("import ("), a('"fmt"', h), f > 0 && a('"time"', h), g && a('"crypto/tls"', h), e != null && e.text && a('"strings"', h), a('"net/http"', h), d && a('"io"', h), a(")"), s(), a("func main() {"), s()), g && (a("insecureTransport := http.DefaultTransport.(*http.Transport).Clone()", h), a("insecureTransport.TLSClientConfig = &tls.Config{InsecureSkipVerify: true}", h));
const m = f > 0, S = m || g, v = S ? "client" : "http.DefaultClient";
return S && (a("client := http.Client{", h), m && a(`Timeout: time.Duration(${f} * time.Second),`, h + 1), g && a("Transport: insecureTransport,", h + 1), a("}", h), s()), a(`url := "${r}"`, h), s(), e != null && e.text ? (a(`payload := strings.NewReader(${JSON.stringify(e.text)})`, h), s(), a(`req, ${p} := http.NewRequest("${t}", url, payload)`, h), s()) : (a(`req, ${p} := http.NewRequest("${t}", url, nil)`, h), s()), b(), Object.keys(n).length && (Object.keys(n).forEach((T) => {
a(`req.Header.Add("${T}", "${V(n[T])}")`, h);
}), s()), a(`res, ${p} := ${v}.Do(req)`, h), b(), d && (s(), a("defer res.Body.Close()", h), a(`body, ${p} := io.ReadAll(res.Body)`, h), b()), s(), a("fmt.Println(res)", h), d && a("fmt.Println(string(body))", h), c && (s(), a("}")), i();
}
}, zi = {
target: "go",
client: "native",
title: "NewRequest",
generate(e) {
return M(Gi, e);
}
}, Wi = {
target: "http",
client: "http1.1",
title: "HTTP/1.1",
generate(e) {
const t = {
method: "GET",
headers: [],
queryString: [],
...e
};
t.method = t.method.toUpperCase();
let n, r;
try {
n = new URL(t.url || "http://"), r = n.pathname + (n.search || "");
} catch {
r = t.url || "/";
}
const o = (n == null ? void 0 : n.hostname) || "UNKNOWN_HOSTNAME";
let s = `${t.method} ${r} HTTP/1.1\r
`;
if (t.queryString.length) {
const c = t.queryString.map((l) => `${encodeURIComponent(l.name)}=${encodeURIComponent(l.value)}`).join("&");
s = `${t.method} ${r}?${c} HTTP/1.1\r
`;
}
const a = /* @__PURE__ */ new Map();
if (a.set("Host", o), t.headers.forEach((c) => {
a.has(c.name) ? a.set(c.name, `${a.get(c.name)}, ${c.value}`) : a.set(c.name, c.value);
}), t.queryString.length) {
const c = t.queryString.map((l) => `${encodeURIComponent(l.name)}=${encodeURIComponent(l.value)}`).join("&");
s = `${t.method} ${r}?${c} HTTP/1.1\r
`;
}
let i = "";
if (t.postData) {
if (t.postData.mimeType === "application/json" && t.postData.text)
a.set("Content-Type", "application/json"), i = t.postData.text;
else if (t.postData.mimeType === "application/octet-stream" && t.postData.text)
a.set("Content-Type", "application/octet-stream"), i = t.postData.text;
else if (t.postData.mimeType === "application/x-www-form-urlencoded" && t.postData.params) {
const c = t.postData.params.map((l) => `${encodeURIComponent(l.name)}=${encodeURIComponent(l.value ?? "")}`).join("&");
a.set("Content-Type", "application/x-www-form-urlencoded"), i = c;
} else if (t.postData.mimeType === "multipart/form-data" && t.postData.params) {
const c = "----WebKitFormBoundary7MA4YWxkTrZu0gW";
a.set("Content-Type", `multipart/form-data; boundary=${c}`), i = t.postData.params.map((l) => l.fileName ? `--${c}\r
Content-Disposition: form-data; name="${l.name}"; filename="${l.fileName}"\r
\r
` : `--${c}\r
Content-Disposition: form-data; name="${l.name}"\r
\r
${l.value}\r
`).join("") + `--${c}--\r
`;
}
}
return a.forEach((c, l) => {
s += `${l}: ${c}\r
`;
}), s += `\r
${i}`, s;
}
}, Yi = {
info: {
key: "asynchttp",
title: "AsyncHttp",
link: "https://github.com/AsyncHttpClient/async-http-client",
description: "Asynchronous Http and WebSocket Client library for Java"
},
convert: ({ method: e, allHeaders: t, postData: n, fullUrl: r }, o) => {
const s = {
indent: " ",
...o
}, { blank: a, push: i, join: c } = new D({ indent: s.indent });
return i("AsyncHttpClient client = new DefaultAsyncHttpClient();"), i(`client.prepare("${e.toUpperCase()}", "${r}")`), Object.keys(t).forEach((l) => {
i(`.setHeader("${l}", "${V(t[l])}")`, 1);
}), n != null && n.text && i(`.setBody(${JSON.stringify(n.text)})`, 1), i(".execute()", 1), i(".toCompletableFuture()", 1), i(".thenAccept(System.out::println)", 1), i(".join();", 1), a(), i("client.close();"), c();
}
}, Ki = {
target: "java",
client: "asynchttp",
title: "AsyncHttp",
generate(e) {
return M(Yi, e);
}
};
function Fe(e) {
return e.reduce((t, n) => (t[n.name] = n.value, t), {});
}
function Qi(e) {
return /\s|-/.test(e);
}
function ie(e, t = 0) {
const n = [], r = " ".repeat(t), o = " ".repeat(t + 2);
for (const [s, a] of Object.entries(e)) {
const i = Qi(s) ? `'${s}'` : s;
if (Array.isArray(a)) {
const c = a.map((l) => typeof l == "string" ? `'${l}'` : l && typeof l == "object" ? ie(l, t + 2) : l).join(`, ${o}`);
n.push(`${o}${i}: [${c}]`);
} else if (a && typeof a == "object")
n.push(`${o}${i}: ${ie(a, t + 2)}`);
else if (typeof a == "string") {
let c = `${a}`;
if (a.startsWith("JSON.stringify")) {
const l = a.split(`
`);
l.length > 1 && (c = l.map((d, f) => f === 0 ? d : `${o}${d}`).join(`
`));
} else
c = `'${a}'`;
n.push(`${o}${i}: ${c}`);
} else
n.push(`${o}${i}: ${a}`);
}
return `{
${n.join(`,
`)}
${r}}`;
}
const Xi = {
target: "js",
client: "fetch",
title: "Fetch",
generate(e) {
var a, i;
const t = {
method: "GET",
...e
};
t.method = t.method.toUpperCase();
const n = {
method: t.method === "GET" ? void 0 : t.method
}, r = new URLSearchParams(t.queryString ? Fe(t.queryString) : void 0), o = r.size ? `?${r.toString()}` : "";
(a = t.headers) != null && a.length && (n.headers = {}, t.headers.forEach((c) => {
n.headers[c.name] = c.value;
})), (i = t.cookies) != null && i.length && (n.headers = n.headers || {}, t.cookies.forEach((c) => {
n.headers["Set-Cookie"] = n.headers["Set-Cookie"] ? `${n.headers["Set-Cookie"]}; ${c.name}=${c.value}` : `${c.name}=${c.value}`;
})), Object.keys(n).forEach((c) => {
n[c] === void 0 && delete n[c];
}), t.postData && (n.body = t.postData.text, t.postData.mimeType === "application/json" && (n.body = `JSON.stringify(${ie(JSON.parse(n.body))})`));
const s = Object.keys(n).length ? `, ${ie(n)}` : "";
return `fetch('${t.url}${o}'${s})`;
}
}, { toString: Zi } = Object.prototype;
function ea(e) {
return Zi.call(e) === "[object RegExp]";
}
function ta(e) {
const t = typeof e;
return e !== null && (t === "object" || t === "function");
}
const { propertyIsEnumerable: na } = Object.prototype;
function ra(e) {
return [
...Object.keys(e),
...Object.getOwnPropertySymbols(e).filter((t) => na.call(e, t))
];
}
function ot(e, t, n) {
const r = [];
return function o(s, a = {}, i = "") {
const c = a.indent || " ";
let l;
a.inlineCharacterLimit === void 0 ? l = {
newline: `
`,
newlineOrSpace: `
`,
pad: i,
indent: i + c
} : l = {
newline: "@@__STRINGIFY_OBJECT_NEW_LINE__@@",
newlineOrSpace: "@@__STRINGIFY_OBJECT_NEW_LINE_OR_SPACE__@@",
pad: "@@__STRINGIFY_OBJECT_PAD__@@",
indent: "@@__STRINGIFY_OBJECT_INDENT__@@"
};
const d = (f) => {
if (a.inlineCharacterLimit === void 0)
return f;
const g = f.replace(new RegExp(l.newline, "g"), "").replace(new RegExp(l.newlineOrSpace, "g"), " ").replace(new RegExp(l.pad + "|" + l.indent, "g"), "");
return g.length <= a.inlineCharacterLimit ? g : f.replace(new RegExp(l.newline + "|" + l.newlineOrSpace, "g"), `
`).replace(new RegExp(l.pad, "g"), i).replace(new RegExp(l.indent, "g"), i + c);
};
if (r.includes(s))
return '"[Circular]"';
if (s == null || typeof s == "number" || typeof s == "boolean" || typeof s == "function" || typeof s == "symbol" || ea(s))
return String(s);
if (s instanceof Date)
return `new Date('${s.toISOString()}')`;
if (Array.isArray(s)) {
if (s.length === 0)
return "[]";
r.push(s);
const f = "[" + l.newline + s.map((g, p) => {
const h = s.length - 1 === p ? l.newline : "," + l.newlineOrSpace;
let b = o(g, a, i + c);
return a.transform && (b = a.transform(s, p, b)), l.indent + b + h;
}).join("") + l.pad + "]";
return r.pop(), d(f);
}
if (ta(s)) {
let f = ra(s);
if (a.filter && (f = f.filter((p) => a.filter(s, p))), f.length === 0)
return "{}";
r.push(s);
const g = "{" + l.newline + f.map((p, h) => {
const b = f.length - 1 === h ? l.newline : "," + l.newlineOrSpace, m = typeof p == "symbol", S = !m && /^[a-z$_][$\w]*$/i.test(p), v = m || S ? p : o(p, a);
let T = o(s[p], a, i + c);
return a.transform && (T = a.transform(s, p, T)), l.indent + String(v) + ": " + T + b;
}).join("") + l.pad + "}";
return r.pop(), d(g);
}
return s = s.replace(/\\/g, "\\\\"), s = String(s).replace(/[\r\n]/g, (f) => f === `
` ? "\\n" : "\\r"), a.singleQuotes === !1 ? (s = s.replace(/"/g, '\\"'), `"${s}"`) : (s = s.replace(/'/g, "\\'"), `'${s}'`);
}(e, t, n);
}
const oa = {
info: {
key: "axios",
title: "Axios",
link: "https://github.com/axios/axios",
description: "Promise based HTTP client for the browser and node.js"
},
convert: ({ allHeaders: e, method: t, url: n, queryObj: r, postData: o }, s) => {
const a = {
indent: " ",
...s
}, { blank: i, push: c, join: l, addPostProcessor: d } = new D({
indent: a.indent
});
c("import axios from 'axios';"), i();
const f = {
method: t,
url: n
};
switch (Object.keys(r).length && (f.params = r), Object.keys(e).length && (f.headers = e), o == null ? void 0 : o.mimeType) {
case "application/x-www-form-urlencoded":
o.params && (c("const encodedParams = new URLSearchParams();"), o.params.forEach((p) => {
c(`encodedParams.set('${p.name}', '${p.value}');`);
}), i(), f.data = "encodedParams,", d((p) => p.replace(/'encodedParams,'/, "encodedParams,")));
break;
case "application/json":
o.jsonObj && (f.data = o.jsonObj);
break;
case "multipart/form-data":
if (!o.params)
break;
c("const form = new FormData();"), o.params.forEach((p) => {
c(`form.append('${p.name}', '${p.value || p.fileName || ""}');`);
}), i(), f.data = "[form]";
break;
default:
o != null && o.text && (f.data = o.text);
}
const g = ot(f, {
indent: " ",
inlineCharacterLimit: 80
}).replace('"[form]"', "form");
return c(`const options = ${g};`), i(), c("try {"), c("const { data } = await axios.request(options);", 1), c("console.log(data);", 1), c("} catch (error) {"), c("console.error(error);", 1), c("}"), l();
}
}, ia = {
target: "js",
client: "axios",
title: "Axios",
generate(e) {
return M(oa, e);
}
}, aa = {
target: "js",
client: "ofetch",
title: "ofetch",
generate(e) {
var s, a;
const t = {
method: "GET",
...e
};
t.method = t.method.toUpperCase();
const n = {
method: t.method === "GET" ? void 0 : t.method
}, r = new URLSearchParams(t.queryString ? Fe(t.queryString) : void 0);
r.size && (n.query = {}, r.forEach((i, c) => {
n.query[c] = i;
})), (s = t.headers) != null && s.length && (n.headers = {}, t.headers.forEach((i) => {
n.headers[i.name] = i.value;
})), (a = t.cookies) != null && a.length && (n.headers = n.headers || {}, t.cookies.forEach((i) => {
n.headers["Set-Cookie"] = n.headers["Set-Cookie"] ? `${n.headers["Set-Cookie"]}; ${i.name}=${i.value}` : `${i.name}=${i.value}`;
})), Object.keys(n).forEach((i) => {
n[i] === void 0 && delete n[i];
}), t.postData && (n.body = t.postData.text, t.postData.mimeType === "application/json" && (n.body = JSON.parse(n.body)));
const o = Object.keys(n).length ? `, ${ie(n)}` : "";
return `import { ofetch } from 'ofetch'
ofetch('${t.url}'${o})`;
}
}, sa = {
info: {
key: "jquery",
title: "jQuery",
link: "http://api.jquery.com/jquery.ajax/",
description: "Perform an asynchronous HTTP (Ajax) requests with jQuery"
},
convert: ({ fullUrl: e, method: t, allHeaders: n, postData: r }, o) => {
let s;
const a = {
indent: " ",
...o
}, { blank: i, push: c, join: l } = new D({ indent: a.indent }), d = {
async: !0,
crossDomain: !0,
url: e,
method: t,
headers: n
};
switch (r == null ? void 0 : r.mimeType) {
case "application/x-www-form-urlencoded":
d.data = r.paramsObj ? r.paramsObj : r.text;
break;
case "application/json":
d.processData = !1, d.data = r.text;
break;
case "multipart/form-data":
if (!r.params)
break;
if (c("const form = new FormData();"), r.params.forEach((g) => {
c(`form.append('${g.name}', '${g.value || g.fileName || ""}');`);
}), d.processData = !1, d.contentType = !1, d.mimeType = "multipart/form-data", d.data = "[form]", cr(n, "content-type") && !((s = de(n, "content-type")) === null || s === void 0) && s.includes("boundary")) {
const g = ae(n, "content-type");
g && delete d.headers[g];
}
i();
break;
default:
r != null && r.text && (d.data = r.text);
}
const f = ot(d, {
indent: a.indent
}).replace("'[form]'", "form");
return c(`const settings = ${f};`), i(), c("$.ajax(settings).done(function (response) {"), c("console.log(response);", 1), c("});"), l();
}
}, ca = {
target: "js",
client: "jquery",
title: "jQuery",
generate(e) {
return M(sa, e);
}
}, la = {
info: {
key: "xhr",
title: "XMLHttpRequest",
link: "https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest",
description: "W3C Standard API that provides scripted client functionality"
},
convert: ({ postData: e, allHeaders: t, method: n, fullUrl: r }, o) => {
let s;
const a = {
indent: " ",
cors: !0,
...o
}, { blank: i, push: c, join: l } = new D({ indent: a.indent });
switch (e == null ? void 0 : e.mimeType) {
case "application/json":
c(`const data = JSON.stringify(${ot(e.jsonObj, {
indent: a.indent
})});`), i();
break;
case "multipart/form-data":
if (!e.params)
break;
if (c("const data = new FormData();"), e.params.forEach((d) => {
c(`data.append('${d.name}', '${d.value || d.fileName || ""}');`);
}), cr(t, "content-type") && !((s = de(t, "content-type")) === null || s === void 0) && s.includes("boundary")) {
const d = ae(t, "content-type");
d && delete t[d];
}
i();
break;
default:
c(`const data = ${e != null && e.text ? `'${e.text}'` : "null"};`), i();
}
return c("const xhr = new XMLHttpRequest();"), a.cors && c("xhr.withCredentials = true;"), i(), c("xhr.addEventListener('readystatechange', function () {"), c("if (this.readyState === this.DONE) {", 1), c("console.log(this.responseText);", 2), c("}", 1), c("});"), i(), c(`xhr.open('${n}', '${r}');`), Object.keys(t).forEach((d) => {
c(`xhr.setRequestHeader('${d}', '${Mt(t[d])}');`);
}), i(), c("xhr.send(data);"), l();
}
}, ua = {
target: "js",
client: "xhr",
title: "XHR",
generate(e) {
return M(la, e);
}
}, da = {
info: {
key: "okhttp",
title: "OkHttp",
link: "http://square.github.io/okhttp/",
description: "An HTTP Request Client Library"
},
convert: ({ postData: e, fullUrl: t, method: n, allHeaders: r }, o) => {
const s = {
indent: " ",
...o
}, { blank: a, join: i, push: c } = new D({ indent: s.indent }), l = ["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD"], d = ["POST", "PUT", "DELETE", "PATCH"];
return c("val client = OkHttpClient()"), a(), e != null && e.text && (e.boundary ? c(`val mediaType = MediaType.parse("${e.mimeType}; boundary=${e.boundary}")`) : c(`val mediaType = MediaType.parse("${e.mimeType}")`), c(`val body = RequestBody.create(mediaType, ${JSON.stringify(e.text)})`)), c("val request = Request.Builder()"), c(`.url("${t}")`, 1), l.includes(n.toUpperCase()) ? d.includes(n.toUpperCase()) ? e != null && e.text ? c(`.${n.toLowerCase()}(body)`, 1) : c(`.${n.toLowerCase()}(null)`, 1) : c(`.${n.toLowerCase()}()`, 1) : e != null && e.text ? c(`.method("${n.toUpperCase()}", body)`, 1) : c(`.method("${n.toUpperCase()}", null)`, 1), Object.keys(r).forEach((f) => {
c(`.addHeader("${f}", "${V(r[f])}")`, 1);
}), c(".build()", 1), a(), c("val response = client.newCall(request).execute()"), i();
}
}, fa = {
target: "kotlin",
client: "okhttp",
title: "OkHttp",
generate(e) {
return M(da, e);
}
}, pa = {
target: "node",
client: "fetch",
title: "Fetch",
generate(e) {
var a, i;
const t = {
method: "GET",
...e
};
t.method = t.method.toUpperCase();
const n = {
method: t.method === "GET" ? void 0 : t.method
}, r = new URLSearchParams(t.queryString ? Fe(t.queryString) : void 0), o = r.size ? `?${r.toString()}` : "";
(a = t.headers) != null && a.length && (n.headers = {}, t.headers.forEach((c) => {
n.headers[c.name] = c.value;
})), (i = t.cookies) != null && i.length && (n.headers = n.headers || {}, t.cookies.forEach((c) => {
n.headers["Set-Cookie"] = n.headers["Set-Cookie"] ? `${n.headers["Set-Cookie"]}; ${c.name}=${c.value}` : `${c.name}=${c.value}`;
})), Object.keys(n).forEach((c) => {
n[c] === void 0 && delete n[c];
}), t.postData && (n.body = t.postData.text, t.postData.mimeType === "application/json" && (n.body = `JSON.stringify(${ie(JSON.parse(n.body))})`));
const s = Object.keys(n).length ? `, ${ie(n)}` : "";
return `fetch('${t.url}${o}'${s})`;
}
}, ga = {
info: {
key: "axios",
title: "Axios",
link: "https://github.com/axios/axios",
description: "Promise based HTTP client for the browser and node.js"
},
convert: ({ method: e, url: t, queryObj: n, allHeaders: r, postData: o }, s) => {
const a = {
indent: " ",
...s
}, { blank: i, join: c, push: l, addPostProcessor: d } = new D({
indent: a.indent
});
l("const axios = require('axios').default;");
const f = {
method: e,
url: t
};
switch (Object.keys(n).length && (f.params = n), Object.keys(r).length && (f.headers = r), o == null ? void 0 : o.mimeType) {
case "application/x-www-form-urlencoded":
o.params && (l("const { URLSearchParams } = require('url');"), i(), l("const encodedParams = new URLSearchParams();"), o.params.forEach((p) => {
l(`encodedParams.set('${p.name}', '${p.value}');`);
}), i(), f.data = "encodedParams,", d((p) => p.replace(/'encodedParams,'/, "encodedParams,")));
break;
case "application/json":
i(), o.jsonObj && (f.data = o.jsonObj);
break;
default:
i(), o != null && o.text && (f.data = o.text);
}
const g = ot(f, {
indent: " ",
inlineCharacterLimit: 80
});
return l(`const options = ${g};`), i(), l("try {"), l("const { data } = await axios.request(options);", 1), l("console.log(data);", 1), l("} catch (error) {"), l("console.error(error);", 1), l("}"), c();
}
}, ha = {
target: "node",
client: "axios",
title: "Axios",
generate(e) {
return M(ga, e);
}
}, ma = {
target: "node",
client: "ofetch",
title: "ofetch",
generate(e) {
var s, a;
const t = {
method: "GET",
...e
};
t.method = t.method.toUpperCase();
const n = {
method: t.method === "GET" ? void 0 : t.method
}, r = new URLSearchParams(t.queryString ? Fe(t.queryString) : void 0);
r.size && (n.query = {}, r.forEach((i, c) => {
n.query[c] = i;
})), (s = t.headers) != null && s.length && (n.headers = {}, t.headers.forEach((i) => {
n.headers[i.name] = i.value;
})), (a = t.cookies) != null && a.length && (n.headers = n.headers || {}, t.cookies.forEach((i) => {
n.headers["Set-Cookie"] = n.headers["Set-Cookie"] ? `${n.headers["Set-Cookie"]}; ${i.name}=${i.value}` : `${i.name}=${i.value}`;
})), Object.keys(n).forEach((i) => {
n[i] === void 0 && delete n[i];
}), t.postData && (n.body = t.postData.text, t.postData.mimeType === "application/json" && (n.body = JSON.parse(n.body)));
const o = Object.keys(n).length ? `, ${ie(n)}` : "";
return `import { ofetch } from 'ofetch'
ofetch('${t.url}'${o})`;
}
}, ya = {
target: "node",
client: "undici",
title: "undici",
generate(e) {
var a, i;
const t = {
method: "GET",
...e
};
t.method = t.method.toUpperCase();
const n = {
method: t.method === "GET" ? void 0 : t.method
}, r = new URLSearchParams(t.queryString ? Fe(t.queryString) : void 0), o = r.size ? `?${r.toString()}` : "";
(a = t.headers) != null && a.length && (n.headers = {}, t.headers.forEach((c) => {
n.headers[c.name] = c.value;
})), (i = t.cookies) != null && i.length && (n.headers = n.headers || {}, t.cookies.forEach((c) => {
n.headers["Set-Cookie"] = n.headers["Set-Cookie"] ? `${n.headers["Set-Cookie"]}; ${c.name}=${c.value}` : `${c.name}=${c.value}`;
})), Object.keys(n).forEach((c) => {
n[c] === void 0 && delete n[c];
}), t.postData && (n.body = t.postData.text, t.postData.mimeType === "application/json" && (n.body = `JSON.stringify(${ie(JSON.parse(n.body))})`));
const s = Object.keys(n).length ? `, ${ie(n)}` : "";
return `import { request } from 'undici'
const { statusCode, body } = await request('${t.url}${o}'${s})`;
}
}, dt = (e, t, n, r) => {
const o = `${e} *${t} = `, s = At(n, r ? o.length : void 0);
return `${o}${s};`;
}, At = (e, t) => {
const n = t === void 0 ? ", " : `,
${" ".repeat(t)}`;
switch (Object.prototype.toString.call(e)) {
case "[object Number]":
return `@${e}`;
case "[object Array]":
return `@[ ${e.map((o) => At(o)).join(n)} ]`;
case "[object Object]": {
const r = [];
for (const o in e)
r.push(`@"${o}": ${At(e[o])}`);
return `@{ ${r.join(n)} }`;
}
case "[object Boolean]":
return e ? "@YES" : "@NO";
default:
return e == null ? "" : `@"${e.toString().replace(/"/g, '\\"')}"`;
}
}, ba = {
info: {
key: "nsurlsession",
title: "NSURLSession",
link: "https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",
description: "Foundation's NSURLSession request"
},
convert: ({ allHeaders: e, postData: t, method: n, fullUrl: r }, o) => {
let s;
const a = {
indent: " ",
pretty: !0,
timeout: 10,
...o
}, { push: i, join: c, blank: l } = new D({ indent: a.indent }), d = {
hasHeaders: !1,
hasBody: !1
};
if (i("#import <Foundation/Foundation.h>"), Object.keys(e).length && (d.hasHeaders = !0, l(), i(dt("NSDictionary", "headers", e, a.pretty))), t && (t.text || t.jsonObj || t.params))
switch (d.hasBody = !0, t.mimeType) {
case "application/x-www-form-urlencoded":
if (!((s = t.params) === null || s === void 0) && s.length) {
l();
const [f, ...g] = t.params;
i(`NSMutableData *postData = [[NSMutableData alloc] initWithData:[@"${f.name}=${f.value}" dataUsingEncoding:NSUTF8StringEncoding]];`), g.forEach(({ name: p, value: h }) => {
i(`[postData appendData:[@"&${p}=${h}" dataUsingEncoding:NSUTF8StringEncoding]];`);
});
} else
d.hasBody = !1;
break;
case "application/json":
t.jsonObj && (i(dt("NSDictionary", "parameters", t.jsonObj, a.pretty)), l(), i("NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];"));
break;
case "multipart/form-data":
i(dt("NSArray", "parameters", t.params || [], a.pretty)), i(`NSString *boundary = @"${t.boundary}";`), l(), i("NSError *error;"), i("NSMutableString *body = [NSMutableString string];"), i("for (NSDictionary *param in parameters) {"), i('[body appendFormat:@"--%@\\r\\n", boundary];', 1), i('if (param[@"fileName"]) {', 1), i('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"; filename=\\"%@\\"\\r\\n", param[@"name"], param[@"fileName"]];', 2), i('[body appendFormat:@"Content-Type: %@\\r\\n\\r\\n", param[@"contentType"]];', 2), i('[body appendFormat:@"%@", [NSString stringWithContentsOfFile:param[@"fileName"] encoding:NSUTF8StringEncoding error:&error]];', 2), i("if (error) {", 2), i('NSLog(@"%@", error);', 3), i("}", 2), i("} else {", 1), i('[body appendFormat:@"Content-Disposition:form-data; name=\\"%@\\"\\r\\n\\r\\n", param[@"name"]];', 2), i('[body appendFormat:@"%@", param[@"value"]];', 2), i("}", 1), i("}"), i('[body appendFormat:@"\\r\\n--%@--\\r\\n", boundary];'), i("NSData *postData = [body dataUsingEncoding:NSUTF8StringEncoding];");
break;
default:
l(), i(`NSData *postData = [[NSData alloc] initWithData:[@"${t.text}" dataUsingEncoding:NSUTF8StringEncoding]];`);
}
return l(), i(`NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"${r}"]`), i(" cachePolicy:NSURLRequestUseProtocolCachePolicy"), i(` timeoutInterval:${a.timeout.toFixed(1)}];`), i(`[request setHTTPMethod:@"${n}"];`), d.hasHeaders && i("[request setAllHTTPHeaderFields:headers];"), d.hasBody && i("[request setHTTPBody:postData];"), l(), i("NSURLSession *session = [NSURLSession sharedSession];"), i("NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request"), i(" completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {"), i(" if (error) {", 1), i(' NSLog(@"%@", error);', 2), i(" } else {", 1), i(" NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;", 2), i(' NSLog(@"%@", httpResponse);', 2), i(" }", 1), i(" }];"), i("[dataTask resume];"), c();
}
}, va = {
target: "objc",
client: "nsurlsession",
title: "NSURLSession",
generate(e) {
return M(ba, e);
}
}, Sa = {
info: {
key: "cohttp",
title: "CoHTTP",
link: "https://github.com/mirage/ocaml-cohttp",
description: "Cohttp is a very lightweight HTTP server using Lwt or Async for OCaml"
},
convert: ({ fullUrl: e, allHeaders: t, postData: n, method: r }, o) => {
const s = {
indent: " ",
...o
}, a = ["get", "post", "head", "delete", "patch", "put", "options"], { push: i, blank: c, join: l } = new D({ indent: s.indent });
i("open Cohttp_lwt_unix"), i("open Cohttp"), i("open Lwt"), c(), i(`let uri = Uri.of_string "${e}" in`);
const d = Object.keys(t);
d.length === 1 ? i(`let headers = Header.add (Header.init ()) "${d[0]}" "${V(t[d[0]])}" in`) : d.length > 1 && (i("let headers = Header.add_list (Header.init ()) ["), d.forEach((h) => {
i(`("${h}", "${V(t[h])}");`, 1);
}), i("] in")), n != null && n.text && i(`let body = Cohttp_lwt_body.of_string ${JSON.stringify(n.text)} in`), c();
const f = d.length ? "~headers " : "", g = n != null && n.text ? "~body " : "", p = a.includes(r.toLowerCase()) ? `\`${r.toUpperCase()}` : `(Code.method_of_string "${r}")`;
return i(`Client.call ${f}${g}${p} uri`), i(">>= fun (res, body_stream) ->"), i("(* Do stuff with the result *)", 1), l();
}
}, $a = {
target: "ocaml",
client: "cohttp",
title: "Cohttp",
generate(e) {
return M(Sa, e);
}
}, ka = {
target: "php",
client: "curl",
title: "cURL",
generate(e, t) {
var a, i, c, l, d;
const n = {
method: "GET",
...e
};
n.method = n.method.toUpperCase();
const r = [], o = (a = n.queryString) != null && a.length ? "?" + n.queryString.map((f) => {
const g = encodeURIComponent(f.name), p = encodeURIComponent(f.value);
return `${g}=${p}`;
}).join("&") : "", s = `${n.url}${o}`;
if (r.push(`$ch = curl_init("${s}");`), r.push(""), n.method === "POST" && r.push("curl_setopt($ch, CURLOPT_POST, true);"), (i = t == null ? void 0 : t.auth) != null && i.username && ((c = t == null ? void 0 : t.auth) != null && c.password) && r.push(`curl_setopt($ch, CURLOPT_USERPWD, '${t.auth.username}:${t.auth.password}');`), (l = n.headers) != null && l.length) {
const f = n.headers.map((p) => `'${p.name}: ${p.value}'`);
r.push(`curl_setopt($ch, CURLOPT_HTTPHEADER, [${f.join(", ")}]);`);
const g = n.headers.find((p) => p.name.toLowerCase() === "accept-encoding");
g && /gzip|deflate/.test(g.value) && r.push("curl_setopt($ch, CURLOPT_ENCODING, '');");
}
if ((d = n.cookies) != null && d.length) {
const f = n.cookies.map((g) => {
const p = encodeURIComponent(g.name), h = encodeURIComponent(g.value);
return `${p}=${h}`;
}).join("; ");
r.push(`curl_setopt($ch, CURLOPT_COOKIE, '${f}');`);
}
if (n.postData) {
if (n.postData.mimeType === "application/json") {
if (n.postData.text)
try {
const f = JSON.parse(n.postData.text), g = Xe(f);
r.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(${g}));`);
} catch {
r.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, '${n.postData.text}');`);
}
} else if (n.postData.mimeType === "multipart/form-data" && n.postData.params) {
const f = n.postData.params.reduce((g, p) => (p.fileName !== void 0 ? g.push(`'${p.name}' => '@${p.fileName}'`) : p.value !== void 0 && g.push(`'${p.name}' => '${p.value}'`), g), []);
r.push("curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: multipart/form-data']);"), r.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, [${f.join(", ")}]);`);
} else if (n.postData.mimeType === "application/x-www-form-urlencoded" && n.postData.params) {
const f = n.postData.params.map((g) => {
const p = encodeURIComponent(g.name), h = g.value ? encodeURIComponent(g.value) : "";
return `${p}=${h}`;
}).join("&");
r.push("curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']);"), r.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, '${f}');`);
} else if (n.postData.mimeType === "application/octet-stream")
r.push("curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/octet-stream']);"), r.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, '${n.postData.text || ""}');`);
else if (n.postData.text)
try {
const f = JSON.parse(n.postData.text), g = Xe(f);
r.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(${g}));`);
} catch {
r.push(`curl_setopt($ch, CURLOPT_POSTFIELDS, '${n.postData.text}');`);
}
}
return r.push(""), r.push("curl_exec($ch);"), r.push(""), r.push("curl_close($ch);"), r.join(`
`).replace(/\n\n\n/g, `
`);
}
};
function ke(e) {
return " ".repeat(e * 2);
}
function Xe(e, t = 0) {
if (e == null)
return "null";
if (typeof e == "string")
return `'${e.replace(/'/g, "\\'")}'`;
if (typeof e == "number" || typeof e == "boolean")
return String(e);
if (Array.isArray(e)) {
if (e.length === 0)
return "[]";
const n = e.map((r) => Xe(r, t + 1)).join(`,
` + ke(t + 1));
return `[
${ke(t + 1)}${n}
${ke(t)}]`;
}
if (typeof e == "object") {
const n = Object.entries(e);
if (n.length === 0)
return "[]";
const r = n.map(([o, s]) => `'${o}' => ${Xe(s, t + 1)}`).join(`,
` + ke(t + 1));
return `[
${ke(t + 1)}${r}
${ke(t)}]`;
}
return "null";
}
const Ta = {
target: "php",
client: "guzzle",
title: "Guzzle",
generate(e, t) {
var a;
if (!e)
return "";
const n = {}, r = (e.method || "GET").toUpperCase(), o = e.url || "";
if (e.headers && Array.isArray(e.headers) && e.headers.length > 0) {
const i = {};
e.headers.forEach((c) => {
i[c.name] === void 0 ? i[c.name] = c.value : Array.isArray(i[c.name]) ? i[c.name].push(c.value) : i[c.name] = [i[c.name], c.value];
}), n.headers = i;
}
if (e.queryString && e.queryString.length > 0) {
const i = {};
e.queryString.forEach((c) => {
i[c.name] = c.value;
}), n.query = i;
}
if (e.cookies && e.cookies.length > 0) {
const i = {};
e.cookies.forEach((c) => {
i[c.name] = c.value;
}), n.cookies = i;
}
if ((a = t == null ? void 0 : t.auth) != null && a.username && t.auth.password && (n.auth = [t.auth.username, t.auth.password]), e.postData)
if (e.postData.mimeType === "application/json")
try {
n.json = JSON.parse(e.postData.text || "{}");
} catch {
n.body = e.postData.text;
}
else if (e.postData.mimeType === "multipart/form-data") {
if (e.postData.params)
n.multipart = e.postData.params.map((i) => ({
name: i.name,
contents: i.fileName ? `fopen('${i.fileName}', 'r')` : i.value || ""
}));
else if (e.postData.text)
try {
n.form_params = JSON.parse(e.postData.text);
} catch {
n.body = e.postData.text;
}
} else if (e.postData.mimeType === "application/x-www-form-urlencoded") {
if (e.postData.params) {
const i = {};
e.postData.params.forEach((c) => {
i[c.name] = c.value || "";
}), n.form_params = i;
}
} else
n.body = e.postData.text;
e.headers && Array.isArray(e.headers) && e.headers.some((i) => i.name === "Accept-Encoding" && i.value.includes("gzip")) && (n.decode_content = !0);
let s = `$client = new GuzzleHttp\\Client();
`;
if (Object.keys(n).length > 0) {
const i = dr(n);
s += `$response = $client->request('${r}', '${o}', ${i});`;
} else
s += `$response = $client->request('${r}', '${o}');`;
return s;
}
};
function dr(e, t = 0) {
if (Object.keys(e).length === 0)
return "[]";
const n = " ".repeat(4);
let r = `[
`;
for (const [o, s] of Object.entries(e)) {
const a = fr(s, t + 1);
r += `${n.repeat(t + 1)}'${o}' => ${a},
`;
}
return r += `${n.repeat(t)}]`, r;
}
function fr(e, t) {
if (e === null)
return "null";
if (typeof e == "boolean")
return e ? "true" : "false";
if (typeof e == "string" && e.startsWith("fopen("))
return e;
if (typeof e == "string")
return `'${e}'`;
if (typeof e == "number")
return e.toString();
if (Array.isArray(e)) {
if (e.length === 0)
return "[]";
const n = " ".repeat(4);
let r = `[
`;
return e.forEach((o) => {
const s = fr(o, t + 1);
r += `${n.repeat(t + 1)}${s},
`;
}), r += `${n.repeat(t)}]`, r;
}
return typeof e == "object" ? dr(e, t) : `'${e}'`;
}
const pr = (e) => ({ method: n, headersObj: r, cookies: o, uriObj: s, fullUrl: a, postData: i, allHeaders: c }) => {
const { push: l, join: d } = new D();
if (!["GET", "POST", "PUT", "DELETE", "PATCH", "HEAD", "OPTIONS"].includes(n.toUpperCase()))
return "Method not supported";
const g = [], p = Object.keys(r);
return p.length && (l("$headers=@{}"), p.forEach((h) => {
h !== "connection" && l(`$headers.Add("${h}", "${Qe(r[h], { escapeChar: "`" })}")`);
}), g.push("-Headers $headers")), o.length && (l("$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession"), o.forEach((h) => {
l("$cookie = New-Object System.Net.Cookie"), l(`$cookie.Name = '${h.name}'`), l(`$cookie.Value = '${h.value}'`), l(`$cookie.Domain = '${s.host}'`), l("$session.Cookies.Add($cookie)");
}), g.push("-WebSession $session")), i != null && i.text && (g.push(`-ContentType '${Qe(de(c, "content-type"), {
delimiter: "'",
escapeChar: "`"
})}'`), g.push(`-Body '${i.text}'`)), l(`$response = ${e} -Uri '${a}' -Method ${n} ${g.join(" ")}`), d();
}, Oa = {
info: {
key: "webrequest",
title: "Invoke-WebRequest",
link: "https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-WebRequest",
description: "Powershell Invoke-WebRequest client"
},
convert: pr("Invoke-WebRequest")
}, wa = {
target: "powershell",
client: "webrequest",
title: "Invoke-WebRequest",
generate(e) {
return M(Oa, e);
}
}, Ea = {
info: {
key: "restmethod",
title: "Invoke-RestMethod",
link: "https://docs.microsoft.com/en-us/powershell/module/Microsoft.PowerShell.Utility/Invoke-RestMethod",
description: "Powershell Invoke-RestMethod client"
},
convert: pr("Invoke-RestMethod")
}, xa = {
target: "powershell",
client: "restmethod",
title: "Invoke-RestMethod",
generate(e) {
return M(Ea, e);
}
}, ja = {
info: {
key: "python3",
title: "http.client",
link: "https://docs.python.org/3/library/http.client.html",
description: "Python3 HTTP Client"
},
convert: ({ uriObj: { path: e, protocol: t, host: n }, postData: r, allHeaders: o, method: s }, a = {}) => {
const { insecureSkipVerify: i = !1 } = a, { push: c, blank: l, join: d } = new D();
c("import http.client"), i && c("import ssl"), l(), t === "https:" ? (c(`conn = http.client.HTTPSConnection("${n}"${i ? ", context = ssl._create_unverified_context()" : ""})`), l()) : (c(`conn = http.client.HTTPConnection("${n}")`), l());
const f = JSON.stringify(r == null ? void 0 : r.text);
f && (c(`payload = ${f}`), l());
const g = o, p = Object.keys(g).length;
if (p === 1)
for (const h in g)
c(`headers = { '${h}': "${V(g[h])}" }`), l();
else if (p > 1) {
let h = 1;
c("headers = {");
for (const b in g)
h++ !== p ? c(` '${b}': "${V(g[b])}",`) : c(` '${b}': "${V(g[b])}"`);
c("}"), l();
}
return c(f && p ? `conn.request("${s}", "${e}", payload, headers)` : f && !p ? `conn.request("${s}", "${e}", payload)` : !f && p ? `conn.request("${s}", "${e}", headers=headers)` : `conn.request("${s}", "${e}")`), l(), c("res = conn.getresponse()"), c("data = res.read()"), l(), c('print(data.decode("utf-8"))'), d();
}
}, Aa = {
target: "python",
client: "python3",
title: "http.client",
generate(e) {
return M(ja, e);
}
}, jn = 40, Ca = {
target: "python",
client: "requests",
title: "Requests",
generate(e, t) {
var i, c, l, d, f, g;
const n = {
url: "https://example.com",
method: "get",
...e
}, r = n.method.toLowerCase(), o = {};
if ((i = n.headers) != null && i.length && (o.headers = n.headers.reduce((p, h) => (h.name in p || (p[h.name] = h.value), p), {})), (c = n.queryString) != null && c.length && (o.params = Object.fromEntries(n.queryString.map((p) => [p.name, p.value]))), (l = n.cookies) != null && l.length && (o.cookies = Object.fromEntries(n.cookies.map((p) => [p.name, p.value]))), (d = t == null ? void 0 : t.auth) != null && d.username && ((f = t == null ? void 0 : t.auth) != null && f.password) && (o.auth = [t.auth.username, t.auth.password]), n.postData) {
const { mimeType: p, text: h, params: b } = n.postData;
if (p === "application/json" && h)
try {
o.json = JSON.parse(h);
} catch {
o.data = h;
}
else if (p === "application/octet-stream" && h)
o.data = h;
else if (p === "multipart/form-data" && b) {
const m = {}, S = {};
b.forEach((v) => {
v.fileName !== void 0 ? m[v.name] = `open("${v.fileName}", "rb")` : v.value !== void 0 && (S[v.name] = v.value);
}), Object.keys(m).length && (o.files = m), Object.keys(S).length && (o.data = S);
} else p === "application/x-www-form-urlencoded" && b && (o.data = Object.fromEntries(b.map((m) => [m.name, m.value])));
}
const s = [], a = `"${n.url}"`;
n.url.length > jn ? s.push(a) : s.push("");
for (const [p, h] of Object.entries(o))
if (p === "auth")
s.push(`${p}=(${JSON.stringify(h[0])}, ${JSON.stringify(h[1])})`);
else if (p === "files") {
const b = JSON.stringify(h).replace(/"open\((.*?)\)"/g, "open($1)").replace(/":open/g, '": open').replace(/\\"/g, '"');
s.push(`${p}=${b}`);
} else if (p === "json") {
const b = JSON.stringify(h, null, 2).split(`
`).map((m, S) => S === 0 ? m : " " + m).join(`
`);
s.push(`${p}=${b}`);
} else if (p === "data" && ((g = n.postData) == null ? void 0 : g.mimeType) === "application/octet-stream")
s.push(`${p}=b"${h}"`);
else {
const b = JSON.stringify(h, null, 2).split(`
`).map((m, S) => S === 0 ? m : " " + m).join(`
`);
s.push(`${p}=${b}`);
}
return n.url.length > jn ? `requests.${r}(
${s.join(`,
`)}
)` : s.length <= 1 ? `requests.${r}(${a})` : `requests.${r}(${a}${s.length > 1 ? "," : ""}
${s.slice(1).join(`,
`)}
)`;
}
}, Pa = {
info: {
key: "httr",
title: "httr",
link: "https://cran.r-project.org/web/packages/httr/vignettes/quickstart.html",
description: "httr: Tools for Working with URLs and HTTP"
},
convert: ({ url: e, queryObj: t, queryString: n, postData: r, allHeaders: o, method: s }, a = {}) => {
let i, c;
const { push: l, blank: d, join: f } = new D({
indent: (i = a.indent) !== null && i !== void 0 ? i : " "
});
l("library(httr)"), d(), l(`url <- "${e}"`), d();
const g = t;
delete t.key;
const p = Object.entries(g), h = p.length;
if (h === 1) {
const O = p[0];
l(`queryString <- list(${O[0]} = "${O[1]}")`), d();
} else h > 1 && (l("queryString <- list("), p.forEach(([O, E], k) => {
const C = k !== h - 1 ? "," : "";
l(`${O} = "${E}"${C}`, 1);
}), l(")"), d());
const b = JSON.stringify(r == null ? void 0 : r.text);
if (b && (l(`payload <- ${b}`), d()), r && (r.text || r.jsonObj || r.params))
switch (r.mimeType) {
case "application/x-www-form-urlencoded":
l('encode <- "form"'), d();
break;
case "application/json":
l('encode <- "json"'), d();
break;
case "multipart/form-data":
l('encode <- "multipart"'), d();
break;
default:
l('encode <- "raw"'), d();
break;
}
const m = de(o, "cookie"), S = de(o, "accept"), v = m ? `set_cookies(\`${String(m).replace(/;/g, '", `').replace(/` /g, "`").replace(/[=]/g, '` = "')}")` : void 0, T = S ? `accept("${V(S)}")` : void 0, A = `content_type("${V((c = r == null ? void 0 : r.mimeType) !== null && c !== void 0 ? c : "application/octet-stream")}")`, P = Object.entries(o).filter(([O]) => !["cookie", "accept", "content-type"].includes(O.toLowerCase())).map(([O, E]) => `'${O}' = '${Mt(E)}'`).join(", "), L = P ? `add_headers(${P})` : void 0;
let N = `response <- VERB("${s}", url`;
b && (N += ", body = payload"), n.length && (N += ", query = queryString");
const U = [L, A, T, v].filter((O) => !!O).join(", ");
return U && (N += `, ${U}`), r && (r.text || r.jsonObj || r.params) && (N += ", encode = encode"), N += ")", l(N), d(), l('content(response, "text")'), f();
}
}, La = {
target: "r",
client: "httr",
title: "httr",
generate(e) {
return M(Pa, e);
}
}, Ia = {
info: {
key: "native",
title: "net::http",
link: "http://ruby-doc.org/stdlib-2.2.1/libdoc/net/http/rdoc/Net/HTTP.html",
description: "Ruby HTTP client"
},
convert: ({ uriObj: e, method: t, fullUrl: n, postData: r, allHeaders: o }, s = {}) => {
const { insecureSkipVerify: a = !1 } = s, { push: i, blank: c, join: l } = new D();
i("require 'uri'"), i("require 'net/http'"), c();
const d = t.toUpperCase(), f = [
"GET",
"POST",
"HEAD",
"DELETE",
"PATCH",
"PUT",
"OPTIONS",
"COPY",
"LOCK",
"UNLOCK",
"MOVE",
"TRACE"
], g = d.charAt(0) + d.substring(1).toLowerCase();
f.includes(d) || (i(`class Net::HTTP::${g} < Net::HTTPRequest`), i(` METHOD = '${d.toUpperCase()}'`), i(` REQUEST_HAS_BODY = '${r != null && r.text ? "true" : "false"}'`), i(" RESPONSE_HAS_BODY = true"), i("end"), c()), i(`url = URI("${n}")`), c(), i("http = Net::HTTP.new(url.host, url.port)"), e.protocol === "https:" && (i("http.use_ssl = true"), a && i("http.verify_mode = OpenSSL::SSL::VERIFY_NONE")), c(), i(`request = Net::HTTP::${g}.new(url)`);
const p = Object.keys(o);
return p.length && p.forEach((h) => {
i(`request["${h}"] = '${Mt(o[h])}'`);
}), r != null && r.text && i(`request.body = ${JSON.stringify(r.text)}`), c(), i("response = http.request(request)"), i("puts response.read_body"), l();
}
}, Ba = {
target: "ruby",
client: "native",
title: "net::http",
generate(e) {
return M(Ia, e);
}
}, Ra = {
target: "shell",
client: "curl",
title: "Curl",
generate(e, t) {
var c, l, d, f, g;
const n = {
method: "GET",
...e
};
n.method = n.method.toUpperCase();
const r = ["curl"], o = (c = n.queryString) != null && c.length ? "?" + n.queryString.map((p) => {
const h = encodeURIComponent(p.name), b = encodeURIComponent(p.value);
return `${h}=${b}`;
}).join("&") : "", s = `${n.url}${o}`, a = /[\s<>[\]{}|\\^%]/.test(s), i = o || a ? `'${s}'` : s;
if (r[0] = `curl ${i}`, n.method !== "GET" && r.push(`--request ${n.method}`), (l = t == null ? void 0 : t.auth) != null && l.username && ((d = t == null ? void 0 : t.auth) != null && d.password) && r.push(`--user '${t.auth.username}:${t.auth.password}'`), (f = n.headers) != null && f.length) {
n.headers.forEach((h) => {
r.push(`--header '${h.name}: ${h.value}'`);
});
const p = n.headers.find((h) => h.name.toLowerCase() === "accept-encoding");
p && /gzip|deflate/.test(p.value) && r.push("--compressed");
}
if ((g = n.cookies) != null && g.length) {
const p = n.cookies.map((h) => {
const b = encodeURIComponent(h.name), m = encodeURIComponent(h.value);
return `${b}=${m}`;
}).join("; ");
r.push(`--cookie '${p}'`);
}
if (n.postData)
if (n.postData.mimeType === "application/json") {
if (n.postData.text)
try {
const p = JSON.parse(n.postData.text), h = JSON.stringify(p, null, 2);
r.push(`--data '${h}'`);
} catch {
r.push(`--data '${n.postData.text}'`);
}
} else if (n.postData.mimeType === "application/octet-stream")
r.push(`--data-binary '${n.postData.text}'`);
else if (n.postData.mimeType === "application/x-www-form-urlencoded" && n.postData.params)
n.postData.params.forEach((p) => {
r.push(`--data-urlencode '${encodeURIComponent(p.name)}=${p.value}'`);
});
else if (n.postData.mimeType === "multipart/form-data" && n.postData.params)
n.postData.params.forEach((p) => {
p.fileName !== void 0 ? r.push(`--form '${p.name}=@${p.fileName}'`) : r.push(`--form '${p.name}=${p.value}'`);
});
else
try {
const p = JSON.parse(n.postData.text ?? ""), h = JSON.stringify(p, null, 2);
r.push(`--data '${h}'`);
} catch {
r.push(`--data '${n.postData.text}'`);
}
return r.join(` \\
`);
}
}, te = (e = "") => /^[a-z0-9-_/.@%^=:]+$/i.test(e) ? e : `'${e.replace(/'/g, "'\\''")}'`, Na = (e) => e.replace(/\r/g, "\\r").replace(/\n/g, "\\n"), Ua = {
info: {
key: "wget",
title: "Wget",
link: "https://www.gnu.org/software/wget/",
description: "a free software package for retrieving files using HTTP, HTTPS"
},
convert: ({ method: e, postData: t, allHeaders: n, fullUrl: r }, o) => {
const s = {
indent: " ",
short: !1,
verbose: !1,
...o
}, { push: a, join: i } = new D({
indent: s.indent,
// @ts-expect-error SEEMS LEGIT
join: s.indent !== !1 ? ` \\
${s.indent}` : " "
});
return s.verbose ? a(`wget ${s.short ? "-v" : "--verbose"}`) : a(`wget ${s.short ? "-q" : "--quiet"}`), a(`--method ${te(e)}`), Object.keys(n).forEach((c) => {
const l = `${c}: ${n[c]}`;
a(`--header ${te(l)}`);
}), t != null && t.text && a(`--body-data ${Na(te(t.text))}`), a(s.short ? "-O" : "--output-document"), a(`- ${te(r)}`), i();
}
}, Ma = {
target: "shell",
client: "wget",
title: "Wget",
generate(e) {
return M(Ua, e);
}
}, Da = {
info: {
key: "httpie",
title: "HTTPie",
link: "http://httpie.org/",
description: "a CLI, cURL-like tool for humans"
},
convert: ({ allHeaders: e, postData: t, queryObj: n, fullUrl: r, method: o, url: s }, a) => {
var h;
const i = {
body: !1,
cert: !1,
headers: !1,
indent: " ",
pretty: !1,
print: !1,
queryParams: !1,
short: !1,
style: !1,
timeout: !1,
verbose: !1,
verify: !1,
...a
}, { push: c, join: l, unshift: d } = new D({
indent: i.indent,
// @ts-expect-error SEEMS LEGIT
join: i.indent !== !1 ? ` \\
${i.indent}` : " "
});
let f = !1;
const g = [];
i.headers && g.push(i.short ? "-h" : "--headers"), i.body && g.push(i.short ? "-b" : "--body"), i.verbose && g.push(i.short ? "-v" : "--verbose"), i.print && g.push(`${i.short ? "-p" : "--print"}=${i.print}`), i.verify && g.push(`--verify=${i.verify}`), i.cert && g.push(`--cert=${i.cert}`), i.pretty && g.push(`--pretty=${i.pretty}`), i.style && g.push(`--style=${i.style}`), i.timeout && g.push(`--timeout=${i.timeout}`), i.queryParams && Object.keys(n).forEach((b) => {
const m = n[b];
Array.isArray(m) ? m.forEach((S) => {
c(`${b}==${te(S)}`);
}) : c(`${b}==${te(m)}`);
}), Object.keys(e).sort().forEach((b) => {
c(`${b}:${te(e[b])}`);
}), (t == null ? void 0 : t.mimeType) === "application/x-www-form-urlencoded" ? (h = t.params) != null && h.length && (g.push(i.short ? "-f" : "--form"), t.params.forEach((b) => {
c(`${b.name}=${te(b.value)}`);
})) : f = !0;
const p = g.length ? `${g.join(" ")} ` : "";
if (s = te(i.queryParams ? s : r), d(`http ${p}${o} ${s}`), f && (t != null && t.text)) {
const b = te(t.text);
d(`echo ${b} | `);
}
return l();
}
}, Ha = {
target: "shell",
client: "httpie",
title: "HTTPie",
generate(e) {
return M(Da, e);
}
}, An = (e, t) => t.repeat(e), Cn = (e, t, n, r) => {
const o = An(r, n), s = An(r - 1, n), a = t ? `,
${o}` : ", ";
return t ? `[
${o}${e.join(a)}
${s}]` : `[${e.join(a)}]`;
}, ft = (e, t, n) => `let ${e} = ${Ct(t, n)}`, Ct = (e, t, n) => {
switch (n = n === void 0 ? 1 : n + 1, Object.prototype.toString.call(e)) {
case "[object Number]":
return e;
case "[object Array]": {
let r = !1;
const o = e.map((s) => (Object.prototype.toString.call(s) === "[object Object]" && (r = Object.keys(s).length > 1), Ct(s, t, n)));
return Cn(o, r, t.indent, n);
}
case "[object Object]": {
const r = [];
for (const o in e)
r.push(`"${o}": ${Ct(e[o], t, n)}`);
return Cn(
r,
// @ts-expect-error needs better types
t.pretty && r.length > 1,
// @ts-expect-error needs better types
t.indent,
n
);
}
case "[object Boolean]":
return e.toString();
default:
return e == null ? "" : `"${e.toString().replace(/"/g, '\\"')}"`;
}
}, _a = {
info: {
key: "nsurlsession",
title: "NSURLSession",
link: "https://developer.apple.com/library/mac/documentation/Foundation/Reference/NSURLSession_class/index.html",
description: "Foundation's NSURLSession request"
},
convert: ({ allHeaders: e, postData: t, fullUrl: n, method: r }, o) => {
let s;
const a = {
indent: " ",
pretty: !0,
timeout: "10",
...o
}, { push: i, blank: c, join: l } = new D({ indent: a.indent }), d = {
hasHeaders: !1,
hasBody: !1
};
if (i("import Foundation"), Object.keys(e).length && (d.hasHeaders = !0, c(), i(ft("headers", e, a))), t && (t.text || t.jsonObj || t.params))
switch (d.hasBody = !0, t.mimeType) {
case "application/x-www-form-urlencoded":
if (c(), !((s = t.params) === null || s === void 0) && s.length) {
const [f, ...g] = t.params;
i(`let postData = NSMutableData(data: "${f.name}=${f.value}".data(using: String.Encoding.utf8)!)`), g.forEach(({ name: p, value: h }) => {
i(`postData.append("&${p}=${h}".data(using: String.Encoding.utf8)!)`);
});
} else
d.hasBody = !1;
break;
case "application/json":
t.jsonObj && (i(`${ft("parameters", t.jsonObj, a)} as [String : Any]`), c(), i("let postData = JSONSerialization.data(withJSONObject: parameters, options: [])"));
break;
case "multipart/form-data":
i(ft("parameters", t.params, a)), c(), i(`let boundary = "${t.boundary}"`), c(), i('var body = ""'), i("var error: NSError? = nil"), i("for param in parameters {"), i('let paramName = param["name"]!', 1), i('body += "--\\(boundary)\\r\\n"', 1), i('body += "Content-Disposition:form-data; name=\\"\\(paramName)\\""', 1), i('if let filename = param["fileName"] {', 1), i('let contentType = param["content-type"]!', 2), i("let fileContent = String(contentsOfFile: filename, encoding: String.Encoding.utf8)", 2), i("if (error != nil) {", 2), i("print(error as Any)", 3), i("}", 2), i('body += "; filename=\\"\\(filename)\\"\\r\\n"', 2), i('body += "Content-Type: \\(contentType)\\r\\n\\r\\n"', 2), i("body += fileContent", 2), i('} else if let paramValue = param["value"] {', 1), i('body += "\\r\\n\\r\\n\\(paramValue)"', 2), i("}", 1), i("}");
break;
default:
c(), i(`let postData = NSData(data: "${t.text}".data(using: String.Encoding.utf8)!)`);
}
return c(), i(`let request = NSMutableURLRequest(url: NSURL(string: "${n}")! as URL,`), i(" cachePolicy: .useProtocolCachePolicy,"), i(
// @ts-expect-error needs better types
` timeoutInterval: ${Number.parseInt(a.timeout, 10).toFixed(1)})`
), i(`request.httpMethod = "${r}"`), d.hasHeaders && i("request.allHTTPHeaderFields = headers"), d.hasBody && i("request.httpBody = postData as Data"), c(), i("let session = URLSession.shared"), i("let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in"), i("if (error != nil) {", 1), i("print(error as Any)", 2), i("} else {", 1), i("let httpResponse = response as? HTTPURLResponse", 2), i("print(httpResponse)", 2), i("}", 1), i("})"), c(), i("dataTask.resume()"), l();
}
}, Fa = {
target: "swift",
client: "nsurlsession",
title: "NSURLSession",
generate(e) {
return M(_a, e);
}
}, pt = [
{
key: "c",
title: "C",
default: "libcurl",
clients: [Ci]
},
{
key: "csharp",
title: "C#",
default: "restsharp",
clients: [Di, _i]
},
{
key: "clojure",
title: "Clojure",
default: "clj_http",
clients: [Vi]
},
{
key: "dart",
title: "Dart",
default: "http",
clients: [Ji]
},
{
key: "go",
title: "Go",
default: "native",
clients: [zi]
},
{
key: "http",
title: "HTTP",
default: "http1.1",
clients: [Wi]
},
{
key: "java",
title: "Java",
default: "unirest",
clients: [Ki, Li, Bi, Ni]
},
{
key: "js",
title: "JavaScript",
default: "fetch",
clients: [Xi, ia, aa, ca, ua]
},
{
key: "kotlin",
title: "Kotlin",
default: "okhttp",
clients: [fa]
},
{
key: "node",
title: "Node.js",
default: "fetch",
clients: [pa, ha, ma, ya]
},
{
key: "objc",
title: "Objective-C",
default: "nsurlsession",
clients: [va]
},
{
key: "ocaml",
title: "OCaml",
default: "cohttp",
clients: [$a]
},
{
key: "php",
title: "PHP",
default: "curl",
clients: [ka, Ta]
},
{
key: "powershell",
title: "Powershell",
default: "webrequest",
clients: [wa, xa]
},
{
key: "python",
title: "Python",
default: "python3",
clients: [Aa, Ca]
},
{
key: "r",
title: "R",
default: "httr",
clients: [La]
},
{
key: "ruby",
title: "Ruby",
default: "native",
clients: [Ba]
},
{
key: "shell",
title: "Shell",
default: "curl",
clients: [Ra, Ma, Ha]
},
{
key: "swift",
title: "Swift",
default: "nsurlsession",
clients: [Fa]
}
];
function qa() {
function e(t, n) {
var r;
return (r = pt.find(({ key: o }) => o === t)) == null ? void 0 : r.clients.find((o) => o.client === n);
}
return {
print(t, n, r) {
var o;
return (o = e(t, n)) == null ? void 0 : o.generate(r);
},
clients() {
return pt;
},
plugins() {
return pt.flatMap(({ key: t, clients: n }) => n.map((r) => ({
target: t,
client: r.client
})));
},
findPlugin: e,
hasPlugin(t, n) {
return !!e(t, n);
}
};
}
function Va(e) {
return e.toLowerCase().match(/^(application|text)\/.*json($|;|\+)/) !== null;
}
function gr(e) {
return e.toLowerCase().match(/^(text|application)\/.*xml($|;|\+)/) !== null;
}
function Dt(e) {
return e.toLowerCase().match(/^application\/x-www-form-urlencoded($|;|\+)/) !== null;
}
function Ht(e) {
return e.toLowerCase().match(/^multipart\/form-data($|;|\+)/) !== null;
}
function Ja(e) {
return e.toLowerCase().match(/^text\/plain($|;|\+)/) !== null;
}
function Ga(e) {
return Va(e) || gr(e) || Dt(e) || Ht(e) || Ja(e) ? !1 : e.toLowerCase().match(/^(application|image|video|audio)\/.*$/) !== null;
}
function za(e) {
const t = {
method: e.method.toUpperCase(),
url: decodeURI(e.url.toString()),
httpVersion: "HTTP/1.1",
headers: Object.entries(e.headers).map(([n, r]) => ({
name: n.replace(/\b\w/g, (o) => o.toUpperCase()),
// Convert to title case.
value: r
})),
queryString: [
...Object.entries(e.query).map(([n, r]) => ({
name: n,
value: r
}))
],
cookies: Object.entries(e.cookies).map(([n, r]) => ({
name: n,
value: r
})),
headersSize: -1,
bodySize: -1
};
if (e.body !== void 0)
if (typeof e.body == "string")
t.postData = {
mimeType: e.contentType || "application/json",
text: e.body
};
else if (e.body instanceof FormData) {
const n = {};
e.body.forEach((r, o) => {
if (r instanceof File)
n[o] = {
type: "file",
text: "BINARY",
name: r.name,
size: r.size,
mimeType: r.type || "application/octet-stream"
};
else {
const s = e.body.getAll(o);
s.length > 1 ? n[o] = s : n[o] = s[0];
}
}), t.postData = {
mimeType: e.contentType || "multipart/form-data",
params: Object.entries(n).map(([r, o]) => typeof o == "object" && o !== null && "text" in o ? {
name: r,
value: o.text,
fileName: o.name,
contentType: o.mimeType
} : {
name: r,
value: String(o)
})
};
} else typeof e.body == "object" && (e.contentType && (Dt(e.contentType) || Ht(e.contentType)) ? t.postData = {
mimeType: e.contentType,
params: Object.entries(e.body).map(([n, r]) => ({
name: n,
value: String(r)
}))
} : t.postData = {
mimeType: e.contentType || "application/json",
text: JSON.stringify(e.body)
});
return t;
}
function qe(e) {
var t, n, r, o, s, a, i;
if ((e == null ? void 0 : e["x-playground-example"]) !== void 0)
return e["x-playground-example"];
if (((t = e == null ? void 0 : e.schema) == null ? void 0 : t["x-playground-example"]) !== void 0)
return e.schema["x-playground-example"];
if ((e == null ? void 0 : e.example) !== void 0)
return e.example;
if (e != null && e.examples && ((n = e == null ? void 0 : e.examples) == null ? void 0 : n.length) > 0)
return e.examples[0];
if (((r = e == null ? void 0 : e.schema) == null ? void 0 : r.example) !== void 0)
return e.schema.example;
if ((o = e == null ? void 0 : e.schema) != null && o.examples && ((a = (s = e == null ? void 0 : e.schema) == null ? void 0 : s.examples) == null ? void 0 : a.length) > 0) {
const c = e.schema.examples[0];
if (c)
return c;
}
return (e == null ? void 0 : e.subexample) !== void 0 ? e.subexample : e != null && e.subexamples && ((i = e == null ? void 0 : e.subexamples) == null ? void 0 : i.length) > 0 ? e.subexamples[0] : null;
}
function hr(e, t = "http://localhost") {
try {
return new URL(e), e;
} catch (n) {
return console.error("Failed to resolve base URL:", n == null ? void 0 : n.message), t;
}
}
class mr {
constructor({
baseUrl: t,
path: n,
url: r,
method: o,
parameters: s,
authorizations: a,
body: i,
variables: c,
headers: l,
query: d,
contentType: f,
cookies: g
}) {
Q(this, "baseUrl");
Q(this, "path");
Q(this, "url");
Q(this, "method");
Q(this, "parameters");
Q(this, "authorizations");
Q(this, "body");
Q(this, "variables");
Q(this, "headers");
Q(this, "query");
Q(this, "contentType");
Q(this, "cookies");
const p = r || (t && n ? new URL(`${t}${n}`) : new URL(at));
this.baseUrl = t, this.path = n, this.url = p, this.method = o, this.parameters = s, this.authorizations = a, this.body = i, this.variables = c || {}, this.headers = l || {}, this.query = d || {}, this.contentType = f, this.cookies = g || {};
}
}
function it(e, t, n) {
const r = new Set(t.map((o) => o.name));
for (const [o, s] of Object.entries(e))
r.has(o) && (s === void 0 || s === "" || n(o, s));
}
function Wa(e, t, n = "") {
let r = n;
return it(e, t, (o, s) => {
r = r.replace(`{${o}}`, s);
}), r;
}
function Ya(e, t, n, r) {
const o = new Headers();
if (e)
if (e instanceof Headers)
for (const [s, a] of e.entries())
o.set(s.toLowerCase(), a);
else
for (const [s, a] of Object.entries(e))
o.set(s.toLowerCase(), a);
return it(t, n, (s, a) => {
o.set(s.toLowerCase(), a);
}), Ka(r).forEach((s, a) => {
o.set(a.toLowerCase(), s);
}), Object.fromEntries(o);
}
function Ka(e) {
const t = new Headers();
if (!e)
return t;
const n = Array.isArray(e) ? e : [e];
if (n.length === 0)
return t;
for (const r of n) {
if (!(r != null && r.type))
continue;
const o = Ce(r.value ?? r.name ?? "");
if (!o) {
console.warn("Empty value for authorization scheme:", r.type);
continue;
}
switch (r.type) {
case "http":
t.set("Authorization", o);
break;
case "apiKey":
(!r.in || r.in === "header") && t.set(r.name ?? "", o);
break;
case "openIdConnect":
case "oauth2":
t.set("Authorization", `Bearer ${o}`);
break;
default:
console.warn("Unknown authorization type:", r.type);
}
}
return t;
}
function Qa(e, t) {
const n = {};
return it(e, t, (r, o) => {
n[r] = o;
}), n;
}
function Xa(e, t) {
const n = {};
return it(e, t, (r, o) => {
n[r] = o;
}), n;
}
function Za(e) {
const t = {};
if (!e)
return t;
const n = Array.isArray(e) ? e : [e];
for (const r of n)
if (r != null && r.type && r.type === "apiKey" && r.in === "query") {
const o = Ce(r.value ?? r.name ?? "");
if (!o)
continue;
const s = r.name ?? "";
if (!s)
continue;
t[s] = o;
}
return t;
}
function es(e) {
const t = {};
if (!e)
return t;
const n = Array.isArray(e) ? e : [e];
for (const r of n)
if (r != null && r.type && r.type === "apiKey" && r.in === "cookie") {
const o = Ce(r.value ?? r.name ?? "");
if (!o)
continue;
const s = r.name ?? "";
if (!s)
continue;
t[s] = o;
}
return t;
}
function ts(e, t) {
return e.forEach((n) => {
if (!n.name || t[n.name] !== void 0)
return;
const r = qe(n);
r != null && (t[n.name] = r);
}), t;
}
function yr({
url: e = void 0,
path: t,
method: n = "GET",
baseUrl: r,
parameters: o = [],
authorizations: s = [],
body: a = void 0,
headers: i = void 0,
variables: c = {},
cookies: l = {},
contentType: d = void 0
}) {
const f = ts(o, c), g = o.filter((L) => L.in === "path"), p = o.filter((L) => L.in === "query"), h = o.filter((L) => L.in === "header"), b = o.filter((L) => L.in === "cookie"), m = Wa(f, g, t), S = (n == null ? void 0 : n.toUpperCase()) || "GET", v = {
...Qa(f, p),
...Za(s)
}, T = Ya(
i,
f,
h,
s
), A = {
...l || {},
...Xa(f, b),
...es(s)
};
r = r ? hr(r) : at;
const P = e ? new URL(e) : r ? new URL(`${r}${m}`) : new URL(m, "http://localhost");
return d && !(a instanceof FormData) ? T["content-type"] = d : a && !T["content-type"] && !(a instanceof FormData) && (T["content-type"] = "application/json"), new mr({
path: m,
url: P,
method: S,
parameters: o,
authorizations: s,
body: [
"POST",
"PUT",
"PATCH",
"DELETE",
"OPTIONS",
"TRACE"
].includes(S) && a ? a : void 0,
variables: f,
headers: T,
query: v,
cookies: A,
contentType: T["content-type"]
});
}
const ns = {
curl: "shell",
javascript: "js",
php: "php",
python: "python"
}, rs = {
curl: "curl",
javascript: "fetch",
php: "curl",
python: "requests"
};
async function br(e, t) {
const n = t instanceof mr ? t : yr(t), r = za(n);
try {
return qa().print(ns[e], rs[e], r) ?? "";
} catch (o) {
return console.error(o, t), "";
}
}
const os = (e) => e !== null && typeof e == "object", is = Array.isArray;
function vr(e) {
const t = nr(e) ? Ce(e) : e;
return os(t) ? is(t) ? as(t) : ss(t) : t;
}
function Sr(e) {
return e !== null && !nr(e) && typeof e == "object" ? vr(e) : Ce(e);
}
function as(e) {
return e.map((t) => Sr(t));
}
function ss(e) {
const t = {};
return Object.keys(e).forEach((n) => {
t[n] = Sr(e[n]);
}), t;
}
const cs = "Response", ls = "Responses", us = "Loading...", ds = "Samples", fs = "Parameters", ps = "Required", gs = "Key", hs = "Value", ms = "Variables", ys = "Type", bs = "Headers", vs = "Schema", Ss = "Authorizations", $s = "Authorization", ks = "Deprecated", Ts = "Body", Os = "License", ws = "Contact", Es = "Servers", xs = "Server", js = "Select...", As = "Operations", Cs = "Default", Ps = "Example", Ls = "Examples", Is = "or", Bs = "Enum", Rs = "Playground", Ns = "Collapse", Us = "Expand", Ms = "Format", Ds = "Maximum", Hs = "Minimum", _s = "Pattern", Fs = {
Response: cs,
Responses: ls,
"Try it out": "Try it out",
Loading: us,
Samples: ds,
"Response time": "Response time",
Parameters: fs,
"Path Parameters": "Path Parameters",
"Query Parameters": "Query Parameters",
Required: ps,
Key: gs,
Value: hs,
Variables: ms,
"Powered by": "Powered by",
Type: ys,
"Header Parameters": "Header Parameters",
Headers: bs,
"Request Body": "Request Body",
Schema: vs,
JSON: "JSON",
Authorizations: Ss,
Authorization: $s,
"Use example": "Use example",
Deprecated: ks,
Body: Ts,
"Terms of Service": "Terms of Service",
License: Os,
Contact: ws,
"API Documentation": "API Documentation",
"External Documentation": "External Documentation",
Servers: Es,
Server: xs,
"Your browser does not support the audio element.": "Your browser does not support the audio element.",
"Unrecognized response type. Raw content:": "Unrecognized response type. Raw content:",
"Download file": "Download file",
Select: js,
"operation.badgePrefix.operationId": "ID: ",
"Content-Type": "Content-Type",
"Hide operations": "Hide operations",
"Show operations": "Show operations",
Operations: As,
Default: Cs,
Example: Ps,
Examples: Ls,
"tags.goTo": "View {tag} operations",
or: Is,
Enum: Bs,
"Copy endpoint": "Copy endpoint",
"Custom Server": "Custom Server",
"Enter a custom server URL": "Enter a custom server URL",
"Select a server": "Select a server...",
Playground: Rs,
"Collapse all": "Collapse all",
"Expand all": "Expand all",
Collapse: Ns,
Expand: Us,
"Download OpenAPI Document": "Download OpenAPI Document",
"Any of": "Any of",
"Valid values": "Valid values",
"Exclusive Maximum": "Exclusive Maximum",
"Exclusive Minimum": "Exclusive Minimum",
Format: Ms,
Maximum: Ds,
"Max Items": "Max Items",
"Max Length": "Max Length",
"Max Properties": "Max Properties",
Minimum: Hs,
"Min Items": "Min Items",
"Min Length": "Min Length",
"Min Properties": "Min Properties",
"Multiple of": "Multiple of",
Pattern: _s,
"Unique Items": "Unique Items"
}, qs = "Respuesta", Vs = "Respuestas", Js = "Cargando...", Gs = "Ejemplos", zs = "Parámetros", Ws = "Requerido", Ys = "Key", Ks = "Value", Qs = "Variables", Xs = "Tipo", Zs = "Headers", ec = "Schema", tc = "Autorizaciones", nc = "Autorización", rc = "Obsoleto", oc = "Cuerpo", ic = "Licencia", ac = "Contacto", sc = "Servidores", cc = "Servidor", lc = "Seleccionar...", uc = "Operaciones", dc = "Por defecto", fc = "Ejemplo", pc = "Ejemplos", gc = "o", hc = "Enum", mc = "Playground", yc = "Colapsar", bc = "Expandir", vc = "Formato", Sc = "Máximo", $c = "Mínimo", kc = "Patrón", Tc = {
Response: qs,
Responses: Vs,
"Try it out": "Probar",
Loading: Js,
Samples: Gs,
"Response time": "Tiempo de respuesta",
Parameters: zs,
"Path Parameters": "Path Parameters",
"Query Parameters": "Query Parameters",
Required: Ws,
Key: Ys,
Value: Ks,
Variables: Qs,
"Powered by": "Powered by",
Type: Xs,
"Header Parameters": "Header Parameters",
Headers: Zs,
"Request Body": "Cuerpo de la petición",
Schema: ec,
JSON: "JSON",
Authorizations: tc,
Authorization: nc,
"Use example": "Usar ejemplo",
Deprecated: rc,
Body: oc,
"Terms of Service": "Términos de servicio",
License: ic,
Contact: ac,
"API Documentation": "Documentación de la API",
"External Documentation": "Documentación externa",
Servers: sc,
Server: cc,
"Your browser does not support the audio element.": "Tu navegador no soporta el elemento de audio.",
"Unrecognized response type. Raw content:": "Tipo de respuesta no reconocido. Contenido en crudo:",
"Download file": "Descargar archivo",
Select: lc,
"operation.badgePrefix.operationId": "ID: ",
"Content-Type": "Content-Type",
"Hide operations": "Ocultar operaciones",
"Show operations": "Mostrar operaciones",
Operations: uc,
Default: dc,
Example: fc,
Examples: pc,
"tags.goTo": "Ver operaciones de {tag}",
or: gc,
Enum: hc,
"Copy endpoint": "Copiar endpoint",
"Custom Server": "Servidor personalizado",
"Enter a custom server URL": "Introduce una URL de servidor personalizada",
"Select a server": "Selecciona un servidor...",
Playground: mc,
"Collapse all": "Colapsar todo",
"Expand all": "Expandir todo",
Collapse: yc,
Expand: bc,
"Download OpenAPI Document": "Descargar Documento OpenAPI",
"Any of": "Cualquiera de",
"Valid values": "Valores válidos",
"Exclusive Maximum": "Máximo exclusivo",
"Exclusive Minimum": "Mínimo exclusivo",
Format: vc,
Maximum: Sc,
"Max Items": "Máx. elementos",
"Max Length": "Longitud máx.",
"Max Properties": "Máx. propiedades",
Minimum: $c,
"Min Items": "Mín. elementos",
"Min Length": "Longitud mín.",
"Min Properties": "Mín. propiedades",
"Multiple of": "Múltiplo de",
Pattern: kc,
"Unique Items": "Elementos únicos"
}, Oc = "レスポンス", wc = "レスポンス", Ec = "Loading...", xc = "サンプル", jc = "パラメータ", Ac = "必須", Cc = "キー", Pc = "値", Lc = "変数", Ic = "型", Bc = "ヘッダー", Rc = "スキーマ", Nc = "認証", Uc = "認証", Mc = "非推奨", Dc = "ボディ", Hc = "ライセンス", _c = "連絡先", Fc = "サーバー", qc = "サーバー", Vc = "選択...", Jc = "オペレーション", Gc = "デフォルト", zc = "例", Wc = "例", Yc = "or", Kc = "Enum", Qc = "Playground", Xc = "折りたたむ", Zc = "展開", el = "フォーマット", tl = "最大値", nl = "最小値", rl = "パターン", ol = {
Response: Oc,
Responses: wc,
"Try it out": "実行",
Loading: Ec,
Samples: xc,
"Response time": "応答時間",
Parameters: jc,
"Path Parameters": "パスパラメータ",
"Query Parameters": "クエリパラメータ",
Required: Ac,
Key: Cc,
Value: Pc,
Variables: Lc,
"Powered by": "Powered by",
Type: Ic,
"Header Parameters": "ヘッダーパラメータ",
Headers: Bc,
"Request Body": "リクエストボディ",
Schema: Rc,
JSON: "JSON",
Authorizations: Nc,
Authorization: Uc,
"Use example": "例を使用",
Deprecated: Mc,
Body: Dc,
"Terms of Service": "利用規約",
License: Hc,
Contact: _c,
"API Documentation": "API ドキュメント",
"External Documentation": "外部ドキュメント",
Servers: Fc,
Server: qc,
"Your browser does not support the audio element.": "ブラウザがオーディオ要素をサポートしていません。",
"Unrecognized response type. Raw content:": "認識できないレスポンスタイプ。生のコンテンツ:",
"Download file": "ファイルをダウンロード",
Select: Vc,
"operation.badgePrefix.operationId": "ID: ",
"Content-Type": "Content-Type",
"Hide operations": "オペレーションを隠す",
"Show operations": "オペレーションを表示",
Operations: Jc,
Default: Gc,
Example: zc,
Examples: Wc,
"tags.goTo": "{tag}のオペレーションを表示",
or: Yc,
Enum: Kc,
"Copy endpoint": "エンドポイントをコピー",
"Custom Server": "カスタムサーバー",
"Enter a custom server URL": "カスタムサーバーの URL を入力",
"Select a server": "サーバーを選択...",
Playground: Qc,
"Collapse all": "すべて折りたたむ",
"Expand all": "すべて展開",
Collapse: Xc,
Expand: Zc,
"Download OpenAPI Document": "OpenAPI ドキュメントをダウンロード",
"Any of": "いずれか",
"Valid values": "有効な値",
"Exclusive Maximum": "排他的最大値",
"Exclusive Minimum": "排他的最小値",
Format: el,
Maximum: tl,
"Max Items": "最大項目数",
"Max Length": "最大長",
"Max Properties": "最大プロパティ数",
Minimum: nl,
"Min Items": "最小項目数",
"Min Length": "最小長",
"Min Properties": "最小プロパティ数",
"Multiple of": "の倍数",
Pattern: rl,
"Unique Items": "ユニーク項目"
}, il = "Resposta", al = "Respostas", sl = "Carregando...", cl = "Exemplos", ll = "Parâmetros", ul = "Obrigatório", dl = "Chave", fl = "Valor", pl = "Variáveis", gl = "Tipo", hl = "Cabeçalhos", ml = "Esquema", yl = "Autorizações", bl = "Autorização", vl = "Obsoleto", Sl = "Corpo", $l = "Licença", kl = "Contato", Tl = "Servidores", Ol = "Servidor", wl = "Selecionar...", El = "Operações", xl = "Padrão", jl = "Exemplo", Al = "Exemplos", Cl = "ou", Pl = "Enum", Ll = "Playground", Il = "Recolher", Bl = "Expandir", Rl = "Formato", Nl = "Máximo", Ul = "Mínimo", Ml = "Padrão", Dl = {
Response: il,
Responses: al,
"Try it out": "Testar",
Loading: sl,
Samples: cl,
"Response time": "Tempo de resposta",
Parameters: ll,
"Path Parameters": "Parâmetros de Caminho",
"Query Parameters": "Parâmetros de Consulta",
Required: ul,
Key: dl,
Value: fl,
Variables: pl,
"Powered by": "Desenvolvido por",
Type: gl,
"Header Parameters": "Parâmetros de Cabeçalho",
Headers: hl,
"Request Body": "Corpo da Requisição",
Schema: ml,
JSON: "JSON",
Authorizations: yl,
Authorization: bl,
"Use example": "Usar exemplo",
Deprecated: vl,
Body: Sl,
"Terms of Service": "Termos de Serviço",
License: $l,
Contact: kl,
"API Documentation": "Documentação da API",
"External Documentation": "Documentação Externa",
Servers: Tl,
Server: Ol,
"Your browser does not support the audio element.": "Seu navegador não suporta o elemento de áudio.",
"Unrecognized response type. Raw content:": "Tipo de resposta não reconhecido. Conteúdo bruto:",
"Download file": "Baixar arquivo",
Select: wl,
"operation.badgePrefix.operationId": "ID: ",
"Content-Type": "Content-Type",
"Hide operations": "Ocultar operações",
"Show operations": "Exibir operações",
Operations: El,
Default: xl,
Example: jl,
Examples: Al,
"tags.goTo": "Ver operações de {tag}",
or: Cl,
Enum: Pl,
"Copy endpoint": "Copiar endpoint",
"Custom Server": "Servidor Personalizado",
"Enter a custom server URL": "Digite uma URL de servidor personalizada",
"Select a server": "Selecione um servidor...",
Playground: Ll,
"Collapse all": "Recolher tudo",
"Expand all": "Expandir tudo",
Collapse: Il,
Expand: Bl,
"Download OpenAPI Document": "Baixar Documento OpenAPI",
"Any of": "Qualquer um dos",
"Valid values": "Valores válidos",
"Exclusive Maximum": "Máximo exclusivo",
"Exclusive Minimum": "Mínimo exclusivo",
Format: Rl,
Maximum: Nl,
"Max Items": "Máx. itens",
"Max Length": "Comp. máx.",
"Max Properties": "Máx. propriedades",
Minimum: Ul,
"Min Items": "Mín. itens",
"Min Length": "Comp. mín.",
"Min Properties": "Mín. propriedades",
"Multiple of": "Múltiplo de",
Pattern: Ml,
"Unique Items": "Itens únicos"
}, Hl = "响应", _l = "响应", Fl = "加载中...", ql = "示例", Vl = "参数", Jl = "必填", Gl = "键", zl = "值", Wl = "变量", Yl = "类型", Kl = "请求头", Ql = "模式", Xl = "授权", Zl = "授权", eu = "已弃用", tu = "主体", nu = "许可证", ru = "联系方式", ou = "服务器", iu = "服务器", au = "选择...", su = "操作", cu = "默认", lu = "示例", uu = "示例", du = "或", fu = "枚举", pu = "试验场", gu = "折叠", hu = "展开", mu = "格式", yu = "最大值", bu = "最小值", vu = "模式", Su = {
Response: Hl,
Responses: _l,
"Try it out": "试一试",
Loading: Fl,
Samples: ql,
"Response time": "响应时间",
Parameters: Vl,
"Path Parameters": "路径参数",
"Query Parameters": "查询参数",
Required: Jl,
Key: Gl,
Value: zl,
Variables: Wl,
"Powered by": "技术支持",
Type: Yl,
"Header Parameters": "请求头参数",
Headers: Kl,
"Request Body": "请求体",
Schema: Ql,
JSON: "JSON",
Authorizations: Xl,
Authorization: Zl,
"Use example": "使用示例",
Deprecated: eu,
Body: tu,
"Terms of Service": "服务条款",
License: nu,
Contact: ru,
"API Documentation": "API 文档",
"External Documentation": "外部文档",
Servers: ou,
Server: iu,
"Your browser does not support the audio element.": "您的浏览器不支持音频元素。",
"Unrecognized response type. Raw content:": "无法识别的响应类型。原始内容:",
"Download file": "下载文件",
Select: au,
"operation.badgePrefix.operationId": "ID: ",
"Content-Type": "Content-Type",
"Hide operations": "隐藏操作",
"Show operations": "显示操作",
Operations: su,
Default: cu,
Example: lu,
Examples: uu,
"tags.goTo": "查看 {tag} 操作",
or: du,
Enum: fu,
"Copy endpoint": "复制端点",
"Custom Server": "自定义服务器",
"Enter a custom server URL": "输入自定义服务器 URL",
"Select a server": "选择服务器...",
Playground: pu,
"Collapse all": "全部折叠",
"Expand all": "全部展开",
Collapse: gu,
Expand: hu,
"Download OpenAPI Document": "下载 OpenAPI 文档",
"Any of": "任意一个",
"Valid values": "有效值",
"Exclusive Maximum": "独占最大值",
"Exclusive Minimum": "独占最小值",
Format: mu,
Maximum: yu,
"Max Items": "最大项数",
"Max Length": "最大长度",
"Max Properties": "最大属性数",
Minimum: bu,
"Min Items": "最小项数",
"Min Length": "最小长度",
"Min Properties": "最小属性数",
"Multiple of": "倍数",
Pattern: vu,
"Unique Items": "唯一项"
}, $u = {
en: Fs,
es: Tc,
ja: ol,
"pt-BR": Dl,
zh: Su
};
function q(e, t) {
return e[t] || (e[t] = {}), e[t];
}
function I(e, t, n, r) {
const o = q(e, t);
return o[n] ? r !== void 0 && (o[n].value = r) : o[n] = B(r), o[n];
}
function ee(e, t, n, r) {
let o = e;
for (const s of t)
o = q(o, s);
return o[n] ? r !== void 0 && (o[n].value = r) : o[n] = B(r), o[n];
}
const ku = [
"header",
"path",
"description",
"security",
"parameters",
"request-body",
"responses",
"playground",
"code-samples",
"branding",
"footer"
], at = "http://localhost", _t = [
{
lang: "curl",
label: "cURL",
highlighter: "bash",
icon: "curl"
},
{
lang: "javascript",
label: "JavaScript",
highlighter: "javascript",
icon: ".js"
},
{
lang: "php",
label: "PHP",
highlighter: "php",
icon: ".php"
},
{
lang: "python",
label: "Python",
highlighter: "python",
icon: ".py"
}
], Pn = "/operations/", j = {
theme: {
highlighterTheme: {
light: ei,
dark: Zo
}
},
path: {
showBaseURL: !1
},
requestBody: {
defaultView: "contentType"
},
jsonViewer: {
deep: Number.POSITIVE_INFINITY,
renderer: "vue-json-pretty"
},
schemaViewer: {
deep: 1
},
headingLevels: {
h1: 1,
h2: 2,
h3: 3,
h4: 4,
h5: 5,
h6: 6
},
response: {
responseCodeSelector: "tabs",
maxTabs: 5,
body: {
defaultView: "contentType"
}
},
playground: {
jsonEditor: {
mode: "tree",
mainMenuBar: !1,
navigationBar: !1,
statusBar: !1
}
},
security: {
defaultScheme: null
},
operation: {
badges: ["deprecated"],
slots: ku,
hiddenSlots: [],
cols: 2,
defaultBaseUrl: at,
getServers: null
},
i18n: {
locale: "en",
fallbackLocale: "en",
messages: $u,
availableLocales: [
{
code: "en",
label: "English"
},
{
code: "es",
label: "Español"
},
{
code: "ja",
label: "Japanese"
},
{
code: "pt-BR",
label: "Português (Brasil)"
},
{
code: "zh",
label: "中文"
}
]
},
spec: {
groupByTags: !0,
collapsePaths: !1,
showPathsSummary: !0,
avoidCirculars: !1,
lazyRendering: !1,
defaultTag: "Default",
defaultTagDescription: "",
wrapExamples: !0,
disableDownload: !1
},
codeSamples: {
langs: [
"curl",
"javascript",
"php",
"python"
],
defaultLang: "curl",
availableLanguages: _t,
generator: (e, t) => br(e, t),
defaultHeaders: {}
},
linksPrefixes: {
tags: "/tags/",
operations: Pn
},
server: {
allowCustomServer: !1,
getServers: null
},
markdown: {
operationLink: {
linkPrefix: Pn
},
externalLinksNewTab: !1,
config: void 0
}
}, y = {
theme: {
highlighterTheme: {
light: j.theme.highlighterTheme.light,
dark: j.theme.highlighterTheme.dark
}
},
path: {
showBaseURL: B(j.path.showBaseURL)
},
requestBody: {
defaultView: B(j.requestBody.defaultView)
},
jsonViewer: {
deep: B(j.jsonViewer.deep),
renderer: B(j.jsonViewer.renderer)
},
schemaViewer: {
deep: B(j.schemaViewer.deep)
},
headingLevels: {
...j.headingLevels
},
response: {
responseCodeSelector: B(j.response.responseCodeSelector),
maxTabs: B(j.response.maxTabs),
body: {
defaultView: B(j.response.body.defaultView)
}
},
playground: {
jsonEditor: {
mode: B(j.playground.jsonEditor.mode),
mainMenuBar: B(j.playground.jsonEditor.mainMenuBar),
navigationBar: B(j.playground.jsonEditor.navigationBar),
statusBar: B(j.playground.jsonEditor.statusBar)
}
},
security: {
defaultScheme: B(j.security.defaultScheme)
},
operation: {
badges: B(j.operation.badges),
slots: B(j.operation.slots),
hiddenSlots: B(j.operation.hiddenSlots),
cols: B(j.operation.cols),
defaultBaseUrl: j.operation.defaultBaseUrl,
getServers: j.operation.getServers
},
i18n: {
locale: B(j.i18n.locale),
fallbackLocale: B(j.i18n.fallbackLocale),
messages: j.i18n.messages,
availableLocales: j.i18n.availableLocales
},
spec: {
groupByTags: B(j.spec.groupByTags),
collapsePaths: B(j.spec.collapsePaths),
showPathsSummary: B(j.spec.showPathsSummary),
avoidCirculars: B(j.spec.avoidCirculars),
lazyRendering: B(j.spec.lazyRendering),
defaultTag: j.spec.defaultTag,
defaultTagDescription: j.spec.defaultTagDescription,
wrapExamples: j.spec.wrapExamples,
disableDownload: B(j.spec.disableDownload)
},
codeSamples: {
langs: j.codeSamples.langs,
defaultLang: j.codeSamples.defaultLang,
availableLanguages: j.codeSamples.availableLanguages,
generator: j.codeSamples.generator,
defaultHeaders: j.codeSamples.defaultHeaders
},
linksPrefixes: {
tags: j.linksPrefixes.tags,
operations: j.linksPrefixes.operations
},
server: {
allowCustomServer: j.server.allowCustomServer,
getServers: j.server.getServers
},
markdown: {
operationLink: {
linkPrefix: j.markdown.operationLink.linkPrefix
},
externalLinksNewTab: j.markdown.externalLinksNewTab,
config: j.markdown.config
}
}, Tu = ji({
storageKey: "vitepress-theme-appearance"
});
function Ou(e = {}) {
t(e);
function t(u) {
var $, R, K, Pe, $e, tn, nn, rn, on, an, sn, cn, ln, un, dn, fn, pn, gn, hn, mn, yn, bn, vn, Sn, $n;
!u || !Object.keys(u).length || (($ = u.theme) != null && $.highlighterTheme && i(u.theme.highlighterTheme), ((R = u.path) == null ? void 0 : R.showBaseURL) !== void 0 && I(y, "path", "showBaseURL", u.path.showBaseURL), ((K = u.requestBody) == null ? void 0 : K.defaultView) !== void 0 && I(y, "requestBody", "defaultView", u.requestBody.defaultView), ((Pe = u.jsonViewer) == null ? void 0 : Pe.deep) !== void 0 && I(y, "jsonViewer", "deep", u.jsonViewer.deep), (($e = u.jsonViewer) == null ? void 0 : $e.renderer) !== void 0 && I(y, "jsonViewer", "renderer", u.jsonViewer.renderer), ((tn = u.schemaViewer) == null ? void 0 : tn.deep) !== void 0 && I(y, "schemaViewer", "deep", u.schemaViewer.deep), u.headingLevels !== void 0 && A(u.headingLevels), ((nn = u.response) == null ? void 0 : nn.responseCodeSelector) !== void 0 && I(y, "response", "responseCodeSelector", u.response.responseCodeSelector), ((rn = u.response) == null ? void 0 : rn.maxTabs) !== void 0 && I(y, "response", "maxTabs", u.response.maxTabs), ((an = (on = u.response) == null ? void 0 : on.body) == null ? void 0 : an.defaultView) !== void 0 && ee(y, ["response", "body"], "defaultView", u.response.body.defaultView), ((cn = (sn = u.playground) == null ? void 0 : sn.jsonEditor) == null ? void 0 : cn.mode) !== void 0 && ee(y, ["playground", "jsonEditor"], "mode", u.playground.jsonEditor.mode), ((un = (ln = u.playground) == null ? void 0 : ln.jsonEditor) == null ? void 0 : un.mainMenuBar) !== void 0 && ee(y, ["playground", "jsonEditor"], "mainMenuBar", u.playground.jsonEditor.mainMenuBar), ((fn = (dn = u.playground) == null ? void 0 : dn.jsonEditor) == null ? void 0 : fn.navigationBar) !== void 0 && ee(y, ["playground", "jsonEditor"], "navigationBar", u.playground.jsonEditor.navigationBar), ((gn = (pn = u.playground) == null ? void 0 : pn.jsonEditor) == null ? void 0 : gn.statusBar) !== void 0 && ee(y, ["playground", "jsonEditor"], "statusBar", u.playground.jsonEditor.statusBar), ((hn = u.security) == null ? void 0 : hn.defaultScheme) !== void 0 && I(y, "security", "defaultScheme", u.security.defaultScheme), ((mn = u.operation) == null ? void 0 : mn.badges) !== void 0 && I(y, "operation", "badges", u.operation.badges), ((yn = u.operation) == null ? void 0 : yn.slots) !== void 0 && I(y, "operation", "slots", u.operation.slots), ((bn = u.operation) == null ? void 0 : bn.hiddenSlots) !== void 0 && I(y, "operation", "hiddenSlots", u.operation.hiddenSlots), ((vn = u.operation) == null ? void 0 : vn.cols) !== void 0 && I(y, "operation", "cols", u.operation.cols), ((Sn = u.operation) == null ? void 0 : Sn.defaultBaseUrl) !== void 0 && Eo(u.operation.defaultBaseUrl), (($n = u.operation) == null ? void 0 : $n.getServers) !== void 0 && jo(u.operation.getServers), u.i18n !== void 0 && Wt(u.i18n), u.spec !== void 0 && Yt(u.spec), u.codeSamples !== void 0 && Qt(u.codeSamples), u.linksPrefixes !== void 0 && Xt(u.linksPrefixes), u.server !== void 0 && Zt(u.server), u.markdown !== void 0 && en(u.markdown));
}
function n() {
t(j);
}
function r() {
return vr(y);
}
function o() {
var u, $;
return (($ = (u = y == null ? void 0 : y.i18n) == null ? void 0 : u.locale) == null ? void 0 : $.value) || "en";
}
function s(u) {
console.warn("`setLocale` is deprecated. Use `setI18nConfig({ locale: value })` instead."), y.i18n.locale.value = u;
}
function a() {
var u;
return (u = y == null ? void 0 : y.theme) == null ? void 0 : u.highlighterTheme;
}
function i(u) {
var $;
y.theme.highlighterTheme = {
...($ = y == null ? void 0 : y.theme) == null ? void 0 : $.highlighterTheme,
...u
};
}
function c() {
var u, $;
return ($ = (u = y == null ? void 0 : y.requestBody) == null ? void 0 : u.defaultView) == null ? void 0 : $.value;
}
function l(u) {
I(y, "requestBody", "defaultView", u);
}
function d() {
var u, $;
return ($ = (u = y == null ? void 0 : y.path) == null ? void 0 : u.showBaseURL) == null ? void 0 : $.value;
}
function f(u) {
I(y, "path", "showBaseURL", u);
}
function g() {
var u, $;
return ($ = (u = y == null ? void 0 : y.jsonViewer) == null ? void 0 : u.deep) == null ? void 0 : $.value;
}
function p(u) {
I(y, "jsonViewer", "deep", u);
}
function h() {
var u, $;
return (($ = (u = y == null ? void 0 : y.jsonViewer) == null ? void 0 : u.renderer) == null ? void 0 : $.value) || "vue-json-pretty";
}
function b(u) {
I(y, "jsonViewer", "renderer", u);
}
function m() {
var u, $;
return ($ = (u = y == null ? void 0 : y.schemaViewer) == null ? void 0 : u.deep) == null ? void 0 : $.value;
}
function S(u) {
I(y, "schemaViewer", "deep", u);
}
function v() {
return y.headingLevels;
}
function T(u) {
if (!y.headingLevels)
return `h${u}`;
const $ = y.headingLevels[u];
if ($ < 1 || $ > 6)
throw new Error(`Heading level for ${u} must be between 1 and 6.`);
return `h${$}`;
}
function A(u) {
y.headingLevels || (y.headingLevels = {});
for (const $ of Object.keys(u)) {
const R = u[$];
if (R < 1 || R > 6)
throw new Error(`Heading level for ${$} must be between 1 and 6.`);
}
Object.assign(y.headingLevels, u);
}
function P() {
var u, $;
return ($ = (u = y == null ? void 0 : y.response) == null ? void 0 : u.responseCodeSelector) == null ? void 0 : $.value;
}
function L(u) {
I(y, "response", "responseCodeSelector", u);
}
function N() {
var u, $;
return ($ = (u = y == null ? void 0 : y.response) == null ? void 0 : u.maxTabs) == null ? void 0 : $.value;
}
function U(u) {
I(y, "response", "maxTabs", u);
}
function O() {
var u, $, R;
return (R = ($ = (u = y == null ? void 0 : y.response) == null ? void 0 : u.body) == null ? void 0 : $.defaultView) == null ? void 0 : R.value;
}
function E(u) {
ee(y, ["response", "body"], "defaultView", u);
}
function k() {
var u, $, R;
return (R = ($ = (u = y == null ? void 0 : y.playground) == null ? void 0 : u.jsonEditor) == null ? void 0 : $.mode) == null ? void 0 : R.value;
}
function x(u) {
ee(y, ["playground", "jsonEditor"], "mode", u);
}
function C() {
var u, $, R;
return (R = ($ = (u = y == null ? void 0 : y.playground) == null ? void 0 : u.jsonEditor) == null ? void 0 : $.mainMenuBar) == null ? void 0 : R.value;
}
function G(u) {
ee(y, ["playground", "jsonEditor"], "mainMenuBar", u);
}
function pe() {
var u, $, R;
return (R = ($ = (u = y == null ? void 0 : y.playground) == null ? void 0 : u.jsonEditor) == null ? void 0 : $.navigationBar) == null ? void 0 : R.value;
}
function Je(u) {
ee(y, ["playground", "jsonEditor"], "navigationBar", u);
}
function po() {
var u, $, R;
return (R = ($ = (u = y == null ? void 0 : y.playground) == null ? void 0 : u.jsonEditor) == null ? void 0 : $.statusBar) == null ? void 0 : R.value;
}
function go(u) {
ee(y, ["playground", "jsonEditor"], "statusBar", u);
}
function ho() {
var u, $;
return ($ = (u = y == null ? void 0 : y.security) == null ? void 0 : u.defaultScheme) == null ? void 0 : $.value;
}
function mo(u) {
I(y, "security", "defaultScheme", u);
}
function yo() {
var u, $;
return [...(($ = (u = y == null ? void 0 : y.operation) == null ? void 0 : u.badges) == null ? void 0 : $.value) || []];
}
function bo(u) {
I(y, "operation", "badges", u);
}
function vo() {
var u, $;
return ($ = (u = y == null ? void 0 : y.operation) == null ? void 0 : u.slots) == null ? void 0 : $.value;
}
function So(u) {
I(y, "operation", "slots", u);
}
function $o() {
var u, $;
return ($ = (u = y == null ? void 0 : y.operation) == null ? void 0 : u.hiddenSlots) == null ? void 0 : $.value;
}
function ko(u) {
I(y, "operation", "hiddenSlots", u);
}
function To() {
var u, $;
return ($ = (u = y == null ? void 0 : y.operation) == null ? void 0 : u.cols) == null ? void 0 : $.value;
}
function Oo(u) {
I(y, "operation", "cols", u);
}
function wo() {
var u;
return ((u = y == null ? void 0 : y.operation) == null ? void 0 : u.defaultBaseUrl) || at;
}
function Eo(u) {
const $ = q(y, "operation");
$.defaultBaseUrl = u;
}
function xo() {
var u, $;
return (u = y == null ? void 0 : y.operation) != null && u.getServers ? (console.warn("operation.getServers is deprecated. Use server.getServers instead."), y.operation.getServers) : (($ = y == null ? void 0 : y.server) == null ? void 0 : $.getServers) || null;
}
function jo(u) {
const $ = q(y, "operation");
$.getServers = u;
}
function Ao() {
return y.i18n;
}
function Wt(u) {
const $ = q(y, "i18n");
u.locale && I(y, "i18n", "locale", u.locale), u.fallbackLocale && I(y, "i18n", "fallbackLocale", u.fallbackLocale), u.messages && ($.messages = u.messages), u.availableLocales && ($.availableLocales = u.availableLocales);
}
function Co() {
return y.spec;
}
function Po() {
var u;
return (u = y == null ? void 0 : y.spec) == null ? void 0 : u.wrapExamples;
}
function Lo() {
var u, $;
return ($ = (u = y == null ? void 0 : y.spec) == null ? void 0 : u.disableDownload) == null ? void 0 : $.value;
}
function Yt(u) {
const $ = q(y, "spec");
u.groupByTags !== void 0 && I(y, "spec", "groupByTags", u.groupByTags), u.collapsePaths !== void 0 && I(y, "spec", "collapsePaths", u.collapsePaths), u.showPathsSummary !== void 0 && I(y, "spec", "showPathsSummary", u.showPathsSummary), u.avoidCirculars !== void 0 && I(y, "spec", "avoidCirculars", u.avoidCirculars), u.lazyRendering !== void 0 && I(y, "spec", "lazyRendering", u.lazyRendering), u.defaultTag !== void 0 && ($.defaultTag = u.defaultTag), u.defaultTagDescription !== void 0 && ($.defaultTagDescription = u.defaultTagDescription), u.wrapExamples !== void 0 && ($.wrapExamples = u.wrapExamples), u.disableDownload !== void 0 && I(y, "spec", "disableDownload", u.disableDownload);
}
function Kt() {
const u = q(y, "codeSamples");
return u.langs || (u.langs = j.codeSamples.langs), u.langs.filter(($, R, K) => K.indexOf($) === R);
}
function Io() {
const u = Kt() || [], $ = q(y, "codeSamples");
return $.defaultLang && u.includes($.defaultLang) ? $.defaultLang : u[0];
}
function Bo() {
return q(y, "codeSamples").availableLanguages;
}
function Ro() {
const u = q(y, "codeSamples");
return u.generator || (u.generator = j.codeSamples.generator), u.generator;
}
function No() {
const u = q(y, "codeSamples");
return u.defaultHeaders || (u.defaultHeaders = j.codeSamples.defaultHeaders), u.defaultHeaders;
}
function Qt(u) {
const $ = q(y, "codeSamples");
u.langs && ($.langs = u.langs.filter((R, K, Pe) => Pe.indexOf(R) === K)), u.defaultLang && ($.defaultLang = u.defaultLang), u.availableLanguages && Uo(u.availableLanguages), u.generator && ($.generator = u.generator), u.defaultHeaders && ($.defaultHeaders = u.defaultHeaders);
}
function Uo(u) {
const $ = q(y, "codeSamples");
$.availableLanguages || ($.availableLanguages = j.codeSamples.availableLanguages);
const R = [...new Set(u.map(({ lang: K }) => K))];
$.availableLanguages = R.map((K) => (u.find(($e) => $e.lang === K) ?? _t.find(($e) => $e.lang === K)) || { lang: K, label: K, highlighter: "plaintext" });
}
function Mo() {
return y.linksPrefixes;
}
function Xt(u) {
const $ = q(y, "linksPrefixes");
u.tags && ($.tags = u.tags), u.operations && ($.operations = u.operations);
}
function Do() {
var u;
return (u = y == null ? void 0 : y.linksPrefixes) == null ? void 0 : u.tags;
}
function Ho() {
var u;
return (u = y == null ? void 0 : y.linksPrefixes) == null ? void 0 : u.operations;
}
function _o() {
return y.server;
}
function Zt(u) {
const $ = q(y, "server");
u.allowCustomServer !== void 0 && ($.allowCustomServer = u.allowCustomServer), u.getServers !== void 0 && ($.getServers = u.getServers);
}
function Fo() {
var u;
return ((u = y.server) == null ? void 0 : u.allowCustomServer) || !1;
}
function qo() {
return y.markdown;
}
function Vo() {
var u;
return ((u = y.markdown) == null ? void 0 : u.externalLinksNewTab) ?? !1;
}
function en(u) {
const $ = q(y, "markdown");
if (u.operationLink !== void 0)
if (u.operationLink === !1)
$.operationLink = !1;
else {
const R = q($, "operationLink");
u.operationLink.linkPrefix !== void 0 && (R.linkPrefix = u.operationLink.linkPrefix), u.operationLink.transformHref !== void 0 && (R.transformHref = u.operationLink.transformHref);
}
u.externalLinksNewTab !== void 0 && ($.externalLinksNewTab = u.externalLinksNewTab), u.config !== void 0 && ($.config = u.config);
}
function Jo() {
var u;
return (u = y.markdown) == null ? void 0 : u.operationLink;
}
return {
isDark: Tu,
schemaConfig: y.requestBody,
reset: n,
getState: r,
getLocale: o,
setLocale: s,
getHighlighterTheme: a,
/** @deprecated Use `getRequestBodyDefaultView` instead. */
getSchemaDefaultView: c,
getRequestBodyDefaultView: c,
/** @deprecated Use `setRequestBodyDefaultView` instead. */
setSchemaDefaultView: l,
setRequestBodyDefaultView: l,
getShowBaseURL: d,
setShowBaseURL: f,
getJsonViewerDeep: g,
setJsonViewerDeep: p,
getJsonViewerRenderer: h,
setJsonViewerRenderer: b,
getSchemaViewerDeep: m,
setSchemaViewerDeep: S,
getHeadingLevels: v,
getHeadingLevel: T,
setHeadingLevels: A,
getResponseCodeSelector: P,
setResponseCodeSelector: L,
getResponseCodeMaxTabs: N,
setResponseCodeMaxTabs: U,
getResponseBodyDefaultView: O,
setResponseBodyDefaultView: E,
getPlaygroundJsonEditorMode: k,
setPlaygroundJsonEditorMode: x,
getPlaygroundJsonEditorMainMenuBar: C,
setPlaygroundJsonEditorMainMenuBar: G,
getPlaygroundJsonEditorNavigationBar: pe,
setPlaygroundJsonEditorNavigationBar: Je,
getPlaygroundJsonEditorStatusBar: po,
setPlaygroundJsonEditorStatusBar: go,
getSecurityDefaultScheme: ho,
setSecurityDefaultScheme: mo,
getOperationBadges: yo,
setOperationBadges: bo,
getOperationSlots: vo,
setOperationSlots: So,
getOperationHiddenSlots: $o,
setOperationHiddenSlots: ko,
getOperationCols: To,
setOperationCols: Oo,
getOperationDefaultBaseUrl: wo,
getOperationServers: xo,
getI18nConfig: Ao,
setI18nConfig: Wt,
getSpecConfig: Co,
getWrapExamples: Po,
getSpecDisableDownload: Lo,
setSpecConfig: Yt,
getCodeSamplesLangs: Kt,
getCodeSamplesDefaultLang: Io,
getCodeSamplesAvailableLanguages: Bo,
getCodeSamplesGenerator: Ro,
getCodeSamplesDefaultHeaders: No,
setCodeSamplesConfig: Qt,
getLinksPrefixesConfig: Mo,
setLinksPrefixesConfig: Xt,
getTagsLinkPrefix: Do,
getOperationsLinkPrefix: Ho,
getServerConfig: _o,
setServerConfig: Zt,
getServerAllowCustomServer: Fo,
getMarkdownConfig: qo,
getExternalLinksNewTab: Vo,
setMarkdownConfig: en,
getOperationLinkConfig: Jo
};
}
var Pt;
(function(e) {
(function(t) {
t.GET = "get", t.PUT = "put", t.POST = "post", t.DELETE = "delete", t.OPTIONS = "options", t.HEAD = "head", t.PATCH = "patch", t.TRACE = "trace";
})(e.HttpMethods || (e.HttpMethods = {}));
})(Pt || (Pt = {}));
var Ln;
(function(e) {
(function(t) {
t.GET = "get", t.PUT = "put", t.POST = "post", t.DELETE = "delete", t.OPTIONS = "options", t.HEAD = "head", t.PATCH = "patch";
})(e.HttpMethods || (e.HttpMethods = {}));
})(Ln || (Ln = {}));
function Te(e) {
if (e instanceof Promise)
return e.then(gt).catch(ht);
try {
const t = e();
return t instanceof Promise ? t.then(gt).catch(ht) : gt(t);
} catch (t) {
return ht(t);
}
}
const gt = (e) => [e, null], ht = (e) => [null, new Ft(e)];
class Ft extends Error {
/**
* Creates a new error with the given cause.
*
* @param cause - The cause of the error.
*/
constructor(t) {
super("thrown error", { cause: t }), this.cause = t, Error.captureStackTrace && Error.captureStackTrace(this, Ft);
}
}
/*!
* allof-merge v0.6.6
* Copyright (C) 2012-2024 Damir Yusipov
* Date: Sat, 17 Feb 2024 19:27:36 GMT
*/
function He(e, t) {
var n = {};
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
if (e != null && typeof Object.getOwnPropertySymbols == "function") {
var o = 0;
for (r = Object.getOwnPropertySymbols(e); o < r.length; o++) t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
}
return n;
}
function wu(e, t) {
var n = {};
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
if (e != null && typeof Object.getOwnPropertySymbols == "function") {
var o = 0;
for (r = Object.getOwnPropertySymbols(e); o < r.length; o++) t.indexOf(r[o]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[o]) && (n[r[o]] = e[r[o]]);
}
return n;
}
const Eu = (e = {}, t, n, r) => {
const o = `/${t}`, s = typeof e["/**"] == "function" ? e["/**"]({ key: t, path: n, value: r }) : e["/**"], a = typeof e["/*"] == "function" ? e["/*"]({ key: t, path: n, value: r }) : e["/*"];
let i = {};
if (o in e) i = e[o];
else if (!s && !a) return;
return i = typeof i == "function" ? i({ key: t, path: n, value: r }) : i, a && (i = Object.assign(Object.assign({}, a), i)), s ? Object.assign(Object.assign({ "/**": e["/**"] }, s), i) : i;
}, $r = (e) => {
const t = {}, n = e.reduce((r, o) => (Object.keys(o).forEach((s) => r.add(s)), r), /* @__PURE__ */ new Set());
for (const r of n.keys()) {
const o = e.filter((s) => r in s);
if (o.length !== 1) {
if (r.charAt(0) !== "/") throw new Error(`Cannot merge rules. Duplicate key: ${r}. Rules should not have same Rule key`);
t[r] = (s, a) => {
const i = o.map((c) => typeof c[r] == "function" ? c[r](s, a) : c[r]);
return $r(i);
};
} else t[r] = o[0][r];
}
return t;
}, ce = (e) => typeof e == "object" && e !== null, mt = (e) => Array.isArray(e), xu = (e, t, n = {}) => {
var r, o;
t = mt(t) ? t : [t];
const s = mt(n.rules) ? $r(n.rules) : n.rules, a = [{ data: e, state: n.state, path: [], keys: [], keyIndex: -1, rules: s }];
for (; a.length > 0; ) {
const i = a[a.length - 1];
if (i.keyIndex >= i.keys.length) {
for (; !((r = i.hooks) === null || r === void 0) && r.length; ) i.hooks.pop()();
a.pop();
continue;
}
const c = i.keys[i.keyIndex++], [l, d, f] = a.length > 1 ? [i.data[c], [...i.path, c], Eu(i.rules, c, [...i.path, c], i.data[c])] : [i.data, i.path, s];
let g = { value: l, path: d, key: c, state: i.state, rules: f };
const p = [];
for (const h of t) {
if (!h || typeof h != "function") continue;
const b = (o = h(g)) !== null && o !== void 0 ? o : {}, { terminate: m, done: S, exitHook: v } = b, T = wu(b, ["terminate", "done", "exitHook"]);
if (m) return;
if (v && p.push(v), g = Object.assign(Object.assign({}, g), T), S) {
g = null;
break;
}
}
if (g && ce(g.value)) {
const h = mt(g.value) ? [...g.value.keys()] : Object.keys(g.value);
a.push({ hooks: p, state: g.state, data: g.value, path: d, keys: h, keyIndex: 0, rules: g.rules });
} else for (; p.length; ) p.pop()();
}
}, ju = () => {
const e = /* @__PURE__ */ new WeakMap();
let t;
return [({ value: n }) => {
t = n;
}, ({ value: n, path: r, key: o, state: s }) => {
if (o = r.length ? o : "#", ce(t) && ce(n)) {
if (e.has(t)) return s.node[o] = e.get(t), { done: !0 };
const a = Array.isArray(n) ? [] : {};
s.node[o] = a, e.set(t, a);
} else s.node[o] = n;
return { value: n, state: Object.assign(Object.assign({}, s), { node: s.node[o] }) };
}];
};
class kr extends Map {
add(t, n) {
const r = this.get(t);
return r ? r.push(n) : this.set(t, [n]), this;
}
}
const Au = (e, t) => {
const n = {};
for (const r of t) r in e && (n[r] = e[r], delete e[r]);
return n;
}, Tr = (e, t) => {
if (Array.isArray(e) && Array.isArray(t)) return [...e, ...t];
if (ce(e) && ce(t)) {
const n = Object.assign({}, e);
for (const r of Object.keys(t)) n[r] = Tr(n[r], t[r]);
return n;
}
return t;
}, Lt = (e) => e && e.$ref && typeof e.$ref == "string", Cu = (e) => e && e.anyOf && Array.isArray(e.anyOf), Pu = (e) => e && e.oneOf && Array.isArray(e.oneOf), Or = (e, t = "") => {
const [n = t, r] = e.split("#"), o = r && r !== "/" ? r : "";
return { filePath: n, pointer: o, normalized: Lu(n, o), jsonPath: Er(o) };
}, Lu = (e, t) => e ? `${e}${t ? "#" + t : ""}` : t ? `#${t}` : "#", wr = (e, t, n = [t]) => {
if (!ce(e)) return;
let r = e;
const o = Er(t);
for (const s of o) if (Array.isArray(r) && r.length > +s) r = r[+s];
else if (ce(r) && s in r) r = r[s];
else {
if (!Lt(r)) return;
{
const a = Or(r.$ref);
r = a.filePath || n.includes(a.pointer) ? void 0 : wr(e, a.pointer, [...n, a.pointer]);
}
}
return r;
}, Ze = { slash: /\//g, tilde: /~/g, escapedSlash: /~1/g, escapedTilde: /~0/g }, Er = (e) => e.split("/").map((t) => decodeURIComponent(t.replace(Ze.escapedSlash, "/").replace(Ze.escapedTilde, "~"))).slice(1), qt = (e) => e.length ? "/" + e.map((t) => encodeURIComponent(String(t).replace(Ze.tilde, "~0").replace(Ze.slash, "~1"))).join("/") : "", Iu = (e, t) => JSON.stringify(e) == JSON.stringify(t), Bu = (e) => {
let t = 1;
for (; e * t % 1 != 0; ) t *= 10;
return t;
};
function Ru(e) {
const t = e.reduce((n, r) => Math.max(n, Bu(r)), 0);
return e.reduce((n, r) => Math.round(n * t * r * t / xr(n * t, r * t)) / t);
}
function xr(e, t) {
return t === 0 ? e : xr(t, e % t);
}
const jr = (e) => {
if (e.length === 0) return [[]];
const t = e[0], n = e.slice(1), r = jr(n), o = [];
for (const s of t) for (const a of r) o.push([s, ...a]);
return o;
}, Nu = (e) => {
const t = [];
for (const n of e) {
if (!("properties" in n)) continue;
const r = new Set(Object.keys(n.properties)), o = new kr();
for (const a of r.values()) for (const i of e) if (!(i == n || i.properties && a in i.properties)) if ("patternProperties" in i && i.patternProperties) for (const c of Object.keys(i.patternProperties)) new RegExp(c).test(a) || r.delete(a);
else "additionalProperties" in i && (i.additionalProperties === !1 ? r.delete(a) : typeof i.additionalProperties == "object" && o.add(a, i.additionalProperties));
if (!r.size) continue;
const s = {};
for (const a of r.values()) o.has(a) ? s[a] = { allOf: [n.properties[a], ...o.get(a)] } : s[a] = n.properties[a];
t.push(s);
}
return t;
}, Uu = (e) => {
const t = [];
for (const n of e) {
if (!("patternProperties" in n)) continue;
const r = new Set(Object.keys(n.patternProperties));
for (const s of e) if (s != n && "additionalProperties" in s && !s.additionalProperties) for (const a of r.values()) s.patternProperties && a in s.patternProperties || r.delete(a);
if (!r.size) continue;
const o = {};
for (const s of r.values()) o[s] = n.patternProperties[s];
t.push(o);
}
return t;
}, In = (e) => {
const t = {}, n = Vt(e);
for (const [r, o] of Object.entries(n)) o.includes(!1) ? t[r] = !1 : t[r] = o.length > 1 ? { allOf: o } : o[0];
return t;
}, Mu = (e, t) => !!e.reduce((n, r) => n && r === !0, !0) || Ve(e, t), Du = () => "Could not merge values, they are probably incompatible", Hu = (e) => `Merge rule not found for key: ${e}`, Vt = (e) => {
const t = {};
for (const n of e) for (const r of Object.keys(n)) Array.isArray(t[r]) ? t[r].push(n[r]) : t[r] = [n[r]];
return t;
}, Ve = (e, t) => {
if (e.includes(!1)) return !1;
const n = {}, r = Vt(e);
"properties" in r && (r.properties = Nu(e)), "patternProperties" in r && (r.patternProperties = Uu(e));
for (let [o, s] of Object.entries(r)) {
if (!s.length) continue;
const a = t.mergeRules;
let i = `/${o}` in a ? a[`/${o}`] : a["/?"];
i = i && !("$" in i) && "/" in i ? i["/"] : i, i = typeof i == "function" ? i() : i;
const c = i && "$" in i ? i.$ : void 0;
if (!c) throw new Error(Hu(o));
const l = s.length > 1 ? c(s, Object.assign(Object.assign({}, t), { allOfItems: e })) : s[0];
l === void 0 ? t.mergeError(s) : n[o] = l;
}
return Object.keys(n).length ? n : void 0;
}, ne = (e) => e[e.length - 1], me = (e) => e.reduce((t, n) => t || n, !1), Ie = (e) => Math.min(...e), Be = (e) => Math.max(...e), _u = (e) => e.length > 1 ? e.reduce((t, n) => `${t}(?=${n})`, "") : e[0], Ar = ([e, ...t]) => t.reduce((n, r) => n.filter((o) => r.includes(o)), e), Fu = ([e, ...t]) => t.find((n) => !Iu(n, e)) ? void 0 : e, X = ([e, ...t]) => t.reduce((n, r) => Tr(n, r), e), Ue = (e) => jr(e).map((t) => ({ allOf: t })), qu = (e) => ({ anyOf: e }), Vu = (e) => Ru(e), Ju = (e, t) => {
const n = e.map((o) => o.map((s) => JSON.stringify(s))), r = Ar(n).map((o) => JSON.parse(o)).sort();
return r.length || t.mergeError(e), r;
}, Gu = (e, t) => {
const n = e.map((o) => Array.isArray(o) ? o : [o]), r = Ar(n);
return r.length === 1 ? r[0] : r.length ? r : void 0;
}, Cr = (e) => {
const t = /* @__PURE__ */ new Set();
for (const n of e) for (const r of n) t.add(r);
return Array.from(t).sort();
}, zu = (e, t) => {
const n = {}, r = Vt(e);
for (const [o, s] of Object.entries(r))
if (s.reduce((a, i) => a && Array.isArray(i), !0)) n[o] = Cr(s);
else {
const a = s.map((i) => Array.isArray(i) ? { required: i } : i);
n[o] = a.length > 1 ? { allOf: a } : a[0];
}
return n;
}, Pr = (e, t) => {
if (!e.reduce((c, l) => Array.isArray(l) || c, !1)) return Ve(e, t);
const n = [];
let r = 1 / 0, o = 0;
const s = new kr();
for (const c of t.allOfItems) "additionalItems" in c && c.additionalItems && "items" in c && Array.isArray(c.items) && s.add(c.items.length, c.additionalItems), "items" in c && (n.push(c.items), Array.isArray(c.items) && (o = Math.max(o, c.items.length), "additionalItems" in c && c.additionalItems === !1 && (r = Math.min(r, c.items.length))));
const a = Math.min(o, r), i = [...Array(a)].map(() => ({ allOf: [] }));
for (const c of n) if (Array.isArray(c)) for (let l = 0; l < a; l++) {
const d = [];
for (let f = 0; f <= l; f++) s.has(f) && d.push(...s.get(f));
l < c.length ? i[l].allOf.push(d.length ? Object.assign(Object.assign({}, c[l]), { allOf: d }) : c[l]) : i[l].allOf.push(!d.length || { allOf: d });
}
else i.forEach(({ allOf: l }) => l.push(c));
return i;
}, Wu = (e, t) => {
const n = [], r = [];
for (const o of t.allOfItems) "items" in o && !Array.isArray(o.items) && r.push(o.items), "additionalItems" in o && "items" in o && Array.isArray(o.items) && n.push(o.additionalItems);
return r.length && n.forEach((o) => o.allOf = r), Ve(n, t);
}, F = (e = "draft-06", t = {}) => Object.assign(Object.assign(Object.assign(Object.assign({ "/maximum": { $: Ie }, "/exclusiveMaximum": { $: me }, "/minimum": { $: Be }, "/exclusiveMinimum": { $: me }, "/maxLength": { $: Ie }, "/minLength": { $: Be }, "/maxItems": { $: Ie }, "/minItems": { $: Be }, "/uniqueItems": { $: me }, "/maxProperties": { $: Ie }, "/minProperties": { $: Be }, "/required": { $: Cr }, "/multipleOf": { $: Vu }, "/enum": { $: Ju }, "/type": { $: Gu }, "/allOf": { "/*": () => F(e, t), $: Ue }, "/not": { $: qu }, "/oneOf": { "/*": () => F(e, t), $: Ue, sibling: ["definitions", "$defs", "$id", "$schema"] }, "/anyOf": { "/*": () => F(e, t), $: Ue, sibling: ["definitions", "$defs", "$id", "$schema"] }, "/properties": { "/*": () => F(e, t), $: In }, "/items": () => Object.assign(Object.assign({}, F(e, t)), { $: Pr, "/*": ({ key: n }) => typeof n == "number" ? F(e, t) : {} }), "/additionalProperties": () => Object.assign(Object.assign({}, F(e, t)), { $: Mu }), "/additionalItems": () => Object.assign(Object.assign({}, F(e, t)), { $: Wu }), "/patternProperties": { "/*": () => F(e, t), $: In }, "/pattern": { $: _u }, "/readOnly": { $: me }, "/writeOnly": { $: me }, "/example": { $: X }, "/examples": { $: X }, "/deprecated": { $: me } }, e !== "draft-04" ? { "/propertyNames": () => F(e, t), "/contains": () => F(e, t), "/dependencies": { "/*": () => F(e, t), $: zu }, "/const": { $: Fu }, "/exclusiveMaximum": { $: Ie }, "/exclusiveMinimum": { $: Be }, "/$defs": { "/*": () => F(e, t), $: X } } : {}), { "/definitions": { "/*": () => F(e, t), $: X }, "/xml": { $: X }, "/externalDocs": { $: ne }, "/description": { $: ne }, "/title": { $: ne }, "/format": { $: ne }, "/default": { $: ne }, "/?": { $: ne } }), t), { $: Ve }), Me = (e) => F(e, { "/discriminator": { $: X }, "/oneOf": { "/*": () => Me(e), $: Ue, sibling: ["discriminator"] }, "/anyOf": { "/*": () => Me(e), $: Ue, sibling: ["discriminator"] } }), st = (e) => e === "3.0.x" ? Object.assign(Object.assign({}, Me("draft-04")), { "/items": ({ key: t }) => Object.assign(Object.assign({}, Me("draft-04")), { $: Pr }) }) : Me("draft-06"), be = (e) => ({ "/*": { "/schema": st(e) } }), Bn = (e) => ({ "/content": { "/*": { "/schema": st(e), "/encoding": { "/headers": be(e) } } } }), Rn = (e) => ({ "/*": { "/headers": be(e), "/content": { "/*": { "/schema": st(e), "/encoding": { "/headers": be(e) } } } } }), Yu = (e = "3.0.x") => ({ "/paths": { "/*": { "/*": { "/parameters": be(e), "/requestBody": Bn(e), "/responses": Rn(e) }, "/parameters": be(e) } }, "/components": { "/schemas": { "/*": st(e) }, "/responses": Rn(e), "/parameters": be(e), "/requestBodies": { "/*": Bn(e) }, "/headers": be(e) } }), ye = F("draft-06", { "/args": () => ye, "/nullable": { $: me }, "/specifiedByURL": { $: ne }, "/values": { $: X, "/*": { $: X, "/description": { $: ne }, "/deprecated": { $: ne, "/reason": { $: ne } } } }, "/interfaces": { $: X, "/*": { $: X } }, "/directives": { $: X, "/*": () => Object.assign(Object.assign({}, ye), { "/meta": { $: X } }) } }), Ku = { "/queries": { "/*": () => ye }, "/mutations": { "/*": () => ye }, "/subscriptions": { "/*": () => ye }, "/components": { "/*": { "/*": ye }, "/directives": { "/*": { "/args": () => ye } } } }, Nn = (e, t, n) => {
const r = n.sibling || [], o = e, s = t, a = o[s], i = He(o, [typeof s == "symbol" ? s : s + ""]), c = Au(i, r);
return Object.keys(i).length ? Object.assign({ [t]: a.map((l) => ({ allOf: [i, l] })) }, c) : e;
}, Lr = (e, t, n, r) => {
const o = [], s = qt(t), a = [], i = { pointer: s, data: "", refs: [] };
for (const l of e) if (Lt(l) && !a.includes(l.$ref)) {
i.data === "" && (i.data = JSON.stringify(e));
const { $ref: d } = l, f = He(l, ["$ref"]), { filePath: g, normalized: p, pointer: h } = Or(d), b = r.find((S) => S.refs.includes(l.$ref) && S.data === i.data && h !== S.pointer);
if (b) return { allOfItems: [{ $ref: "#" + b.pointer }], brokenRefs: a };
i.refs.push(p);
const m = g ? void 0 : wr(n, h);
m === void 0 ? (a.push(p), o.push(l)) : o.push(m), Object.keys(f).length && o.push(f);
} else o.push(l);
i.refs.length && r.push(i);
const c = Ir(o);
return c.find((l) => Lt(l) && !a.includes(l.$ref)) ? Lr(c, t, n, r) : { allOfItems: c, brokenRefs: a };
}, Ir = (e) => {
const t = [];
for (const n of e) if (ce(n)) if (n.allOf && Array.isArray(n.allOf)) {
const { allOf: r } = n, o = He(n, ["allOf"]), s = Object.keys(o).length ? [...r, o] : r;
t.push(...Ir(s));
} else t.push(n);
return t;
}, Qu = (e) => {
if (typeof e != "object" || !e) return F();
if ("openapi" in e && typeof e.openapi == "string" && /3.+/.test(e.openapi)) {
const t = e.openapi.startsWith("3.1") ? "3.1.x" : "3.0.x";
return Yu(t);
}
return "graphapi" in e && typeof e.graphapi == "string" ? Ku : F();
}, Xu = (e, t) => {
var n;
const r = (n = void 0) !== null && n !== void 0 ? n : Qu(e);
return ((o, s = [], a = {}) => {
var i;
s = Array.isArray(s) ? s : [s];
const c = { "#": void 0 }, l = Object.assign({ state: Object.assign(Object.assign({}, (i = a.state) !== null && i !== void 0 ? i : {}), { root: c, node: c }) }, a.rules ? { rules: a.rules } : {}), [d, f] = ju();
return xu(o, [d, ...s, f], l), c["#"];
})(e, Zu(t), { rules: r });
}, Zu = (e) => {
const t = /* @__PURE__ */ new Map();
let n;
const r = [];
return ({ value: o, key: s, path: a, rules: i, state: c }) => {
a.length || (n = o);
const l = (S) => {
var v;
const T = ed(a);
T ? t.set(...T) : (v = void 0) === null || v === void 0 || v.call(e, Du(), a, S);
}, d = () => {
const { node: S } = c, v = qt(a);
if (t.has(v)) {
const T = t.get(v), A = S[s];
Array.isArray(A) && (A.length < 2 && l((o == null ? void 0 : o.allOf) || []), A.splice(T, 1));
}
};
if (!ce(o) || Array.isArray(o)) return { exitHook: d };
if (!((S) => !!S && S["/allOf"] && "$" in S["/allOf"])(i)) return { exitHook: d };
const { allOf: f } = o, g = He(o, ["allOf"]), p = [];
if (Array.isArray(f) && p.push(...f), p.length) Object.keys(g).length && p.push(g);
else {
const { $ref: S } = g;
He(g, ["$ref"]);
}
if (!p.length) return { value: g, exitHook: d };
const { allOfItems: h, brokenRefs: b } = Lr(p, a, n, r);
if (b.length) return b.forEach((S) => {
var v;
return (v = void 0) === null || v === void 0 ? void 0 : v.call(e, "Cannot resolve $ref", a, S);
}), { value: { allOf: h }, exitHook: d };
if (h.length < 2) return { value: h.length ? h[0] : {}, exitHook: d };
const m = Ve(h, { allOfItems: h, mergeRules: i, mergeError: l });
return e != null && e.mergeCombinarySibling && Cu(m) ? { value: Nn(m, "anyOf", i["/anyOf"]), exitHook: d } : e != null && e.mergeCombinarySibling && Pu(m) ? { value: Nn(m, "oneOf", i["/oneOf"]), exitHook: d } : { value: m, exitHook: d };
};
}, ed = (e) => {
for (let t = e.length - 2; t >= 0; t--) if (e[t] === "anyOf" || e[t] === "oneOf") {
const n = e.slice(0, t + 1);
return [qt(n), e[t + 1]];
}
}, td = Symbol.for("__confbox_fmt__"), nd = /^(\s+)/, rd = /(\s+)$/;
function od(e, t = {}) {
var o, s;
const n = t.indent === void 0 && t.preserveIndentation !== !1 && e.slice(0, (t == null ? void 0 : t.sampleSize) || 1024), r = t.preserveWhitespace === !1 ? void 0 : { start: ((o = nd.exec(e)) == null ? void 0 : o[0]) || "", end: ((s = rd.exec(e)) == null ? void 0 : s[0]) || "" };
return { sample: n, whiteSpace: r };
}
function id(e, t, n) {
!t || typeof t != "object" || Object.defineProperty(t, td, { enumerable: !1, configurable: !0, writable: !0, value: od(e, n) });
}
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */
function Br(e) {
return typeof e > "u" || e === null;
}
function ad(e) {
return typeof e == "object" && e !== null;
}
function sd(e) {
return Array.isArray(e) ? e : Br(e) ? [] : [e];
}
function cd(e, t) {
var n, r, o, s;
if (t) for (s = Object.keys(t), n = 0, r = s.length; n < r; n += 1) o = s[n], e[o] = t[o];
return e;
}
function ld(e, t) {
var n = "", r;
for (r = 0; r < t; r += 1) n += e;
return n;
}
function ud(e) {
return e === 0 && Number.NEGATIVE_INFINITY === 1 / e;
}
var dd = Br, fd = ad, pd = sd, gd = ld, hd = ud, md = cd, W = { isNothing: dd, isObject: fd, toArray: pd, repeat: gd, isNegativeZero: hd, extend: md };
function Rr(e, t) {
var n = "", r = e.reason || "(unknown reason)";
return e.mark ? (e.mark.name && (n += 'in "' + e.mark.name + '" '), n += "(" + (e.mark.line + 1) + ":" + (e.mark.column + 1) + ")", !t && e.mark.snippet && (n += `
` + e.mark.snippet), r + " " + n) : r;
}
function Re(e, t) {
Error.call(this), this.name = "YAMLException", this.reason = e, this.mark = t, this.message = Rr(this, !1), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack || "";
}
Re.prototype = Object.create(Error.prototype), Re.prototype.constructor = Re, Re.prototype.toString = function(e) {
return this.name + ": " + Rr(this, e);
};
var se = Re;
function yt(e, t, n, r, o) {
var s = "", a = "", i = Math.floor(o / 2) - 1;
return r - t > i && (s = " ... ", t = r - i + s.length), n - r > i && (a = " ...", n = r + i - a.length), { str: s + e.slice(t, n).replace(/\t/g, "→") + a, pos: r - t + s.length };
}
function bt(e, t) {
return W.repeat(" ", t - e.length) + e;
}
function yd(e, t) {
if (t = Object.create(t || null), !e.buffer) return null;
t.maxLength || (t.maxLength = 79), typeof t.indent != "number" && (t.indent = 1), typeof t.linesBefore != "number" && (t.linesBefore = 3), typeof t.linesAfter != "number" && (t.linesAfter = 2);
for (var n = /\r?\n|\r|\0/g, r = [0], o = [], s, a = -1; s = n.exec(e.buffer); ) o.push(s.index), r.push(s.index + s[0].length), e.position <= s.index && a < 0 && (a = r.length - 2);
a < 0 && (a = r.length - 1);
var i = "", c, l, d = Math.min(e.line + t.linesAfter, o.length).toString().length, f = t.maxLength - (t.indent + d + 3);
for (c = 1; c <= t.linesBefore && !(a - c < 0); c++) l = yt(e.buffer, r[a - c], o[a - c], e.position - (r[a] - r[a - c]), f), i = W.repeat(" ", t.indent) + bt((e.line - c + 1).toString(), d) + " | " + l.str + `
` + i;
for (l = yt(e.buffer, r[a], o[a], e.position, f), i += W.repeat(" ", t.indent) + bt((e.line + 1).toString(), d) + " | " + l.str + `
`, i += W.repeat("-", t.indent + d + 3 + l.pos) + `^
`, c = 1; c <= t.linesAfter && !(a + c >= o.length); c++) l = yt(e.buffer, r[a + c], o[a + c], e.position - (r[a] - r[a + c]), f), i += W.repeat(" ", t.indent) + bt((e.line + c + 1).toString(), d) + " | " + l.str + `
`;
return i.replace(/\n$/, "");
}
var bd = yd, vd = ["kind", "multi", "resolve", "construct", "instanceOf", "predicate", "represent", "representName", "defaultStyle", "styleAliases"], Sd = ["scalar", "sequence", "mapping"];
function $d(e) {
var t = {};
return e !== null && Object.keys(e).forEach(function(n) {
e[n].forEach(function(r) {
t[String(r)] = n;
});
}), t;
}
function kd(e, t) {
if (t = t || {}, Object.keys(t).forEach(function(n) {
if (vd.indexOf(n) === -1) throw new se('Unknown option "' + n + '" is met in definition of "' + e + '" YAML type.');
}), this.options = t, this.tag = e, this.kind = t.kind || null, this.resolve = t.resolve || function() {
return !0;
}, this.construct = t.construct || function(n) {
return n;
}, this.instanceOf = t.instanceOf || null, this.predicate = t.predicate || null, this.represent = t.represent || null, this.representName = t.representName || null, this.defaultStyle = t.defaultStyle || null, this.multi = t.multi || !1, this.styleAliases = $d(t.styleAliases || null), Sd.indexOf(this.kind) === -1) throw new se('Unknown kind "' + this.kind + '" is specified for "' + e + '" YAML type.');
}
var J = kd;
function Un(e, t) {
var n = [];
return e[t].forEach(function(r) {
var o = n.length;
n.forEach(function(s, a) {
s.tag === r.tag && s.kind === r.kind && s.multi === r.multi && (o = a);
}), n[o] = r;
}), n;
}
function Td() {
var e = { scalar: {}, sequence: {}, mapping: {}, fallback: {}, multi: { scalar: [], sequence: [], mapping: [], fallback: [] } }, t, n;
function r(o) {
o.multi ? (e.multi[o.kind].push(o), e.multi.fallback.push(o)) : e[o.kind][o.tag] = e.fallback[o.tag] = o;
}
for (t = 0, n = arguments.length; t < n; t += 1) arguments[t].forEach(r);
return e;
}
function It(e) {
return this.extend(e);
}
It.prototype.extend = function(e) {
var t = [], n = [];
if (e instanceof J) n.push(e);
else if (Array.isArray(e)) n = n.concat(e);
else if (e && (Array.isArray(e.implicit) || Array.isArray(e.explicit))) e.implicit && (t = t.concat(e.implicit)), e.explicit && (n = n.concat(e.explicit));
else throw new se("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");
t.forEach(function(o) {
if (!(o instanceof J)) throw new se("Specified list of YAML types (or a single Type object) contains a non-Type object.");
if (o.loadKind && o.loadKind !== "scalar") throw new se("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");
if (o.multi) throw new se("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.");
}), n.forEach(function(o) {
if (!(o instanceof J)) throw new se("Specified list of YAML types (or a single Type object) contains a non-Type object.");
});
var r = Object.create(It.prototype);
return r.implicit = (this.implicit || []).concat(t), r.explicit = (this.explicit || []).concat(n), r.compiledImplicit = Un(r, "implicit"), r.compiledExplicit = Un(r, "explicit"), r.compiledTypeMap = Td(r.compiledImplicit, r.compiledExplicit), r;
};
var Od = It, wd = new J("tag:yaml.org,2002:str", { kind: "scalar", construct: function(e) {
return e !== null ? e : "";
} }), Ed = new J("tag:yaml.org,2002:seq", { kind: "sequence", construct: function(e) {
return e !== null ? e : [];
} }), xd = new J("tag:yaml.org,2002:map", { kind: "mapping", construct: function(e) {
return e !== null ? e : {};
} }), jd = new Od({ explicit: [wd, Ed, xd] });
function Ad(e) {
if (e === null) return !0;
var t = e.length;
return t === 1 && e === "~" || t === 4 && (e === "null" || e === "Null" || e === "NULL");
}
function Cd() {
return null;
}
function Pd(e) {
return e === null;
}
var Ld = new J("tag:yaml.org,2002:null", { kind: "scalar", resolve: Ad, construct: Cd, predicate: Pd, represent: { canonical: function() {
return "~";
}, lowercase: function() {
return "null";
}, uppercase: function() {
return "NULL";
}, camelcase: function() {
return "Null";
}, empty: function() {
return "";
} }, defaultStyle: "lowercase" });
function Id(e) {
if (e === null) return !1;
var t = e.length;
return t === 4 && (e === "true" || e === "True" || e === "TRUE") || t === 5 && (e === "false" || e === "False" || e === "FALSE");
}
function Bd(e) {
return e === "true" || e === "True" || e === "TRUE";
}
function Rd(e) {
return Object.prototype.toString.call(e) === "[object Boolean]";
}
var Nd = new J("tag:yaml.org,2002:bool", { kind: "scalar", resolve: Id, construct: Bd, predicate: Rd, represent: { lowercase: function(e) {
return e ? "true" : "false";
}, uppercase: function(e) {
return e ? "TRUE" : "FALSE";
}, camelcase: function(e) {
return e ? "True" : "False";
} }, defaultStyle: "lowercase" });
function Ud(e) {
return 48 <= e && e <= 57 || 65 <= e && e <= 70 || 97 <= e && e <= 102;
}
function Md(e) {
return 48 <= e && e <= 55;
}
function Dd(e) {
return 48 <= e && e <= 57;
}
function Hd(e) {
if (e === null) return !1;
var t = e.length, n = 0, r = !1, o;
if (!t) return !1;
if (o = e[n], (o === "-" || o === "+") && (o = e[++n]), o === "0") {
if (n + 1 === t) return !0;
if (o = e[++n], o === "b") {
for (n++; n < t; n++) if (o = e[n], o !== "_") {
if (o !== "0" && o !== "1") return !1;
r = !0;
}
return r && o !== "_";
}
if (o === "x") {
for (n++; n < t; n++) if (o = e[n], o !== "_") {
if (!Ud(e.charCodeAt(n))) return !1;
r = !0;
}
return r && o !== "_";
}
if (o === "o") {
for (n++; n < t; n++) if (o = e[n], o !== "_") {
if (!Md(e.charCodeAt(n))) return !1;
r = !0;
}
return r && o !== "_";
}
}
if (o === "_") return !1;
for (; n < t; n++) if (o = e[n], o !== "_") {
if (!Dd(e.charCodeAt(n))) return !1;
r = !0;
}
return !(!r || o === "_");
}
function _d(e) {
var t = e, n = 1, r;
if (t.indexOf("_") !== -1 && (t = t.replace(/_/g, "")), r = t[0], (r === "-" || r === "+") && (r === "-" && (n = -1), t = t.slice(1), r = t[0]), t === "0") return 0;
if (r === "0") {
if (t[1] === "b") return n * parseInt(t.slice(2), 2);
if (t[1] === "x") return n * parseInt(t.slice(2), 16);
if (t[1] === "o") return n * parseInt(t.slice(2), 8);
}
return n * parseInt(t, 10);
}
function Fd(e) {
return Object.prototype.toString.call(e) === "[object Number]" && e % 1 === 0 && !W.isNegativeZero(e);
}
var qd = new J("tag:yaml.org,2002:int", { kind: "scalar", resolve: Hd, construct: _d, predicate: Fd, represent: { binary: function(e) {
return e >= 0 ? "0b" + e.toString(2) : "-0b" + e.toString(2).slice(1);
}, octal: function(e) {
return e >= 0 ? "0o" + e.toString(8) : "-0o" + e.toString(8).slice(1);
}, decimal: function(e) {
return e.toString(10);
}, hexadecimal: function(e) {
return e >= 0 ? "0x" + e.toString(16).toUpperCase() : "-0x" + e.toString(16).toUpperCase().slice(1);
} }, defaultStyle: "decimal", styleAliases: { binary: [2, "bin"], octal: [8, "oct"], decimal: [10, "dec"], hexadecimal: [16, "hex"] } }), Vd = new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");
function Jd(e) {
return !(e === null || !Vd.test(e) || e[e.length - 1] === "_");
}
function Gd(e) {
var t, n;
return t = e.replace(/_/g, "").toLowerCase(), n = t[0] === "-" ? -1 : 1, "+-".indexOf(t[0]) >= 0 && (t = t.slice(1)), t === ".inf" ? n === 1 ? Number.POSITIVE_INFINITY : Number.NEGATIVE_INFINITY : t === ".nan" ? NaN : n * parseFloat(t, 10);
}
var zd = /^[-+]?[0-9]+e/;
function Wd(e, t) {
var n;
if (isNaN(e)) switch (t) {
case "lowercase":
return ".nan";
case "uppercase":
return ".NAN";
case "camelcase":
return ".NaN";
}
else if (Number.POSITIVE_INFINITY === e) switch (t) {
case "lowercase":
return ".inf";
case "uppercase":
return ".INF";
case "camelcase":
return ".Inf";
}
else if (Number.NEGATIVE_INFINITY === e) switch (t) {
case "lowercase":
return "-.inf";
case "uppercase":
return "-.INF";
case "camelcase":
return "-.Inf";
}
else if (W.isNegativeZero(e)) return "-0.0";
return n = e.toString(10), zd.test(n) ? n.replace("e", ".e") : n;
}
function Yd(e) {
return Object.prototype.toString.call(e) === "[object Number]" && (e % 1 !== 0 || W.isNegativeZero(e));
}
var Kd = new J("tag:yaml.org,2002:float", { kind: "scalar", resolve: Jd, construct: Gd, predicate: Yd, represent: Wd, defaultStyle: "lowercase" }), Qd = jd.extend({ implicit: [Ld, Nd, qd, Kd] }), Xd = Qd, Nr = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"), Ur = new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");
function Zd(e) {
return e === null ? !1 : Nr.exec(e) !== null || Ur.exec(e) !== null;
}
function ef(e) {
var t, n, r, o, s, a, i, c = 0, l = null, d, f, g;
if (t = Nr.exec(e), t === null && (t = Ur.exec(e)), t === null) throw new Error("Date resolve error");
if (n = +t[1], r = +t[2] - 1, o = +t[3], !t[4]) return new Date(Date.UTC(n, r, o));
if (s = +t[4], a = +t[5], i = +t[6], t[7]) {
for (c = t[7].slice(0, 3); c.length < 3; ) c += "0";
c = +c;
}
return t[9] && (d = +t[10], f = +(t[11] || 0), l = (d * 60 + f) * 6e4, t[9] === "-" && (l = -l)), g = new Date(Date.UTC(n, r, o, s, a, i, c)), l && g.setTime(g.getTime() - l), g;
}
function tf(e) {
return e.toISOString();
}
var nf = new J("tag:yaml.org,2002:timestamp", { kind: "scalar", resolve: Zd, construct: ef, instanceOf: Date, represent: tf });
function rf(e) {
return e === "<<" || e === null;
}
var of = new J("tag:yaml.org,2002:merge", { kind: "scalar", resolve: rf }), Jt = `ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
\r`;
function af(e) {
if (e === null) return !1;
var t, n, r = 0, o = e.length, s = Jt;
for (n = 0; n < o; n++) if (t = s.indexOf(e.charAt(n)), !(t > 64)) {
if (t < 0) return !1;
r += 6;
}
return r % 8 === 0;
}
function sf(e) {
var t, n, r = e.replace(/[\r\n=]/g, ""), o = r.length, s = Jt, a = 0, i = [];
for (t = 0; t < o; t++) t % 4 === 0 && t && (i.push(a >> 16 & 255), i.push(a >> 8 & 255), i.push(a & 255)), a = a << 6 | s.indexOf(r.charAt(t));
return n = o % 4 * 6, n === 0 ? (i.push(a >> 16 & 255), i.push(a >> 8 & 255), i.push(a & 255)) : n === 18 ? (i.push(a >> 10 & 255), i.push(a >> 2 & 255)) : n === 12 && i.push(a >> 4 & 255), new Uint8Array(i);
}
function cf(e) {
var t = "", n = 0, r, o, s = e.length, a = Jt;
for (r = 0; r < s; r++) r % 3 === 0 && r && (t += a[n >> 18 & 63], t += a[n >> 12 & 63], t += a[n >> 6 & 63], t += a[n & 63]), n = (n << 8) + e[r];
return o = s % 3, o === 0 ? (t += a[n >> 18 & 63], t += a[n >> 12 & 63], t += a[n >> 6 & 63], t += a[n & 63]) : o === 2 ? (t += a[n >> 10 & 63], t += a[n >> 4 & 63], t += a[n << 2 & 63], t += a[64]) : o === 1 && (t += a[n >> 2 & 63], t += a[n << 4 & 63], t += a[64], t += a[64]), t;
}
function lf(e) {
return Object.prototype.toString.call(e) === "[object Uint8Array]";
}
var uf = new J("tag:yaml.org,2002:binary", { kind: "scalar", resolve: af, construct: sf, predicate: lf, represent: cf }), df = Object.prototype.hasOwnProperty, ff = Object.prototype.toString;
function pf(e) {
if (e === null) return !0;
var t = [], n, r, o, s, a, i = e;
for (n = 0, r = i.length; n < r; n += 1) {
if (o = i[n], a = !1, ff.call(o) !== "[object Object]") return !1;
for (s in o) if (df.call(o, s)) if (!a) a = !0;
else return !1;
if (!a) return !1;
if (t.indexOf(s) === -1) t.push(s);
else return !1;
}
return !0;
}
function gf(e) {
return e !== null ? e : [];
}
var hf = new J("tag:yaml.org,2002:omap", { kind: "sequence", resolve: pf, construct: gf }), mf = Object.prototype.toString;
function yf(e) {
if (e === null) return !0;
var t, n, r, o, s, a = e;
for (s = new Array(a.length), t = 0, n = a.length; t < n; t += 1) {
if (r = a[t], mf.call(r) !== "[object Object]" || (o = Object.keys(r), o.length !== 1)) return !1;
s[t] = [o[0], r[o[0]]];
}
return !0;
}
function bf(e) {
if (e === null) return [];
var t, n, r, o, s, a = e;
for (s = new Array(a.length), t = 0, n = a.length; t < n; t += 1) r = a[t], o = Object.keys(r), s[t] = [o[0], r[o[0]]];
return s;
}
var vf = new J("tag:yaml.org,2002:pairs", { kind: "sequence", resolve: yf, construct: bf }), Sf = Object.prototype.hasOwnProperty;
function $f(e) {
if (e === null) return !0;
var t, n = e;
for (t in n) if (Sf.call(n, t) && n[t] !== null) return !1;
return !0;
}
function kf(e) {
return e !== null ? e : {};
}
var Tf = new J("tag:yaml.org,2002:set", { kind: "mapping", resolve: $f, construct: kf }), Of = Xd.extend({ implicit: [nf, of], explicit: [uf, hf, vf, Tf] }), fe = Object.prototype.hasOwnProperty, et = 1, Mr = 2, Dr = 3, tt = 4, vt = 1, wf = 2, Mn = 3, Ef = /[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/, xf = /[\x85\u2028\u2029]/, jf = /[,\[\]\{\}]/, Hr = /^(?:!|!!|![a-z\-]+!)$/i, _r = /^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;
function Dn(e) {
return Object.prototype.toString.call(e);
}
function oe(e) {
return e === 10 || e === 13;
}
function Se(e) {
return e === 9 || e === 32;
}
function Y(e) {
return e === 9 || e === 32 || e === 10 || e === 13;
}
function we(e) {
return e === 44 || e === 91 || e === 93 || e === 123 || e === 125;
}
function Af(e) {
var t;
return 48 <= e && e <= 57 ? e - 48 : (t = e | 32, 97 <= t && t <= 102 ? t - 97 + 10 : -1);
}
function Cf(e) {
return e === 120 ? 2 : e === 117 ? 4 : e === 85 ? 8 : 0;
}
function Pf(e) {
return 48 <= e && e <= 57 ? e - 48 : -1;
}
function Hn(e) {
return e === 48 ? "\0" : e === 97 ? "\x07" : e === 98 ? "\b" : e === 116 || e === 9 ? " " : e === 110 ? `
` : e === 118 ? "\v" : e === 102 ? "\f" : e === 114 ? "\r" : e === 101 ? "\x1B" : e === 32 ? " " : e === 34 ? '"' : e === 47 ? "/" : e === 92 ? "\\" : e === 78 ? "
" : e === 95 ? " " : e === 76 ? "\u2028" : e === 80 ? "\u2029" : "";
}
function Lf(e) {
return e <= 65535 ? String.fromCharCode(e) : String.fromCharCode((e - 65536 >> 10) + 55296, (e - 65536 & 1023) + 56320);
}
for (var Fr = new Array(256), qr = new Array(256), Oe = 0; Oe < 256; Oe++) Fr[Oe] = Hn(Oe) ? 1 : 0, qr[Oe] = Hn(Oe);
function If(e, t) {
this.input = e, this.filename = t.filename || null, this.schema = t.schema || Of, this.onWarning = t.onWarning || null, this.legacy = t.legacy || !1, this.json = t.json || !1, this.listener = t.listener || null, this.implicitTypes = this.schema.compiledImplicit, this.typeMap = this.schema.compiledTypeMap, this.length = e.length, this.position = 0, this.line = 0, this.lineStart = 0, this.lineIndent = 0, this.firstTabInLine = -1, this.documents = [];
}
function Vr(e, t) {
var n = { name: e.filename, buffer: e.input.slice(0, -1), position: e.position, line: e.line, column: e.position - e.lineStart };
return n.snippet = bd(n), new se(t, n);
}
function w(e, t) {
throw Vr(e, t);
}
function nt(e, t) {
e.onWarning && e.onWarning.call(null, Vr(e, t));
}
var _n = { YAML: function(e, t, n) {
var r, o, s;
e.version !== null && w(e, "duplication of %YAML directive"), n.length !== 1 && w(e, "YAML directive accepts exactly one argument"), r = /^([0-9]+)\.([0-9]+)$/.exec(n[0]), r === null && w(e, "ill-formed argument of the YAML directive"), o = parseInt(r[1], 10), s = parseInt(r[2], 10), o !== 1 && w(e, "unacceptable YAML version of the document"), e.version = n[0], e.checkLineBreaks = s < 2, s !== 1 && s !== 2 && nt(e, "unsupported YAML version of the document");
}, TAG: function(e, t, n) {
var r, o;
n.length !== 2 && w(e, "TAG directive accepts exactly two arguments"), r = n[0], o = n[1], Hr.test(r) || w(e, "ill-formed tag handle (first argument) of the TAG directive"), fe.call(e.tagMap, r) && w(e, 'there is a previously declared suffix for "' + r + '" tag handle'), _r.test(o) || w(e, "ill-formed tag prefix (second argument) of the TAG directive");
try {
o = decodeURIComponent(o);
} catch {
w(e, "tag prefix is malformed: " + o);
}
e.tagMap[r] = o;
} };
function ue(e, t, n, r) {
var o, s, a, i;
if (t < n) {
if (i = e.input.slice(t, n), r) for (o = 0, s = i.length; o < s; o += 1) a = i.charCodeAt(o), a === 9 || 32 <= a && a <= 1114111 || w(e, "expected valid JSON character");
else Ef.test(i) && w(e, "the stream contains non-printable characters");
e.result += i;
}
}
function Fn(e, t, n, r) {
var o, s, a, i;
for (W.isObject(n) || w(e, "cannot merge mappings; the provided source object is unacceptable"), o = Object.keys(n), a = 0, i = o.length; a < i; a += 1) s = o[a], fe.call(t, s) || (t[s] = n[s], r[s] = !0);
}
function Ee(e, t, n, r, o, s, a, i, c) {
var l, d;
if (Array.isArray(o)) for (o = Array.prototype.slice.call(o), l = 0, d = o.length; l < d; l += 1) Array.isArray(o[l]) && w(e, "nested arrays are not supported inside keys"), typeof o == "object" && Dn(o[l]) === "[object Object]" && (o[l] = "[object Object]");
if (typeof o == "object" && Dn(o) === "[object Object]" && (o = "[object Object]"), o = String(o), t === null && (t = {}), r === "tag:yaml.org,2002:merge") if (Array.isArray(s)) for (l = 0, d = s.length; l < d; l += 1) Fn(e, t, s[l], n);
else Fn(e, t, s, n);
else !e.json && !fe.call(n, o) && fe.call(t, o) && (e.line = a || e.line, e.lineStart = i || e.lineStart, e.position = c || e.position, w(e, "duplicated mapping key")), o === "__proto__" ? Object.defineProperty(t, o, { configurable: !0, enumerable: !0, writable: !0, value: s }) : t[o] = s, delete n[o];
return t;
}
function Gt(e) {
var t;
t = e.input.charCodeAt(e.position), t === 10 ? e.position++ : t === 13 ? (e.position++, e.input.charCodeAt(e.position) === 10 && e.position++) : w(e, "a line break is expected"), e.line += 1, e.lineStart = e.position, e.firstTabInLine = -1;
}
function _(e, t, n) {
for (var r = 0, o = e.input.charCodeAt(e.position); o !== 0; ) {
for (; Se(o); ) o === 9 && e.firstTabInLine === -1 && (e.firstTabInLine = e.position), o = e.input.charCodeAt(++e.position);
if (t && o === 35) do
o = e.input.charCodeAt(++e.position);
while (o !== 10 && o !== 13 && o !== 0);
if (oe(o)) for (Gt(e), o = e.input.charCodeAt(e.position), r++, e.lineIndent = 0; o === 32; ) e.lineIndent++, o = e.input.charCodeAt(++e.position);
else break;
}
return n !== -1 && r !== 0 && e.lineIndent < n && nt(e, "deficient indentation"), r;
}
function ct(e) {
var t = e.position, n;
return n = e.input.charCodeAt(t), !!((n === 45 || n === 46) && n === e.input.charCodeAt(t + 1) && n === e.input.charCodeAt(t + 2) && (t += 3, n = e.input.charCodeAt(t), n === 0 || Y(n)));
}
function zt(e, t) {
t === 1 ? e.result += " " : t > 1 && (e.result += W.repeat(`
`, t - 1));
}
function Bf(e, t, n) {
var r, o, s, a, i, c, l, d, f = e.kind, g = e.result, p;
if (p = e.input.charCodeAt(e.position), Y(p) || we(p) || p === 35 || p === 38 || p === 42 || p === 33 || p === 124 || p === 62 || p === 39 || p === 34 || p === 37 || p === 64 || p === 96 || (p === 63 || p === 45) && (o = e.input.charCodeAt(e.position + 1), Y(o) || n && we(o))) return !1;
for (e.kind = "scalar", e.result = "", s = a = e.position, i = !1; p !== 0; ) {
if (p === 58) {
if (o = e.input.charCodeAt(e.position + 1), Y(o) || n && we(o)) break;
} else if (p === 35) {
if (r = e.input.charCodeAt(e.position - 1), Y(r)) break;
} else {
if (e.position === e.lineStart && ct(e) || n && we(p)) break;
if (oe(p)) if (c = e.line, l = e.lineStart, d = e.lineIndent, _(e, !1, -1), e.lineIndent >= t) {
i = !0, p = e.input.charCodeAt(e.position);
continue;
} else {
e.position = a, e.line = c, e.lineStart = l, e.lineIndent = d;
break;
}
}
i && (ue(e, s, a, !1), zt(e, e.line - c), s = a = e.position, i = !1), Se(p) || (a = e.position + 1), p = e.input.charCodeAt(++e.position);
}
return ue(e, s, a, !1), e.result ? !0 : (e.kind = f, e.result = g, !1);
}
function Rf(e, t) {
var n, r, o;
if (n = e.input.charCodeAt(e.position), n !== 39) return !1;
for (e.kind = "scalar", e.result = "", e.position++, r = o = e.position; (n = e.input.charCodeAt(e.position)) !== 0; ) if (n === 39) if (ue(e, r, e.position, !0), n = e.input.charCodeAt(++e.position), n === 39) r = e.position, e.position++, o = e.position;
else return !0;
else oe(n) ? (ue(e, r, o, !0), zt(e, _(e, !1, t)), r = o = e.position) : e.position === e.lineStart && ct(e) ? w(e, "unexpected end of the document within a single quoted scalar") : (e.position++, o = e.position);
w(e, "unexpected end of the stream within a single quoted scalar");
}
function Nf(e, t) {
var n, r, o, s, a, i;
if (i = e.input.charCodeAt(e.position), i !== 34) return !1;
for (e.kind = "scalar", e.result = "", e.position++, n = r = e.position; (i = e.input.charCodeAt(e.position)) !== 0; ) {
if (i === 34) return ue(e, n, e.position, !0), e.position++, !0;
if (i === 92) {
if (ue(e, n, e.position, !0), i = e.input.charCodeAt(++e.position), oe(i)) _(e, !1, t);
else if (i < 256 && Fr[i]) e.result += qr[i], e.position++;
else if ((a = Cf(i)) > 0) {
for (o = a, s = 0; o > 0; o--) i = e.input.charCodeAt(++e.position), (a = Af(i)) >= 0 ? s = (s << 4) + a : w(e, "expected hexadecimal character");
e.result += Lf(s), e.position++;
} else w(e, "unknown escape sequence");
n = r = e.position;
} else oe(i) ? (ue(e, n, r, !0), zt(e, _(e, !1, t)), n = r = e.position) : e.position === e.lineStart && ct(e) ? w(e, "unexpected end of the document within a double quoted scalar") : (e.position++, r = e.position);
}
w(e, "unexpected end of the stream within a double quoted scalar");
}
function Uf(e, t) {
var n = !0, r, o, s, a = e.tag, i, c = e.anchor, l, d, f, g, p, h = /* @__PURE__ */ Object.create(null), b, m, S, v;
if (v = e.input.charCodeAt(e.position), v === 91) d = 93, p = !1, i = [];
else if (v === 123) d = 125, p = !0, i = {};
else return !1;
for (e.anchor !== null && (e.anchorMap[e.anchor] = i), v = e.input.charCodeAt(++e.position); v !== 0; ) {
if (_(e, !0, t), v = e.input.charCodeAt(e.position), v === d) return e.position++, e.tag = a, e.anchor = c, e.kind = p ? "mapping" : "sequence", e.result = i, !0;
n ? v === 44 && w(e, "expected the node content, but found ','") : w(e, "missed comma between flow collection entries"), m = b = S = null, f = g = !1, v === 63 && (l = e.input.charCodeAt(e.position + 1), Y(l) && (f = g = !0, e.position++, _(e, !0, t))), r = e.line, o = e.lineStart, s = e.position, je(e, t, et, !1, !0), m = e.tag, b = e.result, _(e, !0, t), v = e.input.charCodeAt(e.position), (g || e.line === r) && v === 58 && (f = !0, v = e.input.charCodeAt(++e.position), _(e, !0, t), je(e, t, et, !1, !0), S = e.result), p ? Ee(e, i, h, m, b, S, r, o, s) : f ? i.push(Ee(e, null, h, m, b, S, r, o, s)) : i.push(b), _(e, !0, t), v = e.input.charCodeAt(e.position), v === 44 ? (n = !0, v = e.input.charCodeAt(++e.position)) : n = !1;
}
w(e, "unexpected end of the stream within a flow collection");
}
function Mf(e, t) {
var n, r, o = vt, s = !1, a = !1, i = t, c = 0, l = !1, d, f;
if (f = e.input.charCodeAt(e.position), f === 124) r = !1;
else if (f === 62) r = !0;
else return !1;
for (e.kind = "scalar", e.result = ""; f !== 0; ) if (f = e.input.charCodeAt(++e.position), f === 43 || f === 45) vt === o ? o = f === 43 ? Mn : wf : w(e, "repeat of a chomping mode identifier");
else if ((d = Pf(f)) >= 0) d === 0 ? w(e, "bad explicit indentation width of a block scalar; it cannot be less than one") : a ? w(e, "repeat of an indentation width identifier") : (i = t + d - 1, a = !0);
else break;
if (Se(f)) {
do
f = e.input.charCodeAt(++e.position);
while (Se(f));
if (f === 35) do
f = e.input.charCodeAt(++e.position);
while (!oe(f) && f !== 0);
}
for (; f !== 0; ) {
for (Gt(e), e.lineIndent = 0, f = e.input.charCodeAt(e.position); (!a || e.lineIndent < i) && f === 32; ) e.lineIndent++, f = e.input.charCodeAt(++e.position);
if (!a && e.lineIndent > i && (i = e.lineIndent), oe(f)) {
c++;
continue;
}
if (e.lineIndent < i) {
o === Mn ? e.result += W.repeat(`
`, s ? 1 + c : c) : o === vt && s && (e.result += `
`);
break;
}
for (r ? Se(f) ? (l = !0, e.result += W.repeat(`
`, s ? 1 + c : c)) : l ? (l = !1, e.result += W.repeat(`
`, c + 1)) : c === 0 ? s && (e.result += " ") : e.result += W.repeat(`
`, c) : e.result += W.repeat(`
`, s ? 1 + c : c), s = !0, a = !0, c = 0, n = e.position; !oe(f) && f !== 0; ) f = e.input.charCodeAt(++e.position);
ue(e, n, e.position, !1);
}
return !0;
}
function qn(e, t) {
var n, r = e.tag, o = e.anchor, s = [], a, i = !1, c;
if (e.firstTabInLine !== -1) return !1;
for (e.anchor !== null && (e.anchorMap[e.anchor] = s), c = e.input.charCodeAt(e.position); c !== 0 && (e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, w(e, "tab characters must not be used in indentation")), !(c !== 45 || (a = e.input.charCodeAt(e.position + 1), !Y(a)))); ) {
if (i = !0, e.position++, _(e, !0, -1) && e.lineIndent <= t) {
s.push(null), c = e.input.charCodeAt(e.position);
continue;
}
if (n = e.line, je(e, t, Dr, !1, !0), s.push(e.result), _(e, !0, -1), c = e.input.charCodeAt(e.position), (e.line === n || e.lineIndent > t) && c !== 0) w(e, "bad indentation of a sequence entry");
else if (e.lineIndent < t) break;
}
return i ? (e.tag = r, e.anchor = o, e.kind = "sequence", e.result = s, !0) : !1;
}
function Df(e, t, n) {
var r, o, s, a, i, c, l = e.tag, d = e.anchor, f = {}, g = /* @__PURE__ */ Object.create(null), p = null, h = null, b = null, m = !1, S = !1, v;
if (e.firstTabInLine !== -1) return !1;
for (e.anchor !== null && (e.anchorMap[e.anchor] = f), v = e.input.charCodeAt(e.position); v !== 0; ) {
if (!m && e.firstTabInLine !== -1 && (e.position = e.firstTabInLine, w(e, "tab characters must not be used in indentation")), r = e.input.charCodeAt(e.position + 1), s = e.line, (v === 63 || v === 58) && Y(r)) v === 63 ? (m && (Ee(e, f, g, p, h, null, a, i, c), p = h = b = null), S = !0, m = !0, o = !0) : m ? (m = !1, o = !0) : w(e, "incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"), e.position += 1, v = r;
else {
if (a = e.line, i = e.lineStart, c = e.position, !je(e, n, Mr, !1, !0)) break;
if (e.line === s) {
for (v = e.input.charCodeAt(e.position); Se(v); ) v = e.input.charCodeAt(++e.position);
if (v === 58) v = e.input.charCodeAt(++e.position), Y(v) || w(e, "a whitespace character is expected after the key-value separator within a block mapping"), m && (Ee(e, f, g, p, h, null, a, i, c), p = h = b = null), S = !0, m = !1, o = !1, p = e.tag, h = e.result;
else if (S) w(e, "can not read an implicit mapping pair; a colon is missed");
else return e.tag = l, e.anchor = d, !0;
} else if (S) w(e, "can not read a block mapping entry; a multiline key may not be an implicit key");
else return e.tag = l, e.anchor = d, !0;
}
if ((e.line === s || e.lineIndent > t) && (m && (a = e.line, i = e.lineStart, c = e.position), je(e, t, tt, !0, o) && (m ? h = e.result : b = e.result), m || (Ee(e, f, g, p, h, b, a, i, c), p = h = b = null), _(e, !0, -1), v = e.input.charCodeAt(e.position)), (e.line === s || e.lineIndent > t) && v !== 0) w(e, "bad indentation of a mapping entry");
else if (e.lineIndent < t) break;
}
return m && Ee(e, f, g, p, h, null, a, i, c), S && (e.tag = l, e.anchor = d, e.kind = "mapping", e.result = f), S;
}
function Hf(e) {
var t, n = !1, r = !1, o, s, a;
if (a = e.input.charCodeAt(e.position), a !== 33) return !1;
if (e.tag !== null && w(e, "duplication of a tag property"), a = e.input.charCodeAt(++e.position), a === 60 ? (n = !0, a = e.input.charCodeAt(++e.position)) : a === 33 ? (r = !0, o = "!!", a = e.input.charCodeAt(++e.position)) : o = "!", t = e.position, n) {
do
a = e.input.charCodeAt(++e.position);
while (a !== 0 && a !== 62);
e.position < e.length ? (s = e.input.slice(t, e.position), a = e.input.charCodeAt(++e.position)) : w(e, "unexpected end of the stream within a verbatim tag");
} else {
for (; a !== 0 && !Y(a); ) a === 33 && (r ? w(e, "tag suffix cannot contain exclamation marks") : (o = e.input.slice(t - 1, e.position + 1), Hr.test(o) || w(e, "named tag handle cannot contain such characters"), r = !0, t = e.position + 1)), a = e.input.charCodeAt(++e.position);
s = e.input.slice(t, e.position), jf.test(s) && w(e, "tag suffix cannot contain flow indicator characters");
}
s && !_r.test(s) && w(e, "tag name cannot contain such characters: " + s);
try {
s = decodeURIComponent(s);
} catch {
w(e, "tag name is malformed: " + s);
}
return n ? e.tag = s : fe.call(e.tagMap, o) ? e.tag = e.tagMap[o] + s : o === "!" ? e.tag = "!" + s : o === "!!" ? e.tag = "tag:yaml.org,2002:" + s : w(e, 'undeclared tag handle "' + o + '"'), !0;
}
function _f(e) {
var t, n;
if (n = e.input.charCodeAt(e.position), n !== 38) return !1;
for (e.anchor !== null && w(e, "duplication of an anchor property"), n = e.input.charCodeAt(++e.position), t = e.position; n !== 0 && !Y(n) && !we(n); ) n = e.input.charCodeAt(++e.position);
return e.position === t && w(e, "name of an anchor node must contain at least one character"), e.anchor = e.input.slice(t, e.position), !0;
}
function Ff(e) {
var t, n, r;
if (r = e.input.charCodeAt(e.position), r !== 42) return !1;
for (r = e.input.charCodeAt(++e.position), t = e.position; r !== 0 && !Y(r) && !we(r); ) r = e.input.charCodeAt(++e.position);
return e.position === t && w(e, "name of an alias node must contain at least one character"), n = e.input.slice(t, e.position), fe.call(e.anchorMap, n) || w(e, 'unidentified alias "' + n + '"'), e.result = e.anchorMap[n], _(e, !0, -1), !0;
}
function je(e, t, n, r, o) {
var s, a, i, c = 1, l = !1, d = !1, f, g, p, h, b, m;
if (e.listener !== null && e.listener("open", e), e.tag = null, e.anchor = null, e.kind = null, e.result = null, s = a = i = tt === n || Dr === n, r && _(e, !0, -1) && (l = !0, e.lineIndent > t ? c = 1 : e.lineIndent === t ? c = 0 : e.lineIndent < t && (c = -1)), c === 1) for (; Hf(e) || _f(e); ) _(e, !0, -1) ? (l = !0, i = s, e.lineIndent > t ? c = 1 : e.lineIndent === t ? c = 0 : e.lineIndent < t && (c = -1)) : i = !1;
if (i && (i = l || o), (c === 1 || tt === n) && (et === n || Mr === n ? b = t : b = t + 1, m = e.position - e.lineStart, c === 1 ? i && (qn(e, m) || Df(e, m, b)) || Uf(e, b) ? d = !0 : (a && Mf(e, b) || Rf(e, b) || Nf(e, b) ? d = !0 : Ff(e) ? (d = !0, (e.tag !== null || e.anchor !== null) && w(e, "alias node should not have any properties")) : Bf(e, b, et === n) && (d = !0, e.tag === null && (e.tag = "?")), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : c === 0 && (d = i && qn(e, m))), e.tag === null) e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
else if (e.tag === "?") {
for (e.result !== null && e.kind !== "scalar" && w(e, 'unacceptable node kind for !<?> tag; it should be "scalar", not "' + e.kind + '"'), f = 0, g = e.implicitTypes.length; f < g; f += 1) if (h = e.implicitTypes[f], h.resolve(e.result)) {
e.result = h.construct(e.result), e.tag = h.tag, e.anchor !== null && (e.anchorMap[e.anchor] = e.result);
break;
}
} else if (e.tag !== "!") {
if (fe.call(e.typeMap[e.kind || "fallback"], e.tag)) h = e.typeMap[e.kind || "fallback"][e.tag];
else for (h = null, p = e.typeMap.multi[e.kind || "fallback"], f = 0, g = p.length; f < g; f += 1) if (e.tag.slice(0, p[f].tag.length) === p[f].tag) {
h = p[f];
break;
}
h || w(e, "unknown tag !<" + e.tag + ">"), e.result !== null && h.kind !== e.kind && w(e, "unacceptable node kind for !<" + e.tag + '> tag; it should be "' + h.kind + '", not "' + e.kind + '"'), h.resolve(e.result, e.tag) ? (e.result = h.construct(e.result, e.tag), e.anchor !== null && (e.anchorMap[e.anchor] = e.result)) : w(e, "cannot resolve a node with !<" + e.tag + "> explicit tag");
}
return e.listener !== null && e.listener("close", e), e.tag !== null || e.anchor !== null || d;
}
function qf(e) {
var t = e.position, n, r, o, s = !1, a;
for (e.version = null, e.checkLineBreaks = e.legacy, e.tagMap = /* @__PURE__ */ Object.create(null), e.anchorMap = /* @__PURE__ */ Object.create(null); (a = e.input.charCodeAt(e.position)) !== 0 && (_(e, !0, -1), a = e.input.charCodeAt(e.position), !(e.lineIndent > 0 || a !== 37)); ) {
for (s = !0, a = e.input.charCodeAt(++e.position), n = e.position; a !== 0 && !Y(a); ) a = e.input.charCodeAt(++e.position);
for (r = e.input.slice(n, e.position), o = [], r.length < 1 && w(e, "directive name must not be less than one character in length"); a !== 0; ) {
for (; Se(a); ) a = e.input.charCodeAt(++e.position);
if (a === 35) {
do
a = e.input.charCodeAt(++e.position);
while (a !== 0 && !oe(a));
break;
}
if (oe(a)) break;
for (n = e.position; a !== 0 && !Y(a); ) a = e.input.charCodeAt(++e.position);
o.push(e.input.slice(n, e.position));
}
a !== 0 && Gt(e), fe.call(_n, r) ? _n[r](e, r, o) : nt(e, 'unknown document directive "' + r + '"');
}
if (_(e, !0, -1), e.lineIndent === 0 && e.input.charCodeAt(e.position) === 45 && e.input.charCodeAt(e.position + 1) === 45 && e.input.charCodeAt(e.position + 2) === 45 ? (e.position += 3, _(e, !0, -1)) : s && w(e, "directives end mark is expected"), je(e, e.lineIndent - 1, tt, !1, !0), _(e, !0, -1), e.checkLineBreaks && xf.test(e.input.slice(t, e.position)) && nt(e, "non-ASCII line breaks are interpreted as content"), e.documents.push(e.result), e.position === e.lineStart && ct(e)) {
e.input.charCodeAt(e.position) === 46 && (e.position += 3, _(e, !0, -1));
return;
}
if (e.position < e.length - 1) w(e, "end of the stream or a document separator is expected");
else return;
}
function Vf(e, t) {
e = String(e), t = t || {}, e.length !== 0 && (e.charCodeAt(e.length - 1) !== 10 && e.charCodeAt(e.length - 1) !== 13 && (e += `
`), e.charCodeAt(0) === 65279 && (e = e.slice(1)));
var n = new If(e, t), r = e.indexOf("\0");
for (r !== -1 && (n.position = r, w(n, "null byte is not allowed in input")), n.input += "\0"; n.input.charCodeAt(n.position) === 32; ) n.lineIndent += 1, n.position += 1;
for (; n.position < n.length - 1; ) qf(n);
return n.documents;
}
function Jf(e, t) {
var n = Vf(e, t);
if (n.length !== 0) {
if (n.length === 1) return n[0];
throw new se("expected a single document in the stream, but found more");
}
}
var Gf = Jf, zf = { load: Gf }, Wf = zf.load;
function Yf(e, t) {
const n = Wf(e, t);
return id(e, n, t), n;
}
const ve = Symbol("origin"), St = /* @__PURE__ */ new Map();
function Kf(e, t) {
St.has(e) || St.set(e, /* @__PURE__ */ new Map());
const n = St.get(e);
if (n.has(t))
return n.get(t);
const r = t.split("/").slice(1);
let o = e;
for (const s of r) {
if (!o || typeof o != "object") {
o = null;
break;
}
o = o[s] ?? null;
}
return n.set(t, o), o;
}
function Ke(e) {
if (Array.isArray(e)) {
const t = Array.from({ length: e.length });
for (let n = 0; n < e.length; n++)
t[n] = e[n] && typeof e[n] == "object" ? Ke(e[n]) : e[n];
return t;
}
if (Object.prototype.toString.call(e) === "[object Object]") {
const t = {};
for (const n in e)
if (n === "__proto__")
Object.defineProperty(t, n, {
value: Ke(e[n]),
configurable: !0,
enumerable: !0,
writable: !0
});
else {
const r = e[n];
t[n] = r && typeof r == "object" ? Ke(r) : r;
}
return t;
}
return e;
}
function Jr(e, t = /* @__PURE__ */ new WeakSet()) {
if (e && typeof e == "object" && !t.has(e)) {
t.add(e), Object.defineProperty(e, ve, { value: e, enumerable: !1 });
const n = Array.isArray(e) ? e : Object.values(e);
for (const r of n)
Jr(r, t);
}
}
function Qf(e) {
const t = Array.isArray(e) ? [...e] : { ...e };
return Object.defineProperty(t, ve, {
value: e[ve] || e,
enumerable: !1
}), t;
}
const Xf = /* @__PURE__ */ new Set([
"title",
"description",
"summary",
"default",
"deprecated",
"readOnly",
"writeOnly",
"examples",
"example"
]), $t = /* @__PURE__ */ new Map();
function Zf(e) {
if ($t.has(e))
return $t.get(e);
const t = /* @__PURE__ */ new Set(), n = Ke(e);
Jr(n);
const r = (s) => {
if (typeof s == "object" && s !== null) {
if (t.has(s))
return s;
if (t.add(s), Array.isArray(s))
for (let a = 0; a < s.length; a++)
s[a] = r(s[a]);
else {
if ("$ref" in s && typeof s.$ref == "string") {
let a = s;
do
a = Kf(n, a.$ref);
while (a != null && a.$ref);
a = Qf(a), a = r(a);
for (const i in s)
i !== "$ref" && Xf.has(i) && (a[i] = s[i]);
return a;
}
for (const a in s)
s[a] = r(s[a]);
}
}
return s;
}, o = r(n);
return $t.set(e, o), o;
}
async function ep(e) {
var n, r, o, s, a;
if (!(e != null && e.paths))
return e;
const t = hr(((r = (n = e.servers) == null ? void 0 : n[0]) == null ? void 0 : r.url) || "");
for (const [i, c] of Object.entries(e.paths))
for (const l of z) {
const d = c[l];
if (!d)
continue;
const f = ((s = (o = d.securityUi) == null ? void 0 : o[0]) == null ? void 0 : s.schemes) || [], g = Object.keys(((a = d.requestBody) == null ? void 0 : a.content) || {}), h = g.map((m) => {
var S, v, T;
return Object.values(((T = (v = (S = d.requestBody) == null ? void 0 : S.content) == null ? void 0 : v[m]) == null ? void 0 : T.examples) || {});
}).flat().find((m) => m == null ? void 0 : m.isAutogenerated), b = yr({
path: i,
method: l,
baseUrl: t,
parameters: d.parameters || [],
authorizations: Object.entries(f).map(([m, S]) => ({
...S,
name: String(m),
label: String(m)
})),
body: (h == null ? void 0 : h.value) || void 0,
headers: {
...Ou().getCodeSamplesDefaultHeaders() || {}
},
variables: {},
contentType: g.length > 0 ? g[0] : void 0
});
d.codeSamples = await Promise.all(
_t.map(async (m) => ({
...m,
source: await br(m.lang, b)
}))
);
}
return e;
}
function tp(e) {
e.paths = e.paths || {};
for (const t of Object.keys(e.paths)) {
const n = e.paths[t];
for (const r of z) {
const o = n[r];
o && (o.operationId || (o.operationId = `${r}${t.replace(/\//g, "-")}`));
}
}
return e;
}
function np(e) {
e.paths = e.paths || {};
for (const t of Object.keys(e.paths)) {
const n = e.paths[t];
for (const r of z) {
const o = n[r];
o && (o.summary || (o.summary = `${r.toUpperCase()} ${t}`));
}
}
return e;
}
function rp({
spec: e,
defaultTag: t = "Default",
defaultTagDescription: n = ""
}) {
const r = /* @__PURE__ */ new Set();
e.paths = e.paths || {};
for (const [, o] of Object.entries(e.paths))
for (const s of z) {
if (!o || !o[s])
continue;
const a = o[s], i = a.tags || [t];
a.tags = i, i.forEach((c) => r.add(c));
}
return e.tags = e.tags || [], r.has(t) && !e.tags.find((o) => o.name === t) && e.tags.push({
name: t,
description: n
}), e;
}
function Gr(e, t = !1) {
return op(e, t);
}
function op(e, t) {
return Array.isArray(e) ? e.map((n) => _e(n, t)) : _e(e, t);
}
function _e(e, t) {
var n, r;
return (n = e.meta) != null && n.isCircularReference ? "[Circular Reference]" : (r = e.meta) != null && r.isConstant ? ip(e) : Wr(e, "array") ? zr(e, t) : ap(e) ? Vn(e, t) : sp(e) ? Vn({
...e,
types: [e.types.find((o) => o !== "null") ?? "null"]
}, t) : Yr(e) ? Kr(e, t) : cp(e, "object") ? Bt(e.properties || [], t) : Ae(e.types[0] ?? "string", e.defaultValue);
}
function zr(e, t) {
var n;
return Yr(e) ? [Kr(e, t)] : (n = e.meta) != null && n.hasPrefixItems && e.properties && Array.isArray(e.properties) ? e.properties.map((r) => _e(r, t)) : e.properties && Array.isArray(e.properties) ? [Bt(e.properties, t)] : e.subtype ? e.subtype === "object" && e.properties ? [Bt(e.properties, t)] : t ? [qe(e) ?? Ae(e.subtype, e.defaultValue)] : [Ae(e.subtype, e.defaultValue)] : [];
}
function Bt(e, t) {
return e.reduce((n, r) => (Wr(r, "array") ? n[r.name] = zr(r, t) : n[r.name] = _e(r, t), n), {});
}
function Vn(e, t) {
var n;
if (t) {
const r = qe(e);
if (r != null)
return r;
}
return ((n = e.constraints) == null ? void 0 : n.format) === "binary" ? "" : Ae(e.types[0] ?? "string", e.defaultValue);
}
function ip(e) {
const t = qe(e);
return t ?? Ae(e.types[0] ?? "string", e.defaultValue);
}
function Ae(e, t) {
if (t !== void 0)
return t;
switch (e) {
case "string":
return "string";
case "number":
case "integer":
return 0;
case "float":
return 0;
case "boolean":
return !0;
case "null":
return null;
case "array":
return [];
case "object":
return {};
default:
return;
}
}
function Wr(e, t) {
var n;
return ((n = e.types) == null ? void 0 : n.length) === 1 && e.types[0] === t;
}
function ap(e) {
var t;
return ((t = e.types) == null ? void 0 : t.length) === 1 && e.types[0] != null && uo.includes(e.types[0]);
}
function sp(e) {
var t;
return (t = e.types) == null ? void 0 : t.every((n) => n && uo.includes(n));
}
function cp(e, t) {
var n;
return ((n = e.types) == null ? void 0 : n.includes(t)) ?? !1;
}
function lp(e) {
var t;
return !!((t = e.meta) != null && t.isOneOf) && Array.isArray(e.properties);
}
function up(e) {
var t;
return !!((t = e.meta) != null && t.isAnyOf) && Array.isArray(e.properties);
}
function Yr(e) {
return lp(e) || up(e);
}
function Kr(e, t) {
return e.properties && e.properties.length > 0 ? _e(e.properties[0], t) : t ? qe(e) : Ae(e.types[0] ?? "string", e.defaultValue);
}
var Z = {}, ge = {}, We = {}, kt = {}, he = {}, Jn;
function Qr() {
return Jn || (Jn = 1, Object.defineProperty(he, "__esModule", { value: !0 }), he.DEFAULTS = he.TAGS = void 0, he.TAGS = {
OPENING: "OPENING",
CLOSING: "CLOSING",
SELF_CLOSING: "SELF_CLOSING"
}, he.DEFAULTS = {
SPACE: " ",
NEW_LINE: `
`,
ATTR_KEY: "@",
CONTENT_KEY: "#",
EMPTY_STR: "",
DECLARATION: {
version: "1.0"
},
ENTITY_MAP: {
"<": "<",
">": ">",
"&": "&",
"'": "'",
'"': """
},
TYPE_HANDLER: (e) => [!0, e],
LEVEL: {
INIT: 0,
INCREMENT: 1
},
DOUBLE_QUOTES: {
ENABLE: !0,
DIASBLE: !1
},
MAKE_TAG: !0,
BEAUTIFY: {
ENABLE: !0,
DISABLE: !1
},
SELF_CLOSING: {
ENABLE: !0,
DISABLE: !1
},
get EMPTY_OBJ() {
return new Object();
},
get EMPTY_ARR() {
return new Array();
}
}), he;
}
var Tt = {}, Gn;
function Xr() {
return Gn || (Gn = 1, function(e) {
Object.defineProperty(e, "__esModule", { value: !0 }), e.objIsEmpty = e.keyExists = e.isUndef = e.isArr = e.isStr = e.isFunc = e.isObj = void 0;
const t = "{}", n = "[]", r = (d) => !!d && typeof d == "object";
e.isObj = r;
const o = (d) => typeof d == "function";
e.isFunc = o;
const s = (d) => typeof d == "string";
e.isStr = s;
const a = (d) => Array.isArray(d);
e.isArr = a;
const i = (d) => typeof d > "u";
e.isUndef = i;
const c = (d, f) => (0, e.isObj)(d) && f in d;
e.keyExists = c;
const l = (d) => (0, e.isObj)(d) && [t, n].includes(JSON.stringify(d));
e.objIsEmpty = l;
}(Tt)), Tt;
}
var zn;
function dp() {
return zn || (zn = 1, function(e) {
Object.defineProperty(e, "__esModule", { value: !0 }), e.setDeclaration = e.setAttributes = e.setStringVal = e.createTag = e.checkChildTags = e.createEntityHandler = e.beautify = void 0;
const t = Qr(), n = Xr(), r = (l, d = t.DEFAULTS.LEVEL.INIT, f = t.DEFAULTS.BEAUTIFY.ENABLE) => {
let g = l;
if (!f)
return t.DEFAULTS.EMPTY_STR;
if (l === t.DEFAULTS.SPACE) {
if (g = t.DEFAULTS.EMPTY_STR, d)
for (let p = t.DEFAULTS.LEVEL.INIT; p < d; p += t.DEFAULTS.LEVEL.INCREMENT)
g += l;
return g;
}
return g;
};
e.beautify = r;
const o = (l) => {
const d = l && RegExp(Object.keys(l).join("|"), "gi");
return (f) => d ? f.replace(d, (g) => (l == null ? void 0 : l[g]) || t.DEFAULTS.EMPTY_STR) : f;
};
e.createEntityHandler = o;
const s = (l, d, f) => {
if ((0, n.isObj)(l) && !(0, n.isArr)(l)) {
const g = Object.keys(l);
return !!(g.length && (g.find((p) => p === f && (0, n.isObj)(l[p])) || g.some((p) => ![d, f].includes(p))));
} else if ((0, n.isArr)(l))
return !!l.length;
return !1;
};
e.checkChildTags = s, e.createTag = {
[t.TAGS.OPENING]: (l) => `${(0, e.beautify)(t.DEFAULTS.SPACE, l.level, l.beautify)}<${l.name}${(0, e.setAttributes)(l.attributes, l.setEntities)}${l.selfClosing ? `/>${(0, e.beautify)(t.DEFAULTS.NEW_LINE, t.DEFAULTS.LEVEL.INIT, l.beautify)}` : ">"}`,
[t.TAGS.CLOSING]: (l) => `${l.hasChidTags ? (0, e.beautify)(t.DEFAULTS.SPACE, l.level, l.beautify) : t.DEFAULTS.EMPTY_STR}</${l.name}>${(0, e.beautify)(t.DEFAULTS.NEW_LINE, t.DEFAULTS.LEVEL.INIT, l.beautify)}`
};
const a = (l, d, f) => {
let g = (0, n.isFunc)(l) ? l() : l;
return (0, n.isStr)(g) && (g = f && f(g)), d ? `"${g}"` : `${g}`;
};
e.setStringVal = a;
const i = (l, d) => {
let f = t.DEFAULTS.EMPTY_STR;
return l && Object.keys(l).forEach((g) => {
f += ` ${g}=${(0, e.setStringVal)(l[g], t.DEFAULTS.DOUBLE_QUOTES.ENABLE, d)}`;
}), f;
};
e.setAttributes = i;
const c = (l, d, f = t.DEFAULTS.BEAUTIFY.ENABLE) => {
const g = Object.assign({}, (0, n.isObj)(l) ? l : t.DEFAULTS.DECLARATION);
return `<?xml${(0, e.setAttributes)(g, d)}?>${(0, e.beautify)(t.DEFAULTS.NEW_LINE, t.DEFAULTS.LEVEL.INIT, f)}`;
};
e.setDeclaration = c;
}(kt)), kt;
}
var Wn;
function fp() {
if (Wn) return We;
Wn = 1, Object.defineProperty(We, "__esModule", { value: !0 });
const e = dp(), t = Xr(), n = Qr();
return We.default = (r = n.DEFAULTS.EMPTY_OBJ, o = n.DEFAULTS.EMPTY_OBJ) => {
const s = (o == null ? void 0 : o.attrKey) || n.DEFAULTS.ATTR_KEY, a = (o == null ? void 0 : o.contentKey) || n.DEFAULTS.CONTENT_KEY, i = (0, e.createEntityHandler)(Object.assign({}, (0, t.isObj)(o == null ? void 0 : o.entityMap) ? o == null ? void 0 : o.entityMap : n.DEFAULTS.ENTITY_MAP));
let c = (0, e.setDeclaration)(o == null ? void 0 : o.declaration, i, o == null ? void 0 : o.beautify);
const l = (f, g, p) => {
var h;
const b = (g == null ? void 0 : g[s]) || n.DEFAULTS.EMPTY_OBJ;
let m = (0, t.keyExists)(g, a) ? g[a] : g;
m = (0, t.isFunc)(m) ? m() : m;
let [S, v] = (0, t.isFunc)(o == null ? void 0 : o.typeHandler) ? (h = o.typeHandler) === null || h === void 0 ? void 0 : h.call(n.DEFAULTS.EMPTY_OBJ, m) : [n.DEFAULTS.MAKE_TAG, m];
v = (0, t.objIsEmpty)(v) ? n.DEFAULTS.EMPTY_STR : v;
const T = (0, e.checkChildTags)(v, s, a), A = ((0, t.keyExists)(o, "selfClosing") ? o.selfClosing : n.DEFAULTS.SELF_CLOSING.ENABLE) && [void 0, null, ""].includes(v);
!S || [s, a].includes(f) || !(0, t.isArr)(v) && (c += f && e.createTag[n.TAGS.OPENING]({ attributes: b, level: p, name: f, setEntities: i, beautify: o == null ? void 0 : o.beautify, selfClosing: A }) || n.DEFAULTS.EMPTY_STR, A) || (T ? (0, t.isArr)(v) ? v.forEach((P) => {
l(f, P, p);
}) : (c += (0, e.beautify)(n.DEFAULTS.NEW_LINE, n.DEFAULTS.LEVEL.INIT, o == null ? void 0 : o.beautify), Object.keys(v).forEach((P) => {
l(P, v[P], p + n.DEFAULTS.LEVEL.INCREMENT);
})) : c += (0, e.setStringVal)(v, n.DEFAULTS.DOUBLE_QUOTES.DIASBLE, i), (0, t.isArr)(v) || (c += f && e.createTag[n.TAGS.CLOSING]({ level: p, hasChidTags: T, name: f, setEntities: i, beautify: o == null ? void 0 : o.beautify }) || n.DEFAULTS.EMPTY_STR));
};
return ((f) => ((0, t.isObj)(f) && Object.keys(f).forEach((g) => {
l(g, f[g], n.DEFAULTS.LEVEL.INIT);
}), c))(r);
}, We;
}
var Yn;
function pp() {
if (Yn) return ge;
Yn = 1;
var e = ge && ge.__importDefault || function(n) {
return n && n.__esModule ? n : { default: n };
};
Object.defineProperty(ge, "__esModule", { value: !0 }), ge.toXmlString = void 0;
const t = e(fp());
return ge.toXmlString = t.default, ge;
}
var Kn;
function gp() {
if (Kn) return Z;
Kn = 1;
var e = Z && Z.__createBinding || (Object.create ? function(o, s, a, i) {
i === void 0 && (i = a);
var c = Object.getOwnPropertyDescriptor(s, a);
(!c || ("get" in c ? !s.__esModule : c.writable || c.configurable)) && (c = { enumerable: !0, get: function() {
return s[a];
} }), Object.defineProperty(o, i, c);
} : function(o, s, a, i) {
i === void 0 && (i = a), o[i] = s[a];
}), t = Z && Z.__setModuleDefault || (Object.create ? function(o, s) {
Object.defineProperty(o, "default", { enumerable: !0, value: s });
} : function(o, s) {
o.default = s;
}), n = Z && Z.__importStar || function(o) {
if (o && o.__esModule) return o;
var s = {};
if (o != null) for (var a in o) a !== "default" && Object.prototype.hasOwnProperty.call(o, a) && e(s, o, a);
return t(s, o), s;
};
Object.defineProperty(Z, "__esModule", { value: !0 }), Z.jsXml = void 0;
const r = n(pp());
return Z.jsXml = r, Z;
}
var hp = gp();
function mp(e, t = !1) {
const n = Gr(e, t);
return hp.jsXml.toXmlString(n);
}
function yp(e) {
return gr(e) ? {
key: "XML",
summary: "XML",
valueGenerator: mp,
lang: "xml"
} : {
key: "JSON",
summary: "JSON",
valueGenerator: Gr,
lang: "json",
hideOnSchemaTabs: Dt(e) || Ht(e) || Ga(e)
};
}
function Zr(e, t, n = !1) {
const r = yp(e);
return {
[r.key]: bp(r, t, n)
};
}
function bp(e, t, n = !1) {
return {
summary: e.summary,
description: "",
value: e.valueGenerator(t, n),
isAutogenerated: !0,
lang: e.lang ?? "json",
hideOnSchemaTabs: e.hideOnSchemaTabs ?? !1
};
}
function Ot(e) {
var t, n;
return (e == null ? void 0 : e.examples) !== void 0 ? e.examples : ((t = e == null ? void 0 : e.schema) == null ? void 0 : t.examples) !== void 0 ? e.schema.examples : (e == null ? void 0 : e.example) !== void 0 ? [e.example] : (e == null ? void 0 : e.subexamples) !== void 0 ? e.subexamples : ((n = e == null ? void 0 : e.schema) == null ? void 0 : n.example) !== void 0 ? [e.schema.example] : (e == null ? void 0 : e.subexample) !== void 0 ? [e.subexample] : null;
}
const eo = [
"exclusiveMaximum",
"exclusiveMinimum",
"format",
"maximum",
"maxItems",
"maxLength",
"maxProperties",
"minimum",
"minItems",
"minLength",
"minProperties",
"multipleOf",
"pattern",
"uniqueItems",
"default"
];
function vp(e) {
return Object.keys(e).some((t) => eo.includes(t));
}
function Sp(e) {
return Object.entries(e).filter(([t]) => eo.includes(t)).reduce((t, [n, r]) => (t[n] = r, t), {});
}
function $p(e) {
return to({
key: "root",
value: e,
parent: null
}), e;
}
function to(e) {
const { value: t } = e;
if (typeof t != "object" || t === null)
return;
const n = kp(e.parent, t);
if (n)
e.parent.value[e.key] = {
type: "object",
circularReference: n
};
else
for (const [r, o] of Object.entries(t))
to({
key: r,
value: o,
parent: e
});
}
function kp(e, t) {
const n = t && t[ve] ? t[ve] : t;
for (; e; ) {
const r = e.value;
if ((r && r[ve] ? r[ve] : r) === n)
return no(e);
e = e.parent;
}
return null;
}
function no(e) {
return e ? `${no(e.parent)}/${e.key}` : "";
}
class H {
static createBaseProperty(t, n = {}, r = !1) {
const o = Array.isArray(n.type) ? n.type : [n.type || "string"], s = Ot(n), a = {
name: t,
types: o,
required: r,
...n.title && { title: n.title },
...n.description && { description: n.description },
...n.default !== void 0 && { defaultValue: n.default },
...n.externalDocs && { docs: n.externalDocs },
...s && { examples: s },
...n.nullable && { nullable: n.nullable }
};
return n.const !== void 0 && (a.meta = { ...a.meta || {}, isConstant: !0 }), vp(n) && (a.constraints = Sp(n)), Object.keys(n).forEach((i) => {
i.startsWith("x-") && (a.meta = a.meta || {}, a.meta.extra = a.meta.extra || {}, a.meta.extra[i] = n[i]);
}), a;
}
static createCircularReferenceProperty(t, n) {
return {
name: t,
types: ["object"],
required: !1,
description: `Circular reference to **${n}**`,
meta: { isCircularReference: !0 }
};
}
static createUnionProperty(t, n, r = "", o = {}, s = !1) {
const a = H.createBaseProperty(
r,
o,
s
), i = Array.from(
new Set(
t.map((f) => wt(f)).filter(Boolean)
)
);
i.length > 0 && (a.types = i);
const c = n === "oneOf", l = c ? "isOneOfItem" : "isAnyOfItem", d = c ? "isOneOf" : "isAnyOf";
return a.properties = t.map((f) => {
const g = H.schemaToUiProperty("", f);
return g.meta = { ...g.meta || {}, [l]: !0 }, g;
}), a.meta = { ...a.meta || {}, [d]: !0 }, a;
}
static createOneOfProperty(t, n = "", r = {}, o = !1) {
return H.createUnionProperty(t, "oneOf", n, r, o);
}
static createAnyOfProperty(t, n = "", r = {}, o = !1) {
return H.createUnionProperty(t, "anyOf", n, r, o);
}
static schemaToUiProperty(t, n, r = !1) {
if (!n || Object.keys(n).length === 0)
return {
name: t,
types: [],
required: r
};
if (n.circularReference)
return H.createCircularReferenceProperty(t, n.circularReference);
if (n.oneOf)
return H.createOneOfProperty(n.oneOf, t, n, r);
if (n.anyOf)
return H.createAnyOfProperty(n.anyOf, t, n, r);
if (n.const !== void 0) {
const s = H.createBaseProperty(t, n, r), a = wt(n);
a && (s.types = [a]);
const i = Ot(n) || n.const;
return i !== void 0 && (s.examples = Array.isArray(i) ? i : [i]), s.meta = { ...s.meta || {}, isConstant: !0 }, s;
}
if (n.enum) {
let s = [];
n.type ? s = Array.isArray(n.type) ? n.type : [n.type] : s = Tp(n.enum), s.length === 0 && (s = ["string"]);
const a = H.createBaseProperty(t, n, r);
return a.enum = n.enum, a.types = s, a;
}
const o = H.createBaseProperty(t, n, r);
if (Array.isArray(n.type) ? n.type.includes("array") : n.type === "array") {
if (n.items) {
const s = wt(n.items);
o.properties = s === "object" ? H.extractProperties(
n.items.properties,
n.items.required || [],
n.items.additionalProperties
) : void 0, s !== void 0 && (o.subtype = s);
const a = Ot(n.items);
if (a && (o.subexamples = a), n.items.const !== void 0 && (o.meta = { ...o.meta || {}, isConstant: !0 }), n.items.oneOf || n.items.anyOf) {
const i = !!n.items.oneOf, c = i ? n.items.oneOf : n.items.anyOf, l = i ? "isOneOf" : "isAnyOf", d = i ? "isOneOfItem" : "isAnyOfItem";
o.meta = { ...o.meta || {}, [l]: !0 }, o.properties = c.map((f) => {
const g = { ...f, type: n.items.type };
return {
...H.schemaToUiProperty("", g),
meta: { ...f.meta || {}, [d]: !0 }
};
});
}
if (s !== "object" && s !== "array" && !n.items.oneOf && !n.items.anyOf) {
const i = H.schemaToUiProperty("[item]", n.items);
(i.description || i.enum || i.constraints || i.docs) && (o.items = i);
}
}
if (n.prefixItems && Array.isArray(n.prefixItems) && (o.properties = n.prefixItems.map((s, a) => {
const i = H.schemaToUiProperty(
`[${a}]`,
s,
!1
);
return i.meta = {
...i.meta || {},
isPrefixItem: !0,
prefixItemIndex: a
}, i;
}), o.meta = {
...o.meta || {},
hasPrefixItems: !0
}), n.prefixItems && Array.isArray(n.prefixItems) && n.items) {
const s = H.schemaToUiProperty(
"[n+]",
// Name indicating "additional items".
n.items,
!1
);
s.meta = {
...s.meta || {},
isAdditionalItems: !0
}, o.properties = [
...o.properties || [],
s
], o.subtype = void 0;
}
} else (Array.isArray(n.type) ? n.type.includes("object") : n.type === "object") ? o.properties = H.extractProperties(
n.properties,
n.required || [],
n.additionalProperties
) : n.type === void 0 && (n.properties || n.additionalProperties) && (o.types = ["object"], o.properties = H.extractProperties(
n.properties,
n.required || [],
n.additionalProperties
));
return o;
}
static extractProperties(t, n = [], r) {
const o = [];
if (t && Object.entries(t).forEach(([s, a]) => {
const i = n.includes(s);
o.push(H.schemaToUiProperty(s, a, i));
}), r) {
const s = typeof r == "object" ? r : { type: "string" };
o.push({
name: "additionalProperties",
types: [s.type],
required: !1,
meta: { isAdditionalProperties: !0 }
});
}
return o;
}
}
function ro(e) {
if (!e || Object.keys(e).length === 0)
return [];
const t = $p(e);
return H.schemaToUiProperty("", t);
}
function Tp(e) {
const t = /* @__PURE__ */ new Set();
return e.forEach((n) => {
n === null ? t.add("null") : Array.isArray(n) ? t.add("array") : typeof n == "object" ? t.add("object") : typeof n == "string" ? t.add("string") : typeof n == "boolean" ? t.add("boolean") : typeof n == "number" && t.add(Number.isInteger(n) ? "integer" : "number");
}), t.has("number") && t.delete("integer"), Array.from(t);
}
function wt(e) {
return !e.type && e.properties ? "object" : !e.type && e.items ? "array" : !e.type && e.const !== void 0 ? Array.isArray(e.const) ? "array" : typeof e.const == "object" && e.const !== null ? "object" : typeof e.const == "string" ? "string" : typeof e.const == "number" ? "number" : typeof e.const == "boolean" ? "boolean" : "null" : e.type;
}
function Op(e) {
if (!e.paths)
return e;
for (const t of Object.values(e.paths))
for (const n of z) {
const r = t[n];
if (r && r.requestBody)
for (const [o, s] of Object.entries(r.requestBody.content || {})) {
const a = s;
a.schema && (a.ui = ro(a.schema), a.examples = {
...a.examples || {},
...Zr(o, a.ui, !0)
});
}
}
return e;
}
function wp(e) {
if (!e.paths)
return e;
for (const t of Object.values(e.paths))
for (const n of z) {
const r = t[n];
if (r && r.responses)
for (const o of Object.values(r.responses))
for (const [s, a] of Object.entries(o.content || {})) {
const i = a;
i.schema && (i.ui = ro(i.schema), i.examples = {
...i.examples || {},
...Zr(s, i.ui, !0)
});
}
}
return e;
}
const Qn = "None";
function Ep(e, t) {
const n = [];
return e ? (e.forEach((r) => {
const o = {
id: Object.keys(r).length ? Object.keys(r).join("|") : Qn,
schemes: {}
};
Object.keys(r).forEach((s) => {
t && t[s] && (o.schemes[s] = t[s]);
}), n.push(o);
}), n.length === 1 && n[0].id === Qn && Object.keys(n[0].schemes).length === 0 ? [] : n) : n;
}
function xp(e) {
var t;
if (!(e != null && e.paths))
return e;
for (const n of Object.values(e.paths))
for (const r of z) {
const o = n[r];
o && (o.securityUi = Ep(o.security ?? e.security ?? [], ((t = e.components) == null ? void 0 : t.securitySchemes) || {}));
}
return e;
}
function oo() {
function e(s) {
if (typeof s == "string")
try {
return Yf(s);
} catch (a) {
console.error("Error parsing spec", a);
}
else {
if (typeof s == "object")
return s;
console.error("Invalid spec format");
}
return {};
}
function t({
spec: s,
defaultTag: a = void 0,
defaultTagDescription: i = void 0
}) {
let c = e(s);
return c ? !c.openapi || !String(c.openapi).startsWith("3.") ? (console.warn("Only OpenAPI 3.x is supported"), {}) : (c != null && c.paths && (c = tp(c), c = np(c), c = rp({ spec: c, defaultTag: a, defaultTagDescription: i })), c.externalDocs = c.externalDocs || {}, c.info = c.info || {}, c.servers = c.servers || [], c.tags = c.tags || [], Object.assign({}, c)) : {};
}
async function n({
spec: s
}) {
let a = e(s);
const [i, c] = await Te(() => ep(a));
return a = c ? a : i, a;
}
function r({
spec: s,
defaultTag: a = void 0,
defaultTagDescription: i = void 0
}) {
const c = e(s);
let l = Object.assign({}, c);
const [d, f] = Te(() => Xu(
t({
spec: s,
defaultTag: a,
defaultTagDescription: i
})
));
l = f ? l : d;
const [g, p] = Te(() => Zf(l));
l = p ? l : g;
const [h, b] = Te(() => xp(l));
l = b ? l : h;
const [m, S] = Te(() => Op(l));
l = S ? l : m;
const [v, T] = Te(() => wp(l));
return l = T ? l : v, l.externalDocs = l.externalDocs || l.externalDocs || {}, l.info = l.info || l.info || {}, l.servers = l.servers || l.servers || [], l.tags = l.tags || l.tags || [], Object.assign({}, l);
}
async function o({
spec: s,
defaultTag: a = void 0,
defaultTagDescription: i = void 0
}) {
let c = r({
spec: s,
defaultTag: a,
defaultTagDescription: i
});
return c = await n({
spec: c
}), c;
}
return {
transformSync: t,
transformAsync: n,
parseSync: r,
parseAsync: o
};
}
function Mp({
spec: e,
defaultTag: t = void 0,
defaultTagDescription: n = void 0
}) {
const r = fo({
spec: oo().transformSync({
spec: e,
defaultTag: t,
defaultTagDescription: n
})
});
function o() {
return r.getFilteredTags();
}
return {
getPathsByVerbs: r.getPathsByVerbs,
getTags: o
};
}
function Rt(e) {
return Array.isArray(e) ? e.map(Rt) : typeof e == "object" ? {
text: e.text,
...e.collapsed === void 0 ? {} : { collapsed: e.collapsed },
...e.link ? { link: e.link } : {},
...e.items ? { items: Rt(e.items) } : {}
} : e;
}
function io(e) {
return e.map((t) => {
var n;
return t.items ? (t.items = io(t.items), t.text = (n = t.text) != null && n.startsWith("/") ? t.text : `/${t.text}`) : t.text && !t.isOperation && !t.text.startsWith("/") && !t.text.includes("<span") && (t.text = `/${t.text}`), t;
});
}
function jp(e, t, n, r = 1, o = "") {
return so(ao(e, t, n, r, o));
}
function ao(e, t, n, r, o = "") {
return e.map((s) => {
if (s.items) {
const a = o + s.text;
r + 1 > n ? s.flattenedItems = Object.keys(t).filter((i) => i.startsWith(a)).map((i) => {
var l;
const c = t[i];
return {
...c,
items: (l = c.items) == null ? void 0 : l.filter((d) => d.isOperation)
};
}) : s.items = ao(s.items, t, n, r + 1, a);
}
return s;
});
}
function so(e, t = "") {
const n = [];
return e.forEach((r) => {
r.flattenedItems ? n.push(...r.flattenedItems.map((o) => {
var s;
if (o.items && r.text !== o.text) {
const a = t + r.text, i = (s = o.path) == null ? void 0 : s.replace(a, "");
o.text = (r.text || "") + i;
}
return o;
})) : n.push(r), r.items && (r.items = so(r.items, t + r.text));
}), n;
}
function Nt(e) {
return Array.isArray(e) ? e.reduce((t, n) => {
var o;
if (!((o = n.items) != null && o.length))
return t.push(n), t;
if (n.items.length === 1 && !n.items.some((s) => "link" in s)) {
const s = n.items[0], a = Nt([s])[0];
return a.text = Ap(n.text, a.text), a.path = a.path || n.path, t.push(a), t;
}
return n.items = Nt(n.items), t.push(n), t;
}, []) : e;
}
function Ap(e, t) {
const n = t.startsWith("/") ? t : `/${t}`;
return e + n;
}
function co(e) {
return e.map((t) => (t.items && (t.collapsed = !t.items.length, t.items.some((n) => "items" in n) && (t.items = co(t.items))), t));
}
function Cp({
paths: e,
startsWith: t = "",
collapsible: n = !0,
itemLinkPrefix: r = "",
depth: o = 6,
sidebarItemTemplate: s,
sidebarGroupTemplate: a
} = {
paths: {}
}) {
let i = [];
const c = {};
return Object.keys(e).filter((l) => l.startsWith(t)).forEach((l) => {
const d = l.split("/").filter(Boolean);
let f = i;
d.forEach((g, p) => {
const h = p === d.length - 1, b = `/${d.slice(0, p + 1).join("/")}`, m = Pp(f, g, b);
if (h) {
const S = z.map((v) => {
const T = e[l] ? e[l][v] : null;
return T ? {
text: s ? s({ method: v, path: b, title: T.summary }) : `[${v.toUpperCase()}] ${T.summary}`,
link: `${r}${T.operationId}`,
method: v,
path: b,
isOperation: !0,
operation: T
} : null;
}).filter((v) => v !== null);
m.items = m.items || [], m.items.push(...S), c[b] = m;
}
f = m.items;
});
}), i = Nt(i), i = io(i), n && (i = co(i)), i = jp(i, c, o), a && (i = lo(i, a)), i;
}
function Pp(e, t, n) {
let r = e.find(
(o) => o.text === t && o.path === n
);
return r || (r = {
text: t,
path: n,
items: []
}, e.push(r)), r;
}
function lo(e, t, n = 1) {
return e.map((r) => (r.text && r.path && r.items && r.items.length && (r.text = t({ path: r.path, depth: n })), r.items && (r.items = lo(r.items, t, n + 1)), r));
}
const Et = {
linkPrefix: "/operations/",
tagLinkPrefix: "/tags/",
defaultTag: "Default"
};
function Lp({ path: e }) {
return e;
}
function Dp({
spec: e,
linkPrefix: t = Et.linkPrefix,
tagLinkPrefix: n = Et.tagLinkPrefix,
defaultTag: r = Et.defaultTag,
methodAliases: o = {},
sidebarItemTemplate: s,
sidebarGroupTemplate: a
} = {}) {
let i = null;
function c() {
if (!e)
throw new Error("OpenAPI spec is not provided.");
return i || (i = fo({
spec: oo().transformSync({
spec: e,
defaultTag: r
})
})), i;
}
const l = s || (({ method: S, path: v, title: T }) => {
const A = o[S] || S.toUpperCase(), P = T || v;
return `<span class="OASidebarItem group/oaOperationLink">
<span class="OASidebarItem-badge OAMethodBadge--${S.toLowerCase()}">${A}</span>
<span class="OASidebarItem-text text">${P}</span>
</span>`;
}), d = a || Lp;
function f({
method: S,
path: v,
sidebarItemTemplate: T
}) {
var U, O;
const A = (O = (U = c().getPaths()) == null ? void 0 : U[v]) == null ? void 0 : O[S];
if (!A)
return `[${S.toUpperCase()}] ${v}`;
const { summary: P } = A, L = A["x-sidebar-title"] || P || `${S.toUpperCase()} ${v}`;
return (T || l)({ method: S, path: v, title: L });
}
function g(S, v, T = t, A) {
var N, U;
const P = (U = (N = c().getPaths()) == null ? void 0 : N[v]) == null ? void 0 : U[S];
if (!P)
return null;
const L = P.operationId;
return {
text: f({ method: S, path: v, sidebarItemTemplate: A }),
link: `${T}${L}`
};
}
function p({
tag: S,
text: v = "",
linkPrefix: T = t,
sidebarItemTemplate: A,
sidebarGroupTemplate: P
}) {
const L = c().getPaths();
if (!L)
return {
text: "",
items: []
};
const N = Array.isArray(S) ? S : [S], U = Object.entries(L).flatMap(
([E, k]) => z.map((x) => {
const C = k == null ? void 0 : k[x];
return C && (N.length === 0 || N.every((pe) => {
var Je;
return (Je = C.tags) == null ? void 0 : Je.includes(pe);
})) ? g(x, E, T, A) : null;
}).filter((x) => x !== null)
);
return {
text: (P || d)({ path: v, depth: 0 }),
items: U
};
}
function h({
tags: S = void 0,
linkPrefix: v = t,
sidebarItemTemplate: T,
sidebarGroupTemplate: A
} = {}) {
if (S === void 0 && (S = c().getOperationsTags()), !c().getPaths())
return [];
const P = (S ?? []).map(
(U) => p({
tag: U,
text: U,
linkPrefix: v || n,
sidebarItemTemplate: T,
sidebarGroupTemplate: A
})
), L = c().getPathsWithoutTags();
if (Object.keys(L).length > 0) {
const U = p({
tag: [],
text: "",
linkPrefix: v || n,
sidebarItemTemplate: T,
sidebarGroupTemplate: A
});
return [...P, U];
}
return P;
}
function b({
tags: S = void 0,
linkPrefix: v = n
} = {}) {
return S === void 0 && (S = c().getFilteredTags().map((T) => T.name || "")), !c().getPaths() || !S ? [] : S.map((T) => ({
text: T,
link: `${v}${T}`
}));
}
function m({
startsWith: S = "",
collapsible: v = !0,
depth: T = 6,
linkPrefix: A = t,
sidebarItemTemplate: P,
sidebarGroupTemplate: L
} = {}) {
const N = c().getPaths(), O = Cp({
paths: N,
startsWith: S,
collapsible: v,
depth: T,
itemLinkPrefix: A,
sidebarItemTemplate: ({
method: E,
path: k
}) => f({
method: E,
path: k,
sidebarItemTemplate: P
}),
sidebarGroupTemplate: L
});
return Rt(O);
}
return {
sidebarItemTemplate: l,
sidebarGroupTemplate: d,
generateSidebarItem: g,
generateSidebarGroup: p,
generateSidebarGroups: h,
itemsByTags: b,
itemsByPaths: m
// TODO: Add `itemsByOperations` function
};
}
const z = Object.values(Pt.HttpMethods), uo = ["string", "number", "integer", "boolean", "null"];
function fo({
spec: e,
originalSpec: t
} = {
spec: null,
originalSpec: null
}) {
let n = null, r = t ?? null;
function o(O) {
n = O;
}
function s() {
return r;
}
function a(O) {
r = O;
}
function i() {
if (n || o(e ?? {}), !n)
throw new Error("OpenAPI spec is not defined");
return n;
}
function c(O, E) {
var k;
for (const x of Object.values(O))
for (const C of z)
if (x && ((k = x[C]) == null ? void 0 : k.operationId) === E)
return x[C];
return null;
}
function l(O) {
const E = i().paths;
return E ? c(E, O) : null;
}
function d(O) {
var k;
const E = i().paths;
if (!E)
return null;
for (const [x, C] of Object.entries(E))
for (const G of z)
if (C && ((k = C[G]) == null ? void 0 : k.operationId) === O)
return x;
return null;
}
function f(O) {
var k;
const E = i().paths;
if (!E)
return null;
for (const x of Object.values(E))
for (const C of z)
if (x && ((k = x[C]) == null ? void 0 : k.operationId) === O)
return C;
return null;
}
function g(O) {
const E = l(O);
return E ? E.parameters || [] : [];
}
function p() {
return i().paths ?? {};
}
function h() {
const O = p();
return Object.keys(O).flatMap((E) => z.filter((k) => O && O[E] && O[E][k]).map((k) => {
if (!O || !O[E] || !O[E][k])
return null;
const { operationId: x, summary: C, tags: G } = O[E][k];
return {
path: E,
verb: k,
operationId: x,
summary: C,
tags: G ?? []
};
}));
}
function b() {
return i().info ?? {};
}
function m() {
return i().externalDocs ?? {};
}
function S() {
return i().servers ?? [];
}
function v(O) {
var G;
const E = c(p(), O);
if (!E)
return [];
const k = d(O), C = (G = i().paths[k ?? ""]) == null ? void 0 : G.servers;
return (E == null ? void 0 : E.servers) !== void 0 ? E.servers : C !== void 0 ? C : i().servers ?? [];
}
function T() {
if (!i().paths)
return [];
const O = i().paths;
return Object.values(O).reduce((E, k) => {
var x;
for (const C of z)
k && ((x = k[C]) != null && x.tags) && k[C].tags.forEach((G) => {
E.includes(G) || E.push(G);
});
return E;
}, []);
}
function A(O) {
const E = p() ?? {}, k = {};
for (const [x, C] of Object.entries(E))
if (C)
for (const G of z) {
const pe = C[G];
pe && O(pe) && (k[x] = k[x] || {}, k[x][G] = pe);
}
return k;
}
function P(O) {
const E = typeof O == "string" ? [O] : O;
return A((k) => {
var x;
return (x = k == null ? void 0 : k.tags) == null ? void 0 : x.some((C) => E.includes(C));
});
}
function L() {
return A((O) => !(O != null && O.tags) || O.tags.length === 0);
}
function N() {
return (i().tags ?? []).map((O) => ({
name: O.name ?? null,
description: O.description ?? null
}));
}
function U() {
const O = T(), E = N().filter((k) => O.includes(k.name ?? ""));
return E.concat([
...O.filter((k) => !E.map((x) => x.name).includes(k)).map((k) => ({
name: k,
description: null
}))
]);
}
return {
spec: i(),
originalSpec: s(),
setSpec: o,
getSpec: i,
getOriginalSpec: s,
setOriginalSpec: a,
getOperation: l,
getOperationPath: d,
getOperationMethod: f,
getOperationParameters: g,
getPaths: p,
getPathsByVerbs: h,
getInfo: b,
getExternalDocs: m,
getServers: S,
getOperationServers: v,
getOperationsTags: T,
getPathsByTags: P,
getPathsWithoutTags: L,
getTags: N,
getFilteredTags: U
};
}
export {
ku as D,
fo as O,
Sp as a,
wi as b,
Np as c,
qe as d,
Dt as e,
Ht as f,
Ot as g,
gr as h,
Va as i,
yr as j,
Rp as k,
br as l,
Yf as m,
mr as n,
$u as o,
oo as p,
z as q,
hr as r,
uo as s,
Mp as t,
Ou as u,
Dp as v
};