From edd11537233c577fa84b7367b153a9d4d974be65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20Gorej?= Date: Tue, 5 Sep 2023 09:56:51 +0200 Subject: [PATCH] feat: expose plugins and presets on SwaggerUI global symbol (#9189) Part of this commit is also: - complete plugins consolidation - complete presets consolidation - build system consolidation Refs #9188 --- .browserslistrc | 10 + babel.config.js | 124 +- config/jest/jest.unit.config.js | 3 + dist/swagger-ui-es-bundle-core.js | 27309 +++++++++++++++- docs/README.md | 2 + .../customization}/add-plugin.md | 0 package-lock.json | 206 +- package.json | 34 +- src/{img => core/assets}/rolling-load.svg | 0 src/core/brace-snippets-yaml.js | 6 - .../json-schema-components.jsx | 0 src/core/components/model.jsx | 4 +- src/core/components/operation.jsx | 5 +- src/core/components/parameter-row.jsx | 2 +- src/core/components/responses.jsx | 2 +- src/core/index.js | 51 +- src/core/plugins/all.js | 24 - src/core/plugins/download-url.js | 110 - src/core/plugins/download-url/index.js | 126 + .../samples-extensions/fn/main.js | 2 +- src/core/plugins/oas3/selectors.js | 2 +- src/core/plugins/request-snippets/fn.js | 3 +- src/core/plugins/samples/fn/index.js | 3 +- src/core/plugins/spec/index.js | 27 +- src/core/plugins/spec/reducers.js | 5 +- src/core/plugins/spec/selectors.js | 3 +- .../configs-wrap-actions.js | 0 .../{swagger-js => swagger-client}/index.js | 0 src/core/plugins/view/index.js | 2 +- src/core/presets/apis.js | 11 - src/core/presets/apis/index.js | 11 + src/core/presets/base/index.js | 49 + .../plugins/core-components/index.js} | 210 +- .../base/plugins/form-components/index.js | 10 + .../plugins/json-schema-components/index.js | 10 + src/core/proptypes.js | 16 - src/core/system.js | 2 +- .../utils}/create-html-ready-id.js | 0 .../utils}/get-parameter-schema.js | 0 src/core/{utils.js => utils/index.js} | 41 +- src/{helpers => core/utils}/memoizeN.js | 0 src/img/logo_small.png | Bin 581 -> 0 bytes src/plugins/index.js | 7 - src/plugins/topbar/index.js | 11 - src/plugins/topbar/logo.jsx | 8 - src/standalone/index.js | 24 - .../components/StandaloneLayout.jsx} | 4 +- .../plugins/stadalone-layout/index.js | 12 + .../plugins/top-bar/assets}/logo_small.svg | 0 .../plugins/top-bar/components/Logo.jsx | 9 + .../plugins/top-bar/components/TopBar.jsx} | 9 +- src/standalone/plugins/top-bar/index.js | 11 + src/standalone/presets/standalone/index.js | 19 + test/components/highlight-code.jsx | 2 +- test/components/response-body.jsx | 2 +- test/mocha/components/live-response.jsx | 4 +- .../components/online-validator-badge.jsx | 2 +- .../online-validator-badge.jsx | 2 +- test/unit/bugs/3199-sanitization-escaping.jsx | 2 +- test/unit/bugs/3279-empty-markdown-source.jsx | 2 +- .../bugs/4557-default-parameter-values.jsx | 2 +- test/unit/components/filter.jsx | 4 +- test/unit/components/info-wrapper.jsx | 2 +- test/unit/components/json-schema-form.jsx | 27 +- test/unit/components/live-response.jsx | 10 +- test/unit/components/markdown.jsx | 4 +- test/unit/components/model-example.jsx | 10 +- test/unit/components/models.jsx | 6 +- test/unit/components/object-model.jsx | 12 +- .../components/online-validator-badge.jsx | 2 +- test/unit/components/operation-tag.jsx | 4 +- test/unit/components/operation.jsx | 2 +- test/unit/components/operations.jsx | 6 +- test/unit/components/parameter-row.jsx | 2 +- test/unit/components/primitive-model.jsx | 4 +- test/unit/components/response-body.jsx | 2 +- test/unit/components/response.jsx | 4 +- test/unit/components/schemes-wrapper.jsx | 6 +- test/unit/components/schemes.jsx | 2 +- .../unit/components/version-pragma-filter.jsx | 2 +- .../unit/core/helpers/get-parameter-schema.js | 2 +- test/unit/core/plugins/auth/actions.js | 2 +- .../auth/configs-extensions/wrap-actions.js | 2 +- test/unit/core/plugins/auth/preauthorize.js | 4 +- test/unit/core/plugins/auth/selectors.js | 2 +- .../auth/spec-extensions/wrap-actions.js | 2 +- test/unit/core/plugins/auth/wrap-actions.js | 2 +- test/unit/core/plugins/configs/actions.js | 2 +- .../plugins/err/transformers/not-of-type.js | 2 +- .../err/transformers/parameter-oneof.js | 2 +- test/unit/core/plugins/filter/opsFilter.js | 2 +- test/unit/core/plugins/oas3/helpers.js | 2 +- test/unit/core/plugins/oas3/reducers.js | 14 +- .../core/plugins/oas3/servers-wrapper.jsx | 2 +- .../core/plugins/oas3/state-integration.js | 6 +- .../core/plugins/oas3/wrap-auth-selectors.js | 2 +- .../core/plugins/oas3/wrap-spec-selectors.js | 2 +- test/unit/core/plugins/samples/fn/index.js | 2 +- test/unit/core/plugins/spec/actions.js | 2 +- test/unit/core/plugins/spec/reducer.js | 2 +- test/unit/core/plugins/spec/selectors.js | 2 +- .../plugins/swagger-js/withCredentials.js | 10 +- test/unit/xss/anchor-target-rel/info.jsx | 10 +- test/unit/xss/anchor-target-rel/link.jsx | 2 +- test/unit/xss/anchor-target-rel/markdown.jsx | 4 +- .../online-validator-badge.jsx | 2 +- test/unit/xss/info-sanitization.jsx | 4 +- .../unit/xss/markdown-script-sanitization.jsx | 4 +- webpack/_config-builder.js | 25 +- webpack/_helpers.js | 8 +- webpack/{bundle.babel.js => bundle.js} | 19 +- webpack/{core.babel.js => core.js} | 8 +- webpack/{dev-e2e.babel.js => dev-e2e.js} | 18 +- webpack/{dev.babel.js => dev.js} | 30 +- ...bundle-core.babel.js => es-bundle-core.js} | 34 +- webpack/{es-bundle.babel.js => es-bundle.js} | 16 +- .../{standalone.babel.js => standalone.js} | 8 +- .../{stylesheets.babel.js => stylesheets.js} | 6 +- 118 files changed, 28110 insertions(+), 826 deletions(-) create mode 100644 .browserslistrc rename {src/plugins => docs/customization}/add-plugin.md (100%) rename src/{img => core/assets}/rolling-load.svg (100%) delete mode 100644 src/core/brace-snippets-yaml.js rename src/core/{ => components}/json-schema-components.jsx (100%) delete mode 100644 src/core/plugins/all.js delete mode 100644 src/core/plugins/download-url.js create mode 100644 src/core/plugins/download-url/index.js rename src/core/plugins/{swagger-js => swagger-client}/configs-wrap-actions.js (100%) rename src/core/plugins/{swagger-js => swagger-client}/index.js (100%) delete mode 100644 src/core/presets/apis.js create mode 100644 src/core/presets/apis/index.js create mode 100644 src/core/presets/base/index.js rename src/core/presets/{base.js => base/plugins/core-components/index.js} (55%) create mode 100644 src/core/presets/base/plugins/form-components/index.js create mode 100644 src/core/presets/base/plugins/json-schema-components/index.js delete mode 100644 src/core/proptypes.js rename src/{helpers => core/utils}/create-html-ready-id.js (100%) rename src/{helpers => core/utils}/get-parameter-schema.js (100%) rename src/core/{utils.js => utils/index.js} (96%) rename src/{helpers => core/utils}/memoizeN.js (100%) delete mode 100644 src/img/logo_small.png delete mode 100644 src/plugins/index.js delete mode 100644 src/plugins/topbar/index.js delete mode 100644 src/plugins/topbar/logo.jsx delete mode 100644 src/standalone/index.js rename src/standalone/{layout.jsx => plugins/stadalone-layout/components/StandaloneLayout.jsx} (92%) create mode 100644 src/standalone/plugins/stadalone-layout/index.js rename src/{plugins/topbar => standalone/plugins/top-bar/assets}/logo_small.svg (100%) create mode 100644 src/standalone/plugins/top-bar/components/Logo.jsx rename src/{plugins/topbar/topbar.jsx => standalone/plugins/top-bar/components/TopBar.jsx} (96%) create mode 100644 src/standalone/plugins/top-bar/index.js create mode 100644 src/standalone/presets/standalone/index.js rename webpack/{bundle.babel.js => bundle.js} (79%) rename webpack/{core.babel.js => core.js} (71%) rename webpack/{dev-e2e.babel.js => dev-e2e.js} (82%) rename webpack/{dev.babel.js => dev.js} (78%) rename webpack/{es-bundle-core.babel.js => es-bundle-core.js} (74%) rename webpack/{es-bundle.babel.js => es-bundle.js} (80%) rename webpack/{standalone.babel.js => standalone.js} (62%) rename webpack/{stylesheets.babel.js => stylesheets.js} (93%) diff --git a/.browserslistrc b/.browserslistrc new file mode 100644 index 00000000000..89a3d87c6b5 --- /dev/null +++ b/.browserslistrc @@ -0,0 +1,10 @@ +[production] +> 1% +last 2 versions +Firefox ESR +not dead + +[development] +last 1 chrome version +last 1 firefox version +last 1 safari version diff --git a/babel.config.js b/babel.config.js index 4d144301736..510e8189c76 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,56 +1,89 @@ module.exports = { "env": { - "commonjs": { + "esm": { "presets": [ [ - "@babel/preset-env", + "@babel/env", { - "debug": false, - "modules": "commonjs", - "targets": { - "node": "8" - }, - "forceAllTransforms": false, - "ignoreBrowserslistConfig": true + "debug": true, + "modules": false, + "ignoreBrowserslistConfig": false, + "useBuiltIns": false, + "include": [ + "@babel/plugin-proposal-logical-assignment-operators" + ] } ], - "@babel/preset-react", + "@babel/preset-react" ], "plugins": [ [ - "@babel/plugin-transform-modules-commonjs", + "@babel/plugin-transform-runtime", + { + "corejs": 3, + "absoluteRuntime": false, + "version": "^7.11.2" + } + ], + [ + "transform-react-remove-prop-types", { - "loose": true + "additionalLibraries": [ + "react-immutable-proptypes" + ] } ], - "@babel/proposal-class-properties", - "@babel/proposal-object-rest-spread", - "@babel/plugin-proposal-optional-chaining", + [ + "babel-plugin-module-resolver", + { + "alias": { + "root": ".", + "core": "./src/core", + } + } + ] ] }, - "es": { + "test": { "presets": [ [ - "@babel/preset-env", + "@babel/env", { - "debug": false, - "modules": false + "targets": { + "node": "16.13.2" + }, + "ignoreBrowserslistConfig": true, + "useBuiltIns": false, } ], - "@babel/preset-react", + "@babel/preset-react" ], "plugins": [ [ "@babel/plugin-transform-runtime", { - "absoluteRuntime": false, "corejs": 3, + "absoluteRuntime": false, "version": "^7.11.2" } ], - "@babel/proposal-class-properties", - "@babel/proposal-object-rest-spread", - "@babel/plugin-proposal-optional-chaining", + [ + "transform-react-remove-prop-types", + { + "additionalLibraries": [ + "react-immutable-proptypes" + ] + } + ], + [ + "babel-plugin-module-resolver", + { + "alias": { + "root": ".", + "core": "./src/core", + } + } + ] ] }, "development": { @@ -58,17 +91,8 @@ module.exports = { [ "@babel/env", { - "targets": { - "browsers": [ - /* benefit of C/S/FF/Edge only? */ - "> 1%", - "last 2 versions", - "Firefox ESR", - "not dead" - ] - }, + "ignoreBrowserslistConfig": false, "useBuiltIns": false, - "corejs": { version: 3 }, "include": [ "@babel/plugin-proposal-logical-assignment-operators" ] @@ -85,8 +109,6 @@ module.exports = { "version": "^7.11.2" } ], - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-optional-chaining", [ "transform-react-remove-prop-types", { @@ -100,33 +122,31 @@ module.exports = { { "alias": { "root": ".", - "components": "./src/core/components", - "containers": "./src/core/containers", "core": "./src/core", - "plugins": "./src/plugins", - "img": "./src/img", - "corePlugins": "./src/core/plugins", - "less": "./src/less" } } ] ] }, - "test": { + "production": { "presets": [ [ "@babel/env", { - "targets": { - "node": "10" - }, + "ignoreBrowserslistConfig": false, "useBuiltIns": false, - "corejs": { version: 3 } + "include": [ + "@babel/plugin-proposal-logical-assignment-operators" + ] } ], "@babel/preset-react" ], "plugins": [ + "@babel/plugin-transform-class-properties", + "@babel/plugin-transform-nullish-coalescing-operator", + "@babel/plugin-transform-object-rest-spread", + "@babel/plugin-transform-optional-chaining", [ "@babel/plugin-transform-runtime", { @@ -135,8 +155,6 @@ module.exports = { "version": "^7.11.2" } ], - "@babel/plugin-proposal-class-properties", - "@babel/plugin-proposal-optional-chaining", [ "transform-react-remove-prop-types", { @@ -150,18 +168,12 @@ module.exports = { { "alias": { "root": ".", - "components": "./src/core/components", - "containers": "./src/core/containers", "core": "./src/core", - "plugins": "./src/plugins", - "img": "./src/img", - "corePlugins": "./src/core/plugins", - "less": "./src/less" } } ] ] - } + }, } } diff --git a/config/jest/jest.unit.config.js b/config/jest/jest.unit.config.js index 7bf24f390cf..9fca4bef852 100644 --- a/config/jest/jest.unit.config.js +++ b/config/jest/jest.unit.config.js @@ -19,6 +19,9 @@ module.exports = { '/test/unit/components/online-validator-badge.jsx', '/test/unit/components/live-response.jsx', ], + moduleNameMapper: { + '^.+\\.svg$': 'jest-transform-stub' + }, transformIgnorePatterns: ['/node_modules/(?!(sinon)/)'], silent: true, // set to `false` to allow console.* calls to be printed }; diff --git a/dist/swagger-ui-es-bundle-core.js b/dist/swagger-ui-es-bundle-core.js index e04e4ce953f..dfc6014d979 100644 --- a/dist/swagger-ui-es-bundle-core.js +++ b/dist/swagger-ui-es-bundle-core.js @@ -1,3 +1,27306 @@ -/*! For license information please see swagger-ui-es-bundle-core.js.LICENSE.txt */ -import*as e from"react-immutable-pure-component";import*as t from"remarkable/linkify";import*as a from"dompurify";import*as n from"zenscroll";import*as r from"lodash/reduce";import*as s from"@babel/runtime-corejs3/core-js-stable/string/raw";import*as o from"@babel/runtime-corejs3/core-js-stable/number/epsilon";import*as l from"@babel/runtime-corejs3/core-js-stable/instance/repeat";import*as i from"@babel/runtime-corejs3/core-js-stable/instance/fill";import*as c from"lodash/zipObject";import*as u from"@babel/runtime-corejs3/core-js-stable/promise";import*as d from"@babel/runtime-corejs3/core-js-stable/date/now";import*as p from"lodash/isString";import*as m from"lodash/debounce";import*as f from"lodash/set";import*as h from"lodash/fp/assocPath";import*as g from"lodash/constant";import*as y from"swagger-client/es/resolver/strategies/generic";import*as v from"swagger-client/es/resolver/strategies/openapi-2";import*as E from"swagger-client/es/resolver/strategies/openapi-3-0";import*as S from"swagger-client/es/resolver/strategies/openapi-3-1-apidom";import*as w from"swagger-client/es/resolver";import*as b from"swagger-client/es/execute";import*as x from"swagger-client/es/http";import*as _ from"swagger-client/es/subtree-resolver";import*as C from"react-dom";import*as j from"react-redux";import*as N from"react-syntax-highlighter/dist/esm/light";import*as O from"react-syntax-highlighter/dist/esm/languages/hljs/javascript";import*as k from"react-syntax-highlighter/dist/esm/languages/hljs/json";import*as A from"react-syntax-highlighter/dist/esm/languages/hljs/xml";import*as I from"react-syntax-highlighter/dist/esm/languages/hljs/bash";import*as R from"react-syntax-highlighter/dist/esm/languages/hljs/yaml";import*as P from"react-syntax-highlighter/dist/esm/languages/hljs/http";import*as T from"react-syntax-highlighter/dist/esm/languages/hljs/powershell";import*as M from"react-syntax-highlighter/dist/esm/styles/hljs/agate";import*as D from"react-syntax-highlighter/dist/esm/styles/hljs/arta";import*as L from"react-syntax-highlighter/dist/esm/styles/hljs/monokai";import*as q from"react-syntax-highlighter/dist/esm/styles/hljs/nord";import*as B from"react-syntax-highlighter/dist/esm/styles/hljs/obsidian";import*as U from"react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night";import*as J from"react-syntax-highlighter/dist/esm/styles/hljs/idea";import*as $ from"@babel/runtime-corejs3/core-js-stable/instance/starts-with";import*as V from"@braintree/sanitize-url";import*as K from"lodash/camelCase";import*as F from"lodash/upperFirst";import*as z from"lodash/find";import*as W from"lodash/eq";import*as H from"css.escape";import*as G from"@babel/runtime-corejs3/core-js-stable/instance/find-index";import*as Z from"@babel/runtime-corejs3/core-js-stable/array/from";import*as Y from"@babel/runtime-corejs3/core-js-stable/array/is-array";import*as X from"@babel/runtime-corejs3/core-js-stable/instance/bind";import*as Q from"@babel/runtime-corejs3/core-js-stable/instance/concat";import*as ee from"@babel/runtime-corejs3/core-js-stable/instance/entries";import*as te from"@babel/runtime-corejs3/core-js-stable/instance/every";import*as ae from"@babel/runtime-corejs3/core-js-stable/instance/filter";import*as ne from"@babel/runtime-corejs3/core-js-stable/instance/find";import*as re from"@babel/runtime-corejs3/core-js-stable/instance/for-each";import*as se from"@babel/runtime-corejs3/core-js-stable/instance/includes";import*as oe from"@babel/runtime-corejs3/core-js-stable/instance/index-of";import*as le from"@babel/runtime-corejs3/core-js-stable/instance/keys";import*as ie from"@babel/runtime-corejs3/core-js-stable/instance/map";import*as ce from"@babel/runtime-corejs3/core-js-stable/instance/reduce";import*as ue from"@babel/runtime-corejs3/core-js-stable/instance/slice";import*as de from"@babel/runtime-corejs3/core-js-stable/instance/some";import*as pe from"@babel/runtime-corejs3/core-js-stable/instance/sort";import*as me from"@babel/runtime-corejs3/core-js-stable/instance/trim";import*as fe from"@babel/runtime-corejs3/core-js-stable/json/stringify";import*as he from"@babel/runtime-corejs3/core-js-stable/map";import*as ge from"@babel/runtime-corejs3/core-js-stable/number/is-integer";import*as ye from"@babel/runtime-corejs3/core-js-stable/object/assign";import*as ve from"@babel/runtime-corejs3/core-js-stable/object/entries";import*as Ee from"@babel/runtime-corejs3/core-js-stable/object/from-entries";import*as Se from"@babel/runtime-corejs3/core-js-stable/object/keys";import*as we from"@babel/runtime-corejs3/core-js-stable/object/values";import*as be from"@babel/runtime-corejs3/core-js-stable/set";import*as xe from"@babel/runtime-corejs3/core-js-stable/set-timeout";import*as _e from"@babel/runtime-corejs3/core-js-stable/url";import*as Ce from"@babel/runtime-corejs3/core-js-stable/weak-map";import*as je from"@babel/runtime-corejs3/core-js-stable/weak-set";import*as Ne from"@babel/runtime-corejs3/helpers/classPrivateFieldGet";import*as Oe from"@babel/runtime-corejs3/helpers/defineProperty";import*as ke from"@babel/runtime-corejs3/helpers/extends";import*as Ae from"base64-js";import*as Ie from"classnames";import*as Re from"ieee754";import*as Pe from"immutable";import*as Te from"js-yaml";import*as Me from"lodash/get";import*as De from"lodash/identity";import*as Le from"lodash/isEmpty";import*as qe from"lodash/isFunction";import*as Be from"lodash/isPlainObject";import*as Ue from"lodash/memoize";import*as Je from"lodash/omit";import*as $e from"lodash/some";import*as Ve from"prop-types";import*as Ke from"randexp";import*as Fe from"react";import*as ze from"react-copy-to-clipboard";import*as We from"react-immutable-proptypes";import*as He from"redux";import*as Ge from"remarkable";import*as Ze from"reselect";import*as Ye from"serialize-error";import*as Xe from"swagger-client/es/helpers";import*as Qe from"url-parse";import*as et from"@babel/runtime-corejs3/core-js-stable/instance/last-index-of";import*as tt from"redux-immutable";import*as at from"lodash/merge";import*as nt from"lodash/toString";import*as rt from"@babel/runtime-corejs3/core-js-stable/instance/splice";import*as st from"js-file-download";import*as ot from"@babel/runtime-corejs3/core-js-stable/instance/values";import*as lt from"xml-but-prettier";import*as it from"lodash/toLower";import*as ct from"react-debounce-input";var ut={1543:(t,a,n)=>{n.d(a,{Z:()=>m});var r=n(863),s=n(775),o=n(8818),l=n(2565),i=n(810);const c=(e=>{var t={};return n.d(t,e),t})({default:()=>e.default});var u=n(9569),d=n(5053);const p=e=>{const t=e.replace(/~1/g,"/").replace(/~0/g,"~");try{return decodeURIComponent(t)}catch{return t}};class m extends c.default{constructor(){super(...arguments),(0,s.default)(this,"getModelName",(e=>-1!==(0,o.default)(e).call(e,"#/definitions/")?p(e.replace(/^.*#\/definitions\//,"")):-1!==(0,o.default)(e).call(e,"#/components/schemas/")?p(e.replace(/^.*#\/components\/schemas\//,"")):void 0)),(0,s.default)(this,"getRefSchema",(e=>{let{specSelectors:t}=this.props;return t.findDefinition(e)}))}render(){let{getComponent:e,getConfigs:t,specSelectors:a,schema:s,required:o,name:l,isRef:c,specPath:u,displayName:d,includeReadOnly:p,includeWriteOnly:m}=this.props;const f=e("ObjectModel"),h=e("ArrayModel"),g=e("PrimitiveModel");let y="object",v=s&&s.get("$$ref");if(!l&&v&&(l=this.getModelName(v)),!s&&v&&(s=this.getRefSchema(l)),!s)return i.default.createElement("span",{className:"model model-title"},i.default.createElement("span",{className:"model-title__text"},d||l),i.default.createElement("img",{src:n(2517),height:"20px",width:"20px"}));const E=a.isOAS3()&&s.get("deprecated");switch(c=void 0!==c?c:!!v,y=s&&s.get("type")||y,y){case"object":return i.default.createElement(f,(0,r.default)({className:"object"},this.props,{specPath:u,getConfigs:t,schema:s,name:l,deprecated:E,isRef:c,includeReadOnly:p,includeWriteOnly:m}));case"array":return i.default.createElement(h,(0,r.default)({className:"array"},this.props,{getConfigs:t,schema:s,name:l,deprecated:E,required:o,includeReadOnly:p,includeWriteOnly:m}));default:return i.default.createElement(g,(0,r.default)({},this.props,{getComponent:e,getConfigs:t,schema:s,name:l,deprecated:E,required:o}))}}}(0,s.default)(m,"propTypes",{schema:(0,l.default)(u.default).isRequired,getComponent:d.default.func.isRequired,getConfigs:d.default.func.isRequired,specSelectors:d.default.object.isRequired,name:d.default.string,displayName:d.default.string,isRef:d.default.bool,required:d.default.bool,expandDepth:d.default.number,depth:d.default.number,specPath:u.default.list.isRequired,includeReadOnly:d.default.bool,includeWriteOnly:d.default.bool})},5623:(e,t,a)=>{a.d(t,{Z:()=>c});var n=a(775),r=a(2740),s=a(810),o=a(8900),l=(a(5053),a(6561)),i=a(7504);class c extends s.default.Component{constructor(e,t){super(e,t),(0,n.default)(this,"getDefinitionUrl",(()=>{let{specSelectors:e}=this.props;return new o.default(e.url(),i.Z.location).toString()}));let{getConfigs:a}=e,{validatorUrl:r}=a();this.state={url:this.getDefinitionUrl(),validatorUrl:void 0===r?"https://validator.swagger.io/validator":r}}UNSAFE_componentWillReceiveProps(e){let{getConfigs:t}=e,{validatorUrl:a}=t();this.setState({url:this.getDefinitionUrl(),validatorUrl:void 0===a?"https://validator.swagger.io/validator":a})}render(){let{getConfigs:e}=this.props,{spec:t}=e(),a=(0,l.Nm)(this.state.validatorUrl);return"object"==typeof t&&(0,r.default)(t).length?null:this.state.url&&(0,l.hW)(this.state.validatorUrl)&&(0,l.hW)(this.state.url)?s.default.createElement("span",{className:"float-right"},s.default.createElement("a",{target:"_blank",rel:"noopener noreferrer",href:`${a}/debug?url=${encodeURIComponent(this.state.url)}`},s.default.createElement(u,{src:`${a}?url=${encodeURIComponent(this.state.url)}`,alt:"Online validator badge"}))):null}}class u extends s.default.Component{constructor(e){super(e),this.state={loaded:!1,error:!1}}componentDidMount(){const e=new Image;e.onload=()=>{this.setState({loaded:!0})},e.onerror=()=>{this.setState({error:!0})},e.src=this.props.src}UNSAFE_componentWillReceiveProps(e){if(e.src!==this.props.src){const t=new Image;t.onload=()=>{this.setState({loaded:!0})},t.onerror=()=>{this.setState({error:!0})},t.src=e.src}}render(){return this.state.error?s.default.createElement("img",{alt:"Error"}):this.state.loaded?s.default.createElement("img",{src:this.props.src,alt:this.props.alt}):null}}},5466:(e,n,r)=>{r.d(n,{Z:()=>d,s:()=>p});var s=r(810),o=(r(5053),r(3952));const l=(e=>{var t={};return r.d(t,e),t})({linkify:()=>t.linkify});const i=(e=>{var t={};return r.d(t,e),t})({default:()=>a.default});var c=r(8096);function u(e){let{source:t,className:a="",getConfigs:n}=e;if("string"!=typeof t)return null;const r=new o.Remarkable({html:!0,typographer:!0,breaks:!0,linkTarget:"_blank"}).use(l.linkify);r.core.ruler.disable(["replacements","smartquotes"]);const{useUnsafeMarkdown:i}=n(),u=r.render(t),d=p(u,{useUnsafeMarkdown:i});return t&&u&&d?s.default.createElement("div",{className:(0,c.default)(a,"markdown"),dangerouslySetInnerHTML:{__html:d}}):null}i.default.addHook&&i.default.addHook("beforeSanitizeElements",(function(e){return e.href&&e.setAttribute("rel","noopener noreferrer"),e})),u.defaultProps={getConfigs:()=>({useUnsafeMarkdown:!1})};const d=u;function p(e){let{useUnsafeMarkdown:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a=t,n=t?[]:["style","class"];return t&&!p.hasWarnedAboutDeprecation&&(console.warn("useUnsafeMarkdown display configuration parameter is deprecated since >3.26.0 and will be removed in v4.0.0."),p.hasWarnedAboutDeprecation=!0),i.default.sanitize(e,{ADD_ATTR:["target"],FORBID_TAGS:["style","form"],ALLOW_DATA_ATTR:a,FORBID_ATTR:n})}p.hasWarnedAboutDeprecation=!1},5308:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n,r=a(29),s=a(5487),o=a(6561),l=a(8102);const i=a(5102),c={},u=c;(0,r.default)(n=(0,s.default)(i).call(i)).call(n,(function(e){if("./index.js"===e)return;let t=i(e);c[(0,o.Zl)(e)]=t.default?t.default:t})),c.SafeRender=l.default},5812:(e,t,a)=>{a.r(t),a.d(t,{AUTHORIZE:()=>c,AUTHORIZE_OAUTH2:()=>p,CONFIGURE_AUTH:()=>f,LOGOUT:()=>u,PRE_AUTHORIZE_OAUTH2:()=>d,RESTORE_AUTHORIZATION:()=>h,SHOW_AUTH_POPUP:()=>i,VALIDATE:()=>m,authPopup:()=>R,authorize:()=>y,authorizeAccessCodeWithBasicAuthentication:()=>N,authorizeAccessCodeWithFormParams:()=>j,authorizeApplication:()=>C,authorizeOauth2:()=>b,authorizeOauth2WithPersistOption:()=>x,authorizePassword:()=>_,authorizeRequest:()=>O,authorizeWithPersistOption:()=>v,configureAuth:()=>k,logout:()=>E,logoutWithPersistOption:()=>S,persistAuthorizationIfNeeded:()=>I,preAuthorizeImplicit:()=>w,restoreAuthorization:()=>A,showDefinitions:()=>g});var n=a(313),r=a(7512),s=a(8900),o=a(7504),l=a(6561);const i="show_popup",c="authorize",u="logout",d="pre_authorize_oauth2",p="authorize_oauth2",m="validate",f="configure_auth",h="restore_authorization";function g(e){return{type:i,payload:e}}function y(e){return{type:c,payload:e}}const v=e=>t=>{let{authActions:a}=t;a.authorize(e),a.persistAuthorizationIfNeeded()};function E(e){return{type:u,payload:e}}const S=e=>t=>{let{authActions:a}=t;a.logout(e),a.persistAuthorizationIfNeeded()},w=e=>t=>{let{authActions:a,errActions:r}=t,{auth:s,token:l,isValid:i}=e,{schema:c,name:u}=s,d=c.get("flow");delete o.Z.swaggerUIRedirectOauth2,"accessCode"===d||i||r.newAuthErr({authId:u,source:"auth",level:"warning",message:"Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server"}),l.error?r.newAuthErr({authId:u,source:"auth",level:"error",message:(0,n.default)(l)}):a.authorizeOauth2WithPersistOption({auth:s,token:l})};function b(e){return{type:p,payload:e}}const x=e=>t=>{let{authActions:a}=t;a.authorizeOauth2(e),a.persistAuthorizationIfNeeded()},_=e=>t=>{let{authActions:a}=t,{schema:n,name:s,username:o,password:i,passwordType:c,clientId:u,clientSecret:d}=e,p={grant_type:"password",scope:e.scopes.join(" "),username:o,password:i},m={};switch(c){case"request-body":!function(e,t,a){t&&(0,r.default)(e,{client_id:t});a&&(0,r.default)(e,{client_secret:a})}(p,u,d);break;case"basic":m.Authorization="Basic "+(0,l.r3)(u+":"+d);break;default:console.warn(`Warning: invalid passwordType ${c} was passed, not including client id and secret`)}return a.authorizeRequest({body:(0,l.GZ)(p),url:n.get("tokenUrl"),name:s,headers:m,query:{},auth:e})};const C=e=>t=>{let{authActions:a}=t,{schema:n,scopes:r,name:s,clientId:o,clientSecret:i}=e,c={Authorization:"Basic "+(0,l.r3)(o+":"+i)},u={grant_type:"client_credentials",scope:r.join(" ")};return a.authorizeRequest({body:(0,l.GZ)(u),name:s,url:n.get("tokenUrl"),auth:e,headers:c})},j=e=>{let{auth:t,redirectUrl:a}=e;return e=>{let{authActions:n}=e,{schema:r,name:s,clientId:o,clientSecret:i,codeVerifier:c}=t,u={grant_type:"authorization_code",code:t.code,client_id:o,client_secret:i,redirect_uri:a,code_verifier:c};return n.authorizeRequest({body:(0,l.GZ)(u),name:s,url:r.get("tokenUrl"),auth:t})}},N=e=>{let{auth:t,redirectUrl:a}=e;return e=>{let{authActions:n}=e,{schema:r,name:s,clientId:o,clientSecret:i,codeVerifier:c}=t,u={Authorization:"Basic "+(0,l.r3)(o+":"+i)},d={grant_type:"authorization_code",code:t.code,client_id:o,redirect_uri:a,code_verifier:c};return n.authorizeRequest({body:(0,l.GZ)(d),name:s,url:r.get("tokenUrl"),auth:t,headers:u})}},O=e=>t=>{let a,{fn:o,getConfigs:l,authActions:i,errActions:c,oas3Selectors:u,specSelectors:d,authSelectors:p}=t,{body:m,query:f={},headers:h={},name:g,url:y,auth:v}=e,{additionalQueryStringParams:E}=p.getConfigs()||{};if(d.isOAS3()){let e=u.serverEffectiveValue(u.selectedServer());a=(0,s.default)(y,e,!0)}else a=(0,s.default)(y,d.url(),!0);"object"==typeof E&&(a.query=(0,r.default)({},a.query,E));const S=a.toString();let w=(0,r.default)({Accept:"application/json, text/plain, */*","Content-Type":"application/x-www-form-urlencoded","X-Requested-With":"XMLHttpRequest"},h);o.fetch({url:S,method:"post",headers:w,query:f,body:m,requestInterceptor:l().requestInterceptor,responseInterceptor:l().responseInterceptor}).then((function(e){let t=JSON.parse(e.data),a=t&&(t.error||""),r=t&&(t.parseError||"");e.ok?a||r?c.newAuthErr({authId:g,level:"error",source:"auth",message:(0,n.default)(t)}):i.authorizeOauth2WithPersistOption({auth:v,token:t}):c.newAuthErr({authId:g,level:"error",source:"auth",message:e.statusText})})).catch((e=>{let t=new Error(e).message;if(e.response&&e.response.data){const a=e.response.data;try{const e="string"==typeof a?JSON.parse(a):a;e.error&&(t+=`, error: ${e.error}`),e.error_description&&(t+=`, description: ${e.error_description}`)}catch(e){}}c.newAuthErr({authId:g,level:"error",source:"auth",message:t})}))};function k(e){return{type:f,payload:e}}function A(e){return{type:h,payload:e}}const I=()=>e=>{let{authSelectors:t,getConfigs:a}=e;if(!a().persistAuthorization)return;const r=t.authorized().toJS();localStorage.setItem("authorized",(0,n.default)(r))},R=(e,t)=>()=>{o.Z.swaggerUIRedirectOauth2=t,o.Z.open(e)}},7105:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(2740),r=a(810),s=(a(5053),a(1116));class o extends r.default.Component{mapStateToProps(e,t){return{state:e,ownProps:(0,s.default)(t,(0,n.default)(t.getSystem()))}}render(){const{getComponent:e,ownProps:t}=this.props,a=e("LockIcon");return r.default.createElement(a,t)}}const l=o},3219:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(2740),r=a(810),s=(a(5053),a(1116));class o extends r.default.Component{mapStateToProps(e,t){return{state:e,ownProps:(0,s.default)(t,(0,n.default)(t.getSystem()))}}render(){const{getComponent:e,ownProps:t}=this.props,a=e("UnlockIcon");return r.default.createElement(a,t)}}const l=o},3779:(e,t,a)=>{a.r(t),a.d(t,{loaded:()=>n});const n=(e,t)=>a=>{const{getConfigs:n,authActions:r}=t,s=n();if(e(a),s.persistAuthorization){const e=localStorage.getItem("authorized");e&&r.restoreAuthorization({authorized:JSON.parse(e)})}}},3705:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p,preauthorizeApiKey:()=>f,preauthorizeBasic:()=>m});var n=a(5527),r=a(3962),s=a(5812),o=a(35),l=a(489),i=a(3779),c=a(2849),u=a(7105),d=a(3219);function p(){return{afterLoad(e){this.rootInjects=this.rootInjects||{},this.rootInjects.initOAuth=e.authActions.configureAuth,this.rootInjects.preauthorizeApiKey=(0,n.default)(f).call(f,null,e),this.rootInjects.preauthorizeBasic=(0,n.default)(m).call(m,null,e)},components:{LockAuthIcon:u.default,UnlockAuthIcon:d.default,LockAuthOperationIcon:u.default,UnlockAuthOperationIcon:d.default},statePlugins:{auth:{reducers:r.default,actions:s,selectors:o,wrapActions:{authorize:c.authorize,logout:c.logout}},configs:{wrapActions:{loaded:i.loaded}},spec:{wrapActions:{execute:l.execute}}}}}function m(e,t,a,n){const{authActions:{authorize:r},specSelectors:{specJson:s,isOAS3:o}}=e,l=o()?["components","securitySchemes"]:["securityDefinitions"],i=s().getIn([...l,t]);return i?r({[t]:{value:{username:a,password:n},schema:i.toJS()}}):null}function f(e,t,a){const{authActions:{authorize:n},specSelectors:{specJson:r,isOAS3:s}}=e,o=s()?["components","securitySchemes"]:["securityDefinitions"],l=r().getIn([...o,t]);return l?n({[t]:{value:a,schema:l.toJS()}}):null}},3962:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(29),r=a(7512),s=a(9725),o=a(6561),l=a(5812);const i={[l.SHOW_AUTH_POPUP]:(e,t)=>{let{payload:a}=t;return e.set("showDefinitions",a)},[l.AUTHORIZE]:(e,t)=>{var a;let{payload:r}=t,l=(0,s.fromJS)(r),i=e.get("authorized")||(0,s.Map)();return(0,n.default)(a=l.entrySeq()).call(a,(t=>{let[a,n]=t;if(!(0,o.Wl)(n.getIn))return e.set("authorized",i);let r=n.getIn(["schema","type"]);if("apiKey"===r||"http"===r)i=i.set(a,n);else if("basic"===r){let e=n.getIn(["value","username"]),t=n.getIn(["value","password"]);i=i.setIn([a,"value"],{username:e,header:"Basic "+(0,o.r3)(e+":"+t)}),i=i.setIn([a,"schema"],n.get("schema"))}})),e.set("authorized",i)},[l.AUTHORIZE_OAUTH2]:(e,t)=>{let a,{payload:n}=t,{auth:o,token:l}=n;o.token=(0,r.default)({},l),a=(0,s.fromJS)(o);let i=e.get("authorized")||(0,s.Map)();return i=i.set(a.get("name"),a),e.set("authorized",i)},[l.LOGOUT]:(e,t)=>{let{payload:a}=t,r=e.get("authorized").withMutations((e=>{(0,n.default)(a).call(a,(t=>{e.delete(t)}))}));return e.set("authorized",r)},[l.CONFIGURE_AUTH]:(e,t)=>{let{payload:a}=t;return e.set("configs",a)},[l.RESTORE_AUTHORIZATION]:(e,t)=>{let{payload:a}=t;return e.set("authorized",(0,s.fromJS)(a.authorized))}}},35:(e,t,a)=>{a.r(t),a.d(t,{authorized:()=>g,definitionsForRequirements:()=>h,definitionsToAuthorize:()=>m,getConfigs:()=>v,getDefinitionsByNames:()=>f,isAuthorized:()=>y,shownDefinitions:()=>p});var n=a(29),r=a(1778),s=a(6145),o=a(8818),l=a(2565),i=a(2740),c=a(8639),u=a(9725);const d=e=>e,p=(0,c.createSelector)(d,(e=>e.get("showDefinitions"))),m=(0,c.createSelector)(d,(()=>e=>{var t;let{specSelectors:a}=e,r=a.securityDefinitions()||(0,u.Map)({}),s=(0,u.List)();return(0,n.default)(t=r.entrySeq()).call(t,(e=>{let[t,a]=e,n=(0,u.Map)();n=n.set(t,a),s=s.push(n)})),s})),f=(e,t)=>e=>{var a;let{specSelectors:r}=e;console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version.");let s=r.securityDefinitions(),o=(0,u.List)();return(0,n.default)(a=t.valueSeq()).call(a,(e=>{var t;let a=(0,u.Map)();(0,n.default)(t=e.entrySeq()).call(t,(e=>{let t,[r,o]=e,l=s.get(r);var i;"oauth2"===l.get("type")&&o.size&&(t=l.get("scopes"),(0,n.default)(i=t.keySeq()).call(i,(e=>{o.contains(e)||(t=t.delete(e))})),l=l.set("allowedScopes",t));a=a.set(r,l)})),o=o.push(a)})),o},h=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(0,u.List)();return e=>{let{authSelectors:a}=e;const s=a.definitionsToAuthorize()||(0,u.List)();let o=(0,u.List)();return(0,n.default)(s).call(s,(e=>{let a=(0,r.default)(t).call(t,(t=>t.get(e.keySeq().first())));a&&((0,n.default)(e).call(e,((t,r)=>{if("oauth2"===t.get("type")){const o=a.get(r);let l=t.get("scopes");var s;if(u.List.isList(o)&&u.Map.isMap(l))(0,n.default)(s=l.keySeq()).call(s,(e=>{o.contains(e)||(l=l.delete(e))})),e=e.set(r,t.set("scopes",l))}})),o=o.push(e))})),o}},g=(0,c.createSelector)(d,(e=>e.get("authorized")||(0,u.Map)())),y=(e,t)=>e=>{var a;let{authSelectors:n}=e,r=n.authorized();return u.List.isList(t)?!!(0,s.default)(a=t.toJS()).call(a,(e=>{var t,a;return-1===(0,o.default)(t=(0,l.default)(a=(0,i.default)(e)).call(a,(e=>!!r.get(e)))).call(t,!1)})).length:null},v=(0,c.createSelector)(d,(e=>e.get("configs")))},489:(e,t,a)=>{a.r(t),a.d(t,{execute:()=>n});const n=(e,t)=>{let{authSelectors:a,specSelectors:n}=t;return t=>{let{path:r,method:s,operation:o,extras:l}=t,i={authorized:a.authorized()&&a.authorized().toJS(),definitions:n.securityDefinitions()&&n.securityDefinitions().toJS(),specSecurity:n.security()&&n.security().toJS()};return e({path:r,method:s,operation:o,securities:i,...l})}}},2849:(e,t,a)=>{a.r(t),a.d(t,{authorize:()=>o,logout:()=>l});var n=a(374),r=a(4163),s=a(29);const o=(e,t)=>a=>{e(a);if(t.getConfigs().persistAuthorization)try{const[{schema:e,value:t}]=(0,n.default)(a),r="apiKey"===e.get("type"),s="cookie"===e.get("in");r&&s&&(document.cookie=`${e.get("name")}=${t}; SameSite=None; Secure`)}catch(e){console.error("Error persisting cookie based apiKey in document.cookie.",e)}},l=(e,t)=>a=>{const n=t.getConfigs(),o=t.authSelectors.authorized();try{n.persistAuthorization&&(0,r.default)(a)&&(0,s.default)(a).call(a,(e=>{const t=o.get(e,{}),a="apiKey"===t.getIn(["schema","type"]),n="cookie"===t.getIn(["schema","in"]);if(a&&n){const e=t.getIn(["schema","name"]);document.cookie=`${e}=; Max-Age=-99999999`}}))}catch(e){console.error("Error deleting cookie based apiKey from document.cookie.",e)}e(a)}},714:(e,t,a)=>{a.r(t),a.d(t,{TOGGLE_CONFIGS:()=>r,UPDATE_CONFIGS:()=>n,loaded:()=>l,toggle:()=>o,update:()=>s});const n="configs_update",r="configs_toggle";function s(e,t){return{type:n,payload:{[e]:t}}}function o(e){return{type:r,payload:e}}const l=()=>()=>{}},2256:(e,t,a)=>{a.r(t),a.d(t,{parseYamlConfig:()=>r});var n=a(3772);const r=(e,t)=>{try{return n.default.load(e)}catch(e){return t&&t.errActions.newThrownErr(new Error(e)),{}}}},6709:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(2256),r=a(714),s=a(2698),o=a(9018),l=a(7743);const i={getLocalConfig:()=>(0,n.parseYamlConfig)('---\nurl: "https://petstore.swagger.io/v2/swagger.json"\ndom_id: "#swagger-ui"\nvalidatorUrl: "https://validator.swagger.io/validator"\n')};function c(){return{statePlugins:{spec:{actions:s,selectors:i},configs:{reducers:l.default,actions:r,selectors:o}}}}},7743:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(9725),r=a(714);const s={[r.UPDATE_CONFIGS]:(e,t)=>e.merge((0,n.fromJS)(t.payload)),[r.TOGGLE_CONFIGS]:(e,t)=>{const a=t.payload,n=e.get(a);return e.set(a,!n)}}},9018:(e,t,a)=>{a.r(t),a.d(t,{get:()=>r});var n=a(4163);const r=(e,t)=>e.getIn((0,n.default)(t)?t:[t])},2698:(e,t,a)=>{a.r(t),a.d(t,{downloadConfig:()=>r,getConfigByUrl:()=>s});var n=a(2256);const r=e=>t=>{const{fn:{fetch:a}}=t;return a(e)},s=(e,t)=>a=>{let{specActions:r}=a;if(e)return r.downloadConfig(e).then(s,s);function s(a){a instanceof Error||a.status>=400?(r.updateLoadingStatus("failedConfig"),r.updateLoadingStatus("failedConfig"),r.updateUrl(""),console.error(a.statusText+" "+e.url),t(null)):t((0,n.parseYamlConfig)(a.text))}}},1970:(e,t,a)=>{a.r(t),a.d(t,{setHash:()=>n});const n=e=>e?history.pushState(null,null,`#${e}`):window.location.hash=""},4980:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(5858),r=a(877),s=a(4584);function o(){return[n.default,{statePlugins:{configs:{wrapActions:{loaded:(e,t)=>function(){e(...arguments);const a=decodeURIComponent(window.location.hash);t.layoutActions.parseDeepLinkHash(a)}}}},wrapComponents:{operation:r.default,OperationTag:s.default}}]}},5858:(e,t,a)=>{a.r(t),a.d(t,{clearScrollTo:()=>E,default:()=>S,parseDeepLinkHash:()=>g,readyToScroll:()=>y,scrollTo:()=>h,scrollToElement:()=>v,show:()=>f});var r=a(4163),s=a(8136),o=a(2565),l=a(8818),i=a(1970);const c=(e=>{var t={};return a.d(t,e),t})({default:()=>n.default});var u=a(6561),d=a(9725);const p="layout_scroll_to",m="layout_clear_scroll",f=(e,t)=>{let{getConfigs:a,layoutSelectors:n}=t;return function(){for(var t=arguments.length,s=new Array(t),o=0;o({type:p,payload:(0,r.default)(e)?e:[e]}),g=e=>t=>{let{layoutActions:a,layoutSelectors:n,getConfigs:r}=t;if(r().deepLinking&&e){var i;let t=(0,s.default)(e).call(e,1);"!"===t[0]&&(t=(0,s.default)(t).call(t,1)),"/"===t[0]&&(t=(0,s.default)(t).call(t,1));const r=(0,o.default)(i=t.split("/")).call(i,(e=>e||"")),c=n.isShownKeyFromUrlHashArray(r),[u,d="",p=""]=c;if("operations"===u){const e=n.isShownKeyFromUrlHashArray([d]);(0,l.default)(d).call(d,"_")>-1&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),a.show((0,o.default)(e).call(e,(e=>e.replace(/_/g," "))),!0)),a.show(e,!0)}((0,l.default)(d).call(d,"_")>-1||(0,l.default)(p).call(p,"_")>-1)&&(console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."),a.show((0,o.default)(c).call(c,(e=>e.replace(/_/g," "))),!0)),a.show(c,!0),a.scrollTo(c)}},y=(e,t)=>a=>{const n=a.layoutSelectors.getScrollToKey();d.default.is(n,(0,d.fromJS)(e))&&(a.layoutActions.scrollToElement(t),a.layoutActions.clearScrollTo())},v=(e,t)=>a=>{try{t=t||a.fn.getScrollParent(e),c.default.createScroller(t).to(e)}catch(e){console.error(e)}},E=()=>({type:m});const S={fn:{getScrollParent:function(e,t){const a=document.documentElement;let n=getComputedStyle(e);const r="absolute"===n.position,s=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if("fixed"===n.position)return a;for(let t=e;t=t.parentElement;)if(n=getComputedStyle(t),(!r||"static"!==n.position)&&s.test(n.overflow+n.overflowY+n.overflowX))return t;return a}},statePlugins:{layout:{actions:{scrollToElement:v,scrollTo:h,clearScrollTo:E,readyToScroll:y,parseDeepLinkHash:g},selectors:{getScrollToKey:e=>e.get("scrollToKey"),isShownKeyFromUrlHashArray(e,t){const[a,n]=t;return n?["operations",a,n]:a?["operations-tag",a]:[]},urlHashArrayFromIsShownKey(e,t){let[a,n,r]=t;return"operations"==a?[n,r]:"operations-tag"==a?[n]:[]}},reducers:{[p]:(e,t)=>e.set("scrollToKey",d.default.fromJS(t.payload)),[m]:e=>e.delete("scrollToKey")},wrapActions:{show:f}}}}},4584:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(775),r=a(810);a(5053);const s=(e,t)=>class extends r.default.Component{constructor(){super(...arguments),(0,n.default)(this,"onLoad",(e=>{const{tag:a}=this.props,n=["operations-tag",a];t.layoutActions.readyToScroll(n,e)}))}render(){return r.default.createElement("span",{ref:this.onLoad},r.default.createElement(e,this.props))}}},877:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(775),r=a(810);a(9569);const s=(e,t)=>class extends r.default.Component{constructor(){super(...arguments),(0,n.default)(this,"onLoad",(e=>{const{operation:a}=this.props,{tag:n,operationId:r}=a.toObject();let{isShownKey:s}=a.toObject();s=s||["operations",n,r],t.layoutActions.readyToScroll(s,e)}))}render(){return r.default.createElement("span",{ref:this.onLoad},r.default.createElement(e,this.props))}}},8011:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(7512),r=a(3769),s=a(8818),o=a(313),l=a(8639),i=a(9725),c=a(7504);function u(e){let{fn:t}=e;return{statePlugins:{spec:{actions:{download:e=>a=>{let{errActions:s,specSelectors:o,specActions:l,getConfigs:i}=a,{fetch:u}=t;const d=i();function p(t){if(t instanceof Error||t.status>=400)return l.updateLoadingStatus("failed"),s.newThrownErr((0,n.default)(new Error((t.message||t.statusText)+" "+e),{source:"fetch"})),void(!t.status&&t instanceof Error&&function(){try{let t;if("URL"in c.Z?t=new r.default(e):(t=document.createElement("a"),t.href=e),"https:"!==t.protocol&&"https:"===c.Z.location.protocol){const e=(0,n.default)(new Error(`Possible mixed-content issue? The page was loaded over https:// but a ${t.protocol}// URL was specified. Check that you are not attempting to load mixed content.`),{source:"fetch"});return void s.newThrownErr(e)}if(t.origin!==c.Z.location.origin){const e=(0,n.default)(new Error(`Possible cross-origin (CORS) issue? The URL origin (${t.origin}) does not match the page (${c.Z.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`),{source:"fetch"});s.newThrownErr(e)}}catch(e){return}}());l.updateLoadingStatus("success"),l.updateSpec(t.text),o.url()!==e&&l.updateUrl(e)}e=e||o.url(),l.updateLoadingStatus("loading"),s.clear({source:"fetch"}),u({url:e,loadSpec:!0,requestInterceptor:d.requestInterceptor||(e=>e),responseInterceptor:d.responseInterceptor||(e=>e),credentials:"same-origin",headers:{Accept:"application/json,*/*"}}).then(p,p)},updateLoadingStatus:e=>{let t=[null,"loading","failed","success","failedConfig"];return-1===(0,s.default)(t).call(t,e)&&console.error(`Error: ${e} is not one of ${(0,o.default)(t)}`),{type:"spec_update_loading_status",payload:e}}},reducers:{spec_update_loading_status:(e,t)=>"string"==typeof t.payload?e.set("loadingStatus",t.payload):e},selectors:{loadingStatus:(0,l.createSelector)((e=>e||(0,i.Map)()),(e=>e.get("loadingStatus")||null))}}}}}},4966:(e,t,a)=>{a.r(t),a.d(t,{CLEAR:()=>c,CLEAR_BY:()=>u,NEW_AUTH_ERR:()=>i,NEW_SPEC_ERR:()=>o,NEW_SPEC_ERR_BATCH:()=>l,NEW_THROWN_ERR:()=>r,NEW_THROWN_ERR_BATCH:()=>s,clear:()=>g,clearBy:()=>y,newAuthErr:()=>h,newSpecErr:()=>m,newSpecErrBatch:()=>f,newThrownErr:()=>d,newThrownErrBatch:()=>p});var n=a(8518);const r="err_new_thrown_err",s="err_new_thrown_err_batch",o="err_new_spec_err",l="err_new_spec_err_batch",i="err_new_auth_err",c="err_clear",u="err_clear_by";function d(e){return{type:r,payload:(0,n.serializeError)(e)}}function p(e){return{type:s,payload:e}}function m(e){return{type:o,payload:e}}function f(e){return{type:l,payload:e}}function h(e){return{type:i,payload:e}}function g(){return{type:c,payload:arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}}}function y(){return{type:u,payload:arguments.length>0&&void 0!==arguments[0]?arguments[0]:()=>!0}}},6808:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(6145),s=a(2565);const o=(e=>{var t={};return a.d(t,e),t})({default:()=>r.default});const l=[a(2392),a(1835)];function i(e){var t;let a={jsSpec:{}},r=(0,o.default)(l,((e,t)=>{try{let r=t.transform(e,a);return(0,n.default)(r).call(r,(e=>!!e))}catch(t){return console.error("Transformer error:",t),e}}),e);return(0,s.default)(t=(0,n.default)(r).call(r,(e=>!!e))).call(t,(e=>(!e.get("line")&&e.get("path"),e)))}},2392:(e,t,a)=>{a.r(t),a.d(t,{transform:()=>l});var n=a(2565),r=a(8818),s=a(8136),o=a(6785);function l(e){return(0,n.default)(e).call(e,(e=>{var t;let a="is not of a type(s)",n=(0,r.default)(t=e.get("message")).call(t,a);if(n>-1){var l,i;let t=(0,s.default)(l=e.get("message")).call(l,n+19).split(",");return e.set("message",(0,s.default)(i=e.get("message")).call(i,0,n)+function(e){return(0,o.default)(e).call(e,((e,t,a,n)=>a===n.length-1&&n.length>1?e+"or "+t:n[a+1]&&n.length>2?e+t+", ":n[a+1]?e+t+" ":e+t),"should be a")}(t))}return e}))}},1835:(e,t,a)=>{a.r(t),a.d(t,{transform:()=>n});a(2565),a(8818),a(9908),a(9725);function n(e,t){let{jsSpec:a}=t;return e}},7793:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(3527),r=a(4966),s=a(7667);function o(e){return{statePlugins:{err:{reducers:(0,n.default)(e),actions:r,selectors:s}}}}},3527:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var n=a(7512),r=a(2565),s=a(5171),o=a(6145),l=a(7930),i=a(4966),c=a(9725),u=a(6808);let d={line:0,level:"error",message:"Unknown error"};function p(){return{[i.NEW_THROWN_ERR]:(e,t)=>{let{payload:a}=t,r=(0,n.default)(d,a,{type:"thrown"});return e.update("errors",(e=>(e||(0,c.List)()).push((0,c.fromJS)(r)))).update("errors",(e=>(0,u.default)(e)))},[i.NEW_THROWN_ERR_BATCH]:(e,t)=>{let{payload:a}=t;return a=(0,r.default)(a).call(a,(e=>(0,c.fromJS)((0,n.default)(d,e,{type:"thrown"})))),e.update("errors",(e=>{var t;return(0,s.default)(t=e||(0,c.List)()).call(t,(0,c.fromJS)(a))})).update("errors",(e=>(0,u.default)(e)))},[i.NEW_SPEC_ERR]:(e,t)=>{let{payload:a}=t,n=(0,c.fromJS)(a);return n=n.set("type","spec"),e.update("errors",(e=>(e||(0,c.List)()).push((0,c.fromJS)(n)).sortBy((e=>e.get("line"))))).update("errors",(e=>(0,u.default)(e)))},[i.NEW_SPEC_ERR_BATCH]:(e,t)=>{let{payload:a}=t;return a=(0,r.default)(a).call(a,(e=>(0,c.fromJS)((0,n.default)(d,e,{type:"spec"})))),e.update("errors",(e=>{var t;return(0,s.default)(t=e||(0,c.List)()).call(t,(0,c.fromJS)(a))})).update("errors",(e=>(0,u.default)(e)))},[i.NEW_AUTH_ERR]:(e,t)=>{let{payload:a}=t,r=(0,c.fromJS)((0,n.default)({},a));return r=r.set("type","auth"),e.update("errors",(e=>(e||(0,c.List)()).push((0,c.fromJS)(r)))).update("errors",(e=>(0,u.default)(e)))},[i.CLEAR]:(e,t)=>{var a;let{payload:n}=t;if(!n||!e.get("errors"))return e;let r=(0,o.default)(a=e.get("errors")).call(a,(e=>{var t;return(0,l.default)(t=e.keySeq()).call(t,(t=>{const a=e.get(t),r=n[t];return!r||a!==r}))}));return e.merge({errors:r})},[i.CLEAR_BY]:(e,t)=>{var a;let{payload:n}=t;if(!n||"function"!=typeof n)return e;let r=(0,o.default)(a=e.get("errors")).call(a,(e=>n(e)));return e.merge({errors:r})}}}},7667:(e,t,a)=>{a.r(t),a.d(t,{allErrors:()=>s,lastError:()=>o});var n=a(9725),r=a(8639);const s=(0,r.createSelector)((e=>e),(e=>e.get("errors",(0,n.List)()))),o=(0,r.createSelector)(s,(e=>e.last()))},9978:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(4309);function r(){return{fn:{opsFilter:n.default}}}},4309:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(6145),r=a(8818);function s(e,t){return(0,n.default)(e).call(e,((e,a)=>-1!==(0,r.default)(a).call(a,t)))}},6395:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(863),r=a(810);a(5053);const s=e=>{let{className:t,width:a,height:s,...o}=e;return r.default.createElement("svg",(0,n.default)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:a,height:s,"aria-hidden":"true",focusable:"false"},o),r.default.createElement("path",{d:"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"}))};s.defaultProps={className:null,width:20,height:20};const o=s},9689:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(863),r=a(810);a(5053);const s=e=>{let{className:t,width:a,height:s,...o}=e;return r.default.createElement("svg",(0,n.default)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:a,height:s,"aria-hidden":"true",focusable:"false"},o),r.default.createElement("path",{d:"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z"}))};s.defaultProps={className:null,width:20,height:20};const o=s},6984:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(863),r=a(810);a(5053);const s=e=>{let{className:t,width:a,height:s,...o}=e;return r.default.createElement("svg",(0,n.default)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:a,height:s,"aria-hidden":"true",focusable:"false"},o),r.default.createElement("path",{d:"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"}))};s.defaultProps={className:null,width:20,height:20};const o=s},2478:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(863),r=a(810);a(5053);const s=e=>{let{className:t,width:a,height:s,...o}=e;return r.default.createElement("svg",(0,n.default)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:a,height:s,"aria-hidden":"true",focusable:"false"},o),r.default.createElement("path",{d:"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"}))};s.defaultProps={className:null,width:20,height:20};const o=s},3388:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(863),r=a(810);a(5053);const s=e=>{let{className:t,width:a,height:s,...o}=e;return r.default.createElement("svg",(0,n.default)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 15 16",className:t,width:a,height:s,"aria-hidden":"true",focusable:"false"},o),r.default.createElement("g",{transform:"translate(2, -1)"},r.default.createElement("path",{fill:"#ffffff",fillRule:"evenodd",d:"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"})))};s.defaultProps={className:null,width:15,height:16};const o=s},6945:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(863),r=a(810);a(5053);const s=e=>{let{className:t,width:a,height:s,...o}=e;return r.default.createElement("svg",(0,n.default)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:a,height:s,"aria-hidden":"true",focusable:"false"},o),r.default.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"}))};s.defaultProps={className:null,width:20,height:20};const o=s},2568:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(863),r=a(810);a(5053);const s=e=>{let{className:t,width:a,height:s,...o}=e;return r.default.createElement("svg",(0,n.default)({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",className:t,width:a,height:s,"aria-hidden":"true",focusable:"false"},o),r.default.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"}))};s.defaultProps={className:null,width:20,height:20};const o=s},70:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(9689),r=a(6395),s=a(6984),o=a(2478),l=a(3388),i=a(6945),c=a(2568);const u=()=>({components:{ArrowUpIcon:n.default,ArrowDownIcon:r.default,ArrowIcon:s.default,CloseIcon:o.default,CopyIcon:l.default,LockIcon:i.default,UnlockIcon:c.default}})},7349:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(810),r=(a(5053),a(8096)),s=a(2603);const o=e=>{let{expanded:t,children:a,onChange:o}=e;const l=(0,s.useComponent)("ChevronRightIcon"),i=(0,n.useCallback)((e=>{o(e,!t)}),[t,o]);return n.default.createElement("button",{type:"button",className:"json-schema-2020-12-accordion",onClick:i},n.default.createElement("div",{className:"json-schema-2020-12-accordion__children"},a),n.default.createElement("span",{className:(0,r.default)("json-schema-2020-12-accordion__icon",{"json-schema-2020-12-accordion__icon--expanded":t,"json-schema-2020-12-accordion__icon--collapsed":!t})},n.default.createElement(l,null)))};o.defaultProps={expanded:!1};const l=o},6867:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(5053);const r=e=>{let{expanded:t,onClick:a}=e;const r=(0,n.useCallback)((e=>{a(e,!t)}),[t,a]);return n.default.createElement("button",{type:"button",className:"json-schema-2020-12-expand-deep-button",onClick:r},t?"Collapse all":"Expand all")}},2675:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(2565),r=a(810),s=(a(5053),a(8096)),o=(a(6648),a(2603)),l=a(9006);const i=(0,r.forwardRef)(((e,t)=>{let{schema:a,name:i,dependentRequired:c,onExpand:u}=e;const d=(0,o.useFn)(),p=(0,o.useIsExpanded)(),m=(0,o.useIsExpandedDeeply)(),[f,h]=(0,r.useState)(p||m),[g,y]=(0,r.useState)(m),[v,E]=(0,o.useLevel)(),S=(0,o.useIsEmbedded)(),w=d.isExpandable(a)||c.length>0,b=(0,o.useIsCircular)(a),x=(0,o.useRenderedSchemas)(a),_=d.stringifyConstraints(a),C=(0,o.useComponent)("Accordion"),j=(0,o.useComponent)("Keyword$schema"),N=(0,o.useComponent)("Keyword$vocabulary"),O=(0,o.useComponent)("Keyword$id"),k=(0,o.useComponent)("Keyword$anchor"),A=(0,o.useComponent)("Keyword$dynamicAnchor"),I=(0,o.useComponent)("Keyword$ref"),R=(0,o.useComponent)("Keyword$dynamicRef"),P=(0,o.useComponent)("Keyword$defs"),T=(0,o.useComponent)("Keyword$comment"),M=(0,o.useComponent)("KeywordAllOf"),D=(0,o.useComponent)("KeywordAnyOf"),L=(0,o.useComponent)("KeywordOneOf"),q=(0,o.useComponent)("KeywordNot"),B=(0,o.useComponent)("KeywordIf"),U=(0,o.useComponent)("KeywordThen"),J=(0,o.useComponent)("KeywordElse"),$=(0,o.useComponent)("KeywordDependentSchemas"),V=(0,o.useComponent)("KeywordPrefixItems"),K=(0,o.useComponent)("KeywordItems"),F=(0,o.useComponent)("KeywordContains"),z=(0,o.useComponent)("KeywordProperties"),W=(0,o.useComponent)("KeywordPatternProperties"),H=(0,o.useComponent)("KeywordAdditionalProperties"),G=(0,o.useComponent)("KeywordPropertyNames"),Z=(0,o.useComponent)("KeywordUnevaluatedItems"),Y=(0,o.useComponent)("KeywordUnevaluatedProperties"),X=(0,o.useComponent)("KeywordType"),Q=(0,o.useComponent)("KeywordEnum"),ee=(0,o.useComponent)("KeywordConst"),te=(0,o.useComponent)("KeywordConstraint"),ae=(0,o.useComponent)("KeywordDependentRequired"),ne=(0,o.useComponent)("KeywordContentSchema"),re=(0,o.useComponent)("KeywordTitle"),se=(0,o.useComponent)("KeywordDescription"),oe=(0,o.useComponent)("KeywordDefault"),le=(0,o.useComponent)("KeywordDeprecated"),ie=(0,o.useComponent)("KeywordReadOnly"),ce=(0,o.useComponent)("KeywordWriteOnly"),ue=(0,o.useComponent)("ExpandDeepButton");(0,r.useEffect)((()=>{y(m)}),[m]),(0,r.useEffect)((()=>{y(g)}),[g]);const de=(0,r.useCallback)(((e,t)=>{h(t),!t&&y(!1),u(e,t,!1)}),[u]),pe=(0,r.useCallback)(((e,t)=>{h(t),y(t),u(e,t,!0)}),[u]);return r.default.createElement(l.JSONSchemaLevelContext.Provider,{value:E},r.default.createElement(l.JSONSchemaDeepExpansionContext.Provider,{value:g},r.default.createElement(l.JSONSchemaCyclesContext.Provider,{value:x},r.default.createElement("article",{ref:t,"data-json-schema-level":v,className:(0,s.default)("json-schema-2020-12",{"json-schema-2020-12--embedded":S,"json-schema-2020-12--circular":b})},r.default.createElement("div",{className:"json-schema-2020-12-head"},w&&!b?r.default.createElement(r.default.Fragment,null,r.default.createElement(C,{expanded:f,onChange:de},r.default.createElement(re,{title:i,schema:a})),r.default.createElement(ue,{expanded:f,onClick:pe})):r.default.createElement(re,{title:i,schema:a}),r.default.createElement(le,{schema:a}),r.default.createElement(ie,{schema:a}),r.default.createElement(ce,{schema:a}),r.default.createElement(X,{schema:a,isCircular:b}),_.length>0&&(0,n.default)(_).call(_,(e=>r.default.createElement(te,{key:`${e.scope}-${e.value}`,constraint:e})))),r.default.createElement("div",{className:(0,s.default)("json-schema-2020-12-body",{"json-schema-2020-12-body--collapsed":!f})},f&&r.default.createElement(r.default.Fragment,null,r.default.createElement(se,{schema:a}),!b&&w&&r.default.createElement(r.default.Fragment,null,r.default.createElement(z,{schema:a}),r.default.createElement(W,{schema:a}),r.default.createElement(H,{schema:a}),r.default.createElement(Y,{schema:a}),r.default.createElement(G,{schema:a}),r.default.createElement(M,{schema:a}),r.default.createElement(D,{schema:a}),r.default.createElement(L,{schema:a}),r.default.createElement(q,{schema:a}),r.default.createElement(B,{schema:a}),r.default.createElement(U,{schema:a}),r.default.createElement(J,{schema:a}),r.default.createElement($,{schema:a}),r.default.createElement(V,{schema:a}),r.default.createElement(K,{schema:a}),r.default.createElement(Z,{schema:a}),r.default.createElement(F,{schema:a}),r.default.createElement(ne,{schema:a})),r.default.createElement(Q,{schema:a}),r.default.createElement(ee,{schema:a}),r.default.createElement(ae,{schema:a,dependentRequired:c}),r.default.createElement(oe,{schema:a}),r.default.createElement(j,{schema:a}),r.default.createElement(N,{schema:a}),r.default.createElement(O,{schema:a}),r.default.createElement(k,{schema:a}),r.default.createElement(A,{schema:a}),r.default.createElement(I,{schema:a}),!b&&w&&r.default.createElement(P,{schema:a}),r.default.createElement(R,{schema:a}),r.default.createElement(T,{schema:a})))))))}));i.defaultProps={name:"",dependentRequired:[],onExpand:()=>{}};const c=i},2260:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);const r=()=>n.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},n.default.createElement("path",{d:"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}))},4922:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return null!=t&&t.$anchor?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--$anchor"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"$anchor"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},t.$anchor)):null}},4685:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return null!=t&&t.$comment?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--$comment"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"$comment"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},t.$comment)):null}},6418:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(2740),r=a(2565),s=a(7204),o=a(810),l=a(8096),i=(a(6648),a(2603)),c=a(9006);const u=e=>{var t;let{schema:a}=e;const u=(null==a?void 0:a.$defs)||{},d=(0,i.useIsExpandedDeeply)(),[p,m]=(0,o.useState)(d),[f,h]=(0,o.useState)(!1),g=(0,i.useComponent)("Accordion"),y=(0,i.useComponent)("ExpandDeepButton"),v=(0,i.useComponent)("JSONSchema"),E=(0,o.useCallback)((()=>{m((e=>!e))}),[]),S=(0,o.useCallback)(((e,t)=>{m(t),h(t)}),[]);return 0===(0,n.default)(u).length?null:o.default.createElement(c.JSONSchemaDeepExpansionContext.Provider,{value:f},o.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--$defs"},o.default.createElement(g,{expanded:p,onChange:E},o.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"$defs")),o.default.createElement(y,{expanded:p,onClick:S}),o.default.createElement("strong",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary"},"object"),o.default.createElement("ul",{className:(0,l.default)("json-schema-2020-12-keyword__children",{"json-schema-2020-12-keyword__children--collapsed":!p})},p&&o.default.createElement(o.default.Fragment,null,(0,r.default)(t=(0,s.default)(u)).call(t,(e=>{let[t,a]=e;return o.default.createElement("li",{key:t,className:"json-schema-2020-12-property"},o.default.createElement(v,{name:t,schema:a}))}))))))}},1338:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return null!=t&&t.$dynamicAnchor?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicAnchor"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"$dynamicAnchor"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},t.$dynamicAnchor)):null}},7655:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return null!=t&&t.$dynamicRef?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicRef"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"$dynamicRef"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},t.$dynamicRef)):null}},3460:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return null!=t&&t.$id?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--$id"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"$id"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},t.$id)):null}},2348:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return null!=t&&t.$ref?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--$ref"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"$ref"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},t.$ref)):null}},9359:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return null!=t&&t.$schema?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--$schema"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"$schema"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},t.$schema)):null}},7568:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(2565),r=a(7204),s=a(810),o=a(8096),l=(a(6648),a(2603));const i=e=>{var t;let{schema:a}=e;const i=(0,l.useIsExpandedDeeply)(),[c,u]=(0,s.useState)(i),d=(0,l.useComponent)("Accordion"),p=(0,s.useCallback)((()=>{u((e=>!e))}),[]);return null!=a&&a.$vocabulary?"object"!=typeof a.$vocabulary?null:s.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--$vocabulary"},s.default.createElement(d,{expanded:c,onChange:p},s.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"$vocabulary")),s.default.createElement("strong",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary"},"object"),s.default.createElement("ul",null,c&&(0,n.default)(t=(0,r.default)(a.$vocabulary)).call(t,(e=>{let[t,a]=e;return s.default.createElement("li",{key:t,className:(0,o.default)("json-schema-2020-12-$vocabulary-uri",{"json-schema-2020-12-$vocabulary-uri--disabled":!a})},s.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},t))})))):null}},5253:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),{additionalProperties:s}=t,o=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"additionalProperties"))return null;const l=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Additional properties");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--additionalProperties"},!0===s?n.default.createElement(n.default.Fragment,null,l,n.default.createElement("span",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary"},"allowed")):!1===s?n.default.createElement(n.default.Fragment,null,l,n.default.createElement("span",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary"},"forbidden")):n.default.createElement(o,{name:l,schema:s}))}},6457:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(4163),r=a(2565),s=a(810),o=a(8096),l=(a(6648),a(2603)),i=a(9006);const c=e=>{let{schema:t}=e;const a=(null==t?void 0:t.allOf)||[],c=(0,l.useFn)(),u=(0,l.useIsExpandedDeeply)(),[d,p]=(0,s.useState)(u),[m,f]=(0,s.useState)(!1),h=(0,l.useComponent)("Accordion"),g=(0,l.useComponent)("ExpandDeepButton"),y=(0,l.useComponent)("JSONSchema"),v=(0,l.useComponent)("KeywordType"),E=(0,s.useCallback)((()=>{p((e=>!e))}),[]),S=(0,s.useCallback)(((e,t)=>{p(t),f(t)}),[]);return(0,n.default)(a)&&0!==a.length?s.default.createElement(i.JSONSchemaDeepExpansionContext.Provider,{value:m},s.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--allOf"},s.default.createElement(h,{expanded:d,onChange:E},s.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"All of")),s.default.createElement(g,{expanded:d,onClick:S}),s.default.createElement(v,{schema:{allOf:a}}),s.default.createElement("ul",{className:(0,o.default)("json-schema-2020-12-keyword__children",{"json-schema-2020-12-keyword__children--collapsed":!d})},d&&s.default.createElement(s.default.Fragment,null,(0,r.default)(a).call(a,((e,t)=>s.default.createElement("li",{key:`#${t}`,className:"json-schema-2020-12-property"},s.default.createElement(y,{name:`#${t} ${c.getTitle(e)}`,schema:e})))))))):null}},8776:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(4163),r=a(2565),s=a(810),o=a(8096),l=(a(6648),a(2603)),i=a(9006);const c=e=>{let{schema:t}=e;const a=(null==t?void 0:t.anyOf)||[],c=(0,l.useFn)(),u=(0,l.useIsExpandedDeeply)(),[d,p]=(0,s.useState)(u),[m,f]=(0,s.useState)(!1),h=(0,l.useComponent)("Accordion"),g=(0,l.useComponent)("ExpandDeepButton"),y=(0,l.useComponent)("JSONSchema"),v=(0,l.useComponent)("KeywordType"),E=(0,s.useCallback)((()=>{p((e=>!e))}),[]),S=(0,s.useCallback)(((e,t)=>{p(t),f(t)}),[]);return(0,n.default)(a)&&0!==a.length?s.default.createElement(i.JSONSchemaDeepExpansionContext.Provider,{value:m},s.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--anyOf"},s.default.createElement(h,{expanded:d,onChange:E},s.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Any of")),s.default.createElement(g,{expanded:d,onClick:S}),s.default.createElement(v,{schema:{anyOf:a}}),s.default.createElement("ul",{className:(0,o.default)("json-schema-2020-12-keyword__children",{"json-schema-2020-12-keyword__children--collapsed":!d})},d&&s.default.createElement(s.default.Fragment,null,(0,r.default)(a).call(a,((e,t)=>s.default.createElement("li",{key:`#${t}`,className:"json-schema-2020-12-property"},s.default.createElement(y,{name:`#${t} ${c.getTitle(e)}`,schema:e})))))))):null}},7308:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)();return a.hasKeyword(t,"const")?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--const"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Const"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const"},a.stringify(t.const))):null}},9956:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810);a(5053);const r=e=>{let{constraint:t}=e;return n.default.createElement("span",{className:`json-schema-2020-12__constraint json-schema-2020-12__constraint--${t.scope}`},t.value)},s=n.default.memo(r)},8993:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),s=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"contains"))return null;const o=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Contains");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--contains"},n.default.createElement(s,{name:o,schema:t.contains}))}},3484:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),s=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"contentSchema"))return null;const o=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Content schema");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--contentSchema"},n.default.createElement(s,{name:o,schema:t.contentSchema}))}},5148:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)();return a.hasKeyword(t,"default")?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--default"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Default"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const"},a.stringify(t.default))):null}},4539:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(2565),r=a(810);a(5053),a(6648);const s=e=>{let{dependentRequired:t}=e;return 0===t.length?null:r.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentRequired"},r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Required when defined"),r.default.createElement("ul",null,(0,n.default)(t).call(t,(e=>r.default.createElement("li",{key:e},r.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--warning"},e))))))}},6076:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(2740),r=a(2565),s=a(7204),o=a(810),l=a(8096),i=(a(6648),a(2603)),c=a(9006);const u=e=>{var t;let{schema:a}=e;const u=(null==a?void 0:a.dependentSchemas)||[],d=(0,i.useIsExpandedDeeply)(),[p,m]=(0,o.useState)(d),[f,h]=(0,o.useState)(!1),g=(0,i.useComponent)("Accordion"),y=(0,i.useComponent)("ExpandDeepButton"),v=(0,i.useComponent)("JSONSchema"),E=(0,o.useCallback)((()=>{m((e=>!e))}),[]),S=(0,o.useCallback)(((e,t)=>{m(t),h(t)}),[]);return"object"!=typeof u||0===(0,n.default)(u).length?null:o.default.createElement(c.JSONSchemaDeepExpansionContext.Provider,{value:f},o.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentSchemas"},o.default.createElement(g,{expanded:p,onChange:E},o.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Dependent schemas")),o.default.createElement(y,{expanded:p,onClick:S}),o.default.createElement("strong",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary"},"object"),o.default.createElement("ul",{className:(0,l.default)("json-schema-2020-12-keyword__children",{"json-schema-2020-12-keyword__children--collapsed":!p})},p&&o.default.createElement(o.default.Fragment,null,(0,r.default)(t=(0,s.default)(u)).call(t,(e=>{let[t,a]=e;return o.default.createElement("li",{key:t,className:"json-schema-2020-12-property"},o.default.createElement(v,{name:t,schema:a}))}))))))}},6661:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return!0!==(null==t?void 0:t.deprecated)?null:n.default.createElement("span",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--warning"},"deprecated")}},9446:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return null!=t&&t.description?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--description"},n.default.createElement("div",{className:"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary"},t.description)):null}},7207:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),s=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"else"))return null;const o=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Else");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--if"},n.default.createElement(s,{name:o,schema:t.else}))}},1805:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(4163),r=a(2565),s=a(810),o=(a(6648),a(2603));const l=e=>{var t;let{schema:a}=e;const l=(0,o.useFn)();return(0,n.default)(null==a?void 0:a.enum)?s.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--enum"},s.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Allowed values"),s.default.createElement("ul",null,(0,r.default)(t=a.enum).call(t,(e=>{const t=l.stringify(e);return s.default.createElement("li",{key:t},s.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const"},t))})))):null}},487:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),s=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"if"))return null;const o=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"If");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--if"},n.default.createElement(s,{name:o,schema:t.if}))}},9206:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),s=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"items"))return null;const o=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Items");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--items"},n.default.createElement(s,{name:o,schema:t.items}))}},5174:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),s=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"not"))return null;const o=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Not");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--not"},n.default.createElement(s,{name:o,schema:t.not}))}},3834:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(4163),r=a(2565),s=a(810),o=a(8096),l=(a(6648),a(2603)),i=a(9006);const c=e=>{let{schema:t}=e;const a=(null==t?void 0:t.oneOf)||[],c=(0,l.useFn)(),u=(0,l.useIsExpandedDeeply)(),[d,p]=(0,s.useState)(u),[m,f]=(0,s.useState)(!1),h=(0,l.useComponent)("Accordion"),g=(0,l.useComponent)("ExpandDeepButton"),y=(0,l.useComponent)("JSONSchema"),v=(0,l.useComponent)("KeywordType"),E=(0,s.useCallback)((()=>{p((e=>!e))}),[]),S=(0,s.useCallback)(((e,t)=>{p(t),f(t)}),[]);return(0,n.default)(a)&&0!==a.length?s.default.createElement(i.JSONSchemaDeepExpansionContext.Provider,{value:m},s.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--oneOf"},s.default.createElement(h,{expanded:d,onChange:E},s.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"One of")),s.default.createElement(g,{expanded:d,onClick:S}),s.default.createElement(v,{schema:{oneOf:a}}),s.default.createElement("ul",{className:(0,o.default)("json-schema-2020-12-keyword__children",{"json-schema-2020-12-keyword__children--collapsed":!d})},d&&s.default.createElement(s.default.Fragment,null,(0,r.default)(a).call(a,((e,t)=>s.default.createElement("li",{key:`#${t}`,className:"json-schema-2020-12-property"},s.default.createElement(y,{name:`#${t} ${c.getTitle(e)}`,schema:e})))))))):null}},6746:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(2740),r=a(2565),s=a(7204),o=a(810),l=(a(6648),a(2603));const i=e=>{var t;let{schema:a}=e;const i=(null==a?void 0:a.patternProperties)||{},c=(0,l.useComponent)("JSONSchema");return 0===(0,n.default)(i).length?null:o.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--patternProperties"},o.default.createElement("ul",null,(0,r.default)(t=(0,s.default)(i)).call(t,(e=>{let[t,a]=e;return o.default.createElement("li",{key:t,className:"json-schema-2020-12-property"},o.default.createElement(c,{name:t,schema:a}))}))))}},3971:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(4163),r=a(2565),s=a(810),o=a(8096),l=(a(6648),a(2603)),i=a(9006);const c=e=>{let{schema:t}=e;const a=(null==t?void 0:t.prefixItems)||[],c=(0,l.useFn)(),u=(0,l.useIsExpandedDeeply)(),[d,p]=(0,s.useState)(u),[m,f]=(0,s.useState)(!1),h=(0,l.useComponent)("Accordion"),g=(0,l.useComponent)("ExpandDeepButton"),y=(0,l.useComponent)("JSONSchema"),v=(0,l.useComponent)("KeywordType"),E=(0,s.useCallback)((()=>{p((e=>!e))}),[]),S=(0,s.useCallback)(((e,t)=>{p(t),f(t)}),[]);return(0,n.default)(a)&&0!==a.length?s.default.createElement(i.JSONSchemaDeepExpansionContext.Provider,{value:m},s.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--prefixItems"},s.default.createElement(h,{expanded:d,onChange:E},s.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Prefix items")),s.default.createElement(g,{expanded:d,onClick:S}),s.default.createElement(v,{schema:{prefixItems:a}}),s.default.createElement("ul",{className:(0,o.default)("json-schema-2020-12-keyword__children",{"json-schema-2020-12-keyword__children--collapsed":!d})},d&&s.default.createElement(s.default.Fragment,null,(0,r.default)(a).call(a,((e,t)=>s.default.createElement("li",{key:`#${t}`,className:"json-schema-2020-12-property"},s.default.createElement(y,{name:`#${t} ${c.getTitle(e)}`,schema:e})))))))):null}},5472:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var n=a(4163),r=a(2740),s=a(2565),o=a(7204),l=a(2372),i=a(810),c=a(8096),u=(a(6648),a(2603));const d=e=>{var t;let{schema:a}=e;const d=(0,u.useFn)(),p=(null==a?void 0:a.properties)||{},m=(0,n.default)(null==a?void 0:a.required)?a.required:[],f=(0,u.useComponent)("JSONSchema");return 0===(0,r.default)(p).length?null:i.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties"},i.default.createElement("ul",null,(0,s.default)(t=(0,o.default)(p)).call(t,(e=>{let[t,n]=e;const r=(0,l.default)(m).call(m,t),s=d.getDependentRequired(t,a);return i.default.createElement("li",{key:t,className:(0,c.default)("json-schema-2020-12-property",{"json-schema-2020-12-property--required":r})},i.default.createElement(f,{name:t,schema:n,dependentRequired:s}))}))))}},2338:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),{propertyNames:s}=t,o=(0,r.useComponent)("JSONSchema"),l=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Property names");return a.hasKeyword(t,"propertyNames")?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--propertyNames"},n.default.createElement(o,{name:l,schema:s})):null}},6456:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return!0!==(null==t?void 0:t.readOnly)?null:n.default.createElement("span",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted"},"read-only")}},7401:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),s=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"then"))return null;const o=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Then");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--then"},n.default.createElement(s,{name:o,schema:t.then}))}},8137:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(810),r=(a(5053),a(6648),a(2603));const s=e=>{let{title:t,schema:a}=e;const s=(0,r.useFn)();return t||s.getTitle(a)?n.default.createElement("div",{className:"json-schema-2020-12__title"},t||s.getTitle(a)):null};s.defaultProps={title:""};const o=s},2285:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(810),r=(a(5053),a(6648),a(2603));const s=e=>{let{schema:t,isCircular:a}=e;const s=(0,r.useFn)().getType(t),o=a?" [circular]":"";return n.default.createElement("strong",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary"},`${s}${o}`)};s.defaultProps={isCircular:!1};const o=s},5828:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),{unevaluatedItems:s}=t,o=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"unevaluatedItems"))return null;const l=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Unevaluated items");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedItems"},n.default.createElement(o,{name:l,schema:s}))}},6907:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(6648),a(2603));const s=e=>{let{schema:t}=e;const a=(0,r.useFn)(),{unevaluatedProperties:s}=t,o=(0,r.useComponent)("JSONSchema");if(!a.hasKeyword(t,"unevaluatedProperties"))return null;const l=n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary"},"Unevaluated properties");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedProperties"},n.default.createElement(o,{name:l,schema:s}))}},5789:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(6648);const r=e=>{let{schema:t}=e;return!0!==(null==t?void 0:t.writeOnly)?null:n.default.createElement("span",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted"},"write-only")}},9006:(e,t,a)=>{a.r(t),a.d(t,{JSONSchemaContext:()=>s,JSONSchemaCyclesContext:()=>i,JSONSchemaDeepExpansionContext:()=>l,JSONSchemaLevelContext:()=>o});var n=a(527),r=a(810);const s=(0,r.createContext)(null);s.displayName="JSONSchemaContext";const o=(0,r.createContext)(0);o.displayName="JSONSchemaLevelContext";const l=(0,r.createContext)(!1);l.displayName="JSONSchemaDeepExpansionContext";const i=(0,r.createContext)(new n.default)},4121:(e,t,a)=>{a.r(t),a.d(t,{getDependentRequired:()=>C,getTitle:()=>y,getType:()=>v,hasKeyword:()=>S,isBooleanJSONSchema:()=>E,isExpandable:()=>w,stringify:()=>b,stringifyConstraints:()=>_,upperFirst:()=>g});var n=a(8136),r=a(3284),s=a(4163),o=a(2565),l=a(2372),i=a(1772),c=a(6145),u=a(313),d=a(8898),p=a(6785),m=a(7204),f=a(527),h=a(2603);const g=e=>"string"==typeof e?`${e.charAt(0).toUpperCase()}${(0,n.default)(e).call(e,1)}`:e,y=e=>{const t=(0,h.useFn)();return null!=e&&e.title?t.upperFirst(e.title):null!=e&&e.$anchor?t.upperFirst(e.$anchor):null!=e&&e.$id?e.$id:""},v=function(e){var t,a;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new r.default;const u=(0,h.useFn)();if(null==e)return"any";if(u.isBooleanJSONSchema(e))return e?"any":"never";if("object"!=typeof e)return"any";if(n.has(e))return"any";n.add(e);const{type:d,prefixItems:p,items:m}=e,f=()=>{if((0,s.default)(p)){const e=(0,o.default)(p).call(p,(e=>v(e,n))),t=m?v(m,n):"any";return`array<[${e.join(", ")}], ${t}>`}if(m){return`array<${v(m,n)}>`}return"array"};if(e.not&&"any"===v(e.not))return"never";const g=(0,s.default)(d)?(0,o.default)(d).call(d,(e=>"array"===e?f():e)).join(" | "):"array"===d?f():(0,l.default)(t=["null","boolean","object","array","number","integer","string"]).call(t,d)?d:(()=>{var t,a;if(Object.hasOwn(e,"prefixItems")||Object.hasOwn(e,"items")||Object.hasOwn(e,"contains"))return f();if(Object.hasOwn(e,"properties")||Object.hasOwn(e,"additionalProperties")||Object.hasOwn(e,"patternProperties"))return"object";if((0,l.default)(t=["int32","int64"]).call(t,e.format))return"integer";if((0,l.default)(a=["float","double"]).call(a,e.format))return"number";if(Object.hasOwn(e,"minimum")||Object.hasOwn(e,"maximum")||Object.hasOwn(e,"exclusiveMinimum")||Object.hasOwn(e,"exclusiveMaximum")||Object.hasOwn(e,"multipleOf"))return"number | integer";if(Object.hasOwn(e,"pattern")||Object.hasOwn(e,"format")||Object.hasOwn(e,"minLength")||Object.hasOwn(e,"maxLength"))return"string";if(void 0!==e.const){if(null===e.const)return"null";if("boolean"==typeof e.const)return"boolean";if("number"==typeof e.const)return(0,i.default)(e.const)?"integer":"number";if("string"==typeof e.const)return"string";if((0,s.default)(e.const))return"array";if("object"==typeof e.const)return"object"}return null})(),y=(t,a)=>{if((0,s.default)(e[t])){var r;return`(${(0,o.default)(r=e[t]).call(r,(e=>v(e,n))).join(a)})`}return null},E=y("oneOf"," | "),S=y("anyOf"," | "),w=y("allOf"," & "),b=(0,c.default)(a=[g,E,S,w]).call(a,Boolean).join(" | ");return n.delete(e),b||"any"},E=e=>"boolean"==typeof e,S=(e,t)=>null!==e&&"object"==typeof e&&Object.hasOwn(e,t),w=e=>{const t=(0,h.useFn)();return(null==e?void 0:e.$schema)||(null==e?void 0:e.$vocabulary)||(null==e?void 0:e.$id)||(null==e?void 0:e.$anchor)||(null==e?void 0:e.$dynamicAnchor)||(null==e?void 0:e.$ref)||(null==e?void 0:e.$dynamicRef)||(null==e?void 0:e.$defs)||(null==e?void 0:e.$comment)||(null==e?void 0:e.allOf)||(null==e?void 0:e.anyOf)||(null==e?void 0:e.oneOf)||t.hasKeyword(e,"not")||t.hasKeyword(e,"if")||t.hasKeyword(e,"then")||t.hasKeyword(e,"else")||(null==e?void 0:e.dependentSchemas)||(null==e?void 0:e.prefixItems)||t.hasKeyword(e,"items")||t.hasKeyword(e,"contains")||(null==e?void 0:e.properties)||(null==e?void 0:e.patternProperties)||t.hasKeyword(e,"additionalProperties")||t.hasKeyword(e,"propertyNames")||t.hasKeyword(e,"unevaluatedItems")||t.hasKeyword(e,"unevaluatedProperties")||(null==e?void 0:e.description)||(null==e?void 0:e.enum)||t.hasKeyword(e,"const")||t.hasKeyword(e,"contentSchema")||t.hasKeyword(e,"default")},b=e=>{var t;return null===e||(0,l.default)(t=["number","bigint","boolean"]).call(t,typeof e)?String(e):(0,s.default)(e)?`[${(0,o.default)(e).call(e,b).join(", ")}]`:(0,u.default)(e)},x=(e,t,a)=>{const n="number"==typeof t,r="number"==typeof a;return n&&r?t===a?`${t} ${e}`:`[${t}, ${a}] ${e}`:n?`>= ${t} ${e}`:r?`<= ${a} ${e}`:null},_=e=>{const t=[],a=(e=>{if("number"!=typeof(null==e?void 0:e.multipleOf))return null;if(e.multipleOf<=0)return null;if(1===e.multipleOf)return null;const{multipleOf:t}=e;if((0,i.default)(t))return`multiple of ${t}`;const a=10**t.toString().split(".")[1].length;return`multiple of ${t*a}/${a}`})(e);null!==a&&t.push({scope:"number",value:a});const n=(e=>{const t=null==e?void 0:e.minimum,a=null==e?void 0:e.maximum,n=null==e?void 0:e.exclusiveMinimum,r=null==e?void 0:e.exclusiveMaximum,s="number"==typeof t,o="number"==typeof a,l="number"==typeof n,i="number"==typeof r,c=l&&(!s||tr);if((s||l)&&(o||i))return`${c?"(":"["}${c?n:t}, ${u?r:a}${u?")":"]"}`;if(s||l)return`${c?">":"≥"} ${c?n:t}`;if(o||i)return`${u?"<":"≤"} ${u?r:a}`;return null})(e);null!==n&&t.push({scope:"number",value:n}),null!=e&&e.format&&t.push({scope:"string",value:e.format});const r=x("characters",null==e?void 0:e.minLength,null==e?void 0:e.maxLength);null!==r&&t.push({scope:"string",value:r}),null!=e&&e.pattern&&t.push({scope:"string",value:`matches ${null==e?void 0:e.pattern}`}),null!=e&&e.contentMediaType&&t.push({scope:"string",value:`media type: ${e.contentMediaType}`}),null!=e&&e.contentEncoding&&t.push({scope:"string",value:`encoding: ${e.contentEncoding}`});const s=x(null!=e&&e.hasUniqueItems?"unique items":"items",null==e?void 0:e.minItems,null==e?void 0:e.maxItems);null!==s&&t.push({scope:"array",value:s});const o=x("contained items",null==e?void 0:e.minContains,null==e?void 0:e.maxContains);null!==o&&t.push({scope:"array",value:o});const l=x("properties",null==e?void 0:e.minProperties,null==e?void 0:e.maxProperties);return null!==l&&t.push({scope:"object",value:l}),t},C=(e,t)=>{var a;return null!=t&&t.dependentRequired?(0,d.default)((0,p.default)(a=(0,m.default)(t.dependentRequired)).call(a,((t,a)=>{let[n,r]=a;return(0,s.default)(r)&&(0,l.default)(r).call(r,e)?(t.add(n),t):t}),new f.default)):[]}},5077:(e,t,a)=>{a.r(t),a.d(t,{withJSONSchemaContext:()=>H});var n=a(810),r=a(2675),s=a(9359),o=a(7568),l=a(3460),i=a(4922),c=a(1338),u=a(2348),d=a(7655),p=a(6418),m=a(4685),f=a(6457),h=a(8776),g=a(3834),y=a(5174),v=a(487),E=a(7401),S=a(7207),w=a(6076),b=a(3971),x=a(9206),_=a(8993),C=a(5472),j=a(6746),N=a(5253),O=a(2338),k=a(5828),A=a(6907),I=a(2285),R=a(1805),P=a(7308),T=a(9956),M=a(4539),D=a(3484),L=a(8137),q=a(9446),B=a(5148),U=a(6661),J=a(6456),$=a(5789),V=a(7349),K=a(6867),F=a(2260),z=a(9006),W=a(4121);const H=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const a={components:{JSONSchema:r.default,Keyword$schema:s.default,Keyword$vocabulary:o.default,Keyword$id:l.default,Keyword$anchor:i.default,Keyword$dynamicAnchor:c.default,Keyword$ref:u.default,Keyword$dynamicRef:d.default,Keyword$defs:p.default,Keyword$comment:m.default,KeywordAllOf:f.default,KeywordAnyOf:h.default,KeywordOneOf:g.default,KeywordNot:y.default,KeywordIf:v.default,KeywordThen:E.default,KeywordElse:S.default,KeywordDependentSchemas:w.default,KeywordPrefixItems:b.default,KeywordItems:x.default,KeywordContains:_.default,KeywordProperties:C.default,KeywordPatternProperties:j.default,KeywordAdditionalProperties:N.default,KeywordPropertyNames:O.default,KeywordUnevaluatedItems:k.default,KeywordUnevaluatedProperties:A.default,KeywordType:I.default,KeywordEnum:R.default,KeywordConst:P.default,KeywordConstraint:T.default,KeywordDependentRequired:M.default,KeywordContentSchema:D.default,KeywordTitle:L.default,KeywordDescription:q.default,KeywordDefault:B.default,KeywordDeprecated:U.default,KeywordReadOnly:J.default,KeywordWriteOnly:$.default,Accordion:V.default,ExpandDeepButton:K.default,ChevronRightIcon:F.default,...t.components},config:{default$schema:"https://json-schema.org/draft/2020-12/schema",defaultExpandedLevels:0,...t.config},fn:{upperFirst:W.upperFirst,getTitle:W.getTitle,getType:W.getType,isBooleanJSONSchema:W.isBooleanJSONSchema,hasKeyword:W.hasKeyword,isExpandable:W.isExpandable,stringify:W.stringify,stringifyConstraints:W.stringifyConstraints,getDependentRequired:W.getDependentRequired,...t.fn}},H=t=>n.default.createElement(z.JSONSchemaContext.Provider,{value:a},n.default.createElement(e,t));return H.contexts={JSONSchemaContext:z.JSONSchemaContext},H.displayName=e.displayName,H}},2603:(e,t,a)=>{a.r(t),a.d(t,{useComponent:()=>l,useConfig:()=>o,useFn:()=>i,useIsCircular:()=>f,useIsEmbedded:()=>u,useIsExpanded:()=>d,useIsExpandedDeeply:()=>p,useLevel:()=>c,useRenderedSchemas:()=>m});var n=a(527),r=a(810),s=a(9006);const o=()=>{const{config:e}=(0,r.useContext)(s.JSONSchemaContext);return e},l=e=>{const{components:t}=(0,r.useContext)(s.JSONSchemaContext);return t[e]||null},i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;const{fn:t}=(0,r.useContext)(s.JSONSchemaContext);return void 0!==e?t[e]:t},c=()=>{const e=(0,r.useContext)(s.JSONSchemaLevelContext);return[e,e+1]},u=()=>{const[e]=c();return e>0},d=()=>{const[e]=c(),{defaultExpandedLevels:t}=o();return t-e>0},p=()=>(0,r.useContext)(s.JSONSchemaDeepExpansionContext),m=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:void 0;if(void 0===e)return(0,r.useContext)(s.JSONSchemaCyclesContext);const t=(0,r.useContext)(s.JSONSchemaCyclesContext);return new n.default([...t,e])},f=e=>m().has(e)},7139:(e,t,a)=>{a.r(t),a.d(t,{default:()=>Z});var n=a(2675),r=a(9359),s=a(7568),o=a(3460),l=a(4922),i=a(1338),c=a(2348),u=a(7655),d=a(6418),p=a(4685),m=a(6457),f=a(8776),h=a(3834),g=a(5174),y=a(487),v=a(7401),E=a(7207),S=a(6076),w=a(3971),b=a(9206),x=a(8993),_=a(5472),C=a(6746),j=a(5253),N=a(2338),O=a(5828),k=a(6907),A=a(2285),I=a(1805),R=a(7308),P=a(9956),T=a(4539),M=a(3484),D=a(8137),L=a(9446),q=a(5148),B=a(6661),U=a(6456),J=a(5789),$=a(7349),V=a(6867),K=a(2260),F=a(4121),z=a(8591),W=a(9006),H=a(2603),G=a(5077);const Z=()=>({components:{JSONSchema202012:n.default,JSONSchema202012Keyword$schema:r.default,JSONSchema202012Keyword$vocabulary:s.default,JSONSchema202012Keyword$id:o.default,JSONSchema202012Keyword$anchor:l.default,JSONSchema202012Keyword$dynamicAnchor:i.default,JSONSchema202012Keyword$ref:c.default,JSONSchema202012Keyword$dynamicRef:u.default,JSONSchema202012Keyword$defs:d.default,JSONSchema202012Keyword$comment:p.default,JSONSchema202012KeywordAllOf:m.default,JSONSchema202012KeywordAnyOf:f.default,JSONSchema202012KeywordOneOf:h.default,JSONSchema202012KeywordNot:g.default,JSONSchema202012KeywordIf:y.default,JSONSchema202012KeywordThen:v.default,JSONSchema202012KeywordElse:E.default,JSONSchema202012KeywordDependentSchemas:S.default,JSONSchema202012KeywordPrefixItems:w.default,JSONSchema202012KeywordItems:b.default,JSONSchema202012KeywordContains:x.default,JSONSchema202012KeywordProperties:_.default,JSONSchema202012KeywordPatternProperties:C.default,JSONSchema202012KeywordAdditionalProperties:j.default,JSONSchema202012KeywordPropertyNames:N.default,JSONSchema202012KeywordUnevaluatedItems:O.default,JSONSchema202012KeywordUnevaluatedProperties:k.default,JSONSchema202012KeywordType:A.default,JSONSchema202012KeywordEnum:I.default,JSONSchema202012KeywordConst:R.default,JSONSchema202012KeywordConstraint:P.default,JSONSchema202012KeywordDependentRequired:T.default,JSONSchema202012KeywordContentSchema:M.default,JSONSchema202012KeywordTitle:D.default,JSONSchema202012KeywordDescription:L.default,JSONSchema202012KeywordDefault:q.default,JSONSchema202012KeywordDeprecated:B.default,JSONSchema202012KeywordReadOnly:U.default,JSONSchema202012KeywordWriteOnly:J.default,JSONSchema202012Accordion:$.default,JSONSchema202012ExpandDeepButton:V.default,JSONSchema202012ChevronRightIcon:K.default,withJSONSchema202012Context:G.withJSONSchemaContext,JSONSchema202012DeepExpansionContext:()=>W.JSONSchemaDeepExpansionContext},fn:{upperFirst:F.upperFirst,jsonSchema202012:{isExpandable:F.isExpandable,hasKeyword:F.hasKeyword,useFn:H.useFn,useConfig:H.useConfig,useComponent:H.useComponent,useIsExpandedDeeply:H.useIsExpandedDeeply,sampleFromSchema:z.sampleFromSchema,sampleFromSchemaGeneric:z.sampleFromSchemaGeneric,sampleEncoderAPI:z.encoderAPI,sampleFormatAPI:z.formatAPI,sampleMediaTypeAPI:z.mediaTypeAPI,createXMLExample:z.createXMLExample,memoizedSampleFromSchema:z.memoizedSampleFromSchema,memoizedCreateXMLExample:z.memoizedCreateXMLExample}}})},6648:(e,t,a)=>{a.r(t),a.d(t,{booleanSchema:()=>s,objectSchema:()=>r,schema:()=>o});var n=a(5053);const r=n.default.object,s=n.default.bool,o=n.default.oneOfType([r,s])},9507:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});const n=new(a(674).default),r=(e,t)=>"function"==typeof t?n.register(e,t):null===t?n.unregister(e):n.get(e);r.getDefaults=()=>n.defaults;const s=r},2906:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});const n=new(a(4215).default),r=(e,t)=>"function"==typeof t?n.register(e,t):null===t?n.unregister(e):n.get(e)},537:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});const n=new(a(3782).default),r=(e,t)=>{if("function"==typeof t)return n.register(e,t);if(null===t)return n.unregister(e);const a=e.split(";").at(0),r=`${a.split("/").at(0)}/*`;return n.get(e)||n.get(a)||n.get(r)};r.getDefaults=()=>n.defaults;const s=r},674:(e,t,a)=>{a.r(t),a.d(t,{default:()=>y});var n=a(775),r=a(5496),s=a(9651),o=a(4215),l=a(1433),i=a(8509),c=a(4366),u=a(5037),d=a(5709),p=a(4180),m=a(1967);function f(e,t,a){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,a)}var h=new s.default;class g extends o.default{constructor(){super(...arguments),f(this,h,{writable:!0,value:{"7bit":l.default,"8bit":i.default,binary:c.default,"quoted-printable":u.default,base16:d.default,base32:p.default,base64:m.default}}),(0,n.default)(this,"data",{...(0,r.default)(this,h)})}get defaults(){return{...(0,r.default)(this,h)}}}const y=g},3782:(e,t,a)=>{a.r(t),a.d(t,{default:()=>h});var n=a(775),r=a(5496),s=a(9651),o=a(4215),l=a(5378),i=a(6724),c=a(4342),u=a(2974),d=a(5652);function p(e,t,a){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,a)}var m=new s.default;class f extends o.default{constructor(){super(...arguments),p(this,m,{writable:!0,value:{...l.default,...i.default,...c.default,...u.default,...d.default}}),(0,n.default)(this,"data",{...(0,r.default)(this,m)})}get defaults(){return{...(0,r.default)(this,m)}}}const h=f},4215:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(775);const r=class{constructor(){(0,n.default)(this,"data",{})}register(e,t){this.data[e]=t}unregister(e){void 0===e?this.data={}:delete this.data[e]}get(e){return this.data[e]}}},8338:(e,t,a)=>{a.r(t),a.d(t,{ALL_TYPES:()=>r,SCALAR_TYPES:()=>n});const n=["number","integer","string","boolean","null"],r=["array","object",...n]},3783:(e,t,a)=>{a.r(t),a.d(t,{extractExample:()=>o,hasExample:()=>s});var n=a(4163),r=a(3084);const s=e=>{if(!(0,r.isJSONSchemaObject)(e))return!1;const{examples:t,example:a,default:s}=e;return!!((0,n.default)(t)&&t.length>=1)||(void 0!==s||void 0!==a)},o=e=>{if(!(0,r.isJSONSchemaObject)(e))return null;const{examples:t,example:a,default:s}=e;return(0,n.default)(t)&&t.length>=1?t.at(0):void 0!==s?s:void 0!==a?a:void 0}},7078:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p});var n=a(4163),r=a(5171),s=a(8898),o=a(527),l=a(2740),i=a(6145),c=a(6561),u=a(3084);const d=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if((0,u.isBooleanJSONSchema)(e)&&!0===e)return!0;if((0,u.isBooleanJSONSchema)(e)&&!1===e)return!1;if((0,u.isBooleanJSONSchema)(t)&&!0===t)return!0;if((0,u.isBooleanJSONSchema)(t)&&!1===t)return!1;if(!(0,u.isJSONSchema)(e))return t;if(!(0,u.isJSONSchema)(t))return e;const p={...t,...e};if(t.type&&e.type&&(0,n.default)(t.type)&&"string"==typeof t.type){var m;const a=(0,r.default)(m=(0,c.AF)(t.type)).call(m,e.type);p.type=(0,s.default)(new o.default(a))}if((0,n.default)(t.required)&&(0,n.default)(e.required)&&(p.required=[...new o.default([...e.required,...t.required])]),t.properties&&e.properties){const n=new o.default([...(0,l.default)(t.properties),...(0,l.default)(e.properties)]);p.properties={};for(const r of n){const n=t.properties[r]||{},s=e.properties[r]||{};var f;if(n.readOnly&&!a.includeReadOnly||n.writeOnly&&!a.includeWriteOnly)p.required=(0,i.default)(f=p.required||[]).call(f,(e=>e!==r));else p.properties[r]=d(s,n,a)}}return(0,u.isJSONSchema)(t.items)&&(0,u.isJSONSchema)(e.items)&&(p.items=d(e.items,t.items,a)),(0,u.isJSONSchema)(t.contains)&&(0,u.isJSONSchema)(e.contains)&&(p.contains=d(e.contains,t.contains,a)),(0,u.isJSONSchema)(t.contentSchema)&&(0,u.isJSONSchema)(e.contentSchema)&&(p.contentSchema=d(e.contentSchema,t.contentSchema,a)),p},p=d},3084:(e,t,a)=>{a.r(t),a.d(t,{isBooleanJSONSchema:()=>r,isJSONSchema:()=>o,isJSONSchemaObject:()=>s});var n=a(8646);const r=e=>"boolean"==typeof e,s=e=>(0,n.default)(e),o=e=>r(e)||s(e)},5202:(e,t,a)=>{a.r(t),a.d(t,{bytes:()=>o,integer:()=>d,number:()=>u,pick:()=>i,randexp:()=>l,string:()=>c});var n=a(1798),r=a.n(n),s=a(2092);const o=e=>r()(e),l=e=>{try{return new s.default(e).gen()}catch{return"string"}},i=e=>e.at(0),c=()=>"string",u=()=>0,d=()=>0},6276:(e,t,a)=>{a.r(t),a.d(t,{foldType:()=>y,getType:()=>E,inferType:()=>v});var n=a(4163),r=a(1772),s=a(2372),o=a(3284),l=a(2740),i=a(2565),c=a(6145),u=a(8338),d=a(3084),p=a(5202),m=a(3783);const f={array:["items","prefixItems","contains","maxContains","minContains","maxItems","minItems","uniqueItems","unevaluatedItems"],object:["properties","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","required","dependentSchemas","dependentRequired","unevaluatedProperties"],string:["pattern","format","minLength","maxLength","contentEncoding","contentMediaType","contentSchema"],integer:["minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf"]};f.number=f.integer;const h="string",g=e=>void 0===e?null:null===e?"null":(0,n.default)(e)?"array":(0,r.default)(e)?"integer":typeof e,y=e=>{if((0,n.default)(e)&&e.length>=1){if((0,s.default)(e).call(e,"array"))return"array";if((0,s.default)(e).call(e,"object"))return"object";{const t=(0,p.pick)(e);if((0,s.default)(u.ALL_TYPES).call(u.ALL_TYPES,t))return t}}return(0,s.default)(u.ALL_TYPES).call(u.ALL_TYPES,e)?e:null},v=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:new o.default;if(!(0,d.isJSONSchemaObject)(e))return h;if(t.has(e))return h;t.add(e);let{type:a,const:r}=e;if(a=y(a),"string"!=typeof a){const t=(0,l.default)(f);e:for(let n=0;n{if((0,n.default)(e[a])){var r;const n=(0,i.default)(r=e[a]).call(r,(e=>v(e,t)));return y(n)}return null},o=r("allOf"),l=r("anyOf"),u=r("oneOf"),d=e.not?v(e.not,t):null;var s;if(o||l||u||d)a=y((0,c.default)(s=[o,l,u,d]).call(s,Boolean))}if("string"!=typeof a&&(0,m.hasExample)(e)){const t=(0,m.extractExample)(e),n=g(t);a="string"==typeof n?n:a}return t.delete(e),a||h},E=e=>v(e)},9346:(e,t,a)=>{a.r(t),a.d(t,{fromJSONBooleanSchema:()=>r,typeCast:()=>s});var n=a(3084);const r=e=>!1===e?{not:{}}:{},s=e=>(0,n.isBooleanJSONSchema)(e)?r(e):(0,n.isJSONSchemaObject)(e)?e:{}},1433:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(8764).Buffer;const r=e=>n.from(e).toString("ascii")},8509:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(8764).Buffer;const r=e=>n.from(e).toString("utf8")},5709:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(8764).Buffer;const r=e=>n.from(e).toString("hex")},4180:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(8764).Buffer;const r=e=>{const t=n.from(e).toString("utf8"),a="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";let r=0,s="",o=0,l=0;for(let e=0;e=5;)s+=a.charAt(o>>>l-5&31),l-=5;l>0&&(s+=a.charAt(o<<5-l&31),r=(8-8*t.length%5)%5);for(let e=0;e{a.r(t),a.d(t,{default:()=>r});var n=a(8764).Buffer;const r=e=>n.from(e).toString("base64")},4366:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(8764).Buffer;const r=e=>n.from(e).toString("binary")},5037:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(8136);const r=e=>{let t="";for(let s=0;s=33&&o<=60||o>=62&&o<=126||9===o||32===o)t+=e.charAt(s);else if(13===o||10===o)t+="\r\n";else if(o>126){const r=unescape(encodeURIComponent(e.charAt(s)));for(let e=0;e{a.r(t),a.d(t,{default:()=>n});const n=()=>(new Date).toISOString()},1456:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>(new Date).toISOString().substring(0,10)},560:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>.1},4299:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"P3D"},3981:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"user@example.com"},1890:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>.1},9375:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"example.com"},4518:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"실례@example.com"},273:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"실례.com"},7864:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>2**30>>>0},1726:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>2**53-1},8793:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"198.51.100.42"},8269:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"2001:0db8:5b96:0000:0000:426f:8e17:642a"},5693:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"path/실례.html"},3080:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"https://실례.com/"},7856:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"/a/b/c"},5652:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});const n=(e=>{var t={};return a.d(t,e),t})({default:()=>s.default});var r=a(5202);const o={"application/json":()=>'{"key":"value"}',"application/ld+json":()=>'{"name": "John Doe"}',"application/x-httpd-php":()=>"Hello World!

'; ?>","application/rtf":()=>n.default`{\rtf1\adeflang1025\ansi\ansicpg1252\uc1`,"application/x-sh":()=>'echo "Hello World!"',"application/xhtml+xml":()=>"

content

","application/*":()=>(0,r.bytes)(25).toString("binary")}},4342:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(5202);const r={"audio/*":()=>(0,n.bytes)(25).toString("binary")}},6724:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(5202);const r={"image/*":()=>(0,n.bytes)(25).toString("binary")}},5378:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n={"text/plain":()=>"string","text/css":()=>".selector { border: 1px solid red }","text/csv":()=>"value1,value2,value3","text/html":()=>"

content

","text/calendar":()=>"BEGIN:VCALENDAR","text/javascript":()=>"console.dir('Hello world!');","text/xml":()=>'John Doe',"text/*":()=>"string"}},2974:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(5202);const r={"video/*":()=>(0,n.bytes)(25).toString("binary")}},3393:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"********"},4335:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"^[a-z]+$"},375:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"1/0"},5243:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>(new Date).toISOString().substring(11)},4692:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"path/index.html"},3829:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"https://example.com/dictionary/{term:1}/{term}"},2978:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"https://example.com/"},8859:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>"3fa85f64-5717-4562-b3fc-2c963f66afa6"},8591:(e,t,a)=>{a.r(t),a.d(t,{createXMLExample:()=>n.createXMLExample,encoderAPI:()=>r.default,formatAPI:()=>s.default,mediaTypeAPI:()=>o.default,memoizedCreateXMLExample:()=>n.memoizedCreateXMLExample,memoizedSampleFromSchema:()=>n.memoizedSampleFromSchema,sampleFromSchema:()=>n.sampleFromSchema,sampleFromSchemaGeneric:()=>n.sampleFromSchemaGeneric});var n=a(4277),r=a(9507),s=a(2906),o=a(537)},4277:(e,t,a)=>{a.r(t),a.d(t,{createXMLExample:()=>C,memoizedCreateXMLExample:()=>O,memoizedSampleFromSchema:()=>k,sampleFromSchema:()=>j,sampleFromSchemaGeneric:()=>_});var n=a(4163),r=a(1772),s=a(29),o=a(1778),l=a(2372),i=a(5171),c=a(2565),u=a(313),d=a(3479),p=a.n(d),m=a(8747),f=a(8646),h=a(6561),g=a(9669),y=a(3273),v=a(6276),E=a(9346),S=a(3783),w=a(5202),b=a(7078),x=a(3084);const _=function(e){var t;let a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,d=arguments.length>3&&void 0!==arguments[3]&&arguments[3];"function"==typeof(null===(t=e)||void 0===t?void 0:t.toJS)&&(e=e.toJS()),e=(0,E.typeCast)(e);let p=void 0!==u||(0,S.hasExample)(e);const g=!p&&(0,n.default)(e.oneOf)&&e.oneOf.length>0,C=!p&&(0,n.default)(e.anyOf)&&e.anyOf.length>0;if(!p&&(g||C)){const t=(0,E.typeCast)(g?(0,w.pick)(e.oneOf):(0,w.pick)(e.anyOf));!(e=(0,b.default)(e,t,a)).xml&&t.xml&&(e.xml=t.xml),(0,S.hasExample)(e)&&(0,S.hasExample)(t)&&(p=!0)}const j={};let{xml:N,properties:O,additionalProperties:k,items:A,contains:I}=e||{},R=(0,v.getType)(e),{includeReadOnly:P,includeWriteOnly:T}=a;N=N||{};let M,{name:D,prefix:L,namespace:q}=N,B={};if(Object.hasOwn(e,"type")||(e.type=R),d&&(D=D||"notagname",M=(L?`${L}:`:"")+D,q)){j[L?`xmlns:${L}`:"xmlns"]=q}d&&(B[M]=[]);const U=(0,h.mz)(O);let J,$=0;const V=()=>(0,r.default)(e.maxProperties)&&e.maxProperties>0&&$>=e.maxProperties,K=t=>!((0,r.default)(e.maxProperties)&&e.maxProperties>0)||!V()&&(!(t=>{var a;return!(0,n.default)(e.required)||0===e.required.length||!(0,l.default)(a=e.required).call(a,t)})(t)||e.maxProperties-$-(()=>{if(!(0,n.default)(e.required)||0===e.required.length)return 0;let t=0;var a,r;return d?(0,s.default)(a=e.required).call(a,(e=>t+=void 0===B[e]?0:1)):(0,s.default)(r=e.required).call(r,(e=>{var a;t+=void 0===(null===(a=B[M])||void 0===a?void 0:(0,o.default)(a).call(a,(t=>void 0!==t[e])))?0:1})),e.required.length-t})()>0);if(J=d?function(t){let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(e&&U[t]){if(U[t].xml=U[t].xml||{},U[t].xml.attribute){const e=(0,n.default)(U[t].enum)?(0,w.pick)(U[t].enum):void 0;if((0,S.hasExample)(U[t]))j[U[t].xml.name||t]=(0,S.extractExample)(U[t]);else if(void 0!==e)j[U[t].xml.name||t]=e;else{const e=(0,E.typeCast)(U[t]),a=(0,v.getType)(e),n=U[t].xml.name||t;j[n]=y.default[a](e)}return}U[t].xml.name=U[t].xml.name||t}else U[t]||!1===k||(U[t]={xml:{name:t}});let s=_(U[t],a,r,d);var o;K(t)&&($++,(0,n.default)(s)?B[M]=(0,i.default)(o=B[M]).call(o,s):B[M].push(s))}:(t,n)=>{var r;if(K(t)){if((0,f.default)(null===(r=e.discriminator)||void 0===r?void 0:r.mapping)&&e.discriminator.propertyName===t&&"string"==typeof e.$$ref){for(const a in e.discriminator.mapping)if(-1!==e.$$ref.search(e.discriminator.mapping[a])){B[t]=a;break}}else B[t]=_(U[t],a,n,d);$++}},p){let t;if(t=void 0!==u?u:(0,S.extractExample)(e),!d){if("number"==typeof t&&"string"===R)return`${t}`;if("string"!=typeof t||"string"===R)return t;try{return JSON.parse(t)}catch{return t}}if("array"===R){if(!(0,n.default)(t)){if("string"==typeof t)return t;t=[t]}let r=[];return(0,x.isJSONSchemaObject)(A)&&(A.xml=A.xml||N||{},A.xml.name=A.xml.name||N.name,r=(0,c.default)(t).call(t,(e=>_(A,a,e,d)))),(0,x.isJSONSchemaObject)(I)&&(I.xml=I.xml||N||{},I.xml.name=I.xml.name||N.name,r=[_(I,a,void 0,d),...r]),r=y.default.array(e,{sample:r}),N.wrapped?(B[M]=r,(0,m.default)(j)||B[M].push({_attr:j})):B=r,B}if("object"===R){if("string"==typeof t)return t;for(const e in t){var F,z,W,H;Object.hasOwn(t,e)&&(null!==(F=U[e])&&void 0!==F&&F.readOnly&&!P||null!==(z=U[e])&&void 0!==z&&z.writeOnly&&!T||(null!==(W=U[e])&&void 0!==W&&null!==(H=W.xml)&&void 0!==H&&H.attribute?j[U[e].xml.name||e]=t[e]:J(e,t[e])))}return(0,m.default)(j)||B[M].push({_attr:j}),B}return B[M]=(0,m.default)(j)?t:[{_attr:j},t],B}if("array"===R){let t=[];var G,Z;if((0,x.isJSONSchemaObject)(I))if(d&&(I.xml=I.xml||e.xml||{},I.xml.name=I.xml.name||N.name),(0,n.default)(I.anyOf))t.push(...(0,c.default)(G=I.anyOf).call(G,(e=>_((0,b.default)(e,I,a),a,void 0,d))));else if((0,n.default)(I.oneOf)){var Y;t.push(...(0,c.default)(Y=I.oneOf).call(Y,(e=>_((0,b.default)(e,I,a),a,void 0,d))))}else{if(!(!d||d&&N.wrapped))return _(I,a,void 0,d);t.push(_(I,a,void 0,d))}if((0,x.isJSONSchemaObject)(A))if(d&&(A.xml=A.xml||e.xml||{},A.xml.name=A.xml.name||N.name),(0,n.default)(A.anyOf))t.push(...(0,c.default)(Z=A.anyOf).call(Z,(e=>_((0,b.default)(e,A,a),a,void 0,d))));else if((0,n.default)(A.oneOf)){var X;t.push(...(0,c.default)(X=A.oneOf).call(X,(e=>_((0,b.default)(e,A,a),a,void 0,d))))}else{if(!(!d||d&&N.wrapped))return _(A,a,void 0,d);t.push(_(A,a,void 0,d))}return t=y.default.array(e,{sample:t}),d&&N.wrapped?(B[M]=t,(0,m.default)(j)||B[M].push({_attr:j}),B):t}if("object"===R){for(let e in U){var Q,ee,te;Object.hasOwn(U,e)&&(null!==(Q=U[e])&&void 0!==Q&&Q.deprecated||null!==(ee=U[e])&&void 0!==ee&&ee.readOnly&&!P||null!==(te=U[e])&&void 0!==te&&te.writeOnly&&!T||J(e))}if(d&&j&&B[M].push({_attr:j}),V())return B;if((0,x.isBooleanJSONSchema)(k)&&k)d?B[M].push({additionalProp:"Anything can be here"}):B.additionalProp1={},$++;else if((0,x.isJSONSchemaObject)(k)){var ae,ne;const t=k,n=_(t,a,void 0,d);if(d&&"string"==typeof(null==t||null===(ae=t.xml)||void 0===ae?void 0:ae.name)&&"notagname"!==(null==t||null===(ne=t.xml)||void 0===ne?void 0:ne.name))B[M].push(n);else{const t=(0,r.default)(e.minProperties)&&e.minProperties>0&&${const n=_(e,t,a,!0);if(n)return"string"==typeof n?n:p()(n,{declaration:!0,indent:"\t"})},j=(e,t,a)=>_(e,t,a,!1),N=(e,t,a)=>[e,(0,u.default)(t),(0,u.default)(a)],O=(0,g.Z)(C,N),k=(0,g.Z)(j,N)},8262:(e,t,a)=>{a.r(t),a.d(t,{applyArrayConstraints:()=>l,default:()=>i});var n=a(1772),r=a(8136),s=a(8898),o=a(527);const l=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{minItems:a,maxItems:l,uniqueItems:i}=t,{contains:c,minContains:u,maxContains:d}=t;let p=[...e];if(null!=c&&"object"==typeof c){if((0,n.default)(u)&&u>1){const e=p.at(0);for(let t=1;t0&&(p=(0,r.default)(e).call(e,0,l)),(0,n.default)(a)&&a>0)for(let e=0;p.length{let{sample:a}=t;return l(a,e)}},4108:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=e=>"boolean"!=typeof e.default||e.default},3273:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var n=a(8262),r=a(6852),s=a(4522),o=a(7742),l=a(8864),i=a(4108),c=a(853);const u={array:n.default,object:r.default,string:s.default,number:o.default,integer:l.default,boolean:i.default,null:c.default},d=new Proxy(u,{get:(e,t)=>"string"==typeof t&&Object.hasOwn(e,t)?e[t]:()=>`Unknown Type: ${t}`})},8864:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(5202),r=a(2906),s=a(7864),o=a(1726);const l=e=>{const{format:t}=e;return"string"==typeof t?(e=>{const{format:t}=e,a=(0,r.default)(t);if("function"==typeof a)return a(e);switch(t){case"int32":return(0,s.default)();case"int64":return(0,o.default)()}return(0,n.integer)()})(e):(0,n.integer)()}},853:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>null},7742:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(1772);const r=(e=>{var t={};return a.d(t,e),t})({default:()=>o.default});var s=a(5202),l=a(2906),i=a(1890),c=a(560);const u=e=>{const{format:t}=e;let a;return a="string"==typeof t?(e=>{const{format:t}=e,a=(0,l.default)(t);if("function"==typeof a)return a(e);switch(t){case"float":return(0,i.default)();case"double":return(0,c.default)()}return(0,s.number)()})(e):(0,s.number)(),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{minimum:a,maximum:s,exclusiveMinimum:o,exclusiveMaximum:l}=t,{multipleOf:i}=t,c=(0,n.default)(e)?1:r.default;let u="number"==typeof a?a:null,d="number"==typeof s?s:null,p=e;if("number"==typeof o&&(u=null!==u?Math.max(u,o+c):o+c),"number"==typeof l&&(d=null!==d?Math.min(d,l-c):l-c),p=u>d&&e||u||d||p,"number"==typeof i&&i>0){const e=p%i;p=0===e?p:p+i-e}return p}(a,e)}},6852:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=()=>{throw new Error("Not implemented")}},4522:(e,t,a)=>{a.r(t),a.d(t,{default:()=>P});var n=a(1772),r=a(8136),s=a(4163),o=a(313),l=a(1252),i=a(5202),c=a(3084),u=a(3981),d=a(4518),p=a(9375),m=a(273),f=a(8793),h=a(8269),g=a(2978),y=a(4692),v=a(3080),E=a(5693),S=a(8859),w=a(3829),b=a(7856),x=a(375),_=a(4045),C=a(1456),j=a(5243),N=a(4299),O=a(3393),k=a(4335),A=a(2906),I=a(9507),R=a(537);const P=function(e){let{sample:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{contentEncoding:a,contentMediaType:P,contentSchema:T}=e,{pattern:M,format:D}=e,L=(0,I.default)(a)||l.default;let q;if("string"==typeof M)q=(0,i.randexp)(M);else if("string"==typeof D)q=(e=>{const{format:t}=e,a=(0,A.default)(t);if("function"==typeof a)return a(e);switch(t){case"email":return(0,u.default)();case"idn-email":return(0,d.default)();case"hostname":return(0,p.default)();case"idn-hostname":return(0,m.default)();case"ipv4":return(0,f.default)();case"ipv6":return(0,h.default)();case"uri":return(0,g.default)();case"uri-reference":return(0,y.default)();case"iri":return(0,v.default)();case"iri-reference":return(0,E.default)();case"uuid":return(0,S.default)();case"uri-template":return(0,w.default)();case"json-pointer":return(0,b.default)();case"relative-json-pointer":return(0,x.default)();case"date-time":return(0,_.default)();case"date":return(0,C.default)();case"time":return(0,j.default)();case"duration":return(0,N.default)();case"password":return(0,O.default)();case"regex":return(0,k.default)()}return(0,i.string)()})(e);else if((0,c.isJSONSchema)(T)&&"string"==typeof P&&void 0!==t)q=(0,s.default)(t)||"object"==typeof t?(0,o.default)(t):String(t);else if("string"==typeof P){const t=(0,R.default)(P);"function"==typeof t&&(q=t(e))}else q=(0,i.string)();return L(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{maxLength:a,minLength:s}=t;let o=e;if((0,n.default)(a)&&a>0&&(o=(0,r.default)(o).call(o,0,a)),(0,n.default)(s)&&s>0){let e=0;for(;o.length{a.r(t),a.d(t,{SHOW:()=>l,UPDATE_FILTER:()=>s,UPDATE_LAYOUT:()=>r,UPDATE_MODE:()=>o,changeMode:()=>d,show:()=>u,updateFilter:()=>c,updateLayout:()=>i});var n=a(6561);const r="layout_update_layout",s="layout_update_filter",o="layout_update_mode",l="layout_show";function i(e){return{type:r,payload:e}}function c(e){return{type:s,payload:e}}function u(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return e=(0,n.AF)(e),{type:l,payload:{thing:e,shown:t}}}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,n.AF)(e),{type:o,payload:{thing:e,mode:t}}}},6821:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(5672),r=a(5474),s=a(4400),o=a(8989);function l(){return{statePlugins:{layout:{reducers:n.default,actions:r,selectors:s},spec:{wrapSelectors:o}}}}},5672:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(5171),r=a(9725),s=a(5474);const o={[s.UPDATE_LAYOUT]:(e,t)=>e.set("layout",t.payload),[s.UPDATE_FILTER]:(e,t)=>e.set("filter",t.payload),[s.SHOW]:(e,t)=>{const a=t.payload.shown,n=(0,r.fromJS)(t.payload.thing);return e.update("shown",(0,r.fromJS)({}),(e=>e.set(n,a)))},[s.UPDATE_MODE]:(e,t)=>{var a;let r=t.payload.thing,s=t.payload.mode;return e.setIn((0,n.default)(a=["modes"]).call(a,r),(s||"")+"")}}},4400:(e,t,a)=>{a.r(t),a.d(t,{current:()=>o,currentFilter:()=>l,isShown:()=>i,showSummary:()=>u,whatMode:()=>c});var n=a(8639),r=a(6561),s=a(9725);const o=e=>e.get("layout"),l=e=>e.get("filter"),i=(e,t,a)=>(t=(0,r.AF)(t),e.get("shown",(0,s.fromJS)({})).get((0,s.fromJS)(t),a)),c=function(e,t){let a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return t=(0,r.AF)(t),e.getIn(["modes",...t],a)},u=(0,n.createSelector)((e=>e),(e=>!i(e,"editor")))},8989:(e,t,a)=>{a.r(t),a.d(t,{taggedOperations:()=>r});var n=a(8136);const r=(e,t)=>function(a){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o=0&&(l=(0,n.default)(l).call(l,0,p)),l}},9150:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(5527);function r(e){let{configs:t}=e;const a={debug:0,info:1,log:2,warn:3,error:4},r=e=>a[e]||-1;let{logLevel:s}=t,o=r(s);function l(e){for(var t=arguments.length,a=new Array(t>1?t-1:0),n=1;n=o&&console[e](...a)}return l.warn=(0,n.default)(l).call(l,null,"warn"),l.error=(0,n.default)(l).call(l,null,"error"),l.info=(0,n.default)(l).call(l,null,"info"),l.debug=(0,n.default)(l).call(l,null,"debug"),{rootInjects:{log:l}}}},7002:(e,t,a)=>{a.r(t),a.d(t,{CLEAR_REQUEST_BODY_VALIDATE_ERROR:()=>p,CLEAR_REQUEST_BODY_VALUE:()=>m,SET_REQUEST_BODY_VALIDATE_ERROR:()=>d,UPDATE_ACTIVE_EXAMPLES_MEMBER:()=>l,UPDATE_REQUEST_BODY_INCLUSION:()=>o,UPDATE_REQUEST_BODY_VALUE:()=>r,UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG:()=>s,UPDATE_REQUEST_CONTENT_TYPE:()=>i,UPDATE_RESPONSE_CONTENT_TYPE:()=>c,UPDATE_SELECTED_SERVER:()=>n,UPDATE_SERVER_VARIABLE_VALUE:()=>u,clearRequestBodyValidateError:()=>x,clearRequestBodyValue:()=>C,initRequestBodyValidateError:()=>_,setActiveExamplesMember:()=>v,setRequestBodyInclusion:()=>y,setRequestBodyValidateError:()=>b,setRequestBodyValue:()=>h,setRequestContentType:()=>E,setResponseContentType:()=>S,setRetainRequestBodyValueFlag:()=>g,setSelectedServer:()=>f,setServerVariableValue:()=>w});const n="oas3_set_servers",r="oas3_set_request_body_value",s="oas3_set_request_body_retain_flag",o="oas3_set_request_body_inclusion",l="oas3_set_active_examples_member",i="oas3_set_request_content_type",c="oas3_set_response_content_type",u="oas3_set_server_variable_value",d="oas3_set_request_body_validate_error",p="oas3_clear_request_body_validate_error",m="oas3_clear_request_body_value";function f(e,t){return{type:n,payload:{selectedServerUrl:e,namespace:t}}}function h(e){let{value:t,pathMethod:a}=e;return{type:r,payload:{value:t,pathMethod:a}}}const g=e=>{let{value:t,pathMethod:a}=e;return{type:s,payload:{value:t,pathMethod:a}}};function y(e){let{value:t,pathMethod:a,name:n}=e;return{type:o,payload:{value:t,pathMethod:a,name:n}}}function v(e){let{name:t,pathMethod:a,contextType:n,contextName:r}=e;return{type:l,payload:{name:t,pathMethod:a,contextType:n,contextName:r}}}function E(e){let{value:t,pathMethod:a}=e;return{type:i,payload:{value:t,pathMethod:a}}}function S(e){let{value:t,path:a,method:n}=e;return{type:c,payload:{value:t,path:a,method:n}}}function w(e){let{server:t,namespace:a,key:n,val:r}=e;return{type:u,payload:{server:t,namespace:a,key:n,val:r}}}const b=e=>{let{path:t,method:a,validationErrors:n}=e;return{type:d,payload:{path:t,method:a,validationErrors:n}}},x=e=>{let{path:t,method:a}=e;return{type:p,payload:{path:t,method:a}}},_=e=>{let{pathMethod:t}=e;return{type:p,payload:{path:t[0],method:t[1]}}},C=e=>{let{pathMethod:t}=e;return{type:m,payload:{pathMethod:t}}}},3723:(e,t,a)=>{a.r(t),a.d(t,{definitionsToAuthorize:()=>i});var n=a(29),r=a(6145),s=a(6785),o=a(8639),l=a(9725);const i=(c=(0,o.createSelector)((e=>e),(e=>{let{specSelectors:t}=e;return t.securityDefinitions()}),((e,t)=>{var a;let o=(0,l.List)();return t?((0,n.default)(a=t.entrySeq()).call(a,(e=>{let[t,a]=e;const i=a.get("type");var c;if("oauth2"===i&&(0,n.default)(c=a.get("flows").entrySeq()).call(c,(e=>{let[n,s]=e,i=(0,l.fromJS)({flow:n,authorizationUrl:s.get("authorizationUrl"),tokenUrl:s.get("tokenUrl"),scopes:s.get("scopes"),type:a.get("type"),description:a.get("description")});o=o.push(new l.Map({[t]:(0,r.default)(i).call(i,(e=>void 0!==e))}))})),"http"!==i&&"apiKey"!==i||(o=o.push(new l.Map({[t]:a}))),"openIdConnect"===i&&a.get("openIdConnectData")){let e=a.get("openIdConnectData"),i=e.get("grant_types_supported")||["authorization_code","implicit"];(0,n.default)(i).call(i,(n=>{var i;let c=e.get("scopes_supported")&&(0,s.default)(i=e.get("scopes_supported")).call(i,((e,t)=>e.set(t,"")),new l.Map),u=(0,l.fromJS)({flow:n,authorizationUrl:e.get("authorization_endpoint"),tokenUrl:e.get("token_endpoint"),scopes:c,type:"oauth2",openIdConnectUrl:a.get("openIdConnectUrl")});o=o.push(new l.Map({[t]:(0,r.default)(u).call(u,(e=>void 0!==e))}))}))}})),o):o})),(e,t)=>function(){for(var a=arguments.length,n=new Array(a),r=0;r{a.r(t),a.d(t,{default:()=>o});var n=a(2740),r=a(2565),s=a(810);a(5053),a(9569);const o=e=>{let{callbacks:t,specPath:a,specSelectors:o,getComponent:l}=e;const i=o.callbacksOperations({callbacks:t,specPath:a}),c=(0,n.default)(i),u=l("OperationContainer",!0);return 0===c.length?s.default.createElement("span",null,"No callbacks"):s.default.createElement("div",null,(0,r.default)(c).call(c,(e=>{var t;return s.default.createElement("div",{key:`${e}`},s.default.createElement("h2",null,e),(0,r.default)(t=i[e]).call(t,(t=>s.default.createElement(u,{key:`${e}-${t.path}-${t.method}`,op:t.operation,tag:"callbacks",method:t.method,path:t.path,specPath:t.specPath,allowTryItOut:!1}))))})))}},6775:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(775),r=a(7512),s=a(6145),o=a(2565),l=a(810);a(5053);class i extends l.default.Component{constructor(e,t){super(e,t),(0,n.default)(this,"onChange",(e=>{let{onChange:t}=this.props,{value:a,name:n}=e.target,s=(0,r.default)({},this.state.value);n?s[n]=a:s=a,this.setState({value:s},(()=>t(this.state)))}));let{name:a,schema:s}=this.props,o=this.getValue();this.state={name:a,schema:s,value:o}}getValue(){let{name:e,authorized:t}=this.props;return t&&t.getIn([e,"value"])}render(){var e;let{schema:t,getComponent:a,errSelectors:n,name:r}=this.props;const i=a("Input"),c=a("Row"),u=a("Col"),d=a("authError"),p=a("Markdown",!0),m=a("JumpToPath",!0),f=(t.get("scheme")||"").toLowerCase();let h=this.getValue(),g=(0,s.default)(e=n.allErrors()).call(e,(e=>e.get("authId")===r));if("basic"===f){var y;let e=h?h.get("username"):null;return l.default.createElement("div",null,l.default.createElement("h4",null,l.default.createElement("code",null,r||t.get("name")),"  (http, Basic)",l.default.createElement(m,{path:["securityDefinitions",r]})),e&&l.default.createElement("h6",null,"Authorized"),l.default.createElement(c,null,l.default.createElement(p,{source:t.get("description")})),l.default.createElement(c,null,l.default.createElement("label",null,"Username:"),e?l.default.createElement("code",null," ",e," "):l.default.createElement(u,null,l.default.createElement(i,{type:"text",required:"required",name:"username","aria-label":"auth-basic-username",onChange:this.onChange,autoFocus:!0}))),l.default.createElement(c,null,l.default.createElement("label",null,"Password:"),e?l.default.createElement("code",null," ****** "):l.default.createElement(u,null,l.default.createElement(i,{autoComplete:"new-password",name:"password",type:"password","aria-label":"auth-basic-password",onChange:this.onChange}))),(0,o.default)(y=g.valueSeq()).call(y,((e,t)=>l.default.createElement(d,{error:e,key:t}))))}var v;return"bearer"===f?l.default.createElement("div",null,l.default.createElement("h4",null,l.default.createElement("code",null,r||t.get("name")),"  (http, Bearer)",l.default.createElement(m,{path:["securityDefinitions",r]})),h&&l.default.createElement("h6",null,"Authorized"),l.default.createElement(c,null,l.default.createElement(p,{source:t.get("description")})),l.default.createElement(c,null,l.default.createElement("label",null,"Value:"),h?l.default.createElement("code",null," ****** "):l.default.createElement(u,null,l.default.createElement(i,{type:"text","aria-label":"auth-bearer-value",onChange:this.onChange,autoFocus:!0}))),(0,o.default)(v=g.valueSeq()).call(v,((e,t)=>l.default.createElement(d,{error:e,key:t})))):l.default.createElement("div",null,l.default.createElement("em",null,l.default.createElement("b",null,r)," HTTP authentication: unsupported scheme ",`'${f}'`))}}},6467:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var n=a(3427),r=a(2458),s=a(5757),o=a(6617),l=a(9928),i=a(5327),c=a(6775),u=a(6796);const d={Callbacks:n.default,HttpAuth:c.default,RequestBody:r.default,Servers:o.default,ServersContainer:l.default,RequestBodyEditor:i.default,OperationServers:u.default,operationLink:s.default}},5757:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(313),r=a(2565),s=a(810);a(5053),a(9569);class o extends s.Component{render(){const{link:e,name:t,getComponent:a}=this.props,o=a("Markdown",!0);let l=e.get("operationId")||e.get("operationRef"),i=e.get("parameters")&&e.get("parameters").toJS(),c=e.get("description");return s.default.createElement("div",{className:"operation-link"},s.default.createElement("div",{className:"description"},s.default.createElement("b",null,s.default.createElement("code",null,t)),c?s.default.createElement(o,{source:c}):null),s.default.createElement("pre",null,"Operation `",l,"`",s.default.createElement("br",null),s.default.createElement("br",null),"Parameters ",function(e,t){var a;if("string"!=typeof t)return"";return(0,r.default)(a=t.split("\n")).call(a,((t,a)=>a>0?Array(e+1).join(" ")+t:t)).join("\n")}(0,(0,n.default)(i,null,2))||"{}",s.default.createElement("br",null)))}}const l=o},6796:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(775),r=a(810);a(5053),a(9569);class s extends r.default.Component{constructor(){super(...arguments),(0,n.default)(this,"setSelectedServer",(e=>{const{path:t,method:a}=this.props;return this.forceUpdate(),this.props.setSelectedServer(e,`${t}:${a}`)})),(0,n.default)(this,"setServerVariableValue",(e=>{const{path:t,method:a}=this.props;return this.forceUpdate(),this.props.setServerVariableValue({...e,namespace:`${t}:${a}`})})),(0,n.default)(this,"getSelectedServer",(()=>{const{path:e,method:t}=this.props;return this.props.getSelectedServer(`${e}:${t}`)})),(0,n.default)(this,"getServerVariable",((e,t)=>{const{path:a,method:n}=this.props;return this.props.getServerVariable({namespace:`${a}:${n}`,server:e},t)})),(0,n.default)(this,"getEffectiveServerValue",(e=>{const{path:t,method:a}=this.props;return this.props.getEffectiveServerValue({server:e,namespace:`${t}:${a}`})}))}render(){const{operationServers:e,pathServers:t,getComponent:a}=this.props;if(!e&&!t)return null;const n=a("Servers"),s=e||t,o=e?"operation":"path";return r.default.createElement("div",{className:"opblock-section operation-servers"},r.default.createElement("div",{className:"opblock-section-header"},r.default.createElement("div",{className:"tab-header"},r.default.createElement("h4",{className:"opblock-title"},"Servers"))),r.default.createElement("div",{className:"opblock-description-wrapper"},r.default.createElement("h4",{className:"message"},"These ",o,"-level options override the global server options."),r.default.createElement(n,{servers:s,currentServer:this.getSelectedServer(),setSelectedServer:this.setSelectedServer,setServerVariableValue:this.setServerVariableValue,getServerVariable:this.getServerVariable,getEffectiveServerValue:this.getEffectiveServerValue})))}}},5327:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(775),r=a(810),s=(a(5053),a(8096)),o=a(6561);const l=Function.prototype;class i extends r.PureComponent{constructor(e,t){super(e,t),(0,n.default)(this,"applyDefaultValue",(e=>{const{onChange:t,defaultValue:a}=e||this.props;return this.setState({value:a}),t(a)})),(0,n.default)(this,"onChange",(e=>{this.props.onChange((0,o.Pz)(e))})),(0,n.default)(this,"onDomChange",(e=>{const t=e.target.value;this.setState({value:t},(()=>this.onChange(t)))})),this.state={value:(0,o.Pz)(e.value)||e.defaultValue},e.onChange(e.value)}UNSAFE_componentWillReceiveProps(e){this.props.value!==e.value&&e.value!==this.state.value&&this.setState({value:(0,o.Pz)(e.value)}),!e.value&&e.defaultValue&&this.state.value&&this.applyDefaultValue(e)}render(){let{getComponent:e,errors:t}=this.props,{value:a}=this.state,n=t.size>0;const o=e("TextArea");return r.default.createElement("div",{className:"body-param"},r.default.createElement(o,{className:(0,s.default)("body-param__text",{invalid:n}),title:t.size?t.join(", "):"",value:a,onChange:this.onDomChange}))}}(0,n.default)(i,"defaultProps",{onChange:l,userHasEditedBody:!1})},2458:(e,t,a)=>{a.r(t),a.d(t,{default:()=>p,getDefaultRequestBodyValue:()=>d});var n=a(2565),r=a(8818),s=a(2372),o=a(4163),l=a(810),i=(a(5053),a(9569),a(9725)),c=a(6561),u=a(2518);const d=(e,t,a,n)=>{const r=e.getIn(["content",t])??(0,i.OrderedMap)(),s=r.get("schema",(0,i.OrderedMap)()).toJS(),o=void 0!==r.get("examples"),l=r.get("example"),u=o?r.getIn(["examples",a,"value"]):l,d=n.getSampleSchema(s,t,{includeWriteOnly:!0},u);return(0,c.Pz)(d)},p=e=>{let{userHasEditedBody:t,requestBody:a,requestBodyValue:p,requestBodyInclusionSetting:m,requestBodyErrors:f,getComponent:h,getConfigs:g,specSelectors:y,fn:v,contentType:E,isExecute:S,specPath:w,onChange:b,onChangeIncludeEmpty:x,activeExamplesKey:_,updateActiveExamplesKey:C,setRetainRequestBodyValueFlag:j}=e;const N=e=>{b(e.target.files[0])},O=e=>{let t={key:e,shouldDispatchInit:!1,defaultValue:!0};return"no value"===m.get(e,"no value")&&(t.shouldDispatchInit=!0),t},k=h("Markdown",!0),A=h("modelExample"),I=h("RequestBodyEditor"),R=h("highlightCode"),P=h("ExamplesSelectValueRetainer"),T=h("Example"),M=h("ParameterIncludeEmpty"),{showCommonExtensions:D}=g(),L=(null==a?void 0:a.get("description"))??null,q=(null==a?void 0:a.get("content"))??new i.OrderedMap;E=E||q.keySeq().first()||"";const B=q.get(E)??(0,i.OrderedMap)(),U=B.get("schema",(0,i.OrderedMap)()),J=B.get("examples",null),$=null==J?void 0:(0,n.default)(J).call(J,((e,t)=>{var n;const r=null===(n=e)||void 0===n?void 0:n.get("value",null);return r&&(e=e.set("value",d(a,E,t,v),r)),e}));if(f=i.List.isList(f)?f:(0,i.List)(),!B.size)return null;const V="object"===B.getIn(["schema","type"]),K="binary"===B.getIn(["schema","format"]),F="base64"===B.getIn(["schema","format"]);if("application/octet-stream"===E||0===(0,r.default)(E).call(E,"image/")||0===(0,r.default)(E).call(E,"audio/")||0===(0,r.default)(E).call(E,"video/")||K||F){const e=h("Input");return S?l.default.createElement(e,{type:"file",onChange:N}):l.default.createElement("i",null,"Example values are not available for ",l.default.createElement("code",null,E)," media types.")}if(V&&("application/x-www-form-urlencoded"===E||0===(0,r.default)(E).call(E,"multipart/"))&&U.get("properties",(0,i.OrderedMap)()).size>0){var z;const e=h("JsonSchemaForm"),t=h("ParameterExt"),a=U.get("properties",(0,i.OrderedMap)());return p=i.Map.isMap(p)?p:(0,i.OrderedMap)(),l.default.createElement("div",{className:"table-container"},L&&l.default.createElement(k,{source:L}),l.default.createElement("table",null,l.default.createElement("tbody",null,i.Map.isMap(a)&&(0,n.default)(z=a.entrySeq()).call(z,(a=>{var r,u;let[d,g]=a;if(g.get("readOnly"))return;let y=D?(0,c.po)(g):null;const E=(0,s.default)(r=U.get("required",(0,i.List)())).call(r,d),w=g.get("type"),_=g.get("format"),C=g.get("description"),j=p.getIn([d,"value"]),N=p.getIn([d,"errors"])||f,A=m.get(d)||!1,I=g.has("default")||g.has("example")||g.hasIn(["items","example"])||g.hasIn(["items","default"]),R=g.has("enum")&&(1===g.get("enum").size||E),P=I||R;let T="";"array"!==w||P||(T=[]),("object"===w||P)&&(T=v.getSampleSchema(g,!1,{includeWriteOnly:!0})),"string"!=typeof T&&"object"===w&&(T=(0,c.Pz)(T)),"string"==typeof T&&"array"===w&&(T=JSON.parse(T));const L="string"===w&&("binary"===_||"base64"===_);return l.default.createElement("tr",{key:d,className:"parameters","data-property-name":d},l.default.createElement("td",{className:"parameters-col_name"},l.default.createElement("div",{className:E?"parameter__name required":"parameter__name"},d,E?l.default.createElement("span",null," *"):null),l.default.createElement("div",{className:"parameter__type"},w,_&&l.default.createElement("span",{className:"prop-format"},"($",_,")"),D&&y.size?(0,n.default)(u=y.entrySeq()).call(u,(e=>{let[a,n]=e;return l.default.createElement(t,{key:`${a}-${n}`,xKey:a,xVal:n})})):null),l.default.createElement("div",{className:"parameter__deprecated"},g.get("deprecated")?"deprecated":null)),l.default.createElement("td",{className:"parameters-col_description"},l.default.createElement(k,{source:C}),S?l.default.createElement("div",null,l.default.createElement(e,{fn:v,dispatchInitialValue:!L,schema:g,description:d,getComponent:h,value:void 0===j?T:j,required:E,errors:N,onChange:e=>{b(e,[d])}}),E?null:l.default.createElement(M,{onChange:e=>x(d,e),isIncluded:A,isIncludedOptions:O(d),isDisabled:(0,o.default)(j)?0!==j.length:!(0,c.O2)(j)})):null))})))))}const W=d(a,E,_,v);let H=null;return(0,u.O)(W)&&(H="json"),l.default.createElement("div",null,L&&l.default.createElement(k,{source:L}),$?l.default.createElement(P,{userHasEditedBody:t,examples:$,currentKey:_,currentUserInputValue:p,onSelect:e=>{C(e)},updateValue:b,defaultToFirstExample:!0,getComponent:h,setRetainRequestBodyValueFlag:j}):null,S?l.default.createElement("div",null,l.default.createElement(I,{value:p,errors:f,defaultValue:W,onChange:b,getComponent:h})):l.default.createElement(A,{getComponent:h,getConfigs:g,specSelectors:y,expandDepth:1,isExecute:S,schema:B.get("schema"),specPath:w.push("content",E),example:l.default.createElement(R,{className:"body-param__example",getConfigs:g,language:H,value:(0,c.Pz)(p)||W}),includeWriteOnly:!0}),$?l.default.createElement(T,{example:$.get(_),getComponent:h,getConfigs:g}):null)}},9928:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(5053);class r extends n.default.Component{render(){const{specSelectors:e,oas3Selectors:t,oas3Actions:a,getComponent:r}=this.props,s=e.servers(),o=r("Servers");return s&&s.size?n.default.createElement("div",null,n.default.createElement("span",{className:"servers-title"},"Servers"),n.default.createElement(o,{servers:s,currentServer:t.selectedServer(),setSelectedServer:a.setSelectedServer,setServerVariableValue:a.setServerVariableValue,getServerVariable:t.serverVariableValue,getEffectiveServerValue:t.serverEffectiveValue})):null}}},6617:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(775),r=a(1778),s=a(2565),o=a(810),l=a(9725);a(5053),a(9569);class i extends o.default.Component{constructor(){super(...arguments),(0,n.default)(this,"onServerChange",(e=>{this.setServer(e.target.value)})),(0,n.default)(this,"onServerVariableValueChange",(e=>{let{setServerVariableValue:t,currentServer:a}=this.props,n=e.target.getAttribute("data-variable"),r=e.target.value;"function"==typeof t&&t({server:a,key:n,val:r})})),(0,n.default)(this,"setServer",(e=>{let{setSelectedServer:t}=this.props;t(e)}))}componentDidMount(){var e;let{servers:t,currentServer:a}=this.props;a||this.setServer(null===(e=t.first())||void 0===e?void 0:e.get("url"))}UNSAFE_componentWillReceiveProps(e){let{servers:t,setServerVariableValue:a,getServerVariable:n}=e;if(this.props.currentServer!==e.currentServer||this.props.servers!==e.servers){var o;let i=(0,r.default)(t).call(t,(t=>t.get("url")===e.currentServer)),c=(0,r.default)(o=this.props.servers).call(o,(e=>e.get("url")===this.props.currentServer))||(0,l.OrderedMap)();if(!i)return this.setServer(t.first().get("url"));let u=c.get("variables")||(0,l.OrderedMap)(),d=((0,r.default)(u).call(u,(e=>e.get("default")))||(0,l.OrderedMap)()).get("default"),p=i.get("variables")||(0,l.OrderedMap)(),m=((0,r.default)(p).call(p,(e=>e.get("default")))||(0,l.OrderedMap)()).get("default");(0,s.default)(p).call(p,((t,r)=>{n(e.currentServer,r)&&d===m||a({server:e.currentServer,key:r,val:t.get("default")||""})}))}}render(){var e,t;let{servers:a,currentServer:n,getServerVariable:i,getEffectiveServerValue:c}=this.props,u=((0,r.default)(a).call(a,(e=>e.get("url")===n))||(0,l.OrderedMap)()).get("variables")||(0,l.OrderedMap)(),d=0!==u.size;return o.default.createElement("div",{className:"servers"},o.default.createElement("label",{htmlFor:"servers"},o.default.createElement("select",{onChange:this.onServerChange,value:n},(0,s.default)(e=a.valueSeq()).call(e,(e=>o.default.createElement("option",{value:e.get("url"),key:e.get("url")},e.get("url"),e.get("description")&&` - ${e.get("description")}`))).toArray())),d?o.default.createElement("div",null,o.default.createElement("div",{className:"computed-url"},"Computed URL:",o.default.createElement("code",null,c(n))),o.default.createElement("h4",null,"Server variables"),o.default.createElement("table",null,o.default.createElement("tbody",null,(0,s.default)(t=u.entrySeq()).call(t,(e=>{var t;let[a,r]=e;return o.default.createElement("tr",{key:a},o.default.createElement("td",null,a),o.default.createElement("td",null,r.get("enum")?o.default.createElement("select",{"data-variable":a,onChange:this.onServerVariableValueChange},(0,s.default)(t=r.get("enum")).call(t,(e=>o.default.createElement("option",{selected:e===i(n,a),key:e,value:e},e)))):o.default.createElement("input",{type:"text",value:i(n,a)||"",onChange:this.onServerVariableValueChange,"data-variable":a})))}))))):null)}}},7779:(e,t,a)=>{a.r(t),a.d(t,{OAS30ComponentWrapFactory:()=>i,OAS3ComponentWrapFactory:()=>l,isOAS30:()=>s,isSwagger2:()=>o});var n=a(863),r=a(810);function s(e){const t=e.get("openapi");return"string"==typeof t&&/^3\.0\.([0123])(?:-rc[012])?$/.test(t)}function o(e){const t=e.get("swagger");return"string"==typeof t&&"2.0"===t}function l(e){return(t,a)=>s=>{var o;return"function"==typeof(null===(o=a.specSelectors)||void 0===o?void 0:o.isOAS3)?a.specSelectors.isOAS3()?r.default.createElement(e,(0,n.default)({},s,a,{Ori:t})):r.default.createElement(t,s):(console.warn("OAS3 wrapper: couldn't get spec"),null)}}function i(e){return(t,a)=>s=>{var o;return"function"==typeof(null===(o=a.specSelectors)||void 0===o?void 0:o.isOAS30)?a.specSelectors.isOAS30()?r.default.createElement(e,(0,n.default)({},s,a,{Ori:t})):r.default.createElement(t,s):(console.warn("OAS30 wrapper: couldn't get spec"),null)}}},7451:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var n=a(2044),r=a(3723),s=a(1741),o=a(6467),l=a(7761),i=a(7002),c=a(5065),u=a(2109);function d(){return{components:o.default,wrapComponents:l.default,statePlugins:{spec:{wrapSelectors:n,selectors:s},auth:{wrapSelectors:r},oas3:{actions:i,reducers:u.default,selectors:c}}}}},2109:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(5487),r=a(29),s=a(6785),o=a(9725),l=a(7002);const i={[l.UPDATE_SELECTED_SERVER]:(e,t)=>{let{payload:{selectedServerUrl:a,namespace:n}}=t;const r=n?[n,"selectedServer"]:["selectedServer"];return e.setIn(r,a)},[l.UPDATE_REQUEST_BODY_VALUE]:(e,t)=>{let{payload:{value:a,pathMethod:s}}=t,[l,i]=s;if(!o.Map.isMap(a))return e.setIn(["requestData",l,i,"bodyValue"],a);let c,u=e.getIn(["requestData",l,i,"bodyValue"])||(0,o.Map)();o.Map.isMap(u)||(u=(0,o.Map)());const[...d]=(0,n.default)(a).call(a);return(0,r.default)(d).call(d,(e=>{let t=a.getIn([e]);u.has(e)&&o.Map.isMap(t)||(c=u.setIn([e,"value"],t))})),e.setIn(["requestData",l,i,"bodyValue"],c)},[l.UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG]:(e,t)=>{let{payload:{value:a,pathMethod:n}}=t,[r,s]=n;return e.setIn(["requestData",r,s,"retainBodyValue"],a)},[l.UPDATE_REQUEST_BODY_INCLUSION]:(e,t)=>{let{payload:{value:a,pathMethod:n,name:r}}=t,[s,o]=n;return e.setIn(["requestData",s,o,"bodyInclusion",r],a)},[l.UPDATE_ACTIVE_EXAMPLES_MEMBER]:(e,t)=>{let{payload:{name:a,pathMethod:n,contextType:r,contextName:s}}=t,[o,l]=n;return e.setIn(["examples",o,l,r,s,"activeExample"],a)},[l.UPDATE_REQUEST_CONTENT_TYPE]:(e,t)=>{let{payload:{value:a,pathMethod:n}}=t,[r,s]=n;return e.setIn(["requestData",r,s,"requestContentType"],a)},[l.UPDATE_RESPONSE_CONTENT_TYPE]:(e,t)=>{let{payload:{value:a,path:n,method:r}}=t;return e.setIn(["requestData",n,r,"responseContentType"],a)},[l.UPDATE_SERVER_VARIABLE_VALUE]:(e,t)=>{let{payload:{server:a,namespace:n,key:r,val:s}}=t;const o=n?[n,"serverVariableValues",a,r]:["serverVariableValues",a,r];return e.setIn(o,s)},[l.SET_REQUEST_BODY_VALIDATE_ERROR]:(e,t)=>{let{payload:{path:a,method:n,validationErrors:r}}=t,l=[];if(l.push("Required field is not provided"),r.missingBodyValue)return e.setIn(["requestData",a,n,"errors"],(0,o.fromJS)(l));if(r.missingRequiredKeys&&r.missingRequiredKeys.length>0){const{missingRequiredKeys:t}=r;return e.updateIn(["requestData",a,n,"bodyValue"],(0,o.fromJS)({}),(e=>(0,s.default)(t).call(t,((e,t)=>e.setIn([t,"errors"],(0,o.fromJS)(l))),e)))}return console.warn("unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR"),e},[l.CLEAR_REQUEST_BODY_VALIDATE_ERROR]:(e,t)=>{let{payload:{path:a,method:r}}=t;const l=e.getIn(["requestData",a,r,"bodyValue"]);if(!o.Map.isMap(l))return e.setIn(["requestData",a,r,"errors"],(0,o.fromJS)([]));const[...i]=(0,n.default)(l).call(l);return i?e.updateIn(["requestData",a,r,"bodyValue"],(0,o.fromJS)({}),(e=>(0,s.default)(i).call(i,((e,t)=>e.setIn([t,"errors"],(0,o.fromJS)([]))),e))):e},[l.CLEAR_REQUEST_BODY_VALUE]:(e,t)=>{let{payload:{pathMethod:a}}=t,[n,r]=a;const s=e.getIn(["requestData",n,r,"bodyValue"]);return s?o.Map.isMap(s)?e.setIn(["requestData",n,r,"bodyValue"],(0,o.Map)()):e.setIn(["requestData",n,r,"bodyValue"],""):e}}},5065:(e,t,a)=>{a.r(t),a.d(t,{activeExamplesMember:()=>E,hasUserEditedBody:()=>g,requestBodyErrors:()=>v,requestBodyInclusionSetting:()=>y,requestBodyValue:()=>m,requestContentType:()=>S,responseContentType:()=>w,selectDefaultRequestBodyValue:()=>h,selectedServer:()=>p,serverEffectiveValue:()=>_,serverVariableValue:()=>b,serverVariables:()=>x,shouldRetainRequestBodyValue:()=>f,validOperationMethods:()=>O,validateBeforeExecute:()=>C,validateShallowRequired:()=>N});var n=a(2565),r=a(29),s=a(2740),o=a(8818),l=a(9725),i=a(8639),c=a(2458),u=a(6561);const d=e=>function(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),r=1;r{if(a.getSystem().specSelectors.isOAS3()){const r=e(t,...n);return"function"==typeof r?r(a):r}return null}};const p=d(((e,t)=>{const a=t?[t,"selectedServer"]:["selectedServer"];return e.getIn(a)||""})),m=d(((e,t,a)=>e.getIn(["requestData",t,a,"bodyValue"])||null)),f=d(((e,t,a)=>e.getIn(["requestData",t,a,"retainBodyValue"])||!1)),h=(e,t,a)=>e=>{const{oas3Selectors:n,specSelectors:r,fn:s}=e.getSystem();if(r.isOAS3()){const e=n.requestContentType(t,a);if(e)return(0,c.getDefaultRequestBodyValue)(r.specResolvedSubtree(["paths",t,a,"requestBody"]),e,n.activeExamplesMember(t,a,"requestBody","requestBody"),s)}return null},g=d(((e,t,a)=>e=>{const{oas3Selectors:n,specSelectors:r,fn:s}=e;let o=!1;const i=n.requestContentType(t,a);let d=n.requestBodyValue(t,a);const p=r.specResolvedSubtree(["paths",t,a,"requestBody"]);if(!p)return!1;if(l.Map.isMap(d)&&(d=(0,u.Pz)(d.mapEntries((e=>l.Map.isMap(e[1])?[e[0],e[1].get("value")]:e)).toJS())),l.List.isList(d)&&(d=(0,u.Pz)(d)),i){const e=(0,c.getDefaultRequestBodyValue)(p,i,n.activeExamplesMember(t,a,"requestBody","requestBody"),s);o=!!d&&d!==e}return o})),y=d(((e,t,a)=>e.getIn(["requestData",t,a,"bodyInclusion"])||(0,l.Map)())),v=d(((e,t,a)=>e.getIn(["requestData",t,a,"errors"])||null)),E=d(((e,t,a,n,r)=>e.getIn(["examples",t,a,n,r,"activeExample"])||null)),S=d(((e,t,a)=>e.getIn(["requestData",t,a,"requestContentType"])||null)),w=d(((e,t,a)=>e.getIn(["requestData",t,a,"responseContentType"])||null)),b=d(((e,t,a)=>{let n;if("string"!=typeof t){const{server:e,namespace:r}=t;n=r?[r,"serverVariableValues",e,a]:["serverVariableValues",e,a]}else{n=["serverVariableValues",t,a]}return e.getIn(n)||null})),x=d(((e,t)=>{let a;if("string"!=typeof t){const{server:e,namespace:n}=t;a=n?[n,"serverVariableValues",e]:["serverVariableValues",e]}else{a=["serverVariableValues",t]}return e.getIn(a)||(0,l.OrderedMap)()})),_=d(((e,t)=>{var a,r;if("string"!=typeof t){const{server:n,namespace:s}=t;r=n,a=s?e.getIn([s,"serverVariableValues",r]):e.getIn(["serverVariableValues",r])}else r=t,a=e.getIn(["serverVariableValues",r]);a=a||(0,l.OrderedMap)();let s=r;return(0,n.default)(a).call(a,((e,t)=>{s=s.replace(new RegExp(`{${t}}`,"g"),e)})),s})),C=(j=(e,t)=>((e,t)=>(t=t||[],!!e.getIn(["requestData",...t,"bodyValue"])))(e,t),function(){for(var e=arguments.length,t=new Array(e),a=0;a{const a=e.getSystem().specSelectors.specJson();let n=[...t][1]||[];return!a.getIn(["paths",...n,"requestBody","required"])||j(...t)}});var j;const N=(e,t)=>{var a;let{oas3RequiredRequestBodyContentType:n,oas3RequestContentType:i,oas3RequestBodyValue:c}=t,u=[];if(!l.Map.isMap(c))return u;let d=[];return(0,r.default)(a=(0,s.default)(n.requestContentType)).call(a,(e=>{if(e===i){let t=n.requestContentType[e];(0,r.default)(t).call(t,(e=>{(0,o.default)(d).call(d,e)<0&&d.push(e)}))}})),(0,r.default)(d).call(d,(e=>{c.getIn([e,"value"])||u.push(e)})),u},O=(0,i.createSelector)((()=>["get","put","post","delete","options","head","patch","trace"]))},1741:(e,t,a)=>{a.r(t),a.d(t,{callbacksOperations:()=>g,isOAS3:()=>m,isOAS30:()=>p,isSwagger2:()=>d,servers:()=>h});var n=a(2565),r=a(6785),s=a(6145),o=a(2372),l=a(5171),i=a(9725),c=a(7779);const u=(0,i.Map)(),d=()=>e=>{const t=e.getSystem().specSelectors.specJson();return(0,c.isSwagger2)(t)},p=()=>e=>{const t=e.getSystem().specSelectors.specJson();return(0,c.isOAS30)(t)},m=()=>e=>e.getSystem().specSelectors.isOAS30();function f(e){return function(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),r=1;r{if(a.specSelectors.isOAS3()){const r=e(t,...n);return"function"==typeof r?r(a):r}return null}}}const h=f((()=>e=>e.specSelectors.specJson().get("servers",u))),g=f(((e,t)=>{let{callbacks:a,specPath:c}=t;return e=>{var t;const u=e.specSelectors.validOperationMethods();return i.Map.isMap(a)?(0,n.default)(t=(0,r.default)(a).call(a,((e,t,a)=>i.Map.isMap(t)?(0,r.default)(t).call(t,((e,t,r)=>{var d,p;if(!i.Map.isMap(t))return e;const m=(0,n.default)(d=(0,s.default)(p=t.entrySeq()).call(p,(e=>{let[t]=e;return(0,o.default)(u).call(u,t)}))).call(d,(e=>{let[t,n]=e;return{operation:(0,i.Map)({operation:n}),method:t,path:r,callbackName:a,specPath:(0,l.default)(c).call(c,[a,r,t])}}));return(0,l.default)(e).call(e,m)}),(0,i.List)()):e),(0,i.List)()).groupBy((e=>e.callbackName))).call(t,(e=>e.toArray())).toObject():{}}}))},2044:(e,t,a)=>{a.r(t),a.d(t,{basePath:()=>f,consumes:()=>h,definitions:()=>c,hasHost:()=>u,host:()=>m,produces:()=>g,schemes:()=>y,securityDefinitions:()=>d,validOperationMethods:()=>p});var n=a(8639),r=a(3881),s=a(9725);const o=(0,s.Map)();function l(e){return(t,a)=>function(){if(a.getSystem().specSelectors.isOAS3()){const t=e(...arguments);return"function"==typeof t?t(a):t}return t(...arguments)}}const i=l((0,n.createSelector)((()=>null))),c=l((()=>e=>{const t=e.getSystem().specSelectors.specJson().getIn(["components","schemas"]);return s.Map.isMap(t)?t:o})),u=l((()=>e=>e.getSystem().specSelectors.specJson().hasIn(["servers",0]))),d=l((0,n.createSelector)(r.specJsonWithResolvedSubtrees,(e=>e.getIn(["components","securitySchemes"])||null))),p=(e,t)=>function(a){if(t.specSelectors.isOAS3())return t.oas3Selectors.validOperationMethods();for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s{a.r(t),a.d(t,{default:()=>r});var n=a(810);const r=(0,a(7779).OAS3ComponentWrapFactory)((e=>{let{Ori:t,...a}=e;const{schema:r,getComponent:s,errSelectors:o,authorized:l,onAuthChange:i,name:c}=a,u=s("HttpAuth");return"http"===r.get("type")?n.default.createElement(u,{key:c,schema:r,name:c,errSelectors:o,authorized:l,getComponent:s,onChange:i}):n.default.createElement(t,a)}))},7761:(e,t,a)=>{a.r(t),a.d(t,{default:()=>c});var n=a(2460),r=a(356),s=a(58),o=a(3499),l=a(287),i=a(2108);const c={Markdown:n.default,AuthItem:r.default,OpenAPIVersion:i.default,JsonSchema_string:l.default,model:o.default,onlineValidatorBadge:s.default}},287:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);const r=(0,a(7779).OAS3ComponentWrapFactory)((e=>{let{Ori:t,...a}=e;const{schema:r,getComponent:s,errors:o,onChange:l}=a,i=r&&r.get?r.get("format"):null,c=r&&r.get?r.get("type"):null,u=s("Input");return c&&"string"===c&&i&&("binary"===i||"base64"===i)?n.default.createElement(u,{type:"file",className:o.length?"invalid":"",title:o.length?o:"",onChange:e=>{l(e.target.files[0])},disabled:t.isDisabled}):n.default.createElement(t,a)}))},2460:(e,t,a)=>{a.r(t),a.d(t,{Markdown:()=>u,default:()=>d});var n=a(5942),r=a(810),s=(a(5053),a(8096)),o=a(3952),l=a(7779),i=a(5466);const c=new o.Remarkable("commonmark");c.block.ruler.enable(["table"]),c.set({linkTarget:"_blank"});const u=e=>{let{source:t,className:a="",getConfigs:o}=e;if("string"!=typeof t)return null;if(t){const{useUnsafeMarkdown:e}=o(),l=c.render(t),u=(0,i.s)(l,{useUnsafeMarkdown:e});let d;return"string"==typeof u&&(d=(0,n.default)(u).call(u)),r.default.createElement("div",{dangerouslySetInnerHTML:{__html:d},className:(0,s.default)(a,"renderedMarkdown")})}return null};u.defaultProps={getConfigs:()=>({useUnsafeMarkdown:!1})};const d=(0,l.OAS3ComponentWrapFactory)(u)},3499:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(863),r=a(810),s=(a(5053),a(7779)),o=a(1543);class l extends r.Component{render(){let{getConfigs:e,schema:t}=this.props,a=["model-box"],s=null;return!0===t.get("deprecated")&&(a.push("deprecated"),s=r.default.createElement("span",{className:"model-deprecated-warning"},"Deprecated:")),r.default.createElement("div",{className:a.join(" ")},s,r.default.createElement(o.Z,(0,n.default)({},this.props,{getConfigs:e,depth:1,expandDepth:this.props.expandDepth||0})))}}const i=(0,s.OAS3ComponentWrapFactory)(l)},58:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(7779),r=a(5623);const s=(0,n.OAS3ComponentWrapFactory)(r.Z)},2108:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);const r=(0,a(7779).OAS30ComponentWrapFactory)((e=>{const{Ori:t}=e;return n.default.createElement(t,{oasVersion:"3.0"})}))},7754:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(7512),r=a(5800),s=a(4380);const o=function(e){let{fn:t,getSystem:a}=e;if(t.jsonSchema202012){const e=(0,r.makeIsExpandable)(t.jsonSchema202012.isExpandable,a);(0,n.default)(this.fn.jsonSchema202012,{isExpandable:e,getProperties:r.getProperties})}if("function"==typeof t.sampleFromSchema&&t.jsonSchema202012){const e=(0,s.wrapOAS31Fn)({sampleFromSchema:t.jsonSchema202012.sampleFromSchema,sampleFromSchemaGeneric:t.jsonSchema202012.sampleFromSchemaGeneric,createXMLExample:t.jsonSchema202012.createXMLExample,memoizedSampleFromSchema:t.jsonSchema202012.memoizedSampleFromSchema,memoizedCreateXMLExample:t.jsonSchema202012.memoizedCreateXMLExample},a());(0,n.default)(this.fn,e)}}},9503:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(5053),a(6561));const s=e=>{let{getComponent:t,specSelectors:a}=e;const s=a.selectContactNameField(),o=a.selectContactUrl(),l=a.selectContactEmailField(),i=t("Link");return n.default.createElement("div",{className:"info__contact"},o&&n.default.createElement("div",null,n.default.createElement(i,{href:(0,r.Nm)(o),target:"_blank"},s," - Website")),l&&n.default.createElement(i,{href:(0,r.Nm)(`mailto:${l}`)},o?`Send email to ${s}`:`Contact ${s}`))}},6133:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(5053),a(6561));const s=e=>{let{getComponent:t,specSelectors:a}=e;const s=a.version(),o=a.url(),l=a.basePath(),i=a.host(),c=a.selectInfoSummaryField(),u=a.selectInfoDescriptionField(),d=a.selectInfoTitleField(),p=a.selectInfoTermsOfServiceUrl(),m=a.selectExternalDocsUrl(),f=a.selectExternalDocsDescriptionField(),h=a.contact(),g=a.license(),y=t("Markdown",!0),v=t("Link"),E=t("VersionStamp"),S=t("OpenAPIVersion"),w=t("InfoUrl"),b=t("InfoBasePath"),x=t("License",!0),_=t("Contact",!0),C=t("JsonSchemaDialect",!0);return n.default.createElement("div",{className:"info"},n.default.createElement("hgroup",{className:"main"},n.default.createElement("h2",{className:"title"},d,s&&n.default.createElement(E,{version:s}),n.default.createElement(S,{oasVersion:"3.1"})),(i||l)&&n.default.createElement(b,{host:i,basePath:l}),o&&n.default.createElement(w,{getComponent:t,url:o})),c&&n.default.createElement("p",{className:"info__summary"},c),n.default.createElement("div",{className:"info__description description"},n.default.createElement(y,{source:u})),p&&n.default.createElement("div",{className:"info__tos"},n.default.createElement(v,{target:"_blank",href:(0,r.Nm)(p)},"Terms of service")),h.size>0&&n.default.createElement(_,null),g.size>0&&n.default.createElement(x,null),m&&n.default.createElement(v,{className:"info__extdocs",target:"_blank",href:(0,r.Nm)(m)},f||m),n.default.createElement(C,null))}},2562:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(5053),a(6561));const s=e=>{let{getComponent:t,specSelectors:a}=e;const s=a.selectJsonSchemaDialectField(),o=a.selectJsonSchemaDialectDefault(),l=t("Link");return n.default.createElement(n.default.Fragment,null,s&&s===o&&n.default.createElement("p",{className:"info__jsonschemadialect"},"JSON Schema dialect:"," ",n.default.createElement(l,{target:"_blank",href:(0,r.Nm)(s)},s)),s&&s!==o&&n.default.createElement("div",{className:"error-wrapper"},n.default.createElement("div",{className:"no-margin"},n.default.createElement("div",{className:"errors"},n.default.createElement("div",{className:"errors-wrapper"},n.default.createElement("h4",{className:"center"},"Warning"),n.default.createElement("p",{className:"message"},n.default.createElement("strong",null,"OpenAPI.jsonSchemaDialect")," field contains a value different from the default value of"," ",n.default.createElement(l,{target:"_blank",href:o},o),". Values different from the default one are currently not supported. Please either omit the field or provide it with the default value."))))))}},1876:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810),r=(a(5053),a(6561));const s=e=>{let{getComponent:t,specSelectors:a}=e;const s=a.selectLicenseNameField(),o=a.selectLicenseUrl(),l=t("Link");return n.default.createElement("div",{className:"info__license"},o?n.default.createElement("div",{className:"info__license__url"},n.default.createElement(l,{target:"_blank",href:(0,r.Nm)(o)},s)):n.default.createElement("span",null,s))}},2718:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(2372),r=a(810);a(5053),a(9569);const s=e=>"string"==typeof e&&(0,n.default)(e).call(e,"#/components/schemas/")?(e=>{const t=e.replace(/~1/g,"/").replace(/~0/g,"~");try{return decodeURIComponent(t)}catch{return t}})(e.replace(/^.*#\/components\/schemas\//,"")):null,o=(0,r.forwardRef)(((e,t)=>{let{schema:a,getComponent:n,onToggle:o}=e;const l=n("JSONSchema202012"),i=s(a.get("$$ref")),c=(0,r.useCallback)(((e,t)=>{o(i,t)}),[i,o]);return r.default.createElement(l,{name:i,schema:a.toJS(),ref:t,onExpand:c})}));o.defaultProps={name:"",displayName:"",isRef:!1,required:!1,expandDepth:0,depth:1,includeReadOnly:!1,includeWriteOnly:!1,onToggle:()=>{}};const l=o},263:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(2740),r=a(2565),s=a(7204),o=a(810),l=(a(5053),a(8096));const i=e=>{var t;let{specActions:a,specSelectors:i,layoutSelectors:c,layoutActions:u,getComponent:d,getConfigs:p}=e;const m=i.selectSchemas(),f=(0,n.default)(m).length>0,h=["components","schemas"],{docExpansion:g,defaultModelsExpandDepth:y}=p(),v=y>0&&"none"!==g,E=c.isShown(h,v),S=d("Collapse"),w=d("JSONSchema202012"),b=d("ArrowUpIcon"),x=d("ArrowDownIcon");(0,o.useEffect)((()=>{const e=E&&y>1,t=null!=i.specResolvedSubtree(h);e&&!t&&a.requestResolvedSubtree(h)}),[E,y]);const _=(0,o.useCallback)((()=>{u.show(h,!E)}),[E]),C=(0,o.useCallback)((e=>{null!==e&&u.readyToScroll(h,e)}),[]),j=e=>t=>{null!==t&&u.readyToScroll([...h,e],t)},N=e=>(t,n)=>{if(n){const t=[...h,e];null!=i.specResolvedSubtree(t)||a.requestResolvedSubtree([...h,e])}};return!f||y<0?null:o.default.createElement("section",{className:(0,l.default)("models",{"is-open":E}),ref:C},o.default.createElement("h4",null,o.default.createElement("button",{"aria-expanded":E,className:"models-control",onClick:_},o.default.createElement("span",null,"Schemas"),E?o.default.createElement(b,null):o.default.createElement(x,null))),o.default.createElement(S,{isOpened:E},(0,r.default)(t=(0,s.default)(m)).call(t,(e=>{let[t,a]=e;return o.default.createElement(w,{key:t,ref:j(t),schema:a,name:t,onExpand:N(t)})}))))}},3429:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(5053);const r=e=>{let{bypass:t,isSwagger2:a,isOAS3:r,isOAS31:s,alsoShow:o,children:l}=e;return t?n.default.createElement("div",null,l):a&&(r||s)?n.default.createElement("div",{className:"version-pragma"},o,n.default.createElement("div",{className:"version-pragma__message version-pragma__message--ambiguous"},n.default.createElement("div",null,n.default.createElement("h3",null,"Unable to render this definition"),n.default.createElement("p",null,n.default.createElement("code",null,"swagger")," and ",n.default.createElement("code",null,"openapi")," fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields."),n.default.createElement("p",null,"Supported version fields are ",n.default.createElement("code",null,'swagger: "2.0"')," and those that match ",n.default.createElement("code",null,"openapi: 3.x.y")," (for example,"," ",n.default.createElement("code",null,"openapi: 3.1.0"),").")))):a||r||s?n.default.createElement("div",null,l):n.default.createElement("div",{className:"version-pragma"},o,n.default.createElement("div",{className:"version-pragma__message version-pragma__message--missing"},n.default.createElement("div",null,n.default.createElement("h3",null,"Unable to render this definition"),n.default.createElement("p",null,"The provided definition does not specify a valid version field."),n.default.createElement("p",null,"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are ",n.default.createElement("code",null,'swagger: "2.0"')," and those that match ",n.default.createElement("code",null,"openapi: 3.x.y")," (for example,"," ",n.default.createElement("code",null,"openapi: 3.1.0"),")."))))}},9508:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(2740),r=a(2565),s=a(810);a(5053);const o=e=>{let{specSelectors:t,getComponent:a}=e;const o=t.selectWebhooksOperations(),l=(0,n.default)(o),i=a("OperationContainer",!0);return 0===l.length?null:s.default.createElement("div",{className:"webhooks"},s.default.createElement("h2",null,"Webhooks"),(0,r.default)(l).call(l,(e=>{var t;return s.default.createElement("div",{key:`${e}-webhook`},(0,r.default)(t=o[e]).call(t,(t=>s.default.createElement(i,{key:`${e}-${t.method}-webhook`,op:t.operation,tag:"webhooks",method:t.method,path:e,specPath:t.specPath,allowTryItOut:!1}))))})))}},4380:(e,t,a)=>{a.r(t),a.d(t,{createOnlyOAS31ComponentWrapper:()=>p,createOnlyOAS31Selector:()=>c,createOnlyOAS31SelectorWrapper:()=>u,createSystemSelector:()=>d,isOAS31:()=>i,wrapOAS31Fn:()=>m});var n=a(863),r=a(7415),s=a(2565),o=a(7204),l=a(810);const i=e=>{const t=e.get("openapi");return"string"==typeof t&&/^3\.1\.(?:[1-9]\d*|0)$/.test(t)},c=e=>function(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),r=1;r{if(a.getSystem().specSelectors.isOAS31()){const r=e(t,...n);return"function"==typeof r?r(a):r}return null}},u=e=>(t,a)=>function(n){for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;ofunction(t){for(var a=arguments.length,n=new Array(a>1?a-1:0),r=1;r{const r=e(t,a,...n);return"function"==typeof r?r(a):r}},p=e=>(t,a)=>r=>a.specSelectors.isOAS31()?l.default.createElement(e,(0,n.default)({},r,{originalComponent:t,getSystem:a.getSystem})):l.default.createElement(t,r),m=(e,t)=>{var a;const{fn:n,specSelectors:l}=t;return(0,r.default)((0,s.default)(a=(0,o.default)(e)).call(a,(e=>{let[t,a]=e;const r=n[t];return[t,function(){return l.isOAS31()?a(...arguments):"function"==typeof r?r(...arguments):void 0}]})))}},9806:(e,t,a)=>{a.r(t),a.d(t,{default:()=>k});var n=a(9508),r=a(1876),s=a(9503),o=a(6133),l=a(2562),i=a(3429),c=a(2718),u=a(263),d=a(6608),p=a(7423),m=a(284),f=a(7042),h=a(2914),g=a(1434),y=a(4380),v=a(9305),E=a(2884),S=a(4280),w=a(9450),b=a(3995),x=a(9525),_=a(5324),C=a(809),j=a(4951),N=a(7536),O=a(7754);const k=e=>{let{fn:t}=e;const a=t.createSystemSelector||y.createSystemSelector,k=t.createOnlyOAS31Selector||y.createOnlyOAS31Selector;return{afterLoad:O.default,fn:{isOAS31:y.isOAS31,createSystemSelector:y.createSystemSelector,createOnlyOAS31Selector:y.createOnlyOAS31Selector},components:{Webhooks:n.default,JsonSchemaDialect:l.default,OAS31Info:o.default,OAS31License:r.default,OAS31Contact:s.default,OAS31VersionPragmaFilter:i.default,OAS31Model:c.default,OAS31Models:u.default,JSONSchema202012KeywordExample:w.default,JSONSchema202012KeywordXml:b.default,JSONSchema202012KeywordDiscriminator:x.default,JSONSchema202012KeywordExternalDocs:_.default},wrapComponents:{InfoContainer:m.default,License:d.default,Contact:p.default,VersionPragmaFilter:g.default,Model:f.default,Models:h.default,JSONSchema202012KeywordDescription:C.default,JSONSchema202012KeywordDefault:j.default,JSONSchema202012KeywordProperties:N.default},statePlugins:{spec:{selectors:{isOAS31:a(v.isOAS31),license:v.license,selectLicenseNameField:v.selectLicenseNameField,selectLicenseUrlField:v.selectLicenseUrlField,selectLicenseIdentifierField:k(v.selectLicenseIdentifierField),selectLicenseUrl:a(v.selectLicenseUrl),contact:v.contact,selectContactNameField:v.selectContactNameField,selectContactEmailField:v.selectContactEmailField,selectContactUrlField:v.selectContactUrlField,selectContactUrl:a(v.selectContactUrl),selectInfoTitleField:v.selectInfoTitleField,selectInfoSummaryField:k(v.selectInfoSummaryField),selectInfoDescriptionField:v.selectInfoDescriptionField,selectInfoTermsOfServiceField:v.selectInfoTermsOfServiceField,selectInfoTermsOfServiceUrl:a(v.selectInfoTermsOfServiceUrl),selectExternalDocsDescriptionField:v.selectExternalDocsDescriptionField,selectExternalDocsUrlField:v.selectExternalDocsUrlField,selectExternalDocsUrl:a(v.selectExternalDocsUrl),webhooks:k(v.webhooks),selectWebhooksOperations:k(a(v.selectWebhooksOperations)),selectJsonSchemaDialectField:v.selectJsonSchemaDialectField,selectJsonSchemaDialectDefault:v.selectJsonSchemaDialectDefault,selectSchemas:a(v.selectSchemas)},wrapSelectors:{isOAS3:E.isOAS3,selectLicenseUrl:E.selectLicenseUrl}},oas31:{selectors:{selectLicenseUrl:k(a(S.selectLicenseUrl))}}}}}},5989:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(5053);const r=e=>{let{schema:t,getSystem:a}=e;if(null==t||!t.description)return null;const{getComponent:r}=a(),s=r("Markdown");return n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--description"},n.default.createElement("div",{className:"json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary"},n.default.createElement(s,{source:t.description})))}},9525:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(2740),r=a(810),s=(a(5053),a(8096)),o=a(7749);const l=e=>{let{schema:t,getSystem:a}=e;const l=(null==t?void 0:t.discriminator)||{},{fn:i,getComponent:c}=a(),{useIsExpandedDeeply:u,useComponent:d}=i.jsonSchema202012,p=u(),m=!!l.mapping,[f,h]=(0,r.useState)(p),[g,y]=(0,r.useState)(!1),v=d("Accordion"),E=d("ExpandDeepButton"),S=c("JSONSchema202012DeepExpansionContext")(),w=(0,r.useCallback)((()=>{h((e=>!e))}),[]),b=(0,r.useCallback)(((e,t)=>{h(t),y(t)}),[]);return 0===(0,n.default)(l).length?null:r.default.createElement(S.Provider,{value:g},r.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--discriminator"},m?r.default.createElement(r.default.Fragment,null,r.default.createElement(v,{expanded:f,onChange:w},r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"Discriminator")),r.default.createElement(E,{expanded:f,onClick:b})):r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"Discriminator"),l.propertyName&&r.default.createElement("span",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted"},l.propertyName),r.default.createElement("strong",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary"},"object"),r.default.createElement("ul",{className:(0,s.default)("json-schema-2020-12-keyword__children",{"json-schema-2020-12-keyword__children--collapsed":!f})},f&&r.default.createElement("li",{className:"json-schema-2020-12-property"},r.default.createElement(o.default,{discriminator:l})))))}},7749:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(2740),r=a(2565),s=a(7204),o=a(810);a(5053);const l=e=>{var t;let{discriminator:a}=e;const l=(null==a?void 0:a.mapping)||{};return 0===(0,n.default)(l).length?null:(0,r.default)(t=(0,s.default)(l)).call(t,(e=>{let[t,a]=e;return o.default.createElement("div",{key:`${t}-${a}`,className:"json-schema-2020-12-keyword"},o.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},t),o.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},a))}))};l.defaultProps={mapping:void 0};const i=l},9450:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(5053);const r=e=>{let{schema:t,getSystem:a}=e;const{fn:r}=a(),{hasKeyword:s,stringify:o}=r.jsonSchema202012.useFn();return s(t,"example")?n.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--example"},n.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"Example"),n.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const"},o(t.example))):null}},5324:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(2740),r=a(810),s=(a(5053),a(8096)),o=a(6561);const l=e=>{let{schema:t,getSystem:a}=e;const l=(null==t?void 0:t.externalDocs)||{},{fn:i,getComponent:c}=a(),{useIsExpandedDeeply:u,useComponent:d}=i.jsonSchema202012,p=u(),m=!(!l.description&&!l.url),[f,h]=(0,r.useState)(p),[g,y]=(0,r.useState)(!1),v=d("Accordion"),E=d("ExpandDeepButton"),S=c("JSONSchema202012KeywordDescription"),w=c("Link"),b=c("JSONSchema202012DeepExpansionContext")(),x=(0,r.useCallback)((()=>{h((e=>!e))}),[]),_=(0,r.useCallback)(((e,t)=>{h(t),y(t)}),[]);return 0===(0,n.default)(l).length?null:r.default.createElement(b.Provider,{value:g},r.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--externalDocs"},m?r.default.createElement(r.default.Fragment,null,r.default.createElement(v,{expanded:f,onChange:x},r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"External documentation")),r.default.createElement(E,{expanded:f,onClick:_})):r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"External documentation"),r.default.createElement("strong",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary"},"object"),r.default.createElement("ul",{className:(0,s.default)("json-schema-2020-12-keyword__children",{"json-schema-2020-12-keyword__children--collapsed":!f})},f&&r.default.createElement(r.default.Fragment,null,l.description&&r.default.createElement("li",{className:"json-schema-2020-12-property"},r.default.createElement(S,{schema:l,getSystem:a})),l.url&&r.default.createElement("li",{className:"json-schema-2020-12-property"},r.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword"},r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"url"),r.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},r.default.createElement(w,{target:"_blank",href:(0,o.Nm)(l.url)},l.url))))))))}},9023:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});var n=a(4163),r=a(2740),s=a(2565),o=a(7204),l=a(2372),i=a(810),c=(a(5053),a(8096));const u=e=>{var t;let{schema:a,getSystem:u}=e;const{fn:d}=u(),{useComponent:p}=d.jsonSchema202012,{getDependentRequired:m,getProperties:f}=d.jsonSchema202012.useFn(),h=d.jsonSchema202012.useConfig(),g=(0,n.default)(null==a?void 0:a.required)?a.required:[],y=p("JSONSchema"),v=f(a,h);return 0===(0,r.default)(v).length?null:i.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--properties"},i.default.createElement("ul",null,(0,s.default)(t=(0,o.default)(v)).call(t,(e=>{let[t,n]=e;const r=(0,l.default)(g).call(g,t),s=m(t,a);return i.default.createElement("li",{key:t,className:(0,c.default)("json-schema-2020-12-property",{"json-schema-2020-12-property--required":r})},i.default.createElement(y,{name:t,schema:n,dependentRequired:s}))}))))}},3995:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(2740),r=a(810),s=(a(5053),a(8096));const o=e=>{let{schema:t,getSystem:a}=e;const o=(null==t?void 0:t.xml)||{},{fn:l,getComponent:i}=a(),{useIsExpandedDeeply:c,useComponent:u}=l.jsonSchema202012,d=c(),p=!!(o.name||o.namespace||o.prefix),[m,f]=(0,r.useState)(d),[h,g]=(0,r.useState)(!1),y=u("Accordion"),v=u("ExpandDeepButton"),E=i("JSONSchema202012DeepExpansionContext")(),S=(0,r.useCallback)((()=>{f((e=>!e))}),[]),w=(0,r.useCallback)(((e,t)=>{f(t),g(t)}),[]);return 0===(0,n.default)(o).length?null:r.default.createElement(E.Provider,{value:h},r.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword--xml"},p?r.default.createElement(r.default.Fragment,null,r.default.createElement(y,{expanded:m,onChange:S},r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"XML")),r.default.createElement(v,{expanded:m,onClick:w})):r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"XML"),!0===o.attribute&&r.default.createElement("span",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted"},"attribute"),!0===o.wrapped&&r.default.createElement("span",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--muted"},"wrapped"),r.default.createElement("strong",{className:"json-schema-2020-12__attribute json-schema-2020-12__attribute--primary"},"object"),r.default.createElement("ul",{className:(0,s.default)("json-schema-2020-12-keyword__children",{"json-schema-2020-12-keyword__children--collapsed":!m})},m&&r.default.createElement(r.default.Fragment,null,o.name&&r.default.createElement("li",{className:"json-schema-2020-12-property"},r.default.createElement("div",{className:"json-schema-2020-12-keyword json-schema-2020-12-keyword"},r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"name"),r.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},o.name))),o.namespace&&r.default.createElement("li",{className:"json-schema-2020-12-property"},r.default.createElement("div",{className:"json-schema-2020-12-keyword"},r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"namespace"),r.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},o.namespace))),o.prefix&&r.default.createElement("li",{className:"json-schema-2020-12-property"},r.default.createElement("div",{className:"json-schema-2020-12-keyword"},r.default.createElement("span",{className:"json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary"},"prefix"),r.default.createElement("span",{className:"json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary"},o.prefix)))))))}},5800:(e,t,a)=>{a.r(t),a.d(t,{getProperties:()=>l,makeIsExpandable:()=>o});var n=a(7204),r=a(6145),s=a(7415);const o=(e,t)=>{const{fn:a}=t();if("function"!=typeof e)return null;const{hasKeyword:n}=a.jsonSchema202012;return t=>e(t)||n(t,"example")||(null==t?void 0:t.xml)||(null==t?void 0:t.discriminator)||(null==t?void 0:t.externalDocs)},l=(e,t)=>{let{includeReadOnly:a,includeWriteOnly:o}=t;if(null==e||!e.properties)return{};const l=(0,n.default)(e.properties),i=(0,r.default)(l).call(l,(e=>{let[,t]=e;const n=!0===(null==t?void 0:t.readOnly),r=!0===(null==t?void 0:t.writeOnly);return(!n||a)&&(!r||o)}));return(0,s.default)(i)}},4951:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);const r=(0,a(4380).createOnlyOAS31ComponentWrapper)((e=>{let{schema:t,getSystem:a,originalComponent:r}=e;const{getComponent:s}=a(),o=s("JSONSchema202012KeywordDiscriminator"),l=s("JSONSchema202012KeywordXml"),i=s("JSONSchema202012KeywordExample"),c=s("JSONSchema202012KeywordExternalDocs");return n.default.createElement(n.default.Fragment,null,n.default.createElement(r,{schema:t}),n.default.createElement(o,{schema:t,getSystem:a}),n.default.createElement(l,{schema:t,getSystem:a}),n.default.createElement(c,{schema:t,getSystem:a}),n.default.createElement(i,{schema:t,getSystem:a}))}))},809:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(5989);const r=(0,a(4380).createOnlyOAS31ComponentWrapper)(n.default)},7536:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(9023);const r=(0,a(4380).createOnlyOAS31ComponentWrapper)(n.default)},4280:(e,t,a)=>{a.r(t),a.d(t,{selectLicenseUrl:()=>s});var n=a(8639),r=a(3543);const s=(0,n.createSelector)(((e,t)=>t.specSelectors.url()),((e,t)=>t.oas3Selectors.selectedServer()),((e,t)=>t.specSelectors.selectLicenseUrlField()),((e,t)=>t.specSelectors.selectLicenseIdentifierField()),((e,t,a,n)=>a?(0,r.mn)(a,e,{selectedServer:t}):n?`https://spdx.org/licenses/${n}.html`:void 0))},9305:(e,t,a)=>{a.r(t),a.d(t,{contact:()=>b,isOAS31:()=>f,license:()=>y,selectContactEmailField:()=>_,selectContactNameField:()=>x,selectContactUrl:()=>j,selectContactUrlField:()=>C,selectExternalDocsDescriptionField:()=>R,selectExternalDocsUrl:()=>T,selectExternalDocsUrlField:()=>P,selectInfoDescriptionField:()=>k,selectInfoSummaryField:()=>O,selectInfoTermsOfServiceField:()=>A,selectInfoTermsOfServiceUrl:()=>I,selectInfoTitleField:()=>N,selectJsonSchemaDialectDefault:()=>D,selectJsonSchemaDialectField:()=>M,selectLicenseIdentifierField:()=>w,selectLicenseNameField:()=>v,selectLicenseUrl:()=>S,selectLicenseUrlField:()=>E,selectSchemas:()=>L,selectWebhooksOperations:()=>g,webhooks:()=>h});var n=a(2565),r=a(6785),s=a(6145),o=a(2372),l=a(5171),i=a(7204),c=a(9725),u=a(8639),d=a(3543),p=a(4380);const m=(0,c.Map)(),f=(0,u.createSelector)(((e,t)=>t.specSelectors.specJson()),p.isOAS31),h=()=>e=>e.specSelectors.specJson().get("webhooks",m),g=(0,u.createSelector)(((e,t)=>t.specSelectors.webhooks()),((e,t)=>t.specSelectors.validOperationMethods()),((e,t)=>t.specSelectors.specResolvedSubtree(["webhooks"])),((e,t)=>{var a;return c.Map.isMap(e)?(0,n.default)(a=(0,r.default)(e).call(e,((e,a,r)=>{var i,u;if(!c.Map.isMap(a))return e;const d=(0,n.default)(i=(0,s.default)(u=a.entrySeq()).call(u,(e=>{let[a]=e;return(0,o.default)(t).call(t,a)}))).call(i,(e=>{let[t,a]=e;return{operation:(0,c.Map)({operation:a}),method:t,path:r,specPath:(0,c.List)(["webhooks",r,t])}}));return(0,l.default)(e).call(e,d)}),(0,c.List)()).groupBy((e=>e.path))).call(a,(e=>e.toArray())).toObject():{}})),y=()=>e=>e.specSelectors.info().get("license",m),v=()=>e=>e.specSelectors.license().get("name","License"),E=()=>e=>e.specSelectors.license().get("url"),S=(0,u.createSelector)(((e,t)=>t.specSelectors.url()),((e,t)=>t.oas3Selectors.selectedServer()),((e,t)=>t.specSelectors.selectLicenseUrlField()),((e,t,a)=>{if(a)return(0,d.mn)(a,e,{selectedServer:t})})),w=()=>e=>e.specSelectors.license().get("identifier"),b=()=>e=>e.specSelectors.info().get("contact",m),x=()=>e=>e.specSelectors.contact().get("name","the developer"),_=()=>e=>e.specSelectors.contact().get("email"),C=()=>e=>e.specSelectors.contact().get("url"),j=(0,u.createSelector)(((e,t)=>t.specSelectors.url()),((e,t)=>t.oas3Selectors.selectedServer()),((e,t)=>t.specSelectors.selectContactUrlField()),((e,t,a)=>{if(a)return(0,d.mn)(a,e,{selectedServer:t})})),N=()=>e=>e.specSelectors.info().get("title"),O=()=>e=>e.specSelectors.info().get("summary"),k=()=>e=>e.specSelectors.info().get("description"),A=()=>e=>e.specSelectors.info().get("termsOfService"),I=(0,u.createSelector)(((e,t)=>t.specSelectors.url()),((e,t)=>t.oas3Selectors.selectedServer()),((e,t)=>t.specSelectors.selectInfoTermsOfServiceField()),((e,t,a)=>{if(a)return(0,d.mn)(a,e,{selectedServer:t})})),R=()=>e=>e.specSelectors.externalDocs().get("description"),P=()=>e=>e.specSelectors.externalDocs().get("url"),T=(0,u.createSelector)(((e,t)=>t.specSelectors.url()),((e,t)=>t.oas3Selectors.selectedServer()),((e,t)=>t.specSelectors.selectExternalDocsUrlField()),((e,t,a)=>{if(a)return(0,d.mn)(a,e,{selectedServer:t})})),M=()=>e=>e.specSelectors.specJson().get("jsonSchemaDialect"),D=()=>"https://spec.openapis.org/oas/3.1/dialect/base",L=(0,u.createSelector)(((e,t)=>t.specSelectors.definitions()),((e,t)=>t.specSelectors.specResolvedSubtree(["components","schemas"])),((e,t)=>{var a;return c.Map.isMap(e)?c.Map.isMap(t)?(0,r.default)(a=(0,i.default)(e.toJS())).call(a,((e,a)=>{let[n,r]=a;const s=t.get(n);return e[n]=(null==s?void 0:s.toJS())||r,e}),{}):e.toJS():{}}))},2884:(e,t,a)=>{a.r(t),a.d(t,{isOAS3:()=>r,selectLicenseUrl:()=>s});var n=a(4380);const r=(e,t)=>function(a){const n=t.specSelectors.isOAS31();for(var r=arguments.length,s=new Array(r>1?r-1:0),o=1;o(e,t)=>t.oas31Selectors.selectLicenseUrl()))},7423:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);const r=(0,a(4380).createOnlyOAS31ComponentWrapper)((e=>{let{getSystem:t}=e;const a=t().getComponent("OAS31Contact",!0);return n.default.createElement(a,null)}))},284:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);const r=(0,a(4380).createOnlyOAS31ComponentWrapper)((e=>{let{getSystem:t}=e;const a=t().getComponent("OAS31Info",!0);return n.default.createElement(a,null)}))},6608:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);const r=(0,a(4380).createOnlyOAS31ComponentWrapper)((e=>{let{getSystem:t}=e;const a=t().getComponent("OAS31License",!0);return n.default.createElement(a,null)}))},7042:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(810),r=a(4380),s=a(5800);const o=(0,r.createOnlyOAS31ComponentWrapper)((e=>{let{getSystem:t,...a}=e;const r=t(),{getComponent:o,fn:l,getConfigs:i}=r,c=i(),u=o("OAS31Model"),d=o("JSONSchema202012"),p=o("JSONSchema202012Keyword$schema"),m=o("JSONSchema202012Keyword$vocabulary"),f=o("JSONSchema202012Keyword$id"),h=o("JSONSchema202012Keyword$anchor"),g=o("JSONSchema202012Keyword$dynamicAnchor"),y=o("JSONSchema202012Keyword$ref"),v=o("JSONSchema202012Keyword$dynamicRef"),E=o("JSONSchema202012Keyword$defs"),S=o("JSONSchema202012Keyword$comment"),w=o("JSONSchema202012KeywordAllOf"),b=o("JSONSchema202012KeywordAnyOf"),x=o("JSONSchema202012KeywordOneOf"),_=o("JSONSchema202012KeywordNot"),C=o("JSONSchema202012KeywordIf"),j=o("JSONSchema202012KeywordThen"),N=o("JSONSchema202012KeywordElse"),O=o("JSONSchema202012KeywordDependentSchemas"),k=o("JSONSchema202012KeywordPrefixItems"),A=o("JSONSchema202012KeywordItems"),I=o("JSONSchema202012KeywordContains"),R=o("JSONSchema202012KeywordProperties"),P=o("JSONSchema202012KeywordPatternProperties"),T=o("JSONSchema202012KeywordAdditionalProperties"),M=o("JSONSchema202012KeywordPropertyNames"),D=o("JSONSchema202012KeywordUnevaluatedItems"),L=o("JSONSchema202012KeywordUnevaluatedProperties"),q=o("JSONSchema202012KeywordType"),B=o("JSONSchema202012KeywordEnum"),U=o("JSONSchema202012KeywordConst"),J=o("JSONSchema202012KeywordConstraint"),$=o("JSONSchema202012KeywordDependentRequired"),V=o("JSONSchema202012KeywordContentSchema"),K=o("JSONSchema202012KeywordTitle"),F=o("JSONSchema202012KeywordDescription"),z=o("JSONSchema202012KeywordDefault"),W=o("JSONSchema202012KeywordDeprecated"),H=o("JSONSchema202012KeywordReadOnly"),G=o("JSONSchema202012KeywordWriteOnly"),Z=o("JSONSchema202012Accordion"),Y=o("JSONSchema202012ExpandDeepButton"),X=o("JSONSchema202012ChevronRightIcon"),Q=o("withJSONSchema202012Context")(u,{config:{default$schema:"https://spec.openapis.org/oas/3.1/dialect/base",defaultExpandedLevels:c.defaultModelExpandDepth,includeReadOnly:Boolean(a.includeReadOnly),includeWriteOnly:Boolean(a.includeWriteOnly)},components:{JSONSchema:d,Keyword$schema:p,Keyword$vocabulary:m,Keyword$id:f,Keyword$anchor:h,Keyword$dynamicAnchor:g,Keyword$ref:y,Keyword$dynamicRef:v,Keyword$defs:E,Keyword$comment:S,KeywordAllOf:w,KeywordAnyOf:b,KeywordOneOf:x,KeywordNot:_,KeywordIf:C,KeywordThen:j,KeywordElse:N,KeywordDependentSchemas:O,KeywordPrefixItems:k,KeywordItems:A,KeywordContains:I,KeywordProperties:R,KeywordPatternProperties:P,KeywordAdditionalProperties:T,KeywordPropertyNames:M,KeywordUnevaluatedItems:D,KeywordUnevaluatedProperties:L,KeywordType:q,KeywordEnum:B,KeywordConst:U,KeywordConstraint:J,KeywordDependentRequired:$,KeywordContentSchema:V,KeywordTitle:K,KeywordDescription:F,KeywordDefault:z,KeywordDeprecated:W,KeywordReadOnly:H,KeywordWriteOnly:G,Accordion:Z,ExpandDeepButton:Y,ChevronRightIcon:X},fn:{upperFirst:l.upperFirst,isExpandable:(0,s.makeIsExpandable)(l.jsonSchema202012.isExpandable,t),getProperties:s.getProperties}});return n.default.createElement(Q,a)}))},2914:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(810);const r=(0,a(4380).createOnlyOAS31ComponentWrapper)((e=>{let{getSystem:t}=e;const{getComponent:a,fn:s,getConfigs:o}=t(),l=o();if(r.ModelsWithJSONSchemaContext)return n.default.createElement(r.ModelsWithJSONSchemaContext,null);const i=a("OAS31Models",!0),c=a("JSONSchema202012"),u=a("JSONSchema202012Keyword$schema"),d=a("JSONSchema202012Keyword$vocabulary"),p=a("JSONSchema202012Keyword$id"),m=a("JSONSchema202012Keyword$anchor"),f=a("JSONSchema202012Keyword$dynamicAnchor"),h=a("JSONSchema202012Keyword$ref"),g=a("JSONSchema202012Keyword$dynamicRef"),y=a("JSONSchema202012Keyword$defs"),v=a("JSONSchema202012Keyword$comment"),E=a("JSONSchema202012KeywordAllOf"),S=a("JSONSchema202012KeywordAnyOf"),w=a("JSONSchema202012KeywordOneOf"),b=a("JSONSchema202012KeywordNot"),x=a("JSONSchema202012KeywordIf"),_=a("JSONSchema202012KeywordThen"),C=a("JSONSchema202012KeywordElse"),j=a("JSONSchema202012KeywordDependentSchemas"),N=a("JSONSchema202012KeywordPrefixItems"),O=a("JSONSchema202012KeywordItems"),k=a("JSONSchema202012KeywordContains"),A=a("JSONSchema202012KeywordProperties"),I=a("JSONSchema202012KeywordPatternProperties"),R=a("JSONSchema202012KeywordAdditionalProperties"),P=a("JSONSchema202012KeywordPropertyNames"),T=a("JSONSchema202012KeywordUnevaluatedItems"),M=a("JSONSchema202012KeywordUnevaluatedProperties"),D=a("JSONSchema202012KeywordType"),L=a("JSONSchema202012KeywordEnum"),q=a("JSONSchema202012KeywordConst"),B=a("JSONSchema202012KeywordConstraint"),U=a("JSONSchema202012KeywordDependentRequired"),J=a("JSONSchema202012KeywordContentSchema"),$=a("JSONSchema202012KeywordTitle"),V=a("JSONSchema202012KeywordDescription"),K=a("JSONSchema202012KeywordDefault"),F=a("JSONSchema202012KeywordDeprecated"),z=a("JSONSchema202012KeywordReadOnly"),W=a("JSONSchema202012KeywordWriteOnly"),H=a("JSONSchema202012Accordion"),G=a("JSONSchema202012ExpandDeepButton"),Z=a("JSONSchema202012ChevronRightIcon"),Y=a("withJSONSchema202012Context");return r.ModelsWithJSONSchemaContext=Y(i,{config:{default$schema:"https://spec.openapis.org/oas/3.1/dialect/base",defaultExpandedLevels:l.defaultModelsExpandDepth-1,includeReadOnly:!0,includeWriteOnly:!0},components:{JSONSchema:c,Keyword$schema:u,Keyword$vocabulary:d,Keyword$id:p,Keyword$anchor:m,Keyword$dynamicAnchor:f,Keyword$ref:h,Keyword$dynamicRef:g,Keyword$defs:y,Keyword$comment:v,KeywordAllOf:E,KeywordAnyOf:S,KeywordOneOf:w,KeywordNot:b,KeywordIf:x,KeywordThen:_,KeywordElse:C,KeywordDependentSchemas:j,KeywordPrefixItems:N,KeywordItems:O,KeywordContains:k,KeywordProperties:A,KeywordPatternProperties:I,KeywordAdditionalProperties:R,KeywordPropertyNames:P,KeywordUnevaluatedItems:T,KeywordUnevaluatedProperties:M,KeywordType:D,KeywordEnum:L,KeywordConst:q,KeywordConstraint:B,KeywordDependentRequired:U,KeywordContentSchema:J,KeywordTitle:$,KeywordDescription:V,KeywordDefault:K,KeywordDeprecated:F,KeywordReadOnly:z,KeywordWriteOnly:W,Accordion:H,ExpandDeepButton:G,ChevronRightIcon:Z},fn:{upperFirst:s.upperFirst,isExpandable:s.jsonSchema202012.isExpandable,getProperties:s.jsonSchema202012.getProperties}}),n.default.createElement(r.ModelsWithJSONSchemaContext,null)}));r.ModelsWithJSONSchemaContext=null;const s=r},1434:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(863),r=a(810);const s=(e,t)=>e=>{const a=t.specSelectors.isOAS31(),s=t.getComponent("OAS31VersionPragmaFilter");return r.default.createElement(s,(0,n.default)({isOAS31:a},e))}},8560:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(6235);let r=!1;function s(){return{statePlugins:{spec:{wrapActions:{updateSpec:e=>function(){return r=!0,e(...arguments)},updateJsonSpec:(e,t)=>function(){const a=t.getConfigs().onComplete;return r&&"function"==typeof a&&((0,n.default)(a,0),r=!1),e(...arguments)}}}}}}},4624:(e,t,a)=>{a.r(t),a.d(t,{requestSnippetGenerator_curl_bash:()=>E,requestSnippetGenerator_curl_cmd:()=>S,requestSnippetGenerator_curl_powershell:()=>v});var n=a(8818),r=a(5942),s=a(313),o=a(2565);const i=(e=>{var t={};return a.d(t,e),t})({default:()=>l.default});var c=a(2954),u=a(2372),d=a(7504),p=a(9725);const m=e=>{var t;const a="_**[]";return(0,n.default)(e).call(e,a)<0?e:(0,r.default)(t=e.split(a)[0]).call(t)},f=e=>"-d "===e||/^[_\/-]/g.test(e)?e:"'"+e.replace(/'/g,"'\\''")+"'",h=e=>"-d "===(e=e.replace(/\^/g,"^^").replace(/\\"/g,'\\\\"').replace(/"/g,'""').replace(/\n/g,"^\n"))?e.replace(/-d /g,"-d ^\n"):/^[_\/-]/g.test(e)?e:'"'+e+'"',g=e=>"-d "===e?e:/\n/.test(e)?'@"\n'+e.replace(/"/g,'\\"').replace(/`/g,"``").replace(/\$/,"`$")+'\n"@':/^[_\/-]/g.test(e)?e:"'"+e.replace(/"/g,'""').replace(/'/g,"''")+"'";const y=function(e,t,a){let n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=!1,l="";const f=function(){for(var e=arguments.length,a=new Array(e),n=0;nl+=` ${a}`,y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return l+=(0,i.default)(" ").call(" ",e)};let v=e.get("headers");if(l+="curl"+n,e.has("curlOptions")&&f(...e.get("curlOptions")),f("-X",e.get("method")),g(),y(),h(`${e.get("url")}`),v&&v.size)for(let t of(0,c.default)(E=e.get("headers")).call(E)){var E;g(),y();let[e,a]=t;h("-H",`${e}: ${a}`),r=r||/^content-type$/i.test(e)&&/^multipart\/form-data$/i.test(a)}const S=e.get("body");var w;if(S)if(r&&(0,u.default)(w=["POST","PUT","PATCH"]).call(w,e.get("method")))for(let[e,t]of S.entrySeq()){let a=m(e);g(),y(),h("-F"),t instanceof d.Z.File&&"string"==typeof t.valueOf()?f(`${a}=${t.data}${t.type?`;type=${t.type}`:""}`):t instanceof d.Z.File?f(`${a}=@${t.name}${t.type?`;type=${t.type}`:""}`):f(`${a}=${t}`)}else if(S instanceof d.Z.File)g(),y(),h(`--data-binary '@${S.name}'`);else{g(),y(),h("-d ");let t=S;p.Map.isMap(t)?h(function(e){let t=[];for(let[a,n]of e.get("body").entrySeq()){let e=m(a);n instanceof d.Z.File?t.push(` "${e}": {\n "name": "${n.name}"${n.type?`,\n "type": "${n.type}"`:""}\n }`):t.push(` "${e}": ${(0,s.default)(n,null,2).replace(/(\r\n|\r|\n)/g,"\n ")}`)}return`{\n${t.join(",\n")}\n}`}(e)):("string"!=typeof t&&(t=(0,s.default)(t)),h(t))}else S||"POST"!==e.get("method")||(g(),y(),h("-d ''"));return l},v=e=>y(e,g,"`\n",".exe"),E=e=>y(e,f,"\\\n"),S=e=>y(e,h,"^\n")},6575:(e,t,a)=>{a.r(t),a.d(t,{default:()=>o});var n=a(4624),r=a(4669),s=a(4206);const o=()=>({components:{RequestSnippets:s.default},fn:n,statePlugins:{requestSnippets:{selectors:r}}})},4206:(e,t,a)=>{a.r(t),a.d(t,{default:()=>f});var n=a(6145),r=a(8898),s=a(29),o=a(2565),l=a(810),i=(a(5053),a(9908)),c=a(7068),u=a(9874),d=a(4305);const p={cursor:"pointer",lineHeight:1,display:"inline-flex",backgroundColor:"rgb(250, 250, 250)",paddingBottom:"0",paddingTop:"0",border:"1px solid rgb(51, 51, 51)",borderRadius:"4px 4px 0 0",boxShadow:"none",borderBottom:"none"},m={cursor:"pointer",lineHeight:1,display:"inline-flex",backgroundColor:"rgb(51, 51, 51)",boxShadow:"none",border:"1px solid rgb(51, 51, 51)",paddingBottom:"0",paddingTop:"0",borderRadius:"4px 4px 0 0",marginTop:"-5px",marginRight:"-5px",marginLeft:"-5px",zIndex:"9999",borderBottom:"none"},f=e=>{var t,a;let{request:f,requestSnippetsSelectors:h,getConfigs:g,getComponent:y}=e;const v=(0,c.default)(g)?g():null,E=!1!==(0,i.default)(v,"syntaxHighlight")&&(0,i.default)(v,"syntaxHighlight.activated",!0),S=(0,l.useRef)(null),w=y("ArrowUpIcon"),b=y("ArrowDownIcon"),[x,_]=(0,l.useState)(null===(t=h.getSnippetGenerators())||void 0===t?void 0:t.keySeq().first()),[C,j]=(0,l.useState)(null==h?void 0:h.getDefaultExpanded());(0,l.useEffect)((()=>{}),[]),(0,l.useEffect)((()=>{var e;const t=(0,n.default)(e=(0,r.default)(S.current.childNodes)).call(e,(e=>{var t;return!!e.nodeType&&(null===(t=e.classList)||void 0===t?void 0:t.contains("curl-command"))}));return(0,s.default)(t).call(t,(e=>e.addEventListener("mousewheel",R,{passive:!1}))),()=>{(0,s.default)(t).call(t,(e=>e.removeEventListener("mousewheel",R)))}}),[f]);const N=h.getSnippetGenerators(),O=N.get(x),k=O.get("fn")(f),A=()=>{j(!C)},I=e=>e===x?m:p,R=e=>{const{target:t,deltaY:a}=e,{scrollHeight:n,offsetHeight:r,scrollTop:s}=t;n>r&&(0===s&&a<0||r+s>=n&&a>0)&&e.preventDefault()},P=E?l.default.createElement(d.d3,{language:O.get("syntax"),className:"curl microlight",style:(0,d.C2)((0,i.default)(v,"syntaxHighlight.theme"))},k):l.default.createElement("textarea",{readOnly:!0,className:"curl",value:k});return l.default.createElement("div",{className:"request-snippets",ref:S},l.default.createElement("div",{style:{width:"100%",display:"flex",justifyContent:"flex-start",alignItems:"center",marginBottom:"15px"}},l.default.createElement("h4",{onClick:()=>A(),style:{cursor:"pointer"}},"Snippets"),l.default.createElement("button",{onClick:()=>A(),style:{border:"none",background:"none"},title:C?"Collapse operation":"Expand operation"},C?l.default.createElement(b,{className:"arrow",width:"10",height:"10"}):l.default.createElement(w,{className:"arrow",width:"10",height:"10"}))),C&&l.default.createElement("div",{className:"curl-command"},l.default.createElement("div",{style:{paddingLeft:"15px",paddingRight:"10px",width:"100%",display:"flex"}},(0,o.default)(a=N.entrySeq()).call(a,(e=>{let[t,a]=e;return l.default.createElement("div",{style:I(t),className:"btn",key:t,onClick:()=>(e=>{x!==e&&_(e)})(t)},l.default.createElement("h4",{style:t===x?{color:"white"}:{}},a.get("title")))}))),l.default.createElement("div",{className:"copy-to-clipboard"},l.default.createElement(u.CopyToClipboard,{text:k},l.default.createElement("button",null))),l.default.createElement("div",null,P)))}},4669:(e,t,a)=>{a.r(t),a.d(t,{getActiveLanguage:()=>d,getDefaultExpanded:()=>p,getGenerators:()=>c,getSnippetGenerators:()=>u});var n=a(6145),r=a(2372),s=a(2565),o=a(8639),l=a(9725);const i=e=>e||(0,l.Map)(),c=(0,o.createSelector)(i,(e=>{const t=e.get("languages"),a=e.get("generators",(0,l.Map)());return!t||t.isEmpty()?a:(0,n.default)(a).call(a,((e,a)=>(0,r.default)(t).call(t,a)))})),u=e=>t=>{var a,r;let{fn:o}=t;return(0,n.default)(a=(0,s.default)(r=c(e)).call(r,((e,t)=>{const a=(e=>o[`requestSnippetGenerator_${e}`])(t);return"function"!=typeof a?null:e.set("fn",a)}))).call(a,(e=>e))},d=(0,o.createSelector)(i,(e=>e.get("activeLanguage"))),p=(0,o.createSelector)(i,(e=>e.get("defaultExpanded")))},6195:(e,t,a)=>{a.r(t),a.d(t,{ErrorBoundary:()=>o,default:()=>l});a(5053);var n=a(810),r=a(6189),s=a(9403);class o extends n.Component{static getDerivedStateFromError(e){return{hasError:!0,error:e}}constructor(){super(...arguments),this.state={hasError:!1,error:null}}componentDidCatch(e,t){this.props.fn.componentDidCatch(e,t)}render(){const{getComponent:e,targetName:t,children:a}=this.props;if(this.state.hasError){const a=e("Fallback");return n.default.createElement(a,{name:t})}return a}}o.defaultProps={targetName:"this component",getComponent:()=>s.default,fn:{componentDidCatch:r.componentDidCatch},children:null};const l=o},9403:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(810);a(5053);const r=e=>{let{name:t}=e;return n.default.createElement("div",{className:"fallback"},"😱 ",n.default.createElement("i",null,"Could not render ","t"===t?"this component":t,", see the console."))}},6189:(e,t,a)=>{a.r(t),a.d(t,{componentDidCatch:()=>s,withErrorBoundary:()=>o});var n=a(863),r=a(810);const s=console.error,o=e=>t=>{const{getComponent:a,fn:s}=e(),o=a("ErrorBoundary"),l=s.getDisplayName(t);class i extends r.Component{render(){return r.default.createElement(o,{targetName:l,getComponent:a,fn:s},r.default.createElement(t,(0,n.default)({},this.props,this.context)))}}var c;return i.displayName=`WithErrorBoundary(${l})`,(c=t).prototype&&c.prototype.isReactComponent&&(i.prototype.mapStateToProps=t.prototype.mapStateToProps),i}},8102:(e,t,a)=>{a.r(t),a.d(t,{default:()=>u});const n=(e=>{var t={};return a.d(t,e),t})({default:()=>i.default});const r=(e=>{var t={};return a.d(t,e),t})({default:()=>c.default});var s=a(6195),o=a(9403),l=a(6189);const u=function(){let{componentList:e=[],fullOverride:t=!1}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return a=>{var i;let{getSystem:c}=a;const u=t?e:["App","BaseLayout","VersionPragmaFilter","InfoContainer","ServersContainer","SchemesContainer","AuthorizeBtnContainer","FilterContainer","Operations","OperationContainer","parameters","responses","OperationServers","Models","ModelWrapper",...e],d=(0,r.default)(u,(0,n.default)(i=Array(u.length)).call(i,((e,t)=>{let{fn:a}=t;return a.withErrorBoundary(e)})));return{fn:{componentDidCatch:l.componentDidCatch,withErrorBoundary:(0,l.withErrorBoundary)(c)},components:{ErrorBoundary:s.default,Fallback:o.default},wrapComponents:d}}}},2846:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(6785),r=a(313),s=a(841);const o=[{when:/json/,shouldStringifyTypes:["string"]}],l=["object"],i=e=>(t,a,i,c)=>{const{fn:u}=e(),d=u.memoizedSampleFromSchema(t,a,c),p=typeof d,m=(0,n.default)(o).call(o,((e,t)=>t.when.test(i)?[...e,...t.shouldStringifyTypes]:e),l);return(0,s.default)(m,(e=>e===p))?(0,r.default)(d,null,2):d}},6132:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=e=>function(t){var a,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:void 0;const{fn:l}=e();return"function"==typeof(null===(a=t)||void 0===a?void 0:a.toJS)&&(t=t.toJS()),"function"==typeof(null===(n=o)||void 0===n?void 0:n.toJS)&&(o=o.toJS()),/xml/.test(r)?l.getXmlSampleSchema(t,s,o):/(yaml|yml)/.test(r)?l.getYamlSampleSchema(t,s,r,o):l.getJsonSampleSchema(t,s,r,o)}},1169:(e,t,a)=>{a.r(t),a.d(t,{default:()=>n});const n=e=>(t,a,n)=>{const{fn:r}=e();if(t&&!t.xml&&(t.xml={}),t&&!t.xml.name){if(!t.$$ref&&(t.type||t.items||t.properties||t.additionalProperties))return'\n\x3c!-- XML example cannot be generated; root element name is undefined --\x3e';if(t.$$ref){let e=t.$$ref.match(/\S*\/(\S+)$/);t.xml.name=e[1]}}return r.memoizedCreateXMLExample(t,a,n)}},9431:(e,t,a)=>{a.r(t),a.d(t,{default:()=>s});var n=a(8136),r=a(3772);const s=e=>(t,a,s,o)=>{const{fn:l}=e(),i=l.getJsonSampleSchema(t,a,s,o);let c;try{c=r.default.dump(r.default.load(i),{lineWidth:-1},{schema:r.JSON_SCHEMA}),"\n"===c[c.length-1]&&(c=(0,n.default)(c).call(c,0,c.length-1))}catch(e){return console.error(e),"error: could not generate yaml example"}return c.replace(/\t/g," ")}},9812:(e,t,a)=>{a.r(t),a.d(t,{createXMLExample:()=>k,inferSchema:()=>O,memoizedCreateXMLExample:()=>R,memoizedSampleFromSchema:()=>P,sampleFromSchema:()=>A,sampleFromSchemaGeneric:()=>N});var n=a(8818),r=a(29),s=a(4163),o=a(2372),l=a(9963),i=a(8136),c=a(1778),u=a(5171),d=a(2565),p=a(313),m=a(3479),f=a.n(m),h=a(2092),g=a(8747),y=a(6561),v=a(9669);const E={string:e=>e.pattern?(e=>{try{return new h.default(e).gen()}catch(e){return"string"}})(e.pattern):"string",string_email:()=>"user@example.com","string_date-time":()=>(new Date).toISOString(),string_date:()=>(new Date).toISOString().substring(0,10),string_uuid:()=>"3fa85f64-5717-4562-b3fc-2c963f66afa6",string_hostname:()=>"example.com",string_ipv4:()=>"198.51.100.42",string_ipv6:()=>"2001:0db8:5b96:0000:0000:426f:8e17:642a",number:()=>0,number_float:()=>0,integer:()=>0,boolean:e=>"boolean"!=typeof e.default||e.default},S=e=>{e=(0,y.mz)(e);let{type:t,format:a}=e,n=E[`${t}_${a}`]||E[t];return(0,y.Wl)(n)?n(e):"Unknown Type: "+e.type},w=e=>(0,y.XV)(e,"$$ref",(e=>"string"==typeof e&&(0,n.default)(e).call(e,"#")>-1)),b=["maxProperties","minProperties"],x=["minItems","maxItems"],_=["minimum","maximum","exclusiveMinimum","exclusiveMaximum"],C=["minLength","maxLength"],j=function(e,t){var a;let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};var i;((0,r.default)(a=["example","default","enum","xml","type",...b,...x,..._,...C]).call(a,(a=>(a=>{void 0===t[a]&&void 0!==e[a]&&(t[a]=e[a])})(a))),void 0!==e.required&&(0,s.default)(e.required))&&(void 0!==t.required&&t.required.length||(t.required=[]),(0,r.default)(i=e.required).call(i,(e=>{var a;(0,o.default)(a=t.required).call(a,e)||t.required.push(e)})));if(e.properties){t.properties||(t.properties={});let a=(0,y.mz)(e.properties);for(let r in a){var c;if(Object.prototype.hasOwnProperty.call(a,r))if(!a[r]||!a[r].deprecated)if(!a[r]||!a[r].readOnly||l.includeReadOnly)if(!a[r]||!a[r].writeOnly||l.includeWriteOnly)if(!t.properties[r])t.properties[r]=a[r],!e.required&&(0,s.default)(e.required)&&-1!==(0,n.default)(c=e.required).call(c,r)&&(t.required?t.required.push(r):t.required=[r])}}return e.items&&(t.items||(t.items={}),t.items=j(e.items,t.items,l)),t},N=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:void 0,p=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e&&(0,y.Wl)(e.toJS)&&(e=e.toJS());let m=void 0!==a||e&&void 0!==e.example||e&&void 0!==e.default;const f=!m&&e&&e.oneOf&&e.oneOf.length>0,h=!m&&e&&e.anyOf&&e.anyOf.length>0;if(!m&&(f||h)){const a=(0,y.mz)(f?e.oneOf[0]:e.anyOf[0]);if(j(a,e,t),!e.xml&&a.xml&&(e.xml=a.xml),void 0!==e.example&&void 0!==a.example)m=!0;else if(a.properties){e.properties||(e.properties={});let r=(0,y.mz)(a.properties);for(let o in r){var v;if(Object.prototype.hasOwnProperty.call(r,o))if(!r[o]||!r[o].deprecated)if(!r[o]||!r[o].readOnly||t.includeReadOnly)if(!r[o]||!r[o].writeOnly||t.includeWriteOnly)if(!e.properties[o])e.properties[o]=r[o],!a.required&&(0,s.default)(a.required)&&-1!==(0,n.default)(v=a.required).call(v,o)&&(e.required?e.required.push(o):e.required=[o])}}}const E={};let{xml:C,type:O,example:k,properties:A,additionalProperties:I,items:R}=e||{},{includeReadOnly:P,includeWriteOnly:T}=t;C=C||{};let M,{name:D,prefix:L,namespace:q}=C,B={};if(p&&(D=D||"notagname",M=(L?L+":":"")+D,q)){E[L?"xmlns:"+L:"xmlns"]=q}p&&(B[M]=[]);const U=t=>(0,l.default)(t).call(t,(t=>Object.prototype.hasOwnProperty.call(e,t)));e&&!O&&(A||I||U(b)?O="object":R||U(x)?O="array":U(_)?(O="number",e.type="number"):m||e.enum||(O="string",e.type="string"));const J=t=>{var a,n,r,s,o;null!==(null===(a=e)||void 0===a?void 0:a.maxItems)&&void 0!==(null===(n=e)||void 0===n?void 0:n.maxItems)&&(t=(0,i.default)(t).call(t,0,null===(o=e)||void 0===o?void 0:o.maxItems));if(null!==(null===(r=e)||void 0===r?void 0:r.minItems)&&void 0!==(null===(s=e)||void 0===s?void 0:s.minItems)){let a=0;for(;t.length<(null===(l=e)||void 0===l?void 0:l.minItems);){var l;t.push(t[a++%t.length])}}return t},$=(0,y.mz)(A);let V,K=0;const F=()=>e&&null!==e.maxProperties&&void 0!==e.maxProperties&&K>=e.maxProperties,z=t=>!e||null===e.maxProperties||void 0===e.maxProperties||!F()&&(!(t=>{var a;return!(e&&e.required&&e.required.length&&(0,o.default)(a=e.required).call(a,t))})(t)||e.maxProperties-K-(()=>{if(!e||!e.required)return 0;let t=0;var a,n;return p?(0,r.default)(a=e.required).call(a,(e=>t+=void 0===B[e]?0:1)):(0,r.default)(n=e.required).call(n,(e=>{var a;return t+=void 0===(null===(a=B[M])||void 0===a?void 0:(0,c.default)(a).call(a,(t=>void 0!==t[e])))?0:1})),e.required.length-t})()>0);if(V=p?function(a){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:void 0;if(e&&$[a]){if($[a].xml=$[a].xml||{},$[a].xml.attribute){const e=(0,s.default)($[a].enum)?$[a].enum[0]:void 0,t=$[a].example,n=$[a].default;return void(E[$[a].xml.name||a]=void 0!==t?t:void 0!==n?n:void 0!==e?e:S($[a]))}$[a].xml.name=$[a].xml.name||a}else $[a]||!1===I||($[a]={xml:{name:a}});let r=N(e&&$[a]||void 0,t,n,p);var o;z(a)&&(K++,(0,s.default)(r)?B[M]=(0,u.default)(o=B[M]).call(o,r):B[M].push(r))}:(a,n)=>{if(z(a)){if(Object.prototype.hasOwnProperty.call(e,"discriminator")&&e.discriminator&&Object.prototype.hasOwnProperty.call(e.discriminator,"mapping")&&e.discriminator.mapping&&Object.prototype.hasOwnProperty.call(e,"$$ref")&&e.$$ref&&e.discriminator.propertyName===a){for(let t in e.discriminator.mapping)if(-1!==e.$$ref.search(e.discriminator.mapping[t])){B[a]=t;break}}else B[a]=N($[a],t,n,p);K++}},m){let n;if(n=w(void 0!==a?a:void 0!==k?k:e.default),!p){if("number"==typeof n&&"string"===O)return`${n}`;if("string"!=typeof n||"string"===O)return n;try{return JSON.parse(n)}catch(e){return n}}if(e||(O=(0,s.default)(n)?"array":typeof n),"array"===O){if(!(0,s.default)(n)){if("string"==typeof n)return n;n=[n]}const a=e?e.items:void 0;a&&(a.xml=a.xml||C||{},a.xml.name=a.xml.name||C.name);let r=(0,d.default)(n).call(n,(e=>N(a,t,e,p)));return r=J(r),C.wrapped?(B[M]=r,(0,g.default)(E)||B[M].push({_attr:E})):B=r,B}if("object"===O){if("string"==typeof n)return n;for(let t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e&&$[t]&&$[t].readOnly&&!P||e&&$[t]&&$[t].writeOnly&&!T||(e&&$[t]&&$[t].xml&&$[t].xml.attribute?E[$[t].xml.name||t]=n[t]:V(t,n[t])));return(0,g.default)(E)||B[M].push({_attr:E}),B}return B[M]=(0,g.default)(E)?n:[{_attr:E},n],B}if("object"===O){for(let e in $)Object.prototype.hasOwnProperty.call($,e)&&($[e]&&$[e].deprecated||$[e]&&$[e].readOnly&&!P||$[e]&&$[e].writeOnly&&!T||V(e));if(p&&E&&B[M].push({_attr:E}),F())return B;if(!0===I)p?B[M].push({additionalProp:"Anything can be here"}):B.additionalProp1={},K++;else if(I){const a=(0,y.mz)(I),n=N(a,t,void 0,p);if(p&&a.xml&&a.xml.name&&"notagname"!==a.xml.name)B[M].push(n);else{const t=null!==e.minProperties&&void 0!==e.minProperties&&KN(j(R,e,t),t,void 0,p)));else if((0,s.default)(R.oneOf)){var G;a=(0,d.default)(G=R.oneOf).call(G,(e=>N(j(R,e,t),t,void 0,p)))}else{if(!(!p||p&&C.wrapped))return N(R,t,void 0,p);a=[N(R,t,void 0,p)]}return a=J(a),p&&C.wrapped?(B[M]=a,(0,g.default)(E)||B[M].push({_attr:E}),B):a}let Z;if(e&&(0,s.default)(e.enum))Z=(0,y.AF)(e.enum)[0];else{if(!e)return;if(Z=S(e),"number"==typeof Z){let t=e.minimum;null!=t&&(e.exclusiveMinimum&&t++,Z=t);let a=e.maximum;null!=a&&(e.exclusiveMaximum&&a--,Z=a)}if("string"==typeof Z&&(null!==e.maxLength&&void 0!==e.maxLength&&(Z=(0,i.default)(Z).call(Z,0,e.maxLength)),null!==e.minLength&&void 0!==e.minLength)){let t=0;for(;Z.length(e.schema&&(e=e.schema),e.properties&&(e.type="object"),e),k=(e,t,a)=>{const n=N(e,t,a,!0);if(n)return"string"==typeof n?n:f()(n,{declaration:!0,indent:"\t"})},A=(e,t,a)=>N(e,t,a,!1),I=(e,t,a)=>[e,(0,p.default)(t),(0,p.default)(a)],R=(0,v.Z)(k,I),P=(0,v.Z)(A,I)},8883:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(9812),r=a(2846),s=a(9431),o=a(1169),l=a(6132);const i=e=>{let{getSystem:t}=e;return{fn:{inferSchema:n.inferSchema,sampleFromSchema:n.sampleFromSchema,sampleFromSchemaGeneric:n.sampleFromSchemaGeneric,createXMLExample:n.createXMLExample,memoizedSampleFromSchema:n.memoizedSampleFromSchema,memoizedCreateXMLExample:n.memoizedCreateXMLExample,getJsonSampleSchema:(0,r.default)(t),getYamlSampleSchema:(0,s.default)(t),getXmlSampleSchema:(0,o.default)(t),getSampleSchema:(0,l.default)(t)}}}},9620:(e,t,a)=>{a.r(t),a.d(t,{CLEAR_REQUEST:()=>z,CLEAR_RESPONSE:()=>F,CLEAR_VALIDATE_PARAMS:()=>W,LOG_REQUEST:()=>K,SET_MUTATED_REQUEST:()=>V,SET_REQUEST:()=>$,SET_RESPONSE:()=>J,SET_SCHEME:()=>Y,UPDATE_EMPTY_PARAM_INCLUSION:()=>B,UPDATE_JSON:()=>L,UPDATE_OPERATION_META_VALUE:()=>H,UPDATE_PARAM:()=>q,UPDATE_RESOLVED:()=>G,UPDATE_RESOLVED_SUBTREE:()=>Z,UPDATE_SPEC:()=>M,UPDATE_URL:()=>D,VALIDATE_PARAMS:()=>U,changeConsumesValue:()=>ge,changeParam:()=>ce,changeParamByIdentity:()=>ue,changeProducesValue:()=>ye,clearRequest:()=>Ce,clearResponse:()=>_e,clearValidateParams:()=>he,execute:()=>xe,executeRequest:()=>be,invalidateResolvedSubtreeCache:()=>pe,logRequest:()=>we,parseToJson:()=>ne,requestResolvedSubtree:()=>ie,resolveSpec:()=>se,setMutatedRequest:()=>Se,setRequest:()=>Ee,setResponse:()=>ve,setScheme:()=>je,updateEmptyParamInclusion:()=>fe,updateJsonSpec:()=>ae,updateResolved:()=>ee,updateResolvedSubtree:()=>de,updateSpec:()=>Q,updateUrl:()=>te,validateParams:()=>me});var n=a(4163),r=a(2565),s=a(6718),o=a.n(s),l=a(6785),i=a(6914),c=a(29),y=a(7930);const v=(e=>{var t={};return a.d(t,e),t})({default:()=>u.default});var E=a(6145),S=a(374),w=a(1778),b=a(2740),x=a(7512);const _=(e=>{var t={};return a.d(t,e),t})({default:()=>d.default});var C=a(3772),j=a(9725),N=a(8900),O=a(8518);const k=(e=>{var t={};return a.d(t,e),t})({default:()=>p.default});const A=(e=>{var t={};return a.d(t,e),t})({default:()=>m.default});const I=(e=>{var t={};return a.d(t,e),t})({default:()=>f.default});const R=(e=>{var t={};return a.d(t,e),t})({default:()=>h.default});const P=(e=>{var t={};return a.d(t,e),t})({default:()=>g.default});var T=a(6561);const M="spec_update_spec",D="spec_update_url",L="spec_update_json",q="spec_update_param",B="spec_update_empty_param_inclusion",U="spec_validate_param",J="spec_set_response",$="spec_set_request",V="spec_set_mutated_request",K="spec_log_request",F="spec_clear_response",z="spec_clear_request",W="spec_clear_validate_param",H="spec_update_operation_meta_value",G="spec_update_resolved",Z="spec_update_resolved_subtree",Y="set_scheme",X=e=>(0,k.default)(e)?e:"";function Q(e){const t=X(e).replace(/\t/g," ");if("string"==typeof e)return{type:M,payload:t}}function ee(e){return{type:G,payload:e}}function te(e){return{type:D,payload:e}}function ae(e){return{type:L,payload:e}}const ne=e=>t=>{let{specActions:a,specSelectors:n,errActions:r}=t,{specStr:s}=n,o=null;try{e=e||s(),r.clear({source:"parser"}),o=C.default.load(e,{schema:C.JSON_SCHEMA})}catch(e){return console.error(e),r.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return o&&"object"==typeof o?a.updateJsonSpec(o):{}};let re=!1;const se=(e,t)=>a=>{let{specActions:s,specSelectors:l,errActions:i,fn:{fetch:c,resolve:u,AST:d={}},getConfigs:p}=a;re||(console.warn("specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!"),re=!0);const{modelPropertyMacro:m,parameterMacro:f,requestInterceptor:h,responseInterceptor:g}=p();void 0===e&&(e=l.specJson()),void 0===t&&(t=l.url());let y=d.getLineNumberForPath?d.getLineNumberForPath:()=>{},v=l.specStr();return u({fetch:c,spec:e,baseDoc:t,modelPropertyMacro:m,parameterMacro:f,requestInterceptor:h,responseInterceptor:g}).then((e=>{let{spec:t,errors:a}=e;if(i.clear({type:"thrown"}),(0,n.default)(a)&&a.length>0){let e=(0,r.default)(a).call(a,(e=>(console.error(e),e.line=e.fullPath?y(v,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",o()(e,"message",{enumerable:!0,value:e.message}),e)));i.newThrownErrBatch(e)}return s.updateResolved(t)}))};let oe=[];const le=(0,A.default)((()=>{const e=(0,l.default)(oe).call(oe,((e,t)=>{let{path:a,system:n}=t;return e.has(n)||e.set(n,[]),e.get(n).push(a),e}),new i.default);oe=[],(0,c.default)(e).call(e,(async(e,t)=>{if(!t)return void console.error("debResolveSubtrees: don't have a system to operate on, aborting.");if(!t.fn.resolveSubtree)return void console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing.");const{errActions:a,errSelectors:s,fn:{resolveSubtree:i,fetch:c,AST:u={}},specSelectors:d,specActions:p}=t,m=u.getLineNumberForPath??(0,P.default)(void 0),f=d.specStr(),{modelPropertyMacro:h,parameterMacro:g,requestInterceptor:w,responseInterceptor:b}=t.getConfigs();try{const t=await(0,l.default)(e).call(e,(async(e,t)=>{let{resultMap:l,specWithCurrentSubtrees:u}=await e;const{errors:p,spec:x}=await i(u,t,{baseDoc:d.url(),modelPropertyMacro:h,parameterMacro:g,requestInterceptor:w,responseInterceptor:b});if(s.allErrors().size&&a.clearBy((e=>{var a;return"thrown"!==e.get("type")||"resolver"!==e.get("source")||!(0,y.default)(a=e.get("fullPath")).call(a,((e,a)=>e===t[a]||void 0===t[a]))})),(0,n.default)(p)&&p.length>0){let e=(0,r.default)(p).call(p,(e=>(e.line=e.fullPath?m(f,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",o()(e,"message",{enumerable:!0,value:e.message}),e)));a.newThrownErrBatch(e)}var _,C;x&&d.isOAS3()&&"components"===t[0]&&"securitySchemes"===t[1]&&await v.default.all((0,r.default)(_=(0,E.default)(C=(0,S.default)(x)).call(C,(e=>"openIdConnect"===e.type))).call(_,(async e=>{const t={url:e.openIdConnectUrl,requestInterceptor:w,responseInterceptor:b};try{const a=await c(t);a instanceof Error||a.status>=400?console.error(a.statusText+" "+t.url):e.openIdConnectData=JSON.parse(a.text)}catch(e){console.error(e)}})));return(0,I.default)(l,t,x),u=(0,R.default)(t,x,u),{resultMap:l,specWithCurrentSubtrees:u}}),v.default.resolve({resultMap:(d.specResolvedSubtree([])||(0,j.Map)()).toJS(),specWithCurrentSubtrees:d.specJS()}));p.updateResolvedSubtree([],t.resultMap)}catch(e){console.error(e)}}))}),35),ie=e=>t=>{(0,w.default)(oe).call(oe,(a=>{let{path:n,system:r}=a;return r===t&&n.toString()===e.toString()}))||(oe.push({path:e,system:t}),le())};function ce(e,t,a,n,r){return{type:q,payload:{path:e,value:n,paramName:t,paramIn:a,isXml:r}}}function ue(e,t,a,n){return{type:q,payload:{path:e,param:t,value:a,isXml:n}}}const de=(e,t)=>({type:Z,payload:{path:e,value:t}}),pe=()=>({type:Z,payload:{path:[],value:(0,j.Map)()}}),me=(e,t)=>({type:U,payload:{pathMethod:e,isOAS3:t}}),fe=(e,t,a,n)=>({type:B,payload:{pathMethod:e,paramName:t,paramIn:a,includeEmptyValue:n}});function he(e){return{type:W,payload:{pathMethod:e}}}function ge(e,t){return{type:H,payload:{path:e,value:t,key:"consumes_value"}}}function ye(e,t){return{type:H,payload:{path:e,value:t,key:"produces_value"}}}const ve=(e,t,a)=>({payload:{path:e,method:t,res:a},type:J}),Ee=(e,t,a)=>({payload:{path:e,method:t,req:a},type:$}),Se=(e,t,a)=>({payload:{path:e,method:t,req:a},type:V}),we=e=>({payload:e,type:K}),be=e=>t=>{let{fn:a,specActions:s,specSelectors:o,getConfigs:l,oas3Selectors:i}=t,{pathName:u,method:d,operation:p}=e,{requestInterceptor:m,responseInterceptor:f}=l(),h=p.toJS();var g,y;p&&p.get("parameters")&&(0,c.default)(g=(0,E.default)(y=p.get("parameters")).call(y,(e=>e&&!0===e.get("allowEmptyValue")))).call(g,(t=>{if(o.parameterInclusionSettingFor([u,d],t.get("name"),t.get("in"))){e.parameters=e.parameters||{};const a=(0,T.cz)(t,e.parameters);(!a||a&&0===a.size)&&(e.parameters[t.get("name")]="")}}));if(e.contextUrl=(0,N.default)(o.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&u&&d&&(e.operationId=a.opId(h,u,d)),o.isOAS3()){const t=`${u}:${d}`;e.server=i.selectedServer(t)||i.selectedServer();const a=i.serverVariables({server:e.server,namespace:t}).toJS(),s=i.serverVariables({server:e.server}).toJS();e.serverVariables=(0,b.default)(a).length?a:s,e.requestContentType=i.requestContentType(u,d),e.responseContentType=i.responseContentType(u,d)||"*/*";const o=i.requestBodyValue(u,d),l=i.requestBodyInclusionSetting(u,d);var v;if(o&&o.toJS)e.requestBody=(0,E.default)(v=(0,r.default)(o).call(o,(e=>j.Map.isMap(e)?e.get("value"):e))).call(v,((e,t)=>((0,n.default)(e)?0!==e.length:!(0,T.O2)(e))||l.get(t))).toJS();else e.requestBody=o}let S=(0,x.default)({},e);S=a.buildRequest(S),s.setRequest(e.pathName,e.method,S);e.requestInterceptor=async t=>{let a=await m.apply(void 0,[t]),n=(0,x.default)({},a);return s.setMutatedRequest(e.pathName,e.method,n),a},e.responseInterceptor=f;const w=(0,_.default)();return a.execute(e).then((t=>{t.duration=(0,_.default)()-w,s.setResponse(e.pathName,e.method,t)})).catch((t=>{"Failed to fetch"===t.message&&(t.name="",t.message='**Failed to fetch.** \n**Possible Reasons:** \n - CORS \n - Network Failure \n - URL scheme must be "http" or "https" for CORS request.'),s.setResponse(e.pathName,e.method,{error:!0,err:(0,O.serializeError)(t)})}))},xe=function(){let{path:e,method:t,...a}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return n=>{let{fn:{fetch:r},specSelectors:s,specActions:o}=n,l=s.specJsonWithResolvedSubtrees().toJS(),i=s.operationScheme(e,t),{requestContentType:c,responseContentType:u}=s.contentTypeValues([e,t]).toJS(),d=/xml/i.test(c),p=s.parameterValues([e,t],d).toJS();return o.executeRequest({...a,fetch:r,spec:l,pathName:e,method:t,parameters:p,requestContentType:c,scheme:i,responseContentType:u})}};function _e(e,t){return{type:F,payload:{path:e,method:t}}}function Ce(e,t){return{type:z,payload:{path:e,method:t}}}function je(e,t,a){return{type:Y,payload:{scheme:e,path:t,method:a}}}},7038:(e,t,a)=>{a.r(t),a.d(t,{default:()=>l});var n=a(32),r=a(9620),s=a(3881),o=a(7508);function l(){return{statePlugins:{spec:{wrapActions:o,reducers:n.default,actions:r,selectors:s}}}}},32:(e,t,a)=>{a.r(t),a.d(t,{default:()=>d});var n=a(6785),r=a(2565),s=a(7512),o=a(9725),l=a(6561),i=a(7504),c=a(3881),u=a(9620);const d={[u.UPDATE_SPEC]:(e,t)=>"string"==typeof t.payload?e.set("spec",t.payload):e,[u.UPDATE_URL]:(e,t)=>e.set("url",t.payload+""),[u.UPDATE_JSON]:(e,t)=>e.set("json",(0,l.oG)(t.payload)),[u.UPDATE_RESOLVED]:(e,t)=>e.setIn(["resolved"],(0,l.oG)(t.payload)),[u.UPDATE_RESOLVED_SUBTREE]:(e,t)=>{const{value:a,path:n}=t.payload;return e.setIn(["resolvedSubtrees",...n],(0,l.oG)(a))},[u.UPDATE_PARAM]:(e,t)=>{let{payload:a}=t,{path:n,paramName:r,paramIn:s,param:o,value:i,isXml:c}=a,u=o?(0,l.V9)(o):`${s}.${r}`;const d=c?"value_xml":"value";return e.setIn(["meta","paths",...n,"parameters",u,d],i)},[u.UPDATE_EMPTY_PARAM_INCLUSION]:(e,t)=>{let{payload:a}=t,{pathMethod:n,paramName:r,paramIn:s,includeEmptyValue:o}=a;if(!r||!s)return console.warn("Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey."),e;const l=`${s}.${r}`;return e.setIn(["meta","paths",...n,"parameter_inclusions",l],o)},[u.VALIDATE_PARAMS]:(e,t)=>{let{payload:{pathMethod:a,isOAS3:r}}=t;const s=(0,c.specJsonWithResolvedSubtrees)(e).getIn(["paths",...a]),i=(0,c.parameterValues)(e,a).toJS();return e.updateIn(["meta","paths",...a,"parameters"],(0,o.fromJS)({}),(t=>{var u;return(0,n.default)(u=s.get("parameters",(0,o.List)())).call(u,((t,n)=>{const s=(0,l.cz)(n,i),u=(0,c.parameterInclusionSettingFor)(e,a,n.get("name"),n.get("in")),d=(0,l.Ik)(n,s,{bypassRequiredCheck:u,isOAS3:r});return t.setIn([(0,l.V9)(n),"errors"],(0,o.fromJS)(d))}),t)}))},[u.CLEAR_VALIDATE_PARAMS]:(e,t)=>{let{payload:{pathMethod:a}}=t;return e.updateIn(["meta","paths",...a,"parameters"],(0,o.fromJS)([]),(e=>(0,r.default)(e).call(e,(e=>e.set("errors",(0,o.fromJS)([]))))))},[u.SET_RESPONSE]:(e,t)=>{let a,{payload:{res:n,path:r,method:o}}=t;a=n.error?(0,s.default)({error:!0,name:n.err.name,message:n.err.message,statusCode:n.err.statusCode},n.err.response):n,a.headers=a.headers||{};let c=e.setIn(["responses",r,o],(0,l.oG)(a));return i.Z.Blob&&n.data instanceof i.Z.Blob&&(c=c.setIn(["responses",r,o,"text"],n.data)),c},[u.SET_REQUEST]:(e,t)=>{let{payload:{req:a,path:n,method:r}}=t;return e.setIn(["requests",n,r],(0,l.oG)(a))},[u.SET_MUTATED_REQUEST]:(e,t)=>{let{payload:{req:a,path:n,method:r}}=t;return e.setIn(["mutatedRequests",n,r],(0,l.oG)(a))},[u.UPDATE_OPERATION_META_VALUE]:(e,t)=>{let{payload:{path:a,value:n,key:r}}=t,s=["paths",...a],l=["meta","paths",...a];return e.getIn(["json",...s])||e.getIn(["resolved",...s])||e.getIn(["resolvedSubtrees",...s])?e.setIn([...l,r],(0,o.fromJS)(n)):e},[u.CLEAR_RESPONSE]:(e,t)=>{let{payload:{path:a,method:n}}=t;return e.deleteIn(["responses",a,n])},[u.CLEAR_REQUEST]:(e,t)=>{let{payload:{path:a,method:n}}=t;return e.deleteIn(["requests",a,n])},[u.SET_SCHEME]:(e,t)=>{let{payload:{scheme:a,path:n,method:r}}=t;return n&&r?e.setIn(["scheme",n,r],a):n||r?void 0:e.setIn(["scheme","_defaultScheme"],a)}}},3881:(e,t,a)=>{a.r(t),a.d(t,{allowTryItOutFor:()=>ne,basePath:()=>V,canExecuteScheme:()=>ve,consumes:()=>L,consumesOptionsFor:()=>ge,contentTypeValues:()=>me,currentProducesFor:()=>fe,definitions:()=>$,externalDocs:()=>I,findDefinition:()=>J,getOAS3RequiredRequestBodyContentType:()=>we,getParameter:()=>ie,hasHost:()=>ce,host:()=>K,info:()=>A,isMediaTypeSchemaPropertiesEqual:()=>be,isOAS3:()=>k,lastError:()=>v,mutatedRequestFor:()=>ae,mutatedRequests:()=>Q,operationScheme:()=>ye,operationWithMeta:()=>le,operations:()=>D,operationsWithRootInherited:()=>z,operationsWithTags:()=>G,parameterInclusionSettingFor:()=>se,parameterValues:()=>ue,parameterWithMeta:()=>oe,parameterWithMetaByIdentity:()=>re,parametersIncludeIn:()=>de,parametersIncludeType:()=>pe,paths:()=>T,produces:()=>q,producesOptionsFor:()=>he,requestFor:()=>te,requests:()=>X,responseFor:()=>ee,responses:()=>Y,schemes:()=>F,security:()=>B,securityDefinitions:()=>U,semver:()=>P,spec:()=>O,specJS:()=>x,specJson:()=>b,specJsonWithResolvedSubtrees:()=>N,specResolved:()=>_,specResolvedSubtree:()=>C,specSource:()=>w,specStr:()=>S,tagDetails:()=>H,taggedOperations:()=>Z,tags:()=>W,url:()=>E,validOperationMethods:()=>M,validateBeforeExecute:()=>Se,validationErrors:()=>Ee,version:()=>R});var n=a(8136),r=a(29),s=a(8818),o=a(2565),l=a(6145),i=a(1778),c=a(6785),u=a(4350),d=a(9963),p=a(4163),m=a(8639),f=a(6561),h=a(9725);const g=["get","put","post","delete","options","head","patch","trace"],y=e=>e||(0,h.Map)(),v=(0,m.createSelector)(y,(e=>e.get("lastError"))),E=(0,m.createSelector)(y,(e=>e.get("url"))),S=(0,m.createSelector)(y,(e=>e.get("spec")||"")),w=(0,m.createSelector)(y,(e=>e.get("specSource")||"not-editor")),b=(0,m.createSelector)(y,(e=>e.get("json",(0,h.Map)()))),x=(0,m.createSelector)(b,(e=>e.toJS())),_=(0,m.createSelector)(y,(e=>e.get("resolved",(0,h.Map)()))),C=(e,t)=>e.getIn(["resolvedSubtrees",...t],void 0),j=(e,t)=>h.Map.isMap(e)&&h.Map.isMap(t)?t.get("$$ref")?t:(0,h.OrderedMap)().mergeWith(j,e,t):t,N=(0,m.createSelector)(y,(e=>(0,h.OrderedMap)().mergeWith(j,e.get("json"),e.get("resolvedSubtrees")))),O=e=>b(e),k=(0,m.createSelector)(O,(()=>!1)),A=(0,m.createSelector)(O,(e=>xe(e&&e.get("info")))),I=(0,m.createSelector)(O,(e=>xe(e&&e.get("externalDocs")))),R=(0,m.createSelector)(A,(e=>e&&e.get("version"))),P=(0,m.createSelector)(R,(e=>{var t;return(0,n.default)(t=/v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(e)).call(t,1)})),T=(0,m.createSelector)(N,(e=>e.get("paths"))),M=(0,m.createSelector)((()=>["get","put","post","delete","options","head","patch"])),D=(0,m.createSelector)(T,(e=>{if(!e||e.size<1)return(0,h.List)();let t=(0,h.List)();return e&&(0,r.default)(e)?((0,r.default)(e).call(e,((e,a)=>{if(!e||!(0,r.default)(e))return{};(0,r.default)(e).call(e,((e,n)=>{(0,s.default)(g).call(g,n)<0||(t=t.push((0,h.fromJS)({path:a,method:n,operation:e,id:`${n}-${a}`})))}))})),t):(0,h.List)()})),L=(0,m.createSelector)(O,(e=>(0,h.Set)(e.get("consumes")))),q=(0,m.createSelector)(O,(e=>(0,h.Set)(e.get("produces")))),B=(0,m.createSelector)(O,(e=>e.get("security",(0,h.List)()))),U=(0,m.createSelector)(O,(e=>e.get("securityDefinitions"))),J=(e,t)=>{const a=e.getIn(["resolvedSubtrees","definitions",t],null),n=e.getIn(["json","definitions",t],null);return a||n||null},$=(0,m.createSelector)(O,(e=>{const t=e.get("definitions");return h.Map.isMap(t)?t:(0,h.Map)()})),V=(0,m.createSelector)(O,(e=>e.get("basePath"))),K=(0,m.createSelector)(O,(e=>e.get("host"))),F=(0,m.createSelector)(O,(e=>e.get("schemes",(0,h.Map)()))),z=(0,m.createSelector)(D,L,q,((e,t,a)=>(0,o.default)(e).call(e,(e=>e.update("operation",(e=>{if(e){if(!h.Map.isMap(e))return;return e.withMutations((e=>(e.get("consumes")||e.update("consumes",(e=>(0,h.Set)(e).merge(t))),e.get("produces")||e.update("produces",(e=>(0,h.Set)(e).merge(a))),e)))}return(0,h.Map)()})))))),W=(0,m.createSelector)(O,(e=>{const t=e.get("tags",(0,h.List)());return h.List.isList(t)?(0,l.default)(t).call(t,(e=>h.Map.isMap(e))):(0,h.List)()})),H=(e,t)=>{var a;let n=W(e)||(0,h.List)();return(0,i.default)(a=(0,l.default)(n).call(n,h.Map.isMap)).call(a,(e=>e.get("name")===t),(0,h.Map)())},G=(0,m.createSelector)(z,W,((e,t)=>(0,c.default)(e).call(e,((e,t)=>{let a=(0,h.Set)(t.getIn(["operation","tags"]));return a.count()<1?e.update("default",(0,h.List)(),(e=>e.push(t))):(0,c.default)(a).call(a,((e,a)=>e.update(a,(0,h.List)(),(e=>e.push(t)))),e)}),(0,c.default)(t).call(t,((e,t)=>e.set(t.get("name"),(0,h.List)())),(0,h.OrderedMap)())))),Z=e=>t=>{var a;let{getConfigs:n}=t,{tagsSorter:r,operationsSorter:s}=n();return(0,o.default)(a=G(e).sortBy(((e,t)=>t),((e,t)=>{let a="function"==typeof r?r:f.wh.tagsSorter[r];return a?a(e,t):null}))).call(a,((t,a)=>{let n="function"==typeof s?s:f.wh.operationsSorter[s],r=n?(0,u.default)(t).call(t,n):t;return(0,h.Map)({tagDetails:H(e,a),operations:r})}))},Y=(0,m.createSelector)(y,(e=>e.get("responses",(0,h.Map)()))),X=(0,m.createSelector)(y,(e=>e.get("requests",(0,h.Map)()))),Q=(0,m.createSelector)(y,(e=>e.get("mutatedRequests",(0,h.Map)()))),ee=(e,t,a)=>Y(e).getIn([t,a],null),te=(e,t,a)=>X(e).getIn([t,a],null),ae=(e,t,a)=>Q(e).getIn([t,a],null),ne=()=>!0,re=(e,t,a)=>{const n=N(e).getIn(["paths",...t,"parameters"],(0,h.OrderedMap)()),r=e.getIn(["meta","paths",...t,"parameters"],(0,h.OrderedMap)()),s=(0,o.default)(n).call(n,(e=>{const t=r.get(`${a.get("in")}.${a.get("name")}`),n=r.get(`${a.get("in")}.${a.get("name")}.hash-${a.hashCode()}`);return(0,h.OrderedMap)().merge(e,t,n)}));return(0,i.default)(s).call(s,(e=>e.get("in")===a.get("in")&&e.get("name")===a.get("name")),(0,h.OrderedMap)())},se=(e,t,a,n)=>{const r=`${n}.${a}`;return e.getIn(["meta","paths",...t,"parameter_inclusions",r],!1)},oe=(e,t,a,n)=>{const r=N(e).getIn(["paths",...t,"parameters"],(0,h.OrderedMap)()),s=(0,i.default)(r).call(r,(e=>e.get("in")===n&&e.get("name")===a),(0,h.OrderedMap)());return re(e,t,s)},le=(e,t,a)=>{var n;const r=N(e).getIn(["paths",t,a],(0,h.OrderedMap)()),s=e.getIn(["meta","paths",t,a],(0,h.OrderedMap)()),l=(0,o.default)(n=r.get("parameters",(0,h.List)())).call(n,(n=>re(e,[t,a],n)));return(0,h.OrderedMap)().merge(r,s).set("parameters",l)};function ie(e,t,a,n){t=t||[];let r=e.getIn(["meta","paths",...t,"parameters"],(0,h.fromJS)([]));return(0,i.default)(r).call(r,(e=>h.Map.isMap(e)&&e.get("name")===a&&e.get("in")===n))||(0,h.Map)()}const ce=(0,m.createSelector)(O,(e=>{const t=e.get("host");return"string"==typeof t&&t.length>0&&"/"!==t[0]}));function ue(e,t,a){t=t||[];let n=le(e,...t).get("parameters",(0,h.List)());return(0,c.default)(n).call(n,((e,t)=>{let n=a&&"body"===t.get("in")?t.get("value_xml"):t.get("value");return e.set((0,f.V9)(t,{allowHashes:!1}),n)}),(0,h.fromJS)({}))}function de(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(h.List.isList(e))return(0,d.default)(e).call(e,(e=>h.Map.isMap(e)&&e.get("in")===t))}function pe(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";if(h.List.isList(e))return(0,d.default)(e).call(e,(e=>h.Map.isMap(e)&&e.get("type")===t))}function me(e,t){t=t||[];let a=N(e).getIn(["paths",...t],(0,h.fromJS)({})),n=e.getIn(["meta","paths",...t],(0,h.fromJS)({})),r=fe(e,t);const s=a.get("parameters")||new h.List,o=n.get("consumes_value")?n.get("consumes_value"):pe(s,"file")?"multipart/form-data":pe(s,"formData")?"application/x-www-form-urlencoded":void 0;return(0,h.fromJS)({requestContentType:o,responseContentType:r})}function fe(e,t){t=t||[];const a=N(e).getIn(["paths",...t],null);if(null===a)return;const n=e.getIn(["meta","paths",...t,"produces_value"],null),r=a.getIn(["produces",0],null);return n||r||"application/json"}function he(e,t){t=t||[];const a=N(e),n=a.getIn(["paths",...t],null);if(null===n)return;const[r]=t,s=n.get("produces",null),o=a.getIn(["paths",r,"produces"],null),l=a.getIn(["produces"],null);return s||o||l}function ge(e,t){t=t||[];const a=N(e),n=a.getIn(["paths",...t],null);if(null===n)return;const[r]=t,s=n.get("consumes",null),o=a.getIn(["paths",r,"consumes"],null),l=a.getIn(["consumes"],null);return s||o||l}const ye=(e,t,a)=>{let n=e.get("url").match(/^([a-z][a-z0-9+\-.]*):/),r=(0,p.default)(n)?n[1]:null;return e.getIn(["scheme",t,a])||e.getIn(["scheme","_defaultScheme"])||r||""},ve=(e,t,a)=>{var n;return(0,s.default)(n=["http","https"]).call(n,ye(e,t,a))>-1},Ee=(e,t)=>{t=t||[];let a=e.getIn(["meta","paths",...t,"parameters"],(0,h.fromJS)([]));const n=[];return(0,r.default)(a).call(a,(e=>{let t=e.get("errors");t&&t.count()&&(0,r.default)(t).call(t,(e=>n.push(e)))})),n},Se=(e,t)=>0===Ee(e,t).length,we=(e,t)=>{var a;let n={requestBody:!1,requestContentType:{}},s=e.getIn(["resolvedSubtrees","paths",...t,"requestBody"],(0,h.fromJS)([]));return s.size<1||(s.getIn(["required"])&&(n.requestBody=s.getIn(["required"])),(0,r.default)(a=s.getIn(["content"]).entrySeq()).call(a,(e=>{const t=e[0];if(e[1].getIn(["schema","required"])){const a=e[1].getIn(["schema","required"]).toJS();n.requestContentType[t]=a}}))),n},be=(e,t,a,n)=>{if((a||n)&&a===n)return!0;let r=e.getIn(["resolvedSubtrees","paths",...t,"requestBody","content"],(0,h.fromJS)([]));if(r.size<2||!a||!n)return!1;let s=r.getIn([a,"schema","properties"],(0,h.fromJS)([])),o=r.getIn([n,"schema","properties"],(0,h.fromJS)([]));return!!s.equals(o)};function xe(e){return h.Map.isMap(e)?e:new h.Map}},7508:(e,t,a)=>{a.r(t),a.d(t,{executeRequest:()=>i,updateJsonSpec:()=>l,updateSpec:()=>o,validateParams:()=>c});var n=a(2740),r=a(29),s=a(9908);const o=(e,t)=>{let{specActions:a}=t;return function(){e(...arguments),a.parseToJson(...arguments)}},l=(e,t)=>{let{specActions:a}=t;return function(){for(var t=arguments.length,o=new Array(t),l=0;l{(0,s.default)(c,[e]).$ref&&a.requestResolvedSubtree(["paths",e])})),a.requestResolvedSubtree(["components","securitySchemes"])}},i=(e,t)=>{let{specActions:a}=t;return t=>(a.logRequest(t),e(t))},c=(e,t)=>{let{specSelectors:a}=t;return t=>e(t,a.isOAS3())}},4852:(e,t,a)=>{a.r(t),a.d(t,{loaded:()=>n});const n=(e,t)=>function(){e(...arguments);const a=t.getConfigs().withCredentials;void 0!==a&&(t.fn.fetch.withCredentials="string"==typeof a?"true"===a:!!a)}},9430:(e,t,a)=>{a.r(t),a.d(t,{default:()=>m});const n=(e=>{var t={};return a.d(t,e),t})({default:()=>y.default});const r=(e=>{var t={};return a.d(t,e),t})({default:()=>v.default});const s=(e=>{var t={};return a.d(t,e),t})({default:()=>E.default});const o=(e=>{var t={};return a.d(t,e),t})({default:()=>S.default});const l=(e=>{var t={};return a.d(t,e),t})({makeResolve:()=>w.makeResolve});const i=(e=>{var t={};return a.d(t,e),t})({buildRequest:()=>b.buildRequest,execute:()=>b.execute});const c=(e=>{var t={};return a.d(t,e),t})({default:()=>x.default,makeHttp:()=>x.makeHttp,serializeRes:()=>x.serializeRes});const u=(e=>{var t={};return a.d(t,e),t})({makeResolveSubtree:()=>_.makeResolveSubtree});var d=a(5013),p=a(4852);function m(e){let{configs:t,getConfigs:a}=e;return{fn:{fetch:(0,c.makeHttp)(c.default,t.preFetch,t.postFetch),buildRequest:i.buildRequest,execute:i.execute,resolve:(0,l.makeResolve)({strategies:[o.default,s.default,r.default,n.default]}),resolveSubtree:async function(e,t){let l=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const i=a(),c={modelPropertyMacro:i.modelPropertyMacro,parameterMacro:i.parameterMacro,requestInterceptor:i.requestInterceptor,responseInterceptor:i.responseInterceptor,strategies:[o.default,s.default,r.default,n.default]};return(0,u.makeResolveSubtree)(c)(e,t,l)},serializeRes:c.serializeRes,opId:d.opId},statePlugins:{configs:{wrapActions:{loaded:p.loaded}}}}}},8525:(e,t,a)=>{a.r(t),a.d(t,{default:()=>r});var n=a(6561);function r(){return{fn:{shallowEqualKeys:n.be}}}},8347:(e,t,a)=>{a.r(t),a.d(t,{getDisplayName:()=>n});const n=e=>e.displayName||e.name||"Component"},3420:(e,t,a)=>{a.r(t),a.d(t,{default:()=>i});var n=a(313),r=a(6561),s=a(1548),o=a(8347),l=a(9669);const i=e=>{let{getComponents:t,getStore:a,getSystem:i}=e;const c=(u=(0,s.getComponent)(i,a,t),(0,r.HP)(u,(function(){for(var e=arguments.length,t=new Array(e),a=0;a(0,l.Z)(e,(function(){for(var e=arguments.length,t=new Array(e),a=0;a{a.r(t),a.d(t,{getComponent:()=>y,render:()=>g,withMappedContainer:()=>h});var n=a(863),r=a(2740),s=a(810);const o=(e=>{var t={};return a.d(t,e),t})({default:()=>C.default});var l=a(9871);const i=(e=>{var t={};return a.d(t,e),t})({Provider:()=>j.Provider,connect:()=>j.connect});var c=a(1116),u=a(1252);const d=e=>t=>{const{fn:a}=e();class r extends s.Component{render(){return s.default.createElement(t,(0,n.default)({},e(),this.props,this.context))}}return r.displayName=`WithSystem(${a.getDisplayName(t)})`,r},p=(e,t)=>a=>{const{fn:r}=e();class o extends s.Component{render(){return s.default.createElement(i.Provider,{store:t},s.default.createElement(a,(0,n.default)({},this.props,this.context)))}}return o.displayName=`WithRoot(${r.getDisplayName(a)})`,o},m=(e,t,a)=>(0,l.compose)(a?p(e,a):u.default,(0,i.connect)(((a,n)=>{var r;const s={...n,...e()},o=(null===(r=t.prototype)||void 0===r?void 0:r.mapStateToProps)||(e=>({state:e}));return o(a,s)})),d(e))(t),f=(e,t,a,n)=>{for(const r in t){const s=t[r];"function"==typeof s&&s(a[r],n[r],e())}},h=(e,t,a)=>(t,n)=>{const{fn:o}=e(),l=a(t,"root");class i extends s.Component{constructor(t,a){super(t,a),f(e,n,t,{})}UNSAFE_componentWillReceiveProps(t){f(e,n,t,this.props)}render(){const e=(0,c.default)(this.props,n?(0,r.default)(n):[]);return s.default.createElement(l,e)}}return i.displayName=`WithMappedContainer(${o.getDisplayName(l)})`,i},g=(e,t,a,n)=>r=>{const l=a(e,t,n)("App","root");o.default.render(s.default.createElement(l,null),r)},y=(e,t,a)=>function(n,r){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if("string"!=typeof n)throw new TypeError("Need a string, to fetch a component. Was given a "+typeof n);const o=a(n);return o?r?"root"===r?m(e,o,t()):m(e,o):o:(s.failSilently||e().log.warn("Could not find component:",n),null)}},4305:(e,t,a)=>{a.d(t,{d3:()=>s.default,C2:()=>b});var n=a(2740),r=a(2372);const s=(e=>{var t={};return a.d(t,e),t})({default:()=>N.default});const o=(e=>{var t={};return a.d(t,e),t})({default:()=>O.default});const l=(e=>{var t={};return a.d(t,e),t})({default:()=>k.default});const i=(e=>{var t={};return a.d(t,e),t})({default:()=>A.default});const c=(e=>{var t={};return a.d(t,e),t})({default:()=>I.default});const u=(e=>{var t={};return a.d(t,e),t})({default:()=>R.default});const d=(e=>{var t={};return a.d(t,e),t})({default:()=>P.default});const p=(e=>{var t={};return a.d(t,e),t})({default:()=>T.default});const m=(e=>{var t={};return a.d(t,e),t})({default:()=>M.default});const f=(e=>{var t={};return a.d(t,e),t})({default:()=>D.default});const h=(e=>{var t={};return a.d(t,e),t})({default:()=>L.default});const g=(e=>{var t={};return a.d(t,e),t})({default:()=>q.default});const y=(e=>{var t={};return a.d(t,e),t})({default:()=>B.default});const v=(e=>{var t={};return a.d(t,e),t})({default:()=>U.default});const E=(e=>{var t={};return a.d(t,e),t})({default:()=>J.default});s.default.registerLanguage("json",l.default),s.default.registerLanguage("js",o.default),s.default.registerLanguage("xml",i.default),s.default.registerLanguage("yaml",u.default),s.default.registerLanguage("http",d.default),s.default.registerLanguage("bash",c.default),s.default.registerLanguage("powershell",p.default),s.default.registerLanguage("javascript",o.default);const S={agate:m.default,arta:f.default,monokai:h.default,nord:g.default,obsidian:y.default,"tomorrow-night":v.default,idea:E.default},w=(0,n.default)(S),b=e=>(0,r.default)(w).call(w,e)?S[e]:(console.warn(`Request style '${e}' is not available, returning default instead`),m.default)},6561:(e,t,a)=>{a.d(t,{r3:()=>le,GZ:()=>ce,Xb:()=>_e,oJ:()=>fe,XV:()=>ve,iQ:()=>ee,J6:()=>he,DR:()=>ae,oG:()=>L,Uj:()=>xe,QG:()=>me,po:()=>ye,nX:()=>ge,gp:()=>te,kJ:()=>G,O2:()=>je,LQ:()=>B,Wl:()=>J,Kn:()=>U,HP:()=>Z,AF:()=>q,D$:()=>Se,Ay:()=>Y,Q2:()=>X,mz:()=>D,V9:()=>we,cz:()=>be,UG:()=>oe,Zl:()=>ne,hW:()=>pe,Nm:()=>de,be:()=>ue,wh:()=>ie,Pz:()=>Ee,_5:()=>Q,Ik:()=>se});var n=a(4163),r=a(2565),s=a(2954),o=a(29),l=a(6145),i=a(2740),c=(a(5527),a(6785)),u=a(7512),d=a(4350),p=(a(8136),a(5171),a(9963)),m=(a(2372),a(8818)),f=a(1778);const h=(e=>{var t={};return a.d(t,e),t})({default:()=>$.default});var g=a(5942),y=a(313),v=a(9725);const E=(e=>{var t={};return a.d(t,e),t})({sanitizeUrl:()=>V.sanitizeUrl});const S=(e=>{var t={};return a.d(t,e),t})({default:()=>K.default});const w=(e=>{var t={};return a.d(t,e),t})({default:()=>F.default});var b=a(5476);const x=(e=>{var t={};return a.d(t,e),t})({default:()=>z.default});a(841);const _=(e=>{var t={};return a.d(t,e),t})({default:()=>W.default});var C=a(7068),j=a(7504);const N=(e=>{var t={};return a.d(t,e),t})({default:()=>H.default});var O=a(9069),k=a(1798),A=a.n(k),I=a(9072),R=a.n(I),P=a(8764).Buffer;const T="default",M=e=>v.default.Iterable.isIterable(e);function D(e){return U(e)?M(e)?e.toJS():e:{}}function L(e){var t,a;if(M(e))return e;if(e instanceof j.Z.File)return e;if(!U(e))return e;if((0,n.default)(e))return(0,r.default)(a=v.default.Seq(e)).call(a,L).toList();if((0,C.default)((0,s.default)(e))){var o;const t=function(e){if(!(0,C.default)((0,s.default)(e)))return e;const t={},a="_**[]",n={};for(let r of(0,s.default)(e).call(e))if(t[r[0]]||n[r[0]]&&n[r[0]].containsMultiple){if(!n[r[0]]){n[r[0]]={containsMultiple:!0,length:1},t[`${r[0]}${a}${n[r[0]].length}`]=t[r[0]],delete t[r[0]]}n[r[0]].length+=1,t[`${r[0]}${a}${n[r[0]].length}`]=r[1]}else t[r[0]]=r[1];return t}(e);return(0,r.default)(o=v.default.OrderedMap(t)).call(o,L)}return(0,r.default)(t=v.default.OrderedMap(e)).call(t,L)}function q(e){return(0,n.default)(e)?e:[e]}function B(e){return"function"==typeof e}function U(e){return!!e&&"object"==typeof e}function J(e){return"function"==typeof e}function G(e){return(0,n.default)(e)}const Z=b.default;function Y(e,t){var a;return(0,c.default)(a=(0,i.default)(e)).call(a,((a,n)=>(a[n]=t(e[n],n),a)),{})}function X(e,t){var a;return(0,c.default)(a=(0,i.default)(e)).call(a,((a,n)=>{let r=t(e[n],n);return r&&"object"==typeof r&&(0,u.default)(a,r),a}),{})}function Q(e){return t=>{let{dispatch:a,getState:n}=t;return t=>a=>"function"==typeof a?a(e()):t(a)}}function ee(e){var t;let a=e.keySeq();return a.contains(T)?T:(0,d.default)(t=(0,l.default)(a).call(a,(e=>"2"===(e+"")[0]))).call(t).first()}function te(e,t){if(!v.default.Iterable.isIterable(e))return v.default.List();let a=e.getIn((0,n.default)(t)?t:[t]);return v.default.List.isList(a)?a:v.default.List()}function ae(e){let t,a=[/filename\*=[^']+'\w*'"([^"]+)";?/i,/filename\*=[^']+'\w*'([^;]+);?/i,/filename="([^;]*);?"/i,/filename=([^;]*);?/i];if((0,p.default)(a).call(a,(a=>(t=a.exec(e),null!==t))),null!==t&&t.length>1)try{return decodeURIComponent(t[1])}catch(e){console.error(e)}return null}function ne(e){return t=e.replace(/\.[^./]*$/,""),(0,w.default)((0,S.default)(t));var t}function re(e,t,a,s,i){if(!t)return[];let c=[],u=t.get("nullable"),d=t.get("required"),m=t.get("maximum"),f=t.get("minimum"),h=t.get("type"),g=t.get("format"),y=t.get("maxLength"),E=t.get("minLength"),S=t.get("uniqueItems"),w=t.get("maxItems"),b=t.get("minItems"),x=t.get("pattern");const _=a||!0===d,C=null!=e;if(u&&null===e||!h||!(_||C&&"array"===h||!(!_&&!C)))return[];let N="string"===h&&e,O="array"===h&&(0,n.default)(e)&&e.length,k="array"===h&&v.default.List.isList(e)&&e.count();const A=[N,O,k,"array"===h&&"string"==typeof e&&e,"file"===h&&e instanceof j.Z.File,"boolean"===h&&(e||!1===e),"number"===h&&(e||0===e),"integer"===h&&(e||0===e),"object"===h&&"object"==typeof e&&null!==e,"object"===h&&"string"==typeof e&&e],I=(0,p.default)(A).call(A,(e=>!!e));if(_&&!I&&!s)return c.push("Required field is not provided"),c;if("object"===h&&(null===i||"application/json"===i)){let a=e;if("string"==typeof e)try{a=JSON.parse(e)}catch(e){return c.push("Parameter string value must be valid JSON"),c}var R;if(t&&t.has("required")&&J(d.isList)&&d.isList()&&(0,o.default)(d).call(d,(e=>{void 0===a[e]&&c.push({propKey:e,error:"Required property not found"})})),t&&t.has("properties"))(0,o.default)(R=t.get("properties")).call(R,((e,t)=>{const n=re(a[t],e,!1,s,i);c.push(...(0,r.default)(n).call(n,(e=>({propKey:t,error:e}))))}))}if(x){let t=((e,t)=>{if(!new RegExp(t).test(e))return"Value must follow pattern "+t})(e,x);t&&c.push(t)}if(b&&"array"===h){let t=((e,t)=>{if(!e&&t>=1||e&&e.length{if(e&&e.length>t)return`Array must not contain more then ${t} item${1===t?"":"s"}`})(e,w);t&&c.push({needRemove:!0,error:t})}if(S&&"array"===h){let t=((e,t)=>{if(e&&("true"===t||!0===t)){const t=(0,v.fromJS)(e),a=t.toSet();if(e.length>a.size){let e=(0,v.Set)();if((0,o.default)(t).call(t,((a,n)=>{(0,l.default)(t).call(t,(e=>J(e.equals)?e.equals(a):e===a)).size>1&&(e=e.add(n))})),0!==e.size)return(0,r.default)(e).call(e,(e=>({index:e,error:"No duplicates allowed."}))).toArray()}}})(e,S);t&&c.push(...t)}if(y||0===y){let t=((e,t)=>{if(e.length>t)return`Value must be no longer than ${t} character${1!==t?"s":""}`})(e,y);t&&c.push(t)}if(E){let t=((e,t)=>{if(e.length{if(e>t)return`Value must be less than ${t}`})(e,m);t&&c.push(t)}if(f||0===f){let t=((e,t)=>{if(e{if(isNaN(Date.parse(e)))return"Value must be a DateTime"})(e):"uuid"===g?(e=>{if(e=e.toString().toLowerCase(),!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(e))return"Value must be a Guid"})(e):(e=>{if(e&&"string"!=typeof e)return"Value must be a string"})(e),!t)return c;c.push(t)}else if("boolean"===h){let t=(e=>{if("true"!==e&&"false"!==e&&!0!==e&&!1!==e)return"Value must be a boolean"})(e);if(!t)return c;c.push(t)}else if("number"===h){let t=(e=>{if(!/^-?\d+(\.?\d+)?$/.test(e))return"Value must be a number"})(e);if(!t)return c;c.push(t)}else if("integer"===h){let t=(e=>{if(!/^-?\d+$/.test(e))return"Value must be an integer"})(e);if(!t)return c;c.push(t)}else if("array"===h){if(!O&&!k)return c;e&&(0,o.default)(e).call(e,((e,a)=>{const n=re(e,t.get("items"),!1,s,i);c.push(...(0,r.default)(n).call(n,(e=>({index:a,error:e}))))}))}else if("file"===h){let t=(e=>{if(e&&!(e instanceof j.Z.File))return"Value must be a file"})(e);if(!t)return c;c.push(t)}return c}const se=function(e,t){let{isOAS3:a=!1,bypassRequiredCheck:n=!1}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=e.get("required"),{schema:s,parameterContentMediaType:o}=(0,O.Z)(e,{isOAS3:a});return re(t,s,r,n,o)},oe=()=>{let e={},t=j.Z.location.search;if(!t)return{};if(""!=t){let a=t.substr(1).split("&");for(let t in a)Object.prototype.hasOwnProperty.call(a,t)&&(t=a[t].split("="),e[decodeURIComponent(t[0])]=t[1]&&decodeURIComponent(t[1])||"")}return e},le=e=>{let t;return t=e instanceof P?e:P.from(e.toString(),"utf-8"),t.toString("base64")},ie={operationsSorter:{alpha:(e,t)=>e.get("path").localeCompare(t.get("path")),method:(e,t)=>e.get("method").localeCompare(t.get("method"))},tagsSorter:{alpha:(e,t)=>e.localeCompare(t)}},ce=e=>{let t=[];for(let a in e){let n=e[a];void 0!==n&&""!==n&&t.push([a,"=",encodeURIComponent(n).replace(/%20/g,"+")].join(""))}return t.join("&")},ue=(e,t,a)=>!!(0,x.default)(a,(a=>(0,_.default)(e[a],t[a])));function de(e){return"string"!=typeof e||""===e?"":(0,E.sanitizeUrl)(e)}function pe(e){return!(!e||(0,m.default)(e).call(e,"localhost")>=0||(0,m.default)(e).call(e,"127.0.0.1")>=0||"none"===e)}function me(e){if(!v.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;const t=(0,f.default)(e).call(e,((e,t)=>(0,h.default)(t).call(t,"2")&&(0,i.default)(e.get("content")||{}).length>0)),a=e.get("default")||v.default.OrderedMap(),n=(a.get("content")||v.default.OrderedMap()).keySeq().toJS().length?a:null;return t||n}const fe=e=>"string"==typeof e||e instanceof String?(0,g.default)(e).call(e).replace(/\s/g,"%20"):"",he=e=>(0,N.default)(fe(e).replace(/%20/g,"_")),ge=e=>(0,l.default)(e).call(e,((e,t)=>/^x-/.test(t))),ye=e=>(0,l.default)(e).call(e,((e,t)=>/^pattern|maxLength|minLength|maximum|minimum/.test(t)));function ve(e,t){var a;let r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>!0;if("object"!=typeof e||(0,n.default)(e)||null===e||!t)return e;const s=(0,u.default)({},e);return(0,o.default)(a=(0,i.default)(s)).call(a,(e=>{e===t&&r(s[e],e)?delete s[e]:s[e]=ve(s[e],t,r)})),s}function Ee(e){if("string"==typeof e)return e;if(e&&e.toJS&&(e=e.toJS()),"object"==typeof e&&null!==e)try{return(0,y.default)(e,null,2)}catch(t){return String(e)}return null==e?"":e.toString()}function Se(e){return"number"==typeof e?e.toString():e}function we(e){let{returnAll:t=!1,allowHashes:a=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!v.default.Map.isMap(e))throw new Error("paramToIdentifier: received a non-Im.Map parameter as input");const n=e.get("name"),r=e.get("in");let s=[];return e&&e.hashCode&&r&&n&&a&&s.push(`${r}.${n}.hash-${e.hashCode()}`),r&&n&&s.push(`${r}.${n}`),s.push(n),t?s:s[0]||""}function be(e,t){var a;const n=we(e,{returnAll:!0});return(0,l.default)(a=(0,r.default)(n).call(n,(e=>t[e]))).call(a,(e=>void 0!==e))[0]}function xe(){return Ce(A()(32).toString("base64"))}function _e(e){return Ce(R()("sha256").update(e).digest("base64"))}function Ce(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}const je=e=>!e||!(!M(e)||!e.isEmpty())},2518:(e,t,a)=>{function n(e){return function(e){try{return!!JSON.parse(e)}catch(e){return null}}(e)?"json":null}a.d(t,{O:()=>n})},3543:(e,t,a)=>{a.d(t,{mn:()=>o});var n=a(3769);function r(e){return e.match(/^(?:[a-z]+:)?\/\//i)}function s(e,t){return e?r(e)?(a=e).match(/^\/\//i)?`${window.location.protocol}${a}`:a:new n.default(e,t).href:t;var a}function o(e,t){let{selectedServer:a=""}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{return function(e,t){let{selectedServer:a=""}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!e)return;if(r(e))return e;const o=s(a,t);return r(o)?new n.default(e,o).href:new n.default(e,window.location.href).href}(e,t,{selectedServer:a})}catch{return}}},7504:(e,t,a)=>{a.d(t,{Z:()=>n});const n=function(){var e={location:{},history:{},open:()=>{},close:()=>{},File:function(){},FormData:function(){}};if("undefined"==typeof window)return e;try{e=window;for(var t of["File","Blob","FormData"])t in window&&(e[t]=window[t])}catch(e){console.error(e)}return e}()},9069:(e,t,a)=>{a.d(t,{Z:()=>l});var n=a(6145),r=a(2372),s=a(9725);const o=s.default.Set.of("type","format","items","default","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","maxItems","minItems","uniqueItems","enum","multipleOf");function l(e){let{isOAS3:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!s.default.Map.isMap(e))return{schema:s.default.Map(),parameterContentMediaType:null};if(!t)return"body"===e.get("in")?{schema:e.get("schema",s.default.Map()),parameterContentMediaType:null}:{schema:(0,n.default)(e).call(e,((e,t)=>(0,r.default)(o).call(o,t))),parameterContentMediaType:null};if(e.get("content")){const t=e.get("content",s.default.Map({})).keySeq().first();return{schema:e.getIn(["content",t,"schema"],s.default.Map()),parameterContentMediaType:t}}return{schema:e.get("schema")?e.get("schema",s.default.Map()):s.default.Map(),parameterContentMediaType:null}}},9669:(e,t,a)=>{a.d(t,{Z:()=>f});var n=a(4163),r=a(7930),s=a(8898),o=a(5487),l=a(1778);const i=(e=>{var t={};return a.d(t,e),t})({default:()=>G.default});var c=a(6914),u=a(5476);const d=e=>t=>(0,n.default)(e)&&(0,n.default)(t)&&e.length===t.length&&(0,r.default)(e).call(e,((e,a)=>e===t[a])),p=function(){for(var e=arguments.length,t=new Array(e),a=0;a1&&void 0!==arguments[1]?arguments[1]:p;const{Cache:a}=u.default;u.default.Cache=m;const n=(0,u.default)(e,t);return u.default.Cache=a,n}},8764:(e,t,a)=>{const n=a(4780),r=a(3294),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=i,t.SlowBuffer=function(e){+e!=e&&(e=0);return i.alloc(+e)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function l(e){if(e>o)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,i.prototype),t}function i(e,t,a){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,a)}function c(e,t,a){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!i.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const a=0|h(e,t);let n=l(a);const r=n.write(e,t);r!==a&&(n=n.slice(0,r));return n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(G(e,Uint8Array)){const t=new Uint8Array(e);return m(t.buffer,t.byteOffset,t.byteLength)}return p(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(G(e,ArrayBuffer)||e&&G(e.buffer,ArrayBuffer))return m(e,t,a);if("undefined"!=typeof SharedArrayBuffer&&(G(e,SharedArrayBuffer)||e&&G(e.buffer,SharedArrayBuffer)))return m(e,t,a);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return i.from(n,t,a);const r=function(e){if(i.isBuffer(e)){const t=0|f(e.length),a=l(t);return 0===a.length||e.copy(a,0,0,t),a}if(void 0!==e.length)return"number"!=typeof e.length||Z(e.length)?l(0):p(e);if("Buffer"===e.type&&Array.isArray(e.data))return p(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return i.from(e[Symbol.toPrimitive]("string"),t,a);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return u(e),l(e<0?0:0|f(e))}function p(e){const t=e.length<0?0:0|f(e.length),a=l(t);for(let n=0;n=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|e}function h(e,t){if(i.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||G(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const a=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===a)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return a;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*a;case"hex":return a>>>1;case"base64":return W(e).length;default:if(r)return n?-1:z(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,a){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===a||a>this.length)&&(a=this.length),a<=0)return"";if((a>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return A(this,t,a);case"utf8":case"utf-8":return j(this,t,a);case"ascii":return O(this,t,a);case"latin1":case"binary":return k(this,t,a);case"base64":return C(this,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,a);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function y(e,t,a){const n=e[t];e[t]=e[a],e[a]=n}function v(e,t,a,n,r){if(0===e.length)return-1;if("string"==typeof a?(n=a,a=0):a>2147483647?a=2147483647:a<-2147483648&&(a=-2147483648),Z(a=+a)&&(a=r?0:e.length-1),a<0&&(a=e.length+a),a>=e.length){if(r)return-1;a=e.length-1}else if(a<0){if(!r)return-1;a=0}if("string"==typeof t&&(t=i.from(t,n)),i.isBuffer(t))return 0===t.length?-1:E(e,t,a,n,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,a):Uint8Array.prototype.lastIndexOf.call(e,t,a):E(e,[t],a,n,r);throw new TypeError("val must be string, number or Buffer")}function E(e,t,a,n,r){let s,o=1,l=e.length,i=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,l/=2,i/=2,a/=2}function c(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(r){let n=-1;for(s=a;sl&&(a=l-i),s=a;s>=0;s--){let a=!0;for(let n=0;nr&&(n=r):n=r;const s=t.length;let o;for(n>s/2&&(n=s/2),o=0;o>8,r=a%256,s.push(r),s.push(n);return s}(t,e.length-a),e,a,n)}function C(e,t,a){return 0===t&&a===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,a))}function j(e,t,a){a=Math.min(e.length,a);const n=[];let r=t;for(;r239?4:t>223?3:t>191?2:1;if(r+o<=a){let a,n,l,i;switch(o){case 1:t<128&&(s=t);break;case 2:a=e[r+1],128==(192&a)&&(i=(31&t)<<6|63&a,i>127&&(s=i));break;case 3:a=e[r+1],n=e[r+2],128==(192&a)&&128==(192&n)&&(i=(15&t)<<12|(63&a)<<6|63&n,i>2047&&(i<55296||i>57343)&&(s=i));break;case 4:a=e[r+1],n=e[r+2],l=e[r+3],128==(192&a)&&128==(192&n)&&128==(192&l)&&(i=(15&t)<<18|(63&a)<<12|(63&n)<<6|63&l,i>65535&&i<1114112&&(s=i))}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),r+=o}return function(e){const t=e.length;if(t<=N)return String.fromCharCode.apply(String,e);let a="",n=0;for(;nn.length?(i.isBuffer(t)||(t=i.from(t)),t.copy(n,r)):Uint8Array.prototype.set.call(n,t,r);else{if(!i.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,r)}r+=t.length}return n},i.byteLength=h,i.prototype._isBuffer=!0,i.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;ta&&(e+=" ... "),""},s&&(i.prototype[s]=i.prototype.inspect),i.prototype.compare=function(e,t,a,n,r){if(G(e,Uint8Array)&&(e=i.from(e,e.offset,e.byteLength)),!i.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===a&&(a=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||a>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=a)return 0;if(n>=r)return-1;if(t>=a)return 1;if(this===e)return 0;let s=(r>>>=0)-(n>>>=0),o=(a>>>=0)-(t>>>=0);const l=Math.min(s,o),c=this.slice(n,r),u=e.slice(t,a);for(let e=0;e>>=0,isFinite(a)?(a>>>=0,void 0===n&&(n="utf8")):(n=a,a=void 0)}const r=this.length-t;if((void 0===a||a>r)&&(a=r),e.length>0&&(a<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return S(this,e,t,a);case"utf8":case"utf-8":return w(this,e,t,a);case"ascii":case"latin1":case"binary":return b(this,e,t,a);case"base64":return x(this,e,t,a);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,e,t,a);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},i.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const N=4096;function O(e,t,a){let n="";a=Math.min(e.length,a);for(let r=t;rn)&&(a=n);let r="";for(let n=t;na)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,a,n,r,s){if(!i.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||te.length)throw new RangeError("Index out of range")}function T(e,t,a,n,r){$(t,n,r,e,a,7);let s=Number(t&BigInt(4294967295));e[a++]=s,s>>=8,e[a++]=s,s>>=8,e[a++]=s,s>>=8,e[a++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[a++]=o,o>>=8,e[a++]=o,o>>=8,e[a++]=o,o>>=8,e[a++]=o,a}function M(e,t,a,n,r){$(t,n,r,e,a,7);let s=Number(t&BigInt(4294967295));e[a+7]=s,s>>=8,e[a+6]=s,s>>=8,e[a+5]=s,s>>=8,e[a+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[a+3]=o,o>>=8,e[a+2]=o,o>>=8,e[a+1]=o,o>>=8,e[a]=o,a+8}function D(e,t,a,n,r,s){if(a+n>e.length)throw new RangeError("Index out of range");if(a<0)throw new RangeError("Index out of range")}function L(e,t,a,n,s){return t=+t,a>>>=0,s||D(e,0,a,4),r.write(e,t,a,n,23,4),a+4}function q(e,t,a,n,s){return t=+t,a>>>=0,s||D(e,0,a,8),r.write(e,t,a,n,52,8),a+8}i.prototype.slice=function(e,t){const a=this.length;(e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t>>=0,t>>>=0,a||R(e,t,this.length);let n=this[e],r=1,s=0;for(;++s>>=0,t>>>=0,a||R(e,t,this.length);let n=this[e+--t],r=1;for(;t>0&&(r*=256);)n+=this[e+--t]*r;return n},i.prototype.readUint8=i.prototype.readUInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),this[e]},i.prototype.readUint16LE=i.prototype.readUInt16LE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]|this[e+1]<<8},i.prototype.readUint16BE=i.prototype.readUInt16BE=function(e,t){return e>>>=0,t||R(e,2,this.length),this[e]<<8|this[e+1]},i.prototype.readUint32LE=i.prototype.readUInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},i.prototype.readUint32BE=i.prototype.readUInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},i.prototype.readBigUInt64LE=X((function(e){V(e>>>=0,"offset");const t=this[e],a=this[e+7];void 0!==t&&void 0!==a||K(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,r=this[++e]+256*this[++e]+65536*this[++e]+a*2**24;return BigInt(n)+(BigInt(r)<>>=0,"offset");const t=this[e],a=this[e+7];void 0!==t&&void 0!==a||K(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],r=this[++e]*2**24+65536*this[++e]+256*this[++e]+a;return(BigInt(n)<>>=0,t>>>=0,a||R(e,t,this.length);let n=this[e],r=1,s=0;for(;++s=r&&(n-=Math.pow(2,8*t)),n},i.prototype.readIntBE=function(e,t,a){e>>>=0,t>>>=0,a||R(e,t,this.length);let n=t,r=1,s=this[e+--n];for(;n>0&&(r*=256);)s+=this[e+--n]*r;return r*=128,s>=r&&(s-=Math.pow(2,8*t)),s},i.prototype.readInt8=function(e,t){return e>>>=0,t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},i.prototype.readInt16LE=function(e,t){e>>>=0,t||R(e,2,this.length);const a=this[e]|this[e+1]<<8;return 32768&a?4294901760|a:a},i.prototype.readInt16BE=function(e,t){e>>>=0,t||R(e,2,this.length);const a=this[e+1]|this[e]<<8;return 32768&a?4294901760|a:a},i.prototype.readInt32LE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},i.prototype.readInt32BE=function(e,t){return e>>>=0,t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},i.prototype.readBigInt64LE=X((function(e){V(e>>>=0,"offset");const t=this[e],a=this[e+7];void 0!==t&&void 0!==a||K(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(a<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],a=this[e+7];void 0!==t&&void 0!==a||K(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||R(e,4,this.length),r.read(this,e,!0,23,4)},i.prototype.readFloatBE=function(e,t){return e>>>=0,t||R(e,4,this.length),r.read(this,e,!1,23,4)},i.prototype.readDoubleLE=function(e,t){return e>>>=0,t||R(e,8,this.length),r.read(this,e,!0,52,8)},i.prototype.readDoubleBE=function(e,t){return e>>>=0,t||R(e,8,this.length),r.read(this,e,!1,52,8)},i.prototype.writeUintLE=i.prototype.writeUIntLE=function(e,t,a,n){if(e=+e,t>>>=0,a>>>=0,!n){P(this,e,t,a,Math.pow(2,8*a)-1,0)}let r=1,s=0;for(this[t]=255&e;++s>>=0,a>>>=0,!n){P(this,e,t,a,Math.pow(2,8*a)-1,0)}let r=a-1,s=1;for(this[t+r]=255&e;--r>=0&&(s*=256);)this[t+r]=e/s&255;return t+a},i.prototype.writeUint8=i.prototype.writeUInt8=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,1,255,0),this[t]=255&e,t+1},i.prototype.writeUint16LE=i.prototype.writeUInt16LE=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeUint16BE=i.prototype.writeUInt16BE=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeUint32LE=i.prototype.writeUInt32LE=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},i.prototype.writeUint32BE=i.prototype.writeUInt32BE=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeBigUInt64LE=X((function(e,t=0){return T(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeBigUInt64BE=X((function(e,t=0){return M(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),i.prototype.writeIntLE=function(e,t,a,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*a-1);P(this,e,t,a,n-1,-n)}let r=0,s=1,o=0;for(this[t]=255&e;++r>0)-o&255;return t+a},i.prototype.writeIntBE=function(e,t,a,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*a-1);P(this,e,t,a,n-1,-n)}let r=a-1,s=1,o=0;for(this[t+r]=255&e;--r>=0&&(s*=256);)e<0&&0===o&&0!==this[t+r+1]&&(o=1),this[t+r]=(e/s>>0)-o&255;return t+a},i.prototype.writeInt8=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},i.prototype.writeInt16LE=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},i.prototype.writeInt16BE=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},i.prototype.writeInt32LE=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},i.prototype.writeInt32BE=function(e,t,a){return e=+e,t>>>=0,a||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},i.prototype.writeBigInt64LE=X((function(e,t=0){return T(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeBigInt64BE=X((function(e,t=0){return M(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),i.prototype.writeFloatLE=function(e,t,a){return L(this,e,t,!0,a)},i.prototype.writeFloatBE=function(e,t,a){return L(this,e,t,!1,a)},i.prototype.writeDoubleLE=function(e,t,a){return q(this,e,t,!0,a)},i.prototype.writeDoubleBE=function(e,t,a){return q(this,e,t,!1,a)},i.prototype.copy=function(e,t,a,n){if(!i.isBuffer(e))throw new TypeError("argument should be a Buffer");if(a||(a=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,a=void 0===a?this.length:a>>>0,e||(e=0),"number"==typeof e)for(r=t;r=n+4;a-=3)t=`_${e.slice(a-3,a)}${t}`;return`${e.slice(0,a)}${t}`}function $(e,t,a,n,r,s){if(e>a||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(s+1)}${n}`:`>= -(2${n} ** ${8*(s+1)-1}${n}) and < 2 ** ${8*(s+1)-1}${n}`:`>= ${t}${n} and <= ${a}${n}`,new B.ERR_OUT_OF_RANGE("value",r,e)}!function(e,t,a){V(t,"offset"),void 0!==e[t]&&void 0!==e[t+a]||K(t,e.length-(a+1))}(n,r,s)}function V(e,t){if("number"!=typeof e)throw new B.ERR_INVALID_ARG_TYPE(t,"number",e)}function K(e,t,a){if(Math.floor(e)!==e)throw V(e,a),new B.ERR_OUT_OF_RANGE(a||"offset","an integer",e);if(t<0)throw new B.ERR_BUFFER_OUT_OF_BOUNDS;throw new B.ERR_OUT_OF_RANGE(a||"offset",`>= ${a?1:0} and <= ${t}`,e)}U("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),U("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),U("ERR_OUT_OF_RANGE",(function(e,t,a){let n=`The value of "${e}" is out of range.`,r=a;return Number.isInteger(a)&&Math.abs(a)>2**32?r=J(String(a)):"bigint"==typeof a&&(r=String(a),(a>BigInt(2)**BigInt(32)||a<-(BigInt(2)**BigInt(32)))&&(r=J(r)),r+="n"),n+=` It must be ${t}. Received ${r}`,n}),RangeError);const F=/[^+/0-9A-Za-z-_]/g;function z(e,t){let a;t=t||1/0;const n=e.length;let r=null;const s=[];for(let o=0;o55295&&a<57344){if(!r){if(a>56319){(t-=3)>-1&&s.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}r=a;continue}if(a<56320){(t-=3)>-1&&s.push(239,191,189),r=a;continue}a=65536+(r-55296<<10|a-56320)}else r&&(t-=3)>-1&&s.push(239,191,189);if(r=null,a<128){if((t-=1)<0)break;s.push(a)}else if(a<2048){if((t-=2)<0)break;s.push(a>>6|192,63&a|128)}else if(a<65536){if((t-=3)<0)break;s.push(a>>12|224,a>>6&63|128,63&a|128)}else{if(!(a<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;s.push(a>>18|240,a>>12&63|128,a>>6&63|128,63&a|128)}}return s}function W(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function H(e,t,a,n){let r;for(r=0;r=t.length||r>=e.length);++r)t[r+a]=e[r];return r}function G(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Z(e){return e!=e}const Y=function(){const e="0123456789abcdef",t=new Array(256);for(let a=0;a<16;++a){const n=16*a;for(let r=0;r<16;++r)t[n+r]=e[a]+e[r]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},8171:(e,t,a)=>{a(6450);var n=a(4058).Object,r=e.exports=function(e,t,a){return n.defineProperty(e,t,a)};n.defineProperty.sham&&(r.sham=!0)},4883:(e,t,a)=>{var n=a(7475),r=a(9826),s=TypeError;e.exports=function(e){if(n(e))return e;throw s(r(e)+" is not a function")}},6059:(e,t,a)=>{var n=a(941),r=String,s=TypeError;e.exports=function(e){if(n(e))return e;throw s(r(e)+" is not an object")}},2532:(e,t,a)=>{var n=a(5329),r=n({}.toString),s=n("".slice);e.exports=function(e){return s(r(e),8,-1)}},2029:(e,t,a)=>{var n=a(5746),r=a(5988),s=a(1887);e.exports=n?function(e,t,a){return r.f(e,t,s(1,a))}:function(e,t,a){return e[t]=a,e}},1887:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},5609:(e,t,a)=>{var n=a(1899),r=Object.defineProperty;e.exports=function(e,t){try{r(n,e,{value:t,configurable:!0,writable:!0})}catch(a){n[e]=t}return t}},5746:(e,t,a)=>{var n=a(5981);e.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},6616:e=>{var t="object"==typeof document&&document.all,a=void 0===t&&void 0!==t;e.exports={all:t,IS_HTMLDDA:a}},1333:(e,t,a)=>{var n=a(1899),r=a(941),s=n.document,o=r(s)&&r(s.createElement);e.exports=function(e){return o?s.createElement(e):{}}},2861:e=>{e.exports="undefined"!=typeof navigator&&String(navigator.userAgent)||""},3385:(e,t,a)=>{var n,r,s=a(1899),o=a(2861),l=s.process,i=s.Deno,c=l&&l.versions||i&&i.version,u=c&&c.v8;u&&(r=(n=u.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!r&&o&&(!(n=o.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=o.match(/Chrome\/(\d+)/))&&(r=+n[1]),e.exports=r},6887:(e,t,a)=>{var n=a(1899),r=a(9730),s=a(7484),o=a(7475),l=a(9677).f,i=a(7252),c=a(4058),u=a(6843),d=a(2029),p=a(953),m=function(e){var t=function(a,n,s){if(this instanceof t){switch(arguments.length){case 0:return new e;case 1:return new e(a);case 2:return new e(a,n)}return new e(a,n,s)}return r(e,this,arguments)};return t.prototype=e.prototype,t};e.exports=function(e,t){var a,r,f,h,g,y,v,E,S,w=e.target,b=e.global,x=e.stat,_=e.proto,C=b?n:x?n[w]:(n[w]||{}).prototype,j=b?c:c[w]||d(c,w,{})[w],N=j.prototype;for(h in t)r=!(a=i(b?h:w+(x?".":"#")+h,e.forced))&&C&&p(C,h),y=j[h],r&&(v=e.dontCallGetSet?(S=l(C,h))&&S.value:C[h]),g=r&&v?v:t[h],r&&typeof y==typeof g||(E=e.bind&&r?u(g,n):e.wrap&&r?m(g):_&&o(g)?s(g):g,(e.sham||g&&g.sham||y&&y.sham)&&d(E,"sham",!0),d(j,h,E),_&&(p(c,f=w+"Prototype")||d(c,f,{}),d(c[f],h,g),e.real&&N&&(a||!N[h])&&d(N,h,g)))}},5981:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},9730:(e,t,a)=>{var n=a(8285),r=Function.prototype,s=r.apply,o=r.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?o.bind(s):function(){return o.apply(s,arguments)})},6843:(e,t,a)=>{var n=a(7484),r=a(4883),s=a(8285),o=n(n.bind);e.exports=function(e,t){return r(e),void 0===t?e:s?o(e,t):function(){return e.apply(t,arguments)}}},8285:(e,t,a)=>{var n=a(5981);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},8834:(e,t,a)=>{var n=a(8285),r=Function.prototype.call;e.exports=n?r.bind(r):function(){return r.apply(r,arguments)}},7484:(e,t,a)=>{var n=a(2532),r=a(5329);e.exports=function(e){if("Function"===n(e))return r(e)}},5329:(e,t,a)=>{var n=a(8285),r=Function.prototype,s=r.call,o=n&&r.bind.bind(s,s);e.exports=n?o:function(e){return function(){return s.apply(e,arguments)}}},626:(e,t,a)=>{var n=a(4058),r=a(1899),s=a(7475),o=function(e){return s(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e])||o(r[e]):n[e]&&n[e][t]||r[e]&&r[e][t]}},4229:(e,t,a)=>{var n=a(4883),r=a(2119);e.exports=function(e,t){var a=e[t];return r(a)?void 0:n(a)}},1899:function(e,t,a){var n=function(e){return e&&e.Math==Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof a.g&&a.g)||function(){return this}()||this||Function("return this")()},953:(e,t,a)=>{var n=a(5329),r=a(9678),s=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return s(r(e),t)}},2840:(e,t,a)=>{var n=a(5746),r=a(5981),s=a(1333);e.exports=!n&&!r((function(){return 7!=Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},7026:(e,t,a)=>{var n=a(5329),r=a(5981),s=a(2532),o=Object,l=n("".split);e.exports=r((function(){return!o("z").propertyIsEnumerable(0)}))?function(e){return"String"==s(e)?l(e,""):o(e)}:o},7475:(e,t,a)=>{var n=a(6616),r=n.all;e.exports=n.IS_HTMLDDA?function(e){return"function"==typeof e||e===r}:function(e){return"function"==typeof e}},7252:(e,t,a)=>{var n=a(5981),r=a(7475),s=/#|\.prototype\./,o=function(e,t){var a=i[l(e)];return a==u||a!=c&&(r(t)?n(t):!!t)},l=o.normalize=function(e){return String(e).replace(s,".").toLowerCase()},i=o.data={},c=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},2119:e=>{e.exports=function(e){return null==e}},941:(e,t,a)=>{var n=a(7475),r=a(6616),s=r.all;e.exports=r.IS_HTMLDDA?function(e){return"object"==typeof e?null!==e:n(e)||e===s}:function(e){return"object"==typeof e?null!==e:n(e)}},2529:e=>{e.exports=!0},6664:(e,t,a)=>{var n=a(626),r=a(7475),s=a(7046),o=a(2302),l=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return r(t)&&s(t.prototype,l(e))}},5988:(e,t,a)=>{var n=a(5746),r=a(2840),s=a(3937),o=a(6059),l=a(3894),i=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",p="configurable",m="writable";t.f=n?s?function(e,t,a){if(o(e),t=l(t),o(a),"function"==typeof e&&"prototype"===t&&"value"in a&&m in a&&!a[m]){var n=u(e,t);n&&n[m]&&(e[t]=a.value,a={configurable:p in a?a[p]:n[p],enumerable:d in a?a[d]:n[d],writable:!1})}return c(e,t,a)}:c:function(e,t,a){if(o(e),t=l(t),o(a),r)try{return c(e,t,a)}catch(e){}if("get"in a||"set"in a)throw i("Accessors not supported");return"value"in a&&(e[t]=a.value),e}},9677:(e,t,a)=>{var n=a(5746),r=a(8834),s=a(6760),o=a(1887),l=a(4529),i=a(3894),c=a(953),u=a(2840),d=Object.getOwnPropertyDescriptor;t.f=n?d:function(e,t){if(e=l(e),t=i(t),u)try{return d(e,t)}catch(e){}if(c(e,t))return o(!r(s.f,e,t),e[t])}},7046:(e,t,a)=>{var n=a(5329);e.exports=n({}.isPrototypeOf)},6760:(e,t)=>{var a={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,r=n&&!a.call({1:2},1);t.f=r?function(e){var t=n(this,e);return!!t&&t.enumerable}:a},9811:(e,t,a)=>{var n=a(8834),r=a(7475),s=a(941),o=TypeError;e.exports=function(e,t){var a,l;if("string"===t&&r(a=e.toString)&&!s(l=n(a,e)))return l;if(r(a=e.valueOf)&&!s(l=n(a,e)))return l;if("string"!==t&&r(a=e.toString)&&!s(l=n(a,e)))return l;throw o("Can't convert object to primitive value")}},4058:e=>{e.exports={}},8219:(e,t,a)=>{var n=a(2119),r=TypeError;e.exports=function(e){if(n(e))throw r("Can't call method on "+e);return e}},3030:(e,t,a)=>{var n=a(1899),r=a(5609),s="__core-js_shared__",o=n[s]||r(s,{});e.exports=o},8726:(e,t,a)=>{var n=a(2529),r=a(3030);(e.exports=function(e,t){return r[e]||(r[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.31.1",mode:n?"pure":"global",copyright:"© 2014-2023 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.31.1/LICENSE",source:"https://github.com/zloirock/core-js"})},3405:(e,t,a)=>{var n=a(3385),r=a(5981),s=a(1899).String;e.exports=!!Object.getOwnPropertySymbols&&!r((function(){var e=Symbol();return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4529:(e,t,a)=>{var n=a(7026),r=a(8219);e.exports=function(e){return n(r(e))}},9678:(e,t,a)=>{var n=a(8219),r=Object;e.exports=function(e){return r(n(e))}},6935:(e,t,a)=>{var n=a(8834),r=a(941),s=a(6664),o=a(4229),l=a(9811),i=a(9813),c=TypeError,u=i("toPrimitive");e.exports=function(e,t){if(!r(e)||s(e))return e;var a,i=o(e,u);if(i){if(void 0===t&&(t="default"),a=n(i,e,t),!r(a)||s(a))return a;throw c("Can't convert object to primitive value")}return void 0===t&&(t="number"),l(e,t)}},3894:(e,t,a)=>{var n=a(6935),r=a(6664);e.exports=function(e){var t=n(e,"string");return r(t)?t:t+""}},9826:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},9418:(e,t,a)=>{var n=a(5329),r=0,s=Math.random(),o=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++r+s,36)}},2302:(e,t,a)=>{var n=a(3405);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},3937:(e,t,a)=>{var n=a(5746),r=a(5981);e.exports=n&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},9813:(e,t,a)=>{var n=a(1899),r=a(8726),s=a(953),o=a(9418),l=a(3405),i=a(2302),c=n.Symbol,u=r("wks"),d=i?c.for||c:c&&c.withoutSetter||o;e.exports=function(e){return s(u,e)||(u[e]=l&&s(c,e)?c[e]:d("Symbol."+e)),u[e]}},6450:(e,t,a)=>{var n=a(6887),r=a(5746),s=a(5988).f;n({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!r},{defineProperty:s})},1910:(e,t,a)=>{var n=a(8171);e.exports=n},7698:(e,t,a)=>{var n=a(8764).Buffer;function r(e){return e instanceof n||e instanceof Date||e instanceof RegExp}function s(e){if(e instanceof n){var t=n.alloc?n.alloc(e.length):new n(e.length);return e.copy(t),t}if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e);throw new Error("Unexpected situation")}function o(e){var t=[];return e.forEach((function(e,a){"object"==typeof e&&null!==e?Array.isArray(e)?t[a]=o(e):r(e)?t[a]=s(e):t[a]=i({},e):t[a]=e})),t}function l(e,t){return"__proto__"===t?void 0:e[t]}var i=e.exports=function(){if(arguments.length<1||"object"!=typeof arguments[0])return!1;if(arguments.length<2)return arguments[0];var e,t,a=arguments[0];return Array.prototype.slice.call(arguments,1).forEach((function(n){"object"!=typeof n||null===n||Array.isArray(n)||Object.keys(n).forEach((function(c){return t=l(a,c),(e=l(n,c))===a?void 0:"object"!=typeof e||null===e?void(a[c]=e):Array.isArray(e)?void(a[c]=o(e)):r(e)?void(a[c]=s(e)):"object"!=typeof t||null===t||Array.isArray(t)?void(a[c]=i({},e)):void(a[c]=i(t,e))}))})),a}},7187:e=>{var t,a="object"==typeof Reflect?Reflect:null,n=a&&"function"==typeof a.apply?a.apply:function(e,t,a){return Function.prototype.apply.call(e,t,a)};t=a&&"function"==typeof a.ownKeys?a.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var r=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=function(e,t){return new Promise((function(a,n){function r(a){e.removeListener(t,s),n(a)}function s(){"function"==typeof e.removeListener&&e.removeListener("error",r),a([].slice.call(arguments))}h(e,t,s,{once:!0}),"error"!==t&&function(e,t,a){"function"==typeof e.on&&h(e,"error",t,a)}(e,r,{once:!0})}))},s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var o=10;function l(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function i(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function c(e,t,a,n){var r,s,o,c;if(l(a),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,a.listener?a.listener:a),s=e._events),o=s[t]),void 0===o)o=s[t]=a,++e._eventsCount;else if("function"==typeof o?o=s[t]=n?[a,o]:[o,a]:n?o.unshift(a):o.push(a),(r=i(e))>0&&o.length>r&&!o.warned){o.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,c=u,console&&console.warn&&console.warn(c)}return e}function u(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,a){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:a},r=u.bind(n);return r.listener=a,n.wrapFn=r,r}function p(e,t,a){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?a?[r.listener||r]:[r]:a?function(e){for(var t=new Array(e.length),a=0;a0&&(o=t[0]),o instanceof Error)throw o;var l=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw l.context=o,l}var i=s[e];if(void 0===i)return!1;if("function"==typeof i)n(i,this,t);else{var c=i.length,u=f(i,c);for(a=0;a=0;s--)if(a[s]===t||a[s].listener===t){o=a[s].listener,r=s;break}if(r<0)return this;0===r?a.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return p(this,e,!0)},s.prototype.rawListeners=function(e){return p(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):m.call(e,t)},s.prototype.listenerCount=m,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},5717:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var a=function(){};a.prototype=t.prototype,e.prototype=new a,e.prototype.constructor=e}}},4155:e=>{var t,a,n=e.exports={};function r(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function o(e){if(t===setTimeout)return setTimeout(e,0);if((t===r||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(a){try{return t.call(null,e,0)}catch(a){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:r}catch(e){t=r}try{a="function"==typeof clearTimeout?clearTimeout:s}catch(e){a=s}}();var l,i=[],c=!1,u=-1;function d(){c&&l&&(c=!1,l.length?i=l.concat(i):u=-1,i.length&&p())}function p(){if(!c){var e=o(d);c=!0;for(var t=i.length;t;){for(l=i,i=[];++u1)for(var a=1;a{var n=a(4155),r=65536,s=4294967295;var o=a(9509).Buffer,l=a.g.crypto||a.g.msCrypto;l&&l.getRandomValues?e.exports=function(e,t){if(e>s)throw new RangeError("requested too many random bytes");var a=o.allocUnsafe(e);if(e>0)if(e>r)for(var i=0;i{var t={};function a(e,a,n){n||(n=Error);var r=function(e){var t,n;function r(t,n,r){return e.call(this,function(e,t,n){return"string"==typeof a?a:a(e,t,n)}(t,n,r))||this}return n=e,(t=r).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,r}(n);r.prototype.name=n.name,r.prototype.code=e,t[e]=r}function n(e,t){if(Array.isArray(e)){var a=e.length;return e=e.map((function(e){return String(e)})),a>2?"one of ".concat(t," ").concat(e.slice(0,a-1).join(", "),", or ")+e[a-1]:2===a?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}a("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),a("ERR_INVALID_ARG_TYPE",(function(e,t,a){var r,s,o,l;if("string"==typeof t&&(s="not ",t.substr(!o||o<0?0:+o,s.length)===s)?(r="must not be",t=t.replace(/^not /,"")):r="must be",function(e,t,a){return(void 0===a||a>e.length)&&(a=e.length),e.substring(a-t.length,a)===t}(e," argument"))l="The ".concat(e," ").concat(r," ").concat(n(t,"type"));else{var i=function(e,t,a){return"number"!=typeof a&&(a=0),!(a+t.length>e.length)&&-1!==e.indexOf(t,a)}(e,".")?"property":"argument";l='The "'.concat(e,'" ').concat(i," ").concat(r," ").concat(n(t,"type"))}return l+=". Received type ".concat(typeof a)}),TypeError),a("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),a("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),a("ERR_STREAM_PREMATURE_CLOSE","Premature close"),a("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),a("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),a("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),a("ERR_STREAM_WRITE_AFTER_END","write after end"),a("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),a("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),a("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},6753:(e,t,a)=>{var n=a(4155),r=Object.keys||function(e){var t=[];for(var a in e)t.push(a);return t};e.exports=u;var s=a(9481),o=a(3982);a(5717)(u,s);for(var l=r(o.prototype),i=0;i{e.exports=r;var n=a(4605);function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}a(5717)(r,n),r.prototype._transform=function(e,t,a){a(null,e)}},9481:(e,t,a)=>{var n,r=a(4155);e.exports=C,C.ReadableState=_;a(7187).EventEmitter;var s=function(e,t){return e.listeners(t).length},o=a(2503),l=a(8764).Buffer,i=(void 0!==a.g?a.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var c,u=a(4616);c=u&&u.debuglog?u.debuglog("stream"):function(){};var d,p,m,f=a(7327),h=a(1195),g=a(2457).getHighWaterMark,y=a(4281).q,v=y.ERR_INVALID_ARG_TYPE,E=y.ERR_STREAM_PUSH_AFTER_EOF,S=y.ERR_METHOD_NOT_IMPLEMENTED,w=y.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;a(5717)(C,o);var b=h.errorOrDestroy,x=["error","close","destroy","pause","resume"];function _(e,t,r){n=n||a(6753),e=e||{},"boolean"!=typeof r&&(r=t instanceof n),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",r),this.buffer=new f,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(d||(d=a(2553).s),this.decoder=new d(e.encoding),this.encoding=e.encoding)}function C(e){if(n=n||a(6753),!(this instanceof C))return new C(e);var t=this instanceof n;this._readableState=new _(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function j(e,t,a,n,r){c("readableAddChunk",t);var s,o=e._readableState;if(null===t)o.reading=!1,function(e,t){if(c("onEofChunk"),t.ended)return;if(t.decoder){var a=t.decoder.end();a&&a.length&&(t.buffer.push(a),t.length+=t.objectMode?1:a.length)}t.ended=!0,t.sync?A(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,I(e)))}(e,o);else if(r||(s=function(e,t){var a;n=t,l.isBuffer(n)||n instanceof i||"string"==typeof t||void 0===t||e.objectMode||(a=new v("chunk",["string","Buffer","Uint8Array"],t));var n;return a}(o,t)),s)b(e,s);else if(o.objectMode||t&&t.length>0)if("string"==typeof t||o.objectMode||Object.getPrototypeOf(t)===l.prototype||(t=function(e){return l.from(e)}(t)),n)o.endEmitted?b(e,new w):N(e,o,t,!0);else if(o.ended)b(e,new E);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!a?(t=o.decoder.write(t),o.objectMode||0!==t.length?N(e,o,t,!1):R(e,o)):N(e,o,t,!1)}else n||(o.reading=!1,R(e,o));return!o.ended&&(o.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=O?e=O:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function A(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,r.nextTick(I,e))}function I(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,L(e)}function R(e,t){t.readingMore||(t.readingMore=!0,r.nextTick(P,e,t))}function P(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function M(e){c("readable nexttick read 0"),e.read(0)}function D(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),L(e),t.flowing&&!t.reading&&e.read(0)}function L(e){var t=e._readableState;for(c("flow",t.flowing);t.flowing&&null!==e.read(););}function q(e,t){return 0===t.length?null:(t.objectMode?a=t.buffer.shift():!e||e>=t.length?(a=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):a=t.buffer.consume(e,t.decoder),a);var a}function B(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,r.nextTick(U,t,e))}function U(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var a=t._writableState;(!a||a.autoDestroy&&a.finished)&&t.destroy()}}function J(e,t){for(var a=0,n=e.length;a=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?B(this):A(this),null;if(0===(e=k(e,t))&&t.ended)return 0===t.length&&B(this),null;var n,r=t.needReadable;return c("need readable",r),(0===t.length||t.length-e0?q(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),a!==e&&t.ended&&B(this)),null!==n&&this.emit("data",n),n},C.prototype._read=function(e){b(this,new S("_read()"))},C.prototype.pipe=function(e,t){var a=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==r.stdout&&e!==r.stderr?i:g;function l(t,r){c("onunpipe"),t===a&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),e.removeListener("close",f),e.removeListener("finish",h),e.removeListener("drain",u),e.removeListener("error",m),e.removeListener("unpipe",l),a.removeListener("end",i),a.removeListener("end",g),a.removeListener("data",p),d=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||u())}function i(){c("onend"),e.end()}n.endEmitted?r.nextTick(o):a.once("end",o),e.on("unpipe",l);var u=function(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,L(e))}}(a);e.on("drain",u);var d=!1;function p(t){c("ondata");var r=e.write(t);c("dest.write",r),!1===r&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==J(n.pipes,e))&&!d&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),a.pause())}function m(t){c("onerror",t),g(),e.removeListener("error",m),0===s(e,"error")&&b(e,t)}function f(){e.removeListener("finish",h),g()}function h(){c("onfinish"),e.removeListener("close",f),g()}function g(){c("unpipe"),a.unpipe(e)}return a.on("data",p),function(e,t,a){if("function"==typeof e.prependListener)return e.prependListener(t,a);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(a):e._events[t]=[a,e._events[t]]:e.on(t,a)}(e,"error",m),e.once("close",f),e.once("finish",h),e.emit("pipe",a),n.flowing||(c("pipe resume"),a.resume()),e},C.prototype.unpipe=function(e){var t=this._readableState,a={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,a)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?A(this):n.reading||r.nextTick(M,this))),a},C.prototype.addListener=C.prototype.on,C.prototype.removeListener=function(e,t){var a=o.prototype.removeListener.call(this,e,t);return"readable"===e&&r.nextTick(T,this),a},C.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||r.nextTick(T,this),t},C.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,r.nextTick(D,e,t))}(this,e)),e.paused=!1,this},C.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},C.prototype.wrap=function(e){var t=this,a=this._readableState,n=!1;for(var r in e.on("end",(function(){if(c("wrapped end"),a.decoder&&!a.ended){var e=a.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(r){(c("wrapped data"),a.decoder&&(r=a.decoder.write(r)),a.objectMode&&null==r)||(a.objectMode||r&&r.length)&&(t.push(r)||(n=!0,e.pause()))})),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var s=0;s{e.exports=u;var n=a(4281).q,r=n.ERR_METHOD_NOT_IMPLEMENTED,s=n.ERR_MULTIPLE_CALLBACK,o=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,l=n.ERR_TRANSFORM_WITH_LENGTH_0,i=a(6753);function c(e,t){var a=this._transformState;a.transforming=!1;var n=a.writecb;if(null===n)return this.emit("error",new s);a.writechunk=null,a.writecb=null,null!=t&&this.push(t),n(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length{var n,r=a(4155);function s(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,a){var n=e.entry;e.entry=null;for(;n;){var r=n.callback;t.pendingcb--,r(a),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=C,C.WritableState=_;var o={deprecate:a(4927)},l=a(2503),i=a(8764).Buffer,c=(void 0!==a.g?a.g:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var u,d=a(1195),p=a(2457).getHighWaterMark,m=a(4281).q,f=m.ERR_INVALID_ARG_TYPE,h=m.ERR_METHOD_NOT_IMPLEMENTED,g=m.ERR_MULTIPLE_CALLBACK,y=m.ERR_STREAM_CANNOT_PIPE,v=m.ERR_STREAM_DESTROYED,E=m.ERR_STREAM_NULL_VALUES,S=m.ERR_STREAM_WRITE_AFTER_END,w=m.ERR_UNKNOWN_ENCODING,b=d.errorOrDestroy;function x(){}function _(e,t,o){n=n||a(6753),e=e||{},"boolean"!=typeof o&&(o=t instanceof n),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=p(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var l=!1===e.decodeStrings;this.decodeStrings=!l,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var a=e._writableState,n=a.sync,s=a.writecb;if("function"!=typeof s)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(a),t)!function(e,t,a,n,s){--t.pendingcb,a?(r.nextTick(s,n),r.nextTick(I,e,t),e._writableState.errorEmitted=!0,b(e,n)):(s(n),e._writableState.errorEmitted=!0,b(e,n),I(e,t))}(e,a,n,t,s);else{var o=k(a)||e.destroyed;o||a.corked||a.bufferProcessing||!a.bufferedRequest||O(e,a),n?r.nextTick(N,e,a,o,s):N(e,a,o,s)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}function C(e){var t=this instanceof(n=n||a(6753));if(!t&&!u.call(C,this))return new C(e);this._writableState=new _(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),l.call(this)}function j(e,t,a,n,r,s,o){t.writelen=n,t.writecb=o,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):a?e._writev(r,t.onwrite):e._write(r,s,t.onwrite),t.sync=!1}function N(e,t,a,n){a||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),I(e,t)}function O(e,t){t.bufferProcessing=!0;var a=t.bufferedRequest;if(e._writev&&a&&a.next){var n=t.bufferedRequestCount,r=new Array(n),o=t.corkedRequestsFree;o.entry=a;for(var l=0,i=!0;a;)r[l]=a,a.isBuf||(i=!1),a=a.next,l+=1;r.allBuffers=i,j(e,t,!0,t.length,r,"",o.finish),t.pendingcb++,t.lastBufferedRequest=null,o.next?(t.corkedRequestsFree=o.next,o.next=null):t.corkedRequestsFree=new s(t),t.bufferedRequestCount=0}else{for(;a;){var c=a.chunk,u=a.encoding,d=a.callback;if(j(e,t,!1,t.objectMode?1:c.length,c,u,d),a=a.next,t.bufferedRequestCount--,t.writing)break}null===a&&(t.lastBufferedRequest=null)}t.bufferedRequest=a,t.bufferProcessing=!1}function k(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function A(e,t){e._final((function(a){t.pendingcb--,a&&b(e,a),t.prefinished=!0,e.emit("prefinish"),I(e,t)}))}function I(e,t){var a=k(t);if(a&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,r.nextTick(A,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return a}a(5717)(C,l),_.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(_.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(C,Symbol.hasInstance,{value:function(e){return!!u.call(this,e)||this===C&&(e&&e._writableState instanceof _)}})):u=function(e){return e instanceof this},C.prototype.pipe=function(){b(this,new y)},C.prototype.write=function(e,t,a){var n,s=this._writableState,o=!1,l=!s.objectMode&&(n=e,i.isBuffer(n)||n instanceof c);return l&&!i.isBuffer(e)&&(e=function(e){return i.from(e)}(e)),"function"==typeof t&&(a=t,t=null),l?t="buffer":t||(t=s.defaultEncoding),"function"!=typeof a&&(a=x),s.ending?function(e,t){var a=new S;b(e,a),r.nextTick(t,a)}(this,a):(l||function(e,t,a,n){var s;return null===a?s=new E:"string"==typeof a||t.objectMode||(s=new f("chunk",["string","Buffer"],a)),!s||(b(e,s),r.nextTick(n,s),!1)}(this,s,e,a))&&(s.pendingcb++,o=function(e,t,a,n,r,s){if(!a){var o=function(e,t,a){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=i.from(t,a));return t}(t,n,r);n!==o&&(a=!0,r="buffer",n=o)}var l=t.objectMode?1:n.length;t.length+=l;var c=t.length-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(C.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(C.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),C.prototype._write=function(e,t,a){a(new h("_write()"))},C.prototype._writev=null,C.prototype.end=function(e,t,a){var n=this._writableState;return"function"==typeof e?(a=e,e=null,t=null):"function"==typeof t&&(a=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,a){t.ending=!0,I(e,t),a&&(t.finished?r.nextTick(a):e.once("finish",a));t.ended=!0,e.writable=!1}(this,n,a),this},Object.defineProperty(C.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(C.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),C.prototype.destroy=d.destroy,C.prototype._undestroy=d.undestroy,C.prototype._destroy=function(e,t){t(e)}},5850:(e,t,a)=>{var n,r=a(4155);function s(e,t,a){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var a=e[Symbol.toPrimitive];if(void 0!==a){var n=a.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}var o=a(8610),l=Symbol("lastResolve"),i=Symbol("lastReject"),c=Symbol("error"),u=Symbol("ended"),d=Symbol("lastPromise"),p=Symbol("handlePromise"),m=Symbol("stream");function f(e,t){return{value:e,done:t}}function h(e){var t=e[l];if(null!==t){var a=e[m].read();null!==a&&(e[d]=null,e[l]=null,e[i]=null,t(f(a,!1)))}}function g(e){r.nextTick(h,e)}var y=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((s(n={get stream(){return this[m]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[u])return Promise.resolve(f(void 0,!0));if(this[m].destroyed)return new Promise((function(t,a){r.nextTick((function(){e[c]?a(e[c]):t(f(void 0,!0))}))}));var a,n=this[d];if(n)a=new Promise(function(e,t){return function(a,n){e.then((function(){t[u]?a(f(void 0,!0)):t[p](a,n)}),n)}}(n,this));else{var s=this[m].read();if(null!==s)return Promise.resolve(f(s,!1));a=new Promise(this[p])}return this[d]=a,a}},Symbol.asyncIterator,(function(){return this})),s(n,"return",(function(){var e=this;return new Promise((function(t,a){e[m].destroy(null,(function(e){e?a(e):t(f(void 0,!0))}))}))})),n),y);e.exports=function(e){var t,a=Object.create(v,(s(t={},m,{value:e,writable:!0}),s(t,l,{value:null,writable:!0}),s(t,i,{value:null,writable:!0}),s(t,c,{value:null,writable:!0}),s(t,u,{value:e._readableState.endEmitted,writable:!0}),s(t,p,{value:function(e,t){var n=a[m].read();n?(a[d]=null,a[l]=null,a[i]=null,e(f(n,!1))):(a[l]=e,a[i]=t)},writable:!0}),t));return a[d]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=a[i];return null!==t&&(a[d]=null,a[l]=null,a[i]=null,t(e)),void(a[c]=e)}var n=a[l];null!==n&&(a[d]=null,a[l]=null,a[i]=null,n(f(void 0,!0))),a[u]=!0})),e.on("readable",g.bind(null,a)),a}},7327:(e,t,a)=>{function n(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,n)}return a}function r(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,a=""+t.data;t=t.next;)a+=e+t.data;return a}},{key:"concat",value:function(e){if(0===this.length)return i.alloc(0);for(var t,a,n,r=i.allocUnsafe(e>>>0),s=this.head,o=0;s;)t=s.data,a=r,n=o,i.prototype.copy.call(t,a,n),o+=s.data.length,s=s.next;return r}},{key:"consume",value:function(e,t){var a;return er.length?r.length:e;if(s===r.length?n+=r:n+=r.slice(0,e),0==(e-=s)){s===r.length?(++a,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=r.slice(s));break}++a}return this.length-=a,n}},{key:"_getBuffer",value:function(e){var t=i.allocUnsafe(e),a=this.head,n=1;for(a.data.copy(t),e-=a.data.length;a=a.next;){var r=a.data,s=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,s),0==(e-=s)){s===r.length?(++n,a.next?this.head=a.next:this.head=this.tail=null):(this.head=a,a.data=r.slice(s));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return c(this,r(r({},t),{},{depth:0,customInspect:!1}))}}])&&o(t.prototype,a),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},1195:(e,t,a)=>{var n=a(4155);function r(e,t){o(e,t),s(e)}function s(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function o(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var a=this,l=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return l||i?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(o,this,e)):n.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?a._writableState?a._writableState.errorEmitted?n.nextTick(s,a):(a._writableState.errorEmitted=!0,n.nextTick(r,a,e)):n.nextTick(r,a,e):t?(n.nextTick(s,a),t(e)):n.nextTick(s,a)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var a=e._readableState,n=e._writableState;a&&a.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},8610:(e,t,a)=>{var n=a(4281).q.ERR_STREAM_PREMATURE_CLOSE;function r(){}e.exports=function e(t,a,s){if("function"==typeof a)return e(t,null,a);a||(a={}),s=function(e){var t=!1;return function(){if(!t){t=!0;for(var a=arguments.length,n=new Array(a),r=0;r{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},9946:(e,t,a)=>{var n;var r=a(4281).q,s=r.ERR_MISSING_ARGS,o=r.ERR_STREAM_DESTROYED;function l(e){if(e)throw e}function i(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r0,(function(e){u||(u=e),e&&p.forEach(i),s||(p.forEach(i),d(u))}))}));return t.reduce(c)}},2457:(e,t,a)=>{var n=a(4281).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,a,r){var s=function(e,t,a){return null!=e.highWaterMark?e.highWaterMark:t?e[a]:null}(t,r,a);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(r?a:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},2503:(e,t,a)=>{e.exports=a(7187).EventEmitter},9509:(e,t,a)=>{var n=a(8764),r=n.Buffer;function s(e,t){for(var a in e)t[a]=e[a]}function o(e,t,a){return r(e,t,a)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(s(n,t),t.Buffer=o),o.prototype=Object.create(r.prototype),s(r,o),o.from=function(e,t,a){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,a)},o.alloc=function(e,t,a){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=r(e);return void 0!==t?"string"==typeof a?n.fill(t,a):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},4189:(e,t,a)=>{var n=a(9509).Buffer;function r(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var a=this._block,r=this._blockSize,s=e.length,o=this._len,l=0;l=this._finalSize&&(this._update(this._block),this._block.fill(0));var a=8*this._len;if(a<=4294967295)this._block.writeUInt32BE(a,this._blockSize-4);else{var n=(4294967295&a)>>>0,r=(a-n)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var s=this._hash();return e?s.toString(e):s},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},e.exports=r},9072:(e,t,a)=>{var n=e.exports=function(e){e=e.toLowerCase();var t=n[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t};n.sha=a(4448),n.sha1=a(8336),n.sha224=a(8432),n.sha256=a(7499),n.sha384=a(1686),n.sha512=a(7816)},4448:(e,t,a)=>{var n=a(5717),r=a(4189),s=a(9509).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);function i(){this.init(),this._w=l,r.call(this,64,56)}function c(e){return e<<30|e>>>2}function u(e,t,a,n){return 0===e?t&a|~t&n:2===e?t&a|t&n|a&n:t^a^n}n(i,r),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var t,a=this._w,n=0|this._a,r=0|this._b,s=0|this._c,l=0|this._d,i=0|this._e,d=0;d<16;++d)a[d]=e.readInt32BE(4*d);for(;d<80;++d)a[d]=a[d-3]^a[d-8]^a[d-14]^a[d-16];for(var p=0;p<80;++p){var m=~~(p/20),f=0|((t=n)<<5|t>>>27)+u(m,r,s,l)+i+a[p]+o[m];i=l,l=s,s=c(r),r=n,n=f}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=l+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},8336:(e,t,a)=>{var n=a(5717),r=a(4189),s=a(9509).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],l=new Array(80);function i(){this.init(),this._w=l,r.call(this,64,56)}function c(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function d(e,t,a,n){return 0===e?t&a|~t&n:2===e?t&a|t&n|a&n:t^a^n}n(i,r),i.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},i.prototype._update=function(e){for(var t,a=this._w,n=0|this._a,r=0|this._b,s=0|this._c,l=0|this._d,i=0|this._e,p=0;p<16;++p)a[p]=e.readInt32BE(4*p);for(;p<80;++p)a[p]=(t=a[p-3]^a[p-8]^a[p-14]^a[p-16])<<1|t>>>31;for(var m=0;m<80;++m){var f=~~(m/20),h=c(n)+d(f,r,s,l)+i+a[m]+o[f]|0;i=l,l=s,s=u(r),r=n,n=h}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=l+this._d|0,this._e=i+this._e|0},i.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=i},8432:(e,t,a)=>{var n=a(5717),r=a(7499),s=a(4189),o=a(9509).Buffer,l=new Array(64);function i(){this.init(),this._w=l,s.call(this,64,56)}n(i,r),i.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},i.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=i},7499:(e,t,a)=>{var n=a(5717),r=a(4189),s=a(9509).Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],l=new Array(64);function i(){this.init(),this._w=l,r.call(this,64,56)}function c(e,t,a){return a^e&(t^a)}function u(e,t,a){return e&t|a&(e|t)}function d(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function p(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function m(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(i,r),i.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},i.prototype._update=function(e){for(var t,a=this._w,n=0|this._a,r=0|this._b,s=0|this._c,l=0|this._d,i=0|this._e,f=0|this._f,h=0|this._g,g=0|this._h,y=0;y<16;++y)a[y]=e.readInt32BE(4*y);for(;y<64;++y)a[y]=0|(((t=a[y-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+a[y-7]+m(a[y-15])+a[y-16];for(var v=0;v<64;++v){var E=g+p(i)+c(i,f,h)+o[v]+a[v]|0,S=d(n)+u(n,r,s)|0;g=h,h=f,f=i,i=l+E|0,l=s,s=r,r=n,n=E+S|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=s+this._c|0,this._d=l+this._d|0,this._e=i+this._e|0,this._f=f+this._f|0,this._g=h+this._g|0,this._h=g+this._h|0},i.prototype._hash=function(){var e=s.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=i},1686:(e,t,a)=>{var n=a(5717),r=a(7816),s=a(4189),o=a(9509).Buffer,l=new Array(160);function i(){this.init(),this._w=l,s.call(this,128,112)}n(i,r),i.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},i.prototype._hash=function(){var e=o.allocUnsafe(48);function t(t,a,n){e.writeInt32BE(t,n),e.writeInt32BE(a,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=i},7816:(e,t,a)=>{var n=a(5717),r=a(4189),s=a(9509).Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],l=new Array(160);function i(){this.init(),this._w=l,r.call(this,128,112)}function c(e,t,a){return a^e&(t^a)}function u(e,t,a){return e&t|a&(e|t)}function d(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function p(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function m(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function h(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function y(e,t){return e>>>0>>0?1:0}n(i,r),i.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},i.prototype._update=function(e){for(var t=this._w,a=0|this._ah,n=0|this._bh,r=0|this._ch,s=0|this._dh,l=0|this._eh,i=0|this._fh,v=0|this._gh,E=0|this._hh,S=0|this._al,w=0|this._bl,b=0|this._cl,x=0|this._dl,_=0|this._el,C=0|this._fl,j=0|this._gl,N=0|this._hl,O=0;O<32;O+=2)t[O]=e.readInt32BE(4*O),t[O+1]=e.readInt32BE(4*O+4);for(;O<160;O+=2){var k=t[O-30],A=t[O-30+1],I=m(k,A),R=f(A,k),P=h(k=t[O-4],A=t[O-4+1]),T=g(A,k),M=t[O-14],D=t[O-14+1],L=t[O-32],q=t[O-32+1],B=R+D|0,U=I+M+y(B,R)|0;U=(U=U+P+y(B=B+T|0,T)|0)+L+y(B=B+q|0,q)|0,t[O]=U,t[O+1]=B}for(var J=0;J<160;J+=2){U=t[J],B=t[J+1];var $=u(a,n,r),V=u(S,w,b),K=d(a,S),F=d(S,a),z=p(l,_),W=p(_,l),H=o[J],G=o[J+1],Z=c(l,i,v),Y=c(_,C,j),X=N+W|0,Q=E+z+y(X,N)|0;Q=(Q=(Q=Q+Z+y(X=X+Y|0,Y)|0)+H+y(X=X+G|0,G)|0)+U+y(X=X+B|0,B)|0;var ee=F+V|0,te=K+$+y(ee,F)|0;E=v,N=j,v=i,j=C,i=l,C=_,l=s+Q+y(_=x+X|0,x)|0,s=r,x=b,r=n,b=w,n=a,w=S,a=Q+te+y(S=X+ee|0,X)|0}this._al=this._al+S|0,this._bl=this._bl+w|0,this._cl=this._cl+b|0,this._dl=this._dl+x|0,this._el=this._el+_|0,this._fl=this._fl+C|0,this._gl=this._gl+j|0,this._hl=this._hl+N|0,this._ah=this._ah+a+y(this._al,S)|0,this._bh=this._bh+n+y(this._bl,w)|0,this._ch=this._ch+r+y(this._cl,b)|0,this._dh=this._dh+s+y(this._dl,x)|0,this._eh=this._eh+l+y(this._el,_)|0,this._fh=this._fh+i+y(this._fl,C)|0,this._gh=this._gh+v+y(this._gl,j)|0,this._hh=this._hh+E+y(this._hl,N)|0},i.prototype._hash=function(){var e=s.allocUnsafe(64);function t(t,a,n){e.writeInt32BE(t,n),e.writeInt32BE(a,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=i},2830:(e,t,a)=>{e.exports=r;var n=a(7187).EventEmitter;function r(){n.call(this)}a(5717)(r,n),r.Readable=a(9481),r.Writable=a(3982),r.Duplex=a(6753),r.Transform=a(4605),r.PassThrough=a(2725),r.finished=a(8610),r.pipeline=a(9946),r.Stream=r,r.prototype.pipe=function(e,t){var a=this;function r(t){e.writable&&!1===e.write(t)&&a.pause&&a.pause()}function s(){a.readable&&a.resume&&a.resume()}a.on("data",r),e.on("drain",s),e._isStdio||t&&!1===t.end||(a.on("end",l),a.on("close",i));var o=!1;function l(){o||(o=!0,e.end())}function i(){o||(o=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(u(),0===n.listenerCount(this,"error"))throw e}function u(){a.removeListener("data",r),e.removeListener("drain",s),a.removeListener("end",l),a.removeListener("close",i),a.removeListener("error",c),e.removeListener("error",c),a.removeListener("end",u),a.removeListener("close",u),e.removeListener("close",u)}return a.on("error",c),e.on("error",c),a.on("end",u),a.on("close",u),e.on("close",u),e.emit("pipe",a),e}},2553:(e,t,a)=>{var n=a(9509).Buffer,r=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=i,this.end=c,t=4;break;case"utf8":this.fillLast=l,t=4;break;case"base64":this.text=u,this.end=d,t=3;break;default:return this.write=p,void(this.end=m)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function l(e){var t=this.lastTotal-this.lastNeed,a=function(e,t,a){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==a?a:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function i(e,t){if((e.length-t)%2==0){var a=e.toString("utf16le",t);if(a){var n=a.charCodeAt(a.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],a.slice(0,-1)}return a}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var a=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,a)}return t}function u(e,t){var a=(e.length-t)%3;return 0===a?e.toString("base64",t):(this.lastNeed=3-a,this.lastTotal=3,1===a?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-a))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function p(e){return e.toString(this.encoding)}function m(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){if(0===e.length)return"";var t,a;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";a=this.lastNeed,this.lastNeed=0}else a=0;return a=0)return r>0&&(e.lastNeed=r-1),r;if(--n=0)return r>0&&(e.lastNeed=r-2),r;if(--n=0)return r>0&&(2===r?r=0:e.lastNeed=r-3),r;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=a;var n=e.length-(a-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},4927:(e,t,a)=>{function n(e){try{if(!a.g.localStorage)return!1}catch(e){return!1}var t=a.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var a=!1;return function(){if(!a){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),a=!0}return e.apply(this,arguments)}}},255:e=>{var t={"&":"&",'"':""","'":"'","<":"<",">":">"};e.exports=function(e){return e&&e.replace?e.replace(/([&"<>'])/g,(function(e,a){return t[a]})):e}},3479:(e,t,a)=>{var n=a(4155),r=a(255),s=a(2830).Stream;function o(e,t,a){a=a||0;var n,s,l=(n=t,new Array(a||0).join(n||"")),i=e;if("object"==typeof e&&((i=e[s=Object.keys(e)[0]])&&i._elem))return i._elem.name=s,i._elem.icount=a,i._elem.indent=t,i._elem.indents=l,i._elem.interrupt=i,i._elem;var c,u=[],d=[];function p(e){Object.keys(e).forEach((function(t){u.push(function(e,t){return e+'="'+r(t)+'"'}(t,e[t]))}))}switch(typeof i){case"object":if(null===i)break;i._attr&&p(i._attr),i._cdata&&d.push(("/g,"]]]]>")+"]]>"),i.forEach&&(c=!1,d.push(""),i.forEach((function(e){"object"==typeof e?"_attr"==Object.keys(e)[0]?p(e._attr):d.push(o(e,t,a+1)):(d.pop(),c=!0,d.push(r(e)))})),c||d.push(""));break;default:d.push(r(i))}return{name:s,interrupt:!1,attributes:u,content:d,icount:a,indents:l,indent:t}}function l(e,t,a){if("object"!=typeof t)return e(!1,t);var n=t.interrupt?1:t.content.length;function r(){for(;t.content.length;){var r=t.content.shift();if(void 0!==r){if(s(r))return;l(e,r)}}e(!1,(n>1?t.indents:"")+(t.name?"":"")+(t.indent&&!a?"\n":"")),a&&a()}function s(t){return!!t.interrupt&&(t.interrupt.append=e,t.interrupt.end=r,t.interrupt=!1,e(!0),!0)}if(e(!1,t.indents+(t.name?"<"+t.name:"")+(t.attributes.length?" "+t.attributes.join(" "):"")+(n?t.name?">":"":t.name?"/>":"")+(t.indent&&n>1?"\n":"")),!n)return e(!1,t.indent?"\n":"");s(t)||r()}e.exports=function(e,t){"object"!=typeof t&&(t={indent:t});var a,r,i=t.stream?new s:null,c="",u=!1,d=t.indent?!0===t.indent?" ":t.indent:"",p=!0;function m(e){p?n.nextTick(e):e()}function f(e,t){if(void 0!==t&&(c+=t),e&&!u&&(i=i||new s,u=!0),e&&u){var a=c;m((function(){i.emit("data",a)})),c=""}}function h(e,t){l(f,o(e,d,d?1:0),t)}function g(){if(i){var e=c;m((function(){i.emit("data",e),i.emit("end"),i.readable=!1,i.emit("close")}))}}return m((function(){p=!1})),t.declaration&&(a=t.declaration,r={version:"1.0",encoding:a.encoding||"UTF-8"},a.standalone&&(r.standalone=a.standalone),h({"?xml":{_attr:r}}),c=c.replace("/>","?>")),e&&e.forEach?e.forEach((function(t,a){var n;a+1===e.length&&(n=g),h(t,n)})):h(e,g),i?(i.readable=!0,i):c},e.exports.element=e.exports.Element=function(){var e={_elem:o(Array.prototype.slice.call(arguments)),push:function(e){if(!this.append)throw new Error("not assigned to a parent!");var t=this,a=this._elem.indent;l(this.append,o(e,a,this._elem.icount+(a?1:0)),(function(){t.append(!0)}))},close:function(e){void 0!==e&&this.push(e),this.end&&this.end()}};return e}},5102:(e,t,a)=>{var n={"./all.js":5308,"./auth/actions.js":5812,"./auth/components/lock-auth-icon.jsx":7105,"./auth/components/unlock-auth-icon.jsx":3219,"./auth/configs-extensions/wrap-actions.js":3779,"./auth/index.js":3705,"./auth/reducers.js":3962,"./auth/selectors.js":35,"./auth/spec-extensions/wrap-actions.js":489,"./auth/wrap-actions.js":2849,"./configs/actions.js":714,"./configs/helpers.js":2256,"./configs/index.js":6709,"./configs/reducers.js":7743,"./configs/selectors.js":9018,"./configs/spec-actions.js":2698,"./deep-linking/helpers.js":1970,"./deep-linking/index.js":4980,"./deep-linking/layout.js":5858,"./deep-linking/operation-tag-wrapper.jsx":4584,"./deep-linking/operation-wrapper.jsx":877,"./download-url.js":8011,"./err/actions.js":4966,"./err/error-transformers/hook.js":6808,"./err/error-transformers/transformers/not-of-type.js":2392,"./err/error-transformers/transformers/parameter-oneof.js":1835,"./err/index.js":7793,"./err/reducers.js":3527,"./err/selectors.js":7667,"./filter/index.js":9978,"./filter/opsFilter.js":4309,"./icons/components/arrow-down.jsx":6395,"./icons/components/arrow-up.jsx":9689,"./icons/components/arrow.jsx":6984,"./icons/components/close.jsx":2478,"./icons/components/copy.jsx":3388,"./icons/components/lock.jsx":6945,"./icons/components/unlock.jsx":2568,"./icons/index.js":70,"./json-schema-2020-12/components/Accordion/Accordion.jsx":7349,"./json-schema-2020-12/components/ExpandDeepButton/ExpandDeepButton.jsx":6867,"./json-schema-2020-12/components/JSONSchema/JSONSchema.jsx":2675,"./json-schema-2020-12/components/icons/ChevronRight.jsx":2260,"./json-schema-2020-12/components/keywords/$anchor.jsx":4922,"./json-schema-2020-12/components/keywords/$comment.jsx":4685,"./json-schema-2020-12/components/keywords/$defs.jsx":6418,"./json-schema-2020-12/components/keywords/$dynamicAnchor.jsx":1338,"./json-schema-2020-12/components/keywords/$dynamicRef.jsx":7655,"./json-schema-2020-12/components/keywords/$id.jsx":3460,"./json-schema-2020-12/components/keywords/$ref.jsx":2348,"./json-schema-2020-12/components/keywords/$schema.jsx":9359,"./json-schema-2020-12/components/keywords/$vocabulary/$vocabulary.jsx":7568,"./json-schema-2020-12/components/keywords/AdditionalProperties.jsx":5253,"./json-schema-2020-12/components/keywords/AllOf.jsx":6457,"./json-schema-2020-12/components/keywords/AnyOf.jsx":8776,"./json-schema-2020-12/components/keywords/Const.jsx":7308,"./json-schema-2020-12/components/keywords/Constraint/Constraint.jsx":9956,"./json-schema-2020-12/components/keywords/Contains.jsx":8993,"./json-schema-2020-12/components/keywords/ContentSchema.jsx":3484,"./json-schema-2020-12/components/keywords/Default.jsx":5148,"./json-schema-2020-12/components/keywords/DependentRequired/DependentRequired.jsx":4539,"./json-schema-2020-12/components/keywords/DependentSchemas.jsx":6076,"./json-schema-2020-12/components/keywords/Deprecated.jsx":6661,"./json-schema-2020-12/components/keywords/Description/Description.jsx":9446,"./json-schema-2020-12/components/keywords/Else.jsx":7207,"./json-schema-2020-12/components/keywords/Enum/Enum.jsx":1805,"./json-schema-2020-12/components/keywords/If.jsx":487,"./json-schema-2020-12/components/keywords/Items.jsx":9206,"./json-schema-2020-12/components/keywords/Not.jsx":5174,"./json-schema-2020-12/components/keywords/OneOf.jsx":3834,"./json-schema-2020-12/components/keywords/PatternProperties/PatternProperties.jsx":6746,"./json-schema-2020-12/components/keywords/PrefixItems.jsx":3971,"./json-schema-2020-12/components/keywords/Properties/Properties.jsx":5472,"./json-schema-2020-12/components/keywords/PropertyNames.jsx":2338,"./json-schema-2020-12/components/keywords/ReadOnly.jsx":6456,"./json-schema-2020-12/components/keywords/Then.jsx":7401,"./json-schema-2020-12/components/keywords/Title/Title.jsx":8137,"./json-schema-2020-12/components/keywords/Type.jsx":2285,"./json-schema-2020-12/components/keywords/UnevaluatedItems.jsx":5828,"./json-schema-2020-12/components/keywords/UnevaluatedProperties.jsx":6907,"./json-schema-2020-12/components/keywords/WriteOnly.jsx":5789,"./json-schema-2020-12/context.js":9006,"./json-schema-2020-12/fn.js":4121,"./json-schema-2020-12/hoc.jsx":5077,"./json-schema-2020-12/hooks.js":2603,"./json-schema-2020-12/index.js":7139,"./json-schema-2020-12/prop-types.js":6648,"./json-schema-2020-12/samples-extensions/fn/api/encoderAPI.js":9507,"./json-schema-2020-12/samples-extensions/fn/api/formatAPI.js":2906,"./json-schema-2020-12/samples-extensions/fn/api/mediaTypeAPI.js":537,"./json-schema-2020-12/samples-extensions/fn/class/EncoderRegistry.js":674,"./json-schema-2020-12/samples-extensions/fn/class/MediaTypeRegistry.js":3782,"./json-schema-2020-12/samples-extensions/fn/class/Registry.js":4215,"./json-schema-2020-12/samples-extensions/fn/core/constants.js":8338,"./json-schema-2020-12/samples-extensions/fn/core/example.js":3783,"./json-schema-2020-12/samples-extensions/fn/core/merge.js":7078,"./json-schema-2020-12/samples-extensions/fn/core/predicates.js":3084,"./json-schema-2020-12/samples-extensions/fn/core/random.js":5202,"./json-schema-2020-12/samples-extensions/fn/core/type.js":6276,"./json-schema-2020-12/samples-extensions/fn/core/utils.js":9346,"./json-schema-2020-12/samples-extensions/fn/encoders/7bit.js":1433,"./json-schema-2020-12/samples-extensions/fn/encoders/8bit.js":8509,"./json-schema-2020-12/samples-extensions/fn/encoders/base16.js":5709,"./json-schema-2020-12/samples-extensions/fn/encoders/base32.js":4180,"./json-schema-2020-12/samples-extensions/fn/encoders/base64.js":1967,"./json-schema-2020-12/samples-extensions/fn/encoders/binary.js":4366,"./json-schema-2020-12/samples-extensions/fn/encoders/quoted-printable.js":5037,"./json-schema-2020-12/samples-extensions/fn/generators/date-time.js":4045,"./json-schema-2020-12/samples-extensions/fn/generators/date.js":1456,"./json-schema-2020-12/samples-extensions/fn/generators/double.js":560,"./json-schema-2020-12/samples-extensions/fn/generators/duration.js":4299,"./json-schema-2020-12/samples-extensions/fn/generators/email.js":3981,"./json-schema-2020-12/samples-extensions/fn/generators/float.js":1890,"./json-schema-2020-12/samples-extensions/fn/generators/hostname.js":9375,"./json-schema-2020-12/samples-extensions/fn/generators/idn-email.js":4518,"./json-schema-2020-12/samples-extensions/fn/generators/idn-hostname.js":273,"./json-schema-2020-12/samples-extensions/fn/generators/int32.js":7864,"./json-schema-2020-12/samples-extensions/fn/generators/int64.js":1726,"./json-schema-2020-12/samples-extensions/fn/generators/ipv4.js":8793,"./json-schema-2020-12/samples-extensions/fn/generators/ipv6.js":8269,"./json-schema-2020-12/samples-extensions/fn/generators/iri-reference.js":5693,"./json-schema-2020-12/samples-extensions/fn/generators/iri.js":3080,"./json-schema-2020-12/samples-extensions/fn/generators/json-pointer.js":7856,"./json-schema-2020-12/samples-extensions/fn/generators/media-types/application.js":5652,"./json-schema-2020-12/samples-extensions/fn/generators/media-types/audio.js":4342,"./json-schema-2020-12/samples-extensions/fn/generators/media-types/image.js":6724,"./json-schema-2020-12/samples-extensions/fn/generators/media-types/text.js":5378,"./json-schema-2020-12/samples-extensions/fn/generators/media-types/video.js":2974,"./json-schema-2020-12/samples-extensions/fn/generators/password.js":3393,"./json-schema-2020-12/samples-extensions/fn/generators/regex.js":4335,"./json-schema-2020-12/samples-extensions/fn/generators/relative-json-pointer.js":375,"./json-schema-2020-12/samples-extensions/fn/generators/time.js":5243,"./json-schema-2020-12/samples-extensions/fn/generators/uri-reference.js":4692,"./json-schema-2020-12/samples-extensions/fn/generators/uri-template.js":3829,"./json-schema-2020-12/samples-extensions/fn/generators/uri.js":2978,"./json-schema-2020-12/samples-extensions/fn/generators/uuid.js":8859,"./json-schema-2020-12/samples-extensions/fn/index.js":8591,"./json-schema-2020-12/samples-extensions/fn/main.js":4277,"./json-schema-2020-12/samples-extensions/fn/types/array.js":8262,"./json-schema-2020-12/samples-extensions/fn/types/boolean.js":4108,"./json-schema-2020-12/samples-extensions/fn/types/index.js":3273,"./json-schema-2020-12/samples-extensions/fn/types/integer.js":8864,"./json-schema-2020-12/samples-extensions/fn/types/null.js":853,"./json-schema-2020-12/samples-extensions/fn/types/number.js":7742,"./json-schema-2020-12/samples-extensions/fn/types/object.js":6852,"./json-schema-2020-12/samples-extensions/fn/types/string.js":4522,"./layout/actions.js":5474,"./layout/index.js":6821,"./layout/reducers.js":5672,"./layout/selectors.js":4400,"./layout/spec-extensions/wrap-selector.js":8989,"./logs/index.js":9150,"./oas3/actions.js":7002,"./oas3/auth-extensions/wrap-selectors.js":3723,"./oas3/components/callbacks.jsx":3427,"./oas3/components/http-auth.jsx":6775,"./oas3/components/index.js":6467,"./oas3/components/operation-link.jsx":5757,"./oas3/components/operation-servers.jsx":6796,"./oas3/components/request-body-editor.jsx":5327,"./oas3/components/request-body.jsx":2458,"./oas3/components/servers-container.jsx":9928,"./oas3/components/servers.jsx":6617,"./oas3/helpers.jsx":7779,"./oas3/index.js":7451,"./oas3/reducers.js":2109,"./oas3/selectors.js":5065,"./oas3/spec-extensions/selectors.js":1741,"./oas3/spec-extensions/wrap-selectors.js":2044,"./oas3/wrap-components/auth-item.jsx":356,"./oas3/wrap-components/index.js":7761,"./oas3/wrap-components/json-schema-string.jsx":287,"./oas3/wrap-components/markdown.jsx":2460,"./oas3/wrap-components/model.jsx":3499,"./oas3/wrap-components/online-validator-badge.js":58,"./oas3/wrap-components/openapi-version.jsx":2108,"./oas31/after-load.js":7754,"./oas31/components/contact.jsx":9503,"./oas31/components/info.jsx":6133,"./oas31/components/json-schema-dialect.jsx":2562,"./oas31/components/license.jsx":1876,"./oas31/components/model/model.jsx":2718,"./oas31/components/models/models.jsx":263,"./oas31/components/version-pragma-filter.jsx":3429,"./oas31/components/webhooks.jsx":9508,"./oas31/fn.js":4380,"./oas31/index.js":9806,"./oas31/json-schema-2020-12-extensions/components/keywords/Description.jsx":5989,"./oas31/json-schema-2020-12-extensions/components/keywords/Discriminator/Discriminator.jsx":9525,"./oas31/json-schema-2020-12-extensions/components/keywords/Discriminator/DiscriminatorMapping.jsx":7749,"./oas31/json-schema-2020-12-extensions/components/keywords/Example.jsx":9450,"./oas31/json-schema-2020-12-extensions/components/keywords/ExternalDocs.jsx":5324,"./oas31/json-schema-2020-12-extensions/components/keywords/Properties.jsx":9023,"./oas31/json-schema-2020-12-extensions/components/keywords/Xml.jsx":3995,"./oas31/json-schema-2020-12-extensions/fn.js":5800,"./oas31/json-schema-2020-12-extensions/wrap-components/keywords/Default.jsx":4951,"./oas31/json-schema-2020-12-extensions/wrap-components/keywords/Description.jsx":809,"./oas31/json-schema-2020-12-extensions/wrap-components/keywords/Properties.jsx":7536,"./oas31/selectors.js":4280,"./oas31/spec-extensions/selectors.js":9305,"./oas31/spec-extensions/wrap-selectors.js":2884,"./oas31/wrap-components/contact.jsx":7423,"./oas31/wrap-components/info.jsx":284,"./oas31/wrap-components/license.jsx":6608,"./oas31/wrap-components/model.jsx":7042,"./oas31/wrap-components/models.jsx":2914,"./oas31/wrap-components/version-pragma-filter.jsx":1434,"./on-complete/index.js":8560,"./request-snippets/fn.js":4624,"./request-snippets/index.js":6575,"./request-snippets/request-snippets.jsx":4206,"./request-snippets/selectors.js":4669,"./safe-render/components/error-boundary.jsx":6195,"./safe-render/components/fallback.jsx":9403,"./safe-render/fn.jsx":6189,"./safe-render/index.js":8102,"./samples/fn/get-json-sample-schema.js":2846,"./samples/fn/get-sample-schema.js":6132,"./samples/fn/get-xml-sample-schema.js":1169,"./samples/fn/get-yaml-sample-schema.js":9431,"./samples/fn/index.js":9812,"./samples/index.js":8883,"./spec/actions.js":9620,"./spec/index.js":7038,"./spec/reducers.js":32,"./spec/selectors.js":3881,"./spec/wrap-actions.js":7508,"./swagger-js/configs-wrap-actions.js":4852,"./swagger-js/index.js":9430,"./util/index.js":8525,"./view/fn.js":8347,"./view/index.js":3420,"./view/root-injects.jsx":1548,"core/plugins/all.js":5308,"core/plugins/auth/actions.js":5812,"core/plugins/auth/components/lock-auth-icon.jsx":7105,"core/plugins/auth/components/unlock-auth-icon.jsx":3219,"core/plugins/auth/configs-extensions/wrap-actions.js":3779,"core/plugins/auth/index.js":3705,"core/plugins/auth/reducers.js":3962,"core/plugins/auth/selectors.js":35,"core/plugins/auth/spec-extensions/wrap-actions.js":489,"core/plugins/auth/wrap-actions.js":2849,"core/plugins/configs/actions.js":714,"core/plugins/configs/helpers.js":2256,"core/plugins/configs/index.js":6709,"core/plugins/configs/reducers.js":7743,"core/plugins/configs/selectors.js":9018,"core/plugins/configs/spec-actions.js":2698,"core/plugins/deep-linking/helpers.js":1970,"core/plugins/deep-linking/index.js":4980,"core/plugins/deep-linking/layout.js":5858,"core/plugins/deep-linking/operation-tag-wrapper.jsx":4584,"core/plugins/deep-linking/operation-wrapper.jsx":877,"core/plugins/download-url.js":8011,"core/plugins/err/actions.js":4966,"core/plugins/err/error-transformers/hook.js":6808,"core/plugins/err/error-transformers/transformers/not-of-type.js":2392,"core/plugins/err/error-transformers/transformers/parameter-oneof.js":1835,"core/plugins/err/index.js":7793,"core/plugins/err/reducers.js":3527,"core/plugins/err/selectors.js":7667,"core/plugins/filter/index.js":9978,"core/plugins/filter/opsFilter.js":4309,"core/plugins/icons/components/arrow-down.jsx":6395,"core/plugins/icons/components/arrow-up.jsx":9689,"core/plugins/icons/components/arrow.jsx":6984,"core/plugins/icons/components/close.jsx":2478,"core/plugins/icons/components/copy.jsx":3388,"core/plugins/icons/components/lock.jsx":6945,"core/plugins/icons/components/unlock.jsx":2568,"core/plugins/icons/index.js":70,"core/plugins/json-schema-2020-12/components/Accordion/Accordion.jsx":7349,"core/plugins/json-schema-2020-12/components/ExpandDeepButton/ExpandDeepButton.jsx":6867,"core/plugins/json-schema-2020-12/components/JSONSchema/JSONSchema.jsx":2675,"core/plugins/json-schema-2020-12/components/icons/ChevronRight.jsx":2260,"core/plugins/json-schema-2020-12/components/keywords/$anchor.jsx":4922,"core/plugins/json-schema-2020-12/components/keywords/$comment.jsx":4685,"core/plugins/json-schema-2020-12/components/keywords/$defs.jsx":6418,"core/plugins/json-schema-2020-12/components/keywords/$dynamicAnchor.jsx":1338,"core/plugins/json-schema-2020-12/components/keywords/$dynamicRef.jsx":7655,"core/plugins/json-schema-2020-12/components/keywords/$id.jsx":3460,"core/plugins/json-schema-2020-12/components/keywords/$ref.jsx":2348,"core/plugins/json-schema-2020-12/components/keywords/$schema.jsx":9359,"core/plugins/json-schema-2020-12/components/keywords/$vocabulary/$vocabulary.jsx":7568,"core/plugins/json-schema-2020-12/components/keywords/AdditionalProperties.jsx":5253,"core/plugins/json-schema-2020-12/components/keywords/AllOf.jsx":6457,"core/plugins/json-schema-2020-12/components/keywords/AnyOf.jsx":8776,"core/plugins/json-schema-2020-12/components/keywords/Const.jsx":7308,"core/plugins/json-schema-2020-12/components/keywords/Constraint/Constraint.jsx":9956,"core/plugins/json-schema-2020-12/components/keywords/Contains.jsx":8993,"core/plugins/json-schema-2020-12/components/keywords/ContentSchema.jsx":3484,"core/plugins/json-schema-2020-12/components/keywords/Default.jsx":5148,"core/plugins/json-schema-2020-12/components/keywords/DependentRequired/DependentRequired.jsx":4539,"core/plugins/json-schema-2020-12/components/keywords/DependentSchemas.jsx":6076,"core/plugins/json-schema-2020-12/components/keywords/Deprecated.jsx":6661,"core/plugins/json-schema-2020-12/components/keywords/Description/Description.jsx":9446,"core/plugins/json-schema-2020-12/components/keywords/Else.jsx":7207,"core/plugins/json-schema-2020-12/components/keywords/Enum/Enum.jsx":1805,"core/plugins/json-schema-2020-12/components/keywords/If.jsx":487,"core/plugins/json-schema-2020-12/components/keywords/Items.jsx":9206,"core/plugins/json-schema-2020-12/components/keywords/Not.jsx":5174,"core/plugins/json-schema-2020-12/components/keywords/OneOf.jsx":3834,"core/plugins/json-schema-2020-12/components/keywords/PatternProperties/PatternProperties.jsx":6746,"core/plugins/json-schema-2020-12/components/keywords/PrefixItems.jsx":3971,"core/plugins/json-schema-2020-12/components/keywords/Properties/Properties.jsx":5472,"core/plugins/json-schema-2020-12/components/keywords/PropertyNames.jsx":2338,"core/plugins/json-schema-2020-12/components/keywords/ReadOnly.jsx":6456,"core/plugins/json-schema-2020-12/components/keywords/Then.jsx":7401,"core/plugins/json-schema-2020-12/components/keywords/Title/Title.jsx":8137,"core/plugins/json-schema-2020-12/components/keywords/Type.jsx":2285,"core/plugins/json-schema-2020-12/components/keywords/UnevaluatedItems.jsx":5828,"core/plugins/json-schema-2020-12/components/keywords/UnevaluatedProperties.jsx":6907,"core/plugins/json-schema-2020-12/components/keywords/WriteOnly.jsx":5789,"core/plugins/json-schema-2020-12/context.js":9006,"core/plugins/json-schema-2020-12/fn.js":4121,"core/plugins/json-schema-2020-12/hoc.jsx":5077,"core/plugins/json-schema-2020-12/hooks.js":2603,"core/plugins/json-schema-2020-12/index.js":7139,"core/plugins/json-schema-2020-12/prop-types.js":6648,"core/plugins/json-schema-2020-12/samples-extensions/fn/api/encoderAPI.js":9507,"core/plugins/json-schema-2020-12/samples-extensions/fn/api/formatAPI.js":2906,"core/plugins/json-schema-2020-12/samples-extensions/fn/api/mediaTypeAPI.js":537,"core/plugins/json-schema-2020-12/samples-extensions/fn/class/EncoderRegistry.js":674,"core/plugins/json-schema-2020-12/samples-extensions/fn/class/MediaTypeRegistry.js":3782,"core/plugins/json-schema-2020-12/samples-extensions/fn/class/Registry.js":4215,"core/plugins/json-schema-2020-12/samples-extensions/fn/core/constants.js":8338,"core/plugins/json-schema-2020-12/samples-extensions/fn/core/example.js":3783,"core/plugins/json-schema-2020-12/samples-extensions/fn/core/merge.js":7078,"core/plugins/json-schema-2020-12/samples-extensions/fn/core/predicates.js":3084,"core/plugins/json-schema-2020-12/samples-extensions/fn/core/random.js":5202,"core/plugins/json-schema-2020-12/samples-extensions/fn/core/type.js":6276,"core/plugins/json-schema-2020-12/samples-extensions/fn/core/utils.js":9346,"core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/7bit.js":1433,"core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/8bit.js":8509,"core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/base16.js":5709,"core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/base32.js":4180,"core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/base64.js":1967,"core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/binary.js":4366,"core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/quoted-printable.js":5037,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/date-time.js":4045,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/date.js":1456,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/double.js":560,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/duration.js":4299,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/email.js":3981,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/float.js":1890,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/hostname.js":9375,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/idn-email.js":4518,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/idn-hostname.js":273,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/int32.js":7864,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/int64.js":1726,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/ipv4.js":8793,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/ipv6.js":8269,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/iri-reference.js":5693,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/iri.js":3080,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/json-pointer.js":7856,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/application.js":5652,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/audio.js":4342,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/image.js":6724,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/text.js":5378,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/video.js":2974,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/password.js":3393,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/regex.js":4335,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/relative-json-pointer.js":375,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/time.js":5243,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/uri-reference.js":4692,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/uri-template.js":3829,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/uri.js":2978,"core/plugins/json-schema-2020-12/samples-extensions/fn/generators/uuid.js":8859,"core/plugins/json-schema-2020-12/samples-extensions/fn/index.js":8591,"core/plugins/json-schema-2020-12/samples-extensions/fn/main.js":4277,"core/plugins/json-schema-2020-12/samples-extensions/fn/types/array.js":8262,"core/plugins/json-schema-2020-12/samples-extensions/fn/types/boolean.js":4108,"core/plugins/json-schema-2020-12/samples-extensions/fn/types/index.js":3273,"core/plugins/json-schema-2020-12/samples-extensions/fn/types/integer.js":8864,"core/plugins/json-schema-2020-12/samples-extensions/fn/types/null.js":853,"core/plugins/json-schema-2020-12/samples-extensions/fn/types/number.js":7742,"core/plugins/json-schema-2020-12/samples-extensions/fn/types/object.js":6852,"core/plugins/json-schema-2020-12/samples-extensions/fn/types/string.js":4522,"core/plugins/layout/actions.js":5474,"core/plugins/layout/index.js":6821,"core/plugins/layout/reducers.js":5672,"core/plugins/layout/selectors.js":4400,"core/plugins/layout/spec-extensions/wrap-selector.js":8989,"core/plugins/logs/index.js":9150,"core/plugins/oas3/actions.js":7002,"core/plugins/oas3/auth-extensions/wrap-selectors.js":3723,"core/plugins/oas3/components/callbacks.jsx":3427,"core/plugins/oas3/components/http-auth.jsx":6775,"core/plugins/oas3/components/index.js":6467,"core/plugins/oas3/components/operation-link.jsx":5757,"core/plugins/oas3/components/operation-servers.jsx":6796,"core/plugins/oas3/components/request-body-editor.jsx":5327,"core/plugins/oas3/components/request-body.jsx":2458,"core/plugins/oas3/components/servers-container.jsx":9928,"core/plugins/oas3/components/servers.jsx":6617,"core/plugins/oas3/helpers.jsx":7779,"core/plugins/oas3/index.js":7451,"core/plugins/oas3/reducers.js":2109,"core/plugins/oas3/selectors.js":5065,"core/plugins/oas3/spec-extensions/selectors.js":1741,"core/plugins/oas3/spec-extensions/wrap-selectors.js":2044,"core/plugins/oas3/wrap-components/auth-item.jsx":356,"core/plugins/oas3/wrap-components/index.js":7761,"core/plugins/oas3/wrap-components/json-schema-string.jsx":287,"core/plugins/oas3/wrap-components/markdown.jsx":2460,"core/plugins/oas3/wrap-components/model.jsx":3499,"core/plugins/oas3/wrap-components/online-validator-badge.js":58,"core/plugins/oas3/wrap-components/openapi-version.jsx":2108,"core/plugins/oas31/after-load.js":7754,"core/plugins/oas31/components/contact.jsx":9503,"core/plugins/oas31/components/info.jsx":6133,"core/plugins/oas31/components/json-schema-dialect.jsx":2562,"core/plugins/oas31/components/license.jsx":1876,"core/plugins/oas31/components/model/model.jsx":2718,"core/plugins/oas31/components/models/models.jsx":263,"core/plugins/oas31/components/version-pragma-filter.jsx":3429,"core/plugins/oas31/components/webhooks.jsx":9508,"core/plugins/oas31/fn.js":4380,"core/plugins/oas31/index.js":9806,"core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Description.jsx":5989,"core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Discriminator/Discriminator.jsx":9525,"core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Discriminator/DiscriminatorMapping.jsx":7749,"core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Example.jsx":9450,"core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/ExternalDocs.jsx":5324,"core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Properties.jsx":9023,"core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Xml.jsx":3995,"core/plugins/oas31/json-schema-2020-12-extensions/fn.js":5800,"core/plugins/oas31/json-schema-2020-12-extensions/wrap-components/keywords/Default.jsx":4951,"core/plugins/oas31/json-schema-2020-12-extensions/wrap-components/keywords/Description.jsx":809,"core/plugins/oas31/json-schema-2020-12-extensions/wrap-components/keywords/Properties.jsx":7536,"core/plugins/oas31/selectors.js":4280,"core/plugins/oas31/spec-extensions/selectors.js":9305,"core/plugins/oas31/spec-extensions/wrap-selectors.js":2884,"core/plugins/oas31/wrap-components/contact.jsx":7423,"core/plugins/oas31/wrap-components/info.jsx":284,"core/plugins/oas31/wrap-components/license.jsx":6608,"core/plugins/oas31/wrap-components/model.jsx":7042,"core/plugins/oas31/wrap-components/models.jsx":2914,"core/plugins/oas31/wrap-components/version-pragma-filter.jsx":1434,"core/plugins/on-complete/index.js":8560,"core/plugins/request-snippets/fn.js":4624,"core/plugins/request-snippets/index.js":6575,"core/plugins/request-snippets/request-snippets.jsx":4206,"core/plugins/request-snippets/selectors.js":4669,"core/plugins/safe-render/components/error-boundary.jsx":6195,"core/plugins/safe-render/components/fallback.jsx":9403,"core/plugins/safe-render/fn.jsx":6189,"core/plugins/safe-render/index.js":8102,"core/plugins/samples/fn/get-json-sample-schema.js":2846,"core/plugins/samples/fn/get-sample-schema.js":6132,"core/plugins/samples/fn/get-xml-sample-schema.js":1169,"core/plugins/samples/fn/get-yaml-sample-schema.js":9431,"core/plugins/samples/fn/index.js":9812,"core/plugins/samples/index.js":8883,"core/plugins/spec/actions.js":9620,"core/plugins/spec/index.js":7038,"core/plugins/spec/reducers.js":32,"core/plugins/spec/selectors.js":3881,"core/plugins/spec/wrap-actions.js":7508,"core/plugins/swagger-js/configs-wrap-actions.js":4852,"core/plugins/swagger-js/index.js":9430,"core/plugins/util/index.js":8525,"core/plugins/view/fn.js":8347,"core/plugins/view/index.js":3420,"core/plugins/view/root-injects.jsx":1548};function r(e){var t=s(e);return a(t)}function s(e){if(!a.o(n,e)){var t=new Error("Cannot find module '"+e+"'");throw t.code="MODULE_NOT_FOUND",t}return n[e]}r.keys=function(){return Object.keys(n)},r.resolve=s,e.exports=r,r.id=5102},2517:e=>{e.exports="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwcHgiICBoZWlnaHQ9IjIwMHB4IiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIGNsYXNzPSJsZHMtcm9sbGluZyIgc3R5bGU9ImJhY2tncm91bmQtaW1hZ2U6IG5vbmU7IGJhY2tncm91bmQtcG9zaXRpb246IGluaXRpYWwgaW5pdGlhbDsgYmFja2dyb3VuZC1yZXBlYXQ6IGluaXRpYWwgaW5pdGlhbDsiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIGZpbGw9Im5vbmUiIG5nLWF0dHItc3Ryb2tlPSJ7e2NvbmZpZy5jb2xvcn19IiBuZy1hdHRyLXN0cm9rZS13aWR0aD0ie3tjb25maWcud2lkdGh9fSIgbmctYXR0ci1yPSJ7e2NvbmZpZy5yYWRpdXN9fSIgbmctYXR0ci1zdHJva2UtZGFzaGFycmF5PSJ7e2NvbmZpZy5kYXNoYXJyYXl9fSIgc3Ryb2tlPSIjNTU1NTU1IiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgY2FsY01vZGU9ImxpbmVhciIgdmFsdWVzPSIwIDUwIDUwOzM2MCA1MCA1MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlVHJhbnNmb3JtPjwvY2lyY2xlPjwvc3ZnPgo="},8898:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Z.default})},4163:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Y.default})},5527:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>X.default})},5171:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Q.default})},2954:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ee.default})},7930:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>te.default})},6145:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ae.default})},1778:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ne.default})},29:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>re.default})},2372:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>se.default})},8818:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>oe.default})},5487:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>le.default})},2565:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ie.default})},6785:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ce.default})},8136:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ue.default})},9963:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>de.default})},4350:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>pe.default})},5942:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>me.default})},313:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>fe.default})},6914:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>he.default})},1772:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ge.default})},7512:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ye.default})},7204:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ve.default})},7415:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Ee.default})},2740:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Se.default})},374:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>we.default})},527:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>be.default})},6235:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>xe.default})},3769:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>_e.default})},9651:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Ce.default})},3284:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>je.default})},5496:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Ne.default})},775:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Oe.default})},863:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>ke.default})},4780:e=>{e.exports=Ae},8096:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Ie.default})},3294:e=>{e.exports=Re},9725:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({List:()=>Pe.List,Map:()=>Pe.Map,OrderedMap:()=>Pe.OrderedMap,Seq:()=>Pe.Seq,Set:()=>Pe.Set,default:()=>Pe.default,fromJS:()=>Pe.fromJS})},3772:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({JSON_SCHEMA:()=>Te.JSON_SCHEMA,default:()=>Te.default})},9908:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Me.default})},1252:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>De.default})},8747:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Le.default})},7068:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>qe.default})},8646:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Be.default})},5476:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Ue.default})},1116:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Je.default})},841:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>$e.default})},5053:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Ve.default})},2092:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Ke.default})},810:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({Component:()=>Fe.Component,PureComponent:()=>Fe.PureComponent,createContext:()=>Fe.createContext,default:()=>Fe.default,forwardRef:()=>Fe.forwardRef,useCallback:()=>Fe.useCallback,useContext:()=>Fe.useContext,useEffect:()=>Fe.useEffect,useRef:()=>Fe.useRef,useState:()=>Fe.useState})},9874:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({CopyToClipboard:()=>ze.CopyToClipboard})},9569:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>We.default})},9871:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({applyMiddleware:()=>He.applyMiddleware,bindActionCreators:()=>He.bindActionCreators,compose:()=>He.compose,createStore:()=>He.createStore})},3952:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({Remarkable:()=>Ge.Remarkable})},8639:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({createSelector:()=>Ze.createSelector})},8518:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({serializeError:()=>Ye.serializeError})},5013:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({opId:()=>Xe.opId})},8900:(e,t,a)=>{e.exports=(e=>{var t={};return a.d(t,e),t})({default:()=>Qe.default})},2361:()=>{},4616:()=>{},6718:(e,t,a)=>{e.exports=a(1910)}},dt={};function pt(e){var t=dt[e];if(void 0!==t)return t.exports;var a=dt[e]={exports:{}};return ut[e].call(a.exports,a,a.exports,pt),a.exports}pt.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return pt.d(t,{a:t}),t},pt.d=(e,t)=>{for(var a in t)pt.o(t,a)&&!pt.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},pt.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),pt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),pt.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var mt={};(()=>{pt.d(mt,{Z:()=>Ga});var e={};pt.r(e),pt.d(e,{Button:()=>It,Col:()=>kt,Collapse:()=>Lt,Container:()=>Nt,Input:()=>Pt,Link:()=>Mt,Row:()=>At,Select:()=>Tt,TextArea:()=>Rt});var t={};pt.r(t),pt.d(t,{JsonSchemaArrayItemFile:()=>Pa,JsonSchemaArrayItemText:()=>Ra,JsonSchemaForm:()=>ka,JsonSchema_array:()=>Ia,JsonSchema_boolean:()=>Ta,JsonSchema_object:()=>Da,JsonSchema_string:()=>Aa});const a=(e=>{var t={};return pt.d(t,e),t})({default:()=>et.default});var n=pt(6145),r=pt(2740),s=pt(313),o=pt(7698),l=pt.n(o),i=pt(5527),c=pt(7512),u=pt(8136),d=pt(4163),p=pt(6785),m=pt(2565),f=pt(5171),h=pt(810),g=pt(9871),y=pt(9725);const v=(e=>{var t={};return pt.d(t,e),t})({combineReducers:()=>tt.combineReducers});var E=pt(8518);const S=(e=>{var t={};return pt.d(t,e),t})({default:()=>at.default});var w=pt(4966),b=pt(7504),x=pt(6561);const _=e=>e;class C{constructor(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};var a,n,r;l()(this,{state:{},plugins:[],pluginsOptions:{},system:{configs:{},fn:{},components:{},rootInjects:{},statePlugins:{}},boundSystem:{},toolbox:{}},t),this.getSystem=(0,i.default)(e=this._getSystem).call(e,this),this.store=(a=_,n=(0,y.fromJS)(this.state),r=this.getSystem,function(e,t,a){let n=[(0,x._5)(a)];const r=b.Z.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__||g.compose;return(0,g.createStore)(e,t,r((0,g.applyMiddleware)(...n)))}(a,n,r)),this.buildSystem(!1),this.register(this.plugins)}getStore(){return this.store}register(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];var a=j(e,this.getSystem(),this.pluginsOptions);O(this.system,a),t&&this.buildSystem();N.call(this.system,e,this.getSystem())&&this.buildSystem()}buildSystem(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=this.getStore().dispatch,a=this.getStore().getState;this.boundSystem=(0,c.default)({},this.getRootInjects(),this.getWrappedAndBoundActions(t),this.getWrappedAndBoundSelectors(a,this.getSystem),this.getStateThunks(a),this.getFn(),this.getConfigs()),e&&this.rebuildReducer()}_getSystem(){return this.boundSystem}getRootInjects(){var e,t,a;return(0,c.default)({getSystem:this.getSystem,getStore:(0,i.default)(e=this.getStore).call(e,this),getComponents:(0,i.default)(t=this.getComponents).call(t,this),getState:this.getStore().getState,getConfigs:(0,i.default)(a=this._getConfigs).call(a,this),Im:y.default,React:h.default},this.system.rootInjects||{})}_getConfigs(){return this.system.configs}getConfigs(){return{configs:this.system.configs}}setConfigs(e){this.system.configs=e}rebuildReducer(){var e;this.store.replaceReducer((e=this.system.statePlugins,function(e){var t;let a=(0,p.default)(t=(0,r.default)(e)).call(t,((t,a)=>(t[a]=function(e){return function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new y.Map,a=arguments.length>1?arguments[1]:void 0;if(!e)return t;let n=e[a.type];if(n){const e=k(n)(t,a);return null===e?t:e}return t}}(e[a]),t)),{});return(0,r.default)(a).length?(0,v.combineReducers)(a):_}((0,x.Ay)(e,(e=>e.reducers)))))}getType(e){let t=e[0].toUpperCase()+(0,u.default)(e).call(e,1);return(0,x.Q2)(this.system.statePlugins,((a,n)=>{let r=a[e];if(r)return{[n+t]:r}}))}getSelectors(){return this.getType("selectors")}getActions(){let e=this.getType("actions");return(0,x.Ay)(e,(e=>(0,x.Q2)(e,((e,t)=>{if((0,x.LQ)(e))return{[t]:e}}))))}getWrappedAndBoundActions(e){var t=this;let a=this.getBoundActions(e);return(0,x.Ay)(a,((e,a)=>{let n=this.system.statePlugins[(0,u.default)(a).call(a,0,-7)].wrapActions;return n?(0,x.Ay)(e,((e,a)=>{let r=n[a];return r?((0,d.default)(r)||(r=[r]),(0,p.default)(r).call(r,((e,a)=>{let n=function(){return a(e,t.getSystem())(...arguments)};if(!(0,x.LQ)(n))throw new TypeError("wrapActions needs to return a function that returns a new function (ie the wrapped action)");return k(n)}),e||Function.prototype)):e})):e}))}getWrappedAndBoundSelectors(e,t){var a=this;let n=this.getBoundSelectors(e,t);return(0,x.Ay)(n,((t,n)=>{let r=[(0,u.default)(n).call(n,0,-9)],s=this.system.statePlugins[r].wrapSelectors;return s?(0,x.Ay)(t,((t,n)=>{let o=s[n];return o?((0,d.default)(o)||(o=[o]),(0,p.default)(o).call(o,((t,n)=>{let s=function(){for(var s=arguments.length,o=new Array(s),l=0;l(t[a]=e.get(a),t)),{})}getStateThunks(e){var t;return(0,p.default)(t=(0,r.default)(this.system.statePlugins)).call(t,((t,a)=>(t[a]=()=>e().get(a),t)),{})}getFn(){return{fn:this.system.fn}}getComponents(e){const t=this.system.components[e];return(0,d.default)(t)?(0,p.default)(t).call(t,((e,t)=>t(e,this.getSystem()))):void 0!==e?this.system.components[e]:this.system.components}getBoundSelectors(e,t){return(0,x.Ay)(this.getSelectors(),((a,n)=>{let r=[(0,u.default)(n).call(n,0,-9)];return(0,x.Ay)(a,(a=>function(){for(var n=arguments.length,s=new Array(n),o=0;o"function"!=typeof e?(0,x.Ay)(e,(e=>a(e))):function(){var t=null;try{t=e(...arguments)}catch(e){t={type:w.NEW_THROWN_ERR,error:!0,payload:(0,E.serializeError)(e)}}finally{return t}};return(0,x.Ay)(t,(t=>(0,g.bindActionCreators)(a(t),e)))}getMapStateToProps(){return()=>(0,c.default)({},this.getSystem())}getMapDispatchToProps(e){return t=>l()({},this.getWrappedAndBoundActions(t),this.getFn(),e)}}function j(e,t,a){if((0,x.Kn)(e)&&!(0,x.kJ)(e))return(0,S.default)({},e);if((0,x.Wl)(e))return j(e(t),t,a);if((0,x.kJ)(e)){var n;const r="chain"===a.pluginLoadType?t.getComponents():{};return(0,p.default)(n=(0,m.default)(e).call(e,(e=>j(e,t,a)))).call(n,O,r)}return{}}function N(e,t){let{hasLoaded:a}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=a;return(0,x.Kn)(e)&&!(0,x.kJ)(e)&&"function"==typeof e.afterLoad&&(n=!0,k(e.afterLoad).call(this,t)),(0,x.Wl)(e)?N.call(this,e(t),t,{hasLoaded:n}):(0,x.kJ)(e)?(0,m.default)(e).call(e,(e=>N.call(this,e,t,{hasLoaded:n}))):n}function O(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!(0,x.Kn)(e))return{};if(!(0,x.Kn)(t))return e;t.wrapComponents&&((0,x.Ay)(t.wrapComponents,((a,n)=>{const r=e.components&&e.components[n];r&&(0,d.default)(r)?(e.components[n]=(0,f.default)(r).call(r,[a]),delete t.wrapComponents[n]):r&&(e.components[n]=[r,a],delete t.wrapComponents[n])})),(0,r.default)(t.wrapComponents).length||delete t.wrapComponents);const{statePlugins:a}=e;if((0,x.Kn)(a))for(let e in a){const r=a[e];if(!(0,x.Kn)(r))continue;const{wrapActions:o,wrapSelectors:l}=r;if((0,x.Kn)(o))for(let a in o){let r=o[a];var n;if((0,d.default)(r)||(r=[r],o[a]=r),t&&t.statePlugins&&t.statePlugins[e]&&t.statePlugins[e].wrapActions&&t.statePlugins[e].wrapActions[a])t.statePlugins[e].wrapActions[a]=(0,f.default)(n=o[a]).call(n,t.statePlugins[e].wrapActions[a])}if((0,x.Kn)(l))for(let a in l){let n=l[a];var s;if((0,d.default)(n)||(n=[n],l[a]=n),t&&t.statePlugins&&t.statePlugins[e]&&t.statePlugins[e].wrapSelectors&&t.statePlugins[e].wrapSelectors[a])t.statePlugins[e].wrapSelectors[a]=(0,f.default)(s=l[a]).call(s,t.statePlugins[e].wrapSelectors[a])}}return l()(e,t)}function k(e){let{logErrors:t=!0}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"function"!=typeof e?e:function(){try{for(var a=arguments.length,n=new Array(a),r=0;r{let{layoutActions:e,tag:t,operationId:a,isShown:n}=this.props;const r=this.getResolvedSubtree();n||void 0!==r||this.requestResolvedSubtree(),e.show(["operations",t,a],!n)})),(0,W.default)(this,"onCancelClick",(()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})})),(0,W.default)(this,"onTryoutClick",(()=>{this.setState({tryItOutEnabled:!this.state.tryItOutEnabled})})),(0,W.default)(this,"onResetClick",(e=>{const t=this.props.oas3Selectors.selectDefaultRequestBodyValue(...e);this.props.oas3Actions.setRequestBodyValue({value:t,pathMethod:e})})),(0,W.default)(this,"onExecute",(()=>{this.setState({executeInProgress:!0})})),(0,W.default)(this,"getResolvedSubtree",(()=>{const{specSelectors:e,path:t,method:a,specPath:n}=this.props;return n?e.specResolvedSubtree(n.toJS()):e.specResolvedSubtree(["paths",t,a])})),(0,W.default)(this,"requestResolvedSubtree",(()=>{const{specActions:e,path:t,method:a,specPath:n}=this.props;return n?e.requestResolvedSubtree(n.toJS()):e.requestResolvedSubtree(["paths",t,a])}));const{tryItOutEnabled:a}=e.getConfigs();this.state={tryItOutEnabled:!0===a||"true"===a,executeInProgress:!1}}mapStateToProps(e,t){const{op:a,layoutSelectors:n,getConfigs:r}=t,{docExpansion:s,deepLinking:o,displayOperationId:l,displayRequestDuration:i,supportedSubmitMethods:c}=r(),u=n.showSummary(),d=a.getIn(["operation","__originalOperationId"])||a.getIn(["operation","operationId"])||(0,G.opId)(a.get("operation"),t.path,t.method)||a.get("id"),p=["operations",t.tag,d],m=o&&"false"!==o,f=(0,H.default)(c).call(c,t.method)>=0&&(void 0===t.allowTryItOut?t.specSelectors.allowTryItOutFor(t.path,t.method):t.allowTryItOut),h=a.getIn(["operation","security"])||t.specSelectors.security();return{operationId:d,isDeepLinkingEnabled:m,showSummary:u,displayOperationId:l,displayRequestDuration:i,allowTryItOut:f,security:h,isAuthorized:t.authSelectors.isAuthorized(h),isShown:n.isShown(p,"full"===s),jumpToKey:`paths.${t.path}.${t.method}`,response:t.specSelectors.responseFor(t.path,t.method),request:t.specSelectors.requestFor(t.path,t.method)}}componentDidMount(){const{isShown:e}=this.props,t=this.getResolvedSubtree();e&&void 0===t&&this.requestResolvedSubtree()}UNSAFE_componentWillReceiveProps(e){const{response:t,isShown:a}=e,n=this.getResolvedSubtree();t!==this.props.response&&this.setState({executeInProgress:!1}),a&&void 0===n&&this.requestResolvedSubtree()}render(){let{op:e,tag:t,path:a,method:n,security:r,isAuthorized:s,operationId:o,showSummary:l,isShown:i,jumpToKey:c,allowTryItOut:u,response:d,request:p,displayOperationId:m,displayRequestDuration:f,isDeepLinkingEnabled:g,specPath:v,specSelectors:E,specActions:S,getComponent:w,getConfigs:b,layoutSelectors:x,layoutActions:_,authActions:C,authSelectors:j,oas3Actions:N,oas3Selectors:O,fn:k}=this.props;const A=w("operation"),I=this.getResolvedSubtree()||(0,y.Map)(),R=(0,y.fromJS)({op:I,tag:t,path:a,summary:e.getIn(["operation","summary"])||"",deprecated:I.get("deprecated")||e.getIn(["operation","deprecated"])||!1,method:n,security:r,isAuthorized:s,operationId:o,originalOperationId:I.getIn(["operation","__originalOperationId"]),showSummary:l,isShown:i,jumpToKey:c,allowTryItOut:u,request:p,displayOperationId:m,displayRequestDuration:f,isDeepLinkingEnabled:g,executeInProgress:this.state.executeInProgress,tryItOutEnabled:this.state.tryItOutEnabled});return h.default.createElement(A,{operation:R,response:d,request:p,isShown:i,toggleShown:this.toggleShown,onTryoutClick:this.onTryoutClick,onResetClick:this.onResetClick,onCancelClick:this.onCancelClick,onExecute:this.onExecute,specPath:v,specActions:S,specSelectors:E,oas3Actions:N,oas3Selectors:O,layoutActions:_,layoutSelectors:x,authActions:C,authSelectors:j,getComponent:w,getConfigs:b,fn:k})}}(0,W.default)(Z,"defaultProps",{showSummary:!0,response:null,allowTryItOut:!0,displayOperationId:!1,displayRequestDuration:!1});class Y extends h.default.Component{getLayout(){let{getComponent:e,layoutSelectors:t}=this.props;const a=t.current(),n=e(a,!0);return n||(()=>h.default.createElement("h1",null,' No layout defined for "',a,'" '))}render(){const e=this.getLayout();return h.default.createElement(e,null)}}Y.defaultProps={};class X extends h.default.Component{constructor(){super(...arguments),(0,W.default)(this,"close",(()=>{let{authActions:e}=this.props;e.showDefinitions(!1)}))}render(){var e;let{authSelectors:t,authActions:a,getComponent:n,errSelectors:r,specSelectors:s,fn:{AST:o={}}}=this.props,l=t.shownDefinitions();const i=n("auths"),c=n("CloseIcon");return h.default.createElement("div",{className:"dialog-ux"},h.default.createElement("div",{className:"backdrop-ux"}),h.default.createElement("div",{className:"modal-ux"},h.default.createElement("div",{className:"modal-dialog-ux"},h.default.createElement("div",{className:"modal-ux-inner"},h.default.createElement("div",{className:"modal-ux-header"},h.default.createElement("h3",null,"Available authorizations"),h.default.createElement("button",{type:"button",className:"close-modal",onClick:this.close},h.default.createElement(c,null))),h.default.createElement("div",{className:"modal-ux-content"},(0,m.default)(e=l.valueSeq()).call(e,((e,l)=>h.default.createElement(i,{key:l,AST:o,definitions:e,getComponent:n,errSelectors:r,authSelectors:t,authActions:a,specSelectors:s}))))))))}}class Q extends h.default.Component{render(){let{isAuthorized:e,showPopup:t,onClick:a,getComponent:n}=this.props;const r=n("authorizationPopup",!0),s=n("LockAuthIcon",!0),o=n("UnlockAuthIcon",!0);return h.default.createElement("div",{className:"auth-wrapper"},h.default.createElement("button",{className:e?"btn authorize locked":"btn authorize unlocked",onClick:a},h.default.createElement("span",null,"Authorize"),e?h.default.createElement(s,null):h.default.createElement(o,null)),t&&h.default.createElement(r,null))}}class ee extends h.default.Component{render(){const{authActions:e,authSelectors:t,specSelectors:a,getComponent:n}=this.props,r=a.securityDefinitions(),s=t.definitionsToAuthorize(),o=n("authorizeBtn");return r?h.default.createElement(o,{onClick:()=>e.showDefinitions(s),isAuthorized:!!t.authorized().size,showPopup:!!t.shownDefinitions(),getComponent:n}):null}}class te extends h.default.Component{constructor(){super(...arguments),(0,W.default)(this,"onClick",(e=>{e.stopPropagation();let{onClick:t}=this.props;t&&t()}))}render(){let{isAuthorized:e,getComponent:t}=this.props;const a=t("LockAuthOperationIcon",!0),n=t("UnlockAuthOperationIcon",!0);return h.default.createElement("button",{className:"authorization__btn","aria-label":e?"authorization button locked":"authorization button unlocked",onClick:this.onClick},e?h.default.createElement(a,{className:"locked"}):h.default.createElement(n,{className:"unlocked"}))}}class ae extends h.default.Component{constructor(e,t){super(e,t),(0,W.default)(this,"onAuthChange",(e=>{let{name:t}=e;this.setState({[t]:e})})),(0,W.default)(this,"submitAuth",(e=>{e.preventDefault();let{authActions:t}=this.props;t.authorizeWithPersistOption(this.state)})),(0,W.default)(this,"logoutClick",(e=>{e.preventDefault();let{authActions:t,definitions:a}=this.props,n=(0,m.default)(a).call(a,((e,t)=>t)).toArray();this.setState((0,p.default)(n).call(n,((e,t)=>(e[t]="",e)),{})),t.logoutWithPersistOption(n)})),(0,W.default)(this,"close",(e=>{e.preventDefault();let{authActions:t}=this.props;t.showDefinitions(!1)})),this.state={}}render(){var e;let{definitions:t,getComponent:a,authSelectors:r,errSelectors:s}=this.props;const o=a("AuthItem"),l=a("oauth2",!0),i=a("Button");let c=r.authorized(),u=(0,n.default)(t).call(t,((e,t)=>!!c.get(t))),d=(0,n.default)(t).call(t,(e=>"oauth2"!==e.get("type"))),p=(0,n.default)(t).call(t,(e=>"oauth2"===e.get("type")));return h.default.createElement("div",{className:"auth-container"},!!d.size&&h.default.createElement("form",{onSubmit:this.submitAuth},(0,m.default)(d).call(d,((e,t)=>h.default.createElement(o,{key:t,schema:e,name:t,getComponent:a,onAuthChange:this.onAuthChange,authorized:c,errSelectors:s}))).toArray(),h.default.createElement("div",{className:"auth-btn-wrapper"},d.size===u.size?h.default.createElement(i,{className:"btn modal-btn auth",onClick:this.logoutClick},"Logout"):h.default.createElement(i,{type:"submit",className:"btn modal-btn auth authorize"},"Authorize"),h.default.createElement(i,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close"))),p&&p.size?h.default.createElement("div",null,h.default.createElement("div",{className:"scope-def"},h.default.createElement("p",null,"Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes."),h.default.createElement("p",null,"API requires the following scopes. Select which ones you want to grant to Swagger UI.")),(0,m.default)(e=(0,n.default)(t).call(t,(e=>"oauth2"===e.get("type")))).call(e,((e,t)=>h.default.createElement("div",{key:t},h.default.createElement(l,{authorized:c,schema:e,name:t})))).toArray()):null)}}class ne extends h.default.Component{render(){let{schema:e,name:t,getComponent:a,onAuthChange:n,authorized:r,errSelectors:s}=this.props;const o=a("apiKeyAuth"),l=a("basicAuth");let i;const c=e.get("type");switch(c){case"apiKey":i=h.default.createElement(o,{key:t,schema:e,name:t,errSelectors:s,authorized:r,getComponent:a,onChange:n});break;case"basic":i=h.default.createElement(l,{key:t,schema:e,name:t,errSelectors:s,authorized:r,getComponent:a,onChange:n});break;default:i=h.default.createElement("div",{key:t},"Unknown security definition type ",c)}return h.default.createElement("div",{key:`${t}-jump`},i)}}class re extends h.default.Component{render(){let{error:e}=this.props,t=e.get("level"),a=e.get("message"),n=e.get("source");return h.default.createElement("div",{className:"errors"},h.default.createElement("b",null,n," ",t),h.default.createElement("span",null,a))}}class se extends h.default.Component{constructor(e,t){super(e,t),(0,W.default)(this,"onChange",(e=>{let{onChange:t}=this.props,a=e.target.value,n=(0,c.default)({},this.state,{value:a});this.setState(n),t(n)}));let{name:a,schema:n}=this.props,r=this.getValue();this.state={name:a,schema:n,value:r}}getValue(){let{name:e,authorized:t}=this.props;return t&&t.getIn([e,"value"])}render(){var e,t;let{schema:a,getComponent:r,errSelectors:s,name:o}=this.props;const l=r("Input"),i=r("Row"),c=r("Col"),u=r("authError"),d=r("Markdown",!0),p=r("JumpToPath",!0);let f=this.getValue(),g=(0,n.default)(e=s.allErrors()).call(e,(e=>e.get("authId")===o));return h.default.createElement("div",null,h.default.createElement("h4",null,h.default.createElement("code",null,o||a.get("name"))," (apiKey)",h.default.createElement(p,{path:["securityDefinitions",o]})),f&&h.default.createElement("h6",null,"Authorized"),h.default.createElement(i,null,h.default.createElement(d,{source:a.get("description")})),h.default.createElement(i,null,h.default.createElement("p",null,"Name: ",h.default.createElement("code",null,a.get("name")))),h.default.createElement(i,null,h.default.createElement("p",null,"In: ",h.default.createElement("code",null,a.get("in")))),h.default.createElement(i,null,h.default.createElement("label",null,"Value:"),f?h.default.createElement("code",null," ****** "):h.default.createElement(c,null,h.default.createElement(l,{type:"text",onChange:this.onChange,autoFocus:!0}))),(0,m.default)(t=g.valueSeq()).call(t,((e,t)=>h.default.createElement(u,{error:e,key:t}))))}}class oe extends h.default.Component{constructor(e,t){super(e,t),(0,W.default)(this,"onChange",(e=>{let{onChange:t}=this.props,{value:a,name:n}=e.target,r=this.state.value;r[n]=a,this.setState({value:r}),t(this.state)}));let{schema:a,name:n}=this.props,r=this.getValue().username;this.state={name:n,schema:a,value:r?{username:r}:{}}}getValue(){let{authorized:e,name:t}=this.props;return e&&e.getIn([t,"value"])||{}}render(){var e,t;let{schema:a,getComponent:r,name:s,errSelectors:o}=this.props;const l=r("Input"),i=r("Row"),c=r("Col"),u=r("authError"),d=r("JumpToPath",!0),p=r("Markdown",!0);let f=this.getValue().username,g=(0,n.default)(e=o.allErrors()).call(e,(e=>e.get("authId")===s));return h.default.createElement("div",null,h.default.createElement("h4",null,"Basic authorization",h.default.createElement(d,{path:["securityDefinitions",s]})),f&&h.default.createElement("h6",null,"Authorized"),h.default.createElement(i,null,h.default.createElement(p,{source:a.get("description")})),h.default.createElement(i,null,h.default.createElement("label",null,"Username:"),f?h.default.createElement("code",null," ",f," "):h.default.createElement(c,null,h.default.createElement(l,{type:"text",required:"required",name:"username",onChange:this.onChange,autoFocus:!0}))),h.default.createElement(i,null,h.default.createElement("label",null,"Password:"),f?h.default.createElement("code",null," ****** "):h.default.createElement(c,null,h.default.createElement(l,{autoComplete:"new-password",name:"password",type:"password",onChange:this.onChange}))),(0,m.default)(t=g.valueSeq()).call(t,((e,t)=>h.default.createElement(u,{error:e,key:t}))))}}function le(e){const{example:t,showValue:a,getComponent:n,getConfigs:r}=e,s=n("Markdown",!0),o=n("highlightCode");return t?h.default.createElement("div",{className:"example"},t.get("description")?h.default.createElement("section",{className:"example__section"},h.default.createElement("div",{className:"example__section-header"},"Example Description"),h.default.createElement("p",null,h.default.createElement(s,{source:t.get("description")}))):null,a&&t.has("value")?h.default.createElement("section",{className:"example__section"},h.default.createElement("div",{className:"example__section-header"},"Example Value"),h.default.createElement(o,{getConfigs:r,value:(0,x.Pz)(t.get("value"))})):null):null}var ie=pt(6914);class ce extends h.default.PureComponent{constructor(){var e;super(...arguments),e=this,(0,W.default)(this,"_onSelect",(function(t){let{isSyntheticChange:a=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};"function"==typeof e.props.onSelect&&e.props.onSelect(t,{isSyntheticChange:a})})),(0,W.default)(this,"_onDomSelect",(e=>{if("function"==typeof this.props.onSelect){const t=e.target.selectedOptions[0].getAttribute("value");this._onSelect(t,{isSyntheticChange:!1})}})),(0,W.default)(this,"getCurrentExample",(()=>{const{examples:e,currentExampleKey:t}=this.props,a=e.get(t),n=e.keySeq().first(),r=e.get(n);return a||r||(0,ie.default)({})}))}componentDidMount(){const{onSelect:e,examples:t}=this.props;if("function"==typeof e){const e=t.first(),a=t.keyOf(e);this._onSelect(a,{isSyntheticChange:!0})}}UNSAFE_componentWillReceiveProps(e){const{currentExampleKey:t,examples:a}=e;if(a!==this.props.examples&&!a.has(t)){const e=a.first(),t=a.keyOf(e);this._onSelect(t,{isSyntheticChange:!0})}}render(){const{examples:e,currentExampleKey:t,isValueModified:a,isModifiedValueAvailable:n,showLabels:r}=this.props;return h.default.createElement("div",{className:"examples-select"},r?h.default.createElement("span",{className:"examples-select__section-label"},"Examples: "):null,h.default.createElement("select",{className:"examples-select-element",onChange:this._onDomSelect,value:n&&a?"__MODIFIED__VALUE__":t||""},n?h.default.createElement("option",{value:"__MODIFIED__VALUE__"},"[Modified value]"):null,(0,m.default)(e).call(e,((e,t)=>h.default.createElement("option",{key:t,value:t},e.get("summary")||t))).valueSeq()))}}(0,W.default)(ce,"defaultProps",{examples:y.default.Map({}),onSelect:function(){for(var e=arguments.length,t=new Array(e),a=0;ay.List.isList(e)?e:(0,x.Pz)(e);class de extends h.default.PureComponent{constructor(e){var t;super(e),t=this,(0,W.default)(this,"_getStateForCurrentNamespace",(()=>{const{currentNamespace:e}=this.props;return(this.state[e]||(0,y.Map)()).toObject()})),(0,W.default)(this,"_setStateForCurrentNamespace",(e=>{const{currentNamespace:t}=this.props;return this._setStateForNamespace(t,e)})),(0,W.default)(this,"_setStateForNamespace",((e,t)=>{const a=(this.state[e]||(0,y.Map)()).mergeDeep(t);return this.setState({[e]:a})})),(0,W.default)(this,"_isCurrentUserInputSameAsExampleValue",(()=>{const{currentUserInputValue:e}=this.props;return this._getCurrentExampleValue()===e})),(0,W.default)(this,"_getValueForExample",((e,t)=>{const{examples:a}=t||this.props;return ue((a||(0,y.Map)({})).getIn([e,"value"]))})),(0,W.default)(this,"_getCurrentExampleValue",(e=>{const{currentKey:t}=e||this.props;return this._getValueForExample(t,e||this.props)})),(0,W.default)(this,"_onExamplesSelect",(function(e){let{isSyntheticChange:a}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{onSelect:n,updateValue:r,currentUserInputValue:s,userHasEditedBody:o}=t.props,{lastUserEditedValue:l}=t._getStateForCurrentNamespace(),i=t._getValueForExample(e);if("__MODIFIED__VALUE__"===e)return r(ue(l)),t._setStateForCurrentNamespace({isModifiedValueSelected:!0});if("function"==typeof n){for(var c=arguments.length,u=new Array(c>2?c-2:0),d=2;de.get("value")===t||(0,x.Pz)(e.get("value"))===t));if(c.size){let t;t=c.has(e.currentKey)?e.currentKey:c.keySeq().first(),r(t,{isSyntheticChange:!0})}else t!==this.props.currentUserInputValue&&t!==o&&t!==l&&(this.props.setRetainRequestBodyValueFlag(!0),this._setStateForNamespace(e.currentNamespace,{lastUserEditedValue:e.currentUserInputValue,isModifiedValueSelected:s||t!==i}))}render(){const{currentUserInputValue:e,examples:t,currentKey:a,getComponent:n,userHasEditedBody:r}=this.props,{lastDownstreamValue:s,lastUserEditedValue:o,isModifiedValueSelected:l}=this._getStateForCurrentNamespace(),i=n("ExamplesSelect");return h.default.createElement(i,{examples:t,currentExampleKey:a,onSelect:this._onExamplesSelect,isModifiedValueAvailable:!!o&&o!==s,isValueModified:void 0!==e&&l&&e!==this._getCurrentExampleValue()||r})}}(0,W.default)(de,"defaultProps",{userHasEditedBody:!1,examples:(0,y.Map)({}),currentNamespace:"__DEFAULT__NAMESPACE__",setRetainRequestBodyValueFlag:()=>{},onSelect:function(){for(var e=arguments.length,t=new Array(e),a=0;a{e.preventDefault();let{authActions:t}=this.props;t.showDefinitions(!1)})),(0,W.default)(this,"authorize",(()=>{let{authActions:e,errActions:t,getConfigs:a,authSelectors:n,oas3Selectors:r}=this.props,s=a(),o=n.getConfigs();t.clear({authId:name,type:"auth",source:"auth"}),function(e){let{auth:t,authActions:a,errActions:n,configs:r,authConfigs:s={},currentServer:o}=e,{schema:l,scopes:i,name:c,clientId:u}=t,p=l.get("flow"),f=[];switch(p){case"password":return void a.authorizePassword(t);case"application":case"clientCredentials":case"client_credentials":return void a.authorizeApplication(t);case"accessCode":case"authorizationCode":case"authorization_code":f.push("response_type=code");break;case"implicit":f.push("response_type=token")}"string"==typeof u&&f.push("client_id="+encodeURIComponent(u));let h=r.oauth2RedirectUrl;if(void 0===h)return void n.newAuthErr({authId:c,source:"validation",level:"error",message:"oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed."});f.push("redirect_uri="+encodeURIComponent(h));let g=[];if((0,d.default)(i)?g=i:y.default.List.isList(i)&&(g=i.toArray()),g.length>0){let e=s.scopeSeparator||" ";f.push("scope="+encodeURIComponent(g.join(e)))}let v=(0,x.r3)(new Date);if(f.push("state="+encodeURIComponent(v)),void 0!==s.realm&&f.push("realm="+encodeURIComponent(s.realm)),("authorizationCode"===p||"authorization_code"===p||"accessCode"===p)&&s.usePkceWithAuthorizationCodeGrant){const e=(0,x.Uj)(),a=(0,x.Xb)(e);f.push("code_challenge="+a),f.push("code_challenge_method=S256"),t.codeVerifier=e}let{additionalQueryStringParams:E}=s;for(let e in E){var S;void 0!==E[e]&&f.push((0,m.default)(S=[e,E[e]]).call(S,encodeURIComponent).join("="))}const w=l.get("authorizationUrl");let b;b=o?(0,he.default)((0,x.Nm)(w),o,!0).toString():(0,x.Nm)(w);let _,C=[b,f.join("&")].join(-1===(0,H.default)(w).call(w,"?")?"?":"&");_="implicit"===p?a.preAuthorizeImplicit:s.useBasicAuthenticationWithAccessCodeGrant?a.authorizeAccessCodeWithBasicAuthentication:a.authorizeAccessCodeWithFormParams,a.authPopup(C,{auth:t,state:v,redirectUrl:h,callback:_,errCb:n.newAuthErr})}({auth:this.state,currentServer:r.serverEffectiveValue(r.selectedServer()),authActions:e,errActions:t,configs:s,authConfigs:o})})),(0,W.default)(this,"onScopeChange",(e=>{var t,a;let{target:r}=e,{checked:s}=r,o=r.dataset.value;if(s&&-1===(0,H.default)(t=this.state.scopes).call(t,o)){var l;let e=(0,f.default)(l=this.state.scopes).call(l,[o]);this.setState({scopes:e})}else if(!s&&(0,H.default)(a=this.state.scopes).call(a,o)>-1){var i;this.setState({scopes:(0,n.default)(i=this.state.scopes).call(i,(e=>e!==o))})}})),(0,W.default)(this,"onInputChange",(e=>{let{target:{dataset:{name:t},value:a}}=e,n={[t]:a};this.setState(n)})),(0,W.default)(this,"selectScopes",(e=>{var t;e.target.dataset.all?this.setState({scopes:(0,pe.default)((0,me.default)(t=this.props.schema.get("allowedScopes")||this.props.schema.get("scopes")).call(t))}):this.setState({scopes:[]})})),(0,W.default)(this,"logout",(e=>{e.preventDefault();let{authActions:t,errActions:a,name:n}=this.props;a.clear({authId:n,type:"auth",source:"auth"}),t.logoutWithPersistOption([n])}));let{name:a,schema:r,authorized:s,authSelectors:o}=this.props,l=s&&s.get(a),i=o.getConfigs()||{},c=l&&l.get("username")||"",u=l&&l.get("clientId")||i.clientId||"",p=l&&l.get("clientSecret")||i.clientSecret||"",h=l&&l.get("passwordType")||"basic",g=l&&l.get("scopes")||i.scopes||[];"string"==typeof g&&(g=g.split(i.scopeSeparator||" ")),this.state={appName:i.appName,name:a,schema:r,scopes:g,clientId:u,clientSecret:p,username:c,password:"",passwordType:h}}render(){var e,t;let{schema:a,getComponent:r,authSelectors:s,errSelectors:o,name:l,specSelectors:i}=this.props;const c=r("Input"),u=r("Row"),d=r("Col"),p=r("Button"),f=r("authError"),g=r("JumpToPath",!0),y=r("Markdown",!0),v=r("InitializedInput"),{isOAS3:E}=i;let S=E()?a.get("openIdConnectUrl"):null;const w="implicit",b="password",x=E()?S?"authorization_code":"authorizationCode":"accessCode",_=E()?S?"client_credentials":"clientCredentials":"application";let C=!!(s.getConfigs()||{}).usePkceWithAuthorizationCodeGrant,j=a.get("flow"),N=j===x&&C?j+" with PKCE":j,O=a.get("allowedScopes")||a.get("scopes"),k=!!s.authorized().get(l),A=(0,n.default)(e=o.allErrors()).call(e,(e=>e.get("authId")===l)),I=!(0,n.default)(A).call(A,(e=>"validation"===e.get("source"))).size,R=a.get("description");return h.default.createElement("div",null,h.default.createElement("h4",null,l," (OAuth2, ",N,") ",h.default.createElement(g,{path:["securityDefinitions",l]})),this.state.appName?h.default.createElement("h5",null,"Application: ",this.state.appName," "):null,R&&h.default.createElement(y,{source:a.get("description")}),k&&h.default.createElement("h6",null,"Authorized"),S&&h.default.createElement("p",null,"OpenID Connect URL: ",h.default.createElement("code",null,S)),(j===w||j===x)&&h.default.createElement("p",null,"Authorization URL: ",h.default.createElement("code",null,a.get("authorizationUrl"))),(j===b||j===x||j===_)&&h.default.createElement("p",null,"Token URL:",h.default.createElement("code",null," ",a.get("tokenUrl"))),h.default.createElement("p",{className:"flow"},"Flow: ",h.default.createElement("code",null,N)),j!==b?null:h.default.createElement(u,null,h.default.createElement(u,null,h.default.createElement("label",{htmlFor:"oauth_username"},"username:"),k?h.default.createElement("code",null," ",this.state.username," "):h.default.createElement(d,{tablet:10,desktop:10},h.default.createElement("input",{id:"oauth_username",type:"text","data-name":"username",onChange:this.onInputChange,autoFocus:!0}))),h.default.createElement(u,null,h.default.createElement("label",{htmlFor:"oauth_password"},"password:"),k?h.default.createElement("code",null," ****** "):h.default.createElement(d,{tablet:10,desktop:10},h.default.createElement("input",{id:"oauth_password",type:"password","data-name":"password",onChange:this.onInputChange}))),h.default.createElement(u,null,h.default.createElement("label",{htmlFor:"password_type"},"Client credentials location:"),k?h.default.createElement("code",null," ",this.state.passwordType," "):h.default.createElement(d,{tablet:10,desktop:10},h.default.createElement("select",{id:"password_type","data-name":"passwordType",onChange:this.onInputChange},h.default.createElement("option",{value:"basic"},"Authorization header"),h.default.createElement("option",{value:"request-body"},"Request body"))))),(j===_||j===w||j===x||j===b)&&(!k||k&&this.state.clientId)&&h.default.createElement(u,null,h.default.createElement("label",{htmlFor:"client_id"},"client_id:"),k?h.default.createElement("code",null," ****** "):h.default.createElement(d,{tablet:10,desktop:10},h.default.createElement(v,{id:"client_id",type:"text",required:j===b,initialValue:this.state.clientId,"data-name":"clientId",onChange:this.onInputChange}))),(j===_||j===x||j===b)&&h.default.createElement(u,null,h.default.createElement("label",{htmlFor:"client_secret"},"client_secret:"),k?h.default.createElement("code",null," ****** "):h.default.createElement(d,{tablet:10,desktop:10},h.default.createElement(v,{id:"client_secret",initialValue:this.state.clientSecret,type:"password","data-name":"clientSecret",onChange:this.onInputChange}))),!k&&O&&O.size?h.default.createElement("div",{className:"scopes"},h.default.createElement("h2",null,"Scopes:",h.default.createElement("a",{onClick:this.selectScopes,"data-all":!0},"select all"),h.default.createElement("a",{onClick:this.selectScopes},"select none")),(0,m.default)(O).call(O,((e,t)=>{var a;return h.default.createElement(u,{key:t},h.default.createElement("div",{className:"checkbox"},h.default.createElement(c,{"data-value":t,id:`${t}-${j}-checkbox-${this.state.name}`,disabled:k,checked:(0,fe.default)(a=this.state.scopes).call(a,t),type:"checkbox",onChange:this.onScopeChange}),h.default.createElement("label",{htmlFor:`${t}-${j}-checkbox-${this.state.name}`},h.default.createElement("span",{className:"item"}),h.default.createElement("div",{className:"text"},h.default.createElement("p",{className:"name"},t),h.default.createElement("p",{className:"description"},e)))))})).toArray()):null,(0,m.default)(t=A.valueSeq()).call(t,((e,t)=>h.default.createElement(f,{error:e,key:t}))),h.default.createElement("div",{className:"auth-btn-wrapper"},I&&(k?h.default.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.logout},"Logout"):h.default.createElement(p,{className:"btn modal-btn auth authorize",onClick:this.authorize},"Authorize")),h.default.createElement(p,{className:"btn modal-btn auth btn-done",onClick:this.close},"Close")))}}class ye extends h.Component{constructor(){super(...arguments),(0,W.default)(this,"onClick",(()=>{let{specActions:e,path:t,method:a}=this.props;e.clearResponse(t,a),e.clearRequest(t,a)}))}render(){return h.default.createElement("button",{className:"btn btn-clear opblock-control__btn",onClick:this.onClick},"Clear")}}const ve=e=>{let{headers:t}=e;return h.default.createElement("div",null,h.default.createElement("h5",null,"Response headers"),h.default.createElement("pre",{className:"microlight"},t))},Ee=e=>{let{duration:t}=e;return h.default.createElement("div",null,h.default.createElement("h5",null,"Request duration"),h.default.createElement("pre",{className:"microlight"},t," ms"))};class Se extends h.default.Component{shouldComponentUpdate(e){return this.props.response!==e.response||this.props.path!==e.path||this.props.method!==e.method||this.props.displayRequestDuration!==e.displayRequestDuration}render(){const{response:e,getComponent:t,getConfigs:a,displayRequestDuration:n,specSelectors:s,path:o,method:l}=this.props,{showMutatedRequest:i,requestSnippetsEnabled:c}=a(),u=i?s.mutatedRequestFor(o,l):s.requestFor(o,l),p=e.get("status"),f=u.get("url"),g=e.get("headers").toJS(),y=e.get("notDocumented"),v=e.get("error"),E=e.get("text"),S=e.get("duration"),w=(0,r.default)(g),b=g["content-type"]||g["Content-Type"],x=t("responseBody"),_=(0,m.default)(w).call(w,(e=>{var t=(0,d.default)(g[e])?g[e].join():g[e];return h.default.createElement("span",{className:"headerline",key:e}," ",e,": ",t," ")})),C=0!==_.length,j=t("Markdown",!0),N=t("RequestSnippets",!0),O=t("curl");return h.default.createElement("div",null,u&&(!0===c||"true"===c?h.default.createElement(N,{request:u}):h.default.createElement(O,{request:u,getConfigs:a})),f&&h.default.createElement("div",null,h.default.createElement("div",{className:"request-url"},h.default.createElement("h4",null,"Request URL"),h.default.createElement("pre",{className:"microlight"},f))),h.default.createElement("h4",null,"Server response"),h.default.createElement("table",{className:"responses-table live-responses-table"},h.default.createElement("thead",null,h.default.createElement("tr",{className:"responses-header"},h.default.createElement("td",{className:"col_header response-col_status"},"Code"),h.default.createElement("td",{className:"col_header response-col_description"},"Details"))),h.default.createElement("tbody",null,h.default.createElement("tr",{className:"response"},h.default.createElement("td",{className:"response-col_status"},p,y?h.default.createElement("div",{className:"response-undocumented"},h.default.createElement("i",null," Undocumented ")):null),h.default.createElement("td",{className:"response-col_description"},v?h.default.createElement(j,{source:`${""!==e.get("name")?`${e.get("name")}: `:""}${e.get("message")}`}):null,E?h.default.createElement(x,{content:E,contentType:b,url:f,headers:g,getConfigs:a,getComponent:t}):null,C?h.default.createElement(ve,{headers:_}):null,n&&S?h.default.createElement(Ee,{duration:S}):null)))))}}var we=pt(5623);class be extends h.default.Component{constructor(){super(...arguments),(0,W.default)(this,"renderOperationTag",((e,t)=>{const{specSelectors:a,getComponent:n,oas3Selectors:r,layoutSelectors:s,layoutActions:o,getConfigs:l}=this.props,i=a.validOperationMethods(),c=n("OperationContainer",!0),u=n("OperationTag"),d=e.get("operations");return h.default.createElement(u,{key:"operation-"+t,tagObj:e,tag:t,oas3Selectors:r,layoutSelectors:s,layoutActions:o,getConfigs:l,getComponent:n,specUrl:a.url()},h.default.createElement("div",{className:"operation-tag-content"},(0,m.default)(d).call(d,(e=>{const a=e.get("path"),n=e.get("method"),r=y.default.List(["paths",a,n]);return-1===(0,H.default)(i).call(i,n)?null:h.default.createElement(c,{key:`${a}-${n}`,specPath:r,op:e,path:a,method:n,tag:t})})).toArray()))}))}render(){let{specSelectors:e}=this.props;const t=e.taggedOperations();return 0===t.size?h.default.createElement("h3",null," No operations defined in spec!"):h.default.createElement("div",null,(0,m.default)(t).call(t,this.renderOperationTag).toArray(),t.size<1?h.default.createElement("h3",null," No operations defined in spec! "):null)}}var xe=pt(3543);class _e extends h.default.Component{render(){const{tagObj:e,tag:t,children:a,oas3Selectors:n,layoutSelectors:r,layoutActions:s,getConfigs:o,getComponent:l,specUrl:i}=this.props;let{docExpansion:c,deepLinking:u}=o();const d=u&&"false"!==u,p=l("Collapse"),f=l("Markdown",!0),g=l("DeepLink"),y=l("Link"),v=l("ArrowUpIcon"),E=l("ArrowDownIcon");let S,w=e.getIn(["tagDetails","description"],null),b=e.getIn(["tagDetails","externalDocs","description"]),_=e.getIn(["tagDetails","externalDocs","url"]);S=(0,x.Wl)(n)&&(0,x.Wl)(n.selectedServer)?(0,xe.mn)(_,i,{selectedServer:n.selectedServer()}):_;let C=["operations-tag",t],j=r.isShown(C,"full"===c||"list"===c);return h.default.createElement("div",{className:j?"opblock-tag-section is-open":"opblock-tag-section"},h.default.createElement("h3",{onClick:()=>s.show(C,!j),className:w?"opblock-tag":"opblock-tag no-desc",id:(0,m.default)(C).call(C,(e=>(0,x.J6)(e))).join("-"),"data-tag":t,"data-is-open":j},h.default.createElement(g,{enabled:d,isShown:j,path:(0,x.oJ)(t),text:t}),w?h.default.createElement("small",null,h.default.createElement(f,{source:w})):h.default.createElement("small",null),S?h.default.createElement("div",{className:"info__externaldocs"},h.default.createElement("small",null,h.default.createElement(y,{href:(0,x.Nm)(S),onClick:e=>e.stopPropagation(),target:"_blank"},b||S))):null,h.default.createElement("button",{"aria-expanded":j,className:"expand-operation",title:j?"Collapse operation":"Expand operation",onClick:()=>s.show(C,!j)},j?h.default.createElement(v,{className:"arrow"}):h.default.createElement(E,{className:"arrow"}))),h.default.createElement(p,{isOpened:j},a))}}(0,W.default)(_e,"defaultProps",{tagObj:y.default.fromJS({}),tag:""});class Ce extends h.PureComponent{render(){let{specPath:e,response:t,request:a,toggleShown:n,onTryoutClick:r,onResetClick:s,onCancelClick:o,onExecute:l,fn:i,getComponent:c,getConfigs:u,specActions:d,specSelectors:p,authActions:f,authSelectors:g,oas3Actions:y,oas3Selectors:v}=this.props,E=this.props.operation,{deprecated:S,isShown:w,path:b,method:_,op:C,tag:j,operationId:N,allowTryItOut:O,displayRequestDuration:k,tryItOutEnabled:A,executeInProgress:I}=E.toJS(),{description:R,externalDocs:P,schemes:T}=C;const M=P?(0,xe.mn)(P.url,p.url(),{selectedServer:v.selectedServer()}):"";let D=E.getIn(["op"]),L=D.get("responses"),q=(0,x.gp)(D,["parameters"]),B=p.operationScheme(b,_),U=["operations",j,N],J=(0,x.nX)(D);const $=c("responses"),V=c("parameters"),K=c("execute"),F=c("clear"),z=c("Collapse"),W=c("Markdown",!0),H=c("schemes"),G=c("OperationServers"),Z=c("OperationExt"),Y=c("OperationSummary"),X=c("Link"),{showExtensions:Q}=u();if(L&&t&&t.size>0){let e=!L.get(String(t.get("status")))&&!L.get("default");t=t.set("notDocumented",e)}let ee=[b,_];const te=p.validationErrors([b,_]);return h.default.createElement("div",{className:S?"opblock opblock-deprecated":w?`opblock opblock-${_} is-open`:`opblock opblock-${_}`,id:(0,x.J6)(U.join("-"))},h.default.createElement(Y,{operationProps:E,isShown:w,toggleShown:n,getComponent:c,authActions:f,authSelectors:g,specPath:e}),h.default.createElement(z,{isOpened:w},h.default.createElement("div",{className:"opblock-body"},D&&D.size||null===D?null:h.default.createElement("img",{height:"32px",width:"32px",src:pt(2517),className:"opblock-loading-animation"}),S&&h.default.createElement("h4",{className:"opblock-title_normal"}," Warning: Deprecated"),R&&h.default.createElement("div",{className:"opblock-description-wrapper"},h.default.createElement("div",{className:"opblock-description"},h.default.createElement(W,{source:R}))),M?h.default.createElement("div",{className:"opblock-external-docs-wrapper"},h.default.createElement("h4",{className:"opblock-title_normal"},"Find more details"),h.default.createElement("div",{className:"opblock-external-docs"},P.description&&h.default.createElement("span",{className:"opblock-external-docs__description"},h.default.createElement(W,{source:P.description})),h.default.createElement(X,{target:"_blank",className:"opblock-external-docs__link",href:(0,x.Nm)(M)},M))):null,D&&D.size?h.default.createElement(V,{parameters:q,specPath:e.push("parameters"),operation:D,onChangeKey:ee,onTryoutClick:r,onResetClick:s,onCancelClick:o,tryItOutEnabled:A,allowTryItOut:O,fn:i,getComponent:c,specActions:d,specSelectors:p,pathMethod:[b,_],getConfigs:u,oas3Actions:y,oas3Selectors:v}):null,A?h.default.createElement(G,{getComponent:c,path:b,method:_,operationServers:D.get("servers"),pathServers:p.paths().getIn([b,"servers"]),getSelectedServer:v.selectedServer,setSelectedServer:y.setSelectedServer,setServerVariableValue:y.setServerVariableValue,getServerVariable:v.serverVariableValue,getEffectiveServerValue:v.serverEffectiveValue}):null,A&&O&&T&&T.size?h.default.createElement("div",{className:"opblock-schemes"},h.default.createElement(H,{schemes:T,path:b,method:_,specActions:d,currentScheme:B})):null,!A||!O||te.length<=0?null:h.default.createElement("div",{className:"validation-errors errors-wrapper"},"Please correct the following validation errors and try again.",h.default.createElement("ul",null,(0,m.default)(te).call(te,((e,t)=>h.default.createElement("li",{key:t}," ",e," "))))),h.default.createElement("div",{className:A&&t&&O?"btn-group":"execute-wrapper"},A&&O?h.default.createElement(K,{operation:D,specActions:d,specSelectors:p,oas3Selectors:v,oas3Actions:y,path:b,method:_,onExecute:l,disabled:I}):null,A&&t&&O?h.default.createElement(F,{specActions:d,path:b,method:_}):null),I?h.default.createElement("div",{className:"loading-container"},h.default.createElement("div",{className:"loading"})):null,L?h.default.createElement($,{responses:L,request:a,tryItOutResponse:t,getComponent:c,getConfigs:u,specSelectors:p,oas3Actions:y,oas3Selectors:v,specActions:d,produces:p.producesOptionsFor([b,_]),producesValue:p.currentProducesFor([b,_]),specPath:e.push("responses"),path:b,method:_,displayRequestDuration:k,fn:i}):null,Q&&J.size?h.default.createElement(Z,{extensions:J,getComponent:c}):null)))}}(0,W.default)(Ce,"defaultProps",{operation:null,response:null,request:null,specPath:(0,y.List)(),summary:""});const je=(e=>{var t={};return pt.d(t,e),t})({default:()=>nt.default});class Ne extends h.PureComponent{render(){let{isShown:e,toggleShown:t,getComponent:a,authActions:n,authSelectors:r,operationProps:s,specPath:o}=this.props,{summary:l,isAuthorized:i,method:c,op:u,showSummary:d,path:p,operationId:m,originalOperationId:f,displayOperationId:g}=s.toJS(),{summary:y}=u,v=s.get("security");const E=a("authorizeOperationBtn",!0),S=a("OperationSummaryMethod"),w=a("OperationSummaryPath"),b=a("JumpToPath",!0),x=a("CopyToClipboardBtn",!0),_=a("ArrowUpIcon"),C=a("ArrowDownIcon"),j=v&&!!v.count(),N=j&&1===v.size&&v.first().isEmpty(),O=!j||N;return h.default.createElement("div",{className:`opblock-summary opblock-summary-${c}`},h.default.createElement("button",{"aria-label":`${c} ${p.replace(/\//g,"​/")}`,"aria-expanded":e,className:"opblock-summary-control",onClick:t},h.default.createElement(S,{method:c}),h.default.createElement(w,{getComponent:a,operationProps:s,specPath:o}),d?h.default.createElement("div",{className:"opblock-summary-description"},(0,je.default)(y||l)):null,g&&(f||m)?h.default.createElement("span",{className:"opblock-summary-operation-id"},f||m):null),h.default.createElement(x,{textToCopy:`${o.get(1)}`}),O?null:h.default.createElement(E,{isAuthorized:i,onClick:()=>{const e=r.definitionsForRequirements(v);n.showDefinitions(e)}}),h.default.createElement("button",{"aria-label":`${c} ${p.replace(/\//g,"​/")}`,className:"opblock-control-arrow","aria-expanded":e,tabIndex:"-1",onClick:t},e?h.default.createElement(_,{className:"arrow"}):h.default.createElement(C,{className:"arrow"})),h.default.createElement(b,{path:o}))}}(0,W.default)(Ne,"defaultProps",{operationProps:null,specPath:(0,y.List)(),summary:""});class Oe extends h.PureComponent{render(){let{method:e}=this.props;return h.default.createElement("span",{className:"opblock-summary-method"},e.toUpperCase())}}(0,W.default)(Oe,"defaultProps",{operationProps:null});const ke=(e=>{var t={};return pt.d(t,e),t})({default:()=>rt.default});class Ae extends h.PureComponent{render(){let{getComponent:e,operationProps:t}=this.props,{deprecated:a,isShown:n,path:r,tag:s,operationId:o,isDeepLinkingEnabled:l}=t.toJS();const i=r.split(/(?=\/)/g);for(let e=1;e{var t;let{extensions:a,getComponent:n}=e,r=n("OperationExtRow");return h.default.createElement("div",{className:"opblock-section"},h.default.createElement("div",{className:"opblock-section-header"},h.default.createElement("h4",null,"Extensions")),h.default.createElement("div",{className:"table-container"},h.default.createElement("table",null,h.default.createElement("thead",null,h.default.createElement("tr",null,h.default.createElement("td",{className:"col_header"},"Field"),h.default.createElement("td",{className:"col_header"},"Value"))),h.default.createElement("tbody",null,(0,m.default)(t=a.entrySeq()).call(t,(e=>{let[t,a]=e;return h.default.createElement(r,{key:`${t}-${a}`,xKey:t,xVal:a})}))))))},Re=e=>{let{xKey:t,xVal:a}=e;const n=a?a.toJS?a.toJS():a:null;return h.default.createElement("tr",null,h.default.createElement("td",null,t),h.default.createElement("td",null,(0,s.default)(n)))};var Pe=pt(29),Te=pt(8096),Me=pt(4305),De=pt(9908),Le=pt(7068);const qe=(e=>{var t={};return pt.d(t,e),t})({default:()=>st.default});var Be=pt(9874);const Ue=e=>{let{value:t,fileName:a,className:r,downloadable:s,getConfigs:o,canCopy:l,language:i}=e;const c=(0,Le.default)(o)?o():null,u=!1!==(0,De.default)(c,"syntaxHighlight")&&(0,De.default)(c,"syntaxHighlight.activated",!0),d=(0,h.useRef)(null);(0,h.useEffect)((()=>{var e;const t=(0,n.default)(e=(0,pe.default)(d.current.childNodes)).call(e,(e=>!!e.nodeType&&e.classList.contains("microlight")));return(0,Pe.default)(t).call(t,(e=>e.addEventListener("mousewheel",p,{passive:!1}))),()=>{(0,Pe.default)(t).call(t,(e=>e.removeEventListener("mousewheel",p)))}}),[t,r,i]);const p=e=>{const{target:t,deltaY:a}=e,{scrollHeight:n,offsetHeight:r,scrollTop:s}=t;n>r&&(0===s&&a<0||r+s>=n&&a>0)&&e.preventDefault()};return h.default.createElement("div",{className:"highlight-code",ref:d},l&&h.default.createElement("div",{className:"copy-to-clipboard"},h.default.createElement(Be.CopyToClipboard,{text:t},h.default.createElement("button",null))),s?h.default.createElement("button",{className:"download-contents",onClick:()=>{(0,qe.default)(t,a)}},"Download"):null,u?h.default.createElement(Me.d3,{language:i,className:(0,Te.default)(r,"microlight"),style:(0,Me.C2)((0,De.default)(c,"syntaxHighlight.theme","agate"))},t):h.default.createElement("pre",{className:(0,Te.default)(r,"microlight")},t))};Ue.defaultProps={fileName:"response.txt"};const Je=Ue;class $e extends h.default.Component{constructor(){super(...arguments),(0,W.default)(this,"onChangeProducesWrapper",(e=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],e))),(0,W.default)(this,"onResponseContentTypeChange",(e=>{let{controlsAcceptHeader:t,value:a}=e;const{oas3Actions:n,path:r,method:s}=this.props;t&&n.setResponseContentType({value:a,path:r,method:s})}))}render(){var e;let{responses:t,tryItOutResponse:a,getComponent:n,getConfigs:r,specSelectors:s,fn:o,producesValue:l,displayRequestDuration:i,specPath:c,path:u,method:d,oas3Selectors:p,oas3Actions:f}=this.props,g=(0,x.iQ)(t);const y=n("contentType"),v=n("liveResponse"),E=n("response");let S=this.props.produces&&this.props.produces.size?this.props.produces:$e.defaultProps.produces;const w=s.isOAS3()?(0,x.QG)(t):null,b=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"_";return e.replace(/[^\w-]/g,t)}(`${d}${u}_responses`),_=`${b}_select`;return h.default.createElement("div",{className:"responses-wrapper"},h.default.createElement("div",{className:"opblock-section-header"},h.default.createElement("h4",null,"Responses"),s.isOAS3()?null:h.default.createElement("label",{htmlFor:_},h.default.createElement("span",null,"Response content type"),h.default.createElement(y,{value:l,ariaControls:b,ariaLabel:"Response content type",className:"execute-content-type",contentTypes:S,controlId:_,onChange:this.onChangeProducesWrapper}))),h.default.createElement("div",{className:"responses-inner"},a?h.default.createElement("div",null,h.default.createElement(v,{response:a,getComponent:n,getConfigs:r,specSelectors:s,path:this.props.path,method:this.props.method,displayRequestDuration:i}),h.default.createElement("h4",null,"Responses")):null,h.default.createElement("table",{"aria-live":"polite",className:"responses-table",id:b,role:"region"},h.default.createElement("thead",null,h.default.createElement("tr",{className:"responses-header"},h.default.createElement("td",{className:"col_header response-col_status"},"Code"),h.default.createElement("td",{className:"col_header response-col_description"},"Description"),s.isOAS3()?h.default.createElement("td",{className:"col col_header response-col_links"},"Links"):null)),h.default.createElement("tbody",null,(0,m.default)(e=t.entrySeq()).call(e,(e=>{let[t,i]=e,m=a&&a.get("status")==t?"response_current":"";return h.default.createElement(E,{key:t,path:u,method:d,specPath:c.push(t),isDefault:g===t,fn:o,className:m,code:t,response:i,specSelectors:s,controlsAcceptHeader:i===w,onContentTypeChange:this.onResponseContentTypeChange,contentType:l,getConfigs:r,activeExamplesKey:p.activeExamplesMember(u,d,"responses",t),oas3Actions:f,getComponent:n})})).toArray()))))}}(0,W.default)($e,"defaultProps",{tryItOutResponse:null,produces:(0,y.fromJS)(["application/json"]),displayRequestDuration:!1});const Ve=(e=>{var t={};return pt.d(t,e),t})({default:()=>ot.default});var Ke=pt(2518);class Fe extends h.default.Component{constructor(e,t){super(e,t),(0,W.default)(this,"_onContentTypeChange",(e=>{const{onContentTypeChange:t,controlsAcceptHeader:a}=this.props;this.setState({responseContentType:e}),t({value:e,controlsAcceptHeader:a})})),(0,W.default)(this,"getTargetExamplesKey",(()=>{const{response:e,contentType:t,activeExamplesKey:a}=this.props,n=this.state.responseContentType||t,r=e.getIn(["content",n],(0,y.Map)({})).get("examples",null).keySeq().first();return a||r})),this.state={responseContentType:""}}render(){var e,t;let{path:a,method:n,code:r,response:s,className:o,specPath:l,fn:i,getComponent:c,getConfigs:u,specSelectors:d,contentType:p,controlsAcceptHeader:f,oas3Actions:g}=this.props,{inferSchema:v,getSampleSchema:E}=i,S=d.isOAS3();const{showExtensions:w}=u();let b=w?(0,x.nX)(s):null,_=s.get("headers"),C=s.get("links");const j=c("ResponseExtension"),N=c("headers"),O=c("highlightCode"),k=c("modelExample"),A=c("Markdown",!0),I=c("operationLink"),R=c("contentType"),P=c("ExamplesSelect"),T=c("Example");var M,D;const L=this.state.responseContentType||p,q=s.getIn(["content",L],(0,y.Map)({})),B=q.get("examples",null);if(S){const e=q.get("schema");M=e?v(e.toJS()):null,D=e?(0,y.List)(["content",this.state.responseContentType,"schema"]):l}else M=s.get("schema"),D=s.has("schema")?l.push("schema"):l;let U,J,$=!1,V={includeReadOnly:!0};if(S){var K;if(J=null===(K=q.get("schema"))||void 0===K?void 0:K.toJS(),B){const e=this.getTargetExamplesKey(),t=e=>e.get("value");U=t(B.get(e,(0,y.Map)({}))),void 0===U&&(U=t((0,Ve.default)(B).call(B).next().value)),$=!0}else void 0!==q.get("example")&&(U=q.get("example"),$=!0)}else{J=M,V={...V,includeWriteOnly:!0};const e=s.getIn(["examples",L]);e&&(U=e,$=!0)}let F=((e,t,a)=>{if(null!=e){let n=null;return(0,Ke.O)(e)&&(n="json"),h.default.createElement("div",null,h.default.createElement(t,{className:"example",getConfigs:a,language:n,value:(0,x.Pz)(e)}))}return null})(E(J,L,V,$?U:void 0),O,u);return h.default.createElement("tr",{className:"response "+(o||""),"data-code":r},h.default.createElement("td",{className:"response-col_status"},r),h.default.createElement("td",{className:"response-col_description"},h.default.createElement("div",{className:"response-col_description__inner"},h.default.createElement(A,{source:s.get("description")})),w&&b.size?(0,m.default)(e=b.entrySeq()).call(e,(e=>{let[t,a]=e;return h.default.createElement(j,{key:`${t}-${a}`,xKey:t,xVal:a})})):null,S&&s.get("content")?h.default.createElement("section",{className:"response-controls"},h.default.createElement("div",{className:(0,Te.default)("response-control-media-type",{"response-control-media-type--accept-controller":f})},h.default.createElement("small",{className:"response-control-media-type__title"},"Media type"),h.default.createElement(R,{value:this.state.responseContentType,contentTypes:s.get("content")?s.get("content").keySeq():(0,y.Seq)(),onChange:this._onContentTypeChange,ariaLabel:"Media Type"}),f?h.default.createElement("small",{className:"response-control-media-type__accept-message"},"Controls ",h.default.createElement("code",null,"Accept")," header."):null),B?h.default.createElement("div",{className:"response-control-examples"},h.default.createElement("small",{className:"response-control-examples__title"},"Examples"),h.default.createElement(P,{examples:B,currentExampleKey:this.getTargetExamplesKey(),onSelect:e=>g.setActiveExamplesMember({name:e,pathMethod:[a,n],contextType:"responses",contextName:r}),showLabels:!1})):null):null,F||M?h.default.createElement(k,{specPath:D,getComponent:c,getConfigs:u,specSelectors:d,schema:(0,x.oG)(M),example:F,includeReadOnly:!0}):null,S&&B?h.default.createElement(T,{example:B.get(this.getTargetExamplesKey(),(0,y.Map)({})),getComponent:c,getConfigs:u,omitValue:!0}):null,_?h.default.createElement(N,{headers:_,getComponent:c}):null),S?h.default.createElement("td",{className:"response-col_links"},C?(0,m.default)(t=C.toSeq().entrySeq()).call(t,(e=>{let[t,a]=e;return h.default.createElement(I,{key:t,name:t,link:a,getComponent:c})})):h.default.createElement("i",null,"No links")):null)}}(0,W.default)(Fe,"defaultProps",{response:(0,y.fromJS)({}),onContentTypeChange:()=>{}});const ze=e=>{let{xKey:t,xVal:a}=e;return h.default.createElement("div",{className:"response__extension"},t,": ",String(a))};var We=pt(3769);const He=(e=>{var t={};return pt.d(t,e),t})({default:()=>lt.default});const Ge=(e=>{var t={};return pt.d(t,e),t})({default:()=>it.default});class Ze extends h.default.PureComponent{constructor(){super(...arguments),(0,W.default)(this,"state",{parsedContent:null}),(0,W.default)(this,"updateParsedContent",(e=>{const{content:t}=this.props;if(e!==t)if(t&&t instanceof Blob){var a=new FileReader;a.onload=()=>{this.setState({parsedContent:a.result})},a.readAsText(t)}else this.setState({parsedContent:t.toString()})}))}componentDidMount(){this.updateParsedContent(null)}componentDidUpdate(e){this.updateParsedContent(e.content)}render(){let{content:e,contentType:t,url:n,headers:r={},getConfigs:o,getComponent:l}=this.props;const{parsedContent:i}=this.state,c=l("highlightCode"),u="response_"+(new Date).getTime();let d,p;if(n=n||"",(/^application\/octet-stream/i.test(t)||r["Content-Disposition"]&&/attachment/i.test(r["Content-Disposition"])||r["content-disposition"]&&/attachment/i.test(r["content-disposition"])||r["Content-Description"]&&/File Transfer/i.test(r["Content-Description"])||r["content-description"]&&/File Transfer/i.test(r["content-description"]))&&e.size>0)if("Blob"in window){let s=t||"text/html",o=e instanceof Blob?e:new Blob([e],{type:s}),l=We.default.createObjectURL(o),i=[s,n.substr((0,a.default)(n).call(n,"/")+1),l].join(":"),c=r["content-disposition"]||r["Content-Disposition"];if(void 0!==c){let e=(0,x.DR)(c);null!==e&&(i=e)}p=b.Z.navigator&&b.Z.navigator.msSaveOrOpenBlob?h.default.createElement("div",null,h.default.createElement("a",{href:l,onClick:()=>b.Z.navigator.msSaveOrOpenBlob(o,i)},"Download file")):h.default.createElement("div",null,h.default.createElement("a",{href:l,download:i},"Download file"))}else p=h.default.createElement("pre",{className:"microlight"},"Download headers detected but your browser does not support downloading binary via XHR (Blob).");else if(/json/i.test(t)){let t=null;(0,Ke.O)(e)&&(t="json");try{d=(0,s.default)(JSON.parse(e),null," ")}catch(t){d="can't parse JSON. Raw result:\n\n"+e}p=h.default.createElement(c,{language:t,downloadable:!0,fileName:`${u}.json`,value:d,getConfigs:o,canCopy:!0})}else/xml/i.test(t)?(d=(0,He.default)(e,{textNodesOnSameLine:!0,indentor:" "}),p=h.default.createElement(c,{downloadable:!0,fileName:`${u}.xml`,value:d,getConfigs:o,canCopy:!0})):p="text/html"===(0,Ge.default)(t)||/text\/plain/.test(t)?h.default.createElement(c,{downloadable:!0,fileName:`${u}.html`,value:e,getConfigs:o,canCopy:!0}):"text/csv"===(0,Ge.default)(t)||/text\/csv/.test(t)?h.default.createElement(c,{downloadable:!0,fileName:`${u}.csv`,value:e,getConfigs:o,canCopy:!0}):/^image\//i.test(t)?(0,fe.default)(t).call(t,"svg")?h.default.createElement("div",null," ",e," "):h.default.createElement("img",{src:We.default.createObjectURL(e)}):/^audio\//i.test(t)?h.default.createElement("pre",{className:"microlight"},h.default.createElement("audio",{controls:!0,key:n},h.default.createElement("source",{src:n,type:t}))):"string"==typeof e?h.default.createElement(c,{downloadable:!0,fileName:`${u}.txt`,value:e,getConfigs:o,canCopy:!0}):e.size>0?i?h.default.createElement("div",null,h.default.createElement("p",{className:"i"},"Unrecognized response type; displaying content as text."),h.default.createElement(c,{downloadable:!0,fileName:`${u}.txt`,value:i,getConfigs:o,canCopy:!0})):h.default.createElement("p",{className:"i"},"Unrecognized response type; unable to display."):null;return p?h.default.createElement("div",null,h.default.createElement("h5",null,"Response body"),p):null}}var Ye=pt(374);class Xe extends h.Component{constructor(e){super(e),(0,W.default)(this,"onChange",((e,t,a)=>{let{specActions:{changeParamByIdentity:n},onChangeKey:r}=this.props;n(r,e,t,a)})),(0,W.default)(this,"onChangeConsumesWrapper",(e=>{let{specActions:{changeConsumesValue:t},onChangeKey:a}=this.props;t(a,e)})),(0,W.default)(this,"toggleTab",(e=>"parameters"===e?this.setState({parametersVisible:!0,callbackVisible:!1}):"callbacks"===e?this.setState({callbackVisible:!0,parametersVisible:!1}):void 0)),(0,W.default)(this,"onChangeMediaType",(e=>{let{value:t,pathMethod:a}=e,{specActions:n,oas3Selectors:r,oas3Actions:s}=this.props;const o=r.hasUserEditedBody(...a),l=r.shouldRetainRequestBodyValue(...a);s.setRequestContentType({value:t,pathMethod:a}),s.initRequestBodyValidateError({pathMethod:a}),o||(l||s.setRequestBodyValue({value:void 0,pathMethod:a}),n.clearResponse(...a),n.clearRequest(...a),n.clearValidateParams(a))})),this.state={callbackVisible:!1,parametersVisible:!0}}render(){var e;let{onTryoutClick:t,onResetClick:a,parameters:n,allowTryItOut:r,tryItOutEnabled:s,specPath:o,fn:l,getComponent:i,getConfigs:c,specSelectors:d,specActions:g,pathMethod:v,oas3Actions:E,oas3Selectors:S,operation:w}=this.props;const b=i("parameterRow"),x=i("TryItOutButton"),_=i("contentType"),C=i("Callbacks",!0),j=i("RequestBody",!0),N=s&&r,O=d.isOAS3(),k=w.get("requestBody"),A=(0,p.default)(e=(0,Ye.default)((0,p.default)(n).call(n,((e,t)=>{const a=t.get("in");return e[a]??(e[a]=[]),e[a].push(t),e}),{}))).call(e,((e,t)=>(0,f.default)(e).call(e,t)),[]);return h.default.createElement("div",{className:"opblock-section"},h.default.createElement("div",{className:"opblock-section-header"},O?h.default.createElement("div",{className:"tab-header"},h.default.createElement("div",{onClick:()=>this.toggleTab("parameters"),className:`tab-item ${this.state.parametersVisible&&"active"}`},h.default.createElement("h4",{className:"opblock-title"},h.default.createElement("span",null,"Parameters"))),w.get("callbacks")?h.default.createElement("div",{onClick:()=>this.toggleTab("callbacks"),className:`tab-item ${this.state.callbackVisible&&"active"}`},h.default.createElement("h4",{className:"opblock-title"},h.default.createElement("span",null,"Callbacks"))):null):h.default.createElement("div",{className:"tab-header"},h.default.createElement("h4",{className:"opblock-title"},"Parameters")),r?h.default.createElement(x,{isOAS3:d.isOAS3(),hasUserEditedBody:S.hasUserEditedBody(...v),enabled:s,onCancelClick:this.props.onCancelClick,onTryoutClick:t,onResetClick:()=>a(v)}):null),this.state.parametersVisible?h.default.createElement("div",{className:"parameters-container"},A.length?h.default.createElement("div",{className:"table-container"},h.default.createElement("table",{className:"parameters"},h.default.createElement("thead",null,h.default.createElement("tr",null,h.default.createElement("th",{className:"col_header parameters-col_name"},"Name"),h.default.createElement("th",{className:"col_header parameters-col_description"},"Description"))),h.default.createElement("tbody",null,(0,m.default)(A).call(A,((e,t)=>h.default.createElement(b,{fn:l,specPath:o.push(t.toString()),getComponent:i,getConfigs:c,rawParam:e,param:d.parameterWithMetaByIdentity(v,e),key:`${e.get("in")}.${e.get("name")}`,onChange:this.onChange,onChangeConsumes:this.onChangeConsumesWrapper,specSelectors:d,specActions:g,oas3Actions:E,oas3Selectors:S,pathMethod:v,isExecute:N})))))):h.default.createElement("div",{className:"opblock-description-wrapper"},h.default.createElement("p",null,"No parameters"))):null,this.state.callbackVisible?h.default.createElement("div",{className:"callbacks-container opblock-description-wrapper"},h.default.createElement(C,{callbacks:(0,y.Map)(w.get("callbacks")),specPath:(0,u.default)(o).call(o,0,-1).push("callbacks")})):null,O&&k&&this.state.parametersVisible&&h.default.createElement("div",{className:"opblock-section opblock-section-request-body"},h.default.createElement("div",{className:"opblock-section-header"},h.default.createElement("h4",{className:`opblock-title parameter__name ${k.get("required")&&"required"}`},"Request body"),h.default.createElement("label",null,h.default.createElement(_,{value:S.requestContentType(...v),contentTypes:k.get("content",(0,y.List)()).keySeq(),onChange:e=>{this.onChangeMediaType({value:e,pathMethod:v})},className:"body-param-content-type",ariaLabel:"Request content type"}))),h.default.createElement("div",{className:"opblock-description-wrapper"},h.default.createElement(j,{setRetainRequestBodyValueFlag:e=>E.setRetainRequestBodyValueFlag({value:e,pathMethod:v}),userHasEditedBody:S.hasUserEditedBody(...v),specPath:(0,u.default)(o).call(o,0,-1).push("requestBody"),requestBody:k,requestBodyValue:S.requestBodyValue(...v),requestBodyInclusionSetting:S.requestBodyInclusionSetting(...v),requestBodyErrors:S.requestBodyErrors(...v),isExecute:N,getConfigs:c,activeExamplesKey:S.activeExamplesMember(...v,"requestBody","requestBody"),updateActiveExamplesKey:e=>{this.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:this.props.pathMethod,contextType:"requestBody",contextName:"requestBody"})},onChange:(e,t)=>{if(t){const a=S.requestBodyValue(...v),n=y.Map.isMap(a)?a:(0,y.Map)();return E.setRequestBodyValue({pathMethod:v,value:n.setIn(t,e)})}E.setRequestBodyValue({value:e,pathMethod:v})},onChangeIncludeEmpty:(e,t)=>{E.setRequestBodyInclusion({pathMethod:v,value:t,name:e})},contentType:S.requestContentType(...v)}))))}}(0,W.default)(Xe,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,tryItOutEnabled:!1,allowTryItOut:!0,onChangeKey:[],specPath:[]});const Qe=e=>{let{xKey:t,xVal:a}=e;return h.default.createElement("div",{className:"parameter__extension"},t,": ",String(a))},ut={onChange:()=>{},isIncludedOptions:{}};class dt extends h.Component{constructor(){super(...arguments),(0,W.default)(this,"onCheckboxChange",(e=>{const{onChange:t}=this.props;t(e.target.checked)}))}componentDidMount(){const{isIncludedOptions:e,onChange:t}=this.props,{shouldDispatchInit:a,defaultValue:n}=e;a&&t(n)}render(){let{isIncluded:e,isDisabled:t}=this.props;return h.default.createElement("div",null,h.default.createElement("label",{className:(0,Te.default)("parameter__empty_value_toggle",{disabled:t})},h.default.createElement("input",{type:"checkbox",disabled:t,checked:!t&&e,onChange:this.onCheckboxChange}),"Send empty value"))}}(0,W.default)(dt,"defaultProps",ut);var ft=pt(9069);class ht extends h.Component{constructor(e,t){var a;super(e,t),a=this,(0,W.default)(this,"onChangeWrapper",(function(e){let t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],{onChange:r,rawParam:s}=a.props;return t=""===e||e&&0===e.size?null:e,r(s,t,n)})),(0,W.default)(this,"_onExampleSelect",(e=>{this.props.oas3Actions.setActiveExamplesMember({name:e,pathMethod:this.props.pathMethod,contextType:"parameters",contextName:this.getParamKey()})})),(0,W.default)(this,"onChangeIncludeEmpty",(e=>{let{specActions:t,param:a,pathMethod:n}=this.props;const r=a.get("name"),s=a.get("in");return t.updateEmptyParamInclusion(n,r,s,e)})),(0,W.default)(this,"setDefaultValue",(()=>{let{specSelectors:e,pathMethod:t,rawParam:a,oas3Selectors:n,fn:r}=this.props;const s=e.parameterWithMetaByIdentity(t,a)||(0,y.Map)(),{schema:o}=(0,ft.Z)(s,{isOAS3:e.isOAS3()}),l=s.get("content",(0,y.Map)()).keySeq().first(),i=o?r.getSampleSchema(o.toJS(),l,{includeWriteOnly:!0}):null;if(s&&void 0===s.get("value")&&"body"!==s.get("in")){let a;if(e.isSwagger2())a=void 0!==s.get("x-example")?s.get("x-example"):void 0!==s.getIn(["schema","example"])?s.getIn(["schema","example"]):o&&o.getIn(["default"]);else if(e.isOAS3()){const e=n.activeExamplesMember(...t,"parameters",this.getParamKey());a=void 0!==s.getIn(["examples",e,"value"])?s.getIn(["examples",e,"value"]):void 0!==s.getIn(["content",l,"example"])?s.getIn(["content",l,"example"]):void 0!==s.get("example")?s.get("example"):void 0!==(o&&o.get("example"))?o&&o.get("example"):void 0!==(o&&o.get("default"))?o&&o.get("default"):s.get("default")}void 0===a||y.List.isList(a)||(a=(0,x.Pz)(a)),void 0!==a?this.onChangeWrapper(a):o&&"object"===o.get("type")&&i&&!s.get("examples")&&this.onChangeWrapper(y.List.isList(i)?i:(0,x.Pz)(i))}})),this.setDefaultValue()}UNSAFE_componentWillReceiveProps(e){let t,{specSelectors:a,pathMethod:n,rawParam:r}=e,s=a.isOAS3(),o=a.parameterWithMetaByIdentity(n,r)||new y.Map;if(o=o.isEmpty()?r:o,s){let{schema:e}=(0,ft.Z)(o,{isOAS3:s});t=e?e.get("enum"):void 0}else t=o?o.get("enum"):void 0;let l,i=o?o.get("value"):void 0;void 0!==i?l=i:r.get("required")&&t&&t.size&&(l=t.first()),void 0!==l&&l!==i&&this.onChangeWrapper((0,x.D$)(l)),this.setDefaultValue()}getParamKey(){const{param:e}=this.props;return e?`${e.get("name")}-${e.get("in")}`:null}render(){var e,t;let{param:a,rawParam:n,getComponent:r,getConfigs:s,isExecute:o,fn:l,onChangeConsumes:i,specSelectors:c,pathMethod:u,specPath:d,oas3Selectors:p}=this.props,f=c.isOAS3();const{showExtensions:g,showCommonExtensions:v}=s();if(a||(a=n),!n)return null;const E=r("JsonSchemaForm"),S=r("ParamBody");let w=a.get("in"),_="body"!==w?null:h.default.createElement(S,{getComponent:r,getConfigs:s,fn:l,param:a,consumes:c.consumesOptionsFor(u),consumesValue:c.contentTypeValues(u).get("requestContentType"),onChange:this.onChangeWrapper,onChangeConsumes:i,isExecute:o,specSelectors:c,pathMethod:u});const C=r("modelExample"),j=r("Markdown",!0),N=r("ParameterExt"),O=r("ParameterIncludeEmpty"),k=r("ExamplesSelectValueRetainer"),A=r("Example");let I,R,P,T,{schema:M}=(0,ft.Z)(a,{isOAS3:f}),D=c.parameterWithMetaByIdentity(u,n)||(0,y.Map)(),L=M?M.get("format"):null,q=M?M.get("type"):null,B=M?M.getIn(["items","type"]):null,U="formData"===w,J="FormData"in b.Z,$=a.get("required"),V=D?D.get("value"):"",K=v?(0,x.po)(M):null,F=g?(0,x.nX)(a):null,z=!1;return void 0!==a&&M&&(I=M.get("items")),void 0!==I?(R=I.get("enum"),P=I.get("default")):M&&(R=M.get("enum")),R&&R.size&&R.size>0&&(z=!0),void 0!==a&&(M&&(P=M.get("default")),void 0===P&&(P=a.get("default")),T=a.get("example"),void 0===T&&(T=a.get("x-example"))),h.default.createElement("tr",{"data-param-name":a.get("name"),"data-param-in":a.get("in")},h.default.createElement("td",{className:"parameters-col_name"},h.default.createElement("div",{className:$?"parameter__name required":"parameter__name"},a.get("name"),$?h.default.createElement("span",null," *"):null),h.default.createElement("div",{className:"parameter__type"},q,B&&`[${B}]`,L&&h.default.createElement("span",{className:"prop-format"},"($",L,")")),h.default.createElement("div",{className:"parameter__deprecated"},f&&a.get("deprecated")?"deprecated":null),h.default.createElement("div",{className:"parameter__in"},"(",a.get("in"),")"),v&&K.size?(0,m.default)(e=K.entrySeq()).call(e,(e=>{let[t,a]=e;return h.default.createElement(N,{key:`${t}-${a}`,xKey:t,xVal:a})})):null,g&&F.size?(0,m.default)(t=F.entrySeq()).call(t,(e=>{let[t,a]=e;return h.default.createElement(N,{key:`${t}-${a}`,xKey:t,xVal:a})})):null),h.default.createElement("td",{className:"parameters-col_description"},a.get("description")?h.default.createElement(j,{source:a.get("description")}):null,!_&&o||!z?null:h.default.createElement(j,{className:"parameter__enum",source:"Available values : "+(0,m.default)(R).call(R,(function(e){return e})).toArray().join(", ")}),!_&&o||void 0===P?null:h.default.createElement(j,{className:"parameter__default",source:"Default value : "+P}),!_&&o||void 0===T?null:h.default.createElement(j,{source:"Example : "+T}),U&&!J&&h.default.createElement("div",null,"Error: your browser does not support FormData"),f&&a.get("examples")?h.default.createElement("section",{className:"parameter-controls"},h.default.createElement(k,{examples:a.get("examples"),onSelect:this._onExampleSelect,updateValue:this.onChangeWrapper,getComponent:r,defaultToFirstExample:!0,currentKey:p.activeExamplesMember(...u,"parameters",this.getParamKey()),currentUserInputValue:V})):null,_?null:h.default.createElement(E,{fn:l,getComponent:r,value:V,required:$,disabled:!o,description:a.get("name"),onChange:this.onChangeWrapper,errors:D.get("errors"),schema:M}),_&&M?h.default.createElement(C,{getComponent:r,specPath:d.push("schema"),getConfigs:s,isExecute:o,specSelectors:c,schema:M,example:_,includeWriteOnly:!0}):null,!_&&o&&a.get("allowEmptyValue")?h.default.createElement(O,{onChange:this.onChangeIncludeEmpty,isIncluded:c.parameterInclusionSettingFor(u,a.get("name"),a.get("in")),isDisabled:!(0,x.O2)(V)}):null,f&&a.get("examples")?h.default.createElement(A,{example:a.getIn(["examples",p.activeExamplesMember(...u,"parameters",this.getParamKey())]),getComponent:r,getConfigs:s}):null))}}var gt=pt(6235);class yt extends h.Component{constructor(){super(...arguments),(0,W.default)(this,"handleValidateParameters",(()=>{let{specSelectors:e,specActions:t,path:a,method:n}=this.props;return t.validateParams([a,n]),e.validateBeforeExecute([a,n])})),(0,W.default)(this,"handleValidateRequestBody",(()=>{let{path:e,method:t,specSelectors:a,oas3Selectors:n,oas3Actions:r}=this.props,s={missingBodyValue:!1,missingRequiredKeys:[]};r.clearRequestBodyValidateError({path:e,method:t});let o=a.getOAS3RequiredRequestBodyContentType([e,t]),l=n.requestBodyValue(e,t),i=n.validateBeforeExecute([e,t]),c=n.requestContentType(e,t);if(!i)return s.missingBodyValue=!0,r.setRequestBodyValidateError({path:e,method:t,validationErrors:s}),!1;if(!o)return!0;let u=n.validateShallowRequired({oas3RequiredRequestBodyContentType:o,oas3RequestContentType:c,oas3RequestBodyValue:l});return!u||u.length<1||((0,Pe.default)(u).call(u,(e=>{s.missingRequiredKeys.push(e)})),r.setRequestBodyValidateError({path:e,method:t,validationErrors:s}),!1)})),(0,W.default)(this,"handleValidationResultPass",(()=>{let{specActions:e,operation:t,path:a,method:n}=this.props;this.props.onExecute&&this.props.onExecute(),e.execute({operation:t,path:a,method:n})})),(0,W.default)(this,"handleValidationResultFail",(()=>{let{specActions:e,path:t,method:a}=this.props;e.clearValidateParams([t,a]),(0,gt.default)((()=>{e.validateParams([t,a])}),40)})),(0,W.default)(this,"handleValidationResult",(e=>{e?this.handleValidationResultPass():this.handleValidationResultFail()})),(0,W.default)(this,"onClick",(()=>{let e=this.handleValidateParameters(),t=this.handleValidateRequestBody(),a=e&&t;this.handleValidationResult(a)})),(0,W.default)(this,"onChangeProducesWrapper",(e=>this.props.specActions.changeProducesValue([this.props.path,this.props.method],e)))}render(){const{disabled:e}=this.props;return h.default.createElement("button",{className:"btn execute opblock-control__btn",onClick:this.onClick,disabled:e},"Execute")}}class vt extends h.default.Component{render(){var e;let{headers:t,getComponent:a}=this.props;const n=a("Property"),r=a("Markdown",!0);return t&&t.size?h.default.createElement("div",{className:"headers-wrapper"},h.default.createElement("h4",{className:"headers__title"},"Headers:"),h.default.createElement("table",{className:"headers"},h.default.createElement("thead",null,h.default.createElement("tr",{className:"header-row"},h.default.createElement("th",{className:"header-col"},"Name"),h.default.createElement("th",{className:"header-col"},"Description"),h.default.createElement("th",{className:"header-col"},"Type"))),h.default.createElement("tbody",null,(0,m.default)(e=t.entrySeq()).call(e,(e=>{let[t,a]=e;if(!y.default.Map.isMap(a))return null;const s=a.get("description"),o=a.getIn(["schema"])?a.getIn(["schema","type"]):a.getIn(["type"]),l=a.getIn(["schema","example"]);return h.default.createElement("tr",{key:t},h.default.createElement("td",{className:"header-col"},t),h.default.createElement("td",{className:"header-col"},s?h.default.createElement(r,{source:s}):null),h.default.createElement("td",{className:"header-col"},o," ",l?h.default.createElement(n,{propKey:"Example",propVal:l,propClass:"header-example"}):null))})).toArray()))):null}}class Et extends h.default.Component{render(){let{editorActions:e,errSelectors:t,layoutSelectors:a,layoutActions:r,getComponent:s}=this.props;const o=s("Collapse");if(e&&e.jumpToLine)var l=e.jumpToLine;let i=t.allErrors(),c=(0,n.default)(i).call(i,(e=>"thrown"===e.get("type")||"error"===e.get("level")));if(!c||c.count()<1)return null;let u=a.isShown(["errorPane"],!0),d=c.sortBy((e=>e.get("line")));return h.default.createElement("pre",{className:"errors-wrapper"},h.default.createElement("hgroup",{className:"error"},h.default.createElement("h4",{className:"errors__title"},"Errors"),h.default.createElement("button",{className:"btn errors__clear-btn",onClick:()=>r.show(["errorPane"],!u)},u?"Hide":"Show")),h.default.createElement(o,{isOpened:u,animated:!0},h.default.createElement("div",{className:"errors"},(0,m.default)(d).call(d,((e,t)=>{let a=e.get("type");return"thrown"===a||"auth"===a?h.default.createElement(St,{key:t,error:e.get("error")||e,jumpToLine:l}):"spec"===a?h.default.createElement(wt,{key:t,error:e,jumpToLine:l}):void 0})))))}}const St=e=>{let{error:t,jumpToLine:a}=e;if(!t)return null;let n=t.get("line");return h.default.createElement("div",{className:"error-wrapper"},t?h.default.createElement("div",null,h.default.createElement("h4",null,t.get("source")&&t.get("level")?bt(t.get("source"))+" "+t.get("level"):"",t.get("path")?h.default.createElement("small",null," at ",t.get("path")):null),h.default.createElement("span",{className:"message thrown"},t.get("message")),h.default.createElement("div",{className:"error-line"},n&&a?h.default.createElement("a",{onClick:(0,i.default)(a).call(a,null,n)},"Jump to line ",n):null)):null)},wt=e=>{let{error:t,jumpToLine:a}=e,n=null;return t.get("path")?n=y.List.isList(t.get("path"))?h.default.createElement("small",null,"at ",t.get("path").join(".")):h.default.createElement("small",null,"at ",t.get("path")):t.get("line")&&!a&&(n=h.default.createElement("small",null,"on line ",t.get("line"))),h.default.createElement("div",{className:"error-wrapper"},t?h.default.createElement("div",null,h.default.createElement("h4",null,bt(t.get("source"))+" "+t.get("level")," ",n),h.default.createElement("span",{className:"message"},t.get("message")),h.default.createElement("div",{className:"error-line"},a?h.default.createElement("a",{onClick:(0,i.default)(a).call(a,null,t.get("line"))},"Jump to line ",t.get("line")):null)):null)};function bt(e){var t;return(0,m.default)(t=(e||"").split(" ")).call(t,(e=>e[0].toUpperCase()+(0,u.default)(e).call(e,1))).join(" ")}St.defaultProps={jumpToLine:null};class xt extends h.default.Component{constructor(){super(...arguments),(0,W.default)(this,"onChangeWrapper",(e=>this.props.onChange(e.target.value)))}componentDidMount(){this.props.contentTypes&&this.props.onChange(this.props.contentTypes.first())}UNSAFE_componentWillReceiveProps(e){var t;e.contentTypes&&e.contentTypes.size&&((0,fe.default)(t=e.contentTypes).call(t,e.value)||e.onChange(e.contentTypes.first()))}render(){let{ariaControls:e,ariaLabel:t,className:a,contentTypes:n,controlId:r,value:s}=this.props;return n&&n.size?h.default.createElement("div",{className:"content-type-wrapper "+(a||"")},h.default.createElement("select",{"aria-controls":e,"aria-label":t,className:"content-type",id:r,onChange:this.onChangeWrapper,value:s||""},(0,m.default)(n).call(n,(e=>h.default.createElement("option",{key:e,value:e},e))).toArray())):null}}(0,W.default)(xt,"defaultProps",{onChange:()=>{},value:null,contentTypes:(0,y.fromJS)(["application/json"])});var _t=pt(863),Ct=pt(5942);function jt(){for(var e,t=arguments.length,a=new Array(t),r=0;r!!e)).join(" ")).call(e)}class Nt extends h.default.Component{render(){let{fullscreen:e,full:t,...a}=this.props;if(e)return h.default.createElement("section",a);let n="swagger-container"+(t?"-full":"");return h.default.createElement("section",(0,_t.default)({},a,{className:jt(a.className,n)}))}}const Ot={mobile:"",tablet:"-tablet",desktop:"-desktop",large:"-hd"};class kt extends h.default.Component{render(){const{hide:e,keepContents:t,mobile:a,tablet:n,desktop:r,large:s,...o}=this.props;if(e&&!t)return h.default.createElement("span",null);let l=[];for(let e in Ot){if(!Object.prototype.hasOwnProperty.call(Ot,e))continue;let t=Ot[e];if(e in this.props){let a=this.props[e];if(a<1){l.push("none"+t);continue}l.push("block"+t),l.push("col-"+a+t)}}e&&l.push("hidden");let i=jt(o.className,...l);return h.default.createElement("section",(0,_t.default)({},o,{className:i}))}}class At extends h.default.Component{render(){return h.default.createElement("div",(0,_t.default)({},this.props,{className:jt(this.props.className,"wrapper")}))}}class It extends h.default.Component{render(){return h.default.createElement("button",(0,_t.default)({},this.props,{className:jt(this.props.className,"button")}))}}(0,W.default)(It,"defaultProps",{className:""});const Rt=e=>h.default.createElement("textarea",e),Pt=e=>h.default.createElement("input",e);class Tt extends h.default.Component{constructor(e,t){let a;super(e,t),(0,W.default)(this,"onChange",(e=>{let t,{onChange:a,multiple:r}=this.props,s=(0,u.default)([]).call(e.target.options);var o;r?t=(0,m.default)(o=(0,n.default)(s).call(s,(function(e){return e.selected}))).call(o,(function(e){return e.value})):t=e.target.value;this.setState({value:t}),a&&a(t)})),a=e.value?e.value:e.multiple?[""]:"",this.state={value:a}}UNSAFE_componentWillReceiveProps(e){e.value!==this.props.value&&this.setState({value:e.value})}render(){var e,t;let{allowedValues:a,multiple:n,allowEmptyValue:r,disabled:s}=this.props,o=(null===(e=this.state.value)||void 0===e||null===(t=e.toJS)||void 0===t?void 0:t.call(e))||this.state.value;return h.default.createElement("select",{className:this.props.className,multiple:n,value:o,onChange:this.onChange,disabled:s},r?h.default.createElement("option",{value:""},"--"):null,(0,m.default)(a).call(a,(function(e,t){return h.default.createElement("option",{key:t,value:String(e)},String(e))})))}}(0,W.default)(Tt,"defaultProps",{multiple:!1,allowEmptyValue:!0});class Mt extends h.default.Component{render(){return h.default.createElement("a",(0,_t.default)({},this.props,{rel:"noopener noreferrer",className:jt(this.props.className,"link")}))}}const Dt=e=>{let{children:t}=e;return h.default.createElement("div",{className:"no-margin"}," ",t," ")};class Lt extends h.default.Component{renderNotAnimated(){return this.props.isOpened?h.default.createElement(Dt,null,this.props.children):h.default.createElement("noscript",null)}render(){let{animated:e,isOpened:t,children:a}=this.props;return e?(a=t?a:null,h.default.createElement(Dt,null,a)):this.renderNotAnimated()}}(0,W.default)(Lt,"defaultProps",{isOpened:!1,animated:!1});class qt extends h.default.Component{constructor(){var e;super(...arguments),this.setTagShown=(0,i.default)(e=this._setTagShown).call(e,this)}_setTagShown(e,t){this.props.layoutActions.show(e,t)}showOp(e,t){let{layoutActions:a}=this.props;a.show(e,t)}render(){let{specSelectors:e,layoutSelectors:t,layoutActions:a,getComponent:n}=this.props,r=e.taggedOperations();const s=n("Collapse");return h.default.createElement("div",null,h.default.createElement("h4",{className:"overview-title"},"Overview"),(0,m.default)(r).call(r,((e,n)=>{let r=e.get("operations"),o=["overview-tags",n],l=t.isShown(o,!0);return h.default.createElement("div",{key:"overview-"+n},h.default.createElement("h4",{onClick:()=>a.show(o,!l),className:"link overview-tag"}," ",l?"-":"+",n),h.default.createElement(s,{isOpened:l,animated:!0},(0,m.default)(r).call(r,(e=>{let{path:n,method:r,id:s}=e.toObject(),o="operations",l=s,i=t.isShown([o,l]);return h.default.createElement(Bt,{key:s,path:n,method:r,id:n+"-"+r,shown:i,showOpId:l,showOpIdPrefix:o,href:`#operation-${l}`,onClick:a.show})})).toArray()))})).toArray(),r.size<1&&h.default.createElement("h3",null," No operations defined in spec! "))}}class Bt extends h.default.Component{constructor(e){var t;super(e),this.onClick=(0,i.default)(t=this._onClick).call(t,this)}_onClick(){let{showOpId:e,showOpIdPrefix:t,onClick:a,shown:n}=this.props;a([t,e],!n)}render(){let{id:e,method:t,shown:a,href:n}=this.props;return h.default.createElement(Mt,{href:n,onClick:this.onClick,className:"block opblock-link "+(a?"shown":"")},h.default.createElement("div",null,h.default.createElement("small",{className:`bold-label-${t}`},t.toUpperCase()),h.default.createElement("span",{className:"bold-label"},e)))}}class Ut extends h.default.Component{componentDidMount(){this.props.initialValue&&(this.inputRef.value=this.props.initialValue)}render(){const{value:e,defaultValue:t,initialValue:a,...n}=this.props;return h.default.createElement("input",(0,_t.default)({},n,{ref:e=>this.inputRef=e}))}}class Jt extends h.default.Component{render(){const{host:e,basePath:t}=this.props;return h.default.createElement("pre",{className:"base-url"},"[ Base URL: ",e,t," ]")}}class $t extends h.default.PureComponent{render(){const{url:e,getComponent:t}=this.props,a=t("Link");return h.default.createElement(a,{target:"_blank",href:(0,x.Nm)(e)},h.default.createElement("span",{className:"url"}," ",e))}}class Vt extends h.default.Component{render(){const{info:e,url:t,host:a,basePath:n,getComponent:r,externalDocs:s,selectedServer:o,url:l}=this.props,i=e.get("version"),c=e.get("description"),u=e.get("title"),d=(0,xe.mn)(e.get("termsOfService"),l,{selectedServer:o}),p=e.get("contact"),m=e.get("license"),f=s&&s.get("url"),g=(0,xe.mn)(f,l,{selectedServer:o}),y=s&&s.get("description"),v=r("Markdown",!0),E=r("Link"),S=r("VersionStamp"),w=r("OpenAPIVersion"),b=r("InfoUrl"),_=r("InfoBasePath"),C=r("License"),j=r("Contact");return h.default.createElement("div",{className:"info"},h.default.createElement("hgroup",{className:"main"},h.default.createElement("h2",{className:"title"},u,i&&h.default.createElement(S,{version:i}),h.default.createElement(w,{oasVersion:"2.0"})),a||n?h.default.createElement(_,{host:a,basePath:n}):null,t&&h.default.createElement(b,{getComponent:r,url:t})),h.default.createElement("div",{className:"description"},h.default.createElement(v,{source:c})),d&&h.default.createElement("div",{className:"info__tos"},h.default.createElement(E,{target:"_blank",href:(0,x.Nm)(d)},"Terms of service")),(null==p?void 0:p.size)>0&&h.default.createElement(j,{getComponent:r,data:p,selectedServer:o,url:t}),(null==m?void 0:m.size)>0&&h.default.createElement(C,{getComponent:r,license:m,selectedServer:o,url:t}),g?h.default.createElement(E,{className:"info__extdocs",target:"_blank",href:(0,x.Nm)(g)},y||g):null)}}const Kt=Vt;class Ft extends h.default.Component{render(){const{specSelectors:e,getComponent:t,oas3Selectors:a}=this.props,n=e.info(),r=e.url(),s=e.basePath(),o=e.host(),l=e.externalDocs(),i=a.selectedServer(),c=t("info");return h.default.createElement("div",null,n&&n.count()?h.default.createElement(c,{info:n,url:r,host:o,basePath:s,externalDocs:l,getComponent:t,selectedServer:i}):null)}}class zt extends h.default.Component{render(){const{data:e,getComponent:t,selectedServer:a,url:n}=this.props,r=e.get("name","the developer"),s=(0,xe.mn)(e.get("url"),n,{selectedServer:a}),o=e.get("email"),l=t("Link");return h.default.createElement("div",{className:"info__contact"},s&&h.default.createElement("div",null,h.default.createElement(l,{href:(0,x.Nm)(s),target:"_blank"},r," - Website")),o&&h.default.createElement(l,{href:(0,x.Nm)(`mailto:${o}`)},s?`Send email to ${r}`:`Contact ${r}`))}}const Wt=zt;class Ht extends h.default.Component{render(){const{license:e,getComponent:t,selectedServer:a,url:n}=this.props,r=e.get("name","License"),s=(0,xe.mn)(e.get("url"),n,{selectedServer:a}),o=t("Link");return h.default.createElement("div",{className:"info__license"},s?h.default.createElement("div",{className:"info__license__url"},h.default.createElement(o,{target:"_blank",href:(0,x.Nm)(s)},r)):h.default.createElement("span",null,r))}}const Gt=Ht;class Zt extends h.default.Component{render(){return null}}class Yt extends h.default.Component{render(){let{getComponent:e}=this.props;const t=e("CopyIcon");return h.default.createElement("div",{className:"view-line-link copy-to-clipboard",title:"Copy to clipboard"},h.default.createElement(Be.CopyToClipboard,{text:this.props.textToCopy},h.default.createElement(t,null)))}}class Xt extends h.default.Component{render(){return h.default.createElement("div",{className:"footer"})}}class Qt extends h.default.Component{constructor(){super(...arguments),(0,W.default)(this,"onFilterChange",(e=>{const{target:{value:t}}=e;this.props.layoutActions.updateFilter(t)}))}render(){const{specSelectors:e,layoutSelectors:t,getComponent:a}=this.props,n=a("Col"),r="loading"===e.loadingStatus(),s="failed"===e.loadingStatus(),o=t.currentFilter(),l=["operation-filter-input"];return s&&l.push("failed"),r&&l.push("loading"),h.default.createElement("div",null,null===o||!1===o||"false"===o?null:h.default.createElement("div",{className:"filter-container"},h.default.createElement(n,{className:"filter wrapper",mobile:12},h.default.createElement("input",{className:l.join(" "),placeholder:"Filter by tag",type:"text",onChange:this.onFilterChange,value:!0===o||"true"===o?"":o,disabled:r}))))}}const ea=Function.prototype;class ta extends h.PureComponent{constructor(e,t){super(e,t),(0,W.default)(this,"updateValues",(e=>{let{param:t,isExecute:a,consumesValue:n=""}=e,r=/xml/i.test(n),s=/json/i.test(n),o=r?t.get("value_xml"):t.get("value");if(void 0!==o){let e=!o&&s?"{}":o;this.setState({value:e}),this.onChange(e,{isXml:r,isEditBox:a})}else r?this.onChange(this.sample("xml"),{isXml:r,isEditBox:a}):this.onChange(this.sample(),{isEditBox:a})})),(0,W.default)(this,"sample",(e=>{let{param:t,fn:a}=this.props,n=a.inferSchema(t.toJS());return a.getSampleSchema(n,e,{includeWriteOnly:!0})})),(0,W.default)(this,"onChange",((e,t)=>{let{isEditBox:a,isXml:n}=t;this.setState({value:e,isEditBox:a}),this._onChange(e,n)})),(0,W.default)(this,"_onChange",((e,t)=>{(this.props.onChange||ea)(e,t)})),(0,W.default)(this,"handleOnChange",(e=>{const{consumesValue:t}=this.props,a=/xml/i.test(t),n=e.target.value;this.onChange(n,{isXml:a,isEditBox:this.state.isEditBox})})),(0,W.default)(this,"toggleIsEditBox",(()=>this.setState((e=>({isEditBox:!e.isEditBox}))))),this.state={isEditBox:!1,value:""}}componentDidMount(){this.updateValues.call(this,this.props)}UNSAFE_componentWillReceiveProps(e){this.updateValues.call(this,e)}render(){let{onChangeConsumes:e,param:t,isExecute:a,specSelectors:n,pathMethod:r,getConfigs:s,getComponent:o}=this.props;const l=o("Button"),i=o("TextArea"),c=o("highlightCode"),u=o("contentType");let d=(n?n.parameterWithMetaByIdentity(r,t):t).get("errors",(0,y.List)()),p=n.contentTypeValues(r).get("requestContentType"),m=this.props.consumes&&this.props.consumes.size?this.props.consumes:ta.defaultProp.consumes,{value:f,isEditBox:g}=this.state,v=null;return(0,Ke.O)(f)&&(v="json"),h.default.createElement("div",{className:"body-param","data-param-name":t.get("name"),"data-param-in":t.get("in")},g&&a?h.default.createElement(i,{className:"body-param__text"+(d.count()?" invalid":""),value:f,onChange:this.handleOnChange}):f&&h.default.createElement(c,{className:"body-param__example",language:v,getConfigs:s,value:f}),h.default.createElement("div",{className:"body-param-options"},a?h.default.createElement("div",{className:"body-param-edit"},h.default.createElement(l,{className:g?"btn cancel body-param__example-edit":"btn edit body-param__example-edit",onClick:this.toggleIsEditBox},g?"Cancel":"Edit")):null,h.default.createElement("label",{htmlFor:""},h.default.createElement("span",null,"Parameter content type"),h.default.createElement(u,{value:p,contentTypes:m,onChange:e,className:"body-param-content-type",ariaLabel:"Parameter content type"}))))}}(0,W.default)(ta,"defaultProp",{consumes:(0,y.fromJS)(["application/json"]),param:(0,y.fromJS)({}),onChange:ea,onChangeConsumes:ea});var aa=pt(4624);class na extends h.default.Component{render(){let{request:e,getConfigs:t}=this.props,a=(0,aa.requestSnippetGenerator_curl_bash)(e);const n=t(),r=(0,De.default)(n,"syntaxHighlight.activated")?h.default.createElement(Me.d3,{language:"bash",className:"curl microlight",style:(0,Me.C2)((0,De.default)(n,"syntaxHighlight.theme"))},a):h.default.createElement("textarea",{readOnly:!0,className:"curl",value:a});return h.default.createElement("div",{className:"curl-command"},h.default.createElement("h4",null,"Curl"),h.default.createElement("div",{className:"copy-to-clipboard"},h.default.createElement(Be.CopyToClipboard,{text:a},h.default.createElement("button",null))),h.default.createElement("div",null,r))}}class ra extends h.default.Component{constructor(){super(...arguments),(0,W.default)(this,"onChange",(e=>{this.setScheme(e.target.value)})),(0,W.default)(this,"setScheme",(e=>{let{path:t,method:a,specActions:n}=this.props;n.setScheme(e,t,a)}))}UNSAFE_componentWillMount(){let{schemes:e}=this.props;this.setScheme(e.first())}UNSAFE_componentWillReceiveProps(e){var t;this.props.currentScheme&&(0,fe.default)(t=e.schemes).call(t,this.props.currentScheme)||this.setScheme(e.schemes.first())}render(){var e;let{schemes:t,currentScheme:a}=this.props;return h.default.createElement("label",{htmlFor:"schemes"},h.default.createElement("span",{className:"schemes-title"},"Schemes"),h.default.createElement("select",{onChange:this.onChange,value:a},(0,m.default)(e=t.valueSeq()).call(e,(e=>h.default.createElement("option",{value:e,key:e},e))).toArray()))}}class sa extends h.default.Component{render(){const{specActions:e,specSelectors:t,getComponent:a}=this.props,n=t.operationScheme(),r=t.schemes(),s=a("schemes");return r&&r.size?h.default.createElement(s,{currentScheme:n,schemes:r,specActions:e}):null}}class oa extends h.Component{constructor(e,t){super(e,t),(0,W.default)(this,"toggleCollapsed",(()=>{this.props.onToggle&&this.props.onToggle(this.props.modelName,!this.state.expanded),this.setState({expanded:!this.state.expanded})})),(0,W.default)(this,"onLoad",(e=>{if(e&&this.props.layoutSelectors){const t=this.props.layoutSelectors.getScrollToKey();y.default.is(t,this.props.specPath)&&this.toggleCollapsed(),this.props.layoutActions.readyToScroll(this.props.specPath,e.parentElement)}}));let{expanded:a,collapsedContent:n}=this.props;this.state={expanded:a,collapsedContent:n||oa.defaultProps.collapsedContent}}componentDidMount(){const{hideSelfOnExpand:e,expanded:t,modelName:a}=this.props;e&&t&&this.props.onToggle(a,t)}UNSAFE_componentWillReceiveProps(e){this.props.expanded!==e.expanded&&this.setState({expanded:e.expanded})}render(){const{title:e,classes:t}=this.props;return this.state.expanded&&this.props.hideSelfOnExpand?h.default.createElement("span",{className:t||""},this.props.children):h.default.createElement("span",{className:t||"",ref:this.onLoad},h.default.createElement("button",{"aria-expanded":this.state.expanded,className:"model-box-control",onClick:this.toggleCollapsed},e&&h.default.createElement("span",{className:"pointer"},e),h.default.createElement("span",{className:"model-toggle"+(this.state.expanded?"":" collapsed")}),!this.state.expanded&&h.default.createElement("span",null,this.state.collapsedContent)),this.state.expanded&&this.props.children)}}(0,W.default)(oa,"defaultProps",{collapsedContent:"{...}",expanded:!1,title:null,onToggle:()=>{},hideSelfOnExpand:!1,specPath:y.default.List([])});var la=pt(1798),ia=pt.n(la);class ca extends h.default.Component{constructor(e,t){super(e,t),(0,W.default)(this,"activeTab",(e=>{let{target:{dataset:{name:t}}}=e;this.setState({activeTab:t})}));let{getConfigs:a,isExecute:n}=this.props,{defaultModelRendering:r}=a(),s=r;"example"!==r&&"model"!==r&&(s="example"),n&&(s="example"),this.state={activeTab:s}}UNSAFE_componentWillReceiveProps(e){e.isExecute&&!this.props.isExecute&&this.props.example&&this.setState({activeTab:"example"})}render(){let{getComponent:e,specSelectors:t,schema:a,example:n,isExecute:r,getConfigs:s,specPath:o,includeReadOnly:l,includeWriteOnly:i}=this.props,{defaultModelExpandDepth:c}=s();const u=e("ModelWrapper"),d=e("highlightCode"),p=ia()(5).toString("base64"),m=ia()(5).toString("base64"),f=ia()(5).toString("base64"),g=ia()(5).toString("base64");let y=t.isOAS3();return h.default.createElement("div",{className:"model-example"},h.default.createElement("ul",{className:"tab",role:"tablist"},h.default.createElement("li",{className:(0,Te.default)("tabitem",{active:"example"===this.state.activeTab}),role:"presentation"},h.default.createElement("button",{"aria-controls":m,"aria-selected":"example"===this.state.activeTab,className:"tablinks","data-name":"example",id:p,onClick:this.activeTab,role:"tab"},r?"Edit Value":"Example Value")),a&&h.default.createElement("li",{className:(0,Te.default)("tabitem",{active:"model"===this.state.activeTab}),role:"presentation"},h.default.createElement("button",{"aria-controls":g,"aria-selected":"model"===this.state.activeTab,className:(0,Te.default)("tablinks",{inactive:r}),"data-name":"model",id:f,onClick:this.activeTab,role:"tab"},y?"Schema":"Model"))),"example"===this.state.activeTab&&h.default.createElement("div",{"aria-hidden":"example"!==this.state.activeTab,"aria-labelledby":p,"data-name":"examplePanel",id:m,role:"tabpanel",tabIndex:"0"},n||h.default.createElement(d,{value:"(no example available)",getConfigs:s})),"model"===this.state.activeTab&&h.default.createElement("div",{"aria-hidden":"example"===this.state.activeTab,"aria-labelledby":f,"data-name":"modelPanel",id:g,role:"tabpanel",tabIndex:"0"},h.default.createElement(u,{schema:a,getComponent:e,getConfigs:s,specSelectors:t,expandDepth:c,specPath:o,includeReadOnly:l,includeWriteOnly:i})))}}class ua extends h.Component{constructor(){super(...arguments),(0,W.default)(this,"onToggle",((e,t)=>{this.props.layoutActions&&this.props.layoutActions.show(this.props.fullPath,t)}))}render(){let{getComponent:e,getConfigs:t}=this.props;const a=e("Model");let n;return this.props.layoutSelectors&&(n=this.props.layoutSelectors.isShown(this.props.fullPath)),h.default.createElement("div",{className:"model-box"},h.default.createElement(a,(0,_t.default)({},this.props,{getConfigs:t,expanded:n,depth:1,onToggle:this.onToggle,expandDepth:this.props.expandDepth||0})))}}var da=pt(1543);class pa extends h.Component{constructor(){super(...arguments),(0,W.default)(this,"getSchemaBasePath",(()=>this.props.specSelectors.isOAS3()?["components","schemas"]:["definitions"])),(0,W.default)(this,"getCollapsedContent",(()=>" ")),(0,W.default)(this,"handleToggle",((e,t)=>{const{layoutActions:a}=this.props;a.show([...this.getSchemaBasePath(),e],t),t&&this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(),e])})),(0,W.default)(this,"onLoadModels",(e=>{e&&this.props.layoutActions.readyToScroll(this.getSchemaBasePath(),e)})),(0,W.default)(this,"onLoadModel",(e=>{if(e){const t=e.getAttribute("data-name");this.props.layoutActions.readyToScroll([...this.getSchemaBasePath(),t],e)}}))}render(){var e;let{specSelectors:t,getComponent:a,layoutSelectors:n,layoutActions:r,getConfigs:s}=this.props,o=t.definitions(),{docExpansion:l,defaultModelsExpandDepth:i}=s();if(!o.size||i<0)return null;const c=this.getSchemaBasePath();let u=n.isShown(c,i>0&&"none"!==l);const d=t.isOAS3(),p=a("ModelWrapper"),f=a("Collapse"),g=a("ModelCollapse"),v=a("JumpToPath",!0),E=a("ArrowUpIcon"),S=a("ArrowDownIcon");return h.default.createElement("section",{className:u?"models is-open":"models",ref:this.onLoadModels},h.default.createElement("h4",null,h.default.createElement("button",{"aria-expanded":u,className:"models-control",onClick:()=>r.show(c,!u)},h.default.createElement("span",null,d?"Schemas":"Models"),u?h.default.createElement(E,null):h.default.createElement(S,null))),h.default.createElement(f,{isOpened:u},(0,m.default)(e=o.entrySeq()).call(e,(e=>{let[o]=e;const l=[...c,o],u=y.default.List(l),d=t.specResolvedSubtree(l),m=t.specJson().getIn(l),f=y.Map.isMap(d)?d:y.default.Map(),E=y.Map.isMap(m)?m:y.default.Map(),S=f.get("title")||E.get("title")||o,w=n.isShown(l,!1);w&&0===f.size&&E.size>0&&this.props.specActions.requestResolvedSubtree(l);const b=h.default.createElement(p,{name:o,expandDepth:i,schema:f||y.default.Map(),displayName:S,fullPath:l,specPath:u,getComponent:a,specSelectors:t,getConfigs:s,layoutSelectors:n,layoutActions:r,includeReadOnly:!0,includeWriteOnly:!0}),x=h.default.createElement("span",{className:"model-box"},h.default.createElement("span",{className:"model model-title"},S));return h.default.createElement("div",{id:`model-${o}`,className:"model-container",key:`models-section-${o}`,"data-name":o,ref:this.onLoadModel},h.default.createElement("span",{className:"models-jump-to-path"},h.default.createElement(v,{specPath:u})),h.default.createElement(g,{classes:"model-box",collapsedContent:this.getCollapsedContent(o),onToggle:this.handleToggle,title:x,displayName:S,modelName:o,specPath:u,layoutSelectors:n,layoutActions:r,hideSelfOnExpand:!0,expanded:i>0&&w},b))})).toArray()))}}const ma=e=>{let{value:t,getComponent:a}=e,n=a("ModelCollapse"),r=h.default.createElement("span",null,"Array [ ",t.count()," ]");return h.default.createElement("span",{className:"prop-enum"},"Enum:",h.default.createElement("br",null),h.default.createElement(n,{collapsedContent:r},"[ ",t.join(", ")," ]"))};class fa extends h.Component{render(){var e,t,a,r;let{schema:o,name:l,displayName:i,isRef:c,getComponent:d,getConfigs:p,depth:f,onToggle:g,expanded:v,specPath:E,...S}=this.props,{specSelectors:w,expandDepth:b,includeReadOnly:_,includeWriteOnly:C}=S;const{isOAS3:j}=w;if(!o)return null;const{showExtensions:N}=p();let O=o.get("description"),k=o.get("properties"),A=o.get("additionalProperties"),I=o.get("title")||i||l,R=o.get("required"),P=(0,n.default)(o).call(o,((e,t)=>{var a;return-1!==(0,H.default)(a=["maxProperties","minProperties","nullable","example"]).call(a,t)})),T=o.get("deprecated"),M=o.getIn(["externalDocs","url"]),D=o.getIn(["externalDocs","description"]);const L=d("JumpToPath",!0),q=d("Markdown",!0),B=d("Model"),U=d("ModelCollapse"),J=d("Property"),$=d("Link"),V=()=>h.default.createElement("span",{className:"model-jump-to-path"},h.default.createElement(L,{specPath:E})),K=h.default.createElement("span",null,h.default.createElement("span",null,"{"),"...",h.default.createElement("span",null,"}"),c?h.default.createElement(V,null):""),F=w.isOAS3()?o.get("anyOf"):null,z=w.isOAS3()?o.get("oneOf"):null,W=w.isOAS3()?o.get("not"):null,G=I&&h.default.createElement("span",{className:"model-title"},c&&o.get("$$ref")&&h.default.createElement("span",{className:"model-hint"},o.get("$$ref")),h.default.createElement("span",{className:"model-title__text"},I));return h.default.createElement("span",{className:"model"},h.default.createElement(U,{modelName:l,title:G,onToggle:g,expanded:!!v||f<=b,collapsedContent:K},h.default.createElement("span",{className:"brace-open object"},"{"),c?h.default.createElement(V,null):null,h.default.createElement("span",{className:"inner-object"},h.default.createElement("table",{className:"model"},h.default.createElement("tbody",null,O?h.default.createElement("tr",{className:"description"},h.default.createElement("td",null,"description:"),h.default.createElement("td",null,h.default.createElement(q,{source:O}))):null,M&&h.default.createElement("tr",{className:"external-docs"},h.default.createElement("td",null,"externalDocs:"),h.default.createElement("td",null,h.default.createElement($,{target:"_blank",href:(0,x.Nm)(M)},D||M))),T?h.default.createElement("tr",{className:"property"},h.default.createElement("td",null,"deprecated:"),h.default.createElement("td",null,"true")):null,k&&k.size?(0,m.default)(e=(0,n.default)(t=k.entrySeq()).call(t,(e=>{let[,t]=e;return(!t.get("readOnly")||_)&&(!t.get("writeOnly")||C)}))).call(e,(e=>{let[t,a]=e,n=j()&&a.get("deprecated"),r=y.List.isList(R)&&R.contains(t),s=["property-row"];return n&&s.push("deprecated"),r&&s.push("required"),h.default.createElement("tr",{key:t,className:s.join(" ")},h.default.createElement("td",null,t,r&&h.default.createElement("span",{className:"star"},"*")),h.default.createElement("td",null,h.default.createElement(B,(0,_t.default)({key:`object-${l}-${t}_${a}`},S,{required:r,getComponent:d,specPath:E.push("properties",t),getConfigs:p,schema:a,depth:f+1}))))})).toArray():null,N?h.default.createElement("tr",null,h.default.createElement("td",null," ")):null,N?(0,m.default)(a=o.entrySeq()).call(a,(e=>{let[t,a]=e;if("x-"!==(0,u.default)(t).call(t,0,2))return;const n=a?a.toJS?a.toJS():a:null;return h.default.createElement("tr",{key:t,className:"extension"},h.default.createElement("td",null,t),h.default.createElement("td",null,(0,s.default)(n)))})).toArray():null,A&&A.size?h.default.createElement("tr",null,h.default.createElement("td",null,"< * >:"),h.default.createElement("td",null,h.default.createElement(B,(0,_t.default)({},S,{required:!1,getComponent:d,specPath:E.push("additionalProperties"),getConfigs:p,schema:A,depth:f+1})))):null,F?h.default.createElement("tr",null,h.default.createElement("td",null,"anyOf ->"),h.default.createElement("td",null,(0,m.default)(F).call(F,((e,t)=>h.default.createElement("div",{key:t},h.default.createElement(B,(0,_t.default)({},S,{required:!1,getComponent:d,specPath:E.push("anyOf",t),getConfigs:p,schema:e,depth:f+1}))))))):null,z?h.default.createElement("tr",null,h.default.createElement("td",null,"oneOf ->"),h.default.createElement("td",null,(0,m.default)(z).call(z,((e,t)=>h.default.createElement("div",{key:t},h.default.createElement(B,(0,_t.default)({},S,{required:!1,getComponent:d,specPath:E.push("oneOf",t),getConfigs:p,schema:e,depth:f+1}))))))):null,W?h.default.createElement("tr",null,h.default.createElement("td",null,"not ->"),h.default.createElement("td",null,h.default.createElement("div",null,h.default.createElement(B,(0,_t.default)({},S,{required:!1,getComponent:d,specPath:E.push("not"),getConfigs:p,schema:W,depth:f+1}))))):null))),h.default.createElement("span",{className:"brace-close"},"}")),P.size?(0,m.default)(r=P.entrySeq()).call(r,(e=>{let[t,a]=e;return h.default.createElement(J,{key:`${t}-${a}`,propKey:t,propVal:a,propClass:"property"})})):null)}}class ha extends h.Component{render(){var e;let{getComponent:t,getConfigs:a,schema:r,depth:s,expandDepth:o,name:l,displayName:i,specPath:c}=this.props,u=r.get("description"),d=r.get("items"),p=r.get("title")||i||l,f=(0,n.default)(r).call(r,((e,t)=>{var a;return-1===(0,H.default)(a=["type","items","description","$$ref","externalDocs"]).call(a,t)})),g=r.getIn(["externalDocs","url"]),y=r.getIn(["externalDocs","description"]);const v=t("Markdown",!0),E=t("ModelCollapse"),S=t("Model"),w=t("Property"),b=t("Link"),_=p&&h.default.createElement("span",{className:"model-title"},h.default.createElement("span",{className:"model-title__text"},p));return h.default.createElement("span",{className:"model"},h.default.createElement(E,{title:_,expanded:s<=o,collapsedContent:"[...]"},"[",f.size?(0,m.default)(e=f.entrySeq()).call(e,(e=>{let[t,a]=e;return h.default.createElement(w,{key:`${t}-${a}`,propKey:t,propVal:a,propClass:"property"})})):null,u?h.default.createElement(v,{source:u}):f.size?h.default.createElement("div",{className:"markdown"}):null,g&&h.default.createElement("div",{className:"external-docs"},h.default.createElement(b,{target:"_blank",href:(0,x.Nm)(g)},y||g)),h.default.createElement("span",null,h.default.createElement(S,(0,_t.default)({},this.props,{getConfigs:a,specPath:c.push("items"),name:null,schema:d,required:!1,depth:s+1}))),"]"))}}const ga="property primitive";class ya extends h.Component{render(){var e,t,a;let{schema:r,getComponent:s,getConfigs:o,name:l,displayName:i,depth:c,expandDepth:u}=this.props;const{showExtensions:d}=o();if(!r||!r.get)return h.default.createElement("div",null);let p=r.get("type"),f=r.get("format"),g=r.get("xml"),y=r.get("enum"),v=r.get("title")||i||l,E=r.get("description"),S=(0,x.nX)(r),w=(0,n.default)(r).call(r,((e,t)=>{var a;return-1===(0,H.default)(a=["enum","type","format","description","$$ref","externalDocs"]).call(a,t)})).filterNot(((e,t)=>S.has(t))),b=r.getIn(["externalDocs","url"]),_=r.getIn(["externalDocs","description"]);const C=s("Markdown",!0),j=s("EnumModel"),N=s("Property"),O=s("ModelCollapse"),k=s("Link"),A=v&&h.default.createElement("span",{className:"model-title"},h.default.createElement("span",{className:"model-title__text"},v));return h.default.createElement("span",{className:"model"},h.default.createElement(O,{title:A,expanded:c<=u,collapsedContent:"[...]",hideSelfOnExpand:u!==c},h.default.createElement("span",{className:"prop"},l&&c>1&&h.default.createElement("span",{className:"prop-name"},v),h.default.createElement("span",{className:"prop-type"},p),f&&h.default.createElement("span",{className:"prop-format"},"($",f,")"),w.size?(0,m.default)(e=w.entrySeq()).call(e,(e=>{let[t,a]=e;return h.default.createElement(N,{key:`${t}-${a}`,propKey:t,propVal:a,propClass:ga})})):null,d&&S.size?(0,m.default)(t=S.entrySeq()).call(t,(e=>{let[t,a]=e;return h.default.createElement(N,{key:`${t}-${a}`,propKey:t,propVal:a,propClass:ga})})):null,E?h.default.createElement(C,{source:E}):null,b&&h.default.createElement("div",{className:"external-docs"},h.default.createElement(k,{target:"_blank",href:(0,x.Nm)(b)},_||b)),g&&g.size?h.default.createElement("span",null,h.default.createElement("br",null),h.default.createElement("span",{className:ga},"xml:"),(0,m.default)(a=g.entrySeq()).call(a,(e=>{let[t,a]=e;return h.default.createElement("span",{key:`${t}-${a}`,className:ga},h.default.createElement("br",null),"   ",t,": ",String(a))})).toArray()):null,y&&h.default.createElement(j,{value:y,getComponent:s}))))}}const va=e=>{let{propKey:t,propVal:a,propClass:n}=e;return h.default.createElement("span",{className:n},h.default.createElement("br",null),t,": ",String(a))};class Ea extends h.default.Component{render(){const{onTryoutClick:e,onCancelClick:t,onResetClick:a,enabled:n,hasUserEditedBody:r,isOAS3:s}=this.props,o=s&&r;return h.default.createElement("div",{className:o?"try-out btn-group":"try-out"},n?h.default.createElement("button",{className:"btn try-out__btn cancel",onClick:t},"Cancel"):h.default.createElement("button",{className:"btn try-out__btn",onClick:e},"Try it out "),o&&h.default.createElement("button",{className:"btn try-out__btn reset",onClick:a},"Reset"))}}(0,W.default)(Ea,"defaultProps",{onTryoutClick:Function.prototype,onCancelClick:Function.prototype,onResetClick:Function.prototype,enabled:!1,hasUserEditedBody:!1,isOAS3:!1});class Sa extends h.default.PureComponent{render(){const{bypass:e,isSwagger2:t,isOAS3:a,alsoShow:n}=this.props;return e?h.default.createElement("div",null,this.props.children):t&&a?h.default.createElement("div",{className:"version-pragma"},n,h.default.createElement("div",{className:"version-pragma__message version-pragma__message--ambiguous"},h.default.createElement("div",null,h.default.createElement("h3",null,"Unable to render this definition"),h.default.createElement("p",null,h.default.createElement("code",null,"swagger")," and ",h.default.createElement("code",null,"openapi")," fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields."),h.default.createElement("p",null,"Supported version fields are ",h.default.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",h.default.createElement("code",null,"openapi: 3.0.n")," (for example, ",h.default.createElement("code",null,"openapi: 3.0.0"),").")))):t||a?h.default.createElement("div",null,this.props.children):h.default.createElement("div",{className:"version-pragma"},n,h.default.createElement("div",{className:"version-pragma__message version-pragma__message--missing"},h.default.createElement("div",null,h.default.createElement("h3",null,"Unable to render this definition"),h.default.createElement("p",null,"The provided definition does not specify a valid version field."),h.default.createElement("p",null,"Please indicate a valid Swagger or OpenAPI version field. Supported version fields are ",h.default.createElement("code",null,"swagger: ",'"2.0"')," and those that match ",h.default.createElement("code",null,"openapi: 3.0.n")," (for example, ",h.default.createElement("code",null,"openapi: 3.0.0"),")."))))}}(0,W.default)(Sa,"defaultProps",{alsoShow:null,children:null,bypass:!1});const wa=e=>{let{version:t}=e;return h.default.createElement("small",null,h.default.createElement("pre",{className:"version"}," ",t," "))},ba=e=>{let{oasVersion:t}=e;return h.default.createElement("small",{className:"version-stamp"},h.default.createElement("pre",{className:"version"},"OAS ",t))},xa=e=>{let{enabled:t,path:a,text:n}=e;return h.default.createElement("a",{className:"nostyle",onClick:t?e=>e.preventDefault():null,href:t?`#/${a}`:null},h.default.createElement("span",null,n))},_a=()=>h.default.createElement("div",null,h.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",className:"svg-assets"},h.default.createElement("defs",null,h.default.createElement("symbol",{viewBox:"0 0 20 20",id:"unlocked"},h.default.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z"})),h.default.createElement("symbol",{viewBox:"0 0 20 20",id:"locked"},h.default.createElement("path",{d:"M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z"})),h.default.createElement("symbol",{viewBox:"0 0 20 20",id:"close"},h.default.createElement("path",{d:"M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z"})),h.default.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow"},h.default.createElement("path",{d:"M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z"})),h.default.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow-down"},h.default.createElement("path",{d:"M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z"})),h.default.createElement("symbol",{viewBox:"0 0 20 20",id:"large-arrow-up"},h.default.createElement("path",{d:"M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z"})),h.default.createElement("symbol",{viewBox:"0 0 24 24",id:"jump-to"},h.default.createElement("path",{d:"M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z"})),h.default.createElement("symbol",{viewBox:"0 0 24 24",id:"expand"},h.default.createElement("path",{d:"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z"})),h.default.createElement("symbol",{viewBox:"0 0 15 16",id:"copy"},h.default.createElement("g",{transform:"translate(2, -1)"},h.default.createElement("path",{fill:"#ffffff",fillRule:"evenodd",d:"M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z"}))))));var Ca=pt(5466);class ja extends h.default.Component{render(){const{errSelectors:e,specSelectors:t,getComponent:a}=this.props,n=a("SvgAssets"),r=a("InfoContainer",!0),s=a("VersionPragmaFilter"),o=a("operations",!0),l=a("Models",!0),i=a("Webhooks",!0),c=a("Row"),u=a("Col"),d=a("errors",!0),p=a("ServersContainer",!0),m=a("SchemesContainer",!0),f=a("AuthorizeBtnContainer",!0),g=a("FilterContainer",!0),y=t.isSwagger2(),v=t.isOAS3(),E=t.isOAS31(),S=!t.specStr(),w=t.loadingStatus();let b=null;if("loading"===w&&(b=h.default.createElement("div",{className:"info"},h.default.createElement("div",{className:"loading-container"},h.default.createElement("div",{className:"loading"})))),"failed"===w&&(b=h.default.createElement("div",{className:"info"},h.default.createElement("div",{className:"loading-container"},h.default.createElement("h4",{className:"title"},"Failed to load API definition."),h.default.createElement(d,null)))),"failedConfig"===w){const t=e.lastError(),a=t?t.get("message"):"";b=h.default.createElement("div",{className:"info failed-config"},h.default.createElement("div",{className:"loading-container"},h.default.createElement("h4",{className:"title"},"Failed to load remote configuration."),h.default.createElement("p",null,a)))}if(!b&&S&&(b=h.default.createElement("h4",null,"No API definition provided.")),b)return h.default.createElement("div",{className:"swagger-ui"},h.default.createElement("div",{className:"loading-container"},b));const x=t.servers(),_=t.schemes(),C=x&&x.size,j=_&&_.size,N=!!t.securityDefinitions();return h.default.createElement("div",{className:"swagger-ui"},h.default.createElement(n,null),h.default.createElement(s,{isSwagger2:y,isOAS3:v,alsoShow:h.default.createElement(d,null)},h.default.createElement(d,null),h.default.createElement(c,{className:"information-container"},h.default.createElement(u,{mobile:12},h.default.createElement(r,null))),C||j||N?h.default.createElement("div",{className:"scheme-container"},h.default.createElement(u,{className:"schemes wrapper",mobile:12},C?h.default.createElement(p,null):null,j?h.default.createElement(m,null):null,N?h.default.createElement(f,null):null)):null,h.default.createElement(g,null),h.default.createElement(c,null,h.default.createElement(u,{mobile:12,desktop:12},h.default.createElement(o,null))),E&&h.default.createElement(c,{className:"webhooks-container"},h.default.createElement(u,{mobile:12,desktop:12},h.default.createElement(i,null))),h.default.createElement(c,null,h.default.createElement(u,{mobile:12,desktop:12},h.default.createElement(l,null)))))}}const Na=(e=>{var t={};return pt.d(t,e),t})({default:()=>ct.default}),Oa={value:"",onChange:()=>{},schema:{},keyName:"",required:!1,errors:(0,y.List)()};class ka extends h.Component{componentDidMount(){const{dispatchInitialValue:e,value:t,onChange:a}=this.props;e?a(t):!1===e&&a("")}render(){let{schema:e,errors:t,value:a,onChange:n,getComponent:r,fn:s,disabled:o}=this.props;const l=e&&e.get?e.get("format"):null,i=e&&e.get?e.get("type"):null;let c=e=>r(e,!1,{failSilently:!0}),u=i?c(l?`JsonSchema_${i}_${l}`:`JsonSchema_${i}`):r("JsonSchema_string");return u||(u=r("JsonSchema_string")),h.default.createElement(u,(0,_t.default)({},this.props,{errors:t,fn:s,getComponent:r,value:a,onChange:n,schema:e,disabled:o}))}}(0,W.default)(ka,"defaultProps",Oa);class Aa extends h.Component{constructor(){super(...arguments),(0,W.default)(this,"onChange",(e=>{const t=this.props.schema&&"file"===this.props.schema.get("type")?e.target.files[0]:e.target.value;this.props.onChange(t,this.props.keyName)})),(0,W.default)(this,"onEnumChange",(e=>this.props.onChange(e)))}render(){let{getComponent:e,value:t,schema:a,errors:n,required:r,description:s,disabled:o}=this.props;const l=a&&a.get?a.get("enum"):null,i=a&&a.get?a.get("format"):null,c=a&&a.get?a.get("type"):null,u=a&&a.get?a.get("in"):null;if(t||(t=""),n=n.toJS?n.toJS():[],l){const a=e("Select");return h.default.createElement(a,{className:n.length?"invalid":"",title:n.length?n:"",allowedValues:[...l],value:t,allowEmptyValue:!r,disabled:o,onChange:this.onEnumChange})}const d=o||u&&"formData"===u&&!("FormData"in window),p=e("Input");return c&&"file"===c?h.default.createElement(p,{type:"file",className:n.length?"invalid":"",title:n.length?n:"",onChange:this.onChange,disabled:d}):h.default.createElement(Na.default,{type:i&&"password"===i?"password":"text",className:n.length?"invalid":"",title:n.length?n:"",value:t,minLength:0,debounceTimeout:350,placeholder:s,onChange:this.onChange,disabled:d})}}(0,W.default)(Aa,"defaultProps",Oa);class Ia extends h.PureComponent{constructor(e,t){super(e,t),(0,W.default)(this,"onChange",(()=>{this.props.onChange(this.state.value)})),(0,W.default)(this,"onItemChange",((e,t)=>{this.setState((a=>{let{value:n}=a;return{value:n.set(t,e)}}),this.onChange)})),(0,W.default)(this,"removeItem",(e=>{this.setState((t=>{let{value:a}=t;return{value:a.delete(e)}}),this.onChange)})),(0,W.default)(this,"addItem",(()=>{const{fn:e}=this.props;let t=La(this.state.value);this.setState((()=>({value:t.push(e.getSampleSchema(this.state.schema.get("items"),!1,{includeWriteOnly:!0}))})),this.onChange)})),(0,W.default)(this,"onEnumChange",(e=>{this.setState((()=>({value:e})),this.onChange)})),this.state={value:La(e.value),schema:e.schema}}UNSAFE_componentWillReceiveProps(e){const t=La(e.value);t!==this.state.value&&this.setState({value:t}),e.schema!==this.state.schema&&this.setState({schema:e.schema})}render(){var e;let{getComponent:t,required:a,schema:r,errors:s,fn:o,disabled:l}=this.props;s=s.toJS?s.toJS():(0,d.default)(s)?s:[];const i=(0,n.default)(s).call(s,(e=>"string"==typeof e)),c=(0,m.default)(e=(0,n.default)(s).call(s,(e=>void 0!==e.needRemove))).call(e,(e=>e.error)),u=this.state.value,p=!!(u&&u.count&&u.count()>0),f=r.getIn(["items","enum"]),g=r.getIn(["items","type"]),v=r.getIn(["items","format"]),E=r.get("items");let S,w=!1,b="file"===g||"string"===g&&"binary"===v;if(g&&v?S=t(`JsonSchema_${g}_${v}`):"boolean"!==g&&"array"!==g&&"object"!==g||(S=t(`JsonSchema_${g}`)),S||b||(w=!0),f){const e=t("Select");return h.default.createElement(e,{className:s.length?"invalid":"",title:s.length?s:"",multiple:!0,value:u,disabled:l,allowedValues:f,allowEmptyValue:!a,onChange:this.onEnumChange})}const x=t("Button");return h.default.createElement("div",{className:"json-schema-array"},p?(0,m.default)(u).call(u,((e,a)=>{var r;const i=(0,y.fromJS)([...(0,m.default)(r=(0,n.default)(s).call(s,(e=>e.index===a))).call(r,(e=>e.error))]);return h.default.createElement("div",{key:a,className:"json-schema-form-item"},b?h.default.createElement(Pa,{value:e,onChange:e=>this.onItemChange(e,a),disabled:l,errors:i,getComponent:t}):w?h.default.createElement(Ra,{value:e,onChange:e=>this.onItemChange(e,a),disabled:l,errors:i}):h.default.createElement(S,(0,_t.default)({},this.props,{value:e,onChange:e=>this.onItemChange(e,a),disabled:l,errors:i,schema:E,getComponent:t,fn:o})),l?null:h.default.createElement(x,{className:`btn btn-sm json-schema-form-item-remove ${c.length?"invalid":null}`,title:c.length?c:"",onClick:()=>this.removeItem(a)}," - "))})):null,l?null:h.default.createElement(x,{className:`btn btn-sm json-schema-form-item-add ${i.length?"invalid":null}`,title:i.length?i:"",onClick:this.addItem},"Add ",g?`${g} `:"","item"))}}(0,W.default)(Ia,"defaultProps",Oa);class Ra extends h.Component{constructor(){super(...arguments),(0,W.default)(this,"onChange",(e=>{const t=e.target.value;this.props.onChange(t,this.props.keyName)}))}render(){let{value:e,errors:t,description:a,disabled:n}=this.props;return e||(e=""),t=t.toJS?t.toJS():[],h.default.createElement(Na.default,{type:"text",className:t.length?"invalid":"",title:t.length?t:"",value:e,minLength:0,debounceTimeout:350,placeholder:a,onChange:this.onChange,disabled:n})}}(0,W.default)(Ra,"defaultProps",Oa);class Pa extends h.Component{constructor(){super(...arguments),(0,W.default)(this,"onFileChange",(e=>{const t=e.target.files[0];this.props.onChange(t,this.props.keyName)}))}render(){let{getComponent:e,errors:t,disabled:a}=this.props;const n=e("Input"),r=a||!("FormData"in window);return h.default.createElement(n,{type:"file",className:t.length?"invalid":"",title:t.length?t:"",onChange:this.onFileChange,disabled:r})}}(0,W.default)(Pa,"defaultProps",Oa);class Ta extends h.Component{constructor(){super(...arguments),(0,W.default)(this,"onEnumChange",(e=>this.props.onChange(e)))}render(){let{getComponent:e,value:t,errors:a,schema:n,required:r,disabled:s}=this.props;a=a.toJS?a.toJS():[];let o=n&&n.get?n.get("enum"):null,l=!o||!r,i=!o&&["true","false"];const c=e("Select");return h.default.createElement(c,{className:a.length?"invalid":"",title:a.length?a:"",value:String(t),disabled:s,allowedValues:o?[...o]:i,allowEmptyValue:l,onChange:this.onEnumChange})}}(0,W.default)(Ta,"defaultProps",Oa);const Ma=e=>(0,m.default)(e).call(e,(e=>{const t=void 0!==e.propKey?e.propKey:e.index;let a="string"==typeof e?e:"string"==typeof e.error?e.error:null;if(!t&&a)return a;let n=e.error,r=`/${e.propKey}`;for(;"object"==typeof n;){const e=void 0!==n.propKey?n.propKey:n.index;if(void 0===e)break;if(r+=`/${e}`,!n.error)break;n=n.error}return`${r}: ${n}`}));class Da extends h.PureComponent{constructor(){super(),(0,W.default)(this,"onChange",(e=>{this.props.onChange(e)})),(0,W.default)(this,"handleOnChange",(e=>{const t=e.target.value;this.onChange(t)}))}render(){let{getComponent:e,value:t,errors:a,disabled:n}=this.props;const r=e("TextArea");return a=a.toJS?a.toJS():(0,d.default)(a)?a:[],h.default.createElement("div",null,h.default.createElement(r,{className:(0,Te.default)({invalid:a.length}),title:a.length?Ma(a).join(", "):"",value:(0,x.Pz)(t),disabled:n,onChange:this.handleOnChange}))}}function La(e){return y.List.isList(e)?e:(0,d.default)(e)?(0,y.fromJS)(e):(0,y.List)()}function qa(){let a={components:{App:Y,authorizationPopup:X,authorizeBtn:Q,AuthorizeBtnContainer:ee,authorizeOperationBtn:te,auths:ae,AuthItem:ne,authError:re,oauth2:ge,apiKeyAuth:se,basicAuth:oe,clear:ye,liveResponse:Se,InitializedInput:Ut,info:Kt,InfoContainer:Ft,InfoUrl:$t,InfoBasePath:Jt,Contact:Wt,License:Gt,JumpToPath:Zt,CopyToClipboardBtn:Yt,onlineValidatorBadge:we.Z,operations:be,operation:Ce,OperationSummary:Ne,OperationSummaryMethod:Oe,OperationSummaryPath:Ae,highlightCode:Je,responses:$e,response:Fe,ResponseExtension:ze,responseBody:Ze,parameters:Xe,parameterRow:ht,execute:yt,headers:vt,errors:Et,contentType:xt,overview:qt,footer:Xt,FilterContainer:Qt,ParamBody:ta,curl:na,schemes:ra,SchemesContainer:sa,modelExample:ca,ModelWrapper:ua,ModelCollapse:oa,Model:da.Z,Models:pa,EnumModel:ma,ObjectModel:fa,ArrayModel:ha,PrimitiveModel:ya,Property:va,TryItOutButton:Ea,Markdown:Ca.Z,BaseLayout:ja,VersionPragmaFilter:Sa,VersionStamp:wa,OpenAPIVersion:ba,OperationExt:Ie,OperationExtRow:Re,ParameterExt:Qe,ParameterIncludeEmpty:dt,OperationTag:_e,OperationContainer:Z,DeepLink:xa,SvgAssets:_a,Example:le,ExamplesSelect:ce,ExamplesSelectValueRetainer:de}},n={components:e},r={components:t};return[J.default,B.default,D.default,P.default,R.default,A.default,I.default,T.default,a,n,L.default,r,q.default,U.default,$.default,V.default,K.default,M.default,z.default,(0,F.default)()]}(0,W.default)(Da,"defaultProps",Oa);var Ba=pt(7451),Ua=pt(9806),Ja=pt(7139);function $a(){return[qa,Ba.default,Ja.default,Ua.default]}var Va=pt(5308);const{GIT_DIRTY:Ka,GIT_COMMIT:Fa,PACKAGE_VERSION:za,BUILD_TIME:Wa}={PACKAGE_VERSION:"5.5.0",GIT_COMMIT:"gf0c4bf45",GIT_DIRTY:!0,BUILD_TIME:"Mon, 04 Sep 2023 07:51:09 GMT"};function Ha(e){var t;b.Z.versions=b.Z.versions||{},b.Z.versions.swaggerUi={version:za,gitRevision:Fa,gitDirty:Ka,buildTimestamp:Wa};const o={dom_id:null,domNode:null,spec:{},url:"",urls:null,layout:"BaseLayout",docExpansion:"list",maxDisplayedTags:null,filter:null,validatorUrl:"https://validator.swagger.io/validator",oauth2RedirectUrl:`${window.location.protocol}//${window.location.host}${window.location.pathname.substring(0,(0,a.default)(t=window.location.pathname).call(t,"/"))}/oauth2-redirect.html`,persistAuthorization:!1,configs:{},custom:{},displayOperationId:!1,displayRequestDuration:!1,deepLinking:!1,tryItOutEnabled:!1,requestInterceptor:e=>e,responseInterceptor:e=>e,showMutatedRequest:!0,defaultModelRendering:"example",defaultModelExpandDepth:1,defaultModelsExpandDepth:1,showExtensions:!1,showCommonExtensions:!1,withCredentials:void 0,requestSnippetsEnabled:!1,requestSnippets:{generators:{curl_bash:{title:"cURL (bash)",syntax:"bash"},curl_powershell:{title:"cURL (PowerShell)",syntax:"powershell"},curl_cmd:{title:"cURL (CMD)",syntax:"bash"}},defaultExpanded:!0,languages:null},supportedSubmitMethods:["get","put","post","delete","options","head","patch","trace"],queryConfigEnabled:!1,presets:[$a],plugins:[],pluginsOptions:{pluginLoadType:"legacy"},initialState:{},fn:{},components:{},syntaxHighlight:{activated:!0,theme:"agate"}};let i=e.queryConfigEnabled?(0,x.UG)():{};const c=e.domNode;delete e.domNode;const u=l()({},o,e,i),d={system:{configs:u.configs},plugins:u.presets,pluginsOptions:u.pluginsOptions,state:l()({layout:{layout:u.layout,filter:(0,n.default)(u)},spec:{spec:"",url:u.url},requestSnippets:u.requestSnippets},u.initialState)};if(u.initialState)for(var p in u.initialState)Object.prototype.hasOwnProperty.call(u.initialState,p)&&void 0===u.initialState[p]&&delete d.state[p];var m=new C(d);m.register([u.plugins,()=>({fn:u.fn,components:u.components,state:u.state})]);var f=m.getSystem();const h=e=>{let t=f.specSelectors.getLocalConfig?f.specSelectors.getLocalConfig():{},a=l()({},t,u,e||{},i);if(c&&(a.domNode=c),m.setConfigs(a),f.configsActions.loaded(),null!==e&&(!i.url&&"object"==typeof a.spec&&(0,r.default)(a.spec).length?(f.specActions.updateUrl(""),f.specActions.updateLoadingStatus("success"),f.specActions.updateSpec((0,s.default)(a.spec))):f.specActions.download&&a.url&&!a.urls&&(f.specActions.updateUrl(a.url),f.specActions.download(a.url))),a.domNode)f.render(a.domNode,"App");else if(a.dom_id){let e=document.querySelector(a.dom_id);f.render(e,"App")}else null===a.dom_id||null===a.domNode||console.error("Skipped rendering: no `dom_id` or `domNode` was specified");return f},g=i.config||u.configUrl;return g&&f.specActions&&f.specActions.getConfigByUrl?(f.specActions.getConfigByUrl({url:g,loadRemoteConfig:!0,requestInterceptor:u.requestInterceptor,responseInterceptor:u.responseInterceptor},h),f):h()}Ha.presets={apis:$a},Ha.plugins=Va.default;const Ga=Ha})();var ft=mt.Z;export{ft as default}; -//# sourceMappingURL=swagger-ui-es-bundle-core.js.map \ No newline at end of file +import * as __WEBPACK_EXTERNAL_MODULE_base64_js_f145eb6e__ from "base64-js"; +import * as __WEBPACK_EXTERNAL_MODULE_ieee754__ from "ieee754"; +import * as __WEBPACK_EXTERNAL_MODULE_react__ from "react"; +import * as __WEBPACK_EXTERNAL_MODULE_redux__ from "redux"; +import * as __WEBPACK_EXTERNAL_MODULE_immutable__ from "immutable"; +import * as __WEBPACK_EXTERNAL_MODULE_redux_immutable_446c9f82__ from "redux-immutable"; +import * as __WEBPACK_EXTERNAL_MODULE_serialize_error_5f2df3e5__ from "serialize-error"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_merge_cf99375a__ from "lodash/merge"; +import * as __WEBPACK_EXTERNAL_MODULE__braintree_sanitize_url_2340607f__ from "@braintree/sanitize-url"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_camelCase_81fadc19__ from "lodash/camelCase"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_upperFirst_9993ecb4__ from "lodash/upperFirst"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_memoize_2b5bc477__ from "lodash/memoize"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_find_e8ecc2cb__ from "lodash/find"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_some_5cd47809__ from "lodash/some"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_eq_b41b823a__ from "lodash/eq"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_isFunction_f90b20d6__ from "lodash/isFunction"; +import * as __WEBPACK_EXTERNAL_MODULE_css_escape_2d301448__ from "css.escape"; +import * as __WEBPACK_EXTERNAL_MODULE_url_parse_6456105f__ from "url-parse"; +import * as __WEBPACK_EXTERNAL_MODULE_reselect__ from "reselect"; +import * as __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_objectSpread2_89fd8f56__ from "@babel/runtime-corejs3/helpers/objectSpread2"; +import * as __WEBPACK_EXTERNAL_MODULE_prop_types_adfe8e31__ from "prop-types"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_omit_d930e0f3__ from "lodash/omit"; +import * as __WEBPACK_EXTERNAL_MODULE_js_yaml_78384032__ from "js-yaml"; +import * as __WEBPACK_EXTERNAL_MODULE_zenscroll__ from "zenscroll"; +import * as __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_defineProperty_807a2698__ from "@babel/runtime-corejs3/helpers/defineProperty"; +import * as __WEBPACK_EXTERNAL_MODULE_react_immutable_proptypes_89c7d083__ from "react-immutable-proptypes"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_reduce_11e69996__ from "lodash/reduce"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__ from "lodash/get"; +import * as __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_extends_d20d3ceb__ from "@babel/runtime-corejs3/helpers/extends"; +import * as __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_objectWithoutProperties_9beedba5__ from "@babel/runtime-corejs3/helpers/objectWithoutProperties"; +import * as __WEBPACK_EXTERNAL_MODULE_react_copy_to_clipboard_5b11dd57__ from "react-copy-to-clipboard"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_light_746e1958__ from "react-syntax-highlighter/dist/esm/light"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_javascript_e22911f7__ from "react-syntax-highlighter/dist/esm/languages/hljs/javascript"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_json_b876afc5__ from "react-syntax-highlighter/dist/esm/languages/hljs/json"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_xml_a81c807b__ from "react-syntax-highlighter/dist/esm/languages/hljs/xml"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_bash_1621c621__ from "react-syntax-highlighter/dist/esm/languages/hljs/bash"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_yaml_02838f34__ from "react-syntax-highlighter/dist/esm/languages/hljs/yaml"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_http_4e924b23__ from "react-syntax-highlighter/dist/esm/languages/hljs/http"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_powershell_d51eb4f6__ from "react-syntax-highlighter/dist/esm/languages/hljs/powershell"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_agate_99a46aa2__ from "react-syntax-highlighter/dist/esm/styles/hljs/agate"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_arta_570691fc__ from "react-syntax-highlighter/dist/esm/styles/hljs/arta"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_monokai_2529bafb__ from "react-syntax-highlighter/dist/esm/styles/hljs/monokai"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_nord_5bfa1099__ from "react-syntax-highlighter/dist/esm/styles/hljs/nord"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_obsidian_a278dd52__ from "react-syntax-highlighter/dist/esm/styles/hljs/obsidian"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_tomorrow_night_63765df9__ from "react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night"; +import * as __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_idea_023aba2e__ from "react-syntax-highlighter/dist/esm/styles/hljs/idea"; +import * as __WEBPACK_EXTERNAL_MODULE_xml__ from "xml"; +import * as __WEBPACK_EXTERNAL_MODULE_randexp__ from "randexp"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_isEmpty_e109fd6b__ from "lodash/isEmpty"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_isString_e6fa8a5b__ from "lodash/isString"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__ from "lodash/debounce"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_set_b4b15ee5__ from "lodash/set"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_fp_assocPath_f9d64e33__ from "lodash/fp/assocPath"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_constant_f5c0879f__ from "lodash/constant"; +import * as __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_strategies_generic_08dd5200__ from "swagger-client/es/resolver/strategies/generic"; +import * as __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_strategies_openapi_2_ff6e79cf__ from "swagger-client/es/resolver/strategies/openapi-2"; +import * as __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_strategies_openapi_3_0_2fa0ff7c__ from "swagger-client/es/resolver/strategies/openapi-3-0"; +import * as __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_strategies_openapi_3_1_apidom_5e628d39__ from "swagger-client/es/resolver/strategies/openapi-3-1-apidom"; +import * as __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_f879c638__ from "swagger-client/es/resolver"; +import * as __WEBPACK_EXTERNAL_MODULE_swagger_client_es_execute_d486d3d6__ from "swagger-client/es/execute"; +import * as __WEBPACK_EXTERNAL_MODULE_swagger_client_es_http_69655560__ from "swagger-client/es/http"; +import * as __WEBPACK_EXTERNAL_MODULE_swagger_client_es_subtree_resolver_741cb9d9__ from "swagger-client/es/subtree-resolver"; +import * as __WEBPACK_EXTERNAL_MODULE_swagger_client_es_helpers_4d7bea47__ from "swagger-client/es/helpers"; +import * as __WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__ from "react-dom"; +import * as __WEBPACK_EXTERNAL_MODULE_react_redux_87be03b0__ from "react-redux"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_identity_75ffe4a7__ from "lodash/identity"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_zipObject_c74f1c14__ from "lodash/zipObject"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_toString_da931f05__ from "lodash/toString"; +import * as __WEBPACK_EXTERNAL_MODULE_classnames__ from "classnames"; +import * as __WEBPACK_EXTERNAL_MODULE_js_file_download_bd23dbb6__ from "js-file-download"; +import * as __WEBPACK_EXTERNAL_MODULE_xml_but_prettier_2ed4d5cb__ from "xml-but-prettier"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_toLower_c29ee2b0__ from "lodash/toLower"; +import * as __WEBPACK_EXTERNAL_MODULE_react_immutable_pure_component_cbcfaebd__ from "react-immutable-pure-component"; +import * as __WEBPACK_EXTERNAL_MODULE_remarkable__ from "remarkable"; +import * as __WEBPACK_EXTERNAL_MODULE_remarkable_linkify_34829ba6__ from "remarkable/linkify"; +import * as __WEBPACK_EXTERNAL_MODULE_dompurify__ from "dompurify"; +import * as __WEBPACK_EXTERNAL_MODULE_react_debounce_input_7ed3e068__ from "react-debounce-input"; +import * as __WEBPACK_EXTERNAL_MODULE_lodash_isPlainObject_116f2243__ from "lodash/isPlainObject"; +import * as __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_classPrivateFieldGet_c0aa81e1__ from "@babel/runtime-corejs3/helpers/classPrivateFieldGet"; +/******/ var __webpack_modules__ = ({ + +/***/ 764: +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { + +/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */ +/* eslint-disable no-proto */ + + + +const base64 = __webpack_require__(780) +const ieee754 = __webpack_require__(294) +const customInspectSymbol = + (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') // eslint-disable-line dot-notation + ? Symbol['for']('nodejs.util.inspect.custom') // eslint-disable-line dot-notation + : null + +exports.Buffer = Buffer +exports.SlowBuffer = SlowBuffer +exports.INSPECT_MAX_BYTES = 50 + +const K_MAX_LENGTH = 0x7fffffff +exports.kMaxLength = K_MAX_LENGTH + +/** + * If `Buffer.TYPED_ARRAY_SUPPORT`: + * === true Use Uint8Array implementation (fastest) + * === false Print warning and recommend using `buffer` v4.x which has an Object + * implementation (most compatible, even IE6) + * + * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+, + * Opera 11.6+, iOS 4.2+. + * + * We report that the browser does not support typed arrays if the are not subclassable + * using __proto__. Firefox 4-29 lacks support for adding new properties to `Uint8Array` + * (See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438). IE 10 lacks support + * for __proto__ and has a buggy typed array implementation. + */ +Buffer.TYPED_ARRAY_SUPPORT = typedArraySupport() + +if (!Buffer.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && + typeof console.error === 'function') { + console.error( + 'This browser lacks typed array (Uint8Array) support which is required by ' + + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.' + ) +} + +function typedArraySupport () { + // Can typed array instances can be augmented? + try { + const arr = new Uint8Array(1) + const proto = { foo: function () { return 42 } } + Object.setPrototypeOf(proto, Uint8Array.prototype) + Object.setPrototypeOf(arr, proto) + return arr.foo() === 42 + } catch (e) { + return false + } +} + +Object.defineProperty(Buffer.prototype, 'parent', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.buffer + } +}) + +Object.defineProperty(Buffer.prototype, 'offset', { + enumerable: true, + get: function () { + if (!Buffer.isBuffer(this)) return undefined + return this.byteOffset + } +}) + +function createBuffer (length) { + if (length > K_MAX_LENGTH) { + throw new RangeError('The value "' + length + '" is invalid for option "size"') + } + // Return an augmented `Uint8Array` instance + const buf = new Uint8Array(length) + Object.setPrototypeOf(buf, Buffer.prototype) + return buf +} + +/** + * The Buffer constructor returns instances of `Uint8Array` that have their + * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of + * `Uint8Array`, so the returned instances will have all the node `Buffer` methods + * and the `Uint8Array` methods. Square bracket notation works as expected -- it + * returns a single octet. + * + * The `Uint8Array` prototype remains unmodified. + */ + +function Buffer (arg, encodingOrOffset, length) { + // Common case. + if (typeof arg === 'number') { + if (typeof encodingOrOffset === 'string') { + throw new TypeError( + 'The "string" argument must be of type string. Received type number' + ) + } + return allocUnsafe(arg) + } + return from(arg, encodingOrOffset, length) +} + +Buffer.poolSize = 8192 // not used by this implementation + +function from (value, encodingOrOffset, length) { + if (typeof value === 'string') { + return fromString(value, encodingOrOffset) + } + + if (ArrayBuffer.isView(value)) { + return fromArrayView(value) + } + + if (value == null) { + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) + } + + if (isInstance(value, ArrayBuffer) || + (value && isInstance(value.buffer, ArrayBuffer))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof SharedArrayBuffer !== 'undefined' && + (isInstance(value, SharedArrayBuffer) || + (value && isInstance(value.buffer, SharedArrayBuffer)))) { + return fromArrayBuffer(value, encodingOrOffset, length) + } + + if (typeof value === 'number') { + throw new TypeError( + 'The "value" argument must not be of type number. Received type number' + ) + } + + const valueOf = value.valueOf && value.valueOf() + if (valueOf != null && valueOf !== value) { + return Buffer.from(valueOf, encodingOrOffset, length) + } + + const b = fromObject(value) + if (b) return b + + if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && + typeof value[Symbol.toPrimitive] === 'function') { + return Buffer.from(value[Symbol.toPrimitive]('string'), encodingOrOffset, length) + } + + throw new TypeError( + 'The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + + 'or Array-like Object. Received type ' + (typeof value) + ) +} + +/** + * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError + * if value is a number. + * Buffer.from(str[, encoding]) + * Buffer.from(array) + * Buffer.from(buffer) + * Buffer.from(arrayBuffer[, byteOffset[, length]]) + **/ +Buffer.from = function (value, encodingOrOffset, length) { + return from(value, encodingOrOffset, length) +} + +// Note: Change prototype *after* Buffer.from is defined to workaround Chrome bug: +// https://github.com/feross/buffer/pull/148 +Object.setPrototypeOf(Buffer.prototype, Uint8Array.prototype) +Object.setPrototypeOf(Buffer, Uint8Array) + +function assertSize (size) { + if (typeof size !== 'number') { + throw new TypeError('"size" argument must be of type number') + } else if (size < 0) { + throw new RangeError('The value "' + size + '" is invalid for option "size"') + } +} + +function alloc (size, fill, encoding) { + assertSize(size) + if (size <= 0) { + return createBuffer(size) + } + if (fill !== undefined) { + // Only pay attention to encoding if it's a string. This + // prevents accidentally sending in a number that would + // be interpreted as a start offset. + return typeof encoding === 'string' + ? createBuffer(size).fill(fill, encoding) + : createBuffer(size).fill(fill) + } + return createBuffer(size) +} + +/** + * Creates a new filled Buffer instance. + * alloc(size[, fill[, encoding]]) + **/ +Buffer.alloc = function (size, fill, encoding) { + return alloc(size, fill, encoding) +} + +function allocUnsafe (size) { + assertSize(size) + return createBuffer(size < 0 ? 0 : checked(size) | 0) +} + +/** + * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance. + * */ +Buffer.allocUnsafe = function (size) { + return allocUnsafe(size) +} +/** + * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance. + */ +Buffer.allocUnsafeSlow = function (size) { + return allocUnsafe(size) +} + +function fromString (string, encoding) { + if (typeof encoding !== 'string' || encoding === '') { + encoding = 'utf8' + } + + if (!Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + + const length = byteLength(string, encoding) | 0 + let buf = createBuffer(length) + + const actual = buf.write(string, encoding) + + if (actual !== length) { + // Writing a hex string, for example, that contains invalid characters will + // cause everything after the first invalid character to be ignored. (e.g. + // 'abxxcd' will be treated as 'ab') + buf = buf.slice(0, actual) + } + + return buf +} + +function fromArrayLike (array) { + const length = array.length < 0 ? 0 : checked(array.length) | 0 + const buf = createBuffer(length) + for (let i = 0; i < length; i += 1) { + buf[i] = array[i] & 255 + } + return buf +} + +function fromArrayView (arrayView) { + if (isInstance(arrayView, Uint8Array)) { + const copy = new Uint8Array(arrayView) + return fromArrayBuffer(copy.buffer, copy.byteOffset, copy.byteLength) + } + return fromArrayLike(arrayView) +} + +function fromArrayBuffer (array, byteOffset, length) { + if (byteOffset < 0 || array.byteLength < byteOffset) { + throw new RangeError('"offset" is outside of buffer bounds') + } + + if (array.byteLength < byteOffset + (length || 0)) { + throw new RangeError('"length" is outside of buffer bounds') + } + + let buf + if (byteOffset === undefined && length === undefined) { + buf = new Uint8Array(array) + } else if (length === undefined) { + buf = new Uint8Array(array, byteOffset) + } else { + buf = new Uint8Array(array, byteOffset, length) + } + + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(buf, Buffer.prototype) + + return buf +} + +function fromObject (obj) { + if (Buffer.isBuffer(obj)) { + const len = checked(obj.length) | 0 + const buf = createBuffer(len) + + if (buf.length === 0) { + return buf + } + + obj.copy(buf, 0, 0, len) + return buf + } + + if (obj.length !== undefined) { + if (typeof obj.length !== 'number' || numberIsNaN(obj.length)) { + return createBuffer(0) + } + return fromArrayLike(obj) + } + + if (obj.type === 'Buffer' && Array.isArray(obj.data)) { + return fromArrayLike(obj.data) + } +} + +function checked (length) { + // Note: cannot use `length < K_MAX_LENGTH` here because that fails when + // length is NaN (which is otherwise coerced to zero.) + if (length >= K_MAX_LENGTH) { + throw new RangeError('Attempt to allocate Buffer larger than maximum ' + + 'size: 0x' + K_MAX_LENGTH.toString(16) + ' bytes') + } + return length | 0 +} + +function SlowBuffer (length) { + if (+length != length) { // eslint-disable-line eqeqeq + length = 0 + } + return Buffer.alloc(+length) +} + +Buffer.isBuffer = function isBuffer (b) { + return b != null && b._isBuffer === true && + b !== Buffer.prototype // so Buffer.isBuffer(Buffer.prototype) will be false +} + +Buffer.compare = function compare (a, b) { + if (isInstance(a, Uint8Array)) a = Buffer.from(a, a.offset, a.byteLength) + if (isInstance(b, Uint8Array)) b = Buffer.from(b, b.offset, b.byteLength) + if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) { + throw new TypeError( + 'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array' + ) + } + + if (a === b) return 0 + + let x = a.length + let y = b.length + + for (let i = 0, len = Math.min(x, y); i < len; ++i) { + if (a[i] !== b[i]) { + x = a[i] + y = b[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +Buffer.isEncoding = function isEncoding (encoding) { + switch (String(encoding).toLowerCase()) { + case 'hex': + case 'utf8': + case 'utf-8': + case 'ascii': + case 'latin1': + case 'binary': + case 'base64': + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return true + default: + return false + } +} + +Buffer.concat = function concat (list, length) { + if (!Array.isArray(list)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } + + if (list.length === 0) { + return Buffer.alloc(0) + } + + let i + if (length === undefined) { + length = 0 + for (i = 0; i < list.length; ++i) { + length += list[i].length + } + } + + const buffer = Buffer.allocUnsafe(length) + let pos = 0 + for (i = 0; i < list.length; ++i) { + let buf = list[i] + if (isInstance(buf, Uint8Array)) { + if (pos + buf.length > buffer.length) { + if (!Buffer.isBuffer(buf)) buf = Buffer.from(buf) + buf.copy(buffer, pos) + } else { + Uint8Array.prototype.set.call( + buffer, + buf, + pos + ) + } + } else if (!Buffer.isBuffer(buf)) { + throw new TypeError('"list" argument must be an Array of Buffers') + } else { + buf.copy(buffer, pos) + } + pos += buf.length + } + return buffer +} + +function byteLength (string, encoding) { + if (Buffer.isBuffer(string)) { + return string.length + } + if (ArrayBuffer.isView(string) || isInstance(string, ArrayBuffer)) { + return string.byteLength + } + if (typeof string !== 'string') { + throw new TypeError( + 'The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + + 'Received type ' + typeof string + ) + } + + const len = string.length + const mustMatch = (arguments.length > 2 && arguments[2] === true) + if (!mustMatch && len === 0) return 0 + + // Use a for loop to avoid recursion + let loweredCase = false + for (;;) { + switch (encoding) { + case 'ascii': + case 'latin1': + case 'binary': + return len + case 'utf8': + case 'utf-8': + return utf8ToBytes(string).length + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return len * 2 + case 'hex': + return len >>> 1 + case 'base64': + return base64ToBytes(string).length + default: + if (loweredCase) { + return mustMatch ? -1 : utf8ToBytes(string).length // assume utf8 + } + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} +Buffer.byteLength = byteLength + +function slowToString (encoding, start, end) { + let loweredCase = false + + // No need to verify that "this.length <= MAX_UINT32" since it's a read-only + // property of a typed array. + + // This behaves neither like String nor Uint8Array in that we set start/end + // to their upper/lower bounds if the value passed is out of range. + // undefined is handled specially as per ECMA-262 6th Edition, + // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization. + if (start === undefined || start < 0) { + start = 0 + } + // Return early if start > this.length. Done here to prevent potential uint32 + // coercion fail below. + if (start > this.length) { + return '' + } + + if (end === undefined || end > this.length) { + end = this.length + } + + if (end <= 0) { + return '' + } + + // Force coercion to uint32. This will also coerce falsey/NaN values to 0. + end >>>= 0 + start >>>= 0 + + if (end <= start) { + return '' + } + + if (!encoding) encoding = 'utf8' + + while (true) { + switch (encoding) { + case 'hex': + return hexSlice(this, start, end) + + case 'utf8': + case 'utf-8': + return utf8Slice(this, start, end) + + case 'ascii': + return asciiSlice(this, start, end) + + case 'latin1': + case 'binary': + return latin1Slice(this, start, end) + + case 'base64': + return base64Slice(this, start, end) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return utf16leSlice(this, start, end) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = (encoding + '').toLowerCase() + loweredCase = true + } + } +} + +// This property is used by `Buffer.isBuffer` (and the `is-buffer` npm package) +// to detect a Buffer instance. It's not possible to use `instanceof Buffer` +// reliably in a browserify context because there could be multiple different +// copies of the 'buffer' package in use. This method works even for Buffer +// instances that were created from another copy of the `buffer` package. +// See: https://github.com/feross/buffer/issues/154 +Buffer.prototype._isBuffer = true + +function swap (b, n, m) { + const i = b[n] + b[n] = b[m] + b[m] = i +} + +Buffer.prototype.swap16 = function swap16 () { + const len = this.length + if (len % 2 !== 0) { + throw new RangeError('Buffer size must be a multiple of 16-bits') + } + for (let i = 0; i < len; i += 2) { + swap(this, i, i + 1) + } + return this +} + +Buffer.prototype.swap32 = function swap32 () { + const len = this.length + if (len % 4 !== 0) { + throw new RangeError('Buffer size must be a multiple of 32-bits') + } + for (let i = 0; i < len; i += 4) { + swap(this, i, i + 3) + swap(this, i + 1, i + 2) + } + return this +} + +Buffer.prototype.swap64 = function swap64 () { + const len = this.length + if (len % 8 !== 0) { + throw new RangeError('Buffer size must be a multiple of 64-bits') + } + for (let i = 0; i < len; i += 8) { + swap(this, i, i + 7) + swap(this, i + 1, i + 6) + swap(this, i + 2, i + 5) + swap(this, i + 3, i + 4) + } + return this +} + +Buffer.prototype.toString = function toString () { + const length = this.length + if (length === 0) return '' + if (arguments.length === 0) return utf8Slice(this, 0, length) + return slowToString.apply(this, arguments) +} + +Buffer.prototype.toLocaleString = Buffer.prototype.toString + +Buffer.prototype.equals = function equals (b) { + if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer') + if (this === b) return true + return Buffer.compare(this, b) === 0 +} + +Buffer.prototype.inspect = function inspect () { + let str = '' + const max = exports.INSPECT_MAX_BYTES + str = this.toString('hex', 0, max).replace(/(.{2})/g, '$1 ').trim() + if (this.length > max) str += ' ... ' + return '' +} +if (customInspectSymbol) { + Buffer.prototype[customInspectSymbol] = Buffer.prototype.inspect +} + +Buffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) { + if (isInstance(target, Uint8Array)) { + target = Buffer.from(target, target.offset, target.byteLength) + } + if (!Buffer.isBuffer(target)) { + throw new TypeError( + 'The "target" argument must be one of type Buffer or Uint8Array. ' + + 'Received type ' + (typeof target) + ) + } + + if (start === undefined) { + start = 0 + } + if (end === undefined) { + end = target ? target.length : 0 + } + if (thisStart === undefined) { + thisStart = 0 + } + if (thisEnd === undefined) { + thisEnd = this.length + } + + if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) { + throw new RangeError('out of range index') + } + + if (thisStart >= thisEnd && start >= end) { + return 0 + } + if (thisStart >= thisEnd) { + return -1 + } + if (start >= end) { + return 1 + } + + start >>>= 0 + end >>>= 0 + thisStart >>>= 0 + thisEnd >>>= 0 + + if (this === target) return 0 + + let x = thisEnd - thisStart + let y = end - start + const len = Math.min(x, y) + + const thisCopy = this.slice(thisStart, thisEnd) + const targetCopy = target.slice(start, end) + + for (let i = 0; i < len; ++i) { + if (thisCopy[i] !== targetCopy[i]) { + x = thisCopy[i] + y = targetCopy[i] + break + } + } + + if (x < y) return -1 + if (y < x) return 1 + return 0 +} + +// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`, +// OR the last index of `val` in `buffer` at offset <= `byteOffset`. +// +// Arguments: +// - buffer - a Buffer to search +// - val - a string, Buffer, or number +// - byteOffset - an index into `buffer`; will be clamped to an int32 +// - encoding - an optional encoding, relevant is val is a string +// - dir - true for indexOf, false for lastIndexOf +function bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) { + // Empty buffer means no match + if (buffer.length === 0) return -1 + + // Normalize byteOffset + if (typeof byteOffset === 'string') { + encoding = byteOffset + byteOffset = 0 + } else if (byteOffset > 0x7fffffff) { + byteOffset = 0x7fffffff + } else if (byteOffset < -0x80000000) { + byteOffset = -0x80000000 + } + byteOffset = +byteOffset // Coerce to Number. + if (numberIsNaN(byteOffset)) { + // byteOffset: it it's undefined, null, NaN, "foo", etc, search whole buffer + byteOffset = dir ? 0 : (buffer.length - 1) + } + + // Normalize byteOffset: negative offsets start from the end of the buffer + if (byteOffset < 0) byteOffset = buffer.length + byteOffset + if (byteOffset >= buffer.length) { + if (dir) return -1 + else byteOffset = buffer.length - 1 + } else if (byteOffset < 0) { + if (dir) byteOffset = 0 + else return -1 + } + + // Normalize val + if (typeof val === 'string') { + val = Buffer.from(val, encoding) + } + + // Finally, search either indexOf (if dir is true) or lastIndexOf + if (Buffer.isBuffer(val)) { + // Special case: looking for empty string/buffer always fails + if (val.length === 0) { + return -1 + } + return arrayIndexOf(buffer, val, byteOffset, encoding, dir) + } else if (typeof val === 'number') { + val = val & 0xFF // Search for a byte value [0-255] + if (typeof Uint8Array.prototype.indexOf === 'function') { + if (dir) { + return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset) + } else { + return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset) + } + } + return arrayIndexOf(buffer, [val], byteOffset, encoding, dir) + } + + throw new TypeError('val must be string, number or Buffer') +} + +function arrayIndexOf (arr, val, byteOffset, encoding, dir) { + let indexSize = 1 + let arrLength = arr.length + let valLength = val.length + + if (encoding !== undefined) { + encoding = String(encoding).toLowerCase() + if (encoding === 'ucs2' || encoding === 'ucs-2' || + encoding === 'utf16le' || encoding === 'utf-16le') { + if (arr.length < 2 || val.length < 2) { + return -1 + } + indexSize = 2 + arrLength /= 2 + valLength /= 2 + byteOffset /= 2 + } + } + + function read (buf, i) { + if (indexSize === 1) { + return buf[i] + } else { + return buf.readUInt16BE(i * indexSize) + } + } + + let i + if (dir) { + let foundIndex = -1 + for (i = byteOffset; i < arrLength; i++) { + if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) { + if (foundIndex === -1) foundIndex = i + if (i - foundIndex + 1 === valLength) return foundIndex * indexSize + } else { + if (foundIndex !== -1) i -= i - foundIndex + foundIndex = -1 + } + } + } else { + if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength + for (i = byteOffset; i >= 0; i--) { + let found = true + for (let j = 0; j < valLength; j++) { + if (read(arr, i + j) !== read(val, j)) { + found = false + break + } + } + if (found) return i + } + } + + return -1 +} + +Buffer.prototype.includes = function includes (val, byteOffset, encoding) { + return this.indexOf(val, byteOffset, encoding) !== -1 +} + +Buffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, true) +} + +Buffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) { + return bidirectionalIndexOf(this, val, byteOffset, encoding, false) +} + +function hexWrite (buf, string, offset, length) { + offset = Number(offset) || 0 + const remaining = buf.length - offset + if (!length) { + length = remaining + } else { + length = Number(length) + if (length > remaining) { + length = remaining + } + } + + const strLen = string.length + + if (length > strLen / 2) { + length = strLen / 2 + } + let i + for (i = 0; i < length; ++i) { + const parsed = parseInt(string.substr(i * 2, 2), 16) + if (numberIsNaN(parsed)) return i + buf[offset + i] = parsed + } + return i +} + +function utf8Write (buf, string, offset, length) { + return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length) +} + +function asciiWrite (buf, string, offset, length) { + return blitBuffer(asciiToBytes(string), buf, offset, length) +} + +function base64Write (buf, string, offset, length) { + return blitBuffer(base64ToBytes(string), buf, offset, length) +} + +function ucs2Write (buf, string, offset, length) { + return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length) +} + +Buffer.prototype.write = function write (string, offset, length, encoding) { + // Buffer#write(string) + if (offset === undefined) { + encoding = 'utf8' + length = this.length + offset = 0 + // Buffer#write(string, encoding) + } else if (length === undefined && typeof offset === 'string') { + encoding = offset + length = this.length + offset = 0 + // Buffer#write(string, offset[, length][, encoding]) + } else if (isFinite(offset)) { + offset = offset >>> 0 + if (isFinite(length)) { + length = length >>> 0 + if (encoding === undefined) encoding = 'utf8' + } else { + encoding = length + length = undefined + } + } else { + throw new Error( + 'Buffer.write(string, encoding, offset[, length]) is no longer supported' + ) + } + + const remaining = this.length - offset + if (length === undefined || length > remaining) length = remaining + + if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) { + throw new RangeError('Attempt to write outside buffer bounds') + } + + if (!encoding) encoding = 'utf8' + + let loweredCase = false + for (;;) { + switch (encoding) { + case 'hex': + return hexWrite(this, string, offset, length) + + case 'utf8': + case 'utf-8': + return utf8Write(this, string, offset, length) + + case 'ascii': + case 'latin1': + case 'binary': + return asciiWrite(this, string, offset, length) + + case 'base64': + // Warning: maxLength not taken into account in base64Write + return base64Write(this, string, offset, length) + + case 'ucs2': + case 'ucs-2': + case 'utf16le': + case 'utf-16le': + return ucs2Write(this, string, offset, length) + + default: + if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding) + encoding = ('' + encoding).toLowerCase() + loweredCase = true + } + } +} + +Buffer.prototype.toJSON = function toJSON () { + return { + type: 'Buffer', + data: Array.prototype.slice.call(this._arr || this, 0) + } +} + +function base64Slice (buf, start, end) { + if (start === 0 && end === buf.length) { + return base64.fromByteArray(buf) + } else { + return base64.fromByteArray(buf.slice(start, end)) + } +} + +function utf8Slice (buf, start, end) { + end = Math.min(buf.length, end) + const res = [] + + let i = start + while (i < end) { + const firstByte = buf[i] + let codePoint = null + let bytesPerSequence = (firstByte > 0xEF) + ? 4 + : (firstByte > 0xDF) + ? 3 + : (firstByte > 0xBF) + ? 2 + : 1 + + if (i + bytesPerSequence <= end) { + let secondByte, thirdByte, fourthByte, tempCodePoint + + switch (bytesPerSequence) { + case 1: + if (firstByte < 0x80) { + codePoint = firstByte + } + break + case 2: + secondByte = buf[i + 1] + if ((secondByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F) + if (tempCodePoint > 0x7F) { + codePoint = tempCodePoint + } + } + break + case 3: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F) + if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) { + codePoint = tempCodePoint + } + } + break + case 4: + secondByte = buf[i + 1] + thirdByte = buf[i + 2] + fourthByte = buf[i + 3] + if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) { + tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F) + if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) { + codePoint = tempCodePoint + } + } + } + } + + if (codePoint === null) { + // we did not generate a valid codePoint so insert a + // replacement char (U+FFFD) and advance only 1 byte + codePoint = 0xFFFD + bytesPerSequence = 1 + } else if (codePoint > 0xFFFF) { + // encode to utf16 (surrogate pair dance) + codePoint -= 0x10000 + res.push(codePoint >>> 10 & 0x3FF | 0xD800) + codePoint = 0xDC00 | codePoint & 0x3FF + } + + res.push(codePoint) + i += bytesPerSequence + } + + return decodeCodePointsArray(res) +} + +// Based on http://stackoverflow.com/a/22747272/680742, the browser with +// the lowest limit is Chrome, with 0x10000 args. +// We go 1 magnitude less, for safety +const MAX_ARGUMENTS_LENGTH = 0x1000 + +function decodeCodePointsArray (codePoints) { + const len = codePoints.length + if (len <= MAX_ARGUMENTS_LENGTH) { + return String.fromCharCode.apply(String, codePoints) // avoid extra slice() + } + + // Decode in chunks to avoid "call stack size exceeded". + let res = '' + let i = 0 + while (i < len) { + res += String.fromCharCode.apply( + String, + codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH) + ) + } + return res +} + +function asciiSlice (buf, start, end) { + let ret = '' + end = Math.min(buf.length, end) + + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i] & 0x7F) + } + return ret +} + +function latin1Slice (buf, start, end) { + let ret = '' + end = Math.min(buf.length, end) + + for (let i = start; i < end; ++i) { + ret += String.fromCharCode(buf[i]) + } + return ret +} + +function hexSlice (buf, start, end) { + const len = buf.length + + if (!start || start < 0) start = 0 + if (!end || end < 0 || end > len) end = len + + let out = '' + for (let i = start; i < end; ++i) { + out += hexSliceLookupTable[buf[i]] + } + return out +} + +function utf16leSlice (buf, start, end) { + const bytes = buf.slice(start, end) + let res = '' + // If bytes.length is odd, the last 8 bits must be ignored (same as node.js) + for (let i = 0; i < bytes.length - 1; i += 2) { + res += String.fromCharCode(bytes[i] + (bytes[i + 1] * 256)) + } + return res +} + +Buffer.prototype.slice = function slice (start, end) { + const len = this.length + start = ~~start + end = end === undefined ? len : ~~end + + if (start < 0) { + start += len + if (start < 0) start = 0 + } else if (start > len) { + start = len + } + + if (end < 0) { + end += len + if (end < 0) end = 0 + } else if (end > len) { + end = len + } + + if (end < start) end = start + + const newBuf = this.subarray(start, end) + // Return an augmented `Uint8Array` instance + Object.setPrototypeOf(newBuf, Buffer.prototype) + + return newBuf +} + +/* + * Need to make sure that buffer isn't trying to write out of bounds. + */ +function checkOffset (offset, ext, length) { + if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint') + if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length') +} + +Buffer.prototype.readUintLE = +Buffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + let val = this[offset] + let mul = 1 + let i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + + return val +} + +Buffer.prototype.readUintBE = +Buffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + checkOffset(offset, byteLength, this.length) + } + + let val = this[offset + --byteLength] + let mul = 1 + while (byteLength > 0 && (mul *= 0x100)) { + val += this[offset + --byteLength] * mul + } + + return val +} + +Buffer.prototype.readUint8 = +Buffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + return this[offset] +} + +Buffer.prototype.readUint16LE = +Buffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return this[offset] | (this[offset + 1] << 8) +} + +Buffer.prototype.readUint16BE = +Buffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + return (this[offset] << 8) | this[offset + 1] +} + +Buffer.prototype.readUint32LE = +Buffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return ((this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16)) + + (this[offset + 3] * 0x1000000) +} + +Buffer.prototype.readUint32BE = +Buffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] * 0x1000000) + + ((this[offset + 1] << 16) | + (this[offset + 2] << 8) | + this[offset + 3]) +} + +Buffer.prototype.readBigUInt64LE = defineBigIntMethod(function readBigUInt64LE (offset) { + offset = offset >>> 0 + validateNumber(offset, 'offset') + const first = this[offset] + const last = this[offset + 7] + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8) + } + + const lo = first + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 24 + + const hi = this[++offset] + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + last * 2 ** 24 + + return BigInt(lo) + (BigInt(hi) << BigInt(32)) +}) + +Buffer.prototype.readBigUInt64BE = defineBigIntMethod(function readBigUInt64BE (offset) { + offset = offset >>> 0 + validateNumber(offset, 'offset') + const first = this[offset] + const last = this[offset + 7] + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8) + } + + const hi = first * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + this[++offset] + + const lo = this[++offset] * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + last + + return (BigInt(hi) << BigInt(32)) + BigInt(lo) +}) + +Buffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + let val = this[offset] + let mul = 1 + let i = 0 + while (++i < byteLength && (mul *= 0x100)) { + val += this[offset + i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) { + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) checkOffset(offset, byteLength, this.length) + + let i = byteLength + let mul = 1 + let val = this[offset + --i] + while (i > 0 && (mul *= 0x100)) { + val += this[offset + --i] * mul + } + mul *= 0x80 + + if (val >= mul) val -= Math.pow(2, 8 * byteLength) + + return val +} + +Buffer.prototype.readInt8 = function readInt8 (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 1, this.length) + if (!(this[offset] & 0x80)) return (this[offset]) + return ((0xff - this[offset] + 1) * -1) +} + +Buffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + const val = this[offset] | (this[offset + 1] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 2, this.length) + const val = this[offset + 1] | (this[offset] << 8) + return (val & 0x8000) ? val | 0xFFFF0000 : val +} + +Buffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset]) | + (this[offset + 1] << 8) | + (this[offset + 2] << 16) | + (this[offset + 3] << 24) +} + +Buffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + + return (this[offset] << 24) | + (this[offset + 1] << 16) | + (this[offset + 2] << 8) | + (this[offset + 3]) +} + +Buffer.prototype.readBigInt64LE = defineBigIntMethod(function readBigInt64LE (offset) { + offset = offset >>> 0 + validateNumber(offset, 'offset') + const first = this[offset] + const last = this[offset + 7] + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8) + } + + const val = this[offset + 4] + + this[offset + 5] * 2 ** 8 + + this[offset + 6] * 2 ** 16 + + (last << 24) // Overflow + + return (BigInt(val) << BigInt(32)) + + BigInt(first + + this[++offset] * 2 ** 8 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 24) +}) + +Buffer.prototype.readBigInt64BE = defineBigIntMethod(function readBigInt64BE (offset) { + offset = offset >>> 0 + validateNumber(offset, 'offset') + const first = this[offset] + const last = this[offset + 7] + if (first === undefined || last === undefined) { + boundsError(offset, this.length - 8) + } + + const val = (first << 24) + // Overflow + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + this[++offset] + + return (BigInt(val) << BigInt(32)) + + BigInt(this[++offset] * 2 ** 24 + + this[++offset] * 2 ** 16 + + this[++offset] * 2 ** 8 + + last) +}) + +Buffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, true, 23, 4) +} + +Buffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 4, this.length) + return ieee754.read(this, offset, false, 23, 4) +} + +Buffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, true, 52, 8) +} + +Buffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) { + offset = offset >>> 0 + if (!noAssert) checkOffset(offset, 8, this.length) + return ieee754.read(this, offset, false, 52, 8) +} + +function checkInt (buf, value, offset, ext, max, min) { + if (!Buffer.isBuffer(buf)) throw new TypeError('"buffer" argument must be a Buffer instance') + if (value > max || value < min) throw new RangeError('"value" argument is out of bounds') + if (offset + ext > buf.length) throw new RangeError('Index out of range') +} + +Buffer.prototype.writeUintLE = +Buffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + let mul = 1 + let i = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUintBE = +Buffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + byteLength = byteLength >>> 0 + if (!noAssert) { + const maxBytes = Math.pow(2, 8 * byteLength) - 1 + checkInt(this, value, offset, byteLength, maxBytes, 0) + } + + let i = byteLength - 1 + let mul = 1 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + this[offset + i] = (value / mul) & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeUint8 = +Buffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0) + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeUint16LE = +Buffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeUint16BE = +Buffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeUint32LE = +Buffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset + 3] = (value >>> 24) + this[offset + 2] = (value >>> 16) + this[offset + 1] = (value >>> 8) + this[offset] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeUint32BE = +Buffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0) + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +function wrtBigUInt64LE (buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7) + + let lo = Number(value & BigInt(0xffffffff)) + buf[offset++] = lo + lo = lo >> 8 + buf[offset++] = lo + lo = lo >> 8 + buf[offset++] = lo + lo = lo >> 8 + buf[offset++] = lo + let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)) + buf[offset++] = hi + hi = hi >> 8 + buf[offset++] = hi + hi = hi >> 8 + buf[offset++] = hi + hi = hi >> 8 + buf[offset++] = hi + return offset +} + +function wrtBigUInt64BE (buf, value, offset, min, max) { + checkIntBI(value, min, max, buf, offset, 7) + + let lo = Number(value & BigInt(0xffffffff)) + buf[offset + 7] = lo + lo = lo >> 8 + buf[offset + 6] = lo + lo = lo >> 8 + buf[offset + 5] = lo + lo = lo >> 8 + buf[offset + 4] = lo + let hi = Number(value >> BigInt(32) & BigInt(0xffffffff)) + buf[offset + 3] = hi + hi = hi >> 8 + buf[offset + 2] = hi + hi = hi >> 8 + buf[offset + 1] = hi + hi = hi >> 8 + buf[offset] = hi + return offset + 8 +} + +Buffer.prototype.writeBigUInt64LE = defineBigIntMethod(function writeBigUInt64LE (value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) +}) + +Buffer.prototype.writeBigUInt64BE = defineBigIntMethod(function writeBigUInt64BE (value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, BigInt(0), BigInt('0xffffffffffffffff')) +}) + +Buffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + const limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + let i = 0 + let mul = 1 + let sub = 0 + this[offset] = value & 0xFF + while (++i < byteLength && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + const limit = Math.pow(2, (8 * byteLength) - 1) + + checkInt(this, value, offset, byteLength, limit - 1, -limit) + } + + let i = byteLength - 1 + let mul = 1 + let sub = 0 + this[offset + i] = value & 0xFF + while (--i >= 0 && (mul *= 0x100)) { + if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) { + sub = 1 + } + this[offset + i] = ((value / mul) >> 0) - sub & 0xFF + } + + return offset + byteLength +} + +Buffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80) + if (value < 0) value = 0xff + value + 1 + this[offset] = (value & 0xff) + return offset + 1 +} + +Buffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + return offset + 2 +} + +Buffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000) + this[offset] = (value >>> 8) + this[offset + 1] = (value & 0xff) + return offset + 2 +} + +Buffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + this[offset] = (value & 0xff) + this[offset + 1] = (value >>> 8) + this[offset + 2] = (value >>> 16) + this[offset + 3] = (value >>> 24) + return offset + 4 +} + +Buffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000) + if (value < 0) value = 0xffffffff + value + 1 + this[offset] = (value >>> 24) + this[offset + 1] = (value >>> 16) + this[offset + 2] = (value >>> 8) + this[offset + 3] = (value & 0xff) + return offset + 4 +} + +Buffer.prototype.writeBigInt64LE = defineBigIntMethod(function writeBigInt64LE (value, offset = 0) { + return wrtBigUInt64LE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) +}) + +Buffer.prototype.writeBigInt64BE = defineBigIntMethod(function writeBigInt64BE (value, offset = 0) { + return wrtBigUInt64BE(this, value, offset, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')) +}) + +function checkIEEE754 (buf, value, offset, ext, max, min) { + if (offset + ext > buf.length) throw new RangeError('Index out of range') + if (offset < 0) throw new RangeError('Index out of range') +} + +function writeFloat (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38) + } + ieee754.write(buf, value, offset, littleEndian, 23, 4) + return offset + 4 +} + +Buffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) { + return writeFloat(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) { + return writeFloat(this, value, offset, false, noAssert) +} + +function writeDouble (buf, value, offset, littleEndian, noAssert) { + value = +value + offset = offset >>> 0 + if (!noAssert) { + checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308) + } + ieee754.write(buf, value, offset, littleEndian, 52, 8) + return offset + 8 +} + +Buffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) { + return writeDouble(this, value, offset, true, noAssert) +} + +Buffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) { + return writeDouble(this, value, offset, false, noAssert) +} + +// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length) +Buffer.prototype.copy = function copy (target, targetStart, start, end) { + if (!Buffer.isBuffer(target)) throw new TypeError('argument should be a Buffer') + if (!start) start = 0 + if (!end && end !== 0) end = this.length + if (targetStart >= target.length) targetStart = target.length + if (!targetStart) targetStart = 0 + if (end > 0 && end < start) end = start + + // Copy 0 bytes; we're done + if (end === start) return 0 + if (target.length === 0 || this.length === 0) return 0 + + // Fatal error conditions + if (targetStart < 0) { + throw new RangeError('targetStart out of bounds') + } + if (start < 0 || start >= this.length) throw new RangeError('Index out of range') + if (end < 0) throw new RangeError('sourceEnd out of bounds') + + // Are we oob? + if (end > this.length) end = this.length + if (target.length - targetStart < end - start) { + end = target.length - targetStart + start + } + + const len = end - start + + if (this === target && typeof Uint8Array.prototype.copyWithin === 'function') { + // Use built-in when available, missing from IE11 + this.copyWithin(targetStart, start, end) + } else { + Uint8Array.prototype.set.call( + target, + this.subarray(start, end), + targetStart + ) + } + + return len +} + +// Usage: +// buffer.fill(number[, offset[, end]]) +// buffer.fill(buffer[, offset[, end]]) +// buffer.fill(string[, offset[, end]][, encoding]) +Buffer.prototype.fill = function fill (val, start, end, encoding) { + // Handle string cases: + if (typeof val === 'string') { + if (typeof start === 'string') { + encoding = start + start = 0 + end = this.length + } else if (typeof end === 'string') { + encoding = end + end = this.length + } + if (encoding !== undefined && typeof encoding !== 'string') { + throw new TypeError('encoding must be a string') + } + if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) { + throw new TypeError('Unknown encoding: ' + encoding) + } + if (val.length === 1) { + const code = val.charCodeAt(0) + if ((encoding === 'utf8' && code < 128) || + encoding === 'latin1') { + // Fast path: If `val` fits into a single byte, use that numeric value. + val = code + } + } + } else if (typeof val === 'number') { + val = val & 255 + } else if (typeof val === 'boolean') { + val = Number(val) + } + + // Invalid ranges are not set to a default, so can range check early. + if (start < 0 || this.length < start || this.length < end) { + throw new RangeError('Out of range index') + } + + if (end <= start) { + return this + } + + start = start >>> 0 + end = end === undefined ? this.length : end >>> 0 + + if (!val) val = 0 + + let i + if (typeof val === 'number') { + for (i = start; i < end; ++i) { + this[i] = val + } + } else { + const bytes = Buffer.isBuffer(val) + ? val + : Buffer.from(val, encoding) + const len = bytes.length + if (len === 0) { + throw new TypeError('The value "' + val + + '" is invalid for argument "value"') + } + for (i = 0; i < end - start; ++i) { + this[i + start] = bytes[i % len] + } + } + + return this +} + +// CUSTOM ERRORS +// ============= + +// Simplified versions from Node, changed for Buffer-only usage +const errors = {} +function E (sym, getMessage, Base) { + errors[sym] = class NodeError extends Base { + constructor () { + super() + + Object.defineProperty(this, 'message', { + value: getMessage.apply(this, arguments), + writable: true, + configurable: true + }) + + // Add the error code to the name to include it in the stack trace. + this.name = `${this.name} [${sym}]` + // Access the stack to generate the error message including the error code + // from the name. + this.stack // eslint-disable-line no-unused-expressions + // Reset the name to the actual name. + delete this.name + } + + get code () { + return sym + } + + set code (value) { + Object.defineProperty(this, 'code', { + configurable: true, + enumerable: true, + value, + writable: true + }) + } + + toString () { + return `${this.name} [${sym}]: ${this.message}` + } + } +} + +E('ERR_BUFFER_OUT_OF_BOUNDS', + function (name) { + if (name) { + return `${name} is outside of buffer bounds` + } + + return 'Attempt to access memory outside buffer bounds' + }, RangeError) +E('ERR_INVALID_ARG_TYPE', + function (name, actual) { + return `The "${name}" argument must be of type number. Received type ${typeof actual}` + }, TypeError) +E('ERR_OUT_OF_RANGE', + function (str, range, input) { + let msg = `The value of "${str}" is out of range.` + let received = input + if (Number.isInteger(input) && Math.abs(input) > 2 ** 32) { + received = addNumericalSeparator(String(input)) + } else if (typeof input === 'bigint') { + received = String(input) + if (input > BigInt(2) ** BigInt(32) || input < -(BigInt(2) ** BigInt(32))) { + received = addNumericalSeparator(received) + } + received += 'n' + } + msg += ` It must be ${range}. Received ${received}` + return msg + }, RangeError) + +function addNumericalSeparator (val) { + let res = '' + let i = val.length + const start = val[0] === '-' ? 1 : 0 + for (; i >= start + 4; i -= 3) { + res = `_${val.slice(i - 3, i)}${res}` + } + return `${val.slice(0, i)}${res}` +} + +// CHECK FUNCTIONS +// =============== + +function checkBounds (buf, offset, byteLength) { + validateNumber(offset, 'offset') + if (buf[offset] === undefined || buf[offset + byteLength] === undefined) { + boundsError(offset, buf.length - (byteLength + 1)) + } +} + +function checkIntBI (value, min, max, buf, offset, byteLength) { + if (value > max || value < min) { + const n = typeof min === 'bigint' ? 'n' : '' + let range + if (byteLength > 3) { + if (min === 0 || min === BigInt(0)) { + range = `>= 0${n} and < 2${n} ** ${(byteLength + 1) * 8}${n}` + } else { + range = `>= -(2${n} ** ${(byteLength + 1) * 8 - 1}${n}) and < 2 ** ` + + `${(byteLength + 1) * 8 - 1}${n}` + } + } else { + range = `>= ${min}${n} and <= ${max}${n}` + } + throw new errors.ERR_OUT_OF_RANGE('value', range, value) + } + checkBounds(buf, offset, byteLength) +} + +function validateNumber (value, name) { + if (typeof value !== 'number') { + throw new errors.ERR_INVALID_ARG_TYPE(name, 'number', value) + } +} + +function boundsError (value, length, type) { + if (Math.floor(value) !== value) { + validateNumber(value, type) + throw new errors.ERR_OUT_OF_RANGE(type || 'offset', 'an integer', value) + } + + if (length < 0) { + throw new errors.ERR_BUFFER_OUT_OF_BOUNDS() + } + + throw new errors.ERR_OUT_OF_RANGE(type || 'offset', + `>= ${type ? 1 : 0} and <= ${length}`, + value) +} + +// HELPER FUNCTIONS +// ================ + +const INVALID_BASE64_RE = /[^+/0-9A-Za-z-_]/g + +function base64clean (str) { + // Node takes equal signs as end of the Base64 encoding + str = str.split('=')[0] + // Node strips out invalid characters like \n and \t from the string, base64-js does not + str = str.trim().replace(INVALID_BASE64_RE, '') + // Node converts strings with length < 2 to '' + if (str.length < 2) return '' + // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not + while (str.length % 4 !== 0) { + str = str + '=' + } + return str +} + +function utf8ToBytes (string, units) { + units = units || Infinity + let codePoint + const length = string.length + let leadSurrogate = null + const bytes = [] + + for (let i = 0; i < length; ++i) { + codePoint = string.charCodeAt(i) + + // is surrogate component + if (codePoint > 0xD7FF && codePoint < 0xE000) { + // last char was a lead + if (!leadSurrogate) { + // no lead yet + if (codePoint > 0xDBFF) { + // unexpected trail + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } else if (i + 1 === length) { + // unpaired lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + continue + } + + // valid lead + leadSurrogate = codePoint + + continue + } + + // 2 leads in a row + if (codePoint < 0xDC00) { + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + leadSurrogate = codePoint + continue + } + + // valid surrogate pair + codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000 + } else if (leadSurrogate) { + // valid bmp char, but last char was a lead + if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD) + } + + leadSurrogate = null + + // encode utf8 + if (codePoint < 0x80) { + if ((units -= 1) < 0) break + bytes.push(codePoint) + } else if (codePoint < 0x800) { + if ((units -= 2) < 0) break + bytes.push( + codePoint >> 0x6 | 0xC0, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x10000) { + if ((units -= 3) < 0) break + bytes.push( + codePoint >> 0xC | 0xE0, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else if (codePoint < 0x110000) { + if ((units -= 4) < 0) break + bytes.push( + codePoint >> 0x12 | 0xF0, + codePoint >> 0xC & 0x3F | 0x80, + codePoint >> 0x6 & 0x3F | 0x80, + codePoint & 0x3F | 0x80 + ) + } else { + throw new Error('Invalid code point') + } + } + + return bytes +} + +function asciiToBytes (str) { + const byteArray = [] + for (let i = 0; i < str.length; ++i) { + // Node's code seems to be doing this and not & 0x7F.. + byteArray.push(str.charCodeAt(i) & 0xFF) + } + return byteArray +} + +function utf16leToBytes (str, units) { + let c, hi, lo + const byteArray = [] + for (let i = 0; i < str.length; ++i) { + if ((units -= 2) < 0) break + + c = str.charCodeAt(i) + hi = c >> 8 + lo = c % 256 + byteArray.push(lo) + byteArray.push(hi) + } + + return byteArray +} + +function base64ToBytes (str) { + return base64.toByteArray(base64clean(str)) +} + +function blitBuffer (src, dst, offset, length) { + let i + for (i = 0; i < length; ++i) { + if ((i + offset >= dst.length) || (i >= src.length)) break + dst[i + offset] = src[i] + } + return i +} + +// ArrayBuffer or Uint8Array objects from other contexts (i.e. iframes) do not pass +// the `instanceof` check but they should be treated as of that type. +// See: https://github.com/feross/buffer/issues/166 +function isInstance (obj, type) { + return obj instanceof type || + (obj != null && obj.constructor != null && obj.constructor.name != null && + obj.constructor.name === type.name) +} +function numberIsNaN (obj) { + // For IE11 support + return obj !== obj // eslint-disable-line no-self-compare +} + +// Create lookup table for `toString('hex')` +// See: https://github.com/feross/buffer/issues/219 +const hexSliceLookupTable = (function () { + const alphabet = '0123456789abcdef' + const table = new Array(256) + for (let i = 0; i < 16; ++i) { + const i16 = i * 16 + for (let j = 0; j < 16; ++j) { + table[i16 + j] = alphabet[i] + alphabet[j] + } + } + return table +})() + +// Return not function with Error if BigInt not supported +function defineBigIntMethod (fn) { + return typeof BigInt === 'undefined' ? BufferBigIntNotDefined : fn +} + +function BufferBigIntNotDefined () { + throw new Error('BigInt not supported') +} + + +/***/ }), + +/***/ 698: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* provided dependency */ var Buffer = __webpack_require__(764)["Buffer"]; +/*! + * @description Recursive object extending + * @author Viacheslav Lotsmanov + * @license MIT + * + * The MIT License (MIT) + * + * Copyright (c) 2013-2018 Viacheslav Lotsmanov + * + * Permission is hereby granted, free of charge, to any person obtaining a copy of + * this software and associated documentation files (the "Software"), to deal in + * the Software without restriction, including without limitation the rights to + * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + * the Software, and to permit persons to whom the Software is furnished to do so, + * subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + + + +function isSpecificValue(val) { + return ( + val instanceof Buffer + || val instanceof Date + || val instanceof RegExp + ) ? true : false; +} + +function cloneSpecificValue(val) { + if (val instanceof Buffer) { + var x = Buffer.alloc + ? Buffer.alloc(val.length) + : new Buffer(val.length); + val.copy(x); + return x; + } else if (val instanceof Date) { + return new Date(val.getTime()); + } else if (val instanceof RegExp) { + return new RegExp(val); + } else { + throw new Error('Unexpected situation'); + } +} + +/** + * Recursive cloning array. + */ +function deepCloneArray(arr) { + var clone = []; + arr.forEach(function (item, index) { + if (typeof item === 'object' && item !== null) { + if (Array.isArray(item)) { + clone[index] = deepCloneArray(item); + } else if (isSpecificValue(item)) { + clone[index] = cloneSpecificValue(item); + } else { + clone[index] = deepExtend({}, item); + } + } else { + clone[index] = item; + } + }); + return clone; +} + +function safeGetProperty(object, property) { + return property === '__proto__' ? undefined : object[property]; +} + +/** + * Extening object that entered in first argument. + * + * Returns extended object or false if have no target object or incorrect type. + * + * If you wish to clone source object (without modify it), just use empty new + * object as first argument, like this: + * deepExtend({}, yourObj_1, [yourObj_N]); + */ +var deepExtend = module.exports = function (/*obj_1, [obj_2], [obj_N]*/) { + if (arguments.length < 1 || typeof arguments[0] !== 'object') { + return false; + } + + if (arguments.length < 2) { + return arguments[0]; + } + + var target = arguments[0]; + + // convert arguments to array and cut off target object + var args = Array.prototype.slice.call(arguments, 1); + + var val, src, clone; + + args.forEach(function (obj) { + // skip argument if isn't an object, is null, or is an array + if (typeof obj !== 'object' || obj === null || Array.isArray(obj)) { + return; + } + + Object.keys(obj).forEach(function (key) { + src = safeGetProperty(target, key); // source value + val = safeGetProperty(obj, key); // new value + + // recursion prevention + if (val === target) { + return; + + /** + * if new value isn't object then just overwrite by new value + * instead of extending. + */ + } else if (typeof val !== 'object' || val === null) { + target[key] = val; + return; + + // just clone arrays (and recursive clone objects inside) + } else if (Array.isArray(val)) { + target[key] = deepCloneArray(val); + return; + + // custom cloning and overwrite for specific objects + } else if (isSpecificValue(val)) { + target[key] = cloneSpecificValue(val); + return; + + // overwrite by new value if source isn't object or array + } else if (typeof src !== 'object' || src === null || Array.isArray(src)) { + target[key] = deepExtend({}, val); + return; + + // source value and new value is objects both, extending... + } else { + target[key] = deepExtend(src, val); + return; + } + }); + }); + + return target; +}; + + +/***/ }), + +/***/ 717: +/***/ ((module) => { + +if (typeof Object.create === 'function') { + // implementation from standard node.js 'util' module + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + ctor.prototype = Object.create(superCtor.prototype, { + constructor: { + value: ctor, + enumerable: false, + writable: true, + configurable: true + } + }) + } + }; +} else { + // old school shim for old browsers + module.exports = function inherits(ctor, superCtor) { + if (superCtor) { + ctor.super_ = superCtor + var TempCtor = function () {} + TempCtor.prototype = superCtor.prototype + ctor.prototype = new TempCtor() + ctor.prototype.constructor = ctor + } + } +} + + +/***/ }), + +/***/ 155: +/***/ ((module) => { + +// shim for using process in browser +var process = module.exports = {}; + +// cached from whatever global is present so that test runners that stub it +// don't break things. But we need to wrap it in a try catch in case it is +// wrapped in strict mode code which doesn't define any globals. It's inside a +// function because try/catches deoptimize in certain engines. + +var cachedSetTimeout; +var cachedClearTimeout; + +function defaultSetTimout() { + throw new Error('setTimeout has not been defined'); +} +function defaultClearTimeout () { + throw new Error('clearTimeout has not been defined'); +} +(function () { + try { + if (typeof setTimeout === 'function') { + cachedSetTimeout = setTimeout; + } else { + cachedSetTimeout = defaultSetTimout; + } + } catch (e) { + cachedSetTimeout = defaultSetTimout; + } + try { + if (typeof clearTimeout === 'function') { + cachedClearTimeout = clearTimeout; + } else { + cachedClearTimeout = defaultClearTimeout; + } + } catch (e) { + cachedClearTimeout = defaultClearTimeout; + } +} ()) +function runTimeout(fun) { + if (cachedSetTimeout === setTimeout) { + //normal enviroments in sane situations + return setTimeout(fun, 0); + } + // if setTimeout wasn't available but was latter defined + if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) { + cachedSetTimeout = setTimeout; + return setTimeout(fun, 0); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedSetTimeout(fun, 0); + } catch(e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedSetTimeout.call(null, fun, 0); + } catch(e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error + return cachedSetTimeout.call(this, fun, 0); + } + } + + +} +function runClearTimeout(marker) { + if (cachedClearTimeout === clearTimeout) { + //normal enviroments in sane situations + return clearTimeout(marker); + } + // if clearTimeout wasn't available but was latter defined + if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) { + cachedClearTimeout = clearTimeout; + return clearTimeout(marker); + } + try { + // when when somebody has screwed with setTimeout but no I.E. maddness + return cachedClearTimeout(marker); + } catch (e){ + try { + // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally + return cachedClearTimeout.call(null, marker); + } catch (e){ + // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error. + // Some versions of I.E. have different rules for clearTimeout vs setTimeout + return cachedClearTimeout.call(this, marker); + } + } + + + +} +var queue = []; +var draining = false; +var currentQueue; +var queueIndex = -1; + +function cleanUpNextTick() { + if (!draining || !currentQueue) { + return; + } + draining = false; + if (currentQueue.length) { + queue = currentQueue.concat(queue); + } else { + queueIndex = -1; + } + if (queue.length) { + drainQueue(); + } +} + +function drainQueue() { + if (draining) { + return; + } + var timeout = runTimeout(cleanUpNextTick); + draining = true; + + var len = queue.length; + while(len) { + currentQueue = queue; + queue = []; + while (++queueIndex < len) { + if (currentQueue) { + currentQueue[queueIndex].run(); + } + } + queueIndex = -1; + len = queue.length; + } + currentQueue = null; + draining = false; + runClearTimeout(timeout); +} + +process.nextTick = function (fun) { + var args = new Array(arguments.length - 1); + if (arguments.length > 1) { + for (var i = 1; i < arguments.length; i++) { + args[i - 1] = arguments[i]; + } + } + queue.push(new Item(fun, args)); + if (queue.length === 1 && !draining) { + runTimeout(drainQueue); + } +}; + +// v8 likes predictible objects +function Item(fun, array) { + this.fun = fun; + this.array = array; +} +Item.prototype.run = function () { + this.fun.apply(null, this.array); +}; +process.title = 'browser'; +process.browser = true; +process.env = {}; +process.argv = []; +process.version = ''; // empty string to avoid regexp issues +process.versions = {}; + +function noop() {} + +process.on = noop; +process.addListener = noop; +process.once = noop; +process.off = noop; +process.removeListener = noop; +process.removeAllListeners = noop; +process.emit = noop; +process.prependListener = noop; +process.prependOnceListener = noop; + +process.listeners = function (name) { return [] } + +process.binding = function (name) { + throw new Error('process.binding is not supported'); +}; + +process.cwd = function () { return '/' }; +process.chdir = function (dir) { + throw new Error('process.chdir is not supported'); +}; +process.umask = function() { return 0; }; + + +/***/ }), + +/***/ 798: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* provided dependency */ var process = __webpack_require__(155); + + +// limit of Crypto.getRandomValues() +// https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues +var MAX_BYTES = 65536 + +// Node supports requesting up to this number of bytes +// https://github.com/nodejs/node/blob/master/lib/internal/crypto/random.js#L48 +var MAX_UINT32 = 4294967295 + +function oldBrowser () { + throw new Error('Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11') +} + +var Buffer = (__webpack_require__(509).Buffer) +var crypto = __webpack_require__.g.crypto || __webpack_require__.g.msCrypto + +if (crypto && crypto.getRandomValues) { + module.exports = randomBytes +} else { + module.exports = oldBrowser +} + +function randomBytes (size, cb) { + // phantomjs needs to throw + if (size > MAX_UINT32) throw new RangeError('requested too many random bytes') + + var bytes = Buffer.allocUnsafe(size) + + if (size > 0) { // getRandomValues fails on IE if size == 0 + if (size > MAX_BYTES) { // this is the max bytes crypto.getRandomValues + // can do at once see https://developer.mozilla.org/en-US/docs/Web/API/window.crypto.getRandomValues + for (var generated = 0; generated < size; generated += MAX_BYTES) { + // buffer.slice automatically checks if the end is past the end of + // the buffer so we don't have to here + crypto.getRandomValues(bytes.slice(generated, generated + MAX_BYTES)) + } + } else { + crypto.getRandomValues(bytes) + } + } + + if (typeof cb === 'function') { + return process.nextTick(function () { + cb(null, bytes) + }) + } + + return bytes +} + + +/***/ }), + +/***/ 509: +/***/ ((module, exports, __webpack_require__) => { + +/*! safe-buffer. MIT License. Feross Aboukhadijeh */ +/* eslint-disable node/no-deprecated-api */ +var buffer = __webpack_require__(764) +var Buffer = buffer.Buffer + +// alternative to using Object.keys for old browsers +function copyProps (src, dst) { + for (var key in src) { + dst[key] = src[key] + } +} +if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) { + module.exports = buffer +} else { + // Copy properties from require('buffer') + copyProps(buffer, exports) + exports.Buffer = SafeBuffer +} + +function SafeBuffer (arg, encodingOrOffset, length) { + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.prototype = Object.create(Buffer.prototype) + +// Copy static methods from Buffer +copyProps(Buffer, SafeBuffer) + +SafeBuffer.from = function (arg, encodingOrOffset, length) { + if (typeof arg === 'number') { + throw new TypeError('Argument must not be a number') + } + return Buffer(arg, encodingOrOffset, length) +} + +SafeBuffer.alloc = function (size, fill, encoding) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + var buf = Buffer(size) + if (fill !== undefined) { + if (typeof encoding === 'string') { + buf.fill(fill, encoding) + } else { + buf.fill(fill) + } + } else { + buf.fill(0) + } + return buf +} + +SafeBuffer.allocUnsafe = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return Buffer(size) +} + +SafeBuffer.allocUnsafeSlow = function (size) { + if (typeof size !== 'number') { + throw new TypeError('Argument must be a number') + } + return buffer.SlowBuffer(size) +} + + +/***/ }), + +/***/ 189: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var Buffer = (__webpack_require__(509).Buffer) + +// prototype class for hash functions +function Hash (blockSize, finalSize) { + this._block = Buffer.alloc(blockSize) + this._finalSize = finalSize + this._blockSize = blockSize + this._len = 0 +} + +Hash.prototype.update = function (data, enc) { + if (typeof data === 'string') { + enc = enc || 'utf8' + data = Buffer.from(data, enc) + } + + var block = this._block + var blockSize = this._blockSize + var length = data.length + var accum = this._len + + for (var offset = 0; offset < length;) { + var assigned = accum % blockSize + var remainder = Math.min(length - offset, blockSize - assigned) + + for (var i = 0; i < remainder; i++) { + block[assigned + i] = data[offset + i] + } + + accum += remainder + offset += remainder + + if ((accum % blockSize) === 0) { + this._update(block) + } + } + + this._len += length + return this +} + +Hash.prototype.digest = function (enc) { + var rem = this._len % this._blockSize + + this._block[rem] = 0x80 + + // zero (rem + 1) trailing bits, where (rem + 1) is the smallest + // non-negative solution to the equation (length + 1 + (rem + 1)) === finalSize mod blockSize + this._block.fill(0, rem + 1) + + if (rem >= this._finalSize) { + this._update(this._block) + this._block.fill(0) + } + + var bits = this._len * 8 + + // uint32 + if (bits <= 0xffffffff) { + this._block.writeUInt32BE(bits, this._blockSize - 4) + + // uint64 + } else { + var lowBits = (bits & 0xffffffff) >>> 0 + var highBits = (bits - lowBits) / 0x100000000 + + this._block.writeUInt32BE(highBits, this._blockSize - 8) + this._block.writeUInt32BE(lowBits, this._blockSize - 4) + } + + this._update(this._block) + var hash = this._hash() + + return enc ? hash.toString(enc) : hash +} + +Hash.prototype._update = function () { + throw new Error('_update must be implemented by subclass') +} + +module.exports = Hash + + +/***/ }), + +/***/ 72: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var exports = module.exports = function SHA (algorithm) { + algorithm = algorithm.toLowerCase() + + var Algorithm = exports[algorithm] + if (!Algorithm) throw new Error(algorithm + ' is not supported (we accept pull requests)') + + return new Algorithm() +} + +exports.sha = __webpack_require__(448) +exports.sha1 = __webpack_require__(336) +exports.sha224 = __webpack_require__(432) +exports.sha256 = __webpack_require__(499) +exports.sha384 = __webpack_require__(686) +exports.sha512 = __webpack_require__(816) + + +/***/ }), + +/***/ 448: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-0, as defined + * in FIPS PUB 180-1 + * This source code is derived from sha1.js of the same repository. + * The difference between SHA-0 and SHA-1 is just a bitwise rotate left + * operation was added. + */ + +var inherits = __webpack_require__(717) +var Hash = __webpack_require__(189) +var Buffer = (__webpack_require__(509).Buffer) + +var K = [ + 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 +] + +var W = new Array(80) + +function Sha () { + this.init() + this._w = W + + Hash.call(this, 64, 56) +} + +inherits(Sha, Hash) + +Sha.prototype.init = function () { + this._a = 0x67452301 + this._b = 0xefcdab89 + this._c = 0x98badcfe + this._d = 0x10325476 + this._e = 0xc3d2e1f0 + + return this +} + +function rotl5 (num) { + return (num << 5) | (num >>> 27) +} + +function rotl30 (num) { + return (num << 30) | (num >>> 2) +} + +function ft (s, b, c, d) { + if (s === 0) return (b & c) | ((~b) & d) + if (s === 2) return (b & c) | (b & d) | (c & d) + return b ^ c ^ d +} + +Sha.prototype._update = function (M) { + var W = this._w + + var a = this._a | 0 + var b = this._b | 0 + var c = this._c | 0 + var d = this._d | 0 + var e = this._e | 0 + + for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) + for (; i < 80; ++i) W[i] = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16] + + for (var j = 0; j < 80; ++j) { + var s = ~~(j / 20) + var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0 + + e = d + d = c + c = rotl30(b) + b = a + a = t + } + + this._a = (a + this._a) | 0 + this._b = (b + this._b) | 0 + this._c = (c + this._c) | 0 + this._d = (d + this._d) | 0 + this._e = (e + this._e) | 0 +} + +Sha.prototype._hash = function () { + var H = Buffer.allocUnsafe(20) + + H.writeInt32BE(this._a | 0, 0) + H.writeInt32BE(this._b | 0, 4) + H.writeInt32BE(this._c | 0, 8) + H.writeInt32BE(this._d | 0, 12) + H.writeInt32BE(this._e | 0, 16) + + return H +} + +module.exports = Sha + + +/***/ }), + +/***/ 336: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/* + * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined + * in FIPS PUB 180-1 + * Version 2.1a Copyright Paul Johnston 2000 - 2002. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * Distributed under the BSD License + * See http://pajhome.org.uk/crypt/md5 for details. + */ + +var inherits = __webpack_require__(717) +var Hash = __webpack_require__(189) +var Buffer = (__webpack_require__(509).Buffer) + +var K = [ + 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc | 0, 0xca62c1d6 | 0 +] + +var W = new Array(80) + +function Sha1 () { + this.init() + this._w = W + + Hash.call(this, 64, 56) +} + +inherits(Sha1, Hash) + +Sha1.prototype.init = function () { + this._a = 0x67452301 + this._b = 0xefcdab89 + this._c = 0x98badcfe + this._d = 0x10325476 + this._e = 0xc3d2e1f0 + + return this +} + +function rotl1 (num) { + return (num << 1) | (num >>> 31) +} + +function rotl5 (num) { + return (num << 5) | (num >>> 27) +} + +function rotl30 (num) { + return (num << 30) | (num >>> 2) +} + +function ft (s, b, c, d) { + if (s === 0) return (b & c) | ((~b) & d) + if (s === 2) return (b & c) | (b & d) | (c & d) + return b ^ c ^ d +} + +Sha1.prototype._update = function (M) { + var W = this._w + + var a = this._a | 0 + var b = this._b | 0 + var c = this._c | 0 + var d = this._d | 0 + var e = this._e | 0 + + for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) + for (; i < 80; ++i) W[i] = rotl1(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16]) + + for (var j = 0; j < 80; ++j) { + var s = ~~(j / 20) + var t = (rotl5(a) + ft(s, b, c, d) + e + W[j] + K[s]) | 0 + + e = d + d = c + c = rotl30(b) + b = a + a = t + } + + this._a = (a + this._a) | 0 + this._b = (b + this._b) | 0 + this._c = (c + this._c) | 0 + this._d = (d + this._d) | 0 + this._e = (e + this._e) | 0 +} + +Sha1.prototype._hash = function () { + var H = Buffer.allocUnsafe(20) + + H.writeInt32BE(this._a | 0, 0) + H.writeInt32BE(this._b | 0, 4) + H.writeInt32BE(this._c | 0, 8) + H.writeInt32BE(this._d | 0, 12) + H.writeInt32BE(this._e | 0, 16) + + return H +} + +module.exports = Sha1 + + +/***/ }), + +/***/ 432: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined + * in FIPS 180-2 + * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * + */ + +var inherits = __webpack_require__(717) +var Sha256 = __webpack_require__(499) +var Hash = __webpack_require__(189) +var Buffer = (__webpack_require__(509).Buffer) + +var W = new Array(64) + +function Sha224 () { + this.init() + + this._w = W // new Array(64) + + Hash.call(this, 64, 56) +} + +inherits(Sha224, Sha256) + +Sha224.prototype.init = function () { + this._a = 0xc1059ed8 + this._b = 0x367cd507 + this._c = 0x3070dd17 + this._d = 0xf70e5939 + this._e = 0xffc00b31 + this._f = 0x68581511 + this._g = 0x64f98fa7 + this._h = 0xbefa4fa4 + + return this +} + +Sha224.prototype._hash = function () { + var H = Buffer.allocUnsafe(28) + + H.writeInt32BE(this._a, 0) + H.writeInt32BE(this._b, 4) + H.writeInt32BE(this._c, 8) + H.writeInt32BE(this._d, 12) + H.writeInt32BE(this._e, 16) + H.writeInt32BE(this._f, 20) + H.writeInt32BE(this._g, 24) + + return H +} + +module.exports = Sha224 + + +/***/ }), + +/***/ 499: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +/** + * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined + * in FIPS 180-2 + * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009. + * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet + * + */ + +var inherits = __webpack_require__(717) +var Hash = __webpack_require__(189) +var Buffer = (__webpack_require__(509).Buffer) + +var K = [ + 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5, + 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5, + 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3, + 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174, + 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC, + 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA, + 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7, + 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967, + 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13, + 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85, + 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3, + 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070, + 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5, + 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3, + 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208, + 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2 +] + +var W = new Array(64) + +function Sha256 () { + this.init() + + this._w = W // new Array(64) + + Hash.call(this, 64, 56) +} + +inherits(Sha256, Hash) + +Sha256.prototype.init = function () { + this._a = 0x6a09e667 + this._b = 0xbb67ae85 + this._c = 0x3c6ef372 + this._d = 0xa54ff53a + this._e = 0x510e527f + this._f = 0x9b05688c + this._g = 0x1f83d9ab + this._h = 0x5be0cd19 + + return this +} + +function ch (x, y, z) { + return z ^ (x & (y ^ z)) +} + +function maj (x, y, z) { + return (x & y) | (z & (x | y)) +} + +function sigma0 (x) { + return (x >>> 2 | x << 30) ^ (x >>> 13 | x << 19) ^ (x >>> 22 | x << 10) +} + +function sigma1 (x) { + return (x >>> 6 | x << 26) ^ (x >>> 11 | x << 21) ^ (x >>> 25 | x << 7) +} + +function gamma0 (x) { + return (x >>> 7 | x << 25) ^ (x >>> 18 | x << 14) ^ (x >>> 3) +} + +function gamma1 (x) { + return (x >>> 17 | x << 15) ^ (x >>> 19 | x << 13) ^ (x >>> 10) +} + +Sha256.prototype._update = function (M) { + var W = this._w + + var a = this._a | 0 + var b = this._b | 0 + var c = this._c | 0 + var d = this._d | 0 + var e = this._e | 0 + var f = this._f | 0 + var g = this._g | 0 + var h = this._h | 0 + + for (var i = 0; i < 16; ++i) W[i] = M.readInt32BE(i * 4) + for (; i < 64; ++i) W[i] = (gamma1(W[i - 2]) + W[i - 7] + gamma0(W[i - 15]) + W[i - 16]) | 0 + + for (var j = 0; j < 64; ++j) { + var T1 = (h + sigma1(e) + ch(e, f, g) + K[j] + W[j]) | 0 + var T2 = (sigma0(a) + maj(a, b, c)) | 0 + + h = g + g = f + f = e + e = (d + T1) | 0 + d = c + c = b + b = a + a = (T1 + T2) | 0 + } + + this._a = (a + this._a) | 0 + this._b = (b + this._b) | 0 + this._c = (c + this._c) | 0 + this._d = (d + this._d) | 0 + this._e = (e + this._e) | 0 + this._f = (f + this._f) | 0 + this._g = (g + this._g) | 0 + this._h = (h + this._h) | 0 +} + +Sha256.prototype._hash = function () { + var H = Buffer.allocUnsafe(32) + + H.writeInt32BE(this._a, 0) + H.writeInt32BE(this._b, 4) + H.writeInt32BE(this._c, 8) + H.writeInt32BE(this._d, 12) + H.writeInt32BE(this._e, 16) + H.writeInt32BE(this._f, 20) + H.writeInt32BE(this._g, 24) + H.writeInt32BE(this._h, 28) + + return H +} + +module.exports = Sha256 + + +/***/ }), + +/***/ 686: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var inherits = __webpack_require__(717) +var SHA512 = __webpack_require__(816) +var Hash = __webpack_require__(189) +var Buffer = (__webpack_require__(509).Buffer) + +var W = new Array(160) + +function Sha384 () { + this.init() + this._w = W + + Hash.call(this, 128, 112) +} + +inherits(Sha384, SHA512) + +Sha384.prototype.init = function () { + this._ah = 0xcbbb9d5d + this._bh = 0x629a292a + this._ch = 0x9159015a + this._dh = 0x152fecd8 + this._eh = 0x67332667 + this._fh = 0x8eb44a87 + this._gh = 0xdb0c2e0d + this._hh = 0x47b5481d + + this._al = 0xc1059ed8 + this._bl = 0x367cd507 + this._cl = 0x3070dd17 + this._dl = 0xf70e5939 + this._el = 0xffc00b31 + this._fl = 0x68581511 + this._gl = 0x64f98fa7 + this._hl = 0xbefa4fa4 + + return this +} + +Sha384.prototype._hash = function () { + var H = Buffer.allocUnsafe(48) + + function writeInt64BE (h, l, offset) { + H.writeInt32BE(h, offset) + H.writeInt32BE(l, offset + 4) + } + + writeInt64BE(this._ah, this._al, 0) + writeInt64BE(this._bh, this._bl, 8) + writeInt64BE(this._ch, this._cl, 16) + writeInt64BE(this._dh, this._dl, 24) + writeInt64BE(this._eh, this._el, 32) + writeInt64BE(this._fh, this._fl, 40) + + return H +} + +module.exports = Sha384 + + +/***/ }), + +/***/ 816: +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { + +var inherits = __webpack_require__(717) +var Hash = __webpack_require__(189) +var Buffer = (__webpack_require__(509).Buffer) + +var K = [ + 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, + 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, + 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, + 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, + 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, + 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, + 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, + 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, + 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, + 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, + 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, + 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, + 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, + 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, + 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, + 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, + 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, + 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, + 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, + 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, + 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, + 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, + 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, + 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, + 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, + 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, + 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, + 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, + 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, + 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, + 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, + 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, + 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, + 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, + 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, + 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, + 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, + 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, + 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, + 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 +] + +var W = new Array(160) + +function Sha512 () { + this.init() + this._w = W + + Hash.call(this, 128, 112) +} + +inherits(Sha512, Hash) + +Sha512.prototype.init = function () { + this._ah = 0x6a09e667 + this._bh = 0xbb67ae85 + this._ch = 0x3c6ef372 + this._dh = 0xa54ff53a + this._eh = 0x510e527f + this._fh = 0x9b05688c + this._gh = 0x1f83d9ab + this._hh = 0x5be0cd19 + + this._al = 0xf3bcc908 + this._bl = 0x84caa73b + this._cl = 0xfe94f82b + this._dl = 0x5f1d36f1 + this._el = 0xade682d1 + this._fl = 0x2b3e6c1f + this._gl = 0xfb41bd6b + this._hl = 0x137e2179 + + return this +} + +function Ch (x, y, z) { + return z ^ (x & (y ^ z)) +} + +function maj (x, y, z) { + return (x & y) | (z & (x | y)) +} + +function sigma0 (x, xl) { + return (x >>> 28 | xl << 4) ^ (xl >>> 2 | x << 30) ^ (xl >>> 7 | x << 25) +} + +function sigma1 (x, xl) { + return (x >>> 14 | xl << 18) ^ (x >>> 18 | xl << 14) ^ (xl >>> 9 | x << 23) +} + +function Gamma0 (x, xl) { + return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7) +} + +function Gamma0l (x, xl) { + return (x >>> 1 | xl << 31) ^ (x >>> 8 | xl << 24) ^ (x >>> 7 | xl << 25) +} + +function Gamma1 (x, xl) { + return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6) +} + +function Gamma1l (x, xl) { + return (x >>> 19 | xl << 13) ^ (xl >>> 29 | x << 3) ^ (x >>> 6 | xl << 26) +} + +function getCarry (a, b) { + return (a >>> 0) < (b >>> 0) ? 1 : 0 +} + +Sha512.prototype._update = function (M) { + var W = this._w + + var ah = this._ah | 0 + var bh = this._bh | 0 + var ch = this._ch | 0 + var dh = this._dh | 0 + var eh = this._eh | 0 + var fh = this._fh | 0 + var gh = this._gh | 0 + var hh = this._hh | 0 + + var al = this._al | 0 + var bl = this._bl | 0 + var cl = this._cl | 0 + var dl = this._dl | 0 + var el = this._el | 0 + var fl = this._fl | 0 + var gl = this._gl | 0 + var hl = this._hl | 0 + + for (var i = 0; i < 32; i += 2) { + W[i] = M.readInt32BE(i * 4) + W[i + 1] = M.readInt32BE(i * 4 + 4) + } + for (; i < 160; i += 2) { + var xh = W[i - 15 * 2] + var xl = W[i - 15 * 2 + 1] + var gamma0 = Gamma0(xh, xl) + var gamma0l = Gamma0l(xl, xh) + + xh = W[i - 2 * 2] + xl = W[i - 2 * 2 + 1] + var gamma1 = Gamma1(xh, xl) + var gamma1l = Gamma1l(xl, xh) + + // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16] + var Wi7h = W[i - 7 * 2] + var Wi7l = W[i - 7 * 2 + 1] + + var Wi16h = W[i - 16 * 2] + var Wi16l = W[i - 16 * 2 + 1] + + var Wil = (gamma0l + Wi7l) | 0 + var Wih = (gamma0 + Wi7h + getCarry(Wil, gamma0l)) | 0 + Wil = (Wil + gamma1l) | 0 + Wih = (Wih + gamma1 + getCarry(Wil, gamma1l)) | 0 + Wil = (Wil + Wi16l) | 0 + Wih = (Wih + Wi16h + getCarry(Wil, Wi16l)) | 0 + + W[i] = Wih + W[i + 1] = Wil + } + + for (var j = 0; j < 160; j += 2) { + Wih = W[j] + Wil = W[j + 1] + + var majh = maj(ah, bh, ch) + var majl = maj(al, bl, cl) + + var sigma0h = sigma0(ah, al) + var sigma0l = sigma0(al, ah) + var sigma1h = sigma1(eh, el) + var sigma1l = sigma1(el, eh) + + // t1 = h + sigma1 + ch + K[j] + W[j] + var Kih = K[j] + var Kil = K[j + 1] + + var chh = Ch(eh, fh, gh) + var chl = Ch(el, fl, gl) + + var t1l = (hl + sigma1l) | 0 + var t1h = (hh + sigma1h + getCarry(t1l, hl)) | 0 + t1l = (t1l + chl) | 0 + t1h = (t1h + chh + getCarry(t1l, chl)) | 0 + t1l = (t1l + Kil) | 0 + t1h = (t1h + Kih + getCarry(t1l, Kil)) | 0 + t1l = (t1l + Wil) | 0 + t1h = (t1h + Wih + getCarry(t1l, Wil)) | 0 + + // t2 = sigma0 + maj + var t2l = (sigma0l + majl) | 0 + var t2h = (sigma0h + majh + getCarry(t2l, sigma0l)) | 0 + + hh = gh + hl = gl + gh = fh + gl = fl + fh = eh + fl = el + el = (dl + t1l) | 0 + eh = (dh + t1h + getCarry(el, dl)) | 0 + dh = ch + dl = cl + ch = bh + cl = bl + bh = ah + bl = al + al = (t1l + t2l) | 0 + ah = (t1h + t2h + getCarry(al, t1l)) | 0 + } + + this._al = (this._al + al) | 0 + this._bl = (this._bl + bl) | 0 + this._cl = (this._cl + cl) | 0 + this._dl = (this._dl + dl) | 0 + this._el = (this._el + el) | 0 + this._fl = (this._fl + fl) | 0 + this._gl = (this._gl + gl) | 0 + this._hl = (this._hl + hl) | 0 + + this._ah = (this._ah + ah + getCarry(this._al, al)) | 0 + this._bh = (this._bh + bh + getCarry(this._bl, bl)) | 0 + this._ch = (this._ch + ch + getCarry(this._cl, cl)) | 0 + this._dh = (this._dh + dh + getCarry(this._dl, dl)) | 0 + this._eh = (this._eh + eh + getCarry(this._el, el)) | 0 + this._fh = (this._fh + fh + getCarry(this._fl, fl)) | 0 + this._gh = (this._gh + gh + getCarry(this._gl, gl)) | 0 + this._hh = (this._hh + hh + getCarry(this._hl, hl)) | 0 +} + +Sha512.prototype._hash = function () { + var H = Buffer.allocUnsafe(64) + + function writeInt64BE (h, l, offset) { + H.writeInt32BE(h, offset) + H.writeInt32BE(l, offset + 4) + } + + writeInt64BE(this._ah, this._al, 0) + writeInt64BE(this._bh, this._bl, 8) + writeInt64BE(this._ch, this._cl, 16) + writeInt64BE(this._dh, this._dl, 24) + writeInt64BE(this._eh, this._el, 32) + writeInt64BE(this._fh, this._fl, 40) + writeInt64BE(this._gh, this._gl, 48) + writeInt64BE(this._hh, this._hl, 56) + + return H +} + +module.exports = Sha512 + + +/***/ }), + +/***/ 780: +/***/ ((module) => { + +var x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var y = x => () => x +module.exports = __WEBPACK_EXTERNAL_MODULE_base64_js_f145eb6e__; + +/***/ }), + +/***/ 294: +/***/ ((module) => { + +var x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var y = x => () => x +module.exports = __WEBPACK_EXTERNAL_MODULE_ieee754__; + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/compat get default export */ +/******/ (() => { +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = (module) => { +/******/ var getter = module && module.__esModule ? +/******/ () => (module['default']) : +/******/ () => (module); +/******/ __webpack_require__.d(getter, { a: getter }); +/******/ return getter; +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/global */ +/******/ (() => { +/******/ __webpack_require__.g = (function() { +/******/ if (typeof globalThis === 'object') return globalThis; +/******/ try { +/******/ return this || new Function('return this')(); +/******/ } catch (e) { +/******/ if (typeof window === 'object') return window; +/******/ } +/******/ })(); +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/******/ /* webpack/runtime/make namespace object */ +/******/ (() => { +/******/ // define __esModule on exports +/******/ __webpack_require__.r = (exports) => { +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); +/******/ } +/******/ Object.defineProperty(exports, '__esModule', { value: true }); +/******/ }; +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = {}; +// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk. +(() => { + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + Z: () => (/* binding */ src) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/err/actions.js +var actions_namespaceObject = {}; +__webpack_require__.r(actions_namespaceObject); +__webpack_require__.d(actions_namespaceObject, { + CLEAR: () => (CLEAR), + CLEAR_BY: () => (CLEAR_BY), + NEW_AUTH_ERR: () => (NEW_AUTH_ERR), + NEW_SPEC_ERR: () => (NEW_SPEC_ERR), + NEW_SPEC_ERR_BATCH: () => (NEW_SPEC_ERR_BATCH), + NEW_THROWN_ERR: () => (NEW_THROWN_ERR), + NEW_THROWN_ERR_BATCH: () => (NEW_THROWN_ERR_BATCH), + clear: () => (clear), + clearBy: () => (clearBy), + newAuthErr: () => (newAuthErr), + newSpecErr: () => (newSpecErr), + newSpecErrBatch: () => (newSpecErrBatch), + newThrownErr: () => (newThrownErr), + newThrownErrBatch: () => (newThrownErrBatch) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/auth/actions.js +var auth_actions_namespaceObject = {}; +__webpack_require__.r(auth_actions_namespaceObject); +__webpack_require__.d(auth_actions_namespaceObject, { + AUTHORIZE: () => (AUTHORIZE), + AUTHORIZE_OAUTH2: () => (AUTHORIZE_OAUTH2), + CONFIGURE_AUTH: () => (CONFIGURE_AUTH), + LOGOUT: () => (LOGOUT), + PRE_AUTHORIZE_OAUTH2: () => (PRE_AUTHORIZE_OAUTH2), + RESTORE_AUTHORIZATION: () => (RESTORE_AUTHORIZATION), + SHOW_AUTH_POPUP: () => (SHOW_AUTH_POPUP), + VALIDATE: () => (VALIDATE), + authPopup: () => (authPopup), + authorize: () => (authorize), + authorizeAccessCodeWithBasicAuthentication: () => (authorizeAccessCodeWithBasicAuthentication), + authorizeAccessCodeWithFormParams: () => (authorizeAccessCodeWithFormParams), + authorizeApplication: () => (authorizeApplication), + authorizeOauth2: () => (authorizeOauth2), + authorizeOauth2WithPersistOption: () => (authorizeOauth2WithPersistOption), + authorizePassword: () => (authorizePassword), + authorizeRequest: () => (authorizeRequest), + authorizeWithPersistOption: () => (authorizeWithPersistOption), + configureAuth: () => (configureAuth), + logout: () => (logout), + logoutWithPersistOption: () => (logoutWithPersistOption), + persistAuthorizationIfNeeded: () => (persistAuthorizationIfNeeded), + preAuthorizeImplicit: () => (preAuthorizeImplicit), + restoreAuthorization: () => (restoreAuthorization), + showDefinitions: () => (showDefinitions) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/auth/selectors.js +var selectors_namespaceObject = {}; +__webpack_require__.r(selectors_namespaceObject); +__webpack_require__.d(selectors_namespaceObject, { + authorized: () => (authorized), + definitionsForRequirements: () => (definitionsForRequirements), + definitionsToAuthorize: () => (definitionsToAuthorize), + getConfigs: () => (getConfigs), + getDefinitionsByNames: () => (getDefinitionsByNames), + isAuthorized: () => (isAuthorized), + shownDefinitions: () => (shownDefinitions) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/configs/actions.js +var configs_actions_namespaceObject = {}; +__webpack_require__.r(configs_actions_namespaceObject); +__webpack_require__.d(configs_actions_namespaceObject, { + TOGGLE_CONFIGS: () => (TOGGLE_CONFIGS), + UPDATE_CONFIGS: () => (UPDATE_CONFIGS), + loaded: () => (actions_loaded), + toggle: () => (toggle), + update: () => (update) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/configs/spec-actions.js +var spec_actions_namespaceObject = {}; +__webpack_require__.r(spec_actions_namespaceObject); +__webpack_require__.d(spec_actions_namespaceObject, { + downloadConfig: () => (downloadConfig), + getConfigByUrl: () => (getConfigByUrl) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/configs/selectors.js +var configs_selectors_namespaceObject = {}; +__webpack_require__.r(configs_selectors_namespaceObject); +__webpack_require__.d(configs_selectors_namespaceObject, { + get: () => (get) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/err/error-transformers/transformers/not-of-type.js +var not_of_type_namespaceObject = {}; +__webpack_require__.r(not_of_type_namespaceObject); +__webpack_require__.d(not_of_type_namespaceObject, { + transform: () => (transform) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/err/error-transformers/transformers/parameter-oneof.js +var parameter_oneof_namespaceObject = {}; +__webpack_require__.r(parameter_oneof_namespaceObject); +__webpack_require__.d(parameter_oneof_namespaceObject, { + transform: () => (parameter_oneof_transform) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/err/selectors.js +var err_selectors_namespaceObject = {}; +__webpack_require__.r(err_selectors_namespaceObject); +__webpack_require__.d(err_selectors_namespaceObject, { + allErrors: () => (allErrors), + lastError: () => (lastError) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/layout/actions.js +var layout_actions_namespaceObject = {}; +__webpack_require__.r(layout_actions_namespaceObject); +__webpack_require__.d(layout_actions_namespaceObject, { + SHOW: () => (SHOW), + UPDATE_FILTER: () => (UPDATE_FILTER), + UPDATE_LAYOUT: () => (UPDATE_LAYOUT), + UPDATE_MODE: () => (UPDATE_MODE), + changeMode: () => (changeMode), + show: () => (actions_show), + updateFilter: () => (updateFilter), + updateLayout: () => (updateLayout) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/layout/selectors.js +var layout_selectors_namespaceObject = {}; +__webpack_require__.r(layout_selectors_namespaceObject); +__webpack_require__.d(layout_selectors_namespaceObject, { + current: () => (current), + currentFilter: () => (currentFilter), + isShown: () => (isShown), + showSummary: () => (showSummary), + whatMode: () => (whatMode) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/layout/spec-extensions/wrap-selector.js +var wrap_selector_namespaceObject = {}; +__webpack_require__.r(wrap_selector_namespaceObject); +__webpack_require__.d(wrap_selector_namespaceObject, { + taggedOperations: () => (taggedOperations) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/request-snippets/fn.js +var fn_namespaceObject = {}; +__webpack_require__.r(fn_namespaceObject); +__webpack_require__.d(fn_namespaceObject, { + requestSnippetGenerator_curl_bash: () => (requestSnippetGenerator_curl_bash), + requestSnippetGenerator_curl_cmd: () => (requestSnippetGenerator_curl_cmd), + requestSnippetGenerator_curl_powershell: () => (requestSnippetGenerator_curl_powershell) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/request-snippets/selectors.js +var request_snippets_selectors_namespaceObject = {}; +__webpack_require__.r(request_snippets_selectors_namespaceObject); +__webpack_require__.d(request_snippets_selectors_namespaceObject, { + getActiveLanguage: () => (getActiveLanguage), + getDefaultExpanded: () => (getDefaultExpanded), + getGenerators: () => (getGenerators), + getSnippetGenerators: () => (getSnippetGenerators) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/spec/selectors.js +var spec_selectors_namespaceObject = {}; +__webpack_require__.r(spec_selectors_namespaceObject); +__webpack_require__.d(spec_selectors_namespaceObject, { + allowTryItOutFor: () => (allowTryItOutFor), + basePath: () => (basePath), + canExecuteScheme: () => (canExecuteScheme), + consumes: () => (consumes), + consumesOptionsFor: () => (consumesOptionsFor), + contentTypeValues: () => (contentTypeValues), + currentProducesFor: () => (currentProducesFor), + definitions: () => (definitions), + externalDocs: () => (externalDocs), + findDefinition: () => (findDefinition), + getOAS3RequiredRequestBodyContentType: () => (getOAS3RequiredRequestBodyContentType), + getParameter: () => (getParameter), + hasHost: () => (hasHost), + host: () => (host), + info: () => (info), + isMediaTypeSchemaPropertiesEqual: () => (isMediaTypeSchemaPropertiesEqual), + isOAS3: () => (isOAS3), + lastError: () => (selectors_lastError), + mutatedRequestFor: () => (mutatedRequestFor), + mutatedRequests: () => (mutatedRequests), + operationScheme: () => (operationScheme), + operationWithMeta: () => (operationWithMeta), + operations: () => (operations), + operationsWithRootInherited: () => (operationsWithRootInherited), + operationsWithTags: () => (operationsWithTags), + parameterInclusionSettingFor: () => (parameterInclusionSettingFor), + parameterValues: () => (parameterValues), + parameterWithMeta: () => (parameterWithMeta), + parameterWithMetaByIdentity: () => (parameterWithMetaByIdentity), + parametersIncludeIn: () => (parametersIncludeIn), + parametersIncludeType: () => (parametersIncludeType), + paths: () => (paths), + produces: () => (produces), + producesOptionsFor: () => (producesOptionsFor), + requestFor: () => (requestFor), + requests: () => (requests), + responseFor: () => (responseFor), + responses: () => (responses), + schemes: () => (schemes), + security: () => (security), + securityDefinitions: () => (securityDefinitions), + semver: () => (semver), + spec: () => (spec), + specJS: () => (specJS), + specJson: () => (specJson), + specJsonWithResolvedSubtrees: () => (specJsonWithResolvedSubtrees), + specResolved: () => (specResolved), + specResolvedSubtree: () => (specResolvedSubtree), + specSource: () => (specSource), + specStr: () => (specStr), + tagDetails: () => (tagDetails), + taggedOperations: () => (selectors_taggedOperations), + tags: () => (tags), + url: () => (url), + validOperationMethods: () => (validOperationMethods), + validateBeforeExecute: () => (validateBeforeExecute), + validationErrors: () => (validationErrors), + version: () => (version) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/spec/actions.js +var plugins_spec_actions_namespaceObject = {}; +__webpack_require__.r(plugins_spec_actions_namespaceObject); +__webpack_require__.d(plugins_spec_actions_namespaceObject, { + CLEAR_REQUEST: () => (CLEAR_REQUEST), + CLEAR_RESPONSE: () => (CLEAR_RESPONSE), + CLEAR_VALIDATE_PARAMS: () => (CLEAR_VALIDATE_PARAMS), + LOG_REQUEST: () => (LOG_REQUEST), + SET_MUTATED_REQUEST: () => (SET_MUTATED_REQUEST), + SET_REQUEST: () => (SET_REQUEST), + SET_RESPONSE: () => (SET_RESPONSE), + SET_SCHEME: () => (SET_SCHEME), + UPDATE_EMPTY_PARAM_INCLUSION: () => (UPDATE_EMPTY_PARAM_INCLUSION), + UPDATE_JSON: () => (UPDATE_JSON), + UPDATE_OPERATION_META_VALUE: () => (UPDATE_OPERATION_META_VALUE), + UPDATE_PARAM: () => (UPDATE_PARAM), + UPDATE_RESOLVED: () => (UPDATE_RESOLVED), + UPDATE_RESOLVED_SUBTREE: () => (UPDATE_RESOLVED_SUBTREE), + UPDATE_SPEC: () => (UPDATE_SPEC), + UPDATE_URL: () => (UPDATE_URL), + VALIDATE_PARAMS: () => (VALIDATE_PARAMS), + changeConsumesValue: () => (changeConsumesValue), + changeParam: () => (changeParam), + changeParamByIdentity: () => (changeParamByIdentity), + changeProducesValue: () => (changeProducesValue), + clearRequest: () => (clearRequest), + clearResponse: () => (clearResponse), + clearValidateParams: () => (clearValidateParams), + execute: () => (actions_execute), + executeRequest: () => (executeRequest), + invalidateResolvedSubtreeCache: () => (invalidateResolvedSubtreeCache), + logRequest: () => (logRequest), + parseToJson: () => (parseToJson), + requestResolvedSubtree: () => (requestResolvedSubtree), + resolveSpec: () => (resolveSpec), + setMutatedRequest: () => (setMutatedRequest), + setRequest: () => (setRequest), + setResponse: () => (setResponse), + setScheme: () => (setScheme), + updateEmptyParamInclusion: () => (updateEmptyParamInclusion), + updateJsonSpec: () => (updateJsonSpec), + updateResolved: () => (updateResolved), + updateResolvedSubtree: () => (updateResolvedSubtree), + updateSpec: () => (updateSpec), + updateUrl: () => (updateUrl), + validateParams: () => (validateParams) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/spec/wrap-actions.js +var spec_wrap_actions_namespaceObject = {}; +__webpack_require__.r(spec_wrap_actions_namespaceObject); +__webpack_require__.d(spec_wrap_actions_namespaceObject, { + executeRequest: () => (wrap_actions_executeRequest), + updateJsonSpec: () => (wrap_actions_updateJsonSpec), + updateSpec: () => (wrap_actions_updateSpec), + validateParams: () => (wrap_actions_validateParams) +}); + +// NAMESPACE OBJECT: ./src/core/components/layout-utils.jsx +var layout_utils_namespaceObject = {}; +__webpack_require__.r(layout_utils_namespaceObject); +__webpack_require__.d(layout_utils_namespaceObject, { + Button: () => (Button), + Col: () => (Col), + Collapse: () => (Collapse), + Container: () => (Container), + Input: () => (Input), + Link: () => (Link), + Row: () => (Row), + Select: () => (Select), + TextArea: () => (TextArea) +}); + +// NAMESPACE OBJECT: ./src/core/components/json-schema-components.jsx +var json_schema_components_namespaceObject = {}; +__webpack_require__.r(json_schema_components_namespaceObject); +__webpack_require__.d(json_schema_components_namespaceObject, { + JsonSchemaArrayItemFile: () => (JsonSchemaArrayItemFile), + JsonSchemaArrayItemText: () => (JsonSchemaArrayItemText), + JsonSchemaForm: () => (JsonSchemaForm), + JsonSchema_array: () => (JsonSchema_array), + JsonSchema_boolean: () => (JsonSchema_boolean), + JsonSchema_object: () => (JsonSchema_object), + JsonSchema_string: () => (JsonSchema_string) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/oas3/spec-extensions/wrap-selectors.js +var wrap_selectors_namespaceObject = {}; +__webpack_require__.r(wrap_selectors_namespaceObject); +__webpack_require__.d(wrap_selectors_namespaceObject, { + basePath: () => (wrap_selectors_basePath), + consumes: () => (wrap_selectors_consumes), + definitions: () => (wrap_selectors_definitions), + hasHost: () => (wrap_selectors_hasHost), + host: () => (wrap_selectors_host), + produces: () => (wrap_selectors_produces), + schemes: () => (wrap_selectors_schemes), + securityDefinitions: () => (wrap_selectors_securityDefinitions), + validOperationMethods: () => (wrap_selectors_validOperationMethods) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/oas3/auth-extensions/wrap-selectors.js +var auth_extensions_wrap_selectors_namespaceObject = {}; +__webpack_require__.r(auth_extensions_wrap_selectors_namespaceObject); +__webpack_require__.d(auth_extensions_wrap_selectors_namespaceObject, { + definitionsToAuthorize: () => (wrap_selectors_definitionsToAuthorize) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/oas3/spec-extensions/selectors.js +var spec_extensions_selectors_namespaceObject = {}; +__webpack_require__.r(spec_extensions_selectors_namespaceObject); +__webpack_require__.d(spec_extensions_selectors_namespaceObject, { + callbacksOperations: () => (callbacksOperations), + isOAS3: () => (selectors_isOAS3), + isOAS30: () => (selectors_isOAS30), + isSwagger2: () => (selectors_isSwagger2), + servers: () => (servers) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/oas3/actions.js +var oas3_actions_namespaceObject = {}; +__webpack_require__.r(oas3_actions_namespaceObject); +__webpack_require__.d(oas3_actions_namespaceObject, { + CLEAR_REQUEST_BODY_VALIDATE_ERROR: () => (CLEAR_REQUEST_BODY_VALIDATE_ERROR), + CLEAR_REQUEST_BODY_VALUE: () => (CLEAR_REQUEST_BODY_VALUE), + SET_REQUEST_BODY_VALIDATE_ERROR: () => (SET_REQUEST_BODY_VALIDATE_ERROR), + UPDATE_ACTIVE_EXAMPLES_MEMBER: () => (UPDATE_ACTIVE_EXAMPLES_MEMBER), + UPDATE_REQUEST_BODY_INCLUSION: () => (UPDATE_REQUEST_BODY_INCLUSION), + UPDATE_REQUEST_BODY_VALUE: () => (UPDATE_REQUEST_BODY_VALUE), + UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG: () => (UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG), + UPDATE_REQUEST_CONTENT_TYPE: () => (UPDATE_REQUEST_CONTENT_TYPE), + UPDATE_RESPONSE_CONTENT_TYPE: () => (UPDATE_RESPONSE_CONTENT_TYPE), + UPDATE_SELECTED_SERVER: () => (UPDATE_SELECTED_SERVER), + UPDATE_SERVER_VARIABLE_VALUE: () => (UPDATE_SERVER_VARIABLE_VALUE), + clearRequestBodyValidateError: () => (clearRequestBodyValidateError), + clearRequestBodyValue: () => (clearRequestBodyValue), + initRequestBodyValidateError: () => (initRequestBodyValidateError), + setActiveExamplesMember: () => (setActiveExamplesMember), + setRequestBodyInclusion: () => (setRequestBodyInclusion), + setRequestBodyValidateError: () => (setRequestBodyValidateError), + setRequestBodyValue: () => (setRequestBodyValue), + setRequestContentType: () => (setRequestContentType), + setResponseContentType: () => (setResponseContentType), + setRetainRequestBodyValueFlag: () => (setRetainRequestBodyValueFlag), + setSelectedServer: () => (setSelectedServer), + setServerVariableValue: () => (setServerVariableValue) +}); + +// NAMESPACE OBJECT: ./src/core/plugins/oas3/selectors.js +var oas3_selectors_namespaceObject = {}; +__webpack_require__.r(oas3_selectors_namespaceObject); +__webpack_require__.d(oas3_selectors_namespaceObject, { + activeExamplesMember: () => (activeExamplesMember), + hasUserEditedBody: () => (hasUserEditedBody), + requestBodyErrors: () => (requestBodyErrors), + requestBodyInclusionSetting: () => (requestBodyInclusionSetting), + requestBodyValue: () => (requestBodyValue), + requestContentType: () => (requestContentType), + responseContentType: () => (responseContentType), + selectDefaultRequestBodyValue: () => (selectDefaultRequestBodyValue), + selectedServer: () => (selectedServer), + serverEffectiveValue: () => (serverEffectiveValue), + serverVariableValue: () => (serverVariableValue), + serverVariables: () => (serverVariables), + shouldRetainRequestBodyValue: () => (shouldRetainRequestBodyValue), + validOperationMethods: () => (selectors_validOperationMethods), + validateBeforeExecute: () => (selectors_validateBeforeExecute), + validateShallowRequired: () => (validateShallowRequired) +}); + +// EXTERNAL MODULE: ./node_modules/deep-extend/lib/deep-extend.js +var deep_extend = __webpack_require__(698); +var deep_extend_default = /*#__PURE__*/__webpack_require__.n(deep_extend); +;// CONCATENATED MODULE: external "react" +var x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var y = x => () => x +const external_react_namespaceObject = x({ ["Component"]: () => __WEBPACK_EXTERNAL_MODULE_react__.Component, ["PureComponent"]: () => __WEBPACK_EXTERNAL_MODULE_react__.PureComponent, ["createContext"]: () => __WEBPACK_EXTERNAL_MODULE_react__.createContext, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react__["default"], ["forwardRef"]: () => __WEBPACK_EXTERNAL_MODULE_react__.forwardRef, ["useCallback"]: () => __WEBPACK_EXTERNAL_MODULE_react__.useCallback, ["useContext"]: () => __WEBPACK_EXTERNAL_MODULE_react__.useContext, ["useEffect"]: () => __WEBPACK_EXTERNAL_MODULE_react__.useEffect, ["useRef"]: () => __WEBPACK_EXTERNAL_MODULE_react__.useRef, ["useState"]: () => __WEBPACK_EXTERNAL_MODULE_react__.useState }); +;// CONCATENATED MODULE: external "redux" +var external_redux_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_redux_y = x => () => x +const external_redux_namespaceObject = external_redux_x({ ["applyMiddleware"]: () => __WEBPACK_EXTERNAL_MODULE_redux__.applyMiddleware, ["bindActionCreators"]: () => __WEBPACK_EXTERNAL_MODULE_redux__.bindActionCreators, ["compose"]: () => __WEBPACK_EXTERNAL_MODULE_redux__.compose, ["createStore"]: () => __WEBPACK_EXTERNAL_MODULE_redux__.createStore }); +;// CONCATENATED MODULE: external "immutable" +var external_immutable_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_immutable_y = x => () => x +const external_immutable_namespaceObject = external_immutable_x({ ["List"]: () => __WEBPACK_EXTERNAL_MODULE_immutable__.List, ["Map"]: () => __WEBPACK_EXTERNAL_MODULE_immutable__.Map, ["OrderedMap"]: () => __WEBPACK_EXTERNAL_MODULE_immutable__.OrderedMap, ["Seq"]: () => __WEBPACK_EXTERNAL_MODULE_immutable__.Seq, ["Set"]: () => __WEBPACK_EXTERNAL_MODULE_immutable__.Set, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_immutable__["default"], ["fromJS"]: () => __WEBPACK_EXTERNAL_MODULE_immutable__.fromJS }); +;// CONCATENATED MODULE: external "redux-immutable" +var external_redux_immutable_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_redux_immutable_y = x => () => x +const external_redux_immutable_namespaceObject = external_redux_immutable_x({ ["combineReducers"]: () => __WEBPACK_EXTERNAL_MODULE_redux_immutable_446c9f82__.combineReducers }); +;// CONCATENATED MODULE: external "serialize-error" +var external_serialize_error_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_serialize_error_y = x => () => x +const external_serialize_error_namespaceObject = external_serialize_error_x({ ["serializeError"]: () => __WEBPACK_EXTERNAL_MODULE_serialize_error_5f2df3e5__.serializeError }); +;// CONCATENATED MODULE: external "lodash/merge" +var merge_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var merge_y = x => () => x +const merge_namespaceObject = merge_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_merge_cf99375a__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/err/actions.js + + +const NEW_THROWN_ERR = "err_new_thrown_err"; +const NEW_THROWN_ERR_BATCH = "err_new_thrown_err_batch"; +const NEW_SPEC_ERR = "err_new_spec_err"; +const NEW_SPEC_ERR_BATCH = "err_new_spec_err_batch"; +const NEW_AUTH_ERR = "err_new_auth_err"; +const CLEAR = "err_clear"; +const CLEAR_BY = "err_clear_by"; + +function newThrownErr(err) { + return { + type: NEW_THROWN_ERR, + payload: (0,external_serialize_error_namespaceObject.serializeError)(err) + }; +} + +function newThrownErrBatch(errors) { + return { + type: NEW_THROWN_ERR_BATCH, + payload: errors + }; +} + +function newSpecErr(err) { + return { + type: NEW_SPEC_ERR, + payload: err + }; +} + +function newSpecErrBatch(errArray) { + return { + type: NEW_SPEC_ERR_BATCH, + payload: errArray + }; +} + +function newAuthErr(err) { + return { + type: NEW_AUTH_ERR, + payload: err + }; +} + +function clear() {let filter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + // filter looks like: {type: 'spec'}, {source: 'parser'} + return { + type: CLEAR, + payload: filter + }; +} + +function clearBy() {let filter = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : () => true; + // filter is a function + return { + type: CLEAR_BY, + payload: filter + }; +} +;// CONCATENATED MODULE: ./src/core/window.js +function makeWindow() { + var win = { + location: {}, + history: {}, + open: () => {}, + close: () => {}, + File: function () {}, + FormData: function () {} + }; + + if (typeof window === "undefined") { + return win; + } + + try { + win = window; + var props = ["File", "Blob", "FormData"]; + for (var prop of props) { + if (prop in window) { + win[prop] = window[prop]; + } + } + } catch (e) { + console.error(e); + } + + return win; +} + +/* harmony default export */ const core_window = (makeWindow()); +;// CONCATENATED MODULE: external "@braintree/sanitize-url" +var sanitize_url_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var sanitize_url_y = x => () => x +const sanitize_url_namespaceObject = sanitize_url_x({ ["sanitizeUrl"]: () => __WEBPACK_EXTERNAL_MODULE__braintree_sanitize_url_2340607f__.sanitizeUrl }); +;// CONCATENATED MODULE: external "lodash/camelCase" +var camelCase_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var camelCase_y = x => () => x +const camelCase_namespaceObject = camelCase_x({ }); +;// CONCATENATED MODULE: external "lodash/upperFirst" +var upperFirst_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var upperFirst_y = x => () => x +const upperFirst_namespaceObject = upperFirst_x({ }); +;// CONCATENATED MODULE: external "lodash/memoize" +var memoize_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var memoize_y = x => () => x +const memoize_namespaceObject = memoize_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_memoize_2b5bc477__["default"] }); +;// CONCATENATED MODULE: external "lodash/find" +var find_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var find_y = x => () => x +const find_namespaceObject = find_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_find_e8ecc2cb__["default"] }); +;// CONCATENATED MODULE: external "lodash/some" +var some_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var some_y = x => () => x +const some_namespaceObject = some_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_some_5cd47809__["default"] }); +;// CONCATENATED MODULE: external "lodash/eq" +var eq_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var eq_y = x => () => x +const eq_namespaceObject = eq_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_eq_b41b823a__["default"] }); +;// CONCATENATED MODULE: external "lodash/isFunction" +var isFunction_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var isFunction_y = x => () => x +const isFunction_namespaceObject = isFunction_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_isFunction_f90b20d6__["default"] }); +;// CONCATENATED MODULE: external "css.escape" +var external_css_escape_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_css_escape_y = x => () => x +const external_css_escape_namespaceObject = external_css_escape_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_css_escape_2d301448__["default"] }); +// EXTERNAL MODULE: ./node_modules/randombytes/browser.js +var browser = __webpack_require__(798); +var browser_default = /*#__PURE__*/__webpack_require__.n(browser); +// EXTERNAL MODULE: ./node_modules/sha.js/index.js +var sha_js = __webpack_require__(72); +var sha_js_default = /*#__PURE__*/__webpack_require__.n(sha_js); +;// CONCATENATED MODULE: ./src/core/utils/get-parameter-schema.js +/** + * @prettier + */ + + + +const swagger2SchemaKeys = external_immutable_namespaceObject["default"].Set.of( + "type", + "format", + "items", + "default", + "maximum", + "exclusiveMaximum", + "minimum", + "exclusiveMinimum", + "maxLength", + "minLength", + "pattern", + "maxItems", + "minItems", + "uniqueItems", + "enum", + "multipleOf" +); + +/** + * @typedef {Object} ParameterSchemaDescriptor + * @property {Immutable.Map} schema - the parameter schema + * @property {string|null} parameterContentMediaType - the effective media type, for `content`-based OpenAPI 3.0 Parameters, or `null` otherwise + */ + +/** + * Get the effective schema value for a parameter, or an empty Immutable.Map if + * no suitable schema can be found. + * + * Supports OpenAPI 3.0 `Parameter.content` priority -- since a Parameter Object + * cannot have both `schema` and `content`, this function ignores `schema` when + * `content` is present. + * + * @param {Immutable.Map} parameter The parameter to identify a schema for + * @param {object} config + * @param {boolean} config.isOAS3 Whether the parameter is from an OpenAPI 2.0 + * or OpenAPI 3.0 definition + * @return {ParameterSchemaDescriptor} Information about the parameter schema + */ +function getParameterSchema(parameter) {let { isOAS3 } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + // Return empty Map if `parameter` isn't a Map + if (!external_immutable_namespaceObject["default"].Map.isMap(parameter)) { + return { + schema: external_immutable_namespaceObject["default"].Map(), + parameterContentMediaType: null + }; + } + + if (!isOAS3) { + // Swagger 2.0 + if (parameter.get("in") === "body") { + return { + schema: parameter.get("schema", external_immutable_namespaceObject["default"].Map()), + parameterContentMediaType: null + }; + } else { + return { + schema: parameter.filter((v, k) => swagger2SchemaKeys.includes(k)), + parameterContentMediaType: null + }; + } + } + + // If we've reached here, the parameter is OpenAPI 3.0 + + if (parameter.get("content")) { + const parameterContentMediaTypes = parameter. + get("content", external_immutable_namespaceObject["default"].Map({})). + keySeq(); + + const parameterContentMediaType = parameterContentMediaTypes.first(); + + return { + schema: parameter.getIn( + ["content", parameterContentMediaType, "schema"], + external_immutable_namespaceObject["default"].Map() + ), + parameterContentMediaType + }; + } + + return { + schema: parameter.get("schema") ? parameter.get("schema", external_immutable_namespaceObject["default"].Map()) : external_immutable_namespaceObject["default"].Map(), + parameterContentMediaType: null + }; +} +;// CONCATENATED MODULE: ./src/core/utils/index.js +/* provided dependency */ var Buffer = __webpack_require__(764)["Buffer"]; +/* + ATTENTION! This file (but not the functions within) is deprecated. + + You should probably add a new file to `./helpers/` instead of adding a new + function here. + + One-function-per-file is a better pattern than what we have here. + + If you're refactoring something in here, feel free to break it out to a file + in `./helpers` if you have the time. +*/ + + + + + + + + + + + + + + + + +const DEFAULT_RESPONSE_KEY = "default"; + +const isImmutable = (maybe) => external_immutable_namespaceObject["default"].Iterable.isIterable(maybe); + +function objectify(thing) { + if (!isObject(thing)) + return {}; + if (isImmutable(thing)) + return thing.toJS(); + return thing; +} + +function arrayify(thing) { + if (!thing) + return []; + + if (thing.toArray) + return thing.toArray(); + + return normalizeArray(thing); +} + +function fromJSOrdered(js) { + if (isImmutable(js)) { + return js; // Can't do much here + } + if (js instanceof core_window.File) { + return js; + } + if (!isObject(js)) { + return js; + } + if (Array.isArray(js)) { + return external_immutable_namespaceObject["default"].Seq(js).map(fromJSOrdered).toList(); + } + if ((0,isFunction_namespaceObject["default"])(js.entries)) { + // handle multipart/form-data + const objWithHashedKeys = createObjWithHashedKeys(js); + return external_immutable_namespaceObject["default"].OrderedMap(objWithHashedKeys).map(fromJSOrdered); + } + return external_immutable_namespaceObject["default"].OrderedMap(js).map(fromJSOrdered); +} + +/** + * Convert a FormData object into plain object + * Append a hashIdx and counter to the key name, if multiple exists + * if single, key name = + * if multiple, key name = + * @example single entry for vegetable + * fdObj.entries.vegtables: "carrot" + * // returns newObj.vegetables : "carrot" + * @example multiple entries for fruits[] + * fdObj.entries.fruits[]: "apple" + * // returns newObj.fruits[]_**[]1 : "apple" + * fdObj.entries.fruits[]: "banana" + * // returns newObj.fruits[]_**[]2 : "banana" + * fdObj.entries.fruits[]: "grape" + * // returns newObj.fruits[]_**[]3 : "grape" + * @param {FormData} fdObj - a FormData object + * @return {Object} - a plain object + */ +function createObjWithHashedKeys(fdObj) { + if (!(0,isFunction_namespaceObject["default"])(fdObj.entries)) { + return fdObj; // not a FormData object with iterable + } + const newObj = {}; + const hashIdx = "_**[]"; // our internal identifier + const trackKeys = {}; + for (let pair of fdObj.entries()) { + if (!newObj[pair[0]] && !(trackKeys[pair[0]] && trackKeys[pair[0]].containsMultiple)) { + newObj[pair[0]] = pair[1]; // first key name: no hash required + } else { + if (!trackKeys[pair[0]]) { + // initiate tracking key for multiple + trackKeys[pair[0]] = { + containsMultiple: true, + length: 1 + }; + // "reassign" first pair to matching hashed format for multiple + let hashedKeyFirst = `${pair[0]}${hashIdx}${trackKeys[pair[0]].length}`; + newObj[hashedKeyFirst] = newObj[pair[0]]; + // remove non-hashed key of multiple + delete newObj[pair[0]]; // first + } + trackKeys[pair[0]].length += 1; + let hashedKeyCurrent = `${pair[0]}${hashIdx}${trackKeys[pair[0]].length}`; + newObj[hashedKeyCurrent] = pair[1]; + } + } + return newObj; +} + +function bindToState(obj, state) { + var newObj = {}; + Object.keys(obj). + filter((key) => typeof obj[key] === "function"). + forEach((key) => newObj[key] = obj[key].bind(null, state)); + return newObj; +} + +function normalizeArray(arr) { + if (Array.isArray(arr)) + return arr; + return [arr]; +} + +function isFn(fn) { + return typeof fn === "function"; +} + +function isObject(obj) { + return !!obj && typeof obj === "object"; +} + +function isFunc(thing) { + return typeof thing === "function"; +} + +function isArray(thing) { + return Array.isArray(thing); +} + +// I've changed memoize libs more than once, so I'm using this a way to make that simpler +const memoize = memoize_namespaceObject["default"]; + +function objMap(obj, fn) { + return Object.keys(obj).reduce((newObj, key) => { + newObj[key] = fn(obj[key], key); + return newObj; + }, {}); +} + +function objReduce(obj, fn) { + return Object.keys(obj).reduce((newObj, key) => { + let res = fn(obj[key], key); + if (res && typeof res === "object") + Object.assign(newObj, res); + return newObj; + }, {}); +} + +// Redux middleware that exposes the system to async actions (like redux-thunk, but with out system instead of (dispatch, getState) +function systemThunkMiddleware(getSystem) { + return (_ref) => {let { dispatch, getState } = _ref; // eslint-disable-line no-unused-vars + return (next) => (action) => { + if (typeof action === "function") { + return action(getSystem()); + } + + return next(action); + }; + }; +} + +function defaultStatusCode(responses) { + let codes = responses.keySeq(); + return codes.contains(DEFAULT_RESPONSE_KEY) ? DEFAULT_RESPONSE_KEY : codes.filter((key) => (key + "")[0] === "2").sort().first(); +} + + +/** + * Returns an Immutable List, safely + * @param {Immutable.Iterable} iterable the iterable to get the key from + * @param {String|[String]} key either an array of keys, or a single key + * @returns {Immutable.List} either iterable.get(keys) or an empty Immutable.List + */ +function getList(iterable, keys) { + if (!external_immutable_namespaceObject["default"].Iterable.isIterable(iterable)) { + return external_immutable_namespaceObject["default"].List(); + } + let val = iterable.getIn(Array.isArray(keys) ? keys : [keys]); + return external_immutable_namespaceObject["default"].List.isList(val) ? val : external_immutable_namespaceObject["default"].List(); +} + +/** + * Take an immutable map, and convert to a list. + * Where the keys are merged with the value objects + * @param {Immutable.Map} map, the map to convert + * @param {String} key the key to use, when merging the `key` + * @returns {Immutable.List} + */ +function mapToList(map) {let keyNames = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "key";let collectedKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Im.Map(); + if (!Im.Map.isMap(map) || !map.size) { + return Im.List(); + } + + if (!Array.isArray(keyNames)) { + keyNames = [keyNames]; + } + + if (keyNames.length < 1) { + return map.merge(collectedKeys); + } + + // I need to avoid `flatMap` from merging in the Maps, as well as the lists + let list = Im.List(); + let keyName = keyNames[0]; + for (let entry of map.entries()) { + let [key, val] = entry; + let nextList = mapToList(val, keyNames.slice(1), collectedKeys.set(keyName, key)); + if (Im.List.isList(nextList)) { + list = list.concat(nextList); + } else { + list = list.push(nextList); + } + } + + return list; +} + +function extractFileNameFromContentDispositionHeader(value) { + let patterns = [ + /filename\*=[^']+'\w*'"([^"]+)";?/i, + /filename\*=[^']+'\w*'([^;]+);?/i, + /filename="([^;]*);?"/i, + /filename=([^;]*);?/i]; + + + let responseFilename; + patterns.some((regex) => { + responseFilename = regex.exec(value); + return responseFilename !== null; + }); + + if (responseFilename !== null && responseFilename.length > 1) { + try { + return decodeURIComponent(responseFilename[1]); + } catch (e) { + console.error(e); + } + } + + return null; +} + +// PascalCase, aka UpperCamelCase +function pascalCase(str) { + return upperFirst(camelCase(str)); +} + +// Remove the ext of a filename, and pascalCase it +function pascalCaseFilename(filename) { + return pascalCase(filename.replace(/\.[^./]*$/, "")); +} + +// Check if ... +// - new props +// - If immutable, use .is() +// - if in explicit objectList, then compare using _.eq +// - else use === +const propChecker = function (props, nextProps) {let objectList = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];let ignoreList = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; + + if (Object.keys(props).length !== Object.keys(nextProps).length) { + return true; + } + + return ( + some(props, (a, name) => { + if (ignoreList.includes(name)) { + return false; + } + let b = nextProps[name]; + + if (Im.Iterable.isIterable(a)) { + return !Im.is(a, b); + } + + // Not going to compare objects + if (typeof a === "object" && typeof b === "object") { + return false; + } + + return a !== b; + }) || + objectList.some((objectPropName) => !eq(props[objectPropName], nextProps[objectPropName]))); +}; + +const validateMaximum = (val, max) => { + if (val > max) { + return `Value must be less than ${max}`; + } +}; + +const validateMinimum = (val, min) => { + if (val < min) { + return `Value must be greater than ${min}`; + } +}; + +const validateNumber = (val) => { + if (!/^-?\d+(\.?\d+)?$/.test(val)) { + return "Value must be a number"; + } +}; + +const validateInteger = (val) => { + if (!/^-?\d+$/.test(val)) { + return "Value must be an integer"; + } +}; + +const validateFile = (val) => { + if (val && !(val instanceof core_window.File)) { + return "Value must be a file"; + } +}; + +const validateBoolean = (val) => { + if (!(val === "true" || val === "false" || val === true || val === false)) { + return "Value must be a boolean"; + } +}; + +const validateString = (val) => { + if (val && typeof val !== "string") { + return "Value must be a string"; + } +}; + +const validateDateTime = (val) => { + if (isNaN(Date.parse(val))) { + return "Value must be a DateTime"; + } +}; + +const validateGuid = (val) => { + val = val.toString().toLowerCase(); + if (!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(val)) { + return "Value must be a Guid"; + } +}; + +const validateMaxLength = (val, max) => { + if (val.length > max) { + return `Value must be no longer than ${max} character${max !== 1 ? "s" : ""}`; + } +}; + +const validateUniqueItems = (val, uniqueItems) => { + if (!val) { + return; + } + if (uniqueItems === "true" || uniqueItems === true) { + const list = (0,external_immutable_namespaceObject.fromJS)(val); + const set = list.toSet(); + const hasDuplicates = val.length > set.size; + if (hasDuplicates) { + let errorsPerIndex = (0,external_immutable_namespaceObject.Set)(); + list.forEach((item, i) => { + if (list.filter((v) => isFunc(v.equals) ? v.equals(item) : v === item).size > 1) { + errorsPerIndex = errorsPerIndex.add(i); + } + }); + if (errorsPerIndex.size !== 0) { + return errorsPerIndex.map((i) => ({ index: i, error: "No duplicates allowed." })).toArray(); + } + } + } +}; + +const validateMinItems = (val, min) => { + if (!val && min >= 1 || val && val.length < min) { + return `Array must contain at least ${min} item${min === 1 ? "" : "s"}`; + } +}; + +const validateMaxItems = (val, max) => { + if (val && val.length > max) { + return `Array must not contain more then ${max} item${max === 1 ? "" : "s"}`; + } +}; + +const validateMinLength = (val, min) => { + if (val.length < min) { + return `Value must be at least ${min} character${min !== 1 ? "s" : ""}`; + } +}; + +const validatePattern = (val, rxPattern) => { + var patt = new RegExp(rxPattern); + if (!patt.test(val)) { + return "Value must follow pattern " + rxPattern; + } +}; + +function validateValueBySchema(value, schema, requiredByParam, bypassRequiredCheck, parameterContentMediaType) { + if (!schema) return []; + let errors = []; + let nullable = schema.get("nullable"); + let requiredBySchema = schema.get("required"); + let maximum = schema.get("maximum"); + let minimum = schema.get("minimum"); + let type = schema.get("type"); + let format = schema.get("format"); + let maxLength = schema.get("maxLength"); + let minLength = schema.get("minLength"); + let uniqueItems = schema.get("uniqueItems"); + let maxItems = schema.get("maxItems"); + let minItems = schema.get("minItems"); + let pattern = schema.get("pattern"); + + const schemaRequiresValue = requiredByParam || requiredBySchema === true; + const hasValue = value !== undefined && value !== null; + const isValidEmpty = !schemaRequiresValue && !hasValue; + + const needsExplicitConstraintValidation = hasValue && type === "array"; + + const requiresFurtherValidation = + schemaRequiresValue || + needsExplicitConstraintValidation || + !isValidEmpty; + + const isValidNullable = nullable && value === null; + + // will not be included in the request or [schema / value] does not [allow / require] further analysis. + const noFurtherValidationNeeded = + isValidNullable || + !type || + !requiresFurtherValidation; + + if (noFurtherValidationNeeded) { + return []; + } + + // Further this point the parameter is considered worth to validate + let stringCheck = type === "string" && value; + let arrayCheck = type === "array" && Array.isArray(value) && value.length; + let arrayListCheck = type === "array" && external_immutable_namespaceObject["default"].List.isList(value) && value.count(); + let arrayStringCheck = type === "array" && typeof value === "string" && value; + let fileCheck = type === "file" && value instanceof core_window.File; + let booleanCheck = type === "boolean" && (value || value === false); + let numberCheck = type === "number" && (value || value === 0); + let integerCheck = type === "integer" && (value || value === 0); + let objectCheck = type === "object" && typeof value === "object" && value !== null; + let objectStringCheck = type === "object" && typeof value === "string" && value; + + const allChecks = [ + stringCheck, arrayCheck, arrayListCheck, arrayStringCheck, fileCheck, + booleanCheck, numberCheck, integerCheck, objectCheck, objectStringCheck]; + + + const passedAnyCheck = allChecks.some((v) => !!v); + + if (schemaRequiresValue && !passedAnyCheck && !bypassRequiredCheck) { + errors.push("Required field is not provided"); + return errors; + } + if ( + type === "object" && ( + parameterContentMediaType === null || + parameterContentMediaType === "application/json")) + { + let objectVal = value; + if (typeof value === "string") { + try { + objectVal = JSON.parse(value); + } catch (e) { + errors.push("Parameter string value must be valid JSON"); + return errors; + } + } + if (schema && schema.has("required") && isFunc(requiredBySchema.isList) && requiredBySchema.isList()) { + requiredBySchema.forEach((key) => { + if (objectVal[key] === undefined) { + errors.push({ propKey: key, error: "Required property not found" }); + } + }); + } + if (schema && schema.has("properties")) { + schema.get("properties").forEach((val, key) => { + const errs = validateValueBySchema(objectVal[key], val, false, bypassRequiredCheck, parameterContentMediaType); + errors.push(...errs. + map((error) => ({ propKey: key, error }))); + }); + } + } + + if (pattern) { + let err = validatePattern(value, pattern); + if (err) errors.push(err); + } + + if (minItems) { + if (type === "array") { + let err = validateMinItems(value, minItems); + if (err) errors.push(err); + } + } + + if (maxItems) { + if (type === "array") { + let err = validateMaxItems(value, maxItems); + if (err) errors.push({ needRemove: true, error: err }); + } + } + + if (uniqueItems) { + if (type === "array") { + let errorPerItem = validateUniqueItems(value, uniqueItems); + if (errorPerItem) errors.push(...errorPerItem); + } + } + + if (maxLength || maxLength === 0) { + let err = validateMaxLength(value, maxLength); + if (err) errors.push(err); + } + + if (minLength) { + let err = validateMinLength(value, minLength); + if (err) errors.push(err); + } + + if (maximum || maximum === 0) { + let err = validateMaximum(value, maximum); + if (err) errors.push(err); + } + + if (minimum || minimum === 0) { + let err = validateMinimum(value, minimum); + if (err) errors.push(err); + } + + if (type === "string") { + let err; + if (format === "date-time") { + err = validateDateTime(value); + } else if (format === "uuid") { + err = validateGuid(value); + } else { + err = validateString(value); + } + if (!err) return errors; + errors.push(err); + } else if (type === "boolean") { + let err = validateBoolean(value); + if (!err) return errors; + errors.push(err); + } else if (type === "number") { + let err = validateNumber(value); + if (!err) return errors; + errors.push(err); + } else if (type === "integer") { + let err = validateInteger(value); + if (!err) return errors; + errors.push(err); + } else if (type === "array") { + if (!(arrayCheck || arrayListCheck)) { + return errors; + } + if (value) { + value.forEach((item, i) => { + const errs = validateValueBySchema(item, schema.get("items"), false, bypassRequiredCheck, parameterContentMediaType); + errors.push(...errs. + map((err) => ({ index: i, error: err }))); + }); + } + } else if (type === "file") { + let err = validateFile(value); + if (!err) return errors; + errors.push(err); + } + + return errors; +} + +// validation of parameters before execute +const validateParam = function (param, value) {let { isOAS3 = false, bypassRequiredCheck = false } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + let paramRequired = param.get("required"); + + let { + schema: paramDetails, + parameterContentMediaType + } = getParameterSchema(param, { isOAS3 }); + + return validateValueBySchema(value, paramDetails, paramRequired, bypassRequiredCheck, parameterContentMediaType); +}; + +const parseSearch = () => { + let map = {}; + let search = core_window.location.search; + + if (!search) + return {}; + + if (search != "") { + let params = search.substr(1).split("&"); + + for (let i in params) { + if (!Object.prototype.hasOwnProperty.call(params, i)) { + continue; + } + i = params[i].split("="); + map[decodeURIComponent(i[0])] = i[1] && decodeURIComponent(i[1]) || ""; + } + } + + return map; +}; + +const serializeSearch = (searchMap) => { + return Object.keys(searchMap).map((k) => { + return encodeURIComponent(k) + "=" + encodeURIComponent(searchMap[k]); + }).join("&"); +}; + +const btoa = (str) => { + let buffer; + + if (str instanceof Buffer) { + buffer = str; + } else { + buffer = Buffer.from(str.toString(), "utf-8"); + } + + return buffer.toString("base64"); +}; + +const sorters = { + operationsSorter: { + alpha: (a, b) => a.get("path").localeCompare(b.get("path")), + method: (a, b) => a.get("method").localeCompare(b.get("method")) + }, + tagsSorter: { + alpha: (a, b) => a.localeCompare(b) + } +}; + +const buildFormData = (data) => { + let formArr = []; + + for (let name in data) { + let val = data[name]; + if (val !== undefined && val !== "") { + formArr.push([name, "=", encodeURIComponent(val).replace(/%20/g, "+")].join("")); + } + } + return formArr.join("&"); +}; + +// Is this really required as a helper? Perhaps. TODO: expose the system of presets.apis in docs, so we know what is supported +const shallowEqualKeys = (a, b, keys) => { + return !!(0,find_namespaceObject["default"])(keys, (key) => { + return (0,eq_namespaceObject["default"])(a[key], b[key]); + }); +}; + +function sanitizeUrl(url) { + if (typeof url !== "string" || url === "") { + return ""; + } + + return (0,sanitize_url_namespaceObject.sanitizeUrl)(url); +} + +function requiresValidationURL(uri) { + if (!uri || uri.indexOf("localhost") >= 0 || uri.indexOf("127.0.0.1") >= 0 || uri === "none") { + return false; + } + return true; +} + + +function getAcceptControllingResponse(responses) { + if (!external_immutable_namespaceObject["default"].OrderedMap.isOrderedMap(responses)) { + // wrong type! + return null; + } + + if (!responses.size) { + // responses is empty + return null; + } + + const suitable2xxResponse = responses.find((res, k) => { + return k.startsWith("2") && Object.keys(res.get("content") || {}).length > 0; + }); + + // try to find a suitable `default` responses + const defaultResponse = responses.get("default") || external_immutable_namespaceObject["default"].OrderedMap(); + const defaultResponseMediaTypes = (defaultResponse.get("content") || external_immutable_namespaceObject["default"].OrderedMap()).keySeq().toJS(); + const suitableDefaultResponse = defaultResponseMediaTypes.length ? defaultResponse : null; + + return suitable2xxResponse || suitableDefaultResponse; +} + +// suitable for use in URL fragments +const createDeepLinkPath = (str) => typeof str == "string" || str instanceof String ? str.trim().replace(/\s/g, "%20") : ""; +// suitable for use in CSS classes and ids +const escapeDeepLinkPath = (str) => (0,external_css_escape_namespaceObject["default"])(createDeepLinkPath(str).replace(/%20/g, "_")); + +const getExtensions = (defObj) => defObj.filter((v, k) => /^x-/.test(k)); +const getCommonExtensions = (defObj) => defObj.filter((v, k) => /^pattern|maxLength|minLength|maximum|minimum/.test(k)); + +// Deeply strips a specific key from an object. +// +// `predicate` can be used to discriminate the stripping further, +// by preserving the key's place in the object based on its value. +function deeplyStripKey(input, keyToStrip) {let predicate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : () => true; + if (typeof input !== "object" || Array.isArray(input) || input === null || !keyToStrip) { + return input; + } + + const obj = Object.assign({}, input); + + Object.keys(obj).forEach((k) => { + if (k === keyToStrip && predicate(obj[k], k)) { + delete obj[k]; + return; + } + obj[k] = deeplyStripKey(obj[k], keyToStrip, predicate); + }); + + return obj; +} + +function stringify(thing) { + if (typeof thing === "string") { + return thing; + } + + if (thing && thing.toJS) { + thing = thing.toJS(); + } + + if (typeof thing === "object" && thing !== null) { + try { + return JSON.stringify(thing, null, 2); + } + catch (e) { + return String(thing); + } + } + + if (thing === null || thing === undefined) { + return ""; + } + + return thing.toString(); +} + +function numberToString(thing) { + if (typeof thing === "number") { + return thing.toString(); + } + + return thing; +} + +function paramToIdentifier(param) {let { returnAll = false, allowHashes = true } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + if (!external_immutable_namespaceObject["default"].Map.isMap(param)) { + throw new Error("paramToIdentifier: received a non-Im.Map parameter as input"); + } + const paramName = param.get("name"); + const paramIn = param.get("in"); + + let generatedIdentifiers = []; + + // Generate identifiers in order of most to least specificity + + if (param && param.hashCode && paramIn && paramName && allowHashes) { + generatedIdentifiers.push(`${paramIn}.${paramName}.hash-${param.hashCode()}`); + } + + if (paramIn && paramName) { + generatedIdentifiers.push(`${paramIn}.${paramName}`); + } + + generatedIdentifiers.push(paramName); + + // Return the most preferred identifier, or all if requested + + return returnAll ? generatedIdentifiers : generatedIdentifiers[0] || ""; +} + +function paramToValue(param, paramValues) { + const allIdentifiers = paramToIdentifier(param, { returnAll: true }); + + // Map identifiers to values in the provided value hash, filter undefined values, + // and return the first value found + const values = allIdentifiers. + map((id) => { + return paramValues[id]; + }). + filter((value) => value !== undefined); + + return values[0]; +} + +// adapted from https://auth0.com/docs/flows/guides/auth-code-pkce/includes/create-code-verifier +function generateCodeVerifier() { + return b64toB64UrlEncoded( + browser_default()(32).toString("base64") + ); +} + +function createCodeChallenge(codeVerifier) { + return b64toB64UrlEncoded( + sha_js_default()("sha256"). + update(codeVerifier). + digest("base64") + ); +} + +function b64toB64UrlEncoded(str) { + return str. + replace(/\+/g, "-"). + replace(/\//g, "_"). + replace(/=/g, ""); +} + +const isEmptyValue = (value) => { + if (!value) { + return true; + } + + if (isImmutable(value) && value.isEmpty()) { + return true; + } + + return false; +}; +;// CONCATENATED MODULE: ./src/core/system.js + + + + + + + + + + + + +const idFn = (a) => a; + +// Apply middleware that gets sandwitched between `dispatch` and the reducer function(s) +function createStoreWithMiddleware(rootReducer, initialState, getSystem) { + + let middlwares = [ + // createLogger( { + // stateTransformer: state => state && state.toJS() + // } ), + systemThunkMiddleware(getSystem)]; + + + const composeEnhancers = core_window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || external_redux_namespaceObject.compose; + + return (0,external_redux_namespaceObject.createStore)(rootReducer, initialState, composeEnhancers( + (0,external_redux_namespaceObject.applyMiddleware)(...middlwares) + )); +} + +class Store { + + constructor() {let opts = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; + deep_extend_default()(this, { + state: {}, + plugins: [], + pluginsOptions: {}, + system: { + configs: {}, + fn: {}, + components: {}, + rootInjects: {}, + statePlugins: {} + }, + boundSystem: {}, + toolbox: {} + }, opts); + + this.getSystem = this._getSystem.bind(this); + + // Bare system (nothing in it, besides the state) + this.store = configureStore(idFn, (0,external_immutable_namespaceObject.fromJS)(this.state), this.getSystem); + + // will be the system + Im, we can add more tools when we need to + this.buildSystem(false); + + // Bootstrap plugins + this.register(this.plugins); + } + + getStore() { + return this.store; + } + + register(plugins) {let rebuild = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + var pluginSystem = combinePlugins(plugins, this.getSystem(), this.pluginsOptions); + systemExtend(this.system, pluginSystem); + if (rebuild) { + this.buildSystem(); + } + + const needAnotherRebuild = callAfterLoad.call(this.system, plugins, this.getSystem()); + + if (needAnotherRebuild) { + this.buildSystem(); + } + } + + buildSystem() {let buildReducer = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true; + let dispatch = this.getStore().dispatch; + let getState = this.getStore().getState; + + this.boundSystem = Object.assign({}, + this.getRootInjects(), + this.getWrappedAndBoundActions(dispatch), + this.getWrappedAndBoundSelectors(getState, this.getSystem), + this.getStateThunks(getState), + this.getFn(), + this.getConfigs() + ); + + if (buildReducer) + this.rebuildReducer(); + } + + _getSystem() { + return this.boundSystem; + } + + getRootInjects() { + return Object.assign({ + getSystem: this.getSystem, + getStore: this.getStore.bind(this), + getComponents: this.getComponents.bind(this), + getState: this.getStore().getState, + getConfigs: this._getConfigs.bind(this), + Im: external_immutable_namespaceObject["default"], + React: external_react_namespaceObject["default"] + }, this.system.rootInjects || {}); + } + + _getConfigs() { + return this.system.configs; + } + + getConfigs() { + return { + configs: this.system.configs + }; + } + + setConfigs(configs) { + this.system.configs = configs; + } + + rebuildReducer() { + this.store.replaceReducer(buildReducer(this.system.statePlugins)); + } + + /** + * Generic getter from system.statePlugins + * + */ + getType(name) { + let upName = name[0].toUpperCase() + name.slice(1); + return objReduce(this.system.statePlugins, (val, namespace) => { + let thing = val[name]; + if (thing) + return { [namespace + upName]: thing }; + }); + } + + getSelectors() { + return this.getType("selectors"); + } + + getActions() { + let actionHolders = this.getType("actions"); + + return objMap(actionHolders, (actions) => { + return objReduce(actions, (action, actionName) => { + if (isFn(action)) + return { [actionName]: action }; + }); + }); + } + + getWrappedAndBoundActions(dispatch) {var _this = this; + let actionGroups = this.getBoundActions(dispatch); + return objMap(actionGroups, (actions, actionGroupName) => { + let wrappers = this.system.statePlugins[actionGroupName.slice(0, -7)].wrapActions; + if (wrappers) { + return objMap(actions, (action, actionName) => { + let wrap = wrappers[actionName]; + if (!wrap) { + return action; + } + + if (!Array.isArray(wrap)) { + wrap = [wrap]; + } + return wrap.reduce((acc, fn) => { + let newAction = function () { + return fn(acc, _this.getSystem())(...arguments); + }; + if (!isFn(newAction)) { + throw new TypeError("wrapActions needs to return a function that returns a new function (ie the wrapped action)"); + } + return wrapWithTryCatch(newAction); + }, action || Function.prototype); + }); + } + return actions; + }); + } + + getWrappedAndBoundSelectors(getState, getSystem) {var _this2 = this; + let selectorGroups = this.getBoundSelectors(getState, getSystem); + return objMap(selectorGroups, (selectors, selectorGroupName) => { + let stateName = [selectorGroupName.slice(0, -9)]; // selectors = 9 chars + let wrappers = this.system.statePlugins[stateName].wrapSelectors; + if (wrappers) { + return objMap(selectors, (selector, selectorName) => { + let wrap = wrappers[selectorName]; + if (!wrap) { + return selector; + } + + if (!Array.isArray(wrap)) { + wrap = [wrap]; + } + return wrap.reduce((acc, fn) => { + let wrappedSelector = function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];} + return fn(acc, _this2.getSystem())(getState().getIn(stateName), ...args); + }; + if (!isFn(wrappedSelector)) { + throw new TypeError("wrapSelector needs to return a function that returns a new function (ie the wrapped action)"); + } + return wrappedSelector; + }, selector || Function.prototype); + }); + } + return selectors; + }); + } + + getStates(state) { + return Object.keys(this.system.statePlugins).reduce((obj, key) => { + obj[key] = state.get(key); + return obj; + }, {}); + } + + getStateThunks(getState) { + return Object.keys(this.system.statePlugins).reduce((obj, key) => { + obj[key] = () => getState().get(key); + return obj; + }, {}); + } + + getFn() { + return { + fn: this.system.fn + }; + } + + getComponents(component) { + const res = this.system.components[component]; + + if (Array.isArray(res)) { + return res.reduce((ori, wrapper) => { + return wrapper(ori, this.getSystem()); + }); + } + if (typeof component !== "undefined") { + return this.system.components[component]; + } + + return this.system.components; + } + + getBoundSelectors(getState, getSystem) { + return objMap(this.getSelectors(), (obj, key) => { + let stateName = [key.slice(0, -9)]; // selectors = 9 chars + const getNestedState = () => getState().getIn(stateName); + + return objMap(obj, (fn) => { + return function () {for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];} + let res = wrapWithTryCatch(fn).apply(null, [getNestedState(), ...args]); + + // If a selector returns a function, give it the system - for advanced usage + if (typeof res === "function") + res = wrapWithTryCatch(res)(getSystem()); + + return res; + }; + }); + }); + } + + getBoundActions(dispatch) { + + dispatch = dispatch || this.getStore().dispatch; + + const actions = this.getActions(); + + const process = (creator) => { + if (typeof creator !== "function") { + return objMap(creator, (prop) => process(prop)); + } + + return function () { + var action = null; + try { + action = creator(...arguments); + } + catch (e) { + action = { type: NEW_THROWN_ERR, error: true, payload: (0,external_serialize_error_namespaceObject.serializeError)(e) }; + } finally + { + return action; // eslint-disable-line no-unsafe-finally + } + }; + + }; + return objMap(actions, (actionCreator) => (0,external_redux_namespaceObject.bindActionCreators)(process(actionCreator), dispatch)); + } + + getMapStateToProps() { + return () => { + return Object.assign({}, this.getSystem()); + }; + } + + getMapDispatchToProps(extras) { + return (dispatch) => { + return deep_extend_default()({}, this.getWrappedAndBoundActions(dispatch), this.getFn(), extras); + }; + } + +} + +function combinePlugins(plugins, toolbox, pluginOptions) { + if (isObject(plugins) && !isArray(plugins)) { + return (0,merge_namespaceObject["default"])({}, plugins); + } + + if (isFunc(plugins)) { + return combinePlugins(plugins(toolbox), toolbox, pluginOptions); + } + + if (isArray(plugins)) { + const dest = pluginOptions.pluginLoadType === "chain" ? toolbox.getComponents() : {}; + + return plugins. + map((plugin) => combinePlugins(plugin, toolbox, pluginOptions)). + reduce(systemExtend, dest); + } + + return {}; +} + +function callAfterLoad(plugins, system) {let { hasLoaded } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + let calledSomething = hasLoaded; + if (isObject(plugins) && !isArray(plugins)) { + if (typeof plugins.afterLoad === "function") { + calledSomething = true; + wrapWithTryCatch(plugins.afterLoad).call(this, system); + } + } + + if (isFunc(plugins)) + return callAfterLoad.call(this, plugins(system), system, { hasLoaded: calledSomething }); + + if (isArray(plugins)) { + return plugins.map((plugin) => callAfterLoad.call(this, plugin, system, { hasLoaded: calledSomething })); + } + + return calledSomething; +} + +// Wraps deepExtend, to account for certain fields, being wrappers. +// Ie: we need to convert some fields into arrays, and append to them. +// Rather than overwrite +function systemExtend() {let dest = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};let src = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + + if (!isObject(dest)) { + return {}; + } + if (!isObject(src)) { + return dest; + } + + // Wrap components + // Parses existing components in the system, and prepares them for wrapping via getComponents + if (src.wrapComponents) { + objMap(src.wrapComponents, (wrapperFn, key) => { + const ori = dest.components && dest.components[key]; + if (ori && Array.isArray(ori)) { + dest.components[key] = ori.concat([wrapperFn]); + delete src.wrapComponents[key]; + } else if (ori) { + dest.components[key] = [ori, wrapperFn]; + delete src.wrapComponents[key]; + } + }); + + if (!Object.keys(src.wrapComponents).length) { + // only delete wrapComponents if we've matched all of our wrappers to components + // this handles cases where the component to wrap may be out of our scope, + // but a higher recursive `combinePlugins` call will be able to handle it. + delete src.wrapComponents; + } + } + + + // Account for wrapActions, make it an array and append to it + // Modifies `src` + // 80% of this code is just safe traversal. We need to address that ( ie: use a lib ) + const { statePlugins } = dest; + if (isObject(statePlugins)) { + for (let namespace in statePlugins) { + const namespaceObj = statePlugins[namespace]; + if (!isObject(namespaceObj)) { + continue; + } + + const { wrapActions, wrapSelectors } = namespaceObj; + + // process action wrapping + if (isObject(wrapActions)) { + for (let actionName in wrapActions) { + let action = wrapActions[actionName]; + + // This should only happen if dest is the first plugin, since invocations after that will ensure its an array + if (!Array.isArray(action)) { + action = [action]; + wrapActions[actionName] = action; // Put the value inside an array + } + + if (src && src.statePlugins && src.statePlugins[namespace] && src.statePlugins[namespace].wrapActions && src.statePlugins[namespace].wrapActions[actionName]) { + src.statePlugins[namespace].wrapActions[actionName] = wrapActions[actionName].concat(src.statePlugins[namespace].wrapActions[actionName]); + } + + } + } + + // process selector wrapping + if (isObject(wrapSelectors)) { + for (let selectorName in wrapSelectors) { + let selector = wrapSelectors[selectorName]; + + // This should only happen if dest is the first plugin, since invocations after that will ensure its an array + if (!Array.isArray(selector)) { + selector = [selector]; + wrapSelectors[selectorName] = selector; // Put the value inside an array + } + + if (src && src.statePlugins && src.statePlugins[namespace] && src.statePlugins[namespace].wrapSelectors && src.statePlugins[namespace].wrapSelectors[selectorName]) { + src.statePlugins[namespace].wrapSelectors[selectorName] = wrapSelectors[selectorName].concat(src.statePlugins[namespace].wrapSelectors[selectorName]); + } + + } + } + } + } + + return deep_extend_default()(dest, src); +} + +function buildReducer(states) { + let reducerObj = objMap(states, (val) => { + return val.reducers; + }); + return allReducers(reducerObj); +} + +function allReducers(reducerSystem) { + let reducers = Object.keys(reducerSystem).reduce((obj, key) => { + obj[key] = makeReducer(reducerSystem[key]); + return obj; + }, {}); + + if (!Object.keys(reducers).length) { + return idFn; + } + + return (0,external_redux_immutable_namespaceObject.combineReducers)(reducers); +} + +function makeReducer(reducerObj) { + return function () {let state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : new external_immutable_namespaceObject.Map();let action = arguments.length > 1 ? arguments[1] : undefined; + if (!reducerObj) + return state; + + let redFn = reducerObj[action.type]; + if (redFn) { + const res = wrapWithTryCatch(redFn)(state, action); + // If the try/catch wrapper kicks in, we'll get null back... + // in that case, we want to avoid making any changes to state + return res === null ? state : res; + } + return state; + }; +} + +function wrapWithTryCatch(fn) + +{let { logErrors = true } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + if (typeof fn !== "function") { + return fn; + } + + return function () { + try {for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {args[_key3] = arguments[_key3];} + return fn.call(this, ...args); + } catch (e) { + if (logErrors) { + console.error(e); + } + return null; + } + }; +} + +function configureStore(rootReducer, initialState, getSystem) { + const store = createStoreWithMiddleware(rootReducer, initialState, getSystem); + + // if (module.hot) { + // // Enable Webpack hot module replacement for reducers + // module.hot.accept("reducers/index", () => { + // const nextRootReducer = require("reducers/index") + // store.replaceReducer(nextRootReducer) + // }) + // } + + return store; +} +;// CONCATENATED MODULE: external "url-parse" +var external_url_parse_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_url_parse_y = x => () => x +const external_url_parse_namespaceObject = external_url_parse_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_url_parse_6456105f__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/auth/actions.js + + + + +const SHOW_AUTH_POPUP = "show_popup"; +const AUTHORIZE = "authorize"; +const LOGOUT = "logout"; +const PRE_AUTHORIZE_OAUTH2 = "pre_authorize_oauth2"; +const AUTHORIZE_OAUTH2 = "authorize_oauth2"; +const VALIDATE = "validate"; +const CONFIGURE_AUTH = "configure_auth"; +const RESTORE_AUTHORIZATION = "restore_authorization"; + +const scopeSeparator = " "; + +function showDefinitions(payload) { + return { + type: SHOW_AUTH_POPUP, + payload: payload + }; +} + +function authorize(payload) { + return { + type: AUTHORIZE, + payload: payload + }; +} + +const authorizeWithPersistOption = (payload) => (_ref) => {let { authActions } = _ref; + authActions.authorize(payload); + authActions.persistAuthorizationIfNeeded(); +}; + +function logout(payload) { + return { + type: LOGOUT, + payload: payload + }; +} + +const logoutWithPersistOption = (payload) => (_ref2) => {let { authActions } = _ref2; + authActions.logout(payload); + authActions.persistAuthorizationIfNeeded(); +}; + +const preAuthorizeImplicit = (payload) => (_ref3) => {let { authActions, errActions } = _ref3; + let { auth, token, isValid } = payload; + let { schema, name } = auth; + let flow = schema.get("flow"); + + // remove oauth2 property from window after redirect from authentication + delete core_window.swaggerUIRedirectOauth2; + + if (flow !== "accessCode" && !isValid) { + errActions.newAuthErr({ + authId: name, + source: "auth", + level: "warning", + message: "Authorization may be unsafe, passed state was changed in server Passed state wasn't returned from auth server" + }); + } + + if (token.error) { + errActions.newAuthErr({ + authId: name, + source: "auth", + level: "error", + message: JSON.stringify(token) + }); + return; + } + + authActions.authorizeOauth2WithPersistOption({ auth, token }); +}; + + +function authorizeOauth2(payload) { + return { + type: AUTHORIZE_OAUTH2, + payload: payload + }; +} + + +const authorizeOauth2WithPersistOption = (payload) => (_ref4) => {let { authActions } = _ref4; + authActions.authorizeOauth2(payload); + authActions.persistAuthorizationIfNeeded(); +}; + +const authorizePassword = (auth) => (_ref5) => {let { authActions } = _ref5; + let { schema, name, username, password, passwordType, clientId, clientSecret } = auth; + let form = { + grant_type: "password", + scope: auth.scopes.join(scopeSeparator), + username, + password + }; + let query = {}; + let headers = {}; + + switch (passwordType) { + case "request-body": + setClientIdAndSecret(form, clientId, clientSecret); + break; + + case "basic": + headers.Authorization = "Basic " + btoa(clientId + ":" + clientSecret); + break; + default: + console.warn(`Warning: invalid passwordType ${passwordType} was passed, not including client id and secret`); + } + + return authActions.authorizeRequest({ body: buildFormData(form), url: schema.get("tokenUrl"), name, headers, query, auth }); +}; + +function setClientIdAndSecret(target, clientId, clientSecret) { + if (clientId) { + Object.assign(target, { client_id: clientId }); + } + + if (clientSecret) { + Object.assign(target, { client_secret: clientSecret }); + } +} + +const authorizeApplication = (auth) => (_ref6) => {let { authActions } = _ref6; + let { schema, scopes, name, clientId, clientSecret } = auth; + let headers = { + Authorization: "Basic " + btoa(clientId + ":" + clientSecret) + }; + let form = { + grant_type: "client_credentials", + scope: scopes.join(scopeSeparator) + }; + + return authActions.authorizeRequest({ body: buildFormData(form), name, url: schema.get("tokenUrl"), auth, headers }); +}; + +const authorizeAccessCodeWithFormParams = (_ref7) => {let { auth, redirectUrl } = _ref7;return (_ref8) => {let { authActions } = _ref8; + let { schema, name, clientId, clientSecret, codeVerifier } = auth; + let form = { + grant_type: "authorization_code", + code: auth.code, + client_id: clientId, + client_secret: clientSecret, + redirect_uri: redirectUrl, + code_verifier: codeVerifier + }; + + return authActions.authorizeRequest({ body: buildFormData(form), name, url: schema.get("tokenUrl"), auth }); + };}; + +const authorizeAccessCodeWithBasicAuthentication = (_ref9) => {let { auth, redirectUrl } = _ref9;return (_ref10) => {let { authActions } = _ref10; + let { schema, name, clientId, clientSecret, codeVerifier } = auth; + let headers = { + Authorization: "Basic " + btoa(clientId + ":" + clientSecret) + }; + let form = { + grant_type: "authorization_code", + code: auth.code, + client_id: clientId, + redirect_uri: redirectUrl, + code_verifier: codeVerifier + }; + + return authActions.authorizeRequest({ body: buildFormData(form), name, url: schema.get("tokenUrl"), auth, headers }); + };}; + +const authorizeRequest = (data) => (_ref11) => {let { fn, getConfigs, authActions, errActions, oas3Selectors, specSelectors, authSelectors } = _ref11; + let { body, query = {}, headers = {}, name, url, auth } = data; + + let { additionalQueryStringParams } = authSelectors.getConfigs() || {}; + + let parsedUrl; + + if (specSelectors.isOAS3()) { + let finalServerUrl = oas3Selectors.serverEffectiveValue(oas3Selectors.selectedServer()); + parsedUrl = (0,external_url_parse_namespaceObject["default"])(url, finalServerUrl, true); + } else { + parsedUrl = (0,external_url_parse_namespaceObject["default"])(url, specSelectors.url(), true); + } + + if (typeof additionalQueryStringParams === "object") { + parsedUrl.query = Object.assign({}, parsedUrl.query, additionalQueryStringParams); + } + + const fetchUrl = parsedUrl.toString(); + + let _headers = Object.assign({ + "Accept": "application/json, text/plain, */*", + "Content-Type": "application/x-www-form-urlencoded", + "X-Requested-With": "XMLHttpRequest" + }, headers); + + fn.fetch({ + url: fetchUrl, + method: "post", + headers: _headers, + query: query, + body: body, + requestInterceptor: getConfigs().requestInterceptor, + responseInterceptor: getConfigs().responseInterceptor + }). + then(function (response) { + let token = JSON.parse(response.data); + let error = token && (token.error || ""); + let parseError = token && (token.parseError || ""); + + if (!response.ok) { + errActions.newAuthErr({ + authId: name, + level: "error", + source: "auth", + message: response.statusText + }); + return; + } + + if (error || parseError) { + errActions.newAuthErr({ + authId: name, + level: "error", + source: "auth", + message: JSON.stringify(token) + }); + return; + } + + authActions.authorizeOauth2WithPersistOption({ auth, token }); + }). + catch((e) => { + let err = new Error(e); + let message = err.message; + // swagger-js wraps the response (if available) into the e.response property; + // investigate to check whether there are more details on why the authorization + // request failed (according to RFC 6479). + // See also https://github.com/swagger-api/swagger-ui/issues/4048 + if (e.response && e.response.data) { + const errData = e.response.data; + try { + const jsonResponse = typeof errData === "string" ? JSON.parse(errData) : errData; + if (jsonResponse.error) + message += `, error: ${jsonResponse.error}`; + if (jsonResponse.error_description) + message += `, description: ${jsonResponse.error_description}`; + } catch (jsonError) { + + // Ignore + }} + errActions.newAuthErr({ + authId: name, + level: "error", + source: "auth", + message: message + }); + }); +}; + +function configureAuth(payload) { + return { + type: CONFIGURE_AUTH, + payload: payload + }; +} + +function restoreAuthorization(payload) { + return { + type: RESTORE_AUTHORIZATION, + payload: payload + }; +} + +const persistAuthorizationIfNeeded = () => (_ref12) => {let { authSelectors, getConfigs } = _ref12; + const configs = getConfigs(); + + if (!configs.persistAuthorization) return; + + // persist authorization to local storage + const authorized = authSelectors.authorized().toJS(); + localStorage.setItem("authorized", JSON.stringify(authorized)); +}; + +const authPopup = (url, swaggerUIRedirectOauth2) => () => { + core_window.swaggerUIRedirectOauth2 = swaggerUIRedirectOauth2; + + core_window.open(url); +}; +;// CONCATENATED MODULE: ./src/core/plugins/auth/reducers.js + + + + + + +/* harmony default export */ const reducers = ({ + [SHOW_AUTH_POPUP]: (state, _ref) => {let { payload } = _ref; + return state.set("showDefinitions", payload); + }, + + [AUTHORIZE]: (state, _ref2) => {let { payload } = _ref2; + let securities = (0,external_immutable_namespaceObject.fromJS)(payload); + let map = state.get("authorized") || (0,external_immutable_namespaceObject.Map)(); + + // refactor withMutations + securities.entrySeq().forEach((_ref3) => {let [key, security] = _ref3; + if (!isFunc(security.getIn)) { + return state.set("authorized", map); + } + let type = security.getIn(["schema", "type"]); + + if (type === "apiKey" || type === "http") { + map = map.set(key, security); + } else if (type === "basic") { + let username = security.getIn(["value", "username"]); + let password = security.getIn(["value", "password"]); + + map = map.setIn([key, "value"], { + username: username, + header: "Basic " + btoa(username + ":" + password) + }); + + map = map.setIn([key, "schema"], security.get("schema")); + } + }); + + return state.set("authorized", map); + }, + + [AUTHORIZE_OAUTH2]: (state, _ref4) => {let { payload } = _ref4; + let { auth, token } = payload; + let parsedAuth; + + auth.token = Object.assign({}, token); + parsedAuth = (0,external_immutable_namespaceObject.fromJS)(auth); + + let map = state.get("authorized") || (0,external_immutable_namespaceObject.Map)(); + map = map.set(parsedAuth.get("name"), parsedAuth); + + return state.set("authorized", map); + }, + + [LOGOUT]: (state, _ref5) => {let { payload } = _ref5; + let result = state.get("authorized").withMutations((authorized) => { + payload.forEach((auth) => { + authorized.delete(auth); + }); + }); + + return state.set("authorized", result); + }, + + [CONFIGURE_AUTH]: (state, _ref6) => {let { payload } = _ref6; + return state.set("configs", payload); + }, + + [RESTORE_AUTHORIZATION]: (state, _ref7) => {let { payload } = _ref7; + return state.set("authorized", (0,external_immutable_namespaceObject.fromJS)(payload.authorized)); + } +}); +;// CONCATENATED MODULE: external "reselect" +var external_reselect_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_reselect_y = x => () => x +const external_reselect_namespaceObject = external_reselect_x({ ["createSelector"]: () => __WEBPACK_EXTERNAL_MODULE_reselect__.createSelector }); +;// CONCATENATED MODULE: ./src/core/plugins/auth/selectors.js + + + +const state = (state) => state; + +const shownDefinitions = (0,external_reselect_namespaceObject.createSelector)( + state, + (auth) => auth.get("showDefinitions") +); + +const definitionsToAuthorize = (0,external_reselect_namespaceObject.createSelector)( + state, + () => (_ref) => {let { specSelectors } = _ref; + let definitions = specSelectors.securityDefinitions() || (0,external_immutable_namespaceObject.Map)({}); + let list = (0,external_immutable_namespaceObject.List)(); + + //todo refactor + definitions.entrySeq().forEach((_ref2) => {let [key, val] = _ref2; + let map = (0,external_immutable_namespaceObject.Map)(); + + map = map.set(key, val); + list = list.push(map); + }); + + return list; + } +); + + +const getDefinitionsByNames = (state, securities) => (_ref3) => {let { specSelectors } = _ref3; + console.warn("WARNING: getDefinitionsByNames is deprecated and will be removed in the next major version."); + let securityDefinitions = specSelectors.securityDefinitions(); + let result = (0,external_immutable_namespaceObject.List)(); + + securities.valueSeq().forEach((names) => { + let map = (0,external_immutable_namespaceObject.Map)(); + names.entrySeq().forEach((_ref4) => {let [name, scopes] = _ref4; + let definition = securityDefinitions.get(name); + let allowedScopes; + + if (definition.get("type") === "oauth2" && scopes.size) { + allowedScopes = definition.get("scopes"); + + allowedScopes.keySeq().forEach((key) => { + if (!scopes.contains(key)) { + allowedScopes = allowedScopes.delete(key); + } + }); + + definition = definition.set("allowedScopes", allowedScopes); + } + + map = map.set(name, definition); + }); + + result = result.push(map); + }); + + return result; +}; + +const definitionsForRequirements = function (state) {let securities = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : (0,external_immutable_namespaceObject.List)();return (_ref5) => {let { authSelectors } = _ref5; + const allDefinitions = authSelectors.definitionsToAuthorize() || (0,external_immutable_namespaceObject.List)(); + let result = (0,external_immutable_namespaceObject.List)(); + allDefinitions.forEach((definition) => { + let security = securities.find((sec) => sec.get(definition.keySeq().first())); + if (security) { + definition.forEach((props, name) => { + if (props.get("type") === "oauth2") { + const securityScopes = security.get(name); + let definitionScopes = props.get("scopes"); + if (external_immutable_namespaceObject.List.isList(securityScopes) && external_immutable_namespaceObject.Map.isMap(definitionScopes)) { + definitionScopes.keySeq().forEach((key) => { + if (!securityScopes.contains(key)) { + definitionScopes = definitionScopes.delete(key); + } + }); + definition = definition.set(name, props.set("scopes", definitionScopes)); + } + } + }); + result = result.push(definition); + } + }); + return result; + };}; + +const authorized = (0,external_reselect_namespaceObject.createSelector)( + state, + (auth) => auth.get("authorized") || (0,external_immutable_namespaceObject.Map)() +); + + +const isAuthorized = (state, securities) => (_ref6) => {let { authSelectors } = _ref6; + let authorized = authSelectors.authorized(); + + if (!external_immutable_namespaceObject.List.isList(securities)) { + return null; + } + + return !!securities.toJS().filter((security) => { + let isAuthorized = true; + + return Object.keys(security).map((key) => { + return !isAuthorized || !!authorized.get(key); + }).indexOf(false) === -1; + }).length; +}; + +const getConfigs = (0,external_reselect_namespaceObject.createSelector)( + state, + (auth) => auth.get("configs") +); +;// CONCATENATED MODULE: external "@babel/runtime-corejs3/helpers/objectSpread2" +var objectSpread2_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var objectSpread2_y = x => () => x +const objectSpread2_namespaceObject = objectSpread2_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_objectSpread2_89fd8f56__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/auth/spec-extensions/wrap-actions.js + // Add security to the final `execute` call ( via `extras` ) +const execute = (oriAction, _ref) => {let { authSelectors, specSelectors } = _ref;return (_ref2) => {let { path, method, operation, extras } = _ref2; + let securities = { + authorized: authSelectors.authorized() && authSelectors.authorized().toJS(), + definitions: specSelectors.securityDefinitions() && specSelectors.securityDefinitions().toJS(), + specSecurity: specSelectors.security() && specSelectors.security().toJS() + }; + + return oriAction((0,objectSpread2_namespaceObject["default"])({ path, method, operation, securities }, extras)); + };}; +;// CONCATENATED MODULE: ./src/core/plugins/auth/configs-extensions/wrap-actions.js +/** + * @prettier + */ +const loaded = (oriAction, system) => (payload) => { + const { getConfigs, authActions } = system; + const configs = getConfigs(); + + oriAction(payload); + + // check if we should restore authorization data from localStorage + if (configs.persistAuthorization) { + const authorized = localStorage.getItem("authorized"); + if (authorized) { + authActions.restoreAuthorization({ + authorized: JSON.parse(authorized) + }); + } + } +}; +;// CONCATENATED MODULE: ./src/core/plugins/auth/wrap-actions.js +/** + * @prettier + */ + +/** + * `authorize` and `logout` wrapped actions provide capacity + * to persist cookie based apiKey in document.cookie. + * + * `persistAuthorization` SwaggerUI options needs to set to `true` + * for document.cookie persistence to work. + */ +const wrap_actions_authorize = (oriAction, system) => (payload) => { + oriAction(payload); + + const configs = system.getConfigs(); + + if (!configs.persistAuthorization) return; + + // create cookie + try { + const [{ schema, value }] = Object.values(payload); + const isApiKeyAuth = schema.get("type") === "apiKey"; + const isInCookie = schema.get("in") === "cookie"; + const isApiKeyInCookie = isApiKeyAuth && isInCookie; + + if (isApiKeyInCookie) { + document.cookie = `${schema.get("name")}=${value}; SameSite=None; Secure`; + } + } catch (error) { + console.error( + "Error persisting cookie based apiKey in document.cookie.", + error + ); + } +}; + +const wrap_actions_logout = (oriAction, system) => (payload) => { + const configs = system.getConfigs(); + const authorized = system.authSelectors.authorized(); + + // deleting cookie + try { + if (configs.persistAuthorization && Array.isArray(payload)) { + payload.forEach((authorizedName) => { + const auth = authorized.get(authorizedName, {}); + const isApiKeyAuth = auth.getIn(["schema", "type"]) === "apiKey"; + const isInCookie = auth.getIn(["schema", "in"]) === "cookie"; + const isApiKeyInCookie = isApiKeyAuth && isInCookie; + + if (isApiKeyInCookie) { + const cookieName = auth.getIn(["schema", "name"]); + document.cookie = `${cookieName}=; Max-Age=-99999999`; + } + }); + } + } catch (error) { + console.error( + "Error deleting cookie based apiKey from document.cookie.", + error + ); + } + + oriAction(payload); +}; +;// CONCATENATED MODULE: external "prop-types" +var external_prop_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_prop_types_y = x => () => x +const external_prop_types_namespaceObject = external_prop_types_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_prop_types_adfe8e31__["default"] }); +;// CONCATENATED MODULE: external "lodash/omit" +var omit_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var omit_y = x => () => x +const omit_namespaceObject = omit_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_omit_d930e0f3__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/auth/components/lock-auth-icon.jsx +/** + * @prettier + */ + + + + +class LockAuthIcon extends external_react_namespaceObject["default"].Component { + mapStateToProps(state, props) { + const ownProps = (0,omit_namespaceObject["default"])(props, Object.keys(props.getSystem())); + return { state, ownProps }; + } + + render() { + const { getComponent, ownProps } = this.props; + const LockIcon = getComponent("LockIcon"); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(LockIcon, ownProps); + } +} + + + + + + +/* harmony default export */ const lock_auth_icon = (LockAuthIcon); +;// CONCATENATED MODULE: ./src/core/plugins/auth/components/unlock-auth-icon.jsx +/** + * @prettier + */ + + + + +class UnlockAuthIcon extends external_react_namespaceObject["default"].Component { + mapStateToProps(state, props) { + const ownProps = (0,omit_namespaceObject["default"])(props, Object.keys(props.getSystem())); + return { state, ownProps }; + } + + render() { + const { getComponent, ownProps } = this.props; + const UnlockIcon = getComponent("UnlockIcon"); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(UnlockIcon, ownProps); + } +} + + + + + + +/* harmony default export */ const unlock_auth_icon = (UnlockAuthIcon); +;// CONCATENATED MODULE: ./src/core/plugins/auth/index.js + + + + + + + + + + +/* harmony default export */ function auth() { + return { + afterLoad(system) { + this.rootInjects = this.rootInjects || {}; + this.rootInjects.initOAuth = system.authActions.configureAuth; + this.rootInjects.preauthorizeApiKey = preauthorizeApiKey.bind(null, system); + this.rootInjects.preauthorizeBasic = preauthorizeBasic.bind(null, system); + }, + components: { + LockAuthIcon: lock_auth_icon, + UnlockAuthIcon: unlock_auth_icon, + LockAuthOperationIcon: lock_auth_icon, + UnlockAuthOperationIcon: unlock_auth_icon + }, + statePlugins: { + auth: { + reducers: reducers, + actions: auth_actions_namespaceObject, + selectors: selectors_namespaceObject, + wrapActions: { + authorize: wrap_actions_authorize, + logout: wrap_actions_logout + } + }, + configs: { + wrapActions: { + loaded: loaded + } + }, + spec: { + wrapActions: { + execute: execute + } + } + } + }; +} + +function preauthorizeBasic(system, key, username, password) { + const { + authActions: { authorize }, + specSelectors: { specJson, isOAS3 } + } = system; + + const definitionBase = isOAS3() ? ["components", "securitySchemes"] : ["securityDefinitions"]; + + const schema = specJson().getIn([...definitionBase, key]); + + if (!schema) { + return null; + } + + return authorize({ + [key]: { + value: { + username, + password + }, + schema: schema.toJS() + } + }); +} + +function preauthorizeApiKey(system, key, value) { + const { + authActions: { authorize }, + specSelectors: { specJson, isOAS3 } + } = system; + + const definitionBase = isOAS3() ? ["components", "securitySchemes"] : ["securityDefinitions"]; + + const schema = specJson().getIn([...definitionBase, key]); + + if (!schema) { + return null; + } + + return authorize({ + [key]: { + value, + schema: schema.toJS() + } + }); +} +;// CONCATENATED MODULE: ./swagger-config.yaml +const swagger_config_namespaceObject = "---\nurl: \"https://petstore.swagger.io/v2/swagger.json\"\ndom_id: \"#swagger-ui\"\nvalidatorUrl: \"https://validator.swagger.io/validator\"\n"; +;// CONCATENATED MODULE: external "js-yaml" +var external_js_yaml_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_js_yaml_y = x => () => x +const external_js_yaml_namespaceObject = external_js_yaml_x({ ["JSON_SCHEMA"]: () => __WEBPACK_EXTERNAL_MODULE_js_yaml_78384032__.JSON_SCHEMA, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_js_yaml_78384032__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/configs/helpers.js + + +const parseYamlConfig = (yaml, system) => { + try { + return external_js_yaml_namespaceObject["default"].load(yaml); + } catch (e) { + if (system) { + system.errActions.newThrownErr(new Error(e)); + } + return {}; + } +}; +;// CONCATENATED MODULE: ./src/core/plugins/configs/actions.js +const UPDATE_CONFIGS = "configs_update"; +const TOGGLE_CONFIGS = "configs_toggle"; + +// Update the configs, with a merge ( not deep ) +function update(configName, configValue) { + return { + type: UPDATE_CONFIGS, + payload: { + [configName]: configValue + } + }; +} + +// Toggle's the config, by name +function toggle(configName) { + return { + type: TOGGLE_CONFIGS, + payload: configName + }; +} + + +// Hook +const actions_loaded = () => () => { + + // noop +}; +;// CONCATENATED MODULE: ./src/core/plugins/configs/spec-actions.js + + +const downloadConfig = (req) => (system) => { + const { fn: { fetch } } = system; + + return fetch(req); +}; + +const getConfigByUrl = (req, cb) => (_ref) => {let { specActions } = _ref; + if (req) { + return specActions.downloadConfig(req).then(next, next); + } + + function next(res) { + if (res instanceof Error || res.status >= 400) { + specActions.updateLoadingStatus("failedConfig"); + specActions.updateLoadingStatus("failedConfig"); + specActions.updateUrl(""); + console.error(res.statusText + " " + req.url); + cb(null); + } else { + cb(parseYamlConfig(res.text)); + } + } +}; +;// CONCATENATED MODULE: ./src/core/plugins/configs/selectors.js +// Just get the config value ( it can possibly be an immutable object) +const get = (state, path) => { + return state.getIn(Array.isArray(path) ? path : [path]); +}; +;// CONCATENATED MODULE: ./src/core/plugins/configs/reducers.js + + + + + +/* harmony default export */ const configs_reducers = ({ + + [UPDATE_CONFIGS]: (state, action) => { + return state.merge((0,external_immutable_namespaceObject.fromJS)(action.payload)); + }, + + [TOGGLE_CONFIGS]: (state, action) => { + const configName = action.payload; + const oriVal = state.get(configName); + return state.set(configName, !oriVal); + } + +}); +;// CONCATENATED MODULE: ./src/core/plugins/configs/index.js + + + + + + + +const specSelectors = { + getLocalConfig: () => { + return parseYamlConfig(swagger_config_namespaceObject); + } +}; + + +function configsPlugin() { + + return { + statePlugins: { + spec: { + actions: spec_actions_namespaceObject, + selectors: specSelectors + }, + configs: { + reducers: configs_reducers, + actions: configs_actions_namespaceObject, + selectors: configs_selectors_namespaceObject + } + } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/deep-linking/helpers.js +const setHash = (value) => { + if (value) { + return history.pushState(null, null, `#${value}`); + } else { + return window.location.hash = ""; + } +}; +;// CONCATENATED MODULE: external "zenscroll" +var external_zenscroll_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_zenscroll_y = x => () => x +const external_zenscroll_namespaceObject = external_zenscroll_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_zenscroll__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/deep-linking/layout.js + + + + + +const SCROLL_TO = "layout_scroll_to"; +const CLEAR_SCROLL_TO = "layout_clear_scroll"; + +const show = (ori, _ref) => {let { getConfigs, layoutSelectors } = _ref;return function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];} + ori(...args); + + if (!getConfigs().deepLinking) { + return; + } + + try { + let [tokenArray, shown] = args; + //Coerce in to array + tokenArray = Array.isArray(tokenArray) ? tokenArray : [tokenArray]; + // Convert into something we can put in the URL hash + // Or return empty, if we cannot + const urlHashArray = layoutSelectors.urlHashArrayFromIsShownKey(tokenArray); // Will convert + + // No hash friendly list? + if (!urlHashArray.length) + return; + + const [type, assetName] = urlHashArray; + + if (!shown) { + return setHash("/"); + } + + if (urlHashArray.length === 2) { + setHash(createDeepLinkPath(`/${encodeURIComponent(type)}/${encodeURIComponent(assetName)}`)); + } else if (urlHashArray.length === 1) { + setHash(createDeepLinkPath(`/${encodeURIComponent(type)}`)); + } + + } catch (e) { + // This functionality is not mission critical, so if something goes wrong + // we'll just move on + console.error(e); // eslint-disable-line no-console + } + };}; + +const scrollTo = (path) => { + return { + type: SCROLL_TO, + payload: Array.isArray(path) ? path : [path] + }; +}; + +const parseDeepLinkHash = (rawHash) => (_ref2) => {let { layoutActions, layoutSelectors, getConfigs } = _ref2; + + if (!getConfigs().deepLinking) { + return; + } + + if (rawHash) { + let hash = rawHash.slice(1); // # is first character + + + if (hash[0] === "!") { + // Parse UI 2.x shebangs + hash = hash.slice(1); + } + + if (hash[0] === "/") { + // "/pet/addPet" => "pet/addPet" + // makes the split result cleaner + // also handles forgotten leading slash + hash = hash.slice(1); + } + + const hashArray = hash.split("/").map((val) => val || ""); + + const isShownKey = layoutSelectors.isShownKeyFromUrlHashArray(hashArray); + + const [type, tagId = "", maybeOperationId = ""] = isShownKey; + + if (type === "operations") { + // we're going to show an operation, so we need to expand the tag as well + const tagIsShownKey = layoutSelectors.isShownKeyFromUrlHashArray([tagId]); + + // If an `_` is present, trigger the legacy escaping behavior to be safe + // TODO: remove this in v4.0, it is deprecated + if (tagId.indexOf("_") > -1) { + console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."); + layoutActions.show(tagIsShownKey.map((val) => val.replace(/_/g, " ")), true); + } + + layoutActions.show(tagIsShownKey, true); + } + + // If an `_` is present, trigger the legacy escaping behavior to be safe + // TODO: remove this in v4.0, it is deprecated + if (tagId.indexOf("_") > -1 || maybeOperationId.indexOf("_") > -1) { + console.warn("Warning: escaping deep link whitespace with `_` will be unsupported in v4.0, use `%20` instead."); + layoutActions.show(isShownKey.map((val) => val.replace(/_/g, " ")), true); + } + + layoutActions.show(isShownKey, true); + + // Scroll to the newly expanded entity + layoutActions.scrollTo(isShownKey); + } +}; + +const readyToScroll = (isShownKey, ref) => (system) => { + const scrollToKey = system.layoutSelectors.getScrollToKey(); + + if (external_immutable_namespaceObject["default"].is(scrollToKey, (0,external_immutable_namespaceObject.fromJS)(isShownKey))) { + system.layoutActions.scrollToElement(ref); + system.layoutActions.clearScrollTo(); + } +}; + +// Scroll to "ref" (dom node) with the scrollbar on "container" or the nearest parent +const scrollToElement = (ref, container) => (system) => { + try { + container = container || system.fn.getScrollParent(ref); + let myScroller = external_zenscroll_namespaceObject["default"].createScroller(container); + myScroller.to(ref); + } catch (e) { + console.error(e); // eslint-disable-line no-console + } +}; + +const clearScrollTo = () => { + return { + type: CLEAR_SCROLL_TO + }; +}; + +// From: https://stackoverflow.com/a/42543908/3933724 +// Modified to return html instead of body element as last resort +function getScrollParent(element, includeHidden) { + const LAST_RESORT = document.documentElement; + let style = getComputedStyle(element); + const excludeStaticParent = style.position === "absolute"; + const overflowRegex = includeHidden ? /(auto|scroll|hidden)/ : /(auto|scroll)/; + + if (style.position === "fixed") + return LAST_RESORT; + for (let parent = element; parent = parent.parentElement;) { + style = getComputedStyle(parent); + if (excludeStaticParent && style.position === "static") { + continue; + } + if (overflowRegex.test(style.overflow + style.overflowY + style.overflowX)) + return parent; + } + + return LAST_RESORT; +} + +/* harmony default export */ const layout = ({ + fn: { + getScrollParent + }, + statePlugins: { + layout: { + actions: { + scrollToElement, + scrollTo, + clearScrollTo, + readyToScroll, + parseDeepLinkHash + }, + selectors: { + getScrollToKey(state) { + return state.get("scrollToKey"); + }, + isShownKeyFromUrlHashArray(state, urlHashArray) { + const [tag, operationId] = urlHashArray; + // We only put operations in the URL + if (operationId) { + return ["operations", tag, operationId]; + } else if (tag) { + return ["operations-tag", tag]; + } + return []; + }, + urlHashArrayFromIsShownKey(state, isShownKey) { + let [type, tag, operationId] = isShownKey; + // We only put operations in the URL + if (type == "operations") { + return [tag, operationId]; + } else if (type == "operations-tag") { + return [tag]; + } + return []; + } + }, + reducers: { + [SCROLL_TO](state, action) { + return state.set("scrollToKey", external_immutable_namespaceObject["default"].fromJS(action.payload)); + }, + [CLEAR_SCROLL_TO](state) { + return state.delete("scrollToKey"); + } + }, + wrapActions: { + show + } + } + } +}); +;// CONCATENATED MODULE: external "@babel/runtime-corejs3/helpers/defineProperty" +var defineProperty_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var defineProperty_y = x => () => x +const defineProperty_namespaceObject = defineProperty_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_defineProperty_807a2698__["default"] }); +;// CONCATENATED MODULE: external "react-immutable-proptypes" +var external_react_immutable_proptypes_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_react_immutable_proptypes_y = x => () => x +const external_react_immutable_proptypes_namespaceObject = external_react_immutable_proptypes_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_immutable_proptypes_89c7d083__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/deep-linking/operation-wrapper.jsx + + + +const Wrapper = (Ori, system) => class OperationWrapper extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onLoad", + + + + + + (ref) => { + const { operation } = this.props; + const { tag, operationId } = operation.toObject(); + let { isShownKey } = operation.toObject(); + isShownKey = isShownKey || ["operations", tag, operationId]; + system.layoutActions.readyToScroll(isShownKey, ref); + });} + + render() { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { ref: this.onLoad }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Ori, this.props) + )); + + } +}; + +/* harmony default export */ const operation_wrapper = (Wrapper); +;// CONCATENATED MODULE: ./src/core/plugins/deep-linking/operation-tag-wrapper.jsx + + + +const operation_tag_wrapper_Wrapper = (Ori, system) => class OperationTagWrapper extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onLoad", + + + + + + (ref) => { + const { tag } = this.props; + const isShownKey = ["operations-tag", tag]; + system.layoutActions.readyToScroll(isShownKey, ref); + });} + + render() { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { ref: this.onLoad }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Ori, this.props) + )); + + } +}; + +/* harmony default export */ const operation_tag_wrapper = (operation_tag_wrapper_Wrapper); +;// CONCATENATED MODULE: ./src/core/plugins/deep-linking/index.js + + + + +/* harmony default export */ function deep_linking() { + return [layout, { + statePlugins: { + configs: { + wrapActions: { + loaded: (ori, system) => function () { + ori(...arguments); + // location.hash was an UTF-16 String, here is required UTF-8 + const hash = decodeURIComponent(window.location.hash); + system.layoutActions.parseDeepLinkHash(hash); + } + } + } + }, + wrapComponents: { + operation: operation_wrapper, + OperationTag: operation_tag_wrapper + } + }]; +} +;// CONCATENATED MODULE: external "lodash/reduce" +var reduce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var reduce_y = x => () => x +const reduce_namespaceObject = reduce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_reduce_11e69996__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/err/error-transformers/transformers/not-of-type.js +function transform(errors) { + // JSONSchema refers to the current object being validated + // as 'instance'. This isn't helpful to users, so we remove it. + return errors. + map((err) => { + let seekStr = "is not of a type(s)"; + let i = err.get("message").indexOf(seekStr); + if (i > -1) { + let types = err.get("message").slice(i + seekStr.length).split(","); + return err.set("message", err.get("message").slice(0, i) + makeNewMessage(types)); + } else { + return err; + } + }); +} + +function makeNewMessage(types) { + return types.reduce((p, c, i, arr) => { + if (i === arr.length - 1 && arr.length > 1) { + return p + "or " + c; + } else if (arr[i + 1] && arr.length > 2) { + return p + c + ", "; + } else if (arr[i + 1]) { + return p + c + " "; + } else { + return p + c; + } + }, "should be a"); +} +;// CONCATENATED MODULE: external "lodash/get" +var get_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var get_y = x => () => x +const get_namespaceObject = get_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_get_9427f899__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/err/error-transformers/transformers/parameter-oneof.js + + + +function parameter_oneof_transform(errors, _ref) {let { jsSpec } = _ref; + // LOOK HERE THIS TRANSFORMER IS CURRENTLY DISABLED 😃 + // TODO: finish implementing, fix flattening problem + /* eslint-disable no-unreachable */ + return errors; + + + // JSONSchema gives us very little to go on + let searchStr = "is not exactly one from <#/definitions/parameter>,<#/definitions/jsonReference>"; + return errors. + map((err) => { + let message = err.get("message"); + let isParameterOneOfError = message.indexOf(searchStr) > -1; + if (isParameterOneOfError) { + // try to find what's wrong + return createTailoredParameterError(err, jsSpec); + } else { + return err; + } + }). + flatten(true); // shallow Immutable flatten +} + +const VALID_IN_VALUES = ["path", "query", "header", "body", "formData"]; +const VALID_COLLECTIONFORMAT_VALUES = ["csv", "ssv", "tsv", "pipes", "multi"]; + +function createTailoredParameterError(err, jsSpec) { + let newErrs = []; + let parameter = (0,get_namespaceObject["default"])(jsSpec, err.get("path")); + + // find addressable cases + if (parameter.in && VALID_IN_VALUES.indexOf(parameter.in) === -1) { + let message = `Wrong value for the "in" keyword. Expected one of: ${VALID_IN_VALUES.join(", ")}.`; + newErrs.push({ + message, + path: err.get("path") + ".in", + type: "spec", + source: "structural", + level: "error" + }); + } + + if (parameter.collectionFormat && VALID_COLLECTIONFORMAT_VALUES.indexOf(parameter.collectionFormat) === -1) { + let message = `Wrong value for the "collectionFormat" keyword. Expected one of: ${VALID_COLLECTIONFORMAT_VALUES.join(", ")}.`; + newErrs.push({ + message, + path: err.get("path") + ".collectionFormat", + type: "spec", + source: "structural", + level: "error" + }); + } + + return newErrs.length ? (0,external_immutable_namespaceObject.fromJS)(newErrs) : err; // fall back to making no changes + +} +;// CONCATENATED MODULE: ./src/core/plugins/err/error-transformers/hook.js + + + + +const errorTransformers = [ +not_of_type_namespaceObject, +parameter_oneof_namespaceObject]; + + +function transformErrors(errors) { + // Dev note: unimplemented artifact where + // jsSpec: system.specSelectors.specJS() + // regardless, to be compliant with redux@4, instead of calling the store method here, + // jsSpec should be pass down as an argument, + let inputs = { + jsSpec: {} + }; + + let transformedErrors = (0,reduce_namespaceObject["default"])(errorTransformers, (result, transformer) => { + try { + let newlyTransformedErrors = transformer.transform(result, inputs); + return newlyTransformedErrors.filter((err) => !!err); // filter removed errors + } catch (e) { + console.error("Transformer error:", e); + return result; + } + }, errors); + + return transformedErrors. + filter((err) => !!err) // filter removed errors + .map((err) => { + if (!err.get("line") && err.get("path")) { + + // TODO: re-resolve line number if we've transformed it away + }return err; + }); + +} +;// CONCATENATED MODULE: ./src/core/plugins/err/reducers.js + + + + + + + +let DEFAULT_ERROR_STRUCTURE = { + // defaults + line: 0, + level: "error", + message: "Unknown error" +}; + +/* harmony default export */ function err_reducers() { + return { + [NEW_THROWN_ERR]: (state, _ref) => {let { payload } = _ref; + let error = Object.assign(DEFAULT_ERROR_STRUCTURE, payload, { type: "thrown" }); + return state. + update("errors", (errors) => (errors || (0,external_immutable_namespaceObject.List)()).push((0,external_immutable_namespaceObject.fromJS)(error))). + update("errors", (errors) => transformErrors(errors)); + }, + + [NEW_THROWN_ERR_BATCH]: (state, _ref2) => {let { payload } = _ref2; + payload = payload.map((err) => { + return (0,external_immutable_namespaceObject.fromJS)(Object.assign(DEFAULT_ERROR_STRUCTURE, err, { type: "thrown" })); + }); + return state. + update("errors", (errors) => (errors || (0,external_immutable_namespaceObject.List)()).concat((0,external_immutable_namespaceObject.fromJS)(payload))). + update("errors", (errors) => transformErrors(errors)); + }, + + [NEW_SPEC_ERR]: (state, _ref3) => {let { payload } = _ref3; + let error = (0,external_immutable_namespaceObject.fromJS)(payload); + error = error.set("type", "spec"); + return state. + update("errors", (errors) => (errors || (0,external_immutable_namespaceObject.List)()).push((0,external_immutable_namespaceObject.fromJS)(error)).sortBy((err) => err.get("line"))). + update("errors", (errors) => transformErrors(errors)); + }, + + [NEW_SPEC_ERR_BATCH]: (state, _ref4) => {let { payload } = _ref4; + payload = payload.map((err) => { + return (0,external_immutable_namespaceObject.fromJS)(Object.assign(DEFAULT_ERROR_STRUCTURE, err, { type: "spec" })); + }); + return state. + update("errors", (errors) => (errors || (0,external_immutable_namespaceObject.List)()).concat((0,external_immutable_namespaceObject.fromJS)(payload))). + update("errors", (errors) => transformErrors(errors)); + }, + + [NEW_AUTH_ERR]: (state, _ref5) => {let { payload } = _ref5; + let error = (0,external_immutable_namespaceObject.fromJS)(Object.assign({}, payload)); + + error = error.set("type", "auth"); + return state. + update("errors", (errors) => (errors || (0,external_immutable_namespaceObject.List)()).push((0,external_immutable_namespaceObject.fromJS)(error))). + update("errors", (errors) => transformErrors(errors)); + }, + + [CLEAR]: (state, _ref6) => {let { payload } = _ref6; + if (!payload || !state.get("errors")) { + return state; + } + + let newErrors = state.get("errors"). + filter((err) => { + return err.keySeq().every((k) => { + const errValue = err.get(k); + const filterValue = payload[k]; + + if (!filterValue) return true; + + return errValue !== filterValue; + }); + }); + return state.merge({ + errors: newErrors + }); + }, + + [CLEAR_BY]: (state, _ref7) => {let { payload } = _ref7; + if (!payload || typeof payload !== "function") { + return state; + } + let newErrors = state.get("errors"). + filter((err) => { + return payload(err); + }); + return state.merge({ + errors: newErrors + }); + } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/err/selectors.js + + + +const selectors_state = (state) => state; + +const allErrors = (0,external_reselect_namespaceObject.createSelector)( + selectors_state, + (err) => err.get("errors", (0,external_immutable_namespaceObject.List)()) +); + +const lastError = (0,external_reselect_namespaceObject.createSelector)( + allErrors, + (all) => all.last() +); +;// CONCATENATED MODULE: ./src/core/plugins/err/index.js + + + + +/* harmony default export */ function err(system) { + return { + statePlugins: { + err: { + reducers: err_reducers(system), + actions: actions_namespaceObject, + selectors: err_selectors_namespaceObject + } + } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/filter/opsFilter.js +/* harmony default export */ function opsFilter(taggedOps, phrase) { + return taggedOps.filter((tagObj, tag) => tag.indexOf(phrase) !== -1); +} +;// CONCATENATED MODULE: ./src/core/plugins/filter/index.js + + +/* harmony default export */ function filter() { + return { + fn: { + opsFilter: opsFilter + } + }; +} +;// CONCATENATED MODULE: external "@babel/runtime-corejs3/helpers/extends" +var extends_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var extends_y = x => () => x +const extends_namespaceObject = extends_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_extends_d20d3ceb__["default"] }); +;// CONCATENATED MODULE: external "@babel/runtime-corejs3/helpers/objectWithoutProperties" +var objectWithoutProperties_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var objectWithoutProperties_y = x => () => x +const objectWithoutProperties_namespaceObject = objectWithoutProperties_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_objectWithoutProperties_9beedba5__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/icons/components/arrow-up.jsx +const _excluded = ["className", "width", "height"]; /** + * @prettier + */ + + + +const ArrowUp = (_ref) => {let { className, width, height } = _ref,rest = (0,objectWithoutProperties_namespaceObject["default"])(_ref, _excluded);return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("svg", (0,extends_namespaceObject["default"])({ + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20", + className: className, + width: width, + height: height, + "aria-hidden": "true", + focusable: "false" }, + rest), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("path", { d: "M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z" }) + ));}; + + + + + + + + +ArrowUp.defaultProps = { + className: null, + width: 20, + height: 20 +}; + +/* harmony default export */ const arrow_up = (ArrowUp); +;// CONCATENATED MODULE: ./src/core/plugins/icons/components/arrow-down.jsx +const arrow_down_excluded = ["className", "width", "height"]; /** + * @prettier + */ + + + +const ArrowDown = (_ref) => {let { className, width, height } = _ref,rest = (0,objectWithoutProperties_namespaceObject["default"])(_ref, arrow_down_excluded);return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("svg", (0,extends_namespaceObject["default"])({ + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20", + className: className, + width: width, + height: height, + "aria-hidden": "true", + focusable: "false" }, + rest), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("path", { d: "M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z" }) + ));}; + + + + + + + + +ArrowDown.defaultProps = { + className: null, + width: 20, + height: 20 +}; + +/* harmony default export */ const arrow_down = (ArrowDown); +;// CONCATENATED MODULE: ./src/core/plugins/icons/components/arrow.jsx +const arrow_excluded = ["className", "width", "height"]; /** + * @prettier + */ + + + +const Arrow = (_ref) => {let { className, width, height } = _ref,rest = (0,objectWithoutProperties_namespaceObject["default"])(_ref, arrow_excluded);return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("svg", (0,extends_namespaceObject["default"])({ + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20", + className: className, + width: width, + height: height, + "aria-hidden": "true", + focusable: "false" }, + rest), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("path", { d: "M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z" }) + ));}; + + + + + + + + +Arrow.defaultProps = { + className: null, + width: 20, + height: 20 +}; + +/* harmony default export */ const arrow = (Arrow); +;// CONCATENATED MODULE: ./src/core/plugins/icons/components/close.jsx +const close_excluded = ["className", "width", "height"]; /** + * @prettier + */ + + + +const Close = (_ref) => {let { className, width, height } = _ref,rest = (0,objectWithoutProperties_namespaceObject["default"])(_ref, close_excluded);return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("svg", (0,extends_namespaceObject["default"])({ + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20", + className: className, + width: width, + height: height, + "aria-hidden": "true", + focusable: "false" }, + rest), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("path", { d: "M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z" }) + ));}; + + + + + + + + +Close.defaultProps = { + className: null, + width: 20, + height: 20 +}; + +/* harmony default export */ const components_close = (Close); +;// CONCATENATED MODULE: ./src/core/plugins/icons/components/copy.jsx +const copy_excluded = ["className", "width", "height"]; /** + * @prettier + */ + + + +const Copy = (_ref) => {let { className, width, height } = _ref,rest = (0,objectWithoutProperties_namespaceObject["default"])(_ref, copy_excluded);return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("svg", (0,extends_namespaceObject["default"])({ + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 15 16", + className: className, + width: width, + height: height, + "aria-hidden": "true", + focusable: "false" }, + rest), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("g", { transform: "translate(2, -1)" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("path", { + fill: "#ffffff", + fillRule: "evenodd", + d: "M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z" } + ) + ) + ));}; + + + + + + + + +Copy.defaultProps = { + className: null, + width: 15, + height: 16 +}; + +/* harmony default export */ const copy = (Copy); +;// CONCATENATED MODULE: ./src/core/plugins/icons/components/lock.jsx +const lock_excluded = ["className", "width", "height"]; /** + * @prettier + */ + + + +const Lock = (_ref) => {let { className, width, height } = _ref,rest = (0,objectWithoutProperties_namespaceObject["default"])(_ref, lock_excluded);return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("svg", (0,extends_namespaceObject["default"])({ + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20", + className: className, + width: width, + height: height, + "aria-hidden": "true", + focusable: "false" }, + rest), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("path", { d: "M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z" }) + ));}; + + + + + + + + +Lock.defaultProps = { + className: null, + width: 20, + height: 20 +}; + +/* harmony default export */ const lock = (Lock); +;// CONCATENATED MODULE: ./src/core/plugins/icons/components/unlock.jsx +const unlock_excluded = ["className", "width", "height"]; /** + * @prettier + */ + + + +const Unlock = (_ref) => {let { className, width, height } = _ref,rest = (0,objectWithoutProperties_namespaceObject["default"])(_ref, unlock_excluded);return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("svg", (0,extends_namespaceObject["default"])({ + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 20 20", + className: className, + width: width, + height: height, + "aria-hidden": "true", + focusable: "false" }, + rest), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("path", { d: "M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z" }) + ));}; + + + + + + + + +Unlock.defaultProps = { + className: null, + width: 20, + height: 20 +}; + +/* harmony default export */ const unlock = (Unlock); +;// CONCATENATED MODULE: ./src/core/plugins/icons/index.js +/** + * @prettier + */ + + + + + + + + +const IconsPlugin = () => ({ + components: { + ArrowUpIcon: arrow_up, + ArrowDownIcon: arrow_down, + ArrowIcon: arrow, + CloseIcon: components_close, + CopyIcon: copy, + LockIcon: lock, + UnlockIcon: unlock + } +}); + +/* harmony default export */ const icons = (IconsPlugin); +;// CONCATENATED MODULE: ./src/core/plugins/layout/actions.js + + +const UPDATE_LAYOUT = "layout_update_layout"; +const UPDATE_FILTER = "layout_update_filter"; +const UPDATE_MODE = "layout_update_mode"; +const SHOW = "layout_show"; + +// export const ONLY_SHOW = "layout_only_show" + +function updateLayout(layout) { + return { + type: UPDATE_LAYOUT, + payload: layout + }; +} + +function updateFilter(filter) { + return { + type: UPDATE_FILTER, + payload: filter + }; +} + +function actions_show(thing) {let shown = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true; + thing = normalizeArray(thing); + return { + type: SHOW, + payload: { thing, shown } + }; +} + +// Simple string key-store, used for +function changeMode(thing) {let mode = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + thing = normalizeArray(thing); + return { + type: UPDATE_MODE, + payload: { thing, mode } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/layout/reducers.js + + + + +/* harmony default export */ const layout_reducers = ({ + + [UPDATE_LAYOUT]: (state, action) => state.set("layout", action.payload), + + [UPDATE_FILTER]: (state, action) => state.set("filter", action.payload), + + [SHOW]: (state, action) => { + const isShown = action.payload.shown; + // This is one way to serialize an array, another (preferred) is to convert to json-pointer + // TODO: use json-pointer serilization instead of fromJS(...), for performance + const thingToShow = (0,external_immutable_namespaceObject.fromJS)(action.payload.thing); + // This is a map of paths to bools + // eg: [one, two] => true + // eg: [one] => false + return state.update("shown", (0,external_immutable_namespaceObject.fromJS)({}), (a) => a.set(thingToShow, isShown)); + }, + + [UPDATE_MODE]: (state, action) => { + let thing = action.payload.thing; + let mode = action.payload.mode; + return state.setIn(["modes"].concat(thing), (mode || "") + ""); + } + +}); +;// CONCATENATED MODULE: ./src/core/plugins/layout/selectors.js + + + + +const layout_selectors_state = (state) => state; + +const current = (state) => state.get("layout"); + +const currentFilter = (state) => state.get("filter"); + +const isShown = (state, thing, def) => { + thing = normalizeArray(thing); + return state.get("shown", (0,external_immutable_namespaceObject.fromJS)({})).get((0,external_immutable_namespaceObject.fromJS)(thing), def); +}; + +const whatMode = function (state, thing) {let def = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ""; + thing = normalizeArray(thing); + return state.getIn(["modes", ...thing], def); +}; + +const showSummary = (0,external_reselect_namespaceObject.createSelector)( + layout_selectors_state, + (state) => !isShown(state, "editor") +); +;// CONCATENATED MODULE: ./src/core/plugins/layout/spec-extensions/wrap-selector.js + +const taggedOperations = (oriSelector, system) => function (state) {for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {args[_key - 1] = arguments[_key];} + let taggedOps = oriSelector(state, ...args); + + const { fn, layoutSelectors, getConfigs } = system.getSystem(); + const configs = getConfigs(); + const { maxDisplayedTags } = configs; + + // Filter, if requested + let filter = layoutSelectors.currentFilter(); + if (filter) { + if (filter !== true && filter !== "true" && filter !== "false") { + taggedOps = fn.opsFilter(taggedOps, filter); + } + } + // Limit to [max] items, if specified + if (maxDisplayedTags && !isNaN(maxDisplayedTags) && maxDisplayedTags >= 0) { + taggedOps = taggedOps.slice(0, maxDisplayedTags); + } + + return taggedOps; +}; +;// CONCATENATED MODULE: ./src/core/plugins/layout/index.js + + + + + +/* harmony default export */ function plugins_layout() { + return { + statePlugins: { + layout: { + reducers: layout_reducers, + actions: layout_actions_namespaceObject, + selectors: layout_selectors_namespaceObject + }, + spec: { + wrapSelectors: wrap_selector_namespaceObject + } + } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/logs/index.js +/* harmony default export */ function logs(_ref) {let { configs } = _ref; + + const levels = { + "debug": 0, + "info": 1, + "log": 2, + "warn": 3, + "error": 4 + }; + + const getLevel = (level) => levels[level] || -1; + + let { logLevel } = configs; + let logLevelInt = getLevel(logLevel); + + function log(level) {for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {args[_key - 1] = arguments[_key];} + if (getLevel(level) >= logLevelInt) + // eslint-disable-next-line no-console + console[level](...args); + } + + log.warn = log.bind(null, "warn"); + log.error = log.bind(null, "error"); + log.info = log.bind(null, "info"); + log.debug = log.bind(null, "debug"); + + return { rootInjects: { log } }; +} +;// CONCATENATED MODULE: ./src/core/plugins/on-complete/index.js +let engaged = false; + +/* harmony default export */ function on_complete() { + + return { + statePlugins: { + spec: { + wrapActions: { + updateSpec: (ori) => function () { + engaged = true; + return ori(...arguments); + }, + updateJsonSpec: (ori, system) => function () { + const cb = system.getConfigs().onComplete; + if (engaged && typeof cb === "function") { + // call `onComplete` on next tick, which allows React to + // reconcile the DOM before we notify the user + setTimeout(cb, 0); + engaged = false; + } + + return ori(...arguments); + } + } + } + } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/request-snippets/fn.js + + + + +/** + * if duplicate key name existed from FormData entries, + * we mutated the key name by appending a hashIdx + * @param {String} k - possibly mutated key name + * @return {String} - src key name + */ +const extractKey = (k) => { + const hashIdx = "_**[]"; + if (k.indexOf(hashIdx) < 0) { + return k; + } + return k.split(hashIdx)[0].trim(); +}; + +const escapeShell = (str) => { + if (str === "-d ") { + return str; + } + // eslint-disable-next-line no-useless-escape + if (!/^[_\/-]/g.test(str)) + return "'" + str. + replace(/'/g, "'\\''") + "'";else + + return str; +}; + +const escapeCMD = (str) => { + str = str. + replace(/\^/g, "^^"). + replace(/\\"/g, "\\\\\""). + replace(/"/g, "\"\""). + replace(/\n/g, "^\n"); + if (str === "-d ") { + return str. + replace(/-d /g, "-d ^\n"); + } + // eslint-disable-next-line no-useless-escape + if (!/^[_\/-]/g.test(str)) + return "\"" + str + "\"";else + + return str; +}; + +const escapePowershell = (str) => { + if (str === "-d ") { + return str; + } + if (/\n/.test(str)) { + return "@\"\n" + str.replace(/"/g, "\\\"").replace(/`/g, "``").replace(/\$/, "`$") + "\n\"@"; + } + // eslint-disable-next-line no-useless-escape + if (!/^[_\/-]/g.test(str)) + return "'" + str. + replace(/"/g, "\"\""). + replace(/'/g, "''") + "'";else + + return str; +}; + +function getStringBodyOfMap(request) { + let curlifyToJoin = []; + for (let [k, v] of request.get("body").entrySeq()) { + let extractedKey = extractKey(k); + if (v instanceof core_window.File) { + curlifyToJoin.push(` "${extractedKey}": {\n "name": "${v.name}"${v.type ? `,\n "type": "${v.type}"` : ""}\n }`); + } else { + curlifyToJoin.push(` "${extractedKey}": ${JSON.stringify(v, null, 2).replace(/(\r\n|\r|\n)/g, "\n ")}`); + } + } + return `{\n${curlifyToJoin.join(",\n")}\n}`; +} + +const curlify = function (request, escape, newLine) {let ext = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : ""; + let isMultipartFormDataRequest = false; + let curlified = ""; + const addWords = function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}return curlified += " " + args.map(escape).join(" ");}; + const addWordsWithoutLeadingSpace = function () {for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}return curlified += args.map(escape).join(" ");}; + const addNewLine = () => curlified += ` ${newLine}`; + const addIndent = function () {let level = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 1;return curlified += " ".repeat(level);}; + let headers = request.get("headers"); + curlified += "curl" + ext; + + if (request.has("curlOptions")) { + addWords(...request.get("curlOptions")); + } + + addWords("-X", request.get("method")); + + addNewLine(); + addIndent(); + addWordsWithoutLeadingSpace(`${request.get("url")}`); + + if (headers && headers.size) { + for (let p of request.get("headers").entries()) { + addNewLine(); + addIndent(); + let [h, v] = p; + addWordsWithoutLeadingSpace("-H", `${h}: ${v}`); + isMultipartFormDataRequest = isMultipartFormDataRequest || /^content-type$/i.test(h) && /^multipart\/form-data$/i.test(v); + } + } + + const body = request.get("body"); + if (body) { + if (isMultipartFormDataRequest && ["POST", "PUT", "PATCH"].includes(request.get("method"))) { + for (let [k, v] of body.entrySeq()) { + let extractedKey = extractKey(k); + addNewLine(); + addIndent(); + addWordsWithoutLeadingSpace("-F"); + + /** + * SwaggerClient produces specialized sub-class of File class, that only + * accepts string data and retain this data in `data` + * public property throughout the lifecycle of its instances. + * + * This sub-class is exclusively used only when Encoding Object + * is defined within the Media Type Object (OpenAPI 3.x.y). + */ + if (v instanceof core_window.File && typeof v.valueOf() === "string") { + addWords(`${extractedKey}=${v.data}${v.type ? `;type=${v.type}` : ""}`); + } else if (v instanceof core_window.File) { + addWords(`${extractedKey}=@${v.name}${v.type ? `;type=${v.type}` : ""}`); + } else { + addWords(`${extractedKey}=${v}`); + } + } + } else if (body instanceof core_window.File) { + addNewLine(); + addIndent(); + addWordsWithoutLeadingSpace(`--data-binary '@${body.name}'`); + } else { + addNewLine(); + addIndent(); + addWordsWithoutLeadingSpace("-d "); + let reqBody = body; + if (!external_immutable_namespaceObject.Map.isMap(reqBody)) { + if (typeof reqBody !== "string") { + reqBody = JSON.stringify(reqBody); + } + addWordsWithoutLeadingSpace(reqBody); + } else { + addWordsWithoutLeadingSpace(getStringBodyOfMap(request)); + } + } + } else if (!body && request.get("method") === "POST") { + addNewLine(); + addIndent(); + addWordsWithoutLeadingSpace("-d ''"); + } + + return curlified; +}; + +// eslint-disable-next-line camelcase +const requestSnippetGenerator_curl_powershell = (request) => { + return curlify(request, escapePowershell, "`\n", ".exe"); +}; + +// eslint-disable-next-line camelcase +const requestSnippetGenerator_curl_bash = (request) => { + return curlify(request, escapeShell, "\\\n"); +}; + +// eslint-disable-next-line camelcase +const requestSnippetGenerator_curl_cmd = (request) => { + return curlify(request, escapeCMD, "^\n"); +}; +;// CONCATENATED MODULE: ./src/core/plugins/request-snippets/selectors.js + + + +const request_snippets_selectors_state = (state) => state || (0,external_immutable_namespaceObject.Map)(); + +const getGenerators = (0,external_reselect_namespaceObject.createSelector)( + request_snippets_selectors_state, + (state) => { + const languageKeys = state. + get("languages"); + const generators = state. + get("generators", (0,external_immutable_namespaceObject.Map)()); + if (!languageKeys || languageKeys.isEmpty()) { + return generators; + } + return generators. + filter((v, key) => languageKeys.includes(key)); + } +); + +const getSnippetGenerators = (state) => (_ref) => {let { fn } = _ref; + const getGenFn = (key) => fn[`requestSnippetGenerator_${key}`]; + return getGenerators(state). + map((gen, key) => { + const genFn = getGenFn(key); + if (typeof genFn !== "function") { + return null; + } + + return gen.set("fn", genFn); + }). + filter((v) => v); +}; + +const getActiveLanguage = (0,external_reselect_namespaceObject.createSelector)( + request_snippets_selectors_state, + (state) => state. + get("activeLanguage") +); + +const getDefaultExpanded = (0,external_reselect_namespaceObject.createSelector)( + request_snippets_selectors_state, + (state) => state. + get("defaultExpanded") +); +;// CONCATENATED MODULE: external "react-copy-to-clipboard" +var external_react_copy_to_clipboard_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_react_copy_to_clipboard_y = x => () => x +const external_react_copy_to_clipboard_namespaceObject = external_react_copy_to_clipboard_x({ ["CopyToClipboard"]: () => __WEBPACK_EXTERNAL_MODULE_react_copy_to_clipboard_5b11dd57__.CopyToClipboard }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/light" +var light_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var light_y = x => () => x +const light_namespaceObject = light_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_light_746e1958__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/languages/hljs/javascript" +var javascript_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var javascript_y = x => () => x +const javascript_namespaceObject = javascript_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_javascript_e22911f7__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/languages/hljs/json" +var json_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var json_y = x => () => x +const json_namespaceObject = json_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_json_b876afc5__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/languages/hljs/xml" +var xml_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var xml_y = x => () => x +const xml_namespaceObject = xml_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_xml_a81c807b__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/languages/hljs/bash" +var bash_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var bash_y = x => () => x +const bash_namespaceObject = bash_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_bash_1621c621__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/languages/hljs/yaml" +var yaml_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var yaml_y = x => () => x +const yaml_namespaceObject = yaml_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_yaml_02838f34__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/languages/hljs/http" +var http_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var http_y = x => () => x +const http_namespaceObject = http_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_http_4e924b23__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/languages/hljs/powershell" +var powershell_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var powershell_y = x => () => x +const powershell_namespaceObject = powershell_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_languages_hljs_powershell_d51eb4f6__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/styles/hljs/agate" +var agate_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var agate_y = x => () => x +const agate_namespaceObject = agate_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_agate_99a46aa2__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/styles/hljs/arta" +var arta_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var arta_y = x => () => x +const arta_namespaceObject = arta_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_arta_570691fc__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/styles/hljs/monokai" +var monokai_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var monokai_y = x => () => x +const monokai_namespaceObject = monokai_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_monokai_2529bafb__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/styles/hljs/nord" +var nord_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var nord_y = x => () => x +const nord_namespaceObject = nord_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_nord_5bfa1099__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/styles/hljs/obsidian" +var obsidian_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var obsidian_y = x => () => x +const obsidian_namespaceObject = obsidian_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_obsidian_a278dd52__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/styles/hljs/tomorrow-night" +var tomorrow_night_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var tomorrow_night_y = x => () => x +const tomorrow_night_namespaceObject = tomorrow_night_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_tomorrow_night_63765df9__["default"] }); +;// CONCATENATED MODULE: external "react-syntax-highlighter/dist/esm/styles/hljs/idea" +var idea_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var idea_y = x => () => x +const idea_namespaceObject = idea_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_syntax_highlighter_dist_esm_styles_hljs_idea_023aba2e__["default"] }); +;// CONCATENATED MODULE: ./src/core/syntax-highlighting.js + + + + + + + + + + + + + + + + + + +light_namespaceObject["default"].registerLanguage("json", json_namespaceObject["default"]); +light_namespaceObject["default"].registerLanguage("js", javascript_namespaceObject["default"]); +light_namespaceObject["default"].registerLanguage("xml", xml_namespaceObject["default"]); +light_namespaceObject["default"].registerLanguage("yaml", yaml_namespaceObject["default"]); +light_namespaceObject["default"].registerLanguage("http", http_namespaceObject["default"]); +light_namespaceObject["default"].registerLanguage("bash", bash_namespaceObject["default"]); +light_namespaceObject["default"].registerLanguage("powershell", powershell_namespaceObject["default"]); +light_namespaceObject["default"].registerLanguage("javascript", javascript_namespaceObject["default"]); + +const styles = { agate: agate_namespaceObject["default"], arta: arta_namespaceObject["default"], monokai: monokai_namespaceObject["default"], nord: nord_namespaceObject["default"], obsidian: obsidian_namespaceObject["default"], "tomorrow-night": tomorrow_night_namespaceObject["default"], idea: idea_namespaceObject["default"] }; +const availableStyles = Object.keys(styles); + +const getStyle = (name) => { + if (!availableStyles.includes(name)) { + console.warn(`Request style '${name}' is not available, returning default instead`); + return agate_namespaceObject["default"]; + } + return styles[name]; +}; + + +;// CONCATENATED MODULE: ./src/core/plugins/request-snippets/request-snippets.jsx + + + + + + + +const style = { + cursor: "pointer", + lineHeight: 1, + display: "inline-flex", + backgroundColor: "rgb(250, 250, 250)", + paddingBottom: "0", + paddingTop: "0", + border: "1px solid rgb(51, 51, 51)", + borderRadius: "4px 4px 0 0", + boxShadow: "none", + borderBottom: "none" +}; + +const activeStyle = { + cursor: "pointer", + lineHeight: 1, + display: "inline-flex", + backgroundColor: "rgb(51, 51, 51)", + boxShadow: "none", + border: "1px solid rgb(51, 51, 51)", + paddingBottom: "0", + paddingTop: "0", + borderRadius: "4px 4px 0 0", + marginTop: "-5px", + marginRight: "-5px", + marginLeft: "-5px", + zIndex: "9999", + borderBottom: "none" +}; + +const RequestSnippets = (_ref) => {var _requestSnippetsSelec;let { request, requestSnippetsSelectors, getConfigs, getComponent } = _ref; + const config = (0,isFunction_namespaceObject["default"])(getConfigs) ? getConfigs() : null; + const canSyntaxHighlight = (0,get_namespaceObject["default"])(config, "syntaxHighlight") !== false && (0,get_namespaceObject["default"])(config, "syntaxHighlight.activated", true); + const rootRef = (0,external_react_namespaceObject.useRef)(null); + + const ArrowIcon = getComponent("ArrowUpIcon"); + const ArrowDownIcon = getComponent("ArrowDownIcon"); + + const [activeLanguage, setActiveLanguage] = (0,external_react_namespaceObject.useState)((_requestSnippetsSelec = requestSnippetsSelectors.getSnippetGenerators()) === null || _requestSnippetsSelec === void 0 ? void 0 : _requestSnippetsSelec.keySeq().first()); + const [isExpanded, setIsExpanded] = (0,external_react_namespaceObject.useState)(requestSnippetsSelectors === null || requestSnippetsSelectors === void 0 ? void 0 : requestSnippetsSelectors.getDefaultExpanded()); + (0,external_react_namespaceObject.useEffect)(() => { + const doIt = () => { + + }; + doIt(); + }, []); + (0,external_react_namespaceObject.useEffect)(() => { + const childNodes = Array. + from(rootRef.current.childNodes). + filter((node) => {var _node$classList;return !!node.nodeType && ((_node$classList = node.classList) === null || _node$classList === void 0 ? void 0 : _node$classList.contains("curl-command"));}); + // eslint-disable-next-line no-use-before-define + childNodes.forEach((node) => node.addEventListener("mousewheel", handlePreventYScrollingBeyondElement, { passive: false })); + + return () => { + // eslint-disable-next-line no-use-before-define + childNodes.forEach((node) => node.removeEventListener("mousewheel", handlePreventYScrollingBeyondElement)); + }; + }, [request]); + + const snippetGenerators = requestSnippetsSelectors.getSnippetGenerators(); + const activeGenerator = snippetGenerators.get(activeLanguage); + const snippet = activeGenerator.get("fn")(request); + + const handleGenChange = (key) => { + const needsChange = activeLanguage !== key; + if (needsChange) { + setActiveLanguage(key); + } + }; + + const handleSetIsExpanded = () => { + setIsExpanded(!isExpanded); + }; + + const handleGetBtnStyle = (key) => { + if (key === activeLanguage) { + return activeStyle; + } + return style; + }; + + const handlePreventYScrollingBeyondElement = (e) => { + const { target, deltaY } = e; + const { scrollHeight: contentHeight, offsetHeight: visibleHeight, scrollTop } = target; + const scrollOffset = visibleHeight + scrollTop; + const isElementScrollable = contentHeight > visibleHeight; + const isScrollingPastTop = scrollTop === 0 && deltaY < 0; + const isScrollingPastBottom = scrollOffset >= contentHeight && deltaY > 0; + + if (isElementScrollable && (isScrollingPastTop || isScrollingPastBottom)) { + e.preventDefault(); + } + }; + + const SnippetComponent = canSyntaxHighlight ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(light_namespaceObject["default"], { + language: activeGenerator.get("syntax"), + className: "curl microlight", + style: getStyle((0,get_namespaceObject["default"])(config, "syntaxHighlight.theme")) }, + + snippet + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("textarea", { readOnly: true, className: "curl", value: snippet }); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "request-snippets", ref: rootRef }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { style: { width: "100%", display: "flex", justifyContent: "flex-start", alignItems: "center", marginBottom: "15px" } }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { + onClick: () => handleSetIsExpanded(), + style: { cursor: "pointer" } }, + "Snippets"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { + onClick: () => handleSetIsExpanded(), + style: { border: "none", background: "none" }, + title: isExpanded ? "Collapse operation" : "Expand operation" }, + + isExpanded ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowDownIcon, { className: "arrow", width: "10", height: "10" }) : /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowIcon, { className: "arrow", width: "10", height: "10" }) + ) + ), + + isExpanded && /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "curl-command" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { style: { paddingLeft: "15px", paddingRight: "10px", width: "100%", display: "flex" } }, + + snippetGenerators.entrySeq().map((_ref2) => {let [key, gen] = _ref2; + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { style: handleGetBtnStyle(key), className: "btn", key: key, onClick: () => handleGenChange(key) }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { style: key === activeLanguage ? { color: "white" } : {} }, gen.get("title")) + ); + }) + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "copy-to-clipboard" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_copy_to_clipboard_namespaceObject.CopyToClipboard, { text: snippet }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", null) + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, + SnippetComponent + ) + ) + + )); + +}; + + + + + + + + + +/* harmony default export */ const request_snippets = (RequestSnippets); +;// CONCATENATED MODULE: ./src/core/plugins/request-snippets/index.js + + + +/* harmony default export */ const plugins_request_snippets = (() => { + return { + components: { + RequestSnippets: request_snippets + }, + fn: fn_namespaceObject, + statePlugins: { + requestSnippets: { + selectors: request_snippets_selectors_namespaceObject + } + } + }; +}); +;// CONCATENATED MODULE: external "xml" +var external_xml_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_xml_y = x => () => x +const external_xml_namespaceObject = external_xml_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_xml__["default"] }); +;// CONCATENATED MODULE: external "randexp" +var external_randexp_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_randexp_y = x => () => x +const external_randexp_namespaceObject = external_randexp_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_randexp__["default"] }); +;// CONCATENATED MODULE: external "lodash/isEmpty" +var isEmpty_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var isEmpty_y = x => () => x +const isEmpty_namespaceObject = isEmpty_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_isEmpty_e109fd6b__["default"] }); +;// CONCATENATED MODULE: ./src/core/utils/memoizeN.js + + +/** + * This function is extension on top of lodash.memoize. + * It uses all the arguments of the `fn` as the cache key instead of just the first one. + * If resolver is provided, it determines the cache key for + * storing the result based on the arguments provided to the memoized function. + */ + +const shallowArrayEquals = (a) => (b) => { + return Array.isArray(a) && Array.isArray(b) && + a.length === b.length && + a.every((val, index) => val === b[index]); +}; + +const list = function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}return args;}; + +class Cache extends Map { + delete(key) { + const keys = Array.from(this.keys()); + const foundKey = keys.find(shallowArrayEquals(key)); + return super.delete(foundKey); + } + + get(key) { + const keys = Array.from(this.keys()); + const foundKey = keys.find(shallowArrayEquals(key)); + return super.get(foundKey); + } + + has(key) { + const keys = Array.from(this.keys()); + return keys.findIndex(shallowArrayEquals(key)) !== -1; + } +} + +const memoizeN = function (fn) {let resolver = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : list; + const { Cache: OriginalCache } = memoize_namespaceObject["default"]; + memoize_namespaceObject["default"].Cache = Cache; + + const memoized = (0,memoize_namespaceObject["default"])(fn, resolver); + + memoize_namespaceObject["default"].Cache = OriginalCache; + + return memoized; +}; + +/* harmony default export */ const utils_memoizeN = (memoizeN); +;// CONCATENATED MODULE: ./src/core/plugins/samples/fn/index.js + + + + + + +const generateStringFromRegex = (pattern) => { + try { + const randexp = new external_randexp_namespaceObject["default"](pattern); + return randexp.gen(); + } catch (e) { + // Invalid regex should not cause a crash (regex syntax varies across languages) + return "string"; + } +}; + +const primitives = { + "string": (schema) => schema.pattern ? generateStringFromRegex(schema.pattern) : "string", + "string_email": () => "user@example.com", + "string_date-time": () => new Date().toISOString(), + "string_date": () => new Date().toISOString().substring(0, 10), + "string_uuid": () => "3fa85f64-5717-4562-b3fc-2c963f66afa6", + "string_hostname": () => "example.com", + "string_ipv4": () => "198.51.100.42", + "string_ipv6": () => "2001:0db8:5b96:0000:0000:426f:8e17:642a", + "number": () => 0, + "number_float": () => 0.0, + "integer": () => 0, + "boolean": (schema) => typeof schema.default === "boolean" ? schema.default : true +}; + +const primitive = (schema) => { + schema = objectify(schema); + let { type, format } = schema; + + let fn = primitives[`${type}_${format}`] || primitives[type]; + + if (isFunc(fn)) + return fn(schema); + + return "Unknown Type: " + schema.type; +}; + +// do a couple of quick sanity tests to ensure the value +// looks like a $$ref that swagger-client generates. +const sanitizeRef = (value) => deeplyStripKey(value, "$$ref", (val) => +typeof val === "string" && val.indexOf("#") > -1); + +const objectContracts = ["maxProperties", "minProperties"]; +const arrayContracts = ["minItems", "maxItems"]; +const numberContracts = [ +"minimum", +"maximum", +"exclusiveMinimum", +"exclusiveMaximum"]; + +const stringContracts = ["minLength", "maxLength"]; + +const liftSampleHelper = function (oldSchema, target) {let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + const setIfNotDefinedInTarget = (key) => { + if (target[key] === undefined && oldSchema[key] !== undefined) { + target[key] = oldSchema[key]; + } + }; + + [ + "example", + "default", + "enum", + "xml", + "type", + ...objectContracts, + ...arrayContracts, + ...numberContracts, + ...stringContracts]. + forEach((key) => setIfNotDefinedInTarget(key)); + + if (oldSchema.required !== undefined && Array.isArray(oldSchema.required)) { + if (target.required === undefined || !target.required.length) { + target.required = []; + } + oldSchema.required.forEach((key) => { + if (target.required.includes(key)) { + return; + } + target.required.push(key); + }); + } + if (oldSchema.properties) { + if (!target.properties) { + target.properties = {}; + } + let props = objectify(oldSchema.properties); + for (let propName in props) { + if (!Object.prototype.hasOwnProperty.call(props, propName)) { + continue; + } + if (props[propName] && props[propName].deprecated) { + continue; + } + if (props[propName] && props[propName].readOnly && !config.includeReadOnly) { + continue; + } + if (props[propName] && props[propName].writeOnly && !config.includeWriteOnly) { + continue; + } + if (!target.properties[propName]) { + target.properties[propName] = props[propName]; + if (!oldSchema.required && Array.isArray(oldSchema.required) && oldSchema.required.indexOf(propName) !== -1) { + if (!target.required) { + target.required = [propName]; + } else { + target.required.push(propName); + } + } + } + } + } + if (oldSchema.items) { + if (!target.items) { + target.items = {}; + } + target.items = liftSampleHelper(oldSchema.items, target.items, config); + } + + return target; +}; + +const sampleFromSchemaGeneric = function (schema) {let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};let exampleOverride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;let respectXML = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + if (schema && isFunc(schema.toJS)) + schema = schema.toJS(); + let usePlainValue = exampleOverride !== undefined || schema && schema.example !== undefined || schema && schema.default !== undefined; + // first check if there is the need of combining this schema with others required by allOf + const hasOneOf = !usePlainValue && schema && schema.oneOf && schema.oneOf.length > 0; + const hasAnyOf = !usePlainValue && schema && schema.anyOf && schema.anyOf.length > 0; + if (!usePlainValue && (hasOneOf || hasAnyOf)) { + const schemaToAdd = objectify(hasOneOf ? + schema.oneOf[0] : + schema.anyOf[0] + ); + liftSampleHelper(schemaToAdd, schema, config); + if (!schema.xml && schemaToAdd.xml) { + schema.xml = schemaToAdd.xml; + } + if (schema.example !== undefined && schemaToAdd.example !== undefined) { + usePlainValue = true; + } else if (schemaToAdd.properties) { + if (!schema.properties) { + schema.properties = {}; + } + let props = objectify(schemaToAdd.properties); + for (let propName in props) { + if (!Object.prototype.hasOwnProperty.call(props, propName)) { + continue; + } + if (props[propName] && props[propName].deprecated) { + continue; + } + if (props[propName] && props[propName].readOnly && !config.includeReadOnly) { + continue; + } + if (props[propName] && props[propName].writeOnly && !config.includeWriteOnly) { + continue; + } + if (!schema.properties[propName]) { + schema.properties[propName] = props[propName]; + if (!schemaToAdd.required && Array.isArray(schemaToAdd.required) && schemaToAdd.required.indexOf(propName) !== -1) { + if (!schema.required) { + schema.required = [propName]; + } else { + schema.required.push(propName); + } + } + } + } + } + } + const _attr = {}; + let { xml, type, example, properties, additionalProperties, items } = schema || {}; + let { includeReadOnly, includeWriteOnly } = config; + xml = xml || {}; + let { name, prefix, namespace } = xml; + let displayName; + let res = {}; + + // set xml naming and attributes + if (respectXML) { + name = name || "notagname"; + // add prefix to name if exists + displayName = (prefix ? prefix + ":" : "") + name; + if (namespace) { + //add prefix to namespace if exists + let namespacePrefix = prefix ? "xmlns:" + prefix : "xmlns"; + _attr[namespacePrefix] = namespace; + } + } + + // init xml default response sample obj + if (respectXML) { + res[displayName] = []; + } + + const schemaHasAny = (keys) => keys.some((key) => Object.prototype.hasOwnProperty.call(schema, key)); + // try recover missing type + if (schema && !type) { + if (properties || additionalProperties || schemaHasAny(objectContracts)) { + type = "object"; + } else if (items || schemaHasAny(arrayContracts)) { + type = "array"; + } else if (schemaHasAny(numberContracts)) { + type = "number"; + schema.type = "number"; + } else if (!usePlainValue && !schema.enum) { + // implicit cover schemaHasAny(stringContracts) or A schema without a type matches any data type is: + // components: + // schemas: + // AnyValue: + // anyOf: + // - type: string + // - type: number + // - type: integer + // - type: boolean + // - type: array + // items: {} + // - type: object + // + // which would resolve to type: string + type = "string"; + schema.type = "string"; + } + } + + const handleMinMaxItems = (sampleArray) => {var _schema, _schema2, _schema4, _schema5; + if (((_schema = schema) === null || _schema === void 0 ? void 0 : _schema.maxItems) !== null && ((_schema2 = schema) === null || _schema2 === void 0 ? void 0 : _schema2.maxItems) !== undefined) {var _schema3; + sampleArray = sampleArray.slice(0, (_schema3 = schema) === null || _schema3 === void 0 ? void 0 : _schema3.maxItems); + } + if (((_schema4 = schema) === null || _schema4 === void 0 ? void 0 : _schema4.minItems) !== null && ((_schema5 = schema) === null || _schema5 === void 0 ? void 0 : _schema5.minItems) !== undefined) { + let i = 0; + while (sampleArray.length < ((_schema6 = schema) === null || _schema6 === void 0 ? void 0 : _schema6.minItems)) {var _schema6; + sampleArray.push(sampleArray[i++ % sampleArray.length]); + } + } + return sampleArray; + }; + + // add to result helper init for xml or json + const props = objectify(properties); + let addPropertyToResult; + let propertyAddedCounter = 0; + + const hasExceededMaxProperties = () => schema && + schema.maxProperties !== null && schema.maxProperties !== undefined && + propertyAddedCounter >= schema.maxProperties; + + const requiredPropertiesToAdd = () => { + if (!schema || !schema.required) { + return 0; + } + let addedCount = 0; + if (respectXML) { + schema.required.forEach((key) => addedCount += + res[key] === undefined ? + 0 : + 1 + ); + } else { + schema.required.forEach((key) => {var _res$displayName;return addedCount += + ((_res$displayName = res[displayName]) === null || _res$displayName === void 0 ? void 0 : _res$displayName.find((x) => x[key] !== undefined)) === undefined ? + 0 : + 1;} + ); + } + return schema.required.length - addedCount; + }; + + const isOptionalProperty = (propName) => { + if (!schema || !schema.required || !schema.required.length) { + return true; + } + return !schema.required.includes(propName); + }; + + const canAddProperty = (propName) => { + if (!schema || schema.maxProperties === null || schema.maxProperties === undefined) { + return true; + } + if (hasExceededMaxProperties()) { + return false; + } + if (!isOptionalProperty(propName)) { + return true; + } + return schema.maxProperties - propertyAddedCounter - requiredPropertiesToAdd() > 0; + }; + + if (respectXML) { + addPropertyToResult = function (propName) {let overrideE = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + if (schema && props[propName]) { + // case it is an xml attribute + props[propName].xml = props[propName].xml || {}; + + if (props[propName].xml.attribute) { + const enumAttrVal = Array.isArray(props[propName].enum) ? + props[propName].enum[0] : + undefined; + const attrExample = props[propName].example; + const attrDefault = props[propName].default; + + if (attrExample !== undefined) { + _attr[props[propName].xml.name || propName] = attrExample; + } else if (attrDefault !== undefined) { + _attr[props[propName].xml.name || propName] = attrDefault; + } else if (enumAttrVal !== undefined) { + _attr[props[propName].xml.name || propName] = enumAttrVal; + } else { + _attr[props[propName].xml.name || propName] = primitive(props[propName]); + } + + return; + } + props[propName].xml.name = props[propName].xml.name || propName; + } else if (!props[propName] && additionalProperties !== false) { + // case only additionalProperty that is not defined in schema + props[propName] = { + xml: { + name: propName + } + }; + } + + let t = sampleFromSchemaGeneric(schema && props[propName] || undefined, config, overrideE, respectXML); + if (!canAddProperty(propName)) { + return; + } + + propertyAddedCounter++; + if (Array.isArray(t)) { + res[displayName] = res[displayName].concat(t); + } else { + res[displayName].push(t); + } + }; + } else { + addPropertyToResult = (propName, overrideE) => { + if (!canAddProperty(propName)) { + return; + } + if (Object.prototype.hasOwnProperty.call(schema, "discriminator") && + schema.discriminator && + Object.prototype.hasOwnProperty.call(schema.discriminator, "mapping") && + schema.discriminator.mapping && + Object.prototype.hasOwnProperty.call(schema, "$$ref") && + schema.$$ref && + schema.discriminator.propertyName === propName) { + for (let pair in schema.discriminator.mapping) { + if (schema.$$ref.search(schema.discriminator.mapping[pair]) !== -1) { + res[propName] = pair; + break; + } + } + } else { + res[propName] = sampleFromSchemaGeneric(props[propName], config, overrideE, respectXML); + } + propertyAddedCounter++; + }; + } + + // check for plain value and if found use it to generate sample from it + if (usePlainValue) { + let sample; + if (exampleOverride !== undefined) { + sample = sanitizeRef(exampleOverride); + } else if (example !== undefined) { + sample = sanitizeRef(example); + } else { + sample = sanitizeRef(schema.default); + } + + // if json just return + if (!respectXML) { + // spacial case yaml parser can not know about + if (typeof sample === "number" && type === "string") { + return `${sample}`; + } + // return if sample does not need any parsing + if (typeof sample !== "string" || type === "string") { + return sample; + } + // check if sample is parsable or just a plain string + try { + return JSON.parse(sample); + } catch (e) { + // sample is just plain string return it + return sample; + } + } + + // recover missing type + if (!schema) { + type = Array.isArray(sample) ? "array" : typeof sample; + } + + // generate xml sample recursively for array case + if (type === "array") { + if (!Array.isArray(sample)) { + if (typeof sample === "string") { + return sample; + } + sample = [sample]; + } + const itemSchema = schema ? + schema.items : + undefined; + if (itemSchema) { + itemSchema.xml = itemSchema.xml || xml || {}; + itemSchema.xml.name = itemSchema.xml.name || xml.name; + } + let itemSamples = sample. + map((s) => sampleFromSchemaGeneric(itemSchema, config, s, respectXML)); + itemSamples = handleMinMaxItems(itemSamples); + if (xml.wrapped) { + res[displayName] = itemSamples; + if (!(0,isEmpty_namespaceObject["default"])(_attr)) { + res[displayName].push({ _attr: _attr }); + } + } else + { + res = itemSamples; + } + return res; + } + + // generate xml sample recursively for object case + if (type === "object") { + // case literal example + if (typeof sample === "string") { + return sample; + } + for (let propName in sample) { + if (!Object.prototype.hasOwnProperty.call(sample, propName)) { + continue; + } + if (schema && props[propName] && props[propName].readOnly && !includeReadOnly) { + continue; + } + if (schema && props[propName] && props[propName].writeOnly && !includeWriteOnly) { + continue; + } + if (schema && props[propName] && props[propName].xml && props[propName].xml.attribute) { + _attr[props[propName].xml.name || propName] = sample[propName]; + continue; + } + addPropertyToResult(propName, sample[propName]); + } + if (!(0,isEmpty_namespaceObject["default"])(_attr)) { + res[displayName].push({ _attr: _attr }); + } + + return res; + } + + res[displayName] = !(0,isEmpty_namespaceObject["default"])(_attr) ? [{ _attr: _attr }, sample] : sample; + return res; + } + + // use schema to generate sample + + if (type === "object") { + for (let propName in props) { + if (!Object.prototype.hasOwnProperty.call(props, propName)) { + continue; + } + if (props[propName] && props[propName].deprecated) { + continue; + } + if (props[propName] && props[propName].readOnly && !includeReadOnly) { + continue; + } + if (props[propName] && props[propName].writeOnly && !includeWriteOnly) { + continue; + } + addPropertyToResult(propName); + } + if (respectXML && _attr) { + res[displayName].push({ _attr: _attr }); + } + + if (hasExceededMaxProperties()) { + return res; + } + + if (additionalProperties === true) { + if (respectXML) { + res[displayName].push({ additionalProp: "Anything can be here" }); + } else { + res.additionalProp1 = {}; + } + propertyAddedCounter++; + } else if (additionalProperties) { + const additionalProps = objectify(additionalProperties); + const additionalPropSample = sampleFromSchemaGeneric(additionalProps, config, undefined, respectXML); + + if (respectXML && additionalProps.xml && additionalProps.xml.name && additionalProps.xml.name !== "notagname") + { + res[displayName].push(additionalPropSample); + } else { + const toGenerateCount = schema.minProperties !== null && schema.minProperties !== undefined && propertyAddedCounter < schema.minProperties ? + schema.minProperties - propertyAddedCounter : + 3; + for (let i = 1; i <= toGenerateCount; i++) { + if (hasExceededMaxProperties()) { + return res; + } + if (respectXML) { + const temp = {}; + temp["additionalProp" + i] = additionalPropSample["notagname"]; + res[displayName].push(temp); + } else { + res["additionalProp" + i] = additionalPropSample; + } + propertyAddedCounter++; + } + } + } + return res; + } + + if (type === "array") { + if (!items) { + return; + } + + let sampleArray; + if (respectXML) {var _schema7; + items.xml = items.xml || ((_schema7 = schema) === null || _schema7 === void 0 ? void 0 : _schema7.xml) || {}; + items.xml.name = items.xml.name || xml.name; + } + + if (Array.isArray(items.anyOf)) { + sampleArray = items.anyOf.map((i) => sampleFromSchemaGeneric(liftSampleHelper(items, i, config), config, undefined, respectXML)); + } else if (Array.isArray(items.oneOf)) { + sampleArray = items.oneOf.map((i) => sampleFromSchemaGeneric(liftSampleHelper(items, i, config), config, undefined, respectXML)); + } else if (!respectXML || respectXML && xml.wrapped) { + sampleArray = [sampleFromSchemaGeneric(items, config, undefined, respectXML)]; + } else { + return sampleFromSchemaGeneric(items, config, undefined, respectXML); + } + sampleArray = handleMinMaxItems(sampleArray); + if (respectXML && xml.wrapped) { + res[displayName] = sampleArray; + if (!(0,isEmpty_namespaceObject["default"])(_attr)) { + res[displayName].push({ _attr: _attr }); + } + return res; + } + return sampleArray; + } + + let value; + if (schema && Array.isArray(schema.enum)) { + //display enum first value + value = normalizeArray(schema.enum)[0]; + } else if (schema) { + // display schema default + value = primitive(schema); + if (typeof value === "number") { + let min = schema.minimum; + if (min !== undefined && min !== null) { + if (schema.exclusiveMinimum) { + min++; + } + value = min; + } + let max = schema.maximum; + if (max !== undefined && max !== null) { + if (schema.exclusiveMaximum) { + max--; + } + value = max; + } + } + if (typeof value === "string") { + if (schema.maxLength !== null && schema.maxLength !== undefined) { + value = value.slice(0, schema.maxLength); + } + if (schema.minLength !== null && schema.minLength !== undefined) { + let i = 0; + while (value.length < schema.minLength) { + value += value[i++ % value.length]; + } + } + } + } else { + return; + } + if (type === "file") { + return; + } + + if (respectXML) { + res[displayName] = !(0,isEmpty_namespaceObject["default"])(_attr) ? [{ _attr: _attr }, value] : value; + return res; + } + + return value; +}; + +const inferSchema = (thing) => { + if (thing.schema) + thing = thing.schema; + + if (thing.properties) { + thing.type = "object"; + } + + return thing; // Hopefully this will have something schema like in it... `type` for example +}; + +const createXMLExample = (schema, config, o) => { + const json = sampleFromSchemaGeneric(schema, config, o, true); + if (!json) {return;} + if (typeof json === "string") { + return json; + } + return (0,external_xml_namespaceObject["default"])(json, { declaration: true, indent: "\t" }); +}; + +const sampleFromSchema = (schema, config, o) => +sampleFromSchemaGeneric(schema, config, o, false); + +const resolver = (arg1, arg2, arg3) => [arg1, JSON.stringify(arg2), JSON.stringify(arg3)]; + +const memoizedCreateXMLExample = utils_memoizeN(createXMLExample, resolver); + +const memoizedSampleFromSchema = utils_memoizeN(sampleFromSchema, resolver); +;// CONCATENATED MODULE: ./src/core/plugins/samples/fn/get-json-sample-schema.js +/** + * @prettier + */ + + +const shouldStringifyTypesConfig = [ +{ + when: /json/, + shouldStringifyTypes: ["string"] +}]; + +const defaultStringifyTypes = ["object"]; +const makeGetJsonSampleSchema = +(getSystem) => (schema, config, contentType, exampleOverride) => { + const { fn } = getSystem(); + const res = fn.memoizedSampleFromSchema(schema, config, exampleOverride); + const resType = typeof res; + + const typesToStringify = shouldStringifyTypesConfig.reduce( + (types, nextConfig) => + nextConfig.when.test(contentType) ? + [...types, ...nextConfig.shouldStringifyTypes] : + types, + defaultStringifyTypes + ); + + return (0,some_namespaceObject["default"])(typesToStringify, (x) => x === resType) ? + JSON.stringify(res, null, 2) : + res; +}; + +/* harmony default export */ const get_json_sample_schema = (makeGetJsonSampleSchema); +;// CONCATENATED MODULE: ./src/core/plugins/samples/fn/get-yaml-sample-schema.js +/** + * @prettier + */ + + +const makeGetYamlSampleSchema = +(getSystem) => (schema, config, contentType, exampleOverride) => { + const { fn } = getSystem(); + const jsonExample = fn.getJsonSampleSchema( + schema, + config, + contentType, + exampleOverride + ); + let yamlString; + try { + yamlString = external_js_yaml_namespaceObject["default"].dump( + external_js_yaml_namespaceObject["default"].load(jsonExample), + { + lineWidth: -1 // don't generate line folds + }, + { schema: external_js_yaml_namespaceObject.JSON_SCHEMA } + ); + if (yamlString[yamlString.length - 1] === "\n") { + yamlString = yamlString.slice(0, yamlString.length - 1); + } + } catch (e) { + console.error(e); + return "error: could not generate yaml example"; + } + return yamlString.replace(/\t/g, " "); +}; + +/* harmony default export */ const get_yaml_sample_schema = (makeGetYamlSampleSchema); +;// CONCATENATED MODULE: ./src/core/plugins/samples/fn/get-xml-sample-schema.js +/** + * @prettier + */ +const makeGetXmlSampleSchema = +(getSystem) => (schema, config, exampleOverride) => { + const { fn } = getSystem(); + + if (schema && !schema.xml) { + schema.xml = {}; + } + if (schema && !schema.xml.name) { + if ( + !schema.$$ref && ( + schema.type || + schema.items || + schema.properties || + schema.additionalProperties)) + { + // eslint-disable-next-line quotes + return '\n'; + } + if (schema.$$ref) { + let match = schema.$$ref.match(/\S*\/(\S+)$/); + schema.xml.name = match[1]; + } + } + + return fn.memoizedCreateXMLExample(schema, config, exampleOverride); +}; + +/* harmony default export */ const get_xml_sample_schema = (makeGetXmlSampleSchema); +;// CONCATENATED MODULE: ./src/core/plugins/samples/fn/get-sample-schema.js +/** + * @prettier + */ +const makeGetSampleSchema = +(getSystem) => +function (schema) {var _schema, _exampleOverride;let contentType = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "";let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};let exampleOverride = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; + const { fn } = getSystem(); + + if (typeof ((_schema = schema) === null || _schema === void 0 ? void 0 : _schema.toJS) === "function") { + schema = schema.toJS(); + } + if (typeof ((_exampleOverride = exampleOverride) === null || _exampleOverride === void 0 ? void 0 : _exampleOverride.toJS) === "function") { + exampleOverride = exampleOverride.toJS(); + } + + if (/xml/.test(contentType)) { + return fn.getXmlSampleSchema(schema, config, exampleOverride); + } + if (/(yaml|yml)/.test(contentType)) { + return fn.getYamlSampleSchema( + schema, + config, + contentType, + exampleOverride + ); + } + return fn.getJsonSampleSchema(schema, config, contentType, exampleOverride); +}; + +/* harmony default export */ const get_sample_schema = (makeGetSampleSchema); +;// CONCATENATED MODULE: ./src/core/plugins/samples/index.js +/** + * @prettier + */ + + + + + + + +const SamplesPlugin = (_ref) => {let { getSystem } = _ref;return { + fn: { + inferSchema: inferSchema, + sampleFromSchema: sampleFromSchema, + sampleFromSchemaGeneric: sampleFromSchemaGeneric, + createXMLExample: createXMLExample, + memoizedSampleFromSchema: memoizedSampleFromSchema, + memoizedCreateXMLExample: memoizedCreateXMLExample, + getJsonSampleSchema: get_json_sample_schema(getSystem), + getYamlSampleSchema: get_yaml_sample_schema(getSystem), + getXmlSampleSchema: get_xml_sample_schema(getSystem), + getSampleSchema: get_sample_schema(getSystem) + } + };}; + +/* harmony default export */ const samples = (SamplesPlugin); +;// CONCATENATED MODULE: ./src/core/plugins/spec/selectors.js + + + + +const DEFAULT_TAG = "default"; + +const OPERATION_METHODS = [ +"get", "put", "post", "delete", "options", "head", "patch", "trace"]; + + +const spec_selectors_state = (state) => { + return state || (0,external_immutable_namespaceObject.Map)(); +}; + +const selectors_lastError = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (spec) => spec.get("lastError") +); + +const url = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (spec) => spec.get("url") +); + +const specStr = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (spec) => spec.get("spec") || "" +); + +const specSource = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (spec) => spec.get("specSource") || "not-editor" +); + +const specJson = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (spec) => spec.get("json", (0,external_immutable_namespaceObject.Map)()) +); + +const specJS = (0,external_reselect_namespaceObject.createSelector)( + specJson, + (spec) => spec.toJS() +); + +const specResolved = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (spec) => spec.get("resolved", (0,external_immutable_namespaceObject.Map)()) +); + +const specResolvedSubtree = (state, path) => { + return state.getIn(["resolvedSubtrees", ...path], undefined); +}; + +const mergerFn = (oldVal, newVal) => { + if (external_immutable_namespaceObject.Map.isMap(oldVal) && external_immutable_namespaceObject.Map.isMap(newVal)) { + if (newVal.get("$$ref")) { + // resolver artifacts indicated that this key was directly resolved + // so we should drop the old value entirely + return newVal; + } + + return (0,external_immutable_namespaceObject.OrderedMap)().mergeWith( + mergerFn, + oldVal, + newVal + ); + } + + return newVal; +}; + +const specJsonWithResolvedSubtrees = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (spec) => (0,external_immutable_namespaceObject.OrderedMap)().mergeWith( + mergerFn, + spec.get("json"), + spec.get("resolvedSubtrees") + ) +); + +// Default Spec ( as an object ) +const spec = (state) => { + let res = specJson(state); + return res; +}; + +const isOAS3 = (0,external_reselect_namespaceObject.createSelector)( + // isOAS3 is stubbed out here to work around an issue with injecting more selectors + // in the OAS3 plugin, and to ensure that the function is always available. + // It's not perfect, but our hybrid (core+plugin code) implementation for OAS3 + // needs this. //KS + spec, + () => false +); + +const info = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => returnSelfOrNewMap(spec && spec.get("info")) +); + +const externalDocs = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => returnSelfOrNewMap(spec && spec.get("externalDocs")) +); + +const version = (0,external_reselect_namespaceObject.createSelector)( + info, + (info) => info && info.get("version") +); + +const semver = (0,external_reselect_namespaceObject.createSelector)( + version, + (version) => /v?([0-9]*)\.([0-9]*)\.([0-9]*)/i.exec(version).slice(1) +); + +const paths = (0,external_reselect_namespaceObject.createSelector)( + specJsonWithResolvedSubtrees, + (spec) => spec.get("paths") +); + +const validOperationMethods = (0,external_reselect_namespaceObject.createSelector)(() => ["get", "put", "post", "delete", "options", "head", "patch"]); + +const operations = (0,external_reselect_namespaceObject.createSelector)( + paths, + (paths) => { + if (!paths || paths.size < 1) + return (0,external_immutable_namespaceObject.List)(); + + let list = (0,external_immutable_namespaceObject.List)(); + + if (!paths || !paths.forEach) { + return (0,external_immutable_namespaceObject.List)(); + } + + paths.forEach((path, pathName) => { + if (!path || !path.forEach) { + return {}; + } + path.forEach((operation, method) => { + if (OPERATION_METHODS.indexOf(method) < 0) { + return; + } + list = list.push((0,external_immutable_namespaceObject.fromJS)({ + path: pathName, + method, + operation, + id: `${method}-${pathName}` + })); + }); + }); + + return list; + } +); + +const consumes = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => (0,external_immutable_namespaceObject.Set)(spec.get("consumes")) +); + +const produces = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => (0,external_immutable_namespaceObject.Set)(spec.get("produces")) +); + +const security = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => spec.get("security", (0,external_immutable_namespaceObject.List)()) +); + +const securityDefinitions = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => spec.get("securityDefinitions") +); + + +const findDefinition = (state, name) => { + const resolvedRes = state.getIn(["resolvedSubtrees", "definitions", name], null); + const unresolvedRes = state.getIn(["json", "definitions", name], null); + return resolvedRes || unresolvedRes || null; +}; + +const definitions = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => { + const res = spec.get("definitions"); + return external_immutable_namespaceObject.Map.isMap(res) ? res : (0,external_immutable_namespaceObject.Map)(); + } +); + +const basePath = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => spec.get("basePath") +); + +const host = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => spec.get("host") +); + +const schemes = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => spec.get("schemes", (0,external_immutable_namespaceObject.Map)()) +); + +const operationsWithRootInherited = (0,external_reselect_namespaceObject.createSelector)( + operations, + consumes, + produces, + (operations, consumes, produces) => { + return operations.map((ops) => ops.update("operation", (op) => { + if (op) { + if (!external_immutable_namespaceObject.Map.isMap(op)) {return;} + return op.withMutations((op) => { + if (!op.get("consumes")) { + op.update("consumes", (a) => (0,external_immutable_namespaceObject.Set)(a).merge(consumes)); + } + if (!op.get("produces")) { + op.update("produces", (a) => (0,external_immutable_namespaceObject.Set)(a).merge(produces)); + } + return op; + }); + } else { + // return something with Immutable methods + return (0,external_immutable_namespaceObject.Map)(); + } + + })); + } +); + +const tags = (0,external_reselect_namespaceObject.createSelector)( + spec, + (json) => { + const tags = json.get("tags", (0,external_immutable_namespaceObject.List)()); + return external_immutable_namespaceObject.List.isList(tags) ? tags.filter((tag) => external_immutable_namespaceObject.Map.isMap(tag)) : (0,external_immutable_namespaceObject.List)(); + } +); + +const tagDetails = (state, tag) => { + let currentTags = tags(state) || (0,external_immutable_namespaceObject.List)(); + return currentTags.filter(external_immutable_namespaceObject.Map.isMap).find((t) => t.get("name") === tag, (0,external_immutable_namespaceObject.Map)()); +}; + +const operationsWithTags = (0,external_reselect_namespaceObject.createSelector)( + operationsWithRootInherited, + tags, + (operations, tags) => { + return operations.reduce((taggedMap, op) => { + let tags = (0,external_immutable_namespaceObject.Set)(op.getIn(["operation", "tags"])); + if (tags.count() < 1) + return taggedMap.update(DEFAULT_TAG, (0,external_immutable_namespaceObject.List)(), (ar) => ar.push(op)); + return tags.reduce((res, tag) => res.update(tag, (0,external_immutable_namespaceObject.List)(), (ar) => ar.push(op)), taggedMap); + }, tags.reduce((taggedMap, tag) => { + return taggedMap.set(tag.get("name"), (0,external_immutable_namespaceObject.List)()); + }, (0,external_immutable_namespaceObject.OrderedMap)())); + } +); + +const selectors_taggedOperations = (state) => (_ref) => {let { getConfigs } = _ref; + let { tagsSorter, operationsSorter } = getConfigs(); + return operationsWithTags(state). + sortBy( + (val, key) => key, // get the name of the tag to be passed to the sorter + (tagA, tagB) => { + let sortFn = typeof tagsSorter === "function" ? tagsSorter : sorters.tagsSorter[tagsSorter]; + return !sortFn ? null : sortFn(tagA, tagB); + } + ). + map((ops, tag) => { + let sortFn = typeof operationsSorter === "function" ? operationsSorter : sorters.operationsSorter[operationsSorter]; + let operations = !sortFn ? ops : ops.sort(sortFn); + + return (0,external_immutable_namespaceObject.Map)({ tagDetails: tagDetails(state, tag), operations: operations }); + }); +}; + +const responses = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (state) => state.get("responses", (0,external_immutable_namespaceObject.Map)()) +); + +const requests = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (state) => state.get("requests", (0,external_immutable_namespaceObject.Map)()) +); + +const mutatedRequests = (0,external_reselect_namespaceObject.createSelector)( + spec_selectors_state, + (state) => state.get("mutatedRequests", (0,external_immutable_namespaceObject.Map)()) +); + +const responseFor = (state, path, method) => { + return responses(state).getIn([path, method], null); +}; + +const requestFor = (state, path, method) => { + return requests(state).getIn([path, method], null); +}; + +const mutatedRequestFor = (state, path, method) => { + return mutatedRequests(state).getIn([path, method], null); +}; + +const allowTryItOutFor = () => { + // This is just a hook for now. + return true; +}; + +const parameterWithMetaByIdentity = (state, pathMethod, param) => { + const opParams = specJsonWithResolvedSubtrees(state).getIn(["paths", ...pathMethod, "parameters"], (0,external_immutable_namespaceObject.OrderedMap)()); + const metaParams = state.getIn(["meta", "paths", ...pathMethod, "parameters"], (0,external_immutable_namespaceObject.OrderedMap)()); + + const mergedParams = opParams.map((currentParam) => { + const inNameKeyedMeta = metaParams.get(`${param.get("in")}.${param.get("name")}`); + const hashKeyedMeta = metaParams.get(`${param.get("in")}.${param.get("name")}.hash-${param.hashCode()}`); + return (0,external_immutable_namespaceObject.OrderedMap)().merge( + currentParam, + inNameKeyedMeta, + hashKeyedMeta + ); + }); + return mergedParams.find((curr) => curr.get("in") === param.get("in") && curr.get("name") === param.get("name"), (0,external_immutable_namespaceObject.OrderedMap)()); +}; + +const parameterInclusionSettingFor = (state, pathMethod, paramName, paramIn) => { + const paramKey = `${paramIn}.${paramName}`; + return state.getIn(["meta", "paths", ...pathMethod, "parameter_inclusions", paramKey], false); +}; + + +const parameterWithMeta = (state, pathMethod, paramName, paramIn) => { + const opParams = specJsonWithResolvedSubtrees(state).getIn(["paths", ...pathMethod, "parameters"], (0,external_immutable_namespaceObject.OrderedMap)()); + const currentParam = opParams.find((param) => param.get("in") === paramIn && param.get("name") === paramName, (0,external_immutable_namespaceObject.OrderedMap)()); + return parameterWithMetaByIdentity(state, pathMethod, currentParam); +}; + +const operationWithMeta = (state, path, method) => { + const op = specJsonWithResolvedSubtrees(state).getIn(["paths", path, method], (0,external_immutable_namespaceObject.OrderedMap)()); + const meta = state.getIn(["meta", "paths", path, method], (0,external_immutable_namespaceObject.OrderedMap)()); + + const mergedParams = op.get("parameters", (0,external_immutable_namespaceObject.List)()).map((param) => { + return parameterWithMetaByIdentity(state, [path, method], param); + }); + + return (0,external_immutable_namespaceObject.OrderedMap)(). + merge(op, meta). + set("parameters", mergedParams); +}; + +// Get the parameter value by parameter name +function getParameter(state, pathMethod, name, inType) { + pathMethod = pathMethod || []; + let params = state.getIn(["meta", "paths", ...pathMethod, "parameters"], (0,external_immutable_namespaceObject.fromJS)([])); + return params.find((p) => { + return external_immutable_namespaceObject.Map.isMap(p) && p.get("name") === name && p.get("in") === inType; + }) || (0,external_immutable_namespaceObject.Map)(); // Always return a map +} + +const hasHost = (0,external_reselect_namespaceObject.createSelector)( + spec, + (spec) => { + const host = spec.get("host"); + return typeof host === "string" && host.length > 0 && host[0] !== "/"; + } +); + +// Get the parameter values, that the user filled out +function parameterValues(state, pathMethod, isXml) { + pathMethod = pathMethod || []; + let paramValues = operationWithMeta(state, ...pathMethod).get("parameters", (0,external_immutable_namespaceObject.List)()); + return paramValues.reduce((hash, p) => { + let value = isXml && p.get("in") === "body" ? p.get("value_xml") : p.get("value"); + return hash.set(paramToIdentifier(p, { allowHashes: false }), value); + }, (0,external_immutable_namespaceObject.fromJS)({})); +} + +// True if any parameter includes `in: ?` +function parametersIncludeIn(parameters) {let inValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + if (external_immutable_namespaceObject.List.isList(parameters)) { + return parameters.some((p) => external_immutable_namespaceObject.Map.isMap(p) && p.get("in") === inValue); + } +} + +// True if any parameter includes `type: ?` +function parametersIncludeType(parameters) {let typeValue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ""; + if (external_immutable_namespaceObject.List.isList(parameters)) { + return parameters.some((p) => external_immutable_namespaceObject.Map.isMap(p) && p.get("type") === typeValue); + } +} + +// Get the consumes/produces value that the user selected +function contentTypeValues(state, pathMethod) { + pathMethod = pathMethod || []; + let op = specJsonWithResolvedSubtrees(state).getIn(["paths", ...pathMethod], (0,external_immutable_namespaceObject.fromJS)({})); + let meta = state.getIn(["meta", "paths", ...pathMethod], (0,external_immutable_namespaceObject.fromJS)({})); + let producesValue = currentProducesFor(state, pathMethod); + + const parameters = op.get("parameters") || new external_immutable_namespaceObject.List(); + + const requestContentType = + meta.get("consumes_value") ? meta.get("consumes_value") : + parametersIncludeType(parameters, "file") ? "multipart/form-data" : + parametersIncludeType(parameters, "formData") ? "application/x-www-form-urlencoded" : + undefined; + + + return (0,external_immutable_namespaceObject.fromJS)({ + requestContentType, + responseContentType: producesValue + }); +} + +// Get the currently selected produces value for an operation +function currentProducesFor(state, pathMethod) { + pathMethod = pathMethod || []; + + const operation = specJsonWithResolvedSubtrees(state).getIn(["paths", ...pathMethod], null); + + if (operation === null) { + // return nothing if the operation does not exist + return; + } + + const currentProducesValue = state.getIn(["meta", "paths", ...pathMethod, "produces_value"], null); + const firstProducesArrayItem = operation.getIn(["produces", 0], null); + + return currentProducesValue || firstProducesArrayItem || "application/json"; + +} + +// Get the produces options for an operation +function producesOptionsFor(state, pathMethod) { + pathMethod = pathMethod || []; + + const spec = specJsonWithResolvedSubtrees(state); + const operation = spec.getIn(["paths", ...pathMethod], null); + + if (operation === null) { + // return nothing if the operation does not exist + return; + } + + const [path] = pathMethod; + + const operationProduces = operation.get("produces", null); + const pathItemProduces = spec.getIn(["paths", path, "produces"], null); + const globalProduces = spec.getIn(["produces"], null); + + return operationProduces || pathItemProduces || globalProduces; +} + +// Get the consumes options for an operation +function consumesOptionsFor(state, pathMethod) { + pathMethod = pathMethod || []; + + const spec = specJsonWithResolvedSubtrees(state); + const operation = spec.getIn(["paths", ...pathMethod], null); + + if (operation === null) { + // return nothing if the operation does not exist + return; + } + + const [path] = pathMethod; + + const operationConsumes = operation.get("consumes", null); + const pathItemConsumes = spec.getIn(["paths", path, "consumes"], null); + const globalConsumes = spec.getIn(["consumes"], null); + + return operationConsumes || pathItemConsumes || globalConsumes; +} + +const operationScheme = (state, path, method) => { + let url = state.get("url"); + let matchResult = url.match(/^([a-z][a-z0-9+\-.]*):/); + let urlScheme = Array.isArray(matchResult) ? matchResult[1] : null; + + return state.getIn(["scheme", path, method]) || state.getIn(["scheme", "_defaultScheme"]) || urlScheme || ""; +}; + +const canExecuteScheme = (state, path, method) => { + return ["http", "https"].indexOf(operationScheme(state, path, method)) > -1; +}; + +const validationErrors = (state, pathMethod) => { + pathMethod = pathMethod || []; + let paramValues = state.getIn(["meta", "paths", ...pathMethod, "parameters"], (0,external_immutable_namespaceObject.fromJS)([])); + const result = []; + + paramValues.forEach((p) => { + let errors = p.get("errors"); + if (errors && errors.count()) { + errors.forEach((e) => result.push(e)); + } + }); + + return result; +}; + +const validateBeforeExecute = (state, pathMethod) => { + return validationErrors(state, pathMethod).length === 0; +}; + +const getOAS3RequiredRequestBodyContentType = (state, pathMethod) => { + let requiredObj = { + requestBody: false, + requestContentType: {} + }; + let requestBody = state.getIn(["resolvedSubtrees", "paths", ...pathMethod, "requestBody"], (0,external_immutable_namespaceObject.fromJS)([])); + if (requestBody.size < 1) { + return requiredObj; + } + if (requestBody.getIn(["required"])) { + requiredObj.requestBody = requestBody.getIn(["required"]); + } + requestBody.getIn(["content"]).entrySeq().forEach((contentType) => {// e.g application/json + const key = contentType[0]; + if (contentType[1].getIn(["schema", "required"])) { + const val = contentType[1].getIn(["schema", "required"]).toJS(); + requiredObj.requestContentType[key] = val; + } + }); + return requiredObj; +}; + +const isMediaTypeSchemaPropertiesEqual = (state, pathMethod, currentMediaType, targetMediaType) => { + if ((currentMediaType || targetMediaType) && currentMediaType === targetMediaType) { + return true; + } + let requestBodyContent = state.getIn(["resolvedSubtrees", "paths", ...pathMethod, "requestBody", "content"], (0,external_immutable_namespaceObject.fromJS)([])); + if (requestBodyContent.size < 2 || !currentMediaType || !targetMediaType) { + // nothing to compare + return false; + } + let currentMediaTypeSchemaProperties = requestBodyContent.getIn([currentMediaType, "schema", "properties"], (0,external_immutable_namespaceObject.fromJS)([])); + let targetMediaTypeSchemaProperties = requestBodyContent.getIn([targetMediaType, "schema", "properties"], (0,external_immutable_namespaceObject.fromJS)([])); + return !!currentMediaTypeSchemaProperties.equals(targetMediaTypeSchemaProperties); +}; + +function returnSelfOrNewMap(obj) { + // returns obj if obj is an Immutable map, else returns a new Map + return external_immutable_namespaceObject.Map.isMap(obj) ? obj : new external_immutable_namespaceObject.Map(); +} +;// CONCATENATED MODULE: external "lodash/isString" +var isString_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var isString_y = x => () => x +const isString_namespaceObject = isString_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_isString_e6fa8a5b__["default"] }); +;// CONCATENATED MODULE: external "lodash/debounce" +var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var debounce_y = x => () => x +const debounce_namespaceObject = debounce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"] }); +;// CONCATENATED MODULE: external "lodash/set" +var set_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var set_y = x => () => x +const set_namespaceObject = set_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_set_b4b15ee5__["default"] }); +;// CONCATENATED MODULE: external "lodash/fp/assocPath" +var assocPath_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var assocPath_y = x => () => x +const assocPath_namespaceObject = assocPath_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_fp_assocPath_f9d64e33__["default"] }); +;// CONCATENATED MODULE: external "lodash/constant" +var constant_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var constant_y = x => () => x +const constant_namespaceObject = constant_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_constant_f5c0879f__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/spec/actions.js +const actions_excluded = ["path", "method"]; + + + + + + + + + + + +// Actions conform to FSA (flux-standard-actions) +// {type: string,payload: Any|Error, meta: obj, error: bool} + +const UPDATE_SPEC = "spec_update_spec"; +const UPDATE_URL = "spec_update_url"; +const UPDATE_JSON = "spec_update_json"; +const UPDATE_PARAM = "spec_update_param"; +const UPDATE_EMPTY_PARAM_INCLUSION = "spec_update_empty_param_inclusion"; +const VALIDATE_PARAMS = "spec_validate_param"; +const SET_RESPONSE = "spec_set_response"; +const SET_REQUEST = "spec_set_request"; +const SET_MUTATED_REQUEST = "spec_set_mutated_request"; +const LOG_REQUEST = "spec_log_request"; +const CLEAR_RESPONSE = "spec_clear_response"; +const CLEAR_REQUEST = "spec_clear_request"; +const CLEAR_VALIDATE_PARAMS = "spec_clear_validate_param"; +const UPDATE_OPERATION_META_VALUE = "spec_update_operation_meta_value"; +const UPDATE_RESOLVED = "spec_update_resolved"; +const UPDATE_RESOLVED_SUBTREE = "spec_update_resolved_subtree"; +const SET_SCHEME = "set_scheme"; + +const toStr = (str) => (0,isString_namespaceObject["default"])(str) ? str : ""; + +function updateSpec(spec) { + const cleanSpec = toStr(spec).replace(/\t/g, " "); + if (typeof spec === "string") { + return { + type: UPDATE_SPEC, + payload: cleanSpec + }; + } +} + +function updateResolved(spec) { + return { + type: UPDATE_RESOLVED, + payload: spec + }; +} + +function updateUrl(url) { + return { type: UPDATE_URL, payload: url }; +} + +function updateJsonSpec(json) { + return { type: UPDATE_JSON, payload: json }; +} + +const parseToJson = (str) => (_ref) => {let { specActions, specSelectors, errActions } = _ref; + let { specStr } = specSelectors; + + let json = null; + try { + str = str || specStr(); + errActions.clear({ source: "parser" }); + json = external_js_yaml_namespaceObject["default"].load(str, { schema: external_js_yaml_namespaceObject.JSON_SCHEMA }); + } catch (e) { + // TODO: push error to state + console.error(e); + return errActions.newSpecErr({ + source: "parser", + level: "error", + message: e.reason, + line: e.mark && e.mark.line ? e.mark.line + 1 : undefined + }); + } + if (json && typeof json === "object") { + return specActions.updateJsonSpec(json); + } + return {}; +}; + +let hasWarnedAboutResolveSpecDeprecation = false; + +const resolveSpec = (json, url) => (_ref2) => {let { specActions, specSelectors, errActions, fn: { fetch, resolve, AST = {} }, getConfigs } = _ref2; + if (!hasWarnedAboutResolveSpecDeprecation) { + console.warn(`specActions.resolveSpec is deprecated since v3.10.0 and will be removed in v4.0.0; use requestResolvedSubtree instead!`); + hasWarnedAboutResolveSpecDeprecation = true; + } + + const { + modelPropertyMacro, + parameterMacro, + requestInterceptor, + responseInterceptor + } = getConfigs(); + + if (typeof json === "undefined") { + json = specSelectors.specJson(); + } + if (typeof url === "undefined") { + url = specSelectors.url(); + } + + let getLineNumberForPath = AST.getLineNumberForPath ? AST.getLineNumberForPath : () => undefined; + + let specStr = specSelectors.specStr(); + + return resolve({ + fetch, + spec: json, + baseDoc: url, + modelPropertyMacro, + parameterMacro, + requestInterceptor, + responseInterceptor + }).then((_ref3) => {let { spec, errors } = _ref3; + errActions.clear({ + type: "thrown" + }); + if (Array.isArray(errors) && errors.length > 0) { + let preparedErrors = errors. + map((err) => { + console.error(err); + err.line = err.fullPath ? getLineNumberForPath(specStr, err.fullPath) : null; + err.path = err.fullPath ? err.fullPath.join(".") : null; + err.level = "error"; + err.type = "thrown"; + err.source = "resolver"; + Object.defineProperty(err, "message", { enumerable: true, value: err.message }); + return err; + }); + errActions.newThrownErrBatch(preparedErrors); + } + + return specActions.updateResolved(spec); + }); +}; + +let requestBatch = []; + +const debResolveSubtrees = (0,debounce_namespaceObject["default"])(() => { + const systemPartitionedBatches = requestBatch.reduce((acc, _ref4) => {let { path, system } = _ref4; + if (!acc.has(system)) acc.set(system, []); + acc.get(system).push(path); + return acc; + }, new Map()); + + requestBatch = []; // clear stack + + systemPartitionedBatches.forEach(async (systemRequestBatch, system) => {var _AST$getLineNumberFor; + if (!system) { + console.error("debResolveSubtrees: don't have a system to operate on, aborting."); + return; + } + if (!system.fn.resolveSubtree) { + console.error("Error: Swagger-Client did not provide a `resolveSubtree` method, doing nothing."); + return; + } + const { + errActions, + errSelectors, + fn: { + resolveSubtree, + fetch, + AST = {} + }, + specSelectors, + specActions + } = system; + const getLineNumberForPath = (_AST$getLineNumberFor = AST.getLineNumberForPath) !== null && _AST$getLineNumberFor !== void 0 ? _AST$getLineNumberFor : (0,constant_namespaceObject["default"])(undefined); + const specStr = specSelectors.specStr(); + const { + modelPropertyMacro, + parameterMacro, + requestInterceptor, + responseInterceptor + } = system.getConfigs(); + + try { + const batchResult = await systemRequestBatch.reduce(async (prev, path) => { + let { resultMap, specWithCurrentSubtrees } = await prev; + const { errors, spec } = await resolveSubtree(specWithCurrentSubtrees, path, { + baseDoc: specSelectors.url(), + modelPropertyMacro, + parameterMacro, + requestInterceptor, + responseInterceptor + }); + + if (errSelectors.allErrors().size) { + errActions.clearBy((err) => { + // keep if... + return err.get("type") !== "thrown" // it's not a thrown error + || err.get("source") !== "resolver" // it's not a resolver error + || !err.get("fullPath").every((key, i) => key === path[i] || path[i] === undefined); // it's not within the path we're resolving + }); + } + + if (Array.isArray(errors) && errors.length > 0) { + let preparedErrors = errors. + map((err) => { + err.line = err.fullPath ? getLineNumberForPath(specStr, err.fullPath) : null; + err.path = err.fullPath ? err.fullPath.join(".") : null; + err.level = "error"; + err.type = "thrown"; + err.source = "resolver"; + Object.defineProperty(err, "message", { enumerable: true, value: err.message }); + return err; + }); + errActions.newThrownErrBatch(preparedErrors); + } + + if (spec && specSelectors.isOAS3() && path[0] === "components" && path[1] === "securitySchemes") { + // Resolve OIDC URLs if present + await Promise.all(Object.values(spec). + filter((scheme) => scheme.type === "openIdConnect"). + map(async (oidcScheme) => { + const req = { + url: oidcScheme.openIdConnectUrl, + requestInterceptor: requestInterceptor, + responseInterceptor: responseInterceptor + }; + try { + const res = await fetch(req); + if (res instanceof Error || res.status >= 400) { + console.error(res.statusText + " " + req.url); + } else { + oidcScheme.openIdConnectData = JSON.parse(res.text); + } + } catch (e) { + console.error(e); + } + })); + } + (0,set_namespaceObject["default"])(resultMap, path, spec); + specWithCurrentSubtrees = (0,assocPath_namespaceObject["default"])(path, spec, specWithCurrentSubtrees); + + return { + resultMap, + specWithCurrentSubtrees + }; + }, Promise.resolve({ + resultMap: (specSelectors.specResolvedSubtree([]) || (0,external_immutable_namespaceObject.Map)()).toJS(), + specWithCurrentSubtrees: specSelectors.specJS() + })); + + specActions.updateResolvedSubtree([], batchResult.resultMap); + } catch (e) { + console.error(e); + } + }); +}, 35); + +const requestResolvedSubtree = (path) => (system) => { + const isPathAlreadyBatched = requestBatch.find((_ref5) => {let { path: batchedPath, system: batchedSystem } = _ref5; + return batchedSystem === system && batchedPath.toString() === path.toString(); + }); + + if (isPathAlreadyBatched) { + return; + } + + requestBatch.push({ path, system }); + + debResolveSubtrees(); +}; + +function changeParam(path, paramName, paramIn, value, isXml) { + return { + type: UPDATE_PARAM, + payload: { path, value, paramName, paramIn, isXml } + }; +} + +function changeParamByIdentity(pathMethod, param, value, isXml) { + return { + type: UPDATE_PARAM, + payload: { path: pathMethod, param, value, isXml } + }; +} + +const updateResolvedSubtree = (path, value) => { + return { + type: UPDATE_RESOLVED_SUBTREE, + payload: { path, value } + }; +}; + +const invalidateResolvedSubtreeCache = () => { + return { + type: UPDATE_RESOLVED_SUBTREE, + payload: { + path: [], + value: (0,external_immutable_namespaceObject.Map)() + } + }; +}; + +const validateParams = (payload, isOAS3) => { + return { + type: VALIDATE_PARAMS, + payload: { + pathMethod: payload, + isOAS3 + } + }; +}; + +const updateEmptyParamInclusion = (pathMethod, paramName, paramIn, includeEmptyValue) => { + return { + type: UPDATE_EMPTY_PARAM_INCLUSION, + payload: { + pathMethod, + paramName, + paramIn, + includeEmptyValue + } + }; +}; + +function clearValidateParams(payload) { + return { + type: CLEAR_VALIDATE_PARAMS, + payload: { pathMethod: payload } + }; +} + +function changeConsumesValue(path, value) { + return { + type: UPDATE_OPERATION_META_VALUE, + payload: { path, value, key: "consumes_value" } + }; +} + +function changeProducesValue(path, value) { + return { + type: UPDATE_OPERATION_META_VALUE, + payload: { path, value, key: "produces_value" } + }; +} + +const setResponse = (path, method, res) => { + return { + payload: { path, method, res }, + type: SET_RESPONSE + }; +}; + +const setRequest = (path, method, req) => { + return { + payload: { path, method, req }, + type: SET_REQUEST + }; +}; + +const setMutatedRequest = (path, method, req) => { + return { + payload: { path, method, req }, + type: SET_MUTATED_REQUEST + }; +}; + +// This is for debugging, remove this comment if you depend on this action +const logRequest = (req) => { + return { + payload: req, + type: LOG_REQUEST + }; +}; + +// Actually fire the request via fn.execute +// (For debugging) and ease of testing +const executeRequest = (req) => +(_ref6) => {let { fn, specActions, specSelectors, getConfigs, oas3Selectors } = _ref6; + let { pathName, method, operation } = req; + let { requestInterceptor, responseInterceptor } = getConfigs(); + + + let op = operation.toJS(); + + // ensure that explicitly-included params are in the request + + if (operation && operation.get("parameters")) { + operation.get("parameters"). + filter((param) => param && param.get("allowEmptyValue") === true). + forEach((param) => { + if (specSelectors.parameterInclusionSettingFor([pathName, method], param.get("name"), param.get("in"))) { + req.parameters = req.parameters || {}; + const paramValue = paramToValue(param, req.parameters); + + // if the value is falsy or an empty Immutable iterable... + if (!paramValue || paramValue && paramValue.size === 0) { + // set it to empty string, so Swagger Client will treat it as + // present but empty. + req.parameters[param.get("name")] = ""; + } + } + }); + } + + // if url is relative, parseUrl makes it absolute by inferring from `window.location` + req.contextUrl = (0,external_url_parse_namespaceObject["default"])(specSelectors.url()).toString(); + + if (op && op.operationId) { + req.operationId = op.operationId; + } else if (op && pathName && method) { + req.operationId = fn.opId(op, pathName, method); + } + + if (specSelectors.isOAS3()) { + const namespace = `${pathName}:${method}`; + + req.server = oas3Selectors.selectedServer(namespace) || oas3Selectors.selectedServer(); + + const namespaceVariables = oas3Selectors.serverVariables({ + server: req.server, + namespace + }).toJS(); + const globalVariables = oas3Selectors.serverVariables({ server: req.server }).toJS(); + + req.serverVariables = Object.keys(namespaceVariables).length ? namespaceVariables : globalVariables; + + req.requestContentType = oas3Selectors.requestContentType(pathName, method); + req.responseContentType = oas3Selectors.responseContentType(pathName, method) || "*/*"; + const requestBody = oas3Selectors.requestBodyValue(pathName, method); + const requestBodyInclusionSetting = oas3Selectors.requestBodyInclusionSetting(pathName, method); + + if (requestBody && requestBody.toJS) { + req.requestBody = requestBody. + map( + (val) => { + if (external_immutable_namespaceObject.Map.isMap(val)) { + return val.get("value"); + } + return val; + } + ). + filter( + (value, key) => (Array.isArray(value) ? + value.length !== 0 : + !isEmptyValue(value)) || + requestBodyInclusionSetting.get(key) + ). + toJS(); + } else { + req.requestBody = requestBody; + } + } + + let parsedRequest = Object.assign({}, req); + parsedRequest = fn.buildRequest(parsedRequest); + + specActions.setRequest(req.pathName, req.method, parsedRequest); + + let requestInterceptorWrapper = async (r) => { + let mutatedRequest = await requestInterceptor.apply(undefined, [r]); + let parsedMutatedRequest = Object.assign({}, mutatedRequest); + specActions.setMutatedRequest(req.pathName, req.method, parsedMutatedRequest); + return mutatedRequest; + }; + + req.requestInterceptor = requestInterceptorWrapper; + req.responseInterceptor = responseInterceptor; + + // track duration of request + const startTime = Date.now(); + + + return fn.execute(req). + then((res) => { + res.duration = Date.now() - startTime; + specActions.setResponse(req.pathName, req.method, res); + }). + catch( + (err) => { + // console.error(err) + if (err.message === "Failed to fetch") { + err.name = ""; + err.message = "**Failed to fetch.** \n**Possible Reasons:** \n - CORS \n - Network Failure \n - URL scheme must be \"http\" or \"https\" for CORS request."; + } + specActions.setResponse(req.pathName, req.method, { + error: true, err: (0,external_serialize_error_namespaceObject.serializeError)(err) + }); + } + ); +}; + + +// I'm using extras as a way to inject properties into the final, `execute` method - It's not great. Anyone have a better idea? @ponelat +const actions_execute = function () {let _ref7 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};let { path, method } = _ref7,extras = (0,objectWithoutProperties_namespaceObject["default"])(_ref7, actions_excluded);return (system) => { + let { fn: { fetch }, specSelectors, specActions } = system; + let spec = specSelectors.specJsonWithResolvedSubtrees().toJS(); + let scheme = specSelectors.operationScheme(path, method); + let { requestContentType, responseContentType } = specSelectors.contentTypeValues([path, method]).toJS(); + let isXml = /xml/i.test(requestContentType); + let parameters = specSelectors.parameterValues([path, method], isXml).toJS(); + + return specActions.executeRequest((0,objectSpread2_namespaceObject["default"])((0,objectSpread2_namespaceObject["default"])({}, + extras), {}, { + fetch, + spec, + pathName: path, + method, parameters, + requestContentType, + scheme, + responseContentType }) + ); + };}; + +function clearResponse(path, method) { + return { + type: CLEAR_RESPONSE, + payload: { path, method } + }; +} + +function clearRequest(path, method) { + return { + type: CLEAR_REQUEST, + payload: { path, method } + }; +} + +function setScheme(scheme, path, method) { + return { + type: SET_SCHEME, + payload: { scheme, path, method } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/spec/reducers.js + + + + +// selector-in-reducer is suboptimal, but `operationWithMeta` is more of a helper + + + + + + +/* harmony default export */ const spec_reducers = ({ + + [UPDATE_SPEC]: (state, action) => { + return typeof action.payload === "string" ? + state.set("spec", action.payload) : + state; + }, + + [UPDATE_URL]: (state, action) => { + return state.set("url", action.payload + ""); + }, + + [UPDATE_JSON]: (state, action) => { + return state.set("json", fromJSOrdered(action.payload)); + }, + + [UPDATE_RESOLVED]: (state, action) => { + return state.setIn(["resolved"], fromJSOrdered(action.payload)); + }, + + [UPDATE_RESOLVED_SUBTREE]: (state, action) => { + const { value, path } = action.payload; + return state.setIn(["resolvedSubtrees", ...path], fromJSOrdered(value)); + }, + + [UPDATE_PARAM]: (state, _ref) => {let { payload } = _ref; + let { path: pathMethod, paramName, paramIn, param, value, isXml } = payload; + + let paramKey = param ? paramToIdentifier(param) : `${paramIn}.${paramName}`; + + const valueKey = isXml ? "value_xml" : "value"; + + return state.setIn( + ["meta", "paths", ...pathMethod, "parameters", paramKey, valueKey], + value + ); + }, + + [UPDATE_EMPTY_PARAM_INCLUSION]: (state, _ref2) => {let { payload } = _ref2; + let { pathMethod, paramName, paramIn, includeEmptyValue } = payload; + + if (!paramName || !paramIn) { + console.warn("Warning: UPDATE_EMPTY_PARAM_INCLUSION could not generate a paramKey."); + return state; + } + + const paramKey = `${paramIn}.${paramName}`; + + return state.setIn( + ["meta", "paths", ...pathMethod, "parameter_inclusions", paramKey], + includeEmptyValue + ); + }, + + [VALIDATE_PARAMS]: (state, _ref3) => {let { payload: { pathMethod, isOAS3 } } = _ref3; + const op = specJsonWithResolvedSubtrees(state).getIn(["paths", ...pathMethod]); + const paramValues = parameterValues(state, pathMethod).toJS(); + + return state.updateIn(["meta", "paths", ...pathMethod, "parameters"], (0,external_immutable_namespaceObject.fromJS)({}), (paramMeta) => { + return op.get("parameters", (0,external_immutable_namespaceObject.List)()).reduce((res, param) => { + const value = paramToValue(param, paramValues); + const isEmptyValueIncluded = parameterInclusionSettingFor(state, pathMethod, param.get("name"), param.get("in")); + const errors = validateParam(param, value, { + bypassRequiredCheck: isEmptyValueIncluded, + isOAS3 + }); + return res.setIn([paramToIdentifier(param), "errors"], (0,external_immutable_namespaceObject.fromJS)(errors)); + }, paramMeta); + }); + }, + [CLEAR_VALIDATE_PARAMS]: (state, _ref4) => {let { payload: { pathMethod } } = _ref4; + return state.updateIn(["meta", "paths", ...pathMethod, "parameters"], (0,external_immutable_namespaceObject.fromJS)([]), (parameters) => { + return parameters.map((param) => param.set("errors", (0,external_immutable_namespaceObject.fromJS)([]))); + }); + }, + + [SET_RESPONSE]: (state, _ref5) => {let { payload: { res, path, method } } = _ref5; + let result; + if (res.error) { + result = Object.assign({ + error: true, + name: res.err.name, + message: res.err.message, + statusCode: res.err.statusCode + }, res.err.response); + } else { + result = res; + } + + // Ensure headers + result.headers = result.headers || {}; + + let newState = state.setIn(["responses", path, method], fromJSOrdered(result)); + + // ImmutableJS messes up Blob. Needs to reset its value. + if (core_window.Blob && res.data instanceof core_window.Blob) { + newState = newState.setIn(["responses", path, method, "text"], res.data); + } + return newState; + }, + + [SET_REQUEST]: (state, _ref6) => {let { payload: { req, path, method } } = _ref6; + return state.setIn(["requests", path, method], fromJSOrdered(req)); + }, + + [SET_MUTATED_REQUEST]: (state, _ref7) => {let { payload: { req, path, method } } = _ref7; + return state.setIn(["mutatedRequests", path, method], fromJSOrdered(req)); + }, + + [UPDATE_OPERATION_META_VALUE]: (state, _ref8) => {let { payload: { path, value, key } } = _ref8; + // path is a pathMethod tuple... can't change the name now. + let operationPath = ["paths", ...path]; + let metaPath = ["meta", "paths", ...path]; + + if ( + !state.getIn(["json", ...operationPath]) && + !state.getIn(["resolved", ...operationPath]) && + !state.getIn(["resolvedSubtrees", ...operationPath])) + { + // do nothing if the operation does not exist + return state; + } + + return state.setIn([...metaPath, key], (0,external_immutable_namespaceObject.fromJS)(value)); + }, + + [CLEAR_RESPONSE]: (state, _ref9) => {let { payload: { path, method } } = _ref9; + return state.deleteIn(["responses", path, method]); + }, + + [CLEAR_REQUEST]: (state, _ref10) => {let { payload: { path, method } } = _ref10; + return state.deleteIn(["requests", path, method]); + }, + + [SET_SCHEME]: (state, _ref11) => {let { payload: { scheme, path, method } } = _ref11; + if (path && method) { + return state.setIn(["scheme", path, method], scheme); + } + + if (!path && !method) { + return state.setIn(["scheme", "_defaultScheme"], scheme); + } + + } + +}); +;// CONCATENATED MODULE: ./src/core/plugins/spec/wrap-actions.js + + +const wrap_actions_updateSpec = (ori, _ref) => {let { specActions } = _ref;return function () { + ori(...arguments); + specActions.parseToJson(...arguments); + };}; + +const wrap_actions_updateJsonSpec = (ori, _ref2) => {let { specActions } = _ref2;return function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];} + ori(...args); + + specActions.invalidateResolvedSubtreeCache(); + + // Trigger resolution of any path-level $refs. + const [json] = args; + const pathItems = (0,get_namespaceObject["default"])(json, ["paths"]) || {}; + const pathItemKeys = Object.keys(pathItems); + + pathItemKeys.forEach((k) => { + const val = (0,get_namespaceObject["default"])(pathItems, [k]); + + if (val.$ref) { + specActions.requestResolvedSubtree(["paths", k]); + } + }); + + // Trigger resolution of any securitySchemes-level $refs. + specActions.requestResolvedSubtree(["components", "securitySchemes"]); + };}; + +// Log the request ( just for debugging, shouldn't affect prod ) +const wrap_actions_executeRequest = (ori, _ref3) => {let { specActions } = _ref3;return (req) => { + specActions.logRequest(req); + return ori(req); + };}; + +const wrap_actions_validateParams = (ori, _ref4) => {let { specSelectors } = _ref4;return (req) => { + return ori(req, specSelectors.isOAS3()); + };}; +;// CONCATENATED MODULE: ./src/core/plugins/spec/index.js + /** + * @prettier + */ + + + + + +const SpecPlugin = () => ({ + statePlugins: { + spec: { + wrapActions: (0,objectSpread2_namespaceObject["default"])({}, spec_wrap_actions_namespaceObject), + reducers: (0,objectSpread2_namespaceObject["default"])({}, spec_reducers), + actions: (0,objectSpread2_namespaceObject["default"])({}, plugins_spec_actions_namespaceObject), + selectors: (0,objectSpread2_namespaceObject["default"])({}, spec_selectors_namespaceObject) + } + } +}); + +/* harmony default export */ const plugins_spec = (SpecPlugin); +;// CONCATENATED MODULE: external "swagger-client/es/resolver/strategies/generic" +var generic_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var generic_y = x => () => x +const generic_namespaceObject = generic_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_strategies_generic_08dd5200__["default"] }); +;// CONCATENATED MODULE: external "swagger-client/es/resolver/strategies/openapi-2" +var openapi_2_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var openapi_2_y = x => () => x +const openapi_2_namespaceObject = openapi_2_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_strategies_openapi_2_ff6e79cf__["default"] }); +;// CONCATENATED MODULE: external "swagger-client/es/resolver/strategies/openapi-3-0" +var openapi_3_0_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var openapi_3_0_y = x => () => x +const openapi_3_0_namespaceObject = openapi_3_0_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_strategies_openapi_3_0_2fa0ff7c__["default"] }); +;// CONCATENATED MODULE: external "swagger-client/es/resolver/strategies/openapi-3-1-apidom" +var openapi_3_1_apidom_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var openapi_3_1_apidom_y = x => () => x +const openapi_3_1_apidom_namespaceObject = openapi_3_1_apidom_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_strategies_openapi_3_1_apidom_5e628d39__["default"] }); +;// CONCATENATED MODULE: external "swagger-client/es/resolver" +var resolver_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var resolver_y = x => () => x +const resolver_namespaceObject = resolver_x({ ["makeResolve"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_resolver_f879c638__.makeResolve }); +;// CONCATENATED MODULE: external "swagger-client/es/execute" +var execute_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var execute_y = x => () => x +const execute_namespaceObject = execute_x({ ["buildRequest"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_execute_d486d3d6__.buildRequest, ["execute"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_execute_d486d3d6__.execute }); +;// CONCATENATED MODULE: external "swagger-client/es/http" +var es_http_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var es_http_y = x => () => x +const es_http_namespaceObject = es_http_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_http_69655560__["default"], ["makeHttp"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_http_69655560__.makeHttp, ["serializeRes"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_http_69655560__.serializeRes }); +;// CONCATENATED MODULE: external "swagger-client/es/subtree-resolver" +var subtree_resolver_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var subtree_resolver_y = x => () => x +const subtree_resolver_namespaceObject = subtree_resolver_x({ ["makeResolveSubtree"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_subtree_resolver_741cb9d9__.makeResolveSubtree }); +;// CONCATENATED MODULE: external "swagger-client/es/helpers" +var helpers_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var helpers_y = x => () => x +const es_helpers_namespaceObject = helpers_x({ ["opId"]: () => __WEBPACK_EXTERNAL_MODULE_swagger_client_es_helpers_4d7bea47__.opId }); +;// CONCATENATED MODULE: ./src/core/plugins/swagger-client/configs-wrap-actions.js +const configs_wrap_actions_loaded = (ori, system) => function () { + ori(...arguments); + const value = system.getConfigs().withCredentials; + + if (value !== undefined) { + system.fn.fetch.withCredentials = typeof value === "string" ? value === "true" : !!value; + } +}; +;// CONCATENATED MODULE: ./src/core/plugins/swagger-client/index.js + + + + + + + + + + + +/* harmony default export */ function swagger_client(_ref) {let { configs, getConfigs } = _ref; + return { + fn: { + fetch: (0,es_http_namespaceObject.makeHttp)(es_http_namespaceObject["default"], configs.preFetch, configs.postFetch), + buildRequest: execute_namespaceObject.buildRequest, + execute: execute_namespaceObject.execute, + resolve: (0,resolver_namespaceObject.makeResolve)({ + strategies: [ + openapi_3_1_apidom_namespaceObject["default"], + openapi_3_0_namespaceObject["default"], + openapi_2_namespaceObject["default"], + generic_namespaceObject["default"]] + + }), + resolveSubtree: async function (obj, path) {let options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + const freshConfigs = getConfigs(); + const defaultOptions = { + modelPropertyMacro: freshConfigs.modelPropertyMacro, + parameterMacro: freshConfigs.parameterMacro, + requestInterceptor: freshConfigs.requestInterceptor, + responseInterceptor: freshConfigs.responseInterceptor, + strategies: [ + openapi_3_1_apidom_namespaceObject["default"], + openapi_3_0_namespaceObject["default"], + openapi_2_namespaceObject["default"], + generic_namespaceObject["default"]] + + }; + + return (0,subtree_resolver_namespaceObject.makeResolveSubtree)(defaultOptions)(obj, path, options); + }, + serializeRes: es_http_namespaceObject.serializeRes, + opId: es_helpers_namespaceObject.opId + }, + statePlugins: { + configs: { + wrapActions: { + loaded: configs_wrap_actions_loaded + } + } + } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/util/index.js + + +/* harmony default export */ function util() { + return { + fn: { shallowEqualKeys: shallowEqualKeys } + }; +} +;// CONCATENATED MODULE: external "react-dom" +var external_react_dom_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_react_dom_y = x => () => x +const external_react_dom_namespaceObject = external_react_dom_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_dom_7dac9eee__["default"] }); +;// CONCATENATED MODULE: external "react-redux" +var external_react_redux_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_react_redux_y = x => () => x +const external_react_redux_namespaceObject = external_react_redux_x({ ["Provider"]: () => __WEBPACK_EXTERNAL_MODULE_react_redux_87be03b0__.Provider, ["connect"]: () => __WEBPACK_EXTERNAL_MODULE_react_redux_87be03b0__.connect }); +;// CONCATENATED MODULE: external "lodash/identity" +var identity_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var identity_y = x => () => x +const identity_namespaceObject = identity_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_identity_75ffe4a7__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/view/root-injects.jsx + + + + + + + +const withSystem = (getSystem) => (WrappedComponent) => { + const { fn } = getSystem(); + + class WithSystem extends external_react_namespaceObject.Component { + render() { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(WrappedComponent, (0,extends_namespaceObject["default"])({}, getSystem(), this.props, this.context)); + } + } + WithSystem.displayName = `WithSystem(${fn.getDisplayName(WrappedComponent)})`; + return WithSystem; +}; + +const withRoot = (getSystem, reduxStore) => (WrappedComponent) => { + const { fn } = getSystem(); + + class WithRoot extends external_react_namespaceObject.Component { + render() { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(external_react_redux_namespaceObject.Provider, { store: reduxStore }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(WrappedComponent, (0,extends_namespaceObject["default"])({}, this.props, this.context)) + )); + + } + } + WithRoot.displayName = `WithRoot(${fn.getDisplayName(WrappedComponent)})`; + return WithRoot; +}; + +const withConnect = (getSystem, WrappedComponent, reduxStore) => { + const mapStateToProps = (state, ownProps) => {var _WrappedComponent$pro; + const props = (0,objectSpread2_namespaceObject["default"])((0,objectSpread2_namespaceObject["default"])({}, ownProps), getSystem()); + const customMapStateToProps = ((_WrappedComponent$pro = WrappedComponent.prototype) === null || _WrappedComponent$pro === void 0 ? void 0 : _WrappedComponent$pro.mapStateToProps) || ((state) => ({ state })); + return customMapStateToProps(state, props); + }; + + return (0,external_redux_namespaceObject.compose)( + reduxStore ? withRoot(getSystem, reduxStore) : identity_namespaceObject["default"], + (0,external_react_redux_namespaceObject.connect)(mapStateToProps), + withSystem(getSystem) + )(WrappedComponent); +}; + +const handleProps = (getSystem, mapping, props, oldProps) => { + for (const prop in mapping) { + const fn = mapping[prop]; + + if (typeof fn === "function") { + fn(props[prop], oldProps[prop], getSystem()); + } + } +}; + +const withMappedContainer = (getSystem, getStore, memGetComponent) => (componentName, mapping) => { + const { fn } = getSystem(); + const WrappedComponent = memGetComponent(componentName, "root"); + + class WithMappedContainer extends external_react_namespaceObject.Component { + constructor(props, context) { + super(props, context); + handleProps(getSystem, mapping, props, {}); + } + + UNSAFE_componentWillReceiveProps(nextProps) { + handleProps(getSystem, mapping, nextProps, this.props); + } + + render() { + const cleanProps = (0,omit_namespaceObject["default"])(this.props, mapping ? Object.keys(mapping) : []); + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(WrappedComponent, cleanProps); + } + } + WithMappedContainer.displayName = `WithMappedContainer(${fn.getDisplayName(WrappedComponent)})`; + return WithMappedContainer; +}; + +const render = (getSystem, getStore, getComponent, getComponents) => (domNode) => { + const App = getComponent(getSystem, getStore, getComponents)("App", "root"); + external_react_dom_namespaceObject["default"].render( /*#__PURE__*/external_react_namespaceObject["default"].createElement(App, null), domNode); +}; + +const getComponent = (getSystem, getStore, getComponents) => function (componentName, container) {let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + + if (typeof componentName !== "string") + throw new TypeError("Need a string, to fetch a component. Was given a " + typeof componentName); + + // getComponent has a config object as a third, optional parameter + // using the config object requires the presence of the second parameter, container + // e.g. getComponent("JsonSchema_string_whatever", false, { failSilently: true }) + const component = getComponents(componentName); + + if (!component) { + if (!config.failSilently) { + getSystem().log.warn("Could not find component:", componentName); + } + return null; + } + + if (!container) { + return component; + } + + if (container === "root") { + return withConnect(getSystem, component, getStore()); + } + + // container == truthy + return withConnect(getSystem, component); +}; +;// CONCATENATED MODULE: ./src/core/plugins/view/fn.js +const getDisplayName = (WrappedComponent) => WrappedComponent.displayName || WrappedComponent.name || "Component"; +;// CONCATENATED MODULE: ./src/core/plugins/view/index.js + + + + + + +const memoizeForGetComponent = (fn) => { + const resolver = function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}return JSON.stringify(args);}; + return memoize(fn, resolver); +}; + +const memoizeForWithMappedContainer = (fn) => { + const resolver = function () {for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}return args;}; + return utils_memoizeN(fn, resolver); +}; + +const viewPlugin = (_ref) => {let { getComponents, getStore, getSystem } = _ref; + // getComponent should be passed into makeMappedContainer, _already_ memoized... otherwise we have a big performance hit ( think, really big ) + const memGetComponent = memoizeForGetComponent(getComponent(getSystem, getStore, getComponents)); + const memMakeMappedContainer = memoizeForWithMappedContainer(withMappedContainer(getSystem, getStore, memGetComponent)); + + return { + rootInjects: { + getComponent: memGetComponent, + makeMappedContainer: memMakeMappedContainer, + render: render(getSystem, getStore, getComponent, getComponents) + }, + fn: { + getDisplayName: getDisplayName + } + }; +}; + +/* harmony default export */ const view = (viewPlugin); +;// CONCATENATED MODULE: ./src/core/plugins/download-url/index.js +/** + * @prettier + */ + + + + +function downloadUrlPlugin(toolbox) { + let { fn } = toolbox; + + const actions = { + download: + (url) => + (_ref) => {let { errActions, specSelectors, specActions, getConfigs } = _ref; + let { fetch } = fn; + const config = getConfigs(); + url = url || specSelectors.url(); + specActions.updateLoadingStatus("loading"); + errActions.clear({ source: "fetch" }); + fetch({ + url, + loadSpec: true, + requestInterceptor: config.requestInterceptor || ((a) => a), + responseInterceptor: config.responseInterceptor || ((a) => a), + credentials: "same-origin", + headers: { + Accept: "application/json,*/*" + } + }).then(next, next); + + function next(res) { + if (res instanceof Error || res.status >= 400) { + specActions.updateLoadingStatus("failed"); + errActions.newThrownErr( + Object.assign( + new Error((res.message || res.statusText) + " " + url), + { source: "fetch" } + ) + ); + // Check if the failure was possibly due to CORS or mixed content + if (!res.status && res instanceof Error) checkPossibleFailReasons(); + return; + } + specActions.updateLoadingStatus("success"); + specActions.updateSpec(res.text); + if (specSelectors.url() !== url) { + specActions.updateUrl(url); + } + } + + function checkPossibleFailReasons() { + try { + let specUrl; + + if ("URL" in core_window) { + specUrl = new URL(url); + } else { + // legacy browser, use to parse the URL + specUrl = document.createElement("a"); + specUrl.href = url; + } + + if ( + specUrl.protocol !== "https:" && + core_window.location.protocol === "https:") + { + const error = Object.assign( + new Error( + `Possible mixed-content issue? The page was loaded over https:// but a ${specUrl.protocol}// URL was specified. Check that you are not attempting to load mixed content.` + ), + { source: "fetch" } + ); + errActions.newThrownErr(error); + return; + } + if (specUrl.origin !== core_window.location.origin) { + const error = Object.assign( + new Error( + `Possible cross-origin (CORS) issue? The URL origin (${specUrl.origin}) does not match the page (${core_window.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.` + ), + { source: "fetch" } + ); + errActions.newThrownErr(error); + } + } catch (e) { + return; + } + } + }, + + updateLoadingStatus: (status) => { + let enums = [null, "loading", "failed", "success", "failedConfig"]; + if (enums.indexOf(status) === -1) { + console.error(`Error: ${status} is not one of ${JSON.stringify(enums)}`); + } + + return { + type: "spec_update_loading_status", + payload: status + }; + } + }; + + let reducers = { + spec_update_loading_status: (state, action) => { + return typeof action.payload === "string" ? + state.set("loadingStatus", action.payload) : + state; + } + }; + + let selectors = { + loadingStatus: (0,external_reselect_namespaceObject.createSelector)( + (state) => { + return state || (0,external_immutable_namespaceObject.Map)(); + }, + (spec) => spec.get("loadingStatus") || null + ) + }; + + return { + statePlugins: { + spec: { actions, reducers, selectors } + } + }; +} +;// CONCATENATED MODULE: external "lodash/zipObject" +var zipObject_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var zipObject_y = x => () => x +const zipObject_namespaceObject = zipObject_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_zipObject_c74f1c14__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/safe-render/fn.jsx + + +const componentDidCatch = console.error; + +const isClassComponent = (component) => component.prototype && component.prototype.isReactComponent; + +const withErrorBoundary = (getSystem) => (WrappedComponent) => { + const { getComponent, fn } = getSystem(); + const ErrorBoundary = getComponent("ErrorBoundary"); + const targetName = fn.getDisplayName(WrappedComponent); + + class WithErrorBoundary extends external_react_namespaceObject.Component { + render() { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(ErrorBoundary, { targetName: targetName, getComponent: getComponent, fn: fn }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(WrappedComponent, (0,extends_namespaceObject["default"])({}, this.props, this.context)) + )); + + } + } + WithErrorBoundary.displayName = `WithErrorBoundary(${targetName})`; + if (isClassComponent(WrappedComponent)) { + /** + * We need to handle case of class components defining a `mapStateToProps` public method. + * Components with `mapStateToProps` public method cannot be wrapped. + */ + WithErrorBoundary.prototype.mapStateToProps = WrappedComponent.prototype.mapStateToProps; + } + + return WithErrorBoundary; +}; +;// CONCATENATED MODULE: ./src/core/plugins/safe-render/components/fallback.jsx + + + +const Fallback = (_ref) => {let { name } = _ref;return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "fallback" }, "\uD83D\uDE31 ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("i", null, "Could not render ", name === "t" ? "this component" : name, ", see the console.") + ));}; + + + + + +/* harmony default export */ const fallback = (Fallback); +;// CONCATENATED MODULE: ./src/core/plugins/safe-render/components/error-boundary.jsx + + + + + + +class ErrorBoundary extends external_react_namespaceObject.Component { + static getDerivedStateFromError(error) { + return { hasError: true, error }; + } + + constructor() { + super(...arguments); + this.state = { hasError: false, error: null }; + } + + componentDidCatch(error, errorInfo) { + this.props.fn.componentDidCatch(error, errorInfo); + } + + render() { + const { getComponent, targetName, children } = this.props; + + if (this.state.hasError) { + const FallbackComponent = getComponent("Fallback"); + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(FallbackComponent, { name: targetName }); + } + + return children; + } +} + + + + + + + + + +ErrorBoundary.defaultProps = { + targetName: "this component", + getComponent: () => fallback, + fn: { + componentDidCatch: componentDidCatch + }, + children: null +}; + +/* harmony default export */ const error_boundary = (ErrorBoundary); +;// CONCATENATED MODULE: ./src/core/plugins/safe-render/index.js + + + + + + +const safeRenderPlugin = function () {let { componentList = [], fullOverride = false } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};return (_ref) => {let { getSystem } = _ref; + const defaultComponentList = [ + "App", + "BaseLayout", + "VersionPragmaFilter", + "InfoContainer", + "ServersContainer", + "SchemesContainer", + "AuthorizeBtnContainer", + "FilterContainer", + "Operations", + "OperationContainer", + "parameters", + "responses", + "OperationServers", + "Models", + "ModelWrapper"]; + + const mergedComponentList = fullOverride ? componentList : [...defaultComponentList, ...componentList]; + const wrapFactory = (Original, _ref2) => {let { fn } = _ref2;return fn.withErrorBoundary(Original);}; + const wrapComponents = (0,zipObject_namespaceObject["default"])(mergedComponentList, Array(mergedComponentList.length).fill(wrapFactory)); + + return { + fn: { + componentDidCatch: componentDidCatch, + withErrorBoundary: withErrorBoundary(getSystem) + }, + components: { + ErrorBoundary: error_boundary, + Fallback: fallback + }, + wrapComponents + }; + };}; + +/* harmony default export */ const safe_render = (safeRenderPlugin); +;// CONCATENATED MODULE: ./src/core/components/app.jsx + + + +class App extends external_react_namespaceObject["default"].Component { + + getLayout() { + let { getComponent, layoutSelectors } = this.props; + const layoutName = layoutSelectors.current(); + const Component = getComponent(layoutName, true); + return Component ? Component : () => /*#__PURE__*/external_react_namespaceObject["default"].createElement("h1", null, " No layout defined for \"", layoutName, "\" "); + } + + render() { + const Layout = this.getLayout(); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(Layout, null)); + + } +} + + + + + + +App.defaultProps = { +}; +;// CONCATENATED MODULE: ./src/core/components/auth/authorization-popup.jsx + + + +class AuthorizationPopup extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "close", + () => { + let { authActions } = this.props; + + authActions.showDefinitions(false); + });} + + render() { + let { authSelectors, authActions, getComponent, errSelectors, specSelectors, fn: { AST = {} } } = this.props; + let definitions = authSelectors.shownDefinitions(); + const Auths = getComponent("auths"); + const CloseIcon = getComponent("CloseIcon"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "dialog-ux" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "backdrop-ux" }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "modal-ux" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "modal-dialog-ux" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "modal-ux-inner" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "modal-ux-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h3", null, "Available authorizations"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { type: "button", className: "close-modal", onClick: this.close }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(CloseIcon, null) + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "modal-ux-content" }, + + + definitions.valueSeq().map((definition, key) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Auths, { key: key, + AST: AST, + definitions: definition, + getComponent: getComponent, + errSelectors: errSelectors, + authSelectors: authSelectors, + authActions: authActions, + specSelectors: specSelectors }); + }) + + ) + ) + ) + ) + )); + + } + + + + + + + + + +} +;// CONCATENATED MODULE: ./src/core/components/auth/authorize-btn.jsx + + + +class AuthorizeBtn extends external_react_namespaceObject["default"].Component { + + + + + + + + render() { + let { isAuthorized, showPopup, onClick, getComponent } = this.props; + + //must be moved out of button component + const AuthorizationPopup = getComponent("authorizationPopup", true); + const LockAuthIcon = getComponent("LockAuthIcon", true); + const UnlockAuthIcon = getComponent("UnlockAuthIcon", true); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "auth-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { className: isAuthorized ? "btn authorize locked" : "btn authorize unlocked", onClick: onClick }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", null, "Authorize"), + isAuthorized ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(LockAuthIcon, null) : /*#__PURE__*/external_react_namespaceObject["default"].createElement(UnlockAuthIcon, null) + ), + showPopup && /*#__PURE__*/external_react_namespaceObject["default"].createElement(AuthorizationPopup, null) + )); + + } +} +;// CONCATENATED MODULE: ./src/core/containers/authorize-btn.jsx + + + +class AuthorizeBtnContainer extends external_react_namespaceObject["default"].Component { + + + + + + + + + + render() { + const { authActions, authSelectors, specSelectors, getComponent } = this.props; + + const securityDefinitions = specSelectors.securityDefinitions(); + const authorizableDefinitions = authSelectors.definitionsToAuthorize(); + + const AuthorizeBtn = getComponent("authorizeBtn"); + + return securityDefinitions ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(AuthorizeBtn, { + onClick: () => authActions.showDefinitions(authorizableDefinitions), + isAuthorized: !!authSelectors.authorized().size, + showPopup: !!authSelectors.shownDefinitions(), + getComponent: getComponent } + ) : + null; + } +} +;// CONCATENATED MODULE: ./src/core/components/auth/authorize-operation-btn.jsx + + + +class AuthorizeOperationBtn extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onClick", + + + + + + + (e) => { + e.stopPropagation(); + let { onClick } = this.props; + + if (onClick) { + onClick(); + } + });} + + render() { + let { isAuthorized, getComponent } = this.props; + + const LockAuthOperationIcon = getComponent("LockAuthOperationIcon", true); + const UnlockAuthOperationIcon = getComponent("UnlockAuthOperationIcon", true); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("button", { className: "authorization__btn", + "aria-label": isAuthorized ? "authorization button locked" : "authorization button unlocked", + onClick: this.onClick }, + isAuthorized ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(LockAuthOperationIcon, { className: "locked" }) : /*#__PURE__*/external_react_namespaceObject["default"].createElement(UnlockAuthOperationIcon, { className: "unlocked" }) + )); + + + } +} +;// CONCATENATED MODULE: ./src/core/components/auth/auths.jsx + + + + +class Auths extends external_react_namespaceObject["default"].Component { + + + + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "onAuthChange", + + + + + (auth) => { + let { name } = auth; + + this.setState({ [name]: auth }); + });(0,defineProperty_namespaceObject["default"])(this, "submitAuth", + + (e) => { + e.preventDefault(); + + let { authActions } = this.props; + authActions.authorizeWithPersistOption(this.state); + });(0,defineProperty_namespaceObject["default"])(this, "logoutClick", + + (e) => { + e.preventDefault(); + + let { authActions, definitions } = this.props; + let auths = definitions.map((val, key) => { + return key; + }).toArray(); + + this.setState(auths.reduce((prev, auth) => { + prev[auth] = ""; + return prev; + }, {})); + + authActions.logoutWithPersistOption(auths); + });(0,defineProperty_namespaceObject["default"])(this, "close", + + (e) => { + e.preventDefault(); + let { authActions } = this.props; + + authActions.showDefinitions(false); + });this.state = {};} + + render() { + let { definitions, getComponent, authSelectors, errSelectors } = this.props; + const AuthItem = getComponent("AuthItem"); + const Oauth2 = getComponent("oauth2", true); + const Button = getComponent("Button"); + + let authorized = authSelectors.authorized(); + + let authorizedAuth = definitions.filter((definition, key) => { + return !!authorized.get(key); + }); + + let nonOauthDefinitions = definitions.filter((schema) => schema.get("type") !== "oauth2"); + let oauthDefinitions = definitions.filter((schema) => schema.get("type") === "oauth2"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "auth-container" }, + + !!nonOauthDefinitions.size && /*#__PURE__*/external_react_namespaceObject["default"].createElement("form", { onSubmit: this.submitAuth }, + + nonOauthDefinitions.map((schema, name) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(AuthItem, { + key: name, + schema: schema, + name: name, + getComponent: getComponent, + onAuthChange: this.onAuthChange, + authorized: authorized, + errSelectors: errSelectors } + ); + }).toArray(), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "auth-btn-wrapper" }, + + nonOauthDefinitions.size === authorizedAuth.size ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(Button, { className: "btn modal-btn auth", onClick: this.logoutClick }, "Logout") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Button, { type: "submit", className: "btn modal-btn auth authorize" }, "Authorize"), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(Button, { className: "btn modal-btn auth btn-done", onClick: this.close }, "Close") + ) + ), + + + + oauthDefinitions && oauthDefinitions.size ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "scope-def" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "Scopes are used to grant an application different levels of access to data on behalf of the end user. Each API may declare one or more scopes."), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "API requires the following scopes. Select which ones you want to grant to Swagger UI.") + ), + + definitions.filter((schema) => schema.get("type") === "oauth2"). + map((schema, name) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { key: name }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Oauth2, { authorized: authorized, + schema: schema, + name: name }) + ); + } + ).toArray() + + ) : null + + + )); + + } + +} +;// CONCATENATED MODULE: ./src/core/components/auth/auth-item.jsx + + + + +class auth_item_Auths extends external_react_namespaceObject["default"].Component { + + + + + + + + + + render() { + let { + schema, + name, + getComponent, + onAuthChange, + authorized, + errSelectors + } = this.props; + const ApiKeyAuth = getComponent("apiKeyAuth"); + const BasicAuth = getComponent("basicAuth"); + + let authEl; + + const type = schema.get("type"); + + switch (type) { + case "apiKey":authEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement(ApiKeyAuth, { key: name, + schema: schema, + name: name, + errSelectors: errSelectors, + authorized: authorized, + getComponent: getComponent, + onChange: onAuthChange }); + break; + case "basic":authEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement(BasicAuth, { key: name, + schema: schema, + name: name, + errSelectors: errSelectors, + authorized: authorized, + getComponent: getComponent, + onChange: onAuthChange }); + break; + default:authEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { key: name }, "Unknown security definition type ", type); + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { key: `${name}-jump` }, + authEl + ); + } + +} +;// CONCATENATED MODULE: ./src/core/components/auth/error.jsx + + + +class AuthError extends external_react_namespaceObject["default"].Component { + + + + + + render() { + let { error } = this.props; + + let level = error.get("level"); + let message = error.get("message"); + let source = error.get("source"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "errors" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("b", null, source, " ", level), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", null, message) + )); + + } +} +;// CONCATENATED MODULE: ./src/core/components/auth/api-key-auth.jsx + + + +class ApiKeyAuth extends external_react_namespaceObject["default"].Component { + + + + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + + + + + + + + + + + + + + + (e) => { + let { onChange } = this.props; + let value = e.target.value; + let newState = Object.assign({}, this.state, { value: value }); + + this.setState(newState); + onChange(newState); + });let { name, schema } = this.props;let _value = this.getValue();this.state = { name: name, schema: schema, value: _value };}getValue() {let { name, authorized } = this.props;return authorized && authorized.getIn([name, "value"]);} + + render() { + let { schema, getComponent, errSelectors, name } = this.props; + const Input = getComponent("Input"); + const Row = getComponent("Row"); + const Col = getComponent("Col"); + const AuthError = getComponent("authError"); + const Markdown = getComponent("Markdown", true); + const JumpToPath = getComponent("JumpToPath", true); + let value = this.getValue(); + let errors = errSelectors.allErrors().filter((err) => err.get("authId") === name); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, name || schema.get("name")), "\xA0(apiKey)", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JumpToPath, { path: ["securityDefinitions", name] }) + ), + value && /*#__PURE__*/external_react_namespaceObject["default"].createElement("h6", null, "Authorized"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: schema.get("description") }) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "Name: ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, schema.get("name"))) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "In: ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, schema.get("in"))) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", null, "Value:"), + + value ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ****** ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, null, /*#__PURE__*/external_react_namespaceObject["default"].createElement(Input, { type: "text", onChange: this.onChange, autoFocus: true })) + + ), + + errors.valueSeq().map((error, key) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(AuthError, { error: error, + key: key }); + }) + + )); + + } +} +;// CONCATENATED MODULE: ./src/core/components/auth/basic-auth.jsx + + + + +class BasicAuth extends external_react_namespaceObject["default"].Component { + + + + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + + + + + + + + + + + + + + + + + + + (e) => { + let { onChange } = this.props; + let { value, name } = e.target; + + let newValue = this.state.value; + newValue[name] = value; + + this.setState({ value: newValue }); + + onChange(this.state); + });let { schema, name: _name } = this.props;let _value = this.getValue();let username = _value.username;this.state = { name: _name, schema: schema, value: !username ? {} : { username: username } };}getValue() {let { authorized, name } = this.props;return authorized && authorized.getIn([name, "value"]) || {};} + + render() { + let { schema, getComponent, name, errSelectors } = this.props; + const Input = getComponent("Input"); + const Row = getComponent("Row"); + const Col = getComponent("Col"); + const AuthError = getComponent("authError"); + const JumpToPath = getComponent("JumpToPath", true); + const Markdown = getComponent("Markdown", true); + let username = this.getValue().username; + let errors = errSelectors.allErrors().filter((err) => err.get("authId") === name); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, "Basic authorization", /*#__PURE__*/external_react_namespaceObject["default"].createElement(JumpToPath, { path: ["securityDefinitions", name] })), + username && /*#__PURE__*/external_react_namespaceObject["default"].createElement("h6", null, "Authorized"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: schema.get("description") }) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", null, "Username:"), + + username ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ", username, " ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, null, /*#__PURE__*/external_react_namespaceObject["default"].createElement(Input, { type: "text", required: "required", name: "username", onChange: this.onChange, autoFocus: true })) + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", null, "Password:"), + + username ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ****** ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, null, /*#__PURE__*/external_react_namespaceObject["default"].createElement(Input, { autoComplete: "new-password", + name: "password", + type: "password", + onChange: this.onChange })) + + ), + + errors.valueSeq().map((error, key) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(AuthError, { error: error, + key: key }); + }) + + )); + + } + +} +;// CONCATENATED MODULE: ./src/core/components/example.jsx +/** + * @prettier + */ + + + + + + +function Example(props) { + const { example, showValue, getComponent, getConfigs } = props; + + const Markdown = getComponent("Markdown", true); + const HighlightCode = getComponent("highlightCode"); + + if (!example) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "example" }, + example.get("description") ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("section", { className: "example__section" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "example__section-header" }, "Example Description"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: example.get("description") }) + ) + ) : + null, + showValue && example.has("value") ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("section", { className: "example__section" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "example__section-header" }, "Example Value"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(HighlightCode, { getConfigs: getConfigs, value: stringify(example.get("value")) }) + ) : + null + )); + +} +;// CONCATENATED MODULE: ./src/core/components/examples-select.jsx + /** + * @prettier + */ + + + + + + +class ExamplesSelect extends external_react_namespaceObject["default"].PureComponent {constructor() {var _this;super(...arguments);_this = this;(0,defineProperty_namespaceObject["default"])(this, "_onSelect", + + + + + + + + + + + + + + + + + + + + + + function (key) {let { isSyntheticChange = false } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + if (typeof _this.props.onSelect === "function") { + _this.props.onSelect(key, { + isSyntheticChange + }); + } + });(0,defineProperty_namespaceObject["default"])(this, "_onDomSelect", + + (e) => { + if (typeof this.props.onSelect === "function") { + const element = e.target.selectedOptions[0]; + const key = element.getAttribute("value"); + + this._onSelect(key, { + isSyntheticChange: false + }); + } + });(0,defineProperty_namespaceObject["default"])(this, "getCurrentExample", + + () => { + const { examples, currentExampleKey } = this.props; + + const currentExamplePerProps = examples.get(currentExampleKey); + + const firstExamplesKey = examples.keySeq().first(); + const firstExample = examples.get(firstExamplesKey); + + return currentExamplePerProps || firstExample || Map({}); + });} + + componentDidMount() { + // this is the not-so-great part of ExamplesSelect... here we're + // artificially kicking off an onSelect event in order to set a default + // value in state. the consumer has the option to avoid this by checking + // `isSyntheticEvent`, but we should really be doing this in a selector. + // TODO: clean this up + // FIXME: should this only trigger if `currentExamplesKey` is nullish? + const { onSelect, examples } = this.props; + + if (typeof onSelect === "function") { + const firstExample = examples.first(); + const firstExampleKey = examples.keyOf(firstExample); + + this._onSelect(firstExampleKey, { + isSyntheticChange: true + }); + } + } + + UNSAFE_componentWillReceiveProps(nextProps) { + const { currentExampleKey, examples } = nextProps; + if (examples !== this.props.examples && !examples.has(currentExampleKey)) { + // examples have changed from under us, and the currentExampleKey is no longer + // valid. + const firstExample = examples.first(); + const firstExampleKey = examples.keyOf(firstExample); + + this._onSelect(firstExampleKey, { + isSyntheticChange: true + }); + } + } + + render() { + const { + examples, + currentExampleKey, + isValueModified, + isModifiedValueAvailable, + showLabels + } = this.props; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "examples-select" }, + + showLabels ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "examples-select__section-label" }, "Examples: ") : + null, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("select", { + className: "examples-select-element", + onChange: this._onDomSelect, + value: + isModifiedValueAvailable && isValueModified ? + "__MODIFIED__VALUE__" : + currentExampleKey || "" }, + + + isModifiedValueAvailable ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("option", { value: "__MODIFIED__VALUE__" }, "[Modified value]") : + null, + examples. + map((example, exampleName) => { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("option", { + key: exampleName // for React + , value: exampleName // for matching to select's `value` + }, + example.get("summary") || exampleName + )); + + }). + valueSeq() + ) + )); + + } +}(0,defineProperty_namespaceObject["default"])(ExamplesSelect, "defaultProps", { examples: external_immutable_namespaceObject["default"].Map({}), onSelect: function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];}return console.log( // eslint-disable-line no-console + // FIXME: remove before merging to master... + `DEBUG: ExamplesSelect was not given an onSelect callback`, ...args);}, currentExampleKey: null, showLabels: true }); +;// CONCATENATED MODULE: ./src/core/components/examples-select-value-retainer.jsx + /** + * @prettier + */ + + + + + + + +// This stateful component lets us avoid writing competing values (user +// modifications vs example values) into global state, and the mess that comes +// with that: tracking which of the two values are currently used for +// Try-It-Out, which example a modified value came from, etc... +// +// The solution here is to retain the last user-modified value in +// ExamplesSelectValueRetainer's component state, so that our global state can stay +// clean, always simply being the source of truth for what value should be both +// displayed to the user and used as a value during request execution. +// +// This approach/tradeoff was chosen in order to encapsulate the particular +// logic of Examples within the Examples component tree, and to avoid +// regressions within our current implementation elsewhere (non-Examples +// definitions, OpenAPI 2.0, etc). A future refactor to global state might make +// this component unnecessary. +// +// TL;DR: this is not our usual approach, but the choice was made consciously. + +// Note that `currentNamespace` isn't currently used anywhere! + +const stringifyUnlessList = (input) => +external_immutable_namespaceObject.List.isList(input) ? input : stringify(input); + +class ExamplesSelectValueRetainer extends external_react_namespaceObject["default"].PureComponent { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + constructor(_props) {var _this; + super(_props);_this = this;(0,defineProperty_namespaceObject["default"])(this, "_getStateForCurrentNamespace", + + + + + + + + + + + + + + + + + + + + + + + () => { + const { currentNamespace } = this.props; + + return (this.state[currentNamespace] || (0,external_immutable_namespaceObject.Map)()).toObject(); + });(0,defineProperty_namespaceObject["default"])(this, "_setStateForCurrentNamespace", + + (obj) => { + const { currentNamespace } = this.props; + + return this._setStateForNamespace(currentNamespace, obj); + });(0,defineProperty_namespaceObject["default"])(this, "_setStateForNamespace", + + (namespace, obj) => { + const oldStateForNamespace = this.state[namespace] || (0,external_immutable_namespaceObject.Map)(); + const newStateForNamespace = oldStateForNamespace.mergeDeep(obj); + return this.setState({ + [namespace]: newStateForNamespace + }); + });(0,defineProperty_namespaceObject["default"])(this, "_isCurrentUserInputSameAsExampleValue", + + () => { + const { currentUserInputValue } = this.props; + + const valueFromExample = this._getCurrentExampleValue(); + + return valueFromExample === currentUserInputValue; + });(0,defineProperty_namespaceObject["default"])(this, "_getValueForExample", + + (exampleKey, props) => { + // props are accepted so that this can be used in UNSAFE_componentWillReceiveProps, + // which has access to `nextProps` + const { examples } = props || this.props; + return stringifyUnlessList( + (examples || (0,external_immutable_namespaceObject.Map)({})).getIn([exampleKey, "value"]) + ); + });(0,defineProperty_namespaceObject["default"])(this, "_getCurrentExampleValue", + + (props) => { + // props are accepted so that this can be used in UNSAFE_componentWillReceiveProps, + // which has access to `nextProps` + const { currentKey } = props || this.props; + return this._getValueForExample(currentKey, props || this.props); + });(0,defineProperty_namespaceObject["default"])(this, "_onExamplesSelect", + + function (key) {let { isSyntheticChange } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const { + onSelect, + updateValue, + currentUserInputValue, + userHasEditedBody + } = _this.props; + const { lastUserEditedValue } = _this._getStateForCurrentNamespace(); + + const valueFromExample = _this._getValueForExample(key); + + if (key === "__MODIFIED__VALUE__") { + updateValue(stringifyUnlessList(lastUserEditedValue)); + return _this._setStateForCurrentNamespace({ + isModifiedValueSelected: true + }); + } + + if (typeof onSelect === "function") {for (var _len = arguments.length, otherArgs = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {otherArgs[_key - 2] = arguments[_key];} + onSelect(key, { isSyntheticChange }, ...otherArgs); + } + + _this._setStateForCurrentNamespace({ + lastDownstreamValue: valueFromExample, + isModifiedValueSelected: + isSyntheticChange && userHasEditedBody || + !!currentUserInputValue && currentUserInputValue !== valueFromExample + }); + + // we never want to send up value updates from synthetic changes + if (isSyntheticChange) return; + + if (typeof updateValue === "function") { + updateValue(stringifyUnlessList(valueFromExample)); + } + });const _valueFromExample = this._getCurrentExampleValue();this.state = { // user edited: last value that came from the world around us, and didn't + // match the current example's value + // internal: last value that came from user selecting an Example + [_props.currentNamespace]: (0,external_immutable_namespaceObject.Map)({ lastUserEditedValue: this.props.currentUserInputValue, lastDownstreamValue: _valueFromExample, isModifiedValueSelected: // valueFromExample !== undefined && + this.props.userHasEditedBody || this.props.currentUserInputValue !== _valueFromExample }) };}componentWillUnmount() {this.props.setRetainRequestBodyValueFlag(false);}UNSAFE_componentWillReceiveProps(nextProps) {// update `lastUserEditedValue` as new currentUserInput values come in + const { + currentUserInputValue: newValue, + examples, + onSelect, + userHasEditedBody + } = nextProps; + + const { + lastUserEditedValue, + lastDownstreamValue + } = this._getStateForCurrentNamespace(); + + const valueFromCurrentExample = this._getValueForExample( + nextProps.currentKey, + nextProps + ); + + const examplesMatchingNewValue = examples.filter( + (example) => + example.get("value") === newValue || + // sometimes data is stored as a string (e.g. in Request Bodies), so + // let's check against a stringified version of our example too + stringify(example.get("value")) === newValue + ); + + if (examplesMatchingNewValue.size) { + let key; + if (examplesMatchingNewValue.has(nextProps.currentKey)) + { + key = nextProps.currentKey; + } else { + key = examplesMatchingNewValue.keySeq().first(); + } + onSelect(key, { + isSyntheticChange: true + }); + } else if ( + newValue !== this.props.currentUserInputValue && // value has changed + newValue !== lastUserEditedValue && // value isn't already tracked + newValue !== lastDownstreamValue // value isn't what we've seen on the other side + ) { + this.props.setRetainRequestBodyValueFlag(true); + this._setStateForNamespace(nextProps.currentNamespace, { + lastUserEditedValue: nextProps.currentUserInputValue, + isModifiedValueSelected: + userHasEditedBody || newValue !== valueFromCurrentExample + }); + } + } + + render() { + const { + currentUserInputValue, + examples, + currentKey, + getComponent, + userHasEditedBody + } = this.props; + const { + lastDownstreamValue, + lastUserEditedValue, + isModifiedValueSelected + } = this._getStateForCurrentNamespace(); + + const ExamplesSelect = getComponent("ExamplesSelect"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(ExamplesSelect, { + examples: examples, + currentExampleKey: currentKey, + onSelect: this._onExamplesSelect, + isModifiedValueAvailable: + !!lastUserEditedValue && lastUserEditedValue !== lastDownstreamValue, + + isValueModified: + currentUserInputValue !== undefined && + isModifiedValueSelected && + currentUserInputValue !== this._getCurrentExampleValue() || + userHasEditedBody } + + )); + + } +}(0,defineProperty_namespaceObject["default"])(ExamplesSelectValueRetainer, "defaultProps", { userHasEditedBody: false, examples: (0,external_immutable_namespaceObject.Map)({}), currentNamespace: "__DEFAULT__NAMESPACE__", setRetainRequestBodyValueFlag: () => {// NOOP + }, onSelect: function () {for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}return console.log( // eslint-disable-line no-console + "ExamplesSelectValueRetainer: no `onSelect` function was provided", ...args);}, updateValue: function () {for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {args[_key3] = arguments[_key3];}return console.log( // eslint-disable-line no-console + "ExamplesSelectValueRetainer: no `updateValue` function was provided", ...args);} }); +;// CONCATENATED MODULE: ./src/core/oauth2-authorize.js + + + + +function oauth2_authorize_authorize(_ref) {let { auth, authActions, errActions, configs, authConfigs = {}, currentServer } = _ref; + let { schema, scopes, name, clientId } = auth; + let flow = schema.get("flow"); + let query = []; + + switch (flow) { + case "password": + authActions.authorizePassword(auth); + return; + + case "application": + authActions.authorizeApplication(auth); + return; + + case "accessCode": + query.push("response_type=code"); + break; + + case "implicit": + query.push("response_type=token"); + break; + + case "clientCredentials": + case "client_credentials": + // OAS3 + authActions.authorizeApplication(auth); + return; + + case "authorizationCode": + case "authorization_code": + // OAS3 + query.push("response_type=code"); + break; + } + + if (typeof clientId === "string") { + query.push("client_id=" + encodeURIComponent(clientId)); + } + + let redirectUrl = configs.oauth2RedirectUrl; + + // todo move to parser + if (typeof redirectUrl === "undefined") { + errActions.newAuthErr({ + authId: name, + source: "validation", + level: "error", + message: "oauth2RedirectUrl configuration is not passed. Oauth2 authorization cannot be performed." + }); + return; + } + query.push("redirect_uri=" + encodeURIComponent(redirectUrl)); + + let scopesArray = []; + if (Array.isArray(scopes)) { + scopesArray = scopes; + } else if (external_immutable_namespaceObject["default"].List.isList(scopes)) { + scopesArray = scopes.toArray(); + } + + if (scopesArray.length > 0) { + let scopeSeparator = authConfigs.scopeSeparator || " "; + + query.push("scope=" + encodeURIComponent(scopesArray.join(scopeSeparator))); + } + + let state = btoa(new Date()); + + query.push("state=" + encodeURIComponent(state)); + + if (typeof authConfigs.realm !== "undefined") { + query.push("realm=" + encodeURIComponent(authConfigs.realm)); + } + + if ((flow === "authorizationCode" || flow === "authorization_code" || flow === "accessCode") && authConfigs.usePkceWithAuthorizationCodeGrant) { + const codeVerifier = generateCodeVerifier(); + const codeChallenge = createCodeChallenge(codeVerifier); + + query.push("code_challenge=" + codeChallenge); + query.push("code_challenge_method=S256"); + + // storing the Code Verifier so it can be sent to the token endpoint + // when exchanging the Authorization Code for an Access Token + auth.codeVerifier = codeVerifier; + } + + let { additionalQueryStringParams } = authConfigs; + + for (let key in additionalQueryStringParams) { + if (typeof additionalQueryStringParams[key] !== "undefined") { + query.push([key, additionalQueryStringParams[key]].map(encodeURIComponent).join("=")); + } + } + + const authorizationUrl = schema.get("authorizationUrl"); + let sanitizedAuthorizationUrl; + if (currentServer) { + // OpenAPI 3 + sanitizedAuthorizationUrl = (0,external_url_parse_namespaceObject["default"])( + sanitizeUrl(authorizationUrl), + currentServer, + true + ).toString(); + } else { + sanitizedAuthorizationUrl = sanitizeUrl(authorizationUrl); + } + let url = [sanitizedAuthorizationUrl, query.join("&")].join(authorizationUrl.indexOf("?") === -1 ? "?" : "&"); + + // pass action authorizeOauth2 and authentication data through window + // to authorize with oauth2 + + let callback; + if (flow === "implicit") { + callback = authActions.preAuthorizeImplicit; + } else if (authConfigs.useBasicAuthenticationWithAccessCodeGrant) { + callback = authActions.authorizeAccessCodeWithBasicAuthentication; + } else { + callback = authActions.authorizeAccessCodeWithFormParams; + } + + authActions.authPopup(url, { + auth: auth, + state: state, + redirectUrl: redirectUrl, + callback: callback, + errCb: errActions.newAuthErr + }); +} +;// CONCATENATED MODULE: ./src/core/components/auth/oauth2.jsx + + + + +class Oauth2 extends external_react_namespaceObject["default"].Component { + + + + + + + + + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "close", + + + + + + + + + + + + + + + + + + + + + + + + + + (e) => { + e.preventDefault(); + let { authActions } = this.props; + + authActions.showDefinitions(false); + });(0,defineProperty_namespaceObject["default"])(this, "authorize", + + () => { + let { authActions, errActions, getConfigs, authSelectors, oas3Selectors } = this.props; + let configs = getConfigs(); + let authConfigs = authSelectors.getConfigs(); + + errActions.clear({ authId: name, type: "auth", source: "auth" }); + oauth2_authorize_authorize({ + auth: this.state, + currentServer: oas3Selectors.serverEffectiveValue(oas3Selectors.selectedServer()), + authActions, + errActions, + configs, + authConfigs + }); + });(0,defineProperty_namespaceObject["default"])(this, "onScopeChange", + + (e) => { + let { target } = e; + let { checked } = target; + let scope = target.dataset.value; + + if (checked && this.state.scopes.indexOf(scope) === -1) { + let newScopes = this.state.scopes.concat([scope]); + this.setState({ scopes: newScopes }); + } else if (!checked && this.state.scopes.indexOf(scope) > -1) { + this.setState({ scopes: this.state.scopes.filter((val) => val !== scope) }); + } + });(0,defineProperty_namespaceObject["default"])(this, "onInputChange", + + (e) => { + let { target: { dataset: { name }, value } } = e; + let state = { + [name]: value + }; + + this.setState(state); + });(0,defineProperty_namespaceObject["default"])(this, "selectScopes", + + (e) => { + if (e.target.dataset.all) { + this.setState({ + scopes: Array.from((this.props.schema.get("allowedScopes") || this.props.schema.get("scopes")).keys()) + }); + } else { + this.setState({ scopes: [] }); + } + });(0,defineProperty_namespaceObject["default"])(this, "logout", + + (e) => { + e.preventDefault(); + let { authActions, errActions, name } = this.props; + + errActions.clear({ authId: name, type: "auth", source: "auth" }); + authActions.logoutWithPersistOption([name]); + });let { name: _name, schema, authorized, authSelectors: _authSelectors } = this.props;let auth = authorized && authorized.get(_name);let _authConfigs = _authSelectors.getConfigs() || {};let username = auth && auth.get("username") || "";let clientId = auth && auth.get("clientId") || _authConfigs.clientId || "";let clientSecret = auth && auth.get("clientSecret") || _authConfigs.clientSecret || "";let passwordType = auth && auth.get("passwordType") || "basic";let scopes = auth && auth.get("scopes") || _authConfigs.scopes || [];if (typeof scopes === "string") {scopes = scopes.split(_authConfigs.scopeSeparator || " ");}this.state = { appName: _authConfigs.appName, name: _name, schema: schema, scopes: scopes, clientId: clientId, clientSecret: clientSecret, username: username, password: "", passwordType: passwordType };} + + render() { + let { + schema, getComponent, authSelectors, errSelectors, name, specSelectors + } = this.props; + const Input = getComponent("Input"); + const Row = getComponent("Row"); + const Col = getComponent("Col"); + const Button = getComponent("Button"); + const AuthError = getComponent("authError"); + const JumpToPath = getComponent("JumpToPath", true); + const Markdown = getComponent("Markdown", true); + const InitializedInput = getComponent("InitializedInput"); + + const { isOAS3 } = specSelectors; + + let oidcUrl = isOAS3() ? schema.get("openIdConnectUrl") : null; + + // Auth type consts + const AUTH_FLOW_IMPLICIT = "implicit"; + const AUTH_FLOW_PASSWORD = "password"; + const AUTH_FLOW_ACCESS_CODE = isOAS3() ? oidcUrl ? "authorization_code" : "authorizationCode" : "accessCode"; + const AUTH_FLOW_APPLICATION = isOAS3() ? oidcUrl ? "client_credentials" : "clientCredentials" : "application"; + + let authConfigs = authSelectors.getConfigs() || {}; + let isPkceCodeGrant = !!authConfigs.usePkceWithAuthorizationCodeGrant; + + let flow = schema.get("flow"); + let flowToDisplay = flow === AUTH_FLOW_ACCESS_CODE && isPkceCodeGrant ? flow + " with PKCE" : flow; + let scopes = schema.get("allowedScopes") || schema.get("scopes"); + let authorizedAuth = authSelectors.authorized().get(name); + let isAuthorized = !!authorizedAuth; + let errors = errSelectors.allErrors().filter((err) => err.get("authId") === name); + let isValid = !errors.filter((err) => err.get("source") === "validation").size; + let description = schema.get("description"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, name, " (OAuth2, ", flowToDisplay, ") ", /*#__PURE__*/external_react_namespaceObject["default"].createElement(JumpToPath, { path: ["securityDefinitions", name] })), + !this.state.appName ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement("h5", null, "Application: ", this.state.appName, " "), + description && /*#__PURE__*/external_react_namespaceObject["default"].createElement(Markdown, { source: schema.get("description") }), + + isAuthorized && /*#__PURE__*/external_react_namespaceObject["default"].createElement("h6", null, "Authorized"), + + oidcUrl && /*#__PURE__*/external_react_namespaceObject["default"].createElement("p", null, "OpenID Connect URL: ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, oidcUrl)), + (flow === AUTH_FLOW_IMPLICIT || flow === AUTH_FLOW_ACCESS_CODE) && /*#__PURE__*/external_react_namespaceObject["default"].createElement("p", null, "Authorization URL: ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, schema.get("authorizationUrl"))), + (flow === AUTH_FLOW_PASSWORD || flow === AUTH_FLOW_ACCESS_CODE || flow === AUTH_FLOW_APPLICATION) && /*#__PURE__*/external_react_namespaceObject["default"].createElement("p", null, "Token URL:", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ", schema.get("tokenUrl"))), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", { className: "flow" }, "Flow: ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, flowToDisplay)), + + + flow !== AUTH_FLOW_PASSWORD ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", { htmlFor: "oauth_username" }, "username:"), + + isAuthorized ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ", this.state.username, " ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { tablet: 10, desktop: 10 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("input", { id: "oauth_username", type: "text", "data-name": "username", onChange: this.onInputChange, autoFocus: true }) + ) + + ), /*#__PURE__*/ + + + + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", { htmlFor: "oauth_password" }, "password:"), + + isAuthorized ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ****** ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { tablet: 10, desktop: 10 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("input", { id: "oauth_password", type: "password", "data-name": "password", onChange: this.onInputChange }) + ) + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", { htmlFor: "password_type" }, "Client credentials location:"), + + isAuthorized ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ", this.state.passwordType, " ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { tablet: 10, desktop: 10 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("select", { id: "password_type", "data-name": "passwordType", onChange: this.onInputChange }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("option", { value: "basic" }, "Authorization header"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("option", { value: "request-body" }, "Request body") + ) + ) + + ) + ), + + + (flow === AUTH_FLOW_APPLICATION || flow === AUTH_FLOW_IMPLICIT || flow === AUTH_FLOW_ACCESS_CODE || flow === AUTH_FLOW_PASSWORD) && ( + !isAuthorized || isAuthorized && this.state.clientId) && /*#__PURE__*/external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", { htmlFor: "client_id" }, "client_id:"), + + isAuthorized ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ****** ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { tablet: 10, desktop: 10 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(InitializedInput, { id: "client_id", + type: "text", + required: flow === AUTH_FLOW_PASSWORD, + initialValue: this.state.clientId, + "data-name": "clientId", + onChange: this.onInputChange }) + ) + + ), + + + + (flow === AUTH_FLOW_APPLICATION || flow === AUTH_FLOW_ACCESS_CODE || flow === AUTH_FLOW_PASSWORD) && /*#__PURE__*/external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", { htmlFor: "client_secret" }, "client_secret:"), + + isAuthorized ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ****** ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { tablet: 10, desktop: 10 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(InitializedInput, { id: "client_secret", + initialValue: this.state.clientSecret, + type: "password", + "data-name": "clientSecret", + onChange: this.onInputChange }) + ) + + + ), + + + + !isAuthorized && scopes && scopes.size ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "scopes" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h2", null, "Scopes:", /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("a", { onClick: this.selectScopes, "data-all": true }, "select all"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("a", { onClick: this.selectScopes }, "select none") + ), + scopes.map((description, name) => { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(Row, { key: name }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "checkbox" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Input, { "data-value": name, + id: `${name}-${flow}-checkbox-${this.state.name}`, + disabled: isAuthorized, + checked: this.state.scopes.includes(name), + type: "checkbox", + onChange: this.onScopeChange }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", { htmlFor: `${name}-${flow}-checkbox-${this.state.name}` }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "item" }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "text" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", { className: "name" }, name), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", { className: "description" }, description) + ) + ) + ) + )); + + }).toArray() + + ) : null, + + + + errors.valueSeq().map((error, key) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(AuthError, { error: error, + key: key }); + }), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "auth-btn-wrapper" }, + isValid && ( + isAuthorized ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(Button, { className: "btn modal-btn auth authorize", onClick: this.logout }, "Logout") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Button, { className: "btn modal-btn auth authorize", onClick: this.authorize }, "Authorize")), /*#__PURE__*/ + + + external_react_namespaceObject["default"].createElement(Button, { className: "btn modal-btn auth btn-done", onClick: this.close }, "Close") + ) + + )); + + } +} +;// CONCATENATED MODULE: ./src/core/components/clear.jsx + + + +class Clear extends external_react_namespaceObject.Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onClick", + + () => { + let { specActions, path, method } = this.props; + specActions.clearResponse(path, method); + specActions.clearRequest(path, method); + });} + + render() { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("button", { className: "btn btn-clear opblock-control__btn", onClick: this.onClick }, "Clear" + + )); + + } + + + + + + +} +;// CONCATENATED MODULE: ./src/core/components/live-response.jsx + + + + +const Headers = (_ref) => {let { headers } = _ref; + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h5", null, "Response headers"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("pre", { className: "microlight" }, headers) + )); +}; + + + + +const Duration = (_ref2) => {let { duration } = _ref2; + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h5", null, "Request duration"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("pre", { className: "microlight" }, duration, " ms") + )); + +}; + + + + + +class LiveResponse extends external_react_namespaceObject["default"].Component { + + + + + + + + + + + shouldComponentUpdate(nextProps) { + // BUG: props.response is always coming back as a new Immutable instance + // same issue as responses.jsx (tryItOutResponse) + return this.props.response !== nextProps.response || + this.props.path !== nextProps.path || + this.props.method !== nextProps.method || + this.props.displayRequestDuration !== nextProps.displayRequestDuration; + } + + render() { + const { response, getComponent, getConfigs, displayRequestDuration, specSelectors, path, method } = this.props; + const { showMutatedRequest, requestSnippetsEnabled } = getConfigs(); + + const curlRequest = showMutatedRequest ? specSelectors.mutatedRequestFor(path, method) : specSelectors.requestFor(path, method); + const status = response.get("status"); + const url = curlRequest.get("url"); + const headers = response.get("headers").toJS(); + const notDocumented = response.get("notDocumented"); + const isError = response.get("error"); + const body = response.get("text"); + const duration = response.get("duration"); + const headersKeys = Object.keys(headers); + const contentType = headers["content-type"] || headers["Content-Type"]; + + const ResponseBody = getComponent("responseBody"); + const returnObject = headersKeys.map((key) => { + var joinedHeaders = Array.isArray(headers[key]) ? headers[key].join() : headers[key]; + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "headerline", key: key }, " ", key, ": ", joinedHeaders, " "); + }); + const hasHeaders = returnObject.length !== 0; + const Markdown = getComponent("Markdown", true); + const RequestSnippets = getComponent("RequestSnippets", true); + const Curl = getComponent("curl"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, + curlRequest && (requestSnippetsEnabled === true || requestSnippetsEnabled === "true" ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(RequestSnippets, { request: curlRequest }) : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Curl, { request: curlRequest, getConfigs: getConfigs })), + url && /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "request-url" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, "Request URL"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("pre", { className: "microlight" }, url) + ) + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("h4", null, "Server response"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("table", { className: "responses-table live-responses-table" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("thead", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", { className: "responses-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "col_header response-col_status" }, "Code"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "col_header response-col_description" }, "Details") + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tbody", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", { className: "response" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "response-col_status" }, + status, + + notDocumented ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "response-undocumented" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("i", null, " Undocumented ") + ) : + null + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "response-col_description" }, + + isError ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(Markdown, { source: `${response.get("name") !== "" ? `${response.get("name")}: ` : ""}${response.get("message")}` }) : + null, + + + body ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(ResponseBody, { content: body, + contentType: contentType, + url: url, + headers: headers, + getConfigs: getConfigs, + getComponent: getComponent }) : + null, + + + hasHeaders ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(Headers, { headers: returnObject }) : null, + + + displayRequestDuration && duration ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(Duration, { duration: duration }) : null + + ) + ) + ) + ) + )); + + } +} +;// CONCATENATED MODULE: ./src/core/components/online-validator-badge.jsx + + + + + + + +class OnlineValidatorBadge extends external_react_namespaceObject["default"].Component { + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "getDefinitionUrl", + + + + + + + + + () => { + // TODO: test this behavior by stubbing `window.location` in an Enzyme/JSDom env + let { specSelectors } = this.props; + + const urlObject = new external_url_parse_namespaceObject["default"](specSelectors.url(), core_window.location); + return urlObject.toString(); + });let { getConfigs } = props;let { validatorUrl } = getConfigs();this.state = { url: this.getDefinitionUrl(), validatorUrl: validatorUrl === undefined ? "https://validator.swagger.io/validator" : validatorUrl };} + + UNSAFE_componentWillReceiveProps(nextProps) { + let { getConfigs } = nextProps; + let { validatorUrl } = getConfigs(); + + this.setState({ + url: this.getDefinitionUrl(), + validatorUrl: validatorUrl === undefined ? "https://validator.swagger.io/validator" : validatorUrl + }); + } + + render() { + let { getConfigs } = this.props; + let { spec } = getConfigs(); + + let sanitizedValidatorUrl = sanitizeUrl(this.state.validatorUrl); + + if (typeof spec === "object" && Object.keys(spec).length) return null; + + if (!this.state.url || !requiresValidationURL(this.state.validatorUrl) || + !requiresValidationURL(this.state.url)) { + return null; + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "float-right" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("a", { target: "_blank", rel: "noopener noreferrer", href: `${sanitizedValidatorUrl}/debug?url=${encodeURIComponent(this.state.url)}` }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ValidatorImage, { src: `${sanitizedValidatorUrl}?url=${encodeURIComponent(this.state.url)}`, alt: "Online validator badge" }) + ) + ); + } +} + + +class ValidatorImage extends external_react_namespaceObject["default"].Component { + + + + + + constructor(props) { + super(props); + this.state = { + loaded: false, + error: false + }; + } + + componentDidMount() { + const img = new Image(); + img.onload = () => { + this.setState({ + loaded: true + }); + }; + img.onerror = () => { + this.setState({ + error: true + }); + }; + img.src = this.props.src; + } + + UNSAFE_componentWillReceiveProps(nextProps) { + if (nextProps.src !== this.props.src) { + const img = new Image(); + img.onload = () => { + this.setState({ + loaded: true + }); + }; + img.onerror = () => { + this.setState({ + error: true + }); + }; + img.src = nextProps.src; + } + } + + render() { + if (this.state.error) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("img", { alt: "Error" }); + } else if (!this.state.loaded) { + return null; + } + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("img", { src: this.props.src, alt: this.props.alt }); + } +} +;// CONCATENATED MODULE: ./src/core/components/operations.jsx + + + + +class Operations extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "renderOperationTag", + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (tagObj, tag) => { + const { + specSelectors, + getComponent, + oas3Selectors, + layoutSelectors, + layoutActions, + getConfigs + } = this.props; + const validOperationMethods = specSelectors.validOperationMethods(); + const OperationContainer = getComponent("OperationContainer", true); + const OperationTag = getComponent("OperationTag"); + const operations = tagObj.get("operations"); + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(OperationTag, { + key: "operation-" + tag, + tagObj: tagObj, + tag: tag, + oas3Selectors: oas3Selectors, + layoutSelectors: layoutSelectors, + layoutActions: layoutActions, + getConfigs: getConfigs, + getComponent: getComponent, + specUrl: specSelectors.url() }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "operation-tag-content" }, + + operations.map((op) => { + const path = op.get("path"); + const method = op.get("method"); + const specPath = external_immutable_namespaceObject["default"].List(["paths", path, method]); + + if (validOperationMethods.indexOf(method) === -1) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(OperationContainer, { + key: `${path}-${method}`, + specPath: specPath, + op: op, + path: path, + method: method, + tag: tag })); + + }).toArray() + + ) + )); + + });}render() {let { specSelectors } = this.props;const taggedOps = specSelectors.taggedOperations();if (taggedOps.size === 0) {return /*#__PURE__*/external_react_namespaceObject["default"].createElement("h3", null, " No operations defined in spec!");}return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, taggedOps.map(this.renderOperationTag).toArray(), taggedOps.size < 1 ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("h3", null, " No operations defined in spec! ") : null);} + +} +;// CONCATENATED MODULE: ./src/core/utils/url.js +function isAbsoluteUrl(url) { + return url.match(/^(?:[a-z]+:)?\/\//i); // Matches http://, HTTP://, https://, ftp://, //example.com, +} + +function addProtocol(url) { + if (!url.match(/^\/\//i)) return url; // Checks if protocol is missing e.g. //example.com + + return `${window.location.protocol}${url}`; +} + +function buildBaseUrl(selectedServer, specUrl) { + if (!selectedServer) return specUrl; + if (isAbsoluteUrl(selectedServer)) return addProtocol(selectedServer); + + return new URL(selectedServer, specUrl).href; +} + +function buildUrl(url, specUrl) {let { selectedServer = "" } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (!url) return undefined; + if (isAbsoluteUrl(url)) return url; + + const baseUrl = buildBaseUrl(selectedServer, specUrl); + if (!isAbsoluteUrl(baseUrl)) { + return new URL(url, window.location.href).href; + } + return new URL(url, baseUrl).href; +} + +/** + * Safe version of buildUrl function. `selectedServer` can contain server variables + * which can fail the URL resolution. + */ +function safeBuildUrl(url, specUrl) {let { selectedServer = "" } = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + try { + return buildUrl(url, specUrl, { selectedServer }); + } catch { + return undefined; + } +} +;// CONCATENATED MODULE: ./src/core/components/operation-tag.jsx + + + + + + + + +class OperationTag extends external_react_namespaceObject["default"].Component { + + + + + + + + + + + + + + + + + + + + + + + render() { + const { + tagObj, + tag, + children, + oas3Selectors, + layoutSelectors, + layoutActions, + getConfigs, + getComponent, + specUrl + } = this.props; + + let { + docExpansion, + deepLinking + } = getConfigs(); + + const isDeepLinkingEnabled = deepLinking && deepLinking !== "false"; + + const Collapse = getComponent("Collapse"); + const Markdown = getComponent("Markdown", true); + const DeepLink = getComponent("DeepLink"); + const Link = getComponent("Link"); + const ArrowUpIcon = getComponent("ArrowUpIcon"); + const ArrowDownIcon = getComponent("ArrowDownIcon"); + + let tagDescription = tagObj.getIn(["tagDetails", "description"], null); + let tagExternalDocsDescription = tagObj.getIn(["tagDetails", "externalDocs", "description"]); + let rawTagExternalDocsUrl = tagObj.getIn(["tagDetails", "externalDocs", "url"]); + let tagExternalDocsUrl; + if (isFunc(oas3Selectors) && isFunc(oas3Selectors.selectedServer)) { + tagExternalDocsUrl = safeBuildUrl(rawTagExternalDocsUrl, specUrl, { selectedServer: oas3Selectors.selectedServer() }); + } else { + tagExternalDocsUrl = rawTagExternalDocsUrl; + } + + let isShownKey = ["operations-tag", tag]; + let showTag = layoutSelectors.isShown(isShownKey, docExpansion === "full" || docExpansion === "list"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: showTag ? "opblock-tag-section is-open" : "opblock-tag-section" }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("h3", { + onClick: () => layoutActions.show(isShownKey, !showTag), + className: !tagDescription ? "opblock-tag no-desc" : "opblock-tag", + id: isShownKey.map((v) => escapeDeepLinkPath(v)).join("-"), + "data-tag": tag, + "data-is-open": showTag }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(DeepLink, { + enabled: isDeepLinkingEnabled, + isShown: showTag, + path: createDeepLinkPath(tag), + text: tag }), + !tagDescription ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("small", null) : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("small", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: tagDescription }) + ), + + + !tagExternalDocsUrl ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "info__externaldocs" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("small", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { + href: sanitizeUrl(tagExternalDocsUrl), + onClick: (e) => e.stopPropagation(), + target: "_blank" }, + tagExternalDocsDescription || tagExternalDocsUrl) + ) + ), /*#__PURE__*/ + + + + external_react_namespaceObject["default"].createElement("button", { + "aria-expanded": showTag, + className: "expand-operation", + title: showTag ? "Collapse operation" : "Expand operation", + onClick: () => layoutActions.show(isShownKey, !showTag) }, + + showTag ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowUpIcon, { className: "arrow" }) : /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowDownIcon, { className: "arrow" }) + ) + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(Collapse, { isOpened: showTag }, + children + ) + )); + + } +}(0,defineProperty_namespaceObject["default"])(OperationTag, "defaultProps", { tagObj: external_immutable_namespaceObject["default"].fromJS({}), tag: "" }); +;// CONCATENATED MODULE: ./src/core/assets/rolling-load.svg +const rolling_load_namespaceObject = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAwcHgiICBoZWlnaHQ9IjIwMHB4IiAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCIgcHJlc2VydmVBc3BlY3RSYXRpbz0ieE1pZFlNaWQiIGNsYXNzPSJsZHMtcm9sbGluZyIgc3R5bGU9ImJhY2tncm91bmQtaW1hZ2U6IG5vbmU7IGJhY2tncm91bmQtcG9zaXRpb246IGluaXRpYWwgaW5pdGlhbDsgYmFja2dyb3VuZC1yZXBlYXQ6IGluaXRpYWwgaW5pdGlhbDsiPjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIGZpbGw9Im5vbmUiIG5nLWF0dHItc3Ryb2tlPSJ7e2NvbmZpZy5jb2xvcn19IiBuZy1hdHRyLXN0cm9rZS13aWR0aD0ie3tjb25maWcud2lkdGh9fSIgbmctYXR0ci1yPSJ7e2NvbmZpZy5yYWRpdXN9fSIgbmctYXR0ci1zdHJva2UtZGFzaGFycmF5PSJ7e2NvbmZpZy5kYXNoYXJyYXl9fSIgc3Ryb2tlPSIjNTU1NTU1IiBzdHJva2Utd2lkdGg9IjEwIiByPSIzNSIgc3Ryb2tlLWRhc2hhcnJheT0iMTY0LjkzMzYxNDMxMzQ2NDE1IDU2Ljk3Nzg3MTQzNzgyMTM4Ij48YW5pbWF0ZVRyYW5zZm9ybSBhdHRyaWJ1dGVOYW1lPSJ0cmFuc2Zvcm0iIHR5cGU9InJvdGF0ZSIgY2FsY01vZGU9ImxpbmVhciIgdmFsdWVzPSIwIDUwIDUwOzM2MCA1MCA1MCIga2V5VGltZXM9IjA7MSIgZHVyPSIxcyIgYmVnaW49IjBzIiByZXBlYXRDb3VudD0iaW5kZWZpbml0ZSI+PC9hbmltYXRlVHJhbnNmb3JtPjwvY2lyY2xlPjwvc3ZnPgo="; +;// CONCATENATED MODULE: ./src/core/components/operation.jsx + + + + + + + + + + +class Operation extends external_react_namespaceObject.PureComponent { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + render() { + let { + specPath, + response, + request, + toggleShown, + onTryoutClick, + onResetClick, + onCancelClick, + onExecute, + fn, + getComponent, + getConfigs, + specActions, + specSelectors, + authActions, + authSelectors, + oas3Actions, + oas3Selectors + } = this.props; + let operationProps = this.props.operation; + + let { + deprecated, + isShown, + path, + method, + op, + tag, + operationId, + allowTryItOut, + displayRequestDuration, + tryItOutEnabled, + executeInProgress + } = operationProps.toJS(); + + let { + description, + externalDocs, + schemes + } = op; + + const externalDocsUrl = externalDocs ? safeBuildUrl(externalDocs.url, specSelectors.url(), { selectedServer: oas3Selectors.selectedServer() }) : ""; + let operation = operationProps.getIn(["op"]); + let responses = operation.get("responses"); + let parameters = getList(operation, ["parameters"]); + let operationScheme = specSelectors.operationScheme(path, method); + let isShownKey = ["operations", tag, operationId]; + let extensions = getExtensions(operation); + + const Responses = getComponent("responses"); + const Parameters = getComponent("parameters"); + const Execute = getComponent("execute"); + const Clear = getComponent("clear"); + const Collapse = getComponent("Collapse"); + const Markdown = getComponent("Markdown", true); + const Schemes = getComponent("schemes"); + const OperationServers = getComponent("OperationServers"); + const OperationExt = getComponent("OperationExt"); + const OperationSummary = getComponent("OperationSummary"); + const Link = getComponent("Link"); + + const { showExtensions } = getConfigs(); + + // Merge in Live Response + if (responses && response && response.size > 0) { + let notDocumented = !responses.get(String(response.get("status"))) && !responses.get("default"); + response = response.set("notDocumented", notDocumented); + } + + let onChangeKey = [path, method]; // Used to add values to _this_ operation ( indexed by path and method ) + + const validationErrors = specSelectors.validationErrors([path, method]); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: deprecated ? "opblock opblock-deprecated" : isShown ? `opblock opblock-${method} is-open` : `opblock opblock-${method}`, id: escapeDeepLinkPath(isShownKey.join("-")) }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(OperationSummary, { operationProps: operationProps, isShown: isShown, toggleShown: toggleShown, getComponent: getComponent, authActions: authActions, authSelectors: authSelectors, specPath: specPath }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Collapse, { isOpened: isShown }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-body" }, + operation && operation.size || operation === null ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("img", { height: "32px", width: "32px", src: rolling_load_namespaceObject, className: "opblock-loading-animation" }), + + deprecated && /*#__PURE__*/external_react_namespaceObject["default"].createElement("h4", { className: "opblock-title_normal" }, " Warning: Deprecated"), + description && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-description-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-description" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: description }) + ) + ), + + + externalDocsUrl ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-external-docs-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "opblock-title_normal" }, "Find more details"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-external-docs" }, + externalDocs.description && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "opblock-external-docs__description" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: externalDocs.description }) + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", className: "opblock-external-docs__link", href: sanitizeUrl(externalDocsUrl) }, externalDocsUrl) + ) + ) : null, + + + !operation || !operation.size ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Parameters, { + parameters: parameters, + specPath: specPath.push("parameters"), + operation: operation, + onChangeKey: onChangeKey, + onTryoutClick: onTryoutClick, + onResetClick: onResetClick, + onCancelClick: onCancelClick, + tryItOutEnabled: tryItOutEnabled, + allowTryItOut: allowTryItOut, + + fn: fn, + getComponent: getComponent, + specActions: specActions, + specSelectors: specSelectors, + pathMethod: [path, method], + getConfigs: getConfigs, + oas3Actions: oas3Actions, + oas3Selectors: oas3Selectors } + ), + + + !tryItOutEnabled ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(OperationServers, { + getComponent: getComponent, + path: path, + method: method, + operationServers: operation.get("servers"), + pathServers: specSelectors.paths().getIn([path, "servers"]), + getSelectedServer: oas3Selectors.selectedServer, + setSelectedServer: oas3Actions.setSelectedServer, + setServerVariableValue: oas3Actions.setServerVariableValue, + getServerVariable: oas3Selectors.serverVariableValue, + getEffectiveServerValue: oas3Selectors.serverEffectiveValue } + ), + + + !tryItOutEnabled || !allowTryItOut ? null : schemes && schemes.size ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "opblock-schemes" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Schemes, { schemes: schemes, + path: path, + method: method, + specActions: specActions, + currentScheme: operationScheme }) + ) : null, + + + !tryItOutEnabled || !allowTryItOut || validationErrors.length <= 0 ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "validation-errors errors-wrapper" }, "Please correct the following validation errors and try again.", /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("ul", null, + validationErrors.map((error, index) => /*#__PURE__*/external_react_namespaceObject["default"].createElement("li", { key: index }, " ", error, " ")) + ) + ), /*#__PURE__*/ + + + external_react_namespaceObject["default"].createElement("div", { className: !tryItOutEnabled || !response || !allowTryItOut ? "execute-wrapper" : "btn-group" }, + !tryItOutEnabled || !allowTryItOut ? null : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(Execute, { + operation: operation, + specActions: specActions, + specSelectors: specSelectors, + oas3Selectors: oas3Selectors, + oas3Actions: oas3Actions, + path: path, + method: method, + onExecute: onExecute, + disabled: executeInProgress }), + + + !tryItOutEnabled || !response || !allowTryItOut ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Clear, { + specActions: specActions, + path: path, + method: method }) + + ), + + executeInProgress ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "loading-container" }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "loading" })) : null, + + !responses ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Responses, { + responses: responses, + request: request, + tryItOutResponse: response, + getComponent: getComponent, + getConfigs: getConfigs, + specSelectors: specSelectors, + oas3Actions: oas3Actions, + oas3Selectors: oas3Selectors, + specActions: specActions, + produces: specSelectors.producesOptionsFor([path, method]), + producesValue: specSelectors.currentProducesFor([path, method]), + specPath: specPath.push("responses"), + path: path, + method: method, + displayRequestDuration: displayRequestDuration, + fn: fn }), + + + !showExtensions || !extensions.size ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(OperationExt, { extensions: extensions, getComponent: getComponent }) + + ) + ) + )); + + } + +}(0,defineProperty_namespaceObject["default"])(Operation, "defaultProps", { operation: null, response: null, request: null, specPath: (0,external_immutable_namespaceObject.List)(), summary: "" }); +;// CONCATENATED MODULE: ./src/core/containers/OperationContainer.jsx + + + + + + +class OperationContainer extends external_react_namespaceObject.PureComponent { + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "toggleShown", + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + () => { + let { layoutActions, tag, operationId, isShown } = this.props; + const resolvedSubtree = this.getResolvedSubtree(); + if (!isShown && resolvedSubtree === undefined) { + // transitioning from collapsed to expanded + this.requestResolvedSubtree(); + } + layoutActions.show(["operations", tag, operationId], !isShown); + });(0,defineProperty_namespaceObject["default"])(this, "onCancelClick", + + () => { + this.setState({ tryItOutEnabled: !this.state.tryItOutEnabled }); + });(0,defineProperty_namespaceObject["default"])(this, "onTryoutClick", + + () => { + this.setState({ tryItOutEnabled: !this.state.tryItOutEnabled }); + });(0,defineProperty_namespaceObject["default"])(this, "onResetClick", + + (pathMethod) => { + const defaultRequestBodyValue = this.props.oas3Selectors.selectDefaultRequestBodyValue(...pathMethod); + this.props.oas3Actions.setRequestBodyValue({ value: defaultRequestBodyValue, pathMethod }); + });(0,defineProperty_namespaceObject["default"])(this, "onExecute", + + () => { + this.setState({ executeInProgress: true }); + });(0,defineProperty_namespaceObject["default"])(this, "getResolvedSubtree", + + () => { + const { + specSelectors, + path, + method, + specPath + } = this.props; + + if (specPath) { + return specSelectors.specResolvedSubtree(specPath.toJS()); + } + + return specSelectors.specResolvedSubtree(["paths", path, method]); + });(0,defineProperty_namespaceObject["default"])(this, "requestResolvedSubtree", + + () => { + const { + specActions, + path, + method, + specPath + } = this.props; + + + if (specPath) { + return specActions.requestResolvedSubtree(specPath.toJS()); + } + + return specActions.requestResolvedSubtree(["paths", path, method]); + });const { tryItOutEnabled } = props.getConfigs();this.state = { tryItOutEnabled: tryItOutEnabled === true || tryItOutEnabled === "true", executeInProgress: false };}mapStateToProps(nextState, props) {const { op, layoutSelectors, getConfigs } = props;const { docExpansion, deepLinking, displayOperationId, displayRequestDuration, supportedSubmitMethods } = getConfigs();const showSummary = layoutSelectors.showSummary();const operationId = op.getIn(["operation", "__originalOperationId"]) || op.getIn(["operation", "operationId"]) || (0,es_helpers_namespaceObject.opId)(op.get("operation"), props.path, props.method) || op.get("id");const isShownKey = ["operations", props.tag, operationId];const isDeepLinkingEnabled = deepLinking && deepLinking !== "false";const allowTryItOut = supportedSubmitMethods.indexOf(props.method) >= 0 && (typeof props.allowTryItOut === "undefined" ? props.specSelectors.allowTryItOutFor(props.path, props.method) : props.allowTryItOut);const security = op.getIn(["operation", "security"]) || props.specSelectors.security();return { operationId, isDeepLinkingEnabled, showSummary, displayOperationId, displayRequestDuration, allowTryItOut, security, isAuthorized: props.authSelectors.isAuthorized(security), isShown: layoutSelectors.isShown(isShownKey, docExpansion === "full"), jumpToKey: `paths.${props.path}.${props.method}`, response: props.specSelectors.responseFor(props.path, props.method), request: props.specSelectors.requestFor(props.path, props.method) };}componentDidMount() {const { isShown } = this.props;const resolvedSubtree = this.getResolvedSubtree();if (isShown && resolvedSubtree === undefined) {this.requestResolvedSubtree();}}UNSAFE_componentWillReceiveProps(nextProps) {const { response, isShown } = nextProps;const resolvedSubtree = this.getResolvedSubtree();if (response !== this.props.response) {this.setState({ executeInProgress: false });}if (isShown && resolvedSubtree === undefined) {this.requestResolvedSubtree();}} + + render() { + let { + op: unresolvedOp, + tag, + path, + method, + security, + isAuthorized, + operationId, + showSummary, + isShown, + jumpToKey, + allowTryItOut, + response, + request, + displayOperationId, + displayRequestDuration, + isDeepLinkingEnabled, + specPath, + specSelectors, + specActions, + getComponent, + getConfigs, + layoutSelectors, + layoutActions, + authActions, + authSelectors, + oas3Actions, + oas3Selectors, + fn + } = this.props; + + const Operation = getComponent("operation"); + + const resolvedSubtree = this.getResolvedSubtree() || (0,external_immutable_namespaceObject.Map)(); + + const operationProps = (0,external_immutable_namespaceObject.fromJS)({ + op: resolvedSubtree, + tag, + path, + summary: unresolvedOp.getIn(["operation", "summary"]) || "", + deprecated: resolvedSubtree.get("deprecated") || unresolvedOp.getIn(["operation", "deprecated"]) || false, + method, + security, + isAuthorized, + operationId, + originalOperationId: resolvedSubtree.getIn(["operation", "__originalOperationId"]), + showSummary, + isShown, + jumpToKey, + allowTryItOut, + request, + displayOperationId, + displayRequestDuration, + isDeepLinkingEnabled, + executeInProgress: this.state.executeInProgress, + tryItOutEnabled: this.state.tryItOutEnabled + }); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(Operation, { + operation: operationProps, + response: response, + request: request, + isShown: isShown, + + toggleShown: this.toggleShown, + onTryoutClick: this.onTryoutClick, + onResetClick: this.onResetClick, + onCancelClick: this.onCancelClick, + onExecute: this.onExecute, + specPath: specPath, + + specActions: specActions, + specSelectors: specSelectors, + oas3Actions: oas3Actions, + oas3Selectors: oas3Selectors, + layoutActions: layoutActions, + layoutSelectors: layoutSelectors, + authActions: authActions, + authSelectors: authSelectors, + getComponent: getComponent, + getConfigs: getConfigs, + fn: fn } + )); + + } + +}(0,defineProperty_namespaceObject["default"])(OperationContainer, "defaultProps", { showSummary: true, response: null, allowTryItOut: true, displayOperationId: false, displayRequestDuration: false }); +;// CONCATENATED MODULE: external "lodash/toString" +var toString_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var toString_y = x => () => x +const toString_namespaceObject = toString_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_toString_da931f05__["default"] }); +;// CONCATENATED MODULE: ./src/core/components/operation-summary.jsx + + + + + + + +class OperationSummary extends external_react_namespaceObject.PureComponent { + + + + + + + + + + + + + + + + + + + render() { + + let { + isShown, + toggleShown, + getComponent, + authActions, + authSelectors, + operationProps, + specPath + } = this.props; + + let { + summary, + isAuthorized, + method, + op, + showSummary, + path, + operationId, + originalOperationId, + displayOperationId + } = operationProps.toJS(); + + let { + summary: resolvedSummary + } = op; + + let security = operationProps.get("security"); + + const AuthorizeOperationBtn = getComponent("authorizeOperationBtn", true); + const OperationSummaryMethod = getComponent("OperationSummaryMethod"); + const OperationSummaryPath = getComponent("OperationSummaryPath"); + const JumpToPath = getComponent("JumpToPath", true); + const CopyToClipboardBtn = getComponent("CopyToClipboardBtn", true); + const ArrowUpIcon = getComponent("ArrowUpIcon"); + const ArrowDownIcon = getComponent("ArrowDownIcon"); + + const hasSecurity = security && !!security.count(); + const securityIsOptional = hasSecurity && security.size === 1 && security.first().isEmpty(); + const allowAnonymous = !hasSecurity || securityIsOptional; + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: `opblock-summary opblock-summary-${method}` }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { + "aria-label": `${method} ${path.replace(/\//g, "\u200b/")}`, + "aria-expanded": isShown, + className: "opblock-summary-control", + onClick: toggleShown }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(OperationSummaryMethod, { method: method }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(OperationSummaryPath, { getComponent: getComponent, operationProps: operationProps, specPath: specPath }), + + !showSummary ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-summary-description" }, + (0,toString_namespaceObject["default"])(resolvedSummary || summary) + ), + + + displayOperationId && (originalOperationId || operationId) ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "opblock-summary-operation-id" }, originalOperationId || operationId) : null + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(CopyToClipboardBtn, { textToCopy: `${specPath.get(1)}` }), + + allowAnonymous ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(AuthorizeOperationBtn, { + isAuthorized: isAuthorized, + onClick: () => { + const applicableDefinitions = authSelectors.definitionsForRequirements(security); + authActions.showDefinitions(applicableDefinitions); + } } + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("button", { + "aria-label": `${method} ${path.replace(/\//g, "\u200b/")}`, + className: "opblock-control-arrow", + "aria-expanded": isShown, + tabIndex: "-1", + onClick: toggleShown }, + isShown ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowUpIcon, { className: "arrow" }) : /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowDownIcon, { className: "arrow" }) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JumpToPath, { path: specPath }) + )); + + } +}(0,defineProperty_namespaceObject["default"])(OperationSummary, "defaultProps", { operationProps: null, specPath: (0,external_immutable_namespaceObject.List)(), summary: "" }); +;// CONCATENATED MODULE: ./src/core/components/operation-summary-method.jsx + + + + +class OperationSummaryMethod extends external_react_namespaceObject.PureComponent { + + + + + + + + + + render() { + + let { + method + } = this.props; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { className: "opblock-summary-method" }, method.toUpperCase())); + + } +}(0,defineProperty_namespaceObject["default"])(OperationSummaryMethod, "defaultProps", { operationProps: null }); +;// CONCATENATED MODULE: ./src/core/components/operation-summary-path.jsx + + + + + + +class OperationSummaryPath extends external_react_namespaceObject.PureComponent { + + + + + + + + render() { + let { + getComponent, + operationProps + } = this.props; + + + let { + deprecated, + isShown, + path, + tag, + operationId, + isDeepLinkingEnabled + } = operationProps.toJS(); + + /** + * Add word-break elements between each segment, before the slash + * to allow browsers an opportunity to break long paths into sensible segments. + */ + const pathParts = path.split(/(?=\/)/g); + for (let i = 1; i < pathParts.length; i += 2) { + pathParts.splice(i, 0, /*#__PURE__*/external_react_namespaceObject["default"].createElement("wbr", { key: i })); + } + + const DeepLink = getComponent("DeepLink"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { className: deprecated ? "opblock-summary-path__deprecated" : "opblock-summary-path", + "data-path": path }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(DeepLink, { + enabled: isDeepLinkingEnabled, + isShown: isShown, + path: createDeepLinkPath(`${tag}/${operationId}`), + text: pathParts }) + )); + + + } +} +;// CONCATENATED MODULE: ./src/core/components/operation-extensions.jsx + + + +const OperationExt = (_ref) => {let { extensions, getComponent } = _ref; + let OperationExtRow = getComponent("OperationExtRow"); + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "opblock-section" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-section-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, "Extensions") + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "table-container" }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("table", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("thead", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "col_header" }, "Field"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "col_header" }, "Value") + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tbody", null, + + extensions.entrySeq().map((_ref2) => {let [k, v] = _ref2;return /*#__PURE__*/external_react_namespaceObject["default"].createElement(OperationExtRow, { key: `${k}-${v}`, xKey: k, xVal: v });}) + + ) + ) + ) + )); + +}; + + + + + +/* harmony default export */ const operation_extensions = (OperationExt); +;// CONCATENATED MODULE: ./src/core/components/operation-extension-row.jsx + + + +const OperationExtRow = (_ref) => {let { xKey, xVal } = _ref; + const xNormalizedValue = !xVal ? null : xVal.toJS ? xVal.toJS() : xVal; + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("tr", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, xKey), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, JSON.stringify(xNormalizedValue)) + ); +}; + + + + + +/* harmony default export */ const operation_extension_row = (OperationExtRow); +;// CONCATENATED MODULE: external "classnames" +var external_classnames_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_classnames_y = x => () => x +const external_classnames_namespaceObject = external_classnames_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_classnames__["default"] }); +;// CONCATENATED MODULE: external "js-file-download" +var external_js_file_download_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_js_file_download_y = x => () => x +const external_js_file_download_namespaceObject = external_js_file_download_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_js_file_download_bd23dbb6__["default"] }); +;// CONCATENATED MODULE: ./src/core/components/highlight-code.jsx + + + + + + + + + +const HighlightCode = (_ref) => {let { value, fileName, className, downloadable, getConfigs, canCopy, language } = _ref; + const config = (0,isFunction_namespaceObject["default"])(getConfigs) ? getConfigs() : null; + const canSyntaxHighlight = (0,get_namespaceObject["default"])(config, "syntaxHighlight") !== false && (0,get_namespaceObject["default"])(config, "syntaxHighlight.activated", true); + const rootRef = (0,external_react_namespaceObject.useRef)(null); + + (0,external_react_namespaceObject.useEffect)(() => { + const childNodes = Array. + from(rootRef.current.childNodes). + filter((node) => !!node.nodeType && node.classList.contains("microlight")); + + // eslint-disable-next-line no-use-before-define + childNodes.forEach((node) => node.addEventListener("mousewheel", handlePreventYScrollingBeyondElement, { passive: false })); + + return () => { + // eslint-disable-next-line no-use-before-define + childNodes.forEach((node) => node.removeEventListener("mousewheel", handlePreventYScrollingBeyondElement)); + }; + }, [value, className, language]); + + const handleDownload = () => { + (0,external_js_file_download_namespaceObject["default"])(value, fileName); + }; + + const handlePreventYScrollingBeyondElement = (e) => { + const { target, deltaY } = e; + const { scrollHeight: contentHeight, offsetHeight: visibleHeight, scrollTop } = target; + const scrollOffset = visibleHeight + scrollTop; + const isElementScrollable = contentHeight > visibleHeight; + const isScrollingPastTop = scrollTop === 0 && deltaY < 0; + const isScrollingPastBottom = scrollOffset >= contentHeight && deltaY > 0; + + if (isElementScrollable && (isScrollingPastTop || isScrollingPastBottom)) { + e.preventDefault(); + } + }; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "highlight-code", ref: rootRef }, + canCopy && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "copy-to-clipboard" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_copy_to_clipboard_namespaceObject.CopyToClipboard, { text: value }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("button", null)) + ), + + + !downloadable ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { className: "download-contents", onClick: handleDownload }, "Download" + + ), + + + canSyntaxHighlight ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(light_namespaceObject["default"], { + language: language, + className: (0,external_classnames_namespaceObject["default"])(className, "microlight"), + style: getStyle((0,get_namespaceObject["default"])(config, "syntaxHighlight.theme", "agate")) }, + + value + ) : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("pre", { className: (0,external_classnames_namespaceObject["default"])(className, "microlight") }, value) + + + )); + +}; + + + + + + + + + + + +HighlightCode.defaultProps = { + fileName: "response.txt" +}; + +/* harmony default export */ const highlight_code = (HighlightCode); +;// CONCATENATED MODULE: ./src/core/utils/create-html-ready-id.js +/** + * Replace invalid characters from a string to create an html-ready ID + * + * @param {string} id A string that may contain invalid characters for the HTML ID attribute + * @param {string} [replacement=_] The string to replace invalid characters with; "_" by default + * @return {string} Information about the parameter schema + */ +function createHtmlReadyId(id) {let replacement = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "_"; + return id.replace(/[^\w-]/g, replacement); +} +;// CONCATENATED MODULE: ./src/core/components/responses.jsx + + + + + + + +class Responses extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments); + + + + + + + + + + + + + + + + + + + + + + + + + // These performance-enhancing checks were disabled as part of Multiple Examples + // because they were causing data-consistency issues + // + // shouldComponentUpdate(nextProps) { + // // BUG: props.tryItOutResponse is always coming back as a new Immutable instance + // let render = this.props.tryItOutResponse !== nextProps.tryItOutResponse + // || this.props.responses !== nextProps.responses + // || this.props.produces !== nextProps.produces + // || this.props.producesValue !== nextProps.producesValue + // || this.props.displayRequestDuration !== nextProps.displayRequestDuration + // || this.props.path !== nextProps.path + // || this.props.method !== nextProps.method + // return render + // } + (0,defineProperty_namespaceObject["default"])(this, "onChangeProducesWrapper", + (val) => this.props.specActions.changeProducesValue([this.props.path, this.props.method], val));(0,defineProperty_namespaceObject["default"])(this, "onResponseContentTypeChange", + + (_ref) => {let { controlsAcceptHeader, value } = _ref; + const { oas3Actions, path, method } = this.props; + if (controlsAcceptHeader) { + oas3Actions.setResponseContentType({ + value, + path, + method + }); + } + });} + + render() { + let { + responses, + tryItOutResponse, + getComponent, + getConfigs, + specSelectors, + fn, + producesValue, + displayRequestDuration, + specPath, + path, + method, + oas3Selectors, + oas3Actions + } = this.props; + let defaultCode = defaultStatusCode(responses); + + const ContentType = getComponent("contentType"); + const LiveResponse = getComponent("liveResponse"); + const Response = getComponent("response"); + + let produces = this.props.produces && this.props.produces.size ? this.props.produces : Responses.defaultProps.produces; + + const isSpecOAS3 = specSelectors.isOAS3(); + + const acceptControllingResponse = isSpecOAS3 ? + getAcceptControllingResponse(responses) : null; + + const regionId = createHtmlReadyId(`${method}${path}_responses`); + const controlId = `${regionId}_select`; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "responses-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-section-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, "Responses"), + specSelectors.isOAS3() ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement("label", { htmlFor: controlId }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", null, "Response content type"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ContentType, { value: producesValue, + ariaControls: regionId, + ariaLabel: "Response content type", + className: "execute-content-type", + contentTypes: produces, + controlId: controlId, + onChange: this.onChangeProducesWrapper }) + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "responses-inner" }, + + !tryItOutResponse ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(LiveResponse, { response: tryItOutResponse, + getComponent: getComponent, + getConfigs: getConfigs, + specSelectors: specSelectors, + path: this.props.path, + method: this.props.method, + displayRequestDuration: displayRequestDuration }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, "Responses") + ), /*#__PURE__*/ + + + + external_react_namespaceObject["default"].createElement("table", { "aria-live": "polite", className: "responses-table", id: regionId, role: "region" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("thead", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", { className: "responses-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "col_header response-col_status" }, "Code"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "col_header response-col_description" }, "Description"), + specSelectors.isOAS3() ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("td", { className: "col col_header response-col_links" }, "Links") : null + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tbody", null, + + responses.entrySeq().map((_ref2) => {let [code, response] = _ref2; + + let className = tryItOutResponse && tryItOutResponse.get("status") == code ? "response_current" : ""; + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(Response, { key: code, + path: path, + method: method, + specPath: specPath.push(code), + isDefault: defaultCode === code, + fn: fn, + className: className, + code: code, + response: response, + specSelectors: specSelectors, + controlsAcceptHeader: response === acceptControllingResponse, + onContentTypeChange: this.onResponseContentTypeChange, + contentType: producesValue, + getConfigs: getConfigs, + activeExamplesKey: oas3Selectors.activeExamplesMember( + path, + method, + "responses", + code + ), + oas3Actions: oas3Actions, + getComponent: getComponent })); + + }).toArray() + + ) + ) + ) + )); + + } +}(0,defineProperty_namespaceObject["default"])(Responses, "defaultProps", { tryItOutResponse: null, produces: (0,external_immutable_namespaceObject.fromJS)(["application/json"]), displayRequestDuration: false }); +;// CONCATENATED MODULE: ./src/core/utils/jsonParse.js +function canJsonParse(str) { + try { + let testValueForJson = JSON.parse(str); + return testValueForJson ? true : false; + } catch (e) { + // exception: string is not valid json + return null; + } +} + +function getKnownSyntaxHighlighterLanguage(val) { + // to start, only check for json. can expand as needed in future + const isValidJson = canJsonParse(val); + return isValidJson ? "json" : null; +} +;// CONCATENATED MODULE: ./src/core/components/response.jsx + + + + + + + + + +const getExampleComponent = (sampleResponse, HighlightCode, getConfigs) => { + if ( + sampleResponse !== undefined && + sampleResponse !== null) + { + let language = null; + let testValueForJson = getKnownSyntaxHighlighterLanguage(sampleResponse); + if (testValueForJson) { + language = "json"; + } + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(HighlightCode, { className: "example", getConfigs: getConfigs, language: language, value: stringify(sampleResponse) }) + ); + } + return null; +}; + +class Response extends external_react_namespaceObject["default"].Component { + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "_onContentTypeChange", + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (value) => { + const { onContentTypeChange, controlsAcceptHeader } = this.props; + this.setState({ responseContentType: value }); + onContentTypeChange({ + value: value, + controlsAcceptHeader + }); + });(0,defineProperty_namespaceObject["default"])(this, "getTargetExamplesKey", + + () => { + const { response, contentType, activeExamplesKey } = this.props; + + const activeContentType = this.state.responseContentType || contentType; + const activeMediaType = response.getIn(["content", activeContentType], (0,external_immutable_namespaceObject.Map)({})); + const examplesForMediaType = activeMediaType.get("examples", null); + + const firstExamplesKey = examplesForMediaType.keySeq().first(); + return activeExamplesKey || firstExamplesKey; + });this.state = { responseContentType: "" };} + + render() { + let { + path, + method, + code, + response, + className, + specPath, + fn, + getComponent, + getConfigs, + specSelectors, + contentType, + controlsAcceptHeader, + oas3Actions + } = this.props; + + let { inferSchema, getSampleSchema } = fn; + let isOAS3 = specSelectors.isOAS3(); + const { showExtensions } = getConfigs(); + + let extensions = showExtensions ? getExtensions(response) : null; + let headers = response.get("headers"); + let links = response.get("links"); + const ResponseExtension = getComponent("ResponseExtension"); + const Headers = getComponent("headers"); + const HighlightCode = getComponent("highlightCode"); + const ModelExample = getComponent("modelExample"); + const Markdown = getComponent("Markdown", true); + const OperationLink = getComponent("operationLink"); + const ContentType = getComponent("contentType"); + const ExamplesSelect = getComponent("ExamplesSelect"); + const Example = getComponent("Example"); + + + var schema, specPathWithPossibleSchema; + + const activeContentType = this.state.responseContentType || contentType; + const activeMediaType = response.getIn(["content", activeContentType], (0,external_immutable_namespaceObject.Map)({})); + const examplesForMediaType = activeMediaType.get("examples", null); + + // Goal: find a schema value for `schema` + if (isOAS3) { + const oas3SchemaForContentType = activeMediaType.get("schema"); + + schema = oas3SchemaForContentType ? inferSchema(oas3SchemaForContentType.toJS()) : null; + specPathWithPossibleSchema = oas3SchemaForContentType ? (0,external_immutable_namespaceObject.List)(["content", this.state.responseContentType, "schema"]) : specPath; + } else { + schema = response.get("schema"); + specPathWithPossibleSchema = response.has("schema") ? specPath.push("schema") : specPath; + } + + let mediaTypeExample; + let shouldOverrideSchemaExample = false; + let sampleSchema; + let sampleGenConfig = { + includeReadOnly: true + }; + + // Goal: find an example value for `sampleResponse` + if (isOAS3) {var _activeMediaType$get; + sampleSchema = (_activeMediaType$get = activeMediaType.get("schema")) === null || _activeMediaType$get === void 0 ? void 0 : _activeMediaType$get.toJS(); + if (examplesForMediaType) { + const targetExamplesKey = this.getTargetExamplesKey(); + const targetExample = examplesForMediaType. + get(targetExamplesKey, (0,external_immutable_namespaceObject.Map)({})); + const getMediaTypeExample = (targetExample) => + targetExample.get("value"); + mediaTypeExample = getMediaTypeExample(targetExample); + if (mediaTypeExample === undefined) { + mediaTypeExample = getMediaTypeExample(examplesForMediaType.values().next().value); + } + shouldOverrideSchemaExample = true; + } else if (activeMediaType.get("example") !== undefined) { + // use the example key's value + mediaTypeExample = activeMediaType.get("example"); + shouldOverrideSchemaExample = true; + } + } else { + sampleSchema = schema; + sampleGenConfig = (0,objectSpread2_namespaceObject["default"])((0,objectSpread2_namespaceObject["default"])({}, sampleGenConfig), {}, { includeWriteOnly: true }); + const oldOASMediaTypeExample = response.getIn(["examples", activeContentType]); + if (oldOASMediaTypeExample) { + mediaTypeExample = oldOASMediaTypeExample; + shouldOverrideSchemaExample = true; + } + } + + const sampleResponse = getSampleSchema( + sampleSchema, + activeContentType, + sampleGenConfig, + shouldOverrideSchemaExample ? mediaTypeExample : undefined + ); + + let example = getExampleComponent(sampleResponse, HighlightCode, getConfigs); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("tr", { className: "response " + (className || ""), "data-code": code }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "response-col_status" }, + code + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "response-col_description" }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "response-col_description__inner" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: response.get("description") }) + ), + + !showExtensions || !extensions.size ? null : extensions.entrySeq().map((_ref) => {let [key, v] = _ref;return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ResponseExtension, { key: `${key}-${v}`, xKey: key, xVal: v });}), + + isOAS3 && response.get("content") ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("section", { className: "response-controls" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { + className: (0,external_classnames_namespaceObject["default"])("response-control-media-type", { + "response-control-media-type--accept-controller": controlsAcceptHeader + }) }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("small", { className: "response-control-media-type__title" }, "Media type" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ContentType, { + value: this.state.responseContentType, + contentTypes: + response.get("content") ? + response.get("content").keySeq() : + (0,external_immutable_namespaceObject.Seq)(), + + onChange: this._onContentTypeChange, + ariaLabel: "Media Type" } + ), + controlsAcceptHeader ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("small", { className: "response-control-media-type__accept-message" }, "Controls ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, "Accept"), " header." + ) : + null + ), + examplesForMediaType ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "response-control-examples" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("small", { className: "response-control-examples__title" }, "Examples" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExamplesSelect, { + examples: examplesForMediaType, + currentExampleKey: this.getTargetExamplesKey(), + onSelect: (key) => + oas3Actions.setActiveExamplesMember({ + name: key, + pathMethod: [path, method], + contextType: "responses", + contextName: code + }), + + showLabels: false } + ) + ) : + null + ) : + null, + + example || schema ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ModelExample, { + specPath: specPathWithPossibleSchema, + getComponent: getComponent, + getConfigs: getConfigs, + specSelectors: specSelectors, + schema: fromJSOrdered(schema), + example: example, + includeReadOnly: true }) : + null, + + isOAS3 && examplesForMediaType ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Example, { + example: examplesForMediaType.get(this.getTargetExamplesKey(), (0,external_immutable_namespaceObject.Map)({})), + getComponent: getComponent, + getConfigs: getConfigs, + omitValue: true } + ) : + null, + + headers ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Headers, { + headers: headers, + getComponent: getComponent } + ) : + null + + ), + isOAS3 ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("td", { className: "response-col_links" }, + links ? + links.toSeq().entrySeq().map((_ref2) => {let [key, link] = _ref2; + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(OperationLink, { key: key, name: key, link: link, getComponent: getComponent }); + }) : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("i", null, "No links") + ) : null + )); + + } +}(0,defineProperty_namespaceObject["default"])(Response, "defaultProps", { response: (0,external_immutable_namespaceObject.fromJS)({}), onContentTypeChange: () => {} }); +;// CONCATENATED MODULE: ./src/core/components/response-extension.jsx + + + +const ResponseExtension = (_ref) => {let { xKey, xVal } = _ref; + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "response__extension" }, xKey, ": ", String(xVal)); +}; + + + + + +/* harmony default export */ const response_extension = (ResponseExtension); +;// CONCATENATED MODULE: external "xml-but-prettier" +var external_xml_but_prettier_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_xml_but_prettier_y = x => () => x +const external_xml_but_prettier_namespaceObject = external_xml_but_prettier_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_xml_but_prettier_2ed4d5cb__["default"] }); +;// CONCATENATED MODULE: external "lodash/toLower" +var toLower_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var toLower_y = x => () => x +const toLower_namespaceObject = toLower_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_toLower_c29ee2b0__["default"] }); +;// CONCATENATED MODULE: ./src/core/components/response-body.jsx + + + + + + + + +class ResponseBody extends external_react_namespaceObject["default"].PureComponent {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "state", + { + parsedContent: null + });(0,defineProperty_namespaceObject["default"])(this, "updateParsedContent", + + + + + + + + + + + (prevContent) => { + const { content } = this.props; + + if (prevContent === content) { + return; + } + + if (content && content instanceof Blob) { + var reader = new FileReader(); + reader.onload = () => { + this.setState({ + parsedContent: reader.result + }); + }; + reader.readAsText(content); + } else { + this.setState({ + parsedContent: content.toString() + }); + } + });} + + componentDidMount() { + this.updateParsedContent(null); + } + + componentDidUpdate(prevProps) { + this.updateParsedContent(prevProps.content); + } + + render() { + let { content, contentType, url, headers = {}, getConfigs, getComponent } = this.props; + const { parsedContent } = this.state; + const HighlightCode = getComponent("highlightCode"); + const downloadName = "response_" + new Date().getTime(); + let body, bodyEl; + url = url || ""; + + if ( + (/^application\/octet-stream/i.test(contentType) || + headers["Content-Disposition"] && /attachment/i.test(headers["Content-Disposition"]) || + headers["content-disposition"] && /attachment/i.test(headers["content-disposition"]) || + headers["Content-Description"] && /File Transfer/i.test(headers["Content-Description"]) || + headers["content-description"] && /File Transfer/i.test(headers["content-description"])) && + content.size > 0) + { + // Download + + if ("Blob" in window) { + let type = contentType || "text/html"; + let blob = content instanceof Blob ? content : new Blob([content], { type: type }); + let href = window.URL.createObjectURL(blob); + let fileName = url.substr(url.lastIndexOf("/") + 1); + let download = [type, fileName, href].join(":"); + + // Use filename from response header, + // First check if filename is quoted (e.g. contains space), if no, fallback to not quoted check + let disposition = headers["content-disposition"] || headers["Content-Disposition"]; + if (typeof disposition !== "undefined") { + let responseFilename = extractFileNameFromContentDispositionHeader(disposition); + if (responseFilename !== null) { + download = responseFilename; + } + } + + if (core_window.navigator && core_window.navigator.msSaveOrOpenBlob) { + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/external_react_namespaceObject["default"].createElement("a", { href: href, onClick: () => core_window.navigator.msSaveOrOpenBlob(blob, download) }, "Download file")); + } else { + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/external_react_namespaceObject["default"].createElement("a", { href: href, download: download }, "Download file")); + } + } else { + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement("pre", { className: "microlight" }, "Download headers detected but your browser does not support downloading binary via XHR (Blob)."); + } + + // Anything else (CORS) + } else if (/json/i.test(contentType)) { + // JSON + let language = null; + let testValueForJson = getKnownSyntaxHighlighterLanguage(content); + if (testValueForJson) { + language = "json"; + } + try { + body = JSON.stringify(JSON.parse(content), null, " "); + } catch (error) { + body = "can't parse JSON. Raw result:\n\n" + content; + } + + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement(HighlightCode, { language: language, downloadable: true, fileName: `${downloadName}.json`, value: body, getConfigs: getConfigs, canCopy: true }); + + // XML + } else if (/xml/i.test(contentType)) { + body = (0,external_xml_but_prettier_namespaceObject["default"])(content, { + textNodesOnSameLine: true, + indentor: " " + }); + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement(HighlightCode, { downloadable: true, fileName: `${downloadName}.xml`, value: body, getConfigs: getConfigs, canCopy: true }); + + // HTML or Plain Text + } else if ((0,toLower_namespaceObject["default"])(contentType) === "text/html" || /text\/plain/.test(contentType)) { + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement(HighlightCode, { downloadable: true, fileName: `${downloadName}.html`, value: content, getConfigs: getConfigs, canCopy: true }); + + // CSV + } else if ((0,toLower_namespaceObject["default"])(contentType) === "text/csv" || /text\/csv/.test(contentType)) { + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement(HighlightCode, { downloadable: true, fileName: `${downloadName}.csv`, value: content, getConfigs: getConfigs, canCopy: true }); + + // Image + } else if (/^image\//i.test(contentType)) { + if (contentType.includes("svg")) { + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, " ", content, " "); + } else { + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement("img", { src: window.URL.createObjectURL(content) }); + } + + // Audio + } else if (/^audio\//i.test(contentType)) { + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement("pre", { className: "microlight" }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("audio", { controls: true, key: url }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("source", { src: url, type: contentType }))); + } else if (typeof content === "string") { + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement(HighlightCode, { downloadable: true, fileName: `${downloadName}.txt`, value: content, getConfigs: getConfigs, canCopy: true }); + } else if (content.size > 0) { + // We don't know the contentType, but there was some content returned + if (parsedContent) { + // We were able to squeeze something out of content + // in `updateParsedContent`, so let's display it + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", { className: "i" }, "Unrecognized response type; displaying content as text." + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(HighlightCode, { downloadable: true, fileName: `${downloadName}.txt`, value: parsedContent, getConfigs: getConfigs, canCopy: true }) + ); + + } else { + // Give up + bodyEl = /*#__PURE__*/external_react_namespaceObject["default"].createElement("p", { className: "i" }, "Unrecognized response type; unable to display." + + ); + } + } else { + // We don't know the contentType and there was no content returned + bodyEl = null; + } + + return !bodyEl ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h5", null, "Response body"), + bodyEl + ); + + } +} +;// CONCATENATED MODULE: ./src/core/components/parameters/parameters.jsx + + + + + +class Parameters extends external_react_namespaceObject.Component { + + constructor(props) { + super(props);(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (param, value, isXml) => { + let { + specActions: { changeParamByIdentity }, + onChangeKey + } = this.props; + + changeParamByIdentity(onChangeKey, param, value, isXml); + });(0,defineProperty_namespaceObject["default"])(this, "onChangeConsumesWrapper", + + (val) => { + let { + specActions: { changeConsumesValue }, + onChangeKey + } = this.props; + + changeConsumesValue(onChangeKey, val); + });(0,defineProperty_namespaceObject["default"])(this, "toggleTab", + + (tab) => { + if (tab === "parameters") { + return this.setState({ + parametersVisible: true, + callbackVisible: false + }); + } else if (tab === "callbacks") { + return this.setState({ + callbackVisible: true, + parametersVisible: false + }); + } + });(0,defineProperty_namespaceObject["default"])(this, "onChangeMediaType", + + (_ref) => {let { value, pathMethod } = _ref; + let { specActions, oas3Selectors, oas3Actions } = this.props; + const userHasEditedBody = oas3Selectors.hasUserEditedBody(...pathMethod); + const shouldRetainRequestBodyValue = oas3Selectors.shouldRetainRequestBodyValue(...pathMethod); + oas3Actions.setRequestContentType({ value, pathMethod }); + oas3Actions.initRequestBodyValidateError({ pathMethod }); + if (!userHasEditedBody) { + if (!shouldRetainRequestBodyValue) { + oas3Actions.setRequestBodyValue({ value: undefined, pathMethod }); + } + specActions.clearResponse(...pathMethod); + specActions.clearRequest(...pathMethod); + specActions.clearValidateParams(pathMethod); + } + });this.state = { callbackVisible: false, parametersVisible: true };} + + render() { + + let { + onTryoutClick, + onResetClick, + parameters, + allowTryItOut, + tryItOutEnabled, + specPath, + fn, + getComponent, + getConfigs, + specSelectors, + specActions, + pathMethod, + oas3Actions, + oas3Selectors, + operation + } = this.props; + + const ParameterRow = getComponent("parameterRow"); + const TryItOutButton = getComponent("TryItOutButton"); + const ContentType = getComponent("contentType"); + const Callbacks = getComponent("Callbacks", true); + const RequestBody = getComponent("RequestBody", true); + + const isExecute = tryItOutEnabled && allowTryItOut; + const isOAS3 = specSelectors.isOAS3(); + + + const requestBody = operation.get("requestBody"); + + const groupedParametersArr = Object.values(parameters. + reduce((acc, x) => {var _acc$key; + const key = x.get("in"); + (_acc$key = acc[key]) !== null && _acc$key !== void 0 ? _acc$key : acc[key] = []; + acc[key].push(x); + return acc; + }, {})). + reduce((acc, x) => acc.concat(x), []); + + const retainRequestBodyValueFlagForOperation = (f) => oas3Actions.setRetainRequestBodyValueFlag({ value: f, pathMethod }); + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "opblock-section" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-section-header" }, + isOAS3 ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "tab-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { onClick: () => this.toggleTab("parameters"), + className: `tab-item ${this.state.parametersVisible && "active"}` }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "opblock-title" }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, "Parameters")) + ), + operation.get("callbacks") ? /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { onClick: () => this.toggleTab("callbacks"), + className: `tab-item ${this.state.callbackVisible && "active"}` }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "opblock-title" }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, "Callbacks")) + ) : + null + + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "tab-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "opblock-title" }, "Parameters") + ), + + allowTryItOut ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(TryItOutButton, { + isOAS3: specSelectors.isOAS3(), + hasUserEditedBody: oas3Selectors.hasUserEditedBody(...pathMethod), + enabled: tryItOutEnabled, + onCancelClick: this.props.onCancelClick, + onTryoutClick: onTryoutClick, + onResetClick: () => onResetClick(pathMethod) }) : + null + ), + this.state.parametersVisible ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "parameters-container" }, + !groupedParametersArr.length ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "opblock-description-wrapper" }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("p", null, "No parameters")) : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "table-container" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("table", { className: "parameters" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("thead", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("th", { className: "col_header parameters-col_name" }, "Name"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("th", { className: "col_header parameters-col_description" }, "Description") + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tbody", null, + + groupedParametersArr.map((parameter, i) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ParameterRow, { + fn: fn, + specPath: specPath.push(i.toString()), + getComponent: getComponent, + getConfigs: getConfigs, + rawParam: parameter, + param: specSelectors.parameterWithMetaByIdentity(pathMethod, parameter), + key: `${parameter.get("in")}.${parameter.get("name")}`, + onChange: this.onChange, + onChangeConsumes: this.onChangeConsumesWrapper, + specSelectors: specSelectors, + specActions: specActions, + oas3Actions: oas3Actions, + oas3Selectors: oas3Selectors, + pathMethod: pathMethod, + isExecute: isExecute }) + ) + + ) + ) + ) + + ) : null, + + this.state.callbackVisible ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "callbacks-container opblock-description-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Callbacks, { + callbacks: (0,external_immutable_namespaceObject.Map)(operation.get("callbacks")), + specPath: specPath.slice(0, -1).push("callbacks") } + ) + ) : null, + + isOAS3 && requestBody && this.state.parametersVisible && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-section opblock-section-request-body" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-section-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: `opblock-title parameter__name ${requestBody.get("required") && "required"}` }, "Request body" + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ContentType, { + value: oas3Selectors.requestContentType(...pathMethod), + contentTypes: requestBody.get("content", (0,external_immutable_namespaceObject.List)()).keySeq(), + onChange: (value) => { + this.onChangeMediaType({ value, pathMethod }); + }, + className: "body-param-content-type", + ariaLabel: "Request content type" }) + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-description-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(RequestBody, { + setRetainRequestBodyValueFlag: retainRequestBodyValueFlagForOperation, + userHasEditedBody: oas3Selectors.hasUserEditedBody(...pathMethod), + specPath: specPath.slice(0, -1).push("requestBody"), + requestBody: requestBody, + requestBodyValue: oas3Selectors.requestBodyValue(...pathMethod), + requestBodyInclusionSetting: oas3Selectors.requestBodyInclusionSetting(...pathMethod), + requestBodyErrors: oas3Selectors.requestBodyErrors(...pathMethod), + isExecute: isExecute, + getConfigs: getConfigs, + activeExamplesKey: oas3Selectors.activeExamplesMember( + ...pathMethod, + "requestBody", + "requestBody" // RBs are currently not stored per-mediaType + ), + updateActiveExamplesKey: (key) => { + this.props.oas3Actions.setActiveExamplesMember({ + name: key, + pathMethod: this.props.pathMethod, + contextType: "requestBody", + contextName: "requestBody" // RBs are currently not stored per-mediaType + }); + }, + + onChange: (value, path) => { + if (path) { + const lastValue = oas3Selectors.requestBodyValue(...pathMethod); + const usableValue = external_immutable_namespaceObject.Map.isMap(lastValue) ? lastValue : (0,external_immutable_namespaceObject.Map)(); + return oas3Actions.setRequestBodyValue({ + pathMethod, + value: usableValue.setIn(path, value) + }); + } + oas3Actions.setRequestBodyValue({ value, pathMethod }); + }, + onChangeIncludeEmpty: (name, value) => { + oas3Actions.setRequestBodyInclusion({ + pathMethod, + value, + name + }); + }, + contentType: oas3Selectors.requestContentType(...pathMethod) }) + ) + ) + + )); + + } +}(0,defineProperty_namespaceObject["default"])(Parameters, "defaultProps", { onTryoutClick: Function.prototype, onCancelClick: Function.prototype, tryItOutEnabled: false, allowTryItOut: true, onChangeKey: [], specPath: [] }); +;// CONCATENATED MODULE: ./src/core/components/parameters/index.js + +;// CONCATENATED MODULE: ./src/core/components/parameter-extension.jsx + + + +const ParameterExt = (_ref) => {let { xKey, xVal } = _ref; + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "parameter__extension" }, xKey, ": ", String(xVal)); +}; + + + + + +/* harmony default export */ const parameter_extension = (ParameterExt); +;// CONCATENATED MODULE: ./src/core/components/parameter-include-empty.jsx + + + + + +const noop = () => {}; + + + + + + + + +const ParameterIncludeEmptyDefaultProps = { + onChange: noop, + isIncludedOptions: {} +}; +class ParameterIncludeEmpty extends external_react_namespaceObject.Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onCheckboxChange", + + + + + + + + + + + + (e) => { + const { onChange } = this.props; + onChange(e.target.checked); + });}componentDidMount() {const { isIncludedOptions, onChange } = this.props;const { shouldDispatchInit, defaultValue } = isIncludedOptions;if (shouldDispatchInit) {onChange(defaultValue);}} + + render() { + let { isIncluded, isDisabled } = this.props; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", { className: (0,external_classnames_namespaceObject["default"])("parameter__empty_value_toggle", { + "disabled": isDisabled + }) }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("input", { type: "checkbox", + disabled: isDisabled, + checked: !isDisabled && isIncluded, + onChange: this.onCheckboxChange }), "Send empty value" + + ) + )); + + } +}(0,defineProperty_namespaceObject["default"])(ParameterIncludeEmpty, "defaultProps", ParameterIncludeEmptyDefaultProps); +;// CONCATENATED MODULE: ./src/core/components/parameter-row.jsx + + + + + + + + +class ParameterRow extends external_react_namespaceObject.Component { + + + + + + + + + + + + + + + + + + constructor(props, context) {var _this; + super(props, context);_this = this;(0,defineProperty_namespaceObject["default"])(this, "onChangeWrapper", + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + function (value) {let isXml = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; + let { onChange, rawParam } = _this.props; + let valueForUpstream; + + // Coerce empty strings and empty Immutable objects to null + if (value === "" || value && value.size === 0) { + valueForUpstream = null; + } else { + valueForUpstream = value; + } + + return onChange(rawParam, valueForUpstream, isXml); + });(0,defineProperty_namespaceObject["default"])(this, "_onExampleSelect", + + (key /* { isSyntheticChange } = {} */) => { + this.props.oas3Actions.setActiveExamplesMember({ + name: key, + pathMethod: this.props.pathMethod, + contextType: "parameters", + contextName: this.getParamKey() + }); + });(0,defineProperty_namespaceObject["default"])(this, "onChangeIncludeEmpty", + + (newValue) => { + let { specActions, param, pathMethod } = this.props; + const paramName = param.get("name"); + const paramIn = param.get("in"); + return specActions.updateEmptyParamInclusion(pathMethod, paramName, paramIn, newValue); + });(0,defineProperty_namespaceObject["default"])(this, "setDefaultValue", + + () => { + let { specSelectors, pathMethod, rawParam, oas3Selectors, fn } = this.props; + + const paramWithMeta = specSelectors.parameterWithMetaByIdentity(pathMethod, rawParam) || (0,external_immutable_namespaceObject.Map)(); + const { schema } = getParameterSchema(paramWithMeta, { isOAS3: specSelectors.isOAS3() }); + const parameterMediaType = paramWithMeta. + get("content", (0,external_immutable_namespaceObject.Map)()). + keySeq(). + first(); + + // getSampleSchema could return null + const generatedSampleValue = schema ? fn.getSampleSchema(schema.toJS(), parameterMediaType, { + + includeWriteOnly: true + }) : null; + + if (!paramWithMeta || paramWithMeta.get("value") !== undefined) { + return; + } + + if (paramWithMeta.get("in") !== "body") { + let initialValue; + + //// Find an initial value + + if (specSelectors.isSwagger2()) { + initialValue = + paramWithMeta.get("x-example") !== undefined ? + paramWithMeta.get("x-example") : + paramWithMeta.getIn(["schema", "example"]) !== undefined ? + paramWithMeta.getIn(["schema", "example"]) : + schema && schema.getIn(["default"]); + } else if (specSelectors.isOAS3()) { + const currentExampleKey = oas3Selectors.activeExamplesMember(...pathMethod, "parameters", this.getParamKey()); + initialValue = + paramWithMeta.getIn(["examples", currentExampleKey, "value"]) !== undefined ? + paramWithMeta.getIn(["examples", currentExampleKey, "value"]) : + paramWithMeta.getIn(["content", parameterMediaType, "example"]) !== undefined ? + paramWithMeta.getIn(["content", parameterMediaType, "example"]) : + paramWithMeta.get("example") !== undefined ? + paramWithMeta.get("example") : + (schema && schema.get("example")) !== undefined ? + schema && schema.get("example") : + (schema && schema.get("default")) !== undefined ? + schema && schema.get("default") : + paramWithMeta.get("default"); // ensures support for `parameterMacro` + } + + //// Process the initial value + + if (initialValue !== undefined && !external_immutable_namespaceObject.List.isList(initialValue)) { + // Stringify if it isn't a List + initialValue = stringify(initialValue); + } + + //// Dispatch the initial value + + if (initialValue !== undefined) { + this.onChangeWrapper(initialValue); + } else if ( + schema && schema.get("type") === "object" && + generatedSampleValue && + !paramWithMeta.get("examples")) + { + // Object parameters get special treatment.. if the user doesn't set any + // default or example values, we'll provide initial values generated from + // the schema. + // However, if `examples` exist for the parameter, we won't do anything, + // so that the appropriate `examples` logic can take over. + this.onChangeWrapper( + external_immutable_namespaceObject.List.isList(generatedSampleValue) ? + generatedSampleValue : + + stringify(generatedSampleValue) + + ); + } + } + });this.setDefaultValue();}UNSAFE_componentWillReceiveProps(props) {let { specSelectors, pathMethod, rawParam } = props;let isOAS3 = specSelectors.isOAS3();let parameterWithMeta = specSelectors.parameterWithMetaByIdentity(pathMethod, rawParam) || new external_immutable_namespaceObject.Map(); // fallback, if the meta lookup fails + parameterWithMeta = parameterWithMeta.isEmpty() ? rawParam : parameterWithMeta;let enumValue;if (isOAS3) {let { schema } = getParameterSchema(parameterWithMeta, { isOAS3 });enumValue = schema ? schema.get("enum") : undefined;} else {enumValue = parameterWithMeta ? parameterWithMeta.get("enum") : undefined;}let paramValue = parameterWithMeta ? parameterWithMeta.get("value") : undefined;let value;if (paramValue !== undefined) {value = paramValue;} else if (rawParam.get("required") && enumValue && enumValue.size) {value = enumValue.first();}if (value !== undefined && value !== paramValue) {this.onChangeWrapper(numberToString(value));} // todo: could check if schema here; if not, do not call. impact? + this.setDefaultValue();}getParamKey() { + const { param } = this.props; + + if (!param) return null; + + return `${param.get("name")}-${param.get("in")}`; + } + + render() { + let { param, rawParam, getComponent, getConfigs, isExecute, fn, onChangeConsumes, specSelectors, pathMethod, specPath, oas3Selectors } = this.props; + + let isOAS3 = specSelectors.isOAS3(); + + const { showExtensions, showCommonExtensions } = getConfigs(); + + if (!param) { + param = rawParam; + } + + if (!rawParam) return null; + + // const onChangeWrapper = (value) => onChange(param, value) + const JsonSchemaForm = getComponent("JsonSchemaForm"); + const ParamBody = getComponent("ParamBody"); + let inType = param.get("in"); + let bodyParam = inType !== "body" ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ParamBody, { getComponent: getComponent, + getConfigs: getConfigs, + fn: fn, + param: param, + consumes: specSelectors.consumesOptionsFor(pathMethod), + consumesValue: specSelectors.contentTypeValues(pathMethod).get("requestContentType"), + onChange: this.onChangeWrapper, + onChangeConsumes: onChangeConsumes, + isExecute: isExecute, + specSelectors: specSelectors, + pathMethod: pathMethod } + ); + + const ModelExample = getComponent("modelExample"); + const Markdown = getComponent("Markdown", true); + const ParameterExt = getComponent("ParameterExt"); + const ParameterIncludeEmpty = getComponent("ParameterIncludeEmpty"); + const ExamplesSelectValueRetainer = getComponent("ExamplesSelectValueRetainer"); + const Example = getComponent("Example"); + + let { schema } = getParameterSchema(param, { isOAS3 }); + let paramWithMeta = specSelectors.parameterWithMetaByIdentity(pathMethod, rawParam) || (0,external_immutable_namespaceObject.Map)(); + + let format = schema ? schema.get("format") : null; + let type = schema ? schema.get("type") : null; + let itemType = schema ? schema.getIn(["items", "type"]) : null; + let isFormData = inType === "formData"; + let isFormDataSupported = ("FormData" in core_window); + let required = param.get("required"); + + let value = paramWithMeta ? paramWithMeta.get("value") : ""; + let commonExt = showCommonExtensions ? getCommonExtensions(schema) : null; + let extensions = showExtensions ? getExtensions(param) : null; + + let paramItems; // undefined + let paramEnum; // undefined + let paramDefaultValue; // undefined + let paramExample; // undefined + let isDisplayParamEnum = false; + + if (param !== undefined && schema) { + paramItems = schema.get("items"); + } + + if (paramItems !== undefined) { + paramEnum = paramItems.get("enum"); + paramDefaultValue = paramItems.get("default"); + } else if (schema) { + paramEnum = schema.get("enum"); + } + + if (paramEnum && paramEnum.size && paramEnum.size > 0) { + isDisplayParamEnum = true; + } + + // Default and Example Value for readonly doc + if (param !== undefined) { + if (schema) { + paramDefaultValue = schema.get("default"); + } + if (paramDefaultValue === undefined) { + paramDefaultValue = param.get("default"); + } + paramExample = param.get("example"); + if (paramExample === undefined) { + paramExample = param.get("x-example"); + } + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("tr", { "data-param-name": param.get("name"), "data-param-in": param.get("in") }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "parameters-col_name" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: required ? "parameter__name required" : "parameter__name" }, + param.get("name"), + !required ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, "\xA0*") + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "parameter__type" }, + type, + itemType && `[${itemType}]`, + format && /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "prop-format" }, "($", format, ")") + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "parameter__deprecated" }, + isOAS3 && param.get("deprecated") ? "deprecated" : null + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "parameter__in" }, "(", param.get("in"), ")"), + !showCommonExtensions || !commonExt.size ? null : commonExt.entrySeq().map((_ref) => {let [key, v] = _ref;return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ParameterExt, { key: `${key}-${v}`, xKey: key, xVal: v });}), + !showExtensions || !extensions.size ? null : extensions.entrySeq().map((_ref2) => {let [key, v] = _ref2;return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ParameterExt, { key: `${key}-${v}`, xKey: key, xVal: v });}) + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("td", { className: "parameters-col_description" }, + param.get("description") ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(Markdown, { source: param.get("description") }) : null, + + (bodyParam || !isExecute) && isDisplayParamEnum ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { className: "parameter__enum", source: + "Available values : " + paramEnum.map(function (item) { + return item; + }).toArray().join(", ") }) : + null, + + + (bodyParam || !isExecute) && paramDefaultValue !== undefined ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { className: "parameter__default", source: "Default value : " + paramDefaultValue }) : + null, + + + (bodyParam || !isExecute) && paramExample !== undefined ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: "Example : " + paramExample }) : + null, + + + isFormData && !isFormDataSupported && /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, "Error: your browser does not support FormData"), + + + isOAS3 && param.get("examples") ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("section", { className: "parameter-controls" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExamplesSelectValueRetainer, { + examples: param.get("examples"), + onSelect: this._onExampleSelect, + updateValue: this.onChangeWrapper, + getComponent: getComponent, + defaultToFirstExample: true, + currentKey: oas3Selectors.activeExamplesMember(...pathMethod, "parameters", this.getParamKey()), + currentUserInputValue: value } + ) + ) : + null, + + + bodyParam ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JsonSchemaForm, { fn: fn, + getComponent: getComponent, + value: value, + required: required, + disabled: !isExecute, + description: param.get("name"), + onChange: this.onChangeWrapper, + errors: paramWithMeta.get("errors"), + schema: schema }), + + + + + bodyParam && schema ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(ModelExample, { getComponent: getComponent, + specPath: specPath.push("schema"), + getConfigs: getConfigs, + isExecute: isExecute, + specSelectors: specSelectors, + schema: schema, + example: bodyParam, + includeWriteOnly: true }) : + null, + + + + !bodyParam && isExecute && param.get("allowEmptyValue") ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ParameterIncludeEmpty, { + onChange: this.onChangeIncludeEmpty, + isIncluded: specSelectors.parameterInclusionSettingFor(pathMethod, param.get("name"), param.get("in")), + isDisabled: !isEmptyValue(value) }) : + null, + + + + isOAS3 && param.get("examples") ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Example, { + example: param.getIn([ + "examples", + oas3Selectors.activeExamplesMember(...pathMethod, "parameters", this.getParamKey())] + ), + getComponent: getComponent, + getConfigs: getConfigs } + ) : + null + + + ) + + )); + + + } + +} +;// CONCATENATED MODULE: ./src/core/components/execute.jsx + + + +class Execute extends external_react_namespaceObject.Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "handleValidateParameters", + + + + + + + + + + + + + + () => { + let { specSelectors, specActions, path, method } = this.props; + specActions.validateParams([path, method]); + return specSelectors.validateBeforeExecute([path, method]); + });(0,defineProperty_namespaceObject["default"])(this, "handleValidateRequestBody", + + () => { + let { path, method, specSelectors, oas3Selectors, oas3Actions } = this.props; + let validationErrors = { + missingBodyValue: false, + missingRequiredKeys: [] + }; + // context: reset errors, then (re)validate + oas3Actions.clearRequestBodyValidateError({ path, method }); + let oas3RequiredRequestBodyContentType = specSelectors.getOAS3RequiredRequestBodyContentType([path, method]); + let oas3RequestBodyValue = oas3Selectors.requestBodyValue(path, method); + let oas3ValidateBeforeExecuteSuccess = oas3Selectors.validateBeforeExecute([path, method]); + let oas3RequestContentType = oas3Selectors.requestContentType(path, method); + + if (!oas3ValidateBeforeExecuteSuccess) { + validationErrors.missingBodyValue = true; + oas3Actions.setRequestBodyValidateError({ path, method, validationErrors }); + return false; + } + if (!oas3RequiredRequestBodyContentType) { + return true; + } + let missingRequiredKeys = oas3Selectors.validateShallowRequired({ + oas3RequiredRequestBodyContentType, + oas3RequestContentType, + oas3RequestBodyValue + }); + if (!missingRequiredKeys || missingRequiredKeys.length < 1) { + return true; + } + missingRequiredKeys.forEach((missingKey) => { + validationErrors.missingRequiredKeys.push(missingKey); + }); + oas3Actions.setRequestBodyValidateError({ path, method, validationErrors }); + return false; + });(0,defineProperty_namespaceObject["default"])(this, "handleValidationResultPass", + + () => { + let { specActions, operation, path, method } = this.props; + if (this.props.onExecute) { + // loading spinner + this.props.onExecute(); + } + specActions.execute({ operation, path, method }); + });(0,defineProperty_namespaceObject["default"])(this, "handleValidationResultFail", + + () => { + let { specActions, path, method } = this.props; + // deferred by 40ms, to give element class change time to settle. + specActions.clearValidateParams([path, method]); + setTimeout(() => { + specActions.validateParams([path, method]); + }, 40); + });(0,defineProperty_namespaceObject["default"])(this, "handleValidationResult", + + (isPass) => { + if (isPass) { + this.handleValidationResultPass(); + } else { + this.handleValidationResultFail(); + } + });(0,defineProperty_namespaceObject["default"])(this, "onClick", + + () => { + let paramsResult = this.handleValidateParameters(); + let requestBodyResult = this.handleValidateRequestBody(); + let isPass = paramsResult && requestBodyResult; + this.handleValidationResult(isPass); + });(0,defineProperty_namespaceObject["default"])(this, "onChangeProducesWrapper", + + (val) => this.props.specActions.changeProducesValue([this.props.path, this.props.method], val));} + + render() { + const { disabled } = this.props; + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("button", { className: "btn execute opblock-control__btn", onClick: this.onClick, disabled: disabled }, "Execute" + + )); + + } +} +;// CONCATENATED MODULE: ./src/core/components/headers.jsx + + + + +const propClass = "header-example"; + +class headers_Headers extends external_react_namespaceObject["default"].Component { + + + + + + render() { + let { headers, getComponent } = this.props; + + const Property = getComponent("Property"); + const Markdown = getComponent("Markdown", true); + + if (!headers || !headers.size) + return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "headers-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "headers__title" }, "Headers:"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("table", { className: "headers" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("thead", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", { className: "header-row" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("th", { className: "header-col" }, "Name"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("th", { className: "header-col" }, "Description"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("th", { className: "header-col" }, "Type") + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tbody", null, + + headers.entrySeq().map((_ref) => {let [key, header] = _ref; + if (!external_immutable_namespaceObject["default"].Map.isMap(header)) { + return null; + } + + const description = header.get("description"); + const type = header.getIn(["schema"]) ? header.getIn(["schema", "type"]) : header.getIn(["type"]); + const schemaExample = header.getIn(["schema", "example"]); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("tr", { key: key }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "header-col" }, key), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "header-col" }, + !description ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement(Markdown, { source: description }) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "header-col" }, type, " ", schemaExample ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(Property, { propKey: "Example", propVal: schemaExample, propClass: propClass }) : null) + ); + }).toArray() + + ) + ) + )); + + } +} +;// CONCATENATED MODULE: ./src/core/components/errors.jsx + + + + +class Errors extends external_react_namespaceObject["default"].Component { + + + + + + + + + + render() { + let { editorActions, errSelectors, layoutSelectors, layoutActions, getComponent } = this.props; + + const Collapse = getComponent("Collapse"); + + if (editorActions && editorActions.jumpToLine) { + var jumpToLine = editorActions.jumpToLine; + } + + let errors = errSelectors.allErrors(); + + // all thrown errors, plus error-level everything else + let allErrorsToDisplay = errors.filter((err) => err.get("type") === "thrown" ? true : err.get("level") === "error"); + + if (!allErrorsToDisplay || allErrorsToDisplay.count() < 1) { + return null; + } + + let isVisible = layoutSelectors.isShown(["errorPane"], true); + let toggleVisibility = () => layoutActions.show(["errorPane"], !isVisible); + + let sortedJSErrors = allErrorsToDisplay.sortBy((err) => err.get("line")); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("pre", { className: "errors-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("hgroup", { className: "error" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "errors__title" }, "Errors"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { className: "btn errors__clear-btn", onClick: toggleVisibility }, isVisible ? "Hide" : "Show") + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Collapse, { isOpened: isVisible, animated: true }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "errors" }, + sortedJSErrors.map((err, i) => { + let type = err.get("type"); + if (type === "thrown" || type === "auth") { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ThrownErrorItem, { key: i, error: err.get("error") || err, jumpToLine: jumpToLine }); + } + if (type === "spec") { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(SpecErrorItem, { key: i, error: err, jumpToLine: jumpToLine }); + } + }) + ) + ) + )); + + } +} + +const ThrownErrorItem = (_ref) => {let { error, jumpToLine } = _ref; + if (!error) { + return null; + } + let errorLine = error.get("line"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "error-wrapper" }, + !error ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, error.get("source") && error.get("level") ? + toTitleCase(error.get("source")) + " " + error.get("level") : "", + error.get("path") ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("small", null, " at ", error.get("path")) : null), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "message thrown" }, + error.get("message") + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "error-line" }, + errorLine && jumpToLine ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("a", { onClick: jumpToLine.bind(null, errorLine) }, "Jump to line ", errorLine) : null + ) + ) + + )); + +}; + +const SpecErrorItem = (_ref2) => {let { error, jumpToLine } = _ref2; + let locationMessage = null; + + if (error.get("path")) { + if (external_immutable_namespaceObject.List.isList(error.get("path"))) { + locationMessage = /*#__PURE__*/external_react_namespaceObject["default"].createElement("small", null, "at ", error.get("path").join(".")); + } else { + locationMessage = /*#__PURE__*/external_react_namespaceObject["default"].createElement("small", null, "at ", error.get("path")); + } + } else if (error.get("line") && !jumpToLine) { + locationMessage = /*#__PURE__*/external_react_namespaceObject["default"].createElement("small", null, "on line ", error.get("line")); + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "error-wrapper" }, + !error ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, toTitleCase(error.get("source")) + " " + error.get("level"), "\xA0", locationMessage), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "message" }, error.get("message")), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "error-line" }, + jumpToLine ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("a", { onClick: jumpToLine.bind(null, error.get("line")) }, "Jump to line ", error.get("line")) : + null + ) + ) + + )); + +}; + +function toTitleCase(str) { + return (str || ""). + split(" "). + map((substr) => substr[0].toUpperCase() + substr.slice(1)). + join(" "); +} + + + + + + +ThrownErrorItem.defaultProps = { + jumpToLine: null +}; +;// CONCATENATED MODULE: ./src/core/components/content-type.jsx + + + + + +const content_type_noop = () => {}; + +class ContentType extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onChangeWrapper", + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (e) => this.props.onChange(e.target.value));}componentDidMount() {// Needed to populate the form, initially + if (this.props.contentTypes) {this.props.onChange(this.props.contentTypes.first());}}UNSAFE_componentWillReceiveProps(nextProps) {if (!nextProps.contentTypes || !nextProps.contentTypes.size) {return;}if (!nextProps.contentTypes.includes(nextProps.value)) {nextProps.onChange(nextProps.contentTypes.first());}} + render() { + let { ariaControls, ariaLabel, className, contentTypes, controlId, value } = this.props; + + if (!contentTypes || !contentTypes.size) + return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "content-type-wrapper " + (className || "") }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("select", { "aria-controls": ariaControls, "aria-label": ariaLabel, className: "content-type", id: controlId, onChange: this.onChangeWrapper, value: value || "" }, + contentTypes.map((val) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("option", { key: val, value: val }, val); + }).toArray() + ) + )); + + } +}(0,defineProperty_namespaceObject["default"])(ContentType, "defaultProps", { onChange: content_type_noop, value: null, contentTypes: (0,external_immutable_namespaceObject.fromJS)(["application/json"]) }); +;// CONCATENATED MODULE: ./src/core/components/layout-utils.jsx +const layout_utils_excluded = ["fullscreen", "full"],_excluded2 = ["hide", "keepContents", "mobile", "tablet", "desktop", "large"]; + + +function xclass() {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];} + return args.filter((a) => !!a).join(" ").trim(); +} + +class Container extends external_react_namespaceObject["default"].Component { + render() { + let _this$props = this.props,{ fullscreen, full } = _this$props,rest = (0,objectWithoutProperties_namespaceObject["default"])(_this$props, layout_utils_excluded); + // Normal element + + if (fullscreen) + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("section", rest); + + let containerClass = "swagger-container" + (full ? "-full" : ""); + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("section", (0,extends_namespaceObject["default"])({}, rest, { className: xclass(rest.className, containerClass) }))); + + } +} + + + + + + + +const DEVICES = { + "mobile": "", + "tablet": "-tablet", + "desktop": "-desktop", + "large": "-hd" +}; + +class Col extends external_react_namespaceObject["default"].Component { + + render() { + const _this$props2 = + + + + + + + + + + + + this.props,{ hide, keepContents, /* we don't want these in the `rest` object that passes to the final component, + since React now complains. So we extract them */ /* eslint-disable no-unused-vars */mobile, tablet, desktop, large /* eslint-enable no-unused-vars */ } = _this$props2,rest = (0,objectWithoutProperties_namespaceObject["default"])(_this$props2, _excluded2); + if (hide && !keepContents) + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null); + + let classesAr = []; + + for (let device in DEVICES) { + if (!Object.prototype.hasOwnProperty.call(DEVICES, device)) { + continue; + } + let deviceClass = DEVICES[device]; + if (device in this.props) { + let val = this.props[device]; + + if (val < 1) { + classesAr.push("none" + deviceClass); + continue; + } + + classesAr.push("block" + deviceClass); + classesAr.push("col-" + val + deviceClass); + } + } + + if (hide) { + classesAr.push("hidden"); + } + + let classes = xclass(rest.className, ...classesAr); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("section", (0,extends_namespaceObject["default"])({}, rest, { className: classes }))); + + } + +} + + + + + + + + + + + +class Row extends external_react_namespaceObject["default"].Component { + + render() { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", (0,extends_namespaceObject["default"])({}, this.props, { className: xclass(this.props.className, "wrapper") })); + } + +} + + + + + +class Button extends external_react_namespaceObject["default"].Component { + + + + + + + + + + render() { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("button", (0,extends_namespaceObject["default"])({}, this.props, { className: xclass(this.props.className, "button") })); + } + +}(0,defineProperty_namespaceObject["default"])(Button, "defaultProps", { className: "" }); + + +const TextArea = (props) => /*#__PURE__*/external_react_namespaceObject["default"].createElement("textarea", props); + +const Input = (props) => /*#__PURE__*/external_react_namespaceObject["default"].createElement("input", props); + +class Select extends external_react_namespaceObject["default"].Component { + + + + + + + + + + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + + + + + + + + + + + (e) => { + let { onChange, multiple } = this.props; + let options = [].slice.call(e.target.options); + let value; + + + if (multiple) { + value = options.filter(function (option) { + return option.selected; + }). + map(function (option) { + return option.value; + }); + } else { + value = e.target.value; + } + + this.setState({ value: value }); + + onChange && onChange(value); + });let _value;if (props.value) {_value = props.value;} else {_value = props.multiple ? [""] : "";}this.state = { value: _value };} + + UNSAFE_componentWillReceiveProps(nextProps) { + // TODO: this puts us in a weird area btwn un/controlled selection... review + if (nextProps.value !== this.props.value) { + this.setState({ value: nextProps.value }); + } + } + + render() {var _this$state$value, _this$state$value$toJ; + let { allowedValues, multiple, allowEmptyValue, disabled } = this.props; + let value = ((_this$state$value = this.state.value) === null || _this$state$value === void 0 || (_this$state$value$toJ = _this$state$value.toJS) === null || _this$state$value$toJ === void 0 ? void 0 : _this$state$value$toJ.call(_this$state$value)) || this.state.value; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("select", { className: this.props.className, multiple: multiple, value: value, onChange: this.onChange, disabled: disabled }, + allowEmptyValue ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("option", { value: "" }, "--") : null, + + allowedValues.map(function (item, key) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("option", { key: key, value: String(item) }, String(item)); + }) + + )); + + } +}(0,defineProperty_namespaceObject["default"])(Select, "defaultProps", { multiple: false, allowEmptyValue: true }); + +class Link extends external_react_namespaceObject["default"].Component { + + render() { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("a", (0,extends_namespaceObject["default"])({}, this.props, { rel: "noopener noreferrer", className: xclass(this.props.className, "link") })); + } + +} + + + + + +const NoMargin = (_ref) => {let { children } = _ref;return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "no-margin" }, " ", children, " ");}; + + + + + +class Collapse extends external_react_namespaceObject["default"].Component { + + + + + + + + + + + + + renderNotAnimated() { + if (!this.props.isOpened) + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("noscript", null); + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(NoMargin, null, + this.props.children + )); + + } + + render() { + let { animated, isOpened, children } = this.props; + + if (!animated) + return this.renderNotAnimated(); + + children = isOpened ? children : null; + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(NoMargin, null, + children + )); + + } + +}(0,defineProperty_namespaceObject["default"])(Collapse, "defaultProps", { isOpened: false, animated: false }); +;// CONCATENATED MODULE: ./src/core/components/overview.jsx + + + + +class Overview extends external_react_namespaceObject["default"].Component { + + constructor() { + super(...arguments); + this.setTagShown = this._setTagShown.bind(this); + } + + _setTagShown(showTagId, shown) { + this.props.layoutActions.show(showTagId, shown); + } + + showOp(key, shown) { + let { layoutActions } = this.props; + layoutActions.show(key, shown); + } + + render() { + let { specSelectors, layoutSelectors, layoutActions, getComponent } = this.props; + let taggedOps = specSelectors.taggedOperations(); + + const Collapse = getComponent("Collapse"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "overview-title" }, "Overview"), + + + taggedOps.map((tagObj, tag) => { + let operations = tagObj.get("operations"); + + let showTagId = ["overview-tags", tag]; + let showTag = layoutSelectors.isShown(showTagId, true); + let toggleShow = () => layoutActions.show(showTagId, !showTag); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { key: "overview-" + tag }, /*#__PURE__*/ + + + external_react_namespaceObject["default"].createElement("h4", { onClick: toggleShow, className: "link overview-tag" }, " ", showTag ? "-" : "+", tag), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(Collapse, { isOpened: showTag, animated: true }, + + operations.map((op) => { + let { path, method, id } = op.toObject(); // toObject is shallow + let showOpIdPrefix = "operations"; + let showOpId = id; + let shown = layoutSelectors.isShown([showOpIdPrefix, showOpId]); + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(OperationLink, { key: id, + path: path, + method: method, + id: path + "-" + method, + shown: shown, + showOpId: showOpId, + showOpIdPrefix: showOpIdPrefix, + href: `#operation-${showOpId}`, + onClick: layoutActions.show }); + }).toArray() + + ) + + )); + + }).toArray(), + + + taggedOps.size < 1 && /*#__PURE__*/external_react_namespaceObject["default"].createElement("h3", null, " No operations defined in spec! ") + )); + + } + +} + + + + + + + + +class OperationLink extends external_react_namespaceObject["default"].Component { + + constructor(props) { + super(props); + this.onClick = this._onClick.bind(this); + } + + _onClick() { + let { showOpId, showOpIdPrefix, onClick, shown } = this.props; + onClick([showOpIdPrefix, showOpId], !shown); + } + + render() { + let { id, method, shown, href } = this.props; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(Link, { href: href, onClick: this.onClick, className: `block opblock-link ${shown ? "shown" : ""}` }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("small", { className: `bold-label-${method}` }, method.toUpperCase()), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "bold-label" }, id) + ) + )); + + } + +} +;// CONCATENATED MODULE: ./src/core/components/initialized-input.jsx +const initialized_input_excluded = ["value", "defaultValue", "initialValue"]; // This component provides an interface that feels like an uncontrolled input +// to consumers, while providing a `defaultValue` interface that initializes +// the input's value using JavaScript value property APIs instead of React's +// vanilla[0] implementation that uses HTML value attributes. +// +// This is useful in situations where we don't want to surface an input's value +// into the HTML/CSS-exposed side of the DOM, for example to avoid sequential +// input chaining attacks[1]. +// +// [0]: https://github.com/facebook/react/blob/baff5cc2f69d30589a5dc65b089e47765437294b/fixtures/dom/src/components/fixtures/text-inputs/README.md +// [1]: https://github.com/d0nutptr/sic + + + + +class InitializedInput extends external_react_namespaceObject["default"].Component { + componentDidMount() { + // Set the element's `value` property (*not* the `value` attribute) + // once, on mount, if an `initialValue` is provided. + if (this.props.initialValue) { + this.inputRef.value = this.props.initialValue; + } + } + + render() { + // Filter out `value` and `defaultValue`, since we have our own + // `initialValue` interface that we provide. + // eslint-disable-next-line no-unused-vars, react/prop-types + const _this$props = this.props,{ value, defaultValue, initialValue } = _this$props,otherProps = (0,objectWithoutProperties_namespaceObject["default"])(_this$props, initialized_input_excluded); + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("input", (0,extends_namespaceObject["default"])({}, otherProps, { ref: (c) => this.inputRef = c })); + } +} +;// CONCATENATED MODULE: ./src/core/components/info.jsx +/** + * @prettier + */ + + + + + + +class InfoBasePath extends external_react_namespaceObject["default"].Component { + + + + + + render() { + const { host, basePath } = this.props; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("pre", { className: "base-url" }, "[ Base URL: ", + host, + basePath, " ]" + )); + + } +} + +class InfoUrl extends external_react_namespaceObject["default"].PureComponent { + + + + + + render() { + const { url, getComponent } = this.props; + const Link = getComponent("Link"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: sanitizeUrl(url) }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "url" }, " ", url) + )); + + } +} + +class Info extends external_react_namespaceObject["default"].Component { + + + + + + + + + + + + + + + render() { + const { + info, + url, + host, + basePath, + getComponent, + externalDocs, + selectedServer, + url: specUrl + } = this.props; + const version = info.get("version"); + const description = info.get("description"); + const title = info.get("title"); + const termsOfServiceUrl = safeBuildUrl( + info.get("termsOfService"), + specUrl, + { selectedServer } + ); + const contactData = info.get("contact"); + const licenseData = info.get("license"); + const rawExternalDocsUrl = externalDocs && externalDocs.get("url"); + const externalDocsUrl = safeBuildUrl(rawExternalDocsUrl, specUrl, { + selectedServer + }); + const externalDocsDescription = + externalDocs && externalDocs.get("description"); + + const Markdown = getComponent("Markdown", true); + const Link = getComponent("Link"); + const VersionStamp = getComponent("VersionStamp"); + const OpenAPIVersion = getComponent("OpenAPIVersion"); + const InfoUrl = getComponent("InfoUrl"); + const InfoBasePath = getComponent("InfoBasePath"); + const License = getComponent("License"); + const Contact = getComponent("Contact"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "info" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("hgroup", { className: "main" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h2", { className: "title" }, + title, + version && /*#__PURE__*/external_react_namespaceObject["default"].createElement(VersionStamp, { version: version }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(OpenAPIVersion, { oasVersion: "2.0" }) + ), + host || basePath ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(InfoBasePath, { host: host, basePath: basePath }) : + null, + url && /*#__PURE__*/external_react_namespaceObject["default"].createElement(InfoUrl, { getComponent: getComponent, url: url }) + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "description" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: description }) + ), + + termsOfServiceUrl && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "info__tos" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: sanitizeUrl(termsOfServiceUrl) }, "Terms of service" + + ) + ), + + + (contactData === null || contactData === void 0 ? void 0 : contactData.size) > 0 && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Contact, { + getComponent: getComponent, + data: contactData, + selectedServer: selectedServer, + url: url } + ), + + (licenseData === null || licenseData === void 0 ? void 0 : licenseData.size) > 0 && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(License, { + getComponent: getComponent, + license: licenseData, + selectedServer: selectedServer, + url: url } + ), + + externalDocsUrl ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { + className: "info__extdocs", + target: "_blank", + href: sanitizeUrl(externalDocsUrl) }, + + externalDocsDescription || externalDocsUrl + ) : + null + )); + + } +} + +/* harmony default export */ const components_info = (Info); +;// CONCATENATED MODULE: ./src/core/containers/info.jsx + + + +class InfoContainer extends external_react_namespaceObject["default"].Component { + + + + + + + + + render() { + const { specSelectors, getComponent, oas3Selectors } = this.props; + + const info = specSelectors.info(); + const url = specSelectors.url(); + const basePath = specSelectors.basePath(); + const host = specSelectors.host(); + const externalDocs = specSelectors.externalDocs(); + const selectedServer = oas3Selectors.selectedServer(); + + const Info = getComponent("info"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, + info && info.count() ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Info, { info: info, url: url, host: host, basePath: basePath, externalDocs: externalDocs, + getComponent: getComponent, selectedServer: selectedServer }) : + null + )); + + } +} +;// CONCATENATED MODULE: ./src/core/components/contact.jsx +/** + * @prettier + */ + + + + + +class Contact extends external_react_namespaceObject["default"].Component { + + + + + + + + + render() { + const { data, getComponent, selectedServer, url: specUrl } = this.props; + const name = data.get("name", "the developer"); + const url = safeBuildUrl(data.get("url"), specUrl, { selectedServer }); + const email = data.get("email"); + + const Link = getComponent("Link"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "info__contact" }, + url && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { href: sanitizeUrl(url), target: "_blank" }, + name, " - Website" + ) + ), + + email && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { href: sanitizeUrl(`mailto:${email}`) }, + url ? `Send email to ${name}` : `Contact ${name}` + ) + + )); + + } +} + +/* harmony default export */ const contact = (Contact); +;// CONCATENATED MODULE: ./src/core/components/license.jsx +/** + * @prettier + */ + + + + + +class License extends external_react_namespaceObject["default"].Component { + + + + + + + + + render() { + const { license, getComponent, selectedServer, url: specUrl } = this.props; + const name = license.get("name", "License"); + const url = safeBuildUrl(license.get("url"), specUrl, { selectedServer }); + + const Link = getComponent("Link"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "info__license" }, + url ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "info__license__url" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: sanitizeUrl(url) }, + name + ) + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", null, name) + + )); + + } +} + +/* harmony default export */ const license = (License); +;// CONCATENATED MODULE: ./src/core/components/jump-to-path.jsx + + +// Nothing by default- component can be overridden by another plugin. + +class JumpToPath extends external_react_namespaceObject["default"].Component { + render() { + return null; + } +} +;// CONCATENATED MODULE: ./src/core/components/copy-to-clipboard-btn.jsx + + + + +/** + * @param {{ getComponent: func, textToCopy: string }} props + * @returns {JSX.Element} + * @constructor + */ +class CopyToClipboardBtn extends external_react_namespaceObject["default"].Component { + render() { + let { getComponent } = this.props; + + const CopyIcon = getComponent("CopyIcon"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "view-line-link copy-to-clipboard", title: "Copy to clipboard" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_copy_to_clipboard_namespaceObject.CopyToClipboard, { text: this.props.textToCopy }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(CopyIcon, null) + ) + )); + + } + + + + + +} +;// CONCATENATED MODULE: ./src/core/components/footer.jsx + + +class Footer extends external_react_namespaceObject["default"].Component { + render() { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "footer" })); + + } +} +;// CONCATENATED MODULE: ./src/core/containers/filter.jsx + + + +class FilterContainer extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onFilterChange", + + + + + + + + + (e) => { + const { target: { value } } = e; + this.props.layoutActions.updateFilter(value); + });} + + render() { + const { specSelectors, layoutSelectors, getComponent } = this.props; + const Col = getComponent("Col"); + + const isLoading = specSelectors.loadingStatus() === "loading"; + const isFailed = specSelectors.loadingStatus() === "failed"; + const filter = layoutSelectors.currentFilter(); + + const classNames = ["operation-filter-input"]; + if (isFailed) classNames.push("failed"); + if (isLoading) classNames.push("loading"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, + filter === null || filter === false || filter === "false" ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "filter-container" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { className: "filter wrapper", mobile: 12 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("input", { className: classNames.join(" "), placeholder: "Filter by tag", type: "text", + onChange: this.onFilterChange, value: filter === true || filter === "true" ? "" : filter, + disabled: isLoading }) + ) + ) + + )); + + } +} +;// CONCATENATED MODULE: ./src/core/components/param-body.jsx + + + + + +const NOOP = Function.prototype; + +class ParamBody extends external_react_namespaceObject.PureComponent { + + + + + + + + + + + + + + + + + + + + + + + constructor(_props, context) { + super(_props, context);(0,defineProperty_namespaceObject["default"])(this, "updateValues", + + + + + + + + + + + + + + + + + (props) => { + let { param, isExecute, consumesValue = "" } = props; + let isXml = /xml/i.test(consumesValue); + let isJson = /json/i.test(consumesValue); + let paramValue = isXml ? param.get("value_xml") : param.get("value"); + + if (paramValue !== undefined) { + let val = !paramValue && isJson ? "{}" : paramValue; + this.setState({ value: val }); + this.onChange(val, { isXml: isXml, isEditBox: isExecute }); + } else { + if (isXml) { + this.onChange(this.sample("xml"), { isXml: isXml, isEditBox: isExecute }); + } else { + this.onChange(this.sample(), { isEditBox: isExecute }); + } + } + });(0,defineProperty_namespaceObject["default"])(this, "sample", + + (xml) => { + let { param, fn } = this.props; + let schema = fn.inferSchema(param.toJS()); + + return fn.getSampleSchema(schema, xml, { + includeWriteOnly: true + }); + });(0,defineProperty_namespaceObject["default"])(this, "onChange", + + (value, _ref) => {let { isEditBox, isXml } = _ref; + this.setState({ value, isEditBox }); + this._onChange(value, isXml); + });(0,defineProperty_namespaceObject["default"])(this, "_onChange", + + (val, isXml) => {(this.props.onChange || NOOP)(val, isXml);});(0,defineProperty_namespaceObject["default"])(this, "handleOnChange", + + (e) => { + const { consumesValue } = this.props; + const isXml = /xml/i.test(consumesValue); + const inputValue = e.target.value; + this.onChange(inputValue, { isXml, isEditBox: this.state.isEditBox }); + });(0,defineProperty_namespaceObject["default"])(this, "toggleIsEditBox", + + () => this.setState((state) => ({ isEditBox: !state.isEditBox })));this.state = { isEditBox: false, value: "" };}componentDidMount() {this.updateValues.call(this, this.props);}UNSAFE_componentWillReceiveProps(nextProps) {this.updateValues.call(this, nextProps);} + + render() { + let { + onChangeConsumes, + param, + isExecute, + specSelectors, + pathMethod, + getConfigs, + getComponent + } = this.props; + + const Button = getComponent("Button"); + const TextArea = getComponent("TextArea"); + const HighlightCode = getComponent("highlightCode"); + const ContentType = getComponent("contentType"); + // for domains where specSelectors not passed + let parameter = specSelectors ? specSelectors.parameterWithMetaByIdentity(pathMethod, param) : param; + let errors = parameter.get("errors", (0,external_immutable_namespaceObject.List)()); + let consumesValue = specSelectors.contentTypeValues(pathMethod).get("requestContentType"); + let consumes = this.props.consumes && this.props.consumes.size ? this.props.consumes : ParamBody.defaultProp.consumes; + + let { value, isEditBox } = this.state; + let language = null; + let testValueForJson = getKnownSyntaxHighlighterLanguage(value); + if (testValueForJson) { + language = "json"; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "body-param", "data-param-name": param.get("name"), "data-param-in": param.get("in") }, + + isEditBox && isExecute ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(TextArea, { className: "body-param__text" + (errors.count() ? " invalid" : ""), value: value, onChange: this.handleOnChange }) : + value && /*#__PURE__*/external_react_namespaceObject["default"].createElement(HighlightCode, { className: "body-param__example", + language: language, + getConfigs: getConfigs, + value: value }), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "body-param-options" }, + + !isExecute ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "body-param-edit" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Button, { className: isEditBox ? "btn cancel body-param__example-edit" : "btn edit body-param__example-edit", + onClick: this.toggleIsEditBox }, isEditBox ? "Cancel" : "Edit" + ) + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("label", { htmlFor: "" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", null, "Parameter content type"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ContentType, { + value: consumesValue, + contentTypes: consumes, + onChange: onChangeConsumes, + className: "body-param-content-type", + ariaLabel: "Parameter content type" }) + ) + ) + + )); + + + } +}(0,defineProperty_namespaceObject["default"])(ParamBody, "defaultProp", { consumes: (0,external_immutable_namespaceObject.fromJS)(["application/json"]), param: (0,external_immutable_namespaceObject.fromJS)({}), onChange: NOOP, onChangeConsumes: NOOP }); +;// CONCATENATED MODULE: ./src/core/components/curl.jsx + + + + + + + +class Curl extends external_react_namespaceObject["default"].Component { + + + + + + render() { + let { request, getConfigs } = this.props; + let curl = requestSnippetGenerator_curl_bash(request); + + const config = getConfigs(); + + const curlBlock = (0,get_namespaceObject["default"])(config, "syntaxHighlight.activated") ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(light_namespaceObject["default"], { + language: "bash", + className: "curl microlight", + style: getStyle((0,get_namespaceObject["default"])(config, "syntaxHighlight.theme")) }, + + curl + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("textarea", { readOnly: true, className: "curl", value: curl }); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "curl-command" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, "Curl"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "copy-to-clipboard" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_copy_to_clipboard_namespaceObject.CopyToClipboard, { text: curl }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("button", null)) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, + curlBlock + ) + )); + + } + +} +;// CONCATENATED MODULE: ./src/core/components/schemes.jsx + + + +class Schemes extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + + + + + + + + + + + + + + + + + + + + + + + (e) => { + this.setScheme(e.target.value); + });(0,defineProperty_namespaceObject["default"])(this, "setScheme", + + (value) => { + let { path, method, specActions } = this.props; + + specActions.setScheme(value, path, method); + });}UNSAFE_componentWillMount() {let { schemes } = this.props; //fire 'change' event to set default 'value' of select + this.setScheme(schemes.first());}UNSAFE_componentWillReceiveProps(nextProps) {if (!this.props.currentScheme || !nextProps.schemes.includes(this.props.currentScheme)) {// if we don't have a selected currentScheme or if our selected scheme is no longer an option, + // then fire 'change' event and select the first scheme in the list of options + this.setScheme(nextProps.schemes.first());}}render() {let { schemes, currentScheme } = this.props; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("label", { htmlFor: "schemes" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "schemes-title" }, "Schemes"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("select", { onChange: this.onChange, value: currentScheme }, + schemes.valueSeq().map( + (scheme) => /*#__PURE__*/external_react_namespaceObject["default"].createElement("option", { value: scheme, key: scheme }, scheme) + ).toArray() + ) + )); + + } +} +;// CONCATENATED MODULE: ./src/core/containers/schemes.jsx + + + +class SchemesContainer extends external_react_namespaceObject["default"].Component { + + + + + + + + render() { + const { specActions, specSelectors, getComponent } = this.props; + + const currentScheme = specSelectors.operationScheme(); + const schemes = specSelectors.schemes(); + + const Schemes = getComponent("schemes"); + + const schemesArePresent = schemes && schemes.size; + + return schemesArePresent ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Schemes, { + currentScheme: currentScheme, + schemes: schemes, + specActions: specActions } + ) : + null; + } +} +;// CONCATENATED MODULE: ./src/core/components/model-collapse.jsx + + + + + +class ModelCollapse extends external_react_namespaceObject.Component { + + + + + + + + + + + + + + + + + + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "toggleCollapsed", + + + + + + + + + + + + + + + + + + + + + + + + + + () => { + if (this.props.onToggle) { + this.props.onToggle(this.props.modelName, !this.state.expanded); + } + + this.setState({ + expanded: !this.state.expanded + }); + });(0,defineProperty_namespaceObject["default"])(this, "onLoad", + + (ref) => { + if (ref && this.props.layoutSelectors) { + const scrollToKey = this.props.layoutSelectors.getScrollToKey(); + + if (external_immutable_namespaceObject["default"].is(scrollToKey, this.props.specPath)) this.toggleCollapsed(); + this.props.layoutActions.readyToScroll(this.props.specPath, ref.parentElement); + } + });let { expanded, collapsedContent } = this.props;this.state = { expanded: expanded, collapsedContent: collapsedContent || ModelCollapse.defaultProps.collapsedContent };}componentDidMount() {const { hideSelfOnExpand, expanded, modelName } = this.props;if (hideSelfOnExpand && expanded) {// We just mounted pre-expanded, and we won't be going back.. + // So let's give our parent an `onToggle` call.. + // Since otherwise it will never be called. + this.props.onToggle(modelName, expanded);}}UNSAFE_componentWillReceiveProps(nextProps) {if (this.props.expanded !== nextProps.expanded) {this.setState({ expanded: nextProps.expanded });}}render() {const { title, classes } = this.props; + + if (this.state.expanded) { + if (this.props.hideSelfOnExpand) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: classes || "" }, + this.props.children + ); + } + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { className: classes || "", ref: this.onLoad }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { "aria-expanded": this.state.expanded, className: "model-box-control", onClick: this.toggleCollapsed }, + title && /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "pointer" }, title), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "model-toggle" + (this.state.expanded ? "" : " collapsed") }), + !this.state.expanded && /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, this.state.collapsedContent) + ), + + this.state.expanded && this.props.children + )); + + } +}(0,defineProperty_namespaceObject["default"])(ModelCollapse, "defaultProps", { collapsedContent: "{...}", expanded: false, title: null, onToggle: () => {}, hideSelfOnExpand: false, specPath: external_immutable_namespaceObject["default"].List([]) }); +;// CONCATENATED MODULE: ./src/core/components/model-example.jsx + + + + + + +class ModelExample extends external_react_namespaceObject["default"].Component { + + + + + + + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "activeTab", + + + + + + + + + + + + + + + + + + + (e) => { + let { target: { dataset: { name } } } = e; + + this.setState({ + activeTab: name + }); + });let { getConfigs, isExecute } = this.props;let { defaultModelRendering } = getConfigs();let activeTab = defaultModelRendering;if (defaultModelRendering !== "example" && defaultModelRendering !== "model") {activeTab = "example";}if (isExecute) {activeTab = "example";}this.state = { activeTab };} + + UNSAFE_componentWillReceiveProps(nextProps) { + if ( + nextProps.isExecute && + !this.props.isExecute && + this.props.example) + { + this.setState({ activeTab: "example" }); + } + } + + render() { + let { getComponent, specSelectors, schema, example, isExecute, getConfigs, specPath, includeReadOnly, includeWriteOnly } = this.props; + let { defaultModelExpandDepth } = getConfigs(); + const ModelWrapper = getComponent("ModelWrapper"); + const HighlightCode = getComponent("highlightCode"); + const exampleTabId = browser_default()(5).toString("base64"); + const examplePanelId = browser_default()(5).toString("base64"); + const modelTabId = browser_default()(5).toString("base64"); + const modelPanelId = browser_default()(5).toString("base64"); + + let isOAS3 = specSelectors.isOAS3(); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "model-example" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { className: "tab", role: "tablist" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { className: (0,external_classnames_namespaceObject["default"])("tabitem", { active: this.state.activeTab === "example" }), role: "presentation" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { + "aria-controls": examplePanelId, + "aria-selected": this.state.activeTab === "example", + className: "tablinks", + "data-name": "example", + id: exampleTabId, + onClick: this.activeTab, + role: "tab" }, + + isExecute ? "Edit Value" : "Example Value" + ) + ), + schema && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { className: (0,external_classnames_namespaceObject["default"])("tabitem", { active: this.state.activeTab === "model" }), role: "presentation" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { + "aria-controls": modelPanelId, + "aria-selected": this.state.activeTab === "model", + className: (0,external_classnames_namespaceObject["default"])("tablinks", { inactive: isExecute }), + "data-name": "model", + id: modelTabId, + onClick: this.activeTab, + role: "tab" }, + + isOAS3 ? "Schema" : "Model" + ) + ) + + ), + this.state.activeTab === "example" && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { + "aria-hidden": this.state.activeTab !== "example", + "aria-labelledby": exampleTabId, + "data-name": "examplePanel", + id: examplePanelId, + role: "tabpanel", + tabIndex: "0" }, + + example ? example : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(HighlightCode, { value: "(no example available)", getConfigs: getConfigs }) + + ), + + + this.state.activeTab === "model" && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { + "aria-hidden": this.state.activeTab === "example", + "aria-labelledby": modelTabId, + "data-name": "modelPanel", + id: modelPanelId, + role: "tabpanel", + tabIndex: "0" }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(ModelWrapper, { + schema: schema, + getComponent: getComponent, + getConfigs: getConfigs, + specSelectors: specSelectors, + expandDepth: defaultModelExpandDepth, + specPath: specPath, + includeReadOnly: includeReadOnly, + includeWriteOnly: includeWriteOnly } + ) + ) + + )); + + } + +} +;// CONCATENATED MODULE: ./src/core/components/model-wrapper.jsx + + + + +class ModelWrapper extends external_react_namespaceObject.Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onToggle", + + + + + + + + + + + + + + + + + + (name, isShown) => { + // If this prop is present, we'll have deepLinking for it + if (this.props.layoutActions) { + this.props.layoutActions.show(this.props.fullPath, isShown); + } + });} + + render() { + let { getComponent, getConfigs } = this.props; + const Model = getComponent("Model"); + + let expanded; + if (this.props.layoutSelectors) { + // If this is prop is present, we'll have deepLinking for it + expanded = this.props.layoutSelectors.isShown(this.props.fullPath); + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "model-box" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Model, (0,extends_namespaceObject["default"])({}, this.props, { getConfigs: getConfigs, expanded: expanded, depth: 1, onToggle: this.onToggle, expandDepth: this.props.expandDepth || 0 })) + ); + } +} +;// CONCATENATED MODULE: external "react-immutable-pure-component" +var external_react_immutable_pure_component_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_react_immutable_pure_component_y = x => () => x +const external_react_immutable_pure_component_namespaceObject = external_react_immutable_pure_component_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_immutable_pure_component_cbcfaebd__["default"] }); +;// CONCATENATED MODULE: ./src/core/components/model.jsx + + + + + + + +const decodeRefName = (uri) => { + const unescaped = uri.replace(/~1/g, "/").replace(/~0/g, "~"); + + try { + return decodeURIComponent(unescaped); + } catch { + return unescaped; + } +}; + +class Model extends external_react_immutable_pure_component_namespaceObject["default"] {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "getModelName", + + + + + + + + + + + + + + + + + (ref) => { + if (ref.indexOf("#/definitions/") !== -1) { + return decodeRefName(ref.replace(/^.*#\/definitions\//, "")); + } + if (ref.indexOf("#/components/schemas/") !== -1) { + return decodeRefName(ref.replace(/^.*#\/components\/schemas\//, "")); + } + });(0,defineProperty_namespaceObject["default"])(this, "getRefSchema", + + (model) => { + let { specSelectors } = this.props; + + return specSelectors.findDefinition(model); + });} + + render() { + let { getComponent, getConfigs, specSelectors, schema, required, name, isRef, specPath, displayName, + includeReadOnly, includeWriteOnly } = this.props; + const ObjectModel = getComponent("ObjectModel"); + const ArrayModel = getComponent("ArrayModel"); + const PrimitiveModel = getComponent("PrimitiveModel"); + let type = "object"; + let $$ref = schema && schema.get("$$ref"); + + // If we weren't passed a `name` but have a ref, grab the name from the ref + if (!name && $$ref) { + name = this.getModelName($$ref); + } + // If we weren't passed a `schema` but have a ref, grab the schema from the ref + if (!schema && $$ref) { + schema = this.getRefSchema(name); + } + + if (!schema) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "model model-title" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "model-title__text" }, displayName || name), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("img", { src: rolling_load_namespaceObject, height: "20px", width: "20px" }) + ); + } + + const deprecated = specSelectors.isOAS3() && schema.get("deprecated"); + isRef = isRef !== undefined ? isRef : !!$$ref; + type = schema && schema.get("type") || type; + + switch (type) { + case "object": + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ObjectModel, (0,extends_namespaceObject["default"])({ + className: "object" }, this.props, { + specPath: specPath, + getConfigs: getConfigs, + schema: schema, + name: name, + deprecated: deprecated, + isRef: isRef, + includeReadOnly: includeReadOnly, + includeWriteOnly: includeWriteOnly })); + case "array": + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrayModel, (0,extends_namespaceObject["default"])({ + className: "array" }, this.props, { + getConfigs: getConfigs, + schema: schema, + name: name, + deprecated: deprecated, + required: required, + includeReadOnly: includeReadOnly, + includeWriteOnly: includeWriteOnly })); + case "string": + case "number": + case "integer": + case "boolean": + default: + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(PrimitiveModel, (0,extends_namespaceObject["default"])({}, + this.props, { + getComponent: getComponent, + getConfigs: getConfigs, + schema: schema, + name: name, + deprecated: deprecated, + required: required })); + } + } +}(0,defineProperty_namespaceObject["default"])(Model, "propTypes", { schema: external_react_immutable_proptypes_namespaceObject["default"].map.isRequired, getComponent: external_prop_types_namespaceObject["default"].func.isRequired, getConfigs: external_prop_types_namespaceObject["default"].func.isRequired, specSelectors: external_prop_types_namespaceObject["default"].object.isRequired, name: external_prop_types_namespaceObject["default"].string, displayName: external_prop_types_namespaceObject["default"].string, isRef: external_prop_types_namespaceObject["default"].bool, required: external_prop_types_namespaceObject["default"].bool, expandDepth: external_prop_types_namespaceObject["default"].number, depth: external_prop_types_namespaceObject["default"].number, specPath: external_react_immutable_proptypes_namespaceObject["default"].list.isRequired, includeReadOnly: external_prop_types_namespaceObject["default"].bool, includeWriteOnly: external_prop_types_namespaceObject["default"].bool }); +;// CONCATENATED MODULE: ./src/core/components/models.jsx + + + + +class Models extends external_react_namespaceObject.Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "getSchemaBasePath", + + + + + + + + + + () => { + const isOAS3 = this.props.specSelectors.isOAS3(); + return isOAS3 ? ["components", "schemas"] : ["definitions"]; + });(0,defineProperty_namespaceObject["default"])(this, "getCollapsedContent", + + () => { + return " "; + });(0,defineProperty_namespaceObject["default"])(this, "handleToggle", + + (name, isExpanded) => { + const { layoutActions } = this.props; + layoutActions.show([...this.getSchemaBasePath(), name], isExpanded); + if (isExpanded) { + this.props.specActions.requestResolvedSubtree([...this.getSchemaBasePath(), name]); + } + });(0,defineProperty_namespaceObject["default"])(this, "onLoadModels", + + (ref) => { + if (ref) { + this.props.layoutActions.readyToScroll(this.getSchemaBasePath(), ref); + } + });(0,defineProperty_namespaceObject["default"])(this, "onLoadModel", + + (ref) => { + if (ref) { + const name = ref.getAttribute("data-name"); + this.props.layoutActions.readyToScroll([...this.getSchemaBasePath(), name], ref); + } + });} + + render() { + let { specSelectors, getComponent, layoutSelectors, layoutActions, getConfigs } = this.props; + let definitions = specSelectors.definitions(); + let { docExpansion, defaultModelsExpandDepth } = getConfigs(); + if (!definitions.size || defaultModelsExpandDepth < 0) return null; + + const specPathBase = this.getSchemaBasePath(); + let showModels = layoutSelectors.isShown(specPathBase, defaultModelsExpandDepth > 0 && docExpansion !== "none"); + const isOAS3 = specSelectors.isOAS3(); + + const ModelWrapper = getComponent("ModelWrapper"); + const Collapse = getComponent("Collapse"); + const ModelCollapse = getComponent("ModelCollapse"); + const JumpToPath = getComponent("JumpToPath", true); + const ArrowUpIcon = getComponent("ArrowUpIcon"); + const ArrowDownIcon = getComponent("ArrowDownIcon"); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("section", { className: showModels ? "models is-open" : "models", ref: this.onLoadModels }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { + "aria-expanded": showModels, + className: "models-control", + onClick: () => layoutActions.show(specPathBase, !showModels) }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", null, isOAS3 ? "Schemas" : "Models"), + showModels ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowUpIcon, null) : /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowDownIcon, null) + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Collapse, { isOpened: showModels }, + + definitions.entrySeq().map((_ref) => {let [name] = _ref; + + const fullPath = [...specPathBase, name]; + const specPath = external_immutable_namespaceObject["default"].List(fullPath); + + const schemaValue = specSelectors.specResolvedSubtree(fullPath); + const rawSchemaValue = specSelectors.specJson().getIn(fullPath); + + const schema = external_immutable_namespaceObject.Map.isMap(schemaValue) ? schemaValue : external_immutable_namespaceObject["default"].Map(); + const rawSchema = external_immutable_namespaceObject.Map.isMap(rawSchemaValue) ? rawSchemaValue : external_immutable_namespaceObject["default"].Map(); + + const displayName = schema.get("title") || rawSchema.get("title") || name; + const isShown = layoutSelectors.isShown(fullPath, false); + + if (isShown && schema.size === 0 && rawSchema.size > 0) { + // Firing an action in a container render is not great, + // but it works for now. + this.props.specActions.requestResolvedSubtree(fullPath); + } + + const content = /*#__PURE__*/external_react_namespaceObject["default"].createElement(ModelWrapper, { name: name, + expandDepth: defaultModelsExpandDepth, + schema: schema || external_immutable_namespaceObject["default"].Map(), + displayName: displayName, + fullPath: fullPath, + specPath: specPath, + getComponent: getComponent, + specSelectors: specSelectors, + getConfigs: getConfigs, + layoutSelectors: layoutSelectors, + layoutActions: layoutActions, + includeReadOnly: true, + includeWriteOnly: true }); + + const title = /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "model-box" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "model model-title" }, + displayName + ) + ); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { id: `model-${name}`, className: "model-container", key: `models-section-${name}`, + "data-name": name, ref: this.onLoadModel }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "models-jump-to-path" }, /*#__PURE__*/external_react_namespaceObject["default"].createElement(JumpToPath, { specPath: specPath })), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ModelCollapse, { + classes: "model-box", + collapsedContent: this.getCollapsedContent(name), + onToggle: this.handleToggle, + title: title, + displayName: displayName, + modelName: name, + specPath: specPath, + layoutSelectors: layoutSelectors, + layoutActions: layoutActions, + hideSelfOnExpand: true, + expanded: defaultModelsExpandDepth > 0 && isShown }, + content) + ); + }).toArray() + + ) + ); + } +} +;// CONCATENATED MODULE: ./src/core/components/enum-model.jsx + + + +const EnumModel = (_ref) => {let { value, getComponent } = _ref; + let ModelCollapse = getComponent("ModelCollapse"); + let collapsedContent = /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, "Array [ ", value.count(), " ]"); + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "prop-enum" }, "Enum:", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("br", null), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ModelCollapse, { collapsedContent: collapsedContent }, "[ ", + value.join(", "), " ]" + ) + ); +}; + + + + + +/* harmony default export */ const enum_model = (EnumModel); +;// CONCATENATED MODULE: ./src/core/components/object-model.jsx +const object_model_excluded = ["schema", "name", "displayName", "isRef", "getComponent", "getConfigs", "depth", "onToggle", "expanded", "specPath"]; + + + + + +const braceOpen = "{"; +const braceClose = "}"; +const object_model_propClass = "property"; + +class ObjectModel extends external_react_namespaceObject.Component { + + + + + + + + + + + + + + + + + + render() { + let _this$props = this.props,{ schema, name, displayName, isRef, getComponent, getConfigs, depth, onToggle, expanded, specPath } = _this$props,otherProps = (0,objectWithoutProperties_namespaceObject["default"])(_this$props, object_model_excluded); + let { specSelectors, expandDepth, includeReadOnly, includeWriteOnly } = otherProps; + const { isOAS3 } = specSelectors; + + if (!schema) { + return null; + } + + const { showExtensions } = getConfigs(); + + let description = schema.get("description"); + let properties = schema.get("properties"); + let additionalProperties = schema.get("additionalProperties"); + let title = schema.get("title") || displayName || name; + let requiredProperties = schema.get("required"); + let infoProperties = schema. + filter((v, key) => ["maxProperties", "minProperties", "nullable", "example"].indexOf(key) !== -1); + let deprecated = schema.get("deprecated"); + let externalDocsUrl = schema.getIn(["externalDocs", "url"]); + let externalDocsDescription = schema.getIn(["externalDocs", "description"]); + + const JumpToPath = getComponent("JumpToPath", true); + const Markdown = getComponent("Markdown", true); + const Model = getComponent("Model"); + const ModelCollapse = getComponent("ModelCollapse"); + const Property = getComponent("Property"); + const Link = getComponent("Link"); + + const JumpToPathSection = () => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "model-jump-to-path" }, /*#__PURE__*/external_react_namespaceObject["default"].createElement(JumpToPath, { specPath: specPath })); + }; + const collapsedContent = /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", null, braceOpen), "...", /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, braceClose), + + isRef ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(JumpToPathSection, null) : "" + + ); + + const anyOf = specSelectors.isOAS3() ? schema.get("anyOf") : null; + const oneOf = specSelectors.isOAS3() ? schema.get("oneOf") : null; + const not = specSelectors.isOAS3() ? schema.get("not") : null; + + const titleEl = title && /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "model-title" }, + isRef && schema.get("$$ref") && /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "model-hint" }, schema.get("$$ref")), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "model-title__text" }, title) + ); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "model" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ModelCollapse, { + modelName: name, + title: titleEl, + onToggle: onToggle, + expanded: expanded ? true : depth <= expandDepth, + collapsedContent: collapsedContent }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", { className: "brace-open object" }, braceOpen), + + !isRef ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement(JumpToPathSection, null), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", { className: "inner-object" }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("table", { className: "model" }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("tbody", null, + + !description ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement("tr", { className: "description" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, "description:"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: description }) + ) + ), + + + externalDocsUrl && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", { className: "external-docs" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, "externalDocs:" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: sanitizeUrl(externalDocsUrl) }, externalDocsDescription || externalDocsUrl) + ) + ), + + + !deprecated ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", { className: "property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, "deprecated:" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, "true" + + ) + ), + + + !(properties && properties.size) ? null : properties.entrySeq().filter( + (_ref) => {let [, value] = _ref; + return (!value.get("readOnly") || includeReadOnly) && ( + !value.get("writeOnly") || includeWriteOnly); + } + ).map( + (_ref2) => {let [key, value] = _ref2; + let isDeprecated = isOAS3() && value.get("deprecated"); + let isRequired = external_immutable_namespaceObject.List.isList(requiredProperties) && requiredProperties.contains(key); + + let classNames = ["property-row"]; + + if (isDeprecated) { + classNames.push("deprecated"); + } + + if (isRequired) { + classNames.push("required"); + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("tr", { key: key, className: classNames.join(" ") }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, + key, isRequired && /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "star" }, "*") + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Model, (0,extends_namespaceObject["default"])({ key: `object-${name}-${key}_${value}` }, otherProps, { + required: isRequired, + getComponent: getComponent, + specPath: specPath.push("properties", key), + getConfigs: getConfigs, + schema: value, + depth: depth + 1 })) + ) + ); + }).toArray(), + + + // empty row before extensions... + !showExtensions ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement("tr", null, /*#__PURE__*/external_react_namespaceObject["default"].createElement("td", null, "\xA0")), + + + !showExtensions ? null : + schema.entrySeq().map( + (_ref3) => {let [key, value] = _ref3; + if (key.slice(0, 2) !== "x-") { + return; + } + + const normalizedValue = !value ? null : value.toJS ? value.toJS() : value; + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("tr", { key: key, className: "extension" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, + key + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, + JSON.stringify(normalizedValue) + ) + ); + }).toArray(), + + + !additionalProperties || !additionalProperties.size ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, "< * >:"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Model, (0,extends_namespaceObject["default"])({}, otherProps, { required: false, + getComponent: getComponent, + specPath: specPath.push("additionalProperties"), + getConfigs: getConfigs, + schema: additionalProperties, + depth: depth + 1 })) + ) + ), + + + !anyOf ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, "anyOf ->"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, + anyOf.map((schema, k) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { key: k }, /*#__PURE__*/external_react_namespaceObject["default"].createElement(Model, (0,extends_namespaceObject["default"])({}, otherProps, { required: false, + getComponent: getComponent, + specPath: specPath.push("anyOf", k), + getConfigs: getConfigs, + schema: schema, + depth: depth + 1 }))); + }) + ) + ), + + + !oneOf ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, "oneOf ->"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, + oneOf.map((schema, k) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { key: k }, /*#__PURE__*/external_react_namespaceObject["default"].createElement(Model, (0,extends_namespaceObject["default"])({}, otherProps, { required: false, + getComponent: getComponent, + specPath: specPath.push("oneOf", k), + getConfigs: getConfigs, + schema: schema, + depth: depth + 1 }))); + }) + ) + ), + + + !not ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tr", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, "not ->"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Model, (0,extends_namespaceObject["default"])({}, otherProps, { + required: false, + getComponent: getComponent, + specPath: specPath.push("not"), + getConfigs: getConfigs, + schema: not, + depth: depth + 1 })) + ) + ) + ) + + )) + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "brace-close" }, braceClose) + ), + + infoProperties.size ? infoProperties.entrySeq().map((_ref4) => {let [key, v] = _ref4;return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Property, { key: `${key}-${v}`, propKey: key, propVal: v, propClass: object_model_propClass });}) : null + + ); + } +} +;// CONCATENATED MODULE: ./src/core/components/array-model.jsx + + + + + +const array_model_propClass = "property"; + +class ArrayModel extends external_react_namespaceObject.Component { + + + + + + + + + + + + + + + + render() { + let { getComponent, getConfigs, schema, depth, expandDepth, name, displayName, specPath } = this.props; + let description = schema.get("description"); + let items = schema.get("items"); + let title = schema.get("title") || displayName || name; + let properties = schema.filter((v, key) => ["type", "items", "description", "$$ref", "externalDocs"].indexOf(key) === -1); + let externalDocsUrl = schema.getIn(["externalDocs", "url"]); + let externalDocsDescription = schema.getIn(["externalDocs", "description"]); + + + const Markdown = getComponent("Markdown", true); + const ModelCollapse = getComponent("ModelCollapse"); + const Model = getComponent("Model"); + const Property = getComponent("Property"); + const Link = getComponent("Link"); + + const titleEl = title && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "model-title" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "model-title__text" }, title) + ); + + /* + Note: we set `name={null}` in below because we don't want + the name of the current Model passed (and displayed) as the name of the array element Model + */ + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "model" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ModelCollapse, { title: titleEl, expanded: depth <= expandDepth, collapsedContent: "[...]" }, "[", + + + properties.size ? properties.entrySeq().map((_ref) => {let [key, v] = _ref;return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Property, { key: `${key}-${v}`, propKey: key, propVal: v, propClass: array_model_propClass });}) : null, + + + !description ? properties.size ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "markdown" }) : null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: description }), + + externalDocsUrl && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "external-docs" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: sanitizeUrl(externalDocsUrl) }, externalDocsDescription || externalDocsUrl) + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Model, (0,extends_namespaceObject["default"])({}, + this.props, { + getConfigs: getConfigs, + specPath: specPath.push("items"), + name: null, + schema: items, + required: false, + depth: depth + 1 }) + ) + ), "]" + + ) + ); + } +} +;// CONCATENATED MODULE: ./src/core/components/primitive-model.jsx + + + + +const primitive_model_propClass = "property primitive"; + +class Primitive extends external_react_namespaceObject.Component { + + + + + + + + + + + render() { + let { schema, getComponent, getConfigs, name, displayName, depth, expandDepth } = this.props; + + const { showExtensions } = getConfigs(); + + if (!schema || !schema.get) { + // don't render if schema isn't correctly formed + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null); + } + + let type = schema.get("type"); + let format = schema.get("format"); + let xml = schema.get("xml"); + let enumArray = schema.get("enum"); + let title = schema.get("title") || displayName || name; + let description = schema.get("description"); + let extensions = getExtensions(schema); + let properties = schema. + filter((_, key) => ["enum", "type", "format", "description", "$$ref", "externalDocs"].indexOf(key) === -1). + filterNot((_, key) => extensions.has(key)); + let externalDocsUrl = schema.getIn(["externalDocs", "url"]); + let externalDocsDescription = schema.getIn(["externalDocs", "description"]); + + const Markdown = getComponent("Markdown", true); + const EnumModel = getComponent("EnumModel"); + const Property = getComponent("Property"); + const ModelCollapse = getComponent("ModelCollapse"); + const Link = getComponent("Link"); + + const titleEl = title && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "model-title" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "model-title__text" }, title) + ); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "model" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ModelCollapse, { title: titleEl, expanded: depth <= expandDepth, collapsedContent: "[...]", hideSelfOnExpand: expandDepth !== depth }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "prop" }, + name && depth > 1 && /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "prop-name" }, title), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "prop-type" }, type), + format && /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "prop-format" }, "($", format, ")"), + + properties.size ? properties.entrySeq().map((_ref) => {let [key, v] = _ref;return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Property, { key: `${key}-${v}`, propKey: key, propVal: v, propClass: primitive_model_propClass });}) : null, + + + showExtensions && extensions.size ? extensions.entrySeq().map((_ref2) => {let [key, v] = _ref2;return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Property, { key: `${key}-${v}`, propKey: key, propVal: v, propClass: primitive_model_propClass });}) : null, + + + !description ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: description }), + + + externalDocsUrl && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "external-docs" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: sanitizeUrl(externalDocsUrl) }, externalDocsDescription || externalDocsUrl) + ), + + + xml && xml.size ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, /*#__PURE__*/external_react_namespaceObject["default"].createElement("br", null), /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: primitive_model_propClass }, "xml:"), + + xml.entrySeq().map((_ref3) => {let [key, v] = _ref3;return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { key: `${key}-${v}`, className: primitive_model_propClass }, /*#__PURE__*/external_react_namespaceObject["default"].createElement("br", null), "\xA0\xA0\xA0", key, ": ", String(v));}).toArray() + + ) : null, + + + enumArray && /*#__PURE__*/external_react_namespaceObject["default"].createElement(EnumModel, { value: enumArray, getComponent: getComponent }) + + ) + ) + ); + } +} +;// CONCATENATED MODULE: ./src/core/components/property.jsx + + + +const Property = (_ref) => {let { propKey, propVal, propClass } = _ref; + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { className: propClass }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("br", null), propKey, ": ", String(propVal))); + +}; + + + + + + +/* harmony default export */ const property = (Property); +;// CONCATENATED MODULE: ./src/core/components/try-it-out-button.jsx + + + +class TryItOutButton extends external_react_namespaceObject["default"].Component { + + + + + + + + + + + + + + + + + + + + render() { + const { onTryoutClick, onCancelClick, onResetClick, enabled, hasUserEditedBody, isOAS3 } = this.props; + + const showReset = isOAS3 && hasUserEditedBody; + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: showReset ? "try-out btn-group" : "try-out" }, + + enabled ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("button", { className: "btn try-out__btn cancel", onClick: onCancelClick }, "Cancel") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { className: "btn try-out__btn", onClick: onTryoutClick }, "Try it out "), + + + + showReset && /*#__PURE__*/external_react_namespaceObject["default"].createElement("button", { className: "btn try-out__btn reset", onClick: onResetClick }, "Reset") + + )); + + } +}(0,defineProperty_namespaceObject["default"])(TryItOutButton, "defaultProps", { onTryoutClick: Function.prototype, onCancelClick: Function.prototype, onResetClick: Function.prototype, enabled: false, hasUserEditedBody: false, isOAS3: false }); +;// CONCATENATED MODULE: ./src/core/components/version-pragma-filter.jsx + + + +class VersionPragmaFilter extends external_react_namespaceObject["default"].PureComponent { + + + + + + + + + + + + + + + render() { + const { bypass, isSwagger2, isOAS3, alsoShow } = this.props; + + if (bypass) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, this.props.children); + } + + if (isSwagger2 && isOAS3) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "version-pragma" }, + alsoShow, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "version-pragma__message version-pragma__message--ambiguous" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h3", null, "Unable to render this definition"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, "swagger"), " and ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, "openapi"), " fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields."), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "Supported version fields are ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, "swagger: ", "\"2.0\""), " and those that match ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, "openapi: 3.0.n"), " (for example, ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, "openapi: 3.0.0"), ").") + ) + ) + ); + } + + if (!isSwagger2 && !isOAS3) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "version-pragma" }, + alsoShow, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "version-pragma__message version-pragma__message--missing" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h3", null, "Unable to render this definition"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "The provided definition does not specify a valid version field."), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "Please indicate a valid Swagger or OpenAPI version field. Supported version fields are ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, "swagger: ", "\"2.0\""), " and those that match ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, "openapi: 3.0.n"), " (for example, ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, "openapi: 3.0.0"), ").") + ) + ) + ); + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, this.props.children); + } +}(0,defineProperty_namespaceObject["default"])(VersionPragmaFilter, "defaultProps", { alsoShow: null, children: null, bypass: false }); +;// CONCATENATED MODULE: ./src/core/components/version-stamp.jsx + + + +const VersionStamp = (_ref) => {let { version } = _ref; + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("small", null, /*#__PURE__*/external_react_namespaceObject["default"].createElement("pre", { className: "version" }, " ", version, " ")); +}; + + + + + +/* harmony default export */ const version_stamp = (VersionStamp); +;// CONCATENATED MODULE: ./src/core/components/openapi-version.jsx + + + + +const OpenAPIVersion = (_ref) => {let { oasVersion } = _ref;return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("small", { className: "version-stamp" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("pre", { className: "version" }, "OAS ", oasVersion) + ));}; + + + + + + +/* harmony default export */ const openapi_version = (OpenAPIVersion); +;// CONCATENATED MODULE: ./src/core/components/deep-link.jsx + + + +const DeepLink = (_ref) => {let { enabled, path, text } = _ref; + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("a", { className: "nostyle", + onClick: enabled ? (e) => e.preventDefault() : null, + href: enabled ? `#/${path}` : null }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", null, text) + )); + +}; + + + + + + + +/* harmony default export */ const deep_link = (DeepLink); +;// CONCATENATED MODULE: ./src/core/components/svg-assets.jsx + +const SvgAssets = () => /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("svg", { xmlns: "http://www.w3.org/2000/svg", xmlnsXlink: "http://www.w3.org/1999/xlink", className: "svg-assets" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("defs", null, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("symbol", { viewBox: "0 0 20 20", id: "unlocked" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("path", { d: "M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V6h2v-.801C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8z" }) +), /*#__PURE__*/ + +external_react_namespaceObject["default"].createElement("symbol", { viewBox: "0 0 20 20", id: "locked" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("path", { d: "M15.8 8H14V5.6C14 2.703 12.665 1 10 1 7.334 1 6 2.703 6 5.6V8H4c-.553 0-1 .646-1 1.199V17c0 .549.428 1.139.951 1.307l1.197.387C5.672 18.861 6.55 19 7.1 19h5.8c.549 0 1.428-.139 1.951-.307l1.196-.387c.524-.167.953-.757.953-1.306V9.199C17 8.646 16.352 8 15.8 8zM12 8H8V5.199C8 3.754 8.797 3 10 3c1.203 0 2 .754 2 2.199V8z" }) +), /*#__PURE__*/ + +external_react_namespaceObject["default"].createElement("symbol", { viewBox: "0 0 20 20", id: "close" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("path", { d: "M14.348 14.849c-.469.469-1.229.469-1.697 0L10 11.819l-2.651 3.029c-.469.469-1.229.469-1.697 0-.469-.469-.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-.469-.469-.469-1.228 0-1.697.469-.469 1.228-.469 1.697 0L10 8.183l2.651-3.031c.469-.469 1.228-.469 1.697 0 .469.469.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c.469.469.469 1.229 0 1.698z" }) +), /*#__PURE__*/ + +external_react_namespaceObject["default"].createElement("symbol", { viewBox: "0 0 20 20", id: "large-arrow" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("path", { d: "M13.25 10L6.109 2.58c-.268-.27-.268-.707 0-.979.268-.27.701-.27.969 0l7.83 7.908c.268.271.268.709 0 .979l-7.83 7.908c-.268.271-.701.27-.969 0-.268-.269-.268-.707 0-.979L13.25 10z" }) +), /*#__PURE__*/ + +external_react_namespaceObject["default"].createElement("symbol", { viewBox: "0 0 20 20", id: "large-arrow-down" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("path", { d: "M17.418 6.109c.272-.268.709-.268.979 0s.271.701 0 .969l-7.908 7.83c-.27.268-.707.268-.979 0l-7.908-7.83c-.27-.268-.27-.701 0-.969.271-.268.709-.268.979 0L10 13.25l7.418-7.141z" }) +), /*#__PURE__*/ + +external_react_namespaceObject["default"].createElement("symbol", { viewBox: "0 0 20 20", id: "large-arrow-up" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("path", { d: "M 17.418 14.908 C 17.69 15.176 18.127 15.176 18.397 14.908 C 18.667 14.64 18.668 14.207 18.397 13.939 L 10.489 6.109 C 10.219 5.841 9.782 5.841 9.51 6.109 L 1.602 13.939 C 1.332 14.207 1.332 14.64 1.602 14.908 C 1.873 15.176 2.311 15.176 2.581 14.908 L 10 7.767 L 17.418 14.908 Z" }) +), /*#__PURE__*/ + +external_react_namespaceObject["default"].createElement("symbol", { viewBox: "0 0 24 24", id: "jump-to" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("path", { d: "M19 7v4H5.83l3.58-3.59L8 6l-6 6 6 6 1.41-1.41L5.83 13H21V7z" }) +), /*#__PURE__*/ + +external_react_namespaceObject["default"].createElement("symbol", { viewBox: "0 0 24 24", id: "expand" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("path", { d: "M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z" }) +), /*#__PURE__*/ + +external_react_namespaceObject["default"].createElement("symbol", { viewBox: "0 0 15 16", id: "copy" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("g", { transform: "translate(2, -1)" }, /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("path", { fill: "#ffffff", fillRule: "evenodd", d: "M2 13h4v1H2v-1zm5-6H2v1h5V7zm2 3V8l-3 3 3 3v-2h5v-2H9zM4.5 9H2v1h2.5V9zM2 12h2.5v-1H2v1zm9 1h1v2c-.02.28-.11.52-.3.7-.19.18-.42.28-.7.3H1c-.55 0-1-.45-1-1V4c0-.55.45-1 1-1h3c0-1.11.89-2 2-2 1.11 0 2 .89 2 2h3c.55 0 1 .45 1 1v5h-1V6H1v9h10v-2zM2 5h8c0-.55-.45-1-1-1H8c-.55 0-1-.45-1-1s-.45-1-1-1-1 .45-1 1-.45 1-1 1H3c-.55 0-1 .45-1 1z" }) +) +) + +) +) +); + +/* harmony default export */ const svg_assets = (SvgAssets); +;// CONCATENATED MODULE: external "remarkable" +var external_remarkable_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_remarkable_y = x => () => x +const external_remarkable_namespaceObject = external_remarkable_x({ ["Remarkable"]: () => __WEBPACK_EXTERNAL_MODULE_remarkable__.Remarkable }); +;// CONCATENATED MODULE: external "remarkable/linkify" +var linkify_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var linkify_y = x => () => x +const linkify_namespaceObject = linkify_x({ ["linkify"]: () => __WEBPACK_EXTERNAL_MODULE_remarkable_linkify_34829ba6__.linkify }); +;// CONCATENATED MODULE: external "dompurify" +var external_dompurify_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_dompurify_y = x => () => x +const external_dompurify_namespaceObject = external_dompurify_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_dompurify__["default"] }); +;// CONCATENATED MODULE: ./src/core/components/providers/markdown.jsx + + + + + + + +if (external_dompurify_namespaceObject["default"].addHook) { + external_dompurify_namespaceObject["default"].addHook("beforeSanitizeElements", function (current) { + // Attach safe `rel` values to all elements that contain an `href`, + // i.e. all anchors that are links. + // We _could_ just look for elements that have a non-self target, + // but applying it more broadly shouldn't hurt anything, and is safer. + if (current.href) { + current.setAttribute("rel", "noopener noreferrer"); + } + return current; + }); +} + +function Markdown(_ref) {let { source, className = "", getConfigs } = _ref; + if (typeof source !== "string") { + return null; + } + + const md = new external_remarkable_namespaceObject.Remarkable({ + html: true, + typographer: true, + breaks: true, + linkTarget: "_blank" + }).use(linkify_namespaceObject.linkify); + + md.core.ruler.disable(["replacements", "smartquotes"]); + + const { useUnsafeMarkdown } = getConfigs(); + const html = md.render(source); + const sanitized = sanitizer(html, { useUnsafeMarkdown }); + + if (!source || !html || !sanitized) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: (0,external_classnames_namespaceObject["default"])(className, "markdown"), dangerouslySetInnerHTML: { __html: sanitized } })); + +} + + + + + + + +Markdown.defaultProps = { + getConfigs: () => ({ useUnsafeMarkdown: false }) +}; + +/* harmony default export */ const markdown = (Markdown); + +function sanitizer(str) {let { useUnsafeMarkdown = false } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const ALLOW_DATA_ATTR = useUnsafeMarkdown; + const FORBID_ATTR = useUnsafeMarkdown ? [] : ["style", "class"]; + + if (useUnsafeMarkdown && !sanitizer.hasWarnedAboutDeprecation) { + console.warn(`useUnsafeMarkdown display configuration parameter is deprecated since >3.26.0 and will be removed in v4.0.0.`); + sanitizer.hasWarnedAboutDeprecation = true; + } + + return external_dompurify_namespaceObject["default"].sanitize(str, { + ADD_ATTR: ["target"], + FORBID_TAGS: ["style", "form"], + ALLOW_DATA_ATTR, + FORBID_ATTR + }); +} +sanitizer.hasWarnedAboutDeprecation = false; +;// CONCATENATED MODULE: ./src/core/components/layouts/base.jsx +/** + * @prettier + */ + + + +class BaseLayout extends external_react_namespaceObject["default"].Component { + + + + + + + + + + render() { + const { errSelectors, specSelectors, getComponent } = this.props; + + const SvgAssets = getComponent("SvgAssets"); + const InfoContainer = getComponent("InfoContainer", true); + const VersionPragmaFilter = getComponent("VersionPragmaFilter"); + const Operations = getComponent("operations", true); + const Models = getComponent("Models", true); + const Webhooks = getComponent("Webhooks", true); + const Row = getComponent("Row"); + const Col = getComponent("Col"); + const Errors = getComponent("errors", true); + + const ServersContainer = getComponent("ServersContainer", true); + const SchemesContainer = getComponent("SchemesContainer", true); + const AuthorizeBtnContainer = getComponent("AuthorizeBtnContainer", true); + const FilterContainer = getComponent("FilterContainer", true); + const isSwagger2 = specSelectors.isSwagger2(); + const isOAS3 = specSelectors.isOAS3(); + const isOAS31 = specSelectors.isOAS31(); + + const isSpecEmpty = !specSelectors.specStr(); + + const loadingStatus = specSelectors.loadingStatus(); + + let loadingMessage = null; + + if (loadingStatus === "loading") { + loadingMessage = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "info" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "loading-container" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "loading" }) + ) + ); + + } + + if (loadingStatus === "failed") { + loadingMessage = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "info" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "loading-container" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "title" }, "Failed to load API definition."), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Errors, null) + ) + ); + + } + + if (loadingStatus === "failedConfig") { + const lastErr = errSelectors.lastError(); + const lastErrMsg = lastErr ? lastErr.get("message") : ""; + loadingMessage = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "info failed-config" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "loading-container" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "title" }, "Failed to load remote configuration."), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, lastErrMsg) + ) + ); + + } + + if (!loadingMessage && isSpecEmpty) { + loadingMessage = /*#__PURE__*/external_react_namespaceObject["default"].createElement("h4", null, "No API definition provided."); + } + + if (loadingMessage) { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "swagger-ui" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "loading-container" }, loadingMessage) + )); + + } + + const servers = specSelectors.servers(); + const schemes = specSelectors.schemes(); + + const hasServers = servers && servers.size; + const hasSchemes = schemes && schemes.size; + const hasSecurityDefinitions = !!specSelectors.securityDefinitions(); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "swagger-ui" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(SvgAssets, null), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(VersionPragmaFilter, { + isSwagger2: isSwagger2, + isOAS3: isOAS3, + alsoShow: /*#__PURE__*/external_react_namespaceObject["default"].createElement(Errors, null) }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(Errors, null), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, { className: "information-container" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { mobile: 12 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(InfoContainer, null) + ) + ), + + hasServers || hasSchemes || hasSecurityDefinitions ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "scheme-container" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { className: "schemes wrapper", mobile: 12 }, + hasServers ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(ServersContainer, null) : null, + hasSchemes ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(SchemesContainer, null) : null, + hasSecurityDefinitions ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(AuthorizeBtnContainer, null) : null + ) + ) : + null, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(FilterContainer, null), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { mobile: 12, desktop: 12 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Operations, null) + ) + ), + + isOAS31 && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, { className: "webhooks-container" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { mobile: 12, desktop: 12 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Webhooks, null) + ) + ), /*#__PURE__*/ + + + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, { mobile: 12, desktop: 12 }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Models, null) + ) + ) + ) + )); + + } +} +;// CONCATENATED MODULE: ./src/core/presets/base/plugins/core-components/index.js +/** + * @prettier + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const CoreComponentsPlugin = () => ({ + components: { + App: App, + authorizationPopup: AuthorizationPopup, + authorizeBtn: AuthorizeBtn, + AuthorizeBtnContainer: AuthorizeBtnContainer, + authorizeOperationBtn: AuthorizeOperationBtn, + auths: Auths, + AuthItem: auth_item_Auths, + authError: AuthError, + oauth2: Oauth2, + apiKeyAuth: ApiKeyAuth, + basicAuth: BasicAuth, + clear: Clear, + liveResponse: LiveResponse, + InitializedInput: InitializedInput, + info: components_info, + InfoContainer: InfoContainer, + InfoUrl: InfoUrl, + InfoBasePath: InfoBasePath, + Contact: contact, + License: license, + JumpToPath: JumpToPath, + CopyToClipboardBtn: CopyToClipboardBtn, + onlineValidatorBadge: OnlineValidatorBadge, + operations: Operations, + operation: Operation, + OperationSummary: OperationSummary, + OperationSummaryMethod: OperationSummaryMethod, + OperationSummaryPath: OperationSummaryPath, + highlightCode: highlight_code, + responses: Responses, + response: Response, + ResponseExtension: response_extension, + responseBody: ResponseBody, + parameters: Parameters, + parameterRow: ParameterRow, + execute: Execute, + headers: headers_Headers, + errors: Errors, + contentType: ContentType, + overview: Overview, + footer: Footer, + FilterContainer: FilterContainer, + ParamBody: ParamBody, + curl: Curl, + schemes: Schemes, + SchemesContainer: SchemesContainer, + modelExample: ModelExample, + ModelWrapper: ModelWrapper, + ModelCollapse: ModelCollapse, + Model: Model, + Models: Models, + EnumModel: enum_model, + ObjectModel: ObjectModel, + ArrayModel: ArrayModel, + PrimitiveModel: Primitive, + Property: property, + TryItOutButton: TryItOutButton, + Markdown: markdown, + BaseLayout: BaseLayout, + VersionPragmaFilter: VersionPragmaFilter, + VersionStamp: version_stamp, + OperationExt: operation_extensions, + OperationExtRow: operation_extension_row, + ParameterExt: parameter_extension, + ParameterIncludeEmpty: ParameterIncludeEmpty, + OperationTag: OperationTag, + OperationContainer: OperationContainer, + OpenAPIVersion: openapi_version, + DeepLink: deep_link, + SvgAssets: svg_assets, + Example: Example, + ExamplesSelect: ExamplesSelect, + ExamplesSelectValueRetainer: ExamplesSelectValueRetainer + } +}); + +/* harmony default export */ const core_components = (CoreComponentsPlugin); +;// CONCATENATED MODULE: ./src/core/presets/base/plugins/form-components/index.js + /** + * @prettier + */ + + +const FormComponentsPlugin = () => ({ + components: (0,objectSpread2_namespaceObject["default"])({}, layout_utils_namespaceObject) +}); + +/* harmony default export */ const form_components = (FormComponentsPlugin); +;// CONCATENATED MODULE: external "react-debounce-input" +var external_react_debounce_input_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var external_react_debounce_input_y = x => () => x +const external_react_debounce_input_namespaceObject = external_react_debounce_input_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_react_debounce_input_7ed3e068__["default"] }); +;// CONCATENATED MODULE: ./src/core/components/json-schema-components.jsx + + + + + + + + +const json_schema_components_noop = () => {}; + + + + + + + + + + + + + + +const JsonSchemaDefaultProps = { + value: "", + onChange: json_schema_components_noop, + schema: {}, + keyName: "", + required: false, + errors: (0,external_immutable_namespaceObject.List)() +}; + +class JsonSchemaForm extends external_react_namespaceObject.Component { + + + + + componentDidMount() { + const { dispatchInitialValue, value, onChange } = this.props; + if (dispatchInitialValue) { + onChange(value); + } else if (dispatchInitialValue === false) { + onChange(""); + } + } + + render() { + let { schema, errors, value, onChange, getComponent, fn, disabled } = this.props; + const format = schema && schema.get ? schema.get("format") : null; + const type = schema && schema.get ? schema.get("type") : null; + + let getComponentSilently = (name) => getComponent(name, false, { failSilently: true }); + let Comp = type ? format ? + getComponentSilently(`JsonSchema_${type}_${format}`) : + getComponentSilently(`JsonSchema_${type}`) : + getComponent("JsonSchema_string"); + if (!Comp) { + Comp = getComponent("JsonSchema_string"); + } + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Comp, (0,extends_namespaceObject["default"])({}, this.props, { errors: errors, fn: fn, getComponent: getComponent, value: value, onChange: onChange, schema: schema, disabled: disabled })); + } +}(0,defineProperty_namespaceObject["default"])(JsonSchemaForm, "defaultProps", JsonSchemaDefaultProps); + +class JsonSchema_string extends external_react_namespaceObject.Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + (e) => { + const value = this.props.schema && this.props.schema.get("type") === "file" ? e.target.files[0] : e.target.value; + this.props.onChange(value, this.props.keyName); + });(0,defineProperty_namespaceObject["default"])(this, "onEnumChange", + (val) => this.props.onChange(val));} + render() { + let { getComponent, value, schema, errors, required, description, disabled } = this.props; + const enumValue = schema && schema.get ? schema.get("enum") : null; + const format = schema && schema.get ? schema.get("format") : null; + const type = schema && schema.get ? schema.get("type") : null; + const schemaIn = schema && schema.get ? schema.get("in") : null; + if (!value) { + value = ""; // value should not be null; this fixes a Debounce error + } + errors = errors.toJS ? errors.toJS() : []; + + if (enumValue) { + const Select = getComponent("Select"); + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Select, { className: errors.length ? "invalid" : "", + title: errors.length ? errors : "", + allowedValues: [...enumValue], + value: value, + allowEmptyValue: !required, + disabled: disabled, + onChange: this.onEnumChange }); + } + + const isDisabled = disabled || schemaIn && schemaIn === "formData" && !("FormData" in window); + const Input = getComponent("Input"); + if (type && type === "file") { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(Input, { type: "file", + className: errors.length ? "invalid" : "", + title: errors.length ? errors : "", + onChange: this.onChange, + disabled: isDisabled })); + + } else + { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(external_react_debounce_input_namespaceObject["default"], { + type: format && format === "password" ? "password" : "text", + className: errors.length ? "invalid" : "", + title: errors.length ? errors : "", + value: value, + minLength: 0, + debounceTimeout: 350, + placeholder: description, + onChange: this.onChange, + disabled: isDisabled })); + + } + } +}(0,defineProperty_namespaceObject["default"])(JsonSchema_string, "defaultProps", JsonSchemaDefaultProps); + +class JsonSchema_array extends external_react_namespaceObject.PureComponent { + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + + + + + + + + + + + () => { + this.props.onChange(this.state.value); + });(0,defineProperty_namespaceObject["default"])(this, "onItemChange", + + (itemVal, i) => { + this.setState((_ref) => {let { value } = _ref;return { + value: value.set(i, itemVal) + };}, this.onChange); + });(0,defineProperty_namespaceObject["default"])(this, "removeItem", + + (i) => { + this.setState((_ref2) => {let { value } = _ref2;return { + value: value.delete(i) + };}, this.onChange); + });(0,defineProperty_namespaceObject["default"])(this, "addItem", + + () => { + const { fn } = this.props; + let newValue = valueOrEmptyList(this.state.value); + this.setState(() => ({ + value: newValue.push(fn.getSampleSchema(this.state.schema.get("items"), false, { + includeWriteOnly: true + })) + }), this.onChange); + });(0,defineProperty_namespaceObject["default"])(this, "onEnumChange", + + (value) => { + this.setState(() => ({ + value: value + }), this.onChange); + });this.state = { value: valueOrEmptyList(props.value), schema: props.schema };}UNSAFE_componentWillReceiveProps(props) {const value = valueOrEmptyList(props.value);if (value !== this.state.value) this.setState({ value });if (props.schema !== this.state.schema) this.setState({ schema: props.schema });} + + render() { + let { getComponent, required, schema, errors, fn, disabled } = this.props; + + errors = errors.toJS ? errors.toJS() : Array.isArray(errors) ? errors : []; + const arrayErrors = errors.filter((e) => typeof e === "string"); + const needsRemoveError = errors.filter((e) => e.needRemove !== undefined). + map((e) => e.error); + const value = this.state.value; // expect Im List + const shouldRenderValue = + value && value.count && value.count() > 0 ? true : false; + const schemaItemsEnum = schema.getIn(["items", "enum"]); + const schemaItemsType = schema.getIn(["items", "type"]); + const schemaItemsFormat = schema.getIn(["items", "format"]); + const schemaItemsSchema = schema.get("items"); + let ArrayItemsComponent; + let isArrayItemText = false; + let isArrayItemFile = schemaItemsType === "file" || schemaItemsType === "string" && schemaItemsFormat === "binary" ? true : false; + if (schemaItemsType && schemaItemsFormat) { + ArrayItemsComponent = getComponent(`JsonSchema_${schemaItemsType}_${schemaItemsFormat}`); + } else if (schemaItemsType === "boolean" || schemaItemsType === "array" || schemaItemsType === "object") { + ArrayItemsComponent = getComponent(`JsonSchema_${schemaItemsType}`); + } + // if ArrayItemsComponent not assigned or does not exist, + // use default schemaItemsType === "string" & JsonSchemaArrayItemText component + if (!ArrayItemsComponent && !isArrayItemFile) { + isArrayItemText = true; + } + + if (schemaItemsEnum) { + const Select = getComponent("Select"); + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Select, { className: errors.length ? "invalid" : "", + title: errors.length ? errors : "", + multiple: true, + value: value, + disabled: disabled, + allowedValues: schemaItemsEnum, + allowEmptyValue: !required, + onChange: this.onEnumChange }); + } + + const Button = getComponent("Button"); + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-array" }, + shouldRenderValue ? + value.map((item, i) => { + const itemErrors = (0,external_immutable_namespaceObject.fromJS)([ + ...errors.filter((err) => err.index === i). + map((e) => e.error)] + ); + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { key: i, className: "json-schema-form-item" }, + + isArrayItemFile ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JsonSchemaArrayItemFile, { + value: item, + onChange: (val) => this.onItemChange(val, i), + disabled: disabled, + errors: itemErrors, + getComponent: getComponent } + ) : + isArrayItemText ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JsonSchemaArrayItemText, { + value: item, + onChange: (val) => this.onItemChange(val, i), + disabled: disabled, + errors: itemErrors } + ) : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ArrayItemsComponent, (0,extends_namespaceObject["default"])({}, this.props, { + value: item, + onChange: (val) => this.onItemChange(val, i), + disabled: disabled, + errors: itemErrors, + schema: schemaItemsSchema, + getComponent: getComponent, + fn: fn }) + ), + + !disabled ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Button, { + className: `btn btn-sm json-schema-form-item-remove ${needsRemoveError.length ? "invalid" : null}`, + title: needsRemoveError.length ? needsRemoveError : "", + + onClick: () => this.removeItem(i) }, + " - ") : + null + )); + + }) : + null, + + !disabled ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Button, { + className: `btn btn-sm json-schema-form-item-add ${arrayErrors.length ? "invalid" : null}`, + title: arrayErrors.length ? arrayErrors : "", + onClick: this.addItem }, + "Add ", + schemaItemsType ? `${schemaItemsType} ` : "", "item" + ) : + null + )); + + } +}(0,defineProperty_namespaceObject["default"])(JsonSchema_array, "defaultProps", JsonSchemaDefaultProps); + +class JsonSchemaArrayItemText extends external_react_namespaceObject.Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + + (e) => { + const value = e.target.value; + this.props.onChange(value, this.props.keyName); + });} + + render() { + let { value, errors, description, disabled } = this.props; + if (!value) { + value = ""; // value should not be null + } + errors = errors.toJS ? errors.toJS() : []; + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(external_react_debounce_input_namespaceObject["default"], { + type: "text", + className: errors.length ? "invalid" : "", + title: errors.length ? errors : "", + value: value, + minLength: 0, + debounceTimeout: 350, + placeholder: description, + onChange: this.onChange, + disabled: disabled }); + } +}(0,defineProperty_namespaceObject["default"])(JsonSchemaArrayItemText, "defaultProps", JsonSchemaDefaultProps); + +class JsonSchemaArrayItemFile extends external_react_namespaceObject.Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onFileChange", + + + + (e) => { + const value = e.target.files[0]; + this.props.onChange(value, this.props.keyName); + });} + + render() { + let { getComponent, errors, disabled } = this.props; + const Input = getComponent("Input"); + const isDisabled = disabled || !("FormData" in window); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Input, { type: "file", + className: errors.length ? "invalid" : "", + title: errors.length ? errors : "", + onChange: this.onFileChange, + disabled: isDisabled }); + } +}(0,defineProperty_namespaceObject["default"])(JsonSchemaArrayItemFile, "defaultProps", JsonSchemaDefaultProps); + +class JsonSchema_boolean extends external_react_namespaceObject.Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onEnumChange", + + + + (val) => this.props.onChange(val));} + render() { + let { getComponent, value, errors, schema, required, disabled } = this.props; + errors = errors.toJS ? errors.toJS() : []; + let enumValue = schema && schema.get ? schema.get("enum") : null; + let allowEmptyValue = !enumValue || !required; + let booleanValue = !enumValue && ["true", "false"]; + const Select = getComponent("Select"); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Select, { className: errors.length ? "invalid" : "", + title: errors.length ? errors : "", + value: String(value), + disabled: disabled, + allowedValues: enumValue ? [...enumValue] : booleanValue, + allowEmptyValue: allowEmptyValue, + onChange: this.onEnumChange }); + } +}(0,defineProperty_namespaceObject["default"])(JsonSchema_boolean, "defaultProps", JsonSchemaDefaultProps); + +const stringifyObjectErrors = (errors) => { + return errors.map((err) => { + const meta = err.propKey !== undefined ? err.propKey : err.index; + let stringError = typeof err === "string" ? err : typeof err.error === "string" ? err.error : null; + + if (!meta && stringError) { + return stringError; + } + let currentError = err.error; + let path = `/${err.propKey}`; + while (typeof currentError === "object") { + const part = currentError.propKey !== undefined ? currentError.propKey : currentError.index; + if (part === undefined) { + break; + } + path += `/${part}`; + if (!currentError.error) { + break; + } + currentError = currentError.error; + } + return `${path}: ${currentError}`; + }); +}; + +class JsonSchema_object extends external_react_namespaceObject.PureComponent { + constructor() { + super();(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + + + + (value) => { + this.props.onChange(value); + });(0,defineProperty_namespaceObject["default"])(this, "handleOnChange", + + (e) => { + const inputValue = e.target.value; + + this.onChange(inputValue); + });} + + render() { + let { + getComponent, + value, + errors, + disabled + } = this.props; + + const TextArea = getComponent("TextArea"); + errors = errors.toJS ? errors.toJS() : Array.isArray(errors) ? errors : []; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(TextArea, { + className: (0,external_classnames_namespaceObject["default"])({ invalid: errors.length }), + title: errors.length ? stringifyObjectErrors(errors).join(", ") : "", + value: stringify(value), + disabled: disabled, + onChange: this.handleOnChange }) + )); + + } +}(0,defineProperty_namespaceObject["default"])(JsonSchema_object, "defaultProps", JsonSchemaDefaultProps); + +function valueOrEmptyList(value) { + return external_immutable_namespaceObject.List.isList(value) ? value : Array.isArray(value) ? (0,external_immutable_namespaceObject.fromJS)(value) : (0,external_immutable_namespaceObject.List)(); +} +;// CONCATENATED MODULE: ./src/core/presets/base/plugins/json-schema-components/index.js + /** + * @prettier + */ + + +const JSONSchemaComponentsPlugin = () => ({ + components: (0,objectSpread2_namespaceObject["default"])({}, json_schema_components_namespaceObject) +}); + +/* harmony default export */ const json_schema_components = (JSONSchemaComponentsPlugin); +;// CONCATENATED MODULE: ./src/core/presets/base/index.js +/** + * @prettier + */ + + + + + + + + + + + + + + + + + +// ad-hoc plugins + + + + +const BasePreset = () => [ +configsPlugin, +util, +logs, +view, +plugins_spec, +err, +icons, +plugins_layout, +samples, +core_components, +form_components, +swagger_client, +json_schema_components, +auth, +downloadUrlPlugin, +deep_linking, +filter, +on_complete, +plugins_request_snippets, +safe_render()]; + + +/* harmony default export */ const base = (BasePreset); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/spec-extensions/wrap-selectors.js +/** + * @prettier + */ + + + + +/** + * Helpers + */ + +const map = (0,external_immutable_namespaceObject.Map)(); + +function onlyOAS3(selector) { + return (ori, system) => + function () { + if (system.getSystem().specSelectors.isOAS3()) { + const result = selector(...arguments); + return typeof result === "function" ? result(system) : result; + } else { + return ori(...arguments); + } + }; +} + +const nullSelector = (0,external_reselect_namespaceObject.createSelector)(() => null); + +const OAS3NullSelector = onlyOAS3(nullSelector); + +/** + * Wrappers + */ + +const wrap_selectors_definitions = onlyOAS3(() => (system) => { + const spec = system.getSystem().specSelectors.specJson(); + const schemas = spec.getIn(["components", "schemas"]); + return external_immutable_namespaceObject.Map.isMap(schemas) ? schemas : map; +}); + +const wrap_selectors_hasHost = onlyOAS3(() => (system) => { + const spec = system.getSystem().specSelectors.specJson(); + return spec.hasIn(["servers", 0]); +}); + +const wrap_selectors_securityDefinitions = onlyOAS3( + (0,external_reselect_namespaceObject.createSelector)( + specJsonWithResolvedSubtrees, + (spec) => spec.getIn(["components", "securitySchemes"]) || null + ) +); + +const wrap_selectors_validOperationMethods = +(oriSelector, system) => +function (state) { + if (system.specSelectors.isOAS3()) { + return system.oas3Selectors.validOperationMethods(); + }for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {args[_key - 1] = arguments[_key];} + + return oriSelector(...args); +}; + +const wrap_selectors_host = OAS3NullSelector; +const wrap_selectors_basePath = OAS3NullSelector; +const wrap_selectors_consumes = OAS3NullSelector; +const wrap_selectors_produces = OAS3NullSelector; +const wrap_selectors_schemes = OAS3NullSelector; +;// CONCATENATED MODULE: ./src/core/plugins/oas3/auth-extensions/wrap-selectors.js + + + + +// Helpers + +const wrap_selectors_state = (state) => state; + +function wrap_selectors_onlyOAS3(selector) { + return (ori, system) => function () {for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {args[_key] = arguments[_key];} + if (system.getSystem().specSelectors.isOAS3()) { + // Pass the spec plugin state to Reselect to trigger on securityDefinitions update + let resolvedSchemes = system.getState().getIn(["spec", "resolvedSubtrees", + "components", "securitySchemes"]); + return selector(system, resolvedSchemes, ...args); + } else { + return ori(...args); + } + }; +} + +const wrap_selectors_definitionsToAuthorize = wrap_selectors_onlyOAS3((0,external_reselect_namespaceObject.createSelector)( + wrap_selectors_state, + (_ref) => {let { specSelectors } = _ref;return specSelectors.securityDefinitions();}, + (system, definitions) => { + // Coerce our OpenAPI 3.0 definitions into monoflow definitions + // that look like Swagger2 definitions. + let list = (0,external_immutable_namespaceObject.List)(); + + if (!definitions) { + return list; + } + + definitions.entrySeq().forEach((_ref2) => {let [defName, definition] = _ref2; + const type = definition.get("type"); + + if (type === "oauth2") { + definition.get("flows").entrySeq().forEach((_ref3) => {let [flowKey, flowVal] = _ref3; + let translatedDef = (0,external_immutable_namespaceObject.fromJS)({ + flow: flowKey, + authorizationUrl: flowVal.get("authorizationUrl"), + tokenUrl: flowVal.get("tokenUrl"), + scopes: flowVal.get("scopes"), + type: definition.get("type"), + description: definition.get("description") + }); + + list = list.push(new external_immutable_namespaceObject.Map({ + [defName]: translatedDef.filter((v) => { + // filter out unset values, sometimes `authorizationUrl` + // and `tokenUrl` come out as `undefined` in the data + return v !== undefined; + }) + })); + }); + } + if (type === "http" || type === "apiKey") { + list = list.push(new external_immutable_namespaceObject.Map({ + [defName]: definition + })); + } + if (type === "openIdConnect" && definition.get("openIdConnectData")) { + let oidcData = definition.get("openIdConnectData"); + let grants = oidcData.get("grant_types_supported") || ["authorization_code", "implicit"]; + grants.forEach((grant) => { + // Convert from OIDC list of scopes to the OAS-style map with empty descriptions + let translatedScopes = oidcData.get("scopes_supported") && + oidcData.get("scopes_supported").reduce((acc, cur) => acc.set(cur, ""), new external_immutable_namespaceObject.Map()); + + let translatedDef = (0,external_immutable_namespaceObject.fromJS)({ + flow: grant, + authorizationUrl: oidcData.get("authorization_endpoint"), + tokenUrl: oidcData.get("token_endpoint"), + scopes: translatedScopes, + type: "oauth2", + openIdConnectUrl: definition.get("openIdConnectUrl") + }); + + list = list.push(new external_immutable_namespaceObject.Map({ + [defName]: translatedDef.filter((v) => { + // filter out unset values, sometimes `authorizationUrl` + // and `tokenUrl` come out as `undefined` in the data + return v !== undefined; + }) + })); + }); + } + }); + + return list; + } +)); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/helpers.jsx + /** + * @prettier + */ + + +function isOAS30(jsSpec) { + const oasVersion = jsSpec.get("openapi"); + + return ( + typeof oasVersion === "string" && + /^3\.0\.([0123])(?:-rc[012])?$/.test(oasVersion)); + +} + +function isSwagger2(jsSpec) { + const swaggerVersion = jsSpec.get("swagger"); + + return typeof swaggerVersion === "string" && swaggerVersion === "2.0"; +} + +function OAS3ComponentWrapFactory(Component) { + return (Ori, system) => (props) => {var _system$specSelectors; + if (typeof ((_system$specSelectors = system.specSelectors) === null || _system$specSelectors === void 0 ? void 0 : _system$specSelectors.isOAS3) === "function") { + if (system.specSelectors.isOAS3()) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Component, (0,extends_namespaceObject["default"])({}, props, system, { Ori: Ori })); + } else { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Ori, props); + } + } else { + console.warn("OAS3 wrapper: couldn't get spec"); + return null; + } + }; +} + +function OAS30ComponentWrapFactory(Component) { + return (Ori, system) => (props) => {var _system$specSelectors2; + if (typeof ((_system$specSelectors2 = system.specSelectors) === null || _system$specSelectors2 === void 0 ? void 0 : _system$specSelectors2.isOAS30) === "function") { + if (system.specSelectors.isOAS30()) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Component, (0,extends_namespaceObject["default"])({}, props, system, { Ori: Ori })); + } else { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Ori, props); + } + } else { + console.warn("OAS30 wrapper: couldn't get spec"); + return null; + } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/oas3/spec-extensions/selectors.js +/** + * @prettier + */ + + + + + +/** + * Helpers + */ + +const selectors_map = (0,external_immutable_namespaceObject.Map)(); + +const selectors_isSwagger2 = () => (system) => { + const spec = system.getSystem().specSelectors.specJson(); + return isSwagger2(spec); +}; + +const selectors_isOAS30 = () => (system) => { + const spec = system.getSystem().specSelectors.specJson(); + return isOAS30(spec); +}; + +const selectors_isOAS3 = () => (system) => { + return system.getSystem().specSelectors.isOAS30(); +}; + +function selectors_onlyOAS3(selector) { + return function (state) {for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {args[_key - 1] = arguments[_key];}return ( + (system) => { + if (system.specSelectors.isOAS3()) { + const selectedValue = selector(state, ...args); + return typeof selectedValue === "function" ? + selectedValue(system) : + selectedValue; + } else { + return null; + } + });}; +} + +const servers = selectors_onlyOAS3(() => (system) => { + const spec = system.specSelectors.specJson(); + return spec.get("servers", selectors_map); +}); + +const callbacksOperations = selectors_onlyOAS3( + (state, _ref) => {let { callbacks, specPath } = _ref;return ( + (system) => { + const validOperationMethods = system.specSelectors.validOperationMethods(); + + if (!external_immutable_namespaceObject.Map.isMap(callbacks)) return {}; + + return callbacks. + reduce((allOperations, callback, callbackName) => { + if (!external_immutable_namespaceObject.Map.isMap(callback)) return allOperations; + + return callback.reduce((callbackOperations, pathItem, expression) => { + if (!external_immutable_namespaceObject.Map.isMap(pathItem)) return callbackOperations; + + const pathItemOperations = pathItem. + entrySeq(). + filter((_ref2) => {let [key] = _ref2;return validOperationMethods.includes(key);}). + map((_ref3) => {let [method, operation] = _ref3;return { + operation: (0,external_immutable_namespaceObject.Map)({ operation }), + method, + path: expression, + callbackName, + specPath: specPath.concat([callbackName, expression, method]) + };}); + + return callbackOperations.concat(pathItemOperations); + }, (0,external_immutable_namespaceObject.List)()); + }, (0,external_immutable_namespaceObject.List)()). + groupBy((operationDTO) => operationDTO.callbackName). + map((operations) => operations.toArray()). + toObject(); + });} +); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/components/callbacks.jsx +/** + * @prettier + */ + + + + +const Callbacks = (_ref) => {let { callbacks, specPath, specSelectors, getComponent } = _ref; + const operationDTOs = specSelectors.callbacksOperations({ + callbacks, + specPath + }); + const callbackNames = Object.keys(operationDTOs); + + const OperationContainer = getComponent("OperationContainer", true); + + if (callbackNames.length === 0) return /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, "No callbacks"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, + callbackNames.map((callbackName) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { key: `${callbackName}` }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h2", null, callbackName), + + operationDTOs[callbackName].map((operationDTO) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(OperationContainer, { + key: `${callbackName}-${operationDTO.path}-${operationDTO.method}`, + op: operationDTO.operation, + tag: "callbacks", + method: operationDTO.method, + path: operationDTO.path, + specPath: operationDTO.specPath, + allowTryItOut: false } + ) + ) + ) + ) + )); + +}; + + + + + + + + + + +/* harmony default export */ const callbacks = (Callbacks); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/components/request-body.jsx + + + + + + + +const getDefaultRequestBodyValue = (requestBody, mediaType, activeExamplesKey, fn) => {var _requestBody$getIn; + const mediaTypeValue = (_requestBody$getIn = requestBody.getIn(["content", mediaType])) !== null && _requestBody$getIn !== void 0 ? _requestBody$getIn : (0,external_immutable_namespaceObject.OrderedMap)(); + const schema = mediaTypeValue.get("schema", (0,external_immutable_namespaceObject.OrderedMap)()).toJS(); + + const hasExamplesKey = mediaTypeValue.get("examples") !== undefined; + const exampleSchema = mediaTypeValue.get("example"); + const mediaTypeExample = hasExamplesKey ? + mediaTypeValue.getIn([ + "examples", + activeExamplesKey, + "value"] + ) : + exampleSchema; + + const exampleValue = fn.getSampleSchema( + schema, + mediaType, + { + includeWriteOnly: true + }, + mediaTypeExample + ); + return stringify(exampleValue); +}; + + + +const RequestBody = (_ref) => + + + + + + + + + + + + + + + + + +{var _requestBody$get, _requestBody$get2, _requestBodyContent$g;let { userHasEditedBody, requestBody, requestBodyValue, requestBodyInclusionSetting, requestBodyErrors, getComponent, getConfigs, specSelectors, fn, contentType, isExecute, specPath, onChange, onChangeIncludeEmpty, activeExamplesKey, updateActiveExamplesKey, setRetainRequestBodyValueFlag } = _ref; + const handleFile = (e) => { + onChange(e.target.files[0]); + }; + const setIsIncludedOptions = (key) => { + let options = { + key, + shouldDispatchInit: false, + defaultValue: true + }; + let currentInclusion = requestBodyInclusionSetting.get(key, "no value"); + if (currentInclusion === "no value") { + options.shouldDispatchInit = true; + // future: can get/set defaultValue from a config setting + } + return options; + }; + + const Markdown = getComponent("Markdown", true); + const ModelExample = getComponent("modelExample"); + const RequestBodyEditor = getComponent("RequestBodyEditor"); + const HighlightCode = getComponent("highlightCode"); + const ExamplesSelectValueRetainer = getComponent("ExamplesSelectValueRetainer"); + const Example = getComponent("Example"); + const ParameterIncludeEmpty = getComponent("ParameterIncludeEmpty"); + + const { showCommonExtensions } = getConfigs(); + + const requestBodyDescription = (_requestBody$get = requestBody === null || requestBody === void 0 ? void 0 : requestBody.get("description")) !== null && _requestBody$get !== void 0 ? _requestBody$get : null; + const requestBodyContent = (_requestBody$get2 = requestBody === null || requestBody === void 0 ? void 0 : requestBody.get("content")) !== null && _requestBody$get2 !== void 0 ? _requestBody$get2 : new external_immutable_namespaceObject.OrderedMap(); + contentType = contentType || requestBodyContent.keySeq().first() || ""; + + const mediaTypeValue = (_requestBodyContent$g = requestBodyContent.get(contentType)) !== null && _requestBodyContent$g !== void 0 ? _requestBodyContent$g : (0,external_immutable_namespaceObject.OrderedMap)(); + const schemaForMediaType = mediaTypeValue.get("schema", (0,external_immutable_namespaceObject.OrderedMap)()); + const rawExamplesOfMediaType = mediaTypeValue.get("examples", null); + const sampleForMediaType = rawExamplesOfMediaType === null || rawExamplesOfMediaType === void 0 ? void 0 : rawExamplesOfMediaType.map((container, key) => {var _container; + const val = (_container = container) === null || _container === void 0 ? void 0 : _container.get("value", null); + if (val) { + container = container.set("value", getDefaultRequestBodyValue( + requestBody, + contentType, + key, + fn + ), val); + } + return container; + }); + + const handleExamplesSelect = (key /*, { isSyntheticChange } */) => { + updateActiveExamplesKey(key); + }; + requestBodyErrors = external_immutable_namespaceObject.List.isList(requestBodyErrors) ? requestBodyErrors : (0,external_immutable_namespaceObject.List)(); + + if (!mediaTypeValue.size) { + return null; + } + + const isObjectContent = mediaTypeValue.getIn(["schema", "type"]) === "object"; + const isBinaryFormat = mediaTypeValue.getIn(["schema", "format"]) === "binary"; + const isBase64Format = mediaTypeValue.getIn(["schema", "format"]) === "base64"; + + if ( + contentType === "application/octet-stream" || + contentType.indexOf("image/") === 0 || + contentType.indexOf("audio/") === 0 || + contentType.indexOf("video/") === 0 || + isBinaryFormat || + isBase64Format) + { + const Input = getComponent("Input"); + + if (!isExecute) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("i", null, "Example values are not available for ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, contentType), " media types." + ); + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Input, { type: "file", onChange: handleFile }); + } + + if ( + isObjectContent && ( + + contentType === "application/x-www-form-urlencoded" || + contentType.indexOf("multipart/") === 0) && + + schemaForMediaType.get("properties", (0,external_immutable_namespaceObject.OrderedMap)()).size > 0) + { + const JsonSchemaForm = getComponent("JsonSchemaForm"); + const ParameterExt = getComponent("ParameterExt"); + const bodyProperties = schemaForMediaType.get("properties", (0,external_immutable_namespaceObject.OrderedMap)()); + requestBodyValue = external_immutable_namespaceObject.Map.isMap(requestBodyValue) ? requestBodyValue : (0,external_immutable_namespaceObject.OrderedMap)(); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "table-container" }, + requestBodyDescription && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: requestBodyDescription }), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("table", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tbody", null, + + external_immutable_namespaceObject.Map.isMap(bodyProperties) && bodyProperties.entrySeq().map((_ref2) => {let [key, prop] = _ref2; + if (prop.get("readOnly")) return; + + let commonExt = showCommonExtensions ? getCommonExtensions(prop) : null; + const required = schemaForMediaType.get("required", (0,external_immutable_namespaceObject.List)()).includes(key); + const type = prop.get("type"); + const format = prop.get("format"); + const description = prop.get("description"); + const currentValue = requestBodyValue.getIn([key, "value"]); + const currentErrors = requestBodyValue.getIn([key, "errors"]) || requestBodyErrors; + const included = requestBodyInclusionSetting.get(key) || false; + + const useInitialValFromSchemaSamples = prop.has("default") || + prop.has("example") || + prop.hasIn(["items", "example"]) || + prop.hasIn(["items", "default"]); + const useInitialValFromEnum = prop.has("enum") && (prop.get("enum").size === 1 || required); + const useInitialValue = useInitialValFromSchemaSamples || useInitialValFromEnum; + + let initialValue = ""; + if (type === "array" && !useInitialValue) { + initialValue = []; + } + if (type === "object" || useInitialValue) { + // TODO: what about example or examples from requestBody could be passed as exampleOverride + initialValue = fn.getSampleSchema(prop, false, { + includeWriteOnly: true + }); + } + + if (typeof initialValue !== "string" && type === "object") { + initialValue = stringify(initialValue); + } + if (typeof initialValue === "string" && type === "array") { + initialValue = JSON.parse(initialValue); + } + + const isFile = type === "string" && (format === "binary" || format === "base64"); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("tr", { key: key, className: "parameters", "data-property-name": key }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "parameters-col_name" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: required ? "parameter__name required" : "parameter__name" }, + key, + !required ? null : /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", null, "\xA0*") + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "parameter__type" }, + type, + format && /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "prop-format" }, "($", format, ")"), + !showCommonExtensions || !commonExt.size ? null : commonExt.entrySeq().map((_ref3) => {let [key, v] = _ref3;return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ParameterExt, { key: `${key}-${v}`, xKey: key, xVal: v });}) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "parameter__deprecated" }, + prop.get("deprecated") ? "deprecated" : null + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", { className: "parameters-col_description" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: description }), + isExecute ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JsonSchemaForm, { + fn: fn, + dispatchInitialValue: !isFile, + schema: prop, + description: key, + getComponent: getComponent, + value: currentValue === undefined ? initialValue : currentValue, + required: required, + errors: currentErrors, + onChange: (value) => { + onChange(value, [key]); + } } + ), + required ? null : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ParameterIncludeEmpty, { + onChange: (value) => onChangeIncludeEmpty(key, value), + isIncluded: included, + isIncludedOptions: setIsIncludedOptions(key), + isDisabled: Array.isArray(currentValue) ? currentValue.length !== 0 : !isEmptyValue(currentValue) } + ) + + ) : null + ) + ); + }) + + ) + ) + ); + } + + const sampleRequestBody = getDefaultRequestBodyValue( + requestBody, + contentType, + activeExamplesKey, + fn + ); + let language = null; + let testValueForJson = getKnownSyntaxHighlighterLanguage(sampleRequestBody); + if (testValueForJson) { + language = "json"; + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, + requestBodyDescription && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: requestBodyDescription }), + + + sampleForMediaType ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExamplesSelectValueRetainer, { + userHasEditedBody: userHasEditedBody, + examples: sampleForMediaType, + currentKey: activeExamplesKey, + currentUserInputValue: requestBodyValue, + onSelect: handleExamplesSelect, + updateValue: onChange, + defaultToFirstExample: true, + getComponent: getComponent, + setRetainRequestBodyValueFlag: setRetainRequestBodyValueFlag } + ) : + null, + + + isExecute ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(RequestBodyEditor, { + value: requestBodyValue, + errors: requestBodyErrors, + defaultValue: sampleRequestBody, + onChange: onChange, + getComponent: getComponent } + ) + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(ModelExample, { + getComponent: getComponent, + getConfigs: getConfigs, + specSelectors: specSelectors, + expandDepth: 1, + isExecute: isExecute, + schema: mediaTypeValue.get("schema"), + specPath: specPath.push("content", contentType), + example: /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(HighlightCode, { + className: "body-param__example", + getConfigs: getConfigs, + language: language, + value: stringify(requestBodyValue) || sampleRequestBody } + ), + + includeWriteOnly: true } + ), + + + + sampleForMediaType ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Example, { + example: sampleForMediaType.get(activeExamplesKey), + getComponent: getComponent, + getConfigs: getConfigs } + ) : + null + + ); +}; + + + + + + + + + + + + + + + + + + + + + + +/* harmony default export */ const request_body = (RequestBody); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/components/operation-link.jsx + + + + +class operation_link_OperationLink extends external_react_namespaceObject.Component { + render() { + const { link, name, getComponent } = this.props; + + const Markdown = getComponent("Markdown", true); + + let targetOp = link.get("operationId") || link.get("operationRef"); + let parameters = link.get("parameters") && link.get("parameters").toJS(); + let description = link.get("description"); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "operation-link" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "description" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("b", null, /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, name)), + description ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(Markdown, { source: description }) : null + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("pre", null, "Operation `", + targetOp, "`", /*#__PURE__*/external_react_namespaceObject["default"].createElement("br", null), /*#__PURE__*/external_react_namespaceObject["default"].createElement("br", null), "Parameters ", + padString(0, JSON.stringify(parameters, null, 2)) || "{}", /*#__PURE__*/external_react_namespaceObject["default"].createElement("br", null) + ) + ); + } + +} + +function padString(n, string) { + if (typeof string !== "string") {return "";} + return string. + split("\n"). + map((line, i) => i > 0 ? Array(n + 1).join(" ") + line : line). + join("\n"); +} + + + + + + + +/* harmony default export */ const operation_link = (operation_link_OperationLink); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/components/servers.jsx + + + + + +class Servers extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "onServerChange", + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + (e) => { + this.setServer(e.target.value); + + // set default variable values + });(0,defineProperty_namespaceObject["default"])(this, "onServerVariableValueChange", + + (e) => { + let { + setServerVariableValue, + currentServer + } = this.props; + + let variableName = e.target.getAttribute("data-variable"); + let newVariableValue = e.target.value; + + if (typeof setServerVariableValue === "function") { + setServerVariableValue({ + server: currentServer, + key: variableName, + val: newVariableValue + }); + } + });(0,defineProperty_namespaceObject["default"])(this, "setServer", + + (value) => { + let { setSelectedServer } = this.props; + + setSelectedServer(value); + });}componentDidMount() {var _servers$first;let { servers, currentServer } = this.props;if (currentServer) {return;} // fire 'change' event to set default 'value' of select + this.setServer((_servers$first = servers.first()) === null || _servers$first === void 0 ? void 0 : _servers$first.get("url"));}UNSAFE_componentWillReceiveProps(nextProps) {let { servers, setServerVariableValue, getServerVariable } = nextProps;if (this.props.currentServer !== nextProps.currentServer || this.props.servers !== nextProps.servers) {// Server has changed, we may need to set default values + let currentServerDefinition = servers.find((v) => v.get("url") === nextProps.currentServer);let prevServerDefinition = this.props.servers.find((v) => v.get("url") === this.props.currentServer) || (0,external_immutable_namespaceObject.OrderedMap)();if (!currentServerDefinition) {return this.setServer(servers.first().get("url"));}let prevServerVariableDefs = prevServerDefinition.get("variables") || (0,external_immutable_namespaceObject.OrderedMap)();let prevServerVariableDefaultKey = prevServerVariableDefs.find((v) => v.get("default")) || (0,external_immutable_namespaceObject.OrderedMap)();let prevServerVariableDefaultValue = prevServerVariableDefaultKey.get("default");let currentServerVariableDefs = currentServerDefinition.get("variables") || (0,external_immutable_namespaceObject.OrderedMap)();let currentServerVariableDefaultKey = currentServerVariableDefs.find((v) => v.get("default")) || (0,external_immutable_namespaceObject.OrderedMap)();let currentServerVariableDefaultValue = currentServerVariableDefaultKey.get("default");currentServerVariableDefs.map((val, key) => {let currentValue = getServerVariable(nextProps.currentServer, key); // note: it is possible for both key/val to be the same across definitions, + // but we will try to detect a change in default values between definitions + // only set the default value if the user hasn't set one yet + // or if the definition appears to have changed + if (!currentValue || prevServerVariableDefaultValue !== currentServerVariableDefaultValue) {setServerVariableValue({ server: nextProps.currentServer, key, val: val.get("default") || "" });}});}}render() {let { servers, currentServer, getServerVariable, getEffectiveServerValue + } = this.props; + + + let currentServerDefinition = servers.find((s) => s.get("url") === currentServer) || (0,external_immutable_namespaceObject.OrderedMap)(); + + let currentServerVariableDefs = currentServerDefinition.get("variables") || (0,external_immutable_namespaceObject.OrderedMap)(); + + let shouldShowVariableUI = currentServerVariableDefs.size !== 0; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "servers" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", { htmlFor: "servers" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("select", { onChange: this.onServerChange, value: currentServer }, + servers.valueSeq().map( + (server) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("option", { + value: server.get("url"), + key: server.get("url") }, + server.get("url"), + server.get("description") && ` - ${server.get("description")}` + ) + ).toArray() + ) + ), + shouldShowVariableUI ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "computed-url" }, "Computed URL:", /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("code", null, + getEffectiveServerValue(currentServer) + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, "Server variables"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("table", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("tbody", null, + + currentServerVariableDefs.entrySeq().map((_ref) => {let [name, val] = _ref; + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("tr", { key: name }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, name), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("td", null, + val.get("enum") ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("select", { "data-variable": name, onChange: this.onServerVariableValueChange }, + val.get("enum").map((enumValue) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("option", { + selected: enumValue === getServerVariable(currentServer, name), + key: enumValue, + value: enumValue }, + enumValue + ); + }) + ) : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("input", { + type: "text", + value: getServerVariable(currentServer, name) || "", + onChange: this.onServerVariableValueChange, + "data-variable": name } + ) + + ) + ); + }) + + ) + ) + ) : null + + )); + + } +} +;// CONCATENATED MODULE: ./src/core/plugins/oas3/components/servers-container.jsx + + + +class ServersContainer extends external_react_namespaceObject["default"].Component { + + + + + + + + + render() { + const { specSelectors, oas3Selectors, oas3Actions, getComponent } = this.props; + + const servers = specSelectors.servers(); + + const Servers = getComponent("Servers"); + + return servers && servers.size ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "servers-title" }, "Servers"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Servers, { + servers: servers, + currentServer: oas3Selectors.selectedServer(), + setSelectedServer: oas3Actions.setSelectedServer, + setServerVariableValue: oas3Actions.setServerVariableValue, + getServerVariable: oas3Selectors.serverVariableValue, + getEffectiveServerValue: oas3Selectors.serverEffectiveValue } + ) + ) : null; + } +} +;// CONCATENATED MODULE: ./src/core/plugins/oas3/components/request-body-editor.jsx + + + + + +const request_body_editor_NOOP = Function.prototype; + +class RequestBodyEditor extends external_react_namespaceObject.PureComponent { + + + + + + + + + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "applyDefaultValue", + + + + + + + + + + + + (nextProps) => { + const { onChange, defaultValue } = nextProps ? nextProps : this.props; + + this.setState({ + value: defaultValue + }); + + return onChange(defaultValue); + });(0,defineProperty_namespaceObject["default"])(this, "onChange", + + (value) => { + this.props.onChange(stringify(value)); + });(0,defineProperty_namespaceObject["default"])(this, "onDomChange", + + (e) => { + const inputValue = e.target.value; + + this.setState({ + value: inputValue + }, () => this.onChange(inputValue)); + });this.state = { value: stringify(props.value) || props.defaultValue }; // this is the glue that makes sure our initial value gets set as the + // current request body value + // TODO: achieve this in a selector instead + props.onChange(props.value);}UNSAFE_componentWillReceiveProps(nextProps) {if ( + this.props.value !== nextProps.value && + nextProps.value !== this.state.value) + { + + this.setState({ + value: stringify(nextProps.value) + }); + } + + + + if (!nextProps.value && nextProps.defaultValue && !!this.state.value) { + // if new value is falsy, we have a default, AND the falsy value didn't + // come from us originally + this.applyDefaultValue(nextProps); + } + } + + render() { + let { + getComponent, + errors + } = this.props; + + let { + value + } = this.state; + + let isInvalid = errors.size > 0 ? true : false; + const TextArea = getComponent("TextArea"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "body-param" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(TextArea, { + className: (0,external_classnames_namespaceObject["default"])("body-param__text", { invalid: isInvalid }), + title: errors.size ? errors.join(", ") : "", + value: value, + onChange: this.onDomChange } + ) + )); + + + } +}(0,defineProperty_namespaceObject["default"])(RequestBodyEditor, "defaultProps", { onChange: request_body_editor_NOOP, userHasEditedBody: false }); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/components/http-auth.jsx + + + +class HttpAuth extends external_react_namespaceObject["default"].Component { + + + + + + + + + + constructor(props, context) { + super(props, context);(0,defineProperty_namespaceObject["default"])(this, "onChange", + + + + + + + + + + + + + + + + + (e) => { + let { onChange } = this.props; + let { value, name } = e.target; + + let newValue = Object.assign({}, this.state.value); + + if (name) { + newValue[name] = value; + } else { + newValue = value; + } + + this.setState({ value: newValue }, () => onChange(this.state)); + + });let { name: _name, schema } = this.props;let _value = this.getValue();this.state = { name: _name, schema: schema, value: _value };}getValue() {let { name, authorized } = this.props;return authorized && authorized.getIn([name, "value"]);} + + render() { + let { schema, getComponent, errSelectors, name } = this.props; + const Input = getComponent("Input"); + const Row = getComponent("Row"); + const Col = getComponent("Col"); + const AuthError = getComponent("authError"); + const Markdown = getComponent("Markdown", true); + const JumpToPath = getComponent("JumpToPath", true); + + const scheme = (schema.get("scheme") || "").toLowerCase(); + let value = this.getValue(); + let errors = errSelectors.allErrors().filter((err) => err.get("authId") === name); + + if (scheme === "basic") { + let username = value ? value.get("username") : null; + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, name || schema.get("name")), "\xA0 (http, Basic)", /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(JumpToPath, { path: ["securityDefinitions", name] }) + ), + username && /*#__PURE__*/external_react_namespaceObject["default"].createElement("h6", null, "Authorized"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: schema.get("description") }) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", null, "Username:"), + + username ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ", username, " ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, null, /*#__PURE__*/external_react_namespaceObject["default"].createElement(Input, { type: "text", required: "required", name: "username", "aria-label": "auth-basic-username", onChange: this.onChange, autoFocus: true })) + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", null, "Password:"), + + username ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ****** ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, null, /*#__PURE__*/external_react_namespaceObject["default"].createElement(Input, { autoComplete: "new-password", + name: "password", + type: "password", + "aria-label": "auth-basic-password", + onChange: this.onChange })) + + ), + + errors.valueSeq().map((error, key) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(AuthError, { error: error, + key: key }); + }) + + ); + } + + if (scheme === "bearer") { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, name || schema.get("name")), "\xA0 (http, Bearer)", /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(JumpToPath, { path: ["securityDefinitions", name] }) + ), + value && /*#__PURE__*/external_react_namespaceObject["default"].createElement("h6", null, "Authorized"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: schema.get("description") }) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Row, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("label", null, "Value:"), + + value ? /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, " ****** ") : /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Col, null, /*#__PURE__*/external_react_namespaceObject["default"].createElement(Input, { type: "text", "aria-label": "auth-bearer-value", onChange: this.onChange, autoFocus: true })) + + ), + + errors.valueSeq().map((error, key) => { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(AuthError, { error: error, + key: key }); + }) + + )); + + } + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("em", null, /*#__PURE__*/external_react_namespaceObject["default"].createElement("b", null, name), " HTTP authentication: unsupported scheme ", `'${scheme}'`) + ); + } +} +;// CONCATENATED MODULE: ./src/core/plugins/oas3/components/operation-servers.jsx + + + + +class OperationServers extends external_react_namespaceObject["default"].Component {constructor() {super(...arguments);(0,defineProperty_namespaceObject["default"])(this, "setSelectedServer", + + + + + + + + + + + + + + + + + (server) => { + const { path, method } = this.props; + // FIXME: we should be keeping up with this in props/state upstream of us + // instead of cheating™ with `forceUpdate` + this.forceUpdate(); + return this.props.setSelectedServer(server, `${path}:${method}`); + });(0,defineProperty_namespaceObject["default"])(this, "setServerVariableValue", + + (obj) => { + const { path, method } = this.props; + // FIXME: we should be keeping up with this in props/state upstream of us + // instead of cheating™ with `forceUpdate` + this.forceUpdate(); + return this.props.setServerVariableValue((0,objectSpread2_namespaceObject["default"])((0,objectSpread2_namespaceObject["default"])({}, + obj), {}, { + namespace: `${path}:${method}` }) + ); + });(0,defineProperty_namespaceObject["default"])(this, "getSelectedServer", + + () => { + const { path, method } = this.props; + return this.props.getSelectedServer(`${path}:${method}`); + });(0,defineProperty_namespaceObject["default"])(this, "getServerVariable", + + (server, key) => { + const { path, method } = this.props; + return this.props.getServerVariable({ + namespace: `${path}:${method}`, + server + }, key); + });(0,defineProperty_namespaceObject["default"])(this, "getEffectiveServerValue", + + (server) => { + const { path, method } = this.props; + return this.props.getEffectiveServerValue({ + server, + namespace: `${path}:${method}` + }); + });} + + render() { + const { + // for self + operationServers, + pathServers, + + // util + getComponent + } = this.props; + + if (!operationServers && !pathServers) { + return null; + } + + const Servers = getComponent("Servers"); + + const serversToDisplay = operationServers || pathServers; + const displaying = operationServers ? "operation" : "path"; + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: "opblock-section operation-servers" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-section-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "tab-header" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "opblock-title" }, "Servers") + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "opblock-description-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "message" }, "These ", + displaying, "-level options override the global server options." + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Servers, { + servers: serversToDisplay, + currentServer: this.getSelectedServer(), + setSelectedServer: this.setSelectedServer, + setServerVariableValue: this.setServerVariableValue, + getServerVariable: this.getServerVariable, + getEffectiveServerValue: this.getEffectiveServerValue } + ) + ) + ); + } +} +;// CONCATENATED MODULE: ./src/core/plugins/oas3/components/index.js + + + + + + + + + +/* harmony default export */ const components = ({ + Callbacks: callbacks, + HttpAuth: HttpAuth, + RequestBody: request_body, + Servers: Servers, + ServersContainer: ServersContainer, + RequestBodyEditor: RequestBodyEditor, + OperationServers: OperationServers, + operationLink: operation_link +}); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/wrap-components/markdown.jsx + + + + + + + +const parser = new external_remarkable_namespaceObject.Remarkable("commonmark"); +parser.block.ruler.enable(["table"]); +parser.set({ linkTarget: "_blank" }); + +const markdown_Markdown = (_ref) => {let { source, className = "", getConfigs } = _ref; + if (typeof source !== "string") { + return null; + } + + if (source) { + const { useUnsafeMarkdown } = getConfigs(); + const html = parser.render(source); + const sanitized = sanitizer(html, { useUnsafeMarkdown }); + + let trimmed; + + if (typeof sanitized === "string") { + trimmed = sanitized.trim(); + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { + dangerouslySetInnerHTML: { + __html: trimmed + }, + className: (0,external_classnames_namespaceObject["default"])(className, "renderedMarkdown") } + )); + + } + return null; +}; + + + + + + +markdown_Markdown.defaultProps = { + getConfigs: () => ({ useUnsafeMarkdown: false }) +}; + +/* harmony default export */ const wrap_components_markdown = (OAS3ComponentWrapFactory(markdown_Markdown)); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/wrap-components/auth-item.jsx +const auth_item_excluded = ["Ori"]; + + +/* harmony default export */ const auth_item = (OAS3ComponentWrapFactory((_ref) => {let { Ori } = _ref,props = (0,objectWithoutProperties_namespaceObject["default"])(_ref, auth_item_excluded); + const { + schema, getComponent, errSelectors, authorized, onAuthChange, name + } = props; + + const HttpAuth = getComponent("HttpAuth"); + const type = schema.get("type"); + + if (type === "http") { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(HttpAuth, { key: name, + schema: schema, + name: name, + errSelectors: errSelectors, + authorized: authorized, + getComponent: getComponent, + onChange: onAuthChange }); + } else { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Ori, props); + } +})); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/wrap-components/online-validator-badge.js + + + +// OAS3 spec is now supported by the online validator. +/* harmony default export */ const online_validator_badge = (OAS3ComponentWrapFactory(OnlineValidatorBadge)); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/wrap-components/model.jsx + + + + + +class ModelComponent extends external_react_namespaceObject.Component { + + + + + + + + + + + + render() { + let { getConfigs, schema } = this.props; + let classes = ["model-box"]; + let isDeprecated = schema.get("deprecated") === true; + let message = null; + + if (isDeprecated) { + classes.push("deprecated"); + message = /*#__PURE__*/external_react_namespaceObject["default"].createElement("span", { className: "model-deprecated-warning" }, "Deprecated:"); + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", { className: classes.join(" ") }, + message, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Model, (0,extends_namespaceObject["default"])({}, this.props, { + getConfigs: getConfigs, + depth: 1, + expandDepth: this.props.expandDepth || 0 }) + ) + ); + } +} + +/* harmony default export */ const model = (OAS3ComponentWrapFactory(ModelComponent)); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/wrap-components/json-schema-string.jsx +const json_schema_string_excluded = ["Ori"]; + + +/* harmony default export */ const json_schema_string = (OAS3ComponentWrapFactory((_ref) => {let { Ori } = _ref,props = (0,objectWithoutProperties_namespaceObject["default"])(_ref, json_schema_string_excluded); + const { + schema, + getComponent, + errors, + onChange + } = props; + + const format = schema && schema.get ? schema.get("format") : null; + const type = schema && schema.get ? schema.get("type") : null; + const Input = getComponent("Input"); + + if (type && type === "string" && format && (format === "binary" || format === "base64")) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Input, { type: "file", + className: errors.length ? "invalid" : "", + title: errors.length ? errors : "", + onChange: (e) => { + onChange(e.target.files[0]); + }, + disabled: Ori.isDisabled }); + } else { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Ori, props); + } +})); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/wrap-components/openapi-version.jsx + + + +/* harmony default export */ const wrap_components_openapi_version = (OAS30ComponentWrapFactory((props) => { + const { Ori } = props; + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Ori, { oasVersion: "3.0" }); +})); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/wrap-components/index.js + + + + + + + +/* harmony default export */ const wrap_components = ({ + Markdown: wrap_components_markdown, + AuthItem: auth_item, + OpenAPIVersion: wrap_components_openapi_version, + JsonSchema_string: json_schema_string, + model: model, + onlineValidatorBadge: online_validator_badge +}); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/actions.js +// Actions conform to FSA (flux-standard-actions) +// {type: string,payload: Any|Error, meta: obj, error: bool} + +const UPDATE_SELECTED_SERVER = "oas3_set_servers"; +const UPDATE_REQUEST_BODY_VALUE = "oas3_set_request_body_value"; +const UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG = "oas3_set_request_body_retain_flag"; +const UPDATE_REQUEST_BODY_INCLUSION = "oas3_set_request_body_inclusion"; +const UPDATE_ACTIVE_EXAMPLES_MEMBER = "oas3_set_active_examples_member"; +const UPDATE_REQUEST_CONTENT_TYPE = "oas3_set_request_content_type"; +const UPDATE_RESPONSE_CONTENT_TYPE = "oas3_set_response_content_type"; +const UPDATE_SERVER_VARIABLE_VALUE = "oas3_set_server_variable_value"; +const SET_REQUEST_BODY_VALIDATE_ERROR = "oas3_set_request_body_validate_error"; +const CLEAR_REQUEST_BODY_VALIDATE_ERROR = "oas3_clear_request_body_validate_error"; +const CLEAR_REQUEST_BODY_VALUE = "oas3_clear_request_body_value"; + +function setSelectedServer(selectedServerUrl, namespace) { + return { + type: UPDATE_SELECTED_SERVER, + payload: { selectedServerUrl, namespace } + }; +} + +function setRequestBodyValue(_ref) {let { value, pathMethod } = _ref; + return { + type: UPDATE_REQUEST_BODY_VALUE, + payload: { value, pathMethod } + }; +} + +const setRetainRequestBodyValueFlag = (_ref2) => {let { value, pathMethod } = _ref2; + return { + type: UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG, + payload: { value, pathMethod } + }; +}; + + +function setRequestBodyInclusion(_ref3) {let { value, pathMethod, name } = _ref3; + return { + type: UPDATE_REQUEST_BODY_INCLUSION, + payload: { value, pathMethod, name } + }; +} + +function setActiveExamplesMember(_ref4) {let { name, pathMethod, contextType, contextName } = _ref4; + return { + type: UPDATE_ACTIVE_EXAMPLES_MEMBER, + payload: { name, pathMethod, contextType, contextName } + }; +} + +function setRequestContentType(_ref5) {let { value, pathMethod } = _ref5; + return { + type: UPDATE_REQUEST_CONTENT_TYPE, + payload: { value, pathMethod } + }; +} + +function setResponseContentType(_ref6) {let { value, path, method } = _ref6; + return { + type: UPDATE_RESPONSE_CONTENT_TYPE, + payload: { value, path, method } + }; +} + +function setServerVariableValue(_ref7) {let { server, namespace, key, val } = _ref7; + return { + type: UPDATE_SERVER_VARIABLE_VALUE, + payload: { server, namespace, key, val } + }; +} + +const setRequestBodyValidateError = (_ref8) => {let { path, method, validationErrors } = _ref8; + return { + type: SET_REQUEST_BODY_VALIDATE_ERROR, + payload: { path, method, validationErrors } + }; +}; + +const clearRequestBodyValidateError = (_ref9) => {let { path, method } = _ref9; + return { + type: CLEAR_REQUEST_BODY_VALIDATE_ERROR, + payload: { path, method } + }; +}; + +const initRequestBodyValidateError = (_ref10) => {let { pathMethod } = _ref10; + return { + type: CLEAR_REQUEST_BODY_VALIDATE_ERROR, + payload: { path: pathMethod[0], method: pathMethod[1] } + }; +}; + +const clearRequestBodyValue = (_ref11) => {let { pathMethod } = _ref11; + return { + type: CLEAR_REQUEST_BODY_VALUE, + payload: { pathMethod } + }; +}; +;// CONCATENATED MODULE: ./src/core/plugins/oas3/selectors.js +/** + * @prettier + */ + + + + + + +// Helpers + +const oas3_selectors_onlyOAS3 = +(selector) => +function (state) {for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {args[_key - 1] = arguments[_key];}return ( + (system) => { + if (system.getSystem().specSelectors.isOAS3()) { + const selectedValue = selector(state, ...args); + return typeof selectedValue === "function" ? + selectedValue(system) : + selectedValue; + } else { + return null; + } + });}; + +function validateRequestBodyIsRequired(selector) { + return function () {for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {args[_key2] = arguments[_key2];}return ( + (system) => { + const specJson = system.getSystem().specSelectors.specJson(); + const argsList = [...args]; + // expect argsList[0] = state + let pathMethod = argsList[1] || []; + let isOas3RequestBodyRequired = specJson.getIn([ + "paths", + ...pathMethod, + "requestBody", + "required"] + ); + + if (isOas3RequestBodyRequired) { + return selector(...args); + } else { + // validation pass b/c not required + return true; + } + });}; +} + +const validateRequestBodyValueExists = (state, pathMethod) => { + pathMethod = pathMethod || []; + let oas3RequestBodyValue = state.getIn([ + "requestData", + ...pathMethod, + "bodyValue"] + ); + // context: bodyValue can be a String, or a Map + if (!oas3RequestBodyValue) { + return false; + } + // validation pass if String is not empty, or if Map exists + return true; +}; + +const selectedServer = oas3_selectors_onlyOAS3((state, namespace) => { + const path = namespace ? [namespace, "selectedServer"] : ["selectedServer"]; + return state.getIn(path) || ""; +}); + +const requestBodyValue = oas3_selectors_onlyOAS3((state, path, method) => { + return state.getIn(["requestData", path, method, "bodyValue"]) || null; +}); + +const shouldRetainRequestBodyValue = oas3_selectors_onlyOAS3((state, path, method) => { + return state.getIn(["requestData", path, method, "retainBodyValue"]) || false; +}); + +const selectDefaultRequestBodyValue = +(state, path, method) => (system) => { + const { oas3Selectors, specSelectors, fn } = system.getSystem(); + + if (specSelectors.isOAS3()) { + const currentMediaType = oas3Selectors.requestContentType(path, method); + if (currentMediaType) { + return getDefaultRequestBodyValue( + specSelectors.specResolvedSubtree([ + "paths", + path, + method, + "requestBody"] + ), + currentMediaType, + oas3Selectors.activeExamplesMember( + path, + method, + "requestBody", + "requestBody" + ), + fn + ); + } + } + return null; +}; + +const hasUserEditedBody = oas3_selectors_onlyOAS3((state, path, method) => (system) => { + const { oas3Selectors, specSelectors, fn } = system; + + let userHasEditedBody = false; + const currentMediaType = oas3Selectors.requestContentType(path, method); + let userEditedRequestBody = oas3Selectors.requestBodyValue(path, method); + const requestBody = specSelectors.specResolvedSubtree([ + "paths", + path, + method, + "requestBody"] + ); + + /** + * The only request body that can currently be edited is for Path Items that are direct values of OpenAPI.paths. + * Path Item contained within the Callback Object or OpenAPI.webhooks (OpenAPI 3.1.0) have `Try it out` + * disabled and thus body cannot be edited. + */ + if (!requestBody) { + return false; + } + + if (external_immutable_namespaceObject.Map.isMap(userEditedRequestBody)) { + // context is not application/json media-type + userEditedRequestBody = stringify( + userEditedRequestBody. + mapEntries((kv) => + external_immutable_namespaceObject.Map.isMap(kv[1]) ? [kv[0], kv[1].get("value")] : kv + ). + toJS() + ); + } + if (external_immutable_namespaceObject.List.isList(userEditedRequestBody)) { + userEditedRequestBody = stringify(userEditedRequestBody); + } + + if (currentMediaType) { + const currentMediaTypeDefaultBodyValue = getDefaultRequestBodyValue( + requestBody, + currentMediaType, + oas3Selectors.activeExamplesMember( + path, + method, + "requestBody", + "requestBody" + ), + fn + ); + userHasEditedBody = + !!userEditedRequestBody && + userEditedRequestBody !== currentMediaTypeDefaultBodyValue; + } + return userHasEditedBody; +}); + +const requestBodyInclusionSetting = oas3_selectors_onlyOAS3((state, path, method) => { + return state.getIn(["requestData", path, method, "bodyInclusion"]) || (0,external_immutable_namespaceObject.Map)(); +}); + +const requestBodyErrors = oas3_selectors_onlyOAS3((state, path, method) => { + return state.getIn(["requestData", path, method, "errors"]) || null; +}); + +const activeExamplesMember = oas3_selectors_onlyOAS3( + (state, path, method, type, name) => { + return ( + state.getIn(["examples", path, method, type, name, "activeExample"]) || + null); + + } +); + +const requestContentType = oas3_selectors_onlyOAS3((state, path, method) => { + return ( + state.getIn(["requestData", path, method, "requestContentType"]) || null); + +}); + +const responseContentType = oas3_selectors_onlyOAS3((state, path, method) => { + return ( + state.getIn(["requestData", path, method, "responseContentType"]) || null); + +}); + +const serverVariableValue = oas3_selectors_onlyOAS3((state, locationData, key) => { + let path; + + // locationData may take one of two forms, for backwards compatibility + // Object: ({server, namespace?}) or String:(server) + if (typeof locationData !== "string") { + const { server, namespace } = locationData; + if (namespace) { + path = [namespace, "serverVariableValues", server, key]; + } else { + path = ["serverVariableValues", server, key]; + } + } else { + const server = locationData; + path = ["serverVariableValues", server, key]; + } + + return state.getIn(path) || null; +}); + +const serverVariables = oas3_selectors_onlyOAS3((state, locationData) => { + let path; + + // locationData may take one of two forms, for backwards compatibility + // Object: ({server, namespace?}) or String:(server) + if (typeof locationData !== "string") { + const { server, namespace } = locationData; + if (namespace) { + path = [namespace, "serverVariableValues", server]; + } else { + path = ["serverVariableValues", server]; + } + } else { + const server = locationData; + path = ["serverVariableValues", server]; + } + + return state.getIn(path) || (0,external_immutable_namespaceObject.OrderedMap)(); +}); + +const serverEffectiveValue = oas3_selectors_onlyOAS3((state, locationData) => { + var varValues, serverValue; + + // locationData may take one of two forms, for backwards compatibility + // Object: ({server, namespace?}) or String:(server) + if (typeof locationData !== "string") { + const { server, namespace } = locationData; + serverValue = server; + if (namespace) { + varValues = state.getIn([namespace, "serverVariableValues", serverValue]); + } else { + varValues = state.getIn(["serverVariableValues", serverValue]); + } + } else { + serverValue = locationData; + varValues = state.getIn(["serverVariableValues", serverValue]); + } + + varValues = varValues || (0,external_immutable_namespaceObject.OrderedMap)(); + let str = serverValue; + + varValues.map((val, key) => { + str = str.replace(new RegExp(`{${key}}`, "g"), val); + }); + + return str; +}); + +const selectors_validateBeforeExecute = validateRequestBodyIsRequired( + (state, pathMethod) => validateRequestBodyValueExists(state, pathMethod) +); + +const validateShallowRequired = ( +state, _ref) => + + + + + +{let { oas3RequiredRequestBodyContentType, oas3RequestContentType, oas3RequestBodyValue } = _ref; + let missingRequiredKeys = []; + // context: json => String; urlencoded, form-data => Map + if (!external_immutable_namespaceObject.Map.isMap(oas3RequestBodyValue)) { + return missingRequiredKeys; + } + let requiredKeys = []; + // Cycle through list of possible contentTypes for matching contentType and defined requiredKeys + Object.keys(oas3RequiredRequestBodyContentType.requestContentType).forEach( + (contentType) => { + if (contentType === oas3RequestContentType) { + let contentTypeVal = + oas3RequiredRequestBodyContentType.requestContentType[contentType]; + contentTypeVal.forEach((requiredKey) => { + if (requiredKeys.indexOf(requiredKey) < 0) { + requiredKeys.push(requiredKey); + } + }); + } + } + ); + requiredKeys.forEach((key) => { + let requiredKeyValue = oas3RequestBodyValue.getIn([key, "value"]); + if (!requiredKeyValue) { + missingRequiredKeys.push(key); + } + }); + return missingRequiredKeys; +}; + +const selectors_validOperationMethods = (0,external_reselect_namespaceObject.createSelector)(() => [ +"get", +"put", +"post", +"delete", +"options", +"head", +"patch", +"trace"] +); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/reducers.js + + + + + +/* harmony default export */ const oas3_reducers = ({ + [UPDATE_SELECTED_SERVER]: (state, _ref) => {let { payload: { selectedServerUrl, namespace } } = _ref; + const path = namespace ? [namespace, "selectedServer"] : ["selectedServer"]; + return state.setIn(path, selectedServerUrl); + }, + [UPDATE_REQUEST_BODY_VALUE]: (state, _ref2) => {let { payload: { value, pathMethod } } = _ref2; + let [path, method] = pathMethod; + if (!external_immutable_namespaceObject.Map.isMap(value)) { + // context: application/json is always a String (instead of Map) + return state.setIn(["requestData", path, method, "bodyValue"], value); + } + let currentVal = state.getIn(["requestData", path, method, "bodyValue"]) || (0,external_immutable_namespaceObject.Map)(); + if (!external_immutable_namespaceObject.Map.isMap(currentVal)) { + // context: user switch from application/json to application/x-www-form-urlencoded + currentVal = (0,external_immutable_namespaceObject.Map)(); + } + let newVal; + const [...valueKeys] = value.keys(); + valueKeys.forEach((valueKey) => { + let valueKeyVal = value.getIn([valueKey]); + if (!currentVal.has(valueKey)) { + newVal = currentVal.setIn([valueKey, "value"], valueKeyVal); + } else if (!external_immutable_namespaceObject.Map.isMap(valueKeyVal)) { + // context: user input will be received as String + newVal = currentVal.setIn([valueKey, "value"], valueKeyVal); + } + }); + return state.setIn(["requestData", path, method, "bodyValue"], newVal); + }, + [UPDATE_REQUEST_BODY_VALUE_RETAIN_FLAG]: (state, _ref3) => {let { payload: { value, pathMethod } } = _ref3; + let [path, method] = pathMethod; + return state.setIn(["requestData", path, method, "retainBodyValue"], value); + }, + [UPDATE_REQUEST_BODY_INCLUSION]: (state, _ref4) => {let { payload: { value, pathMethod, name } } = _ref4; + let [path, method] = pathMethod; + return state.setIn(["requestData", path, method, "bodyInclusion", name], value); + }, + [UPDATE_ACTIVE_EXAMPLES_MEMBER]: (state, _ref5) => {let { payload: { name, pathMethod, contextType, contextName } } = _ref5; + let [path, method] = pathMethod; + return state.setIn(["examples", path, method, contextType, contextName, "activeExample"], name); + }, + [UPDATE_REQUEST_CONTENT_TYPE]: (state, _ref6) => {let { payload: { value, pathMethod } } = _ref6; + let [path, method] = pathMethod; + return state.setIn(["requestData", path, method, "requestContentType"], value); + }, + [UPDATE_RESPONSE_CONTENT_TYPE]: (state, _ref7) => {let { payload: { value, path, method } } = _ref7; + return state.setIn(["requestData", path, method, "responseContentType"], value); + }, + [UPDATE_SERVER_VARIABLE_VALUE]: (state, _ref8) => {let { payload: { server, namespace, key, val } } = _ref8; + const path = namespace ? [namespace, "serverVariableValues", server, key] : ["serverVariableValues", server, key]; + return state.setIn(path, val); + }, + [SET_REQUEST_BODY_VALIDATE_ERROR]: (state, _ref9) => {let { payload: { path, method, validationErrors } } = _ref9; + let errors = []; + errors.push("Required field is not provided"); + if (validationErrors.missingBodyValue) { + // context: is application/json or application/xml, where typeof (missing) bodyValue = String + return state.setIn(["requestData", path, method, "errors"], (0,external_immutable_namespaceObject.fromJS)(errors)); + } + if (validationErrors.missingRequiredKeys && validationErrors.missingRequiredKeys.length > 0) { + // context: is application/x-www-form-urlencoded, with list of missing keys + const { missingRequiredKeys } = validationErrors; + return state.updateIn(["requestData", path, method, "bodyValue"], (0,external_immutable_namespaceObject.fromJS)({}), (missingKeyValues) => { + return missingRequiredKeys.reduce((bodyValue, currentMissingKey) => { + return bodyValue.setIn([currentMissingKey, "errors"], (0,external_immutable_namespaceObject.fromJS)(errors)); + }, missingKeyValues); + }); + } + console.warn("unexpected result: SET_REQUEST_BODY_VALIDATE_ERROR"); + return state; + }, + [CLEAR_REQUEST_BODY_VALIDATE_ERROR]: (state, _ref10) => {let { payload: { path, method } } = _ref10; + const requestBodyValue = state.getIn(["requestData", path, method, "bodyValue"]); + if (!external_immutable_namespaceObject.Map.isMap(requestBodyValue)) { + return state.setIn(["requestData", path, method, "errors"], (0,external_immutable_namespaceObject.fromJS)([])); + } + const [...valueKeys] = requestBodyValue.keys(); + if (!valueKeys) { + return state; + } + return state.updateIn(["requestData", path, method, "bodyValue"], (0,external_immutable_namespaceObject.fromJS)({}), (bodyValues) => { + return valueKeys.reduce((bodyValue, curr) => { + return bodyValue.setIn([curr, "errors"], (0,external_immutable_namespaceObject.fromJS)([])); + }, bodyValues); + }); + }, + [CLEAR_REQUEST_BODY_VALUE]: (state, _ref11) => {let { payload: { pathMethod } } = _ref11; + let [path, method] = pathMethod; + const requestBodyValue = state.getIn(["requestData", path, method, "bodyValue"]); + if (!requestBodyValue) { + return state; + } + if (!external_immutable_namespaceObject.Map.isMap(requestBodyValue)) { + return state.setIn(["requestData", path, method, "bodyValue"], ""); + } + return state.setIn(["requestData", path, method, "bodyValue"], (0,external_immutable_namespaceObject.Map)()); + } +}); +;// CONCATENATED MODULE: ./src/core/plugins/oas3/index.js +/** + * @prettier + */ + + + + + + + + + +/* harmony default export */ function oas3() { + return { + components: components, + wrapComponents: wrap_components, + statePlugins: { + spec: { + wrapSelectors: wrap_selectors_namespaceObject, + selectors: spec_extensions_selectors_namespaceObject + }, + auth: { + wrapSelectors: auth_extensions_wrap_selectors_namespaceObject + }, + oas3: { + actions: oas3_actions_namespaceObject, + reducers: oas3_reducers, + selectors: oas3_selectors_namespaceObject + } + } + }; +} +;// CONCATENATED MODULE: ./src/core/plugins/oas31/components/webhooks.jsx +/** + * @prettier + */ + + + +const Webhooks = (_ref) => {let { specSelectors, getComponent } = _ref; + const operationDTOs = specSelectors.selectWebhooksOperations(); + const pathItemNames = Object.keys(operationDTOs); + + const OperationContainer = getComponent("OperationContainer", true); + + if (pathItemNames.length === 0) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "webhooks" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h2", null, "Webhooks"), + + pathItemNames.map((pathItemName) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { key: `${pathItemName}-webhook` }, + operationDTOs[pathItemName].map((operationDTO) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(OperationContainer, { + key: `${pathItemName}-${operationDTO.method}-webhook`, + op: operationDTO.operation, + tag: "webhooks", + method: operationDTO.method, + path: pathItemName, + specPath: operationDTO.specPath, + allowTryItOut: false } + ) + ) + ) + ) + )); + +}; + + + + + + + + +/* harmony default export */ const webhooks = (Webhooks); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/components/license.jsx +/** + * @prettier + */ + + + + + +const license_License = (_ref) => {let { getComponent, specSelectors } = _ref; + const name = specSelectors.selectLicenseNameField(); + const url = specSelectors.selectLicenseUrl(); + + const Link = getComponent("Link"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "info__license" }, + url ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "info__license__url" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: sanitizeUrl(url) }, + name + ) + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", null, name) + + )); + +}; + + + + + + + + + +/* harmony default export */ const components_license = (license_License); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/components/contact.jsx +/** + * @prettier + */ + + + + + +const contact_Contact = (_ref) => {let { getComponent, specSelectors } = _ref; + const name = specSelectors.selectContactNameField(); + const url = specSelectors.selectContactUrl(); + const email = specSelectors.selectContactEmailField(); + + const Link = getComponent("Link"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "info__contact" }, + url && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { href: sanitizeUrl(url), target: "_blank" }, + name, " - Website" + ) + ), + + email && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { href: sanitizeUrl(`mailto:${email}`) }, + url ? `Send email to ${name}` : `Contact ${name}` + ) + + )); + +}; + + + + + + + + + + +/* harmony default export */ const components_contact = (contact_Contact); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/components/info.jsx +/** + * @prettier + */ + + + + + +const info_Info = (_ref) => {let { getComponent, specSelectors } = _ref; + const version = specSelectors.version(); + const url = specSelectors.url(); + const basePath = specSelectors.basePath(); + const host = specSelectors.host(); + const summary = specSelectors.selectInfoSummaryField(); + const description = specSelectors.selectInfoDescriptionField(); + const title = specSelectors.selectInfoTitleField(); + const termsOfServiceUrl = specSelectors.selectInfoTermsOfServiceUrl(); + const externalDocsUrl = specSelectors.selectExternalDocsUrl(); + const externalDocsDesc = specSelectors.selectExternalDocsDescriptionField(); + const contact = specSelectors.contact(); + const license = specSelectors.license(); + + const Markdown = getComponent("Markdown", true); + const Link = getComponent("Link"); + const VersionStamp = getComponent("VersionStamp"); + const OpenAPIVersion = getComponent("OpenAPIVersion"); + const InfoUrl = getComponent("InfoUrl"); + const InfoBasePath = getComponent("InfoBasePath"); + const License = getComponent("License", true); + const Contact = getComponent("Contact", true); + const JsonSchemaDialect = getComponent("JsonSchemaDialect", true); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "info" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("hgroup", { className: "main" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h2", { className: "title" }, + title, + version && /*#__PURE__*/external_react_namespaceObject["default"].createElement(VersionStamp, { version: version }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(OpenAPIVersion, { oasVersion: "3.1" }) + ), + + (host || basePath) && /*#__PURE__*/external_react_namespaceObject["default"].createElement(InfoBasePath, { host: host, basePath: basePath }), + url && /*#__PURE__*/external_react_namespaceObject["default"].createElement(InfoUrl, { getComponent: getComponent, url: url }) + ), + + summary && /*#__PURE__*/external_react_namespaceObject["default"].createElement("p", { className: "info__summary" }, summary), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "info__description description" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Markdown, { source: description }) + ), + + termsOfServiceUrl && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "info__tos" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: sanitizeUrl(termsOfServiceUrl) }, "Terms of service" + + ) + ), + + + contact.size > 0 && /*#__PURE__*/external_react_namespaceObject["default"].createElement(Contact, null), + + license.size > 0 && /*#__PURE__*/external_react_namespaceObject["default"].createElement(License, null), + + externalDocsUrl && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { + className: "info__extdocs", + target: "_blank", + href: sanitizeUrl(externalDocsUrl) }, + + externalDocsDesc || externalDocsUrl + ), /*#__PURE__*/ + + + external_react_namespaceObject["default"].createElement(JsonSchemaDialect, null) + )); + +}; + + + + + + + + + + + + + + + + + + + +/* harmony default export */ const oas31_components_info = (info_Info); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/components/json-schema-dialect.jsx +/** + * @prettier + */ + + + + + + +const JsonSchemaDialect = (_ref) => {let { getComponent, specSelectors } = _ref; + const jsonSchemaDialect = specSelectors.selectJsonSchemaDialectField(); + const jsonSchemaDialectDefault = specSelectors.selectJsonSchemaDialectDefault(); // prettier-ignore + + const Link = getComponent("Link"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + jsonSchemaDialect && jsonSchemaDialect === jsonSchemaDialectDefault && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", { className: "info__jsonschemadialect" }, "JSON Schema dialect:", + " ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: sanitizeUrl(jsonSchemaDialect) }, + jsonSchemaDialect + ) + ), + + + jsonSchemaDialect && jsonSchemaDialect !== jsonSchemaDialectDefault && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "error-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "no-margin" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "errors" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "errors-wrapper" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h4", { className: "center" }, "Warning"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", { className: "message" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("strong", null, "OpenAPI.jsonSchemaDialect"), " field contains a value different from the default value of", + " ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { target: "_blank", href: jsonSchemaDialectDefault }, + jsonSchemaDialectDefault + ), ". Values different from the default one are currently not supported. Please either omit the field or provide it with the default value." + + + + ) + ) + ) + ) + ) + + )); + +}; + + + + + + + + + +/* harmony default export */ const json_schema_dialect = (JsonSchemaDialect); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/components/version-pragma-filter.jsx + + + +const version_pragma_filter_VersionPragmaFilter = (_ref) => + + + + + + +{let { bypass, isSwagger2, isOAS3, isOAS31, alsoShow, children } = _ref; + if (bypass) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, children); + } + + if (isSwagger2 && (isOAS3 || isOAS31)) { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "version-pragma" }, + alsoShow, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "version-pragma__message version-pragma__message--ambiguous" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h3", null, "Unable to render this definition"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, "swagger"), " and ", /*#__PURE__*/external_react_namespaceObject["default"].createElement("code", null, "openapi"), " fields cannot be present in the same Swagger or OpenAPI definition. Please remove one of the fields." + + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "Supported version fields are ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, "swagger: \"2.0\""), " and those that match ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, "openapi: 3.x.y"), " (for example,", " ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, "openapi: 3.1.0"), ")." + ) + ) + ) + )); + + } + + if (!isSwagger2 && !isOAS3 && !isOAS31) { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "version-pragma" }, + alsoShow, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "version-pragma__message version-pragma__message--missing" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("h3", null, "Unable to render this definition"), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "The provided definition does not specify a valid version field." + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("p", null, "Please indicate a valid Swagger or OpenAPI version field. Supported version fields are ", /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("code", null, "swagger: \"2.0\""), " and those that match ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, "openapi: 3.x.y"), " (for example,", " ", /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("code", null, "openapi: 3.1.0"), ")." + ) + ) + ) + )); + + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement("div", null, children); +}; + + + + + + + + + + +/* harmony default export */ const version_pragma_filter = (version_pragma_filter_VersionPragmaFilter); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/components/model/model.jsx +/** + * @prettier + */ + + + + +const model_decodeRefName = (uri) => { + const unescaped = uri.replace(/~1/g, "/").replace(/~0/g, "~"); + try { + return decodeURIComponent(unescaped); + } catch { + return unescaped; + } +}; +const getModelName = (uri) => { + if (typeof uri === "string" && uri.includes("#/components/schemas/")) { + return model_decodeRefName(uri.replace(/^.*#\/components\/schemas\//, "")); + } + return null; +}; + +const model_Model = /*#__PURE__*/(0,external_react_namespaceObject.forwardRef)((_ref, ref) => {let { schema, getComponent, onToggle } = _ref; + const JSONSchema202012 = getComponent("JSONSchema202012"); + const name = getModelName(schema.get("$$ref")); + + const handleExpand = (0,external_react_namespaceObject.useCallback)( + (e, expanded) => { + onToggle(name, expanded); + }, + [name, onToggle] + ); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchema202012, { + name: name, + schema: schema.toJS(), + ref: ref, + onExpand: handleExpand } + )); + +}); + + + + + + + + + + + + + + + + + + +model_Model.defaultProps = { + name: "", + displayName: "", + isRef: false, + required: false, + expandDepth: 0, + depth: 1, + includeReadOnly: false, + includeWriteOnly: false, + onToggle: () => {} +}; + +/* harmony default export */ const model_model = (model_Model); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/components/models/models.jsx +/** + * @prettier + */ + + + + +const models_Models = (_ref) => + + + + + + +{let { specActions, specSelectors, layoutSelectors, layoutActions, getComponent, getConfigs } = _ref; + const schemas = specSelectors.selectSchemas(); + const hasSchemas = Object.keys(schemas).length > 0; + const schemasPath = ["components", "schemas"]; + const { docExpansion, defaultModelsExpandDepth } = getConfigs(); + const isOpenDefault = defaultModelsExpandDepth > 0 && docExpansion !== "none"; + const isOpen = layoutSelectors.isShown(schemasPath, isOpenDefault); + const Collapse = getComponent("Collapse"); + const JSONSchema202012 = getComponent("JSONSchema202012"); + const ArrowUpIcon = getComponent("ArrowUpIcon"); + const ArrowDownIcon = getComponent("ArrowDownIcon"); + + /** + * Effects. + */ + (0,external_react_namespaceObject.useEffect)(() => { + const isOpenAndExpanded = isOpen && defaultModelsExpandDepth > 1; + const isResolved = specSelectors.specResolvedSubtree(schemasPath) != null; + if (isOpenAndExpanded && !isResolved) { + specActions.requestResolvedSubtree(schemasPath); + } + }, [isOpen, defaultModelsExpandDepth]); + + /** + * Event handlers. + */ + + const handleModelsExpand = (0,external_react_namespaceObject.useCallback)(() => { + layoutActions.show(schemasPath, !isOpen); + }, [isOpen]); + const handleModelsRef = (0,external_react_namespaceObject.useCallback)((node) => { + if (node !== null) { + layoutActions.readyToScroll(schemasPath, node); + } + }, []); + const handleJSONSchema202012Ref = (schemaName) => (node) => { + if (node !== null) { + layoutActions.readyToScroll([...schemasPath, schemaName], node); + } + }; + const handleJSONSchema202012Expand = (schemaName) => (e, expanded) => { + if (expanded) { + const schemaPath = [...schemasPath, schemaName]; + const isResolved = specSelectors.specResolvedSubtree(schemaPath) != null; + if (!isResolved) { + specActions.requestResolvedSubtree([...schemasPath, schemaName]); + } + } + }; + + /** + * Rendering. + */ + + if (!hasSchemas || defaultModelsExpandDepth < 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("section", { + className: (0,external_classnames_namespaceObject["default"])("models", { "is-open": isOpen }), + ref: handleModelsRef }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("h4", null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("button", { + "aria-expanded": isOpen, + className: "models-control", + onClick: handleModelsExpand }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", null, "Schemas"), + isOpen ? /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowUpIcon, null) : /*#__PURE__*/external_react_namespaceObject["default"].createElement(ArrowDownIcon, null) + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Collapse, { isOpened: isOpen }, + Object.entries(schemas).map((_ref2) => {let [schemaName, schema] = _ref2;return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchema202012, { + key: schemaName, + ref: handleJSONSchema202012Ref(schemaName), + schema: schema, + name: schemaName, + onExpand: handleJSONSchema202012Expand(schemaName) } + ));} + ) + ) + )); + +}; + + + + + + + + + + + + + + + + + + + + +/* harmony default export */ const models = (models_Models); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/fn.js + /** + * @prettier + */ + + +const isOAS31 = (jsSpec) => { + const oasVersion = jsSpec.get("openapi"); + + return ( + typeof oasVersion === "string" && /^3\.1\.(?:[1-9]\d*|0)$/.test(oasVersion)); + +}; + +/** + * Creates selector that returns value of the passed + * selector when spec is OpenAPI 3.1.0., null otherwise. + * + * @param selector + * @returns {function(*, ...[*]): function(*): (*|null)} + */ +const fn_createOnlyOAS31Selector = +(selector) => +function (state) {for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {args[_key - 1] = arguments[_key];}return ( + (system) => { + if (system.getSystem().specSelectors.isOAS31()) { + const selectedValue = selector(state, ...args); + return typeof selectedValue === "function" ? + selectedValue(system) : + selectedValue; + } else { + return null; + } + });}; + +/** + * Creates selector wrapper that returns value of the passed + * selector when spec is OpenAPI 3.1.0., calls original selector otherwise. + * + * + * @param selector + * @returns {function(*, *): function(*, ...[*]): (*)} + */ +const createOnlyOAS31SelectorWrapper = +(selector) => +(oriSelector, system) => +function (state) {for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {args[_key2 - 1] = arguments[_key2];} + if (system.getSystem().specSelectors.isOAS31()) { + const selectedValue = selector(state, ...args); + return typeof selectedValue === "function" ? + selectedValue(oriSelector, system) : + selectedValue; + } else { + return oriSelector(...args); + } +}; + +/** + * Creates selector that provides system as the + * second argument. This allows to create memoized + * composed selectors from different plugins. + * + * @param selector + * @returns {function(*, ...[*]): function(*): *} + */ +const fn_createSystemSelector = +(selector) => +function (state) {for (var _len3 = arguments.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {args[_key3 - 1] = arguments[_key3];}return ( + (system) => { + const selectedValue = selector(state, system, ...args); + return typeof selectedValue === "function" ? + selectedValue(system) : + selectedValue; + });}; + +/* eslint-disable react/jsx-filename-extension */ +/** + * Creates component wrapper that only wraps the component + * when spec is OpenAPI 3.1.0. Otherwise, returns original + * component with passed props. + * + * @param Component + * @returns {function(*, *): function(*): *} + */ +const createOnlyOAS31ComponentWrapper = +(Component) => (Original, system) => (props) => { + if (system.specSelectors.isOAS31()) { + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(Component, (0,extends_namespaceObject["default"])({}, + props, { + originalComponent: Original, + getSystem: system.getSystem }) + )); + + } + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(Original, props); +}; +/* eslint-enable react/jsx-filename-extension */ + +/** + * Runs the fn replacement implementation when spec is OpenAPI 3.1. + * Runs the fn original implementation otherwise. + * + * @param fn + * @param system + * @returns {{[p: string]: function(...[*]): *}} + */ +const wrapOAS31Fn = (fn, system) => { + const { fn: systemFn, specSelectors } = system; + + return Object.fromEntries( + Object.entries(fn).map((_ref) => {let [name, newImpl] = _ref; + const oriImpl = systemFn[name]; + const impl = function () {return ( + specSelectors.isOAS31() ? + newImpl(...arguments) : + typeof oriImpl === "function" ? + oriImpl(...arguments) : + undefined);}; + + return [name, impl]; + }) + ); +}; +;// CONCATENATED MODULE: ./src/core/plugins/oas31/wrap-components/license.jsx +/** + * @prettier + */ + + + + +const LicenseWrapper = createOnlyOAS31ComponentWrapper((_ref) => {let { getSystem } = _ref; + const system = getSystem(); + const OAS31License = system.getComponent("OAS31License", true); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(OAS31License, null); +}); + +/* harmony default export */ const wrap_components_license = (LicenseWrapper); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/wrap-components/contact.jsx +/** + * @prettier + */ + + + + +const ContactWrapper = createOnlyOAS31ComponentWrapper((_ref) => {let { getSystem } = _ref; + const system = getSystem(); + const OAS31Contact = system.getComponent("OAS31Contact", true); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(OAS31Contact, null); +}); + +/* harmony default export */ const wrap_components_contact = (ContactWrapper); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/wrap-components/info.jsx +/** + * @prettier + */ + + + + +const InfoWrapper = createOnlyOAS31ComponentWrapper((_ref) => {let { getSystem } = _ref; + const system = getSystem(); + const OAS31Info = system.getComponent("OAS31Info", true); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(OAS31Info, null); +}); + +/* harmony default export */ const wrap_components_info = (InfoWrapper); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/fn.js +/** + * @prettier + */ +const makeIsExpandable = (original, getSystem) => { + const { fn } = getSystem(); + + if (typeof original !== "function") { + return null; + } + + const { hasKeyword } = fn.jsonSchema202012; + + return (schema) => + original(schema) || + hasKeyword(schema, "example") || ( + schema === null || schema === void 0 ? void 0 : schema.xml) || ( + schema === null || schema === void 0 ? void 0 : schema.discriminator) || ( + schema === null || schema === void 0 ? void 0 : schema.externalDocs); +}; + +const getProperties = ( +schema, _ref) => + +{let { includeReadOnly, includeWriteOnly } = _ref; + // shortcut + if (!(schema !== null && schema !== void 0 && schema.properties)) return {}; + + const properties = Object.entries(schema.properties); + const filteredProperties = properties.filter((_ref2) => {let [, value] = _ref2; + const isReadOnly = (value === null || value === void 0 ? void 0 : value.readOnly) === true; + const isWriteOnly = (value === null || value === void 0 ? void 0 : value.writeOnly) === true; + + return ( + (!isReadOnly || includeReadOnly) && (!isWriteOnly || includeWriteOnly)); + + }); + + return Object.fromEntries(filteredProperties); +}; +;// CONCATENATED MODULE: ./src/core/plugins/oas31/wrap-components/model.jsx +const model_excluded = ["getSystem"]; /** + * @prettier + */ + + + + + + +const model_ModelWrapper = createOnlyOAS31ComponentWrapper( + (_ref) => {let { getSystem } = _ref,props = (0,objectWithoutProperties_namespaceObject["default"])(_ref, model_excluded); + const system = getSystem(); + const { getComponent, fn, getConfigs } = system; + const configs = getConfigs(); + + const Model = getComponent("OAS31Model"); + const JSONSchema = getComponent("JSONSchema202012"); + const Keyword$schema = getComponent("JSONSchema202012Keyword$schema"); + const Keyword$vocabulary = getComponent( + "JSONSchema202012Keyword$vocabulary" + ); + const Keyword$id = getComponent("JSONSchema202012Keyword$id"); + const Keyword$anchor = getComponent("JSONSchema202012Keyword$anchor"); + const Keyword$dynamicAnchor = getComponent( + "JSONSchema202012Keyword$dynamicAnchor" + ); + const Keyword$ref = getComponent("JSONSchema202012Keyword$ref"); + const Keyword$dynamicRef = getComponent( + "JSONSchema202012Keyword$dynamicRef" + ); + const Keyword$defs = getComponent("JSONSchema202012Keyword$defs"); + const Keyword$comment = getComponent("JSONSchema202012Keyword$comment"); + const KeywordAllOf = getComponent("JSONSchema202012KeywordAllOf"); + const KeywordAnyOf = getComponent("JSONSchema202012KeywordAnyOf"); + const KeywordOneOf = getComponent("JSONSchema202012KeywordOneOf"); + const KeywordNot = getComponent("JSONSchema202012KeywordNot"); + const KeywordIf = getComponent("JSONSchema202012KeywordIf"); + const KeywordThen = getComponent("JSONSchema202012KeywordThen"); + const KeywordElse = getComponent("JSONSchema202012KeywordElse"); + const KeywordDependentSchemas = getComponent( + "JSONSchema202012KeywordDependentSchemas" + ); + const KeywordPrefixItems = getComponent( + "JSONSchema202012KeywordPrefixItems" + ); + const KeywordItems = getComponent("JSONSchema202012KeywordItems"); + const KeywordContains = getComponent("JSONSchema202012KeywordContains"); + const KeywordProperties = getComponent("JSONSchema202012KeywordProperties"); + const KeywordPatternProperties = getComponent( + "JSONSchema202012KeywordPatternProperties" + ); + const KeywordAdditionalProperties = getComponent( + "JSONSchema202012KeywordAdditionalProperties" + ); + const KeywordPropertyNames = getComponent( + "JSONSchema202012KeywordPropertyNames" + ); + const KeywordUnevaluatedItems = getComponent( + "JSONSchema202012KeywordUnevaluatedItems" + ); + const KeywordUnevaluatedProperties = getComponent( + "JSONSchema202012KeywordUnevaluatedProperties" + ); + const KeywordType = getComponent("JSONSchema202012KeywordType"); + const KeywordEnum = getComponent("JSONSchema202012KeywordEnum"); + const KeywordConst = getComponent("JSONSchema202012KeywordConst"); + const KeywordConstraint = getComponent("JSONSchema202012KeywordConstraint"); + const KeywordDependentRequired = getComponent( + "JSONSchema202012KeywordDependentRequired" + ); + const KeywordContentSchema = getComponent( + "JSONSchema202012KeywordContentSchema" + ); + const KeywordTitle = getComponent("JSONSchema202012KeywordTitle"); + const KeywordDescription = getComponent( + "JSONSchema202012KeywordDescription" + ); + const KeywordDefault = getComponent("JSONSchema202012KeywordDefault"); + const KeywordDeprecated = getComponent("JSONSchema202012KeywordDeprecated"); + const KeywordReadOnly = getComponent("JSONSchema202012KeywordReadOnly"); + const KeywordWriteOnly = getComponent("JSONSchema202012KeywordWriteOnly"); + const Accordion = getComponent("JSONSchema202012Accordion"); + const ExpandDeepButton = getComponent("JSONSchema202012ExpandDeepButton"); + const ChevronRightIcon = getComponent("JSONSchema202012ChevronRightIcon"); + const withSchemaContext = getComponent("withJSONSchema202012Context"); + + const ModelWithJSONSchemaContext = withSchemaContext(Model, { + config: { + default$schema: "https://spec.openapis.org/oas/3.1/dialect/base", + defaultExpandedLevels: configs.defaultModelExpandDepth, + includeReadOnly: Boolean(props.includeReadOnly), + includeWriteOnly: Boolean(props.includeWriteOnly) + }, + components: { + JSONSchema, + Keyword$schema, + Keyword$vocabulary, + Keyword$id, + Keyword$anchor, + Keyword$dynamicAnchor, + Keyword$ref, + Keyword$dynamicRef, + Keyword$defs, + Keyword$comment, + KeywordAllOf, + KeywordAnyOf, + KeywordOneOf, + KeywordNot, + KeywordIf, + KeywordThen, + KeywordElse, + KeywordDependentSchemas, + KeywordPrefixItems, + KeywordItems, + KeywordContains, + KeywordProperties, + KeywordPatternProperties, + KeywordAdditionalProperties, + KeywordPropertyNames, + KeywordUnevaluatedItems, + KeywordUnevaluatedProperties, + KeywordType, + KeywordEnum, + KeywordConst, + KeywordConstraint, + KeywordDependentRequired, + KeywordContentSchema, + KeywordTitle, + KeywordDescription, + KeywordDefault, + KeywordDeprecated, + KeywordReadOnly, + KeywordWriteOnly, + Accordion, + ExpandDeepButton, + ChevronRightIcon + }, + fn: { + upperFirst: fn.upperFirst, + isExpandable: makeIsExpandable( + fn.jsonSchema202012.isExpandable, + getSystem + ), + getProperties: getProperties + } + }); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ModelWithJSONSchemaContext, props); + } +); + +/* harmony default export */ const wrap_components_model = (model_ModelWrapper); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/wrap-components/models.jsx +/** + * @prettier + */ + + + + +const ModelsWrapper = createOnlyOAS31ComponentWrapper((_ref) => {let { getSystem } = _ref; + const { getComponent, fn, getConfigs } = getSystem(); + const configs = getConfigs(); + + if (ModelsWrapper.ModelsWithJSONSchemaContext) { + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ModelsWrapper.ModelsWithJSONSchemaContext, null); + } + + const Models = getComponent("OAS31Models", true); + const JSONSchema = getComponent("JSONSchema202012"); + const Keyword$schema = getComponent("JSONSchema202012Keyword$schema"); + const Keyword$vocabulary = getComponent("JSONSchema202012Keyword$vocabulary"); + const Keyword$id = getComponent("JSONSchema202012Keyword$id"); + const Keyword$anchor = getComponent("JSONSchema202012Keyword$anchor"); + const Keyword$dynamicAnchor = getComponent( + "JSONSchema202012Keyword$dynamicAnchor" + ); + const Keyword$ref = getComponent("JSONSchema202012Keyword$ref"); + const Keyword$dynamicRef = getComponent("JSONSchema202012Keyword$dynamicRef"); + const Keyword$defs = getComponent("JSONSchema202012Keyword$defs"); + const Keyword$comment = getComponent("JSONSchema202012Keyword$comment"); + const KeywordAllOf = getComponent("JSONSchema202012KeywordAllOf"); + const KeywordAnyOf = getComponent("JSONSchema202012KeywordAnyOf"); + const KeywordOneOf = getComponent("JSONSchema202012KeywordOneOf"); + const KeywordNot = getComponent("JSONSchema202012KeywordNot"); + const KeywordIf = getComponent("JSONSchema202012KeywordIf"); + const KeywordThen = getComponent("JSONSchema202012KeywordThen"); + const KeywordElse = getComponent("JSONSchema202012KeywordElse"); + const KeywordDependentSchemas = getComponent( + "JSONSchema202012KeywordDependentSchemas" + ); + const KeywordPrefixItems = getComponent("JSONSchema202012KeywordPrefixItems"); + const KeywordItems = getComponent("JSONSchema202012KeywordItems"); + const KeywordContains = getComponent("JSONSchema202012KeywordContains"); + const KeywordProperties = getComponent("JSONSchema202012KeywordProperties"); + const KeywordPatternProperties = getComponent( + "JSONSchema202012KeywordPatternProperties" + ); + const KeywordAdditionalProperties = getComponent( + "JSONSchema202012KeywordAdditionalProperties" + ); + const KeywordPropertyNames = getComponent( + "JSONSchema202012KeywordPropertyNames" + ); + const KeywordUnevaluatedItems = getComponent( + "JSONSchema202012KeywordUnevaluatedItems" + ); + const KeywordUnevaluatedProperties = getComponent( + "JSONSchema202012KeywordUnevaluatedProperties" + ); + const KeywordType = getComponent("JSONSchema202012KeywordType"); + const KeywordEnum = getComponent("JSONSchema202012KeywordEnum"); + const KeywordConst = getComponent("JSONSchema202012KeywordConst"); + const KeywordConstraint = getComponent("JSONSchema202012KeywordConstraint"); + const KeywordDependentRequired = getComponent( + "JSONSchema202012KeywordDependentRequired" + ); + const KeywordContentSchema = getComponent( + "JSONSchema202012KeywordContentSchema" + ); + const KeywordTitle = getComponent("JSONSchema202012KeywordTitle"); + const KeywordDescription = getComponent("JSONSchema202012KeywordDescription"); + const KeywordDefault = getComponent("JSONSchema202012KeywordDefault"); + const KeywordDeprecated = getComponent("JSONSchema202012KeywordDeprecated"); + const KeywordReadOnly = getComponent("JSONSchema202012KeywordReadOnly"); + const KeywordWriteOnly = getComponent("JSONSchema202012KeywordWriteOnly"); + const Accordion = getComponent("JSONSchema202012Accordion"); + const ExpandDeepButton = getComponent("JSONSchema202012ExpandDeepButton"); + const ChevronRightIcon = getComponent("JSONSchema202012ChevronRightIcon"); + const withSchemaContext = getComponent("withJSONSchema202012Context"); + + // we cache the HOC as recreating it with every re-render is quite expensive + ModelsWrapper.ModelsWithJSONSchemaContext = withSchemaContext(Models, { + config: { + default$schema: "https://spec.openapis.org/oas/3.1/dialect/base", + defaultExpandedLevels: configs.defaultModelsExpandDepth - 1, + includeReadOnly: true, + includeWriteOnly: true + }, + components: { + JSONSchema, + Keyword$schema, + Keyword$vocabulary, + Keyword$id, + Keyword$anchor, + Keyword$dynamicAnchor, + Keyword$ref, + Keyword$dynamicRef, + Keyword$defs, + Keyword$comment, + KeywordAllOf, + KeywordAnyOf, + KeywordOneOf, + KeywordNot, + KeywordIf, + KeywordThen, + KeywordElse, + KeywordDependentSchemas, + KeywordPrefixItems, + KeywordItems, + KeywordContains, + KeywordProperties, + KeywordPatternProperties, + KeywordAdditionalProperties, + KeywordPropertyNames, + KeywordUnevaluatedItems, + KeywordUnevaluatedProperties, + KeywordType, + KeywordEnum, + KeywordConst, + KeywordConstraint, + KeywordDependentRequired, + KeywordContentSchema, + KeywordTitle, + KeywordDescription, + KeywordDefault, + KeywordDeprecated, + KeywordReadOnly, + KeywordWriteOnly, + Accordion, + ExpandDeepButton, + ChevronRightIcon + }, + fn: { + upperFirst: fn.upperFirst, + isExpandable: fn.jsonSchema202012.isExpandable, + getProperties: fn.jsonSchema202012.getProperties + } + }); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(ModelsWrapper.ModelsWithJSONSchemaContext, null); +}); + +ModelsWrapper.ModelsWithJSONSchemaContext = null; + +/* harmony default export */ const wrap_components_models = (ModelsWrapper); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/wrap-components/version-pragma-filter.jsx + /** + * @prettier + */ + + +const VersionPragmaFilterWrapper = (Original, system) => (props) => { + const isOAS31 = system.specSelectors.isOAS31(); + + const OAS31VersionPragmaFilter = system.getComponent( + "OAS31VersionPragmaFilter" + ); + + return /*#__PURE__*/external_react_namespaceObject["default"].createElement(OAS31VersionPragmaFilter, (0,extends_namespaceObject["default"])({ isOAS31: isOAS31 }, props)); +}; + +/* harmony default export */ const wrap_components_version_pragma_filter = (VersionPragmaFilterWrapper); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/spec-extensions/selectors.js +/** + * @prettier + */ + + + + + + +const spec_extensions_selectors_map = (0,external_immutable_namespaceObject.Map)(); + +const selectors_isOAS31 = (0,external_reselect_namespaceObject.createSelector)( + (state, system) => system.specSelectors.specJson(), + isOAS31 +); + +const selectors_webhooks = () => (system) => { + return system.specSelectors.specJson().get("webhooks", spec_extensions_selectors_map); +}; + +/** + * `specResolvedSubtree` selector is needed as input selector, + * so that we regenerate the selected result whenever the lazy + * resolution happens. + */ +const selectWebhooksOperations = (0,external_reselect_namespaceObject.createSelector)( + (state, system) => system.specSelectors.webhooks(), + (state, system) => system.specSelectors.validOperationMethods(), + (state, system) => system.specSelectors.specResolvedSubtree(["webhooks"]), + (webhooks, validOperationMethods) => { + if (!external_immutable_namespaceObject.Map.isMap(webhooks)) return {}; + + return webhooks. + reduce((allOperations, pathItem, pathItemName) => { + if (!external_immutable_namespaceObject.Map.isMap(pathItem)) return allOperations; + + const pathItemOperations = pathItem. + entrySeq(). + filter((_ref) => {let [key] = _ref;return validOperationMethods.includes(key);}). + map((_ref2) => {let [method, operation] = _ref2;return { + operation: (0,external_immutable_namespaceObject.Map)({ operation }), + method, + path: pathItemName, + specPath: (0,external_immutable_namespaceObject.List)(["webhooks", pathItemName, method]) + };}); + + return allOperations.concat(pathItemOperations); + }, (0,external_immutable_namespaceObject.List)()). + groupBy((operationDTO) => operationDTO.path). + map((operations) => operations.toArray()). + toObject(); + } +); + +const selectors_license = () => (system) => { + return system.specSelectors.info().get("license", spec_extensions_selectors_map); +}; + +const selectLicenseNameField = () => (system) => { + return system.specSelectors.license().get("name", "License"); +}; + +const selectLicenseUrlField = () => (system) => { + return system.specSelectors.license().get("url"); +}; + +const selectLicenseUrl = (0,external_reselect_namespaceObject.createSelector)( + (state, system) => system.specSelectors.url(), + (state, system) => system.oas3Selectors.selectedServer(), + (state, system) => system.specSelectors.selectLicenseUrlField(), + (specUrl, selectedServer, url) => { + if (url) { + return safeBuildUrl(url, specUrl, { selectedServer }); + } + + return undefined; + } +); + +const selectLicenseIdentifierField = () => (system) => { + return system.specSelectors.license().get("identifier"); +}; + +const selectors_contact = () => (system) => { + return system.specSelectors.info().get("contact", spec_extensions_selectors_map); +}; + +const selectContactNameField = () => (system) => { + return system.specSelectors.contact().get("name", "the developer"); +}; + +const selectContactEmailField = () => (system) => { + return system.specSelectors.contact().get("email"); +}; + +const selectContactUrlField = () => (system) => { + return system.specSelectors.contact().get("url"); +}; + +const selectContactUrl = (0,external_reselect_namespaceObject.createSelector)( + (state, system) => system.specSelectors.url(), + (state, system) => system.oas3Selectors.selectedServer(), + (state, system) => system.specSelectors.selectContactUrlField(), + (specUrl, selectedServer, url) => { + if (url) { + return safeBuildUrl(url, specUrl, { selectedServer }); + } + + return undefined; + } +); + +const selectInfoTitleField = () => (system) => { + return system.specSelectors.info().get("title"); +}; + +const selectInfoSummaryField = () => (system) => { + return system.specSelectors.info().get("summary"); +}; + +const selectInfoDescriptionField = () => (system) => { + return system.specSelectors.info().get("description"); +}; + +const selectInfoTermsOfServiceField = () => (system) => { + return system.specSelectors.info().get("termsOfService"); +}; + +const selectInfoTermsOfServiceUrl = (0,external_reselect_namespaceObject.createSelector)( + (state, system) => system.specSelectors.url(), + (state, system) => system.oas3Selectors.selectedServer(), + (state, system) => system.specSelectors.selectInfoTermsOfServiceField(), + (specUrl, selectedServer, termsOfService) => { + if (termsOfService) { + return safeBuildUrl(termsOfService, specUrl, { selectedServer }); + } + + return undefined; + } +); + +const selectExternalDocsDescriptionField = () => (system) => { + return system.specSelectors.externalDocs().get("description"); +}; + +const selectExternalDocsUrlField = () => (system) => { + return system.specSelectors.externalDocs().get("url"); +}; + +const selectExternalDocsUrl = (0,external_reselect_namespaceObject.createSelector)( + (state, system) => system.specSelectors.url(), + (state, system) => system.oas3Selectors.selectedServer(), + (state, system) => system.specSelectors.selectExternalDocsUrlField(), + (specUrl, selectedServer, url) => { + if (url) { + return safeBuildUrl(url, specUrl, { selectedServer }); + } + + return undefined; + } +); + +const selectJsonSchemaDialectField = () => (system) => { + return system.specSelectors.specJson().get("jsonSchemaDialect"); +}; + +const selectJsonSchemaDialectDefault = () => +"https://spec.openapis.org/oas/3.1/dialect/base"; + +const selectSchemas = (0,external_reselect_namespaceObject.createSelector)( + (state, system) => system.specSelectors.definitions(), + (state, system) => + system.specSelectors.specResolvedSubtree(["components", "schemas"]), + + (rawSchemas, resolvedSchemas) => { + if (!external_immutable_namespaceObject.Map.isMap(rawSchemas)) return {}; + if (!external_immutable_namespaceObject.Map.isMap(resolvedSchemas)) return rawSchemas.toJS(); + + return Object.entries(rawSchemas.toJS()).reduce( + (acc, _ref3) => {let [schemaName, rawSchema] = _ref3; + const resolvedSchema = resolvedSchemas.get(schemaName); + acc[schemaName] = (resolvedSchema === null || resolvedSchema === void 0 ? void 0 : resolvedSchema.toJS()) || rawSchema; + return acc; + }, + {} + ); + } +); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/spec-extensions/wrap-selectors.js +/** + * @prettier + */ + + + +const wrap_selectors_isOAS3 = +(oriSelector, system) => +function (state) { + const isOAS31 = system.specSelectors.isOAS31();for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {args[_key - 1] = arguments[_key];} + return isOAS31 || oriSelector(...args); +}; + +const wrap_selectors_selectLicenseUrl = createOnlyOAS31SelectorWrapper( + () => (oriSelector, system) => { + return system.oas31Selectors.selectLicenseUrl(); + } +); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/selectors.js +/** + * @prettier + */ + + + + +const selectors_selectLicenseUrl = (0,external_reselect_namespaceObject.createSelector)( + (state, system) => system.specSelectors.url(), + (state, system) => system.oas3Selectors.selectedServer(), + (state, system) => system.specSelectors.selectLicenseUrlField(), + (state, system) => system.specSelectors.selectLicenseIdentifierField(), + (specUrl, selectedServer, url, identifier) => { + if (url) { + return safeBuildUrl(url, specUrl, { selectedServer }); + } + + if (identifier) { + return `https://spdx.org/licenses/${identifier}.html`; + } + + return undefined; + } +); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Example.jsx +/** + * @prettier + */ + + + +const Example_Example = (_ref) => {let { schema, getSystem } = _ref; + const { fn } = getSystem(); + const { hasKeyword, stringify } = fn.jsonSchema202012.useFn(); + + if (!hasKeyword(schema, "example")) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--example" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "Example" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const" }, + stringify(schema.example) + ) + )); + +}; + + + + + + +/* harmony default export */ const keywords_Example = (Example_Example); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Xml.jsx +/** + * @prettier + */ + + + + +const Xml = (_ref) => {let { schema, getSystem } = _ref; + const xml = (schema === null || schema === void 0 ? void 0 : schema.xml) || {}; + const { fn, getComponent } = getSystem(); + const { useIsExpandedDeeply, useComponent } = fn.jsonSchema202012; + const isExpandedDeeply = useIsExpandedDeeply(); + const isExpandable = !!(xml.name || xml.namespace || xml.prefix); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(false); + const Accordion = useComponent("Accordion"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + const JSONSchemaDeepExpansionContext = getComponent( + "JSONSchema202012DeepExpansionContext" + )(); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)((e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + }, []); + + /** + * Rendering. + */ + if (Object.keys(xml).length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--xml" }, + isExpandable ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "XML" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { + expanded: expanded, + onClick: handleExpansionDeep } + ) + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "XML" + + ), + + xml.attribute === true && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--muted" }, "attribute" + + ), + + xml.wrapped === true && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--muted" }, "wrapped" + + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("strong", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--primary" }, "object" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-keyword__children", { + "json-schema-2020-12-keyword__children--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + xml.name && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "name" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + xml.name + ) + ) + ), + + + xml.namespace && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "namespace" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + xml.namespace + ) + ) + ), + + + xml.prefix && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "prefix" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + xml.prefix + ) + ) + ) + + ) + + ) + ) + )); + +}; + + + + + + +/* harmony default export */ const keywords_Xml = (Xml); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Discriminator/DiscriminatorMapping.jsx +/** + * @prettier + */ + + + +const DiscriminatorMapping = (_ref) => {let { discriminator } = _ref; + const mapping = (discriminator === null || discriminator === void 0 ? void 0 : discriminator.mapping) || {}; + + if (Object.keys(mapping).length === 0) { + return null; + } + + return Object.entries(mapping).map((_ref2) => {let [key, value] = _ref2;return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { key: `${key}-${value}`, className: "json-schema-2020-12-keyword" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, + key + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + value + ) + ));} + ); +}; + + + + + + + +DiscriminatorMapping.defaultProps = { + mapping: undefined +}; + +/* harmony default export */ const Discriminator_DiscriminatorMapping = (DiscriminatorMapping); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Discriminator/Discriminator.jsx +/** + * @prettier + */ + + + + + + +const Discriminator = (_ref) => {let { schema, getSystem } = _ref; + const discriminator = (schema === null || schema === void 0 ? void 0 : schema.discriminator) || {}; + const { fn, getComponent } = getSystem(); + const { useIsExpandedDeeply, useComponent } = fn.jsonSchema202012; + const isExpandedDeeply = useIsExpandedDeeply(); + const isExpandable = !!discriminator.mapping; + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(false); + const Accordion = useComponent("Accordion"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + const JSONSchemaDeepExpansionContext = getComponent( + "JSONSchema202012DeepExpansionContext" + )(); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)((e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + }, []); + + /** + * Rendering. + */ + if (Object.keys(discriminator).length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--discriminator" }, + isExpandable ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "Discriminator" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { + expanded: expanded, + onClick: handleExpansionDeep } + ) + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "Discriminator" + + ), + + + discriminator.propertyName && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--muted" }, + discriminator.propertyName + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("strong", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--primary" }, "object" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-keyword__children", { + "json-schema-2020-12-keyword__children--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Discriminator_DiscriminatorMapping, { discriminator: discriminator }) + ) + + ) + ) + )); + +}; + + + + + + +/* harmony default export */ const Discriminator_Discriminator = (Discriminator); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/ExternalDocs.jsx +/** + * @prettier + */ + + + + + + +const ExternalDocs = (_ref) => {let { schema, getSystem } = _ref; + const externalDocs = (schema === null || schema === void 0 ? void 0 : schema.externalDocs) || {}; + const { fn, getComponent } = getSystem(); + const { useIsExpandedDeeply, useComponent } = fn.jsonSchema202012; + const isExpandedDeeply = useIsExpandedDeeply(); + const isExpandable = !!(externalDocs.description || externalDocs.url); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(false); + const Accordion = useComponent("Accordion"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + const KeywordDescription = getComponent("JSONSchema202012KeywordDescription"); + const Link = getComponent("Link"); + const JSONSchemaDeepExpansionContext = getComponent( + "JSONSchema202012DeepExpansionContext" + )(); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)((e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + }, []); + + /** + * Rendering. + */ + if (Object.keys(externalDocs).length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--externalDocs" }, + isExpandable ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "External documentation" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { + expanded: expanded, + onClick: handleExpansionDeep } + ) + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "External documentation" + + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("strong", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--primary" }, "object" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-keyword__children", { + "json-schema-2020-12-keyword__children--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + externalDocs.description && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordDescription, { + schema: externalDocs, + getSystem: getSystem } + ) + ), + + + externalDocs.url && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "url" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Link, { + target: "_blank", + href: sanitizeUrl(externalDocs.url) }, + + externalDocs.url + ) + ) + ) + ) + + ) + + ) + ) + )); + +}; + + + + + + +/* harmony default export */ const keywords_ExternalDocs = (ExternalDocs); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Description.jsx +/** + * @prettier + */ + + + +const Description = (_ref) => {let { schema, getSystem } = _ref; + if (!(schema !== null && schema !== void 0 && schema.description)) return null; + + const { getComponent } = getSystem(); + const MarkDown = getComponent("Markdown"); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--description" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(MarkDown, { source: schema.description }) + ) + )); + +}; + + + + + + +/* harmony default export */ const keywords_Description = (Description); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/wrap-components/keywords/Description.jsx +/** + * @prettier + */ + + + +const DescriptionWrapper = createOnlyOAS31ComponentWrapper(keywords_Description); + +/* harmony default export */ const wrap_components_keywords_Description = (DescriptionWrapper); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/wrap-components/keywords/Default.jsx +/** + * @prettier + */ + + + +const DefaultWrapper = createOnlyOAS31ComponentWrapper( + (_ref) => {let { schema, getSystem, originalComponent: KeywordDefault } = _ref; + const { getComponent } = getSystem(); + const KeywordDiscriminator = getComponent( + "JSONSchema202012KeywordDiscriminator" + ); + const KeywordXml = getComponent("JSONSchema202012KeywordXml"); + const KeywordExample = getComponent("JSONSchema202012KeywordExample"); + const KeywordExternalDocs = getComponent( + "JSONSchema202012KeywordExternalDocs" + ); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordDefault, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordDiscriminator, { schema: schema, getSystem: getSystem }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordXml, { schema: schema, getSystem: getSystem }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordExternalDocs, { schema: schema, getSystem: getSystem }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordExample, { schema: schema, getSystem: getSystem }) + )); + + } +); + +/* harmony default export */ const Default = (DefaultWrapper); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/components/keywords/Properties.jsx +/** + * @prettier + */ + + + + +const Properties = (_ref) => {let { schema, getSystem } = _ref; + const { fn } = getSystem(); + const { useComponent } = fn.jsonSchema202012; + const { getDependentRequired, getProperties } = fn.jsonSchema202012.useFn(); + const config = fn.jsonSchema202012.useConfig(); + const required = Array.isArray(schema === null || schema === void 0 ? void 0 : schema.required) ? schema.required : []; + const JSONSchema = useComponent("JSONSchema"); + const properties = getProperties(schema, config); + + /** + * Rendering. + */ + if (Object.keys(properties).length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--properties" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", null, + Object.entries(properties).map((_ref2) => {let [propertyName, propertySchema] = _ref2; + const isRequired = required.includes(propertyName); + const dependentRequired = getDependentRequired(propertyName, schema); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("li", { + key: propertyName, + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-property", { + "json-schema-2020-12-property--required": isRequired + }) }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(JSONSchema, { + name: propertyName, + schema: propertySchema, + dependentRequired: dependentRequired } + ) + )); + + }) + ) + )); + +}; + + + + + + +/* harmony default export */ const keywords_Properties = (Properties); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/json-schema-2020-12-extensions/wrap-components/keywords/Properties.jsx +/** + * @prettier + */ + + + +const PropertiesWrapper = createOnlyOAS31ComponentWrapper(keywords_Properties); + +/* harmony default export */ const wrap_components_keywords_Properties = (PropertiesWrapper); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/after-load.js +/** + * @prettier + */ + + + + +function afterLoad(_ref) {let { fn, getSystem } = _ref; + // overrides for fn.jsonSchema202012 + if (fn.jsonSchema202012) { + const isExpandable = makeIsExpandable( + fn.jsonSchema202012.isExpandable, + getSystem + ); + + Object.assign(this.fn.jsonSchema202012, { isExpandable, getProperties: getProperties }); + } + + // wraps schema generators from samples plugin and make them specific to OpenAPI 3.1 version + if (typeof fn.sampleFromSchema === "function" && fn.jsonSchema202012) { + const wrappedFns = wrapOAS31Fn( + { + sampleFromSchema: fn.jsonSchema202012.sampleFromSchema, + sampleFromSchemaGeneric: fn.jsonSchema202012.sampleFromSchemaGeneric, + createXMLExample: fn.jsonSchema202012.createXMLExample, + memoizedSampleFromSchema: fn.jsonSchema202012.memoizedSampleFromSchema, + memoizedCreateXMLExample: fn.jsonSchema202012.memoizedCreateXMLExample + }, + getSystem() + ); + + Object.assign(this.fn, wrappedFns); + } +} + +/* harmony default export */ const after_load = (afterLoad); +;// CONCATENATED MODULE: ./src/core/plugins/oas31/index.js +/** + * @prettier + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const OAS31Plugin = (_ref) => {let { fn } = _ref; + const createSystemSelector = fn.createSystemSelector || fn_createSystemSelector; + const createOnlyOAS31Selector = fn.createOnlyOAS31Selector || fn_createOnlyOAS31Selector; // prettier-ignore + + return { + afterLoad: after_load, + fn: { + isOAS31: isOAS31, + createSystemSelector: fn_createSystemSelector, + createOnlyOAS31Selector: fn_createOnlyOAS31Selector + }, + components: { + Webhooks: webhooks, + JsonSchemaDialect: json_schema_dialect, + OAS31Info: oas31_components_info, + OAS31License: components_license, + OAS31Contact: components_contact, + OAS31VersionPragmaFilter: version_pragma_filter, + OAS31Model: model_model, + OAS31Models: models, + JSONSchema202012KeywordExample: keywords_Example, + JSONSchema202012KeywordXml: keywords_Xml, + JSONSchema202012KeywordDiscriminator: Discriminator_Discriminator, + JSONSchema202012KeywordExternalDocs: keywords_ExternalDocs + }, + wrapComponents: { + InfoContainer: wrap_components_info, + License: wrap_components_license, + Contact: wrap_components_contact, + VersionPragmaFilter: wrap_components_version_pragma_filter, + Model: wrap_components_model, + Models: wrap_components_models, + JSONSchema202012KeywordDescription: + wrap_components_keywords_Description, + JSONSchema202012KeywordDefault: Default, + JSONSchema202012KeywordProperties: + wrap_components_keywords_Properties + }, + statePlugins: { + spec: { + selectors: { + isOAS31: createSystemSelector(selectors_isOAS31), + + license: selectors_license, + selectLicenseNameField: selectLicenseNameField, + selectLicenseUrlField: selectLicenseUrlField, + selectLicenseIdentifierField: createOnlyOAS31Selector(selectLicenseIdentifierField), // prettier-ignore + selectLicenseUrl: createSystemSelector(selectLicenseUrl), + + contact: selectors_contact, + selectContactNameField: selectContactNameField, + selectContactEmailField: selectContactEmailField, + selectContactUrlField: selectContactUrlField, + selectContactUrl: createSystemSelector(selectContactUrl), + + selectInfoTitleField: selectInfoTitleField, + selectInfoSummaryField: createOnlyOAS31Selector(selectInfoSummaryField), // prettier-ignore + selectInfoDescriptionField: selectInfoDescriptionField, + selectInfoTermsOfServiceField: selectInfoTermsOfServiceField, + selectInfoTermsOfServiceUrl: createSystemSelector(selectInfoTermsOfServiceUrl), // prettier-ignore + + selectExternalDocsDescriptionField: selectExternalDocsDescriptionField, + selectExternalDocsUrlField: selectExternalDocsUrlField, + selectExternalDocsUrl: createSystemSelector(selectExternalDocsUrl), + + webhooks: createOnlyOAS31Selector(selectors_webhooks), + selectWebhooksOperations: createOnlyOAS31Selector(createSystemSelector(selectWebhooksOperations)), // prettier-ignore + + selectJsonSchemaDialectField: selectJsonSchemaDialectField, + selectJsonSchemaDialectDefault: selectJsonSchemaDialectDefault, + + selectSchemas: createSystemSelector(selectSchemas) + }, + wrapSelectors: { + isOAS3: wrap_selectors_isOAS3, + selectLicenseUrl: wrap_selectors_selectLicenseUrl + } + }, + oas31: { + selectors: { + selectLicenseUrl: createOnlyOAS31Selector(createSystemSelector(selectors_selectLicenseUrl)) // prettier-ignore + } + } + } + }; +}; + +/* harmony default export */ const oas31 = (OAS31Plugin); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/prop-types.js +/** + * @prettier + */ + + +const objectSchema = external_prop_types_namespaceObject["default"].object; + +const booleanSchema = external_prop_types_namespaceObject["default"].bool; + +const schema = external_prop_types_namespaceObject["default"].oneOfType([objectSchema, booleanSchema]); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/context.js +/** + * @prettier + */ + + +const JSONSchemaContext = /*#__PURE__*/(0,external_react_namespaceObject.createContext)(null); +JSONSchemaContext.displayName = "JSONSchemaContext"; + +const JSONSchemaLevelContext = /*#__PURE__*/(0,external_react_namespaceObject.createContext)(0); +JSONSchemaLevelContext.displayName = "JSONSchemaLevelContext"; + +const JSONSchemaDeepExpansionContext = /*#__PURE__*/(0,external_react_namespaceObject.createContext)(false); +JSONSchemaDeepExpansionContext.displayName = "JSONSchemaDeepExpansionContext"; + +const JSONSchemaCyclesContext = /*#__PURE__*/(0,external_react_namespaceObject.createContext)(new Set()); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/hooks.js +/** + * @prettier + */ + + + + + +const useConfig = () => { + const { config } = (0,external_react_namespaceObject.useContext)(JSONSchemaContext); + return config; +}; + +const useComponent = (componentName) => { + const { components } = (0,external_react_namespaceObject.useContext)(JSONSchemaContext); + return components[componentName] || null; +}; + +const useFn = function () {let fnName = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; + const { fn } = (0,external_react_namespaceObject.useContext)(JSONSchemaContext); + + return typeof fnName !== "undefined" ? fn[fnName] : fn; +}; + +const useLevel = () => { + const level = (0,external_react_namespaceObject.useContext)(JSONSchemaLevelContext); + + return [level, level + 1]; +}; + +const useIsEmbedded = () => { + const [level] = useLevel(); + + return level > 0; +}; + +const useIsExpanded = () => { + const [level] = useLevel(); + const { defaultExpandedLevels } = useConfig(); + + return defaultExpandedLevels - level > 0; +}; + +const useIsExpandedDeeply = () => { + return (0,external_react_namespaceObject.useContext)(JSONSchemaDeepExpansionContext); +}; + +const useRenderedSchemas = function () {let schema = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined; + if (typeof schema === "undefined") { + return (0,external_react_namespaceObject.useContext)(JSONSchemaCyclesContext); + } + + const renderedSchemas = (0,external_react_namespaceObject.useContext)(JSONSchemaCyclesContext); + return new Set([...renderedSchemas, schema]); +}; +const useIsCircular = (schema) => { + const renderedSchemas = useRenderedSchemas(); + return renderedSchemas.has(schema); +}; +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/JSONSchema/JSONSchema.jsx +/** + * @prettier + */ + + + + + + + + + + +const JSONSchema = /*#__PURE__*/(0,external_react_namespaceObject.forwardRef)( + (_ref, ref) => {let { schema, name, dependentRequired, onExpand } = _ref; + const fn = useFn(); + const isExpanded = useIsExpanded(); + const isExpandedDeeply = useIsExpandedDeeply(); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpanded || isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [level, nextLevel] = useLevel(); + const isEmbedded = useIsEmbedded(); + const isExpandable = fn.isExpandable(schema) || dependentRequired.length > 0; + const isCircular = useIsCircular(schema); + const renderedSchemas = useRenderedSchemas(schema); + const constraints = fn.stringifyConstraints(schema); + const Accordion = useComponent("Accordion"); + const Keyword$schema = useComponent("Keyword$schema"); + const Keyword$vocabulary = useComponent("Keyword$vocabulary"); + const Keyword$id = useComponent("Keyword$id"); + const Keyword$anchor = useComponent("Keyword$anchor"); + const Keyword$dynamicAnchor = useComponent("Keyword$dynamicAnchor"); + const Keyword$ref = useComponent("Keyword$ref"); + const Keyword$dynamicRef = useComponent("Keyword$dynamicRef"); + const Keyword$defs = useComponent("Keyword$defs"); + const Keyword$comment = useComponent("Keyword$comment"); + const KeywordAllOf = useComponent("KeywordAllOf"); + const KeywordAnyOf = useComponent("KeywordAnyOf"); + const KeywordOneOf = useComponent("KeywordOneOf"); + const KeywordNot = useComponent("KeywordNot"); + const KeywordIf = useComponent("KeywordIf"); + const KeywordThen = useComponent("KeywordThen"); + const KeywordElse = useComponent("KeywordElse"); + const KeywordDependentSchemas = useComponent("KeywordDependentSchemas"); + const KeywordPrefixItems = useComponent("KeywordPrefixItems"); + const KeywordItems = useComponent("KeywordItems"); + const KeywordContains = useComponent("KeywordContains"); + const KeywordProperties = useComponent("KeywordProperties"); + const KeywordPatternProperties = useComponent("KeywordPatternProperties"); + const KeywordAdditionalProperties = useComponent( + "KeywordAdditionalProperties" + ); + const KeywordPropertyNames = useComponent("KeywordPropertyNames"); + const KeywordUnevaluatedItems = useComponent("KeywordUnevaluatedItems"); + const KeywordUnevaluatedProperties = useComponent( + "KeywordUnevaluatedProperties" + ); + const KeywordType = useComponent("KeywordType"); + const KeywordEnum = useComponent("KeywordEnum"); + const KeywordConst = useComponent("KeywordConst"); + const KeywordConstraint = useComponent("KeywordConstraint"); + const KeywordDependentRequired = useComponent("KeywordDependentRequired"); + const KeywordContentSchema = useComponent("KeywordContentSchema"); + const KeywordTitle = useComponent("KeywordTitle"); + const KeywordDescription = useComponent("KeywordDescription"); + const KeywordDefault = useComponent("KeywordDefault"); + const KeywordDeprecated = useComponent("KeywordDeprecated"); + const KeywordReadOnly = useComponent("KeywordReadOnly"); + const KeywordWriteOnly = useComponent("KeywordWriteOnly"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + + /** + * Effects handlers. + */ + (0,external_react_namespaceObject.useEffect)(() => { + setExpandedDeeply(isExpandedDeeply); + }, [isExpandedDeeply]); + + (0,external_react_namespaceObject.useEffect)(() => { + setExpandedDeeply(expandedDeeply); + }, [expandedDeeply]); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)( + (e, expandedNew) => { + setExpanded(expandedNew); + !expandedNew && setExpandedDeeply(false); + onExpand(e, expandedNew, false); + }, + [onExpand] + ); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)( + (e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + onExpand(e, expandedDeepNew, true); + }, + [onExpand] + ); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaLevelContext.Provider, { value: nextLevel }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchemaCyclesContext.Provider, { value: renderedSchemas }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("article", { + ref: ref, + "data-json-schema-level": level, + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12", { + "json-schema-2020-12--embedded": isEmbedded, + "json-schema-2020-12--circular": isCircular + }) }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-head" }, + isExpandable && !isCircular ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordTitle, { title: name, schema: schema }) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { + expanded: expanded, + onClick: handleExpansionDeep } + ) + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(KeywordTitle, { title: name, schema: schema }), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(KeywordDeprecated, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordReadOnly, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordWriteOnly, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordType, { schema: schema, isCircular: isCircular }), + constraints.length > 0 && + constraints.map((constraint) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordConstraint, { + key: `${constraint.scope}-${constraint.value}`, + constraint: constraint } + ) + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-body", { + "json-schema-2020-12-body--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordDescription, { schema: schema }), + !isCircular && isExpandable && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordProperties, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordPatternProperties, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordAdditionalProperties, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordUnevaluatedProperties, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordPropertyNames, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordAllOf, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordAnyOf, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordOneOf, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordNot, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordIf, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordThen, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordElse, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordDependentSchemas, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordPrefixItems, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordItems, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordUnevaluatedItems, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordContains, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordContentSchema, { schema: schema }) + ), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(KeywordEnum, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordConst, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordDependentRequired, { + schema: schema, + dependentRequired: dependentRequired } + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordDefault, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Keyword$schema, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Keyword$vocabulary, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Keyword$id, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Keyword$anchor, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Keyword$dynamicAnchor, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Keyword$ref, { schema: schema }), + !isCircular && isExpandable && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Keyword$defs, { schema: schema }), /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(Keyword$dynamicRef, { schema: schema }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Keyword$comment, { schema: schema }) + ) + + ) + ) + ) + ) + )); + + } +); + + + + + + + + +JSONSchema.defaultProps = { + name: "", + dependentRequired: [], + onExpand: () => {} +}; + +/* harmony default export */ const JSONSchema_JSONSchema = (JSONSchema); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/$schema.jsx +/** + * @prettier + */ + + + + +const $schema = (_ref) => {let { schema } = _ref; + if (!(schema !== null && schema !== void 0 && schema.$schema)) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--$schema" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "$schema" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + schema.$schema + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_$schema = ($schema); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/$vocabulary/$vocabulary.jsx +/** + * @prettier + */ + + + + + + +const $vocabulary = (_ref) => {let { schema } = _ref; + const isExpandedDeeply = useIsExpandedDeeply(); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const Accordion = useComponent("Accordion"); + + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + + /** + * Rendering. + */ + if (!(schema !== null && schema !== void 0 && schema.$vocabulary)) return null; + if (typeof schema.$vocabulary !== "object") return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--$vocabulary" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "$vocabulary" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("strong", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--primary" }, "object" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", null, + expanded && + Object.entries(schema.$vocabulary).map((_ref2) => {let [uri, enabled] = _ref2;return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("li", { + key: uri, + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-$vocabulary-uri", { + "json-schema-2020-12-$vocabulary-uri--disabled": !enabled + }) }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + uri + ) + ));} + ) + ) + )); + +}; + + + + + +/* harmony default export */ const $vocabulary_$vocabulary = ($vocabulary); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/$id.jsx +/** + * @prettier + */ + + + + +const $id = (_ref) => {let { schema } = _ref; + if (!(schema !== null && schema !== void 0 && schema.$id)) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--$id" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "$id" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + schema.$id + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_$id = ($id); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/$anchor.jsx +/** + * @prettier + */ + + + + +const $anchor = (_ref) => {let { schema } = _ref; + if (!(schema !== null && schema !== void 0 && schema.$anchor)) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--$anchor" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "$anchor" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + schema.$anchor + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_$anchor = ($anchor); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/$dynamicAnchor.jsx +/** + * @prettier + */ + + + + +const $dynamicAnchor = (_ref) => {let { schema } = _ref; + if (!(schema !== null && schema !== void 0 && schema.$dynamicAnchor)) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicAnchor" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "$dynamicAnchor" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + schema.$dynamicAnchor + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_$dynamicAnchor = ($dynamicAnchor); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/$ref.jsx +/** + * @prettier + */ + + + + +const $ref = (_ref) => {let { schema } = _ref; + if (!(schema !== null && schema !== void 0 && schema.$ref)) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--$ref" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "$ref" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + schema.$ref + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_$ref = ($ref); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/$dynamicRef.jsx +/** + * @prettier + */ + + + + +const $dynamicRef = (_ref) => {let { schema } = _ref; + if (!(schema !== null && schema !== void 0 && schema.$dynamicRef)) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--$dynamicRef" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "$dynamicRef" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + schema.$dynamicRef + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_$dynamicRef = ($dynamicRef); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/$defs.jsx +/** + * @prettier + */ + + + + + + + +const $defs = (_ref) => {let { schema } = _ref; + const $defs = (schema === null || schema === void 0 ? void 0 : schema.$defs) || {}; + const isExpandedDeeply = useIsExpandedDeeply(); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(false); + const Accordion = useComponent("Accordion"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + const JSONSchema = useComponent("JSONSchema"); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)((e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + }, []); + + /** + * Rendering. + */ + if (Object.keys($defs).length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--$defs" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "$defs" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { expanded: expanded, onClick: handleExpansionDeep }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("strong", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--primary" }, "object" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-keyword__children", { + "json-schema-2020-12-keyword__children--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + Object.entries($defs).map((_ref2) => {let [schemaName, schema] = _ref2;return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("li", { key: schemaName, className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: schemaName, schema: schema }) + ));} + ) + ) + + ) + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_$defs = ($defs); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/$comment.jsx +/** + * @prettier + */ + + + + +const $comment = (_ref) => {let { schema } = _ref; + if (!(schema !== null && schema !== void 0 && schema.$comment)) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--$comment" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--secondary" }, "$comment" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--secondary" }, + schema.$comment + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_$comment = ($comment); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/AllOf.jsx +/** + * @prettier + */ + + + + + + + +const AllOf = (_ref) => {let { schema } = _ref; + const allOf = (schema === null || schema === void 0 ? void 0 : schema.allOf) || []; + const fn = useFn(); + const isExpandedDeeply = useIsExpandedDeeply(); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(false); + const Accordion = useComponent("Accordion"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + const JSONSchema = useComponent("JSONSchema"); + const KeywordType = useComponent("KeywordType"); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)((e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + }, []); + + /** + * Rendering. + */ + if (!Array.isArray(allOf) || allOf.length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--allOf" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "All of" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { expanded: expanded, onClick: handleExpansionDeep }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordType, { schema: { allOf } }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-keyword__children", { + "json-schema-2020-12-keyword__children--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + allOf.map((schema, index) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { key: `#${index}`, className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { + name: `#${index} ${fn.getTitle(schema)}`, + schema: schema } + ) + ) + ) + ) + + ) + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_AllOf = (AllOf); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/AnyOf.jsx +/** + * @prettier + */ + + + + + + + +const AnyOf = (_ref) => {let { schema } = _ref; + const anyOf = (schema === null || schema === void 0 ? void 0 : schema.anyOf) || []; + const fn = useFn(); + const isExpandedDeeply = useIsExpandedDeeply(); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(false); + const Accordion = useComponent("Accordion"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + const JSONSchema = useComponent("JSONSchema"); + const KeywordType = useComponent("KeywordType"); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)((e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + }, []); + + /** + * Rendering. + */ + if (!Array.isArray(anyOf) || anyOf.length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--anyOf" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Any of" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { expanded: expanded, onClick: handleExpansionDeep }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordType, { schema: { anyOf } }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-keyword__children", { + "json-schema-2020-12-keyword__children--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + anyOf.map((schema, index) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { key: `#${index}`, className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { + name: `#${index} ${fn.getTitle(schema)}`, + schema: schema } + ) + ) + ) + ) + + ) + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_AnyOf = (AnyOf); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/OneOf.jsx +/** + * @prettier + */ + + + + + + + +const OneOf = (_ref) => {let { schema } = _ref; + const oneOf = (schema === null || schema === void 0 ? void 0 : schema.oneOf) || []; + const fn = useFn(); + const isExpandedDeeply = useIsExpandedDeeply(); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(false); + const Accordion = useComponent("Accordion"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + const JSONSchema = useComponent("JSONSchema"); + const KeywordType = useComponent("KeywordType"); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)((e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + }, []); + + /** + * Rendering. + */ + if (!Array.isArray(oneOf) || oneOf.length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--oneOf" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "One of" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { expanded: expanded, onClick: handleExpansionDeep }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordType, { schema: { oneOf } }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-keyword__children", { + "json-schema-2020-12-keyword__children--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + oneOf.map((schema, index) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { key: `#${index}`, className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { + name: `#${index} ${fn.getTitle(schema)}`, + schema: schema } + ) + ) + ) + ) + + ) + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_OneOf = (OneOf); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Not.jsx +/** + * @prettier + */ + + + + + +const Not = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "not")) return null; + + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Not" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--not" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: schema.not }) + )); + +}; + + + + + +/* harmony default export */ const keywords_Not = (Not); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/If.jsx +/** + * @prettier + */ + + + + + +const If = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "if")) return null; + + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "If" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--if" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: schema.if }) + )); + +}; + + + + + +/* harmony default export */ const keywords_If = (If); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Then.jsx +/** + * @prettier + */ + + + + + +const Then = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "then")) return null; + + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Then" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--then" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: schema.then }) + )); + +}; + + + + + +/* harmony default export */ const keywords_Then = (Then); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Else.jsx +/** + * @prettier + */ + + + + + +const Else = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "else")) return null; + + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Else" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--if" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: schema.else }) + )); + +}; + + + + + +/* harmony default export */ const keywords_Else = (Else); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/DependentSchemas.jsx +/** + * @prettier + */ + + + + + + + +const DependentSchemas = (_ref) => {let { schema } = _ref; + const dependentSchemas = (schema === null || schema === void 0 ? void 0 : schema.dependentSchemas) || []; + const isExpandedDeeply = useIsExpandedDeeply(); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(false); + const Accordion = useComponent("Accordion"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + const JSONSchema = useComponent("JSONSchema"); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)((e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + }, []); + + /** + * Rendering. + */ + if (typeof dependentSchemas !== "object") return null; + if (Object.keys(dependentSchemas).length === 0) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentSchemas" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Dependent schemas" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { expanded: expanded, onClick: handleExpansionDeep }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("strong", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--primary" }, "object" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-keyword__children", { + "json-schema-2020-12-keyword__children--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + Object.entries(dependentSchemas).map((_ref2) => {let [schemaName, schema] = _ref2;return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("li", { key: schemaName, className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: schemaName, schema: schema }) + ));} + ) + ) + + ) + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_DependentSchemas = (DependentSchemas); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/PrefixItems.jsx +/** + * @prettier + */ + + + + + + + +const PrefixItems = (_ref) => {let { schema } = _ref; + const prefixItems = (schema === null || schema === void 0 ? void 0 : schema.prefixItems) || []; + const fn = useFn(); + const isExpandedDeeply = useIsExpandedDeeply(); + const [expanded, setExpanded] = (0,external_react_namespaceObject.useState)(isExpandedDeeply); + const [expandedDeeply, setExpandedDeeply] = (0,external_react_namespaceObject.useState)(false); + const Accordion = useComponent("Accordion"); + const ExpandDeepButton = useComponent("ExpandDeepButton"); + const JSONSchema = useComponent("JSONSchema"); + const KeywordType = useComponent("KeywordType"); + + /** + * Event handlers. + */ + const handleExpansion = (0,external_react_namespaceObject.useCallback)(() => { + setExpanded((prev) => !prev); + }, []); + const handleExpansionDeep = (0,external_react_namespaceObject.useCallback)((e, expandedDeepNew) => { + setExpanded(expandedDeepNew); + setExpandedDeeply(expandedDeepNew); + }, []); + + /** + * Rendering. + */ + if (!Array.isArray(prefixItems) || prefixItems.length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement(JSONSchemaDeepExpansionContext.Provider, { value: expandedDeeply }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--prefixItems" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Accordion, { expanded: expanded, onChange: handleExpansion }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Prefix items" + + ) + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(ExpandDeepButton, { expanded: expanded, onClick: handleExpansionDeep }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(KeywordType, { schema: { prefixItems } }), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-keyword__children", { + "json-schema-2020-12-keyword__children--collapsed": !expanded + }) }, + + expanded && /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + prefixItems.map((schema, index) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { key: `#${index}`, className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { + name: `#${index} ${fn.getTitle(schema)}`, + schema: schema } + ) + ) + ) + ) + + ) + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_PrefixItems = (PrefixItems); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Items.jsx +/** + * @prettier + */ + + + + + +const Items = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "items")) return null; + + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Items" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--items" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: schema.items }) + )); + +}; + + + + + +/* harmony default export */ const keywords_Items = (Items); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Contains.jsx +/** + * @prettier + */ + + + + + +const Contains = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "contains")) return null; + + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Contains" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--contains" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: schema.contains }) + )); + +}; + + + + + +/* harmony default export */ const keywords_Contains = (Contains); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Properties/Properties.jsx +/** + * @prettier + */ + + + + + + +const Properties_Properties = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const properties = (schema === null || schema === void 0 ? void 0 : schema.properties) || {}; + const required = Array.isArray(schema === null || schema === void 0 ? void 0 : schema.required) ? schema.required : []; + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (Object.keys(properties).length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--properties" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", null, + Object.entries(properties).map((_ref2) => {let [propertyName, propertySchema] = _ref2; + const isRequired = required.includes(propertyName); + const dependentRequired = fn.getDependentRequired( + propertyName, + schema + ); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("li", { + key: propertyName, + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-property", { + "json-schema-2020-12-property--required": isRequired + }) }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(JSONSchema, { + name: propertyName, + schema: propertySchema, + dependentRequired: dependentRequired } + ) + )); + + }) + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_Properties_Properties = (Properties_Properties); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/PatternProperties/PatternProperties.jsx +/** + * @prettier + */ + + + + + +const PatternProperties = (_ref) => {let { schema } = _ref; + const patternProperties = (schema === null || schema === void 0 ? void 0 : schema.patternProperties) || {}; + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (Object.keys(patternProperties).length === 0) { + return null; + } + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--patternProperties" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", null, + Object.entries(patternProperties).map((_ref2) => {let [propertyName, schema] = _ref2;return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("li", { key: propertyName, className: "json-schema-2020-12-property" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: propertyName, schema: schema }) + ));} + ) + ) + )); + +}; + + + + + +/* harmony default export */ const PatternProperties_PatternProperties = (PatternProperties); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/AdditionalProperties.jsx +/** + * @prettier + */ + + + + + +const AdditionalProperties = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const { additionalProperties } = schema; + const JSONSchema = useComponent("JSONSchema"); + + if (!fn.hasKeyword(schema, "additionalProperties")) return null; + + /** + * Rendering. + */ + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Additional properties" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--additionalProperties" }, + additionalProperties === true ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + name, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--primary" }, "allowed" + + ) + ) : + additionalProperties === false ? /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(external_react_namespaceObject["default"].Fragment, null, + name, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--primary" }, "forbidden" + + ) + ) : /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: additionalProperties }) + + )); + +}; + + + + + +/* harmony default export */ const keywords_AdditionalProperties = (AdditionalProperties); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/PropertyNames.jsx +/** + * @prettier + */ + + + + + +const PropertyNames = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const { propertyNames } = schema; + const JSONSchema = useComponent("JSONSchema"); + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Property names" + + ); + + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "propertyNames")) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--propertyNames" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: propertyNames }) + )); + +}; + + + + + +/* harmony default export */ const keywords_PropertyNames = (PropertyNames); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/UnevaluatedItems.jsx +/** + * @prettier + */ + + + + + +const UnevaluatedItems = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const { unevaluatedItems } = schema; + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "unevaluatedItems")) return null; + + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Unevaluated items" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedItems" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: unevaluatedItems }) + )); + +}; + + + + + +/* harmony default export */ const keywords_UnevaluatedItems = (UnevaluatedItems); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/UnevaluatedProperties.jsx +/** + * @prettier + */ + + + + + +const UnevaluatedProperties = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const { unevaluatedProperties } = schema; + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "unevaluatedProperties")) return null; + + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Unevaluated properties" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--unevaluatedProperties" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: unevaluatedProperties }) + )); + +}; + + + + + +/* harmony default export */ const keywords_UnevaluatedProperties = (UnevaluatedProperties); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Type.jsx +/** + * @prettier + */ + + + + + + +const Type = (_ref) => {let { schema, isCircular } = _ref; + const fn = useFn(); + const type = fn.getType(schema); + const circularSuffix = isCircular ? " [circular]" : ""; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("strong", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--primary" }, + `${type}${circularSuffix}` + )); + +}; + + + + + + +Type.defaultProps = { + isCircular: false +}; + +/* harmony default export */ const keywords_Type = (Type); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Enum/Enum.jsx +/** + * @prettier + */ + + + + + +const Enum = (_ref) => {let { schema } = _ref; + const fn = useFn(); + + if (!Array.isArray(schema === null || schema === void 0 ? void 0 : schema.enum)) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--enum" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Allowed values" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", null, + schema.enum.map((element) => { + const strigifiedElement = fn.stringify(element); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("li", { key: strigifiedElement }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const" }, + strigifiedElement + ) + )); + + }) + ) + )); + +}; + + + + + +/* harmony default export */ const Enum_Enum = (Enum); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Const.jsx +/** + * @prettier + */ + + + + + +const Const = (_ref) => {let { schema } = _ref; + const fn = useFn(); + + if (!fn.hasKeyword(schema, "const")) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--const" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Const" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const" }, + fn.stringify(schema.const) + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_Const = (Const); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Constraint/Constraint.jsx +/** + * @prettier + */ + + + +/** + * This component represents various constraint keywords + * from JSON Schema 2020-12 validation vocabulary. + */ +const Constraint = (_ref) => {let { constraint } = _ref;return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { + className: `json-schema-2020-12__constraint json-schema-2020-12__constraint--${constraint.scope}` }, + + constraint.value + ));}; + + + + + + + + + +/* harmony default export */ const Constraint_Constraint = (/*#__PURE__*/external_react_namespaceObject["default"].memo(Constraint)); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/DependentRequired/DependentRequired.jsx +/** + * @prettier + */ + + + + + +const DependentRequired = (_ref) => {let { dependentRequired } = _ref; + if (dependentRequired.length === 0) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--dependentRequired" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Required when defined" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("ul", null, + dependentRequired.map((propertyName) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("li", { key: propertyName }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--warning" }, + propertyName + ) + ) + ) + ) + )); + +}; + + + + + + +/* harmony default export */ const DependentRequired_DependentRequired = (DependentRequired); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/ContentSchema.jsx +/** + * @prettier + */ + + + + + +const ContentSchema = (_ref) => {let { schema } = _ref; + const fn = useFn(); + const JSONSchema = useComponent("JSONSchema"); + + /** + * Rendering. + */ + if (!fn.hasKeyword(schema, "contentSchema")) return null; + + const name = /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Content schema" + + ); + + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--contentSchema" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchema, { name: name, schema: schema.contentSchema }) + )); + +}; + + + + + +/* harmony default export */ const keywords_ContentSchema = (ContentSchema); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Title/Title.jsx +/** + * @prettier + */ + + + + + + +const Title = (_ref) => {let { title, schema } = _ref; + const fn = useFn(); + const renderedTitle = title || fn.getTitle(schema); + + if (!renderedTitle) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12__title" }, + title || fn.getTitle(schema) + )); + +}; + + + + + + +Title.defaultProps = { + title: "" +}; + +/* harmony default export */ const Title_Title = (Title); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Description/Description.jsx +/** + * @prettier + */ + + + + +const Description_Description = (_ref) => {let { schema } = _ref; + if (!(schema !== null && schema !== void 0 && schema.description)) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--description" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-core-keyword__value json-schema-2020-12-core-keyword__value--secondary" }, + schema.description + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_Description_Description = (Description_Description); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Default.jsx +/** + * @prettier + */ + + + + + +const Default_Default = (_ref) => {let { schema } = _ref; + const fn = useFn(); + + if (!fn.hasKeyword(schema, "default")) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-keyword json-schema-2020-12-keyword--default" }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__name json-schema-2020-12-keyword__name--primary" }, "Default" + + ), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12-keyword__value json-schema-2020-12-keyword__value--const" }, + fn.stringify(schema.default) + ) + )); + +}; + + + + + +/* harmony default export */ const keywords_Default = (Default_Default); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/Deprecated.jsx +/** + * @prettier + */ + + + + +const Deprecated = (_ref) => {let { schema } = _ref; + if ((schema === null || schema === void 0 ? void 0 : schema.deprecated) !== true) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--warning" }, "deprecated" + + )); + +}; + + + + + +/* harmony default export */ const keywords_Deprecated = (Deprecated); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/ReadOnly.jsx +/** + * @prettier + */ + + + + +const ReadOnly = (_ref) => {let { schema } = _ref; + if ((schema === null || schema === void 0 ? void 0 : schema.readOnly) !== true) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--muted" }, "read-only" + + )); + +}; + + + + + +/* harmony default export */ const keywords_ReadOnly = (ReadOnly); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/keywords/WriteOnly.jsx +/** + * @prettier + */ + + + + +const WriteOnly = (_ref) => {let { schema } = _ref; + if ((schema === null || schema === void 0 ? void 0 : schema.writeOnly) !== true) return null; + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("span", { className: "json-schema-2020-12__attribute json-schema-2020-12__attribute--muted" }, "write-only" + + )); + +}; + + + + + +/* harmony default export */ const keywords_WriteOnly = (WriteOnly); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/Accordion/Accordion.jsx +/** + * @prettier + */ + + + + + + +const Accordion = (_ref) => {let { expanded, children, onChange } = _ref; + const ChevronRightIcon = useComponent("ChevronRightIcon"); + + const handleExpansion = (0,external_react_namespaceObject.useCallback)( + (event) => { + onChange(event, !expanded); + }, + [expanded, onChange] + ); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("button", { + type: "button", + className: "json-schema-2020-12-accordion", + onClick: handleExpansion }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement("div", { className: "json-schema-2020-12-accordion__children" }, children), /*#__PURE__*/ + external_react_namespaceObject["default"].createElement("span", { + className: (0,external_classnames_namespaceObject["default"])("json-schema-2020-12-accordion__icon", { + "json-schema-2020-12-accordion__icon--expanded": expanded, + "json-schema-2020-12-accordion__icon--collapsed": !expanded + }) }, /*#__PURE__*/ + + external_react_namespaceObject["default"].createElement(ChevronRightIcon, null) + ) + )); + +}; + + + + + + + +Accordion.defaultProps = { + expanded: false +}; + +/* harmony default export */ const Accordion_Accordion = (Accordion); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/ExpandDeepButton/ExpandDeepButton.jsx +/** + * @prettier + */ + + + +const ExpandDeepButton = (_ref) => {let { expanded, onClick } = _ref; + const handleExpansion = (0,external_react_namespaceObject.useCallback)( + (event) => { + onClick(event, !expanded); + }, + [expanded, onClick] + ); + + return /*#__PURE__*/( + external_react_namespaceObject["default"].createElement("button", { + type: "button", + className: "json-schema-2020-12-expand-deep-button", + onClick: handleExpansion }, + + expanded ? "Collapse all" : "Expand all" + )); + +}; + + + + + + +/* harmony default export */ const ExpandDeepButton_ExpandDeepButton = (ExpandDeepButton); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/components/icons/ChevronRight.jsx +/** + * @prettier + */ + + +const ChevronRight = () => /*#__PURE__*/ +external_react_namespaceObject["default"].createElement("svg", { + xmlns: "http://www.w3.org/2000/svg", + width: "24", + height: "24", + viewBox: "0 0 24 24" }, /*#__PURE__*/ + +external_react_namespaceObject["default"].createElement("path", { d: "M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z" }) +); + + +/* harmony default export */ const icons_ChevronRight = (ChevronRight); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/fn.js +/** + * @prettier + */ + + +const fn_upperFirst = (value) => { + if (typeof value === "string") { + return `${value.charAt(0).toUpperCase()}${value.slice(1)}`; + } + return value; +}; + +const getTitle = (schema) => { + const fn = useFn(); + + if (schema !== null && schema !== void 0 && schema.title) return fn.upperFirst(schema.title); + if (schema !== null && schema !== void 0 && schema.$anchor) return fn.upperFirst(schema.$anchor); + if (schema !== null && schema !== void 0 && schema.$id) return schema.$id; + + return ""; +}; + +const getType = function (schema) {let processedSchemas = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new WeakSet(); + const fn = useFn(); + + if (schema == null) { + return "any"; + } + + if (fn.isBooleanJSONSchema(schema)) { + return schema ? "any" : "never"; + } + + if (typeof schema !== "object") { + return "any"; + } + + if (processedSchemas.has(schema)) { + return "any"; // detect a cycle + } + processedSchemas.add(schema); + + const { type, prefixItems, items } = schema; + + const getArrayType = () => { + if (Array.isArray(prefixItems)) { + const prefixItemsTypes = prefixItems.map((itemSchema) => + getType(itemSchema, processedSchemas) + ); + const itemsType = items ? getType(items, processedSchemas) : "any"; + return `array<[${prefixItemsTypes.join(", ")}], ${itemsType}>`; + } else if (items) { + const itemsType = getType(items, processedSchemas); + return `array<${itemsType}>`; + } else { + return "array"; + } + }; + + const inferType = () => { + if ( + Object.hasOwn(schema, "prefixItems") || + Object.hasOwn(schema, "items") || + Object.hasOwn(schema, "contains")) + { + return getArrayType(); + } else if ( + Object.hasOwn(schema, "properties") || + Object.hasOwn(schema, "additionalProperties") || + Object.hasOwn(schema, "patternProperties")) + { + return "object"; + } else if (["int32", "int64"].includes(schema.format)) { + // OpenAPI 3.1.0 integer custom formats + return "integer"; + } else if (["float", "double"].includes(schema.format)) { + // OpenAPI 3.1.0 number custom formats + return "number"; + } else if ( + Object.hasOwn(schema, "minimum") || + Object.hasOwn(schema, "maximum") || + Object.hasOwn(schema, "exclusiveMinimum") || + Object.hasOwn(schema, "exclusiveMaximum") || + Object.hasOwn(schema, "multipleOf")) + { + return "number | integer"; + } else if ( + Object.hasOwn(schema, "pattern") || + Object.hasOwn(schema, "format") || + Object.hasOwn(schema, "minLength") || + Object.hasOwn(schema, "maxLength")) + { + return "string"; + } else if (typeof schema.const !== "undefined") { + if (schema.const === null) { + return "null"; + } else if (typeof schema.const === "boolean") { + return "boolean"; + } else if (typeof schema.const === "number") { + return Number.isInteger(schema.const) ? "integer" : "number"; + } else if (typeof schema.const === "string") { + return "string"; + } else if (Array.isArray(schema.const)) { + return "array"; + } else if (typeof schema.const === "object") { + return "object"; + } + } + return null; + }; + + if (schema.not && getType(schema.not) === "any") { + return "never"; + } + + const typeString = Array.isArray(type) ? + type.map((t) => t === "array" ? getArrayType() : t).join(" | ") : + type === "array" ? + getArrayType() : + [ + "null", + "boolean", + "object", + "array", + "number", + "integer", + "string"]. + includes(type) ? + type : + inferType(); + + const handleCombiningKeywords = (keyword, separator) => { + if (Array.isArray(schema[keyword])) { + const combinedTypes = schema[keyword].map((subSchema) => + getType(subSchema, processedSchemas) + ); + return `(${combinedTypes.join(separator)})`; + } + return null; + }; + + const oneOfString = handleCombiningKeywords("oneOf", " | "); + const anyOfString = handleCombiningKeywords("anyOf", " | "); + const allOfString = handleCombiningKeywords("allOf", " & "); + + const combinedStrings = [typeString, oneOfString, anyOfString, allOfString]. + filter(Boolean). + join(" | "); + + processedSchemas.delete(schema); + + return combinedStrings || "any"; +}; + +const isBooleanJSONSchema = (schema) => typeof schema === "boolean"; + +const hasKeyword = (schema, keyword) => +schema !== null && +typeof schema === "object" && +Object.hasOwn(schema, keyword); + +const isExpandable = (schema) => { + const fn = useFn(); + + return ( + (schema === null || schema === void 0 ? void 0 : schema.$schema) || ( + schema === null || schema === void 0 ? void 0 : schema.$vocabulary) || ( + schema === null || schema === void 0 ? void 0 : schema.$id) || ( + schema === null || schema === void 0 ? void 0 : schema.$anchor) || ( + schema === null || schema === void 0 ? void 0 : schema.$dynamicAnchor) || ( + schema === null || schema === void 0 ? void 0 : schema.$ref) || ( + schema === null || schema === void 0 ? void 0 : schema.$dynamicRef) || ( + schema === null || schema === void 0 ? void 0 : schema.$defs) || ( + schema === null || schema === void 0 ? void 0 : schema.$comment) || ( + schema === null || schema === void 0 ? void 0 : schema.allOf) || ( + schema === null || schema === void 0 ? void 0 : schema.anyOf) || ( + schema === null || schema === void 0 ? void 0 : schema.oneOf) || + fn.hasKeyword(schema, "not") || + fn.hasKeyword(schema, "if") || + fn.hasKeyword(schema, "then") || + fn.hasKeyword(schema, "else") || ( + schema === null || schema === void 0 ? void 0 : schema.dependentSchemas) || ( + schema === null || schema === void 0 ? void 0 : schema.prefixItems) || + fn.hasKeyword(schema, "items") || + fn.hasKeyword(schema, "contains") || ( + schema === null || schema === void 0 ? void 0 : schema.properties) || ( + schema === null || schema === void 0 ? void 0 : schema.patternProperties) || + fn.hasKeyword(schema, "additionalProperties") || + fn.hasKeyword(schema, "propertyNames") || + fn.hasKeyword(schema, "unevaluatedItems") || + fn.hasKeyword(schema, "unevaluatedProperties") || ( + schema === null || schema === void 0 ? void 0 : schema.description) || ( + schema === null || schema === void 0 ? void 0 : schema.enum) || + fn.hasKeyword(schema, "const") || + fn.hasKeyword(schema, "contentSchema") || + fn.hasKeyword(schema, "default")); + +}; + +const fn_stringify = (value) => { + if ( + value === null || + ["number", "bigint", "boolean"].includes(typeof value)) + { + return String(value); + } + + if (Array.isArray(value)) { + return `[${value.map(fn_stringify).join(", ")}]`; + } + + return JSON.stringify(value); +}; + +const stringifyConstraintMultipleOf = (schema) => { + if (typeof (schema === null || schema === void 0 ? void 0 : schema.multipleOf) !== "number") return null; + if (schema.multipleOf <= 0) return null; + if (schema.multipleOf === 1) return null; + + const { multipleOf } = schema; + + if (Number.isInteger(multipleOf)) { + return `multiple of ${multipleOf}`; + } + + const decimalPlaces = multipleOf.toString().split(".")[1].length; + const factor = 10 ** decimalPlaces; + const numerator = multipleOf * factor; + const denominator = factor; + return `multiple of ${numerator}/${denominator}`; +}; + +const stringifyConstraintNumberRange = (schema) => { + const minimum = schema === null || schema === void 0 ? void 0 : schema.minimum; + const maximum = schema === null || schema === void 0 ? void 0 : schema.maximum; + const exclusiveMinimum = schema === null || schema === void 0 ? void 0 : schema.exclusiveMinimum; + const exclusiveMaximum = schema === null || schema === void 0 ? void 0 : schema.exclusiveMaximum; + const hasMinimum = typeof minimum === "number"; + const hasMaximum = typeof maximum === "number"; + const hasExclusiveMinimum = typeof exclusiveMinimum === "number"; + const hasExclusiveMaximum = typeof exclusiveMaximum === "number"; + const isMinExclusive = hasExclusiveMinimum && (!hasMinimum || minimum < exclusiveMinimum); // prettier-ignore + const isMaxExclusive = hasExclusiveMaximum && (!hasMaximum || maximum > exclusiveMaximum); // prettier-ignore + + if ( + (hasMinimum || hasExclusiveMinimum) && ( + hasMaximum || hasExclusiveMaximum)) + { + const minSymbol = isMinExclusive ? "(" : "["; + const maxSymbol = isMaxExclusive ? ")" : "]"; + const minValue = isMinExclusive ? exclusiveMinimum : minimum; + const maxValue = isMaxExclusive ? exclusiveMaximum : maximum; + return `${minSymbol}${minValue}, ${maxValue}${maxSymbol}`; + } + if (hasMinimum || hasExclusiveMinimum) { + const minSymbol = isMinExclusive ? ">" : "≥"; + const minValue = isMinExclusive ? exclusiveMinimum : minimum; + return `${minSymbol} ${minValue}`; + } + if (hasMaximum || hasExclusiveMaximum) { + const maxSymbol = isMaxExclusive ? "<" : "≤"; + const maxValue = isMaxExclusive ? exclusiveMaximum : maximum; + return `${maxSymbol} ${maxValue}`; + } + + return null; +}; + +const stringifyConstraintRange = (label, min, max) => { + const hasMin = typeof min === "number"; + const hasMax = typeof max === "number"; + + if (hasMin && hasMax) { + if (min === max) { + return `${min} ${label}`; + } else { + return `[${min}, ${max}] ${label}`; + } + } + if (hasMin) { + return `>= ${min} ${label}`; + } + if (hasMax) { + return `<= ${max} ${label}`; + } + + return null; +}; + +const stringifyConstraints = (schema) => { + const constraints = []; + + // validation Keywords for Numeric Instances (number and integer) + const multipleOf = stringifyConstraintMultipleOf(schema); + if (multipleOf !== null) { + constraints.push({ scope: "number", value: multipleOf }); + } + const numberRange = stringifyConstraintNumberRange(schema); + if (numberRange !== null) { + constraints.push({ scope: "number", value: numberRange }); + } + + // vocabularies for Semantic Content With "format" + if (schema !== null && schema !== void 0 && schema.format) { + constraints.push({ scope: "string", value: schema.format }); + } + + // validation Keywords for Strings + const stringRange = stringifyConstraintRange( + "characters", + schema === null || schema === void 0 ? void 0 : schema.minLength, + schema === null || schema === void 0 ? void 0 : schema.maxLength + ); + if (stringRange !== null) { + constraints.push({ scope: "string", value: stringRange }); + } + if (schema !== null && schema !== void 0 && schema.pattern) { + constraints.push({ scope: "string", value: `matches ${schema === null || schema === void 0 ? void 0 : schema.pattern}` }); + } + + // vocabulary for the Contents of String-Encoded Data + if (schema !== null && schema !== void 0 && schema.contentMediaType) { + constraints.push({ + scope: "string", + value: `media type: ${schema.contentMediaType}` + }); + } + if (schema !== null && schema !== void 0 && schema.contentEncoding) { + constraints.push({ + scope: "string", + value: `encoding: ${schema.contentEncoding}` + }); + } + + // validation Keywords for Arrays + const arrayRange = stringifyConstraintRange( + schema !== null && schema !== void 0 && schema.hasUniqueItems ? "unique items" : "items", + schema === null || schema === void 0 ? void 0 : schema.minItems, + schema === null || schema === void 0 ? void 0 : schema.maxItems + ); + if (arrayRange !== null) { + constraints.push({ scope: "array", value: arrayRange }); + } + const containsRange = stringifyConstraintRange( + "contained items", + schema === null || schema === void 0 ? void 0 : schema.minContains, + schema === null || schema === void 0 ? void 0 : schema.maxContains + ); + if (containsRange !== null) { + constraints.push({ scope: "array", value: containsRange }); + } + + // validation Keywords for Objects + const objectRange = stringifyConstraintRange( + "properties", + schema === null || schema === void 0 ? void 0 : schema.minProperties, + schema === null || schema === void 0 ? void 0 : schema.maxProperties + ); + if (objectRange !== null) { + constraints.push({ scope: "object", value: objectRange }); + } + + return constraints; +}; + +const getDependentRequired = (propertyName, schema) => { + if (!(schema !== null && schema !== void 0 && schema.dependentRequired)) return []; + + return Array.from( + Object.entries(schema.dependentRequired).reduce((acc, _ref) => {let [prop, list] = _ref; + if (!Array.isArray(list)) return acc; + if (!list.includes(propertyName)) return acc; + + acc.add(prop); + + return acc; + }, new Set()) + ); +}; +;// CONCATENATED MODULE: external "lodash/isPlainObject" +var isPlainObject_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var isPlainObject_y = x => () => x +const isPlainObject_namespaceObject = isPlainObject_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_isPlainObject_116f2243__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/types/array.js +/** + * @prettier + */ + +const applyArrayConstraints = function (array) {let constraints = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const { minItems, maxItems, uniqueItems } = constraints; + const { contains, minContains, maxContains } = constraints; + let constrainedArray = [...array]; + + if (contains != null && typeof contains === "object") { + if (Number.isInteger(minContains) && minContains > 1) { + const containsItem = constrainedArray.at(0); + for (let i = 1; i < minContains; i += 1) { + constrainedArray.unshift(containsItem); + } + } + if (Number.isInteger(maxContains) && maxContains > 0) { + + + + + + /** + * This is noop. `minContains` already generate minimum required + * number of items that satisfies `contains`. `maxContains` would + * have no effect. + */}}if (Number.isInteger(maxItems) && maxItems > 0) {constrainedArray = array.slice(0, maxItems); + } + if (Number.isInteger(minItems) && minItems > 0) { + for (let i = 0; constrainedArray.length < minItems; i += 1) { + constrainedArray.push(constrainedArray[i % constrainedArray.length]); + } + } + + if (uniqueItems === true) { + /** + * If uniqueItems is true, it implies that every item in the array must be unique. + * This overrides any minItems constraint that cannot be satisfied with unique items. + * So if minItems is greater than the number of unique items, + * it should be reduced to the number of unique items. + */ + constrainedArray = Array.from(new Set(constrainedArray)); + } + + return constrainedArray; +}; + +const arrayType = (schema, _ref) => {let { sample } = _ref; + return applyArrayConstraints(sample, schema); +}; + +/* harmony default export */ const array = (arrayType); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/types/object.js +/** + * @prettier + */ + +const objectType = () => { + throw new Error("Not implemented"); +}; + +/* harmony default export */ const object = (objectType); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/core/random.js +/** + * @prettier + */ + + + +/** + * Some of the functions returns constants. This is due to the nature + * of SwaggerUI expectations - provide as stable data as possible. + * + * In future, we may decide to randomize these function and provide + * true random values. + */ + +const bytes = (length) => browser_default()(length); + +const randexp = (pattern) => { + try { + const randexpInstance = new external_randexp_namespaceObject["default"](pattern); + return randexpInstance.gen(); + } catch { + // invalid regex should not cause a crash (regex syntax varies across languages) + return "string"; + } +}; + +const pick = (list) => { + return list.at(0); +}; + +const string = () => "string"; + +const number = () => 0; + +const integer = () => 0; +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/core/predicates.js +/** + * @prettier + */ + + +const predicates_isBooleanJSONSchema = (schema) => { + return typeof schema === "boolean"; +}; + +const isJSONSchemaObject = (schema) => { + return (0,isPlainObject_namespaceObject["default"])(schema); +}; + +const isJSONSchema = (schema) => { + return predicates_isBooleanJSONSchema(schema) || isJSONSchemaObject(schema); +}; +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/email.js +/** + * @prettier + */ +const emailGenerator = () => "user@example.com"; + +/* harmony default export */ const email = (emailGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/idn-email.js +/** + * @prettier + */ +const idnEmailGenerator = () => "실례@example.com"; + +/* harmony default export */ const idn_email = (idnEmailGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/hostname.js +/** + * @prettier + */ +const hostnameGenerator = () => "example.com"; + +/* harmony default export */ const hostname = (hostnameGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/idn-hostname.js +/** + * @prettier + */ +const idnHostnameGenerator = () => "실례.com"; + +/* harmony default export */ const idn_hostname = (idnHostnameGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/ipv4.js +/** + * @prettier + */ +const ipv4Generator = () => "198.51.100.42"; + +/* harmony default export */ const ipv4 = (ipv4Generator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/ipv6.js +/** + * @prettier + */ +const ipv6Generator = () => "2001:0db8:5b96:0000:0000:426f:8e17:642a"; + +/* harmony default export */ const ipv6 = (ipv6Generator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/uri.js +/** + * @prettier + */ +const uriGenerator = () => "https://example.com/"; + +/* harmony default export */ const uri = (uriGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/uri-reference.js +/** + * @prettier + */ +const uriReferenceGenerator = () => "path/index.html"; + +/* harmony default export */ const uri_reference = (uriReferenceGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/iri.js +/** + * @prettier + */ +const iriGenerator = () => "https://실례.com/"; + +/* harmony default export */ const iri = (iriGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/iri-reference.js +/** + * @prettier + */ +const iriReferenceGenerator = () => "path/실례.html"; + +/* harmony default export */ const iri_reference = (iriReferenceGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/uuid.js +/** + * @prettier + */ +const uuidGenerator = () => "3fa85f64-5717-4562-b3fc-2c963f66afa6"; + +/* harmony default export */ const uuid = (uuidGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/uri-template.js +/** + * @prettier + */ +const uriTemplateGenerator = () => +"https://example.com/dictionary/{term:1}/{term}"; + +/* harmony default export */ const uri_template = (uriTemplateGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/json-pointer.js +/** + * @prettier + */ +const jsonPointerGenerator = () => "/a/b/c"; + +/* harmony default export */ const json_pointer = (jsonPointerGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/relative-json-pointer.js +/** + * @prettier + */ +const relativeJsonPointerGenerator = () => "1/0"; + +/* harmony default export */ const relative_json_pointer = (relativeJsonPointerGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/date-time.js +/** + * @prettier + */ +const dateTimeGenerator = () => new Date().toISOString(); + +/* harmony default export */ const date_time = (dateTimeGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/date.js +/** + * @prettier + */ +const dateGenerator = () => new Date().toISOString().substring(0, 10); + +/* harmony default export */ const date = (dateGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/time.js +/** + * @prettier + */ +const timeGenerator = () => new Date().toISOString().substring(11); + +/* harmony default export */ const time = (timeGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/duration.js +/** + * @prettier + */ +const durationGenerator = () => "P3D"; // expresses a duration of 3 days + +/* harmony default export */ const duration = (durationGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/password.js +/** + * @prettier + */ +const passwordGenerator = () => "********"; + +/* harmony default export */ const generators_password = (passwordGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/regex.js +/** + * @prettier + */ +const regexGenerator = () => "^[a-z]+$"; + +/* harmony default export */ const regex = (regexGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/class/Registry.js + /** + * @prettier + */ +class Registry {constructor() {(0,defineProperty_namespaceObject["default"])(this, "data", + {});} + + register(name, value) { + this.data[name] = value; + } + + unregister(name) { + if (typeof name === "undefined") { + this.data = {}; + } else { + delete this.data[name]; + } + } + + get(name) { + return this.data[name]; + } +} + +/* harmony default export */ const class_Registry = (Registry); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/api/formatAPI.js +/** + * @prettier + */ + + + +const registry = new class_Registry(); + +const formatAPI = (format, generator) => { + if (typeof generator === "function") { + return registry.register(format, generator); + } else if (generator === null) { + return registry.unregister(format); + } + + return registry.get(format); +}; + +/* harmony default export */ const api_formatAPI = (formatAPI); +;// CONCATENATED MODULE: external "@babel/runtime-corejs3/helpers/classPrivateFieldGet" +var classPrivateFieldGet_x = y => { var x = {}; __webpack_require__.d(x, y); return x; } +var classPrivateFieldGet_y = x => () => x +const classPrivateFieldGet_namespaceObject = classPrivateFieldGet_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__babel_runtime_corejs3_helpers_classPrivateFieldGet_c0aa81e1__["default"] }); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/7bit.js +/* provided dependency */ var _7bit_Buffer = __webpack_require__(764)["Buffer"]; +/** + * @prettier + */ +const encode7bit = (content) => _7bit_Buffer.from(content).toString("ascii"); + +/* harmony default export */ const _7bit = (encode7bit); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/8bit.js +/* provided dependency */ var _8bit_Buffer = __webpack_require__(764)["Buffer"]; +/** + * @prettier + */ +const encode8bit = (content) => _8bit_Buffer.from(content).toString("utf8"); + +/* harmony default export */ const _8bit = (encode8bit); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/binary.js +/* provided dependency */ var binary_Buffer = __webpack_require__(764)["Buffer"]; +/** + * @prettier + */ +const encodeBinary = (content) => binary_Buffer.from(content).toString("binary"); + +/* harmony default export */ const binary = (encodeBinary); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/quoted-printable.js +/** + * @prettier + */ +const encodeQuotedPrintable = (content) => { + let quotedPrintable = ""; + + for (let i = 0; i < content.length; i++) { + const charCode = content.charCodeAt(i); + + if (charCode === 61) { + // ASCII content of "=" + quotedPrintable += "=3D"; + } else if ( + charCode >= 33 && charCode <= 60 || + charCode >= 62 && charCode <= 126 || + charCode === 9 || + charCode === 32) + { + quotedPrintable += content.charAt(i); + } else if (charCode === 13 || charCode === 10) { + quotedPrintable += "\r\n"; + } else if (charCode > 126) { + // convert non-ASCII characters to UTF-8 and encode each byte + const utf8 = unescape(encodeURIComponent(content.charAt(i))); + for (let j = 0; j < utf8.length; j++) { + quotedPrintable += + "=" + ("0" + utf8.charCodeAt(j).toString(16)).slice(-2).toUpperCase(); + } + } else { + quotedPrintable += + "=" + ("0" + charCode.toString(16)).slice(-2).toUpperCase(); + } + } + + return quotedPrintable; +}; + +/* harmony default export */ const quoted_printable = (encodeQuotedPrintable); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/base16.js +/* provided dependency */ var base16_Buffer = __webpack_require__(764)["Buffer"]; +/** + * @prettier + */ +const encodeBase16 = (content) => base16_Buffer.from(content).toString("hex"); + +/* harmony default export */ const base16 = (encodeBase16); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/base32.js +/* provided dependency */ var base32_Buffer = __webpack_require__(764)["Buffer"]; +/** + * @prettier + */ +const encodeBase32 = (content) => { + const utf8Value = base32_Buffer.from(content).toString("utf8"); + const base32Alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; + let paddingCount = 0; + let base32Str = ""; + let buffer = 0; + let bufferLength = 0; + + for (let i = 0; i < utf8Value.length; i++) { + buffer = buffer << 8 | utf8Value.charCodeAt(i); + bufferLength += 8; + + while (bufferLength >= 5) { + base32Str += base32Alphabet.charAt(buffer >>> bufferLength - 5 & 31); + bufferLength -= 5; + } + } + + if (bufferLength > 0) { + base32Str += base32Alphabet.charAt(buffer << 5 - bufferLength & 31); + paddingCount = (8 - utf8Value.length * 8 % 5) % 5; + } + + for (let i = 0; i < paddingCount; i++) { + base32Str += "="; + } + + return base32Str; +}; + +/* harmony default export */ const base32 = (encodeBase32); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/encoders/base64.js +/* provided dependency */ var base64_Buffer = __webpack_require__(764)["Buffer"]; +/** + * @prettier + */ +const encodeBase64 = (content) => base64_Buffer.from(content).toString("base64"); + +/* harmony default export */ const base64 = (encodeBase64); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/class/EncoderRegistry.js +function _classPrivateFieldInitSpec(obj, privateMap, value) {_checkPrivateRedeclaration(obj, privateMap);privateMap.set(obj, value);}function _checkPrivateRedeclaration(obj, privateCollection) {if (privateCollection.has(obj)) {throw new TypeError("Cannot initialize the same private elements twice on an object");}} /** + * @prettier + */ + + + + + + + +var _defaults = /*#__PURE__*/new WeakMap(); + +class EncoderRegistry extends class_Registry {constructor() {super(...arguments);_classPrivateFieldInitSpec(this, _defaults, { writable: true, value: + { + "7bit": _7bit, + "8bit": _8bit, + binary: binary, + "quoted-printable": quoted_printable, + base16: base16, + base32: base32, + base64: base64 + } });(0,defineProperty_namespaceObject["default"])(this, "data", (0,objectSpread2_namespaceObject["default"])({}, (0,classPrivateFieldGet_namespaceObject["default"])( + + this, _defaults)));} + + get defaults() { + return (0,objectSpread2_namespaceObject["default"])({}, (0,classPrivateFieldGet_namespaceObject["default"])(this, _defaults)); + } +} + +/* harmony default export */ const class_EncoderRegistry = (EncoderRegistry); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/api/encoderAPI.js +/** + * @prettier + */ + + + +const encoderAPI_registry = new class_EncoderRegistry(); + +const encoderAPI = (encodingName, encoder) => { + if (typeof encoder === "function") { + return encoderAPI_registry.register(encodingName, encoder); + } else if (encoder === null) { + return encoderAPI_registry.unregister(encodingName); + } + + return encoderAPI_registry.get(encodingName); +}; +encoderAPI.getDefaults = () => encoderAPI_registry.defaults; + +/* harmony default export */ const api_encoderAPI = (encoderAPI); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/text.js +/** + * @prettier + */ + +// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types +const textMediaTypesGenerators = { + "text/plain": () => "string", + "text/css": () => ".selector { border: 1px solid red }", + "text/csv": () => "value1,value2,value3", + "text/html": () => "

content

", + "text/calendar": () => "BEGIN:VCALENDAR", + "text/javascript": () => "console.dir('Hello world!');", + "text/xml": () => 'John Doe', + "text/*": () => "string" +}; + +/* harmony default export */ const media_types_text = (textMediaTypesGenerators); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/image.js +/** + * @prettier + */ + + +const imageMediaTypesGenerators = { + "image/*": () => bytes(25).toString("binary") +}; + +/* harmony default export */ const media_types_image = (imageMediaTypesGenerators); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/audio.js +/** + * @prettier + */ + + +const audioMediaTypesGenerators = { + "audio/*": () => bytes(25).toString("binary") +}; + +/* harmony default export */ const audio = (audioMediaTypesGenerators); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/video.js +/** + * @prettier + */ + + +const videoMediaTypesGenerators = { + "video/*": () => bytes(25).toString("binary") +}; + +/* harmony default export */ const video = (videoMediaTypesGenerators); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/media-types/application.js +/** + * @prettier + */ + + +// https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types +const applicationMediaTypesGenerators = { + "application/json": () => '{"key":"value"}', + "application/ld+json": () => '{"name": "John Doe"}', + "application/x-httpd-php": () => "Hello World!

'; ?>", + "application/rtf": () => String.raw`{\rtf1\adeflang1025\ansi\ansicpg1252\uc1`, + "application/x-sh": () => 'echo "Hello World!"', + "application/xhtml+xml": () => "

content

", + "application/*": () => bytes(25).toString("binary") +}; + +/* harmony default export */ const application = (applicationMediaTypesGenerators); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/class/MediaTypeRegistry.js +function MediaTypeRegistry_classPrivateFieldInitSpec(obj, privateMap, value) {MediaTypeRegistry_checkPrivateRedeclaration(obj, privateMap);privateMap.set(obj, value);}function MediaTypeRegistry_checkPrivateRedeclaration(obj, privateCollection) {if (privateCollection.has(obj)) {throw new TypeError("Cannot initialize the same private elements twice on an object");}} /** + * @prettier + */ + + + + + +var MediaTypeRegistry_defaults = /*#__PURE__*/new WeakMap(); + +class MediaTypeRegistry extends class_Registry {constructor() {super(...arguments);MediaTypeRegistry_classPrivateFieldInitSpec(this, MediaTypeRegistry_defaults, { writable: true, value: (0,objectSpread2_namespaceObject["default"])((0,objectSpread2_namespaceObject["default"])((0,objectSpread2_namespaceObject["default"])((0,objectSpread2_namespaceObject["default"])((0,objectSpread2_namespaceObject["default"])({}, + + media_types_text), + media_types_image), + audio), + video), + application) });(0,defineProperty_namespaceObject["default"])(this, "data", (0,objectSpread2_namespaceObject["default"])({}, (0,classPrivateFieldGet_namespaceObject["default"])( + + + this, MediaTypeRegistry_defaults)));} + + get defaults() { + return (0,objectSpread2_namespaceObject["default"])({}, (0,classPrivateFieldGet_namespaceObject["default"])(this, MediaTypeRegistry_defaults)); + } +} + +/* harmony default export */ const class_MediaTypeRegistry = (MediaTypeRegistry); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/api/mediaTypeAPI.js +/** + * @prettier + */ + + + +const mediaTypeAPI_registry = new class_MediaTypeRegistry(); + +const mediaTypeAPI = (mediaType, generator) => { + if (typeof generator === "function") { + return mediaTypeAPI_registry.register(mediaType, generator); + } else if (generator === null) { + return mediaTypeAPI_registry.unregister(mediaType); + } + + const mediaTypeNoParams = mediaType.split(";").at(0); + const topLevelMediaType = `${mediaTypeNoParams.split("/").at(0)}/*`; + + return ( + mediaTypeAPI_registry.get(mediaType) || + mediaTypeAPI_registry.get(mediaTypeNoParams) || + mediaTypeAPI_registry.get(topLevelMediaType)); + +}; +mediaTypeAPI.getDefaults = () => mediaTypeAPI_registry.defaults; + +/* harmony default export */ const api_mediaTypeAPI = (mediaTypeAPI); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/types/string.js +/** + * @prettier + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const generateFormat = (schema) => { + const { format } = schema; + + const formatGenerator = api_formatAPI(format); + if (typeof formatGenerator === "function") { + return formatGenerator(schema); + } + + switch (format) { + case "email":{ + return email(); + } + case "idn-email":{ + return idn_email(); + } + case "hostname":{ + return hostname(); + } + case "idn-hostname":{ + return idn_hostname(); + } + case "ipv4":{ + return ipv4(); + } + case "ipv6":{ + return ipv6(); + } + case "uri":{ + return uri(); + } + case "uri-reference":{ + return uri_reference(); + } + case "iri":{ + return iri(); + } + case "iri-reference":{ + return iri_reference(); + } + case "uuid":{ + return uuid(); + } + case "uri-template":{ + return uri_template(); + } + case "json-pointer":{ + return json_pointer(); + } + case "relative-json-pointer":{ + return relative_json_pointer(); + } + case "date-time":{ + return date_time(); + } + case "date":{ + return date(); + } + case "time":{ + return time(); + } + case "duration":{ + return duration(); + } + case "password":{ + return generators_password(); + } + case "regex":{ + return regex(); + } + } + + return string(); +}; + +const applyStringConstraints = function (string) {let constraints = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const { maxLength, minLength } = constraints; + let constrainedString = string; + + if (Number.isInteger(maxLength) && maxLength > 0) { + constrainedString = constrainedString.slice(0, maxLength); + } + if (Number.isInteger(minLength) && minLength > 0) { + let i = 0; + while (constrainedString.length < minLength) { + constrainedString += constrainedString[i++ % constrainedString.length]; + } + } + + return constrainedString; +}; +const stringType = function (schema) {let { sample } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const { contentEncoding, contentMediaType, contentSchema } = schema; + const { pattern, format } = schema; + const encode = api_encoderAPI(contentEncoding) || identity_namespaceObject["default"]; + let generatedString; + + if (typeof pattern === "string") { + generatedString = randexp(pattern); + } else if (typeof format === "string") { + generatedString = generateFormat(schema); + } else if ( + isJSONSchema(contentSchema) && + typeof contentMediaType === "string" && + typeof sample !== "undefined") + { + if (Array.isArray(sample) || typeof sample === "object") { + generatedString = JSON.stringify(sample); + } else { + generatedString = String(sample); + } + } else if (typeof contentMediaType === "string") { + const mediaTypeGenerator = api_mediaTypeAPI(contentMediaType); + if (typeof mediaTypeGenerator === "function") { + generatedString = mediaTypeGenerator(schema); + } + } else { + generatedString = string(); + } + + return encode(applyStringConstraints(generatedString, schema)); +}; + +/* harmony default export */ const types_string = (stringType); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/float.js +/** + * @prettier + */ +const floatGenerator = () => 0.1; + +/* harmony default export */ const generators_float = (floatGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/double.js +/** + * @prettier + */ +const doubleGenerator = () => 0.1; + +/* harmony default export */ const generators_double = (doubleGenerator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/types/number.js +/** + * @prettier + */ + + + + + +const number_generateFormat = (schema) => { + const { format } = schema; + + const formatGenerator = api_formatAPI(format); + if (typeof formatGenerator === "function") { + return formatGenerator(schema); + } + + switch (format) { + case "float":{ + return generators_float(); + } + case "double":{ + return generators_double(); + } + } + + return number(); +}; + +const applyNumberConstraints = function (number) {let constraints = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const { minimum, maximum, exclusiveMinimum, exclusiveMaximum } = constraints; + const { multipleOf } = constraints; + const epsilon = Number.isInteger(number) ? 1 : Number.EPSILON; + let minValue = typeof minimum === "number" ? minimum : null; + let maxValue = typeof maximum === "number" ? maximum : null; + let constrainedNumber = number; + + if (typeof exclusiveMinimum === "number") { + minValue = + minValue !== null ? + Math.max(minValue, exclusiveMinimum + epsilon) : + exclusiveMinimum + epsilon; + } + if (typeof exclusiveMaximum === "number") { + maxValue = + maxValue !== null ? + Math.min(maxValue, exclusiveMaximum - epsilon) : + exclusiveMaximum - epsilon; + } + constrainedNumber = + minValue > maxValue && number || minValue || maxValue || constrainedNumber; + + if (typeof multipleOf === "number" && multipleOf > 0) { + const remainder = constrainedNumber % multipleOf; + constrainedNumber = + remainder === 0 ? + constrainedNumber : + constrainedNumber + multipleOf - remainder; + } + + return constrainedNumber; +}; + +const numberType = (schema) => { + const { format } = schema; + let generatedNumber; + + if (typeof format === "string") { + generatedNumber = number_generateFormat(schema); + } else { + generatedNumber = number(); + } + + return applyNumberConstraints(generatedNumber, schema); +}; + +/* harmony default export */ const types_number = (numberType); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/int32.js +/** + * @prettier + */ +const int32Generator = () => 2 ** 30 >>> 0; + +/* harmony default export */ const int32 = (int32Generator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/generators/int64.js +/** + * @prettier + */ +const int64Generator = () => 2 ** 53 - 1; + +/* harmony default export */ const int64 = (int64Generator); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/types/integer.js +/** + * @prettier + */ + + + + + +const integer_generateFormat = (schema) => { + const { format } = schema; + + const formatGenerator = api_formatAPI(format); + if (typeof formatGenerator === "function") { + return formatGenerator(schema); + } + + switch (format) { + case "int32":{ + return int32(); + } + case "int64":{ + return int64(); + } + } + + return integer(); +}; +const integerType = (schema) => { + const { format } = schema; + + if (typeof format === "string") { + return integer_generateFormat(schema); + } + + return integer(); +}; + +/* harmony default export */ const types_integer = (integerType); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/types/boolean.js +/** + * @prettier + */ + +const booleanType = (schema) => { + return typeof schema.default === "boolean" ? schema.default : true; +}; + +/* harmony default export */ const types_boolean = (booleanType); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/types/null.js +/** + * @prettier + */ + +const nullType = () => { + return null; +}; + +/* harmony default export */ const types_null = (nullType); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/types/index.js +/** + * @prettier + */ + + + + + + + + +const typeMap = { + array: array, + object: object, + string: types_string, + number: types_number, + integer: types_integer, + boolean: types_boolean, + null: types_null +}; + +/* harmony default export */ const types = (new Proxy(typeMap, { + get(target, prop) { + if (typeof prop === "string" && Object.hasOwn(target, prop)) { + return target[prop]; + } + + return () => `Unknown Type: ${prop}`; + } +})); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/core/constants.js +/** + * @prettier + */ +const SCALAR_TYPES = ["number", "integer", "string", "boolean", "null"]; + +const ALL_TYPES = ["array", "object", ...SCALAR_TYPES]; +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/core/example.js +/** + * @prettier + */ + + +/** + * Precedence of keywords that provides author defined values (top of the list = higher priority) + * + * ### examples + * Array containing example values for the item defined by the schema. + * Not guaranteed to be valid or invalid against the schema + * + * ### default + * Default value for an item defined by the schema. + * Is expected to be a valid instance of the schema. + * + * ### example + * Deprecated. Part of OpenAPI 3.1.0 Schema Object dialect. + * Represents single example. Equivalent of `examples` keywords + * with single item. + */ + +const hasExample = (schema) => { + if (!isJSONSchemaObject(schema)) return false; + + const { examples, example, default: defaultVal } = schema; + + if (Array.isArray(examples) && examples.length >= 1) { + return true; + } + + if (typeof defaultVal !== "undefined") { + return true; + } + + return typeof example !== "undefined"; +}; + +const extractExample = (schema) => { + if (!isJSONSchemaObject(schema)) return null; + + const { examples, example, default: defaultVal } = schema; + + if (Array.isArray(examples) && examples.length >= 1) { + return examples.at(0); + } + + if (typeof defaultVal !== "undefined") { + return defaultVal; + } + + if (typeof example !== "undefined") { + return example; + } + + return undefined; +}; +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/core/type.js +/** + * @prettier + */ + + + + + +const inferringKeywords = { + array: [ + "items", + "prefixItems", + "contains", + "maxContains", + "minContains", + "maxItems", + "minItems", + "uniqueItems", + "unevaluatedItems"], + + object: [ + "properties", + "additionalProperties", + "patternProperties", + "propertyNames", + "minProperties", + "maxProperties", + "required", + "dependentSchemas", + "dependentRequired", + "unevaluatedProperties"], + + string: [ + "pattern", + "format", + "minLength", + "maxLength", + "contentEncoding", + "contentMediaType", + "contentSchema"], + + integer: [ + "minimum", + "maximum", + "exclusiveMinimum", + "exclusiveMaximum", + "multipleOf"] + +}; +inferringKeywords.number = inferringKeywords.integer; + +const fallbackType = "string"; + +const inferTypeFromValue = (value) => { + if (typeof value === "undefined") return null; + if (value === null) return "null"; + if (Array.isArray(value)) return "array"; + if (Number.isInteger(value)) return "integer"; + + return typeof value; +}; + +const foldType = (type) => { + if (Array.isArray(type) && type.length >= 1) { + if (type.includes("array")) { + return "array"; + } else if (type.includes("object")) { + return "object"; + } else { + const pickedType = pick(type); + if (ALL_TYPES.includes(pickedType)) { + return pickedType; + } + } + } + + if (ALL_TYPES.includes(type)) { + return type; + } + + return null; +}; + +const inferType = function (schema) {let processedSchemas = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new WeakSet(); + if (!isJSONSchemaObject(schema)) return fallbackType; + if (processedSchemas.has(schema)) return fallbackType; + + processedSchemas.add(schema); + + let { type, const: constant } = schema; + type = foldType(type); + + // inferring type from inferring keywords + if (typeof type !== "string") { + const inferringTypes = Object.keys(inferringKeywords); + + interrupt: for (let i = 0; i < inferringTypes.length; i += 1) { + const inferringType = inferringTypes[i]; + const inferringTypeKeywords = inferringKeywords[inferringType]; + + for (let j = 0; j < inferringTypeKeywords.length; j += 1) { + const inferringKeyword = inferringTypeKeywords[j]; + if (Object.hasOwn(schema, inferringKeyword)) { + type = inferringType; + break interrupt; + } + } + } + } + + // inferring type from const keyword + if (typeof type !== "string" && typeof constant !== "undefined") { + const constType = inferTypeFromValue(constant); + type = typeof constType === "string" ? constType : type; + } + + // inferring type from combining schemas + if (typeof type !== "string") { + const combineTypes = (keyword) => { + if (Array.isArray(schema[keyword])) { + const combinedTypes = schema[keyword].map((subSchema) => + inferType(subSchema, processedSchemas) + ); + return foldType(combinedTypes); + } + return null; + }; + + const allOf = combineTypes("allOf"); + const anyOf = combineTypes("anyOf"); + const oneOf = combineTypes("oneOf"); + const not = schema.not ? inferType(schema.not, processedSchemas) : null; + + if (allOf || anyOf || oneOf || not) { + type = foldType([allOf, anyOf, oneOf, not].filter(Boolean)); + } + } + + // inferring type from example + if (typeof type !== "string" && hasExample(schema)) { + const example = extractExample(schema); + const exampleType = inferTypeFromValue(example); + type = typeof exampleType === "string" ? exampleType : type; + } + + processedSchemas.delete(schema); + + return type || fallbackType; +}; + +const type_getType = (schema) => { + return inferType(schema); +}; +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/core/utils.js +/** + * @prettier + */ + + +const fromJSONBooleanSchema = (schema) => { + if (schema === false) { + return { not: {} }; + } + + return {}; +}; + +const typeCast = (schema) => { + if (predicates_isBooleanJSONSchema(schema)) { + return fromJSONBooleanSchema(schema); + } + if (!isJSONSchemaObject(schema)) { + return {}; + } + + return schema; +}; +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/core/merge.js + /** + * @prettier + */ + + + +const merge = function (target, source) {let config = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + if (predicates_isBooleanJSONSchema(target) && target === true) return true; + if (predicates_isBooleanJSONSchema(target) && target === false) return false; + if (predicates_isBooleanJSONSchema(source) && source === true) return true; + if (predicates_isBooleanJSONSchema(source) && source === false) return false; + + if (!isJSONSchema(target)) return source; + if (!isJSONSchema(source)) return target; + + /** + * Merging properties from the source object into the target object + * only if they do not already exist in the target object. + */ + const merged = (0,objectSpread2_namespaceObject["default"])((0,objectSpread2_namespaceObject["default"])({}, source), target); + + // merging the type keyword + if (source.type && target.type) { + if (Array.isArray(source.type) && typeof source.type === "string") { + const mergedType = normalizeArray(source.type).concat(target.type); + merged.type = Array.from(new Set(mergedType)); + } + } + + // merging required keyword + if (Array.isArray(source.required) && Array.isArray(target.required)) { + merged.required = [...new Set([...target.required, ...source.required])]; + } + + // merging properties keyword + if (source.properties && target.properties) { + const allPropertyNames = new Set([ + ...Object.keys(source.properties), + ...Object.keys(target.properties)] + ); + + merged.properties = {}; + for (const name of allPropertyNames) { + const sourceProperty = source.properties[name] || {}; + const targetProperty = target.properties[name] || {}; + + if ( + sourceProperty.readOnly && !config.includeReadOnly || + sourceProperty.writeOnly && !config.includeWriteOnly) + { + merged.required = (merged.required || []).filter((p) => p !== name); + } else { + merged.properties[name] = merge(targetProperty, sourceProperty, config); + } + } + } + + // merging items keyword + if (isJSONSchema(source.items) && isJSONSchema(target.items)) { + merged.items = merge(target.items, source.items, config); + } + + // merging contains keyword + if (isJSONSchema(source.contains) && isJSONSchema(target.contains)) { + merged.contains = merge(target.contains, source.contains, config); + } + + // merging contentSchema keyword + if ( + isJSONSchema(source.contentSchema) && + isJSONSchema(target.contentSchema)) + { + merged.contentSchema = merge( + target.contentSchema, + source.contentSchema, + config + ); + } + + return merged; +}; + +/* harmony default export */ const core_merge = (merge); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/main.js +/** + * @prettier + */ + + + + + + + + + + + + + + +const main_sampleFromSchemaGeneric = function ( +schema) + + + +{var _schema;let config = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};let exampleOverride = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;let respectXML = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false; + if (typeof ((_schema = schema) === null || _schema === void 0 ? void 0 : _schema.toJS) === "function") schema = schema.toJS(); + schema = typeCast(schema); + + let usePlainValue = exampleOverride !== undefined || hasExample(schema); + // first check if there is the need of combining this schema with others required by allOf + const hasOneOf = + !usePlainValue && Array.isArray(schema.oneOf) && schema.oneOf.length > 0; + const hasAnyOf = + !usePlainValue && Array.isArray(schema.anyOf) && schema.anyOf.length > 0; + if (!usePlainValue && (hasOneOf || hasAnyOf)) { + const schemaToAdd = typeCast( + hasOneOf ? pick(schema.oneOf) : pick(schema.anyOf) + ); + schema = core_merge(schema, schemaToAdd, config); + if (!schema.xml && schemaToAdd.xml) { + schema.xml = schemaToAdd.xml; + } + if (hasExample(schema) && hasExample(schemaToAdd)) { + usePlainValue = true; + } + } + const _attr = {}; + let { xml, properties, additionalProperties, items, contains } = schema || {}; + let type = type_getType(schema); + let { includeReadOnly, includeWriteOnly } = config; + xml = xml || {}; + let { name, prefix, namespace } = xml; + let displayName; + let res = {}; + + if (!Object.hasOwn(schema, "type")) { + schema.type = type; + } + + // set xml naming and attributes + if (respectXML) { + name = name || "notagname"; + // add prefix to name if exists + displayName = (prefix ? `${prefix}:` : "") + name; + if (namespace) { + //add prefix to namespace if exists + let namespacePrefix = prefix ? `xmlns:${prefix}` : "xmlns"; + _attr[namespacePrefix] = namespace; + } + } + + // init xml default response sample obj + if (respectXML) { + res[displayName] = []; + } + + // add to result helper init for xml or json + const props = objectify(properties); + let addPropertyToResult; + let propertyAddedCounter = 0; + + const hasExceededMaxProperties = () => + Number.isInteger(schema.maxProperties) && + schema.maxProperties > 0 && + propertyAddedCounter >= schema.maxProperties; + + const requiredPropertiesToAdd = () => { + if (!Array.isArray(schema.required) || schema.required.length === 0) { + return 0; + } + let addedCount = 0; + if (respectXML) { + schema.required.forEach( + (key) => addedCount += res[key] === undefined ? 0 : 1 + ); + } else { + schema.required.forEach((key) => {var _res$displayName; + addedCount += + ((_res$displayName = res[displayName]) === null || _res$displayName === void 0 ? void 0 : _res$displayName.find((x) => x[key] !== undefined)) === undefined ? + 0 : + 1; + }); + } + return schema.required.length - addedCount; + }; + + const isOptionalProperty = (propName) => { + if (!Array.isArray(schema.required)) return true; + if (schema.required.length === 0) return true; + + return !schema.required.includes(propName); + }; + + const canAddProperty = (propName) => { + if (!(Number.isInteger(schema.maxProperties) && schema.maxProperties > 0)) { + return true; + } + if (hasExceededMaxProperties()) { + return false; + } + if (!isOptionalProperty(propName)) { + return true; + } + return ( + schema.maxProperties - propertyAddedCounter - requiredPropertiesToAdd() > + 0); + + }; + + if (respectXML) { + addPropertyToResult = function (propName) {let overrideE = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined; + if (schema && props[propName]) { + // case it is a xml attribute + props[propName].xml = props[propName].xml || {}; + + if (props[propName].xml.attribute) { + const enumAttrVal = Array.isArray(props[propName].enum) ? + pick(props[propName].enum) : + undefined; + if (hasExample(props[propName])) { + _attr[props[propName].xml.name || propName] = extractExample( + props[propName] + ); + } else if (enumAttrVal !== undefined) { + _attr[props[propName].xml.name || propName] = enumAttrVal; + } else { + const propSchema = typeCast(props[propName]); + const propSchemaType = type_getType(propSchema); + const attrName = props[propName].xml.name || propName; + _attr[attrName] = types[propSchemaType](propSchema); + } + + return; + } + props[propName].xml.name = props[propName].xml.name || propName; + } else if (!props[propName] && additionalProperties !== false) { + // case only additionalProperty that is not defined in schema + props[propName] = { + xml: { + name: propName + } + }; + } + + let t = main_sampleFromSchemaGeneric( + props[propName], + config, + overrideE, + respectXML + ); + if (!canAddProperty(propName)) { + return; + } + + propertyAddedCounter++; + if (Array.isArray(t)) { + res[displayName] = res[displayName].concat(t); + } else { + res[displayName].push(t); + } + }; + } else { + addPropertyToResult = (propName, overrideE) => {var _schema$discriminator; + if (!canAddProperty(propName)) { + return; + } + if ( + (0,isPlainObject_namespaceObject["default"])((_schema$discriminator = schema.discriminator) === null || _schema$discriminator === void 0 ? void 0 : _schema$discriminator.mapping) && + schema.discriminator.propertyName === propName && + typeof schema.$$ref === "string") + { + for (const pair in schema.discriminator.mapping) { + if (schema.$$ref.search(schema.discriminator.mapping[pair]) !== -1) { + res[propName] = pair; + break; + } + } + } else { + res[propName] = main_sampleFromSchemaGeneric( + props[propName], + config, + overrideE, + respectXML + ); + } + propertyAddedCounter++; + }; + } + + // check for plain value and if found use it to generate sample from it + if (usePlainValue) { + let sample; + if (exampleOverride !== undefined) { + sample = exampleOverride; + } else { + sample = extractExample(schema); + } + + // if json just return + if (!respectXML) { + // spacial case yaml parser can not know about + if (typeof sample === "number" && type === "string") { + return `${sample}`; + } + // return if sample does not need any parsing + if (typeof sample !== "string" || type === "string") { + return sample; + } + // check if sample is parsable or just a plain string + try { + return JSON.parse(sample); + } catch { + // sample is just plain string return it + return sample; + } + } + + // generate xml sample recursively for array case + if (type === "array") { + if (!Array.isArray(sample)) { + if (typeof sample === "string") { + return sample; + } + sample = [sample]; + } + + let itemSamples = []; + + if (isJSONSchemaObject(items)) { + items.xml = items.xml || xml || {}; + items.xml.name = items.xml.name || xml.name; + itemSamples = sample.map((s) => + main_sampleFromSchemaGeneric(items, config, s, respectXML) + ); + } + + if (isJSONSchemaObject(contains)) { + contains.xml = contains.xml || xml || {}; + contains.xml.name = contains.xml.name || xml.name; + itemSamples = [ + main_sampleFromSchemaGeneric(contains, config, undefined, respectXML), + ...itemSamples]; + + } + + itemSamples = types.array(schema, { sample: itemSamples }); + if (xml.wrapped) { + res[displayName] = itemSamples; + if (!(0,isEmpty_namespaceObject["default"])(_attr)) { + res[displayName].push({ _attr: _attr }); + } + } else { + res = itemSamples; + } + return res; + } + + // generate xml sample recursively for object case + if (type === "object") { + // case literal example + if (typeof sample === "string") { + return sample; + } + for (const propName in sample) {var _props$propName, _props$propName2, _props$propName3; + if (!Object.hasOwn(sample, propName)) { + continue; + } + if ((_props$propName = props[propName]) !== null && _props$propName !== void 0 && _props$propName.readOnly && !includeReadOnly) { + continue; + } + if ((_props$propName2 = props[propName]) !== null && _props$propName2 !== void 0 && _props$propName2.writeOnly && !includeWriteOnly) { + continue; + } + if ((_props$propName3 = props[propName]) !== null && _props$propName3 !== void 0 && (_props$propName3 = _props$propName3.xml) !== null && _props$propName3 !== void 0 && _props$propName3.attribute) { + _attr[props[propName].xml.name || propName] = sample[propName]; + continue; + } + addPropertyToResult(propName, sample[propName]); + } + if (!(0,isEmpty_namespaceObject["default"])(_attr)) { + res[displayName].push({ _attr: _attr }); + } + + return res; + } + + res[displayName] = !(0,isEmpty_namespaceObject["default"])(_attr) ? [{ _attr: _attr }, sample] : sample; + return res; + } + + // use schema to generate sample + if (type === "array") { + let sampleArray = []; + + if (isJSONSchemaObject(contains)) { + if (respectXML) { + contains.xml = contains.xml || schema.xml || {}; + contains.xml.name = contains.xml.name || xml.name; + } + + if (Array.isArray(contains.anyOf)) { + sampleArray.push( + ...contains.anyOf.map((anyOfSchema) => + main_sampleFromSchemaGeneric( + core_merge(anyOfSchema, contains, config), + config, + undefined, + respectXML + ) + ) + ); + } else if (Array.isArray(contains.oneOf)) { + sampleArray.push( + ...contains.oneOf.map((oneOfSchema) => + main_sampleFromSchemaGeneric( + core_merge(oneOfSchema, contains, config), + config, + undefined, + respectXML + ) + ) + ); + } else if (!respectXML || respectXML && xml.wrapped) { + sampleArray.push( + main_sampleFromSchemaGeneric(contains, config, undefined, respectXML) + ); + } else { + return main_sampleFromSchemaGeneric(contains, config, undefined, respectXML); + } + } + + if (isJSONSchemaObject(items)) { + if (respectXML) { + items.xml = items.xml || schema.xml || {}; + items.xml.name = items.xml.name || xml.name; + } + + if (Array.isArray(items.anyOf)) { + sampleArray.push( + ...items.anyOf.map((i) => + main_sampleFromSchemaGeneric( + core_merge(i, items, config), + config, + undefined, + respectXML + ) + ) + ); + } else if (Array.isArray(items.oneOf)) { + sampleArray.push( + ...items.oneOf.map((i) => + main_sampleFromSchemaGeneric( + core_merge(i, items, config), + config, + undefined, + respectXML + ) + ) + ); + } else if (!respectXML || respectXML && xml.wrapped) { + sampleArray.push( + main_sampleFromSchemaGeneric(items, config, undefined, respectXML) + ); + } else { + return main_sampleFromSchemaGeneric(items, config, undefined, respectXML); + } + } + + sampleArray = types.array(schema, { sample: sampleArray }); + if (respectXML && xml.wrapped) { + res[displayName] = sampleArray; + if (!(0,isEmpty_namespaceObject["default"])(_attr)) { + res[displayName].push({ _attr: _attr }); + } + return res; + } + + return sampleArray; + } + + if (type === "object") { + for (let propName in props) {var _props$propName4, _props$propName5, _props$propName6; + if (!Object.hasOwn(props, propName)) { + continue; + } + if ((_props$propName4 = props[propName]) !== null && _props$propName4 !== void 0 && _props$propName4.deprecated) { + continue; + } + if ((_props$propName5 = props[propName]) !== null && _props$propName5 !== void 0 && _props$propName5.readOnly && !includeReadOnly) { + continue; + } + if ((_props$propName6 = props[propName]) !== null && _props$propName6 !== void 0 && _props$propName6.writeOnly && !includeWriteOnly) { + continue; + } + addPropertyToResult(propName); + } + if (respectXML && _attr) { + res[displayName].push({ _attr: _attr }); + } + + if (hasExceededMaxProperties()) { + return res; + } + + if (predicates_isBooleanJSONSchema(additionalProperties) && additionalProperties) { + if (respectXML) { + res[displayName].push({ additionalProp: "Anything can be here" }); + } else { + res.additionalProp1 = {}; + } + propertyAddedCounter++; + } else if (isJSONSchemaObject(additionalProperties)) {var _additionalProps$xml, _additionalProps$xml2; + const additionalProps = additionalProperties; + const additionalPropSample = main_sampleFromSchemaGeneric( + additionalProps, + config, + undefined, + respectXML + ); + + if ( + respectXML && + typeof (additionalProps === null || additionalProps === void 0 || (_additionalProps$xml = additionalProps.xml) === null || _additionalProps$xml === void 0 ? void 0 : _additionalProps$xml.name) === "string" && + (additionalProps === null || additionalProps === void 0 || (_additionalProps$xml2 = additionalProps.xml) === null || _additionalProps$xml2 === void 0 ? void 0 : _additionalProps$xml2.name) !== "notagname") + { + res[displayName].push(additionalPropSample); + } else { + const toGenerateCount = + Number.isInteger(schema.minProperties) && + schema.minProperties > 0 && + propertyAddedCounter < schema.minProperties ? + schema.minProperties - propertyAddedCounter : + 3; + for (let i = 1; i <= toGenerateCount; i++) { + if (hasExceededMaxProperties()) { + return res; + } + if (respectXML) { + const temp = {}; + temp["additionalProp" + i] = additionalPropSample["notagname"]; + res[displayName].push(temp); + } else { + res["additionalProp" + i] = additionalPropSample; + } + propertyAddedCounter++; + } + } + } + return res; + } + + let value; + if (typeof schema.const !== "undefined") { + // display const value + value = schema.const; + } else if (schema && Array.isArray(schema.enum)) { + //display enum first value + value = pick(normalizeArray(schema.enum)); + } else { + // display schema default + const contentSample = isJSONSchemaObject(schema.contentSchema) ? + main_sampleFromSchemaGeneric( + schema.contentSchema, + config, + undefined, + respectXML + ) : + undefined; + value = types[type](schema, { sample: contentSample }); + } + + if (respectXML) { + res[displayName] = !(0,isEmpty_namespaceObject["default"])(_attr) ? [{ _attr: _attr }, value] : value; + return res; + } + + return value; +}; + +const main_createXMLExample = (schema, config, o) => { + const json = main_sampleFromSchemaGeneric(schema, config, o, true); + if (!json) { + return; + } + if (typeof json === "string") { + return json; + } + return (0,external_xml_namespaceObject["default"])(json, { declaration: true, indent: "\t" }); +}; + +const main_sampleFromSchema = (schema, config, o) => { + return main_sampleFromSchemaGeneric(schema, config, o, false); +}; + +const main_resolver = (arg1, arg2, arg3) => [ +arg1, +JSON.stringify(arg2), +JSON.stringify(arg3)]; + + +const main_memoizedCreateXMLExample = utils_memoizeN(main_createXMLExample, main_resolver); + +const main_memoizedSampleFromSchema = utils_memoizeN(main_sampleFromSchema, main_resolver); +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/samples-extensions/fn/index.js +/** + * @prettier + */ + + + + + +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/hoc.jsx + /** + * @prettier + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const withJSONSchemaContext = function (Component) {let overrides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; + const value = { + components: (0,objectSpread2_namespaceObject["default"])({ + JSONSchema: JSONSchema_JSONSchema, + Keyword$schema: keywords_$schema, + Keyword$vocabulary: $vocabulary_$vocabulary, + Keyword$id: keywords_$id, + Keyword$anchor: keywords_$anchor, + Keyword$dynamicAnchor: keywords_$dynamicAnchor, + Keyword$ref: keywords_$ref, + Keyword$dynamicRef: keywords_$dynamicRef, + Keyword$defs: keywords_$defs, + Keyword$comment: keywords_$comment, + KeywordAllOf: keywords_AllOf, + KeywordAnyOf: keywords_AnyOf, + KeywordOneOf: keywords_OneOf, + KeywordNot: keywords_Not, + KeywordIf: keywords_If, + KeywordThen: keywords_Then, + KeywordElse: keywords_Else, + KeywordDependentSchemas: keywords_DependentSchemas, + KeywordPrefixItems: keywords_PrefixItems, + KeywordItems: keywords_Items, + KeywordContains: keywords_Contains, + KeywordProperties: keywords_Properties_Properties, + KeywordPatternProperties: PatternProperties_PatternProperties, + KeywordAdditionalProperties: keywords_AdditionalProperties, + KeywordPropertyNames: keywords_PropertyNames, + KeywordUnevaluatedItems: keywords_UnevaluatedItems, + KeywordUnevaluatedProperties: keywords_UnevaluatedProperties, + KeywordType: keywords_Type, + KeywordEnum: Enum_Enum, + KeywordConst: keywords_Const, + KeywordConstraint: Constraint_Constraint, + KeywordDependentRequired: DependentRequired_DependentRequired, + KeywordContentSchema: keywords_ContentSchema, + KeywordTitle: Title_Title, + KeywordDescription: keywords_Description_Description, + KeywordDefault: keywords_Default, + KeywordDeprecated: keywords_Deprecated, + KeywordReadOnly: keywords_ReadOnly, + KeywordWriteOnly: keywords_WriteOnly, + Accordion: Accordion_Accordion, + ExpandDeepButton: ExpandDeepButton_ExpandDeepButton, + ChevronRightIcon: icons_ChevronRight }, + overrides.components), + + config: (0,objectSpread2_namespaceObject["default"])({ + default$schema: "https://json-schema.org/draft/2020-12/schema", + /** + * Defines an upper exclusive boundary of the level range for automatic expansion. + * + * 0 -> do nothing + * 1 -> [0]...(1) + * 2 -> [0]...(2) + * 3 -> [0]...(3) + */ + defaultExpandedLevels: 0 }, + overrides.config), + + fn: (0,objectSpread2_namespaceObject["default"])({ + upperFirst: fn_upperFirst, + getTitle: getTitle, + getType: getType, + isBooleanJSONSchema: isBooleanJSONSchema, + hasKeyword: hasKeyword, + isExpandable: isExpandable, + stringify: fn_stringify, + stringifyConstraints: stringifyConstraints, + getDependentRequired: getDependentRequired }, + overrides.fn) + + }; + + const HOC = (props) => /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(JSONSchemaContext.Provider, { value: value }, /*#__PURE__*/ + external_react_namespaceObject["default"].createElement(Component, props) + ); + + HOC.contexts = { + JSONSchemaContext: JSONSchemaContext + }; + HOC.displayName = Component.displayName; + + return HOC; +}; +;// CONCATENATED MODULE: ./src/core/plugins/json-schema-2020-12/index.js +/** + * @prettier + */ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +const JSONSchema202012Plugin = () => ({ + components: { + JSONSchema202012: JSONSchema_JSONSchema, + JSONSchema202012Keyword$schema: keywords_$schema, + JSONSchema202012Keyword$vocabulary: $vocabulary_$vocabulary, + JSONSchema202012Keyword$id: keywords_$id, + JSONSchema202012Keyword$anchor: keywords_$anchor, + JSONSchema202012Keyword$dynamicAnchor: keywords_$dynamicAnchor, + JSONSchema202012Keyword$ref: keywords_$ref, + JSONSchema202012Keyword$dynamicRef: keywords_$dynamicRef, + JSONSchema202012Keyword$defs: keywords_$defs, + JSONSchema202012Keyword$comment: keywords_$comment, + JSONSchema202012KeywordAllOf: keywords_AllOf, + JSONSchema202012KeywordAnyOf: keywords_AnyOf, + JSONSchema202012KeywordOneOf: keywords_OneOf, + JSONSchema202012KeywordNot: keywords_Not, + JSONSchema202012KeywordIf: keywords_If, + JSONSchema202012KeywordThen: keywords_Then, + JSONSchema202012KeywordElse: keywords_Else, + JSONSchema202012KeywordDependentSchemas: keywords_DependentSchemas, + JSONSchema202012KeywordPrefixItems: keywords_PrefixItems, + JSONSchema202012KeywordItems: keywords_Items, + JSONSchema202012KeywordContains: keywords_Contains, + JSONSchema202012KeywordProperties: keywords_Properties_Properties, + JSONSchema202012KeywordPatternProperties: PatternProperties_PatternProperties, + JSONSchema202012KeywordAdditionalProperties: keywords_AdditionalProperties, + JSONSchema202012KeywordPropertyNames: keywords_PropertyNames, + JSONSchema202012KeywordUnevaluatedItems: keywords_UnevaluatedItems, + JSONSchema202012KeywordUnevaluatedProperties: keywords_UnevaluatedProperties, + JSONSchema202012KeywordType: keywords_Type, + JSONSchema202012KeywordEnum: Enum_Enum, + JSONSchema202012KeywordConst: keywords_Const, + JSONSchema202012KeywordConstraint: Constraint_Constraint, + JSONSchema202012KeywordDependentRequired: DependentRequired_DependentRequired, + JSONSchema202012KeywordContentSchema: keywords_ContentSchema, + JSONSchema202012KeywordTitle: Title_Title, + JSONSchema202012KeywordDescription: keywords_Description_Description, + JSONSchema202012KeywordDefault: keywords_Default, + JSONSchema202012KeywordDeprecated: keywords_Deprecated, + JSONSchema202012KeywordReadOnly: keywords_ReadOnly, + JSONSchema202012KeywordWriteOnly: keywords_WriteOnly, + JSONSchema202012Accordion: Accordion_Accordion, + JSONSchema202012ExpandDeepButton: ExpandDeepButton_ExpandDeepButton, + JSONSchema202012ChevronRightIcon: icons_ChevronRight, + withJSONSchema202012Context: withJSONSchemaContext, + JSONSchema202012DeepExpansionContext: () => JSONSchemaDeepExpansionContext + }, + fn: { + upperFirst: fn_upperFirst, + jsonSchema202012: { + isExpandable: isExpandable, + hasKeyword: hasKeyword, + useFn: useFn, + useConfig: useConfig, + useComponent: useComponent, + useIsExpandedDeeply: useIsExpandedDeeply, + sampleFromSchema: main_sampleFromSchema, + sampleFromSchemaGeneric: main_sampleFromSchemaGeneric, + sampleEncoderAPI: api_encoderAPI, + sampleFormatAPI: api_formatAPI, + sampleMediaTypeAPI: api_mediaTypeAPI, + createXMLExample: main_createXMLExample, + memoizedSampleFromSchema: main_memoizedSampleFromSchema, + memoizedCreateXMLExample: main_memoizedCreateXMLExample + } + } +}); + +/* harmony default export */ const json_schema_2020_12 = (JSONSchema202012Plugin); +;// CONCATENATED MODULE: ./src/core/presets/apis/index.js +/** + * @prettier + */ + + + + + +function PresetApis() { + return [base, oas3, json_schema_2020_12, oas31]; +} +;// CONCATENATED MODULE: ./src/core/index.js + + + +// presets + + +// plugins + + + + + + + + + + + + + + + + + + + + + + + + +// eslint-disable-next-line no-undef +const { GIT_DIRTY, GIT_COMMIT, PACKAGE_VERSION, BUILD_TIME } = {"PACKAGE_VERSION":"5.5.0","GIT_COMMIT":"g1ed1332d","GIT_DIRTY":true,"BUILD_TIME":"Mon, 04 Sep 2023 20:05:42 GMT"}; + +function SwaggerUI(opts) { + + core_window.versions = core_window.versions || {}; + core_window.versions.swaggerUi = { + version: PACKAGE_VERSION, + gitRevision: GIT_COMMIT, + gitDirty: GIT_DIRTY, + buildTimestamp: BUILD_TIME + }; + + const defaults = { + // Some general settings, that we floated to the top + dom_id: null, // eslint-disable-line camelcase + domNode: null, + spec: {}, + url: "", + urls: null, + layout: "BaseLayout", + docExpansion: "list", + maxDisplayedTags: null, + filter: null, + validatorUrl: "https://validator.swagger.io/validator", + oauth2RedirectUrl: `${window.location.protocol}//${window.location.host}${window.location.pathname.substring(0, window.location.pathname.lastIndexOf("/"))}/oauth2-redirect.html`, + persistAuthorization: false, + configs: {}, + custom: {}, + displayOperationId: false, + displayRequestDuration: false, + deepLinking: false, + tryItOutEnabled: false, + requestInterceptor: (a) => a, + responseInterceptor: (a) => a, + showMutatedRequest: true, + defaultModelRendering: "example", + defaultModelExpandDepth: 1, + defaultModelsExpandDepth: 1, + showExtensions: false, + showCommonExtensions: false, + withCredentials: undefined, + requestSnippetsEnabled: false, + requestSnippets: { + generators: { + "curl_bash": { + title: "cURL (bash)", + syntax: "bash" + }, + "curl_powershell": { + title: "cURL (PowerShell)", + syntax: "powershell" + }, + "curl_cmd": { + title: "cURL (CMD)", + syntax: "bash" + } + }, + defaultExpanded: true, + languages: null // e.g. only show curl bash = ["curl_bash"] + }, + supportedSubmitMethods: [ + "get", + "put", + "post", + "delete", + "options", + "head", + "patch", + "trace"], + + queryConfigEnabled: false, + + // Initial set of plugins ( TODO rename this, or refactor - we don't need presets _and_ plugins. Its just there for performance. + // Instead, we can compile the first plugin ( it can be a collection of plugins ), then batch the rest. + presets: [ + PresetApis], + + + // Plugins; ( loaded after presets ) + plugins: [], + + + pluginsOptions: { + // Behavior during plugin registration. Can be : + // - legacy (default) : the current behavior for backward compatibility – last plugin takes precedence over the others + // - chain : chain wrapComponents when targeting the same core component + pluginLoadType: "legacy" + }, + + // Initial state + initialState: {}, + + // Inline Plugin + fn: {}, + components: {}, + + syntaxHighlight: { + activated: true, + theme: "agate" + } + }; + + let queryConfig = opts.queryConfigEnabled ? parseSearch() : {}; + + const domNode = opts.domNode; + delete opts.domNode; + + const constructorConfig = deep_extend_default()({}, defaults, opts, queryConfig); + + const storeConfigs = { + system: { + configs: constructorConfig.configs + }, + plugins: constructorConfig.presets, + pluginsOptions: constructorConfig.pluginsOptions, + state: deep_extend_default()({ + layout: { + layout: constructorConfig.layout, + filter: constructorConfig.filter + }, + spec: { + spec: "", + url: constructorConfig.url + }, + requestSnippets: constructorConfig.requestSnippets + }, constructorConfig.initialState) + }; + + if (constructorConfig.initialState) { + // if the user sets a key as `undefined`, that signals to us that we + // should delete the key entirely. + // known usage: Swagger-Editor validate plugin tests + for (var key in constructorConfig.initialState) { + if ( + Object.prototype.hasOwnProperty.call(constructorConfig.initialState, key) && + constructorConfig.initialState[key] === undefined) + { + delete storeConfigs.state[key]; + } + } + } + + let inlinePlugin = () => { + return { + fn: constructorConfig.fn, + components: constructorConfig.components, + state: constructorConfig.state + }; + }; + + var store = new Store(storeConfigs); + store.register([constructorConfig.plugins, inlinePlugin]); + + var system = store.getSystem(); + + const downloadSpec = (fetchedConfig) => { + let localConfig = system.specSelectors.getLocalConfig ? system.specSelectors.getLocalConfig() : {}; + let mergedConfig = deep_extend_default()({}, localConfig, constructorConfig, fetchedConfig || {}, queryConfig); + + // deep extend mangles domNode, we need to set it manually + if (domNode) { + mergedConfig.domNode = domNode; + } + + store.setConfigs(mergedConfig); + system.configsActions.loaded(); + + if (fetchedConfig !== null) { + if (!queryConfig.url && typeof mergedConfig.spec === "object" && Object.keys(mergedConfig.spec).length) { + system.specActions.updateUrl(""); + system.specActions.updateLoadingStatus("success"); + system.specActions.updateSpec(JSON.stringify(mergedConfig.spec)); + } else if (system.specActions.download && mergedConfig.url && !mergedConfig.urls) { + system.specActions.updateUrl(mergedConfig.url); + system.specActions.download(mergedConfig.url); + } + } + + if (mergedConfig.domNode) { + system.render(mergedConfig.domNode, "App"); + } else if (mergedConfig.dom_id) { + let domNode = document.querySelector(mergedConfig.dom_id); + system.render(domNode, "App"); + } else if (mergedConfig.dom_id === null || mergedConfig.domNode === null) { + + + // do nothing + // this is useful for testing that does not need to do any rendering + } else {console.error("Skipped rendering: no `dom_id` or `domNode` was specified");} + + return system; + }; + + const configUrl = queryConfig.config || constructorConfig.configUrl; + + if (configUrl && system.specActions && system.specActions.getConfigByUrl) { + system.specActions.getConfigByUrl({ + url: configUrl, + loadRemoteConfig: true, + requestInterceptor: constructorConfig.requestInterceptor, + responseInterceptor: constructorConfig.responseInterceptor + }, downloadSpec); + } else { + return downloadSpec(); + } + + return system; +} + +SwaggerUI.presets = { + base: base, + apis: PresetApis +}; + +SwaggerUI.plugins = { + Auth: auth, + Configs: configsPlugin, + DeepLining: deep_linking, + Err: err, + Filter: filter, + Icons: icons, + JSONSchema202012: json_schema_2020_12, + Layout: plugins_layout, + Logs: logs, + OpenAPI30: oas3, + OpenAPI31: oas3, + OnComplete: on_complete, + RequestSnippets: plugins_request_snippets, + Samples: samples, + Spec: plugins_spec, + SwaggerClient: swagger_client, + Util: util, + View: view, + DownloadUrl: downloadUrlPlugin, + SafeRender: safe_render +}; +;// CONCATENATED MODULE: ./src/index.js + + +/* harmony default export */ const src = (SwaggerUI); +})(); + +var __webpack_exports__default = __webpack_exports__.Z; +export { __webpack_exports__default as default }; diff --git a/docs/README.md b/docs/README.md index d0438008c4d..9b42682eaa4 100644 --- a/docs/README.md +++ b/docs/README.md @@ -17,6 +17,8 @@ Welcome to the Swagger UI documentation! - [Overview](customization/overview.md) - [Plugin API](customization/plugin-api.md) - [Custom layout](customization/custom-layout.md) +- [Adding plugin](customization/add-plugin.md) +- [Plug-Points](customization/plug-points.md) ## Development diff --git a/src/plugins/add-plugin.md b/docs/customization/add-plugin.md similarity index 100% rename from src/plugins/add-plugin.md rename to docs/customization/add-plugin.md diff --git a/package-lock.json b/package-lock.json index 02ddbc7001d..dfa24ea97e9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -51,11 +51,10 @@ "@babel/cli": "=7.22.10", "@babel/core": "=7.22.11", "@babel/eslint-parser": "=7.22.11", - "@babel/plugin-proposal-class-properties": "=7.18.6", - "@babel/plugin-proposal-nullish-coalescing-operator": "=7.18.6", - "@babel/plugin-proposal-object-rest-spread": "=7.20.7", - "@babel/plugin-proposal-optional-chaining": "=7.21.0", - "@babel/plugin-transform-modules-commonjs": "=7.22.11", + "@babel/plugin-transform-class-properties": "=7.22.5", + "@babel/plugin-transform-nullish-coalescing-operator": "=7.22.11", + "@babel/plugin-transform-object-rest-spread": "=7.22.15", + "@babel/plugin-transform-optional-chaining": "=7.22.15", "@babel/plugin-transform-runtime": "=7.22.10", "@babel/preset-env": "=7.22.14", "@babel/preset-react": "=7.22.5", @@ -96,6 +95,7 @@ "inspectpack": "=4.7.1", "jest": "=29.6.3", "jest-environment-jsdom": "=29.6.4", + "jest-transform-stub": "=2.0.0", "jsdom": "=22.1.0", "json-loader": "^0.5.7", "json-merger": "^1.1.10", @@ -309,13 +309,13 @@ } }, "node_modules/@babel/helper-compilation-targets": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz", - "integrity": "sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", + "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", "dev": true, "dependencies": { "@babel/compat-data": "^7.22.9", - "@babel/helper-validator-option": "^7.22.5", + "@babel/helper-validator-option": "^7.22.15", "browserslist": "^4.21.9", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -567,9 +567,9 @@ } }, "node_modules/@babel/helper-validator-option": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", - "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", + "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", "dev": true, "engines": { "node": ">=6.9.0" @@ -661,74 +661,6 @@ "@babel/core": "^7.13.0" } }, - "node_modules/@babel/plugin-proposal-class-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", - "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", - "dev": true, - "dependencies": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", - "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz", - "integrity": "sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==", - "dev": true, - "dependencies": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.20.7" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, - "node_modules/@babel/plugin-proposal-optional-chaining": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz", - "integrity": "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==", - "dev": true, - "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - }, - "engines": { - "node": ">=6.9.0" - }, - "peerDependencies": { - "@babel/core": "^7.0.0-0" - } - }, "node_modules/@babel/plugin-proposal-private-property-in-object": { "version": "7.21.0-placeholder-for-preset-env.2", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", @@ -1489,16 +1421,16 @@ } }, "node_modules/@babel/plugin-transform-object-rest-spread": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.11.tgz", - "integrity": "sha512-nX8cPFa6+UmbepISvlf5jhQyaC7ASs/7UxHmMkuJ/k5xSHvDPPaibMo+v3TXwU/Pjqhep/nFNpd3zn4YR59pnw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz", + "integrity": "sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==", "dev": true, "dependencies": { "@babel/compat-data": "^7.22.9", - "@babel/helper-compilation-targets": "^7.22.10", + "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.22.5" + "@babel/plugin-transform-parameters": "^7.22.15" }, "engines": { "node": ">=6.9.0" @@ -1540,9 +1472,9 @@ } }, "node_modules/@babel/plugin-transform-optional-chaining": { - "version": "7.22.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.12.tgz", - "integrity": "sha512-7XXCVqZtyFWqjDsYDY4T45w4mlx1rf7aOgkc/Ww76xkgBiOlmjPkx36PBLHa1k1rwWvVgYMPsbuVnIamx2ZQJw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.15.tgz", + "integrity": "sha512-ngQ2tBhq5vvSJw2Q2Z9i7ealNkpDMU0rGWnHPKqRZO0tzZ5tlaoz4hDvhXioOoaE0X2vfNss1djwg0DXlfu30A==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5", @@ -1557,9 +1489,9 @@ } }, "node_modules/@babel/plugin-transform-parameters": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz", - "integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz", + "integrity": "sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==", "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" @@ -17312,6 +17244,12 @@ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", "dev": true }, + "node_modules/jest-transform-stub": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jest-transform-stub/-/jest-transform-stub-2.0.0.tgz", + "integrity": "sha512-lspHaCRx/mBbnm3h4uMMS3R5aZzMwyNpNIJLXj4cEsV0mIUtS4IjYJLSoyjRCtnxb6RIGJ4NL2quZzfIeNhbkg==", + "dev": true + }, "node_modules/jest-util": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz", @@ -30129,13 +30067,13 @@ } }, "@babel/helper-compilation-targets": { - "version": "7.22.10", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.10.tgz", - "integrity": "sha512-JMSwHD4J7SLod0idLq5PKgI+6g/hLD/iuWBq08ZX49xE14VpVEojJ5rHWptpirV2j020MvypRLAXAO50igCJ5Q==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.22.15.tgz", + "integrity": "sha512-y6EEzULok0Qvz8yyLkCvVX+02ic+By2UdOhylwUOvOn9dvYc9mKICJuuU1n1XBI02YWsNsnrY1kc6DVbjcXbtw==", "dev": true, "requires": { "@babel/compat-data": "^7.22.9", - "@babel/helper-validator-option": "^7.22.5", + "@babel/helper-validator-option": "^7.22.15", "browserslist": "^4.21.9", "lru-cache": "^5.1.1", "semver": "^6.3.1" @@ -30315,9 +30253,9 @@ "dev": true }, "@babel/helper-validator-option": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.5.tgz", - "integrity": "sha512-R3oB6xlIVKUnxNUxbmgq7pKjxpru24zlimpE8WK47fACIlM0II/Hm1RS8IaOI7NgCr6LNS+jl5l75m20npAziw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-option/-/helper-validator-option-7.22.15.tgz", + "integrity": "sha512-bMn7RmyFjY/mdECUbgn9eoSY4vqvacUnS9i9vGAGttgFWesO6B4CYWA7XlpbWgBt71iv/hfbPlynohStqnu5hA==", "dev": true }, "@babel/helper-wrap-function": { @@ -30379,50 +30317,6 @@ "@babel/plugin-transform-optional-chaining": "^7.22.5" } }, - "@babel/plugin-proposal-class-properties": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz", - "integrity": "sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==", - "dev": true, - "requires": { - "@babel/helper-create-class-features-plugin": "^7.18.6", - "@babel/helper-plugin-utils": "^7.18.6" - } - }, - "@babel/plugin-proposal-nullish-coalescing-operator": { - "version": "7.18.6", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz", - "integrity": "sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.18.6", - "@babel/plugin-syntax-nullish-coalescing-operator": "^7.8.3" - } - }, - "@babel/plugin-proposal-object-rest-spread": { - "version": "7.20.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz", - "integrity": "sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg==", - "dev": true, - "requires": { - "@babel/compat-data": "^7.20.5", - "@babel/helper-compilation-targets": "^7.20.7", - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.20.7" - } - }, - "@babel/plugin-proposal-optional-chaining": { - "version": "7.21.0", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz", - "integrity": "sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==", - "dev": true, - "requires": { - "@babel/helper-plugin-utils": "^7.20.2", - "@babel/helper-skip-transparent-expression-wrappers": "^7.20.0", - "@babel/plugin-syntax-optional-chaining": "^7.8.3" - } - }, "@babel/plugin-proposal-private-property-in-object": { "version": "7.21.0-placeholder-for-preset-env.2", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0-placeholder-for-preset-env.2.tgz", @@ -30917,16 +30811,16 @@ } }, "@babel/plugin-transform-object-rest-spread": { - "version": "7.22.11", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.11.tgz", - "integrity": "sha512-nX8cPFa6+UmbepISvlf5jhQyaC7ASs/7UxHmMkuJ/k5xSHvDPPaibMo+v3TXwU/Pjqhep/nFNpd3zn4YR59pnw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-rest-spread/-/plugin-transform-object-rest-spread-7.22.15.tgz", + "integrity": "sha512-fEB+I1+gAmfAyxZcX1+ZUwLeAuuf8VIg67CTznZE0MqVFumWkh8xWtn58I4dxdVf080wn7gzWoF8vndOViJe9Q==", "dev": true, "requires": { "@babel/compat-data": "^7.22.9", - "@babel/helper-compilation-targets": "^7.22.10", + "@babel/helper-compilation-targets": "^7.22.15", "@babel/helper-plugin-utils": "^7.22.5", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.22.5" + "@babel/plugin-transform-parameters": "^7.22.15" } }, "@babel/plugin-transform-object-super": { @@ -30950,9 +30844,9 @@ } }, "@babel/plugin-transform-optional-chaining": { - "version": "7.22.12", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.12.tgz", - "integrity": "sha512-7XXCVqZtyFWqjDsYDY4T45w4mlx1rf7aOgkc/Ww76xkgBiOlmjPkx36PBLHa1k1rwWvVgYMPsbuVnIamx2ZQJw==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.22.15.tgz", + "integrity": "sha512-ngQ2tBhq5vvSJw2Q2Z9i7ealNkpDMU0rGWnHPKqRZO0tzZ5tlaoz4hDvhXioOoaE0X2vfNss1djwg0DXlfu30A==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5", @@ -30961,9 +30855,9 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.22.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.5.tgz", - "integrity": "sha512-AVkFUBurORBREOmHRKo06FjHYgjrabpdqRSwq6+C7R5iTCZOsM4QbcB27St0a4U6fffyAOqh3s/qEfybAhfivg==", + "version": "7.22.15", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.22.15.tgz", + "integrity": "sha512-hjk7qKIqhyzhhUvRT683TYQOFa/4cQKwQy7ALvTpODswN40MljzNDa0YldevS6tGbxwaEKVn502JmY0dP7qEtQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" @@ -42495,6 +42389,12 @@ } } }, + "jest-transform-stub": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jest-transform-stub/-/jest-transform-stub-2.0.0.tgz", + "integrity": "sha512-lspHaCRx/mBbnm3h4uMMS3R5aZzMwyNpNIJLXj4cEsV0mIUtS4IjYJLSoyjRCtnxb6RIGJ4NL2quZzfIeNhbkg==", + "dev": true + }, "jest-util": { "version": "29.6.3", "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-29.6.3.tgz", diff --git a/package.json b/package.json index e7123a569f8..a5df3572892 100644 --- a/package.json +++ b/package.json @@ -39,28 +39,28 @@ "automated-release": "release-it -VV --config ./release/.release-it.json", "build": "npm run build-stylesheets && rimraf ./dist/swagger-ui.js ./dist/swagger-ui.js.map && npm run build-all-bundles", "build-all-bundles": "run-p --aggregate-output build:core build:bundle build:standalone build:es:bundle build:es:bundle:core", - "build-stylesheets": "webpack --color --config webpack/stylesheets.babel.js", - "build:bundle": "webpack --color --config webpack/bundle.babel.js", - "build:core": "webpack --color --config webpack/core.babel.js", - "build:standalone": "webpack --color --config webpack/standalone.babel.js", - "build:es:bundle": "webpack --color --config webpack/es-bundle.babel.js", - "build:es:bundle:core": "webpack --color --config webpack/es-bundle-core.babel.js", + "build-stylesheets": "cross-env NODE_ENV=production webpack --color --config webpack/stylesheets.js", + "build:bundle": "cross-env NODE_ENV=production webpack --color --config webpack/bundle.js", + "build:core": "cross-env NODE_ENV=production webpack --color --config webpack/core.js", + "build:standalone": "cross-env NODE_ENV=production webpack --color --config webpack/standalone.js", + "build:es:bundle": "cross-env NODE_ENV=production webpack --color --config webpack/es-bundle.js", + "build:es:bundle:core": "cross-env NODE_ENV=production BABEL_ENV=esm webpack --color --config webpack/es-bundle-core.js", "clean": "rimraf ./dist", "postinstall": "patch-package", - "dev": "webpack serve --config webpack/dev.babel.js", + "dev": "cross-env NODE_ENV=development webpack serve --config webpack/dev.js", "deps-license": "license-checker --production --csv --out $npm_package_config_deps_check_dir/licenses.csv && license-checker --development --csv --out $npm_package_config_deps_check_dir/licenses-dev.csv", - "deps-size": "webpack -p --config webpack/bundle.babel.js --json | webpack-bundle-size-analyzer >| $npm_package_config_deps_check_dir/sizes.txt", + "deps-size": "cross-env NODE_ENV=development webpack -p --config webpack/bundle.js --json | webpack-bundle-size-analyzer >| $npm_package_config_deps_check_dir/sizes.txt", "deps-check": "run-s deps-license deps-size", "lint": "eslint --ext \".js,.jsx\" src test dev-helpers flavors", "lint-errors": "eslint --quiet --ext \".js,.jsx\" src test dev-helpers flavors", "lint-fix": "eslint --ext \".js,.jsx\" src test dev-helpers flavors --fix", "test": "run-s lint-errors just-test-in-node test:unit-jest cy:ci", "test-in-node": "run-s lint-errors just-test-in-node", - "just-test-in-node": "cross-env BABEL_ENV=test mocha \"test/mocha/**/*.{js,jsx}\"", - "test:artifact": "jest --config ./config/jest/jest.artifact.config.js", - "test:unit-jest": "cross-env BABEL_ENV=test jest --config ./config/jest/jest.unit.config.js", + "just-test-in-node": "cross-env NODE_ENV=test mocha \"test/mocha/**/*.{js,jsx}\"", + "test:artifact": "cross-env NODE_ENV=production jest --config ./config/jest/jest.artifact.config.js", + "test:unit-jest": "cross-env NODE_ENV=test jest --config ./config/jest/jest.unit.config.js", "cy:mock-api": "json-server --watch test/e2e-selenium/db.json --port 3204", - "cy:server": "webpack serve --config webpack/dev-e2e.babel.js", + "cy:server": "cross-env NODE_ENV=production webpack serve --config webpack/dev-e2e.js", "cy:start": "run-p -r cy:server cy:mock-api", "cy:open": "cypress open", "cy:run": "cypress run", @@ -115,11 +115,10 @@ "@babel/cli": "=7.22.10", "@babel/core": "=7.22.11", "@babel/eslint-parser": "=7.22.11", - "@babel/plugin-proposal-class-properties": "=7.18.6", - "@babel/plugin-proposal-nullish-coalescing-operator": "=7.18.6", - "@babel/plugin-proposal-object-rest-spread": "=7.20.7", - "@babel/plugin-proposal-optional-chaining": "=7.21.0", - "@babel/plugin-transform-modules-commonjs": "=7.22.11", + "@babel/plugin-transform-class-properties": "=7.22.5", + "@babel/plugin-transform-nullish-coalescing-operator": "=7.22.11", + "@babel/plugin-transform-object-rest-spread": "=7.22.15", + "@babel/plugin-transform-optional-chaining": "=7.22.15", "@babel/plugin-transform-runtime": "=7.22.10", "@babel/preset-env": "=7.22.14", "@babel/preset-react": "=7.22.5", @@ -160,6 +159,7 @@ "inspectpack": "=4.7.1", "jest": "=29.6.3", "jest-environment-jsdom": "=29.6.4", + "jest-transform-stub": "=2.0.0", "jsdom": "=22.1.0", "json-loader": "^0.5.7", "json-merger": "^1.1.10", diff --git a/src/img/rolling-load.svg b/src/core/assets/rolling-load.svg similarity index 100% rename from src/img/rolling-load.svg rename to src/core/assets/rolling-load.svg diff --git a/src/core/brace-snippets-yaml.js b/src/core/brace-snippets-yaml.js deleted file mode 100644 index 1130e70c252..00000000000 --- a/src/core/brace-snippets-yaml.js +++ /dev/null @@ -1,6 +0,0 @@ -/* global ace */ -ace.define("ace/snippets/yaml", - ["require","exports","module"], function(e,t,n){ // eslint-disable-line no-unused-vars - t.snippetText=undefined - t.scope="yaml" - }) diff --git a/src/core/json-schema-components.jsx b/src/core/components/json-schema-components.jsx similarity index 100% rename from src/core/json-schema-components.jsx rename to src/core/components/json-schema-components.jsx diff --git a/src/core/components/model.jsx b/src/core/components/model.jsx index 4b420f367e6..a5e505da67f 100644 --- a/src/core/components/model.jsx +++ b/src/core/components/model.jsx @@ -3,6 +3,8 @@ import ImmutablePureComponent from "react-immutable-pure-component" import ImPropTypes from "react-immutable-proptypes" import PropTypes from "prop-types" +import RollingLoadSVG from "core/assets/rolling-load.svg" + const decodeRefName = uri => { const unescaped = uri.replace(/~1/g, "/").replace(/~0/g, "~") @@ -66,7 +68,7 @@ export default class Model extends ImmutablePureComponent { if(!schema) { return { displayName || name } - + } diff --git a/src/core/components/operation.jsx b/src/core/components/operation.jsx index f0c9e5129de..6e3f2f8a969 100644 --- a/src/core/components/operation.jsx +++ b/src/core/components/operation.jsx @@ -6,6 +6,7 @@ import { safeBuildUrl } from "core/utils/url" import { Iterable, List } from "immutable" import ImPropTypes from "react-immutable-proptypes" +import RollingLoadSVG from "core/assets/rolling-load.svg" export default class Operation extends PureComponent { static propTypes = { @@ -122,7 +123,7 @@ export default class Operation extends PureComponent {
{ (operation && operation.size) || operation === null ? null : - + } { deprecated &&

Warning: Deprecated

} { description && @@ -140,7 +141,7 @@ export default class Operation extends PureComponent { {externalDocs.description && - + } {externalDocsUrl}
diff --git a/src/core/components/parameter-row.jsx b/src/core/components/parameter-row.jsx index fa709ce1b10..f3c88f369ce 100644 --- a/src/core/components/parameter-row.jsx +++ b/src/core/components/parameter-row.jsx @@ -4,7 +4,7 @@ import PropTypes from "prop-types" import ImPropTypes from "react-immutable-proptypes" import win from "core/window" import { getExtensions, getCommonExtensions, numberToString, stringify, isEmptyValue } from "core/utils" -import getParameterSchema from "../../helpers/get-parameter-schema.js" +import getParameterSchema from "core/utils/get-parameter-schema.js" export default class ParameterRow extends Component { static propTypes = { diff --git a/src/core/components/responses.jsx b/src/core/components/responses.jsx index 8b73582cd57..d6bc8bbe78b 100644 --- a/src/core/components/responses.jsx +++ b/src/core/components/responses.jsx @@ -3,7 +3,7 @@ import { fromJS, Iterable } from "immutable" import PropTypes from "prop-types" import ImPropTypes from "react-immutable-proptypes" import { defaultStatusCode, getAcceptControllingResponse } from "core/utils" -import createHtmlReadyId from "../../helpers/create-html-ready-id" +import createHtmlReadyId from "core/utils/create-html-ready-id" export default class Responses extends React.Component { static propTypes = { diff --git a/src/core/index.js b/src/core/index.js index f7f3981fb81..df2bc2cbc5c 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -1,8 +1,31 @@ import deepExtend from "deep-extend" import System from "./system" +// presets +import BasePreset from "./presets/base" import ApisPreset from "./presets/apis" -import AllPlugins from "./plugins/all" +// plugins +import AuthPlugin from "./plugins/auth/" +import ConfigsPlugin from "./plugins/configs" +import DeepLinkingPlugin from "./plugins/deep-linking" +import ErrPlugin from "./plugins/err" +import FilterPlugin from "./plugins/filter" +import IconsPlugin from "./plugins/icons" +import JSONSchema202012Plugin from "./plugins/json-schema-2020-12" +import LayoutPlugin from "./plugins/layout" +import LogsPlugin from "./plugins/logs" +import OpenAPI30Plugin from "./plugins/oas3" +import OpenAPI31Plugin from "./plugins/oas3" +import OnCompletePlugin from "./plugins/on-complete" +import RequestSnippetsPlugin from "./plugins/request-snippets" +import SamplesPlugin from "./plugins/samples" +import SpecPlugin from "./plugins/spec" +import SwaggerClientPlugin from "./plugins/swagger-client" +import UtilPlugin from "./plugins/util" +import ViewPlugin from "./plugins/view" +import DownloadUrlPlugin from "./plugins/download-url" +import SafeRenderPlugin from "./plugins/safe-render" + import { parseSearch } from "./utils" import win from "./window" @@ -216,10 +239,30 @@ export default function SwaggerUI(opts) { return system } -// Add presets SwaggerUI.presets = { + base: BasePreset, apis: ApisPreset, } -// All Plugins -SwaggerUI.plugins = AllPlugins +SwaggerUI.plugins = { + Auth: AuthPlugin, + Configs: ConfigsPlugin, + DeepLining: DeepLinkingPlugin, + Err: ErrPlugin, + Filter: FilterPlugin, + Icons: IconsPlugin, + JSONSchema202012: JSONSchema202012Plugin, + Layout: LayoutPlugin, + Logs: LogsPlugin, + OpenAPI30: OpenAPI30Plugin, + OpenAPI31: OpenAPI31Plugin, + OnComplete: OnCompletePlugin, + RequestSnippets: RequestSnippetsPlugin, + Samples: SamplesPlugin, + Spec: SpecPlugin, + SwaggerClient: SwaggerClientPlugin, + Util: UtilPlugin, + View: ViewPlugin, + DownloadUrl: DownloadUrlPlugin, + SafeRender: SafeRenderPlugin, +} diff --git a/src/core/plugins/all.js b/src/core/plugins/all.js deleted file mode 100644 index 7e6ed0ccd7e..00000000000 --- a/src/core/plugins/all.js +++ /dev/null @@ -1,24 +0,0 @@ -import { pascalCaseFilename } from "core/utils" -import SafeRender from "core/plugins/safe-render" - -const request = require.context(".", true, /\.jsx?$/) - -const allPlugins = {} - -export default allPlugins - -request.keys().forEach( function( key ){ - if( key === "./index.js" ) { - return - } - - // if( key.slice(2).indexOf("/") > -1) { - // // skip files in subdirs - // return - // } - - let mod = request(key) - allPlugins[pascalCaseFilename(key)] = mod.default ? mod.default : mod -}) - -allPlugins.SafeRender = SafeRender diff --git a/src/core/plugins/download-url.js b/src/core/plugins/download-url.js deleted file mode 100644 index 527cc03b24d..00000000000 --- a/src/core/plugins/download-url.js +++ /dev/null @@ -1,110 +0,0 @@ -import { createSelector } from "reselect" -import { Map } from "immutable" -import win from "../window" - -export default function downloadUrlPlugin (toolbox) { - let { fn } = toolbox - - const actions = { - download: (url)=> ({ errActions, specSelectors, specActions, getConfigs }) => { - let { fetch } = fn - const config = getConfigs() - url = url || specSelectors.url() - specActions.updateLoadingStatus("loading") - errActions.clear({source: "fetch"}) - fetch({ - url, - loadSpec: true, - requestInterceptor: config.requestInterceptor || (a => a), - responseInterceptor: config.responseInterceptor || (a => a), - credentials: "same-origin", - headers: { - "Accept": "application/json,*/*" - } - }).then(next,next) - - function next(res) { - if(res instanceof Error || res.status >= 400) { - specActions.updateLoadingStatus("failed") - errActions.newThrownErr(Object.assign( new Error((res.message || res.statusText) + " " + url), {source: "fetch"})) - // Check if the failure was possibly due to CORS or mixed content - if (!res.status && res instanceof Error) checkPossibleFailReasons() - return - } - specActions.updateLoadingStatus("success") - specActions.updateSpec(res.text) - if(specSelectors.url() !== url) { - specActions.updateUrl(url) - } - } - - function checkPossibleFailReasons() { - try { - let specUrl - - if("URL" in win ) { - specUrl = new URL(url) - } else { - // legacy browser, use
to parse the URL - specUrl = document.createElement("a") - specUrl.href = url - } - - if(specUrl.protocol !== "https:" && win.location.protocol === "https:") { - const error = Object.assign( - new Error(`Possible mixed-content issue? The page was loaded over https:// but a ${specUrl.protocol}// URL was specified. Check that you are not attempting to load mixed content.`), - {source: "fetch"} - ) - errActions.newThrownErr(error) - return - } - if(specUrl.origin !== win.location.origin) { - const error = Object.assign( - new Error(`Possible cross-origin (CORS) issue? The URL origin (${specUrl.origin}) does not match the page (${win.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.`), - {source: "fetch"} - ) - errActions.newThrownErr(error) - } - } catch (e) { - return - } - } - - }, - - updateLoadingStatus: (status) => { - let enums = [null, "loading", "failed", "success", "failedConfig"] - if(enums.indexOf(status) === -1) { - console.error(`Error: ${status} is not one of ${JSON.stringify(enums)}`) - } - - return { - type: "spec_update_loading_status", - payload: status - } - } - } - - let reducers = { - "spec_update_loading_status": (state, action) => { - return (typeof action.payload === "string") - ? state.set("loadingStatus", action.payload) - : state - } - } - - let selectors = { - loadingStatus: createSelector( - state => { - return state || Map() - }, - spec => spec.get("loadingStatus") || null - ) - } - - return { - statePlugins: { - spec: { actions, reducers, selectors } - } - } -} diff --git a/src/core/plugins/download-url/index.js b/src/core/plugins/download-url/index.js new file mode 100644 index 00000000000..710a4664220 --- /dev/null +++ b/src/core/plugins/download-url/index.js @@ -0,0 +1,126 @@ +/** + * @prettier + */ +import { createSelector } from "reselect" +import { Map } from "immutable" +import win from "core/window" + +export default function downloadUrlPlugin(toolbox) { + let { fn } = toolbox + + const actions = { + download: + (url) => + ({ errActions, specSelectors, specActions, getConfigs }) => { + let { fetch } = fn + const config = getConfigs() + url = url || specSelectors.url() + specActions.updateLoadingStatus("loading") + errActions.clear({ source: "fetch" }) + fetch({ + url, + loadSpec: true, + requestInterceptor: config.requestInterceptor || ((a) => a), + responseInterceptor: config.responseInterceptor || ((a) => a), + credentials: "same-origin", + headers: { + Accept: "application/json,*/*", + }, + }).then(next, next) + + function next(res) { + if (res instanceof Error || res.status >= 400) { + specActions.updateLoadingStatus("failed") + errActions.newThrownErr( + Object.assign( + new Error((res.message || res.statusText) + " " + url), + { source: "fetch" } + ) + ) + // Check if the failure was possibly due to CORS or mixed content + if (!res.status && res instanceof Error) checkPossibleFailReasons() + return + } + specActions.updateLoadingStatus("success") + specActions.updateSpec(res.text) + if (specSelectors.url() !== url) { + specActions.updateUrl(url) + } + } + + function checkPossibleFailReasons() { + try { + let specUrl + + if ("URL" in win) { + specUrl = new URL(url) + } else { + // legacy browser, use to parse the URL + specUrl = document.createElement("a") + specUrl.href = url + } + + if ( + specUrl.protocol !== "https:" && + win.location.protocol === "https:" + ) { + const error = Object.assign( + new Error( + `Possible mixed-content issue? The page was loaded over https:// but a ${specUrl.protocol}// URL was specified. Check that you are not attempting to load mixed content.` + ), + { source: "fetch" } + ) + errActions.newThrownErr(error) + return + } + if (specUrl.origin !== win.location.origin) { + const error = Object.assign( + new Error( + `Possible cross-origin (CORS) issue? The URL origin (${specUrl.origin}) does not match the page (${win.location.origin}). Check the server returns the correct 'Access-Control-Allow-*' headers.` + ), + { source: "fetch" } + ) + errActions.newThrownErr(error) + } + } catch (e) { + return + } + } + }, + + updateLoadingStatus: (status) => { + let enums = [null, "loading", "failed", "success", "failedConfig"] + if (enums.indexOf(status) === -1) { + console.error(`Error: ${status} is not one of ${JSON.stringify(enums)}`) + } + + return { + type: "spec_update_loading_status", + payload: status, + } + }, + } + + let reducers = { + spec_update_loading_status: (state, action) => { + return typeof action.payload === "string" + ? state.set("loadingStatus", action.payload) + : state + }, + } + + let selectors = { + loadingStatus: createSelector( + (state) => { + return state || Map() + }, + (spec) => spec.get("loadingStatus") || null + ), + } + + return { + statePlugins: { + spec: { actions, reducers, selectors }, + }, + } +} diff --git a/src/core/plugins/json-schema-2020-12/samples-extensions/fn/main.js b/src/core/plugins/json-schema-2020-12/samples-extensions/fn/main.js index ee57f223ebd..b923fbcdcf6 100644 --- a/src/core/plugins/json-schema-2020-12/samples-extensions/fn/main.js +++ b/src/core/plugins/json-schema-2020-12/samples-extensions/fn/main.js @@ -6,7 +6,7 @@ import isEmpty from "lodash/isEmpty" import isPlainObject from "lodash/isPlainObject" import { objectify, normalizeArray } from "core/utils" -import memoizeN from "../../../../../helpers/memoizeN" +import memoizeN from "core/utils/memoizeN" import typeMap from "./types/index" import { getType } from "./core/type" import { typeCast } from "./core/utils" diff --git a/src/core/plugins/oas3/selectors.js b/src/core/plugins/oas3/selectors.js index eb24526ef45..8dce935ad45 100644 --- a/src/core/plugins/oas3/selectors.js +++ b/src/core/plugins/oas3/selectors.js @@ -5,7 +5,7 @@ import { OrderedMap, Map, List } from "immutable" import { createSelector } from "reselect" import { getDefaultRequestBodyValue } from "./components/request-body" -import { stringify } from "../../utils" +import { stringify } from "core/utils" // Helpers diff --git a/src/core/plugins/request-snippets/fn.js b/src/core/plugins/request-snippets/fn.js index 33ecb801532..7244eef6703 100644 --- a/src/core/plugins/request-snippets/fn.js +++ b/src/core/plugins/request-snippets/fn.js @@ -1,5 +1,6 @@ -import win from "../../window" import { Map } from "immutable" +import win from "../../window" + /** * if duplicate key name existed from FormData entries, diff --git a/src/core/plugins/samples/fn/index.js b/src/core/plugins/samples/fn/index.js index 340867bceea..0e5b1305e1e 100644 --- a/src/core/plugins/samples/fn/index.js +++ b/src/core/plugins/samples/fn/index.js @@ -2,8 +2,7 @@ import XML from "xml" import RandExp from "randexp" import isEmpty from "lodash/isEmpty" import { objectify, isFunc, normalizeArray, deeplyStripKey } from "core/utils" - -import memoizeN from "../../../../helpers/memoizeN" +import memoizeN from "core/utils/memoizeN" const generateStringFromRegex = (pattern) => { try { diff --git a/src/core/plugins/spec/index.js b/src/core/plugins/spec/index.js index 4f3aab2c995..cb474a78c0f 100644 --- a/src/core/plugins/spec/index.js +++ b/src/core/plugins/spec/index.js @@ -1,17 +1,20 @@ +/** + * @prettier + */ import reducers from "./reducers" import * as actions from "./actions" import * as selectors from "./selectors" import * as wrapActions from "./wrap-actions" -export default function() { - return { - statePlugins: { - spec: { - wrapActions, - reducers, - actions, - selectors - } - } - } -} +const SpecPlugin = () => ({ + statePlugins: { + spec: { + wrapActions: { ...wrapActions }, + reducers: { ...reducers }, + actions: { ...actions }, + selectors: { ...selectors }, + }, + }, +}) + +export default SpecPlugin diff --git a/src/core/plugins/spec/reducers.js b/src/core/plugins/spec/reducers.js index e9eba190481..ce1b4cf2828 100644 --- a/src/core/plugins/spec/reducers.js +++ b/src/core/plugins/spec/reducers.js @@ -1,6 +1,6 @@ import { fromJS, List } from "immutable" -import { fromJSOrdered, validateParam, paramToValue } from "core/utils" -import win from "../../window" +import { fromJSOrdered, validateParam, paramToValue, paramToIdentifier } from "core/utils" +import win from "core/window" // selector-in-reducer is suboptimal, but `operationWithMeta` is more of a helper import { @@ -27,7 +27,6 @@ import { CLEAR_VALIDATE_PARAMS, SET_SCHEME } from "./actions" -import { paramToIdentifier } from "../../utils" export default { diff --git a/src/core/plugins/spec/selectors.js b/src/core/plugins/spec/selectors.js index 19c6b1dde3a..e8619aa7112 100644 --- a/src/core/plugins/spec/selectors.js +++ b/src/core/plugins/spec/selectors.js @@ -1,7 +1,6 @@ import { createSelector } from "reselect" -import { sorters } from "core/utils" +import { sorters, paramToIdentifier } from "core/utils" import { fromJS, Set, Map, OrderedMap, List } from "immutable" -import { paramToIdentifier } from "../../utils" const DEFAULT_TAG = "default" diff --git a/src/core/plugins/swagger-js/configs-wrap-actions.js b/src/core/plugins/swagger-client/configs-wrap-actions.js similarity index 100% rename from src/core/plugins/swagger-js/configs-wrap-actions.js rename to src/core/plugins/swagger-client/configs-wrap-actions.js diff --git a/src/core/plugins/swagger-js/index.js b/src/core/plugins/swagger-client/index.js similarity index 100% rename from src/core/plugins/swagger-js/index.js rename to src/core/plugins/swagger-client/index.js diff --git a/src/core/plugins/view/index.js b/src/core/plugins/view/index.js index 113f77ff968..be3cbd45bb4 100644 --- a/src/core/plugins/view/index.js +++ b/src/core/plugins/view/index.js @@ -1,8 +1,8 @@ import { memoize } from "core/utils" +import memoizeN from "core/utils/memoizeN" import { getComponent, render, withMappedContainer } from "./root-injects" import { getDisplayName } from "./fn" -import memoizeN from "../../../helpers/memoizeN" const memoizeForGetComponent = (fn) => { const resolver = (...args) => JSON.stringify(args) diff --git a/src/core/presets/apis.js b/src/core/presets/apis.js deleted file mode 100644 index 4498aee52f4..00000000000 --- a/src/core/presets/apis.js +++ /dev/null @@ -1,11 +0,0 @@ -/** - * @prettier - */ -import BasePreset from "./base" -import OAS3Plugin from "../plugins/oas3" -import OAS31Plugin from "../plugins/oas31" -import JSONSchema202012Plugin from "../plugins/json-schema-2020-12" - -export default function PresetApis() { - return [BasePreset, OAS3Plugin, JSONSchema202012Plugin, OAS31Plugin] -} diff --git a/src/core/presets/apis/index.js b/src/core/presets/apis/index.js new file mode 100644 index 00000000000..a2966ba5d3d --- /dev/null +++ b/src/core/presets/apis/index.js @@ -0,0 +1,11 @@ +/** + * @prettier + */ +import BasePreset from "core/presets/base" +import OpenAPI30Plugin from "core/plugins/oas3" +import OpenAPI31Plugin from "core/plugins/oas31" +import JSONSchema202012Plugin from "core/plugins/json-schema-2020-12" + +export default function PresetApis() { + return [BasePreset, OpenAPI30Plugin, JSONSchema202012Plugin, OpenAPI31Plugin] +} diff --git a/src/core/presets/base/index.js b/src/core/presets/base/index.js new file mode 100644 index 00000000000..1fdc49c943b --- /dev/null +++ b/src/core/presets/base/index.js @@ -0,0 +1,49 @@ +/** + * @prettier + */ +import AuthPlugin from "core/plugins/auth/" +import ConfigsPlugin from "core/plugins/configs" +import DeepLinkingPlugin from "core/plugins/deep-linking" +import ErrPlugin from "core/plugins/err" +import FilterPlugin from "core/plugins/filter" +import IconsPlugin from "core/plugins/icons" +import LayoutPlugin from "core/plugins/layout" +import LogsPlugin from "core/plugins/logs" +import OnCompletePlugin from "core/plugins/on-complete" +import RequestSnippetsPlugin from "core/plugins/request-snippets" +import SamplesPlugin from "core/plugins/samples" +import SpecPlugin from "core/plugins/spec" +import SwaggerClientPlugin from "core/plugins/swagger-client" +import UtilPlugin from "core/plugins/util" +import ViewPlugin from "core/plugins/view" +import DownloadUrlPlugin from "core/plugins/download-url" +import SafeRenderPlugin from "core/plugins/safe-render" +// ad-hoc plugins +import CoreComponentsPlugin from "core/presets/base/plugins/core-components" +import FormComponentsPlugin from "core/presets/base/plugins/form-components" +import JSONSchemaComponentsPlugin from "core/presets/base/plugins/json-schema-components" + +const BasePreset = () => [ + ConfigsPlugin, + UtilPlugin, + LogsPlugin, + ViewPlugin, + SpecPlugin, + ErrPlugin, + IconsPlugin, + LayoutPlugin, + SamplesPlugin, + CoreComponentsPlugin, + FormComponentsPlugin, + SwaggerClientPlugin, + JSONSchemaComponentsPlugin, + AuthPlugin, + DownloadUrlPlugin, + DeepLinkingPlugin, + FilterPlugin, + OnCompletePlugin, + RequestSnippetsPlugin, + SafeRenderPlugin(), +] + +export default BasePreset diff --git a/src/core/presets/base.js b/src/core/presets/base/plugins/core-components/index.js similarity index 55% rename from src/core/presets/base.js rename to src/core/presets/base/plugins/core-components/index.js index 4c483123675..4ba1f455365 100644 --- a/src/core/presets/base.js +++ b/src/core/presets/base/plugins/core-components/index.js @@ -1,26 +1,6 @@ /** * @prettier */ -import err from "core/plugins/err" -import layout from "core/plugins/layout" -import spec from "core/plugins/spec" -import view from "core/plugins/view" -import samples from "core/plugins/samples" -import requestSnippets from "core/plugins/request-snippets" -import logs from "core/plugins/logs" -import swaggerJs from "core/plugins/swagger-js" -import auth from "core/plugins/auth" -import util from "core/plugins/util" -import downloadUrlPlugin from "core/plugins/download-url" -import configsPlugin from "core/plugins/configs" -import deepLinkingPlugin from "core/plugins/deep-linking" -import filter from "core/plugins/filter" -import onComplete from "core/plugins/on-complete" -import safeRender from "core/plugins/safe-render" -import iconsPlugin from "core/plugins/icons" - -import OperationContainer from "core/containers/OperationContainer" - import App from "core/components/app" import AuthorizationPopup from "core/components/auth/authorization-popup" import AuthorizeBtn from "core/components/auth/authorize-btn" @@ -41,6 +21,7 @@ import OnlineValidatorBadge from "core/components/online-validator-badge" import Operations from "core/components/operations" import OperationTag from "core/components/operation-tag" import Operation from "core/components/operation" +import OperationContainer from "core/containers/OperationContainer" import OperationSummary from "core/components/operation-summary" import OperationSummaryMethod from "core/components/operation-summary-method" import OperationSummaryPath from "core/components/operation-summary-path" @@ -91,116 +72,83 @@ import DeepLink from "core/components/deep-link" import SvgAssets from "core/components/svg-assets" import Markdown from "core/components/providers/markdown" import BaseLayout from "core/components/layouts/base" -import * as LayoutUtils from "core/components/layout-utils" -import * as JsonSchemaComponents from "core/json-schema-components" - -export default function () { - let coreComponents = { - components: { - App, - authorizationPopup: AuthorizationPopup, - authorizeBtn: AuthorizeBtn, - AuthorizeBtnContainer, - authorizeOperationBtn: AuthorizeOperationBtn, - auths: Auths, - AuthItem: AuthItem, - authError: AuthError, - oauth2: Oauth2, - apiKeyAuth: ApiKeyAuth, - basicAuth: BasicAuth, - clear: Clear, - liveResponse: LiveResponse, - InitializedInput, - info: Info, - InfoContainer, - InfoUrl, - InfoBasePath, - Contact, - License, - JumpToPath, - CopyToClipboardBtn, - onlineValidatorBadge: OnlineValidatorBadge, - operations: Operations, - operation: Operation, - OperationSummary, - OperationSummaryMethod, - OperationSummaryPath, - highlightCode: HighlightCode, - responses: Responses, - response: Response, - ResponseExtension: ResponseExtension, - responseBody: ResponseBody, - parameters: Parameters, - parameterRow: ParameterRow, - execute: Execute, - headers: Headers, - errors: Errors, - contentType: ContentType, - overview: Overview, - footer: Footer, - FilterContainer, - ParamBody: ParamBody, - curl: Curl, - schemes: Schemes, - SchemesContainer, - modelExample: ModelExample, - ModelWrapper, - ModelCollapse, - Model, - Models, - EnumModel, - ObjectModel, - ArrayModel, - PrimitiveModel, - Property, - TryItOutButton, - Markdown, - BaseLayout, - VersionPragmaFilter, - VersionStamp, - OpenAPIVersion, - OperationExt, - OperationExtRow, - ParameterExt, - ParameterIncludeEmpty, - OperationTag, - OperationContainer, - DeepLink, - SvgAssets, - Example, - ExamplesSelect, - ExamplesSelectValueRetainer, - }, - } - - let formComponents = { - components: LayoutUtils, - } - let jsonSchemaComponents = { - components: JsonSchemaComponents, - } +const CoreComponentsPlugin = () => ({ + components: { + App, + authorizationPopup: AuthorizationPopup, + authorizeBtn: AuthorizeBtn, + AuthorizeBtnContainer, + authorizeOperationBtn: AuthorizeOperationBtn, + auths: Auths, + AuthItem: AuthItem, + authError: AuthError, + oauth2: Oauth2, + apiKeyAuth: ApiKeyAuth, + basicAuth: BasicAuth, + clear: Clear, + liveResponse: LiveResponse, + InitializedInput, + info: Info, + InfoContainer, + InfoUrl, + InfoBasePath, + Contact, + License, + JumpToPath, + CopyToClipboardBtn, + onlineValidatorBadge: OnlineValidatorBadge, + operations: Operations, + operation: Operation, + OperationSummary, + OperationSummaryMethod, + OperationSummaryPath, + highlightCode: HighlightCode, + responses: Responses, + response: Response, + ResponseExtension: ResponseExtension, + responseBody: ResponseBody, + parameters: Parameters, + parameterRow: ParameterRow, + execute: Execute, + headers: Headers, + errors: Errors, + contentType: ContentType, + overview: Overview, + footer: Footer, + FilterContainer, + ParamBody: ParamBody, + curl: Curl, + schemes: Schemes, + SchemesContainer, + modelExample: ModelExample, + ModelWrapper, + ModelCollapse, + Model, + Models, + EnumModel, + ObjectModel, + ArrayModel, + PrimitiveModel, + Property, + TryItOutButton, + Markdown, + BaseLayout, + VersionPragmaFilter, + VersionStamp, + OperationExt, + OperationExtRow, + ParameterExt, + ParameterIncludeEmpty, + OperationTag, + OperationContainer, + OpenAPIVersion, + DeepLink, + SvgAssets, + Example, + ExamplesSelect, + ExamplesSelectValueRetainer, + }, +}) - return [ - configsPlugin, - util, - logs, - view, - spec, - err, - layout, - samples, - coreComponents, - formComponents, - swaggerJs, - jsonSchemaComponents, - auth, - downloadUrlPlugin, - deepLinkingPlugin, - filter, - onComplete, - requestSnippets, - iconsPlugin, - safeRender(), - ] -} +export default CoreComponentsPlugin diff --git a/src/core/presets/base/plugins/form-components/index.js b/src/core/presets/base/plugins/form-components/index.js new file mode 100644 index 00000000000..f088a3a752d --- /dev/null +++ b/src/core/presets/base/plugins/form-components/index.js @@ -0,0 +1,10 @@ +/** + * @prettier + */ +import * as LayoutUtils from "core/components/layout-utils" + +const FormComponentsPlugin = () => ({ + components: { ...LayoutUtils }, +}) + +export default FormComponentsPlugin diff --git a/src/core/presets/base/plugins/json-schema-components/index.js b/src/core/presets/base/plugins/json-schema-components/index.js new file mode 100644 index 00000000000..aa1c40a071f --- /dev/null +++ b/src/core/presets/base/plugins/json-schema-components/index.js @@ -0,0 +1,10 @@ +/** + * @prettier + */ +import * as JSONSchemaComponents from "core/components/json-schema-components" + +const JSONSchemaComponentsPlugin = () => ({ + components: { ...JSONSchemaComponents }, +}) + +export default JSONSchemaComponentsPlugin diff --git a/src/core/proptypes.js b/src/core/proptypes.js deleted file mode 100644 index d669e6fa1ad..00000000000 --- a/src/core/proptypes.js +++ /dev/null @@ -1,16 +0,0 @@ -import PropTypes from "prop-types" - -// Takes a list and proptype, and returns a PropType.shape({ [item]: propType }) -const mapListToPropTypeShape = (list, propType) => PropTypes.shape( - list.reduce((shape, propName) => { - shape[propName] = propType - return shape -}, {})) - - -export const arrayOrString = PropTypes.oneOfType([ - PropTypes.arrayOf(PropTypes.string), - PropTypes.string, -]) - -export const objectWithFuncs = list => mapListToPropTypeShape(list, PropTypes.func.isRequired) diff --git a/src/core/system.js b/src/core/system.js index a1d55082567..54eea0782e1 100644 --- a/src/core/system.js +++ b/src/core/system.js @@ -5,7 +5,7 @@ import deepExtend from "deep-extend" import { combineReducers } from "redux-immutable" import { serializeError } from "serialize-error" import merge from "lodash/merge" -import { NEW_THROWN_ERR } from "corePlugins/err/actions" +import { NEW_THROWN_ERR } from "core/plugins/err/actions" import win from "core/window" import { systemThunkMiddleware, isFn, objMap, objReduce, isObject, isArray, isFunc } from "core/utils" diff --git a/src/helpers/create-html-ready-id.js b/src/core/utils/create-html-ready-id.js similarity index 100% rename from src/helpers/create-html-ready-id.js rename to src/core/utils/create-html-ready-id.js diff --git a/src/helpers/get-parameter-schema.js b/src/core/utils/get-parameter-schema.js similarity index 100% rename from src/helpers/get-parameter-schema.js rename to src/core/utils/get-parameter-schema.js diff --git a/src/core/utils.js b/src/core/utils/index.js similarity index 96% rename from src/core/utils.js rename to src/core/utils/index.js index 1ca3ab10cef..9ff5770ee2e 100644 --- a/src/core/utils.js +++ b/src/core/utils/index.js @@ -18,11 +18,12 @@ import find from "lodash/find" import some from "lodash/some" import eq from "lodash/eq" import isFunction from "lodash/isFunction" -import win from "./window" import cssEscape from "css.escape" -import getParameterSchema from "../helpers/get-parameter-schema" import randomBytes from "randombytes" import shaJs from "sha.js" +import win from "core/window" +import getParameterSchema from "core/utils/get-parameter-schema" + const DEFAULT_RESPONSE_KEY = "default" @@ -117,11 +118,11 @@ export function createObjWithHashedKeys (fdObj) { } export function bindToState(obj, state) { - var newObj = {} - Object.keys(obj) - .filter(key => typeof obj[key] === "function") - .forEach(key => newObj[key] = obj[key].bind(null, state)) - return newObj + var newObj = {} + Object.keys(obj) + .filter(key => typeof obj[key] === "function") + .forEach(key => newObj[key] = obj[key].bind(null, state)) + return newObj } export function normalizeArray(arr) { @@ -344,21 +345,21 @@ export const validateString = ( val ) => { } export const validateDateTime = (val) => { - if (isNaN(Date.parse(val))) { - return "Value must be a DateTime" - } + if (isNaN(Date.parse(val))) { + return "Value must be a DateTime" + } } export const validateGuid = (val) => { - val = val.toString().toLowerCase() - if (!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(val)) { - return "Value must be a Guid" - } + val = val.toString().toLowerCase() + if (!/^[{(]?[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}[)}]?$/.test(val)) { + return "Value must be a Guid" + } } export const validateMaxLength = (val, max) => { if (val.length > max) { - return `Value must be no longer than ${max} character${max !== 1 ? "s" : ""}` + return `Value must be no longer than ${max} character${max !== 1 ? "s" : ""}` } } @@ -386,7 +387,7 @@ export const validateUniqueItems = (val, uniqueItems) => { export const validateMinItems = (val, min) => { if (!val && min >= 1 || val && val.length < min) { - return `Array must contain at least ${min} item${min === 1 ? "" : "s"}` + return `Array must contain at least ${min} item${min === 1 ? "" : "s"}` } } @@ -398,14 +399,14 @@ export const validateMaxItems = (val, max) => { export const validateMinLength = (val, min) => { if (val.length < min) { - return `Value must be at least ${min} character${min !== 1 ? "s" : ""}` + return `Value must be at least ${min} character${min !== 1 ? "s" : ""}` } } export const validatePattern = (val, rxPattern) => { var patt = new RegExp(rxPattern) if (!patt.test(val)) { - return "Value must follow pattern " + rxPattern + return "Value must follow pattern " + rxPattern } } @@ -823,10 +824,10 @@ export function generateCodeVerifier() { export function createCodeChallenge(codeVerifier) { return b64toB64UrlEncoded( - shaJs("sha256") + shaJs("sha256") .update(codeVerifier) .digest("base64") - ) + ) } function b64toB64UrlEncoded(str) { diff --git a/src/helpers/memoizeN.js b/src/core/utils/memoizeN.js similarity index 100% rename from src/helpers/memoizeN.js rename to src/core/utils/memoizeN.js diff --git a/src/img/logo_small.png b/src/img/logo_small.png deleted file mode 100644 index fe60b1ffb0a04fd9e96789c32360b12d1078bbab..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 581 zcmV-L0=oT)P)X zMin(c7dA(Q>MeulEN8hhf#obdcRWalI#ilBGGsqQfIBW-K|y;wZpJYbg52fON#J`~QEp z5|Ry;!@MN9b27J+Mqo#V=NXY5&>I#j6Mmj%S(^JWSBq!XHBj+{2_!s)sNA+ne~AAs(-UIFa zan|@IA}<|meBvQ)z=tz6h=TFjPs2N*AHM{&_C-z|I!$-D2o--#VIwS8^qS^UstIW$ zd?qE1n%0YRt>fE0=55BZf7+Dd?X!3y z#luGDqR`{4LUUwdDsTBvi7m&nTyUCp>!Qj+hAe8MTVCm+k~_BK21q^ueBBb-h=%UF ztD^I?)(xegt=I=taOJqn4ik|xJBmbK-rOJ)EhD6#)<6qvW|nBck84NP%L@JhNlZQB T(=f$000000NkvXXu0mjfPnPf| diff --git a/src/plugins/index.js b/src/plugins/index.js deleted file mode 100644 index f143ff0b3c9..00000000000 --- a/src/plugins/index.js +++ /dev/null @@ -1,7 +0,0 @@ -import Configs from "./configs" -import Topbar from "./topbar" - -export default { - Configs, - Topbar -} diff --git a/src/plugins/topbar/index.js b/src/plugins/topbar/index.js deleted file mode 100644 index dc00e514577..00000000000 --- a/src/plugins/topbar/index.js +++ /dev/null @@ -1,11 +0,0 @@ -import Topbar from "./topbar" -import Logo from "./logo" - -export default function () { - return { - components: { - Topbar, - Logo - } - } -} diff --git a/src/plugins/topbar/logo.jsx b/src/plugins/topbar/logo.jsx deleted file mode 100644 index bbfc59927fe..00000000000 --- a/src/plugins/topbar/logo.jsx +++ /dev/null @@ -1,8 +0,0 @@ -import React from "react" -import SwaggerUILogo from "./logo_small.svg" - -export const Logo = () => ( - Swagger UI -) - -export default Logo diff --git a/src/standalone/index.js b/src/standalone/index.js deleted file mode 100644 index 83277b576e2..00000000000 --- a/src/standalone/index.js +++ /dev/null @@ -1,24 +0,0 @@ -import StandaloneLayout from "./layout" -import TopbarPlugin from "plugins/topbar" -import ConfigsPlugin from "corePlugins/configs" -import SafeRenderPlugin from "core/plugins/safe-render" - -// the Standalone preset - -export default [ - TopbarPlugin, - ConfigsPlugin, - () => { - return { - components: { StandaloneLayout } - } - }, - SafeRenderPlugin({ - fullOverride: true, - componentList: [ - "Topbar", - "StandaloneLayout", - "onlineValidatorBadge" - ] - }) -] diff --git a/src/standalone/layout.jsx b/src/standalone/plugins/stadalone-layout/components/StandaloneLayout.jsx similarity index 92% rename from src/standalone/layout.jsx rename to src/standalone/plugins/stadalone-layout/components/StandaloneLayout.jsx index 417616063ad..6703a2b2eef 100644 --- a/src/standalone/layout.jsx +++ b/src/standalone/plugins/stadalone-layout/components/StandaloneLayout.jsx @@ -1,7 +1,7 @@ import React from "react" import PropTypes from "prop-types" -export default class StandaloneLayout extends React.Component { +class StandaloneLayout extends React.Component { static propTypes = { errSelectors: PropTypes.object.isRequired, @@ -36,3 +36,5 @@ export default class StandaloneLayout extends React.Component { } } + +export default StandaloneLayout diff --git a/src/standalone/plugins/stadalone-layout/index.js b/src/standalone/plugins/stadalone-layout/index.js new file mode 100644 index 00000000000..8907c39e469 --- /dev/null +++ b/src/standalone/plugins/stadalone-layout/index.js @@ -0,0 +1,12 @@ +/** + * @prettier + */ +import StandaloneLayout from "./components/StandaloneLayout" + +const StandaloneLayoutPlugin = () => ({ + components: { + StandaloneLayout, + }, +}) + +export default StandaloneLayoutPlugin diff --git a/src/plugins/topbar/logo_small.svg b/src/standalone/plugins/top-bar/assets/logo_small.svg similarity index 100% rename from src/plugins/topbar/logo_small.svg rename to src/standalone/plugins/top-bar/assets/logo_small.svg diff --git a/src/standalone/plugins/top-bar/components/Logo.jsx b/src/standalone/plugins/top-bar/components/Logo.jsx new file mode 100644 index 00000000000..b84a6ae2af0 --- /dev/null +++ b/src/standalone/plugins/top-bar/components/Logo.jsx @@ -0,0 +1,9 @@ +/** + * @prettier + */ +import React from "react" +import SwaggerUILogo from "../assets/logo_small.svg" + +const Logo = () => Swagger UI + +export default Logo diff --git a/src/plugins/topbar/topbar.jsx b/src/standalone/plugins/top-bar/components/TopBar.jsx similarity index 96% rename from src/plugins/topbar/topbar.jsx rename to src/standalone/plugins/top-bar/components/TopBar.jsx index 9dc07ba451b..edcb05694c7 100644 --- a/src/plugins/topbar/topbar.jsx +++ b/src/standalone/plugins/top-bar/components/TopBar.jsx @@ -1,10 +1,9 @@ import React, { cloneElement } from "react" import PropTypes from "prop-types" -//import "./topbar.less" -import {parseSearch, serializeSearch} from "../../core/utils" +import {parseSearch, serializeSearch} from "core/utils" -export default class Topbar extends React.Component { +class TopBar extends React.Component { static propTypes = { layoutActions: PropTypes.object.isRequired, @@ -163,9 +162,11 @@ export default class Topbar extends React.Component { } } -Topbar.propTypes = { +TopBar.propTypes = { specSelectors: PropTypes.object.isRequired, specActions: PropTypes.object.isRequired, getComponent: PropTypes.func.isRequired, getConfigs: PropTypes.func.isRequired } + +export default TopBar diff --git a/src/standalone/plugins/top-bar/index.js b/src/standalone/plugins/top-bar/index.js new file mode 100644 index 00000000000..03092fc692d --- /dev/null +++ b/src/standalone/plugins/top-bar/index.js @@ -0,0 +1,11 @@ +/** + * @prettier + */ +import TopBar from "./components/TopBar" +import Logo from "./components/Logo" + +const TopBarPlugin = () => ({ + components: { Topbar: TopBar, Logo }, +}) + +export default TopBarPlugin diff --git a/src/standalone/presets/standalone/index.js b/src/standalone/presets/standalone/index.js new file mode 100644 index 00000000000..6bee8f6709e --- /dev/null +++ b/src/standalone/presets/standalone/index.js @@ -0,0 +1,19 @@ +/** + * @prettier + */ +import StandaloneLayoutPlugin from "standalone/plugins/stadalone-layout" +import TopBarPlugin from "standalone/plugins/top-bar" +import ConfigsPlugin from "core/plugins/configs" +import SafeRenderPlugin from "core/plugins/safe-render" + +const StandalonePreset = [ + TopBarPlugin, + ConfigsPlugin, + StandaloneLayoutPlugin, + SafeRenderPlugin({ + fullOverride: true, + componentList: ["Topbar", "StandaloneLayout", "onlineValidatorBadge"], + }), +] + +export default StandalonePreset diff --git a/test/components/highlight-code.jsx b/test/components/highlight-code.jsx index ebe53fef8d5..36c0339d08e 100644 --- a/test/components/highlight-code.jsx +++ b/test/components/highlight-code.jsx @@ -1,7 +1,7 @@ import React from "react" import expect from "expect" import { shallow } from "enzyme" -import HighlightCode from "components/highlight-code" +import HighlightCode from "core/components/highlight-code" const fakeGetConfigs = () => ({syntaxHighlight: {activated: true, theme: "agate"}}) diff --git a/test/components/response-body.jsx b/test/components/response-body.jsx index 3b7502cbe77..e794d0eafe0 100644 --- a/test/components/response-body.jsx +++ b/test/components/response-body.jsx @@ -1,7 +1,7 @@ import React from "react" import expect from "expect" import { shallow } from "enzyme" -import ResponseBody from "components/response-body" +import ResponseBody from "core/components/response-body" describe("", function() { const highlightCodeComponent = () => null diff --git a/test/mocha/components/live-response.jsx b/test/mocha/components/live-response.jsx index bac8ff0fbd7..2099a39ef91 100644 --- a/test/mocha/components/live-response.jsx +++ b/test/mocha/components/live-response.jsx @@ -4,8 +4,8 @@ import { fromJSOrdered } from "core/utils" import sinon from "sinon" import expect from "expect" import { shallow } from "enzyme" -import LiveResponse from "components/live-response" -import ResponseBody from "components/response-body" +import LiveResponse from "core/components/live-response" +import ResponseBody from "core/components/response-body" import RequestSnippets from "core/plugins/request-snippets/request-snippets" describe("", function () { diff --git a/test/mocha/components/online-validator-badge.jsx b/test/mocha/components/online-validator-badge.jsx index 8b464828286..3d7839bcca2 100644 --- a/test/mocha/components/online-validator-badge.jsx +++ b/test/mocha/components/online-validator-badge.jsx @@ -3,7 +3,7 @@ import React from "react" import expect from "expect" import { mount } from "enzyme" import { fromJS, Map } from "immutable" -import OnlineValidatorBadge from "components/online-validator-badge" +import OnlineValidatorBadge from "core/components/online-validator-badge" describe("", function () { it("should render a validator link and image correctly for the default validator", function () { diff --git a/test/mocha/xss/anchor-target-rel/online-validator-badge.jsx b/test/mocha/xss/anchor-target-rel/online-validator-badge.jsx index 78e73a8e3a8..3775e9a7ac4 100644 --- a/test/mocha/xss/anchor-target-rel/online-validator-badge.jsx +++ b/test/mocha/xss/anchor-target-rel/online-validator-badge.jsx @@ -3,7 +3,7 @@ import React from "react" import expect from "expect" import { mount } from "enzyme" import { fromJS, Map } from "immutable" -import OnlineValidatorBadge from "components/online-validator-badge" +import OnlineValidatorBadge from "core/components/online-validator-badge" describe(" Anchor Target Safety", function () { it("should render a validator link with safe `rel` attributes", function () { diff --git a/test/unit/bugs/3199-sanitization-escaping.jsx b/test/unit/bugs/3199-sanitization-escaping.jsx index fd39f5b4cf4..bc0127dcd34 100644 --- a/test/unit/bugs/3199-sanitization-escaping.jsx +++ b/test/unit/bugs/3199-sanitization-escaping.jsx @@ -1,6 +1,6 @@ import React from "react" import { render } from "enzyme" -import Markdown from "components/providers/markdown" +import Markdown from "core/components/providers/markdown" describe("UI-3199: Sanitized Markdown causing code examples to be double escaped", function(){ it("should single-escape quotes", function(){ diff --git a/test/unit/bugs/3279-empty-markdown-source.jsx b/test/unit/bugs/3279-empty-markdown-source.jsx index 33be60fd8e6..8267ebd9074 100644 --- a/test/unit/bugs/3279-empty-markdown-source.jsx +++ b/test/unit/bugs/3279-empty-markdown-source.jsx @@ -1,6 +1,6 @@ import React from "react" import { render } from "enzyme" -import Markdown from "components/providers/markdown" +import Markdown from "core/components/providers/markdown" describe("UI-3279: Empty Markdown inputs causing bare `undefined` in output", function(){ it("should return no text for `null` as source input", function(){ diff --git a/test/unit/bugs/4557-default-parameter-values.jsx b/test/unit/bugs/4557-default-parameter-values.jsx index 13e925c0c17..3cba3fb4129 100644 --- a/test/unit/bugs/4557-default-parameter-values.jsx +++ b/test/unit/bugs/4557-default-parameter-values.jsx @@ -5,7 +5,7 @@ import React from "react" import { List, fromJS } from "immutable" import { render } from "enzyme" -import ParameterRow from "components/parameter-row" +import ParameterRow from "core/components/parameter-row" import { memoizedSampleFromSchema, memoizedCreateXMLExample, diff --git a/test/unit/components/filter.jsx b/test/unit/components/filter.jsx index 6be672df3b3..4fd740a7896 100644 --- a/test/unit/components/filter.jsx +++ b/test/unit/components/filter.jsx @@ -1,7 +1,7 @@ import React from "react" import { mount } from "enzyme" -import FilterContainer from "containers/filter" -import { Col } from "components/layout-utils" +import FilterContainer from "core/containers/filter" +import { Col } from "core/components/layout-utils" describe("", function(){ diff --git a/test/unit/components/info-wrapper.jsx b/test/unit/components/info-wrapper.jsx index 256ee1d3041..1b31d069988 100644 --- a/test/unit/components/info-wrapper.jsx +++ b/test/unit/components/info-wrapper.jsx @@ -1,7 +1,7 @@ import React from "react" import { mount } from "enzyme" import { fromJS } from "immutable" -import InfoContainer from "containers/info" +import InfoContainer from "core/containers/info" describe("", function () { diff --git a/test/unit/components/json-schema-form.jsx b/test/unit/components/json-schema-form.jsx index f8df3fb689b..14fc629f8d1 100644 --- a/test/unit/components/json-schema-form.jsx +++ b/test/unit/components/json-schema-form.jsx @@ -1,9 +1,8 @@ import React from "react" import Immutable, { List } from "immutable" -import { Select, Input, TextArea } from "components/layout-utils" +import { Select, Input, TextArea } from "core/components/layout-utils" import { mount, render } from "enzyme" -import * as JsonSchemaComponents from "core/json-schema-components" -import { JsonSchemaForm } from "core/json-schema-components" +import * as JsonSchemaComponents from "core/components/json-schema-components" const components = {...JsonSchemaComponents, Select, Input, TextArea} @@ -13,7 +12,7 @@ const getComponentStub = (name) => { return null } -describe("", function(){ +describe("", function(){ describe("strings", function() { it("should render the correct options for a string enum parameter", function(){ @@ -29,7 +28,7 @@ describe("", function(){ }) } - let wrapper = render() + let wrapper = render() expect(wrapper.get(0).name).toEqual("select") expect(wrapper.find("option").length).toEqual(3) @@ -53,7 +52,7 @@ describe("", function(){ disabled: true } - let wrapper = render() + let wrapper = render() expect(wrapper.attr("disabled")).toEqual("disabled") }) @@ -74,7 +73,7 @@ describe("", function(){ }) } - let wrapper = render() + let wrapper = render() expect(wrapper.get(0).name).toEqual("select") expect(wrapper.find("select option").length).toEqual(2) @@ -96,7 +95,7 @@ describe("", function(){ }) } - let wrapper = render() + let wrapper = render() expect(wrapper.get(0).name).toEqual("select") expect(wrapper.find("select option").length).toEqual(3) @@ -120,7 +119,7 @@ describe("", function(){ }) } - let wrapper = render() + let wrapper = render() expect(wrapper.get(0).name).toEqual("select") expect(wrapper.find("select option").length).toEqual(2) @@ -143,7 +142,7 @@ describe("", function(){ }) } - let wrapper = render() + let wrapper = render() expect(wrapper.get(0).name).toEqual("select") expect(wrapper.find("select option").length).toEqual(3) @@ -168,7 +167,7 @@ describe("", function(){ }) } - let wrapper = render() + let wrapper = render() expect(wrapper.get(0).name).toEqual("select") expect(wrapper.find("select option").length).toEqual(1) @@ -200,7 +199,7 @@ describe("", function(){ }) } - let wrapper = mount() + let wrapper = mount() updateQueue.forEach(newProps => wrapper.setProps(newProps)) @@ -223,7 +222,7 @@ describe("", function(){ } - let wrapper = render() + let wrapper = render() expect(wrapper.length).toEqual(1) expect(wrapper.get(0).name).toEqual("input") @@ -246,7 +245,7 @@ describe("", function(){ } - let wrapper = render() + let wrapper = render() expect(wrapper.length).toEqual(1) expect(wrapper.get(0).name).toEqual("input") diff --git a/test/unit/components/live-response.jsx b/test/unit/components/live-response.jsx index ce7702faff9..722fb9f10f8 100644 --- a/test/unit/components/live-response.jsx +++ b/test/unit/components/live-response.jsx @@ -1,9 +1,9 @@ import React from "react" import { fromJSOrdered } from "core/utils" import { shallow } from "enzyme" -import Curl from "components/curl" -import LiveResponse from "components/live-response" -import ResponseBody from "components/response-body" +import Curl from "core/components/curl" +import LiveResponse from "core/components/live-response" +import ResponseBody from "core/components/response-body" describe("", function(){ let request = fromJSOrdered({ @@ -49,7 +49,7 @@ describe("", function(){ }) let mutatedRequestForSpy = jest.fn().mockImplementation(function(mutatedRequest) { return mutatedRequest }) - let requestForSpy = jest.fn().mockImplementation(function(request) { return request }) + let requestForSpy = jest.fn().mockImplementation(function(request) { return request }) let components = { curl: Curl, @@ -57,7 +57,7 @@ describe("", function(){ } let props = { - response: response, + response: response, specSelectors: { mutatedRequestFor: mutatedRequestForSpy, requestFor: requestForSpy, diff --git a/test/unit/components/markdown.jsx b/test/unit/components/markdown.jsx index 536ce49bae6..c4e72c9628d 100644 --- a/test/unit/components/markdown.jsx +++ b/test/unit/components/markdown.jsx @@ -1,7 +1,7 @@ import React from "react" import { render } from "enzyme" -import Markdown from "components/providers/markdown" -import { Markdown as OAS3Markdown } from "corePlugins/oas3/wrap-components/markdown.jsx" +import Markdown from "core/components/providers/markdown" +import { Markdown as OAS3Markdown } from "core/plugins/oas3/wrap-components/markdown.jsx" describe("Markdown component", function () { describe("Swagger 2.0", function () { diff --git a/test/unit/components/model-example.jsx b/test/unit/components/model-example.jsx index c45ce4666aa..3aa78544aee 100644 --- a/test/unit/components/model-example.jsx +++ b/test/unit/components/model-example.jsx @@ -1,11 +1,11 @@ import React from "react" import { shallow } from "enzyme" -import ModelExample from "components/model-example" -import ModelComponent from "components/model-wrapper" +import ModelExample from "core/components/model-example" +import ModelComponent from "core/components/model-wrapper" describe("", function(){ let components, props - + let exampleSelectedTestInputs = [ { defaultModelRendering: "model", isExecute: true }, { defaultModelRendering: "example", isExecute: true }, @@ -13,7 +13,7 @@ describe("", function(){ { defaultModelRendering: "othervalue", isExecute: true }, { defaultModelRendering: "othervalue", isExecute: false } ] - + let modelSelectedTestInputs = [ { defaultModelRendering: "model", isExecute: false } ] @@ -22,7 +22,7 @@ describe("", function(){ components = { ModelWrapper: ModelComponent } - + props = { getComponent: (c) => { return components[c] diff --git a/test/unit/components/models.jsx b/test/unit/components/models.jsx index dde61ff37b6..b86157ae540 100644 --- a/test/unit/components/models.jsx +++ b/test/unit/components/models.jsx @@ -1,9 +1,9 @@ import React from "react" import { shallow } from "enzyme" import { fromJS, Map } from "immutable" -import Models from "components/models" -import ModelCollapse from "components/model-collapse" -import ModelComponent from "components/model-wrapper" +import Models from "core/components/models" +import ModelCollapse from "core/components/model-collapse" +import ModelComponent from "core/components/model-wrapper" describe("", function(){ const dummyComponent = () => null diff --git a/test/unit/components/object-model.jsx b/test/unit/components/object-model.jsx index 3367bac36aa..478a49c0e5f 100644 --- a/test/unit/components/object-model.jsx +++ b/test/unit/components/object-model.jsx @@ -1,13 +1,13 @@ import React from "react" import { shallow } from "enzyme" import { List } from "immutable" -import ObjectModel from "components/object-model" -// import ModelExample from "components/model-example" +import ObjectModel from "core/components/object-model" +// import ModelExample from "core/components/model-example" import Immutable from "immutable" -import Model from "components/model" -import ModelCollapse from "components/model-collapse" -import Property from "components/property" -// import { inferSchema } from "corePlugins/samples/fn" +import Model from "core/components/model" +import ModelCollapse from "core/components/model-collapse" +import Property from "core/components/property" +// import { inferSchema } from "core/plugins/samples/fn" describe("", function() { const dummyComponent = () => null diff --git a/test/unit/components/online-validator-badge.jsx b/test/unit/components/online-validator-badge.jsx index f3a77552977..c0bc8384425 100644 --- a/test/unit/components/online-validator-badge.jsx +++ b/test/unit/components/online-validator-badge.jsx @@ -1,6 +1,6 @@ import React from "react" import { mount } from "enzyme" -import OnlineValidatorBadge from "components/online-validator-badge" +import OnlineValidatorBadge from "core/components/online-validator-badge" describe("", function () { it("should render a validator link and image correctly for the default validator", function () { diff --git a/test/unit/components/operation-tag.jsx b/test/unit/components/operation-tag.jsx index af3850c36f5..0d1ba533ee7 100644 --- a/test/unit/components/operation-tag.jsx +++ b/test/unit/components/operation-tag.jsx @@ -1,8 +1,8 @@ import React from "react" import { shallow } from "enzyme" -import OperationTag from "components/operation-tag" +import OperationTag from "core/components/operation-tag" import Im from "immutable" -import { Link } from "components/layout-utils" +import { Link } from "core/components/layout-utils" describe("", function(){ it("render externalDocs URL for swagger v2", function(){ diff --git a/test/unit/components/operation.jsx b/test/unit/components/operation.jsx index 161d56735c3..18d7da49fb9 100644 --- a/test/unit/components/operation.jsx +++ b/test/unit/components/operation.jsx @@ -1,6 +1,6 @@ import React from "react" import { shallow } from "enzyme" -import Operation from "components/operation" +import Operation from "core/components/operation" describe("", function(){ it.skip("blanket tests", function(){ diff --git a/test/unit/components/operations.jsx b/test/unit/components/operations.jsx index 4afeb61f6d8..0cbb648b7f2 100644 --- a/test/unit/components/operations.jsx +++ b/test/unit/components/operations.jsx @@ -1,9 +1,9 @@ import React from "react" import { render } from "enzyme" import { fromJS } from "immutable" -import DeepLink from "components/deep-link" -import Operations from "components/operations" -import {Collapse} from "components/layout-utils" +import DeepLink from "core/components/deep-link" +import Operations from "core/components/operations" +import {Collapse} from "core/components/layout-utils" const components = { Collapse, diff --git a/test/unit/components/parameter-row.jsx b/test/unit/components/parameter-row.jsx index b137bdbaaf5..fca9b3a8e0b 100644 --- a/test/unit/components/parameter-row.jsx +++ b/test/unit/components/parameter-row.jsx @@ -5,7 +5,7 @@ import React from "react" import { List, fromJS } from "immutable" import { render } from "enzyme" -import ParameterRow from "components/parameter-row" +import ParameterRow from "core/components/parameter-row" import { memoizedSampleFromSchema, memoizedCreateXMLExample, diff --git a/test/unit/components/primitive-model.jsx b/test/unit/components/primitive-model.jsx index f6ff3f486a4..b021667732e 100644 --- a/test/unit/components/primitive-model.jsx +++ b/test/unit/components/primitive-model.jsx @@ -1,8 +1,8 @@ import React from "react" import { shallow } from "enzyme" import { fromJS } from "immutable" -import PrimitiveModel from "components/primitive-model" -import ModelCollapse from "components/model-collapse" +import PrimitiveModel from "core/components/primitive-model" +import ModelCollapse from "core/components/model-collapse" describe("", function () { const dummyComponent = () => null diff --git a/test/unit/components/response-body.jsx b/test/unit/components/response-body.jsx index 57e1d423ef6..0d316b6ef0e 100644 --- a/test/unit/components/response-body.jsx +++ b/test/unit/components/response-body.jsx @@ -1,6 +1,6 @@ import React from "react" import { shallow } from "enzyme" -import ResponseBody from "components/response-body" +import ResponseBody from "core/components/response-body" describe("", function () { const highlightCodeComponent = () => null diff --git a/test/unit/components/response.jsx b/test/unit/components/response.jsx index 93c216b32d8..f82ab050c1d 100644 --- a/test/unit/components/response.jsx +++ b/test/unit/components/response.jsx @@ -5,8 +5,8 @@ import React from "react" import { shallow } from "enzyme" import { fromJS, List } from "immutable" -import Response from "components/response" -import ModelExample from "components/model-example" +import Response from "core/components/response" +import ModelExample from "core/components/model-example" import { inferSchema, memoizedSampleFromSchema, diff --git a/test/unit/components/schemes-wrapper.jsx b/test/unit/components/schemes-wrapper.jsx index b23aa8cf147..01348343671 100644 --- a/test/unit/components/schemes-wrapper.jsx +++ b/test/unit/components/schemes-wrapper.jsx @@ -1,9 +1,9 @@ import React from "react" import { mount } from "enzyme" import { fromJS } from "immutable" -import SchemesContainer from "containers/schemes" -import Schemes from "components/schemes" -import { Col } from "components/layout-utils" +import SchemesContainer from "core/containers/schemes" +import Schemes from "core/components/schemes" +import { Col } from "core/components/layout-utils" describe("", function(){ diff --git a/test/unit/components/schemes.jsx b/test/unit/components/schemes.jsx index e34496d00f1..57a2cf4fe47 100644 --- a/test/unit/components/schemes.jsx +++ b/test/unit/components/schemes.jsx @@ -1,7 +1,7 @@ import React from "react" import { shallow } from "enzyme" import { fromJS } from "immutable" -import Schemes from "components/schemes" +import Schemes from "core/components/schemes" describe("", function(){ it("calls props.specActions.setScheme() when no currentScheme is selected", function(){ diff --git a/test/unit/components/version-pragma-filter.jsx b/test/unit/components/version-pragma-filter.jsx index 8571916fe63..2a08ea1cebc 100644 --- a/test/unit/components/version-pragma-filter.jsx +++ b/test/unit/components/version-pragma-filter.jsx @@ -1,6 +1,6 @@ import React from "react" import { shallow } from "enzyme" -import VersionPragmaFilter from "components/version-pragma-filter" +import VersionPragmaFilter from "core/components/version-pragma-filter" describe("", function(){ it("renders children for a Swagger 2 definition", function(){ diff --git a/test/unit/core/helpers/get-parameter-schema.js b/test/unit/core/helpers/get-parameter-schema.js index 47da1b317a4..121e2392f23 100644 --- a/test/unit/core/helpers/get-parameter-schema.js +++ b/test/unit/core/helpers/get-parameter-schema.js @@ -3,7 +3,7 @@ */ import { fromJS } from "immutable" -import getParameterSchema from "../../../../src/helpers/get-parameter-schema" +import getParameterSchema from "../../../../src/core/utils/get-parameter-schema" describe("getParameterSchema", () => { it("should return an empty Map when given no parameters", () => { diff --git a/test/unit/core/plugins/auth/actions.js b/test/unit/core/plugins/auth/actions.js index f73ee1e3a4f..d9c751be6d5 100644 --- a/test/unit/core/plugins/auth/actions.js +++ b/test/unit/core/plugins/auth/actions.js @@ -7,7 +7,7 @@ import { authorizeOauth2WithPersistOption, logoutWithPersistOption, persistAuthorizationIfNeeded -} from "corePlugins/auth/actions" +} from "core/plugins/auth/actions" import {authorizeAccessCodeWithBasicAuthentication, authPopup} from "../../../../../src/core/plugins/auth/actions" describe("auth plugin - actions", () => { diff --git a/test/unit/core/plugins/auth/configs-extensions/wrap-actions.js b/test/unit/core/plugins/auth/configs-extensions/wrap-actions.js index 33b1e63e983..a3520b82577 100644 --- a/test/unit/core/plugins/auth/configs-extensions/wrap-actions.js +++ b/test/unit/core/plugins/auth/configs-extensions/wrap-actions.js @@ -1,4 +1,4 @@ -import { loaded } from "corePlugins/auth/configs-extensions/wrap-actions" +import { loaded } from "core/plugins/auth/configs-extensions/wrap-actions" describe("loaded hook", () => { describe("authorization data restoration", () => { diff --git a/test/unit/core/plugins/auth/preauthorize.js b/test/unit/core/plugins/auth/preauthorize.js index a42f1c4f0c4..61fbf499d6d 100644 --- a/test/unit/core/plugins/auth/preauthorize.js +++ b/test/unit/core/plugins/auth/preauthorize.js @@ -1,7 +1,7 @@ import { fromJS } from "immutable" -import { preauthorizeBasic, preauthorizeApiKey } from "corePlugins/auth" -import { authorize } from "corePlugins/auth/actions" +import { preauthorizeBasic, preauthorizeApiKey } from "core/plugins/auth" +import { authorize } from "core/plugins/auth/actions" const S2_SYSTEM = { authActions: { diff --git a/test/unit/core/plugins/auth/selectors.js b/test/unit/core/plugins/auth/selectors.js index 2b6c1509855..a9e4c611bd4 100644 --- a/test/unit/core/plugins/auth/selectors.js +++ b/test/unit/core/plugins/auth/selectors.js @@ -1,6 +1,6 @@ import { fromJS } from "immutable" -import { definitionsToAuthorize, definitionsForRequirements } from "corePlugins/auth/selectors" +import { definitionsToAuthorize, definitionsForRequirements } from "core/plugins/auth/selectors" describe("auth plugin - selectors", () => { describe("definitionsToAuthorize", () => { diff --git a/test/unit/core/plugins/auth/spec-extensions/wrap-actions.js b/test/unit/core/plugins/auth/spec-extensions/wrap-actions.js index dbeabf0f5f9..86b09a8cb06 100644 --- a/test/unit/core/plugins/auth/spec-extensions/wrap-actions.js +++ b/test/unit/core/plugins/auth/spec-extensions/wrap-actions.js @@ -1,4 +1,4 @@ -import { execute } from "corePlugins/auth/spec-extensions/wrap-actions" +import { execute } from "core/plugins/auth/spec-extensions/wrap-actions" describe("spec plugin - actions", function(){ diff --git a/test/unit/core/plugins/auth/wrap-actions.js b/test/unit/core/plugins/auth/wrap-actions.js index 60f61621930..cd1327d7be2 100644 --- a/test/unit/core/plugins/auth/wrap-actions.js +++ b/test/unit/core/plugins/auth/wrap-actions.js @@ -2,7 +2,7 @@ * @prettier */ import { fromJS } from "immutable" -import { authorize, logout } from "corePlugins/auth/wrap-actions" +import { authorize, logout } from "core/plugins/auth/wrap-actions" describe("Cookie based apiKey persistence in document.cookie", () => { beforeEach(() => { diff --git a/test/unit/core/plugins/configs/actions.js b/test/unit/core/plugins/configs/actions.js index e67930b1020..fd1c6f8704a 100644 --- a/test/unit/core/plugins/configs/actions.js +++ b/test/unit/core/plugins/configs/actions.js @@ -1,4 +1,4 @@ -import { downloadConfig } from "corePlugins/configs/spec-actions" +import { downloadConfig } from "core/plugins/configs/spec-actions" describe("configs plugin - actions", () => { diff --git a/test/unit/core/plugins/err/transformers/not-of-type.js b/test/unit/core/plugins/err/transformers/not-of-type.js index 682c641bc24..1f3e781614a 100644 --- a/test/unit/core/plugins/err/transformers/not-of-type.js +++ b/test/unit/core/plugins/err/transformers/not-of-type.js @@ -1,5 +1,5 @@ import { Map, List } from "immutable" -import { transform } from "corePlugins/err/error-transformers/transformers/not-of-type" +import { transform } from "core/plugins/err/error-transformers/transformers/not-of-type" describe("err plugin - tranformers - not of type", () => { diff --git a/test/unit/core/plugins/err/transformers/parameter-oneof.js b/test/unit/core/plugins/err/transformers/parameter-oneof.js index 1ff41019a86..87388bb10b1 100644 --- a/test/unit/core/plugins/err/transformers/parameter-oneof.js +++ b/test/unit/core/plugins/err/transformers/parameter-oneof.js @@ -1,6 +1,6 @@ /* eslint-disable no-useless-escape */ import { fromJS } from "immutable" -import { transform } from "corePlugins/err/error-transformers/transformers/parameter-oneof" +import { transform } from "core/plugins/err/error-transformers/transformers/parameter-oneof" describe.skip("err plugin - tranformers - parameter oneof", () => { diff --git a/test/unit/core/plugins/filter/opsFilter.js b/test/unit/core/plugins/filter/opsFilter.js index d64ce609ba4..ddb19177346 100644 --- a/test/unit/core/plugins/filter/opsFilter.js +++ b/test/unit/core/plugins/filter/opsFilter.js @@ -1,5 +1,5 @@ import { Map } from "immutable" -import opsFilter from "corePlugins/filter/opsFilter" +import opsFilter from "core/plugins/filter/opsFilter" describe("opsFilter", function() { const taggedOps = Map([["pet"], ["store"], ["user"]]) diff --git a/test/unit/core/plugins/oas3/helpers.js b/test/unit/core/plugins/oas3/helpers.js index 7eef6d4f0b6..2ff68ad0f60 100644 --- a/test/unit/core/plugins/oas3/helpers.js +++ b/test/unit/core/plugins/oas3/helpers.js @@ -1,5 +1,5 @@ import { fromJS } from "immutable" -import { isOAS30, isSwagger2 } from "corePlugins/oas3/helpers" +import { isOAS30, isSwagger2 } from "core/plugins/oas3/helpers" const isOAS3Shorthand = (version) => isOAS30(fromJS({ openapi: version diff --git a/test/unit/core/plugins/oas3/reducers.js b/test/unit/core/plugins/oas3/reducers.js index c99eaba1da8..22371eb8943 100644 --- a/test/unit/core/plugins/oas3/reducers.js +++ b/test/unit/core/plugins/oas3/reducers.js @@ -1,6 +1,6 @@ import { fromJS } from "immutable" -import reducer from "corePlugins/oas3/reducers" +import reducer from "core/plugins/oas3/reducers" describe("oas3 plugin - reducer", function () { describe("SET_REQUEST_BODY_VALIDATE_ERROR", () => { @@ -518,13 +518,13 @@ describe("oas3 plugin - reducer", function () { } } }) - + const result = clearRequestBodyValue(state, { payload: { pathMethod: ["/pet", "post"], } }) - + const expectedResult = { requestData: { "/pet": { @@ -535,7 +535,7 @@ describe("oas3 plugin - reducer", function () { } } } - + expect(result.toJS()).toEqual(expectedResult) }) }) @@ -556,13 +556,13 @@ describe("oas3 plugin - reducer", function () { } } }) - + const result = clearRequestBodyValue(state, { payload: { pathMethod: ["/pet", "post"], } }) - + const expectedResult = { requestData: { "/pet": { @@ -573,7 +573,7 @@ describe("oas3 plugin - reducer", function () { } } } - + expect(result.toJS()).toEqual(expectedResult) }) }) diff --git a/test/unit/core/plugins/oas3/servers-wrapper.jsx b/test/unit/core/plugins/oas3/servers-wrapper.jsx index 31bdff84dee..7eb6724c061 100644 --- a/test/unit/core/plugins/oas3/servers-wrapper.jsx +++ b/test/unit/core/plugins/oas3/servers-wrapper.jsx @@ -4,7 +4,7 @@ import { mount } from "enzyme" import { fromJS } from "immutable" import ServersContainer from "core/plugins/oas3/components/servers-container" import Servers from "core/plugins/oas3/components/servers" -import { Col } from "components/layout-utils" +import { Col } from "core/components/layout-utils" describe("", function(){ diff --git a/test/unit/core/plugins/oas3/state-integration.js b/test/unit/core/plugins/oas3/state-integration.js index 62b1f620e3a..e166850dd08 100644 --- a/test/unit/core/plugins/oas3/state-integration.js +++ b/test/unit/core/plugins/oas3/state-integration.js @@ -5,14 +5,14 @@ import { serverVariableValue, serverVariables, serverEffectiveValue -} from "corePlugins/oas3/selectors" +} from "core/plugins/oas3/selectors" -import reducers from "corePlugins/oas3/reducers" +import reducers from "core/plugins/oas3/reducers" import { setSelectedServer, setServerVariableValue, -} from "corePlugins/oas3/actions" +} from "core/plugins/oas3/actions" describe("OAS3 plugin - state", function() { describe("action + reducer + selector integration", function() { diff --git a/test/unit/core/plugins/oas3/wrap-auth-selectors.js b/test/unit/core/plugins/oas3/wrap-auth-selectors.js index 4d3ef3bf660..c26b65b9ad5 100644 --- a/test/unit/core/plugins/oas3/wrap-auth-selectors.js +++ b/test/unit/core/plugins/oas3/wrap-auth-selectors.js @@ -2,7 +2,7 @@ import { fromJS, Map } from "immutable" import { definitionsToAuthorize -} from "corePlugins/oas3/auth-extensions/wrap-selectors" +} from "core/plugins/oas3/auth-extensions/wrap-selectors" describe("oas3 plugin - auth extensions - wrapSelectors", function(){ diff --git a/test/unit/core/plugins/oas3/wrap-spec-selectors.js b/test/unit/core/plugins/oas3/wrap-spec-selectors.js index 35bdcafccf8..65efa83396c 100644 --- a/test/unit/core/plugins/oas3/wrap-spec-selectors.js +++ b/test/unit/core/plugins/oas3/wrap-spec-selectors.js @@ -1,5 +1,5 @@ import { fromJS } from "immutable" -import { definitions } from "corePlugins/oas3/spec-extensions/wrap-selectors" +import { definitions } from "core/plugins/oas3/spec-extensions/wrap-selectors" describe("oas3 plugin - spec extensions - wrapSelectors", function(){ diff --git a/test/unit/core/plugins/samples/fn/index.js b/test/unit/core/plugins/samples/fn/index.js index d4de01d5542..f4e0c686254 100644 --- a/test/unit/core/plugins/samples/fn/index.js +++ b/test/unit/core/plugins/samples/fn/index.js @@ -1,5 +1,5 @@ import { fromJS } from "immutable" -import { createXMLExample, sampleFromSchema, memoizedCreateXMLExample, memoizedSampleFromSchema } from "corePlugins/samples/fn/index" +import { createXMLExample, sampleFromSchema, memoizedCreateXMLExample, memoizedSampleFromSchema } from "core/plugins/samples/fn/index" describe("sampleFromSchema", () => { it("handles Immutable.js objects for nested schemas", function () { diff --git a/test/unit/core/plugins/spec/actions.js b/test/unit/core/plugins/spec/actions.js index d2a680343e0..bf2e9b0952f 100644 --- a/test/unit/core/plugins/spec/actions.js +++ b/test/unit/core/plugins/spec/actions.js @@ -1,6 +1,6 @@ import { fromJS } from "immutable" -import { execute, executeRequest, changeParamByIdentity, updateEmptyParamInclusion } from "corePlugins/spec/actions" +import { execute, executeRequest, changeParamByIdentity, updateEmptyParamInclusion } from "core/plugins/spec/actions" describe("spec plugin - actions", function(){ diff --git a/test/unit/core/plugins/spec/reducer.js b/test/unit/core/plugins/spec/reducer.js index 9c56a4a7f75..a0635b44009 100644 --- a/test/unit/core/plugins/spec/reducer.js +++ b/test/unit/core/plugins/spec/reducer.js @@ -1,6 +1,6 @@ import { fromJS } from "immutable" -import reducer from "corePlugins/spec/reducers" +import reducer from "core/plugins/spec/reducers" describe("spec plugin - reducer", function(){ diff --git a/test/unit/core/plugins/spec/selectors.js b/test/unit/core/plugins/spec/selectors.js index b49623726f9..95bf4c58503 100644 --- a/test/unit/core/plugins/spec/selectors.js +++ b/test/unit/core/plugins/spec/selectors.js @@ -15,7 +15,7 @@ import { consumesOptionsFor, taggedOperations, isMediaTypeSchemaPropertiesEqual -} from "corePlugins/spec/selectors" +} from "core/plugins/spec/selectors" import Petstore from "./assets/petstore.json" diff --git a/test/unit/core/plugins/swagger-js/withCredentials.js b/test/unit/core/plugins/swagger-js/withCredentials.js index f0be4ef7d8f..9153d548f80 100644 --- a/test/unit/core/plugins/swagger-js/withCredentials.js +++ b/test/unit/core/plugins/swagger-js/withCredentials.js @@ -1,6 +1,6 @@ -import { loaded } from "corePlugins/swagger-js/configs-wrap-actions" +import { loaded } from "core/plugins/swagger-client/configs-wrap-actions" -describe("swagger-js plugin - withCredentials", () => { +describe("swagger-client plugin - withCredentials", () => { it("should have no effect by default", () => { const system = { fn: { @@ -34,7 +34,7 @@ describe("swagger-js plugin - withCredentials", () => { expect(oriExecute.mock.calls.length).toBe(1) expect(system.fn.fetch.withCredentials).toBe(true) }) - + it("should allow setting flag to false via config", () => { const system = { fn: { @@ -52,7 +52,7 @@ describe("swagger-js plugin - withCredentials", () => { expect(oriExecute.mock.calls.length).toBe(1) expect(system.fn.fetch.withCredentials).toBe(false) }) - + it("should allow setting flag to true via config as string", () => { // for query string config const system = { @@ -71,7 +71,7 @@ describe("swagger-js plugin - withCredentials", () => { expect(oriExecute.mock.calls.length).toBe(1) expect(system.fn.fetch.withCredentials).toBe(true) }) - + it("should allow setting flag to false via config as string", () => { // for query string config const system = { diff --git a/test/unit/xss/anchor-target-rel/info.jsx b/test/unit/xss/anchor-target-rel/info.jsx index 628f22d0f91..fc3f88bcfa6 100644 --- a/test/unit/xss/anchor-target-rel/info.jsx +++ b/test/unit/xss/anchor-target-rel/info.jsx @@ -1,11 +1,11 @@ import React from "react" import { render } from "enzyme" import { fromJS } from "immutable" -import Info, { InfoUrl } from "components/info" -import Contact from "components/contact" -import License from "components/license" -import { Link } from "components/layout-utils" -import Markdown from "components/providers/markdown" +import Info, { InfoUrl } from "core/components/info" +import Contact from "core/components/contact" +import License from "core/components/license" +import { Link } from "core/components/layout-utils" +import Markdown from "core/components/providers/markdown" describe(" Anchor Target Safety", function(){ const dummyComponent = () => null diff --git a/test/unit/xss/anchor-target-rel/link.jsx b/test/unit/xss/anchor-target-rel/link.jsx index 6bd95a6a0f5..7c032c19b6d 100644 --- a/test/unit/xss/anchor-target-rel/link.jsx +++ b/test/unit/xss/anchor-target-rel/link.jsx @@ -1,6 +1,6 @@ import React from "react" import { render } from "enzyme" -import { Link } from "components/layout-utils" +import { Link } from "core/components/layout-utils" describe(" Anchor Target Safety", function () { const dummyComponent = () => null diff --git a/test/unit/xss/anchor-target-rel/markdown.jsx b/test/unit/xss/anchor-target-rel/markdown.jsx index a247a14273d..362861ae6c0 100644 --- a/test/unit/xss/anchor-target-rel/markdown.jsx +++ b/test/unit/xss/anchor-target-rel/markdown.jsx @@ -1,7 +1,7 @@ import React from "react" import { render } from "enzyme" -import Markdown from "components/providers/markdown" -import { Markdown as OAS3Markdown } from "corePlugins/oas3/wrap-components/markdown.jsx" +import Markdown from "core/components/providers/markdown" +import { Markdown as OAS3Markdown } from "core/plugins/oas3/wrap-components/markdown.jsx" describe("Markdown Link Anchor Safety", function () { describe("Swagger 2.0", function () { diff --git a/test/unit/xss/anchor-target-rel/online-validator-badge.jsx b/test/unit/xss/anchor-target-rel/online-validator-badge.jsx index ecce983a7b6..bc4c03fd465 100644 --- a/test/unit/xss/anchor-target-rel/online-validator-badge.jsx +++ b/test/unit/xss/anchor-target-rel/online-validator-badge.jsx @@ -1,6 +1,6 @@ import React from "react" import { mount } from "enzyme" -import OnlineValidatorBadge from "components/online-validator-badge" +import OnlineValidatorBadge from "core/components/online-validator-badge" describe(" Anchor Target Safety", function () { it("should render a validator link with safe `rel` attributes", function () { diff --git a/test/unit/xss/info-sanitization.jsx b/test/unit/xss/info-sanitization.jsx index 1ce595e028e..c4b847c3b26 100644 --- a/test/unit/xss/info-sanitization.jsx +++ b/test/unit/xss/info-sanitization.jsx @@ -1,8 +1,8 @@ import React from "react" import { render } from "enzyme" import { fromJS } from "immutable" -import Info from "components/info" -import Markdown from "components/providers/markdown" +import Info from "core/components/info" +import Markdown from "core/components/providers/markdown" describe(" Sanitization", function(){ const dummyComponent = () => null diff --git a/test/unit/xss/markdown-script-sanitization.jsx b/test/unit/xss/markdown-script-sanitization.jsx index c2c4e257041..34ff2e24340 100644 --- a/test/unit/xss/markdown-script-sanitization.jsx +++ b/test/unit/xss/markdown-script-sanitization.jsx @@ -1,7 +1,7 @@ import React from "react" import { render } from "enzyme" -import Markdown from "components/providers/markdown" -import { Markdown as OAS3Markdown } from "corePlugins/oas3/wrap-components/markdown.jsx" +import Markdown from "core/components/providers/markdown" +import { Markdown as OAS3Markdown } from "core/plugins/oas3/wrap-components/markdown.jsx" describe("Markdown Script Sanitization", function() { describe("Swagger 2.0", function() { diff --git a/webpack/_config-builder.js b/webpack/_config-builder.js index 73d500aac2e..2ef221e4318 100644 --- a/webpack/_config-builder.js +++ b/webpack/_config-builder.js @@ -2,14 +2,14 @@ * @prettier */ -import path from "path" -import deepExtend from "deep-extend" -import webpack from "webpack" -import TerserPlugin from "terser-webpack-plugin" -import nodeExternals from "webpack-node-externals" +const path = require("path") +const deepExtend = require("deep-extend") +const webpack = require("webpack") +const TerserPlugin = require("terser-webpack-plugin") +const nodeExternals = require("webpack-node-externals") -import { getRepoInfo } from "./_helpers" -import pkg from "../package.json" +const { getRepoInfo } = require("./_helpers") +const pkg = require("../package.json") const projectBasePath = path.join(__dirname, "../") @@ -33,7 +33,7 @@ const baseRules = [ }, ] -export default function buildConfig( +function buildConfig( { minimize = true, mangle = true, @@ -143,6 +143,13 @@ export default function buildConfig( new TerserPlugin({ terserOptions: { mangle: !!mangle, + keep_classnames: + !customConfig.mode || customConfig.mode === "production", + keep_fnames: + !customConfig.mode || customConfig.mode === "production", + output: { + comments: false, + }, }, }).apply(compiler), ], @@ -156,3 +163,5 @@ export default function buildConfig( return completeConfig } + +module.exports = buildConfig diff --git a/webpack/_helpers.js b/webpack/_helpers.js index 4d060633376..042cc0e058b 100644 --- a/webpack/_helpers.js +++ b/webpack/_helpers.js @@ -2,9 +2,9 @@ * @prettier */ -import { gitDescribeSync } from "git-describe" +const { gitDescribeSync } = require("git-describe") -export function getRepoInfo() { +function getRepoInfo() { try { return gitDescribeSync(__dirname) } catch (e) { @@ -15,3 +15,7 @@ export function getRepoInfo() { } } } + +module.exports = { + getRepoInfo, +} diff --git a/webpack/bundle.babel.js b/webpack/bundle.js similarity index 79% rename from webpack/bundle.babel.js rename to webpack/bundle.js index 12de71face3..bd0ecae26f4 100644 --- a/webpack/bundle.babel.js +++ b/webpack/bundle.js @@ -2,16 +2,19 @@ * @prettier */ -/** Dev Note: +/** Dev Note: * StatsWriterPlugin is disabled by default; uncomment to enable * when enabled, rebuilding the bundle will cause error for assetSizeLimit, * which we want to keep out of CI/CD * post build, cli command: npx webpack-bundle-analyzer - */ + */ + +const { DuplicatesPlugin } = require("inspectpack/plugin") +const { + WebpackBundleSizeAnalyzerPlugin, +} = require("webpack-bundle-size-analyzer") +const configBuilder = require("./_config-builder") -import configBuilder from "./_config-builder" -import { DuplicatesPlugin } from "inspectpack/plugin" -import { WebpackBundleSizeAnalyzerPlugin } from "webpack-bundle-size-analyzer" // import path from "path" // import { StatsWriterPlugin } from "webpack-stats-plugin" @@ -24,9 +27,7 @@ const result = configBuilder( }, { entry: { - "swagger-ui-bundle": [ - "./src/index.js", - ], + "swagger-ui-bundle": ["./src/index.js"], }, output: { globalObject: "this", @@ -51,4 +52,4 @@ const result = configBuilder( } ) -export default result +module.exports = result diff --git a/webpack/core.babel.js b/webpack/core.js similarity index 71% rename from webpack/core.babel.js rename to webpack/core.js index 0ceed8b5180..0249bcc6843 100644 --- a/webpack/core.babel.js +++ b/webpack/core.js @@ -2,7 +2,7 @@ * @prettier */ -import configBuilder from "./_config-builder" +const configBuilder = require("./_config-builder") const result = configBuilder( { @@ -13,9 +13,7 @@ const result = configBuilder( }, { entry: { - "swagger-ui": [ - "./src/index.js", - ], + "swagger-ui": ["./src/index.js"], }, output: { @@ -28,4 +26,4 @@ const result = configBuilder( } ) -export default result +module.exports = result diff --git a/webpack/dev-e2e.babel.js b/webpack/dev-e2e.js similarity index 82% rename from webpack/dev-e2e.babel.js rename to webpack/dev-e2e.js index a96786666ce..2f1ebdf5e1a 100644 --- a/webpack/dev-e2e.babel.js +++ b/webpack/dev-e2e.js @@ -2,10 +2,10 @@ * @prettier */ -import path from "path" +const path = require("path") -import configBuilder from "./_config-builder" -import styleConfig from "./stylesheets.babel" +const configBuilder = require("./_config-builder") +const styleConfig = require("./stylesheets") // Pretty much the same as devConfig, but with changes to port and static.directory const devE2eConfig = configBuilder( @@ -18,17 +18,15 @@ const devE2eConfig = configBuilder( { mode: "development", entry: { - "swagger-ui-bundle": [ - "./src/core/index.js", - ], + "swagger-ui-bundle": ["./src/core/index.js"], "swagger-ui-standalone-preset": [ - "./src/standalone/index.js", + "./src/standalone/presets/standalone/index.js", ], "swagger-ui": "./src/style/main.scss", }, performance: { - hints: false + hints: false, }, output: { @@ -61,7 +59,7 @@ const devE2eConfig = configBuilder( }, devMiddleware: {}, }, - }, + } ) // mix in the style config's plugins and loader rules @@ -73,4 +71,4 @@ devE2eConfig.module.rules = [ ...styleConfig.module.rules, ] -export default devE2eConfig +module.exports = devE2eConfig diff --git a/webpack/dev.babel.js b/webpack/dev.js similarity index 78% rename from webpack/dev.babel.js rename to webpack/dev.js index 1b498577629..bb5b8ba23ab 100644 --- a/webpack/dev.babel.js +++ b/webpack/dev.js @@ -2,13 +2,15 @@ * @prettier */ -import path from "path" -import ReactRefreshWebpackPlugin from "@pmmmwh/react-refresh-webpack-plugin" -import HtmlWebpackPlugin from "html-webpack-plugin" -import { HtmlWebpackSkipAssetsPlugin } from "html-webpack-skip-assets-plugin" +const path = require("path") +const ReactRefreshWebpackPlugin = require("@pmmmwh/react-refresh-webpack-plugin") +const HtmlWebpackPlugin = require("html-webpack-plugin") +const { + HtmlWebpackSkipAssetsPlugin, +} = require("html-webpack-skip-assets-plugin") -import configBuilder from "./_config-builder" -import styleConfig from "./stylesheets.babel" +const configBuilder = require("./_config-builder") +const styleConfig = require("./stylesheets") const projectBasePath = path.join(__dirname, "../") const isDevelopment = process.env.NODE_ENV !== "production" @@ -23,18 +25,16 @@ const devConfig = configBuilder( { mode: "development", entry: { - "swagger-ui-bundle": [ - "./src/core/index.js", - ], + "swagger-ui-bundle": ["./src/core/index.js"], "swagger-ui-standalone-preset": [ - "./src/standalone/index.js", + "./src/standalone/presets/standalone/index.js", ], "swagger-ui": "./src/style/main.scss", vendors: ["react-refresh/runtime"], }, performance: { - hints: false + hints: false, }, output: { @@ -79,7 +79,9 @@ const devConfig = configBuilder( options: { retainLines: true, cacheDirectory: true, - plugins: [isDevelopment && require.resolve("react-refresh/babel")].filter(Boolean), + plugins: [ + isDevelopment && require.resolve("react-refresh/babel"), + ].filter(Boolean), }, }, { @@ -106,7 +108,7 @@ const devConfig = configBuilder( optimization: { runtimeChunk: "single", // for multiple entry points using ReactRefreshWebpackPlugin }, - }, + } ) // mix in the style config's plugins and loader rules @@ -118,4 +120,4 @@ devConfig.module.rules = [ ...styleConfig.module.rules, ] -export default devConfig +module.exports = devConfig diff --git a/webpack/es-bundle-core.babel.js b/webpack/es-bundle-core.js similarity index 74% rename from webpack/es-bundle-core.babel.js rename to webpack/es-bundle-core.js index 064170efa65..274aae87748 100644 --- a/webpack/es-bundle-core.babel.js +++ b/webpack/es-bundle-core.js @@ -2,18 +2,19 @@ * @prettier */ - /** Dev Note: +/** Dev Note: * StatsWriterPlugin is disabled by default; uncomment to enable * when enabled, rebuilding the bundle will cause error for assetSizeLimit, * which we want to keep out of CI/CD * post build, cli command: npx webpack-bundle-analyzer */ - -import configBuilder from "./_config-builder" -import { DuplicatesPlugin } from "inspectpack/plugin" -import { WebpackBundleSizeAnalyzerPlugin } from "webpack-bundle-size-analyzer" -import nodeExternals from "webpack-node-externals" -// import { StatsWriterPlugin } from "webpack-stats-plugin" +const configBuilder = require("./_config-builder") +const { DuplicatesPlugin } = require("inspectpack/plugin") +const { + WebpackBundleSizeAnalyzerPlugin, +} = require("webpack-bundle-size-analyzer") +const nodeExternals = require("webpack-node-externals") +// const { StatsWriterPlugin } = require("webpack-stats-plugin") const minimize = true const sourcemaps = true @@ -26,10 +27,9 @@ const result = configBuilder( includeDependencies: false, }, { + target: "browserslist", entry: { - "swagger-ui-es-bundle-core": [ - "./src/index.js", - ], + "swagger-ui-es-bundle-core": ["./src/index.js"], }, experiments: { outputModule: true, @@ -52,11 +52,10 @@ const result = configBuilder( }, nodeExternals({ allowlist: [ - /object\/define-property/, // @babel/runtime-corejs3 import which makes fragment work with Jest "deep-extend", // uses Buffer as global symbol "randombytes", // uses require('safe-buffer') "sha.js", // uses require('safe-buffer') - "xml", // uses require('stream') + /xml/, // uses require('stream') /process\/browser/, // is injected via ProvidePlugin /readable-stream/, // byproduct of buffer ProvidePlugin injection "util-deprecate", // dependency of readable-stream @@ -68,20 +67,23 @@ const result = configBuilder( ], importType: (moduleName) => { return `module ${moduleName}` - }}) + }, + }), ], plugins: [ new DuplicatesPlugin({ emitErrors: false, verbose: false, }), - new WebpackBundleSizeAnalyzerPlugin("log.es-bundle-core-sizes.swagger-ui.txt"), + new WebpackBundleSizeAnalyzerPlugin( + "log.es-bundle-core-sizes.swagger-ui.txt" + ), // new StatsWriterPlugin({ // filename: path.join("log.es-bundle-core-stats.swagger-ui.json"), // fields: null, // }), - ] + ], } ) -export default result +module.exports = result diff --git a/webpack/es-bundle.babel.js b/webpack/es-bundle.js similarity index 80% rename from webpack/es-bundle.babel.js rename to webpack/es-bundle.js index d24a95df8ba..08ac5bc20bb 100644 --- a/webpack/es-bundle.babel.js +++ b/webpack/es-bundle.js @@ -9,9 +9,11 @@ * post build, cli command: npx webpack-bundle-analyzer */ -import configBuilder from "./_config-builder" -import { DuplicatesPlugin } from "inspectpack/plugin" -import { WebpackBundleSizeAnalyzerPlugin } from "webpack-bundle-size-analyzer" +const configBuilder = require("./_config-builder") +const { DuplicatesPlugin } = require("inspectpack/plugin") +const { + WebpackBundleSizeAnalyzerPlugin, +} = require("webpack-bundle-size-analyzer") // import path from "path" // import { StatsWriterPlugin } from "webpack-stats-plugin" @@ -24,9 +26,7 @@ const result = configBuilder( }, { entry: { - "swagger-ui-es-bundle": [ - "./src/index.js", - ], + "swagger-ui-es-bundle": ["./src/index.js"], }, output: { globalObject: "this", @@ -47,8 +47,8 @@ const result = configBuilder( // filename: path.join("log.es-bundle-stats.swagger-ui.json"), // fields: null, // }), - ] + ], } ) -export default result +module.exports = result diff --git a/webpack/standalone.babel.js b/webpack/standalone.js similarity index 62% rename from webpack/standalone.babel.js rename to webpack/standalone.js index a1998a14ce2..c777af7e496 100644 --- a/webpack/standalone.babel.js +++ b/webpack/standalone.js @@ -2,7 +2,7 @@ * @prettier */ -import configBuilder from "./_config-builder" +const configBuilder = require("./_config-builder") const result = configBuilder( { @@ -12,7 +12,9 @@ const result = configBuilder( }, { entry: { - "swagger-ui-standalone-preset": ["./src/standalone/index.js"], + "swagger-ui-standalone-preset": [ + "./src/standalone/presets/standalone/index.js", + ], }, output: { @@ -25,4 +27,4 @@ const result = configBuilder( } ) -export default result +module.exports = result diff --git a/webpack/stylesheets.babel.js b/webpack/stylesheets.js similarity index 93% rename from webpack/stylesheets.babel.js rename to webpack/stylesheets.js index e3af988bcd5..31ce364cc20 100644 --- a/webpack/stylesheets.babel.js +++ b/webpack/stylesheets.js @@ -5,10 +5,10 @@ // NOTE: this config *does not* inherit from `_config-builder`. // It is also used in the dev config. -import path from "path" -import MiniCssExtractPlugin from "mini-css-extract-plugin" +const path = require("path") +const MiniCssExtractPlugin = require("mini-css-extract-plugin") -export default { +module.exports = { mode: "production", entry: {