From 999223901c55f4c4d880578300e0e74150333281 Mon Sep 17 00:00:00 2001 From: Joshua Bauer Date: Fri, 20 Nov 2020 13:38:54 -0800 Subject: [PATCH] Removed swagger module and updated dependencies. --- CHANGELOG.md | 5 + pom.xml | 54 +- proteus-core/pom.xml | 18 +- .../sinistral/proteus/ProteusApplication.java | 6 +- .../src/main/resources/reference.conf | 4 + .../test/converters/MoneyModelConverter.java | 8 +- proteus-swagger/pom.xml | 122 -- proteus-swagger/pom.xml.releaseBackup | 122 -- .../swagger/jaxrs2/AnnotationHelper.java | 222 -- .../proteus/swagger/jaxrs2/Reader.java | 1391 ------------- .../jaxrs2/ServerParameterExtension.java | 68 - .../swagger/services/SwaggerService.java | 598 ------ .../src/main/resources/application.conf | 91 - .../io/sinistral/proteus/swagger/index.html | 119 -- .../proteus/swagger/proteus-logo.svg | 17 - .../io/sinistral/proteus/swagger/redoc.html | 25 - .../proteus/swagger/swagger-ui-bundle.js | 98 - .../swagger/swagger-ui-standalone-preset.js | 12 - .../sinistral/proteus/swagger/swagger-ui.css | 1 - .../sinistral/proteus/swagger/swagger-ui.js | 7 - .../swagger/themes/theme-feeling-blue.css | 1672 --------------- .../proteus/swagger/themes/theme-flattop.css | 1672 --------------- .../proteus/swagger/themes/theme-material.css | 1687 ---------------- .../proteus/swagger/themes/theme-monokai.css | 1792 ----------------- .../proteus/swagger/themes/theme-muted.css | 1673 --------------- .../swagger/themes/theme-newspaper.css | 1671 --------------- .../proteus/swagger/themes/theme-outline.css | 1652 --------------- .../swagger/test/controllers/Tests.java | 271 --- .../swagger/test/server/DefaultServer.java | 129 -- .../test/server/TestControllerEndpoints.java | 87 - .../src/test/resources/application.conf | 91 - .../src/test/resources/logback-test.xml | 53 - 32 files changed, 55 insertions(+), 15383 deletions(-) delete mode 100644 proteus-swagger/pom.xml delete mode 100644 proteus-swagger/pom.xml.releaseBackup delete mode 100644 proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/AnnotationHelper.java delete mode 100644 proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/Reader.java delete mode 100644 proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/ServerParameterExtension.java delete mode 100644 proteus-swagger/src/main/java/io/sinistral/proteus/swagger/services/SwaggerService.java delete mode 100644 proteus-swagger/src/main/resources/application.conf delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/index.html delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/proteus-logo.svg delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/redoc.html delete mode 100755 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/swagger-ui-bundle.js delete mode 100755 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/swagger-ui-standalone-preset.js delete mode 100755 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/swagger-ui.css delete mode 100755 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/swagger-ui.js delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/themes/theme-feeling-blue.css delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/themes/theme-flattop.css delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/themes/theme-material.css delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/themes/theme-monokai.css delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/themes/theme-muted.css delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/themes/theme-newspaper.css delete mode 100644 proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/themes/theme-outline.css delete mode 100644 proteus-swagger/src/test/java/io/sinistral/proteus/swagger/test/controllers/Tests.java delete mode 100644 proteus-swagger/src/test/java/io/sinistral/proteus/swagger/test/server/DefaultServer.java delete mode 100644 proteus-swagger/src/test/java/io/sinistral/proteus/swagger/test/server/TestControllerEndpoints.java delete mode 100644 proteus-swagger/src/test/resources/application.conf delete mode 100644 proteus-swagger/src/test/resources/logback-test.xml diff --git a/CHANGELOG.md b/CHANGELOG.md index d333077..1a940ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ Proteus Changelog. ## Unreleased ### No issue +**Async service timeouts.** + + +[5b1ff1de664b009](https://github.com/noboomu/proteus/commit/5b1ff1de664b009) Joshua Bauer *2020-11-20 01:22:12* + **Controllers are now compiled in parallel.** diff --git a/pom.xml b/pom.xml index d259c60..5315b2e 100644 --- a/pom.xml +++ b/pom.xml @@ -14,7 +14,6 @@ proteus-core - proteus-swagger proteus-openapi @@ -40,40 +39,41 @@ - 1.8 - 1.8 - UTF-8 - 2.1.0.Final - 2.9.8 - 28.1-jre - 4.2.2 - 1.3.3 - 1.25 - 2.6 - 1.7.30 - 2.3.1 + + 1.60 + 2.8.0 + 3.11 + 30.0-jre + 4.2.3 + 4.4.13 + 2.11.3 2.1.6 1.18 - 6.0.3 - 3.9 1.11.1 - 0.9.12 - 4.4.12 1.2.3 - 2.0.6 - 1.5.21 - 1.60 - ${project.version} - 3.2.1 - 1.6.8 - 3.2.0 + 3.8.1 3.0.0-M1 - 3.2.1 - 3.1.1 1.6 + 3.2.0 + 3.1.1 2.5.3 - 3.8.1 + 3.2.1 + 3.2.1 3.0.0-M4 + 12 + 12 + 1.6.8 + 2.1.5 + 2.3.1 + UTF-8 + ${project.version} + 0.9.12 + 1.7.30 + 1.25 + 1.5.21 + 1.3.3 + 2.1.0.Final + 6.0.3 diff --git a/proteus-core/pom.xml b/proteus-core/pom.xml index b49baac..6ca5620 100644 --- a/proteus-core/pom.xml +++ b/proteus-core/pom.xml @@ -192,11 +192,6 @@ Proteus Changelog. ${javapoet.version} - - com.google.inject - guice - ${guice.version} - com.google.guava @@ -204,6 +199,19 @@ Proteus Changelog. ${guava.version} + + + com.google.inject + guice + ${guice.version} + + + com.google.guava + guava + + + + com.typesafe config diff --git a/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java b/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java index f0fb0ec..d328b65 100644 --- a/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java +++ b/proteus-core/src/main/java/io/sinistral/proteus/ProteusApplication.java @@ -246,7 +246,7 @@ public void failure(Service service) try { - serviceManager.startAsync().awaitHealthy(120L, TimeUnit.SECONDS); + serviceManager.startAsync().awaitHealthy(config.getDuration("application.services.timeout")); } catch( Exception e ) { log.error("Failed start to services within 2 minutes",e); @@ -289,6 +289,8 @@ public void buildServer() CopyOnWriteArrayList>> routerClasses = new CopyOnWriteArrayList<>(); + log.info("Generating route handlers..."); + for (Class controllerClass : registeredControllers) { @@ -333,6 +335,8 @@ public void buildServer() this.addDefaultRoutes(router); + log.info("Route handlers generated"); + HttpHandler handler; if (rootHandlerClass != null) diff --git a/proteus-core/src/main/resources/reference.conf b/proteus-core/src/main/resources/reference.conf index 2d0f960..f66f485 100644 --- a/proteus-core/src/main/resources/reference.conf +++ b/proteus-core/src/main/resources/reference.conf @@ -29,6 +29,10 @@ application { # path to default favicon file favicon = "/io/sinistral/proteus/favicon.ico" + + services { + timeout = 2 minutes + } } diff --git a/proteus-openapi/src/test/java/io/sinistral/proteus/openapi/test/converters/MoneyModelConverter.java b/proteus-openapi/src/test/java/io/sinistral/proteus/openapi/test/converters/MoneyModelConverter.java index b4c25fe..94aaf2c 100644 --- a/proteus-openapi/src/test/java/io/sinistral/proteus/openapi/test/converters/MoneyModelConverter.java +++ b/proteus-openapi/src/test/java/io/sinistral/proteus/openapi/test/converters/MoneyModelConverter.java @@ -139,13 +139,7 @@ public int hashCode() * Convert the given object to string with each line indented by 4 spaces * (except the first line). */ - private String toIndentedString(java.lang.Object o) - { - if (o == null) { - return "null"; - } - return o.toString().replace("\n", "\n "); - } + } } diff --git a/proteus-swagger/pom.xml b/proteus-swagger/pom.xml deleted file mode 100644 index cf46973..0000000 --- a/proteus-swagger/pom.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - proteus-project - io.sinistral - 0.5.0-SNAPSHOT - - - 4.0.0 - - proteus-swagger - - Proteus Swagger - - jar - - - - - - src/main/resources - false - - - - - src/test/resources - - - src/test/java - - **/*.java - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.0 - - - - test-jar - - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - maven-surefire-plugin - org.apache.maven.plugins - - - - org.apache.maven.plugins - maven-gpg-plugin - - - org.sonatype.plugins - nexus-staging-maven-plugin - - - org.apache.maven.plugins - maven-release-plugin - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger.version} - - - io.swagger - swagger-core - ${swagger.version} - - - org.slf4j - slf4j-api - - - - - io.swagger - swagger-jaxrs - ${swagger.version} - - - io.sinistral - proteus-core - ${proteus.version} - - - - - - - - https://oss.sonatype.org/content/groups/public/io/sinistral/proteus-swagger - - \ No newline at end of file diff --git a/proteus-swagger/pom.xml.releaseBackup b/proteus-swagger/pom.xml.releaseBackup deleted file mode 100644 index 97f681b..0000000 --- a/proteus-swagger/pom.xml.releaseBackup +++ /dev/null @@ -1,122 +0,0 @@ - - - - proteus-project - io.sinistral - 0.4.6-SNAPSHOT - - - 4.0.0 - - proteus-swagger - - Proteus Swagger - - jar - - - - - - src/main/resources - false - - - - - src/test/resources - - - src/test/java - - **/*.java - - - - - - - org.apache.maven.plugins - maven-jar-plugin - 3.1.0 - - - - test-jar - - - - - - org.apache.maven.plugins - maven-source-plugin - - - org.apache.maven.plugins - maven-javadoc-plugin - - - maven-surefire-plugin - org.apache.maven.plugins - - - - org.apache.maven.plugins - maven-gpg-plugin - - - org.sonatype.plugins - nexus-staging-maven-plugin - - - org.apache.maven.plugins - maven-release-plugin - - - - org.apache.maven.plugins - maven-compiler-plugin - - - - - - - - - - - io.swagger - swagger-annotations - ${swagger.version} - - - io.swagger - swagger-core - ${swagger.version} - - - org.slf4j - slf4j-api - - - - - io.swagger - swagger-jaxrs - ${swagger.version} - - - io.sinistral - proteus-core - ${proteus.version} - - - - - - - - https://oss.sonatype.org/content/groups/public/io/sinistral/proteus-swagger - - \ No newline at end of file diff --git a/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/AnnotationHelper.java b/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/AnnotationHelper.java deleted file mode 100644 index def9df2..0000000 --- a/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/AnnotationHelper.java +++ /dev/null @@ -1,222 +0,0 @@ - -/** - * - */ -package io.sinistral.proteus.swagger.jaxrs2; - -import io.swagger.annotations.ApiParam; -import io.swagger.annotations.Example; - -import javax.ws.rs.DefaultValue; -import javax.ws.rs.FormParam; -import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; -import java.lang.annotation.Annotation; -import java.lang.reflect.Parameter; - -/** - * @author jbauer - */ -public class AnnotationHelper -{ - public static ApiParam createApiParam(Parameter parameter) - { - return new ApiParam() - { - @Override - public Class annotationType() - { - return ApiParam.class; - } - @Override - public String name() - { - QueryParam queryParam = parameter.getAnnotation(QueryParam.class); - FormParam formParam = parameter.getAnnotation(FormParam.class); - PathParam pathParam = parameter.getAnnotation(PathParam.class); - - if (queryParam != null) - { - return queryParam.value(); - } - else if (pathParam != null) - { - return pathParam.value(); - } - else if (formParam != null) - { - return formParam.value(); - } - else - { - return parameter.getName(); - } - } - @Override - public String value() - { - // TODO Auto-generated method stub - return null; - } - @Override - public String defaultValue() - { - try { - - DefaultValue defaultValue = parameter.getAnnotation(DefaultValue.class); - - return defaultValue.value(); - - } catch (NullPointerException e) {} - - // TODO Auto-generated method stub - return null; - } - @Override - public String allowableValues() - { - // TODO Auto-generated method stub - return null; - } - @Override - public boolean required() - { - return !parameter.getParameterizedType().getTypeName().contains("java.util.Optional"); - } - @Override - public String access() - { - // TODO Auto-generated method stub - return null; - } - @Override - public boolean allowMultiple() - { - // TODO Auto-generated method stub - return false; - } - @Override - public boolean hidden() - { - // TODO Auto-generated method stub - return false; - } - @Override - public String example() - { - // TODO Auto-generated method stub - return null; - } - @Override - public Example examples() - { - // TODO Auto-generated method stub - return null; - } - @Override - public String type() - { - // TODO Auto-generated method stub - return null; - } - @Override - public String format() - { - return null; - } - @Override - public boolean allowEmptyValue() - { - // TODO Auto-generated method stub - return false; - } - @Override - public boolean readOnly() - { - // TODO Auto-generated method stub - return false; - } - @Override - public String collectionFormat() - { - // TODO Auto-generated method stub - return null; - } - }; - } - - public static FormParam createFormParam(Parameter parameter) - { - return new FormParam() - { - @Override - public String value() - { - FormParam annotation = parameter.getAnnotation(FormParam.class); - - if (annotation != null) - { - return annotation.value(); - } - - return parameter.getName(); - } - @Override - public Class annotationType() - { - return FormParam.class; - } - }; - } - - public static PathParam createPathParam(Parameter parameter) - { - return new PathParam() - { - @Override - public String value() - { - PathParam annotation = parameter.getAnnotation(PathParam.class); - - if (annotation != null) - { - return annotation.value(); - } - - return parameter.getName(); - } - @Override - public Class annotationType() - { - return PathParam.class; - } - }; - } - - public static QueryParam createQueryParam(Parameter parameter) - { - return new QueryParam() - { - @Override - public String value() - { - QueryParam annotation = parameter.getAnnotation(QueryParam.class); - - if (annotation != null) - { - return annotation.value(); - } - - return parameter.getName(); - } - @Override - public Class annotationType() - { - return QueryParam.class; - } - }; - } -} - - - diff --git a/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/Reader.java b/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/Reader.java deleted file mode 100644 index 56b45a8..0000000 --- a/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/Reader.java +++ /dev/null @@ -1,1391 +0,0 @@ -/** - * - */ -package io.sinistral.proteus.swagger.jaxrs2; - -import com.fasterxml.jackson.databind.BeanDescription; -import com.fasterxml.jackson.databind.JavaType; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.introspect.AnnotatedMethod; -import com.fasterxml.jackson.databind.introspect.AnnotatedParameter; -import com.fasterxml.jackson.databind.type.TypeFactory; -import io.sinistral.proteus.server.ServerRequest; -import io.sinistral.proteus.server.ServerResponse; -import io.swagger.annotations.Info; -import io.swagger.annotations.*; -import io.swagger.converter.ModelConverters; -import io.swagger.jaxrs.PATCH; -import io.swagger.jaxrs.config.DefaultReaderConfig; -import io.swagger.jaxrs.config.ReaderConfig; -import io.swagger.jaxrs.config.ReaderListener; -import io.swagger.jaxrs.ext.SwaggerExtension; -import io.swagger.jaxrs.ext.SwaggerExtensions; -import io.swagger.jaxrs.utils.ReaderUtils; -import io.swagger.models.Contact; -import io.swagger.models.ExternalDocs; -import io.swagger.models.License; -import io.swagger.models.Tag; -import io.swagger.models.*; -import io.swagger.models.auth.In; -import io.swagger.models.parameters.*; -import io.swagger.models.properties.ArrayProperty; -import io.swagger.models.properties.MapProperty; -import io.swagger.models.properties.Property; -import io.swagger.models.properties.RefProperty; -import io.swagger.util.BaseReaderUtils; -import io.swagger.util.ParameterProcessor; -import io.swagger.util.PathUtils; -import io.swagger.util.ReflectionUtils; -import io.undertow.server.HttpHandler; -import io.undertow.server.HttpServerExchange; -import org.apache.commons.lang3.StringUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.ws.rs.Consumes; -import javax.ws.rs.HttpMethod; -import javax.ws.rs.Produces; -import java.lang.annotation.Annotation; -import java.lang.reflect.Method; -import java.lang.reflect.ParameterizedType; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.util.*; -import java.util.concurrent.CompletableFuture; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Copied from swagger.io implementation with tweaks to ignore or re-map server specific classes - * @author jbauer - * - */ -public class Reader { - - private static Logger log = LoggerFactory.getLogger(Reader.class.getCanonicalName()); - - private static final Logger LOGGER = LoggerFactory.getLogger(Reader.class); - private static final String SUCCESSFUL_OPERATION = "successful operation"; - private static final String PATH_DELIMITER = "/"; - private static final Pattern PATH_PATTERN = Pattern.compile("\\{([^\\}]*?)\\}"); - - - private final ReaderConfig config; - private Swagger swagger; - - public Reader(Swagger swagger) { - this(swagger, null); - } - - public Reader(Swagger swagger, ReaderConfig config) { - this.swagger = (swagger == null) ? new Swagger() : swagger; - this.config = new DefaultReaderConfig(config); - } - - public Swagger getSwagger() { - return swagger; - } - - /** - * Scans a set of classes for both ReaderListeners and Swagger annotations. All found listeners will - * be instantiated before any of the classes are scanned for Swagger annotations - so they can be invoked - * accordingly. - * - * @param classes a set of classes to scan - * @return the generated Swagger definition - */ - public Swagger read(Set> classes) { - Set> sortedClasses = new TreeSet<>((class1, class2) -> { - if (class1.equals(class2)) { - return 0; - } else if (class1.isAssignableFrom(class2)) { - return -1; - } else if (class2.isAssignableFrom(class1)) { - return 1; - } - return class1.getName().compareTo(class2.getName()); - }); - sortedClasses.addAll(classes); - - Map, ReaderListener> listeners = new HashMap, ReaderListener>(); - - for (Class cls : sortedClasses) { - if (ReaderListener.class.isAssignableFrom(cls) && !listeners.containsKey(cls)) { - try { - listeners.put(cls, (ReaderListener) cls.newInstance()); - } catch (Exception e) { - LOGGER.error("Failed to create ReaderListener", e); - } - } - } - -// for (ReaderListener listener : listeners.values()) { -// try { -// listener.beforeScan(this, swagger); -// } catch (Exception e) { -// LOGGER.error("Unexpected error invoking beforeScan listener [" + listener.getClass().getName() + "]", e); -// } -// } - - // process SwaggerDefinitions first - so we get tags in desired order - for (Class cls : sortedClasses) { - SwaggerDefinition swaggerDefinition = cls.getAnnotation(SwaggerDefinition.class); - if (swaggerDefinition != null) { - readSwaggerConfig(cls, swaggerDefinition); - } - } - - for (Class cls : sortedClasses) { - read(cls, "", null, false, new String[0], new String[0], new LinkedHashMap<>(), new ArrayList<>(), new HashSet<>()); - } - -// for (ReaderListener listener : listeners.values()) { -// try { -// listener.afterScan(this, swagger); -// } catch (Exception e) { -// LOGGER.error("Unexpected error invoking afterScan listener [" + listener.getClass().getName() + "]", e); -// } -// } - - return swagger; - } - - /** - * Scans a single class for Swagger annotations - does not invoke ReaderListeners - */ - public Swagger read(Class cls) { - SwaggerDefinition swaggerDefinition = cls.getAnnotation(SwaggerDefinition.class); - if (swaggerDefinition != null) { - readSwaggerConfig(cls, swaggerDefinition); - } - - return read(cls, "", null, false, new String[0], new String[0], new LinkedHashMap<>(), new ArrayList<>(), new HashSet<>()); - } - - protected Swagger read(Class cls, String parentPath, String parentMethod, boolean isSubresource, String[] parentConsumes, String[] parentProduces, Map parentTags, List parentParameters) { - return read(cls, parentPath, parentMethod, isSubresource, parentConsumes, parentProduces, parentTags, parentParameters, new HashSet<>()); - } - - @SuppressWarnings("deprecation") - private Swagger read(Class cls, String parentPath, String parentMethod, boolean isSubresource, String[] parentConsumes, String[] parentProduces, Map parentTags, List parentParameters, Set> scannedResources) { - - Map tags = new TreeMap<>(); - - - List securities = new ArrayList<>(); - - String[] consumes = new String[0]; - String[] produces = new String[0]; - final Set globalSchemes = EnumSet.noneOf(Scheme.class); - - Api api = ReflectionUtils.getAnnotation(cls, Api.class); - - boolean hasPathAnnotation = (ReflectionUtils.getAnnotation(cls, javax.ws.rs.Path.class) != null); - boolean hasApiAnnotation = (api != null); - boolean isApiHidden = hasApiAnnotation && api.hidden(); - - // class readable only if annotated with ((@Path and @Api) or isSubresource ) - and @Api not hidden - boolean classReadable = ((hasPathAnnotation && hasApiAnnotation) || isSubresource) && !isApiHidden; - - // with scanAllResources true in config and @Api not hidden scan only if it has also @Path annotation or is subresource - boolean scanAll = !isApiHidden && config.isScanAllResources() && (hasPathAnnotation || isSubresource); - - // readable if classReadable or scanAll - boolean readable = classReadable || scanAll; - - if (!readable) { - return swagger; - } - - // api readable only if @Api present; cannot be hidden because checked in classReadable. - - if (hasApiAnnotation) { - // the value will be used as a tag for 2.0 UNLESS a Tags annotation is present - Set tagStrings = extractTags(api); - for (String tagString : tagStrings) { - Tag tag = new Tag().name(tagString); - tags.put(tagString, tag); - } - for (String tagName : tags.keySet()) { - swagger.tag(tags.get(tagName)); - } - - if (!api.produces().isEmpty()) { - produces = ReaderUtils.splitContentValues(new String[]{api.produces()}); - } - if (!api.consumes().isEmpty()) { - consumes = ReaderUtils.splitContentValues(new String[]{api.consumes()}); - } - globalSchemes.addAll(parseSchemes(api.protocols())); - - for (Authorization auth : api.authorizations()) { - if (auth.value() != null && !auth.value().isEmpty()) { - SecurityRequirement security = new SecurityRequirement(); - security.setName(auth.value()); - for (AuthorizationScope scope : auth.scopes()) { - if (scope.scope() != null && !scope.scope().isEmpty()) { - security.addScope(scope.scope()); - } - } - securities.add(security); - } - } - } - - if (readable) { - if (isSubresource) { - if (parentTags != null) { - tags.putAll(parentTags); - } - } - // merge consumes, produces - if (consumes.length == 0 && cls.getAnnotation(Consumes.class) != null) { - consumes = ReaderUtils.splitContentValues(cls.getAnnotation(Consumes.class).value()); - } - if (produces.length == 0 && cls.getAnnotation(Produces.class) != null) { - produces = ReaderUtils.splitContentValues(cls.getAnnotation(Produces.class).value()); - } - // look for method-level annotated properties - - // handle sub-resources by looking at return type - - final List globalParameters = new ArrayList(); - - // look for constructor-level annotated properties - globalParameters.addAll(ReaderUtils.collectConstructorParameters(cls, swagger)); - - // look for field-level annotated properties - globalParameters.addAll(ReaderUtils.collectFieldParameters(cls, swagger)); - - // build class/interface level @ApiResponse list - ApiResponses classResponseAnnotation = ReflectionUtils.getAnnotation(cls, ApiResponses.class); - List classApiResponses = new ArrayList(); - if (classResponseAnnotation != null) { - classApiResponses.addAll(Arrays.asList(classResponseAnnotation.value())); - } - - // parse the method - final javax.ws.rs.Path apiPath = ReflectionUtils.getAnnotation(cls, javax.ws.rs.Path.class); - JavaType classType = TypeFactory.defaultInstance().constructType(cls); - BeanDescription bd = new ObjectMapper().getSerializationConfig().introspect(classType); - Method methods[] = cls.getMethods(); - for (Method method : methods) { - AnnotatedMethod annotatedMethod = bd.findMethod(method.getName(), method.getParameterTypes()); - if (ReflectionUtils.isOverriddenMethod(method, cls)) { - continue; - } - javax.ws.rs.Path methodPath = ReflectionUtils.getAnnotation(method, javax.ws.rs.Path.class); - - String operationPath = getPath(apiPath, methodPath, parentPath); - Map regexMap = new LinkedHashMap<>(); - operationPath = PathUtils.parsePath(operationPath, regexMap); - - - - if (operationPath != null) { - if (isIgnored(operationPath)) { - continue; - } - - List pathParamNames = new ArrayList<>(); - - Matcher m = PATH_PATTERN.matcher(operationPath); - while(m.find()) - { - String pathParamName = m.group(1); - int bracketIndex = pathParamName.indexOf('['); - - if(bracketIndex > -1) - { - pathParamName = pathParamName.substring(0, bracketIndex); - } - - pathParamNames.add(pathParamName); - } - - - final ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); - String httpMethod = extractOperationMethod(apiOperation, method, SwaggerExtensions.chain()); - - Operation operation = null; - if (apiOperation != null || config.isScanAllResources() || httpMethod != null || methodPath != null) { - operation = parseMethod(cls, method, annotatedMethod, globalParameters, classApiResponses,pathParamNames); - } - if (operation == null) { - continue; - } - if (parentParameters != null) { - for (Parameter param : parentParameters) { - operation.parameter(param); - } - } - - for (Parameter param : operation.getParameters()) { - if (regexMap.get(param.getName()) != null) { - String pattern = regexMap.get(param.getName()); - param.setPattern(pattern); - } - } - - if (apiOperation != null) { - for (Scheme scheme : parseSchemes(apiOperation.protocols())) { - operation.scheme(scheme); - } - } - - if (operation.getSchemes() == null || operation.getSchemes().isEmpty()) { - for (Scheme scheme : globalSchemes) { - operation.scheme(scheme); - } - } - - String[] apiConsumes = consumes; - if (parentConsumes != null) { - Set both = new LinkedHashSet<>(Arrays.asList(apiConsumes)); - both.addAll(new LinkedHashSet<>(Arrays.asList(parentConsumes))); - if (operation.getConsumes() != null) { - both.addAll(new LinkedHashSet(operation.getConsumes())); - } - apiConsumes = both.toArray(new String[both.size()]); - } - - String[] apiProduces = produces; - if (parentProduces != null) { - Set both = new LinkedHashSet<>(Arrays.asList(apiProduces)); - both.addAll(new LinkedHashSet<>(Arrays.asList(parentProduces))); - if (operation.getProduces() != null) { - both.addAll(new LinkedHashSet(operation.getProduces())); - } - apiProduces = both.toArray(new String[both.size()]); - } - final Class subResource = getSubResourceWithJaxRsSubresourceLocatorSpecs(method); - if (subResource != null && !scannedResources.contains(subResource)) { - scannedResources.add(subResource); - read(subResource, operationPath, httpMethod, true, apiConsumes, apiProduces, tags, operation.getParameters(), scannedResources); - // remove the sub resource so that it can visit it later in another path - // but we have a room for optimization in the future to reuse the scanned result - // by caching the scanned resources in the reader instance to avoid actual scanning - // the the resources again - scannedResources.remove(subResource); - } - - // can't continue without a valid http method - httpMethod = (httpMethod == null) ? parentMethod : httpMethod; - - if (httpMethod != null) - { - if (apiOperation != null) { - for (String tag : apiOperation.tags()) { - if (!"".equals(tag)) { - operation.tag(tag); - swagger.tag(new Tag().name(tag)); - } - } - - operation.getVendorExtensions().putAll(BaseReaderUtils.parseExtensions(apiOperation.extensions())); - } - - if (operation.getConsumes() == null) { - for (String mediaType : apiConsumes) { - operation.consumes(mediaType); - } - } - if (operation.getProduces() == null) { - for (String mediaType : apiProduces) { - operation.produces(mediaType); - } - } - - if (operation.getTags() == null) { - for (String tagString : tags.keySet()) { - operation.tag(tagString); - } - } - // Only add global @Api securities if operation doesn't already have more specific securities - if (operation.getSecurity() == null) { - for (SecurityRequirement security : securities) { - operation.security(security); - } - } - - Path path = swagger.getPath(operationPath); - if (path == null) { - path = new Path(); - swagger.path(operationPath, path); - } - path.set(httpMethod, operation); - - readImplicitParameters(method, operation); - - readExternalDocs(method, operation); - } - } - } - } - - List swaggerTags = new ArrayList(swagger.getTags()); - - swaggerTags.sort( (a,b) -> { - return a.getName().compareTo(b.getName()); - }); - - swagger.setTags(swaggerTags); - - return swagger; - } - - private void readImplicitParameters(Method method, Operation operation) { - processImplicitParams(ReflectionUtils.getAnnotation(method, ApiImplicitParams.class), operation); - processImplicitParams(ReflectionUtils.getAnnotation(method.getDeclaringClass(), ApiImplicitParams.class), operation); - } - - private void processImplicitParams(ApiImplicitParams implicitParams, Operation operation) { - if (implicitParams != null) { - for (ApiImplicitParam param : implicitParams.value()) { - Parameter p = readImplicitParam(param); - if (p != null) { - operation.addParameter(p); - } - } - } - } - - private void readExternalDocs(Method method, Operation operation) { - io.swagger.annotations.ExternalDocs externalDocs = ReflectionUtils.getAnnotation(method, io.swagger.annotations.ExternalDocs.class); - if(externalDocs != null) { - operation.setExternalDocs(new ExternalDocs(externalDocs.value(), externalDocs.url())); - } - } - - protected Parameter readImplicitParam(ApiImplicitParam param) { - final Parameter p; - if (param.paramType().equalsIgnoreCase("path")) { - p = new PathParameter(); - } else if (param.paramType().equalsIgnoreCase("query")) { - p = new QueryParameter(); - } else if (param.paramType().equalsIgnoreCase("form") || param.paramType().equalsIgnoreCase("formData")) { - p = new FormParameter(); - } else if (param.paramType().equalsIgnoreCase("body")) { - p = null; - } else if (param.paramType().equalsIgnoreCase("header")) { - p = new HeaderParameter(); - } else { - LOGGER.warn("Unknown implicit parameter type: [{}]", param.paramType()); - return null; - } - final Type type = ReflectionUtils.typeFromString(param.dataType()); - return ParameterProcessor.applyAnnotations(swagger, p, (type == null) ? String.class : type, - Arrays.asList(param)); - } - - @SuppressWarnings("deprecation") - protected void readSwaggerConfig(Class cls, SwaggerDefinition config) { - if (!config.basePath().isEmpty()) { - swagger.setBasePath(config.basePath()); - } - - if (!config.host().isEmpty()) { - swagger.setHost(config.host()); - } - - readInfoConfig(config); - - for (String consume : config.consumes()) { - if (StringUtils.isNotEmpty(consume)) { - swagger.addConsumes(consume); - } - } - - for (String produce : config.produces()) { - if (StringUtils.isNotEmpty(produce)) { - swagger.addProduces(produce); - } - } - - for (OAuth2Definition oAuth2Config : config.securityDefinition().oAuth2Definitions()) { - io.swagger.models.auth.OAuth2Definition oAuth2Definition = new io.swagger.models.auth.OAuth2Definition(); - OAuth2Definition.Flow flow = oAuth2Config.flow(); - - if (flow.equals(OAuth2Definition.Flow.ACCESS_CODE)) { - oAuth2Definition = oAuth2Definition.accessCode(oAuth2Config.authorizationUrl(), oAuth2Config.tokenUrl()); - } else if (flow.equals(OAuth2Definition.Flow.APPLICATION)) { - oAuth2Definition = oAuth2Definition.application(oAuth2Config.tokenUrl()); - } else if (flow.equals(OAuth2Definition.Flow.IMPLICIT)) { - oAuth2Definition = oAuth2Definition.implicit(oAuth2Config.authorizationUrl()); - } else { - oAuth2Definition = oAuth2Definition.password(oAuth2Config.tokenUrl()); - } - - for (Scope scope : oAuth2Config.scopes()) { - oAuth2Definition.addScope(scope.name(), scope.description()); - } - - oAuth2Definition.setDescription(oAuth2Config.description()); - swagger.addSecurityDefinition(oAuth2Config.key(), oAuth2Definition); - } - - for (ApiKeyAuthDefinition[] apiKeyAuthConfigs : new ApiKeyAuthDefinition[][] { - config.securityDefinition().apiKeyAuthDefintions(), config.securityDefinition().apiKeyAuthDefinitions() }) { - for (ApiKeyAuthDefinition apiKeyAuthConfig : apiKeyAuthConfigs) { - io.swagger.models.auth.ApiKeyAuthDefinition apiKeyAuthDefinition = new io.swagger.models.auth.ApiKeyAuthDefinition(); - - apiKeyAuthDefinition.setName(apiKeyAuthConfig.name()); - apiKeyAuthDefinition.setIn(In.forValue(apiKeyAuthConfig.in().toValue())); - apiKeyAuthDefinition.setDescription(apiKeyAuthConfig.description()); - - swagger.addSecurityDefinition(apiKeyAuthConfig.key(), apiKeyAuthDefinition); - } - } - - for (BasicAuthDefinition[] basicAuthConfigs : new BasicAuthDefinition[][] { - config.securityDefinition().basicAuthDefinions(), config.securityDefinition().basicAuthDefinitions() }) { - for (BasicAuthDefinition basicAuthConfig : basicAuthConfigs) { - io.swagger.models.auth.BasicAuthDefinition basicAuthDefinition = new io.swagger.models.auth.BasicAuthDefinition(); - - basicAuthDefinition.setDescription(basicAuthConfig.description()); - - swagger.addSecurityDefinition(basicAuthConfig.key(), basicAuthDefinition); - } - } - - if (!config.externalDocs().value().isEmpty()) { - ExternalDocs externalDocs = swagger.getExternalDocs(); - if (externalDocs == null) { - externalDocs = new ExternalDocs(); - swagger.setExternalDocs(externalDocs); - } - - externalDocs.setDescription(config.externalDocs().value()); - - if (!config.externalDocs().url().isEmpty()) { - externalDocs.setUrl(config.externalDocs().url()); - } - } - - for (io.swagger.annotations.Tag tagConfig : config.tags()) { - if (!tagConfig.name().isEmpty()) { - Tag tag = new Tag(); - tag.setName(tagConfig.name()); - tag.setDescription(tagConfig.description()); - - if (!tagConfig.externalDocs().value().isEmpty()) { - tag.setExternalDocs(new ExternalDocs(tagConfig.externalDocs().value(), - tagConfig.externalDocs().url())); - } - - tag.getVendorExtensions().putAll(BaseReaderUtils.parseExtensions(tagConfig.extensions())); - - swagger.addTag(tag); - } - } - - for (SwaggerDefinition.Scheme scheme : config.schemes()) { - if (scheme != SwaggerDefinition.Scheme.DEFAULT) { - swagger.addScheme(Scheme.forValue(scheme.name())); - } - } - } - - protected void readInfoConfig(SwaggerDefinition config) { - Info infoConfig = config.info(); - io.swagger.models.Info info = swagger.getInfo(); - if (info == null) { - info = new io.swagger.models.Info(); - swagger.setInfo(info); - } - - if (!infoConfig.description().isEmpty()) { - info.setDescription(infoConfig.description()); - } - - if (!infoConfig.termsOfService().isEmpty()) { - info.setTermsOfService(infoConfig.termsOfService()); - } - - if (!infoConfig.title().isEmpty()) { - info.setTitle(infoConfig.title()); - } - - if (!infoConfig.version().isEmpty()) { - info.setVersion(infoConfig.version()); - } - - if (!infoConfig.contact().name().isEmpty()) { - Contact contact = info.getContact(); - if (contact == null) { - contact = new Contact(); - info.setContact(contact); - } - - contact.setName(infoConfig.contact().name()); - if (!infoConfig.contact().email().isEmpty()) { - contact.setEmail(infoConfig.contact().email()); - } - - if (!infoConfig.contact().url().isEmpty()) { - contact.setUrl(infoConfig.contact().url()); - } - } - - if (!infoConfig.license().name().isEmpty()) { - License license = info.getLicense(); - if (license == null) { - license = new License(); - info.setLicense(license); - } - - license.setName(infoConfig.license().name()); - if (!infoConfig.license().url().isEmpty()) { - license.setUrl(infoConfig.license().url()); - } - } - - info.getVendorExtensions().putAll(BaseReaderUtils.parseExtensions(infoConfig.extensions())); - } - - protected Class getSubResource(Method method) { - final Class rawType = method.getReturnType(); - final Class type; - if (Class.class.equals(rawType)) { - type = getClassArgument(method.getGenericReturnType()); - if (type == null) { - return null; - } - } else { - type = rawType; - } - - if (type.getAnnotation(Api.class) != null) { - return type; - } - - // For sub-resources that are not annotated with @Api, look for any HttpMethods. - for (Method m : type.getMethods()) { - if (extractOperationMethod(null, m, null) != null) { - return type; - } - } - - return null; - } - - protected Class getSubResourceWithJaxRsSubresourceLocatorSpecs(Method method) { - final Class rawType = method.getReturnType(); - final Class type; - if (Class.class.equals(rawType)) { - type = getClassArgument(method.getGenericReturnType()); - if (type == null) { - return null; - } - } else { - type = rawType; - } - - if (method.getAnnotation(javax.ws.rs.Path.class) != null) { - if (extractOperationMethod(null, method, null) == null) { - return type; - } - } - return null; - } - - private static Class getClassArgument(Type cls) { - if (cls instanceof ParameterizedType) { - final ParameterizedType parameterized = (ParameterizedType) cls; - final Type[] args = parameterized.getActualTypeArguments(); - if (args.length != 1) { - LOGGER.error("Unexpected class definition: {}", cls); - return null; - } - final Type first = args[0]; - if (first instanceof Class) { - return (Class) first; - } else { - return null; - } - } else { - LOGGER.error("Unknown class definition: {}", cls); - return null; - } - } - - protected Set extractTags(Api api) { - Set output = new LinkedHashSet<>(); - - boolean hasExplicitTags = false; - for (String tag : api.tags()) { - if (!"".equals(tag)) { - hasExplicitTags = true; - output.add(tag); - } - } - if (!hasExplicitTags) { - // derive tag from api path + description - String tagString = api.value().replace("/", ""); - if (!"".equals(tagString)) { - output.add(tagString); - } - } - return output; - } - - String getPath(javax.ws.rs.Path classLevelPath, javax.ws.rs.Path methodLevelPath, String parentPath) { - if (classLevelPath == null && methodLevelPath == null && StringUtils.isEmpty(parentPath)) { - return null; - } - StringBuilder b = new StringBuilder(); - if (parentPath != null && !"".equals(parentPath) && !"/".equals(parentPath)) { - if (!parentPath.startsWith("/")) { - parentPath = "/" + parentPath; - } - if (parentPath.endsWith("/")) { - parentPath = parentPath.substring(0, parentPath.length() - 1); - } - - b.append(parentPath); - } - if (classLevelPath != null) { - b.append(classLevelPath.value()); - } - if (methodLevelPath != null && !"/".equals(methodLevelPath.value())) { - String methodPath = methodLevelPath.value(); - if (!methodPath.startsWith("/") && !b.toString().endsWith("/")) { - b.append("/"); - } - if (methodPath.endsWith("/")) { - methodPath = methodPath.substring(0, methodPath.length() - 1); - } - b.append(methodPath); - } - String output = b.toString(); - if (!output.startsWith("/")) { - output = "/" + output; - } - if (output.endsWith("/") && output.length() > 1) { - return output.substring(0, output.length() - 1); - } else { - return output; - } - } - - private Map parseResponseHeaders(ResponseHeader[] headers) { - Map responseHeaders = null; - if (headers != null) { - for (ResponseHeader header : headers) { - String name = header.name(); - if (!"".equals(name)) { - if (responseHeaders == null) { - responseHeaders = new LinkedHashMap<>(); - } - String description = header.description(); - Class cls = header.response(); - - if (!isVoid(cls)) { - final Property property = ModelConverters.getInstance().readAsProperty(cls); - if (property != null) { - Property responseProperty = ContainerWrapper.wrapContainer(header.responseContainer(), property, - ContainerWrapper.ARRAY, ContainerWrapper.LIST, ContainerWrapper.SET); - responseProperty.setDescription(description); - responseHeaders.put(name, responseProperty); - appendModels(cls); - } - } - } - } - } - return responseHeaders; - } - - public Operation parseMethod(Method method) { - JavaType classType = TypeFactory.defaultInstance().constructType(method.getDeclaringClass()); - BeanDescription bd = new ObjectMapper().getSerializationConfig().introspect(classType); - return parseMethod(classType.getClass(), method, bd.findMethod(method.getName(), method.getParameterTypes()), - Collections. emptyList(), Collections. emptyList(),Collections.emptyList()); - } - - @SuppressWarnings("deprecation") - private Operation parseMethod(Class cls, Method method, AnnotatedMethod annotatedMethod, - List globalParameters, List classApiResponses, List pathParamNames) { - Operation operation = new Operation(); - if (annotatedMethod != null) { - method = annotatedMethod.getAnnotated(); - } - ApiOperation apiOperation = ReflectionUtils.getAnnotation(method, ApiOperation.class); - ApiResponses responseAnnotation = ReflectionUtils.getAnnotation(method, ApiResponses.class); - - String operationId; - // check if it's an inherited or implemented method. - boolean methodInSuperType = false; - if (!cls.isInterface()) { - methodInSuperType = ReflectionUtils.findMethod(method, cls.getSuperclass()) != null; - } - if (!methodInSuperType) { - for (Class implementedInterface : cls.getInterfaces()) { - methodInSuperType = ReflectionUtils.findMethod(method, implementedInterface) != null; - if (methodInSuperType) { - break; - } - } - } - if (!methodInSuperType) { - operationId = method.getName(); - } else { - operationId = this.getOperationId(method.getName()); - } - - String responseContainer = null; - - Type responseType = null; - Map defaultResponseHeaders = new LinkedHashMap(); - - - if (apiOperation != null) { - if (apiOperation.hidden()) { - return null; - } - if (operationId == null) { - operationId = apiOperation.nickname(); - } - - defaultResponseHeaders = parseResponseHeaders(apiOperation.responseHeaders()); - - operation.summary(apiOperation.value()).description(apiOperation.notes()); - - if (!isVoid(apiOperation.response())) { - responseType = apiOperation.response(); - } - if (!apiOperation.responseContainer().isEmpty()) { - responseContainer = apiOperation.responseContainer(); - } - List securities = new ArrayList(); - for (Authorization auth : apiOperation.authorizations()) { - if (!auth.value().isEmpty()) { - SecurityRequirement security = new SecurityRequirement(); - security.setName(auth.value()); - for (AuthorizationScope scope : auth.scopes()) { - if (!scope.scope().isEmpty()) { - security.addScope(scope.scope()); - } - } - securities.add(security); - } - } - for (SecurityRequirement sec : securities) { - operation.security(sec); - } - if (!apiOperation.consumes().isEmpty()) { - String[] consumesAr = ReaderUtils.splitContentValues(new String[]{apiOperation.consumes()}); - for (String consume : consumesAr) { - operation.consumes(consume); - } - } - if (!apiOperation.produces().isEmpty()) { - String[] producesAr = ReaderUtils.splitContentValues(new String[]{apiOperation.produces()}); - for (String produce : producesAr) { - operation.produces(produce); - } - } - } - - /* - * @TODO - * Use apiOperation response class instead of unwrapping ServerResponse's inner type - */ - - if (apiOperation != null && StringUtils.isNotEmpty(apiOperation.responseReference())) { - Response response = new Response().description(SUCCESSFUL_OPERATION); - response.schema(new RefProperty(apiOperation.responseReference())); - operation.addResponse(String.valueOf(apiOperation.code()), response); - } else if (responseType == null) { - // pick out response from method declaration - LOGGER.debug("picking up response class from method {}", method); - responseType = method.getGenericReturnType(); - } - - - if (responseType != null) { - final JavaType javaType = TypeFactory.defaultInstance().constructType(responseType); - if (!isVoid(javaType)) { - - final Class responseCls = javaType.getRawClass(); - - if( responseCls != null ) - { - if( responseCls.isAssignableFrom(ServerResponse.class)) - { - responseType = javaType.containedType(0); - } - else if( responseCls.isAssignableFrom(CompletableFuture.class) ) - { - Class futureCls = javaType.containedType(0).getRawClass(); - - if( futureCls.isAssignableFrom(ServerResponse.class)) - { - final JavaType futureType = TypeFactory.defaultInstance().constructType(javaType.containedType(0)); - responseType = futureType.containedType(0); - } - else - { - responseType = javaType.containedType(0); - } - } - } - } - } - - - if (isValidResponse(responseType)) { - final Property property = ModelConverters.getInstance().readAsProperty(responseType); - if (property != null) { - final Property responseProperty = ContainerWrapper.wrapContainer(responseContainer, property); - final int responseCode = (apiOperation == null) ? 200 : apiOperation.code(); - operation.response(responseCode, new Response().description(SUCCESSFUL_OPERATION).schema(responseProperty) - .headers(defaultResponseHeaders)); - appendModels(responseType); - } - } - - - operation.operationId(operationId); - - if (operation.getConsumes() == null || operation.getConsumes().isEmpty()) { - final Consumes consumes = ReflectionUtils.getAnnotation(method, Consumes.class); - if (consumes != null) { - for (String mediaType : ReaderUtils.splitContentValues(consumes.value())) { - operation.consumes(mediaType); - } - } - } - - if (operation.getProduces() == null || operation.getProduces().isEmpty()) { - final Produces produces = ReflectionUtils.getAnnotation(method, Produces.class); - if (produces != null) { - for (String mediaType : ReaderUtils.splitContentValues(produces.value())) { - operation.produces(mediaType); - } - } - } - - List apiResponses = new ArrayList<>(); - if (responseAnnotation != null) { - apiResponses.addAll(Arrays.asList(responseAnnotation.value())); - } - - Class[] exceptionTypes = method.getExceptionTypes(); - for (Class exceptionType : exceptionTypes) { - ApiResponses exceptionResponses = ReflectionUtils.getAnnotation(exceptionType, ApiResponses.class); - if (exceptionResponses != null) { - apiResponses.addAll(Arrays.asList(exceptionResponses.value())); - } - } - - for (ApiResponse apiResponse : apiResponses) { - addResponse(operation, apiResponse); - } - // merge class level @ApiResponse - for (ApiResponse apiResponse : classApiResponses) { - String key = (apiResponse.code() == 0) ? "default" : String.valueOf(apiResponse.code()); - if (operation.getResponses() != null && operation.getResponses().containsKey(key)) { - continue; - } - addResponse(operation, apiResponse); - } - - if (ReflectionUtils.getAnnotation(method, Deprecated.class) != null) { - operation.setDeprecated(true); - } - - // process parameters - for (Parameter globalParameter : globalParameters) { - - LOGGER.debug("globalParameters TYPE: " + globalParameter); - - operation.parameter(globalParameter); - } - - - Annotation[][] paramAnnotations = ReflectionUtils.getParameterAnnotations(method); - java.lang.reflect.Parameter[] methodParameters = method.getParameters(); - - if (annotatedMethod == null) { - Type[] genericParameterTypes = method.getGenericParameterTypes(); - - for (int i = 0; i < genericParameterTypes.length; i++) { - - Type type = TypeFactory.defaultInstance().constructType(genericParameterTypes[i], cls); - - if( type.getTypeName().contains("Optional") || type.getTypeName().contains("io.sinistral.proteus.server.ServerResponse")) - { - if( type instanceof com.fasterxml.jackson.databind.type.SimpleType) - { - com.fasterxml.jackson.databind.type.SimpleType simpleType = (com.fasterxml.jackson.databind.type.SimpleType)type; - - type = simpleType.containedType(0); - } - - } - - if(type.equals(ServerRequest.class) || type.equals(HttpServerExchange.class) || type.equals(HttpHandler.class) || type.getTypeName().contains("io.sinistral.proteus.server.ServerResponse")) - { - continue; - } - - - List parameters = getParameters(type, Arrays.asList(paramAnnotations[i]), methodParameters[i], pathParamNames); - - for (Parameter parameter : parameters) { - operation.parameter(parameter); - } - } - } else { - for (int i = 0; i < annotatedMethod.getParameterCount(); i++) { - AnnotatedParameter param = annotatedMethod.getParameter(i); - - if(param.getParameterType().equals(ServerRequest.class) || param.getParameterType().equals(HttpServerExchange.class) || param.getParameterType().equals(HttpHandler.class)|| param.getParameterType().getTypeName().contains("ServerResponse")) - { - continue; - } - - Type type = TypeFactory.defaultInstance().constructType(param.getParameterType(), cls); - - - - - List parameters = getParameters(type, Arrays.asList(paramAnnotations[i]),methodParameters[i],pathParamNames); - - for (Parameter parameter : parameters) { - - operation.parameter(parameter); - } - } - } - - if (operation.getResponses() == null) { - Response response = new Response().description(SUCCESSFUL_OPERATION); - - operation.response(200, response); - } - - processOperationDecorator(operation, method); - - return operation; - } - - private void processOperationDecorator(Operation operation, Method method) { - final Iterator chain = SwaggerExtensions.chain(); - if (chain.hasNext()) { - SwaggerExtension extension = chain.next(); - // LOGGER.debug("trying to decorate operation: {}", extension); - extension.decorateOperation(operation, method, chain); - } - } - - private void addResponse(Operation operation, ApiResponse apiResponse) { - Map responseHeaders = parseResponseHeaders(apiResponse.responseHeaders()); - - Response response = new Response().description(apiResponse.message()).headers(responseHeaders); - - if (apiResponse.code() == 0) { - operation.defaultResponse(response); - } else { - operation.response(apiResponse.code(), response); - } - - if (StringUtils.isNotEmpty(apiResponse.reference())) { - response.schema(new RefProperty(apiResponse.reference())); - } else if (!isVoid(apiResponse.response())) { - Type responseType = apiResponse.response(); - final Property property = ModelConverters.getInstance().readAsProperty(responseType); - if (property != null) { - response.schema(ContainerWrapper.wrapContainer(apiResponse.responseContainer(), property)); - appendModels(responseType); - } - } - } - - private List getParameters(Type type, List annotations, java.lang.reflect.Parameter methodParameter, List pathParamNames) { - final Iterator chain = SwaggerExtensions.chain(); - - - if (!chain.hasNext()) { - return Collections.emptyList(); - } - - - // LOGGER.debug("getParameters for {}", type); - Set typesToSkip = new HashSet<>(); - typesToSkip.add(TypeFactory.defaultInstance().constructType(ServerRequest.class)); - typesToSkip.add(TypeFactory.defaultInstance().constructType(HttpServerExchange.class)); - typesToSkip.add(TypeFactory.defaultInstance().constructType(ServerResponse.class)); - typesToSkip.add(TypeFactory.defaultInstance().constructType(HttpHandler.class)); - typesToSkip.add(TypeFactory.defaultInstance().constructType(io.undertow.server.session.Session.class)); - - final SwaggerExtension extension = chain.next(); - - if (typesToSkip.contains(type)) { - return Collections.emptyList(); - } - - - annotations = new ArrayList<>(annotations); - - - if(! annotations.stream().filter( a -> a instanceof ApiParam ).findFirst().isPresent() ) - { - annotations.add( AnnotationHelper.createApiParam( methodParameter ) ) ; - } - - - if(type.getTypeName().contains("java.nio.file.Path") || type.getTypeName().contains("java.nio.ByteBuffer") || type.getTypeName().contains("java.io.File")) - { - if(type.getTypeName().contains("java.nio.file.Path") || type.getTypeName().contains("java.nio.ByteBuffer")) - { - type = java.io.File.class; - } - - annotations.add(AnnotationHelper.createFormParam(methodParameter)); - - } - - if(annotations.size() == 1) - { - if( annotations.get(0) instanceof ApiParam) - { - // If there is only one ApiParam and the parameter type is a member of the java.lang and the name of that parameter is in the path operation's path make the assumption that this is a path param - if(methodParameter.getType().getName().indexOf("java.lang") > -1 && pathParamNames.contains(methodParameter.getName())) - { - annotations.add(AnnotationHelper.createPathParam(methodParameter)); - - } - // If there is only one ApiParam and the parameter type is a member of the java.lang or java.util package we make the assumption that this is a query param - else if( methodParameter.getType().getName().indexOf("java.lang") > -1 || methodParameter.getType().getName().indexOf("java.util") > -1 ) - { - annotations.add(AnnotationHelper.createQueryParam(methodParameter)); - } - } - } - - final List parameters = extension.extractParameters(annotations, type, typesToSkip, chain); - if (!parameters.isEmpty()) { - final List processed = new ArrayList(parameters.size()); - for (Parameter parameter : parameters) { - - // LOGGER.debug("getParameters for {}", type); - - if (ParameterProcessor.applyAnnotations(swagger, parameter, type, annotations) != null) { - - processed.add(parameter); - } - } - return processed; - } else { - // LOGGER.debug("no parameter found, looking at body params"); - final List body = new ArrayList(); - if (!typesToSkip.contains(type)) { - - Parameter param = ParameterProcessor.applyAnnotations(swagger, null, type, annotations); - if (param != null) { - - body.add(param); - } - } - return body; - } - } - - public String extractOperationMethod(ApiOperation apiOperation, Method method, Iterator chain) { - if (apiOperation != null && !"".equals(apiOperation.httpMethod())) { - return apiOperation.httpMethod().toLowerCase(); - } else if (method.getAnnotation(javax.ws.rs.GET.class) != null) { - return "get"; - } else if (method.getAnnotation(javax.ws.rs.PUT.class) != null) { - return "put"; - } else if (method.getAnnotation(javax.ws.rs.POST.class) != null) { - return "post"; - } else if (method.getAnnotation(javax.ws.rs.DELETE.class) != null) { - return "delete"; - } else if (method.getAnnotation(javax.ws.rs.OPTIONS.class) != null) { - return "options"; - } else if (method.getAnnotation(javax.ws.rs.HEAD.class) != null) { - return "head"; - } else if (method.getAnnotation(PATCH.class) != null) { - return "patch"; - } else if (method.getAnnotation(HttpMethod.class) != null) { - HttpMethod httpMethod = method.getAnnotation(HttpMethod.class); - return httpMethod.value().toLowerCase(); - } else if (!StringUtils.isEmpty(getHttpMethodFromCustomAnnotations(method))) { - return getHttpMethodFromCustomAnnotations(method); - } else if ((ReflectionUtils.getOverriddenMethod(method)) != null) { - return extractOperationMethod(apiOperation, ReflectionUtils.getOverriddenMethod(method), chain); - } else if (chain != null && chain.hasNext()) { - return chain.next().extractOperationMethod(apiOperation, method, chain); - } else { - return null; - } - } - - private String getHttpMethodFromCustomAnnotations(Method method) { - for (Annotation methodAnnotation : method.getAnnotations()) { - HttpMethod httpMethod = methodAnnotation.annotationType().getAnnotation(HttpMethod.class); - if (httpMethod != null) { - return httpMethod.value().toLowerCase(); - } - } - return null; - } - - private static Set parseSchemes(String schemes) { - final Set result = EnumSet.noneOf(Scheme.class); - for (String item : StringUtils.trimToEmpty(schemes).split(",")) { - final Scheme scheme = Scheme.forValue(StringUtils.trimToNull(item)); - if (scheme != null) { - result.add(scheme); - } - } - return result; - } - - private void appendModels(Type type) { - - final Map models = ModelConverters.getInstance().readAll(type); - - for (Map.Entry entry : models.entrySet()) { - swagger.model(entry.getKey(), entry.getValue()); - } - } - - private static boolean isVoid(Type type) { - final Class cls = TypeFactory.defaultInstance().constructType(type).getRawClass(); - return Void.class.isAssignableFrom(cls) || Void.TYPE.isAssignableFrom(cls); - } - - private boolean isIgnored(String path) { - for (String item : config.getIgnoredRoutes()) { - final int length = item.length(); - if (path.startsWith(item) && (path.length() == length || path.startsWith(PATH_DELIMITER, length))) { - return true; - } - } - return false; - } - - private static boolean isValidResponse(Type type) { - if (type == null) { - return false; - } - final JavaType javaType = TypeFactory.defaultInstance().constructType(type); - if (isVoid(javaType)) { - return false; - } - - final Class cls = javaType.getRawClass(); - - if( cls != null ) - { - if( cls.isAssignableFrom(ServerResponse.class) || cls.isAssignableFrom(CompletableFuture.class) || cls.isAssignableFrom(ByteBuffer.class)) - { - return false; - } - } - - return !javax.ws.rs.core.Response.class.isAssignableFrom(cls) && !isResourceClass(cls); - } - - private static boolean isResourceClass(Class cls) { - return cls.getAnnotation(Api.class) != null; - } - - public ReaderConfig getConfig() { - return config; - } - - enum ContainerWrapper { - LIST("list") { - @Override - protected Property doWrap(Property property) { - return new ArrayProperty(property); - } - }, - ARRAY("array") { - @Override - protected Property doWrap(Property property) { - return new ArrayProperty(property); - } - }, - MAP("map") { - @Override - protected Property doWrap(Property property) { - return new MapProperty(property); - } - }, - SET("set") { - @Override - protected Property doWrap(Property property) { - ArrayProperty arrayProperty = new ArrayProperty(property); - arrayProperty.setUniqueItems(true); - return arrayProperty; - } - }; - - private final String container; - - ContainerWrapper(String container) { - this.container = container; - } - - public static Property wrapContainer(String container, Property property, ContainerWrapper... allowed) { - final Set tmp = (allowed.length > 0) ? EnumSet.copyOf(Arrays.asList(allowed)) - : EnumSet.allOf(ContainerWrapper.class); - for (ContainerWrapper wrapper : tmp) { - final Property prop = wrapper.wrap(container, property); - if (prop != null) { - return prop; - } - } - return property; - } - - public Property wrap(String container, Property property) { - if (this.container.equalsIgnoreCase(container)) { - return doWrap(property); - } - return null; - } - - protected abstract Property doWrap(Property property); - } - - protected String getOperationId(String operationId) { - boolean operationIdUsed = existOperationId(operationId); - String operationIdToFind = null; - int counter = 0; - while (operationIdUsed) { - - log.debug("duplicate operation id: " + operationIdUsed); - - operationIdToFind = String.format("%s_%d", operationId, ++counter); - operationIdUsed = existOperationId(operationIdToFind); - } - if (operationIdToFind != null) { - operationId = operationIdToFind; - } - return operationId; - } - - private boolean existOperationId(String operationId) { - if (swagger == null) { - return false; - } - if (swagger.getPaths() == null || swagger.getPaths().isEmpty()) { - return false; - } - for (Path path : swagger.getPaths().values()) { - for (Operation op : path.getOperations()) { - if (operationId.equalsIgnoreCase(op.getOperationId())) { - return true; - } - } - } - return false; - } -} \ No newline at end of file diff --git a/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/ServerParameterExtension.java b/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/ServerParameterExtension.java deleted file mode 100644 index c9a200e..0000000 --- a/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/jaxrs2/ServerParameterExtension.java +++ /dev/null @@ -1,68 +0,0 @@ - -/** - * - */ -package io.sinistral.proteus.swagger.jaxrs2; - -import com.fasterxml.jackson.databind.JavaType; -import io.swagger.jaxrs.DefaultParameterExtension; -import io.swagger.jaxrs.ext.SwaggerExtension; -import io.swagger.models.parameters.Parameter; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Type; -import java.util.Iterator; -import java.util.List; -import java.util.Set; - -/** - * @author jbauer - * - */ -public class ServerParameterExtension extends DefaultParameterExtension -{ - public ServerParameterExtension() - { - super(); - } - - @Override - protected JavaType constructType(Type type) - { - if (type.getTypeName().contains("java.nio.ByteBuffer") || type.getTypeName().contains("java.nio.file.Path")) - { - type = java.io.File.class; - } - - return super.constructType(type); - } - - @Override - public List extractParameters(List annotations, Type type, Set typesToSkip, Iterator chain) - { - if (type.getTypeName().contains("java.nio.ByteBuffer") || type.getTypeName().contains("java.nio.file.Path")) - { - type = java.io.File.class; - } - - return super.extractParameters(annotations, type, typesToSkip, chain); - } - - @Override - protected boolean shouldIgnoreType(Type type, Set typesToSkip) - { - if (type.getTypeName().contains("io.sinistral.proteus.server.ServerRequest") - || type.getTypeName().contains("HttpServerExchange") - || type.getTypeName().contains("HttpHandler") - || type.getTypeName().contains("io.sinistral.proteus.server.ServerResponse") - || type.getTypeName().contains("io.undertow.server.session")) - { - return true; - } - - return super.shouldIgnoreType(type, typesToSkip); - } -} - - - diff --git a/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/services/SwaggerService.java b/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/services/SwaggerService.java deleted file mode 100644 index 5b89214..0000000 --- a/proteus-swagger/src/main/java/io/sinistral/proteus/swagger/services/SwaggerService.java +++ /dev/null @@ -1,598 +0,0 @@ - -package io.sinistral.proteus.swagger.services; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.ObjectWriter; -import com.fasterxml.jackson.databind.SerializationFeature; -import com.google.inject.Inject; -import com.google.inject.Singleton; -import com.google.inject.name.Named; -import com.typesafe.config.Config; -import io.sinistral.proteus.server.endpoints.EndpointInfo; -import io.sinistral.proteus.services.DefaultService; -import io.sinistral.proteus.swagger.jaxrs2.Reader; -import io.sinistral.proteus.swagger.jaxrs2.ServerParameterExtension; -import io.swagger.jaxrs.ext.SwaggerExtension; -import io.swagger.jaxrs.ext.SwaggerExtensions; -import io.swagger.models.Info; -import io.swagger.models.Swagger; -import io.swagger.util.Json; -import io.swagger.util.Yaml; -import io.undertow.server.HandlerWrapper; -import io.undertow.server.HttpServerExchange; -import io.undertow.server.RoutingHandler; -import io.undertow.server.handlers.ResponseCodeHandler; -import io.undertow.server.handlers.resource.FileResourceManager; -import io.undertow.server.handlers.resource.ResourceHandler; -import io.undertow.util.CanonicalPathUtils; -import io.undertow.util.Headers; -import io.undertow.util.Methods; -import org.apache.commons.io.FileUtils; -import org.apache.commons.io.IOUtils; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -import javax.ws.rs.HttpMethod; -import javax.ws.rs.core.MediaType; -import java.io.File; -import java.io.InputStream; -import java.net.URL; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.file.Files; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.StandardCopyOption; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.concurrent.CompletableFuture; -import java.util.function.Supplier; -import java.util.jar.JarFile; - -/** - * A service for generating and serving an Swagger 2.0 spec and ui. - * @author jbauer - */ - -@Singleton -public class SwaggerService extends DefaultService implements Supplier -{ - - private static Logger log = LoggerFactory.getLogger(SwaggerService.class.getCanonicalName()); - - protected Reader reader = null; - - protected final String resourcePathPrefix = "swagger"; - - protected final String resourcePrefix = "io/sinistral/proteus/swagger"; - - @Inject - @Named("swagger.basePath") - protected String basePath; - - @Inject - @Named("swagger.theme") - protected String theme; - - @Inject - @Named("swagger.specFilename") - protected String specFilename; - - @Inject - @Named("swagger") - protected Config swaggerConfig; - - @Inject - @Named("swagger.security") - protected Config securityConfig; - - @Inject - @Named("swagger.redocPath") - protected String redocPath; - - @Inject - @Named("swagger.host") - protected String host; - - @Inject - @Named("application.name") - protected String applicationName; - - @Inject - @Named("swagger.port") - protected Integer port; - - @Inject - @Named("application.path") - protected String applicationPath; - - @Inject - protected RoutingHandler router; - - @Inject - @Named("registeredEndpoints") - protected Set registeredEndpoints; - - @Inject - @Named("registeredControllers") - protected Set> registeredControllers; - - @Inject - @Named("registeredHandlerWrappers") - protected Map registeredHandlerWrappers; - - protected ObjectMapper mapper; - - protected ObjectWriter writer; - - protected ObjectMapper yamlMapper; - - protected Path swaggerResourcePath = null; - - protected ClassLoader serviceClassLoader = null; - - protected Swagger swagger = null; - - protected String swaggerSpec = null; - - protected String swaggerIndexHTML = null; - - protected String redocHTML = null; - - public SwaggerService() - { - mapper = Json.mapper(); - - writer = mapper.writerWithDefaultPrettyPrinter(); - writer = writer.without(SerializationFeature.WRITE_NULL_MAP_VALUES); - yamlMapper = Yaml.mapper(); - } - - public void generateSwaggerSpec() throws Exception - { - - Set> classes = this.registeredControllers; - - log.debug("registeredControllers: " + this.registeredControllers); - - List extensions = new ArrayList<>(); - - extensions.add(new ServerParameterExtension()); - - SwaggerExtensions.setExtensions(extensions); - - log.debug("Added SwaggerExtension: ServerParameterExtension"); - - Swagger swagger = new Swagger(); - - swagger.setBasePath(applicationPath); - - swagger.setHost(host + ((port != 80 && port != 443) ? ":" + port : "")); - - Info info = mapper.convertValue(swaggerConfig.getValue("info").unwrapped(), Info.class); - - swagger.setInfo(info); - -// if (securityConfig.hasPath("apiKeys")) -// { -// List apiKeys = securityConfig.getObjectList("apiKeys"); -// -// for (ConfigObject apiKey : apiKeys) -// { -// Config apiKeyConfig = apiKey.toConfig(); -// -// String key = apiKeyConfig.getString("key"); -// String name = apiKeyConfig.getString("name"); -// String value = apiKeyConfig.getString("value"); -// -// io.swagger.converters.auth.In keyLocation = io.swagger.converters.auth.In.valueOf(apiKeyConfig.getString("in")); -// -// final Predicate predicate; -// -// switch (keyLocation) -// { -// case HEADER: -// { -// ExchangeAttribute[] attributes = new ExchangeAttribute[] { ExchangeAttributes.requestHeader(HttpString.tryFromString(name)), -// ExchangeAttributes.constant(value) }; -// predicate = Predicates.equals(attributes); -// break; -// } -// case QUERY: -// { -// predicate = Predicates.contains(ExchangeAttributes.queryString(), value); -// break; -// } -// default: -// predicate = Predicates.truePredicate(); -// break; -// } -// -// if (predicate != null) -// { -// log.debug("Adding apiKey handler " + name + " in " + keyLocation + " named " + key); -// -// final HandlerWrapper wrapper = new HandlerWrapper() -// { -// @Override -// public HttpHandler wrap(final HttpHandler handler) -// { -// return new PredicateHandler(predicate, handler, ResponseCodeHandler.HANDLE_403); -// } -// }; -// -// ApiKeyAuthDefinition keyAuthDefinition = new ApiKeyAuthDefinition(name, keyLocation); -// swagger.addSecurityDefinition(key, keyAuthDefinition); -// -// registeredHandlerWrappers.put(key, wrapper); -// } -// } -// } -// -// if (securityConfig.hasPath("basicRealms")) -// { -// List realms = securityConfig.getObjectList("basicRealms"); -// -// for (ConfigObject realm : realms) -// { -// Config realmConfig = realm.toConfig(); -// -// final String name = realmConfig.getString("name"); -// -// List identities = realmConfig.getStringList("identities"); -// -// final Map identityMap = new HashMap<>(); -// -// identities.stream().forEach(i -> -// { -// String[] identity = i.split(":"); -// -// identityMap.put(identity[0], identity[1].toCharArray()); -// }); -// -// final IdentityManager identityManager = new MapIdentityManager(identityMap); -// -// log.debug("Adding basic handler for realm " + name + " with identities " + identityMap); -// -// final HandlerWrapper wrapper = new HandlerWrapper() -// { -// @Override -// public HttpHandler wrap(final HttpHandler handler) -// { -// HttpHandler authHandler = new AuthenticationCallHandler(handler); -// authHandler = new AuthenticationConstraintHandler(authHandler); -// final List mechanisms = Collections. singletonList(new BasicAuthenticationMechanism(name)); -// authHandler = new AuthenticationMechanismsHandler(authHandler, mechanisms); -// authHandler = new SecurityInitialHandler(AuthenticationMode.PRO_ACTIVE, identityManager, authHandler); -// return authHandler; -// } -// }; -// -// BasicAuthDefinition authDefinition = new BasicAuthDefinition(); -// swagger.addSecurityDefinition(name, authDefinition); -// -// registeredHandlerWrappers.put(name, wrapper); -// -// } -// } - - this.reader = new Reader(swagger); - - classes.forEach(c -> this.reader.read(c)); - - this.swagger = this.reader.getSwagger(); - - this.swaggerSpec = writer.writeValueAsString(swagger); - - } - - public Swagger getSwagger() - { - return swagger; - } - - public void setSwagger(Swagger swagger) - { - this.swagger = swagger; - } - - protected void generateSwaggerHTML() - { - try - { - - try (InputStream templateInputStream = getClass().getClassLoader().getResourceAsStream(resourcePrefix + "/index.html")) - { - byte[] templateBytes = IOUtils.toByteArray(templateInputStream); - - String templateString = new String(templateBytes, Charset.defaultCharset()); - - String themePath = "swagger-ui.css"; - - if (!theme.equals("default")) - { - themePath = "themes/theme-" + theme + ".css"; - } - - templateString = templateString.replaceAll("\\{\\{ themePath }}", themePath); - templateString = templateString.replaceAll("\\{\\{ swaggerBasePath }}", basePath); - templateString = templateString.replaceAll("\\{\\{ title }}", applicationName + " Swagger UI"); - templateString = templateString.replaceAll("\\{\\{ swaggerFilePath }}", basePath + ".json"); - - this.swaggerIndexHTML = templateString; - } - - try (InputStream templateInputStream = getClass().getClassLoader().getResourceAsStream(resourcePrefix + "/redoc.html")) - { - byte[] templateBytes = IOUtils.toByteArray(templateInputStream); - - String templateString = new String(templateBytes, Charset.defaultCharset()); - - templateString = templateString.replaceAll("\\{\\{ specPath }}", this.basePath + ".json"); - templateString = templateString.replaceAll("\\{\\{ applicationName }}", applicationName); - - this.redocHTML = templateString; - } - - URL url = getClass().getClassLoader().getResource(resourcePrefix); - - if (url.toExternalForm().contains("!")) - { - log.debug("Copying Swagger resources..."); - - String appName = config.getString("application.name").replaceAll(" ", "_"); - - Path tmpDirParent = Files.createTempDirectory(appName); - - Path swaggerTmpDir = tmpDirParent.resolve("swagger/"); - - String jarPathString = url.toExternalForm().substring(0, url.toExternalForm().indexOf("!")).replaceAll("file:", "").replaceAll("jar:", ""); - - File srcFile = new File(jarPathString); - - try (JarFile jarFile = new JarFile(srcFile, false)) - { - - if (swaggerTmpDir.toFile().exists()) - { - log.debug("Deleting existing Swagger directory at " + swaggerTmpDir); - - try - { - FileUtils.deleteDirectory(swaggerTmpDir.toFile()); - - } catch (IllegalArgumentException e) - { - log.debug("Swagger tmp directory is not a directory..."); - - swaggerTmpDir.toFile().delete(); - } - } - - Files.createDirectory(swaggerTmpDir); - - this.swaggerResourcePath = swaggerTmpDir; - - jarFile.stream().filter(ze -> ze.getName().endsWith("js") || ze.getName().endsWith("css") || ze.getName().endsWith("map") || ze.getName().endsWith("html")) - .forEach(ze -> - { - - try - { - final InputStream entryInputStream = jarFile.getInputStream(ze); - - String filename = ze.getName().substring(resourcePrefix.length() + 1); - - Path entryFilePath = swaggerTmpDir.resolve(filename); - - Files.createDirectories(entryFilePath.getParent()); - - Files.copy(entryInputStream, entryFilePath, StandardCopyOption.REPLACE_EXISTING); - - } catch (Exception e) - { - log.error(e.getMessage() + " for entry " + ze.getName()); - } - }); - } - } - else - { - this.swaggerResourcePath = Paths.get(this.getClass().getClassLoader().getResource(this.resourcePrefix).toURI()); - this.serviceClassLoader = this.getClass().getClassLoader(); - } - - } catch (Exception e) - { - log.error(e.getMessage(), e); - } - } - - public RoutingHandler get() - { - - RoutingHandler router = new RoutingHandler(); - - /* - * JSON path - */ - - String pathTemplate = this.basePath + ".json"; - - FileResourceManager resourceManager = new FileResourceManager(this.swaggerResourcePath.toFile(), 1024); - - - router.add(HttpMethod.GET, pathTemplate, (HttpServerExchange exchange) -> - { - final Swagger swaggerCopy = swagger; - - exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, MediaType.APPLICATION_JSON); - - String spec = null; - - try - { - swaggerCopy.setHost(exchange.getHostAndPort()); - - spec = writer.writeValueAsString(swaggerCopy); - - } catch (Exception e) - { - log.error(e.getMessage(), e); - } - - exchange.getResponseSender().send(spec); - - }); - - this.registeredEndpoints.add( - EndpointInfo.builder().withConsumes("*/*").withPathTemplate(pathTemplate).withControllerName(this.getClass().getSimpleName()) - .withMethod(Methods.GET).withProduces(MediaType.APPLICATION_JSON).build()); - - /* - * YAML path - */ - - pathTemplate = this.basePath + ".yaml"; - - router.add(HttpMethod.GET, pathTemplate, (HttpServerExchange exchange) -> - { - exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, io.sinistral.proteus.protocol.MediaType.TEXT_YAML.contentType()); - - String spec = null; - - final Swagger swaggerCopy = swagger; - - try - { - swaggerCopy.setHost(exchange.getHostAndPort()); - - spec = yamlMapper.writeValueAsString(swaggerCopy); - - } catch (Exception e) - { - log.error(e.getMessage(), e); - } - - exchange.getResponseSender().send(spec); - }); - - this.registeredEndpoints.add( - EndpointInfo.builder().withConsumes("*/*").withPathTemplate(pathTemplate).withControllerName(this.getClass().getSimpleName()) - .withMethod(Methods.GET).withProduces(io.sinistral.proteus.protocol.MediaType.TEXT_YAML.contentType()).build()); - - pathTemplate = this.basePath + "/" + this.redocPath; - - router.add(HttpMethod.GET, pathTemplate, (HttpServerExchange exchange) -> - { - exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, MediaType.TEXT_HTML); - exchange.getResponseSender().send(redocHTML); - }); - - this.registeredEndpoints.add( - EndpointInfo.builder().withConsumes("*/*").withPathTemplate(pathTemplate).withControllerName(this.getClass().getSimpleName()) - .withMethod(Methods.GET).withProduces(MediaType.TEXT_HTML).build()); - - pathTemplate = this.basePath; - - router.add(HttpMethod.GET, pathTemplate, (HttpServerExchange exchange) -> - { - exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, MediaType.TEXT_HTML); - exchange.getResponseSender().send(swaggerIndexHTML); - }); - - this.registeredEndpoints.add( - EndpointInfo.builder().withConsumes(MediaType.WILDCARD).withProduces(MediaType.TEXT_HTML).withPathTemplate(pathTemplate) - .withControllerName(this.getClass().getSimpleName()).withMethod(Methods.GET).build()); - - try - { - - pathTemplate = this.basePath + "/*"; - - router.add(HttpMethod.GET, pathTemplate, new ResourceHandler(resourceManager) - { - - @Override - public void handleRequest(HttpServerExchange exchange) throws Exception - { - - String canonicalPath = CanonicalPathUtils.canonicalize((exchange.getRelativePath())); - - canonicalPath = canonicalPath.split(basePath)[1]; - - exchange.setRelativePath(canonicalPath); - - if (serviceClassLoader == null) - { - super.handleRequest(exchange); - } - else - { - canonicalPath = resourcePrefix + canonicalPath; - - try (final InputStream resourceInputStream = serviceClassLoader.getResourceAsStream(canonicalPath)) - { - - if (resourceInputStream == null) - { - ResponseCodeHandler.HANDLE_404.handleRequest(exchange); - return; - } - - byte[] resourceBytes = IOUtils.toByteArray(resourceInputStream); - - io.sinistral.proteus.protocol.MediaType mediaType = io.sinistral.proteus.protocol.MediaType.getByFileName(canonicalPath); - - exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, mediaType.toString()); - - exchange.getResponseSender().send(ByteBuffer.wrap(resourceBytes)); - } - } - - } - - }); - - this.registeredEndpoints.add( - EndpointInfo.builder().withConsumes(MediaType.WILDCARD).withProduces(MediaType.WILDCARD).withPathTemplate(pathTemplate) - .withControllerName(this.getClass().getSimpleName()).withMethod(Methods.GET).build()); - - } catch (Exception e) - { - log.error(e.getMessage(), e); - } - - return router; - } - - @Override - protected void startUp() throws Exception - { - super.startUp(); - - this.generateSwaggerHTML(); - - CompletableFuture.runAsync(() -> - { - - try - { - - generateSwaggerSpec(); - - log.info("\nSwagger Spec:\n" + writer.writeValueAsString(swagger)); - - } catch (Exception e) - { - log.error("Error generating swagger spec.", e); - } - - }); - - router.addAll(this.get()); - } - -} diff --git a/proteus-swagger/src/main/resources/application.conf b/proteus-swagger/src/main/resources/application.conf deleted file mode 100644 index 9c55400..0000000 --- a/proteus-swagger/src/main/resources/application.conf +++ /dev/null @@ -1,91 +0,0 @@ - -application { - - env = dev - - version = "1.0" - - name="proteus" - - path = "/v1" - - host = "localhost" - - ports { - http = 0 - # https = 8443 - } - - charset = UTF-8 - - fallbackHandler = "io.sinistral.proteus.server.handlers.ServerFallbackHandler" - - defaultResponseListener = "io.sinistral.proteus.server.handlers.ServerDefaultResponseListener" - - tmpdir = ${java.io.tmpdir}/${application.name} - - # path to default favicon file - favicon = "/io/sinistral/proteus/favicon.ico" - -} - -api.version="v1" - -globalHeaders -{ -# Access-Control-Allow-Origin: "*" -# Access-Control-Allow-Methods: "*" -# Access-Control-Allow-Headers: "*" - Server = ${application.name} -} - -assets { - # the base path assets will be server from - path = "/public" - # the directory to load the assets from - dir = "./assets" - cache { - # cache timeout for the assets - time = 500 - } - - -} - - - - - -undertow -{ - server { - enableHttp2 = false - alwaysSetDate = true - alwaysSetKeepAlive = false - recordRequestStartTime = false - maxEntitySize = 100M - bufferPipelinedData = false - } - - socket { - backlog = 10000 - } - - - ssl { - enabled=false - keystorePath="development.jks" - truststorePath="development.ts" - keystorePassword="password" - truststorePassword="password" - } - - enableHttp2=false - # x AvailableProcessors - ioThreadsMultiplier = 2 - workerThreadMultiplier = 8 - bufferSize = 16K - directBuffers = true -} - - \ No newline at end of file diff --git a/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/index.html b/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/index.html deleted file mode 100644 index 1f13f97..0000000 --- a/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/index.html +++ /dev/null @@ -1,119 +0,0 @@ - - - - - - - {{ title }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - diff --git a/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/proteus-logo.svg b/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/proteus-logo.svg deleted file mode 100644 index ab4ad7b..0000000 --- a/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/proteus-logo.svg +++ /dev/null @@ -1,17 +0,0 @@ - - - - - proteus - - - - - - - - - - diff --git a/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/redoc.html b/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/redoc.html deleted file mode 100644 index b99afb5..0000000 --- a/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/redoc.html +++ /dev/null @@ -1,25 +0,0 @@ - - - - ReDoc - - - - - - - - - - - - - - \ No newline at end of file diff --git a/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/swagger-ui-bundle.js b/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/swagger-ui-bundle.js deleted file mode 100755 index c6dd0a3..0000000 --- a/proteus-swagger/src/main/resources/io/sinistral/proteus/swagger/swagger-ui-bundle.js +++ /dev/null @@ -1,98 +0,0 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.SwaggerUIBundle=t():e.SwaggerUIBundle=t()}(this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist",t(t.s=1215)}([function(e,t,n){"use strict";e.exports=n(91)},function(e,t,n){e.exports=n(997)()},function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(331),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(){function e(e,t){for(var n=0;n>>0;if(""+n!==t||4294967295===n)return NaN;t=n}return t<0?d(e)+t:t}function v(){return!0}function g(e,t,n){return(0===e||void 0!==n&&e<=-n)&&(void 0===t||void 0!==n&&t>=n)}function y(e,t){return b(e,t,0)}function _(e,t){return b(e,t,t)}function b(e,t,n){return void 0===e?n:e<0?Math.max(0,t+e):void 0===t?e:Math.min(t,e)}function x(e){this.next=e}function w(e,t,n,r){var i=0===e?t:1===e?n:[t,n];return r?r.value=i:r={value:i,done:!1},r}function k(){return{value:void 0,done:!0}}function E(e){return!!A(e)}function S(e){return e&&"function"==typeof e.next}function C(e){var t=A(e);return t&&t.call(e)}function A(e){var t=e&&(wn&&e[wn]||e[kn]);if("function"==typeof t)return t}function D(e){return e&&"number"==typeof e.length}function O(e){return null===e||void 0===e?B():o(e)?e.toSeq():z(e)}function M(e){return null===e||void 0===e?B().toKeyedSeq():o(e)?a(e)?e.toSeq():e.fromEntrySeq():L(e)}function T(e){return null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e.toIndexedSeq():q(e)}function P(e){return(null===e||void 0===e?B():o(e)?a(e)?e.entrySeq():e:q(e)).toSetSeq()}function I(e){this._array=e,this.size=e.length}function R(e){var t=Object.keys(e);this._object=e,this._keys=t,this.size=t.length}function F(e){this._iterable=e,this.size=e.length||e.size}function j(e){this._iterator=e,this._iteratorCache=[]}function N(e){return!(!e||!e[Sn])}function B(){return Cn||(Cn=new I([]))}function L(e){var t=Array.isArray(e)?new I(e).fromEntrySeq():S(e)?new j(e).fromEntrySeq():E(e)?new F(e).fromEntrySeq():"object"==typeof e?new R(e):void 0;if(!t)throw new TypeError("Expected Array or iterable object of [k, v] entries, or keyed object: "+e);return t}function q(e){var t=U(e);if(!t)throw new TypeError("Expected Array or iterable object of values: "+e);return t}function z(e){var t=U(e)||"object"==typeof e&&new R(e);if(!t)throw new TypeError("Expected Array or iterable object of values, or keyed object: "+e);return t}function U(e){return D(e)?new I(e):S(e)?new j(e):E(e)?new F(e):void 0}function W(e,t,n,r){var i=e._cache;if(i){for(var o=i.length-1,a=0;a<=o;a++){var s=i[n?o-a:a];if(!1===t(s[1],r?s[0]:a,e))return a+1}return a}return e.__iterateUncached(t,n)}function V(e,t,n,r){var i=e._cache;if(i){var o=i.length-1,a=0;return new x(function(){var e=i[n?o-a:a];return a++>o?k():w(t,r?e[0]:a-1,e[1])})}return e.__iteratorUncached(t,n)}function H(e,t){return t?G(t,e,"",{"":e}):J(e)}function G(e,t,n,r){return Array.isArray(t)?e.call(r,n,T(t).map(function(n,r){return G(e,n,r,t)})):K(t)?e.call(r,n,M(t).map(function(n,r){return G(e,n,r,t)})):t}function J(e){return Array.isArray(e)?T(e).map(J).toList():K(e)?M(e).map(J).toMap():e}function K(e){return e&&(e.constructor===Object||void 0===e.constructor)}function X(e,t){if(e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1;if("function"==typeof e.valueOf&&"function"==typeof t.valueOf){if(e=e.valueOf(),t=t.valueOf(),e===t||e!==e&&t!==t)return!0;if(!e||!t)return!1}return!("function"!=typeof e.equals||"function"!=typeof t.equals||!e.equals(t))}function Y(e,t){if(e===t)return!0;if(!o(t)||void 0!==e.size&&void 0!==t.size&&e.size!==t.size||void 0!==e.__hash&&void 0!==t.__hash&&e.__hash!==t.__hash||a(e)!==a(t)||s(e)!==s(t)||l(e)!==l(t))return!1;if(0===e.size&&0===t.size)return!0;var n=!u(e);if(l(e)){var r=e.entries();return t.every(function(e,t){var i=r.next().value;return i&&X(i[1],e)&&(n||X(i[0],t))})&&r.next().done}var i=!1;if(void 0===e.size)if(void 0===t.size)"function"==typeof e.cacheResult&&e.cacheResult();else{i=!0;var c=e;e=t,t=c}var p=!0,f=t.__iterate(function(t,r){if(n?!e.has(t):i?!X(t,e.get(r,vn)):!X(e.get(r,vn),t))return p=!1,!1});return p&&e.size===f}function $(e,t){if(!(this instanceof $))return new $(e,t);if(this._value=e,this.size=void 0===t?1/0:Math.max(0,t),0===this.size){if(An)return An;An=this}}function Z(e,t){if(!e)throw new Error(t)}function Q(e,t,n){if(!(this instanceof Q))return new Q(e,t,n);if(Z(0!==n,"Cannot step a Range by 0"),e=e||0,void 0===t&&(t=1/0),n=void 0===n?1:Math.abs(n),t>>1&1073741824|3221225471&e}function oe(e){if(!1===e||null===e||void 0===e)return 0;if("function"==typeof e.valueOf&&(!1===(e=e.valueOf())||null===e||void 0===e))return 0;if(!0===e)return 1;var t=typeof e;if("number"===t){if(e!==e||e===1/0)return 0;var n=0|e;for(n!==e&&(n^=4294967295*e);e>4294967295;)e/=4294967295,n^=e;return ie(n)}if("string"===t)return e.length>jn?ae(e):se(e);if("function"==typeof e.hashCode)return e.hashCode();if("object"===t)return ue(e);if("function"==typeof e.toString)return se(e.toString());throw new Error("Value type "+t+" cannot be hashed.")}function ae(e){var t=Ln[e];return void 0===t&&(t=se(e),Bn===Nn&&(Bn=0,Ln={}),Bn++,Ln[e]=t),t}function se(e){for(var t=0,n=0;n0)switch(e.nodeType){case 1:return e.uniqueID;case 9:return e.documentElement&&e.documentElement.uniqueID}}function ce(e){Z(e!==1/0,"Cannot perform this action with an infinite size.")}function pe(e){return null===e||void 0===e?we():fe(e)&&!l(e)?e:we().withMutations(function(t){var r=n(e);ce(r.size),r.forEach(function(e,n){return t.set(n,e)})})}function fe(e){return!(!e||!e[qn])}function he(e,t){this.ownerID=e,this.entries=t}function de(e,t,n){this.ownerID=e,this.bitmap=t,this.nodes=n}function me(e,t,n){this.ownerID=e,this.count=t,this.nodes=n}function ve(e,t,n){this.ownerID=e,this.keyHash=t,this.entries=n}function ge(e,t,n){this.ownerID=e,this.keyHash=t,this.entry=n}function ye(e,t,n){this._type=t,this._reverse=n,this._stack=e._root&&be(e._root)}function _e(e,t){return w(e,t[0],t[1])}function be(e,t){return{node:e,index:0,__prev:t}}function xe(e,t,n,r){var i=Object.create(zn);return i.size=e,i._root=t,i.__ownerID=n,i.__hash=r,i.__altered=!1,i}function we(){return Un||(Un=xe(0))}function ke(e,t,n){var r,i;if(e._root){var o=c(gn),a=c(yn);if(r=Ee(e._root,e.__ownerID,0,void 0,t,n,o,a),!a.value)return e;i=e.size+(o.value?n===vn?-1:1:0)}else{if(n===vn)return e;i=1,r=new he(e.__ownerID,[[t,n]])}return e.__ownerID?(e.size=i,e._root=r,e.__hash=void 0,e.__altered=!0,e):r?xe(i,r):we()}function Ee(e,t,n,r,i,o,a,s){return e?e.update(t,n,r,i,o,a,s):o===vn?e:(p(s),p(a),new ge(t,r,[i,o]))}function Se(e){return e.constructor===ge||e.constructor===ve}function Ce(e,t,n,r,i){if(e.keyHash===r)return new ve(t,r,[e.entry,i]);var o,a=(0===n?e.keyHash:e.keyHash>>>n)&mn,s=(0===n?r:r>>>n)&mn;return new de(t,1<>>=1)a[s]=1&n?t[o++]:void 0;return a[r]=i,new me(e,o+1,a)}function Me(e,t,r){for(var i=[],a=0;a>1&1431655765,e=(858993459&e)+(e>>2&858993459),e=e+(e>>4)&252645135,e+=e>>8,127&(e+=e>>16)}function je(e,t,n,r){var i=r?e:h(e);return i[t]=n,i}function Ne(e,t,n,r){var i=e.length+1;if(r&&t+1===i)return e[t]=n,e;for(var o=new Array(i),a=0,s=0;s0&&io?0:o-n,l=a-n;return l>dn&&(l=dn),function(){if(i===l)return Xn;var e=t?--l:i++;return r&&r[e]}}function i(e,r,i){var s,u=e&&e.array,l=i>o?0:o-i>>r,c=1+(a-i>>r);return c>dn&&(c=dn),function(){for(;;){if(s){var e=s();if(e!==Xn)return e;s=null}if(l===c)return Xn;var o=t?--c:l++;s=n(u&&u[o],r-hn,i+(o<=e.size||t<0)return e.withMutations(function(e){t<0?Xe(e,t).set(0,n):Xe(e,0,t+1).set(t,n)});t+=e._origin;var r=e._tail,i=e._root,o=c(yn);return t>=$e(e._capacity)?r=Ge(r,e.__ownerID,0,t,n,o):i=Ge(i,e.__ownerID,e._level,t,n,o),o.value?e.__ownerID?(e._root=i,e._tail=r,e.__hash=void 0,e.__altered=!0,e):We(e._origin,e._capacity,e._level,i,r):e}function Ge(e,t,n,r,i,o){var a=r>>>n&mn,s=e&&a0){var l=e&&e.array[a],c=Ge(l,t,n-hn,r,i,o);return c===l?e:(u=Je(e,t),u.array[a]=c,u)}return s&&e.array[a]===i?e:(p(o),u=Je(e,t),void 0===i&&a===u.array.length-1?u.array.pop():u.array[a]=i,u)}function Je(e,t){return t&&e&&t===e.ownerID?e:new ze(e?e.array.slice():[],t)}function Ke(e,t){if(t>=$e(e._capacity))return e._tail;if(t<1<0;)n=n.array[t>>>r&mn],r-=hn;return n}}function Xe(e,t,n){void 0!==t&&(t|=0),void 0!==n&&(n|=0);var r=e.__ownerID||new f,i=e._origin,o=e._capacity,a=i+t,s=void 0===n?o:n<0?o+n:i+n;if(a===i&&s===o)return e;if(a>=s)return e.clear();for(var u=e._level,l=e._root,c=0;a+c<0;)l=new ze(l&&l.array.length?[void 0,l]:[],r),u+=hn,c+=1<=1<p?new ze([],r):d;if(d&&h>p&&ahn;g-=hn){var y=p>>>g&mn;v=v.array[y]=Je(v.array[y],r)}v.array[p>>>hn&mn]=d}if(s=h)a-=h,s-=h,u=hn,l=null,m=m&&m.removeBefore(r,0,a);else if(a>i||h>>u&mn;if(_!==h>>>u&mn)break;_&&(c+=(1<i&&(l=l.removeBefore(r,u,a-c)),l&&ha&&(a=l.size),o(u)||(l=l.map(function(e){return H(e)})),i.push(l)}return a>e.size&&(e=e.setSize(a)),Ie(e,t,i)}function $e(e){return e>>hn<=dn&&a.size>=2*o.size?(i=a.filter(function(e,t){return void 0!==e&&s!==t}),r=i.toKeyedSeq().map(function(e){return e[0]}).flip().toMap(),e.__ownerID&&(r.__ownerID=i.__ownerID=e.__ownerID)):(r=o.remove(t),i=s===a.size-1?a.pop():a.set(s,void 0))}else if(u){if(n===a.get(s)[1])return e;r=o,i=a.set(s,[t,n])}else r=o.set(t,a.size),i=a.set(a.size,[t,n]);return e.__ownerID?(e.size=r.size,e._map=r,e._list=i,e.__hash=void 0,e):et(r,i)}function rt(e,t){this._iter=e,this._useKeys=t,this.size=e.size}function it(e){this._iter=e,this.size=e.size}function ot(e){this._iter=e,this.size=e.size}function at(e){this._iter=e,this.size=e.size}function st(e){var t=Dt(e);return t._iter=e,t.size=e.size,t.flip=function(){return e},t.reverse=function(){var t=e.reverse.apply(this);return t.flip=function(){return e.reverse()},t},t.has=function(t){return e.includes(t)},t.includes=function(t){return e.has(t)},t.cacheResult=Ot,t.__iterateUncached=function(t,n){var r=this;return e.__iterate(function(e,n){return!1!==t(n,e,r)},n)},t.__iteratorUncached=function(t,n){if(t===xn){var r=e.__iterator(t,n);return new x(function(){var e=r.next();if(!e.done){var t=e.value[0];e.value[0]=e.value[1],e.value[1]=t}return e})}return e.__iterator(t===bn?_n:bn,n)},t}function ut(e,t,n){var r=Dt(e);return r.size=e.size,r.has=function(t){return e.has(t)},r.get=function(r,i){var o=e.get(r,vn);return o===vn?i:t.call(n,o,r,e)},r.__iterateUncached=function(r,i){var o=this;return e.__iterate(function(e,i,a){return!1!==r(t.call(n,e,i,a),i,o)},i)},r.__iteratorUncached=function(r,i){var o=e.__iterator(xn,i);return new x(function(){var i=o.next();if(i.done)return i;var a=i.value,s=a[0];return w(r,s,t.call(n,a[1],s,e),i)})},r}function lt(e,t){var n=Dt(e);return n._iter=e,n.size=e.size,n.reverse=function(){return e},e.flip&&(n.flip=function(){var t=st(e);return t.reverse=function(){return e.flip()},t}),n.get=function(n,r){return e.get(t?n:-1-n,r)},n.has=function(n){return e.has(t?n:-1-n)},n.includes=function(t){return e.includes(t)},n.cacheResult=Ot,n.__iterate=function(t,n){var r=this;return e.__iterate(function(e,n){return t(e,n,r)},!n)},n.__iterator=function(t,n){return e.__iterator(t,!n)},n}function ct(e,t,n,r){var i=Dt(e);return r&&(i.has=function(r){var i=e.get(r,vn);return i!==vn&&!!t.call(n,i,r,e)},i.get=function(r,i){var o=e.get(r,vn);return o!==vn&&t.call(n,o,r,e)?o:i}),i.__iterateUncached=function(i,o){var a=this,s=0;return e.__iterate(function(e,o,u){if(t.call(n,e,o,u))return s++,i(e,r?o:s-1,a)},o),s},i.__iteratorUncached=function(i,o){var a=e.__iterator(xn,o),s=0;return new x(function(){for(;;){var o=a.next();if(o.done)return o;var u=o.value,l=u[0],c=u[1];if(t.call(n,c,l,e))return w(i,r?l:s++,c,o)}})},i}function pt(e,t,n){var r=pe().asMutable();return e.__iterate(function(i,o){r.update(t.call(n,i,o,e),0,function(e){return e+1})}),r.asImmutable()}function ft(e,t,n){var r=a(e),i=(l(e)?Ze():pe()).asMutable();e.__iterate(function(o,a){i.update(t.call(n,o,a,e),function(e){return e=e||[],e.push(r?[a,o]:o),e})});var o=At(e);return i.map(function(t){return Et(e,o(t))})}function ht(e,t,n,r){var i=e.size;if(void 0!==t&&(t|=0),void 0!==n&&(n===1/0?n=i:n|=0),g(t,n,i))return e;var o=y(t,i),a=_(n,i);if(o!==o||a!==a)return ht(e.toSeq().cacheResult(),t,n,r);var s,u=a-o;u===u&&(s=u<0?0:u);var l=Dt(e);return l.size=0===s?s:e.size&&s||void 0,!r&&N(e)&&s>=0&&(l.get=function(t,n){return t=m(this,t),t>=0&&ts)return k();var e=i.next();return r||t===bn?e:t===_n?w(t,u-1,void 0,e):w(t,u-1,e.value[1],e)})},l}function dt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterate(r,i);var a=0;return e.__iterate(function(e,i,s){return t.call(n,e,i,s)&&++a&&r(e,i,o)}),a},r.__iteratorUncached=function(r,i){var o=this;if(i)return this.cacheResult().__iterator(r,i);var a=e.__iterator(xn,i),s=!0;return new x(function(){if(!s)return k();var e=a.next();if(e.done)return e;var i=e.value,u=i[0],l=i[1];return t.call(n,l,u,o)?r===xn?e:w(r,u,l,e):(s=!1,k())})},r}function mt(e,t,n,r){var i=Dt(e);return i.__iterateUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterate(i,o);var s=!0,u=0;return e.__iterate(function(e,o,l){if(!s||!(s=t.call(n,e,o,l)))return u++,i(e,r?o:u-1,a)}),u},i.__iteratorUncached=function(i,o){var a=this;if(o)return this.cacheResult().__iterator(i,o);var s=e.__iterator(xn,o),u=!0,l=0;return new x(function(){var e,o,c;do{if(e=s.next(),e.done)return r||i===bn?e:i===_n?w(i,l++,void 0,e):w(i,l++,e.value[1],e);var p=e.value;o=p[0],c=p[1],u&&(u=t.call(n,c,o,a))}while(u);return i===xn?e:w(i,o,c,e)})},i}function vt(e,t){var r=a(e),i=[e].concat(t).map(function(e){return o(e)?r&&(e=n(e)):e=r?L(e):q(Array.isArray(e)?e:[e]),e}).filter(function(e){return 0!==e.size});if(0===i.length)return e;if(1===i.length){var u=i[0];if(u===e||r&&a(u)||s(e)&&s(u))return u}var l=new I(i);return r?l=l.toKeyedSeq():s(e)||(l=l.toSetSeq()),l=l.flatten(!0),l.size=i.reduce(function(e,t){if(void 0!==e){var n=t.size;if(void 0!==n)return e+n}},0),l}function gt(e,t,n){var r=Dt(e);return r.__iterateUncached=function(r,i){function a(e,l){var c=this;e.__iterate(function(e,i){return(!t||l0}function kt(e,n,r){var i=Dt(e);return i.size=new I(r).map(function(e){return e.size}).min(),i.__iterate=function(e,t){for(var n,r=this.__iterator(bn,t),i=0;!(n=r.next()).done&&!1!==e(n.value,i++,this););return i},i.__iteratorUncached=function(e,i){var o=r.map(function(e){return e=t(e),C(i?e.reverse():e)}),a=0,s=!1;return new x(function(){var t;return s||(t=o.map(function(e){return e.next()}),s=t.some(function(e){return e.done})),s?k():w(e,a++,n.apply(null,t.map(function(e){return e.value})))})},i}function Et(e,t){return N(e)?t:e.constructor(t)}function St(e){if(e!==Object(e))throw new TypeError("Expected [K, V] tuple: "+e)}function Ct(e){return ce(e.size),d(e)}function At(e){return a(e)?n:s(e)?r:i}function Dt(e){return Object.create((a(e)?M:s(e)?T:P).prototype)}function Ot(){return this._iter.cacheResult?(this._iter.cacheResult(),this.size=this._iter.size,this):O.prototype.cacheResult.call(this)}function Mt(e,t){return e>t?1:et?-1:0}function on(e){if(e.size===1/0)return 0;var t=l(e),n=a(e),r=t?1:0;return an(e.__iterate(n?t?function(e,t){r=31*r+sn(oe(e),oe(t))|0}:function(e,t){r=r+sn(oe(e),oe(t))|0}:t?function(e){r=31*r+oe(e)|0}:function(e){r=r+oe(e)|0}),r)}function an(e,t){return t=Mn(t,3432918353),t=Mn(t<<15|t>>>-15,461845907),t=Mn(t<<13|t>>>-13,5),t=(t+3864292196|0)^e,t=Mn(t^t>>>16,2246822507),t=Mn(t^t>>>13,3266489909),t=ie(t^t>>>16)}function sn(e,t){return e^t+2654435769+(e<<6)+(e>>2)|0}var un=Array.prototype.slice;e(n,t),e(r,t),e(i,t),t.isIterable=o,t.isKeyed=a,t.isIndexed=s,t.isAssociative=u,t.isOrdered=l,t.Keyed=n,t.Indexed=r,t.Set=i;var ln="@@__IMMUTABLE_ITERABLE__@@",cn="@@__IMMUTABLE_KEYED__@@",pn="@@__IMMUTABLE_INDEXED__@@",fn="@@__IMMUTABLE_ORDERED__@@",hn=5,dn=1<r?k():w(e,i,n[t?r-i++:i++])})},e(R,M),R.prototype.get=function(e,t){return void 0===t||this.has(e)?this._object[e]:t},R.prototype.has=function(e){return this._object.hasOwnProperty(e)},R.prototype.__iterate=function(e,t){for(var n=this._object,r=this._keys,i=r.length-1,o=0;o<=i;o++){var a=r[t?i-o:o];if(!1===e(n[a],a,this))return o+1}return o},R.prototype.__iterator=function(e,t){var n=this._object,r=this._keys,i=r.length-1,o=0;return new x(function(){var a=r[t?i-o:o];return o++>i?k():w(e,a,n[a])})},R.prototype[fn]=!0,e(F,T),F.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);var n=this._iterable,r=C(n),i=0;if(S(r))for(var o;!(o=r.next()).done&&!1!==e(o.value,i++,this););return i},F.prototype.__iteratorUncached=function(e,t){if(t)return this.cacheResult().__iterator(e,t);var n=this._iterable,r=C(n);if(!S(r))return new x(k);var i=0;return new x(function(){var t=r.next();return t.done?t:w(e,i++,t.value)})},e(j,T),j.prototype.__iterateUncached=function(e,t){if(t)return this.cacheResult().__iterate(e,t);for(var n=this._iterator,r=this._iteratorCache,i=0;i=r.length){var t=n.next();if(t.done)return t;r[i]=t.value}return w(e,i,r[i++])})};var Cn;e($,T),$.prototype.toString=function(){return 0===this.size?"Repeat []":"Repeat [ "+this._value+" "+this.size+" times ]"},$.prototype.get=function(e,t){return this.has(e)?this._value:t},$.prototype.includes=function(e){return X(this._value,e)},$.prototype.slice=function(e,t){var n=this.size;return g(e,t,n)?this:new $(this._value,_(t,n)-y(e,n))},$.prototype.reverse=function(){return this},$.prototype.indexOf=function(e){return X(this._value,e)?0:-1},$.prototype.lastIndexOf=function(e){return X(this._value,e)?this.size:-1},$.prototype.__iterate=function(e,t){for(var n=0;n=0&&t=0&&nn?k():w(e,o++,a)})},Q.prototype.equals=function(e){return e instanceof Q?this._start===e._start&&this._end===e._end&&this._step===e._step:Y(this,e)};var Dn;e(ee,t),e(te,ee),e(ne,ee),e(re,ee),ee.Keyed=te,ee.Indexed=ne,ee.Set=re;var On,Mn="function"==typeof Math.imul&&-2===Math.imul(4294967295,2)?Math.imul:function(e,t){e|=0,t|=0;var n=65535&e,r=65535&t;return n*r+((e>>>16)*r+n*(t>>>16)<<16>>>0)|0},Tn=Object.isExtensible,Pn=function(){try{return Object.defineProperty({},"@",{}),!0}catch(e){return!1}}(),In="function"==typeof WeakMap;In&&(On=new WeakMap);var Rn=0,Fn="__immutablehash__";"function"==typeof Symbol&&(Fn=Symbol(Fn));var jn=16,Nn=255,Bn=0,Ln={};e(pe,te),pe.of=function(){var e=un.call(arguments,0);return we().withMutations(function(t){for(var n=0;n=e.length)throw new Error("Missing value for key: "+e[n]);t.set(e[n],e[n+1])}})},pe.prototype.toString=function(){return this.__toString("Map {","}")},pe.prototype.get=function(e,t){return this._root?this._root.get(0,void 0,e,t):t},pe.prototype.set=function(e,t){return ke(this,e,t)},pe.prototype.setIn=function(e,t){return this.updateIn(e,vn,function(){return t})},pe.prototype.remove=function(e){return ke(this,e,vn)},pe.prototype.deleteIn=function(e){return this.updateIn(e,function(){return vn})},pe.prototype.update=function(e,t,n){return 1===arguments.length?e(this):this.updateIn([e],t,n)},pe.prototype.updateIn=function(e,t,n){n||(n=t,t=void 0);var r=Re(this,Tt(e),t,n);return r===vn?void 0:r},pe.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._root=null,this.__hash=void 0,this.__altered=!0,this):we()},pe.prototype.merge=function(){return Me(this,void 0,arguments)},pe.prototype.mergeWith=function(e){return Me(this,e,un.call(arguments,1))},pe.prototype.mergeIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.merge?e.merge.apply(e,t):t[t.length-1]})},pe.prototype.mergeDeep=function(){return Me(this,Te,arguments)},pe.prototype.mergeDeepWith=function(e){var t=un.call(arguments,1);return Me(this,Pe(e),t)},pe.prototype.mergeDeepIn=function(e){var t=un.call(arguments,1);return this.updateIn(e,we(),function(e){return"function"==typeof e.mergeDeep?e.mergeDeep.apply(e,t):t[t.length-1]})},pe.prototype.sort=function(e){return Ze(bt(this,e))},pe.prototype.sortBy=function(e,t){return Ze(bt(this,t,e))},pe.prototype.withMutations=function(e){var t=this.asMutable();return e(t),t.wasAltered()?t.__ensureOwner(this.__ownerID):this},pe.prototype.asMutable=function(){return this.__ownerID?this:this.__ensureOwner(new f)},pe.prototype.asImmutable=function(){return this.__ensureOwner()},pe.prototype.wasAltered=function(){return this.__altered},pe.prototype.__iterator=function(e,t){return new ye(this,e,t)},pe.prototype.__iterate=function(e,t){var n=this,r=0;return this._root&&this._root.iterate(function(t){return r++,e(t[1],t[0],n)},t),r},pe.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?xe(this.size,this._root,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},pe.isMap=fe;var qn="@@__IMMUTABLE_MAP__@@",zn=pe.prototype;zn[qn]=!0,zn.delete=zn.remove,zn.removeIn=zn.deleteIn,he.prototype.get=function(e,t,n,r){for(var i=this.entries,o=0,a=i.length;o=Wn)return Ae(e,u,r,i);var d=e&&e===this.ownerID,m=d?u:h(u);return f?s?l===c-1?m.pop():m[l]=m.pop():m[l]=[r,i]:m.push([r,i]),d?(this.entries=m,this):new he(e,m)}},de.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=1<<((0===e?t:t>>>e)&mn),o=this.bitmap;return 0==(o&i)?r:this.nodes[Fe(o&i-1)].get(e+hn,t,n,r)},de.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=1<=Vn)return Oe(e,f,l,s,d);if(c&&!d&&2===f.length&&Se(f[1^p]))return f[1^p];if(c&&d&&1===f.length&&Se(d))return d;var m=e&&e===this.ownerID,v=c?d?l:l^u:l|u,g=c?d?je(f,p,d,m):Be(f,p,m):Ne(f,p,d,m);return m?(this.bitmap=v,this.nodes=g,this):new de(e,v,g)},me.prototype.get=function(e,t,n,r){void 0===t&&(t=oe(n));var i=(0===e?t:t>>>e)&mn,o=this.nodes[i];return o?o.get(e+hn,t,n,r):r},me.prototype.update=function(e,t,n,r,i,o,a){void 0===n&&(n=oe(r));var s=(0===t?n:n>>>t)&mn,u=i===vn,l=this.nodes,c=l[s];if(u&&!c)return this;var p=Ee(c,e,t+hn,n,r,i,o,a);if(p===c)return this;var f=this.count;if(c){if(!p&&--f=0&&e>>t&mn;if(r>=this.array.length)return new ze([],e);var i,o=0===r;if(t>0){var a=this.array[r];if((i=a&&a.removeBefore(e,t-hn,n))===a&&o)return this}if(o&&!i)return this;var s=Je(this,e);if(!o)for(var u=0;u>>t&mn;if(r>=this.array.length)return this;var i;if(t>0){var o=this.array[r];if((i=o&&o.removeAfter(e,t-hn,n))===o&&r===this.array.length-1)return this}var a=Je(this,e);return a.array.splice(r+1),i&&(a.array[r]=i),a};var Kn,Xn={};e(Ze,pe),Ze.of=function(){return this(arguments)},Ze.prototype.toString=function(){return this.__toString("OrderedMap {","}")},Ze.prototype.get=function(e,t){var n=this._map.get(e);return void 0!==n?this._list.get(n)[1]:t},Ze.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._map.clear(),this._list.clear(),this):tt()},Ze.prototype.set=function(e,t){return nt(this,e,t)},Ze.prototype.remove=function(e){return nt(this,e,vn)},Ze.prototype.wasAltered=function(){return this._map.wasAltered()||this._list.wasAltered()},Ze.prototype.__iterate=function(e,t){var n=this;return this._list.__iterate(function(t){return t&&e(t[1],t[0],n)},t)},Ze.prototype.__iterator=function(e,t){return this._list.fromEntrySeq().__iterator(e,t)},Ze.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map.__ensureOwner(e),n=this._list.__ensureOwner(e);return e?et(t,n,e,this.__hash):(this.__ownerID=e,this._map=t,this._list=n,this)},Ze.isOrderedMap=Qe,Ze.prototype[fn]=!0,Ze.prototype.delete=Ze.prototype.remove;var Yn;e(rt,M),rt.prototype.get=function(e,t){return this._iter.get(e,t)},rt.prototype.has=function(e){return this._iter.has(e)},rt.prototype.valueSeq=function(){return this._iter.valueSeq()},rt.prototype.reverse=function(){var e=this,t=lt(this,!0);return this._useKeys||(t.valueSeq=function(){return e._iter.toSeq().reverse()}),t},rt.prototype.map=function(e,t){var n=this,r=ut(this,e,t);return this._useKeys||(r.valueSeq=function(){return n._iter.toSeq().map(e,t)}),r},rt.prototype.__iterate=function(e,t){var n,r=this;return this._iter.__iterate(this._useKeys?function(t,n){return e(t,n,r)}:(n=t?Ct(this):0,function(i){return e(i,t?--n:n++,r)}),t)},rt.prototype.__iterator=function(e,t){if(this._useKeys)return this._iter.__iterator(e,t);var n=this._iter.__iterator(bn,t),r=t?Ct(this):0;return new x(function(){var i=n.next();return i.done?i:w(e,t?--r:r++,i.value,i)})},rt.prototype[fn]=!0,e(it,T),it.prototype.includes=function(e){return this._iter.includes(e)},it.prototype.__iterate=function(e,t){var n=this,r=0;return this._iter.__iterate(function(t){return e(t,r++,n)},t)},it.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t),r=0;return new x(function(){var t=n.next();return t.done?t:w(e,r++,t.value,t)})},e(ot,P),ot.prototype.has=function(e){return this._iter.includes(e)},ot.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){return e(t,t,n)},t)},ot.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){var t=n.next();return t.done?t:w(e,t.value,t.value,t)})},e(at,M),at.prototype.entrySeq=function(){return this._iter.toSeq()},at.prototype.__iterate=function(e,t){var n=this;return this._iter.__iterate(function(t){if(t){St(t);var r=o(t);return e(r?t.get(1):t[1],r?t.get(0):t[0],n)}},t)},at.prototype.__iterator=function(e,t){var n=this._iter.__iterator(bn,t);return new x(function(){for(;;){var t=n.next();if(t.done)return t;var r=t.value;if(r){St(r);var i=o(r);return w(e,i?r.get(0):r[0],i?r.get(1):r[1],t)}}})},it.prototype.cacheResult=rt.prototype.cacheResult=ot.prototype.cacheResult=at.prototype.cacheResult=Ot,e(Pt,te),Pt.prototype.toString=function(){return this.__toString(Rt(this)+" {","}")},Pt.prototype.has=function(e){return this._defaultValues.hasOwnProperty(e)},Pt.prototype.get=function(e,t){if(!this.has(e))return t;var n=this._defaultValues[e];return this._map?this._map.get(e,n):n},Pt.prototype.clear=function(){if(this.__ownerID)return this._map&&this._map.clear(),this;var e=this.constructor;return e._empty||(e._empty=It(this,we()))},Pt.prototype.set=function(e,t){if(!this.has(e))throw new Error('Cannot set unknown key "'+e+'" on '+Rt(this));if(this._map&&!this._map.has(e)){if(t===this._defaultValues[e])return this}var n=this._map&&this._map.set(e,t);return this.__ownerID||n===this._map?this:It(this,n)},Pt.prototype.remove=function(e){if(!this.has(e))return this;var t=this._map&&this._map.remove(e);return this.__ownerID||t===this._map?this:It(this,t)},Pt.prototype.wasAltered=function(){return this._map.wasAltered()},Pt.prototype.__iterator=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterator(e,t)},Pt.prototype.__iterate=function(e,t){var r=this;return n(this._defaultValues).map(function(e,t){return r.get(t)}).__iterate(e,t)},Pt.prototype.__ensureOwner=function(e){if(e===this.__ownerID)return this;var t=this._map&&this._map.__ensureOwner(e);return e?It(this,t,e):(this.__ownerID=e,this._map=t,this)};var $n=Pt.prototype;$n.delete=$n.remove,$n.deleteIn=$n.removeIn=zn.removeIn,$n.merge=zn.merge,$n.mergeWith=zn.mergeWith,$n.mergeIn=zn.mergeIn,$n.mergeDeep=zn.mergeDeep,$n.mergeDeepWith=zn.mergeDeepWith,$n.mergeDeepIn=zn.mergeDeepIn,$n.setIn=zn.setIn,$n.update=zn.update,$n.updateIn=zn.updateIn,$n.withMutations=zn.withMutations,$n.asMutable=zn.asMutable,$n.asImmutable=zn.asImmutable,e(Nt,re),Nt.of=function(){return this(arguments)},Nt.fromKeys=function(e){return this(n(e).keySeq())},Nt.prototype.toString=function(){return this.__toString("Set {","}")},Nt.prototype.has=function(e){return this._map.has(e)},Nt.prototype.add=function(e){return Lt(this,this._map.set(e,!0))},Nt.prototype.remove=function(e){return Lt(this,this._map.remove(e))},Nt.prototype.clear=function(){return Lt(this,this._map.clear())},Nt.prototype.union=function(){var e=un.call(arguments,0);return e=e.filter(function(e){return 0!==e.size}),0===e.length?this:0!==this.size||this.__ownerID||1!==e.length?this.withMutations(function(t){for(var n=0;n=0;n--)t={value:arguments[n],next:t};return this.__ownerID?(this.size=e,this._head=t,this.__hash=void 0,this.__altered=!0,this):Kt(e,t)},Gt.prototype.pushAll=function(e){if(e=r(e),0===e.size)return this;ce(e.size);var t=this.size,n=this._head;return e.reverse().forEach(function(e){t++,n={value:e,next:n}}),this.__ownerID?(this.size=t,this._head=n,this.__hash=void 0,this.__altered=!0,this):Kt(t,n)},Gt.prototype.pop=function(){return this.slice(1)},Gt.prototype.unshift=function(){return this.push.apply(this,arguments)},Gt.prototype.unshiftAll=function(e){return this.pushAll(e)},Gt.prototype.shift=function(){return this.pop.apply(this,arguments)},Gt.prototype.clear=function(){return 0===this.size?this:this.__ownerID?(this.size=0,this._head=void 0,this.__hash=void 0,this.__altered=!0,this):Xt()},Gt.prototype.slice=function(e,t){if(g(e,t,this.size))return this;var n=y(e,this.size);if(_(t,this.size)!==this.size)return ne.prototype.slice.call(this,e,t);for(var r=this.size-n,i=this._head;n--;)i=i.next;return this.__ownerID?(this.size=r,this._head=i,this.__hash=void 0,this.__altered=!0,this):Kt(r,i)},Gt.prototype.__ensureOwner=function(e){return e===this.__ownerID?this:e?Kt(this.size,this._head,e,this.__hash):(this.__ownerID=e,this.__altered=!1,this)},Gt.prototype.__iterate=function(e,t){if(t)return this.reverse().__iterate(e);for(var n=0,r=this._head;r&&!1!==e(r.value,n++,this);)r=r.next;return n},Gt.prototype.__iterator=function(e,t){if(t)return this.reverse().__iterator(e);var n=0,r=this._head;return new x(function(){if(r){var t=r.value;return r=r.next,w(e,n++,t)}return k()})},Gt.isStack=Jt;var rr="@@__IMMUTABLE_STACK__@@",ir=Gt.prototype;ir[rr]=!0,ir.withMutations=zn.withMutations,ir.asMutable=zn.asMutable,ir.asImmutable=zn.asImmutable,ir.wasAltered=zn.wasAltered;var or;t.Iterator=x,Yt(t,{toArray:function(){ce(this.size);var e=new Array(this.size||0);return this.valueSeq().__iterate(function(t,n){e[n]=t}),e},toIndexedSeq:function(){return new it(this)},toJS:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJS?e.toJS():e}).__toJS()},toJSON:function(){return this.toSeq().map(function(e){return e&&"function"==typeof e.toJSON?e.toJSON():e}).__toJS()},toKeyedSeq:function(){return new rt(this,!0)},toMap:function(){return pe(this.toKeyedSeq())},toObject:function(){ce(this.size);var e={};return this.__iterate(function(t,n){e[n]=t}),e},toOrderedMap:function(){return Ze(this.toKeyedSeq())},toOrderedSet:function(){return Ut(a(this)?this.valueSeq():this)},toSet:function(){return Nt(a(this)?this.valueSeq():this)},toSetSeq:function(){return new ot(this)},toSeq:function(){return s(this)?this.toIndexedSeq():a(this)?this.toKeyedSeq():this.toSetSeq()},toStack:function(){return Gt(a(this)?this.valueSeq():this)},toList:function(){return Le(a(this)?this.valueSeq():this)},toString:function(){return"[Iterable]"},__toString:function(e,t){return 0===this.size?e+t:e+" "+this.toSeq().map(this.__toStringMapper).join(", ")+" "+t},concat:function(){return Et(this,vt(this,un.call(arguments,0)))},includes:function(e){return this.some(function(t){return X(t,e)})},entries:function(){return this.__iterator(xn)},every:function(e,t){ce(this.size);var n=!0;return this.__iterate(function(r,i,o){if(!e.call(t,r,i,o))return n=!1,!1}),n},filter:function(e,t){return Et(this,ct(this,e,t,!0))},find:function(e,t,n){var r=this.findEntry(e,t);return r?r[1]:n},forEach:function(e,t){return ce(this.size),this.__iterate(t?e.bind(t):e)},join:function(e){ce(this.size),e=void 0!==e?""+e:",";var t="",n=!0;return this.__iterate(function(r){n?n=!1:t+=e,t+=null!==r&&void 0!==r?r.toString():""}),t},keys:function(){return this.__iterator(_n)},map:function(e,t){return Et(this,ut(this,e,t))},reduce:function(e,t,n){ce(this.size);var r,i;return arguments.length<2?i=!0:r=t,this.__iterate(function(t,o,a){i?(i=!1,r=t):r=e.call(n,r,t,o,a)}),r},reduceRight:function(e,t,n){var r=this.toKeyedSeq().reverse();return r.reduce.apply(r,arguments)},reverse:function(){return Et(this,lt(this,!0))},slice:function(e,t){return Et(this,ht(this,e,t,!0))},some:function(e,t){return!this.every(Qt(e),t)},sort:function(e){return Et(this,bt(this,e))},values:function(){return this.__iterator(bn)},butLast:function(){return this.slice(0,-1)},isEmpty:function(){return void 0!==this.size?0===this.size:!this.some(function(){return!0})},count:function(e,t){return d(e?this.toSeq().filter(e,t):this)},countBy:function(e,t){return pt(this,e,t)},equals:function(e){return Y(this,e)},entrySeq:function(){var e=this;if(e._cache)return new I(e._cache);var t=e.toSeq().map(Zt).toIndexedSeq();return t.fromEntrySeq=function(){return e.toSeq()},t},filterNot:function(e,t){return this.filter(Qt(e),t)},findEntry:function(e,t,n){var r=n;return this.__iterate(function(n,i,o){if(e.call(t,n,i,o))return r=[i,n],!1}),r},findKey:function(e,t){var n=this.findEntry(e,t);return n&&n[0]},findLast:function(e,t,n){return this.toKeyedSeq().reverse().find(e,t,n)},findLastEntry:function(e,t,n){return this.toKeyedSeq().reverse().findEntry(e,t,n)},findLastKey:function(e,t){return this.toKeyedSeq().reverse().findKey(e,t)},first:function(){return this.find(v)},flatMap:function(e,t){return Et(this,yt(this,e,t))},flatten:function(e){return Et(this,gt(this,e,!0))},fromEntrySeq:function(){return new at(this)},get:function(e,t){return this.find(function(t,n){return X(n,e)},void 0,t)},getIn:function(e,t){for(var n,r=this,i=Tt(e);!(n=i.next()).done;){var o=n.value;if((r=r&&r.get?r.get(o,vn):vn)===vn)return t}return r},groupBy:function(e,t){return ft(this,e,t)},has:function(e){return this.get(e,vn)!==vn},hasIn:function(e){return this.getIn(e,vn)!==vn},isSubset:function(e){return e="function"==typeof e.includes?e:t(e),this.every(function(t){return e.includes(t)})},isSuperset:function(e){return e="function"==typeof e.isSubset?e:t(e),e.isSubset(this)},keyOf:function(e){return this.findKey(function(t){return X(t,e)})},keySeq:function(){return this.toSeq().map($t).toIndexedSeq()},last:function(){return this.toSeq().reverse().first()},lastKeyOf:function(e){return this.toKeyedSeq().reverse().keyOf(e)},max:function(e){return xt(this,e)},maxBy:function(e,t){return xt(this,t,e)},min:function(e){return xt(this,e?en(e):rn)},minBy:function(e,t){return xt(this,t?en(t):rn,e)},rest:function(){return this.slice(1)},skip:function(e){return this.slice(Math.max(0,e))},skipLast:function(e){return Et(this,this.toSeq().reverse().skip(e).reverse())},skipWhile:function(e,t){return Et(this,mt(this,e,t,!0))},skipUntil:function(e,t){return this.skipWhile(Qt(e),t)},sortBy:function(e,t){return Et(this,bt(this,t,e))},take:function(e){return this.slice(0,Math.max(0,e))},takeLast:function(e){return Et(this,this.toSeq().reverse().take(e).reverse())},takeWhile:function(e,t){return Et(this,dt(this,e,t))},takeUntil:function(e,t){return this.takeWhile(Qt(e),t)},valueSeq:function(){return this.toIndexedSeq()},hashCode:function(){return this.__hash||(this.__hash=on(this))}});var ar=t.prototype;ar[ln]=!0,ar[En]=ar.values,ar.__toJS=ar.toArray,ar.__toStringMapper=tn,ar.inspect=ar.toSource=function(){return this.toString()},ar.chain=ar.flatMap,ar.contains=ar.includes,Yt(n,{flip:function(){return Et(this,st(this))},mapEntries:function(e,t){var n=this,r=0;return Et(this,this.toSeq().map(function(i,o){return e.call(t,[o,i],r++,n)}).fromEntrySeq())},mapKeys:function(e,t){var n=this;return Et(this,this.toSeq().flip().map(function(r,i){return e.call(t,r,i,n)}).flip())}});var sr=n.prototype;return sr[cn]=!0,sr[En]=ar.entries,sr.__toJS=ar.toObject,sr.__toStringMapper=function(e,t){return JSON.stringify(t)+": "+tn(e)},Yt(r,{toKeyedSeq:function(){return new rt(this,!1)},filter:function(e,t){return Et(this,ct(this,e,t,!1))},findIndex:function(e,t){var n=this.findEntry(e,t);return n?n[0]:-1},indexOf:function(e){var t=this.keyOf(e);return void 0===t?-1:t},lastIndexOf:function(e){var t=this.lastKeyOf(e);return void 0===t?-1:t},reverse:function(){return Et(this,lt(this,!1))},slice:function(e,t){return Et(this,ht(this,e,t,!1))},splice:function(e,t){var n=arguments.length;if(t=Math.max(0|t,0),0===n||2===n&&!t)return this;e=y(e,e<0?this.count():this.size);var r=this.slice(0,e);return Et(this,1===n?r:r.concat(h(arguments,2),this.slice(e+t)))},findLastIndex:function(e,t){var n=this.findLastEntry(e,t);return n?n[0]:-1},first:function(){return this.get(0)},flatten:function(e){return Et(this,gt(this,e,!1))},get:function(e,t){return e=m(this,e),e<0||this.size===1/0||void 0!==this.size&&e>this.size?t:this.find(function(t,n){return n===e},void 0,t)},has:function(e){return(e=m(this,e))>=0&&(void 0!==this.size?this.size===1/0||e5e3)return e.textContent;return function(e){for(var n,r,i,o,a,s=e.textContent,u=0,l=s[0],c=1,p=e.innerHTML="",f=0;r=n,n=f<7&&"\\"==n?1:c;){if(c=l,l=s[++u],o=p.length>1,!c||f>8&&"\n"==c||[/\S/.test(c),1,1,!/[$\w]/.test(c),("/"==n||"\n"==n)&&o,'"'==n&&o,"'"==n&&o,s[u-4]+r+n=="--\x3e",r+n=="*/"][f])for(p&&(e.appendChild(a=t.createElement("span")).setAttribute("style",["color: #555; font-weight: 200;","","","color: #555;",""][f?f<3?2:f>6?4:f>3?3:+/^(a(bstract|lias|nd|rguments|rray|s(m|sert)?|uto)|b(ase|egin|ool(ean)?|reak|yte)|c(ase|atch|har|hecked|lass|lone|ompl|onst|ontinue)|de(bugger|cimal|clare|f(ault|er)?|init|l(egate|ete)?)|do|double|e(cho|ls?if|lse(if)?|nd|nsure|num|vent|x(cept|ec|p(licit|ort)|te(nds|nsion|rn)))|f(allthrough|alse|inal(ly)?|ixed|loat|or(each)?|riend|rom|unc(tion)?)|global|goto|guard|i(f|mp(lements|licit|ort)|n(it|clude(_once)?|line|out|stanceof|t(erface|ernal)?)?|s)|l(ambda|et|ock|ong)|m(icrolight|odule|utable)|NaN|n(amespace|ative|ext|ew|il|ot|ull)|o(bject|perator|r|ut|verride)|p(ackage|arams|rivate|rotected|rotocol|ublic)|r(aise|e(adonly|do|f|gister|peat|quire(_once)?|scue|strict|try|turn))|s(byte|ealed|elf|hort|igned|izeof|tatic|tring|truct|ubscript|uper|ynchronized|witch)|t(emplate|hen|his|hrows?|ransient|rue|ry|ype(alias|def|id|name|of))|u(n(checked|def(ined)?|ion|less|signed|til)|se|sing)|v(ar|irtual|oid|olatile)|w(char_t|hen|here|hile|ith)|xor|yield)$/.test(p):0]),a.appendChild(t.createTextNode(p))),i=f&&f<7?f:i,p="",f=11;![1,/[\/{}[(\-+*=<>:;|\\.,?!&@~]/.test(c),/[\])]/.test(c),/[$\w]/.test(c),"/"==c&&i<2&&"<"!=n,'"'==c,"'"==c,c+l+s[u+1]+s[u+2]=="\x3c!--",c+l=="/*",c+l=="//","#"==c][--f];);p+=c}}(e)}function b(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"key",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:L.default.Map();if(!L.default.Map.isMap(e)||!e.size)return L.default.List();if(Array.isArray(t)||(t=[t]),t.length<1)return e.merge(n);var r=L.default.List(),i=t[0],o=!0,a=!1,s=void 0;try{for(var u,l=(0,T.default)(e.entries());!(o=(u=l.next()).done);o=!0){var c=u.value,p=(0,O.default)(c,2),f=p[0],h=p[1],d=b(h,t.slice(1),n.set(i,f));r=L.default.List.isList(d)?r.concat(d):r.push(d)}}catch(e){a=!0,s=e}finally{try{!o&&l.return&&l.return()}finally{if(a)throw s}}return r}function x(e){var t=/filename="([^;]*);?"/i.exec(e);return null===t&&(t=/filename=([^;]*);?/i.exec(e)),null!==t&&t.length>1?t[1]:null}function w(e){return(0,V.default)((0,U.default)(e))}function k(e){return w(e.replace(/\.[^.\/]*$/,""))}function E(e){return"string"!=typeof e||""===e?"":(0,q.sanitizeUrl)(e)}function S(e){if(!L.default.OrderedMap.isOrderedMap(e))return null;if(!e.size)return null;var t=e.find(function(e,t){return t.startsWith("2")&&(0,F.default)(e.get("content")||{}).length>0}),n=e.get("default")||L.default.OrderedMap(),r=(n.get("content")||L.default.OrderedMap()).keySeq().toJS(),i=r.length?n:null;return t||i}Object.defineProperty(t,"__esModule",{value:!0}),t.getExtensions=t.escapeDeepLinkPath=t.createDeepLinkPath=t.shallowEqualKeys=t.buildFormData=t.sorters=t.btoa=t.parseSearch=t.getSampleSchema=t.validateParam=t.validatePattern=t.validateMinLength=t.validateMaxLength=t.validateGuid=t.validateDateTime=t.validateString=t.validateBoolean=t.validateFile=t.validateInteger=t.validateNumber=t.validateMinimum=t.validateMaximum=t.propChecker=t.memoize=t.isImmutable=void 0;var C=n(35),A=r(C),D=n(18),O=r(D),M=n(95),T=r(M),P=n(30),I=r(P),R=n(47),F=r(R),j=n(48),N=r(j);t.isJSONObject=i,t.objectify=o,t.arrayify=a,t.fromJSOrdered=s,t.bindToState=u,t.normalizeArray=l,t.isFn=c,t.isObject=p,t.isFunc=f,t.isArray=h,t.objMap=d,t.objReduce=m,t.systemThunkMiddleware=v,t.defaultStatusCode=g,t.getList=y,t.highlight=_,t.mapToList=b,t.extractFileNameFromContentDispositionHeader=x,t.pascalCase=w,t.pascalCaseFilename=k,t.sanitizeUrl=E,t.getAcceptControllingResponse=S;var B=n(7),L=r(B),q=n(508),z=n(942),U=r(z),W=n(429),V=r(W),H=n(426),G=r(H),J=n(223),K=r(J),X=n(957),Y=r(X),$=n(120),Z=r($),Q=n(172),ee=n(46),te=r(ee),ne=n(699),re=r(ne),ie="default",oe=t.isImmutable=function(e){return L.default.Iterable.isIterable(e)},ae=(t.memoize=G.default,t.propChecker=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return(0,F.default)(e).length!==(0,F.default)(t).length||((0,Y.default)(e,function(e,n){if(r.includes(n))return!1;var i=t[n];return L.default.Iterable.isIterable(e)?!L.default.is(e,i):("object"!==(void 0===e?"undefined":(0,N.default)(e))||"object"!==(void 0===i?"undefined":(0,N.default)(i)))&&e!==i})||n.some(function(n){return!(0,Z.default)(e[n],t[n])}))},t.validateMaximum=function(e,t){if(e>t)return"Value must be less than Maximum"}),se=t.validateMinimum=function(e,t){if(et)return"Value must be less than MaxLength"},ve=t.validateMinLength=function(e,t){if(e.length2&&void 0!==arguments[2]&&arguments[2],r=[],i=t&&"body"===e.get("in")?e.get("value_xml"):e.get("value"),o=e.get("required"),a=n?e.get("schema"):e;if(!a)return r;var s=a.get("maximum"),u=a.get("minimum"),l=a.get("type"),c=a.get("format"),p=a.get("maxLength"),f=a.get("minLength"),h=a.get("pattern");if(l&&(o||i)){var d="string"===l&&i,m="array"===l&&Array.isArray(i)&&i.length,v="array"===l&&L.default.List.isList(i)&&i.count(),g="file"===l&&i instanceof te.default.File,y="boolean"===l&&(i||!1===i),_="number"===l&&(i||0===i),b="integer"===l&&(i||0===i);if(o&&!(d||m||v||g||y||_||b))return r.push("Required field is not provided"),r;if(h){var x=ge(i,h);x&&r.push(x)}if(p||0===p){var w=me(i,p);w&&r.push(w)}if(f){var k=ve(i,f);k&&r.push(k)}if(s||0===s){var E=ae(i,s);E&&r.push(E)}if(u||0===u){var S=se(i,u);S&&r.push(S)}if("string"===l){var C=void 0;if(!(C="date-time"===c?he(i):"uuid"===c?de(i):fe(i)))return r;r.push(C)}else if("boolean"===l){var A=pe(i);if(!A)return r;r.push(A)}else if("number"===l){var D=ue(i);if(!D)return r;r.push(D)}else if("integer"===l){var O=le(i);if(!O)return r;r.push(O)}else if("array"===l){var M=void 0;if(!i.count())return r;M=a.getIn(["items","type"]),i.forEach(function(e,t){var n=void 0;"number"===M?n=ue(e):"integer"===M?n=le(e):"string"===M&&(n=fe(e)),n&&r.push({index:t,error:n})})}else if("file"===l){var T=ce(i);if(!T)return r;r.push(T)}}return r},t.getSampleSchema=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(/xml/.test(t)){if(!e.xml||!e.xml.name){if(e.xml=e.xml||{},!e.$$ref)return e.type||e.items||e.properties||e.additionalProperties?'\n\x3c!-- XML example cannot be generated --\x3e':null;var r=e.$$ref.match(/\S*\/(\S+)$/);e.xml.name=r[1]}return(0,Q.memoizedCreateXMLExample)(e,n)}return(0,A.default)((0,Q.memoizedSampleFromSchema)(e,n),null,2)},t.parseSearch=function(){var e={},t=te.default.location.search;if(!t)return{};if(""!=t){var n=t.substr(1).split("&");for(var r in n)n.hasOwnProperty(r)&&(r=n[r].split("="),e[decodeURIComponent(r[0])]=decodeURIComponent(r[1]))}return e},t.btoa=function(t){var n=void 0;return n=t instanceof e?t:new e(t.toString(),"utf-8"),n.toString("base64")},t.sorters={operationsSorter:{alpha:function(e,t){return e.get("path").localeCompare(t.get("path"))},method:function(e,t){return e.get("method").localeCompare(t.get("method"))}},tagsSorter:{alpha:function(e,t){return e.localeCompare(t)}}},t.buildFormData=function(e){var t=[];for(var n in e){var r=e[n];void 0!==r&&""!==r&&t.push([n,"=",encodeURIComponent(r).replace(/%20/g,"+")].join(""))}return t.join("&")},t.shallowEqualKeys=function(e,t,n){return!!(0,K.default)(n,function(n){return(0,Z.default)(e[n],t[n])})},t.createDeepLinkPath=function(e){return"string"==typeof e||e instanceof String?e.trim().replace(/\s/g,"_"):""});t.escapeDeepLinkPath=function(e){return(0,re.default)(ye(e))},t.getExtensions=function(e){return e.filter(function(e,t){return/^x-/.test(t)})}}).call(t,n(40).Buffer)},function(e,t,n){"use strict";var r=n(32),i=r;e.exports=i},function(e,t,n){"use strict";function r(e){for(var t=arguments.length-1,n="Minified React error #"+e+"; visit http://facebook.github.io/react/docs/error-decoder.html?invariant="+e,r=0;r6?s-6:0),l=6;l5?l-5:0),p=5;p5?a-5:0),u=5;u key("+c[p]+")"].concat(s));if(h instanceof Error)return h}}return i(t)}function u(e){return a(e,"List",b.List.isList)}function l(e,t,n,r){function o(){for(var i=arguments.length,o=Array(i),u=0;u5?s-5:0),l=5;l5?l-5:0),p=5;p>",w={listOf:u,mapOf:c,orderedMapOf:p,setOf:f,orderedSetOf:h,stackOf:d,iterableOf:m,recordOf:v,shape:y,contains:y,mapContains:_,list:o("List",b.List.isList),map:o("Map",b.Map.isMap),orderedMap:o("OrderedMap",b.OrderedMap.isOrderedMap),set:o("Set",b.Set.isSet),orderedSet:o("OrderedSet",b.OrderedSet.isOrderedSet),stack:o("Stack",b.Stack.isStack),seq:o("Seq",b.Seq.isSeq),record:o("Record",function(e){return e instanceof b.Record}),iterable:o("Iterable",b.Iterable.isIterable)};e.exports=w},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/* -object-assign -(c) Sindre Sorhus -@license MIT -*/ -var i=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,u=r(e),l=1;l=55296&&e<=57343)&&(!(e>=64976&&e<=65007)&&(65535!=(65535&e)&&65534!=(65535&e)&&(!(e>=0&&e<=8)&&(11!==e&&(!(e>=14&&e<=31)&&(!(e>=127&&e<=159)&&!(e>1114111)))))))}function l(e){if(e>65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function c(e,t){var n=0;return o(y,t)?y[t]:35===t.charCodeAt(0)&&g.test(t)&&(n="x"===t[1].toLowerCase()?parseInt(t.slice(2),16):parseInt(t.slice(1),10),u(n))?l(n):e}function p(e){return e.indexOf("&")<0?e:e.replace(v,c)}function f(e){return x[e]}function h(e){return _.test(e)?e.replace(b,f):e}var d=Object.prototype.hasOwnProperty,m=/\\([\\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g,v=/&([a-z#][a-z0-9]{1,31});/gi,g=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,y=n(490),_=/[&<>"]/,b=/[&<>"]/g,x={"&":"&","<":"<",">":">",'"':"""};t.assign=a,t.isString=i,t.has=o,t.unescapeMd=s,t.isValidEntityCode=u,t.fromCodePoint=l,t.replaceEntities=p,t.escapeHtml=h},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(31),i=n(63),o=n(64),a=n(77),s=n(136),u=function(e,t,n){var l,c,p,f,h=e&u.F,d=e&u.G,m=e&u.S,v=e&u.P,g=e&u.B,y=d?r:m?r[t]||(r[t]={}):(r[t]||{}).prototype,_=d?i:i[t]||(i[t]={}),b=_.prototype||(_.prototype={});d&&(n=t);for(l in n)c=!h&&y&&void 0!==y[l],p=(c?y:n)[l],f=g&&c?s(p,r):v&&"function"==typeof p?s(Function.call,p):p,y&&a(y,l,p,e&u.U),_[l]!=p&&o(_,l,f),v&&b[l]!=p&&(b[l]=p)};r.core=i,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,e.exports=u},function(e,t,n){var r=n(28),i=n(107),o=n(57),a=/"/g,s=function(e,t,n,r){var i=String(o(e)),s="<"+t;return""!==n&&(s+=" "+n+'="'+String(r).replace(a,""")+'"'),s+">"+i+""};e.exports=function(e,t){var n={};n[e]=t(s),r(r.P+r.F*i(function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}),"String",n)}},function(e,t,n){e.exports={default:n(591),__esModule:!0}},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){"use strict";function r(e){return function(){return e}}var i=function(){};i.thatReturns=r,i.thatReturnsFalse=r(!1),i.thatReturnsTrue=r(!0),i.thatReturnsNull=r(null),i.thatReturnsThis=function(){return this},i.thatReturnsArgument=function(e){return e},e.exports=i},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function r(){throw new Error("clearTimeout has not been defined")}function i(e){if(c===setTimeout)return setTimeout(e,0);if((c===n||!c)&&setTimeout)return c=setTimeout,setTimeout(e,0);try{return c(e,0)}catch(t){try{return c.call(null,e,0)}catch(t){return c.call(this,e,0)}}}function o(e){if(p===clearTimeout)return clearTimeout(e);if((p===r||!p)&&clearTimeout)return p=clearTimeout,clearTimeout(e);try{return p(e)}catch(t){try{return p.call(null,e)}catch(t){return p.call(this,e)}}}function a(){m&&h&&(m=!1,h.length?d=h.concat(d):v=-1,d.length&&s())}function s(){if(!m){var e=i(a);m=!0;for(var t=d.length;t;){for(h=d,d=[];++v1)for(var n=1;n=r())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r().toString(16)+" bytes");return 0|e}function m(e){return+e!=e&&(e=0),o.alloc(+e)}function v(e,t){if(o.isBuffer(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return V(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return J(e).length;default:if(r)return V(e).length;t=(""+t).toLowerCase(),r=!0}}function g(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if(n>>>=0,t>>>=0,n<=t)return"";for(e||(e="utf8");;)switch(e){case"hex":return P(this,t,n);case"utf8":case"utf-8":return D(this,t,n);case"ascii":return M(this,t,n);case"latin1":case"binary":return T(this,t,n);case"base64":return A(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function y(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function _(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=o.from(t,r)),o.isBuffer(t))return 0===t.length?-1:b(e,t,n,r,i);if("number"==typeof t)return t&=255,o.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):b(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,n,r,i){function o(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}var a=1,s=e.length,u=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;a=2,s/=2,u/=2,n/=2}var l;if(i){var c=-1;for(l=n;ls&&(n=s-u),l=n;l>=0;l--){for(var p=!0,f=0;fi&&(r=i):r=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var a=0;a239?4:o>223?3:o>191?2:1;if(i+s<=n){var u,l,c,p;switch(s){case 1:o<128&&(a=o);break;case 2:u=e[i+1],128==(192&u)&&(p=(31&o)<<6|63&u)>127&&(a=p);break;case 3:u=e[i+1],l=e[i+2],128==(192&u)&&128==(192&l)&&(p=(15&o)<<12|(63&u)<<6|63&l)>2047&&(p<55296||p>57343)&&(a=p);break;case 4:u=e[i+1],l=e[i+2],c=e[i+3],128==(192&u)&&128==(192&l)&&128==(192&c)&&(p=(15&o)<<18|(63&u)<<12|(63&l)<<6|63&c)>65535&&p<1114112&&(a=p)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,r.push(a>>>10&1023|55296),a=56320|1023&a),r.push(a),i+=s}return O(r)}function O(e){var t=e.length;if(t<=Q)return String.fromCharCode.apply(String,e);for(var n="",r=0;rr)&&(n=r);for(var i="",o=t;on)throw new RangeError("Trying to access beyond buffer length")}function F(e,t,n,r,i,a){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function j(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-n,2);i>>8*(r?i:1-i)}function N(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-n,4);i>>8*(r?i:3-i)&255}function B(e,t,n,r,i,o){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(e,t,n,r,i){return i||B(e,t,n,4,3.4028234663852886e38,-3.4028234663852886e38),$.write(e,t,n,r,23,4),n+4}function q(e,t,n,r,i){return i||B(e,t,n,8,1.7976931348623157e308,-1.7976931348623157e308),$.write(e,t,n,r,52,8),n+8}function z(e){if(e=U(e).replace(ee,""),e.length<2)return"";for(;e.length%4!=0;)e+="=";return e}function U(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function W(e){return e<16?"0"+e.toString(16):e.toString(16)}function V(e,t){t=t||1/0;for(var n,r=e.length,i=null,o=[],a=0;a55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(a+1===r){(t-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function H(e){for(var t=[],n=0;n>8,i=n%256,o.push(i),o.push(r);return o}function J(e){return Y.toByteArray(z(e))}function K(e,t,n,r){for(var i=0;i=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function X(e){return e!==e}/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */ -var Y=n(572),$=n(766),Z=n(387);t.Buffer=o,t.SlowBuffer=m,t.INSPECT_MAX_BYTES=50,o.TYPED_ARRAY_SUPPORT=void 0!==e.TYPED_ARRAY_SUPPORT?e.TYPED_ARRAY_SUPPORT:function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()&&"function"==typeof e.subarray&&0===e.subarray(1,1).byteLength}catch(e){return!1}}(),t.kMaxLength=r(),o.poolSize=8192,o._augment=function(e){return e.__proto__=o.prototype,e},o.from=function(e,t,n){return a(null,e,t,n)},o.TYPED_ARRAY_SUPPORT&&(o.prototype.__proto__=Uint8Array.prototype,o.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&o[Symbol.species]===o&&Object.defineProperty(o,Symbol.species,{value:null,configurable:!0})),o.alloc=function(e,t,n){return u(null,e,t,n)},o.allocUnsafe=function(e){return l(null,e)},o.allocUnsafeSlow=function(e){return l(null,e)},o.isBuffer=function(e){return!(null==e||!e._isBuffer)},o.compare=function(e,t){if(!o.isBuffer(e)||!o.isBuffer(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i0&&(e=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(e+=" ... ")),""},o.prototype.compare=function(e,t,n,r,i){if(!o.isBuffer(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(t>>>=0,n>>>=0,r>>>=0,i>>>=0,this===e)return 0;for(var a=i-r,s=n-t,u=Math.min(a,s),l=this.slice(r,i),c=e.slice(t,n),p=0;pi)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return x(this,e,t,n);case"utf8":case"utf-8":return w(this,e,t,n);case"ascii":return k(this,e,t,n);case"latin1":case"binary":return E(this,e,t,n);case"base64":return S(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,e,t,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Q=4096;o.prototype.slice=function(e,t){var n=this.length;e=~~e,t=void 0===t?n:~~t,e<0?(e+=n)<0&&(e=0):e>n&&(e=n),t<0?(t+=n)<0&&(t=0):t>n&&(t=n),t0&&(i*=256);)r+=this[e+--t]*i;return r},o.prototype.readUInt8=function(e,t){return t||R(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return t||R(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return t||R(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return t||R(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUInt32BE=function(e,t){return t||R(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=this[e],i=1,o=0;++o=i&&(r-=Math.pow(2,8*t)),r},o.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||R(e,t,this.length);for(var r=t,i=1,o=this[e+--r];r>0&&(i*=256);)o+=this[e+--r]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return t||R(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){t||R(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt16BE=function(e,t){t||R(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},o.prototype.readInt32LE=function(e,t){return t||R(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return t||R(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return t||R(e,4,this.length),$.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return t||R(e,8,this.length),$.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,n,r){if(e=+e,t|=0,n|=0,!r){F(this,e,t,n,Math.pow(2,8*n)-1,0)}var i=1,o=0;for(this[t]=255&e;++o=0&&(o*=256);)this[t+i]=e/o&255;return t+n},o.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,255,0),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},o.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,65535,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},o.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):N(this,e,t,!0),t+4},o.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,4294967295,0),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);F(this,e,t,n,i-1,-i)}var o=0,a=1,s=0;for(this[t]=255&e;++o>0)-s&255;return t+n},o.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);F(this,e,t,n,i-1,-i)}var o=n-1,a=1,s=0;for(this[t+o]=255&e;--o>=0&&(a*=256);)e<0&&0===s&&0!==this[t+o+1]&&(s=1),this[t+o]=(e/a>>0)-s&255;return t+n},o.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,1,127,-128),o.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):j(this,e,t,!0),t+2},o.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,2,32767,-32768),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):j(this,e,t,!1),t+2},o.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),o.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):N(this,e,t,!0),t+4},o.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||F(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),o.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):N(this,e,t,!1),t+4},o.prototype.writeFloatLE=function(e,t,n){return L(this,e,t,!0,n)},o.prototype.writeFloatBE=function(e,t,n){return L(this,e,t,!1,n)},o.prototype.writeDoubleLE=function(e,t,n){return q(this,e,t,!0,n)},o.prototype.writeDoubleBE=function(e,t,n){return q(this,e,t,!1,n)},o.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t=0;--i)e[i+t]=this[i+n];else if(a<1e3||!o.TYPED_ARRAY_SUPPORT)for(i=0;i>>=0,n=void 0===n?this.length:n>>>0,e||(e=0);var a;if("number"==typeof e)for(a=t;a0&&(a=this.buffer[u-1],e.call(r,a)<0);)if(u--,this.pointer-u>n/2-1){o=" ... ",u+=5;break}for(l="",i=this.pointer;in/2-1){l=" ... ",i-=5;break}return""+new Array(t).join(" ")+o+this.buffer.slice(u,i)+l+"\n"+new Array(t+this.pointer-u+o.length).join(" ")+"^"},t.prototype.toString=function(){var e,t;return e=this.get_snippet(),t=" on line "+(this.line+1)+", column "+(this.column+1),e?t:t+":\n"+e},t}(),this.YAMLError=function(e){function n(e){this.message=e,n.__super__.constructor.call(this),this.stack=this.toString()+"\n"+(new Error).stack.split("\n").slice(1).join("\n")}return t(n,e),n.prototype.toString=function(){return this.message},n}(Error),this.MarkedYAMLError=function(e){function n(e,t,r,i,o){this.context=e,this.context_mark=t,this.problem=r,this.problem_mark=i,this.note=o,n.__super__.constructor.call(this)}return t(n,e),n.prototype.toString=function(){var e;return e=[],null!=this.context&&e.push(this.context),null==this.context_mark||null!=this.problem&&null!=this.problem_mark&&this.context_mark.line===this.problem_mark.line&&this.context_mark.column===this.problem_mark.column||e.push(this.context_mark.toString()),null!=this.problem&&e.push(this.problem),null!=this.problem_mark&&e.push(this.problem_mark.toString()),null!=this.note&&e.push(this.note),e.join("\n")},n}(this.YAMLError)}).call(this)},function(e,t,n){"use strict";var r=n(95),i=function(e){return e&&e.__esModule?e:{default:e}}(r);e.exports=function(){var e={location:{},history:{},open:function(){},close:function(){},File:function(){}};if("undefined"==typeof window)return e;try{e=window;var t=["File","Blob","FormData"],n=!0,r=!1,o=void 0;try{for(var a,s=(0,i.default)(t);!(n=(a=s.next()).done);n=!0){var u=a.value;u in window&&(e[u]=window[u])}}catch(e){r=!0,o=e}finally{try{!n&&s.return&&s.return()}finally{if(r)throw o}}}catch(e){console.error(e)}return e}()},function(e,t,n){e.exports={default:n(595),__esModule:!0}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}t.__esModule=!0;var i=n(569),o=r(i),a=n(568),s=r(a),u="function"==typeof s.default&&"symbol"==typeof o.default?function(e){return typeof e}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":typeof e};t.default="function"==typeof s.default&&"symbol"===u(o.default)?function(e){return void 0===e?"undefined":u(e)}:function(e){return e&&"function"==typeof s.default&&e.constructor===s.default&&e!==s.default.prototype?"symbol":void 0===e?"undefined":u(e)}},function(e,t,n){e.exports=!n(54)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";function r(e,t,n){return n?[e,t]:e}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,e.exports=t.default},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this._targetInst=t,this.nativeEvent=n;var i=this.constructor.Interface;for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var u=null!=n.defaultPrevented?n.defaultPrevented:!1===n.returnValue;return this.isDefaultPrevented=u?a.thatReturnsTrue:a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse,this}var i=n(13),o=n(70),a=n(32),s=(n(10),["dispatchConfig","_targetInst","nativeEvent","isDefaultPrevented","isPropagationStopped","_dispatchListeners","_dispatchInstances"]),u={type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null};i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!=typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!=typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;for(var n=0;n1?t-1:0),i=1;i2?n-2:0),o=2;o=n?e:e.length+1===n?""+t+e:""+new Array(n-e.length+1).join(t)+e},this.to_hex=function(e){return"string"==typeof e&&(e=e.charCodeAt(0)),e.toString(16)}}).call(this)}).call(t,n(16))},function(e,t,n){var r=n(76);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t){var n=e.exports={version:"2.5.3"};"number"==typeof __e&&(__e=n)},function(e,t,n){var r=n(138),i=n(360);e.exports=n(106)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=n(727),i=Math.max;e.exports=function(e){return i(0,r(e))}},function(e,t,n){function r(e){return null==e?void 0===e?u:s:(e=Object(e),l&&l in e?o(e):a(e))}var i=n(81),o=n(898),a=n(927),s="[object Null]",u="[object Undefined]",l=i?i.toStringTag:void 0;e.exports=r},function(e,t,n){function r(e,t){var n=o(e,t);return i(n)?n:void 0}var i=n(856),o=n(899);e.exports=r},function(e,t){function n(e){return null!=e&&"object"==typeof e}e.exports=n},function(e,t,n){"use strict"},function(e,t,n){"use strict";var r=n(11),i=(n(8),function(e){var t=this;if(t.instancePool.length){var n=t.instancePool.pop();return t.call(n,e),n}return new t(e)}),o=function(e,t){var n=this;if(n.instancePool.length){var r=n.instancePool.pop();return n.call(r,e,t),r}return new n(e,t)},a=function(e,t,n){var r=this;if(r.instancePool.length){var i=r.instancePool.pop();return r.call(i,e,t,n),i}return new r(e,t,n)},s=function(e,t,n,r){var i=this;if(i.instancePool.length){var o=i.instancePool.pop();return i.call(o,e,t,n,r),o}return new i(e,t,n,r)},u=function(e){var t=this;e instanceof t||r("25"),e.destructor(),t.instancePool.length`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t){e.exports={}},function(e,t,n){var r=n(181),i=n(178);e.exports=function(e){return r(i(e))}},function(e,t,n){var r=n(178);e.exports=function(e){return Object(r(e))}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(31),i=n(64),o=n(108),a=n(202)("src"),s=Function.toString,u=(""+s).split("toString");n(63).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var l="function"==typeof n;l&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(l&&(o(n,a)||i(n,a,e[t]?""+e[t]:u.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){"use strict";var r=n(372)();e.exports=function(e){return e!==r&&null!==e}},function(e,t,n){"use strict";function r(e){return void 0===e||null===e}function i(e){return"object"==typeof e&&null!==e}function o(e){return Array.isArray(e)?e:r(e)?[]:[e]}function a(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>",u="]",l=new RegExp("^(?:<[A-Za-z][A-Za-z0-9-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^\"'=<>`\\x00-\\x20]+|'[^']*'|\"[^\"]*\"))?)*\\s*/?>|]|\x3c!----\x3e|\x3c!--(?:-?[^>-])(?:-?[^-])*--\x3e|[<][?].*?[?][>]|]*>|)","i"),c=/[\\&]/,p="[!\"#$%&'()*+,./:;<=>?@[\\\\\\]^_`{|}~-]",f=new RegExp("\\\\"+p+"|"+a,"gi"),h=new RegExp('[&<>"]',"g"),d=new RegExp(a+'|[&<>"]',"gi"),m=function(e){return 92===e.charCodeAt(0)?e.charAt(1):o(e)},v=function(e){return c.test(e)?e.replace(f,m):e},g=function(e){try{return r(i(e))}catch(t){return e}},y=function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case'"':return""";default:return e}},_=function(e,t){return h.test(e)?t?e.replace(d,y):e.replace(h,y):e};e.exports={unescapeString:v,normalizeURI:g,escapeXml:_,reHtmlTag:l,OPENTAG:s,CLOSETAG:u,ENTITY:a,ESCAPABLE:p}},function(e,t,n){"use strict";var r=n(13),i=n(476),o=n(1101),a=n(1102),s=n(92),u=n(1103),l=n(1104),c=n(1105),p=n(1109),f=s.createElement,h=s.createFactory,d=s.cloneElement,m=r,v=function(e){return e},g={Children:{map:o.map,forEach:o.forEach,count:o.count,toArray:o.toArray,only:p},Component:i.Component,PureComponent:i.PureComponent,createElement:f,cloneElement:d,isValidElement:s.isValidElement,PropTypes:u,createClass:c,createFactory:h,createMixin:v,DOM:a,version:l,__spread:m};e.exports=g},function(e,t,n){"use strict";function r(e){return void 0!==e.ref}function i(e){return void 0!==e.key}var o=n(13),a=n(52),s=(n(10),n(480),Object.prototype.hasOwnProperty),u=n(478),l={key:!0,ref:!0,__self:!0,__source:!0},c=function(e,t,n,r,i,o,a){var s={$$typeof:u,type:e,key:t,ref:n,props:a,_owner:o};return s};c.createElement=function(e,t,n){var o,u={},p=null,f=null;if(null!=t){r(t)&&(f=t.ref),i(t)&&(p=""+t.key),void 0===t.__self?null:t.__self,void 0===t.__source?null:t.__source;for(o in t)s.call(t,o)&&!l.hasOwnProperty(o)&&(u[o]=t[o])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var d=Array(h),m=0;m1){for(var g=Array(v),y=0;y=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}},function(e,t,n){"use strict";t.__esModule=!0;var r=n(565),i=function(e){return e&&e.__esModule?e:{default:e}}(r);t.default=function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){n(624);for(var r=n(24),i=n(56),o=n(73),a=n(22)("toStringTag"),s="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),u=0;u0?i(r(e),9007199254740991):0}},function(e,t,n){(function(e){function n(e){return Array.isArray?Array.isArray(e):"[object Array]"===v(e)}function r(e){return"boolean"==typeof e}function i(e){return null===e}function o(e){return null==e}function a(e){return"number"==typeof e}function s(e){return"string"==typeof e}function u(e){return"symbol"==typeof e}function l(e){return void 0===e}function c(e){return"[object RegExp]"===v(e)}function p(e){return"object"==typeof e&&null!==e}function f(e){return"[object Date]"===v(e)}function h(e){return"[object Error]"===v(e)||e instanceof Error}function d(e){return"function"==typeof e}function m(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function v(e){return Object.prototype.toString.call(e)}t.isArray=n,t.isBoolean=r,t.isNull=i,t.isNullOrUndefined=o,t.isNumber=a,t.isString=s,t.isSymbol=u,t.isUndefined=l,t.isRegExp=c,t.isObject=p,t.isDate=f,t.isError=h,t.isFunction=d,t.isPrimitive=m,t.isBuffer=e.isBuffer}).call(t,n(40).Buffer)},function(e,t,n){"use strict";function r(e){return"string"==typeof e&&i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r;var i=/-webkit-|-moz-|-ms-/;e.exports=t.default},function(e,t){e.exports={Text:"text",Directive:"directive",Comment:"comment",Script:"script",Style:"style",Tag:"tag",CDATA:"cdata",Doctype:"doctype",isTag:function(e){return"tag"===e.type||"script"===e.type||"style"===e.type}}},function(e,t,n){var r=n(713),i=n(712);t.decode=function(e,t){return(!t||t<=0?i.XML:i.HTML)(e)},t.decodeStrict=function(e,t){return(!t||t<=0?i.XML:i.HTMLStrict)(e)},t.encode=function(e,t){return(!t||t<=0?r.XML:r.HTML)(e)},t.encodeXML=r.XML,t.encodeHTML4=t.encodeHTML5=t.encodeHTML=r.HTML,t.decodeXML=t.decodeXMLStrict=i.XML,t.decodeHTML4=t.decodeHTML5=t.decodeHTML=i.HTML,t.decodeHTML4Strict=t.decodeHTML5Strict=t.decodeHTMLStrict=i.HTMLStrict,t.escape=r.escape},function(e,t,n){"use strict";var r=n(78);e.exports=function(e){if(!r(e))throw new TypeError("Cannot use null or undefined");return e}},function(e,t,n){function r(t,n){return delete e.exports[t],e.exports[t]=n,n}var i=n(380),o=n(702);e.exports={Parser:i,Tokenizer:n(381),ElementType:n(113),DomHandler:o,get FeedHandler(){return r("FeedHandler",n(762))},get Stream(){return r("Stream",n(764))},get WritableStream(){return r("WritableStream",n(382))},get ProxyHandler(){return r("ProxyHandler",n(763))},get DomUtils(){return r("DomUtils",n(704))},get CollectingHandler(){return r("CollectingHandler",n(761))},DefaultHandler:o,get RssHandler(){return r("RssHandler",this.FeedHandler)},parseDOM:function(e,t){var n=new o(t);return new i(n,t).end(e),n.dom},parseFeed:function(t,n){var r=new e.exports.FeedHandler(n);return new i(r,n).end(t),r.dom},createDomStream:function(e,t,n){var r=new o(e,t,n);return new i(r,t)},EVENTS:{attribute:2,cdatastart:0,cdataend:0,text:1,processinginstruction:2,comment:1,commentend:0,closetag:1,opentag:2,opentagname:1,error:1,end:0}}},function(e,t,n){"use strict";function r(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=(this.reason||"(unknown reason)")+(this.mark?" "+this.mark.toString():""),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack||""}r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r.prototype.toString=function(e){var t=this.name+": ";return t+=this.reason||"(unknown reason)",!e&&this.mark&&(t+=" "+this.mark.toString()),t},e.exports=r},function(e,t,n){"use strict";var r=n(80);e.exports=new r({include:[n(388)],implicit:[n(816),n(809)],explicit:[n(801),n(811),n(812),n(814)]})},function(e,t,n){function r(e){return"function"==typeof e?e:null==e?a:"object"==typeof e?s(e)?o(e[0],e[1]):i(e):u(e)}var i=n(860),o=n(861),a=n(225),s=n(20),u=n(954);e.exports=r},function(e,t){function n(e,t){return e===t||e!==e&&t!==t}e.exports=n},function(e,t){function n(e,t,n){if(t in e)return e[t];if(3===arguments.length)return n;throw new Error('"'+t+'" is a required argument.')}function r(e){var t=e.match(y);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}function i(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}function o(e){var n=e,o=r(e);if(o){if(!o.path)return e;n=o.path}for(var a,s=t.isAbsolute(n),u=n.split(/\/+/),l=0,c=u.length-1;c>=0;c--)a=u[c],"."===a?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return n=u.join("/"),""===n&&(n=s?"/":"."),o?(o.path=n,i(o)):n}function a(e,t){""===e&&(e="."),""===t&&(t=".");var n=r(t),a=r(e);if(a&&(e=a.path||"/"),n&&!n.scheme)return a&&(n.scheme=a.scheme),i(n);if(n||t.match(_))return t;if(a&&!a.host&&!a.path)return a.host=t,i(a);var s="/"===t.charAt(0)?t:o(e.replace(/\/+$/,"")+"/"+t);return a?(a.path=s,i(a)):s}function s(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if(e=e.slice(0,r),e.match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)}function u(e){return e}function l(e){return p(e)?"$"+e:e}function c(e){return p(e)?e.slice(1):e}function p(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function f(e,t,n){var r=d(e.source,t.source);return 0!==r?r:0!==(r=e.originalLine-t.originalLine)?r:0!==(r=e.originalColumn-t.originalColumn)||n?r:0!==(r=e.generatedColumn-t.generatedColumn)?r:(r=e.generatedLine-t.generatedLine,0!==r?r:d(e.name,t.name))}function h(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!==(r=e.generatedColumn-t.generatedColumn)||n?r:0!==(r=d(e.source,t.source))?r:0!==(r=e.originalLine-t.originalLine)?r:(r=e.originalColumn-t.originalColumn,0!==r?r:d(e.name,t.name))}function d(e,t){return e===t?0:null===e?1:null===t?-1:e>t?1:-1}function m(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!==(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=d(e.source,t.source))?n:0!==(n=e.originalLine-t.originalLine)?n:(n=e.originalColumn-t.originalColumn,0!==n?n:d(e.name,t.name))}function v(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}function g(e,t,n){if(t=t||"",e&&("/"!==e[e.length-1]&&"/"!==t[0]&&(e+="/"),t=e+t),n){var s=r(n);if(!s)throw new Error("sourceMapURL could not be parsed");if(s.path){var u=s.path.lastIndexOf("/");u>=0&&(s.path=s.path.substring(0,u+1))}t=a(i(s),t)}return o(t)}t.getArg=n;var y=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,_=/^data:.+\,.+$/;t.urlParse=r,t.urlGenerate=i,t.normalize=o,t.join=a,t.isAbsolute=function(e){return"/"===e.charAt(0)||y.test(e)},t.relative=s;var b=function(){return!("__proto__"in Object.create(null))}();t.toSetString=b?u:l,t.fromSetString=b?u:c,t.compareByOriginalPositions=f,t.compareByGeneratedPositionsDeflated=h,t.compareByGeneratedPositionsInflated=m,t.parseSourceMapInput=v,t.computeSourceURL=g},function(e,t,n){"use strict";function r(e){return"button"===e||"input"===e||"select"===e||"textarea"===e}function i(e,t,n){switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":return!(!n.disabled||!r(t));default:return!1}}var o=n(11),a=n(242),s=n(243),u=n(247),l=n(464),c=n(465),p=(n(8),{}),f=null,h=function(e,t){e&&(s.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},d=function(e){return h(e,!0)},m=function(e){return h(e,!1)},v=function(e){return"."+e._rootNodeID},g={injection:{injectEventPluginOrder:a.injectEventPluginOrder,injectEventPluginsByName:a.injectEventPluginsByName},putListener:function(e,t,n){"function"!=typeof n&&o("94",t,typeof n);var r=v(e);(p[t]||(p[t]={}))[r]=n;var i=a.registrationNameModules[t];i&&i.didPutListener&&i.didPutListener(e,t,n)},getListener:function(e,t){var n=p[t];if(i(t,e._currentElement.type,e._currentElement.props))return null;var r=v(e);return n&&n[r]},deleteListener:function(e,t){var n=a.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var r=p[t];if(r){delete r[v(e)]}},deleteAllListeners:function(e){var t=v(e);for(var n in p)if(p.hasOwnProperty(n)&&p[n][t]){var r=a.registrationNameModules[n];r&&r.willDeleteListener&&r.willDeleteListener(e,n),delete p[n][t]}},extractEvents:function(e,t,n,r){for(var i,o=a.plugins,s=0;s0&&void 0!==arguments[0]?arguments[0]:{};return{type:v,payload:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.CLEAR=t.NEW_AUTH_ERR=t.NEW_SPEC_ERR_BATCH=t.NEW_SPEC_ERR=t.NEW_THROWN_ERR_BATCH=t.NEW_THROWN_ERR=void 0,t.newThrownErr=r,t.newThrownErrBatch=i,t.newSpecErr=o,t.newSpecErrBatch=a,t.newAuthErr=s,t.clear=u;var l=n(264),c=function(e){return e&&e.__esModule?e:{default:e}}(l),p=t.NEW_THROWN_ERR="err_new_thrown_err",f=t.NEW_THROWN_ERR_BATCH="err_new_thrown_err_batch",h=t.NEW_SPEC_ERR="err_new_spec_err",d=t.NEW_SPEC_ERR_BATCH="err_new_spec_err_batch",m=t.NEW_AUTH_ERR="err_new_auth_err",v=t.CLEAR="err_clear"},function(e,t,n){var r=n(53),i=n(338),o=n(336),a=n(37),s=n(133),u=n(193),l={},c={},t=e.exports=function(e,t,n,p,f){var h,d,m,v,g=f?function(){return e}:u(e),y=r(n,p,t?2:1),_=0;if("function"!=typeof g)throw TypeError(e+" is not iterable!");if(o(g)){for(h=s(e.length);h>_;_++)if((v=t?y(a(d=e[_])[0],d[1]):y(e[_]))===l||v===c)return v}else for(m=g.call(e);!(d=m.next()).done;)if((v=i(m,y,d.value,t))===l||v===c)return v};t.BREAK=l,t.RETURN=c},function(e,t){e.exports=!0},function(e,t,n){var r=n(134)("meta"),i=n(27),o=n(55),a=n(41).f,s=0,u=Object.isExtensible||function(){return!0},l=!n(54)(function(){return u(Object.preventExtensions({}))}),c=function(e){a(e,r,{value:{i:"O"+ ++s,w:{}}})},p=function(e,t){if(!i(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!o(e,r)){if(!u(e))return"F";if(!t)return"E";c(e)}return e[r].i},f=function(e,t){if(!o(e,r)){if(!u(e))return!0;if(!t)return!1;c(e)}return e[r].w},h=function(e){return l&&d.NEED&&u(e)&&!o(e,r)&&c(e),e},d=e.exports={KEY:r,NEED:!1,fastKey:p,getWeak:f,onFreeze:h}},function(e,t){t.f={}.propertyIsEnumerable},function(e,t,n){var r=n(189),i=Math.min;e.exports=function(e){return e>0?i(r(e),9007199254740991):0}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){var r=n(135);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";var r=n(64),i=n(77),o=n(107),a=n(57),s=n(19);e.exports=function(e,t,n){var u=s(e),l=n(a,u,""[e]),c=l[0],p=l[1];o(function(){var t={};return t[u]=function(){return 7},7!=""[e](t)})&&(i(String.prototype,e,c),r(RegExp.prototype,u,2==t?function(e,t){return p.call(e,this,t)}:function(e){return p.call(e,this)}))}},function(e,t,n){var r=n(62),i=n(644),o=n(663),a=Object.defineProperty;t.f=n(106)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(646),i=n(57);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r,i=n(373),o=n(376),a=n(731),s=n(736);r=e.exports=function(e,t){var n,r,a,u,l;return arguments.length<2||"string"!=typeof e?(u=t,t=e,e=null):u=arguments[2],null==e?(n=a=!0,r=!1):(n=s.call(e,"c"),r=s.call(e,"e"),a=s.call(e,"w")),l={value:t,configurable:n,enumerable:r,writable:a},u?i(o(u),l):l},r.gs=function(e,t,n){var r,u,l,c;return"string"!=typeof e?(l=n,n=t,t=e,e=null):l=arguments[3],null==t?t=void 0:a(t)?null==n?n=void 0:a(n)||(l=n,n=void 0):(l=t,t=n=void 0),null==e?(r=!0,u=!1):(r=s.call(e,"c"),u=s.call(e,"e")),c={get:t,set:n,configurable:r,enumerable:u},l?i(o(l),c):c}},function(e,t,n){"use strict";e.exports=n(728)("forEach")},function(e,t){function n(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function i(e){return"number"==typeof e}function o(e){return"object"==typeof e&&null!==e}function a(e){return void 0===e}e.exports=n,n.EventEmitter=n,n.prototype._events=void 0,n.prototype._maxListeners=void 0,n.defaultMaxListeners=10,n.prototype.setMaxListeners=function(e){if(!i(e)||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},n.prototype.emit=function(e){var t,n,i,s,u,l;if(this._events||(this._events={}),"error"===e&&(!this._events.error||o(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var c=new Error('Uncaught, unspecified "error" event. ('+t+")");throw c.context=t,c}if(n=this._events[e],a(n))return!1;if(r(n))switch(arguments.length){case 1:n.call(this);break;case 2:n.call(this,arguments[1]);break;case 3:n.call(this,arguments[1],arguments[2]);break;default:s=Array.prototype.slice.call(arguments,1),n.apply(this,s)}else if(o(n))for(s=Array.prototype.slice.call(arguments,1),l=n.slice(),i=l.length,u=0;u0&&this._events[e].length>i&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(e,t){function n(){this.removeListener(e,n),i||(i=!0,t.apply(this,arguments))}if(!r(t))throw TypeError("listener must be a function");var i=!1;return n.listener=t,this.on(e,n),this},n.prototype.removeListener=function(e,t){var n,i,a,s;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(n=this._events[e],a=n.length,i=-1,n===t||r(n.listener)&&n.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(o(n)){for(s=a;s-- >0;)if(n[s]===t||n[s].listener&&n[s].listener===t){i=s;break}if(i<0)return this;1===n.length?(n.length=0,delete this._events[e]):n.splice(i,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},n.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(n=this._events[e],r(n))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},n.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},n.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},n.listenerCount=function(e,t){return e.listenerCount(t)}},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";var r=n(80);e.exports=r.DEFAULT=new r({include:[n(118)],explicit:[n(807),n(806),n(805)]})},function(e,t,n){function r(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t-1&&e%1==0&&e]/;e.exports=i},function(e,t,n){"use strict";var r,i=n(25),o=n(241),a=/^[ \r\n\t\f]/,s=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,u=n(249),l=u(function(e,t){if(e.namespaceURI!==o.svg||"innerHTML"in e)e.innerHTML=t;else{r=r||document.createElement("div"),r.innerHTML=""+t+"";for(var n=r.firstChild;n.firstChild;)e.appendChild(n.firstChild)}});if(i.canUseDOM){var c=document.createElement("div");c.innerHTML=" ",""===c.innerHTML&&(l=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),a.test(t)||"<"===t[0]&&s.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t}),c=null}e.exports=l},function(e,t,n){"use strict";function r(e){var t={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]="number"==typeof e[n]?e[n]:e[n].val);return t}t.__esModule=!0,t.default=r,e.exports=t.default},function(e,t,n){"use strict";e.exports=function(e,t){var n,r,i,o=-1,a=e.posMax,s=e.pos,u=e.isInLabel;if(e.isInLabel)return-1;if(e.labelUnmatchedScopes)return e.labelUnmatchedScopes--,-1;for(e.pos=t+1,e.isInLabel=!0,n=1;e.pos1&&void 0!==arguments[1])||arguments[1];return e=(0,s.normalizeArray)(e),{type:p,payload:{thing:e,shown:t}}}function a(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e=(0,s.normalizeArray)(e),{type:c,payload:{thing:e,mode:t}}}Object.defineProperty(t,"__esModule",{value:!0}),t.SHOW=t.UPDATE_MODE=t.UPDATE_FILTER=t.UPDATE_LAYOUT=void 0,t.updateLayout=r,t.updateFilter=i,t.show=o,t.changeMode=a;var s=n(9),u=t.UPDATE_LAYOUT="layout_update_layout",l=t.UPDATE_FILTER="layout_update_filter",c=t.UPDATE_MODE="layout_update_mode",p=t.SHOW="layout_show"},function(e,t,n){"use strict";function r(e,t){return{type:u,payload:{selectedServerUrl:e,namespace:t}}}function i(e){var t=e.value,n=e.pathMethod;return{type:l,payload:{value:t,pathMethod:n}}}function o(e){var t=e.value,n=e.pathMethod;return{type:c,payload:{value:t,pathMethod:n}}}function a(e){var t=e.value,n=e.path,r=e.method;return{type:p,payload:{value:t,path:n,method:r}}}function s(e){var t=e.server,n=e.namespace,r=e.key,i=e.val;return{type:f,payload:{server:t,namespace:n,key:r,val:i}}}Object.defineProperty(t,"__esModule",{value:!0}),t.setSelectedServer=r,t.setRequestBodyValue=i,t.setRequestContentType=o,t.setResponseContentType=a,t.setServerVariableValue=s;var u=t.UPDATE_SELECTED_SERVER="oas3_set_servers",l=t.UPDATE_REQUEST_BODY_VALUE="oas3_set_request_body_value",c=t.UPDATE_REQUEST_CONTENT_TYPE="oas3_set_request_content_type",p=t.UPDATE_RESPONSE_CONTENT_TYPE="oas3_set_response_content_type",f=t.UPDATE_SERVER_VARIABLE_VALUE="oas3_set_server_variable_value"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e,t){var n=h(e,t);if(n)return(0,s.default)(n,{declaration:!0,indent:"\t"})}Object.defineProperty(t,"__esModule",{value:!0}),t.memoizedSampleFromSchema=t.memoizedCreateXMLExample=t.sampleXmlFromSchema=t.inferSchema=t.sampleFromSchema=void 0,t.createXMLExample=i;var o=n(9),a=n(1199),s=r(a),u=n(970),l=r(u),c={string:function(){return"string"},string_email:function(){return"user@example.com"},"string_date-time":function(){return(new Date).toISOString()},number:function(){return 0},number_float:function(){return 0},integer:function(){return 0},boolean:function(e){return"boolean"!=typeof e.default||e.default}},p=function(e){e=(0,o.objectify)(e);var t=e,n=t.type,r=t.format,i=c[n+"_"+r]||c[n];return(0,o.isFunc)(i)?i(e):"Unknown Type: "+e.type},f=t.sampleFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.example,s=r.properties,u=r.additionalProperties,l=r.items,c=n.includeReadOnly,f=n.includeWriteOnly;if(void 0!==a)return a;if(!i)if(s)i="object";else{if(!l)return;i="array"}if("object"===i){var h=(0,o.objectify)(s),d={};for(var m in h)h[m].readOnly&&!c||h[m].writeOnly&&!f||(d[m]=e(h[m],n));if(!0===u)d.additionalProp1={};else if(u)for(var v=(0,o.objectify)(u),g=e(v,n),y=1;y<4;y++)d["additionalProp"+y]=g;return d}return"array"===i?[e(l,n)]:t.enum?t.default?t.default:(0,o.normalizeArray)(t.enum)[0]:"file"!==i?p(t):void 0},h=(t.inferSchema=function(e){return e.schema&&(e=e.schema),e.properties&&(e.type="object"),e},t.sampleXmlFromSchema=function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=(0,o.objectify)(t),i=r.type,a=r.properties,s=r.additionalProperties,u=r.items,l=r.example,c=n.includeReadOnly,f=n.includeWriteOnly,h=r.default,d={},m={},v=t.xml,g=v.name,y=v.prefix,_=v.namespace,b=r.enum,x=void 0,w=void 0;if(!i)if(a||s)i="object";else{if(!u)return;i="array"}if(g=g||"notagname",x=(y?y+":":"")+g,_){m[y?"xmlns:"+y:"xmlns"]=_}if("array"===i&&u){if(u.xml=u.xml||v||{},u.xml.name=u.xml.name||v.name,v.wrapped)return d[x]=[],Array.isArray(l)?l.forEach(function(t){u.example=t,d[x].push(e(u,n))}):Array.isArray(h)?h.forEach(function(t){u.default=t,d[x].push(e(u,n))}):d[x]=[e(u,n)],m&&d[x].push({_attr:m}),d;var k=[];return Array.isArray(l)?(l.forEach(function(t){u.example=t,k.push(e(u,n))}),k):Array.isArray(h)?(h.forEach(function(t){u.default=t,k.push(e(u,n))}),k):e(u,n)}if("object"===i){var E=(0,o.objectify)(a);d[x]=[],l=l||{};for(var S in E)if(E.hasOwnProperty(S)&&(!E[S].readOnly||c)&&(!E[S].writeOnly||f))if(E[S].xml=E[S].xml||{},E[S].xml.attribute){var C=Array.isArray(E[S].enum)&&E[S].enum[0],A=E[S].example,D=E[S].default;m[E[S].xml.name||S]=void 0!==A&&A||void 0!==l[S]&&l[S]||void 0!==D&&D||C||p(E[S])}else{E[S].xml.name=E[S].xml.name||S,E[S].example=void 0!==E[S].example?E[S].example:l[S];var O=e(E[S]);Array.isArray(O)?d[x]=d[x].concat(O):d[x].push(O)}return!0===s?d[x].push({additionalProp:"Anything can be here"}):s&&d[x].push({additionalProp:p(s)}),m&&d[x].push({_attr:m}),d}return w=void 0!==l?l:void 0!==h?h:Array.isArray(b)?b[0]:p(t),d[x]=m?[{_attr:m},w]:w,d});t.memoizedCreateXMLExample=(0,l.default)(i),t.memoizedSampleFromSchema=(0,l.default)(f)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{default:e}}function i(e){var t=X(e).replace(/\t/g," ");if("string"==typeof e)return{type:R,payload:t}}function o(e){return{type:J,payload:e}}function a(e){return{type:F,payload:e}}function s(e){return{type:j,payload:e}}function u(e,t,n,r,i){return{type:N,payload:{path:e,value:r,paramName:t,paramIn:n,isXml:i}}}function l(e){return{type:H,payload:{pathMethod:e}}}function c(e,t){return{type:G,payload:{path:e,value:t,key:"consumes_value"}}}function p(e,t){return{type:G,payload:{path:e,value:t,key:"produces_value"}}}function f(e,t){return{type:W,payload:{path:e,method:t}}}function h(e,t){return{type:V,payload:{path:e,method:t}}}function d(e,t,n){return{type:K,payload:{scheme:e,path:t,method:n}}}Object.defineProperty(t,"__esModule",{value:!0}),t.execute=t.executeRequest=t.logRequest=t.setMutatedRequest=t.setRequest=t.setResponse=t.validateParams=t.resolveSpec=t.parseToJson=t.SET_SCHEME=t.UPDATE_RESOLVED=t.UPDATE_OPERATION_META_VALUE=t.CLEAR_VALIDATE_PARAMS=t.CLEAR_REQUEST=t.CLEAR_RESPONSE=t.LOG_REQUEST=t.SET_MUTATED_REQUEST=t.SET_REQUEST=t.SET_RESPONSE=t.VALIDATE_PARAMS=t.UPDATE_PARAM=t.UPDATE_JSON=t.UPDATE_URL=t.UPDATE_SPEC=void 0;var m=n(21),v=r(m),g=n(96),y=r(g),_=n(30),b=r(_),x=n(47),w=r(x),k=n(48),E=r(k);t.updateSpec=i,t.updateResolved=o,t.updateUrl=a,t.updateJsonSpec=s,t.changeParam=u,t.clearValidateParams=l,t.changeConsumesValue=c,t.changeProducesValue=p,t.clearResponse=f,t.clearRequest=h,t.setScheme=d;var S=n(211),C=r(S),A=n(1187),D=r(A),O=n(264),M=r(O),T=n(423),P=r(T),I=n(9),R=t.UPDATE_SPEC="spec_update_spec",F=t.UPDATE_URL="spec_update_url",j=t.UPDATE_JSON="spec_update_json",N=t.UPDATE_PARAM="spec_update_param",B=t.VALIDATE_PARAMS="spec_validate_param",L=t.SET_RESPONSE="spec_set_response",q=t.SET_REQUEST="spec_set_request",z=t.SET_MUTATED_REQUEST="spec_set_mutated_request",U=t.LOG_REQUEST="spec_log_request",W=t.CLEAR_RESPONSE="spec_clear_response",V=t.CLEAR_REQUEST="spec_clear_request",H=t.CLEAR_VALIDATE_PARAMS="spec_clear_validate_param",G=t.UPDATE_OPERATION_META_VALUE="spec_update_operation_meta_value",J=t.UPDATE_RESOLVED="spec_update_resolved",K=t.SET_SCHEME="set_scheme",X=function(e){return(0,P.default)(e)?e:""},Y=(t.parseToJson=function(e){return function(t){var n=t.specActions,r=t.specSelectors,i=t.errActions,o=r.specStr,a=null;try{e=e||o(),i.clear({source:"parser"}),a=C.default.safeLoad(e)}catch(e){return console.error(e),i.newSpecErr({source:"parser",level:"error",message:e.reason,line:e.mark&&e.mark.line?e.mark.line+1:void 0})}return a&&"object"===(void 0===a?"undefined":(0,E.default)(a))?n.updateJsonSpec(a):{}}},t.resolveSpec=function(e,t){return function(n){var r=n.specActions,i=n.specSelectors,o=n.errActions,a=n.fn,s=a.fetch,u=a.resolve,l=a.AST,c=n.getConfigs,p=c(),f=p.modelPropertyMacro,h=p.parameterMacro,d=p.requestInterceptor,m=p.responseInterceptor;void 0===e&&(e=i.specJson()),void 0===t&&(t=i.url());var v=l.getLineNumberForPath,g=i.specStr();return u({fetch:s,spec:e,baseDoc:t,modelPropertyMacro:f,parameterMacro:h,requestInterceptor:d,responseInterceptor:m}).then(function(e){var t=e.spec,n=e.errors;if(o.clear({type:"thrown"}),Array.isArray(n)&&n.length>0){var i=n.map(function(e){return console.error(e),e.line=e.fullPath?v(g,e.fullPath):null,e.path=e.fullPath?e.fullPath.join("."):null,e.level="error",e.type="thrown",e.source="resolver",Object.defineProperty(e,"message",{enumerable:!0,value:e.message}),e});o.newThrownErrBatch(i)}return r.updateResolved(t)})}},t.validateParams=function(e,t){return{type:B,payload:{pathMethod:e,isOAS3:t}}},t.setResponse=function(e,t,n){return{payload:{path:e,method:t,res:n},type:L}},t.setRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:q}},t.setMutatedRequest=function(e,t,n){return{payload:{path:e,method:t,req:n},type:z}},t.logRequest=function(e){return{payload:e,type:U}},t.executeRequest=function(e){return function(t){var n=t.fn,r=t.specActions,i=t.specSelectors,o=t.getConfigs,a=t.oas3Selectors,s=e.pathName,u=e.method,l=e.operation,c=o(),p=c.requestInterceptor,f=c.responseInterceptor,h=l.toJS();if(e.contextUrl=(0,D.default)(i.url()).toString(),h&&h.operationId?e.operationId=h.operationId:h&&s&&u&&(e.operationId=n.opId(h,s,u)),i.isOAS3()){var d=s+":"+u;e.server=a.selectedServer(d)||a.selectedServer();var m=a.serverVariables({server:e.server,namespace:d}).toJS(),v=a.serverVariables({server:e.server}).toJS();e.serverVariables=(0,w.default)(m).length?m:v,e.requestContentType=a.requestContentType(s,u),e.responseContentType=a.responseContentType(s,u)||"*/*";var g=a.requestBodyValue(s,u);(0,I.isJSONObject)(g)?e.requestBody=JSON.parse(g):e.requestBody=g}var y=(0,b.default)({},e);y=n.buildRequest(y),r.setRequest(e.pathName,e.method,y);var _=function(t){var n=p.apply(this,[t]),i=(0,b.default)({},n);return r.setMutatedRequest(e.pathName,e.method,i),n};e.requestInterceptor=_,e.responseInterceptor=f;var x=Date.now();return n.execute(e).then(function(t){t.duration=Date.now()-x,r.setResponse(e.pathName,e.method,t)}).catch(function(t){return r.setResponse(e.pathName,e.method,{error:!0,err:(0,M.default)(t)})})}},function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.path,n=e.method,r=(0,y.default)(e,["path","method"]);return function(e){var i=e.fn.fetch,o=e.specSelectors,a=e.specActions,s=o.spec().toJS(),u=o.operationScheme(t,n),l=o.contentTypeValues([t,n]).toJS(),c=l.requestContentType,p=l.responseContentType,f=/xml/i.test(c),h=o.parameterValues([t,n],f).toJS();return a.executeRequest((0,v.default)({fetch:i,spec:s,pathName:t,method:n,parameters:h,requestContentType:c,scheme:u,responseContentType:p},r))}});t.execute=Y},function(e,t,n){"use strict";function r(e){switch(e._type){case"document":case"block_quote":case"list":case"item":case"paragraph":case"heading":case"emph":case"strong":case"link":case"image":case"custom_inline":case"custom_block":return!0;default:return!1}}var i=function(e,t){this.current=e,this.entering=!0===t},o=function(){var e=this.current,t=this.entering;if(null===e)return null;var n=r(e);return t&&n?e._firstChild?(this.current=e._firstChild,this.entering=!0):this.entering=!1:e===this.root?this.current=null:null===e._next?(this.current=e._parent,this.entering=!1):(this.current=e._next,this.entering=!0),{entering:t,node:e}},a=function(e){return{current:e,root:e,entering:!0,next:o,resumeAt:i}},s=function(e,t){this._type=e,this._parent=null,this._firstChild=null,this._lastChild=null,this._prev=null,this._next=null,this._sourcepos=t,this._lastLineBlank=!1,this._open=!0,this._string_content=null,this._literal=null,this._listData={},this._info=null,this._destination=null,this._title=null,this._isFenced=!1,this._fenceChar=null,this._fenceLength=0,this._fenceOffset=null,this._level=null,this._onEnter=null,this._onExit=null},u=s.prototype;Object.defineProperty(u,"isContainer",{get:function(){return r(this)}}),Object.defineProperty(u,"type",{get:function(){return this._type}}),Object.defineProperty(u,"firstChild",{get:function(){return this._firstChild}}),Object.defineProperty(u,"lastChild",{get:function(){return this._lastChild}}),Object.defineProperty(u,"next",{get:function(){return this._next}}),Object.defineProperty(u,"prev",{get:function(){return this._prev}}),Object.defineProperty(u,"parent",{get:function(){return this._parent}}),Object.defineProperty(u,"sourcepos",{get:function(){return this._sourcepos}}),Object.defineProperty(u,"literal",{get:function(){return this._literal},set:function(e){this._literal=e}}),Object.defineProperty(u,"destination",{get:function(){return this._destination},set:function(e){this._destination=e}}),Object.defineProperty(u,"title",{get:function(){return this._title},set:function(e){this._title=e}}),Object.defineProperty(u,"info",{get:function(){return this._info},set:function(e){this._info=e}}),Object.defineProperty(u,"level",{get:function(){return this._level},set:function(e){this._level=e}}),Object.defineProperty(u,"listType",{get:function(){return this._listData.type},set:function(e){this._listData.type=e}}),Object.defineProperty(u,"listTight",{get:function(){return this._listData.tight},set:function(e){this._listData.tight=e}}),Object.defineProperty(u,"listStart",{get:function(){return this._listData.start},set:function(e){this._listData.start=e}}),Object.defineProperty(u,"listDelimiter",{get:function(){return this._listData.delimiter},set:function(e){this._listData.delimiter=e}}),Object.defineProperty(u,"onEnter",{get:function(){return this._onEnter},set:function(e){this._onEnter=e}}),Object.defineProperty(u,"onExit",{get:function(){return this._onExit},set:function(e){this._onExit=e}}),s.prototype.appendChild=function(e){e.unlink(),e._parent=this,this._lastChild?(this._lastChild._next=e,e._prev=this._lastChild,this._lastChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.prependChild=function(e){e.unlink(),e._parent=this,this._firstChild?(this._firstChild._prev=e,e._next=this._firstChild,this._firstChild=e):(this._firstChild=e,this._lastChild=e)},s.prototype.unlink=function(){this._prev?this._prev._next=this._next:this._parent&&(this._parent._firstChild=this._next),this._next?this._next._prev=this._prev:this._parent&&(this._parent._lastChild=this._prev),this._parent=null,this._next=null,this._prev=null},s.prototype.insertAfter=function(e){e.unlink(),e._next=this._next,e._next&&(e._next._prev=e),e._prev=this,this._next=e,e._parent=this._parent,e._next||(e._parent._lastChild=e)},s.prototype.insertBefore=function(e){e.unlink(),e._prev=this._prev,e._prev&&(e._prev._next=e),e._next=this,this._prev=e,e._parent=this._parent,e._prev||(e._parent._firstChild=e)},s.prototype.walker=function(){return new a(this)},e.exports=s},function(e,t){e.exports=function(e,t,n,r){if(!(e instanceof t)||void 0!==r&&r in e)throw TypeError(n+": incorrect invocation!");return e}},function(e,t,n){var r=n(53),i=n(181),o=n(75),a=n(133),s=n(604);e.exports=function(e,t){var n=1==e,u=2==e,l=3==e,c=4==e,p=6==e,f=5==e||p,h=t||s;return function(t,s,d){for(var m,v,g=o(t),y=i(g),_=r(s,d,3),b=a(y.length),x=0,w=n?h(t,b):u?h(t,0):void 0;b>x;x++)if((f||x in y)&&(m=y[x],v=_(m,x,g),e))if(n)w[x]=v;else if(v)switch(e){case 3:return!0;case 5:return m;case 6:return x;case 2:w.push(m)}else if(c)return!1;return p?-1:l||c?c:w}}},function(e,t,n){var r=n(99),i=n(22)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){var r=n(27),i=n(24).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t){e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){var r=n(99);e.exports=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==r(e)?e.split(""):Object(e)}},function(e,t,n){"use strict";function r(e){var t,n;this.promise=new e(function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r}),this.resolve=i(t),this.reject=i(n)}var i=n(98);e.exports.f=function(e){return new r(e)}},function(e,t,n){var r=n(37),i=n(613),o=n(180),a=n(187)("IE_PROTO"),s=function(){},u=function(){var e,t=n(179)("iframe"),r=o.length;for(t.style.display="none",n(334).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write("