diff --git a/doc/docs/_sidebar.md b/doc/docs/_sidebar.md index 679a05a0..578edd2f 100644 --- a/doc/docs/_sidebar.md +++ b/doc/docs/_sidebar.md @@ -1,32 +1,32 @@ -* [首页](/?t=1567561041568) +* [首页](/?t=1566794701229) * 开发文档 - * [快速体验](files/10010_快速体验.md?t=1567561041571) - * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1567561041592) - * [新增接口](files/10020_新增接口.md?t=1567561041592) - * [开发流程](files/10021_开发流程.md?t=1567561041592) - * [业务参数校验](files/10030_业务参数校验.md?t=1567561041592) - * [错误处理](files/10040_错误处理.md?t=1567561041592) - * [编写文档](files/10041_编写文档.md?t=1567561041592) - * [接口交互详解](files/10050_接口交互详解.md?t=1567561041593) - * [easyopen支持](files/10070_easyopen支持.md?t=1567561041593) - * [使用签名校验工具](files/10080_使用签名校验工具.md?t=1567561041593) - * [ISV管理](files/10085_ISV管理.md?t=1567561041593) - * [自定义返回结果](files/10087_自定义返回结果.md?t=1567561041593) - * [自定义过滤器](files/10088_自定义过滤器.md?t=1567561041593) - * [路由授权](files/10090_路由授权.md?t=1567561041594) - * [接口限流](files/10092_接口限流.md?t=1567561041594) - * [监控日志](files/10093_监控日志.md?t=1567561041594) - * [SDK开发](files/10095_SDK开发.md?t=1567561041594) - * [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1567561041594) - * [应用授权](files/10097_应用授权.md?t=1567561041594) - * [传统web开发](files/10100_传统web开发.md?t=1567561041594) - * [文件上传](files/10104_文件上传.md?t=1567561041594) - * [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1567561041594) - * [预发布灰度发布](files/10110_预发布灰度发布.md?t=1567561041595) - * [动态修改请求参数](files/10111_动态修改请求参数.md?t=1567561041595) + * [快速体验](files/10010_快速体验.md?t=1566794701233) + * [项目接入到SOP](files/10011_项目接入到SOP.md?t=1566794701264) + * [新增接口](files/10020_新增接口.md?t=1566794701265) + * [开发流程](files/10021_开发流程.md?t=1566794701265) + * [业务参数校验](files/10030_业务参数校验.md?t=1566794701265) + * [错误处理](files/10040_错误处理.md?t=1566794701265) + * [编写文档](files/10041_编写文档.md?t=1566794701265) + * [接口交互详解](files/10050_接口交互详解.md?t=1566794701265) + * [easyopen支持](files/10070_easyopen支持.md?t=1566794701265) + * [使用签名校验工具](files/10080_使用签名校验工具.md?t=1566794701266) + * [ISV管理](files/10085_ISV管理.md?t=1566794701266) + * [自定义返回结果](files/10087_自定义返回结果.md?t=1566794701266) + * [自定义过滤器](files/10088_自定义过滤器.md?t=1566794701266) + * [路由授权](files/10090_路由授权.md?t=1566794701266) + * [接口限流](files/10092_接口限流.md?t=1566794701266) + * [监控日志](files/10093_监控日志.md?t=1566794701266) + * [SDK开发](files/10095_SDK开发.md?t=1566794701266) + * [使用SpringCloudGateway](files/10096_使用SpringCloudGateway.md?t=1566794701267) + * [应用授权](files/10097_应用授权.md?t=1566794701267) + * [传统web开发](files/10100_传统web开发.md?t=1566794701267) + * [文件上传](files/10104_文件上传.md?t=1566794701270) + * [配置Sleuth链路追踪](files/10109_配置Sleuth链路追踪.md?t=1566794701270) + * [预发布灰度发布](files/10110_预发布灰度发布.md?t=1566794701270) + * [动态修改请求参数](files/10111_动态修改请求参数.md?t=1566794701270) * 原理分析 - * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1567561041595) - * [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1567561041595) - * [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1567561041595) - * [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1567561041595) - * [常见问题](files/90100_常见问题.md?t=1567561041595) + * [原理分析之@ApiMapping](files/90010_原理分析之@ApiMapping.md?t=1566794701270) + * [原理分析之如何存储路由](files/90011_原理分析之如何存储路由.md?t=1566794701270) + * [原理分析之如何路由](files/90012_原理分析之如何路由.md?t=1566794701270) + * [原理分析之文档归纳](files/90013_原理分析之文档归纳.md?t=1566794701270) + * [常见问题](files/90100_常见问题.md?t=1566794701270) diff --git a/doc/docs/files/10021_开发流程.md b/doc/docs/files/10021_开发流程.md new file mode 100644 index 00000000..68445b63 --- /dev/null +++ b/doc/docs/files/10021_开发流程.md @@ -0,0 +1,10 @@ +# 开发流程 + +- 启动SOP,注册中心(nacos)、网关(sop-gateway)、后台管理(sop-admin)、文档(sop-website) + +以上服务是固定的,启动一次即可,后续不用做改动。 + +- 在微服务端开发接口,编写swagger注解文档 +- 【可选】编写sdk +- 接口开发完成,启动微服务,注册到注册中心。 +- ISV调用你刚写的接口 diff --git a/doc/docs/files/90011_原理分析之如何存储路由.md b/doc/docs/files/90011_原理分析之如何存储路由.md new file mode 100644 index 00000000..7bb00f6d --- /dev/null +++ b/doc/docs/files/90011_原理分析之如何存储路由.md @@ -0,0 +1,63 @@ +# 原理分析之如何存储路由 + +SOP基于spring cloud,因此会涉及到网关路由。但是开发者不用去配置文件定义路由的隐射关系,SOP自动帮你解决了这个问题。 + +## 获取路由信息 + +首先明确一点,路由信息由各微服务提供,因此网关需要从注册中心获取各微服务实例,这个通过nacos提供的`watch`来实现。 +当有新的微服务加入时,Nacos会触发一个事件推送,详见`NacosWatch.java`类 + +```java +this.publisher.publishEvent(new HeartbeatEvent(this, this.nacosWatchIndex.getAndIncrement())); +``` + +因此,只要注册了`HeartbeatEvent`事件就能随时感知到微服务实例的变化。如何注册呢,config类实现`ApplicationListener`接口即可。 + +```java +public class AbstractConfiguration implements ApplicationContextAware, ApplicationListener { + /** + * nacos事件监听,每次微服务变化会触发这个方法 + * @see org.springframework.cloud.alibaba.nacos.discovery.NacosWatch NacosWatch + * @param heartbeatEvent + */ + @Override + public void onApplicationEvent(HeartbeatEvent heartbeatEvent) { + ...这里加载路由信息 + } +} +``` + +然后,每个微服务提供一个restful接口,接口地址为:`http://ip:port/sop/routes`,用来返回自身路由信息。网关请求这个接口用来获取路由信息。 + +加载路由伪代码如下: + +```java +public void onApplicationEvent(HeartbeatEvent heartbeatEvent) { + // 获取nacos中的服务实例列表 + List allInstances = namingService.getAllInstances(serviceName); + for(Instance instance : allInstances) { + // 微服务提供的接口 + String url = "http://" + instance.getIp + ":" + instance.getPort + "/sop/routes"; + ResponseEntity responseEntity = restTemplate.getForEntity(url, String.class); + if (responseEntity.getStatusCode() == HttpStatus.OK) { + // 返回来的路由信息 + String body = responseEntity.getBody(); + ...加载路由到本地 + } + } +} +``` + +完整代码可参看`com.gitee.sop.gatewaycommon.manager.ServiceRoutesLoader.java` + +路由的存储方式是一个Map,key为路由id,即接口名+版本号。 + +```java +/** + * key:nameVersion + */ +private Map nameVersionTargetRouteMap; +``` + +因为客户端调用接口都会传递一个接口名和版本号,因此通过这两个字段能够很快查询出路由信息,进行路由转发操作。 + diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/HttpTool.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/HttpTool.java new file mode 100644 index 00000000..63e43ef2 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/HttpTool.java @@ -0,0 +1,437 @@ +package com.gitee.sop.adminserver.bean; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import okhttp3.Cookie; +import okhttp3.CookieJar; +import okhttp3.FormBody; +import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.apache.commons.codec.digest.DigestUtils; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * http请求工具,基于OKHTTP3 + * @author tanghc + */ +public class HttpTool { + private static final MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json; charset=utf-8"); + + private Map> cookieStore = new HashMap>(); + + private OkHttpClient httpClient; + + public HttpTool() { + this(new HttpToolConfig()); + } + + public HttpTool(HttpToolConfig httpToolConfig) { + this.initHttpClient(httpToolConfig); + } + + protected void initHttpClient(HttpToolConfig httpToolConfig) { + httpClient = new OkHttpClient.Builder() + // 设置链接超时时间,默认10秒 + .connectTimeout(httpToolConfig.connectTimeoutSeconds, TimeUnit.SECONDS) + .readTimeout(httpToolConfig.readTimeoutSeconds, TimeUnit.SECONDS) + .writeTimeout(httpToolConfig.writeTimeoutSeconds, TimeUnit.SECONDS) + .cookieJar(new CookieJar() { + @Override + public void saveFromResponse(HttpUrl httpUrl, List list) { + cookieStore.put(httpUrl.host(), list); + } + + @Override + public List loadForRequest(HttpUrl httpUrl) { + List cookies = cookieStore.get(httpUrl.host()); + return cookies != null ? cookies : new ArrayList(); + } + }).build(); + } + + @Data + public static class HttpToolConfig { + /** + * 请求超时时间 + */ + private int connectTimeoutSeconds = 10; + /** + * http读取超时时间 + */ + private int readTimeoutSeconds = 10; + /** + * http写超时时间 + */ + private int writeTimeoutSeconds = 10; + } + + /** + * get请求 + * + * @param url + * @param header + * @return + * @throws IOException + */ + public String get(String url, Map header) throws IOException { + Request.Builder builder = new Request.Builder().url(url).get(); + // 添加header + addHeader(builder, header); + + Request request = builder.build(); + Response response = httpClient.newCall(request).execute(); + return response.body().string(); + } + + /** + * 提交表单 + * + * @param url url + * @param form 参数 + * @param header header + * @param method 请求方式,post,get等 + * @return + * @throws IOException + */ + public String request(String url, Map form, Map header, HTTPMethod method) throws IOException { + Request.Builder requestBuilder = buildRequestBuilder(url, form, method); + // 添加header + addHeader(requestBuilder, header); + + Request request = requestBuilder.build(); + Response response = httpClient + .newCall(request) + .execute(); + try { + return response.body().string(); + } finally { + response.close(); + } + } + + /** + * 请求json数据,contentType=application/json + * @param url 请求路径 + * @param json json数据 + * @param header header + * @return 返回响应结果 + * @throws IOException + */ + public String requestJson(String url, String json, Map header) throws IOException { + RequestBody body = RequestBody.create(MEDIA_TYPE_JSON, json); + Request.Builder requestBuilder = new Request.Builder() + .url(url) + .post(body); + // 添加header + addHeader(requestBuilder, header); + + Request request = requestBuilder.build(); + Response response = httpClient + .newCall(request) + .execute(); + try { + return response.body().string(); + } finally { + response.close(); + } + } + + public static Request.Builder buildRequestBuilder(String url, Map form, HTTPMethod method) { + switch (method) { + case GET: + return new Request.Builder() + .url(buildHttpUrl(url, form)) + .get(); + case HEAD: + return new Request.Builder() + .url(buildHttpUrl(url, form)) + .head(); + case PUT: + return new Request.Builder() + .url(url) + .put(buildFormBody(form)); + case DELETE: + return new Request.Builder() + .url(url) + .delete(buildFormBody(form)); + default: + return new Request.Builder() + .url(url) + .post(buildFormBody(form)); + } + } + + public static HttpUrl buildHttpUrl(String url, Map form) { + HttpUrl.Builder urlBuilder = HttpUrl.parse(url).newBuilder(); + for (Map.Entry entry : form.entrySet()) { + urlBuilder.addQueryParameter(entry.getKey(), String.valueOf(entry.getValue())); + } + return urlBuilder.build(); + } + + public static FormBody buildFormBody(Map form) { + FormBody.Builder paramBuilder = new FormBody.Builder(StandardCharsets.UTF_8); + for (Map.Entry entry : form.entrySet()) { + paramBuilder.add(entry.getKey(), String.valueOf(entry.getValue())); + } + return paramBuilder.build(); + } + + /** + * 提交表单,并且上传文件 + * + * @param url + * @param form + * @param header + * @param files + * @return + * @throws IOException + */ + public String requestFile(String url, Map form, Map header, List files) + throws IOException { + // 创建MultipartBody.Builder,用于添加请求的数据 + MultipartBody.Builder bodyBuilder = new MultipartBody.Builder(); + bodyBuilder.setType(MultipartBody.FORM); + + for (UploadFile uploadFile : files) { + // 请求的名字 + bodyBuilder.addFormDataPart(uploadFile.getName(), + // 文件的文字,服务器端用来解析的 + uploadFile.getFileName(), + // 创建RequestBody,把上传的文件放入 + RequestBody.create(null, uploadFile.getFileData()) + ); + } + + for (Map.Entry entry : form.entrySet()) { + bodyBuilder.addFormDataPart(entry.getKey(), String.valueOf(entry.getValue())); + } + + RequestBody requestBody = bodyBuilder.build(); + + Request.Builder builder = new Request.Builder().url(url).post(requestBody); + + // 添加header + addHeader(builder, header); + + Request request = builder.build(); + Response response = httpClient.newCall(request).execute(); + try { + return response.body().string(); + } finally { + response.close(); + } + } + + /** + * 请求数据 + * + * @param url 请求url + * @param form 请求数据 + * @param header header + * @return 返回Response + * @throws IOException + */ + public Response requestForResponse(String url, Map form, Map header, HTTPMethod method) throws IOException { + Request.Builder requestBuilder = buildRequestBuilder(url, form, method); + // 添加header + addHeader(requestBuilder, header); + + Request request = requestBuilder.build(); + return httpClient + .newCall(request) + .execute(); + } + + /** + * 下载文件 + * + * @param url 请求url + * @param form 请求数据 + * @param header header + * @return 返回文件流 + * @throws IOException + */ + public InputStream downloadFile(String url, Map form, Map header) throws IOException { + Request.Builder requestBuilder = buildRequestBuilder(url, form, HTTPMethod.GET); + // 添加header + addHeader(requestBuilder, header); + + Request request = requestBuilder.build(); + Response response = httpClient + .newCall(request) + .execute(); + if (response.isSuccessful()) { + ResponseBody body = response.body(); + return body == null ? null : body.byteStream(); + } + return null; + } + + private void addHeader(Request.Builder builder, Map header) { + if (header != null) { + Set> entrySet = header.entrySet(); + for (Map.Entry entry : entrySet) { + builder.addHeader(entry.getKey(), String.valueOf(entry.getValue())); + } + } + } + + public void setCookieStore(Map> cookieStore) { + this.cookieStore = cookieStore; + } + + public void setHttpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + } + + public enum HTTPMethod { + /** http GET */ + GET, + /** http POST */ + POST, + /** http PUT */ + PUT, + /** http HEAD */ + HEAD, + /** http DELETE */ + DELETE; + + private HTTPMethod() { + } + + public String value() { + return this.name(); + } + + public static HTTPMethod fromValue(String v) { + return valueOf(v.toUpperCase()); + } + } + + /** + * 文件上传类 + * @author tanghc + */ + @Getter + @Setter + public static class UploadFile implements Serializable { + private static final long serialVersionUID = -1100614660944996398L; + + /** + * @param name 表单名称,不能重复 + * @param file 文件 + * @throws IOException + */ + public UploadFile(String name, File file) throws IOException { + this(name, file.getName(), FileUtil.toBytes(file)); + } + + /** + * @param name 表单名称,不能重复 + * @param fileName 文件名 + * @param input 文件流 + * @throws IOException + */ + public UploadFile(String name, String fileName, InputStream input) throws IOException { + this(name, fileName, FileUtil.toBytes(input)); + } + + /** + * @param name 表单名称,不能重复 + * @param fileName 文件名 + * @param fileData 文件数据 + */ + public UploadFile(String name, String fileName, byte[] fileData) { + super(); + this.name = name; + this.fileName = fileName; + this.fileData = fileData; + this.md5 = DigestUtils.md5Hex(fileData); + } + + private String name; + private String fileName; + private byte[] fileData; + private String md5; + + } + + public static class FileUtil { + + /** + * The default buffer size to use. + */ + private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; + private static final int EOF = -1; + + /** + * 将文件流转换成byte[] + * @param input + * @return + * @throws IOException + */ + public static byte[] toBytes(InputStream input) throws IOException { + ByteArrayOutputStream output = new ByteArrayOutputStream(); + int n = 0; + byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; + + while (EOF != (n = input.read(buffer))) { + output.write(buffer, 0, n); + } + return output.toByteArray(); + } + + /** + * 将文件转换成数据流 + * @param file 文件 + * @return 返回数据流 + * @throws IOException + */ + public static byte[] toBytes(File file) throws IOException { + if (file.exists()) { + if (file.isDirectory()) { + throw new IOException("File '" + file + "' exists but is a directory"); + } + if (file.canRead() == false) { + throw new IOException("File '" + file + "' cannot be read"); + } + } else { + throw new FileNotFoundException("File '" + file + "' does not exist"); + } + InputStream input = null; + try { + input = new FileInputStream(file); + return toBytes(input); + } finally { + try { + if (input != null) { + input.close(); + } + } catch (IOException ioe) { + } + } + } + } +} diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/NacosConfigs.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/NacosConfigs.java new file mode 100644 index 00000000..4110e8e8 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/NacosConfigs.java @@ -0,0 +1,29 @@ +package com.gitee.sop.adminserver.bean; + +/** + * @author tanghc + */ +public class NacosConfigs { + + public static final String GROUP_CHANNEL = "sop:channel"; + + public static final String GROUP_ROUTE = "sop:route"; + + public static final String DATA_ID_GRAY = "com.gitee.sop.channel.gray"; + + public static final String DATA_ID_IP_BLACKLIST = "com.gitee.sop.channel.ipblacklist"; + + public static final String DATA_ID_ISV = "com.gitee.sop.channel.isv"; + + public static final String DATA_ID_ROUTE_PERMISSION = "com.gitee.sop.channel.routepermission"; + + public static final String DATA_ID_LIMIT_CONFIG = "com.gitee.sop.channel.limitconfig"; + + public static final String DATA_ID_ROUTE_CONFIG = "com.gitee.sop.channel.routeconfig"; + + private static final String DATA_ID_TPL = "com.gitee.sop.route.%s"; + + public static String getRouteDataId(String serviceId) { + return String.format(DATA_ID_TPL, serviceId); + } +} diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/RouteDefinition.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/RouteDefinition.java new file mode 100644 index 00000000..73de492d --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/RouteDefinition.java @@ -0,0 +1,89 @@ +package com.gitee.sop.adminserver.bean; + +import com.alibaba.fastjson.annotation.JSONField; +import com.gitee.easyopen.doc.annotation.ApiDocField; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class RouteDefinition { + /** + * 路由的Id + */ + @ApiDocField(description = "路由id") + private String id = ""; + + /** + * 接口名 + */ + private String name; + + /** + * 版本号 + */ + private String version; + + /** + * 路由断言集合配置 + */ + @JSONField(serialize = false) + private List predicates = new ArrayList<>(); + + /** + * 路由过滤器集合配置 + */ + @JSONField(serialize = false) + private List filters = new ArrayList<>(); + + /** + * 路由规则转发的目标uri + */ + @ApiDocField(description = "uri") + private String uri; + + /** + * uri后面跟的path + */ + @ApiDocField(description = "path") + private String path; + + /** + * 路由执行的顺序 + */ + private int order = 0; + + /** + * 是否忽略验证,业务参数验证除外 + */ + @ApiDocField(description = "是否忽略验证,业务参数验证除外,1:忽略,0:不忽略") + private int ignoreValidate; + + /** + * 状态,0:待审核,1:启用,2:禁用 + */ + @ApiDocField(description = "状态,0:待审核,1:启用,2:禁用") + private int status = 1; + + /** + * 合并结果,统一格式输出 + */ + @ApiDocField(description = "合并结果,统一格式输出,1:合并,0:不合并") + private int mergeResult = 1; + + /** + * 是否需要授权才能访问 + */ + @ApiDocField(description = "是否需要授权才能访问,1:是,0:否") + private int permission; + + /** + * 是否是自定义路由 + */ + @ApiDocField(description = "是否是自定义路由,1:是,0:否") + private int custom; +} \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/ServiceInfo.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/ServiceInfo.java new file mode 100644 index 00000000..8a10e096 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/ServiceInfo.java @@ -0,0 +1,16 @@ +package com.gitee.sop.adminserver.bean; + +import lombok.Data; + +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class ServiceInfo { + /** 服务名称 */ + private String serviceId; + /** 实例列表 */ + private List instances; +} diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/ServiceInstance.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/ServiceInstance.java new file mode 100644 index 00000000..10603d65 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/bean/ServiceInstance.java @@ -0,0 +1,48 @@ +package com.gitee.sop.adminserver.bean; + +import lombok.Data; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author tanghc + */ +@Data +public class ServiceInstance { + /** + * 实例id + */ + private String instanceId; + + /** + * 服务名称 + */ + private String serviceId; + + /** + * ip + */ + private String ip; + + /** + * port + */ + private int port; + + /** + * 服务状态,UP:已上线,OUT_OF_SERVICE:已下线 + */ + private String status; + + /** + * 更新时间 + */ + private String updateTime; + + /** + * user extended attributes + */ + private Map metadata = new HashMap(); + +} \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/ConfigPushService.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/ConfigPushService.java new file mode 100644 index 00000000..9b1109de --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/ConfigPushService.java @@ -0,0 +1,32 @@ +package com.gitee.sop.adminserver.service; + +import com.alibaba.fastjson.JSON; +import com.alibaba.nacos.api.annotation.NacosInjected; +import com.alibaba.nacos.api.config.ConfigService; +import com.alibaba.nacos.api.exception.NacosException; +import com.gitee.sop.adminserver.bean.ChannelMsg; +import com.gitee.sop.adminserver.common.BizException; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; + +/** + * @author tanghc + */ +@Slf4j +@Service +public class ConfigPushService { + + @NacosInjected + private ConfigService configService; + + public void publishConfig(String dataId, String groupId, ChannelMsg channelMsg) { + try { + log.info("nacos配置, dataId={}, groupId={}, operation={}", dataId, groupId, channelMsg.getOperation()); + configService.publishConfig(dataId, groupId, JSON.toJSONString(channelMsg)); + } catch (NacosException e) { + log.error("nacos配置失败, dataId={}, groupId={}, operation={}", dataId, groupId, channelMsg.getOperation(), e); + throw new BizException("nacos配置失败"); + } + } + +} diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/RegistryService.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/RegistryService.java new file mode 100644 index 00000000..4799997d --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/RegistryService.java @@ -0,0 +1,50 @@ +package com.gitee.sop.adminserver.service; + +import com.gitee.sop.adminserver.bean.ServiceInfo; +import com.gitee.sop.adminserver.bean.ServiceInstance; + +import java.util.List; + +/** + * @author tanghc + */ +public interface RegistryService { + String TIMESTAMP_PATTERN = "yyyy-MM-dd HH:mm:ss"; + + /** + * 获取所有服务列表 + * + * @param pageNo 当前页码 + * @param pageSize 分页大小 + * @return 返回服务列表 + * @throws Exception 获取失败抛出异常 + */ + List listAllService(int pageNo, int pageSize) throws Exception; + + /** + * 服务上线 + * + * @param serviceInstance + * @throws Exception 服务上线失败抛出异常 + */ + void onlineInstance(ServiceInstance serviceInstance) throws Exception; + + /** + * 服务下线 + * + * @param serviceInstance + * @throws Exception 服务下线失败抛出异常 + */ + void offlineInstance(ServiceInstance serviceInstance) throws Exception; + + + /** + * 设置实例元数据 + * + * @param serviceInstance 实例 + * @param key key + * @param value 值 + * @throws Exception 设置实例元数据失败抛出异常 + */ + void setMetadata(ServiceInstance serviceInstance, String key, String value) throws Exception; +} diff --git a/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/impl/RegistryServiceNacosImpl.java b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/impl/RegistryServiceNacosImpl.java new file mode 100644 index 00000000..a7bfced5 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/java/com/gitee/sop/adminserver/service/impl/RegistryServiceNacosImpl.java @@ -0,0 +1,134 @@ +package com.gitee.sop.adminserver.service.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.api.naming.NamingFactory; +import com.alibaba.nacos.api.naming.NamingService; +import com.alibaba.nacos.api.naming.pojo.Instance; +import com.alibaba.nacos.api.naming.pojo.ListView; +import com.gitee.sop.adminserver.bean.HttpTool; +import com.gitee.sop.adminserver.bean.ServiceInfo; +import com.gitee.sop.adminserver.bean.ServiceInstance; +import com.gitee.sop.adminserver.service.RegistryService; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.util.CollectionUtils; + +import javax.annotation.PostConstruct; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * nacos接口实现, https://nacos.io/zh-cn/docs/open-api.html + * @author tanghc + */ +@Slf4j +public class RegistryServiceNacosImpl implements RegistryService { + + private static HttpTool httpTool = new HttpTool(); + + @Value("${nacos.discovery.server-addr:${registry.nacos-server-addr:}}") + private String nacosAddr; + + private NamingService namingService; + + @PostConstruct + public void after() throws NacosException { + if (StringUtils.isBlank(nacosAddr)) { + throw new IllegalArgumentException("请在配置文件中指定nacos.discovery.server-addr参数"); + } + namingService = NamingFactory.createNamingService(nacosAddr); + } + + @Override + public List listAllService(int pageNo, int pageSize) throws Exception { + ListView servicesOfServer = namingService.getServicesOfServer(pageNo, pageSize); + List serverList = servicesOfServer.getData(); + List serviceInfoList = new ArrayList<>(); + for (String serviceName : serverList) { + ServiceInfo serviceInfo = new ServiceInfo(); + serviceInfo.setServiceId(serviceName); + List instanceList = namingService.getAllInstances(serviceName); + if (CollectionUtils.isEmpty(instanceList)) { + serviceInfo.setInstances(Collections.emptyList()); + } else { + serviceInfo.setInstances(new ArrayList<>(instanceList.size())); + for (Instance instance : instanceList) { + ServiceInstance serviceInstance = new ServiceInstance(); + serviceInstance.setInstanceId(instance.getInstanceId()); + serviceInstance.setServiceId(serviceInfo.getServiceId()); + serviceInstance.setIp(instance.getIp()); + serviceInstance.setPort(instance.getPort()); + boolean isOnline = instance.getWeight() > 0; + String status = isOnline ? "UP" : "OUT_OF_SERVICE"; + serviceInstance.setStatus(status); + serviceInstance.setMetadata(instance.getMetadata()); + serviceInfo.getInstances().add(serviceInstance); + } + } + serviceInfoList.add(serviceInfo); + } + serviceInfoList.sort((o1, o2) -> o2.getInstances().size() - o1.getInstances().size()); + return serviceInfoList; + } + + @Override + public void onlineInstance(ServiceInstance serviceInstance) throws Exception { + // 查询实例 + Instance instance = this.getInstance(serviceInstance); + // 上线,把权重设置成1 + instance.setWeight(1); + this.updateInstance(instance); + } + + @Override + public void offlineInstance(ServiceInstance serviceInstance) throws Exception { + // 查询实例 + Instance instance = this.getInstance(serviceInstance); + // 下线,把权重设置成0 + instance.setWeight(0); + this.updateInstance(instance); + } + + @Override + public void setMetadata(ServiceInstance serviceInstance, String key, String value) throws Exception { + // 查询实例 + Instance instance = this.getInstance(serviceInstance); + // 设置metadata + Map metadata = instance.getMetadata(); + metadata.put(key, value); + this.updateInstance(instance); + } + + protected void updateInstance(Instance instance) throws IOException { + String json = JSON.toJSONString(instance); + JSONObject jsonObject = JSON.parseObject(json); + String response = httpTool.request("http://" + nacosAddr + "/nacos/v1/ns/instance", jsonObject, null, HttpTool.HTTPMethod.PUT); + if (!"ok".equalsIgnoreCase(response)) { + throw new RuntimeException(response); + } + } + + /** + * 查询实例 + * @param serviceInstance 实例信息 + * @return 返回nacos实例 + * @throws IOException 查询异常 + */ + protected Instance getInstance(ServiceInstance serviceInstance) throws IOException { + Map params = new HashMap<>(8); + params.put("serviceName", serviceInstance.getServiceId()); + params.put("ip", serviceInstance.getIp()); + params.put("port", String.valueOf(serviceInstance.getPort())); + String instanceJson = httpTool.request("http://" + nacosAddr + "/nacos/v1/ns/instance", params, null, HttpTool.HTTPMethod.GET); + Instance instance = JSON.parseObject(instanceJson, Instance.class); + instance.setServiceName(serviceInstance.getServiceId()); + return instance; + } +} diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/css/app.c6dfb7ee.css b/sop-admin/sop-admin-server/src/main/resources/public/static/css/app.c6dfb7ee.css new file mode 100644 index 00000000..980f7dc7 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/css/app.c6dfb7ee.css @@ -0,0 +1 @@ +.fade-enter-active,.fade-leave-active{-webkit-transition:opacity .28s;transition:opacity .28s}.fade-enter,.fade-leave-active{opacity:0}.fade-transform-enter-active,.fade-transform-leave-active{-webkit-transition:all .5s;transition:all .5s}.fade-transform-enter{opacity:0;-webkit-transform:translateX(-30px);transform:translateX(-30px)}.fade-transform-leave-to{opacity:0;-webkit-transform:translateX(30px);transform:translateX(30px)}.breadcrumb-enter-active,.breadcrumb-leave-active{-webkit-transition:all .5s;transition:all .5s}.breadcrumb-enter,.breadcrumb-leave-active{opacity:0;-webkit-transform:translateX(20px);transform:translateX(20px)}.breadcrumb-move{-webkit-transition:all .5s;transition:all .5s}.breadcrumb-leave-active{position:absolute}.el-breadcrumb__inner,.el-breadcrumb__inner a{font-weight:400!important}.el-upload input[type=file]{display:none!important}.el-upload__input{display:none}.el-dialog{-webkit-transform:none;transform:none;left:0;position:relative;margin:0 auto}.upload-container .el-upload{width:100%}.upload-container .el-upload .el-upload-dragger{width:100%;height:200px}.el-dropdown-menu a{display:block}#app .main-container{min-height:100%;-webkit-transition:margin-left .28s;transition:margin-left .28s;margin-left:210px;position:relative}#app .sidebar-container{-webkit-transition:width .28s;transition:width .28s;width:210px!important;background-color:#304156;height:100%;position:fixed;font-size:0;top:0;bottom:0;left:0;z-index:1001;overflow:hidden}#app .sidebar-container .horizontal-collapse-transition{-webkit-transition:width 0s ease-in-out,padding-left 0s ease-in-out,padding-right 0s ease-in-out;transition:width 0s ease-in-out,padding-left 0s ease-in-out,padding-right 0s ease-in-out}#app .sidebar-container .scrollbar-wrapper{overflow-x:hidden!important}#app .sidebar-container .el-scrollbar__bar.is-vertical{right:0}#app .sidebar-container .el-scrollbar{height:100%}#app .sidebar-container.has-logo .el-scrollbar{height:calc(100% - 50px)}#app .sidebar-container .is-horizontal{display:none}#app .sidebar-container a{display:inline-block;width:100%;overflow:hidden}#app .sidebar-container .svg-icon{margin-right:16px}#app .sidebar-container .el-menu{border:none;height:100%;width:100%!important}#app .sidebar-container .el-submenu__title:hover,#app .sidebar-container .submenu-title-noDropdown:hover{background-color:#263445!important}#app .sidebar-container .is-active>.el-submenu__title{color:#f4f4f5!important}#app .sidebar-container .el-submenu .el-menu-item,#app .sidebar-container .nest-menu .el-submenu>.el-submenu__title{min-width:210px!important;background-color:#1f2d3d!important}#app .sidebar-container .el-submenu .el-menu-item:hover,#app .sidebar-container .nest-menu .el-submenu>.el-submenu__title:hover{background-color:#001528!important}#app .hideSidebar .sidebar-container{width:54px!important}#app .hideSidebar .main-container{margin-left:54px}#app .hideSidebar .svg-icon{margin-right:0}#app .hideSidebar .submenu-title-noDropdown{padding:0!important;position:relative}#app .hideSidebar .submenu-title-noDropdown .el-tooltip{padding:0!important}#app .hideSidebar .submenu-title-noDropdown .el-tooltip .svg-icon{margin-left:20px}#app .hideSidebar .el-submenu{overflow:hidden}#app .hideSidebar .el-submenu>.el-submenu__title{padding:0!important}#app .hideSidebar .el-submenu>.el-submenu__title .svg-icon{margin-left:20px}#app .hideSidebar .el-submenu>.el-submenu__title .el-submenu__icon-arrow{display:none}#app .hideSidebar .el-menu--collapse .el-submenu>.el-submenu__title>span{height:0;width:0;overflow:hidden;visibility:hidden;display:inline-block}#app .el-menu--collapse .el-menu .el-submenu{min-width:210px!important}#app .mobile .main-container{margin-left:0}#app .mobile .sidebar-container{-webkit-transition:-webkit-transform .28s;transition:-webkit-transform .28s;transition:transform .28s;transition:transform .28s,-webkit-transform .28s;width:210px!important}#app .mobile.hideSidebar .sidebar-container{pointer-events:none;-webkit-transition-duration:.3s;transition-duration:.3s;-webkit-transform:translate3d(-210px,0,0);transform:translate3d(-210px,0,0)}#app .withoutAnimation .main-container,#app .withoutAnimation .sidebar-container{-webkit-transition:none;transition:none}.el-menu--vertical>.el-menu .svg-icon{margin-right:16px}.el-menu--vertical .el-menu-item:hover,.el-menu--vertical .nest-menu .el-submenu>.el-submenu__title:hover{background-color:#263445!important}.el-menu--vertical>.el-menu--popup{max-height:100vh;overflow-y:auto}.el-menu--vertical>.el-menu--popup::-webkit-scrollbar-track-piece{background:#d3dce6}.el-menu--vertical>.el-menu--popup::-webkit-scrollbar{width:6px}.el-menu--vertical>.el-menu--popup::-webkit-scrollbar-thumb{background:#99a9bf;border-radius:20px}body{height:100%;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased;text-rendering:optimizeLegibility;font-family:Helvetica Neue,Helvetica,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Arial,sans-serif}label{font-weight:700}html{-webkit-box-sizing:border-box;box-sizing:border-box}#app,html{height:100%}*,:after,:before{-webkit-box-sizing:inherit;box-sizing:inherit}a:active,a:focus{outline:none}a,a:focus,a:hover{cursor:pointer;color:inherit;text-decoration:none}div:focus{outline:none}.clearfix:after{visibility:hidden;display:block;font-size:0;content:" ";clear:both;height:0}.app-container{padding:20px}.app-breadcrumb.el-breadcrumb[data-v-62cc9144]{display:inline-block;font-size:14px;line-height:50px;margin-left:8px}.app-breadcrumb.el-breadcrumb .no-redirect[data-v-62cc9144]{color:#97a8be;cursor:text}.hamburger[data-v-49e15297]{display:inline-block;vertical-align:middle;width:20px;height:20px}.hamburger.is-active[data-v-49e15297]{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.navbar[data-v-1eff5c58]{height:50px;overflow:hidden;position:relative;background:#fff;-webkit-box-shadow:0 1px 4px rgba(0,21,41,.08);box-shadow:0 1px 4px rgba(0,21,41,.08)}.navbar .hamburger-container[data-v-1eff5c58]{line-height:46px;height:100%;float:left;cursor:pointer;-webkit-transition:background .3s;transition:background .3s;-webkit-tap-highlight-color:transparent}.navbar .hamburger-container[data-v-1eff5c58]:hover{background:rgba(0,0,0,.025)}.navbar .breadcrumb-container[data-v-1eff5c58]{float:left}.navbar .right-menu[data-v-1eff5c58]{float:right;height:100%;line-height:50px}.navbar .right-menu[data-v-1eff5c58]:focus{outline:none}.navbar .right-menu .right-menu-item[data-v-1eff5c58]{display:inline-block;padding:0 8px;height:100%;font-size:18px;color:#5a5e66;vertical-align:text-bottom}.navbar .right-menu .right-menu-item.hover-effect[data-v-1eff5c58]{cursor:pointer;-webkit-transition:background .3s;transition:background .3s}.navbar .right-menu .right-menu-item.hover-effect[data-v-1eff5c58]:hover{background:rgba(0,0,0,.025)}.navbar .right-menu .avatar-container[data-v-1eff5c58]{margin-right:30px}.navbar .right-menu .avatar-container .avatar-wrapper[data-v-1eff5c58]{margin-top:5px;position:relative}.navbar .right-menu .avatar-container .avatar-wrapper .user-avatar[data-v-1eff5c58]{cursor:pointer;width:40px;height:40px;border-radius:10px}.navbar .right-menu .avatar-container .avatar-wrapper .el-icon-caret-bottom[data-v-1eff5c58]{cursor:pointer;position:absolute;right:-20px;top:25px;font-size:12px}.sidebarLogoFade-enter-active[data-v-b905289c]{-webkit-transition:opacity 1.5s;transition:opacity 1.5s}.sidebarLogoFade-enter[data-v-b905289c],.sidebarLogoFade-leave-to[data-v-b905289c]{opacity:0}.sidebar-logo-container[data-v-b905289c]{position:relative;width:100%;height:50px;line-height:50px;background:#2b2f3a;padding-left:10px;overflow:hidden}.sidebar-logo-container .sidebar-logo-link[data-v-b905289c]{height:100%;width:100%}.sidebar-logo-container .sidebar-logo-link .sidebar-logo[data-v-b905289c]{width:32px;height:32px;vertical-align:middle;margin-right:12px}.sidebar-logo-container .sidebar-logo-link .sidebar-title[data-v-b905289c]{display:inline-block;margin:0;color:#fff;font-weight:600;line-height:50px;font-size:14px;font-family:Avenir,Helvetica Neue,Arial,Helvetica,sans-serif;vertical-align:middle}.sidebar-logo-container.collapse .sidebar-logo[data-v-b905289c]{margin-right:0}.app-main[data-v-43c24f68]{min-height:calc(100vh - 50px);width:100%;position:relative;overflow:hidden}.fixed-header+.app-main[data-v-43c24f68]{padding-top:50px}[data-v-4f739cf0]:export{menuText:#bfcbd9;menuActiveText:#409eff;subMenuActiveText:#f4f4f5;menuBg:#304156;menuHover:#263445;subMenuBg:#1f2d3d;subMenuHover:#001528;sideBarWidth:210px}.app-wrapper[data-v-4f739cf0]{position:relative;height:100%;width:100%}.app-wrapper[data-v-4f739cf0]:after{content:"";display:table;clear:both}.app-wrapper.mobile.openSidebar[data-v-4f739cf0]{position:fixed;top:0}.drawer-bg[data-v-4f739cf0]{background:#000;opacity:.3;width:100%;top:0;height:100%;position:absolute;z-index:999}.fixed-header[data-v-4f739cf0]{position:fixed;top:0;right:0;z-index:9;width:calc(100% - 210px);-webkit-transition:width .28s;transition:width .28s}.hideSidebar .fixed-header[data-v-4f739cf0]{width:calc(100% - 54px)}.mobile .fixed-header[data-v-4f739cf0]{width:100%}.svg-icon[data-v-53ff2da0]{width:1em;height:1em;vertical-align:-.15em;fill:currentColor;overflow:hidden} \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-2c1f2e8f.0314067f.css b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-2c1f2e8f.0314067f.css new file mode 100644 index 00000000..134e08d6 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-2c1f2e8f.0314067f.css @@ -0,0 +1 @@ +@supports (-webkit-mask:none) and (not (cater-color:#fff)){.login-container .el-input input{color:#fff}}.login-container .el-input{display:inline-block;height:47px;width:85%}.login-container .el-input input{background:transparent;border:0;-webkit-appearance:none;border-radius:0;padding:12px 5px 12px 15px;color:#fff;height:47px;caret-color:#fff}.login-container .el-input input:-webkit-autofill{-webkit-box-shadow:0 0 0 1000px #283443 inset!important;box-shadow:inset 0 0 0 1000px #283443!important;-webkit-text-fill-color:#fff!important}.login-container .el-form-item{border:1px solid hsla(0,0%,100%,.1);background:rgba(0,0,0,.1);border-radius:5px;color:#454545}.login-container[data-v-0204d890]{min-height:100%;width:100%;background-color:#2d3a4b;overflow:hidden}.login-container .login-form[data-v-0204d890]{position:relative;width:520px;max-width:100%;padding:160px 35px 0;margin:0 auto;overflow:hidden}.login-container .tips[data-v-0204d890]{font-size:14px;color:#fff;margin-bottom:10px}.login-container .tips span[data-v-0204d890]:first-of-type{margin-right:16px}.login-container .svg-container[data-v-0204d890]{padding:6px 5px 6px 15px;color:#889aa4;vertical-align:middle;width:30px;display:inline-block}.login-container .title-container[data-v-0204d890]{position:relative}.login-container .title-container .title[data-v-0204d890]{font-size:26px;color:#eee;margin:0 auto 40px auto;text-align:center;font-weight:700}.login-container .show-pwd[data-v-0204d890]{position:absolute;right:10px;top:7px;font-size:16px;color:#889aa4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-4de1c2b6.a37cd815.css b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-4de1c2b6.a37cd815.css new file mode 100644 index 00000000..5adab285 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-4de1c2b6.a37cd815.css @@ -0,0 +1 @@ +.wscn-http404-container[data-v-c095f994]{-webkit-transform:translate(-50%,-50%);transform:translate(-50%,-50%);position:absolute;top:40%;left:50%}.wscn-http404[data-v-c095f994]{position:relative;width:1200px;padding:0 50px;overflow:hidden}.wscn-http404 .pic-404[data-v-c095f994]{position:relative;float:left;width:600px;overflow:hidden}.wscn-http404 .pic-404__parent[data-v-c095f994]{width:100%}.wscn-http404 .pic-404__child[data-v-c095f994]{position:absolute}.wscn-http404 .pic-404__child.left[data-v-c095f994]{width:80px;top:17px;left:220px;opacity:0;-webkit-animation-name:cloudLeft-data-v-c095f994;animation-name:cloudLeft-data-v-c095f994;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1s;animation-delay:1s}.wscn-http404 .pic-404__child.mid[data-v-c095f994]{width:46px;top:10px;left:420px;opacity:0;-webkit-animation-name:cloudMid-data-v-c095f994;animation-name:cloudMid-data-v-c095f994;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1.2s;animation-delay:1.2s}.wscn-http404 .pic-404__child.right[data-v-c095f994]{width:62px;top:100px;left:500px;opacity:0;-webkit-animation-name:cloudRight-data-v-c095f994;animation-name:cloudRight-data-v-c095f994;-webkit-animation-duration:2s;animation-duration:2s;-webkit-animation-timing-function:linear;animation-timing-function:linear;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards;-webkit-animation-delay:1s;animation-delay:1s}@-webkit-keyframes cloudLeft-data-v-c095f994{0%{top:17px;left:220px;opacity:0}20%{top:33px;left:188px;opacity:1}80%{top:81px;left:92px;opacity:1}to{top:97px;left:60px;opacity:0}}@keyframes cloudLeft-data-v-c095f994{0%{top:17px;left:220px;opacity:0}20%{top:33px;left:188px;opacity:1}80%{top:81px;left:92px;opacity:1}to{top:97px;left:60px;opacity:0}}@-webkit-keyframes cloudMid-data-v-c095f994{0%{top:10px;left:420px;opacity:0}20%{top:40px;left:360px;opacity:1}70%{top:130px;left:180px;opacity:1}to{top:160px;left:120px;opacity:0}}@keyframes cloudMid-data-v-c095f994{0%{top:10px;left:420px;opacity:0}20%{top:40px;left:360px;opacity:1}70%{top:130px;left:180px;opacity:1}to{top:160px;left:120px;opacity:0}}@-webkit-keyframes cloudRight-data-v-c095f994{0%{top:100px;left:500px;opacity:0}20%{top:120px;left:460px;opacity:1}80%{top:180px;left:340px;opacity:1}to{top:200px;left:300px;opacity:0}}@keyframes cloudRight-data-v-c095f994{0%{top:100px;left:500px;opacity:0}20%{top:120px;left:460px;opacity:1}80%{top:180px;left:340px;opacity:1}to{top:200px;left:300px;opacity:0}}.wscn-http404 .bullshit[data-v-c095f994]{position:relative;float:left;width:300px;padding:30px 0;overflow:hidden}.wscn-http404 .bullshit__oops[data-v-c095f994]{font-size:32px;line-height:40px;color:#1482f0;margin-bottom:20px;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.wscn-http404 .bullshit__headline[data-v-c095f994],.wscn-http404 .bullshit__oops[data-v-c095f994]{font-weight:700;opacity:0;-webkit-animation-name:slideUp-data-v-c095f994;animation-name:slideUp-data-v-c095f994;-webkit-animation-duration:.5s;animation-duration:.5s}.wscn-http404 .bullshit__headline[data-v-c095f994]{font-size:20px;line-height:24px;color:#222;margin-bottom:10px;-webkit-animation-delay:.1s;animation-delay:.1s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.wscn-http404 .bullshit__info[data-v-c095f994]{font-size:13px;line-height:21px;color:grey;margin-bottom:30px;-webkit-animation-delay:.2s;animation-delay:.2s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}.wscn-http404 .bullshit__info[data-v-c095f994],.wscn-http404 .bullshit__return-home[data-v-c095f994]{opacity:0;-webkit-animation-name:slideUp-data-v-c095f994;animation-name:slideUp-data-v-c095f994;-webkit-animation-duration:.5s;animation-duration:.5s}.wscn-http404 .bullshit__return-home[data-v-c095f994]{display:block;float:left;width:110px;height:36px;background:#1482f0;border-radius:100px;text-align:center;color:#fff;font-size:14px;line-height:36px;cursor:pointer;-webkit-animation-delay:.3s;animation-delay:.3s;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes slideUp-data-v-c095f994{0%{-webkit-transform:translateY(60px);transform:translateY(60px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}}@keyframes slideUp-data-v-c095f994{0%{-webkit-transform:translateY(60px);transform:translateY(60px);opacity:0}to{-webkit-transform:translateY(0);transform:translateY(0);opacity:1}} \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-510c5a69.5e48e29a.css b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-510c5a69.5e48e29a.css new file mode 100644 index 00000000..cbc88a37 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-510c5a69.5e48e29a.css @@ -0,0 +1 @@ +.custom-tree-node{-webkit-box-flex:1;-ms-flex:1;flex:1;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between;font-size:14px;padding-right:8px}.el-input.is-disabled .el-input__inner,.el-radio__input.is-disabled+span.el-radio__label{color:#909399}.limit-tip[data-v-385a3259]{cursor:pointer;margin-left:10px} \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-c3ce42fe.6b789903.css b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-c3ce42fe.6b789903.css new file mode 100644 index 00000000..9952df5c --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/css/chunk-c3ce42fe.6b789903.css @@ -0,0 +1 @@ +.dashboard-container[data-v-b4bd5162]{margin:30px}.dashboard-text[data-v-b4bd5162]{font-size:18px;line-height:46px} \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/app.872b3cd0.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/app.872b3cd0.js new file mode 100644 index 00000000..a51ffe01 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/app.872b3cd0.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["app"],{0:function(e,t,n){e.exports=n("56d7")},"0a7b":function(e,t,n){},"0cb8":function(e,t,n){},"186a":function(e,t,n){"use strict";var a=n("dc52"),i=n.n(a);i.a},"18f0":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-link",use:"icon-link-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},2536:function(e,t,n){},"2a3d":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-password",use:"icon-password-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},"30c3":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-example",use:"icon-example-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},"34c8":function(e,t,n){"use strict";var a=n("88a1"),i=n.n(a);i.a},"405a":function(e,t,n){"use strict";var a=n("4a83"),i=n.n(a);i.a},"47f1":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-table",use:"icon-table-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},"4a83":function(e,t,n){},"4df5":function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-eye",use:"icon-eye-usage",viewBox:"0 0 128 64",content:''});r.a.add(c);t["default"]=c},"50be":function(e,t,n){"use strict";var a=n("2536"),i=n.n(a);i.a},"51ff":function(e,t,n){var a={"./dashboard.svg":"f782","./example.svg":"30c3","./eye-open.svg":"d7ec","./eye.svg":"4df5","./form.svg":"eb1b","./link.svg":"18f0","./nested.svg":"dcf8","./password.svg":"2a3d","./table.svg":"47f1","./tree.svg":"93cd","./user.svg":"b3b5"};function i(e){var t=o(e);return n(t)}function o(e){var t=a[e];if(!(t+1)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t}i.keys=function(){return Object.keys(a)},i.resolve=o,e.exports=i,i.id="51ff"},"56d7":function(e,t,n){"use strict";n.r(t);n("cadf"),n("551c"),n("f751"),n("097d");var a=n("2b0e"),i=(n("f5df"),n("5c96")),o=n.n(i),r=(n("0fae"),n("f0d9")),c=n.n(r),s=(n("b20f"),function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{attrs:{id:"app"}},[n("router-view")],1)}),u=[],l={name:"App"},d=l,m=n("2877"),h=Object(m["a"])(d,s,u,!1,null,null,null),f=h.exports,p=n("2f62"),v=(n("7f7f"),{sidebar:function(e){return e.app.sidebar},device:function(e){return e.app.device},token:function(e){return e.user.token},avatar:function(e){return e.user.avatar},name:function(e){return e.user.name}}),b=v,g=n("a78e"),w=n.n(g),x={sidebar:{opened:!w.a.get("sidebarStatus")||!!+w.a.get("sidebarStatus"),withoutAnimation:!1},device:"desktop"},y={TOGGLE_SIDEBAR:function(e){e.sidebar.opened=!e.sidebar.opened,e.sidebar.withoutAnimation=!1,e.sidebar.opened?w.a.set("sidebarStatus",1):w.a.set("sidebarStatus",0)},CLOSE_SIDEBAR:function(e,t){w.a.set("sidebarStatus",0),e.sidebar.opened=!1,e.sidebar.withoutAnimation=t},TOGGLE_DEVICE:function(e,t){e.device=t}},k={toggleSideBar:function(e){var t=e.commit;t("TOGGLE_SIDEBAR")},closeSideBar:function(e,t){var n=e.commit,a=t.withoutAnimation;n("CLOSE_SIDEBAR",a)},toggleDevice:function(e,t){var n=e.commit;n("TOGGLE_DEVICE",t)}},_={namespaced:!0,state:x,mutations:y,actions:k},C=n("83d6"),O=n.n(C),S=O.a.showSettings,z=O.a.fixedHeader,B=O.a.sidebarLogo,H={showSettings:S,fixedHeader:z,sidebarLogo:B},M={CHANGE_SETTING:function(e,t){var n=t.key,a=t.value;e.hasOwnProperty(n)&&(e[n]=a)}},T={changeSetting:function(e,t){var n=e.commit;n("CHANGE_SETTING",t)}},E={namespaced:!0,state:H,mutations:M,actions:T},L=n("bc3a"),$=n.n(L),V=n("5f87"),A=$.a.create({baseURL:"/api",withCredentials:!0,timeout:5e3});A.interceptors.request.use(function(e){return bt.getters.token&&(e.headers["X-Token"]=Object(V["a"])()),e},function(e){return console.log(e),Promise.reject(e)}),A.interceptors.response.use(function(e){var t=e.data;return 2e4!==t.code?(Object(i["Message"])({message:t.message||"error",type:"error",duration:5e3}),50008!==t.code&&50012!==t.code&&50014!==t.code||i["MessageBox"].confirm("You have been logged out, you can cancel to stay on this page, or log in again","Confirm logout",{confirmButtonText:"Re-Login",cancelButtonText:"Cancel",type:"warning"}).then(function(){bt.dispatch("user/resetToken").then(function(){location.reload()})}),Promise.reject(t.message||"error")):t},function(e){return console.log("err"+e),Object(i["Message"])({message:e.message,type:"error",duration:5e3}),Promise.reject(e)});var j=A;function I(e){return j({url:"/user/login",method:"post",data:e})}function P(e){return j({url:"/user/info",method:"get",params:{token:e}})}function N(){return j({url:"/user/logout",method:"post"})}var D=n("8c4f"),R=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"app-wrapper",class:e.classObj},["mobile"===e.device&&e.sidebar.opened?n("div",{staticClass:"drawer-bg",on:{click:e.handleClickOutside}}):e._e(),e._v(" "),n("sidebar",{staticClass:"sidebar-container"}),e._v(" "),n("div",{staticClass:"main-container"},[n("div",{class:{"fixed-header":e.fixedHeader}},[n("navbar")],1),e._v(" "),n("app-main")],1)],1)},q=[],G=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"navbar"},[n("hamburger",{staticClass:"hamburger-container",attrs:{"is-active":e.sidebar.opened},on:{toggleClick:e.toggleSideBar}}),e._v(" "),n("breadcrumb",{staticClass:"breadcrumb-container"}),e._v(" "),n("div",{staticClass:"right-menu"},[n("el-button",{staticStyle:{"margin-right":"10px"},attrs:{type:"text"},on:{click:e.doLogout}},[e._v("退出")])],1)],1)},F=[],U=n("db72"),K=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("el-breadcrumb",{staticClass:"app-breadcrumb",attrs:{separator:"/"}},[n("transition-group",{attrs:{name:"breadcrumb"}},e._l(e.levelList,function(t,a){return n("el-breadcrumb-item",{key:t.path},["noRedirect"===t.redirect||a==e.levelList.length-1?n("span",{staticClass:"no-redirect"},[e._v(e._s(t.meta.title))]):n("a",{on:{click:function(n){return n.preventDefault(),e.handleLink(t)}}},[e._v(e._s(t.meta.title))])])}),1)],1)},W=[],J=n("bd11"),X=n.n(J),Y={data:function(){return{levelList:null}},watch:{$route:function(){this.getBreadcrumb()}},created:function(){this.getBreadcrumb()},methods:{getBreadcrumb:function(){var e=this.$route.matched.filter(function(e){return e.meta&&e.meta.title}),t=e[0];this.isDashboard(t)||(e=[{path:"/dashboard",meta:{title:"Dashboard"}}].concat(e)),this.levelList=e.filter(function(e){return e.meta&&e.meta.title&&!1!==e.meta.breadcrumb})},isDashboard:function(e){var t=e&&e.name;return!!t&&t.trim().toLocaleLowerCase()==="Dashboard".toLocaleLowerCase()},pathCompile:function(e){var t=this.$route.params,n=X.a.compile(e);return n(t)},handleLink:function(e){var t=e.redirect,n=e.path;t?this.$router.push(t):this.$router.push(this.pathCompile(n))}}},Q=Y,Z=(n("34c8"),Object(m["a"])(Q,K,W,!1,null,"62cc9144",null)),ee=Z.exports,te=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{padding:"0 15px"},on:{click:e.toggleClick}},[n("svg",{staticClass:"hamburger",class:{"is-active":e.isActive},attrs:{viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64"}},[n("path",{attrs:{d:"M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"}})])])},ne=[],ae={name:"Hamburger",props:{isActive:{type:Boolean,default:!1}},methods:{toggleClick:function(){this.$emit("toggleClick")}}},ie=ae,oe=(n("186a"),Object(m["a"])(ie,te,ne,!1,null,"49e15297",null)),re=oe.exports,ce={components:{Breadcrumb:ee,Hamburger:re},computed:Object(U["a"])({},Object(p["b"])(["sidebar","avatar"])),methods:{toggleSideBar:function(){this.$store.dispatch("app/toggleSideBar")},doLogout:function(){this.logout()}}},se=ce,ue=(n("405a"),Object(m["a"])(se,G,F,!1,null,"1eff5c58",null)),le=ue.exports,de=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{class:{"has-logo":e.showLogo}},[e.showLogo?n("logo",{attrs:{collapse:e.isCollapse}}):e._e(),e._v(" "),n("el-scrollbar",{attrs:{"wrap-class":"scrollbar-wrapper"}},[n("el-menu",{attrs:{"default-active":e.activeMenu,collapse:e.isCollapse,"background-color":e.variables.menuBg,"text-color":e.variables.menuText,"unique-opened":!1,"active-text-color":e.variables.menuActiveText,"collapse-transition":!1,mode:"vertical"}},e._l(e.routes,function(e){return n("sidebar-item",{key:e.path,attrs:{item:e,"base-path":e.path}})}),1)],1)],1)},me=[],he=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"sidebar-logo-container",class:{collapse:e.collapse}},[n("transition",{attrs:{name:"sidebarLogoFade"}},[e.collapse?n("router-link",{key:"collapse",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])]):n("router-link",{key:"expand",staticClass:"sidebar-logo-link",attrs:{to:"/"}},[e.logo?n("img",{staticClass:"sidebar-logo",attrs:{src:e.logo}}):e._e(),e._v(" "),n("h1",{staticClass:"sidebar-title"},[e._v(e._s(e.title)+" ")])])],1)],1)},fe=[],pe={name:"SidebarLogo",props:{collapse:{type:Boolean,required:!0}},data:function(){return{title:"SOP Admin",logo:"https://wpimg.wallstcn.com/69a1c46c-eb1c-4b46-8bd4-e9e686ef5251.png"}}},ve=pe,be=(n("7c27"),Object(m["a"])(ve,he,fe,!1,null,"b905289c",null)),ge=be.exports,we=function(){var e=this,t=e.$createElement,n=e._self._c||t;return e.item.hidden?e._e():n("div",{staticClass:"menu-wrapper"},[!e.hasOneShowingChild(e.item.children,e.item)||e.onlyOneChild.children&&!e.onlyOneChild.noShowingChildren||e.item.alwaysShow?n("el-submenu",{ref:"subMenu",attrs:{index:e.resolvePath(e.item.path),"popper-append-to-body":""}},[n("template",{slot:"title"},[e.item.meta?n("item",{attrs:{icon:e.item.meta&&e.item.meta.icon,title:e.item.meta.title}}):e._e()],1),e._v(" "),e._l(e.item.children,function(t){return n("sidebar-item",{key:t.path,staticClass:"nest-menu",attrs:{"is-nest":!0,item:t,"base-path":e.resolvePath(t.path)}})})],2):[e.onlyOneChild.meta?n("app-link",{attrs:{to:e.resolvePath(e.onlyOneChild.path)}},[n("el-menu-item",{class:{"submenu-title-noDropdown":!e.isNest},attrs:{index:e.resolvePath(e.onlyOneChild.path)}},[n("item",{attrs:{icon:e.onlyOneChild.meta.icon||e.item.meta&&e.item.meta.icon,title:e.onlyOneChild.meta.title}})],1)],1):e._e()]],2)},xe=[],ye=n("df7c"),ke=n.n(ye);function _e(e){return/^(https?:|mailto:|tel:)/.test(e)}var Ce,Oe,Se={name:"MenuItem",functional:!0,props:{icon:{type:String,default:""},title:{type:String,default:""}},render:function(e,t){var n=t.props,a=n.icon,i=n.title,o=[];return a&&o.push(e("svg-icon",{attrs:{"icon-class":a}})),i&&o.push(e("span",{slot:"title"},[i])),o}},ze=Se,Be=Object(m["a"])(ze,Ce,Oe,!1,null,null,null),He=Be.exports,Me=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("component",e._b({},"component",e.linkProps(e.to),!1),[e._t("default")],2)},Te=[],Ee={props:{to:{type:String,required:!0}},methods:{linkProps:function(e){return _e(e)?{is:"a",href:e,target:"_blank",rel:"noopener"}:{is:"router-link",to:e}}}},Le=Ee,$e=Object(m["a"])(Le,Me,Te,!1,null,null,null),Ve=$e.exports,Ae={computed:{device:function(){return this.$store.state.app.device}},mounted:function(){this.fixBugIniOS()},methods:{fixBugIniOS:function(){var e=this,t=this.$refs.subMenu;if(t){var n=t.handleMouseleave;t.handleMouseleave=function(t){"mobile"!==e.device&&n(t)}}}}},je={name:"SidebarItem",components:{Item:He,AppLink:Ve},mixins:[Ae],props:{item:{type:Object,required:!0},isNest:{type:Boolean,default:!1},basePath:{type:String,default:""}},data:function(){return this.onlyOneChild=null,{}},methods:{hasOneShowingChild:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1?arguments[1]:void 0,a=t.filter(function(t){return!t.hidden&&(e.onlyOneChild=t,!0)});return 1===a.length||0===a.length&&(this.onlyOneChild=Object(U["a"])({},n,{path:"",noShowingChildren:!0}),!0)},resolvePath:function(e){return _e(e)?e:_e(this.basePath)?this.basePath:ke.a.resolve(this.basePath,e)}}},Ie=je,Pe=Object(m["a"])(Ie,we,xe,!1,null,null,null),Ne=Pe.exports,De=n("cf1e"),Re=n.n(De),qe={components:{SidebarItem:Ne,Logo:ge},computed:Object(U["a"])({},Object(p["b"])(["sidebar"]),{routes:function(){return this.$router.options.routes},activeMenu:function(){var e=this.$route,t=e.meta,n=e.path;return t.activeMenu?t.activeMenu:n},showLogo:function(){return this.$store.state.settings.sidebarLogo},variables:function(){return Re.a},isCollapse:function(){return!this.sidebar.opened}})},Ge=qe,Fe=Object(m["a"])(Ge,de,me,!1,null,null,null),Ue=Fe.exports,Ke=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("section",{staticClass:"app-main"},[n("transition",{attrs:{name:"fade-transform",mode:"out-in"}},[n("router-view",{key:e.key})],1)],1)},We=[],Je={name:"AppMain",computed:{key:function(){return this.$route.fullPath}}},Xe=Je,Ye=(n("50be"),Object(m["a"])(Xe,Ke,We,!1,null,"43c24f68",null)),Qe=Ye.exports,Ze=document,et=Ze.body,tt=992,nt={watch:{$route:function(e){"mobile"===this.device&&this.sidebar.opened&&bt.dispatch("app/closeSideBar",{withoutAnimation:!1})}},beforeMount:function(){window.addEventListener("resize",this.$_resizeHandler)},beforeDestroy:function(){window.removeEventListener("resize",this.$_resizeHandler)},mounted:function(){var e=this.$_isMobile();e&&(bt.dispatch("app/toggleDevice","mobile"),bt.dispatch("app/closeSideBar",{withoutAnimation:!0}))},methods:{$_isMobile:function(){var e=et.getBoundingClientRect();return e.width-1'});r.a.add(c);t["default"]=c},"9f2b":function(e,t,n){"use strict";var a=n("bf90"),i=n.n(a);i.a},b20f:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409EFF",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},b3b5:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-user",use:"icon-user-usage",viewBox:"0 0 130 130",content:''});r.a.add(c);t["default"]=c},bf90:function(e,t,n){},cf1e:function(e,t,n){e.exports={menuText:"#bfcbd9",menuActiveText:"#409EFF",subMenuActiveText:"#f4f4f5",menuBg:"#304156",menuHover:"#263445",subMenuBg:"#1f2d3d",subMenuHover:"#001528",sideBarWidth:"210px"}},d7ec:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-eye-open",use:"icon-eye-open-usage",viewBox:"0 0 1024 1024",content:''});r.a.add(c);t["default"]=c},dc52:function(e,t,n){},dcf8:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-nested",use:"icon-nested-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},eb1b:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-form",use:"icon-form-usage",viewBox:"0 0 128 128",content:''});r.a.add(c);t["default"]=c},f782:function(e,t,n){"use strict";n.r(t);var a=n("e017"),i=n.n(a),o=n("21a1"),r=n.n(o),c=new i.a({id:"icon-dashboard",use:"icon-dashboard-usage",viewBox:"0 0 128 100",content:''});r.a.add(c);t["default"]=c}},[[0,"runtime","chunk-elementUI","chunk-libs"]]]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-25908fca.79487469.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-25908fca.79487469.js new file mode 100644 index 00000000..1c344aea --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-25908fca.79487469.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-25908fca"],{"021d":function(e,t,a){},"0bac":function(e,t,a){"use strict";var s=a("021d"),i=a.n(s);i.a},cb56:function(e,t,a){"use strict";a.r(t);var s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"app-container"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.searchFormData,size:"mini"}},[a("el-form-item",{attrs:{label:"appId"}},[a("el-input",{staticStyle:{width:"250px"},attrs:{clearable:!0,placeholder:"appId"},model:{value:e.searchFormData.appKey,callback:function(t){e.$set(e.searchFormData,"appKey",t)},expression:"searchFormData.appKey"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.onSearchTable}},[e._v("查询")])],1)],1),e._v(" "),a("el-button",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"primary",size:"mini",icon:"el-icon-plus"},on:{click:e.onAdd}},[e._v("新增ISV")]),e._v(" "),a("el-table",{attrs:{data:e.pageInfo.list,border:"",fit:"","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"id",label:"ID",width:"80"}}),e._v(" "),a("el-table-column",{attrs:{prop:"appKey",label:"appId",width:"250"}}),e._v(" "),a("el-table-column",{attrs:{prop:"",label:"秘钥",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.onShowKeys(t.row)}}},[e._v("查看")])]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"roleList",label:"角色",width:"100","show-overflow-tooltip":"true"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("div",{domProps:{innerHTML:e._s(e.roleRender(t.row))}})]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"status",label:"状态",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[1===t.row.status?a("span",{staticStyle:{color:"#67C23A"}},[e._v("已启用")]):e._e(),e._v(" "),2===t.row.status?a("span",{staticStyle:{color:"#F56C6C"}},[e._v("已禁用")]):e._e()]}}])}),e._v(" "),a("el-table-column",{attrs:{prop:"gmtCreate",label:"添加时间",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"gmtModified",label:"修改时间",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"remark",label:"备注",width:"120","show-overflow-tooltip":"true"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作",width:"150"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.onTableUpdate(t.row)}}},[e._v("修改")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.onKeysUpdate(t.row)}}},[e._v("秘钥管理")])]}}])})],1),e._v(" "),a("el-pagination",{staticStyle:{"margin-top":"5px"},attrs:{background:"","current-page":e.searchFormData.pageIndex,"page-size":e.searchFormData.pageSize,"page-sizes":[5,10,20,40],total:e.pageInfo.total,layout:"total, sizes, prev, pager, next"},on:{"size-change":e.onSizeChange,"current-change":e.onPageIndexChange}}),e._v(" "),a("el-dialog",{attrs:{title:e.isvDialogTitle,visible:e.isvDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.isvDialogVisible=t},close:e.onIsvDialogClose}},[a("el-form",{ref:"isvForm",attrs:{rules:e.rulesIsvForm,model:e.isvDialogFormData,"label-width":"120px",size:"mini"}},[a("el-form-item",{attrs:{label:"appId"}},[0===e.isvDialogFormData.id?a("span",{staticStyle:{color:"gray"}},[e._v("(系统自动生成)")]):a("span",[e._v(e._s(e.isvDialogFormData.appKey))])]),e._v(" "),a("el-form-item",{attrs:{label:"角色"}},[a("el-checkbox-group",{model:{value:e.isvDialogFormData.roleCode,callback:function(t){e.$set(e.isvDialogFormData,"roleCode",t)},expression:"isvDialogFormData.roleCode"}},e._l(e.roles,function(t){return a("el-checkbox",{key:t.roleCode,attrs:{label:t.roleCode}},[e._v(e._s(t.description))])}),1)],1),e._v(" "),a("el-form-item",{attrs:{label:"备注",prop:"remark"}},[a("el-input",{attrs:{type:"textarea"},model:{value:e.isvDialogFormData.remark,callback:function(t){e.$set(e.isvDialogFormData,"remark",t)},expression:"isvDialogFormData.remark"}})],1),e._v(" "),a("el-form-item",{attrs:{label:"状态"}},[a("el-radio-group",{model:{value:e.isvDialogFormData.status,callback:function(t){e.$set(e.isvDialogFormData,"status",t)},expression:"isvDialogFormData.status"}},[a("el-radio",{attrs:{label:1,name:"status"}},[e._v("启用")]),e._v(" "),a("el-radio",{attrs:{label:2,name:"status"}},[e._v("禁用")])],1)],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.isvDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary",disabled:e.isSaveButtonDisabled},on:{click:e.onIsvDialogSave}},[e._v("保 存")])],1)],1),e._v(" "),a("el-dialog",{attrs:{title:"秘钥信息",visible:e.isvKeysDialogVisible},on:{"update:visible":function(t){e.isvKeysDialogVisible=t},close:function(t){return e.resetForm("isvKeysFrom")}}},[a("el-form",{ref:"isvKeysFrom",staticClass:"key-view",attrs:{model:e.isvKeysFormData,"label-width":"160px",size:"mini"}},[a("el-form-item",{attrs:{label:""}},[a("el-alert",{attrs:{title:"带 ★ 的分配给开发者",type:"warning",closable:!1}})],1),e._v(" "),a("el-form-item",{attrs:{label:e.selfLabel("appId")}},[a("span",[e._v(e._s(e.isvKeysFormData.appKey))])]),e._v(" "),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.showKeys(),expression:"showKeys()"}],attrs:{label:"秘钥格式"}},[1===e.isvKeysFormData.keyFormat?a("span",[e._v("PKCS8(JAVA适用)")]):e._e(),e._v(" "),2===e.isvKeysFormData.keyFormat?a("span",[e._v("PKCS1(非JAVA适用)")]):e._e()]),e._v(" "),a("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.isvKeysFormData.signType,expression:"isvKeysFormData.signType === 2"}],attrs:{label:e.selfLabel("secret")}},[a("span",[e._v(e._s(e.isvKeysFormData.secret))])]),e._v(" "),a("fieldset",{directives:[{name:"show",rawName:"v-show",value:e.showKeys(),expression:"showKeys()"}]},[a("legend",[e._v("ISV公私钥")]),e._v(" "),a("el-form-item",{attrs:{label:"ISV公钥"}},[a("el-input",{attrs:{type:"textarea",readonly:""},model:{value:e.isvKeysFormData.publicKeyIsv,callback:function(t){e.$set(e.isvKeysFormData,"publicKeyIsv",t)},expression:"isvKeysFormData.publicKeyIsv"}})],1),e._v(" "),a("el-form-item",{attrs:{label:e.selfLabel("ISV私钥")}},[a("el-input",{attrs:{type:"textarea",readonly:""},model:{value:e.isvKeysFormData.privateKeyIsv,callback:function(t){e.$set(e.isvKeysFormData,"privateKeyIsv",t)},expression:"isvKeysFormData.privateKeyIsv"}})],1)],1),e._v(" "),a("fieldset",{directives:[{name:"show",rawName:"v-show",value:e.showKeys(),expression:"showKeys()"}]},[a("legend",[e._v("平台公私钥")]),e._v(" "),a("el-form-item",{attrs:{label:e.selfLabel("平台公钥")}},[a("el-input",{attrs:{type:"textarea",readonly:""},model:{value:e.isvKeysFormData.publicKeyPlatform,callback:function(t){e.$set(e.isvKeysFormData,"publicKeyPlatform",t)},expression:"isvKeysFormData.publicKeyPlatform"}})],1),e._v(" "),a("el-form-item",{attrs:{prop:"privateKeyPlatform",label:"平台私钥"}},[a("el-input",{attrs:{type:"textarea",readonly:""},model:{value:e.isvKeysFormData.privateKeyPlatform,callback:function(t){e.$set(e.isvKeysFormData,"privateKeyPlatform",t)},expression:"isvKeysFormData.privateKeyPlatform"}})],1)],1)],1),e._v(" "),a("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(t){e.isvKeysDialogVisible=!1}}},[e._v("关 闭")])],1)],1)],1)},i=[],o={data:function(){return{searchFormData:{appKey:"",pageIndex:1,pageSize:10},pageInfo:{list:[],total:0},roles:[],isvDialogVisible:!1,isvDialogTitle:"新增ISV",isvDialogFormData:{id:0,status:1,remark:"",roleCode:[]},rulesIsvForm:{remark:[{min:0,max:100,message:"长度在 1 到 100 个字符",trigger:"blur"}]},isSaveButtonDisabled:!1,isvKeysDialogVisible:!1,isvKeysFormData:{appKey:"",secret:"",publicKeyIsv:"",privateKeyIsv:"",publicKeyPlatform:"",privateKeyPlatform:"",signType:""}}},created:function(){this.loadTable(),this.loadRouteRole()},methods:{loadTable:function(){this.post("isv.info.page",this.searchFormData,function(e){this.pageInfo=e.data})},loadRouteRole:function(){0===this.roles.length&&this.post("role.listall",{},function(e){this.roles=e.data})},onShowKeys:function(e){this.post("isv.keys.get",{appKey:e.appKey},function(e){var t=this;this.isvKeysDialogVisible=!0,this.$nextTick(function(){Object.assign(t.isvKeysFormData,e.data)})})},onSearchTable:function(){this.loadTable()},onTableUpdate:function(e){var t=this;this.isvDialogTitle="修改ISV",this.isvDialogVisible=!0,this.$nextTick(function(){t.post("isv.info.get",{id:e.id},function(e){for(var t=e.data,a=t.roleList,s=[],i=0;i>2]|=t[i]<>6,h[o++]=128|63&s):s<55296||s>=57344?(h[o++]=224|s>>12,h[o++]=128|s>>6&63,h[o++]=128|63&s):(s=65536+((1023&s)<<10|1023&t.charCodeAt(++i)),h[o++]=240|s>>18,h[o++]=128|s>>12&63,h[o++]=128|s>>6&63,h[o++]=128|63&s);else for(o=this.start;i>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(a[o>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[e>>2]|=EXTRA[3&e],e>=56&&(this.hashed||this.hash(),t[0]=t[16],t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.bytes<<3,t[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var t,e,r,s,o,i,n=this.blocks;this.first?(t=n[0]-680876937,t=(t<<7|t>>>25)-271733879<<0,s=(-1732584194^2004318071&t)+n[1]-117830708,s=(s<<12|s>>>20)+t<<0,r=(-271733879^s&(-271733879^t))+n[2]-1126478375,r=(r<<17|r>>>15)+s<<0,e=(t^r&(s^t))+n[3]-1316259209,e=(e<<22|e>>>10)+r<<0):(t=this.h0,e=this.h1,r=this.h2,s=this.h3,t+=(s^e&(r^s))+n[0]-680876936,t=(t<<7|t>>>25)+e<<0,s+=(r^t&(e^r))+n[1]-389564586,s=(s<<12|s>>>20)+t<<0,r+=(e^s&(t^e))+n[2]+606105819,r=(r<<17|r>>>15)+s<<0,e+=(t^r&(s^t))+n[3]-1044525330,e=(e<<22|e>>>10)+r<<0),t+=(s^e&(r^s))+n[4]-176418897,t=(t<<7|t>>>25)+e<<0,s+=(r^t&(e^r))+n[5]+1200080426,s=(s<<12|s>>>20)+t<<0,r+=(e^s&(t^e))+n[6]-1473231341,r=(r<<17|r>>>15)+s<<0,e+=(t^r&(s^t))+n[7]-45705983,e=(e<<22|e>>>10)+r<<0,t+=(s^e&(r^s))+n[8]+1770035416,t=(t<<7|t>>>25)+e<<0,s+=(r^t&(e^r))+n[9]-1958414417,s=(s<<12|s>>>20)+t<<0,r+=(e^s&(t^e))+n[10]-42063,r=(r<<17|r>>>15)+s<<0,e+=(t^r&(s^t))+n[11]-1990404162,e=(e<<22|e>>>10)+r<<0,t+=(s^e&(r^s))+n[12]+1804603682,t=(t<<7|t>>>25)+e<<0,s+=(r^t&(e^r))+n[13]-40341101,s=(s<<12|s>>>20)+t<<0,r+=(e^s&(t^e))+n[14]-1502002290,r=(r<<17|r>>>15)+s<<0,e+=(t^r&(s^t))+n[15]+1236535329,e=(e<<22|e>>>10)+r<<0,t+=(r^s&(e^r))+n[1]-165796510,t=(t<<5|t>>>27)+e<<0,s+=(e^r&(t^e))+n[6]-1069501632,s=(s<<9|s>>>23)+t<<0,r+=(t^e&(s^t))+n[11]+643717713,r=(r<<14|r>>>18)+s<<0,e+=(s^t&(r^s))+n[0]-373897302,e=(e<<20|e>>>12)+r<<0,t+=(r^s&(e^r))+n[5]-701558691,t=(t<<5|t>>>27)+e<<0,s+=(e^r&(t^e))+n[10]+38016083,s=(s<<9|s>>>23)+t<<0,r+=(t^e&(s^t))+n[15]-660478335,r=(r<<14|r>>>18)+s<<0,e+=(s^t&(r^s))+n[4]-405537848,e=(e<<20|e>>>12)+r<<0,t+=(r^s&(e^r))+n[9]+568446438,t=(t<<5|t>>>27)+e<<0,s+=(e^r&(t^e))+n[14]-1019803690,s=(s<<9|s>>>23)+t<<0,r+=(t^e&(s^t))+n[3]-187363961,r=(r<<14|r>>>18)+s<<0,e+=(s^t&(r^s))+n[8]+1163531501,e=(e<<20|e>>>12)+r<<0,t+=(r^s&(e^r))+n[13]-1444681467,t=(t<<5|t>>>27)+e<<0,s+=(e^r&(t^e))+n[2]-51403784,s=(s<<9|s>>>23)+t<<0,r+=(t^e&(s^t))+n[7]+1735328473,r=(r<<14|r>>>18)+s<<0,e+=(s^t&(r^s))+n[12]-1926607734,e=(e<<20|e>>>12)+r<<0,o=e^r,t+=(o^s)+n[5]-378558,t=(t<<4|t>>>28)+e<<0,s+=(o^t)+n[8]-2022574463,s=(s<<11|s>>>21)+t<<0,i=s^t,r+=(i^e)+n[11]+1839030562,r=(r<<16|r>>>16)+s<<0,e+=(i^r)+n[14]-35309556,e=(e<<23|e>>>9)+r<<0,o=e^r,t+=(o^s)+n[1]-1530992060,t=(t<<4|t>>>28)+e<<0,s+=(o^t)+n[4]+1272893353,s=(s<<11|s>>>21)+t<<0,i=s^t,r+=(i^e)+n[7]-155497632,r=(r<<16|r>>>16)+s<<0,e+=(i^r)+n[10]-1094730640,e=(e<<23|e>>>9)+r<<0,o=e^r,t+=(o^s)+n[13]+681279174,t=(t<<4|t>>>28)+e<<0,s+=(o^t)+n[0]-358537222,s=(s<<11|s>>>21)+t<<0,i=s^t,r+=(i^e)+n[3]-722521979,r=(r<<16|r>>>16)+s<<0,e+=(i^r)+n[6]+76029189,e=(e<<23|e>>>9)+r<<0,o=e^r,t+=(o^s)+n[9]-640364487,t=(t<<4|t>>>28)+e<<0,s+=(o^t)+n[12]-421815835,s=(s<<11|s>>>21)+t<<0,i=s^t,r+=(i^e)+n[15]+530742520,r=(r<<16|r>>>16)+s<<0,e+=(i^r)+n[2]-995338651,e=(e<<23|e>>>9)+r<<0,t+=(r^(e|~s))+n[0]-198630844,t=(t<<6|t>>>26)+e<<0,s+=(e^(t|~r))+n[7]+1126891415,s=(s<<10|s>>>22)+t<<0,r+=(t^(s|~e))+n[14]-1416354905,r=(r<<15|r>>>17)+s<<0,e+=(s^(r|~t))+n[5]-57434055,e=(e<<21|e>>>11)+r<<0,t+=(r^(e|~s))+n[12]+1700485571,t=(t<<6|t>>>26)+e<<0,s+=(e^(t|~r))+n[3]-1894986606,s=(s<<10|s>>>22)+t<<0,r+=(t^(s|~e))+n[10]-1051523,r=(r<<15|r>>>17)+s<<0,e+=(s^(r|~t))+n[1]-2054922799,e=(e<<21|e>>>11)+r<<0,t+=(r^(e|~s))+n[8]+1873313359,t=(t<<6|t>>>26)+e<<0,s+=(e^(t|~r))+n[15]-30611744,s=(s<<10|s>>>22)+t<<0,r+=(t^(s|~e))+n[6]-1560198380,r=(r<<15|r>>>17)+s<<0,e+=(s^(r|~t))+n[13]+1309151649,e=(e<<21|e>>>11)+r<<0,t+=(r^(e|~s))+n[4]-145523070,t=(t<<6|t>>>26)+e<<0,s+=(e^(t|~r))+n[11]-1120210379,s=(s<<10|s>>>22)+t<<0,r+=(t^(s|~e))+n[2]+718787259,r=(r<<15|r>>>17)+s<<0,e+=(s^(r|~t))+n[9]-343485551,e=(e<<21|e>>>11)+r<<0,this.first?(this.h0=t+1732584193<<0,this.h1=e-271733879<<0,this.h2=r-1732584194<<0,this.h3=s+271733878<<0,this.first=!1):(this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+r<<0,this.h3=this.h3+s<<0)},Md5.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,s=this.h3;return HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,s=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&e,e>>8&255,e>>16&255,e>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&s,s>>8&255,s>>16&255,s>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(16),e=new Uint32Array(t);return e[0]=this.h0,e[1]=this.h1,e[2]=this.h2,e[3]=this.h3,t},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var t,e,r,s="",o=this.array(),i=0;i<15;)t=o[i++],e=o[i++],r=o[i++],s+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[63&(t<<4|e>>>4)]+BASE64_ENCODE_CHAR[63&(e<<2|r>>>6)]+BASE64_ENCODE_CHAR[63&r];return t=o[i],s+=BASE64_ENCODE_CHAR[t>>>2]+BASE64_ENCODE_CHAR[t<<4&63]+"==",s};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module),void 0===__WEBPACK_AMD_DEFINE_RESULT__||(module.exports=__WEBPACK_AMD_DEFINE_RESULT__)))})()}).call(this,__webpack_require__("4362"),__webpack_require__("c8ba"))},"9ed6":function(t,e,r){"use strict";r.r(e);var s=function(){var t=this,e=t.$createElement,r=t._self._c||e;return r("div",{staticClass:"login-container"},[r("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:t.loginForm,rules:t.loginRules,"auto-complete":"on","label-position":"left"}},[r("div",{staticClass:"title-container"},[r("h3",{staticClass:"title"},[t._v("SOP Admin")])]),t._v(" "),r("el-form-item",{attrs:{prop:"username"}},[r("span",{staticClass:"svg-container"},[r("svg-icon",{attrs:{"icon-class":"user"}})],1),t._v(" "),r("el-input",{ref:"username",attrs:{placeholder:"用户名",name:"username",type:"text",tabindex:"1","auto-complete":"on"},model:{value:t.loginForm.username,callback:function(e){t.$set(t.loginForm,"username",e)},expression:"loginForm.username"}})],1),t._v(" "),r("el-form-item",{attrs:{prop:"password"}},[r("span",{staticClass:"svg-container"},[r("svg-icon",{attrs:{"icon-class":"password"}})],1),t._v(" "),r("el-input",{key:t.passwordType,ref:"password",attrs:{type:t.passwordType,placeholder:"密码",name:"password",tabindex:"2","auto-complete":"on"},nativeOn:{keyup:function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleLogin(e)}},model:{value:t.loginForm.password,callback:function(e){t.$set(t.loginForm,"password",e)},expression:"loginForm.password"}}),t._v(" "),r("span",{staticClass:"show-pwd",on:{click:t.showPwd}},[r("svg-icon",{attrs:{"icon-class":"password"===t.passwordType?"eye":"eye-open"}})],1)],1),t._v(" "),r("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:t.loading,type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.handleLogin(e)}}},[t._v("登 录")])],1)],1)},o=[],i=r("8237"),n=r.n(i),a=r("5f87"),h={name:"Login",data:function(){var t=function(t,e,r){0===e.length?r(new Error("请输入用户名")):r()},e=function(t,e,r){0===e.length?r(new Error("请输入密码")):e.length<6?r(new Error("请密码长度不得小于6位")):r()};return{loginForm:{username:"",password:""},loginRules:{username:[{required:!0,trigger:"blur",validator:t}],password:[{required:!0,trigger:"blur",validator:e}]},loading:!1,passwordType:"password",redirect:void 0}},watch:{$route:{handler:function(t){this.redirect=t.query&&t.query.redirect},immediate:!0}},methods:{showPwd:function(){var t=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick(function(){t.$refs.password.focus()})},handleLogin:function(){var t=this;this.$refs.loginForm.validate(function(e){if(e){var r=t.loginForm,s=r.password;s=n()(s);var o={username:r.username,password:s};t.post("nologin.admin.login",o,function(t){Object(a["c"])(t.data),this.$router.push({path:this.redirect||"/"})})}})}}},c=h,u=(r("2017"),r("d982"),r("2877")),f=Object(u["a"])(c,s,o,!1,null,"0204d890",null);e["default"]=f.exports},b12d:function(t,e,r){},d982:function(t,e,r){"use strict";var s=r("7e12"),o=r.n(s);o.a}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-2d2085ef.2e46d1f4.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-2d2085ef.2e46d1f4.js new file mode 100644 index 00000000..1d85106c --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-2d2085ef.2e46d1f4.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d2085ef"],{a505:function(e,o,a){"use strict";a.r(o);var t=function(){var e=this,o=e.$createElement,a=e._self._c||o;return a("div",{staticClass:"app-container"},[a("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:e.searchFormData,size:"mini"}},[a("el-form-item",{attrs:{label:"角色码"}},[a("el-input",{staticStyle:{width:"250px"},attrs:{clearable:!0,placeholder:"输入角色码"},model:{value:e.searchFormData.roleCode,callback:function(o){e.$set(e.searchFormData,"roleCode",o)},expression:"searchFormData.roleCode"}})],1),e._v(" "),a("el-form-item",[a("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:e.loadTable}},[e._v("查询")])],1)],1),e._v(" "),a("el-button",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"primary",size:"mini",icon:"el-icon-plus"},on:{click:e.onAdd}},[e._v("新增角色")]),e._v(" "),a("el-table",{attrs:{data:e.pageInfo.rows,border:"","highlight-current-row":""}},[a("el-table-column",{attrs:{prop:"roleCode",label:"角色码",width:"200"}}),e._v(" "),a("el-table-column",{attrs:{prop:"description",label:"角色描述",width:"200"}}),e._v(" "),a("el-table-column",{attrs:{prop:"gmtCreate",label:"添加时间",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{prop:"gmtModified",label:"修改时间",width:"160"}}),e._v(" "),a("el-table-column",{attrs:{label:"操作",width:"150"},scopedSlots:e._u([{key:"default",fn:function(o){return[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.onTableUpdate(o.row)}}},[e._v("修改")]),e._v(" "),a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.onTableDelete(o.row)}}},[e._v("删除")])]}}])})],1),e._v(" "),a("el-pagination",{staticStyle:{"margin-top":"5px"},attrs:{background:"","current-page":e.searchFormData.pageIndex,"page-size":e.searchFormData.pageSize,"page-sizes":[5,10,20,40],total:e.pageInfo.total,layout:"total, sizes, prev, pager, next"},on:{"size-change":e.onSizeChange,"current-change":e.onPageIndexChange}}),e._v(" "),a("el-dialog",{attrs:{title:e.roleDialogTitle,visible:e.roleDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(o){e.roleDialogVisible=o},close:function(o){return e.resetForm("roleForm")}}},[a("el-form",{ref:"roleForm",attrs:{rules:e.roleDialogFormRules,model:e.roleDialogFormData,"label-width":"120px",size:"mini"}},[a("el-form-item",{attrs:{prop:"roleCode",label:"角色码"}},[a("el-input",{directives:[{name:"show",rawName:"v-show",value:0===e.roleDialogFormData.id,expression:"roleDialogFormData.id === 0"}],model:{value:e.roleDialogFormData.roleCode,callback:function(o){e.$set(e.roleDialogFormData,"roleCode",o)},expression:"roleDialogFormData.roleCode"}}),e._v(" "),a("span",{directives:[{name:"show",rawName:"v-show",value:e.roleDialogFormData.id>0,expression:"roleDialogFormData.id > 0"}]},[e._v(e._s(e.roleDialogFormData.roleCode))])],1),e._v(" "),a("el-form-item",{attrs:{prop:"description",label:"角色描述"}},[a("el-input",{model:{value:e.roleDialogFormData.description,callback:function(o){e.$set(e.roleDialogFormData,"description",o)},expression:"roleDialogFormData.description"}})],1)],1),e._v(" "),a("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[a("el-button",{on:{click:function(o){e.roleDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),a("el-button",{attrs:{type:"primary"},on:{click:e.onRoleDialogSave}},[e._v("保 存")])],1)],1)],1)},l=[],i={data:function(){return{searchFormData:{roleCode:"",pageIndex:1,pageSize:10},pageInfo:{rows:[],total:0},roleDialogVisible:!1,roleDialogTitle:"",roleDialogFormData:{id:0,roleCode:"",description:""},roleDialogFormRules:{roleCode:[{required:!0,message:"不能为空",trigger:"blur"},{min:1,max:64,message:"长度在 1 到 64 个字符",trigger:"blur"}],description:[{max:64,message:"不能超过 64 个字符",trigger:"blur"}]}}},created:function(){this.loadTable()},methods:{loadTable:function(){this.post("role.page",this.searchFormData,function(e){this.pageInfo=e.data})},onTableUpdate:function(e){var o=this;this.roleDialogTitle="修改角色",this.roleDialogVisible=!0,this.$nextTick(function(){Object.assign(o.roleDialogFormData,e)})},onTableDelete:function(e){this.confirm("确认要删除角色【".concat(e.roleCode,"】吗?"),function(o){var a={id:e.id};this.post("role.del",a,function(){o(),this.tip("删除成功"),this.loadTable()})})},onRoleDialogSave:function(){var e=this;this.$refs.roleForm.validate(function(o){if(o){var a=e.roleDialogFormData.id?"role.update":"role.add";e.post(a,e.roleDialogFormData,function(){this.roleDialogVisible=!1,this.loadTable()})}})},onSizeChange:function(e){this.searchFormData.pageSize=e,this.loadTable()},onAdd:function(){this.roleDialogTitle="新增角色",this.roleDialogVisible=!0,this.roleDialogFormData.id=0},onPageIndexChange:function(e){this.searchFormData.pageIndex=e,this.loadTable()}}},r=i,n=a("2877"),s=Object(n["a"])(r,t,l,!1,null,null,null);o["default"]=s.exports}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-2d221c34.0db10350.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-2d221c34.0db10350.js new file mode 100644 index 00000000..379d4bc1 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-2d221c34.0db10350.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d221c34"],{cc75:function(a,t,e){"use strict";e.r(t);var i=function(){var a=this,t=a.$createElement,e=a._self._c||t;return e("div",{staticClass:"app-container"},[e("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:a.searchFormData,size:"mini"}},[e("el-form-item",{attrs:{label:"IP"}},[e("el-input",{staticStyle:{width:"250px"},attrs:{clearable:!0,placeholder:"输入IP"},model:{value:a.searchFormData.ip,callback:function(t){a.$set(a.searchFormData,"ip",t)},expression:"searchFormData.ip"}})],1),a._v(" "),e("el-form-item",[e("el-button",{attrs:{type:"primary",icon:"el-icon-search"},on:{click:a.loadTable}},[a._v("查询")])],1)],1),a._v(" "),e("el-button",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"primary",size:"mini",icon:"el-icon-plus"},on:{click:a.onAdd}},[a._v("新增IP")]),a._v(" "),e("el-table",{attrs:{data:a.pageInfo.rows,border:"","highlight-current-row":""}},[e("el-table-column",{attrs:{prop:"ip",label:"IP",width:"200"}}),a._v(" "),e("el-table-column",{attrs:{prop:"remark",label:"备注",width:"300"}}),a._v(" "),e("el-table-column",{attrs:{prop:"gmtCreate",label:"添加时间",width:"160"}}),a._v(" "),e("el-table-column",{attrs:{prop:"gmtModified",label:"修改时间",width:"160"}}),a._v(" "),e("el-table-column",{attrs:{label:"操作",width:"150"},scopedSlots:a._u([{key:"default",fn:function(t){return[e("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(e){return a.onTableUpdate(t.row)}}},[a._v("修改")]),a._v(" "),e("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(e){return a.onTableDelete(t.row)}}},[a._v("删除")])]}}])})],1),a._v(" "),e("el-pagination",{staticStyle:{"margin-top":"5px"},attrs:{background:"","current-page":a.searchFormData.pageIndex,"page-size":a.searchFormData.pageSize,"page-sizes":[5,10,20,40],total:a.pageInfo.total,layout:"total, sizes, prev, pager, next"},on:{"size-change":a.onSizeChange,"current-change":a.onPageIndexChange}}),a._v(" "),e("el-dialog",{attrs:{title:a.dialogTitle,visible:a.dialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){a.dialogVisible=t},close:function(t){return a.resetForm("dialogForm")}}},[e("el-form",{ref:"dialogForm",attrs:{rules:a.dialogFormRules,model:a.dialogFormData,"label-width":"120px",size:"mini"}},[e("el-form-item",{attrs:{prop:"ip",label:"IP"}},[e("el-input",{directives:[{name:"show",rawName:"v-show",value:0===a.dialogFormData.id,expression:"dialogFormData.id === 0"}],model:{value:a.dialogFormData.ip,callback:function(t){a.$set(a.dialogFormData,"ip",t)},expression:"dialogFormData.ip"}}),a._v(" "),e("span",{directives:[{name:"show",rawName:"v-show",value:a.dialogFormData.id>0,expression:"dialogFormData.id > 0"}]},[a._v(a._s(a.dialogFormData.ip))])],1),a._v(" "),e("el-form-item",{attrs:{prop:"remark",label:"备注"}},[e("el-input",{model:{value:a.dialogFormData.remark,callback:function(t){a.$set(a.dialogFormData,"remark",t)},expression:"dialogFormData.remark"}})],1)],1),a._v(" "),e("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[e("el-button",{on:{click:function(t){a.dialogVisible=!1}}},[a._v("取 消")]),a._v(" "),e("el-button",{attrs:{type:"primary"},on:{click:a.onDialogSave}},[a._v("保 存")])],1)],1)],1)},o=[],l={data:function(){var a=/^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/,t=function(t,e,i){""===e?i(new Error("请输入IP")):(a.test(e)||i(new Error("IP格式不正确")),i())};return{searchFormData:{ip:"",pageIndex:1,pageSize:10},pageInfo:{rows:[],total:0},dialogVisible:!1,dialogTitle:"",dialogFormData:{id:0,ip:"",remark:""},dialogFormRules:{ip:[{validator:t,trigger:"blur"},{min:1,max:64,message:"长度在 1 到 64 个字符",trigger:"blur"}],remark:[{max:100,message:"不能超过 100 个字符",trigger:"blur"}]}}},created:function(){this.loadTable()},methods:{loadTable:function(){this.post("ip.blacklist.page",this.searchFormData,function(a){this.pageInfo=a.data})},onTableUpdate:function(a){var t=this;this.dialogTitle="修改IP",this.dialogVisible=!0,this.$nextTick(function(){Object.assign(t.dialogFormData,a)})},onTableDelete:function(a){this.confirm("确认要移除IP【".concat(a.ip,"】吗?"),function(t){var e={id:a.id};this.post("ip.blacklist.del",e,function(){t(),this.tip("删除成功"),this.loadTable()})})},onDialogSave:function(){var a=this;this.$refs.dialogForm.validate(function(t){if(t){var e=a.dialogFormData.id?"ip.blacklist.update":"ip.blacklist.add";a.post(e,a.dialogFormData,function(){this.dialogVisible=!1,this.loadTable()})}})},onSizeChange:function(a){this.searchFormData.pageSize=a,this.loadTable()},onAdd:function(){this.dialogTitle="新增IP",this.dialogVisible=!0,this.dialogFormData.id=0},onPageIndexChange:function(a){this.searchFormData.pageIndex=a,this.loadTable()}}},r=l,n=e("2877"),s=Object(n["a"])(r,i,o,!1,null,null,null);t["default"]=s.exports}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-4de1c2b6.0188bd8f.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-4de1c2b6.0188bd8f.js new file mode 100644 index 00000000..7ac4d783 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-4de1c2b6.0188bd8f.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-4de1c2b6"],{"26fc":function(t,s,a){t.exports=a.p+"static/img/404_cloud.0f4bc32b.png"},"8cdb":function(t,s,a){"use strict";a.r(s);var e=function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"wscn-http404-container"},[a("div",{staticClass:"wscn-http404"},[t._m(0),t._v(" "),a("div",{staticClass:"bullshit"},[a("div",{staticClass:"bullshit__oops"},[t._v("OOPS!")]),t._v(" "),t._m(1),t._v(" "),a("div",{staticClass:"bullshit__headline"},[t._v(t._s(t.message))]),t._v(" "),a("div",{staticClass:"bullshit__info"},[t._v("Please check that the URL you entered is correct, or click the button below to return to the homepage.")]),t._v(" "),a("a",{staticClass:"bullshit__return-home",attrs:{href:""}},[t._v("Back to home")])])])])},c=[function(){var t=this,s=t.$createElement,e=t._self._c||s;return e("div",{staticClass:"pic-404"},[e("img",{staticClass:"pic-404__parent",attrs:{src:a("a36b"),alt:"404"}}),t._v(" "),e("img",{staticClass:"pic-404__child left",attrs:{src:a("26fc"),alt:"404"}}),t._v(" "),e("img",{staticClass:"pic-404__child mid",attrs:{src:a("26fc"),alt:"404"}}),t._v(" "),e("img",{staticClass:"pic-404__child right",attrs:{src:a("26fc"),alt:"404"}})])},function(){var t=this,s=t.$createElement,a=t._self._c||s;return a("div",{staticClass:"bullshit__info"},[t._v("All rights reserved\n "),a("a",{staticStyle:{color:"#20a0ff"},attrs:{href:"https://wallstreetcn.com",target:"_blank"}},[t._v("wallstreetcn")])])}],i={name:"Page404",computed:{message:function(){return"The webmaster said that you can not enter this page..."}}},l=i,n=(a("97ef"),a("2877")),r=Object(n["a"])(l,e,c,!1,null,"c095f994",null);s["default"]=r.exports},"97ef":function(t,s,a){"use strict";var e=a("d3f45"),c=a.n(e);c.a},a36b:function(t,s,a){t.exports=a.p+"static/img/404.a57b6f31.png"},d3f45:function(t,s,a){}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-510c5a69.c3dd05bb.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-510c5a69.c3dd05bb.js new file mode 100644 index 00000000..eb2ece0d --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-510c5a69.c3dd05bb.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-510c5a69"],{"0a49":function(e,t,i){var a=i("9b43"),l=i("626a"),o=i("4bf8"),r=i("9def"),n=i("cd1c");e.exports=function(e,t){var i=1==e,s=2==e,c=3==e,m=4==e,p=6==e,u=5==e||p,d=t||n;return function(t,n,g){for(var f,h,D=o(t),v=l(D),y=a(n,g,3),b=r(v.length),k=0,x=i?d(t,b):s?d(t,0):void 0;b>k;k++)if((u||k in v)&&(f=v[k],h=y(f,k,D),e))if(i)x[k]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return k;case 2:x.push(f)}else if(m)return!1;return p?-1:c||m?m:x}}},1169:function(e,t,i){var a=i("2d95");e.exports=Array.isArray||function(e){return"Array"==a(e)}},2735:function(e,t,i){"use strict";i.r(t);var a=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-container",[i("el-aside",{staticStyle:{"min-height":"300px",width:"250px"}},[i("el-input",{staticStyle:{"margin-bottom":"20px"},attrs:{"prefix-icon":"el-icon-search",placeholder:"搜索服务...",size:"mini",clearable:""},model:{value:e.filterText,callback:function(t){e.filterText=t},expression:"filterText"}}),e._v(" "),i("el-tree",{ref:"tree2",staticClass:"filter-tree",attrs:{data:e.treeData,props:e.defaultProps,"filter-node-method":e.filterNode,"highlight-current":!0,"expand-on-click-node":!1,"empty-text":"无数据","node-key":"id","default-expand-all":""},on:{"node-click":e.onNodeClick},scopedSlots:e._u([{key:"default",fn:function(t){t.node;var a=t.data;return i("span",{staticClass:"custom-tree-node"},[i("div",[i("el-tooltip",{directives:[{name:"show",rawName:"v-show",value:a.custom,expression:"data.custom"}],staticClass:"item",attrs:{content:"自定义服务",effect:"light",placement:"left"}},[i("i",{staticClass:"el-icon-warning-outline"})]),e._v(" "),a.label.lengthsubCode:"+e.limitCode),t.push("
subMsg:"+e.limitMsg)):2===e.limitType&&t.push("令牌桶容量:"+e.tokenBucketCount),t.join("")},onLimitDialogSave:function(){var e=this;this.$refs["limitDialogForm"].validate(function(t){if(t){e.cleanCheckboxData(),e.limitDialogFormData.serviceId=e.serviceId;var i=e.limitDialogFormData.id?"config.limit.update":"config.limit.add";e.post(i,e.limitDialogFormData,function(e){this.limitDialogVisible=!1,this.loadTable()})}})},cleanCheckboxData:function(){this.checkTypeKey(1)||(this.limitDialogFormData.routeId=""),this.checkTypeKey(2)||(this.limitDialogFormData.appKey=""),this.checkTypeKey(3)||(this.limitDialogFormData.limitIp="")},onLimitTypeTipClick:function(){var e="窗口策略:每秒处理固定数量的请求,超出请求数量返回错误信息。",t="令牌桶策略:每秒放置固定数量的令牌数,每个请求进来后先去拿令牌,拿到了令牌才能继续,拿不到则等候令牌重新生成了再拿。",i=e+"
"+t;this.$alert(i,"限流策略",{dangerouslyUseHTMLString:!0})},onSizeChange:function(e){this.searchFormData.pageSize=e,this.loadTable()},onPageIndexChange:function(e){this.searchFormData.pageIndex=e,this.loadTable()},checkTypeKey:function(e){return this.limitDialogFormData.typeKey.find(function(t,i,a){return t===e})},isWindowType:function(){return 1===this.limitDialogFormData.limitType},isTokenType:function(){return 2===this.limitDialogFormData.limitType},limitRender:function(e){var t=[],i=[];return e.routeId&&(i.push(e.routeId),t.push("路由ID")),e.appKey&&(i.push(e.appKey),t.push("AppKey")),e.limitIp&&(i.push(e.limitIp),t.push("IP")),i.join(" + ")+"
("+t.join(" + ")+")"}}}),r=o,n=(i("fbea"),i("6682"),i("2877")),s=Object(n["a"])(r,a,l,!1,null,"385a3259",null);t["default"]=s.exports},6682:function(e,t,i){"use strict";var a=i("738c"),l=i.n(a);l.a},6886:function(e,t,i){},"738c":function(e,t,i){},7514:function(e,t,i){"use strict";var a=i("5ca1"),l=i("0a49")(5),o="find",r=!0;o in[]&&Array(1)[o](function(){r=!1}),a(a.P+a.F*r,"Array",{find:function(e){return l(this,e,arguments.length>1?arguments[1]:void 0)}}),i("9c6c")(o)},cd1c:function(e,t,i){var a=i("e853");e.exports=function(e,t){return new(a(e))(t)}},e853:function(e,t,i){var a=i("d3f4"),l=i("1169"),o=i("2b4c")("species");e.exports=function(e){var t;return l(e)&&(t=e.constructor,"function"!=typeof t||t!==Array&&!l(t.prototype)||(t=void 0),a(t)&&(t=t[o],null===t&&(t=void 0))),void 0===t?Array:t}},fbea:function(e,t,i){"use strict";var a=i("6886"),l=i.n(a);l.a}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-6f78c9fe.bec8af48.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-6f78c9fe.bec8af48.js new file mode 100644 index 00000000..c8511867 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-6f78c9fe.bec8af48.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-6f78c9fe"],{"02f4":function(t,e,n){var r=n("4588"),i=n("be13");t.exports=function(t){return function(e,n){var o,a,l=String(i(e)),c=r(n),s=l.length;return c<0||c>=s?t?"":void 0:(o=l.charCodeAt(c),o<55296||o>56319||c+1===s||(a=l.charCodeAt(c+1))<56320||a>57343?t?l.charAt(c):o:t?l.slice(c,c+2):a-56320+(o-55296<<10)+65536)}}},"0390":function(t,e,n){"use strict";var r=n("02f4")(!0);t.exports=function(t,e,n){return e+(n?r(t,e).length:1)}},"0a49":function(t,e,n){var r=n("9b43"),i=n("626a"),o=n("4bf8"),a=n("9def"),l=n("cd1c");t.exports=function(t,e){var n=1==t,c=2==t,s=3==t,u=4==t,f=6==t,d=5==t||f,v=e||l;return function(e,l,p){for(var g,h,b=o(e),m=i(b),D=r(l,p,3),x=a(m.length),y=0,_=n?v(e,x):c?v(e,0):void 0;x>y;y++)if((d||y in m)&&(g=m[y],h=D(g,y,b),t))if(n)_[y]=h;else if(h)switch(t){case 3:return!0;case 5:return g;case 6:return y;case 2:_.push(g)}else if(u)return!1;return f?-1:s||u?u:_}}},"0bfb":function(t,e,n){"use strict";var r=n("cb7c");t.exports=function(){var t=r(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},1169:function(t,e,n){var r=n("2d95");t.exports=Array.isArray||function(t){return"Array"==r(t)}},"20d6":function(t,e,n){"use strict";var r=n("5ca1"),i=n("0a49")(6),o="findIndex",a=!0;o in[]&&Array(1)[o](function(){a=!1}),r(r.P+r.F*a,"Array",{findIndex:function(t){return i(this,t,arguments.length>1?arguments[1]:void 0)}}),n("9c6c")(o)},"214f":function(t,e,n){"use strict";n("b0c5");var r=n("2aba"),i=n("32e9"),o=n("79e5"),a=n("be13"),l=n("2b4c"),c=n("520a"),s=l("species"),u=!o(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}),f=function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();t.exports=function(t,e,n){var d=l(t),v=!o(function(){var e={};return e[d]=function(){return 7},7!=""[t](e)}),p=v?!o(function(){var e=!1,n=/a/;return n.exec=function(){return e=!0,null},"split"===t&&(n.constructor={},n.constructor[s]=function(){return n}),n[d](""),!e}):void 0;if(!v||!p||"replace"===t&&!u||"split"===t&&!f){var g=/./[d],h=n(a,d,""[t],function(t,e,n,r,i){return e.exec===c?v&&!i?{done:!0,value:g.call(e,n,r)}:{done:!0,value:t.call(n,e,r)}:{done:!1}}),b=h[0],m=h[1];r(String.prototype,t,b),i(RegExp.prototype,d,2==e?function(t,e){return m.call(t,this,e)}:function(t){return m.call(t,this)})}}},"520a":function(t,e,n){"use strict";var r=n("0bfb"),i=RegExp.prototype.exec,o=String.prototype.replace,a=i,l="lastIndex",c=function(){var t=/a/,e=/b*/g;return i.call(t,"a"),i.call(e,"a"),0!==t[l]||0!==e[l]}(),s=void 0!==/()??/.exec("")[1],u=c||s;u&&(a=function(t){var e,n,a,u,f=this;return s&&(n=new RegExp("^"+f.source+"$(?!\\s)",r.call(f))),c&&(e=f[l]),a=i.call(f,t),c&&a&&(f[l]=f.global?a.index+a[0].length:e),s&&a&&a.length>1&&o.call(a[0],n,function(){for(u=1;u]*>)/g,v=/\$([$&`']|\d\d?)/g,p=function(t){return void 0===t?t:String(t)};n("214f")("replace",2,function(t,e,n,g){return[function(r,i){var o=t(this),a=void 0==r?void 0:r[e];return void 0!==a?a.call(r,o,i):n.call(String(o),r,i)},function(t,e){var i=g(n,t,this,e);if(i.done)return i.value;var f=r(t),d=String(this),v="function"===typeof e;v||(e=String(e));var b=f.global;if(b){var m=f.unicode;f.lastIndex=0}var D=[];while(1){var x=c(f,d);if(null===x)break;if(D.push(x),!b)break;var y=String(x[0]);""===y&&(f.lastIndex=l(d,o(f.lastIndex),m))}for(var _="",w=0,I=0;I=w&&(_+=d.slice(w,k)+L,w=k+S.length)}return _+d.slice(w)}];function h(t,e,r,o,a,l){var c=r+t.length,s=o.length,u=v;return void 0!==a&&(a=i(a),u=d),n.call(l,u,function(n,i){var l;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,r);case"'":return e.slice(c);case"<":l=a[i.slice(1,-1)];break;default:var u=+i;if(0===u)return n;if(u>s){var d=f(u/10);return 0===d?n:d<=s?void 0===o[d-1]?i.charAt(1):o[d-1]+i.charAt(1):n}l=o[u-1]}return void 0===l?"":l})}})},b0c5:function(t,e,n){"use strict";var r=n("520a");n("5ca1")({target:"RegExp",proto:!0,forced:r!==/./.exec},{exec:r})},cd1c:function(t,e,n){var r=n("e853");t.exports=function(t,e){return new(r(t))(e)}},e75e:function(t,e,n){"use strict";n.r(e);var r=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("el-form",{staticClass:"demo-form-inline",attrs:{inline:!0,model:t.searchFormData,size:"mini"}},[n("el-form-item",[n("el-button",{attrs:{type:"primary",icon:"el-icon-plus"},on:{click:t.onAddServer}},[t._v("添加监控服务器")])],1)],1),t._v(" "),n("el-table",{staticStyle:{width:"100%","margin-bottom":"20px"},attrs:{data:t.tableData,border:"","default-expand-all":!0,"row-key":"treeId","empty-text":"请添加监控服务器"}},[n("el-table-column",{attrs:{prop:"monitorName",label:"网关实例",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){return[0===e.row.parentId?n("span",[t._v(t._s(e.row.monitorName))]):t._e()]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"serviceId",label:"serviceId",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[e.row.parentId>0?n("span",[t._v(t._s(e.row.serviceId))]):t._e()]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"name",label:"接口名 (版本号)",width:"200"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v("\n "+t._s(e.row.name+(e.row.version?" ("+e.row.version+")":""))+"\n ")]}}])}),t._v(" "),n("el-table-column",{attrs:{prop:"count",label:"出错次数",width:"100"}}),t._v(" "),n("el-table-column",{attrs:{prop:"errorMsg",label:"报错信息",width:"300"},scopedSlots:t._u([{key:"default",fn:function(e){return e.row.parentId>0?[n("div",{staticStyle:{display:"inline-block"},domProps:{innerHTML:t._s(t.showErrorMsg(e.row))}}),t._v(" "),n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return t.onShowErrorDetail(e.row)}}},[t._v("详情")])]:void 0}}],null,!0)}),t._v(" "),n("el-table-column",{attrs:{label:"操作",width:"180"},scopedSlots:t._u([{key:"default",fn:function(e){return[0===e.row.parentId&&e.row.children?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return t.onClearLog(e.row)}}},[t._v("清空日志")]):t._e(),t._v(" "),0===e.row.parentId?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return t.onDelete(e.row)}}},[t._v("删除实例")]):t._e()]}}])})],1),t._v(" "),n("el-dialog",{attrs:{title:"选择服务器实例",visible:t.logDialogInstanceVisible,"close-on-click-modal":!1},on:{"update:visible":function(e){t.logDialogInstanceVisible=e}}},[n("el-form",{ref:"logDialogForm",attrs:{model:t.logDialogFormData,rules:t.rulesLog,"label-width":"150px",size:"mini"}},[n("el-form-item",[n("p",{staticStyle:{color:"#878787"}},[t._v("只能选择网关实例,其它实例不支持")])]),t._v(" "),n("el-form-item",{attrs:{prop:"instanceData",label:"服务器实例"}},[n("el-select",{staticStyle:{width:"400px"},attrs:{"value-key":"id"},model:{value:t.logDialogFormData.instanceData,callback:function(e){t.$set(t.logDialogFormData,"instanceData",e)},expression:"logDialogFormData.instanceData"}},t._l(t.serviceData,function(e){return n("el-option",{key:e.id,attrs:{label:e.serviceId+"("+e.ipPort+")",value:e,disabled:t.isOptionDisabled(e)}},[n("span",{staticStyle:{float:"left"}},[t._v(t._s(e.serviceId)+" "),t.isOptionDisabled(e)?n("span",[t._v("(已添加)")]):t._e()]),t._v(" "),n("span",{staticStyle:{float:"right",color:"#8492a6","font-size":"13px"}},[t._v(t._s(e.ipPort))])])}),1)],1)],1),t._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(e){t.logDialogInstanceVisible=!1}}},[t._v("取 消")]),t._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:t.onLogDialogSave}},[t._v("保 存")])],1)],1),t._v(" "),n("el-dialog",{attrs:{title:"错误详情",visible:t.logDetailVisible,width:"60%"},on:{"update:visible":function(e){t.logDetailVisible=e}}},[n("div",{staticStyle:{"overflow-x":"auto"},domProps:{innerHTML:t._s(t.errorMsgDetail)}}),t._v(" "),n("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{attrs:{type:"primary"},on:{click:function(e){t.logDetailVisible=!1}}},[t._v("关 闭")])],1)])],1)},i=[],o=(n("a481"),n("ac6a"),n("20d6"),{data:function(){return{searchFormData:{},tableData:[],serviceData:[],addedInstanceList:[],logDialogFormData:{instanceData:null},logDialogInstanceVisible:!1,logDetailVisible:!1,rulesLog:{instanceData:[{required:!0,message:"不能为空",trigger:"blur"}]},errorMsgDetail:""}},created:function(){this.loadServiceInstance(),this.loadTable()},methods:{loadServiceInstance:function(){this.post("service.instance.list",{},function(t){this.serviceData=t.data.filter(function(t){return t.instanceId&&t.instanceId.length>0})}),this.post("monitor.instance.list",{},function(t){this.addedInstanceList=t.data})},loadTable:function(){this.post("monitor.log.list",{},function(t){this.tableData=this.buildTreeData(t.data)})},isOptionDisabled:function(t){var e=t.ipPort,n=this.addedInstanceList.findIndex(function(t,n,r){return t===e});return n>-1},buildTreeData:function(t){return t.forEach(function(e){var n=e.parentId;0===n||t.forEach(function(t){if(t.treeId===n){var r=t.children;r||(r=[]),r.push(e),t.children=r}})}),t=t.filter(function(t){return 0===t.parentId}),t},showErrorMsg:function(t){var e=t.errorMsg.replace(/\/g,"");return e.substring(0,30)+"..."},onAddServer:function(){this.logDialogInstanceVisible=!0},onDelete:function(t){this.confirm("确定要删除实例【"+t.monitorName+"】吗?",function(e){this.post("monitor.instance.del",{id:t.rawId},function(t){e(),this.tip("删除成功"),this.loadTable()})})},onClearLog:function(t){this.confirm("确定要清空日志吗?",function(e){this.post("monitor.log.clear",{id:t.rawId},function(t){e(),this.tip("清空成功"),this.loadTable()})})},onShowErrorDetail:function(t){this.errorMsgDetail=t.errorMsg,this.logDetailVisible=!0},onLogDialogSave:function(){var t=this;this.$refs["logDialogForm"].validate(function(e){if(e){var n=t.logDialogFormData.instanceData;t.post("monitor.instance.add",n,function(t){this.logDialogInstanceVisible=!1,this.loadTable()})}})}}}),a=o,l=n("2877"),c=Object(l["a"])(a,r,i,!1,null,null,null);e["default"]=c.exports},e853:function(t,e,n){var r=n("d3f4"),i=n("1169"),o=n("2b4c")("species");t.exports=function(t){var e;return i(t)&&(e=t.constructor,"function"!=typeof e||e!==Array&&!i(e.prototype)||(e=void 0),r(e)&&(e=e[o],null===e&&(e=void 0))),void 0===e?Array:e}}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-73b2dcec.a99ece5c.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-73b2dcec.a99ece5c.js new file mode 100644 index 00000000..b3ef66f0 --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-73b2dcec.a99ece5c.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-73b2dcec"],{"29fd":function(e,t,s){},"3bf7":function(e,t,s){"use strict";s.r(t);var a=function(){var e=this,t=e.$createElement,s=e._self._c||t;return s("div",{staticClass:"app-container"},[s("el-button",{staticClass:"el-icon-back",attrs:{type:"text"},on:{click:e.onBack}},[e._v("返回")]),e._v(" "),s("el-form",{ref:"isvKeysForm",staticStyle:{width:"700px"},attrs:{rules:e.rulesIsvKeysForm,model:e.isvKeysFormData,"label-width":"160px",size:"mini"}},[s("el-form-item",{attrs:{label:""}},[s("el-alert",{attrs:{title:"带 ★ 的分配给开发者",type:"warning",closable:!1}})],1),e._v(" "),s("el-form-item",{attrs:{label:e.selfLabel("appId")}},[s("div",[e._v(e._s(e.isvKeysFormData.appKey))])]),e._v(" "),s("el-form-item",{directives:[{name:"show",rawName:"v-show",value:e.showKeys(),expression:"showKeys()"}],attrs:{label:"秘钥格式"}},[s("el-radio-group",{model:{value:e.isvKeysFormData.keyFormat,callback:function(t){e.$set(e.isvKeysFormData,"keyFormat",t)},expression:"isvKeysFormData.keyFormat"}},[s("el-radio",{attrs:{label:1,name:"keyFormat"}},[e._v("PKCS8(JAVA适用)")]),e._v(" "),s("el-radio",{attrs:{label:2,name:"keyFormat"}},[e._v("PKCS1(非JAVA适用)")])],1)],1),e._v(" "),s("el-form-item",{directives:[{name:"show",rawName:"v-show",value:2===e.isvKeysFormData.signType,expression:"isvKeysFormData.signType === 2"}],attrs:{prop:"secret",label:e.selfLabel("secret")}},[s("el-input",{model:{value:e.isvKeysFormData.secret,callback:function(t){e.$set(e.isvKeysFormData,"secret",t)},expression:"isvKeysFormData.secret"}}),e._v(" "),s("el-button",{attrs:{type:"text"},on:{click:e.onGenSecret}},[e._v("重新生成")])],1),e._v(" "),s("fieldset",{directives:[{name:"show",rawName:"v-show",value:e.showKeys(),expression:"showKeys()"}]},[s("legend",[e._v("ISV公私钥")]),e._v(" "),s("el-form-item",{staticClass:"gen-key"},[s("el-button",{attrs:{type:"text"},on:{click:e.onGenKeysIsv}},[e._v("重新生成")])],1),e._v(" "),s("el-form-item",{attrs:{prop:"publicKeyIsv",label:"ISV公钥"}},[s("el-input",{attrs:{type:"textarea"},model:{value:e.isvKeysFormData.publicKeyIsv,callback:function(t){e.$set(e.isvKeysFormData,"publicKeyIsv",t)},expression:"isvKeysFormData.publicKeyIsv"}})],1),e._v(" "),s("el-form-item",{attrs:{prop:"privateKeyIsv",label:e.selfLabel("ISV私钥")}},[s("el-input",{attrs:{type:"textarea"},model:{value:e.isvKeysFormData.privateKeyIsv,callback:function(t){e.$set(e.isvKeysFormData,"privateKeyIsv",t)},expression:"isvKeysFormData.privateKeyIsv"}})],1)],1),e._v(" "),s("fieldset",{directives:[{name:"show",rawName:"v-show",value:e.showKeys(),expression:"showKeys()"}]},[s("legend",[e._v("平台公私钥")]),e._v(" "),s("el-form-item",{staticClass:"gen-key"},[s("el-button",{attrs:{type:"text"},on:{click:e.onGenKeysPlatform}},[e._v("重新生成")])],1),e._v(" "),s("el-form-item",{attrs:{prop:"publicKeyPlatform",label:e.selfLabel("平台公钥")}},[s("el-input",{attrs:{type:"textarea"},model:{value:e.isvKeysFormData.publicKeyPlatform,callback:function(t){e.$set(e.isvKeysFormData,"publicKeyPlatform",t)},expression:"isvKeysFormData.publicKeyPlatform"}})],1),e._v(" "),s("el-form-item",{attrs:{prop:"privateKeyPlatform",label:"平台私钥"}},[s("el-input",{attrs:{type:"textarea"},model:{value:e.isvKeysFormData.privateKeyPlatform,callback:function(t){e.$set(e.isvKeysFormData,"privateKeyPlatform",t)},expression:"isvKeysFormData.privateKeyPlatform"}})],1)],1),e._v(" "),s("el-form-item",[s("el-button",{attrs:{type:"primary"},on:{click:e.onSubmit}},[e._v("保存")]),e._v(" "),s("el-button",{on:{click:e.onBack}},[e._v("取消")])],1)],1)],1)},i=[],r={data:function(){var e=this,t=function(t,s,a){2===e.isvKeysFormData.signType&&(""===s&&a(new Error("不能为空")),s.length>200&&a(new Error("长度不能超过200"))),a()},s=function(t,s,a){1===e.isvKeysFormData.signType&&""===s&&a(new Error("不能为空")),a()};return{isvKeysFormData:{appKey:"",secret:"",keyFormat:1,publicKeyIsv:"",privateKeyIsv:"",publicKeyPlatform:"",privateKeyPlatform:"",signType:1},rulesIsvKeysForm:{secret:[{validator:t,trigger:"blur"}],publicKeyIsv:[{validator:s,trigger:"blur"}],privateKeyIsv:[{validator:s,trigger:"blur"}]}}},created:function(){var e=this.$route.query;this.isvKeysFormData.appKey=e.appKey,this.loadForm()},methods:{loadForm:function(){this.post("isv.keys.get",{appKey:this.isvKeysFormData.appKey},function(e){Object.assign(this.isvKeysFormData,e.data)})},selfLabel:function(e){return"★ "+e},onSubmit:function(){var e=this;this.$refs.isvKeysForm.validate(function(t){t&&e.post("isv.keys.update",e.isvKeysFormData,function(){this.tip("保存成功")})})},onBack:function(){this.$router.push({path:"list"})},onGenKeysPlatform:function(){this.post("isv.keys.gen",{},function(e){this.tip("生成公私钥成功");var t=e.data;this.isvKeysFormData.publicKeyPlatform=t.publicKey,this.isvKeysFormData.privateKeyPlatform=t.privateKey})},onGenKeysIsv:function(){this.post("isv.keys.gen",{keyFormat:this.isvKeysFormData.keyFormat},function(e){this.tip("生成公私钥成功");var t=e.data;this.isvKeysFormData.publicKeyIsv=t.publicKey,this.isvKeysFormData.privateKeyIsv=t.privateKey})},onGenSecret:function(){this.post("isv.secret.gen",{},function(e){this.isvKeysFormData.secret=e.data})},showKeys:function(){return 1===this.isvKeysFormData.signType}}},o=r,l=(s("8b91"),s("2877")),n=Object(l["a"])(o,a,i,!1,null,null,null);t["default"]=n.exports},"8b91":function(e,t,s){"use strict";var a=s("29fd"),i=s.n(a);i.a}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9b31c83a.9f4ebfeb.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9b31c83a.9f4ebfeb.js new file mode 100644 index 00000000..4ec6d16c --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9b31c83a.9f4ebfeb.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9b31c83a"],{"048e":function(e,t,i){},"0ce7":function(e,t,i){"use strict";var o=i("048e"),a=i.n(o);a.a},"5f67":function(e,t,i){"use strict";i.r(t);var o=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"app-container"},[i("el-container",[i("el-aside",{staticStyle:{"min-height":"300px",width:"250px"}},[i("el-button",{staticStyle:{display:"none"},attrs:{type:"primary",plain:"",size:"mini",icon:"el-icon-plus"},on:{click:function(t){return t.stopPropagation(),e.addService(t)}}},[e._v("\n 新建服务\n ")]),e._v(" "),i("el-input",{staticStyle:{"margin-bottom":"10px","margin-top":"10px"},attrs:{"prefix-icon":"el-icon-search",placeholder:"搜索服务...",size:"mini",clearable:""},model:{value:e.filterText,callback:function(t){e.filterText=t},expression:"filterText"}}),e._v(" "),i("el-tree",{ref:"serviceTree",staticClass:"filter-tree",attrs:{data:e.treeData,props:e.defaultProps,"filter-node-method":e.filterNode,"highlight-current":!0,"expand-on-click-node":!1,"empty-text":"无数据","node-key":"serviceId","default-expand-all":""},on:{"node-click":e.onNodeClick},scopedSlots:e._u([{key:"default",fn:function(t){t.node;var o=t.data;return i("span",{staticClass:"custom-tree-node"},[i("div",[i("el-tooltip",{directives:[{name:"show",rawName:"v-show",value:o.custom,expression:"data.custom"}],staticClass:"item",attrs:{content:"自定义服务",effect:"light",placement:"left"}},[i("i",{staticClass:"el-icon-warning-outline"})]),e._v(" "),o.label.length0?t.join(", "):'未授权'},onRouteDialogSave:function(){var e=this;this.$refs.routeDialogFormRef.validate(function(t){if(t){var i=e.routeDialogFormData.id?"route.update":"route.add";e.routeDialogFormData.serviceId=e.serviceId,e.post(i,e.routeDialogFormData,function(){this.routeDialogVisible=!1,this.loadTable()})}})},onAuthDialogSave:function(){this.post("route.role.update",this.authDialogFormData,function(){this.authDialogVisible=!1,this.loadTable()})},addService:function(){this.addServiceDialogVisible=!0},closeAddServiceDlg:function(){this.$refs.addServiceForm.resetFields()},onAddService:function(){var e=this;this.$refs.addServiceForm.validate(function(t){t&&e.post("service.custom.add",e.addServiceForm,function(e){this.addServiceDialogVisible=!1,this.tip("添加成功"),this.loadTree()})})},onDelService:function(e){var t=e.serviceId;this.confirm("确认要删除服务"+t+"吗,【对应的路由配置会一起删除】",function(e){var i={serviceId:t};this.post("service.custom.del",i,function(){e(),this.tip("删除成功"),this.loadTree()})})}}},l=r,s=(i("0ce7"),i("2877")),n=Object(s["a"])(l,o,a,!1,null,null,null);t["default"]=n.exports}}]); \ No newline at end of file diff --git a/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.6b795525.js b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.6b795525.js new file mode 100644 index 00000000..8095a6ce --- /dev/null +++ b/sop-admin/sop-admin-server/src/main/resources/public/static/js/chunk-9f479afe.6b795525.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-9f479afe"],{"02f4":function(e,t,n){var r=n("4588"),o=n("be13");e.exports=function(e){return function(t,n){var i,a,s=String(o(t)),l=r(n),c=s.length;return l<0||l>=c?e?"":void 0:(i=s.charCodeAt(l),i<55296||i>56319||l+1===c||(a=s.charCodeAt(l+1))<56320||a>57343?e?s.charAt(l):i:e?s.slice(l,l+2):a-56320+(i-55296<<10)+65536)}}},"0390":function(e,t,n){"use strict";var r=n("02f4")(!0);e.exports=function(e,t,n){return t+(n?r(e,t).length:1)}},"0bfb":function(e,t,n){"use strict";var r=n("cb7c");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"214f":function(e,t,n){"use strict";n("b0c5");var r=n("2aba"),o=n("32e9"),i=n("79e5"),a=n("be13"),s=n("2b4c"),l=n("520a"),c=s("species"),u=!i(function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$")}),f=function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2===n.length&&"a"===n[0]&&"b"===n[1]}();e.exports=function(e,t,n){var d=s(e),v=!i(function(){var t={};return t[d]=function(){return 7},7!=""[e](t)}),p=v?!i(function(){var t=!1,n=/a/;return n.exec=function(){return t=!0,null},"split"===e&&(n.constructor={},n.constructor[c]=function(){return n}),n[d](""),!t}):void 0;if(!v||!p||"replace"===e&&!u||"split"===e&&!f){var g=/./[d],y=n(a,d,""[e],function(e,t,n,r,o){return t.exec===l?v&&!o?{done:!0,value:g.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),h=y[0],m=y[1];r(String.prototype,e,h),o(RegExp.prototype,d,2==t?function(e,t){return m.call(e,this,t)}:function(e){return m.call(e,this)})}}},"28a5":function(e,t,n){"use strict";var r=n("aae3"),o=n("cb7c"),i=n("ebd6"),a=n("0390"),s=n("9def"),l=n("5f1b"),c=n("520a"),u=n("79e5"),f=Math.min,d=[].push,v="split",p="length",g="lastIndex",y=4294967295,h=!u(function(){RegExp(y,"y")});n("214f")("split",2,function(e,t,n,u){var m;return m="c"=="abbc"[v](/(b)*/)[1]||4!="test"[v](/(?:)/,-1)[p]||2!="ab"[v](/(?:ab)*/)[p]||4!="."[v](/(.?)(.?)/)[p]||"."[v](/()()/)[p]>1||""[v](/.?/)[p]?function(e,t){var o=String(this);if(void 0===e&&0===t)return[];if(!r(e))return n.call(o,e,t);var i,a,s,l=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),f=0,v=void 0===t?y:t>>>0,h=new RegExp(e.source,u+"g");while(i=c.call(h,o)){if(a=h[g],a>f&&(l.push(o.slice(f,i.index)),i[p]>1&&i.index=v))break;h[g]===i.index&&h[g]++}return f===o[p]?!s&&h.test("")||l.push(""):l.push(o.slice(f)),l[p]>v?l.slice(0,v):l}:"0"[v](void 0,0)[p]?function(e,t){return void 0===e&&0===t?[]:n.call(this,e,t)}:n,[function(n,r){var o=e(this),i=void 0==n?void 0:n[t];return void 0!==i?i.call(n,o,r):m.call(String(o),n,r)},function(e,t){var r=u(m,e,this,t,m!==n);if(r.done)return r.value;var c=o(e),d=String(this),v=i(c,RegExp),p=c.unicode,g=(c.ignoreCase?"i":"")+(c.multiline?"m":"")+(c.unicode?"u":"")+(h?"y":"g"),b=new v(h?c:"^(?:"+c.source+")",g),_=void 0===t?y:t>>>0;if(0===_)return[];if(0===d.length)return null===l(b,d)?[d]:[];var w=0,x=0,I=[];while(x1&&i.call(a[0],n,function(){for(u=1;u0&&"pre"===t.row.metadata.env?n("el-tag",{attrs:{type:"warning"}},[e._v("预发布")]):e._e(),e._v(" "),t.row.parentId>0&&"gray"===t.row.metadata.env?n("el-tag",{attrs:{type:"info"}},[e._v("灰度")]):e._e(),e._v(" "),t.row.parentId>0&&!t.row.metadata.env?n("el-tag",{attrs:{type:"success"}},[e._v("线上")]):e._e()],1):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"metadata",label:"metadata",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0?n("span",[e._v(e._s(JSON.stringify(t.row.metadata)))]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"status",label:"服务状态",width:"100"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.parentId>0&&"UP"===t.row.status?n("el-tag",{attrs:{type:"success"}},[e._v("正常")]):e._e(),e._v(" "),t.row.parentId>0&&"STARTING"===t.row.status?n("el-tag",{attrs:{type:"info"}},[e._v("正在启动")]):e._e(),e._v(" "),t.row.parentId>0&&"UNKNOWN"===t.row.status?n("el-tag",[e._v("未知")]):e._e(),e._v(" "),t.row.parentId>0&&("OUT_OF_SERVICE"===t.row.status||"DOWN"===t.row.status)?n("el-tag",{attrs:{type:"danger"}},[e._v("已禁用")]):e._e()]}}])}),e._v(" "),n("el-table-column",{attrs:{prop:"updateTime",label:"最后更新时间",width:"160"}}),e._v(" "),n("el-table-column",{attrs:{label:"操作",width:"250"},scopedSlots:e._u([{key:"default",fn:function(t){return[0===t.row.parentId?n("div",[n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onGrayConfigUpdate(t.row)}}},[e._v("设置灰度参数")])],1):e._e(),e._v(" "),t.row.parentId>0?n("div",["UP"===t.row.status?n("span",["pre"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreClose(t.row)}}},[e._v("结束预发布")]):e._e(),e._v(" "),"gray"===t.row.metadata.env?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayClose(t.row)}}},[e._v("结束灰度")]):e._e(),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvPreOpen(t.row)}}},[e._v("开启预发布")]),e._v(" "),t.row.metadata.env?e._e():n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnvGrayOpen(t.row)}}},[e._v("开启灰度")])],1):e._e(),e._v(" "),n("span",{staticStyle:{"margin-left":"10px"}},["UP"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onDisable(t.row)}}},[e._v("禁用")]):e._e(),e._v(" "),"OUT_OF_SERVICE"===t.row.status?n("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(n){return e.onEnable(t.row)}}},[e._v("启用")]):e._e()],1)]):e._e()]}}])})],1),e._v(" "),n("el-dialog",{attrs:{title:"灰度设置",visible:e.grayDialogVisible,"close-on-click-modal":!1},on:{"update:visible":function(t){e.grayDialogVisible=t},close:function(t){return e.resetForm("grayForm")}}},[n("el-form",{ref:"grayForm",attrs:{model:e.grayForm,rules:e.grayFormRules,size:"mini"}},[n("el-form-item",{attrs:{label:"serviceId"}},[e._v("\n "+e._s(e.grayForm.serviceId)+"\n ")]),e._v(" "),n("el-tabs",{attrs:{type:"card"},model:{value:e.tabsActiveName,callback:function(t){e.tabsActiveName=t},expression:"tabsActiveName"}},[n("el-tab-pane",{attrs:{label:"灰度用户",name:"first"}},[n("el-alert",{staticStyle:{"margin-bottom":"20px"},attrs:{title:"可以是appId,或userId,多个用英文逗号隔开",type:"info",closable:!1}}),e._v(" "),n("el-form-item",{attrs:{prop:"userKeyContent"}},[n("el-input",{attrs:{placeholder:"可以是appId,或userId,多个用英文逗号隔开",type:"textarea",rows:6},model:{value:e.grayForm.userKeyContent,callback:function(t){e.$set(e.grayForm,"userKeyContent",t)},expression:"grayForm.userKeyContent"}})],1)],1),e._v(" "),n("el-tab-pane",{attrs:{label:"接口配置",name:"second"}},[n("el-form-item",[n("el-button",{attrs:{type:"text"},on:{click:e.addNameVersion}},[e._v("新增灰度接口")])],1),e._v(" "),n("table",{attrs:{cellpadding:"0",cellspacing:"0"}},e._l(e.grayForm.grayRouteConfigList,function(t,r){return n("tr",{key:t.key},[n("td",[n("el-form-item",{key:t.key,attrs:{prop:"grayRouteConfigList."+r+".oldRouteId",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 老接口:\n "),n("el-select",{staticStyle:{"margin-right":"10px"},on:{change:function(n){return e.onChangeOldRoute(t)}},model:{value:t.oldRouteId,callback:function(n){e.$set(t,"oldRouteId",n)},expression:"grayRouteConfig.oldRouteId"}},e._l(e.routeList,function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.id}})}),1)],1)],1),e._v(" "),n("td",[n("el-form-item",{key:t.key+1,attrs:{prop:"grayRouteConfigList."+r+".newVersion",rules:{required:!0,message:"不能为空",trigger:["blur","change"]}}},[e._v("\n 灰度接口:\n "),n("el-select",{attrs:{"no-data-text":"无数据"},model:{value:t.newVersion,callback:function(n){e.$set(t,"newVersion",n)},expression:"grayRouteConfig.newVersion"}},e._l(e.getGraySelectData(t.oldRouteId),function(e){return n("el-option",{key:e.id,attrs:{label:e.name+"("+e.version+")",value:e.version}})}),1)],1)],1),e._v(" "),n("td",{staticStyle:{"vertical-align":"baseline"}},[n("el-button",{directives:[{name:"show",rawName:"v-show",value:e.grayForm.grayRouteConfigList.length>1,expression:"grayForm.grayRouteConfigList.length > 1"}],attrs:{type:"text"},on:{click:function(n){return n.preventDefault(),e.removeNameVersion(t)}}},[e._v("删除")])],1)])}),0)],1)],1)],1),e._v(" "),n("span",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[n("el-button",{on:{click:function(t){e.grayDialogVisible=!1}}},[e._v("取 消")]),e._v(" "),n("el-button",{attrs:{type:"primary"},on:{click:e.onGrayConfigSave}},[e._v("确 定")])],1)],1)],1)},o=[],i=(n("28a5"),n("ac6a"),n("7f7f"),{data:function(){var e=/^\S+(,\S+)*$/,t=function(t,n,r){""===n?r(new Error("不能为空")):(e.test(n)||r(new Error("格式不正确")),r())};return{searchFormData:{serviceId:""},grayDialogVisible:!1,grayForm:{serviceId:"",userKeyContent:"",onlyUpdateGrayUserkey:!1,grayRouteConfigList:[]},tabsActiveName:"first",routeList:[],selectNameVersion:[],grayFormRules:{userKeyContent:[{required:!0,message:"不能为空",trigger:"blur"},{validator:t,trigger:"blur"}]},tableData:[]}},created:function(){this.loadTable()},methods:{loadTable:function(){this.post("service.instance.list",this.searchFormData,function(e){this.tableData=this.buildTreeData(e.data)})},loadRouteList:function(e){this.post("route.list/1.2",{serviceId:e.toLowerCase()},function(e){this.routeList=e.data})},getGraySelectData:function(e){return this.routeList.filter(function(t){return e!==t.id&&e.indexOf(t.name)>-1})},buildTreeData:function(e){return e.forEach(function(t){var n=t.parentId;0===n||e.forEach(function(e){if(e.id===n){var r=e.children;r||(r=[]),r.push(t),e.children=r}})}),e=e.filter(function(e){return 0===e.parentId}),e},onSearchTable:function(){this.loadTable()},onDisable:function(e){this.confirm("确定要禁用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.offline",e,function(){this.tip("禁用成功"),t(),this.loadTableDelay()})})},onEnable:function(e){this.confirm("确定要启用 ".concat(e.serviceId,"(").concat(e.ipPort,") 吗?"),function(t){this.post("service.instance.online",e,function(){this.tip("启用成功"),t(),this.loadTableDelay()})})},doEnvOnline:function(e,t){this.post("service.instance.env.online",e,function(){t&&t.call(this)})},onEnvPreOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.post("service.instance.env.pre.open",e,function(){this.tip("预发布成功"),t(),this.loadTableDelay()})})},onEnvPreClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 预发布吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onEnvGrayOpen:function(e){this.confirm("确定要开启 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.post("service.instance.env.gray.open",e,function(){this.tip("开启成功"),t(),this.loadTableDelay()})})},onEnvGrayClose:function(e){this.confirm("确定要结束 ".concat(e.serviceId,"(").concat(e.ipPort,") 灰度吗?"),function(t){this.doEnvOnline(e,function(){this.tip("操作成功"),t(),this.loadTableDelay()})})},onGrayConfigUpdate:function(e){var t=e.serviceId;this.loadRouteList(t),this.post("service.gray.config.get",{serviceId:t},function(e){var n=this;this.grayDialogVisible=!0,this.$nextTick(function(){var r=e.data;Object.assign(n.grayForm,{serviceId:t,userKeyContent:r.userKeyContent||"",grayRouteConfigList:n.createGrayRouteConfigList(r.nameVersionContent)})})})},onGrayConfigSave:function(){var e=this;this.$refs.grayForm.validate(function(t){if(t){for(var n=[],r=e.grayForm.grayRouteConfigList,o=0;o0&&(this.timeoutPending=setTimeout(function(){e.showPopper=!1},this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(e){!1===e&&clearTimeout(this.timeoutPending),this.expectedState=e},getFirstElement:function(){var e=this.$slots.default;if(!Array.isArray(e))return null;for(var t=null,i=0;il&&(e.scrollTop=a-e.clientHeight)}else e.scrollTop=0}},"2bb5":function(e,t,i){"use strict";t.__esModule=!0;i("8122");t.default={mounted:function(){},methods:{getMigratingConfig:function(){return{props:{},events:{}}}}}},4010:function(e,t,i){"use strict";t.__esModule=!0,t.removeResizeListener=t.addResizeListener=void 0;var n=i("6dd8"),s=r(n);function r(e){return e&&e.__esModule?e:{default:e}}var a="undefined"===typeof window,o=function(e){var t=e,i=Array.isArray(t),n=0;for(t=i?t:t[Symbol.iterator]();;){var s;if(i){if(n>=t.length)break;s=t[n++]}else{if(n=t.next(),n.done)break;s=n.value}var r=s,a=r.target.__resizeListeners__||[];a.length&&a.forEach(function(e){e()})}};t.addResizeListener=function(e,t){a||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new s.default(o),e.__ro__.observe(e)),e.__resizeListeners__.push(t))},t.removeResizeListener=function(e,t){e&&e.__resizeListeners__&&(e.__resizeListeners__.splice(e.__resizeListeners__.indexOf(t),1),e.__resizeListeners__.length||e.__ro__.disconnect())}},"417f":function(e,t,i){"use strict";t.__esModule=!0;var n=i("2b0e"),s=a(n),r=i("5924");function a(e){return e&&e.__esModule?e:{default:e}}var o=[],l="@@clickoutsideContext",c=void 0,u=0;function h(e,t,i){return function(){var n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!(i&&i.context&&n.target&&s.target)||e.contains(n.target)||e.contains(s.target)||e===n.target||i.context.popperElm&&(i.context.popperElm.contains(n.target)||i.context.popperElm.contains(s.target))||(t.expression&&e[l].methodName&&i.context[e[l].methodName]?i.context[e[l].methodName]():e[l].bindingFn&&e[l].bindingFn())}}!s.default.prototype.$isServer&&(0,r.on)(document,"mousedown",function(e){return c=e}),!s.default.prototype.$isServer&&(0,r.on)(document,"mouseup",function(e){o.forEach(function(t){return t[l].documentHandler(e,c)})}),t.default={bind:function(e,t,i){o.push(e);var n=u++;e[l]={id:n,documentHandler:h(e,t,i),methodName:t.expression,bindingFn:t.value}},update:function(e,t,i){e[l].documentHandler=h(e,t,i),e[l].methodName=t.expression,e[l].bindingFn=t.value},unbind:function(e){for(var t=o.length,i=0;i\n \n '}else i||(this.hoverTimer=setTimeout(this.clearHoverZone,this.panel.config.hoverThreshold))},clearHoverZone:function(){var e=this.$refs.hoverZone;e&&(e.innerHTML="")},renderEmptyText:function(e){return e("div",{class:"el-cascader-menu__empty-text"},[this.t("el.cascader.noData")])},renderNodeList:function(e){var t=this.menuId,i=this.panel.isHoverMenu,n={on:{}};i&&(n.on.expand=this.handleExpand);var s=this.nodes.map(function(i,s){var r=i.hasChildren;return e("cascader-node",l()([{key:i.uid,attrs:{node:i,"node-id":t+"-"+s,"aria-haspopup":r,"aria-owns":r?t:null}},n]))});return[].concat(s,[i?e("svg",{ref:"hoverZone",class:"el-cascader-menu__hover-zone"}):null])}},render:function(e){var t=this.isEmpty,i=this.menuId,n={nativeOn:{}};return this.panel.isHoverMenu&&(n.nativeOn.mousemove=this.handleMouseMove),e("el-scrollbar",l()([{attrs:{tag:"ul",role:"menu",id:i,"wrap-class":"el-cascader-menu__wrap","view-class":{"el-cascader-menu__list":!0,"is-empty":t}},class:"el-cascader-menu"},n]),[t?this.renderEmptyText(e):this.renderNodeList(e)])}},$=D,O=Object(y["a"])($,x,C,!1,null,null,null);O.options.__file="packages/cascader-panel/src/cascader-menu.vue";var E=O.exports,T=i(22),P=function(){function e(e,t){for(var i=0;i1?t-1:0),n=1;n1?n-1:0),r=1;r0},e.prototype.syncCheckState=function(e){var t=this.getValueByOption(),i=this.isSameNode(e,t);this.doCheck(i)},e.prototype.doCheck=function(e){this.checked!==e&&(this.config.checkStrictly?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check")))},P(e,[{key:"isDisabled",get:function(){var e=this.data,t=this.parent,i=this.config,n=i.disabled,s=i.checkStrictly;return e[n]||!s&&t&&t.isDisabled}},{key:"isLeaf",get:function(){var e=this.data,t=this.loaded,i=this.hasChildren,n=this.children,s=this.config,r=s.lazy,a=s.leaf;if(r){var o=Object(T["isDef"])(e[a])?e[a]:!!t&&!n.length;return this.hasChildren=!o,o}return!i}}]),e}(),j=N;function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var L=function e(t,i){return t.reduce(function(t,n){return n.isLeaf?t.push(n):(!i&&t.push(n),t=t.concat(e(n.children,i))),t},[])},V=function(){function e(t,i){F(this,e),this.config=i,this.initNodes(t)}return e.prototype.initNodes=function(e){var t=this;e=Object(m["coerceTruthyValueToArray"])(e),this.nodes=e.map(function(e){return new j(e,t.config)}),this.flattedNodes=this.getFlattedNodes(!1,!1),this.leafNodes=this.getFlattedNodes(!0,!1)},e.prototype.appendNode=function(e,t){var i=new j(e,this.config,t),n=t?t.children:this.nodes;n.push(i)},e.prototype.appendNodes=function(e,t){var i=this;e=Object(m["coerceTruthyValueToArray"])(e),e.forEach(function(e){return i.appendNode(e,t)})},e.prototype.getNodes=function(){return this.nodes},e.prototype.getFlattedNodes=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e?this.leafNodes:this.flattedNodes;return t?i:L(this.nodes,e)},e.prototype.getNodeByValue=function(e){if(e){e=Array.isArray(e)?e[e.length-1]:e;var t=this.getFlattedNodes(!1,!this.config.lazy).filter(function(t){return t.value===e});return t&&t.length?t[0]:null}return null},e}(),A=V,z=i(9),B=i.n(z),R=i(39),H=i.n(R),W=i(31),q=i.n(W),Y=Object.assign||function(e){for(var t=1;t0){var n=t[t.length-1];if(n.id===e){if(n.modalClass){var s=n.modalClass.trim().split(/\s+/);s.forEach(function(e){return(0,r.removeClass)(i,e)})}t.pop(),t.length>0&&(i.style.zIndex=t[t.length-1].zIndex)}else for(var a=t.length-1;a>=0;a--)if(t[a].id===e){t.splice(a,1);break}}0===t.length&&(this.modalFade&&(0,r.addClass)(i,"v-modal-leave"),setTimeout(function(){0===t.length&&(i.parentNode&&i.parentNode.removeChild(i),i.style.display="none",d.modalDom=void 0),(0,r.removeClass)(i,"v-modal-leave")},200))}};Object.defineProperty(d,"zIndex",{configurable:!0,get:function(){return l||(c=(s.default.prototype.$ELEMENT||{}).zIndex||c,l=!0),c},set:function(e){c=e}});var p=function(){if(!s.default.prototype.$isServer&&d.modalStack.length>0){var e=d.modalStack[d.modalStack.length-1];if(!e)return;var t=d.getInstance(e.id);return t}};s.default.prototype.$isServer||window.addEventListener("keydown",function(e){if(27===e.keyCode){var t=p();t&&t.closeOnPressEscape&&(t.handleClose?t.handleClose():t.handleAction?t.handleAction("cancel"):t.close())}}),t.default=d},"4e4b":function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=60)}([function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,this.$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",function(){return n})},,,function(e,t){e.exports=i("8122")},function(e,t){e.exports=i("d010")},function(e,t){e.exports=i("e974")},function(e,t){e.exports=i("6b7c")},,,,function(e,t){e.exports=i("f3ad")},,function(e,t){e.exports=i("417f")},function(e,t){e.exports=i("4010")},function(e,t){e.exports=i("0e15")},function(e,t){e.exports=i("14e9")},,,,,function(e,t){e.exports=i("4897")},function(e,t){e.exports=i("12f2")},function(e,t){e.exports=i("d397")},,,,,,,,,function(e,t){e.exports=i("2a5e")},,function(e,t,i){"use strict";var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:e.itemSelected,"is-disabled":e.disabled||e.groupDisabled||e.limitReached,hover:e.hover},on:{mouseenter:e.hoverItem,click:function(t){return t.stopPropagation(),e.selectOptionClick(t)}}},[e._t("default",[i("span",[e._v(e._s(e.currentLabel))])])],2)},s=[];n._withStripped=!0;var r=i(4),a=i.n(r),o=i(3),l="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c={mixins:[a.a],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&(!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(e,t){var i=this.select,n=i.remote,s=i.valueKey;if(!this.created&&!n){if(s&&"object"===("undefined"===typeof e?"undefined":l(e))&&"object"===("undefined"===typeof t?"undefined":l(t))&&e[s]===t[s])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(e,t){if(this.isObject){var i=this.select.valueKey;return Object(o["getValueByPath"])(e,i)===Object(o["getValueByPath"])(t,i)}return e===t},contains:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(this.isObject){var i=this.select.valueKey;return e&&e.some(function(e){return Object(o["getValueByPath"])(e,i)===Object(o["getValueByPath"])(t,i)})}return e&&e.indexOf(t)>-1},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(e){this.visible=new RegExp(Object(o["escapeRegexpString"])(e),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){this.select.onOptionDestroy(this.select.options.indexOf(this))}},u=c,h=i(0),d=Object(h["a"])(u,n,s,!1,null,null,null);d.options.__file="packages/select/src/option.vue";t["a"]=d.exports},,,function(e,t){e.exports=i("8bbc")},,,,,,,,,,,,,,,,,,,,,,,,function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClose,expression:"handleClose"}],staticClass:"el-select",class:[e.selectSize?"el-select--"+e.selectSize:""],on:{click:function(t){return t.stopPropagation(),e.toggleMenu(t)}}},[e.multiple?i("div",{ref:"tags",staticClass:"el-select__tags",style:{"max-width":e.inputWidth-32+"px",width:"100%"}},[e.collapseTags&&e.selected.length?i("span",[i("el-tag",{attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:e.selected[0].hitState,type:"info","disable-transitions":""},on:{close:function(t){e.deleteTag(t,e.selected[0])}}},[i("span",{staticClass:"el-select__tags-text"},[e._v(e._s(e.selected[0].currentLabel))])]),e.selected.length>1?i("el-tag",{attrs:{closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""}},[i("span",{staticClass:"el-select__tags-text"},[e._v("+ "+e._s(e.selected.length-1))])]):e._e()],1):e._e(),e.collapseTags?e._e():i("transition-group",{on:{"after-leave":e.resetInputHeight}},e._l(e.selected,function(t){return i("el-tag",{key:e.getValueKey(t),attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:t.hitState,type:"info","disable-transitions":""},on:{close:function(i){e.deleteTag(i,t)}}},[i("span",{staticClass:"el-select__tags-text"},[e._v(e._s(t.currentLabel))])])}),1),e.filterable?i("input",{directives:[{name:"model",rawName:"v-model",value:e.query,expression:"query"}],ref:"input",staticClass:"el-select__input",class:[e.selectSize?"is-"+e.selectSize:""],style:{"flex-grow":"1",width:e.inputLength/(e.inputWidth-32)+"%","max-width":e.inputWidth-42+"px"},attrs:{type:"text",disabled:e.selectDisabled,autocomplete:e.autoComplete||e.autocomplete},domProps:{value:e.query},on:{focus:e.handleFocus,blur:function(t){e.softFocus=!1},click:function(e){e.stopPropagation()},keyup:e.managePlaceholder,keydown:[e.resetInputState,function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.preventDefault(),e.navigateOptions("prev")},function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?(t.preventDefault(),e.selectOption(t)):null},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){return"button"in t||!e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?e.deletePrevTag(t):null}],compositionstart:e.handleComposition,compositionupdate:e.handleComposition,compositionend:e.handleComposition,input:[function(t){t.target.composing||(e.query=t.target.value)},e.debouncedQueryChange]}}):e._e()],1):e._e(),i("el-input",{ref:"reference",class:{"is-focus":e.visible},attrs:{type:"text",placeholder:e.currentPlaceholder,name:e.name,id:e.id,autocomplete:e.autoComplete||e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1},on:{focus:e.handleFocus,blur:e.handleBlur},nativeOn:{keyup:function(t){return e.debouncedOnInputChange(t)},keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("prev")},function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?(t.preventDefault(),e.selectOption(t)):null},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],paste:function(t){return e.debouncedOnInputChange(t)},mouseenter:function(t){e.inputHovering=!0},mouseleave:function(t){e.inputHovering=!1}},model:{value:e.selectedLabel,callback:function(t){e.selectedLabel=t},expression:"selectedLabel"}},[e.$slots.prefix?i("template",{slot:"prefix"},[e._t("prefix")],2):e._e(),i("template",{slot:"suffix"},[i("i",{directives:[{name:"show",rawName:"v-show",value:!e.showClose,expression:"!showClose"}],class:["el-select__caret","el-input__icon","el-icon-"+e.iconClass]}),e.showClose?i("i",{staticClass:"el-select__caret el-input__icon el-icon-circle-close",on:{click:e.handleClearClick}}):e._e()])],2),i("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":e.doDestroy}},[i("el-select-menu",{directives:[{name:"show",rawName:"v-show",value:e.visible&&!1!==e.emptyText,expression:"visible && emptyText !== false"}],ref:"popper",attrs:{"append-to-body":e.popperAppendToBody}},[i("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.options.length>0&&!e.loading,expression:"options.length > 0 && !loading"}],ref:"scrollbar",class:{"is-empty":!e.allowCreate&&e.query&&0===e.filteredOptionsCount},attrs:{tag:"ul","wrap-class":"el-select-dropdown__wrap","view-class":"el-select-dropdown__list"}},[e.showNewOption?i("el-option",{attrs:{value:e.query,created:""}}):e._e(),e._t("default")],2),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&0===e.options.length)?[e.$slots.empty?e._t("empty"):i("p",{staticClass:"el-select-dropdown__empty"},[e._v("\n "+e._s(e.emptyText)+"\n ")])]:e._e()],2)],1)],1)},s=[];n._withStripped=!0;var r=i(4),a=i.n(r),o=i(21),l=i.n(o),c=i(6),u=i.n(c),h=i(10),d=i.n(h),p=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-select-dropdown el-popper",class:[{"is-multiple":e.$parent.multiple},e.popperClass],style:{minWidth:e.minWidth}},[e._t("default")],2)},f=[];p._withStripped=!0;var m=i(5),v=i.n(m),g={name:"ElSelectDropdown",componentName:"ElSelectDropdown",mixins:[v.a],props:{placement:{default:"bottom-start"},boundariesPadding:{default:0},popperOptions:{default:function(){return{gpuAcceleration:!1}}},visibleArrow:{default:!0},appendToBody:{type:Boolean,default:!0}},data:function(){return{minWidth:""}},computed:{popperClass:function(){return this.$parent.popperClass}},watch:{"$parent.inputWidth":function(){this.minWidth=this.$parent.$el.getBoundingClientRect().width+"px"}},mounted:function(){var e=this;this.referenceElm=this.$parent.$refs.reference.$el,this.$parent.popperElm=this.popperElm=this.$el,this.$on("updatePopper",function(){e.$parent.visible&&e.updatePopper()}),this.$on("destroyPopper",this.destroyPopper)}},b=g,y=i(0),_=Object(y["a"])(b,p,f,!1,null,null,null);_.options.__file="packages/select/src/select-dropdown.vue";var x=_.exports,C=i(33),w=i(36),k=i.n(w),S=i(15),D=i.n(S),$=i(14),O=i.n($),E=i(12),T=i.n(E),P=i(13),M=i(20),I=i(31),N=i.n(I),j=i(3),F={data:function(){return{hoverOption:-1}},computed:{optionsAllDisabled:function(){return this.options.filter(function(e){return e.visible}).every(function(e){return e.disabled})}},watch:{hoverIndex:function(e){var t=this;"number"===typeof e&&e>-1&&(this.hoverOption=this.options[e]||{}),this.options.forEach(function(e){e.hover=t.hoverOption===e})}},methods:{navigateOptions:function(e){var t=this;if(this.visible){if(0!==this.options.length&&0!==this.filteredOptionsCount&&!this.optionsAllDisabled){"next"===e?(this.hoverIndex++,this.hoverIndex===this.options.length&&(this.hoverIndex=0)):"prev"===e&&(this.hoverIndex--,this.hoverIndex<0&&(this.hoverIndex=this.options.length-1));var i=this.options[this.hoverIndex];!0!==i.disabled&&!0!==i.groupDisabled&&i.visible||this.navigateOptions(e),this.$nextTick(function(){return t.scrollToOption(t.hoverOption)})}}else this.visible=!0}}},L=i(22),V={mixins:[a.a,u.a,l()("reference"),F],name:"ElSelect",componentName:"ElSelect",inject:{elForm:{default:""},elFormItem:{default:""}},provide:function(){return{select:this}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},readonly:function(){return!this.filterable||this.multiple||!Object(j["isIE"])()&&!Object(j["isEdge"])()&&!this.visible},showClose:function(){var e=this.multiple?Array.isArray(this.value)&&this.value.length>0:void 0!==this.value&&null!==this.value&&""!==this.value,t=this.clearable&&!this.selectDisabled&&this.inputHovering&&e;return t},iconClass:function(){return this.remote&&this.filterable?"":this.visible?"arrow-up is-reverse":"arrow-up"},debounce:function(){return this.remote?300:0},emptyText:function(){return this.loading?this.loadingText||this.t("el.select.loading"):(!this.remote||""!==this.query||0!==this.options.length)&&(this.filterable&&this.query&&this.options.length>0&&0===this.filteredOptionsCount?this.noMatchText||this.t("el.select.noMatch"):0===this.options.length?this.noDataText||this.t("el.select.noData"):null)},showNewOption:function(){var e=this,t=this.options.filter(function(e){return!e.created}).some(function(t){return t.currentLabel===e.query});return this.filterable&&this.allowCreate&&""!==this.query&&!t},selectSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},selectDisabled:function(){return this.disabled||(this.elForm||{}).disabled},collapseTagSize:function(){return["small","mini"].indexOf(this.selectSize)>-1?"mini":"small"}},components:{ElInput:d.a,ElSelectMenu:x,ElOption:C["a"],ElTag:k.a,ElScrollbar:D.a},directives:{Clickoutside:T.a},props:{name:String,id:String,value:{required:!0},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},automaticDropdown:Boolean,size:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:String,remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String,default:function(){return Object(M["t"])("el.select.placeholder")}},defaultFirstOption:Boolean,reserveKeyword:Boolean,valueKey:{type:String,default:"value"},collapseTags:Boolean,popperAppendToBody:{type:Boolean,default:!0}},data:function(){return{options:[],cachedOptions:[],createdLabel:null,createdSelected:!1,selected:this.multiple?[]:{},inputLength:20,inputWidth:0,initialInputHeight:0,cachedPlaceHolder:"",optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,currentPlaceholder:"",menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1}},watch:{selectDisabled:function(){var e=this;this.$nextTick(function(){e.resetInputHeight()})},placeholder:function(e){this.cachedPlaceHolder=this.currentPlaceholder=e},value:function(e,t){this.multiple&&(this.resetInputHeight(),e&&e.length>0||this.$refs.input&&""!==this.query?this.currentPlaceholder="":this.currentPlaceholder=this.cachedPlaceHolder,this.filterable&&!this.reserveKeyword&&(this.query="",this.handleQueryChange(this.query))),this.setSelected(),this.filterable&&!this.multiple&&(this.inputLength=20),Object(j["valueEquals"])(e,t)||this.dispatch("ElFormItem","el.form.change",e)},visible:function(e){var t=this;e?(this.broadcast("ElSelectDropdown","updatePopper"),this.filterable&&(this.query=this.remote?"":this.selectedLabel,this.handleQueryChange(this.query),this.multiple?this.$refs.input.focus():(this.remote||(this.broadcast("ElOption","queryChange",""),this.broadcast("ElOptionGroup","queryChange")),this.selectedLabel&&(this.currentPlaceholder=this.selectedLabel,this.selectedLabel="")))):(this.broadcast("ElSelectDropdown","destroyPopper"),this.$refs.input&&this.$refs.input.blur(),this.query="",this.previousQuery=null,this.selectedLabel="",this.inputLength=20,this.menuVisibleOnFocus=!1,this.resetHoverIndex(),this.$nextTick(function(){t.$refs.input&&""===t.$refs.input.value&&0===t.selected.length&&(t.currentPlaceholder=t.cachedPlaceHolder)}),this.multiple||(this.selected&&(this.filterable&&this.allowCreate&&this.createdSelected&&this.createdLabel?this.selectedLabel=this.createdLabel:this.selectedLabel=this.selected.currentLabel,this.filterable&&(this.query=this.selectedLabel)),this.filterable&&(this.currentPlaceholder=this.cachedPlaceHolder))),this.$emit("visible-change",e)},options:function(){var e=this;if(!this.$isServer){this.$nextTick(function(){e.broadcast("ElSelectDropdown","updatePopper")}),this.multiple&&this.resetInputHeight();var t=this.$el.querySelectorAll("input");-1===[].indexOf.call(t,document.activeElement)&&this.setSelected(),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}}},methods:{handleComposition:function(e){var t=e.target.value;if("compositionend"===e.type)this.isOnComposition=!1,this.handleQueryChange(t);else{var i=t[t.length-1]||"";this.isOnComposition=!Object(L["isKorean"])(i)}},handleQueryChange:function(e){var t=this;this.previousQuery===e||this.isOnComposition||(null!==this.previousQuery||"function"!==typeof this.filterMethod&&"function"!==typeof this.remoteMethod?(this.previousQuery=e,this.$nextTick(function(){t.visible&&t.broadcast("ElSelectDropdown","updatePopper")}),this.hoverIndex=-1,this.multiple&&this.filterable&&this.$nextTick(function(){var e=15*t.$refs.input.value.length+20;t.inputLength=t.collapseTags?Math.min(50,e):e,t.managePlaceholder(),t.resetInputHeight()}),this.remote&&"function"===typeof this.remoteMethod?(this.hoverIndex=-1,this.remoteMethod(e)):"function"===typeof this.filterMethod?(this.filterMethod(e),this.broadcast("ElOptionGroup","queryChange")):(this.filteredOptionsCount=this.optionsCount,this.broadcast("ElOption","queryChange",e),this.broadcast("ElOptionGroup","queryChange")),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()):this.previousQuery=e)},scrollToOption:function(e){var t=Array.isArray(e)&&e[0]?e[0].$el:e.$el;if(this.$refs.popper&&t){var i=this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");N()(i,t)}this.$refs.scrollbar&&this.$refs.scrollbar.handleScroll()},handleMenuEnter:function(){var e=this;this.$nextTick(function(){return e.scrollToOption(e.selected)})},emitChange:function(e){Object(j["valueEquals"])(this.value,e)||this.$emit("change",e)},getOption:function(e){for(var t=void 0,i="[object object]"===Object.prototype.toString.call(e).toLowerCase(),n="[object null]"===Object.prototype.toString.call(e).toLowerCase(),s="[object undefined]"===Object.prototype.toString.call(e).toLowerCase(),r=this.cachedOptions.length-1;r>=0;r--){var a=this.cachedOptions[r],o=i?Object(j["getValueByPath"])(a.value,this.valueKey)===Object(j["getValueByPath"])(e,this.valueKey):a.value===e;if(o){t=a;break}}if(t)return t;var l=i||n||s?"":e,c={value:e,currentLabel:l};return this.multiple&&(c.hitState=!1),c},setSelected:function(){var e=this;if(!this.multiple){var t=this.getOption(this.value);return t.created?(this.createdLabel=t.currentLabel,this.createdSelected=!0):this.createdSelected=!1,this.selectedLabel=t.currentLabel,this.selected=t,void(this.filterable&&(this.query=this.selectedLabel))}var i=[];Array.isArray(this.value)&&this.value.forEach(function(t){i.push(e.getOption(t))}),this.selected=i,this.$nextTick(function(){e.resetInputHeight()})},handleFocus:function(e){this.softFocus?this.softFocus=!1:((this.automaticDropdown||this.filterable)&&(this.visible=!0,this.menuVisibleOnFocus=!0),this.$emit("focus",e))},blur:function(){this.visible=!1,this.$refs.reference.blur()},handleBlur:function(e){var t=this;setTimeout(function(){t.isSilentBlur?t.isSilentBlur=!1:t.$emit("blur",e)},50),this.softFocus=!1},handleClearClick:function(e){this.deleteSelected(e)},doDestroy:function(){this.$refs.popper&&this.$refs.popper.doDestroy()},handleClose:function(){this.visible=!1},toggleLastOptionHitState:function(e){if(Array.isArray(this.selected)){var t=this.selected[this.selected.length-1];if(t)return!0===e||!1===e?(t.hitState=e,e):(t.hitState=!t.hitState,t.hitState)}},deletePrevTag:function(e){if(e.target.value.length<=0&&!this.toggleLastOptionHitState()){var t=this.value.slice();t.pop(),this.$emit("input",t),this.emitChange(t)}},managePlaceholder:function(){""!==this.currentPlaceholder&&(this.currentPlaceholder=this.$refs.input.value?"":this.cachedPlaceHolder)},resetInputState:function(e){8!==e.keyCode&&this.toggleLastOptionHitState(!1),this.inputLength=15*this.$refs.input.value.length+20,this.resetInputHeight()},resetInputHeight:function(){var e=this;this.collapseTags&&!this.filterable||this.$nextTick(function(){if(e.$refs.reference){var t=e.$refs.reference.$el.childNodes,i=[].filter.call(t,function(e){return"INPUT"===e.tagName})[0],n=e.$refs.tags,s=e.initialInputHeight||40;i.style.height=0===e.selected.length?s+"px":Math.max(n?n.clientHeight+(n.clientHeight>s?6:0):0,s)+"px",e.visible&&!1!==e.emptyText&&e.broadcast("ElSelectDropdown","updatePopper")}})},resetHoverIndex:function(){var e=this;setTimeout(function(){e.multiple?e.selected.length>0?e.hoverIndex=Math.min.apply(null,e.selected.map(function(t){return e.options.indexOf(t)})):e.hoverIndex=-1:e.hoverIndex=e.options.indexOf(e.selected)},300)},handleOptionSelect:function(e,t){var i=this;if(this.multiple){var n=(this.value||[]).slice(),s=this.getValueIndex(n,e.value);s>-1?n.splice(s,1):(this.multipleLimit<=0||n.length0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],i="[object object]"===Object.prototype.toString.call(t).toLowerCase();if(i){var n=this.valueKey,s=-1;return e.some(function(e,i){return Object(j["getValueByPath"])(e,n)===Object(j["getValueByPath"])(t,n)&&(s=i,!0)}),s}return e.indexOf(t)},toggleMenu:function(){this.selectDisabled||(this.menuVisibleOnFocus?this.menuVisibleOnFocus=!1:this.visible=!this.visible,this.visible&&(this.$refs.input||this.$refs.reference).focus())},selectOption:function(){this.visible?this.options[this.hoverIndex]&&this.handleOptionSelect(this.options[this.hoverIndex]):this.toggleMenu()},deleteSelected:function(e){e.stopPropagation();var t=this.multiple?[]:"";this.$emit("input",t),this.emitChange(t),this.visible=!1,this.$emit("clear")},deleteTag:function(e,t){var i=this.selected.indexOf(t);if(i>-1&&!this.selectDisabled){var n=this.value.slice();n.splice(i,1),this.$emit("input",n),this.emitChange(n),this.$emit("remove-tag",t.value)}e.stopPropagation()},onInputChange:function(){this.filterable&&this.query!==this.selectedLabel&&(this.query=this.selectedLabel,this.handleQueryChange(this.query))},onOptionDestroy:function(e){e>-1&&(this.optionsCount--,this.filteredOptionsCount--,this.options.splice(e,1))},resetInputWidth:function(){this.inputWidth=this.$refs.reference.$el.getBoundingClientRect().width},handleResize:function(){this.resetInputWidth(),this.multiple&&this.resetInputHeight()},checkDefaultFirstOption:function(){this.hoverIndex=-1;for(var e=!1,t=this.options.length-1;t>=0;t--)if(this.options[t].created){e=!0,this.hoverIndex=t;break}if(!e)for(var i=0;i!==this.options.length;++i){var n=this.options[i];if(this.query){if(!n.disabled&&!n.groupDisabled&&n.visible){this.hoverIndex=i;break}}else if(n.itemSelected){this.hoverIndex=i;break}}},getValueKey:function(e){return"[object object]"!==Object.prototype.toString.call(e.value).toLowerCase()?e.value:Object(j["getValueByPath"])(e.value,this.valueKey)}},created:function(){var e=this;this.cachedPlaceHolder=this.currentPlaceholder=this.placeholder,this.multiple&&!Array.isArray(this.value)&&this.$emit("input",[]),!this.multiple&&Array.isArray(this.value)&&this.$emit("input",""),this.debouncedOnInputChange=O()(this.debounce,function(){e.onInputChange()}),this.debouncedQueryChange=O()(this.debounce,function(t){e.handleQueryChange(t.target.value)}),this.$on("handleOptionClick",this.handleOptionSelect),this.$on("setSelected",this.setSelected)},mounted:function(){var e=this;this.multiple&&Array.isArray(this.value)&&this.value.length>0&&(this.currentPlaceholder=""),Object(P["addResizeListener"])(this.$el,this.handleResize);var t=this.$refs.reference;if(t&&t.$el){var i={medium:36,small:32,mini:28};this.initialInputHeight=t.$el.getBoundingClientRect().height||i[this.selectSize]}this.remote&&this.multiple&&this.resetInputHeight(),this.$nextTick(function(){t&&t.$el&&(e.inputWidth=t.$el.getBoundingClientRect().width)}),this.setSelected()},beforeDestroy:function(){this.$el&&this.handleResize&&Object(P["removeResizeListener"])(this.$el,this.handleResize)}},A=V,z=Object(y["a"])(A,n,s,!1,null,null,null);z.options.__file="packages/select/src/select.vue";var B=z.exports;B.install=function(e){e.component(B.name,B)};t["default"]=B}])},5128:function(e,t,i){"use strict";t.__esModule=!0,t.PopupManager=void 0;var n=i("2b0e"),s=d(n),r=i("7f4d"),a=d(r),o=i("4b26"),l=d(o),c=i("e62d"),u=d(c),h=i("5924");function d(e){return e&&e.__esModule?e:{default:e}}var p=1,f=void 0;t.default={props:{visible:{type:Boolean,default:!1},openDelay:{},closeDelay:{},zIndex:{},modal:{type:Boolean,default:!1},modalFade:{type:Boolean,default:!0},modalClass:{},modalAppendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!1},closeOnClickModal:{type:Boolean,default:!1}},beforeMount:function(){this._popupId="popup-"+p++,l.default.register(this._popupId,this)},beforeDestroy:function(){l.default.deregister(this._popupId),l.default.closeModal(this._popupId),this.restoreBodyStyle()},data:function(){return{opened:!1,bodyPaddingRight:null,computedBodyPaddingRight:0,withoutHiddenClass:!0,rendered:!1}},watch:{visible:function(e){var t=this;if(e){if(this._opening)return;this.rendered?this.open():(this.rendered=!0,s.default.nextTick(function(){t.open()}))}else this.close()}},methods:{open:function(e){var t=this;this.rendered||(this.rendered=!0);var i=(0,a.default)({},this.$props||this,e);this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),clearTimeout(this._openTimer);var n=Number(i.openDelay);n>0?this._openTimer=setTimeout(function(){t._openTimer=null,t.doOpen(i)},n):this.doOpen(i)},doOpen:function(e){if(!this.$isServer&&(!this.willOpen||this.willOpen())&&!this.opened){this._opening=!0;var t=this.$el,i=e.modal,n=e.zIndex;if(n&&(l.default.zIndex=n),i&&(this._closing&&(l.default.closeModal(this._popupId),this._closing=!1),l.default.openModal(this._popupId,l.default.nextZIndex(),this.modalAppendToBody?void 0:t,e.modalClass,e.modalFade),e.lockScroll)){this.withoutHiddenClass=!(0,h.hasClass)(document.body,"el-popup-parent--hidden"),this.withoutHiddenClass&&(this.bodyPaddingRight=document.body.style.paddingRight,this.computedBodyPaddingRight=parseInt((0,h.getStyle)(document.body,"paddingRight"),10)),f=(0,u.default)();var s=document.documentElement.clientHeight0&&(s||"scroll"===r)&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.computedBodyPaddingRight+f+"px"),(0,h.addClass)(document.body,"el-popup-parent--hidden")}"static"===getComputedStyle(t).position&&(t.style.position="absolute"),t.style.zIndex=l.default.nextZIndex(),this.opened=!0,this.onOpen&&this.onOpen(),this.doAfterOpen()}},doAfterOpen:function(){this._opening=!1},close:function(){var e=this;if(!this.willClose||this.willClose()){null!==this._openTimer&&(clearTimeout(this._openTimer),this._openTimer=null),clearTimeout(this._closeTimer);var t=Number(this.closeDelay);t>0?this._closeTimer=setTimeout(function(){e._closeTimer=null,e.doClose()},t):this.doClose()}},doClose:function(){this._closing=!0,this.onClose&&this.onClose(),this.lockScroll&&setTimeout(this.restoreBodyStyle,200),this.opened=!1,this.doAfterClose()},doAfterClose:function(){l.default.closeModal(this._popupId),this._closing=!1},restoreBodyStyle:function(){this.modal&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.bodyPaddingRight,(0,h.removeClass)(document.body,"el-popup-parent--hidden")),this.withoutHiddenClass=!0}}},t.PopupManager=l.default},5488:function(e,t,i){"use strict";t.__esModule=!0;var n=i("5924");function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var r=function(){function e(){s(this,e)}return e.prototype.beforeEnter=function(e){(0,n.addClass)(e,"collapse-transition"),e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.style.height="0",e.style.paddingTop=0,e.style.paddingBottom=0},e.prototype.enter=function(e){e.dataset.oldOverflow=e.style.overflow,0!==e.scrollHeight?(e.style.height=e.scrollHeight+"px",e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom):(e.style.height="",e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom),e.style.overflow="hidden"},e.prototype.afterEnter=function(e){(0,n.removeClass)(e,"collapse-transition"),e.style.height="",e.style.overflow=e.dataset.oldOverflow},e.prototype.beforeLeave=function(e){e.dataset||(e.dataset={}),e.dataset.oldPaddingTop=e.style.paddingTop,e.dataset.oldPaddingBottom=e.style.paddingBottom,e.dataset.oldOverflow=e.style.overflow,e.style.height=e.scrollHeight+"px",e.style.overflow="hidden"},e.prototype.leave=function(e){0!==e.scrollHeight&&((0,n.addClass)(e,"collapse-transition"),e.style.height=0,e.style.paddingTop=0,e.style.paddingBottom=0)},e.prototype.afterLeave=function(e){(0,n.removeClass)(e,"collapse-transition"),e.style.height="",e.style.overflow=e.dataset.oldOverflow,e.style.paddingTop=e.dataset.oldPaddingTop,e.style.paddingBottom=e.dataset.oldPaddingBottom},e}();t.default={name:"ElCollapseTransition",functional:!0,render:function(e,t){var i=t.children,n={on:new r};return e("transition",n,i)}}},5924:function(e,t,i){"use strict";t.__esModule=!0,t.isInContainer=t.getScrollContainer=t.isScroll=t.getStyle=t.once=t.off=t.on=void 0;var n="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};t.hasClass=m,t.addClass=v,t.removeClass=g,t.setStyle=y;var s=i("2b0e"),r=a(s);function a(e){return e&&e.__esModule?e:{default:e}}var o=r.default.prototype.$isServer,l=/([\:\-\_]+(.))/g,c=/^moz([A-Z])/,u=o?0:Number(document.documentMode),h=function(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},d=function(e){return e.replace(l,function(e,t,i,n){return n?i.toUpperCase():i}).replace(c,"Moz$1")},p=t.on=function(){return!o&&document.addEventListener?function(e,t,i){e&&t&&i&&e.addEventListener(t,i,!1)}:function(e,t,i){e&&t&&i&&e.attachEvent("on"+t,i)}}(),f=t.off=function(){return!o&&document.removeEventListener?function(e,t,i){e&&t&&e.removeEventListener(t,i,!1)}:function(e,t,i){e&&t&&e.detachEvent("on"+t,i)}}();t.once=function(e,t,i){var n=function n(){i&&i.apply(this,arguments),f(e,t,n)};p(e,t,n)};function m(e,t){if(!e||!t)return!1;if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}function v(e,t){if(e){for(var i=e.className,n=(t||"").split(" "),s=0,r=n.length;sn.top&&i.right>n.left&&i.left0?i("li",{staticClass:"number",class:{active:1===e.currentPage,disabled:e.disabled}},[e._v("1")]):e._e(),e.showPrevMore?i("li",{staticClass:"el-icon more btn-quickprev",class:[e.quickprevIconClass,{disabled:e.disabled}],on:{mouseenter:function(t){e.onMouseenter("left")},mouseleave:function(t){e.quickprevIconClass="el-icon-more"}}}):e._e(),e._l(e.pagers,function(t){return i("li",{key:t,staticClass:"number",class:{active:e.currentPage===t,disabled:e.disabled}},[e._v(e._s(t))])}),e.showNextMore?i("li",{staticClass:"el-icon more btn-quicknext",class:[e.quicknextIconClass,{disabled:e.disabled}],on:{mouseenter:function(t){e.onMouseenter("right")},mouseleave:function(t){e.quicknextIconClass="el-icon-more"}}}):e._e(),e.pageCount>1?i("li",{staticClass:"number",class:{active:e.currentPage===e.pageCount,disabled:e.disabled}},[e._v(e._s(e.pageCount))]):e._e()],2)},s=[];n._withStripped=!0;var r={name:"ElPager",props:{currentPage:Number,pageCount:Number,pagerCount:Number,disabled:Boolean},watch:{showPrevMore:function(e){e||(this.quickprevIconClass="el-icon-more")},showNextMore:function(e){e||(this.quicknextIconClass="el-icon-more")}},methods:{onPagerClick:function(e){var t=e.target;if("UL"!==t.tagName&&!this.disabled){var i=Number(e.target.textContent),n=this.pageCount,s=this.currentPage,r=this.pagerCount-2;-1!==t.className.indexOf("more")&&(-1!==t.className.indexOf("quickprev")?i=s-r:-1!==t.className.indexOf("quicknext")&&(i=s+r)),isNaN(i)||(i<1&&(i=1),i>n&&(i=n)),i!==s&&this.$emit("change",i)}},onMouseenter:function(e){this.disabled||("left"===e?this.quickprevIconClass="el-icon-d-arrow-left":this.quicknextIconClass="el-icon-d-arrow-right")}},computed:{pagers:function(){var e=this.pagerCount,t=(e-1)/2,i=Number(this.currentPage),n=Number(this.pageCount),s=!1,r=!1;n>e&&(i>e-t&&(s=!0),i4&&e<22&&e%2===1},default:7},currentPage:{type:Number,default:1},layout:{default:"prev, pager, next, jumper, ->, total"},pageSizes:{type:Array,default:function(){return[10,20,30,40,50,100]}},popperClass:String,prevText:String,nextText:String,background:Boolean,disabled:Boolean,hideOnSinglePage:Boolean},data:function(){return{internalCurrentPage:1,internalPageSize:0,lastEmittedPage:-1,userChangePageSize:!1}},render:function(e){var t=this.layout;if(!t)return null;if(this.hideOnSinglePage&&(!this.internalPageCount||1===this.internalPageCount))return null;var i=e("div",{class:["el-pagination",{"is-background":this.background,"el-pagination--small":this.small}]}),n={prev:e("prev"),jumper:e("jumper"),pager:e("pager",{attrs:{currentPage:this.internalCurrentPage,pageCount:this.internalPageCount,pagerCount:this.pagerCount,disabled:this.disabled},on:{change:this.handleCurrentChange}}),next:e("next"),sizes:e("sizes",{attrs:{pageSizes:this.pageSizes}}),slot:e("slot",[this.$slots.default?this.$slots.default:""]),total:e("total")},s=t.split(",").map(function(e){return e.trim()}),r=e("div",{class:"el-pagination__rightwrapper"}),a=!1;return i.children=i.children||[],r.children=r.children||[],s.forEach(function(e){"->"!==e?a?r.children.push(n[e]):i.children.push(n[e]):a=!0}),a&&i.children.unshift(r),i},components:{Prev:{render:function(e){return e("button",{attrs:{type:"button",disabled:this.$parent.disabled||this.$parent.internalCurrentPage<=1},class:"btn-prev",on:{click:this.$parent.prev}},[this.$parent.prevText?e("span",[this.$parent.prevText]):e("i",{class:"el-icon el-icon-arrow-left"})])}},Next:{render:function(e){return e("button",{attrs:{type:"button",disabled:this.$parent.disabled||this.$parent.internalCurrentPage===this.$parent.internalPageCount||0===this.$parent.internalPageCount},class:"btn-next",on:{click:this.$parent.next}},[this.$parent.nextText?e("span",[this.$parent.nextText]):e("i",{class:"el-icon el-icon-arrow-right"})])}},Sizes:{mixins:[g.a],props:{pageSizes:Array},watch:{pageSizes:{immediate:!0,handler:function(e,t){Object(b["valueEquals"])(e,t)||Array.isArray(e)&&(this.$parent.internalPageSize=e.indexOf(this.$parent.pageSize)>-1?this.$parent.pageSize:this.pageSizes[0])}}},render:function(e){var t=this;return e("span",{class:"el-pagination__sizes"},[e("el-select",{attrs:{value:this.$parent.internalPageSize,popperClass:this.$parent.popperClass||"",size:"mini",disabled:this.$parent.disabled},on:{input:this.handleChange}},[this.pageSizes.map(function(i){return e("el-option",{attrs:{value:i,label:i+t.t("el.pagination.pagesize")}})})])])},components:{ElSelect:h.a,ElOption:p.a},methods:{handleChange:function(e){e!==this.$parent.internalPageSize&&(this.$parent.internalPageSize=e=parseInt(e,10),this.$parent.userChangePageSize=!0,this.$parent.$emit("update:pageSize",e),this.$parent.$emit("size-change",e))}}},Jumper:{mixins:[g.a],components:{ElInput:m.a},data:function(){return{userInput:null}},watch:{"$parent.internalCurrentPage":function(){this.userInput=null}},methods:{handleKeyup:function(e){var t=e.keyCode,i=e.target;13===t&&this.handleChange(i.value)},handleInput:function(e){this.userInput=e},handleChange:function(e){this.$parent.internalCurrentPage=this.$parent.getValidCurrentPage(e),this.$parent.emitChange(),this.userInput=null}},render:function(e){return e("span",{class:"el-pagination__jump"},[this.t("el.pagination.goto"),e("el-input",{class:"el-pagination__editor is-in-pagination",attrs:{min:1,max:this.$parent.internalPageCount,value:null!==this.userInput?this.userInput:this.$parent.internalCurrentPage,type:"number",disabled:this.$parent.disabled},nativeOn:{keyup:this.handleKeyup},on:{input:this.handleInput,change:this.handleChange}}),this.t("el.pagination.pageClassifier")])}},Total:{mixins:[g.a],render:function(e){return"number"===typeof this.$parent.total?e("span",{class:"el-pagination__total"},[this.t("el.pagination.total",{total:this.$parent.total})]):""}},Pager:c},methods:{handleCurrentChange:function(e){this.internalCurrentPage=this.getValidCurrentPage(e),this.userChangePageSize=!0,this.emitChange()},prev:function(){if(!this.disabled){var e=this.internalCurrentPage-1;this.internalCurrentPage=this.getValidCurrentPage(e),this.$emit("prev-click",this.internalCurrentPage),this.emitChange()}},next:function(){if(!this.disabled){var e=this.internalCurrentPage+1;this.internalCurrentPage=this.getValidCurrentPage(e),this.$emit("next-click",this.internalCurrentPage),this.emitChange()}},getValidCurrentPage:function(e){e=parseInt(e,10);var t="number"===typeof this.internalPageCount,i=void 0;return t?e<1?i=1:e>this.internalPageCount&&(i=this.internalPageCount):(isNaN(e)||e<1)&&(i=1),void 0===i&&isNaN(e)?i=1:0===i&&(i=1),void 0===i?e:i},emitChange:function(){var e=this;this.$nextTick(function(){(e.internalCurrentPage!==e.lastEmittedPage||e.userChangePageSize)&&(e.$emit("current-change",e.internalCurrentPage),e.lastEmittedPage=e.internalCurrentPage,e.userChangePageSize=!1)})}},computed:{internalPageCount:function(){return"number"===typeof this.total?Math.max(1,Math.ceil(this.total/this.internalPageSize)):"number"===typeof this.pageCount?Math.max(1,this.pageCount):null}},watch:{currentPage:{immediate:!0,handler:function(e){this.internalCurrentPage=this.getValidCurrentPage(e)}},pageSize:{immediate:!0,handler:function(e){this.internalPageSize=isNaN(e)?10:e}},internalCurrentPage:{immediate:!0,handler:function(e){this.$emit("update:currentPage",e),this.lastEmittedPage=-1}},internalPageCount:function(e){var t=this.internalCurrentPage;e>0&&0===t?this.internalCurrentPage=1:t>e&&(this.internalCurrentPage=0===e?1:e,this.userChangePageSize&&this.emitChange()),this.userChangePageSize=!1}},install:function(e){e.component(y.name,y)}},_=y,x=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"dialog-fade"},on:{"after-enter":e.afterEnter,"after-leave":e.afterLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-dialog__wrapper",on:{click:function(t){return t.target!==t.currentTarget?null:e.handleWrapperClick(t)}}},[i("div",{ref:"dialog",staticClass:"el-dialog",class:[{"is-fullscreen":e.fullscreen,"el-dialog--center":e.center},e.customClass],style:e.style,attrs:{role:"dialog","aria-modal":"true","aria-label":e.title||"dialog"}},[i("div",{staticClass:"el-dialog__header"},[e._t("title",[i("span",{staticClass:"el-dialog__title"},[e._v(e._s(e.title))])]),e.showClose?i("button",{staticClass:"el-dialog__headerbtn",attrs:{type:"button","aria-label":"Close"},on:{click:e.handleClose}},[i("i",{staticClass:"el-dialog__close el-icon el-icon-close"})]):e._e()],2),e.rendered?i("div",{staticClass:"el-dialog__body"},[e._t("default")],2):e._e(),e.$slots.footer?i("div",{staticClass:"el-dialog__footer"},[e._t("footer")],2):e._e()])])])},C=[];x._withStripped=!0;var w=i(15),k=i.n(w),S=i(9),D=i.n(S),$=i(3),O=i.n($),E={name:"ElDialog",mixins:[k.a,O.a,D.a],props:{title:{type:String,default:""},modal:{type:Boolean,default:!0},modalAppendToBody:{type:Boolean,default:!0},appendToBody:{type:Boolean,default:!1},lockScroll:{type:Boolean,default:!0},closeOnClickModal:{type:Boolean,default:!0},closeOnPressEscape:{type:Boolean,default:!0},showClose:{type:Boolean,default:!0},width:String,fullscreen:Boolean,customClass:{type:String,default:""},top:{type:String,default:"15vh"},beforeClose:Function,center:{type:Boolean,default:!1}},data:function(){return{closed:!1}},watch:{visible:function(e){var t=this;e?(this.closed=!1,this.$emit("open"),this.$el.addEventListener("scroll",this.updatePopper),this.$nextTick(function(){t.$refs.dialog.scrollTop=0}),this.appendToBody&&document.body.appendChild(this.$el)):(this.$el.removeEventListener("scroll",this.updatePopper),this.closed||this.$emit("close"))}},computed:{style:function(){var e={};return this.fullscreen||(e.marginTop=this.top,this.width&&(e.width=this.width)),e}},methods:{getMigratingConfig:function(){return{props:{size:"size is removed."}}},handleWrapperClick:function(){this.closeOnClickModal&&this.handleClose()},handleClose:function(){"function"===typeof this.beforeClose?this.beforeClose(this.hide):this.hide()},hide:function(e){!1!==e&&(this.$emit("update:visible",!1),this.$emit("close"),this.closed=!0)},updatePopper:function(){this.broadcast("ElSelectDropdown","updatePopper"),this.broadcast("ElDropdownMenu","updatePopper")},afterEnter:function(){this.$emit("opened")},afterLeave:function(){this.$emit("closed")}},mounted:function(){this.visible&&(this.rendered=!0,this.open(),this.appendToBody&&document.body.appendChild(this.$el))},destroyed:function(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},T=E,P=o(T,x,C,!1,null,null,null);P.options.__file="packages/dialog/src/component.vue";var M=P.exports;M.install=function(e){e.component(M.name,M)};var I=M,N=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.close,expression:"close"}],staticClass:"el-autocomplete",attrs:{"aria-haspopup":"listbox",role:"combobox","aria-expanded":e.suggestionVisible,"aria-owns":e.id}},[i("el-input",e._b({ref:"input",on:{input:e.handleChange,focus:e.handleFocus,blur:e.handleBlur,clear:e.handleClear},nativeOn:{keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.preventDefault(),e.highlight(e.highlightedIndex-1)},function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.preventDefault(),e.highlight(e.highlightedIndex+1)},function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.handleKeyEnter(t):null},function(t){return"button"in t||!e._k(t.keyCode,"tab",9,t.key,"Tab")?e.close(t):null}]}},"el-input",[e.$props,e.$attrs],!1),[e.$slots.prepend?i("template",{slot:"prepend"},[e._t("prepend")],2):e._e(),e.$slots.append?i("template",{slot:"append"},[e._t("append")],2):e._e(),e.$slots.prefix?i("template",{slot:"prefix"},[e._t("prefix")],2):e._e(),e.$slots.suffix?i("template",{slot:"suffix"},[e._t("suffix")],2):e._e()],2),i("el-autocomplete-suggestions",{ref:"suggestions",class:[e.popperClass?e.popperClass:""],attrs:{"visible-arrow":"","popper-options":e.popperOptions,"append-to-body":e.popperAppendToBody,placement:e.placement,id:e.id}},e._l(e.suggestions,function(t,n){return i("li",{key:n,class:{highlighted:e.highlightedIndex===n},attrs:{id:e.id+"-item-"+n,role:"option","aria-selected":e.highlightedIndex===n},on:{click:function(i){e.select(t)}}},[e._t("default",[e._v("\n "+e._s(t[e.valueKey])+"\n ")],{item:t})],2)}),0)],1)},j=[];N._withStripped=!0;var F=i(12),L=i.n(F),V=i(10),A=i.n(V),z=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.doDestroy}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-autocomplete-suggestion el-popper",class:{"is-loading":!e.parent.hideLoading&&e.parent.loading},style:{width:e.dropdownWidth},attrs:{role:"region"}},[i("el-scrollbar",{attrs:{tag:"ul","wrap-class":"el-autocomplete-suggestion__wrap","view-class":"el-autocomplete-suggestion__list"}},[!e.parent.hideLoading&&e.parent.loading?i("li",[i("i",{staticClass:"el-icon-loading"})]):e._t("default")],2)],1)])},B=[];z._withStripped=!0;var R=i(6),H=i.n(R),W=i(18),q=i.n(W),Y={components:{ElScrollbar:q.a},mixins:[H.a,O.a],componentName:"ElAutocompleteSuggestions",data:function(){return{parent:this.$parent,dropdownWidth:""}},props:{options:{default:function(){return{gpuAcceleration:!1}}},id:String},methods:{select:function(e){this.dispatch("ElAutocomplete","item-click",e)}},updated:function(){var e=this;this.$nextTick(function(t){e.popperJS&&e.updatePopper()})},mounted:function(){this.$parent.popperElm=this.popperElm=this.$el,this.referenceElm=this.$parent.$refs.input.$refs.input,this.referenceList=this.$el.querySelector(".el-autocomplete-suggestion__list"),this.referenceList.setAttribute("role","listbox"),this.referenceList.setAttribute("id",this.id)},created:function(){var e=this;this.$on("visible",function(t,i){e.dropdownWidth=i+"px",e.showPopper=t})}},K=Y,U=o(K,z,B,!1,null,null,null);U.options.__file="packages/autocomplete/src/autocomplete-suggestions.vue";var G=U.exports,X=i(21),Q=i.n(X),Z={name:"ElAutocomplete",mixins:[O.a,Q()("input"),D.a],inheritAttrs:!1,componentName:"ElAutocomplete",components:{ElInput:m.a,ElAutocompleteSuggestions:G},directives:{Clickoutside:A.a},props:{valueKey:{type:String,default:"value"},popperClass:String,popperOptions:Object,placeholder:String,clearable:{type:Boolean,default:!1},disabled:Boolean,name:String,size:String,value:String,maxlength:Number,minlength:Number,autofocus:Boolean,fetchSuggestions:Function,triggerOnFocus:{type:Boolean,default:!0},customItem:String,selectWhenUnmatched:{type:Boolean,default:!1},prefixIcon:String,suffixIcon:String,label:String,debounce:{type:Number,default:300},placement:{type:String,default:"bottom-start"},hideLoading:Boolean,popperAppendToBody:{type:Boolean,default:!0},highlightFirstItem:{type:Boolean,default:!1}},data:function(){return{activated:!1,suggestions:[],loading:!1,highlightedIndex:-1,suggestionDisabled:!1}},computed:{suggestionVisible:function(){var e=this.suggestions,t=Array.isArray(e)&&e.length>0;return(t||this.loading)&&this.activated},id:function(){return"el-autocomplete-"+Object(b["generateId"])()}},watch:{suggestionVisible:function(e){var t=this.getInput();t&&this.broadcast("ElAutocompleteSuggestions","visible",[e,t.offsetWidth])}},methods:{getMigratingConfig:function(){return{props:{"custom-item":"custom-item is removed, use scoped slot instead.",props:"props is removed, use value-key instead."}}},getData:function(e){var t=this;this.suggestionDisabled||(this.loading=!0,this.fetchSuggestions(e,function(e){t.loading=!1,t.suggestionDisabled||(Array.isArray(e)?(t.suggestions=e,t.highlightedIndex=t.highlightFirstItem?0:-1):console.error("[Element Error][Autocomplete]autocomplete suggestions must be an array"))}))},handleChange:function(e){if(this.$emit("input",e),this.suggestionDisabled=!1,!this.triggerOnFocus&&!e)return this.suggestionDisabled=!0,void(this.suggestions=[]);this.debouncedGetData(e)},handleFocus:function(e){this.activated=!0,this.$emit("focus",e),this.triggerOnFocus&&this.debouncedGetData(this.value)},handleBlur:function(e){this.$emit("blur",e)},handleClear:function(){this.activated=!1,this.$emit("clear")},close:function(e){this.activated=!1},handleKeyEnter:function(e){var t=this;this.suggestionVisible&&this.highlightedIndex>=0&&this.highlightedIndex=this.suggestions.length&&(e=this.suggestions.length-1);var t=this.$refs.suggestions.$el.querySelector(".el-autocomplete-suggestion__wrap"),i=t.querySelectorAll(".el-autocomplete-suggestion__list li"),n=i[e],s=t.scrollTop,r=n.offsetTop;r+n.scrollHeight>s+t.clientHeight&&(t.scrollTop+=n.scrollHeight),r=0&&this.resetTabindex(this.triggerElm),clearTimeout(this.timeout),this.timeout=setTimeout(function(){e.visible=!1},"click"===this.trigger?0:this.hideTimeout))},handleClick:function(){this.triggerElm.disabled||(this.visible?this.hide():this.show())},handleTriggerKeyDown:function(e){var t=e.keyCode;[38,40].indexOf(t)>-1?(this.removeTabindex(),this.resetTabindex(this.menuItems[0]),this.menuItems[0].focus(),e.preventDefault(),e.stopPropagation()):13===t?this.handleClick():[9,27].indexOf(t)>-1&&this.hide()},handleItemKeyDown:function(e){var t=e.keyCode,i=e.target,n=this.menuItemsArray.indexOf(i),s=this.menuItemsArray.length-1,r=void 0;[38,40].indexOf(t)>-1?(r=38===t?0!==n?n-1:0:n-1&&(this.hide(),this.triggerElmFocus())},resetTabindex:function(e){this.removeTabindex(),e.setAttribute("tabindex","0")},removeTabindex:function(){this.triggerElm.setAttribute("tabindex","-1"),this.menuItemsArray.forEach(function(e){e.setAttribute("tabindex","-1")})},initAria:function(){this.dropdownElm.setAttribute("id",this.listId),this.triggerElm.setAttribute("aria-haspopup","list"),this.triggerElm.setAttribute("aria-controls",this.listId),this.splitButton||(this.triggerElm.setAttribute("role","button"),this.triggerElm.setAttribute("tabindex",this.tabindex),this.triggerElm.setAttribute("class",(this.triggerElm.getAttribute("class")||"")+" el-dropdown-selfdefine"))},initEvent:function(){var e=this,t=this.trigger,i=this.show,n=this.hide,s=this.handleClick,r=this.splitButton,a=this.handleTriggerKeyDown,o=this.handleItemKeyDown;this.triggerElm=r?this.$refs.trigger.$el:this.$slots.default[0].elm;var l=this.dropdownElm;this.triggerElm.addEventListener("keydown",a),l.addEventListener("keydown",o,!0),r||(this.triggerElm.addEventListener("focus",function(){e.focusing=!0}),this.triggerElm.addEventListener("blur",function(){e.focusing=!1}),this.triggerElm.addEventListener("click",function(){e.focusing=!1})),"hover"===t?(this.triggerElm.addEventListener("mouseenter",i),this.triggerElm.addEventListener("mouseleave",n),l.addEventListener("mouseenter",i),l.addEventListener("mouseleave",n)):"click"===t&&this.triggerElm.addEventListener("click",s)},handleMenuItemClick:function(e,t){this.hideOnClick&&(this.visible=!1),this.$emit("command",e,t)},triggerElmFocus:function(){this.triggerElm.focus&&this.triggerElm.focus()},initDomOperation:function(){this.dropdownElm=this.popperElm,this.menuItems=this.dropdownElm.querySelectorAll("[tabindex='-1']"),this.menuItemsArray=[].slice.call(this.menuItems),this.initEvent(),this.initAria()}},render:function(e){var t=this,i=this.hide,n=this.splitButton,s=this.type,r=this.dropdownSize,a=function(e){t.$emit("click",e),i()},o=n?e("el-button-group",[e("el-button",{attrs:{type:s,size:r},nativeOn:{click:a}},[this.$slots.default]),e("el-button",{ref:"trigger",attrs:{type:s,size:r},class:"el-dropdown__caret-button"},[e("i",{class:"el-dropdown__icon el-icon-arrow-down"})])]):this.$slots.default;return e("div",{class:"el-dropdown",directives:[{name:"clickoutside",value:i}]},[o,this.$slots.dropdown])}},ue=ce,he=o(ue,ie,ne,!1,null,null,null);he.options.__file="packages/dropdown/src/dropdown.vue";var de=he.exports;de.install=function(e){e.component(de.name,de)};var pe=de,fe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.doDestroy}},[i("ul",{directives:[{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-dropdown-menu el-popper",class:[e.size&&"el-dropdown-menu--"+e.size]},[e._t("default")],2)])},me=[];fe._withStripped=!0;var ve={name:"ElDropdownMenu",componentName:"ElDropdownMenu",mixins:[H.a],props:{visibleArrow:{type:Boolean,default:!0},arrowOffset:{type:Number,default:0}},data:function(){return{size:this.dropdown.dropdownSize}},inject:["dropdown"],created:function(){var e=this;this.$on("updatePopper",function(){e.showPopper&&e.updatePopper()}),this.$on("visible",function(t){e.showPopper=t})},mounted:function(){this.dropdown.popperElm=this.popperElm=this.$el,this.referenceElm=this.dropdown.$el,this.dropdown.initDomOperation()},watch:{"dropdown.placement":{immediate:!0,handler:function(e){this.currentPlacement=e}}}},ge=ve,be=o(ge,fe,me,!1,null,null,null);be.options.__file="packages/dropdown/src/dropdown-menu.vue";var ye=be.exports;ye.install=function(e){e.component(ye.name,ye)};var _e=ye,xe=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{staticClass:"el-dropdown-menu__item",class:{"is-disabled":e.disabled,"el-dropdown-menu__item--divided":e.divided},attrs:{"aria-disabled":e.disabled,tabindex:e.disabled?null:-1},on:{click:e.handleClick}},[e.icon?i("i",{class:e.icon}):e._e(),e._t("default")],2)},Ce=[];xe._withStripped=!0;var we={name:"ElDropdownItem",mixins:[O.a],props:{command:{},disabled:Boolean,divided:Boolean,icon:String},methods:{handleClick:function(e){this.dispatch("ElDropdown","menu-item-click",[this.command,this])}}},ke=we,Se=o(ke,xe,Ce,!1,null,null,null);Se.options.__file="packages/dropdown/src/dropdown-item.vue";var De=Se.exports;De.install=function(e){e.component(De.name,De)};var $e=De,Oe=Oe||{};Oe.Utils=Oe.Utils||{},Oe.Utils.focusFirstDescendant=function(e){for(var t=0;t=0;t--){var i=e.childNodes[t];if(Oe.Utils.attemptFocus(i)||Oe.Utils.focusLastDescendant(i))return!0}return!1},Oe.Utils.attemptFocus=function(e){if(!Oe.Utils.isFocusable(e))return!1;Oe.Utils.IgnoreUtilFocusChanges=!0;try{e.focus()}catch(t){}return Oe.Utils.IgnoreUtilFocusChanges=!1,document.activeElement===e},Oe.Utils.isFocusable=function(e){if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return"hidden"!==e.type&&"file"!==e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},Oe.Utils.triggerEvent=function(e,t){var i=void 0;i=/^mouse|click/.test(t)?"MouseEvents":/^key/.test(t)?"KeyboardEvent":"HTMLEvents";for(var n=document.createEvent(i),s=arguments.length,r=Array(s>2?s-2:0),a=2;a=0;t--)e.splice(t,0,e[t]);e=e.join("")}return/^[0-9a-fA-F]{6}$/.test(e)?{red:parseInt(e.slice(0,2),16),green:parseInt(e.slice(2,4),16),blue:parseInt(e.slice(4,6),16)}:{red:255,green:255,blue:255}},mixColor:function(e,t){var i=this.getColorChannels(e),n=i.red,s=i.green,r=i.blue;return t>0?(n*=1-t,s*=1-t,r*=1-t):(n+=(255-n)*t,s+=(255-s)*t,r+=(255-r)*t),"rgb("+Math.round(n)+", "+Math.round(s)+", "+Math.round(r)+")"},addItem:function(e){this.$set(this.items,e.index,e)},removeItem:function(e){delete this.items[e.index]},addSubmenu:function(e){this.$set(this.submenus,e.index,e)},removeSubmenu:function(e){delete this.submenus[e.index]},openMenu:function(e,t){var i=this.openedMenus;-1===i.indexOf(e)&&(this.uniqueOpened&&(this.openedMenus=i.filter(function(e){return-1!==t.indexOf(e)})),this.openedMenus.push(e))},closeMenu:function(e){var t=this.openedMenus.indexOf(e);-1!==t&&this.openedMenus.splice(t,1)},handleSubmenuClick:function(e){var t=e.index,i=e.indexPath,n=-1!==this.openedMenus.indexOf(t);n?(this.closeMenu(t),this.$emit("close",t,i)):(this.openMenu(t,i),this.$emit("open",t,i))},handleItemClick:function(e){var t=this,i=e.index,n=e.indexPath,s=this.activeIndex,r=null!==e.index;r&&(this.activeIndex=e.index),this.$emit("select",i,n,e),("horizontal"===this.mode||this.collapse)&&(this.openedMenus=[]),this.router&&r&&this.routeToItem(e,function(e){t.activeIndex=s,e&&console.error(e)})},initOpenedMenu:function(){var e=this,t=this.activeIndex,i=this.items[t];if(i&&"horizontal"!==this.mode&&!this.collapse){var n=i.indexPath;n.forEach(function(t){var i=e.submenus[t];i&&e.openMenu(t,i.indexPath)})}},routeToItem:function(e,t){var i=e.route||e.index;try{this.$router.push(i,function(){},t)}catch(n){console.error(n)}},open:function(e){var t=this,i=this.submenus[e.toString()].indexPath;i.forEach(function(e){return t.openMenu(e,i)})},close:function(e){this.closeMenu(e)}},mounted:function(){this.initOpenedMenu(),this.$on("item-click",this.handleItemClick),this.$on("submenu-click",this.handleSubmenuClick),"horizontal"===this.mode&&new Le(this.$el),this.$watch("items",this.updateActiveIndex)}},ze=Ae,Be=o(ze,je,Fe,!1,null,null,null);Be.options.__file="packages/menu/src/menu.vue";var Re=Be.exports;Re.install=function(e){e.component(Re.name,Re)};var He,We,qe=Re,Ye=i(20),Ke=i.n(Ye),Ue={inject:["rootMenu"],computed:{indexPath:function(){var e=[this.index],t=this.$parent;while("ElMenu"!==t.$options.componentName)t.index&&e.unshift(t.index),t=t.$parent;return e},parentMenu:function(){var e=this.$parent;while(e&&-1===["ElMenu","ElSubmenu"].indexOf(e.$options.componentName))e=e.$parent;return e},paddingStyle:function(){if("vertical"!==this.rootMenu.mode)return{};var e=20,t=this.$parent;if(this.rootMenu.collapse)e=20;else while(t&&"ElMenu"!==t.$options.componentName)"ElSubmenu"===t.$options.componentName&&(e+=20),t=t.$parent;return{paddingLeft:e+"px"}}}},Ge={props:{transformOrigin:{type:[Boolean,String],default:!1},offset:H.a.props.offset,boundariesPadding:H.a.props.boundariesPadding,popperOptions:H.a.props.popperOptions},data:H.a.data,methods:H.a.methods,beforeDestroy:H.a.beforeDestroy,deactivated:H.a.deactivated},Xe={name:"ElSubmenu",componentName:"ElSubmenu",mixins:[Ue,O.a,Ge],components:{ElCollapseTransition:Ke.a},props:{index:{type:String,required:!0},showTimeout:{type:Number,default:300},hideTimeout:{type:Number,default:300},popperClass:String,disabled:Boolean,popperAppendToBody:{type:Boolean,default:void 0}},data:function(){return{popperJS:null,timeout:null,items:{},submenus:{},mouseInChild:!1}},watch:{opened:function(e){var t=this;this.isMenuPopup&&this.$nextTick(function(e){t.updatePopper()})}},computed:{appendToBody:function(){return void 0===this.popperAppendToBody?this.isFirstLevel:this.popperAppendToBody},menuTransitionName:function(){return this.rootMenu.collapse?"el-zoom-in-left":"el-zoom-in-top"},opened:function(){return this.rootMenu.openedMenus.indexOf(this.index)>-1},active:function(){var e=!1,t=this.submenus,i=this.items;return Object.keys(i).forEach(function(t){i[t].active&&(e=!0)}),Object.keys(t).forEach(function(i){t[i].active&&(e=!0)}),e},hoverBackground:function(){return this.rootMenu.hoverBackground},backgroundColor:function(){return this.rootMenu.backgroundColor||""},activeTextColor:function(){return this.rootMenu.activeTextColor||""},textColor:function(){return this.rootMenu.textColor||""},mode:function(){return this.rootMenu.mode},isMenuPopup:function(){return this.rootMenu.isMenuPopup},titleStyle:function(){return"horizontal"!==this.mode?{color:this.textColor}:{borderBottomColor:this.active?this.rootMenu.activeTextColor?this.activeTextColor:"":"transparent",color:this.active?this.activeTextColor:this.textColor}},isFirstLevel:function(){var e=!0,t=this.$parent;while(t&&t!==this.rootMenu){if(["ElSubmenu","ElMenuItemGroup"].indexOf(t.$options.componentName)>-1){e=!1;break}t=t.$parent}return e}},methods:{handleCollapseToggle:function(e){e?this.initPopper():this.doDestroy()},addItem:function(e){this.$set(this.items,e.index,e)},removeItem:function(e){delete this.items[e.index]},addSubmenu:function(e){this.$set(this.submenus,e.index,e)},removeSubmenu:function(e){delete this.submenus[e.index]},handleClick:function(){var e=this.rootMenu,t=this.disabled;"hover"===e.menuTrigger&&"horizontal"===e.mode||e.collapse&&"vertical"===e.mode||t||this.dispatch("ElMenu","submenu-click",this)},handleMouseenter:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.showTimeout;if("ActiveXObject"in window||"focus"!==e.type||e.relatedTarget){var n=this.rootMenu,s=this.disabled;"click"===n.menuTrigger&&"horizontal"===n.mode||!n.collapse&&"vertical"===n.mode||s||(this.dispatch("ElSubmenu","mouse-enter-child"),clearTimeout(this.timeout),this.timeout=setTimeout(function(){t.rootMenu.openMenu(t.index,t.indexPath)},i))}},handleMouseleave:function(){var e=this,t=this.rootMenu;"click"===t.menuTrigger&&"horizontal"===t.mode||!t.collapse&&"vertical"===t.mode||(this.dispatch("ElSubmenu","mouse-leave-child"),clearTimeout(this.timeout),this.timeout=setTimeout(function(){!e.mouseInChild&&e.rootMenu.closeMenu(e.index)},this.hideTimeout))},handleTitleMouseenter:function(){if("horizontal"!==this.mode||this.rootMenu.backgroundColor){var e=this.$refs["submenu-title"];e&&(e.style.backgroundColor=this.rootMenu.hoverBackground)}},handleTitleMouseleave:function(){if("horizontal"!==this.mode||this.rootMenu.backgroundColor){var e=this.$refs["submenu-title"];e&&(e.style.backgroundColor=this.rootMenu.backgroundColor||"")}},updatePlacement:function(){this.currentPlacement="horizontal"===this.mode&&this.isFirstLevel?"bottom-start":"right-start"},initPopper:function(){this.referenceElm=this.$el,this.popperElm=this.$refs.menu,this.updatePlacement()}},created:function(){var e=this;this.$on("toggle-collapse",this.handleCollapseToggle),this.$on("mouse-enter-child",function(){e.mouseInChild=!0,clearTimeout(e.timeout)}),this.$on("mouse-leave-child",function(){e.mouseInChild=!1,clearTimeout(e.timeout)})},mounted:function(){this.parentMenu.addSubmenu(this),this.rootMenu.addSubmenu(this),this.initPopper()},beforeDestroy:function(){this.parentMenu.removeSubmenu(this),this.rootMenu.removeSubmenu(this)},render:function(e){var t=this,i=this.active,n=this.opened,s=this.paddingStyle,r=this.titleStyle,a=this.backgroundColor,o=this.rootMenu,l=this.currentPlacement,c=this.menuTransitionName,u=this.mode,h=this.disabled,d=this.popperClass,p=this.$slots,f=this.isFirstLevel,m=e("transition",{attrs:{name:c}},[e("div",{ref:"menu",directives:[{name:"show",value:n}],class:["el-menu--"+u,d],on:{mouseenter:function(e){return t.handleMouseenter(e,100)},mouseleave:this.handleMouseleave,focus:function(e){return t.handleMouseenter(e,100)}}},[e("ul",{attrs:{role:"menu"},class:["el-menu el-menu--popup","el-menu--popup-"+l],style:{backgroundColor:o.backgroundColor||""}},[p.default])])]),v=e("el-collapse-transition",[e("ul",{attrs:{role:"menu"},class:"el-menu el-menu--inline",directives:[{name:"show",value:n}],style:{backgroundColor:o.backgroundColor||""}},[p.default])]),g="horizontal"===o.mode&&f||"vertical"===o.mode&&!o.collapse?"el-icon-arrow-down":"el-icon-arrow-right";return e("li",{class:{"el-submenu":!0,"is-active":i,"is-opened":n,"is-disabled":h},attrs:{role:"menuitem","aria-haspopup":"true","aria-expanded":n},on:{mouseenter:this.handleMouseenter,mouseleave:this.handleMouseleave,focus:this.handleMouseenter}},[e("div",{class:"el-submenu__title",ref:"submenu-title",on:{click:this.handleClick,mouseenter:this.handleTitleMouseenter,mouseleave:this.handleTitleMouseleave},style:[s,r,{backgroundColor:a}]},[p.title,e("i",{class:["el-submenu__icon-arrow",g]})]),this.isMenuPopup?m:v])}},Qe=Xe,Ze=o(Qe,He,We,!1,null,null,null);Ze.options.__file="packages/menu/src/submenu.vue";var Je=Ze.exports;Je.install=function(e){e.component(Je.name,Je)};var et=Je,tt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{staticClass:"el-menu-item",class:{"is-active":e.active,"is-disabled":e.disabled},style:[e.paddingStyle,e.itemStyle,{backgroundColor:e.backgroundColor}],attrs:{role:"menuitem",tabindex:"-1"},on:{click:e.handleClick,mouseenter:e.onMouseEnter,focus:e.onMouseEnter,blur:e.onMouseLeave,mouseleave:e.onMouseLeave}},["ElMenu"===e.parentMenu.$options.componentName&&e.rootMenu.collapse&&e.$slots.title?i("el-tooltip",{attrs:{effect:"dark",placement:"right"}},[i("div",{attrs:{slot:"content"},slot:"content"},[e._t("title")],2),i("div",{staticStyle:{position:"absolute",left:"0",top:"0",height:"100%",width:"100%",display:"inline-block","box-sizing":"border-box",padding:"0 20px"}},[e._t("default")],2)]):[e._t("default"),e._t("title")]],2)},it=[];tt._withStripped=!0;var nt=i(26),st=i.n(nt),rt={name:"ElMenuItem",componentName:"ElMenuItem",mixins:[Ue,O.a],components:{ElTooltip:st.a},props:{index:{default:null,validator:function(e){return"string"===typeof e||null===e}},route:[String,Object],disabled:Boolean},computed:{active:function(){return this.index===this.rootMenu.activeIndex},hoverBackground:function(){return this.rootMenu.hoverBackground},backgroundColor:function(){return this.rootMenu.backgroundColor||""},activeTextColor:function(){return this.rootMenu.activeTextColor||""},textColor:function(){return this.rootMenu.textColor||""},mode:function(){return this.rootMenu.mode},itemStyle:function(){var e={color:this.active?this.activeTextColor:this.textColor};return"horizontal"!==this.mode||this.isNested||(e.borderBottomColor=this.active?this.rootMenu.activeTextColor?this.activeTextColor:"":"transparent"),e},isNested:function(){return this.parentMenu!==this.rootMenu}},methods:{onMouseEnter:function(){("horizontal"!==this.mode||this.rootMenu.backgroundColor)&&(this.$el.style.backgroundColor=this.hoverBackground)},onMouseLeave:function(){("horizontal"!==this.mode||this.rootMenu.backgroundColor)&&(this.$el.style.backgroundColor=this.backgroundColor)},handleClick:function(){this.disabled||(this.dispatch("ElMenu","item-click",this),this.$emit("click",this))}},mounted:function(){this.parentMenu.addItem(this),this.rootMenu.addItem(this)},beforeDestroy:function(){this.parentMenu.removeItem(this),this.rootMenu.removeItem(this)}},at=rt,ot=o(at,tt,it,!1,null,null,null);ot.options.__file="packages/menu/src/menu-item.vue";var lt=ot.exports;lt.install=function(e){e.component(lt.name,lt)};var ct=lt,ut=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{staticClass:"el-menu-item-group"},[i("div",{staticClass:"el-menu-item-group__title",style:{paddingLeft:e.levelPadding+"px"}},[e.$slots.title?e._t("title"):[e._v(e._s(e.title))]],2),i("ul",[e._t("default")],2)])},ht=[];ut._withStripped=!0;var dt={name:"ElMenuItemGroup",componentName:"ElMenuItemGroup",inject:["rootMenu"],props:{title:{type:String}},data:function(){return{paddingLeft:20}},computed:{levelPadding:function(){var e=20,t=this.$parent;if(this.rootMenu.collapse)return 20;while(t&&"ElMenu"!==t.$options.componentName)"ElSubmenu"===t.$options.componentName&&(e+=20),t=t.$parent;return e}}},pt=dt,ft=o(pt,ut,ht,!1,null,null,null);ft.options.__file="packages/menu/src/menu-item-group.vue";var mt=ft.exports;mt.install=function(e){e.component(mt.name,mt)};var vt=mt,gt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["textarea"===e.type?"el-textarea":"el-input",e.inputSize?"el-input--"+e.inputSize:"",{"is-disabled":e.inputDisabled,"is-exceed":e.inputExceed,"el-input-group":e.$slots.prepend||e.$slots.append,"el-input-group--append":e.$slots.append,"el-input-group--prepend":e.$slots.prepend,"el-input--prefix":e.$slots.prefix||e.prefixIcon,"el-input--suffix":e.$slots.suffix||e.suffixIcon||e.clearable||e.showPassword}],on:{mouseenter:function(t){e.hovering=!0},mouseleave:function(t){e.hovering=!1}}},["textarea"!==e.type?[e.$slots.prepend?i("div",{staticClass:"el-input-group__prepend"},[e._t("prepend")],2):e._e(),"textarea"!==e.type?i("input",e._b({ref:"input",staticClass:"el-input__inner",attrs:{tabindex:e.tabindex,type:e.showPassword?e.passwordVisible?"text":"password":e.type,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"input",e.$attrs,!1)):e._e(),e.$slots.prefix||e.prefixIcon?i("span",{staticClass:"el-input__prefix"},[e._t("prefix"),e.prefixIcon?i("i",{staticClass:"el-input__icon",class:e.prefixIcon}):e._e()],2):e._e(),e.getSuffixVisible()?i("span",{staticClass:"el-input__suffix"},[i("span",{staticClass:"el-input__suffix-inner"},[e.showClear&&e.showPwdVisible&&e.isWordLimitVisible?e._e():[e._t("suffix"),e.suffixIcon?i("i",{staticClass:"el-input__icon",class:e.suffixIcon}):e._e()],e.showClear?i("i",{staticClass:"el-input__icon el-icon-circle-close el-input__clear",on:{click:e.clear}}):e._e(),e.showPwdVisible?i("i",{staticClass:"el-input__icon el-icon-view el-input__clear",on:{click:e.handlePasswordVisible}}):e._e(),e.isWordLimitVisible?i("span",{staticClass:"el-input__count"},[i("span",{staticClass:"el-input__count-inner"},[e._v("\n "+e._s(e.textLength)+"/"+e._s(e.upperLimit)+"\n ")])]):e._e()],2),e.validateState?i("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",e.validateIcon]}):e._e()]):e._e(),e.$slots.append?i("div",{staticClass:"el-input-group__append"},[e._t("append")],2):e._e()]:i("textarea",e._b({ref:"textarea",staticClass:"el-textarea__inner",style:e.textareaStyle,attrs:{tabindex:e.tabindex,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"textarea",e.$attrs,!1)),e.isWordLimitVisible&&"textarea"===e.type?i("span",{staticClass:"el-input__count"},[e._v(e._s(e.textLength)+"/"+e._s(e.upperLimit))]):e._e()],2)},bt=[];gt._withStripped=!0;var yt=void 0,_t="\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",xt=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function Ct(e){var t=window.getComputedStyle(e),i=t.getPropertyValue("box-sizing"),n=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),s=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width")),r=xt.map(function(e){return e+":"+t.getPropertyValue(e)}).join(";");return{contextStyle:r,paddingSize:n,borderSize:s,boxSizing:i}}function wt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;yt||(yt=document.createElement("textarea"),document.body.appendChild(yt));var n=Ct(e),s=n.paddingSize,r=n.borderSize,a=n.boxSizing,o=n.contextStyle;yt.setAttribute("style",o+";"+_t),yt.value=e.value||e.placeholder||"";var l=yt.scrollHeight,c={};"border-box"===a?l+=r:"content-box"===a&&(l-=s),yt.value="";var u=yt.scrollHeight-s;if(null!==t){var h=u*t;"border-box"===a&&(h=h+s+r),l=Math.max(h,l),c.minHeight=h+"px"}if(null!==i){var d=u*i;"border-box"===a&&(d=d+s+r),l=Math.min(d,l)}return c.height=l+"px",yt.parentNode&&yt.parentNode.removeChild(yt),yt=null,c}var kt=i(7),St=i.n(kt),Dt={name:"ElInput",componentName:"ElInput",mixins:[O.a,D.a],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{textareaCalcStyle:{},hovering:!1,focused:!1,isComposing:!1,passwordVisible:!1}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,readonly:Boolean,type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},tabindex:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},textareaStyle:function(){return St()({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputDisabled:function(){return this.disabled||(this.elForm||{}).disabled},nativeInputValue:function(){return null===this.value||void 0===this.value?"":String(this.value)},showClear:function(){return this.clearable&&!this.inputDisabled&&!this.readonly&&this.nativeInputValue&&(this.focused||this.hovering)},showPwdVisible:function(){return this.showPassword&&!this.inputDisabled&&!this.readonly&&(!!this.nativeInputValue||this.focused)},isWordLimitVisible:function(){return this.showWordLimit&&this.$attrs.maxlength&&("text"===this.type||"textarea"===this.type)&&!this.inputDisabled&&!this.readonly&&!this.showPassword},upperLimit:function(){return this.$attrs.maxlength},textLength:function(){return"number"===typeof this.value?String(this.value).length:(this.value||"").length},inputExceed:function(){return this.isWordLimitVisible&&this.textLength>this.upperLimit}},watch:{value:function(e){this.$nextTick(this.resizeTextarea),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[e])},nativeInputValue:function(){this.setNativeInputValue()},type:function(){var e=this;this.$nextTick(function(){e.setNativeInputValue(),e.resizeTextarea(),e.updateIconOffset()})}},methods:{focus:function(){this.getInput().focus()},blur:function(){this.getInput().blur()},getMigratingConfig:function(){return{props:{icon:"icon is removed, use suffix-icon / prefix-icon instead.","on-icon-click":"on-icon-click is removed."},events:{click:"click is removed."}}},handleBlur:function(e){this.focused=!1,this.$emit("blur",e),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.value])},select:function(){this.getInput().select()},resizeTextarea:function(){if(!this.$isServer){var e=this.autosize,t=this.type;if("textarea"===t)if(e){var i=e.minRows,n=e.maxRows;this.textareaCalcStyle=wt(this.$refs.textarea,i,n)}else this.textareaCalcStyle={minHeight:wt(this.$refs.textarea).minHeight}}},setNativeInputValue:function(){var e=this.getInput();e&&e.value!==this.nativeInputValue&&(e.value=this.nativeInputValue)},handleFocus:function(e){this.focused=!0,this.$emit("focus",e)},handleCompositionStart:function(){this.isComposing=!0},handleCompositionEnd:function(e){this.isComposing=!1,this.handleInput(e)},handleInput:function(e){this.isComposing||e.target.value!==this.nativeInputValue&&(this.$emit("input",e.target.value),this.$nextTick(this.setNativeInputValue))},handleChange:function(e){this.$emit("change",e.target.value)},calcIconOffset:function(e){var t=[].slice.call(this.$el.querySelectorAll(".el-input__"+e)||[]);if(t.length){for(var i=null,n=0;n=0&&e===parseInt(e,10)}}},data:function(){return{currentValue:0,userInput:null}},watch:{value:{immediate:!0,handler:function(e){var t=void 0===e?e:Number(e);if(void 0!==t){if(isNaN(t))return;if(this.stepStrictly){var i=this.getPrecision(this.step),n=Math.pow(10,i);t=Math.round(t/this.step)*n*this.step/n}void 0!==this.precision&&(t=this.toPrecision(t,this.precision))}t>=this.max&&(t=this.max),t<=this.min&&(t=this.min),this.currentValue=t,this.userInput=null,this.$emit("input",t)}}},computed:{minDisabled:function(){return this._decrease(this.value,this.step)this.max},numPrecision:function(){var e=this.value,t=this.step,i=this.getPrecision,n=this.precision,s=i(t);return void 0!==n?(s>n&&console.warn("[Element Warn][InputNumber]precision should not be less than the decimal places of step"),n):Math.max(i(e),s)},controlsAtRight:function(){return this.controls&&"right"===this.controlsPosition},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},inputNumberSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputNumberDisabled:function(){return this.disabled||(this.elForm||{}).disabled},displayValue:function(){if(null!==this.userInput)return this.userInput;var e=this.currentValue;if("number"===typeof e){if(this.stepStrictly){var t=this.getPrecision(this.step),i=Math.pow(10,t);e=Math.round(e/this.step)*i*this.step/i}void 0!==this.precision&&(e=e.toFixed(this.precision))}return e}},methods:{toPrecision:function(e,t){return void 0===t&&(t=this.numPrecision),parseFloat(Math.round(e*Math.pow(10,t))/Math.pow(10,t))},getPrecision:function(e){if(void 0===e)return 0;var t=e.toString(),i=t.indexOf("."),n=0;return-1!==i&&(n=t.length-i-1),n},_increase:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*e+i*t)/i)},_decrease:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*e-i*t)/i)},increase:function(){if(!this.inputNumberDisabled&&!this.maxDisabled){var e=this.value||0,t=this._increase(e,this.step);this.setCurrentValue(t)}},decrease:function(){if(!this.inputNumberDisabled&&!this.minDisabled){var e=this.value||0,t=this._decrease(e,this.step);this.setCurrentValue(t)}},handleBlur:function(e){this.$emit("blur",e)},handleFocus:function(e){this.$emit("focus",e)},setCurrentValue:function(e){var t=this.currentValue;"number"===typeof e&&void 0!==this.precision&&(e=this.toPrecision(e,this.precision)),e>=this.max&&(e=this.max),e<=this.min&&(e=this.min),t!==e&&(this.userInput=null,this.$emit("input",e),this.$emit("change",e,t),this.currentValue=e)},handleInput:function(e){this.userInput=e},handleInputChange:function(e){var t=""===e?void 0:Number(e);isNaN(t)&&""!==e||this.setCurrentValue(t),this.userInput=null},select:function(){this.$refs.input.select()}},mounted:function(){var e=this.$refs.input.$refs.input;e.setAttribute("role","spinbutton"),e.setAttribute("aria-valuemax",this.max),e.setAttribute("aria-valuemin",this.min),e.setAttribute("aria-valuenow",this.currentValue),e.setAttribute("aria-disabled",this.inputNumberDisabled)},updated:function(){if(this.$refs&&this.$refs.input){var e=this.$refs.input.$refs.input;e.setAttribute("aria-valuenow",this.currentValue)}}},jt=Nt,Ft=o(jt,Pt,Mt,!1,null,null,null);Ft.options.__file="packages/input-number/src/input-number.vue";var Lt=Ft.exports;Lt.install=function(e){e.component(Lt.name,Lt)};var Vt=Lt,At=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-radio",class:[e.border&&e.radioSize?"el-radio--"+e.radioSize:"",{"is-disabled":e.isDisabled},{"is-focus":e.focus},{"is-bordered":e.border},{"is-checked":e.model===e.label}],attrs:{role:"radio","aria-checked":e.model===e.label,"aria-disabled":e.isDisabled,tabindex:e.tabIndex},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"]))return null;t.stopPropagation(),t.preventDefault(),e.model=e.isDisabled?e.model:e.label}}},[i("span",{staticClass:"el-radio__input",class:{"is-disabled":e.isDisabled,"is-checked":e.model===e.label}},[i("span",{staticClass:"el-radio__inner"}),i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],ref:"radio",staticClass:"el-radio__original",attrs:{type:"radio","aria-hidden":"true",name:e.name,disabled:e.isDisabled,tabindex:"-1"},domProps:{value:e.label,checked:e._q(e.model,e.label)},on:{focus:function(t){e.focus=!0},blur:function(t){e.focus=!1},change:[function(t){e.model=e.label},e.handleChange]}})]),i("span",{staticClass:"el-radio__label",on:{keydown:function(e){e.stopPropagation()}}},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2)])},zt=[];At._withStripped=!0;var Bt={name:"ElRadio",mixins:[O.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElRadio",props:{value:{},label:{},disabled:Boolean,name:String,border:Boolean,size:String},data:function(){return{focus:!1}},computed:{isGroup:function(){var e=this.$parent;while(e){if("ElRadioGroup"===e.$options.componentName)return this._radioGroup=e,!0;e=e.$parent}return!1},model:{get:function(){return this.isGroup?this._radioGroup.value:this.value},set:function(e){this.isGroup?this.dispatch("ElRadioGroup","input",[e]):this.$emit("input",e),this.$refs.radio&&(this.$refs.radio.checked=this.model===this.label)}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},radioSize:function(){var e=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._radioGroup.radioGroupSize||e},isDisabled:function(){return this.isGroup?this._radioGroup.disabled||this.disabled||(this.elForm||{}).disabled:this.disabled||(this.elForm||{}).disabled},tabIndex:function(){return this.isDisabled||this.isGroup&&this.model!==this.label?-1:0}},methods:{handleChange:function(){var e=this;this.$nextTick(function(){e.$emit("change",e.model),e.isGroup&&e.dispatch("ElRadioGroup","handleChange",e.model)})}}},Rt=Bt,Ht=o(Rt,At,zt,!1,null,null,null);Ht.options.__file="packages/radio/src/radio.vue";var Wt=Ht.exports;Wt.install=function(e){e.component(Wt.name,Wt)};var qt=Wt,Yt=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-radio-group",attrs:{role:"radiogroup"},on:{keydown:e.handleKeydown}},[e._t("default")],2)},Kt=[];Yt._withStripped=!0;var Ut=Object.freeze({LEFT:37,UP:38,RIGHT:39,DOWN:40}),Gt={name:"ElRadioGroup",componentName:"ElRadioGroup",inject:{elFormItem:{default:""}},mixins:[O.a],props:{value:{},size:String,fill:String,textColor:String,disabled:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},radioGroupSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},created:function(){var e=this;this.$on("handleChange",function(t){e.$emit("change",t)})},mounted:function(){var e=this.$el.querySelectorAll("[type=radio]"),t=this.$el.querySelectorAll("[role=radio]")[0];![].some.call(e,function(e){return e.checked})&&t&&(t.tabIndex=0)},methods:{handleKeydown:function(e){var t=e.target,i="INPUT"===t.nodeName?"[type=radio]":"[role=radio]",n=this.$el.querySelectorAll(i),s=n.length,r=[].indexOf.call(n,t),a=this.$el.querySelectorAll("[role=radio]");switch(e.keyCode){case Ut.LEFT:case Ut.UP:e.stopPropagation(),e.preventDefault(),0===r?(a[s-1].click(),a[s-1].focus()):(a[r-1].click(),a[r-1].focus());break;case Ut.RIGHT:case Ut.DOWN:r===s-1?(e.stopPropagation(),e.preventDefault(),a[0].click(),a[0].focus()):(a[r+1].click(),a[r+1].focus());break;default:break}}},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",[this.value])}}},Xt=Gt,Qt=o(Xt,Yt,Kt,!1,null,null,null);Qt.options.__file="packages/radio/src/radio-group.vue";var Zt=Qt.exports;Zt.install=function(e){e.component(Zt.name,Zt)};var Jt=Zt,ei=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-radio-button",class:[e.size?"el-radio-button--"+e.size:"",{"is-active":e.value===e.label},{"is-disabled":e.isDisabled},{"is-focus":e.focus}],attrs:{role:"radio","aria-checked":e.value===e.label,"aria-disabled":e.isDisabled,tabindex:e.tabIndex},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"]))return null;t.stopPropagation(),t.preventDefault(),e.value=e.isDisabled?e.value:e.label}}},[i("input",{directives:[{name:"model",rawName:"v-model",value:e.value,expression:"value"}],staticClass:"el-radio-button__orig-radio",attrs:{type:"radio",name:e.name,disabled:e.isDisabled,tabindex:"-1"},domProps:{value:e.label,checked:e._q(e.value,e.label)},on:{change:[function(t){e.value=e.label},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}),i("span",{staticClass:"el-radio-button__inner",style:e.value===e.label?e.activeStyle:null,on:{keydown:function(e){e.stopPropagation()}}},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2)])},ti=[];ei._withStripped=!0;var ii={name:"ElRadioButton",mixins:[O.a],inject:{elForm:{default:""},elFormItem:{default:""}},props:{label:{},disabled:Boolean,name:String},data:function(){return{focus:!1}},computed:{value:{get:function(){return this._radioGroup.value},set:function(e){this._radioGroup.$emit("input",e)}},_radioGroup:function(){var e=this.$parent;while(e){if("ElRadioGroup"===e.$options.componentName)return e;e=e.$parent}return!1},activeStyle:function(){return{backgroundColor:this._radioGroup.fill||"",borderColor:this._radioGroup.fill||"",boxShadow:this._radioGroup.fill?"-1px 0 0 0 "+this._radioGroup.fill:"",color:this._radioGroup.textColor||""}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},size:function(){return this._radioGroup.radioGroupSize||this._elFormItemSize||(this.$ELEMENT||{}).size},isDisabled:function(){return this.disabled||this._radioGroup.disabled||(this.elForm||{}).disabled},tabIndex:function(){return this.isDisabled||this._radioGroup&&this.value!==this.label?-1:0}},methods:{handleChange:function(){var e=this;this.$nextTick(function(){e.dispatch("ElRadioGroup","handleChange",e.value)})}}},ni=ii,si=o(ni,ei,ti,!1,null,null,null);si.options.__file="packages/radio/src/radio-button.vue";var ri=si.exports;ri.install=function(e){e.component(ri.name,ri)};var ai=ri,oi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-checkbox",class:[e.border&&e.checkboxSize?"el-checkbox--"+e.checkboxSize:"",{"is-disabled":e.isDisabled},{"is-bordered":e.border},{"is-checked":e.isChecked}],attrs:{role:"checkbox","aria-checked":e.indeterminate?"mixed":e.isChecked,"aria-disabled":e.isDisabled,id:e.id}},[i("span",{staticClass:"el-checkbox__input",class:{"is-disabled":e.isDisabled,"is-checked":e.isChecked,"is-indeterminate":e.indeterminate,"is-focus":e.focus},attrs:{"aria-checked":"mixed"}},[i("span",{staticClass:"el-checkbox__inner"}),e.trueLabel||e.falseLabel?i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":"true",name:e.name,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e._q(e.model,e.trueLabel)},on:{change:[function(t){var i=e.model,n=t.target,s=n.checked?e.trueLabel:e.falseLabel;if(Array.isArray(i)){var r=null,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":"true",disabled:e.isDisabled,name:e.name},domProps:{value:e.label,checked:Array.isArray(e.model)?e._i(e.model,e.label)>-1:e.model},on:{change:[function(t){var i=e.model,n=t.target,s=!!n.checked;if(Array.isArray(i)){var r=e.label,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})]),e.$slots.default||e.label?i("span",{staticClass:"el-checkbox__label"},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2):e._e()])},li=[];oi._withStripped=!0;var ci={name:"ElCheckbox",mixins:[O.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElCheckbox",data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(e){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&e.lengththis._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[e])):(this.$emit("input",e),this.selfModel=e)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},isGroup:function(){var e=this.$parent;while(e){if("ElCheckboxGroup"===e.$options.componentName)return this._checkboxGroup=e,!0;e=e.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isLimitDisabled:function(){var e=this._checkboxGroup,t=e.max,i=e.min;return!(!t&&!i)&&this.model.length>=t&&!this.isChecked||this.model.length<=i&&this.isChecked},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxSize:function(){var e=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._checkboxGroup.checkboxGroupSize||e}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number],id:String,controls:String,border:Boolean,size:String},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(e){var t=this;if(!this.isLimitExceeded){var i=void 0;i=e.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",i,e),this.$nextTick(function(){t.isGroup&&t.dispatch("ElCheckboxGroup","change",[t._checkboxGroup.value])})}}},created:function(){this.checked&&this.addToStore()},mounted:function(){this.indeterminate&&this.$el.setAttribute("aria-controls",this.controls)},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",e)}}},ui=ci,hi=o(ui,oi,li,!1,null,null,null);hi.options.__file="packages/checkbox/src/checkbox.vue";var di=hi.exports;di.install=function(e){e.component(di.name,di)};var pi=di,fi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-checkbox-button",class:[e.size?"el-checkbox-button--"+e.size:"",{"is-disabled":e.isDisabled},{"is-checked":e.isChecked},{"is-focus":e.focus}],attrs:{role:"checkbox","aria-checked":e.isChecked,"aria-disabled":e.isDisabled}},[e.trueLabel||e.falseLabel?i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{type:"checkbox",name:e.name,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e._q(e.model,e.trueLabel)},on:{change:[function(t){var i=e.model,n=t.target,s=n.checked?e.trueLabel:e.falseLabel;if(Array.isArray(i)){var r=null,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox-button__original",attrs:{type:"checkbox",name:e.name,disabled:e.isDisabled},domProps:{value:e.label,checked:Array.isArray(e.model)?e._i(e.model,e.label)>-1:e.model},on:{change:[function(t){var i=e.model,n=t.target,s=!!n.checked;if(Array.isArray(i)){var r=e.label,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}),e.$slots.default||e.label?i("span",{staticClass:"el-checkbox-button__inner",style:e.isChecked?e.activeStyle:null},[e._t("default",[e._v(e._s(e.label))])],2):e._e()])},mi=[];fi._withStripped=!0;var vi={name:"ElCheckboxButton",mixins:[O.a],inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},props:{value:{},label:{},disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number]},computed:{model:{get:function(){return this._checkboxGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(e){this._checkboxGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&e.lengththis._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[e])):void 0!==this.value?this.$emit("input",e):this.selfModel=e}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},_checkboxGroup:function(){var e=this.$parent;while(e){if("ElCheckboxGroup"===e.$options.componentName)return e;e=e.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},activeStyle:function(){return{backgroundColor:this._checkboxGroup.fill||"",borderColor:this._checkboxGroup.fill||"",color:this._checkboxGroup.textColor||"","box-shadow":"-1px 0 0 0 "+this._checkboxGroup.fill}},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},size:function(){return this._checkboxGroup.checkboxGroupSize||this._elFormItemSize||(this.$ELEMENT||{}).size},isLimitDisabled:function(){var e=this._checkboxGroup,t=e.max,i=e.min;return!(!t&&!i)&&this.model.length>=t&&!this.isChecked||this.model.length<=i&&this.isChecked},isDisabled:function(){return this._checkboxGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled}},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(e){var t=this;if(!this.isLimitExceeded){var i=void 0;i=e.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",i,e),this.$nextTick(function(){t._checkboxGroup&&t.dispatch("ElCheckboxGroup","change",[t._checkboxGroup.value])})}}},created:function(){this.checked&&this.addToStore()}},gi=vi,bi=o(gi,fi,mi,!1,null,null,null);bi.options.__file="packages/checkbox/src/checkbox-button.vue";var yi=bi.exports;yi.install=function(e){e.component(yi.name,yi)};var _i=yi,xi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-checkbox-group",attrs:{role:"group","aria-label":"checkbox-group"}},[e._t("default")],2)},Ci=[];xi._withStripped=!0;var wi={name:"ElCheckboxGroup",componentName:"ElCheckboxGroup",mixins:[O.a],inject:{elFormItem:{default:""}},props:{value:{},disabled:Boolean,min:Number,max:Number,size:String,fill:String,textColor:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxGroupSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size}},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",[e])}}},ki=wi,Si=o(ki,xi,Ci,!1,null,null,null);Si.options.__file="packages/checkbox/src/checkbox-group.vue";var Di=Si.exports;Di.install=function(e){e.component(Di.name,Di)};var $i=Di,Oi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-switch",class:{"is-disabled":e.switchDisabled,"is-checked":e.checked},attrs:{role:"switch","aria-checked":e.checked,"aria-disabled":e.switchDisabled},on:{click:function(t){return t.preventDefault(),e.switchValue(t)}}},[i("input",{ref:"input",staticClass:"el-switch__input",attrs:{type:"checkbox",id:e.id,name:e.name,"true-value":e.activeValue,"false-value":e.inactiveValue,disabled:e.switchDisabled},on:{change:e.handleChange,keydown:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.switchValue(t):null}}}),e.inactiveIconClass||e.inactiveText?i("span",{class:["el-switch__label","el-switch__label--left",e.checked?"":"is-active"]},[e.inactiveIconClass?i("i",{class:[e.inactiveIconClass]}):e._e(),!e.inactiveIconClass&&e.inactiveText?i("span",{attrs:{"aria-hidden":e.checked}},[e._v(e._s(e.inactiveText))]):e._e()]):e._e(),i("span",{ref:"core",staticClass:"el-switch__core",style:{width:e.coreWidth+"px"}}),e.activeIconClass||e.activeText?i("span",{class:["el-switch__label","el-switch__label--right",e.checked?"is-active":""]},[e.activeIconClass?i("i",{class:[e.activeIconClass]}):e._e(),!e.activeIconClass&&e.activeText?i("span",{attrs:{"aria-hidden":!e.checked}},[e._v(e._s(e.activeText))]):e._e()]):e._e()])},Ei=[];Oi._withStripped=!0;var Ti={name:"ElSwitch",mixins:[Q()("input"),D.a,O.a],inject:{elForm:{default:""}},props:{value:{type:[Boolean,String,Number],default:!1},disabled:{type:Boolean,default:!1},width:{type:Number,default:40},activeIconClass:{type:String,default:""},inactiveIconClass:{type:String,default:""},activeText:String,inactiveText:String,activeColor:{type:String,default:""},inactiveColor:{type:String,default:""},activeValue:{type:[Boolean,String,Number],default:!0},inactiveValue:{type:[Boolean,String,Number],default:!1},name:{type:String,default:""},validateEvent:{type:Boolean,default:!0},id:String},data:function(){return{coreWidth:this.width}},created:function(){~[this.activeValue,this.inactiveValue].indexOf(this.value)||this.$emit("input",this.inactiveValue)},computed:{checked:function(){return this.value===this.activeValue},switchDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{checked:function(){this.$refs.input.checked=this.checked,(this.activeColor||this.inactiveColor)&&this.setBackgroundColor(),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[this.value])}},methods:{handleChange:function(e){var t=this,i=this.checked?this.inactiveValue:this.activeValue;this.$emit("input",i),this.$emit("change",i),this.$nextTick(function(){t.$refs.input.checked=t.checked})},setBackgroundColor:function(){var e=this.checked?this.activeColor:this.inactiveColor;this.$refs.core.style.borderColor=e,this.$refs.core.style.backgroundColor=e},switchValue:function(){!this.switchDisabled&&this.handleChange()},getMigratingConfig:function(){return{props:{"on-color":"on-color is renamed to active-color.","off-color":"off-color is renamed to inactive-color.","on-text":"on-text is renamed to active-text.","off-text":"off-text is renamed to inactive-text.","on-value":"on-value is renamed to active-value.","off-value":"off-value is renamed to inactive-value.","on-icon-class":"on-icon-class is renamed to active-icon-class.","off-icon-class":"off-icon-class is renamed to inactive-icon-class."}}}},mounted:function(){this.coreWidth=this.width||40,(this.activeColor||this.inactiveColor)&&this.setBackgroundColor(),this.$refs.input.checked=this.checked}},Pi=Ti,Mi=o(Pi,Oi,Ei,!1,null,null,null);Mi.options.__file="packages/switch/src/component.vue";var Ii=Mi.exports;Ii.install=function(e){e.component(Ii.name,Ii)};var Ni=Ii,ji=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleClose,expression:"handleClose"}],staticClass:"el-select",class:[e.selectSize?"el-select--"+e.selectSize:""],on:{click:function(t){return t.stopPropagation(),e.toggleMenu(t)}}},[e.multiple?i("div",{ref:"tags",staticClass:"el-select__tags",style:{"max-width":e.inputWidth-32+"px",width:"100%"}},[e.collapseTags&&e.selected.length?i("span",[i("el-tag",{attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:e.selected[0].hitState,type:"info","disable-transitions":""},on:{close:function(t){e.deleteTag(t,e.selected[0])}}},[i("span",{staticClass:"el-select__tags-text"},[e._v(e._s(e.selected[0].currentLabel))])]),e.selected.length>1?i("el-tag",{attrs:{closable:!1,size:e.collapseTagSize,type:"info","disable-transitions":""}},[i("span",{staticClass:"el-select__tags-text"},[e._v("+ "+e._s(e.selected.length-1))])]):e._e()],1):e._e(),e.collapseTags?e._e():i("transition-group",{on:{"after-leave":e.resetInputHeight}},e._l(e.selected,function(t){return i("el-tag",{key:e.getValueKey(t),attrs:{closable:!e.selectDisabled,size:e.collapseTagSize,hit:t.hitState,type:"info","disable-transitions":""},on:{close:function(i){e.deleteTag(i,t)}}},[i("span",{staticClass:"el-select__tags-text"},[e._v(e._s(t.currentLabel))])])}),1),e.filterable?i("input",{directives:[{name:"model",rawName:"v-model",value:e.query,expression:"query"}],ref:"input",staticClass:"el-select__input",class:[e.selectSize?"is-"+e.selectSize:""],style:{"flex-grow":"1",width:e.inputLength/(e.inputWidth-32)+"%","max-width":e.inputWidth-42+"px"},attrs:{type:"text",disabled:e.selectDisabled,autocomplete:e.autoComplete||e.autocomplete},domProps:{value:e.query},on:{focus:e.handleFocus,blur:function(t){e.softFocus=!1},click:function(e){e.stopPropagation()},keyup:e.managePlaceholder,keydown:[e.resetInputState,function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.preventDefault(),e.navigateOptions("prev")},function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?(t.preventDefault(),e.selectOption(t)):null},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){return"button"in t||!e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?e.deletePrevTag(t):null}],compositionstart:e.handleComposition,compositionupdate:e.handleComposition,compositionend:e.handleComposition,input:[function(t){t.target.composing||(e.query=t.target.value)},e.debouncedQueryChange]}}):e._e()],1):e._e(),i("el-input",{ref:"reference",class:{"is-focus":e.visible},attrs:{type:"text",placeholder:e.currentPlaceholder,name:e.name,id:e.id,autocomplete:e.autoComplete||e.autocomplete,size:e.selectSize,disabled:e.selectDisabled,readonly:e.readonly,"validate-event":!1},on:{focus:e.handleFocus,blur:e.handleBlur},nativeOn:{keyup:function(t){return e.debouncedOnInputChange(t)},keydown:[function(t){if(!("button"in t)&&e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"]))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("next")},function(t){if(!("button"in t)&&e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"]))return null;t.stopPropagation(),t.preventDefault(),e.navigateOptions("prev")},function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?(t.preventDefault(),e.selectOption(t)):null},function(t){if(!("button"in t)&&e._k(t.keyCode,"esc",27,t.key,["Esc","Escape"]))return null;t.stopPropagation(),t.preventDefault(),e.visible=!1},function(t){if(!("button"in t)&&e._k(t.keyCode,"tab",9,t.key,"Tab"))return null;e.visible=!1}],paste:function(t){return e.debouncedOnInputChange(t)},mouseenter:function(t){e.inputHovering=!0},mouseleave:function(t){e.inputHovering=!1}},model:{value:e.selectedLabel,callback:function(t){e.selectedLabel=t},expression:"selectedLabel"}},[e.$slots.prefix?i("template",{slot:"prefix"},[e._t("prefix")],2):e._e(),i("template",{slot:"suffix"},[i("i",{directives:[{name:"show",rawName:"v-show",value:!e.showClose,expression:"!showClose"}],class:["el-select__caret","el-input__icon","el-icon-"+e.iconClass]}),e.showClose?i("i",{staticClass:"el-select__caret el-input__icon el-icon-circle-close",on:{click:e.handleClearClick}}):e._e()])],2),i("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":e.doDestroy}},[i("el-select-menu",{directives:[{name:"show",rawName:"v-show",value:e.visible&&!1!==e.emptyText,expression:"visible && emptyText !== false"}],ref:"popper",attrs:{"append-to-body":e.popperAppendToBody}},[i("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.options.length>0&&!e.loading,expression:"options.length > 0 && !loading"}],ref:"scrollbar",class:{"is-empty":!e.allowCreate&&e.query&&0===e.filteredOptionsCount},attrs:{tag:"ul","wrap-class":"el-select-dropdown__wrap","view-class":"el-select-dropdown__list"}},[e.showNewOption?i("el-option",{attrs:{value:e.query,created:""}}):e._e(),e._t("default")],2),e.emptyText&&(!e.allowCreate||e.loading||e.allowCreate&&0===e.options.length)?[e.$slots.empty?e._t("empty"):i("p",{staticClass:"el-select-dropdown__empty"},[e._v("\n "+e._s(e.emptyText)+"\n ")])]:e._e()],2)],1)],1)},Fi=[];ji._withStripped=!0;var Li=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-select-dropdown el-popper",class:[{"is-multiple":e.$parent.multiple},e.popperClass],style:{minWidth:e.minWidth}},[e._t("default")],2)},Vi=[];Li._withStripped=!0;var Ai={name:"ElSelectDropdown",componentName:"ElSelectDropdown",mixins:[H.a],props:{placement:{default:"bottom-start"},boundariesPadding:{default:0},popperOptions:{default:function(){return{gpuAcceleration:!1}}},visibleArrow:{default:!0},appendToBody:{type:Boolean,default:!0}},data:function(){return{minWidth:""}},computed:{popperClass:function(){return this.$parent.popperClass}},watch:{"$parent.inputWidth":function(){this.minWidth=this.$parent.$el.getBoundingClientRect().width+"px"}},mounted:function(){var e=this;this.referenceElm=this.$parent.$refs.reference.$el,this.$parent.popperElm=this.popperElm=this.$el,this.$on("updatePopper",function(){e.$parent.visible&&e.updatePopper()}),this.$on("destroyPopper",this.destroyPopper)}},zi=Ai,Bi=o(zi,Li,Vi,!1,null,null,null);Bi.options.__file="packages/select/src/select-dropdown.vue";var Ri=Bi.exports,Hi=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-dropdown__item",class:{selected:e.itemSelected,"is-disabled":e.disabled||e.groupDisabled||e.limitReached,hover:e.hover},on:{mouseenter:e.hoverItem,click:function(t){return t.stopPropagation(),e.selectOptionClick(t)}}},[e._t("default",[i("span",[e._v(e._s(e.currentLabel))])])],2)},Wi=[];Hi._withStripped=!0;var qi="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yi={mixins:[O.a],name:"ElOption",componentName:"ElOption",inject:["select"],props:{value:{required:!0},label:[String,Number],created:Boolean,disabled:{type:Boolean,default:!1}},data:function(){return{index:-1,groupDisabled:!1,visible:!0,hitState:!1,hover:!1}},computed:{isObject:function(){return"[object object]"===Object.prototype.toString.call(this.value).toLowerCase()},currentLabel:function(){return this.label||(this.isObject?"":this.value)},currentValue:function(){return this.value||this.label||""},itemSelected:function(){return this.select.multiple?this.contains(this.select.value,this.value):this.isEqual(this.value,this.select.value)},limitReached:function(){return!!this.select.multiple&&(!this.itemSelected&&(this.select.value||[]).length>=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(e,t){var i=this.select,n=i.remote,s=i.valueKey;if(!this.created&&!n){if(s&&"object"===("undefined"===typeof e?"undefined":qi(e))&&"object"===("undefined"===typeof t?"undefined":qi(t))&&e[s]===t[s])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(e,t){if(this.isObject){var i=this.select.valueKey;return Object(b["getValueByPath"])(e,i)===Object(b["getValueByPath"])(t,i)}return e===t},contains:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(this.isObject){var i=this.select.valueKey;return e&&e.some(function(e){return Object(b["getValueByPath"])(e,i)===Object(b["getValueByPath"])(t,i)})}return e&&e.indexOf(t)>-1},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(e){this.visible=new RegExp(Object(b["escapeRegexpString"])(e),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){this.select.onOptionDestroy(this.select.options.indexOf(this))}},Ki=Yi,Ui=o(Ki,Hi,Wi,!1,null,null,null);Ui.options.__file="packages/select/src/option.vue";var Gi=Ui.exports,Xi=i(28),Qi=i.n(Xi),Zi=i(11),Ji=i(14),en=i.n(Ji),tn=i(27),nn=i.n(tn),sn={data:function(){return{hoverOption:-1}},computed:{optionsAllDisabled:function(){return this.options.filter(function(e){return e.visible}).every(function(e){return e.disabled})}},watch:{hoverIndex:function(e){var t=this;"number"===typeof e&&e>-1&&(this.hoverOption=this.options[e]||{}),this.options.forEach(function(e){e.hover=t.hoverOption===e})}},methods:{navigateOptions:function(e){var t=this;if(this.visible){if(0!==this.options.length&&0!==this.filteredOptionsCount&&!this.optionsAllDisabled){"next"===e?(this.hoverIndex++,this.hoverIndex===this.options.length&&(this.hoverIndex=0)):"prev"===e&&(this.hoverIndex--,this.hoverIndex<0&&(this.hoverIndex=this.options.length-1));var i=this.options[this.hoverIndex];!0!==i.disabled&&!0!==i.groupDisabled&&i.visible||this.navigateOptions(e),this.$nextTick(function(){return t.scrollToOption(t.hoverOption)})}}else this.visible=!0}}},rn=i(22),an={mixins:[O.a,g.a,Q()("reference"),sn],name:"ElSelect",componentName:"ElSelect",inject:{elForm:{default:""},elFormItem:{default:""}},provide:function(){return{select:this}},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},readonly:function(){return!this.filterable||this.multiple||!Object(b["isIE"])()&&!Object(b["isEdge"])()&&!this.visible},showClose:function(){var e=this.multiple?Array.isArray(this.value)&&this.value.length>0:void 0!==this.value&&null!==this.value&&""!==this.value,t=this.clearable&&!this.selectDisabled&&this.inputHovering&&e;return t},iconClass:function(){return this.remote&&this.filterable?"":this.visible?"arrow-up is-reverse":"arrow-up"},debounce:function(){return this.remote?300:0},emptyText:function(){return this.loading?this.loadingText||this.t("el.select.loading"):(!this.remote||""!==this.query||0!==this.options.length)&&(this.filterable&&this.query&&this.options.length>0&&0===this.filteredOptionsCount?this.noMatchText||this.t("el.select.noMatch"):0===this.options.length?this.noDataText||this.t("el.select.noData"):null)},showNewOption:function(){var e=this,t=this.options.filter(function(e){return!e.created}).some(function(t){return t.currentLabel===e.query});return this.filterable&&this.allowCreate&&""!==this.query&&!t},selectSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},selectDisabled:function(){return this.disabled||(this.elForm||{}).disabled},collapseTagSize:function(){return["small","mini"].indexOf(this.selectSize)>-1?"mini":"small"}},components:{ElInput:m.a,ElSelectMenu:Ri,ElOption:Gi,ElTag:Qi.a,ElScrollbar:q.a},directives:{Clickoutside:A.a},props:{name:String,id:String,value:{required:!0},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},automaticDropdown:Boolean,size:String,disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:String,remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String,default:function(){return Object(Ji["t"])("el.select.placeholder")}},defaultFirstOption:Boolean,reserveKeyword:Boolean,valueKey:{type:String,default:"value"},collapseTags:Boolean,popperAppendToBody:{type:Boolean,default:!0}},data:function(){return{options:[],cachedOptions:[],createdLabel:null,createdSelected:!1,selected:this.multiple?[]:{},inputLength:20,inputWidth:0,initialInputHeight:0,cachedPlaceHolder:"",optionsCount:0,filteredOptionsCount:0,visible:!1,softFocus:!1,selectedLabel:"",hoverIndex:-1,query:"",previousQuery:null,inputHovering:!1,currentPlaceholder:"",menuVisibleOnFocus:!1,isOnComposition:!1,isSilentBlur:!1}},watch:{selectDisabled:function(){var e=this;this.$nextTick(function(){e.resetInputHeight()})},placeholder:function(e){this.cachedPlaceHolder=this.currentPlaceholder=e},value:function(e,t){this.multiple&&(this.resetInputHeight(),e&&e.length>0||this.$refs.input&&""!==this.query?this.currentPlaceholder="":this.currentPlaceholder=this.cachedPlaceHolder,this.filterable&&!this.reserveKeyword&&(this.query="",this.handleQueryChange(this.query))),this.setSelected(),this.filterable&&!this.multiple&&(this.inputLength=20),Object(b["valueEquals"])(e,t)||this.dispatch("ElFormItem","el.form.change",e)},visible:function(e){var t=this;e?(this.broadcast("ElSelectDropdown","updatePopper"),this.filterable&&(this.query=this.remote?"":this.selectedLabel,this.handleQueryChange(this.query),this.multiple?this.$refs.input.focus():(this.remote||(this.broadcast("ElOption","queryChange",""),this.broadcast("ElOptionGroup","queryChange")),this.selectedLabel&&(this.currentPlaceholder=this.selectedLabel,this.selectedLabel="")))):(this.broadcast("ElSelectDropdown","destroyPopper"),this.$refs.input&&this.$refs.input.blur(),this.query="",this.previousQuery=null,this.selectedLabel="",this.inputLength=20,this.menuVisibleOnFocus=!1,this.resetHoverIndex(),this.$nextTick(function(){t.$refs.input&&""===t.$refs.input.value&&0===t.selected.length&&(t.currentPlaceholder=t.cachedPlaceHolder)}),this.multiple||(this.selected&&(this.filterable&&this.allowCreate&&this.createdSelected&&this.createdLabel?this.selectedLabel=this.createdLabel:this.selectedLabel=this.selected.currentLabel,this.filterable&&(this.query=this.selectedLabel)),this.filterable&&(this.currentPlaceholder=this.cachedPlaceHolder))),this.$emit("visible-change",e)},options:function(){var e=this;if(!this.$isServer){this.$nextTick(function(){e.broadcast("ElSelectDropdown","updatePopper")}),this.multiple&&this.resetInputHeight();var t=this.$el.querySelectorAll("input");-1===[].indexOf.call(t,document.activeElement)&&this.setSelected(),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()}}},methods:{handleComposition:function(e){var t=e.target.value;if("compositionend"===e.type)this.isOnComposition=!1,this.handleQueryChange(t);else{var i=t[t.length-1]||"";this.isOnComposition=!Object(rn["isKorean"])(i)}},handleQueryChange:function(e){var t=this;this.previousQuery===e||this.isOnComposition||(null!==this.previousQuery||"function"!==typeof this.filterMethod&&"function"!==typeof this.remoteMethod?(this.previousQuery=e,this.$nextTick(function(){t.visible&&t.broadcast("ElSelectDropdown","updatePopper")}),this.hoverIndex=-1,this.multiple&&this.filterable&&this.$nextTick(function(){var e=15*t.$refs.input.value.length+20;t.inputLength=t.collapseTags?Math.min(50,e):e,t.managePlaceholder(),t.resetInputHeight()}),this.remote&&"function"===typeof this.remoteMethod?(this.hoverIndex=-1,this.remoteMethod(e)):"function"===typeof this.filterMethod?(this.filterMethod(e),this.broadcast("ElOptionGroup","queryChange")):(this.filteredOptionsCount=this.optionsCount,this.broadcast("ElOption","queryChange",e),this.broadcast("ElOptionGroup","queryChange")),this.defaultFirstOption&&(this.filterable||this.remote)&&this.filteredOptionsCount&&this.checkDefaultFirstOption()):this.previousQuery=e)},scrollToOption:function(e){var t=Array.isArray(e)&&e[0]?e[0].$el:e.$el;if(this.$refs.popper&&t){var i=this.$refs.popper.$el.querySelector(".el-select-dropdown__wrap");nn()(i,t)}this.$refs.scrollbar&&this.$refs.scrollbar.handleScroll()},handleMenuEnter:function(){var e=this;this.$nextTick(function(){return e.scrollToOption(e.selected)})},emitChange:function(e){Object(b["valueEquals"])(this.value,e)||this.$emit("change",e)},getOption:function(e){for(var t=void 0,i="[object object]"===Object.prototype.toString.call(e).toLowerCase(),n="[object null]"===Object.prototype.toString.call(e).toLowerCase(),s="[object undefined]"===Object.prototype.toString.call(e).toLowerCase(),r=this.cachedOptions.length-1;r>=0;r--){var a=this.cachedOptions[r],o=i?Object(b["getValueByPath"])(a.value,this.valueKey)===Object(b["getValueByPath"])(e,this.valueKey):a.value===e;if(o){t=a;break}}if(t)return t;var l=i||n||s?"":e,c={value:e,currentLabel:l};return this.multiple&&(c.hitState=!1),c},setSelected:function(){var e=this;if(!this.multiple){var t=this.getOption(this.value);return t.created?(this.createdLabel=t.currentLabel,this.createdSelected=!0):this.createdSelected=!1,this.selectedLabel=t.currentLabel,this.selected=t,void(this.filterable&&(this.query=this.selectedLabel))}var i=[];Array.isArray(this.value)&&this.value.forEach(function(t){i.push(e.getOption(t))}),this.selected=i,this.$nextTick(function(){e.resetInputHeight()})},handleFocus:function(e){this.softFocus?this.softFocus=!1:((this.automaticDropdown||this.filterable)&&(this.visible=!0,this.menuVisibleOnFocus=!0),this.$emit("focus",e))},blur:function(){this.visible=!1,this.$refs.reference.blur()},handleBlur:function(e){var t=this;setTimeout(function(){t.isSilentBlur?t.isSilentBlur=!1:t.$emit("blur",e)},50),this.softFocus=!1},handleClearClick:function(e){this.deleteSelected(e)},doDestroy:function(){this.$refs.popper&&this.$refs.popper.doDestroy()},handleClose:function(){this.visible=!1},toggleLastOptionHitState:function(e){if(Array.isArray(this.selected)){var t=this.selected[this.selected.length-1];if(t)return!0===e||!1===e?(t.hitState=e,e):(t.hitState=!t.hitState,t.hitState)}},deletePrevTag:function(e){if(e.target.value.length<=0&&!this.toggleLastOptionHitState()){var t=this.value.slice();t.pop(),this.$emit("input",t),this.emitChange(t)}},managePlaceholder:function(){""!==this.currentPlaceholder&&(this.currentPlaceholder=this.$refs.input.value?"":this.cachedPlaceHolder)},resetInputState:function(e){8!==e.keyCode&&this.toggleLastOptionHitState(!1),this.inputLength=15*this.$refs.input.value.length+20,this.resetInputHeight()},resetInputHeight:function(){var e=this;this.collapseTags&&!this.filterable||this.$nextTick(function(){if(e.$refs.reference){var t=e.$refs.reference.$el.childNodes,i=[].filter.call(t,function(e){return"INPUT"===e.tagName})[0],n=e.$refs.tags,s=e.initialInputHeight||40;i.style.height=0===e.selected.length?s+"px":Math.max(n?n.clientHeight+(n.clientHeight>s?6:0):0,s)+"px",e.visible&&!1!==e.emptyText&&e.broadcast("ElSelectDropdown","updatePopper")}})},resetHoverIndex:function(){var e=this;setTimeout(function(){e.multiple?e.selected.length>0?e.hoverIndex=Math.min.apply(null,e.selected.map(function(t){return e.options.indexOf(t)})):e.hoverIndex=-1:e.hoverIndex=e.options.indexOf(e.selected)},300)},handleOptionSelect:function(e,t){var i=this;if(this.multiple){var n=(this.value||[]).slice(),s=this.getValueIndex(n,e.value);s>-1?n.splice(s,1):(this.multipleLimit<=0||n.length0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1],i="[object object]"===Object.prototype.toString.call(t).toLowerCase();if(i){var n=this.valueKey,s=-1;return e.some(function(e,i){return Object(b["getValueByPath"])(e,n)===Object(b["getValueByPath"])(t,n)&&(s=i,!0)}),s}return e.indexOf(t)},toggleMenu:function(){this.selectDisabled||(this.menuVisibleOnFocus?this.menuVisibleOnFocus=!1:this.visible=!this.visible,this.visible&&(this.$refs.input||this.$refs.reference).focus())},selectOption:function(){this.visible?this.options[this.hoverIndex]&&this.handleOptionSelect(this.options[this.hoverIndex]):this.toggleMenu()},deleteSelected:function(e){e.stopPropagation();var t=this.multiple?[]:"";this.$emit("input",t),this.emitChange(t),this.visible=!1,this.$emit("clear")},deleteTag:function(e,t){var i=this.selected.indexOf(t);if(i>-1&&!this.selectDisabled){var n=this.value.slice();n.splice(i,1),this.$emit("input",n),this.emitChange(n),this.$emit("remove-tag",t.value)}e.stopPropagation()},onInputChange:function(){this.filterable&&this.query!==this.selectedLabel&&(this.query=this.selectedLabel,this.handleQueryChange(this.query))},onOptionDestroy:function(e){e>-1&&(this.optionsCount--,this.filteredOptionsCount--,this.options.splice(e,1))},resetInputWidth:function(){this.inputWidth=this.$refs.reference.$el.getBoundingClientRect().width},handleResize:function(){this.resetInputWidth(),this.multiple&&this.resetInputHeight()},checkDefaultFirstOption:function(){this.hoverIndex=-1;for(var e=!1,t=this.options.length-1;t>=0;t--)if(this.options[t].created){e=!0,this.hoverIndex=t;break}if(!e)for(var i=0;i!==this.options.length;++i){var n=this.options[i];if(this.query){if(!n.disabled&&!n.groupDisabled&&n.visible){this.hoverIndex=i;break}}else if(n.itemSelected){this.hoverIndex=i;break}}},getValueKey:function(e){return"[object object]"!==Object.prototype.toString.call(e.value).toLowerCase()?e.value:Object(b["getValueByPath"])(e.value,this.valueKey)}},created:function(){var e=this;this.cachedPlaceHolder=this.currentPlaceholder=this.placeholder,this.multiple&&!Array.isArray(this.value)&&this.$emit("input",[]),!this.multiple&&Array.isArray(this.value)&&this.$emit("input",""),this.debouncedOnInputChange=L()(this.debounce,function(){e.onInputChange()}),this.debouncedQueryChange=L()(this.debounce,function(t){e.handleQueryChange(t.target.value)}),this.$on("handleOptionClick",this.handleOptionSelect),this.$on("setSelected",this.setSelected)},mounted:function(){var e=this;this.multiple&&Array.isArray(this.value)&&this.value.length>0&&(this.currentPlaceholder=""),Object(Zi["addResizeListener"])(this.$el,this.handleResize);var t=this.$refs.reference;if(t&&t.$el){var i={medium:36,small:32,mini:28};this.initialInputHeight=t.$el.getBoundingClientRect().height||i[this.selectSize]}this.remote&&this.multiple&&this.resetInputHeight(),this.$nextTick(function(){t&&t.$el&&(e.inputWidth=t.$el.getBoundingClientRect().width)}),this.setSelected()},beforeDestroy:function(){this.$el&&this.handleResize&&Object(Zi["removeResizeListener"])(this.$el,this.handleResize)}},on=an,ln=o(on,ji,Fi,!1,null,null,null);ln.options.__file="packages/select/src/select.vue";var cn=ln.exports;cn.install=function(e){e.component(cn.name,cn)};var un=cn;Gi.install=function(e){e.component(Gi.name,Gi)};var hn=Gi,dn=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-select-group__wrap"},[i("li",{staticClass:"el-select-group__title"},[e._v(e._s(e.label))]),i("li",[i("ul",{staticClass:"el-select-group"},[e._t("default")],2)])])},pn=[];dn._withStripped=!0;var fn={mixins:[O.a],name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:{type:Boolean,default:!1}},data:function(){return{visible:!0}},watch:{disabled:function(e){this.broadcast("ElOption","handleGroupDisabled",e)}},methods:{queryChange:function(){this.visible=this.$children&&Array.isArray(this.$children)&&this.$children.some(function(e){return!0===e.visible})}},created:function(){this.$on("queryChange",this.queryChange)},mounted:function(){this.disabled&&this.broadcast("ElOption","handleGroupDisabled",this.disabled)}},mn=fn,vn=o(mn,dn,pn,!1,null,null,null);vn.options.__file="packages/select/src/option-group.vue";var gn=vn.exports;gn.install=function(e){e.component(gn.name,gn)};var bn=gn,yn=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("button",{staticClass:"el-button",class:[e.type?"el-button--"+e.type:"",e.buttonSize?"el-button--"+e.buttonSize:"",{"is-disabled":e.buttonDisabled,"is-loading":e.loading,"is-plain":e.plain,"is-round":e.round,"is-circle":e.circle}],attrs:{disabled:e.buttonDisabled||e.loading,autofocus:e.autofocus,type:e.nativeType},on:{click:e.handleClick}},[e.loading?i("i",{staticClass:"el-icon-loading"}):e._e(),e.icon&&!e.loading?i("i",{class:e.icon}):e._e(),e.$slots.default?i("span",[e._t("default")],2):e._e()])},_n=[];yn._withStripped=!0;var xn={name:"ElButton",inject:{elForm:{default:""},elFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},buttonSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},buttonDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},methods:{handleClick:function(e){this.$emit("click",e)}}},Cn=xn,wn=o(Cn,yn,_n,!1,null,null,null);wn.options.__file="packages/button/src/button.vue";var kn=wn.exports;kn.install=function(e){e.component(kn.name,kn)};var Sn=kn,Dn=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-button-group"},[e._t("default")],2)},$n=[];Dn._withStripped=!0;var On={name:"ElButtonGroup"},En=On,Tn=o(En,Dn,$n,!1,null,null,null);Tn.options.__file="packages/button/src/button-group.vue";var Pn=Tn.exports;Pn.install=function(e){e.component(Pn.name,Pn)};var Mn=Pn,In=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-table",class:[{"el-table--fit":e.fit,"el-table--striped":e.stripe,"el-table--border":e.border||e.isGroup,"el-table--hidden":e.isHidden,"el-table--group":e.isGroup,"el-table--fluid-height":e.maxHeight,"el-table--scrollable-x":e.layout.scrollX,"el-table--scrollable-y":e.layout.scrollY,"el-table--enable-row-hover":!e.store.states.isComplex,"el-table--enable-row-transition":0!==(e.store.states.data||[]).length&&(e.store.states.data||[]).length<100},e.tableSize?"el-table--"+e.tableSize:""],on:{mouseleave:function(t){e.handleMouseLeave(t)}}},[i("div",{ref:"hiddenColumns",staticClass:"hidden-columns"},[e._t("default")],2),e.showHeader?i("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleHeaderFooterMousewheel,expression:"handleHeaderFooterMousewheel"}],ref:"headerWrapper",staticClass:"el-table__header-wrapper"},[i("table-header",{ref:"tableHeader",style:{width:e.layout.bodyWidth?e.layout.bodyWidth+"px":""},attrs:{store:e.store,border:e.border,"default-sort":e.defaultSort}})],1):e._e(),i("div",{ref:"bodyWrapper",staticClass:"el-table__body-wrapper",class:[e.layout.scrollX?"is-scrolling-"+e.scrollPosition:"is-scrolling-none"],style:[e.bodyHeight]},[i("table-body",{style:{width:e.bodyWidth},attrs:{context:e.context,store:e.store,stripe:e.stripe,"row-class-name":e.rowClassName,"row-style":e.rowStyle,highlight:e.highlightCurrentRow}}),e.data&&0!==e.data.length?e._e():i("div",{ref:"emptyBlock",staticClass:"el-table__empty-block",style:{width:e.bodyWidth}},[i("span",{staticClass:"el-table__empty-text"},[e._t("empty",[e._v(e._s(e.emptyText||e.t("el.table.emptyText")))])],2)]),e.$slots.append?i("div",{ref:"appendWrapper",staticClass:"el-table__append-wrapper"},[e._t("append")],2):e._e()],1),e.showSummary?i("div",{directives:[{name:"show",rawName:"v-show",value:e.data&&e.data.length>0,expression:"data && data.length > 0"},{name:"mousewheel",rawName:"v-mousewheel",value:e.handleHeaderFooterMousewheel,expression:"handleHeaderFooterMousewheel"}],ref:"footerWrapper",staticClass:"el-table__footer-wrapper"},[i("table-footer",{style:{width:e.layout.bodyWidth?e.layout.bodyWidth+"px":""},attrs:{store:e.store,border:e.border,"sum-text":e.sumText||e.t("el.table.sumText"),"summary-method":e.summaryMethod,"default-sort":e.defaultSort}})],1):e._e(),e.fixedColumns.length>0?i("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleFixedMousewheel,expression:"handleFixedMousewheel"}],ref:"fixedWrapper",staticClass:"el-table__fixed",style:[{width:e.layout.fixedWidth?e.layout.fixedWidth+"px":""},e.fixedHeight]},[e.showHeader?i("div",{ref:"fixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[i("table-header",{ref:"fixedTableHeader",style:{width:e.bodyWidth},attrs:{fixed:"left",border:e.border,store:e.store}})],1):e._e(),i("div",{ref:"fixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:e.layout.headerHeight+"px"},e.fixedBodyHeight]},[i("table-body",{style:{width:e.bodyWidth},attrs:{fixed:"left",store:e.store,stripe:e.stripe,highlight:e.highlightCurrentRow,"row-class-name":e.rowClassName,"row-style":e.rowStyle}}),e.$slots.append?i("div",{staticClass:"el-table__append-gutter",style:{height:e.layout.appendHeight+"px"}}):e._e()],1),e.showSummary?i("div",{directives:[{name:"show",rawName:"v-show",value:e.data&&e.data.length>0,expression:"data && data.length > 0"}],ref:"fixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[i("table-footer",{style:{width:e.bodyWidth},attrs:{fixed:"left",border:e.border,"sum-text":e.sumText||e.t("el.table.sumText"),"summary-method":e.summaryMethod,store:e.store}})],1):e._e()]):e._e(),e.rightFixedColumns.length>0?i("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleFixedMousewheel,expression:"handleFixedMousewheel"}],ref:"rightFixedWrapper",staticClass:"el-table__fixed-right",style:[{width:e.layout.rightFixedWidth?e.layout.rightFixedWidth+"px":"",right:e.layout.scrollY?(e.border?e.layout.gutterWidth:e.layout.gutterWidth||0)+"px":""},e.fixedHeight]},[e.showHeader?i("div",{ref:"rightFixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[i("table-header",{ref:"rightFixedTableHeader",style:{width:e.bodyWidth},attrs:{fixed:"right",border:e.border,store:e.store}})],1):e._e(),i("div",{ref:"rightFixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:e.layout.headerHeight+"px"},e.fixedBodyHeight]},[i("table-body",{style:{width:e.bodyWidth},attrs:{fixed:"right",store:e.store,stripe:e.stripe,"row-class-name":e.rowClassName,"row-style":e.rowStyle,highlight:e.highlightCurrentRow}})],1),e.showSummary?i("div",{directives:[{name:"show",rawName:"v-show",value:e.data&&e.data.length>0,expression:"data && data.length > 0"}],ref:"rightFixedFooterWrapper",staticClass:"el-table__fixed-footer-wrapper"},[i("table-footer",{style:{width:e.bodyWidth},attrs:{fixed:"right",border:e.border,"sum-text":e.sumText||e.t("el.table.sumText"),"summary-method":e.summaryMethod,store:e.store}})],1):e._e()]):e._e(),e.rightFixedColumns.length>0?i("div",{ref:"rightFixedPatch",staticClass:"el-table__fixed-right-patch",style:{width:e.layout.scrollY?e.layout.gutterWidth+"px":"0",height:e.layout.headerHeight+"px"}}):e._e(),i("div",{directives:[{name:"show",rawName:"v-show",value:e.resizeProxyVisible,expression:"resizeProxyVisible"}],ref:"resizeProxy",staticClass:"el-table__column-resize-proxy"})])},Nn=[];In._withStripped=!0;var jn=i(13),Fn=i.n(jn),Ln=i(34),Vn=i(38),An=i.n(Vn),zn="undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,Bn=function(e,t){e&&e.addEventListener&&e.addEventListener(zn?"DOMMouseScroll":"mousewheel",function(e){var i=An()(e);t&&t.apply(this,[e,i])})},Rn={bind:function(e,t){Bn(e,t.value)}},Hn=i(5),Wn=i.n(Hn),qn="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Yn=function(e){var t=e.target;while(t&&"HTML"!==t.tagName.toUpperCase()){if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null},Kn=function(e){return null!==e&&"object"===("undefined"===typeof e?"undefined":qn(e))},Un=function(e,t,i,n,s){if(!t&&!n&&(!s||Array.isArray(s)&&!s.length))return e;i="string"===typeof i?"descending"===i?-1:1:i&&i<0?-1:1;var r=n?null:function(i,n){return s?(Array.isArray(s)||(s=[s]),s.map(function(t){return"string"===typeof t?Object(b["getValueByPath"])(i,t):t(i,n,e)})):("$key"!==t&&Kn(i)&&"$value"in i&&(i=i.$value),[Kn(i)?Object(b["getValueByPath"])(i,t):i])},a=function(e,t){if(n)return n(e.value,t.value);for(var i=0,s=e.key.length;it.key[i])return 1}return 0};return e.map(function(e,t){return{value:e,index:t,key:r?r(e,t):null}}).sort(function(e,t){var n=a(e,t);return n||(n=e.index-t.index),n*i}).map(function(e){return e.value})},Gn=function(e,t){var i=null;return e.columns.forEach(function(e){e.id===t&&(i=e)}),i},Xn=function(e,t){for(var i=null,n=0;n2&&void 0!==arguments[2]?arguments[2]:"children",n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hasChildren",s=function(e){return!(Array.isArray(e)&&e.length)};function r(e,a,o){t(e,a,o),a.forEach(function(e){if(e[n])t(e,null,o+1);else{var a=e[i];s(a)||r(e,a,o+1)}})}e.forEach(function(e){if(e[n])t(e,null,0);else{var a=e[i];s(a)||r(e,a,0)}})}var ls={data:function(){return{states:{defaultExpandAll:!1,expandRows:[]}}},methods:{updateExpandRows:function(){var e=this.states,t=e.data,i=void 0===t?[]:t,n=e.rowKey,s=e.defaultExpandAll,r=e.expandRows;if(s)this.states.expandRows=i.slice();else if(n){var a=Jn(r,n);this.states.expandRows=i.reduce(function(e,t){var i=Zn(t,n),s=a[i];return s&&e.push(t),e},[])}else this.states.expandRows=[]},toggleRowExpansion:function(e,t){var i=as(this.states.expandRows,e,t);i&&(this.table.$emit("expand-change",e,this.states.expandRows.slice()),this.scheduleLayout())},setExpandRowKeys:function(e){this.assertRowKey();var t=this.states,i=t.data,n=t.rowKey,s=Jn(i,n);this.states.expandRows=e.reduce(function(e,t){var i=s[t];return i&&e.push(i.row),e},[])},isRowExpanded:function(e){var t=this.states,i=t.expandRows,n=void 0===i?[]:i,s=t.rowKey;if(s){var r=Jn(n,s);return!!r[Zn(e,s)]}return-1!==n.indexOf(e)}}},cs={data:function(){return{states:{current:null}}},methods:{setCurrentRowKey:function(e){this.assertRowKey();var t=this.states,i=t.data,n=void 0===i?[]:i,s=t.rowKey,r=Object(b["arrayFind"])(n,function(t){return Zn(t,s)===e});t.currentRow=r||null},updateCurrentRow:function(){var e=this.states,t=this.table,i=e.rowKey,n=e.data||[],s=e.currentRow;if(-1===n.indexOf(s)&&s){var r=null;i&&(r=Object(b["arrayFind"])(n,function(e){return Zn(e,i)===Zn(s,i)})),e.currentRow=r,r!==s&&t.$emit("current-change",null,s)}}}},us=Object.assign||function(e){for(var t=1;t0&&t[0]&&"selection"===t[0].type&&!t[0].fixed&&(t[0].fixed=!0,e.fixedColumns.unshift(t[0]));var i=t.filter(function(e){return!e.fixed});e.originColumns=[].concat(e.fixedColumns).concat(i).concat(e.rightFixedColumns);var n=ps(i),s=ps(e.fixedColumns),r=ps(e.rightFixedColumns);e.leafColumnsLength=n.length,e.fixedLeafColumnsLength=s.length,e.rightFixedLeafColumnsLength=r.length,e.columns=[].concat(s).concat(n).concat(r),e.isComplex=e.fixedColumns.length>0||e.rightFixedColumns.length>0},scheduleLayout:function(e){e&&this.updateColumns(),this.table.debouncedUpdateLayout()},isSelected:function(e){var t=this.states.selection,i=void 0===t?[]:t;return i.indexOf(e)>-1},clearSelection:function(){var e=this.states;e.isAllSelected=!1;var t=e.selection;e.selection.length&&(e.selection=[]),t.length>0&&this.table.$emit("selection-change",e.selection?e.selection.slice():[])},cleanSelection:function(){var e=this.states.selection||[],t=this.states.data,i=this.states.rowKey,n=void 0;if(i){n=[];var s=Jn(e,i),r=Jn(t,i);for(var a in s)s.hasOwnProperty(a)&&!r[a]&&n.push(s[a].row)}else n=e.filter(function(e){return-1===t.indexOf(e)});n.forEach(function(t){e.splice(e.indexOf(t),1)}),n.length&&this.table.$emit("selection-change",e?e.slice():[])},toggleRowSelection:function(e,t){var i=as(this.states.selection,e,t);if(i){var n=this.states.selection?this.states.selection.slice():[];this.table.$emit("select",n,e),this.table.$emit("selection-change",n)}},toggleAllSelection:L()(10,function(){var e=this.states,t=e.data,i=void 0===t?[]:t,n=e.selection,s=e.selectOnIndeterminate?!e.isAllSelected:!(e.isAllSelected||n.length);e.isAllSelected=s;var r=!1;i.forEach(function(t,i){e.selectable?e.selectable.call(null,t,i)&&as(n,t,s)&&(r=!0):as(n,t,s)&&(r=!0)}),r&&this.table.$emit("selection-change",n?n.slice():[]),this.table.$emit("select-all",n)}),updateSelectionByRowKey:function(){var e=this.states,t=e.selection,i=e.rowKey,n=e.data,s=void 0===n?[]:n,r=Jn(t,i);e.selection=s.reduce(function(e,t){var n=Zn(t,i),s=r[n];return s&&e.push(t),e},[])},updateAllSelected:function(){var e=this.states,t=e.selection,i=e.rowKey,n=e.selectable,s=e.data||[];if(0!==s.length){var r=void 0;i&&(r=Jn(t,i));for(var a=function(e){return r?!!r[Zn(e,i)]:-1!==t.indexOf(e)},o=!0,l=0,c=0,u=s.length;c1?i-1:0),s=1;s1&&void 0!==arguments[1]?arguments[1]:{};if(!e)throw new Error("Table is required.");var i=new ms;return i.table=e,Object.keys(t).forEach(function(e){i.states[e]=t[e]}),i}function gs(e){var t={};return Object.keys(e).forEach(function(i){var n=e[i],s=void 0;"string"===typeof n?s=function(){return this.store.states[n]}:"function"===typeof n?s=function(){return n.call(this,this.store.states)}:console.error("invalid value type"),s&&(t[i]=s)}),t}var bs=i(29),ys=i.n(bs);function _s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var xs=function(){function e(t){for(var i in _s(this,e),this.observers=[],this.table=null,this.store=null,this.columns=null,this.fit=!0,this.showHeader=!0,this.height=null,this.scrollX=!1,this.scrollY=!1,this.bodyWidth=null,this.fixedWidth=null,this.rightFixedWidth=null,this.tableHeight=null,this.headerHeight=44,this.appendHeight=0,this.footerHeight=44,this.viewportHeight=null,this.bodyHeight=null,this.fixedBodyHeight=null,this.gutterWidth=ys()(),t)t.hasOwnProperty(i)&&(this[i]=t[i]);if(!this.table)throw new Error("table is required for Table Layout");if(!this.store)throw new Error("store is required for Table Layout")}return e.prototype.updateScrollY=function(){var e=this.height;if(null!==e){var t=this.table.bodyWrapper;if(this.table.$el&&t){var i=t.querySelector(".el-table__body");this.scrollY=i.offsetHeight>this.bodyHeight}}},e.prototype.setHeight=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"height";if(!Wn.a.prototype.$isServer){var n=this.table.$el;if(e=ss(e),this.height=e,!n&&(e||0===e))return Wn.a.nextTick(function(){return t.setHeight(e,i)});e&&(n.style[i]=e+"px",this.updateElsHeight())}},e.prototype.setMaxHeight=function(e){this.setHeight(e,"max-height")},e.prototype.getFlattenColumns=function(){var e=[],t=this.table.columns;return t.forEach(function(t){t.isColumnGroup?e.push.apply(e,t.columns):e.push(t)}),e},e.prototype.updateElsHeight=function(){var e=this;if(!this.table.$ready)return Wn.a.nextTick(function(){return e.updateElsHeight()});var t=this.table.$refs,i=t.headerWrapper,n=t.appendWrapper,s=t.footerWrapper;if(this.appendHeight=n?n.offsetHeight:0,!this.showHeader||i){var r=this.headerHeight=this.showHeader?i.offsetHeight:0;if(this.showHeader&&i.offsetWidth>0&&(this.table.columns||[]).length>0&&r<2)return Wn.a.nextTick(function(){return e.updateElsHeight()});var a=this.tableHeight=this.table.$el.clientHeight,o=this.footerHeight=s?s.offsetHeight:0;null!==this.height&&(this.bodyHeight=a-r-o+(s?1:0)),this.fixedBodyHeight=this.scrollX?this.bodyHeight-this.gutterWidth:this.bodyHeight;var l=!this.table.data||0===this.table.data.length;this.viewportHeight=this.scrollX?a-(l?0:this.gutterWidth):a,this.updateScrollY(),this.notifyObservers("scrollable")}},e.prototype.updateColumnsWidth=function(){if(!Wn.a.prototype.$isServer){var e=this.fit,t=this.table.$el.clientWidth,i=0,n=this.getFlattenColumns(),s=n.filter(function(e){return"number"!==typeof e.width});if(n.forEach(function(e){"number"===typeof e.width&&e.realWidth&&(e.realWidth=null)}),s.length>0&&e){n.forEach(function(e){i+=e.width||e.minWidth||80});var r=this.scrollY?this.gutterWidth:0;if(i<=t-r){this.scrollX=!1;var a=t-r-i;if(1===s.length)s[0].realWidth=(s[0].minWidth||80)+a;else{var o=s.reduce(function(e,t){return e+(t.minWidth||80)},0),l=a/o,c=0;s.forEach(function(e,t){if(0!==t){var i=Math.floor((e.minWidth||80)*l);c+=i,e.realWidth=(e.minWidth||80)+i}}),s[0].realWidth=(s[0].minWidth||80)+a-c}}else this.scrollX=!0,s.forEach(function(e){e.realWidth=e.minWidth});this.bodyWidth=Math.max(i,t),this.table.resizeState.width=this.bodyWidth}else n.forEach(function(e){e.width||e.minWidth?e.realWidth=e.width||e.minWidth:e.realWidth=80,i+=e.realWidth}),this.scrollX=i>t,this.bodyWidth=i;var u=this.store.states.fixedColumns;if(u.length>0){var h=0;u.forEach(function(e){h+=e.realWidth||e.width}),this.fixedWidth=h}var d=this.store.states.rightFixedColumns;if(d.length>0){var p=0;d.forEach(function(e){p+=e.realWidth||e.width}),this.rightFixedWidth=p}this.notifyObservers("columns")}},e.prototype.addObserver=function(e){this.observers.push(e)},e.prototype.removeObserver=function(e){var t=this.observers.indexOf(e);-1!==t&&this.observers.splice(t,1)},e.prototype.notifyObservers=function(e){var t=this,i=this.observers;i.forEach(function(i){switch(e){case"columns":i.onColumnsChange(t);break;case"scrollable":i.onScrollableChange(t);break;default:throw new Error("Table Layout don't have event "+e+".")}})},e}(),Cs=xs,ws={created:function(){this.tableLayout.addObserver(this)},destroyed:function(){this.tableLayout.removeObserver(this)},computed:{tableLayout:function(){var e=this.layout;if(!e&&this.table&&(e=this.table.layout),!e)throw new Error("Can not find table layout.");return e}},mounted:function(){this.onColumnsChange(this.tableLayout),this.onScrollableChange(this.tableLayout)},updated:function(){this.__updated__||(this.onColumnsChange(this.tableLayout),this.onScrollableChange(this.tableLayout),this.__updated__=!0)},methods:{onColumnsChange:function(){var e=this.$el.querySelectorAll("colgroup > col");if(e.length){var t=this.tableLayout.getFlattenColumns(),i={};t.forEach(function(e){i[e.id]=e});for(var n=0,s=e.length;n col[name=gutter]"),i=0,n=t.length;i=this.leftFixedLeafCount:"right"===this.fixed?e=this.columnsCount-this.rightFixedLeafCount},getSpan:function(e,t,i,n){var s=1,r=1,a=this.table.spanMethod;if("function"===typeof a){var o=a({row:e,column:t,rowIndex:i,columnIndex:n});Array.isArray(o)?(s=o[0],r=o[1]):"object"===("undefined"===typeof o?"undefined":ks(o))&&(s=o.rowspan,r=o.colspan)}return{rowspan:s,colspan:r}},getRowStyle:function(e,t){var i=this.table.rowStyle;return"function"===typeof i?i.call(null,{row:e,rowIndex:t}):i||null},getRowClass:function(e,t){var i=["el-table__row"];this.table.highlightCurrentRow&&e===this.store.states.currentRow&&i.push("current-row"),this.stripe&&t%2===1&&i.push("el-table__row--striped");var n=this.table.rowClassName;return"string"===typeof n?i.push(n):"function"===typeof n&&i.push(n.call(null,{row:e,rowIndex:t})),this.store.states.expandRows.indexOf(e)>-1&&i.push("expanded"),i},getCellStyle:function(e,t,i,n){var s=this.table.cellStyle;return"function"===typeof s?s.call(null,{rowIndex:e,columnIndex:t,row:i,column:n}):s},getCellClass:function(e,t,i,n){var s=[n.id,n.align,n.className];this.isColumnHidden(t)&&s.push("is-hidden");var r=this.table.cellClassName;return"string"===typeof r?s.push(r):"function"===typeof r&&s.push(r.call(null,{rowIndex:e,columnIndex:t,row:i,column:n})),s.join(" ")},getColspanRealWidth:function(e,t,i){if(t<1)return e[i].realWidth;var n=e.map(function(e){var t=e.realWidth;return t}).slice(i,i+t);return n.reduce(function(e,t){return e+t},-1)},handleCellMouseEnter:function(e,t){var i=this.table,n=Yn(e);if(n){var s=Qn(i,n),r=i.hoverState={cell:n,column:s,row:t};i.$emit("cell-mouse-enter",r.row,r.column,r.cell,e)}var a=e.target.querySelector(".cell");if(Object(Ve["hasClass"])(a,"el-tooltip")&&a.childNodes.length){var o=document.createRange();o.setStart(a,0),o.setEnd(a,a.childNodes.length);var l=o.getBoundingClientRect().width,c=(parseInt(Object(Ve["getStyle"])(a,"paddingLeft"),10)||0)+(parseInt(Object(Ve["getStyle"])(a,"paddingRight"),10)||0);if((l+c>a.offsetWidth||a.scrollWidth>a.offsetWidth)&&this.$refs.tooltip){var u=this.$refs.tooltip;this.tooltipContent=n.innerText||n.textContent,u.referenceElm=n,u.$refs.popper&&(u.$refs.popper.style.display="none"),u.doDestroy(),u.setExpectedState(!0),this.activateTooltip(u)}}},handleCellMouseLeave:function(e){var t=this.$refs.tooltip;t&&(t.setExpectedState(!1),t.handleClosePopper());var i=Yn(e);if(i){var n=this.table.hoverState||{};this.table.$emit("cell-mouse-leave",n.row,n.column,n.cell,e)}},handleMouseEnter:L()(30,function(e){this.store.commit("setHoverRow",e)}),handleMouseLeave:L()(30,function(){this.store.commit("setHoverRow",null)}),handleContextMenu:function(e,t){this.handleEvent(e,t,"contextmenu")},handleDoubleClick:function(e,t){this.handleEvent(e,t,"dblclick")},handleClick:function(e,t){this.store.commit("setCurrentRow",t),this.handleEvent(e,t,"click")},handleEvent:function(e,t,i){var n=this.table,s=Yn(e),r=void 0;s&&(r=Qn(n,s),r&&n.$emit("cell-"+i,t,r,s,e)),n.$emit("row-"+i,t,r,e)},rowRender:function(e,t,i){var n=this,s=this.$createElement,r=this.treeIndent,a=this.columns,o=this.firstDefaultColumnIndex,l=a.map(function(e,t){return n.isColumnHidden(t)}),c=this.getRowClass(e,t),u=!0;return i&&(c.push("el-table__row--level-"+i.level),u=i.display),s("tr",{directives:[{name:"show",value:u}],style:this.getRowStyle(e,t),class:c,key:this.getKeyOfRow(e,t),on:{dblclick:function(t){return n.handleDoubleClick(t,e)},click:function(t){return n.handleClick(t,e)},contextmenu:function(t){return n.handleContextMenu(t,e)},mouseenter:function(e){return n.handleMouseEnter(t)},mouseleave:this.handleMouseLeave}},[a.map(function(c,u){var h=n.getSpan(e,c,t,u),d=h.rowspan,p=h.colspan;if(!d||!p)return null;var f=Ss({},c);f.realWidth=n.getColspanRealWidth(a,p,u);var m={store:n.store,_self:n.context||n.table.$vnode.context,column:f,row:e,$index:t};return u===o&&i&&(m.treeNode={indent:i.level*r,level:i.level},"boolean"===typeof i.expanded&&(m.treeNode.expanded=i.expanded,"loading"in i&&(m.treeNode.loading=i.loading),"noLazyChildren"in i&&(m.treeNode.noLazyChildren=i.noLazyChildren))),s("td",{style:n.getCellStyle(t,u,e,c),class:n.getCellClass(t,u,e,c),attrs:{rowspan:d,colspan:p},on:{mouseenter:function(t){return n.handleCellMouseEnter(t,e)},mouseleave:n.handleCellMouseLeave}},[c.renderCell.call(n._renderProxy,n.$createElement,m,l[u])])})])},wrappedRowRender:function(e,t){var i=this,n=this.$createElement,s=this.store,r=s.isRowExpanded,a=s.assertRowKey,o=s.states,l=o.treeData,c=o.lazyTreeNodeMap,u=o.childrenColumnName,h=o.rowKey;if(this.hasExpandColumn&&r(e)){var d=this.table.renderExpanded,p=this.rowRender(e,t);return d?[[p,n("tr",{key:"expanded-row__"+p.key},[n("td",{attrs:{colspan:this.columnsCount},class:"el-table__expanded-cell"},[d(this.$createElement,{row:e,$index:t,store:this.store})])])]]:(console.error("[Element Error]renderExpanded is required."),p)}if(Object.keys(l).length){a();var f=Zn(e,h),m=l[f],v=null;m&&(v={expanded:m.expanded,level:m.level,display:!0},"boolean"===typeof m.loaded&&m.loaded&&(v.noLazyChildren=!(m.children&&m.children.length)),"boolean"===typeof m.loading&&(v.loading=m.loading));var g=[this.rowRender(e,t,v)];if(m){var b=0,y=function e(n,s){n&&n.length&&s&&n.forEach(function(n){var r={display:s.display&&s.expanded,level:s.level+1},a=Zn(n,h);if(void 0===a||null===a)throw new Error("for nested data item, row-key is required.");if(m=Ss({},l[a]),m&&(r.expanded=m.expanded,m.level=m.level||r.level,m.display=!(!m.expanded||!r.display),"boolean"===typeof m.loaded&&m.loaded&&(r.noLazyChildren=!(m.children&&m.children.length)),"boolean"===typeof m.lazy&&(r.loading=m.loading)),b++,g.push(i.rowRender(n,t+b,r)),m){var o=c[a]||n[u];e(o,m)}})};m.display=!0;var _=c[f]||e[u];y(_,m)}return g}return this.rowRender(e,t)}}},$s=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"}},[e.multiple?i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleOutsideClick,expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-table-filter"},[i("div",{staticClass:"el-table-filter__content"},[i("el-scrollbar",{attrs:{"wrap-class":"el-table-filter__wrap"}},[i("el-checkbox-group",{staticClass:"el-table-filter__checkbox-group",model:{value:e.filteredValue,callback:function(t){e.filteredValue=t},expression:"filteredValue"}},e._l(e.filters,function(t){return i("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.text))])}),1)],1)],1),i("div",{staticClass:"el-table-filter__bottom"},[i("button",{class:{"is-disabled":0===e.filteredValue.length},attrs:{disabled:0===e.filteredValue.length},on:{click:e.handleConfirm}},[e._v(e._s(e.t("el.table.confirmFilter")))]),i("button",{on:{click:e.handleReset}},[e._v(e._s(e.t("el.table.resetFilter")))])])]):i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleOutsideClick,expression:"handleOutsideClick"},{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-table-filter"},[i("ul",{staticClass:"el-table-filter__list"},[i("li",{staticClass:"el-table-filter__list-item",class:{"is-active":void 0===e.filterValue||null===e.filterValue},on:{click:function(t){e.handleSelect(null)}}},[e._v(e._s(e.t("el.table.clearFilter")))]),e._l(e.filters,function(t){return i("li",{key:t.value,staticClass:"el-table-filter__list-item",class:{"is-active":e.isActive(t)},attrs:{label:t.value},on:{click:function(i){e.handleSelect(t.value)}}},[e._v(e._s(t.text))])})],2)])])},Os=[];$s._withStripped=!0;var Es=[];!Wn.a.prototype.$isServer&&document.addEventListener("click",function(e){Es.forEach(function(t){var i=e.target;t&&t.$el&&(i===t.$el||t.$el.contains(i)||t.handleOutsideClick&&t.handleOutsideClick(e))})});var Ts={open:function(e){e&&Es.push(e)},close:function(e){var t=Es.indexOf(e);-1!==t&&Es.splice(e,1)}},Ps=i(30),Ms=i.n(Ps),Is={name:"ElTableFilterPanel",mixins:[H.a,g.a],directives:{Clickoutside:A.a},components:{ElCheckbox:Fn.a,ElCheckboxGroup:Ms.a},props:{placement:{type:String,default:"bottom-end"}},methods:{isActive:function(e){return e.value===this.filterValue},handleOutsideClick:function(){var e=this;setTimeout(function(){e.showPopper=!1},16)},handleConfirm:function(){this.confirmFilter(this.filteredValue),this.handleOutsideClick()},handleReset:function(){this.filteredValue=[],this.confirmFilter(this.filteredValue),this.handleOutsideClick()},handleSelect:function(e){this.filterValue=e,"undefined"!==typeof e&&null!==e?this.confirmFilter(this.filteredValue):this.confirmFilter([]),this.handleOutsideClick()},confirmFilter:function(e){this.table.store.commit("filterChange",{column:this.column,values:e}),this.table.store.updateAllSelected()}},data:function(){return{table:null,cell:null,column:null}},computed:{filters:function(){return this.column&&this.column.filters},filterValue:{get:function(){return(this.column.filteredValue||[])[0]},set:function(e){this.filteredValue&&("undefined"!==typeof e&&null!==e?this.filteredValue.splice(0,1,e):this.filteredValue.splice(0,1))}},filteredValue:{get:function(){return this.column&&this.column.filteredValue||[]},set:function(e){this.column&&(this.column.filteredValue=e)}},multiple:function(){return!this.column||this.column.filterMultiple}},mounted:function(){var e=this;this.popperElm=this.$el,this.referenceElm=this.cell,this.table.bodyWrapper.addEventListener("scroll",function(){e.updatePopper()}),this.$watch("showPopper",function(t){e.column&&(e.column.filterOpened=t),t?Ts.open(e):Ts.close(e)})},watch:{showPopper:function(e){!0===e&&parseInt(this.popperJS._popper.style.zIndex,10)1;return s&&(this.$parent.isGroup=!0),e("table",{class:"el-table__header",attrs:{cellspacing:"0",cellpadding:"0",border:"0"}},[e("colgroup",[this.columns.map(function(t){return e("col",{attrs:{name:t.id},key:t.id})}),this.hasGutter?e("col",{attrs:{name:"gutter"}}):""]),e("thead",{class:[{"is-group":s,"has-gutter":this.hasGutter}]},[this._l(n,function(i,n){return e("tr",{style:t.getHeaderRowStyle(n),class:t.getHeaderRowClass(n)},[i.map(function(s,r){return e("th",{attrs:{colspan:s.colSpan,rowspan:s.rowSpan},on:{mousemove:function(e){return t.handleMouseMove(e,s)},mouseout:t.handleMouseOut,mousedown:function(e){return t.handleMouseDown(e,s)},click:function(e){return t.handleHeaderClick(e,s)},contextmenu:function(e){return t.handleHeaderContextMenu(e,s)}},style:t.getHeaderCellStyle(n,r,i,s),class:t.getHeaderCellClass(n,r,i,s),key:s.id},[e("div",{class:["cell",s.filteredValue&&s.filteredValue.length>0?"highlight":"",s.labelClassName]},[s.renderHeader?s.renderHeader.call(t._renderProxy,e,{column:s,$index:r,store:t.store,_self:t.$parent.$vnode.context}):s.label,s.sortable?e("span",{class:"caret-wrapper",on:{click:function(e){return t.handleSortClick(e,s)}}},[e("i",{class:"sort-caret ascending",on:{click:function(e){return t.handleSortClick(e,s,"ascending")}}}),e("i",{class:"sort-caret descending",on:{click:function(e){return t.handleSortClick(e,s,"descending")}}})]):"",s.filterable?e("span",{class:"el-table__column-filter-trigger",on:{click:function(e){return t.handleFilterClick(e,s)}}},[e("i",{class:["el-icon-arrow-down",s.filterOpened?"el-icon-arrow-up":""]})]):""])])}),t.hasGutter?e("th",{class:"gutter"}):""])})])])},props:{fixed:String,store:{required:!0},border:Boolean,defaultSort:{type:Object,default:function(){return{prop:"",order:""}}}},components:{ElCheckbox:Fn.a},computed:Ls({table:function(){return this.$parent},hasGutter:function(){return!this.fixed&&this.tableLayout.gutterWidth}},gs({columns:"columns",isAllSelected:"isAllSelected",leftFixedLeafCount:"fixedLeafColumnsLength",rightFixedLeafCount:"rightFixedLeafColumnsLength",columnsCount:function(e){return e.columns.length},leftFixedCount:function(e){return e.fixedColumns.length},rightFixedCount:function(e){return e.rightFixedColumns.length}})),created:function(){this.filterPanels={}},mounted:function(){var e=this.defaultSort,t=e.prop,i=e.order,n=!0;this.store.commit("sort",{prop:t,order:i,init:n})},beforeDestroy:function(){var e=this.filterPanels;for(var t in e)e.hasOwnProperty(t)&&e[t]&&e[t].$destroy(!0)},methods:{isCellHidden:function(e,t){for(var i=0,n=0;n=this.leftFixedLeafCount:"right"===this.fixed?i=this.columnsCount-this.rightFixedLeafCount},getHeaderRowStyle:function(e){var t=this.table.headerRowStyle;return"function"===typeof t?t.call(null,{rowIndex:e}):t},getHeaderRowClass:function(e){var t=[],i=this.table.headerRowClassName;return"string"===typeof i?t.push(i):"function"===typeof i&&t.push(i.call(null,{rowIndex:e})),t.join(" ")},getHeaderCellStyle:function(e,t,i,n){var s=this.table.headerCellStyle;return"function"===typeof s?s.call(null,{rowIndex:e,columnIndex:t,row:i,column:n}):s},getHeaderCellClass:function(e,t,i,n){var s=[n.id,n.order,n.headerAlign,n.className,n.labelClassName];0===e&&this.isCellHidden(t,i)&&s.push("is-hidden"),n.children||s.push("is-leaf"),n.sortable&&s.push("is-sortable");var r=this.table.headerCellClassName;return"string"===typeof r?s.push(r):"function"===typeof r&&s.push(r.call(null,{rowIndex:e,columnIndex:t,row:i,column:n})),s.join(" ")},toggleAllSelection:function(e){e.stopPropagation(),this.store.commit("toggleAllSelection")},handleFilterClick:function(e,t){e.stopPropagation();var i=e.target,n="TH"===i.tagName?i:i.parentNode;n=n.querySelector(".el-table__column-filter-trigger")||n;var s=this.$parent,r=this.filterPanels[t.id];r&&t.filterOpened?r.showPopper=!1:(r||(r=new Wn.a(Fs),this.filterPanels[t.id]=r,t.filterPlacement&&(r.placement=t.filterPlacement),r.table=s,r.cell=n,r.column=t,!this.$isServer&&r.$mount(document.createElement("div"))),setTimeout(function(){r.showPopper=!0},16))},handleHeaderClick:function(e,t){!t.filters&&t.sortable?this.handleSortClick(e,t):t.filterable&&!t.sortable&&this.handleFilterClick(e,t),this.$parent.$emit("header-click",t,e)},handleHeaderContextMenu:function(e,t){this.$parent.$emit("header-contextmenu",t,e)},handleMouseDown:function(e,t){var i=this;if(!this.$isServer&&!(t.children&&t.children.length>0)&&this.draggingColumn&&this.border){this.dragging=!0,this.$parent.resizeProxyVisible=!0;var n=this.$parent,s=n.$el,r=s.getBoundingClientRect().left,a=this.$el.querySelector("th."+t.id),o=a.getBoundingClientRect(),l=o.left-r+30;Object(Ve["addClass"])(a,"noclick"),this.dragState={startMouseLeft:e.clientX,startLeft:o.right-r,startColumnLeft:o.left-r,tableLeft:r};var c=n.$refs.resizeProxy;c.style.left=this.dragState.startLeft+"px",document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var u=function(e){var t=e.clientX-i.dragState.startMouseLeft,n=i.dragState.startLeft+t;c.style.left=Math.max(l,n)+"px"},h=function s(){if(i.dragging){var r=i.dragState,o=r.startColumnLeft,l=r.startLeft,h=parseInt(c.style.left,10),d=h-o;t.width=t.realWidth=d,n.$emit("header-dragend",t.width,l-o,t,e),i.store.scheduleLayout(),document.body.style.cursor="",i.dragging=!1,i.draggingColumn=null,i.dragState={},n.resizeProxyVisible=!1}document.removeEventListener("mousemove",u),document.removeEventListener("mouseup",s),document.onselectstart=null,document.ondragstart=null,setTimeout(function(){Object(Ve["removeClass"])(a,"noclick")},0)};document.addEventListener("mousemove",u),document.addEventListener("mouseup",h)}},handleMouseMove:function(e,t){if(!(t.children&&t.children.length>0)){var i=e.target;while(i&&"TH"!==i.tagName)i=i.parentNode;if(t&&t.resizable&&!this.dragging&&this.border){var n=i.getBoundingClientRect(),s=document.body.style;n.width>12&&n.right-e.pageX<8?(s.cursor="col-resize",Object(Ve["hasClass"])(i,"is-sortable")&&(i.style.cursor="col-resize"),this.draggingColumn=t):this.dragging||(s.cursor="",Object(Ve["hasClass"])(i,"is-sortable")&&(i.style.cursor="pointer"),this.draggingColumn=null)}}},handleMouseOut:function(){this.$isServer||(document.body.style.cursor="")},toggleOrder:function(e){var t=e.order,i=e.sortOrders;if(""===t)return i[0];var n=i.indexOf(t||null);return i[n>i.length-2?0:n+1]},handleSortClick:function(e,t,i){e.stopPropagation();var n=t.order===i?null:i||this.toggleOrder(t),s=e.target;while(s&&"TH"!==s.tagName)s=s.parentNode;if(s&&"TH"===s.tagName&&Object(Ve["hasClass"])(s,"noclick"))Object(Ve["removeClass"])(s,"noclick");else if(t.sortable){var r=this.store.states,a=r.sortProp,o=void 0,l=r.sortingColumn;(l!==t||l===t&&null===l.order)&&(l&&(l.order=null),r.sortingColumn=t,a=t.property),o=t.order=n||null,r.sortProp=a,r.sortOrder=o,this.store.commit("changeSortCondition")}}},data:function(){return{draggingColumn:null,dragging:!1,dragState:{}}}},Bs=Object.assign||function(e){for(var t=1;t=this.leftFixedLeafCount;if("right"===this.fixed){for(var n=0,s=0;s=this.columnsCount-this.rightFixedCount)},getRowClasses:function(e,t){var i=[e.id,e.align,e.labelClassName];return e.className&&i.push(e.className),this.isCellHidden(t,this.columns,e)&&i.push("is-hidden"),e.children||i.push("is-leaf"),i}}},Hs=Object.assign||function(e){for(var t=1;t0){var n=i.scrollTop;t.pixelY<0&&0!==n&&e.preventDefault(),t.pixelY>0&&i.scrollHeight-i.clientHeight>n&&e.preventDefault(),i.scrollTop+=Math.ceil(t.pixelY/5)}else i.scrollLeft+=Math.ceil(t.pixelX/5)},handleHeaderFooterMousewheel:function(e,t){var i=t.pixelX,n=t.pixelY;Math.abs(i)>=Math.abs(n)&&(this.bodyWrapper.scrollLeft+=t.pixelX/5)},syncPostion:Object(Ln["throttle"])(20,function(){var e=this.bodyWrapper,t=e.scrollLeft,i=e.scrollTop,n=e.offsetWidth,s=e.scrollWidth,r=this.$refs,a=r.headerWrapper,o=r.footerWrapper,l=r.fixedBodyWrapper,c=r.rightFixedBodyWrapper;a&&(a.scrollLeft=t),o&&(o.scrollLeft=t),l&&(l.scrollTop=i),c&&(c.scrollTop=i);var u=s-n-1;this.scrollPosition=t>=u?"right":0===t?"left":"middle"}),bindEvents:function(){this.bodyWrapper.addEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(Zi["addResizeListener"])(this.$el,this.resizeListener)},unbindEvents:function(){this.bodyWrapper.removeEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(Zi["removeResizeListener"])(this.$el,this.resizeListener)},resizeListener:function(){if(this.$ready){var e=!1,t=this.$el,i=this.resizeState,n=i.width,s=i.height,r=t.offsetWidth;n!==r&&(e=!0);var a=t.offsetHeight;(this.height||this.shouldUpdateHeight)&&s!==a&&(e=!0),e&&(this.resizeState.width=r,this.resizeState.height=a,this.doLayout())}},doLayout:function(){this.layout.updateColumnsWidth(),this.shouldUpdateHeight&&this.layout.updateElsHeight()},sort:function(e,t){this.store.commit("sort",{prop:e,order:t})},toggleAllSelection:function(){this.store.commit("toggleAllSelection")}},computed:Hs({tableSize:function(){return this.size||(this.$ELEMENT||{}).size},bodyWrapper:function(){return this.$refs.bodyWrapper},shouldUpdateHeight:function(){return this.height||this.maxHeight||this.fixedColumns.length>0||this.rightFixedColumns.length>0},bodyWidth:function(){var e=this.layout,t=e.bodyWidth,i=e.scrollY,n=e.gutterWidth;return t?t-(i?n:0)+"px":""},bodyHeight:function(){var e=this.layout,t=e.headerHeight,i=void 0===t?0:t,n=e.bodyHeight,s=e.footerHeight,r=void 0===s?0:s;if(this.height)return{height:n?n+"px":""};if(this.maxHeight){var a=ss(this.maxHeight);if(a)return{"max-height":a-r-(this.showHeader?i:0)+"px"}}return{}},fixedBodyHeight:function(){if(this.height)return{height:this.layout.fixedBodyHeight?this.layout.fixedBodyHeight+"px":""};if(this.maxHeight){var e=ss(this.maxHeight);if(e)return e=this.layout.scrollX?e-this.layout.gutterWidth:e,this.showHeader&&(e-=this.layout.headerHeight),e-=this.layout.footerHeight,{"max-height":e+"px"}}return{}},fixedHeight:function(){return this.maxHeight?this.showSummary?{bottom:0}:{bottom:this.layout.scrollX&&this.data.length?this.layout.gutterWidth+"px":""}:this.showSummary?{height:this.layout.tableHeight?this.layout.tableHeight+"px":""}:{height:this.layout.viewportHeight?this.layout.viewportHeight+"px":""}}},gs({selection:"selection",columns:"columns",tableData:"data",fixedColumns:"fixedColumns",rightFixedColumns:"rightFixedColumns"})),watch:{height:{immediate:!0,handler:function(e){this.layout.setHeight(e)}},maxHeight:{immediate:!0,handler:function(e){this.layout.setMaxHeight(e)}},currentRowKey:function(e){this.store.setCurrentRowKey(e)},data:{immediate:!0,handler:function(e){var t=this;this.store.commit("setData",e),this.$ready&&this.$nextTick(function(){t.doLayout()})}},expandRowKeys:{immediate:!0,handler:function(e){e&&this.store.setExpandRowKeysAdapter(e)}}},created:function(){var e=this;this.tableId="el-table_"+Ws++,this.debouncedUpdateLayout=Object(Ln["debounce"])(50,function(){return e.doLayout()})},mounted:function(){var e=this;this.bindEvents(),this.store.updateColumns(),this.doLayout(),this.resizeState={width:this.$el.offsetWidth,height:this.$el.offsetHeight},this.store.states.columns.forEach(function(t){t.filteredValue&&t.filteredValue.length&&e.store.commit("filterChange",{column:t,values:t.filteredValue,silent:!0})}),this.$ready=!0},destroyed:function(){this.unbindEvents()},data:function(){var e=this.treeProps,t=e.hasChildren,i=void 0===t?"hasChildren":t,n=e.children,s=void 0===n?"children":n;this.store=vs(this,{rowKey:this.rowKey,defaultExpandAll:this.defaultExpandAll,selectOnIndeterminate:this.selectOnIndeterminate,indent:this.indent,lazy:this.lazy,lazyColumnIdentifier:i,childrenColumnName:s});var r=new Cs({store:this.store,table:this,fit:this.fit,showHeader:this.showHeader});return{layout:r,isHidden:!1,renderExpanded:null,resizeProxyVisible:!1,resizeState:{width:null,height:null},isGroup:!1,scrollPosition:"left"}}},Ys=qs,Ks=o(Ys,In,Nn,!1,null,null,null);Ks.options.__file="packages/table/src/table.vue";var Us=Ks.exports;Us.install=function(e){e.component(Us.name,Us)};var Gs=Us,Xs={default:{order:""},selection:{width:48,minWidth:48,realWidth:48,order:"",className:"el-table-column--selection"},expand:{width:48,minWidth:48,realWidth:48,order:""},index:{width:48,minWidth:48,realWidth:48,order:""}},Qs={selection:{renderHeader:function(e,t){var i=t.store;return e("el-checkbox",{attrs:{disabled:i.states.data&&0===i.states.data.length,indeterminate:i.states.selection.length>0&&!this.isAllSelected,value:this.isAllSelected},nativeOn:{click:this.toggleAllSelection}})},renderCell:function(e,t){var i=t.row,n=t.column,s=t.store,r=t.$index;return e("el-checkbox",{nativeOn:{click:function(e){return e.stopPropagation()}},attrs:{value:s.isSelected(i),disabled:!!n.selectable&&!n.selectable.call(null,i,r)},on:{input:function(){s.commit("rowSelectedChanged",i)}}})},sortable:!1,resizable:!1},index:{renderHeader:function(e,t){var i=t.column;return i.label||"#"},renderCell:function(e,t){var i=t.$index,n=t.column,s=i+1,r=n.index;return"number"===typeof r?s=i+r:"function"===typeof r&&(s=r(i)),e("div",[s])},sortable:!1},expand:{renderHeader:function(e,t){var i=t.column;return i.label||""},renderCell:function(e,t){var i=t.row,n=t.store,s=["el-table__expand-icon"];n.states.expandRows.indexOf(i)>-1&&s.push("el-table__expand-icon--expanded");var r=function(e){e.stopPropagation(),n.toggleRowExpansion(i)};return e("div",{class:s,on:{click:r}},[e("i",{class:"el-icon el-icon-arrow-right"})])},sortable:!1,resizable:!1,className:"el-table__expand-column"}};function Zs(e,t){var i=t.row,n=t.column,s=t.$index,r=n.property,a=r&&Object(b["getPropByPath"])(i,r).v;return n&&n.formatter?n.formatter(i,n,a,s):a}function Js(e,t){var i=t.row,n=t.treeNode,s=t.store;if(!n)return null;var r=[],a=function(e){e.stopPropagation(),s.loadOrToggle(i)};if(n.indent&&r.push(e("span",{class:"el-table__indent",style:{"padding-left":n.indent+"px"}})),"boolean"!==typeof n.expanded||n.noLazyChildren)r.push(e("span",{class:"el-table__placeholder"}));else{var o=["el-table__expand-icon",n.expanded?"el-table__expand-icon--expanded":""],l=["el-icon-arrow-right"];n.loading&&(l=["el-icon-loading"]),r.push(e("div",{class:o,on:{click:a}},[e("i",{class:l})]))}return r}var er=Object.assign||function(e){for(var t=1;t-1})}}},data:function(){return{isSubColumn:!1,columns:[]}},computed:{owner:function(){var e=this.$parent;while(e&&!e.tableId)e=e.$parent;return e},columnOrTableParent:function(){var e=this.$parent;while(e&&!e.tableId&&!e.columnId)e=e.$parent;return e},realWidth:function(){return is(this.width)},realMinWidth:function(){return ns(this.minWidth)},realAlign:function(){return this.align?"is-"+this.align:null},realHeaderAlign:function(){return this.headerAlign?"is-"+this.headerAlign:this.realAlign}},methods:{getPropsData:function(){for(var e=this,t=arguments.length,i=Array(t),n=0;n3&&void 0!==arguments[3]?arguments[3]:"-";if(!e)return null;var s=(fr[i]||fr["default"]).parser,r=t||lr[i];return s(e,r,n)},gr=function(e,t,i){if(!e)return null;var n=(fr[i]||fr["default"]).formatter,s=t||lr[i];return n(e,s)},br=function(e,t){var i=function(e,t){var i=e instanceof Date,n=t instanceof Date;return i&&n?e.getTime()===t.getTime():!i&&!n&&e===t},n=e instanceof Array,s=t instanceof Array;return n&&s?e.length===t.length&&e.every(function(e,n){return i(e,t[n])}):!n&&!s&&i(e,t)},yr=function(e){return"string"===typeof e||e instanceof String},_r=function(e){return null===e||void 0===e||yr(e)||Array.isArray(e)&&2===e.length&&e.every(yr)},xr={mixins:[O.a,or],inject:{elForm:{default:""},elFormItem:{default:""}},props:{size:String,format:String,valueFormat:String,readonly:Boolean,placeholder:String,startPlaceholder:String,endPlaceholder:String,prefixIcon:String,clearIcon:{type:String,default:"el-icon-circle-close"},name:{default:"",validator:_r},disabled:Boolean,clearable:{type:Boolean,default:!0},id:{default:"",validator:_r},popperClass:String,editable:{type:Boolean,default:!0},align:{type:String,default:"left"},value:{},defaultValue:{},defaultTime:{},rangeSeparator:{default:"-"},pickerOptions:{},unlinkPanels:Boolean,validateEvent:{type:Boolean,default:!0}},components:{ElInput:m.a},directives:{Clickoutside:A.a},data:function(){return{pickerVisible:!1,showClose:!1,userInput:null,valueOnOpen:null,unwatchPickerOptions:null}},watch:{pickerVisible:function(e){this.readonly||this.pickerDisabled||(e?(this.showPicker(),this.valueOnOpen=Array.isArray(this.value)?[].concat(this.value):this.value):(this.hidePicker(),this.emitChange(this.value),this.userInput=null,this.validateEvent&&this.dispatch("ElFormItem","el.form.blur"),this.$emit("blur",this),this.blur()))},parsedValue:{immediate:!0,handler:function(e){this.picker&&(this.picker.value=e)}},defaultValue:function(e){this.picker&&(this.picker.defaultValue=e)},value:function(e,t){br(e,t)||this.pickerVisible||!this.validateEvent||this.dispatch("ElFormItem","el.form.change",e)}},computed:{ranged:function(){return this.type.indexOf("range")>-1},reference:function(){var e=this.$refs.reference;return e.$el||e},refInput:function(){return this.reference?[].slice.call(this.reference.querySelectorAll("input")):[]},valueIsEmpty:function(){var e=this.value;if(Array.isArray(e)){for(var t=0,i=e.length;t0&&void 0!==arguments[0]?arguments[0]:"",i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];e.userInput=null,e.pickerVisible=e.picker.visible=i,e.emitInput(t),e.picker.resetView&&e.picker.resetView()}),this.picker.$on("select-range",function(t,i,n){0!==e.refInput.length&&(n&&"min"!==n?"max"===n&&(e.refInput[1].setSelectionRange(t,i),e.refInput[1].focus()):(e.refInput[0].setSelectionRange(t,i),e.refInput[0].focus()))})},unmountPicker:function(){this.picker&&(this.picker.$destroy(),this.picker.$off(),"function"===typeof this.unwatchPickerOptions&&this.unwatchPickerOptions(),this.picker.$el.parentNode.removeChild(this.picker.$el))},emitChange:function(e){br(e,this.valueOnOpen)||(this.$emit("change",e),this.valueOnOpen=e,this.validateEvent&&this.dispatch("ElFormItem","el.form.change",e))},emitInput:function(e){var t=this.formatToValue(e);br(this.value,t)||this.$emit("input",t)},isValidValue:function(e){return this.picker||this.mountPicker(),!this.picker.isValidValue||e&&this.picker.isValidValue(e)}}},Cr=xr,wr=o(Cr,sr,rr,!1,null,null,null);wr.options.__file="packages/date-picker/src/picker.vue";var kr=wr.exports,Sr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-enter":e.handleEnter,"after-leave":e.handleLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-picker el-popper",class:[{"has-sidebar":e.$slots.sidebar||e.shortcuts,"has-time":e.showTime},e.popperClass]},[i("div",{staticClass:"el-picker-panel__body-wrapper"},[e._t("sidebar"),e.shortcuts?i("div",{staticClass:"el-picker-panel__sidebar"},e._l(e.shortcuts,function(t,n){return i("button",{key:n,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(i){e.handleShortcutClick(t)}}},[e._v(e._s(t.text))])}),0):e._e(),i("div",{staticClass:"el-picker-panel__body"},[e.showTime?i("div",{staticClass:"el-date-picker__time-header"},[i("span",{staticClass:"el-date-picker__editor-wrap"},[i("el-input",{attrs:{placeholder:e.t("el.datepicker.selectDate"),value:e.visibleDate,size:"small"},on:{input:function(t){return e.userInputDate=t},change:e.handleVisibleDateChange}})],1),i("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleTimePickClose,expression:"handleTimePickClose"}],staticClass:"el-date-picker__editor-wrap"},[i("el-input",{ref:"input",attrs:{placeholder:e.t("el.datepicker.selectTime"),value:e.visibleTime,size:"small"},on:{focus:function(t){e.timePickerVisible=!0},input:function(t){return e.userInputTime=t},change:e.handleVisibleTimeChange}}),i("time-picker",{ref:"timepicker",attrs:{"time-arrow-control":e.arrowControl,visible:e.timePickerVisible},on:{pick:e.handleTimePick,mounted:e.proxyTimePickerDataProperties}})],1)]):e._e(),i("div",{directives:[{name:"show",rawName:"v-show",value:"time"!==e.currentView,expression:"currentView !== 'time'"}],staticClass:"el-date-picker__header",class:{"el-date-picker__header--bordered":"year"===e.currentView||"month"===e.currentView}},[i("button",{staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-d-arrow-left",attrs:{type:"button","aria-label":e.t("el.datepicker.prevYear")},on:{click:e.prevYear}}),i("button",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__prev-btn el-icon-arrow-left",attrs:{type:"button","aria-label":e.t("el.datepicker.prevMonth")},on:{click:e.prevMonth}}),i("span",{staticClass:"el-date-picker__header-label",attrs:{role:"button"},on:{click:e.showYearPicker}},[e._v(e._s(e.yearLabel))]),i("span",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],staticClass:"el-date-picker__header-label",class:{active:"month"===e.currentView},attrs:{role:"button"},on:{click:e.showMonthPicker}},[e._v(e._s(e.t("el.datepicker.month"+(e.month+1))))]),i("button",{staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-d-arrow-right",attrs:{type:"button","aria-label":e.t("el.datepicker.nextYear")},on:{click:e.nextYear}}),i("button",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],staticClass:"el-picker-panel__icon-btn el-date-picker__next-btn el-icon-arrow-right",attrs:{type:"button","aria-label":e.t("el.datepicker.nextMonth")},on:{click:e.nextMonth}})]),i("div",{staticClass:"el-picker-panel__content"},[i("date-table",{directives:[{name:"show",rawName:"v-show",value:"date"===e.currentView,expression:"currentView === 'date'"}],attrs:{"selection-mode":e.selectionMode,"first-day-of-week":e.firstDayOfWeek,value:e.value,"default-value":e.defaultValue?new Date(e.defaultValue):null,date:e.date,"disabled-date":e.disabledDate},on:{pick:e.handleDatePick}}),i("year-table",{directives:[{name:"show",rawName:"v-show",value:"year"===e.currentView,expression:"currentView === 'year'"}],attrs:{value:e.value,"default-value":e.defaultValue?new Date(e.defaultValue):null,date:e.date,"disabled-date":e.disabledDate},on:{pick:e.handleYearPick}}),i("month-table",{directives:[{name:"show",rawName:"v-show",value:"month"===e.currentView,expression:"currentView === 'month'"}],attrs:{value:e.value,"default-value":e.defaultValue?new Date(e.defaultValue):null,date:e.date,"disabled-date":e.disabledDate},on:{pick:e.handleMonthPick}})],1)])],2),i("div",{directives:[{name:"show",rawName:"v-show",value:e.footerVisible&&"date"===e.currentView,expression:"footerVisible && currentView === 'date'"}],staticClass:"el-picker-panel__footer"},[i("el-button",{directives:[{name:"show",rawName:"v-show",value:"dates"!==e.selectionMode,expression:"selectionMode !== 'dates'"}],staticClass:"el-picker-panel__link-btn",attrs:{size:"mini",type:"text"},on:{click:e.changeToNow}},[e._v("\n "+e._s(e.t("el.datepicker.now"))+"\n ")]),i("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{plain:"",size:"mini"},on:{click:e.confirm}},[e._v("\n "+e._s(e.t("el.datepicker.confirm"))+"\n ")])],1)])])},Dr=[];Sr._withStripped=!0;var $r=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-time-panel el-popper",class:e.popperClass},[i("div",{staticClass:"el-time-panel__content",class:{"has-seconds":e.showSeconds}},[i("time-spinner",{ref:"spinner",attrs:{"arrow-control":e.useArrow,"show-seconds":e.showSeconds,"am-pm-mode":e.amPmMode,date:e.date},on:{change:e.handleChange,"select-range":e.setSelectionRange}})],1),i("div",{staticClass:"el-time-panel__footer"},[i("button",{staticClass:"el-time-panel__btn cancel",attrs:{type:"button"},on:{click:e.handleCancel}},[e._v(e._s(e.t("el.datepicker.cancel")))]),i("button",{staticClass:"el-time-panel__btn",class:{confirm:!e.disabled},attrs:{type:"button"},on:{click:function(t){e.handleConfirm()}}},[e._v(e._s(e.t("el.datepicker.confirm")))])])])])},Or=[];$r._withStripped=!0;var Er=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-time-spinner",class:{"has-seconds":e.showSeconds}},[e.arrowControl?e._e():[i("el-scrollbar",{ref:"hours",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(t){e.emitSelectRange("hours")},mousemove:function(t){e.adjustCurrentSpinner("hours")}}},e._l(e.hoursList,function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:n===e.hours,disabled:t},on:{click:function(i){e.handleClick("hours",{value:n,disabled:t})}}},[e._v(e._s(("0"+(e.amPmMode?n%12||12:n)).slice(-2))+e._s(e.amPm(n)))])}),0),i("el-scrollbar",{ref:"minutes",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(t){e.emitSelectRange("minutes")},mousemove:function(t){e.adjustCurrentSpinner("minutes")}}},e._l(e.minutesList,function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:n===e.minutes,disabled:!t},on:{click:function(t){e.handleClick("minutes",{value:n,disabled:!1})}}},[e._v(e._s(("0"+n).slice(-2)))])}),0),i("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.showSeconds,expression:"showSeconds"}],ref:"seconds",staticClass:"el-time-spinner__wrapper",attrs:{"wrap-style":"max-height: inherit;","view-class":"el-time-spinner__list",noresize:"",tag:"ul"},nativeOn:{mouseenter:function(t){e.emitSelectRange("seconds")},mousemove:function(t){e.adjustCurrentSpinner("seconds")}}},e._l(60,function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:n===e.seconds},on:{click:function(t){e.handleClick("seconds",{value:n,disabled:!1})}}},[e._v(e._s(("0"+n).slice(-2)))])}),0)],e.arrowControl?[i("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(t){e.emitSelectRange("hours")}}},[i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),i("ul",{ref:"hours",staticClass:"el-time-spinner__list"},e._l(e.arrowHourList,function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:t===e.hours,disabled:e.hoursList[t]}},[e._v(e._s(void 0===t?"":("0"+(e.amPmMode?t%12||12:t)).slice(-2)+e.amPm(t)))])}),0)]),i("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(t){e.emitSelectRange("minutes")}}},[i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),i("ul",{ref:"minutes",staticClass:"el-time-spinner__list"},e._l(e.arrowMinuteList,function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:t===e.minutes}},[e._v("\n "+e._s(void 0===t?"":("0"+t).slice(-2))+"\n ")])}),0)]),e.showSeconds?i("div",{staticClass:"el-time-spinner__wrapper is-arrow",on:{mouseenter:function(t){e.emitSelectRange("seconds")}}},[i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-time-spinner__arrow el-icon-arrow-up"}),i("i",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-time-spinner__arrow el-icon-arrow-down"}),i("ul",{ref:"seconds",staticClass:"el-time-spinner__list"},e._l(e.arrowSecondList,function(t,n){return i("li",{key:n,staticClass:"el-time-spinner__item",class:{active:t===e.seconds}},[e._v("\n "+e._s(void 0===t?"":("0"+t).slice(-2))+"\n ")])}),0)]):e._e()]:e._e()],2)},Tr=[];Er._withStripped=!0;var Pr={components:{ElScrollbar:q.a},directives:{repeatClick:It},props:{date:{},defaultValue:{},showSeconds:{type:Boolean,default:!0},arrowControl:Boolean,amPmMode:{type:String,default:""}},computed:{hours:function(){return this.date.getHours()},minutes:function(){return this.date.getMinutes()},seconds:function(){return this.date.getSeconds()},hoursList:function(){return Object(ar["getRangeHours"])(this.selectableRange)},minutesList:function(){return Object(ar["getRangeMinutes"])(this.selectableRange,this.hours)},arrowHourList:function(){var e=this.hours;return[e>0?e-1:void 0,e,e<23?e+1:void 0]},arrowMinuteList:function(){var e=this.minutes;return[e>0?e-1:void 0,e,e<59?e+1:void 0]},arrowSecondList:function(){var e=this.seconds;return[e>0?e-1:void 0,e,e<59?e+1:void 0]}},data:function(){return{selectableRange:[],currentScrollbar:null}},mounted:function(){var e=this;this.$nextTick(function(){!e.arrowControl&&e.bindScrollEvent()})},methods:{increase:function(){this.scrollDown(1)},decrease:function(){this.scrollDown(-1)},modifyDateField:function(e,t){switch(e){case"hours":this.$emit("change",Object(ar["modifyTime"])(this.date,t,this.minutes,this.seconds));break;case"minutes":this.$emit("change",Object(ar["modifyTime"])(this.date,this.hours,t,this.seconds));break;case"seconds":this.$emit("change",Object(ar["modifyTime"])(this.date,this.hours,this.minutes,t));break}},handleClick:function(e,t){var i=t.value,n=t.disabled;n||(this.modifyDateField(e,i),this.emitSelectRange(e),this.adjustSpinner(e,i))},emitSelectRange:function(e){"hours"===e?this.$emit("select-range",0,2):"minutes"===e?this.$emit("select-range",3,5):"seconds"===e&&this.$emit("select-range",6,8),this.currentScrollbar=e},bindScrollEvent:function(){var e=this,t=function(t){e.$refs[t].wrap.onscroll=function(i){e.handleScroll(t,i)}};t("hours"),t("minutes"),t("seconds")},handleScroll:function(e){var t=Math.min(Math.floor((this.$refs[e].wrap.scrollTop-(.5*this.scrollBarHeight(e)-10)/this.typeItemHeight(e)+3)/this.typeItemHeight(e)),"hours"===e?23:59);this.modifyDateField(e,t)},adjustSpinners:function(){this.adjustSpinner("hours",this.hours),this.adjustSpinner("minutes",this.minutes),this.adjustSpinner("seconds",this.seconds)},adjustCurrentSpinner:function(e){this.adjustSpinner(e,this[e])},adjustSpinner:function(e,t){if(!this.arrowControl){var i=this.$refs[e].wrap;i&&(i.scrollTop=Math.max(0,t*this.typeItemHeight(e)))}},scrollDown:function(e){this.currentScrollbar||this.emitSelectRange("hours");var t=this.currentScrollbar,i=this.hoursList,n=this[t];if("hours"===this.currentScrollbar){var s=Math.abs(e);e=e>0?1:-1;var r=i.length;while(r--&&s)n=(n+e+i.length)%i.length,i[n]||s--;if(i[n])return}else n=(n+e+60)%60;this.modifyDateField(t,n),this.adjustSpinner(t,n)},amPm:function(e){var t="a"===this.amPmMode.toLowerCase();if(!t)return"";var i="A"===this.amPmMode,n=e<12?" am":" pm";return i&&(n=n.toUpperCase()),n},typeItemHeight:function(e){return this.$refs[e].$el.querySelector("li").offsetHeight},scrollBarHeight:function(e){return this.$refs[e].$el.offsetHeight}}},Mr=Pr,Ir=o(Mr,Er,Tr,!1,null,null,null);Ir.options.__file="packages/date-picker/src/basic/time-spinner.vue";var Nr=Ir.exports,jr={mixins:[g.a],components:{TimeSpinner:Nr},props:{visible:Boolean,timeArrowControl:Boolean},watch:{visible:function(e){var t=this;e?(this.oldValue=this.value,this.$nextTick(function(){return t.$refs.spinner.emitSelectRange("hours")})):this.needInitAdjust=!0},value:function(e){var t=this,i=void 0;e instanceof Date?i=Object(ar["limitTimeRange"])(e,this.selectableRange,this.format):e||(i=this.defaultValue?new Date(this.defaultValue):new Date),this.date=i,this.visible&&this.needInitAdjust&&(this.$nextTick(function(e){return t.adjustSpinners()}),this.needInitAdjust=!1)},selectableRange:function(e){this.$refs.spinner.selectableRange=e},defaultValue:function(e){Object(ar["isDate"])(this.value)||(this.date=e?new Date(e):new Date)}},data:function(){return{popperClass:"",format:"HH:mm:ss",value:"",defaultValue:null,date:new Date,oldValue:new Date,selectableRange:[],selectionRange:[0,2],disabled:!1,arrowControl:!1,needInitAdjust:!0}},computed:{showSeconds:function(){return-1!==(this.format||"").indexOf("ss")},useArrow:function(){return this.arrowControl||this.timeArrowControl||!1},amPmMode:function(){return-1!==(this.format||"").indexOf("A")?"A":-1!==(this.format||"").indexOf("a")?"a":""}},methods:{handleCancel:function(){this.$emit("pick",this.oldValue,!1)},handleChange:function(e){this.visible&&(this.date=Object(ar["clearMilliseconds"])(e),this.isValidValue(this.date)&&this.$emit("pick",this.date,!0))},setSelectionRange:function(e,t){this.$emit("select-range",e,t),this.selectionRange=[e,t]},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments[1];if(!t){var i=Object(ar["clearMilliseconds"])(Object(ar["limitTimeRange"])(this.date,this.selectableRange,this.format));this.$emit("pick",i,e,t)}},handleKeydown:function(e){var t=e.keyCode,i={38:-1,40:1,37:-1,39:1};if(37===t||39===t){var n=i[t];return this.changeSelectionRange(n),void e.preventDefault()}if(38===t||40===t){var s=i[t];return this.$refs.spinner.scrollDown(s),void e.preventDefault()}},isValidValue:function(e){return Object(ar["timeWithinRange"])(e,this.selectableRange,this.format)},adjustSpinners:function(){return this.$refs.spinner.adjustSpinners()},changeSelectionRange:function(e){var t=[0,3].concat(this.showSeconds?[6]:[]),i=["hours","minutes"].concat(this.showSeconds?["seconds"]:[]),n=t.indexOf(this.selectionRange[0]),s=(n+e+t.length)%t.length;this.$refs.spinner.emitSelectRange(i[s])}},mounted:function(){var e=this;this.$nextTick(function(){return e.handleConfirm(!0,!0)}),this.$emit("mounted")}},Fr=jr,Lr=o(Fr,$r,Or,!1,null,null,null);Lr.options.__file="packages/date-picker/src/panel/time.vue";var Vr=Lr.exports,Ar=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("table",{staticClass:"el-year-table",on:{click:e.handleYearTableClick}},[i("tbody",[i("tr",[i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+0)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+1)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+1))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+2)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+2))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+3)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+3))])])]),i("tr",[i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+4)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+4))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+5)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+5))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+6)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+6))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+7)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+7))])])]),i("tr",[i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+8)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+8))])]),i("td",{staticClass:"available",class:e.getCellStyle(e.startYear+9)},[i("a",{staticClass:"cell"},[e._v(e._s(e.startYear+9))])]),i("td"),i("td")])])])},zr=[];Ar._withStripped=!0;var Br=function(e){var t=Object(ar["getDayCountOfYear"])(e),i=new Date(e,0,1);return Object(ar["range"])(t).map(function(e){return Object(ar["nextDate"])(i,e)})},Rr={props:{disabledDate:{},value:{},defaultValue:{validator:function(e){return null===e||e instanceof Date&&Object(ar["isDate"])(e)}},date:{}},computed:{startYear:function(){return 10*Math.floor(this.date.getFullYear()/10)}},methods:{getCellStyle:function(e){var t={},i=new Date;return t.disabled="function"===typeof this.disabledDate&&Br(e).every(this.disabledDate),t.current=Object(b["arrayFindIndex"])(Object(b["coerceTruthyValueToArray"])(this.value),function(t){return t.getFullYear()===e})>=0,t.today=i.getFullYear()===e,t.default=this.defaultValue&&this.defaultValue.getFullYear()===e,t},handleYearTableClick:function(e){var t=e.target;if("A"===t.tagName){if(Object(Ve["hasClass"])(t.parentNode,"disabled"))return;var i=t.textContent||t.innerText;this.$emit("pick",Number(i))}}}},Hr=Rr,Wr=o(Hr,Ar,zr,!1,null,null,null);Wr.options.__file="packages/date-picker/src/basic/year-table.vue";var qr=Wr.exports,Yr=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("table",{staticClass:"el-month-table",on:{click:e.handleMonthTableClick,mousemove:e.handleMouseMove}},[i("tbody",e._l(e.rows,function(t,n){return i("tr",{key:n},e._l(t,function(t,n){return i("td",{key:n,class:e.getCellStyle(t)},[i("div",[i("a",{staticClass:"cell"},[e._v(e._s(e.t("el.datepicker.months."+e.months[t.text])))])])])}),0)}),0)])},Kr=[];Yr._withStripped=!0;var Ur=function(e,t){var i=Object(ar["getDayCountOfMonth"])(e,t),n=new Date(e,t,1);return Object(ar["range"])(i).map(function(e){return Object(ar["nextDate"])(n,e)})},Gr=function(e){return new Date(e.getFullYear(),e.getMonth())},Xr=function(e){return"number"===typeof e||"string"===typeof e?Gr(new Date(e)).getTime():e instanceof Date?Gr(e).getTime():NaN},Qr={props:{disabledDate:{},value:{},selectionMode:{default:"month"},minDate:{},maxDate:{},defaultValue:{validator:function(e){return null===e||Object(ar["isDate"])(e)||Array.isArray(e)&&e.every(ar["isDate"])}},date:{},rangeState:{default:function(){return{endDate:null,selecting:!1}}}},mixins:[g.a],watch:{"rangeState.endDate":function(e){this.markRange(this.minDate,e)},minDate:function(e,t){Xr(e)!==Xr(t)&&this.markRange(this.minDate,this.maxDate)},maxDate:function(e,t){Xr(e)!==Xr(t)&&this.markRange(this.minDate,this.maxDate)}},data:function(){return{months:["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],tableRows:[[],[],[]],lastRow:null,lastColumn:null}},methods:{cellMatchesDate:function(e,t){var i=new Date(t);return this.date.getFullYear()===i.getFullYear()&&Number(e.text)===i.getMonth()},getCellStyle:function(e){var t=this,i={},n=this.date.getFullYear(),s=new Date,r=e.text,a=this.defaultValue?Array.isArray(this.defaultValue)?this.defaultValue:[this.defaultValue]:[];return i.disabled="function"===typeof this.disabledDate&&Ur(n,r).every(this.disabledDate),i.current=Object(b["arrayFindIndex"])(Object(b["coerceTruthyValueToArray"])(this.value),function(e){return e.getFullYear()===n&&e.getMonth()===r})>=0,i.today=s.getFullYear()===n&&s.getMonth()===r,i.default=a.some(function(i){return t.cellMatchesDate(e,i)}),e.inRange&&(i["in-range"]=!0,e.start&&(i["start-date"]=!0),e.end&&(i["end-date"]=!0)),i},getMonthOfCell:function(e){var t=this.date.getFullYear();return new Date(t,e,1)},markRange:function(e,t){e=Xr(e),t=Xr(t)||e;var i=[Math.min(e,t),Math.max(e,t)];e=i[0],t=i[1];for(var n=this.rows,s=0,r=n.length;s=e&&h<=t,c.start=e&&h===e,c.end=t&&h===t}},handleMouseMove:function(e){if(this.rangeState.selecting){var t=e.target;if("A"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName){var i=t.parentNode.rowIndex,n=t.cellIndex;this.rows[i][n].disabled||i===this.lastRow&&n===this.lastColumn||(this.lastRow=i,this.lastColumn=n,this.$emit("changerange",{minDate:this.minDate,maxDate:this.maxDate,rangeState:{selecting:!0,endDate:this.getMonthOfCell(4*i+n)}}))}}},handleMonthTableClick:function(e){var t=e.target;if("A"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName&&!Object(Ve["hasClass"])(t,"disabled")){var i=t.cellIndex,n=t.parentNode.rowIndex,s=4*n+i,r=this.getMonthOfCell(s);"range"===this.selectionMode?this.rangeState.selecting?(r>=this.minDate?this.$emit("pick",{minDate:this.minDate,maxDate:r}):this.$emit("pick",{minDate:r,maxDate:this.minDate}),this.rangeState.selecting=!1):(this.$emit("pick",{minDate:r,maxDate:null}),this.rangeState.selecting=!0):this.$emit("pick",s)}}},computed:{rows:function(){for(var e=this,t=this.tableRows,i=this.disabledDate,n=[],s=Xr(new Date),r=0;r<3;r++)for(var a=t[r],o=function(t){var o=a[t];o||(o={row:r,column:t,type:"normal",inRange:!1,start:!1,end:!1}),o.type="normal";var l=4*r+t,c=new Date(e.date.getFullYear(),l).getTime();o.inRange=c>=Xr(e.minDate)&&c<=Xr(e.maxDate),o.start=e.minDate&&c===Xr(e.minDate),o.end=e.maxDate&&c===Xr(e.maxDate);var u=c===s;u&&(o.type="today"),o.text=l;var h=new Date(c);o.disabled="function"===typeof i&&i(h),o.selected=Object(b["arrayFind"])(n,function(e){return e.getTime()===h.getTime()}),e.$set(a,t,o)},l=0;l<4;l++)o(l);return t}}},Zr=Qr,Jr=o(Zr,Yr,Kr,!1,null,null,null);Jr.options.__file="packages/date-picker/src/basic/month-table.vue";var ea=Jr.exports,ta=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("table",{staticClass:"el-date-table",class:{"is-week-mode":"week"===e.selectionMode},attrs:{cellspacing:"0",cellpadding:"0"},on:{click:e.handleClick,mousemove:e.handleMouseMove}},[i("tbody",[i("tr",[e.showWeekNumber?i("th",[e._v(e._s(e.t("el.datepicker.week")))]):e._e(),e._l(e.WEEKS,function(t,n){return i("th",{key:n},[e._v(e._s(e.t("el.datepicker.weeks."+t)))])})],2),e._l(e.rows,function(t,n){return i("tr",{key:n,staticClass:"el-date-table__row",class:{current:e.isWeekActive(t[1])}},e._l(t,function(t,n){return i("td",{key:n,class:e.getCellClasses(t)},[i("div",[i("span",[e._v("\n "+e._s(t.text)+"\n ")])])])}),0)})],2)])},ia=[];ta._withStripped=!0;var na=["sun","mon","tue","wed","thu","fri","sat"],sa=function(e){return"number"===typeof e||"string"===typeof e?Object(ar["clearTime"])(new Date(e)).getTime():e instanceof Date?Object(ar["clearTime"])(e).getTime():NaN},ra=function(e,t){var i="function"===typeof t?Object(b["arrayFindIndex"])(e,t):e.indexOf(t);return i>=0?[].concat(e.slice(0,i),e.slice(i+1)):e},aa={mixins:[g.a],props:{firstDayOfWeek:{default:7,type:Number,validator:function(e){return e>=1&&e<=7}},value:{},defaultValue:{validator:function(e){return null===e||Object(ar["isDate"])(e)||Array.isArray(e)&&e.every(ar["isDate"])}},date:{},selectionMode:{default:"day"},showWeekNumber:{type:Boolean,default:!1},disabledDate:{},minDate:{},maxDate:{},rangeState:{default:function(){return{endDate:null,selecting:!1}}}},computed:{offsetDay:function(){var e=this.firstDayOfWeek;return e>3?7-e:-e},WEEKS:function(){var e=this.firstDayOfWeek;return na.concat(na).slice(e,e+7)},year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()},startDate:function(){return Object(ar["getStartDateOfMonth"])(this.year,this.month)},rows:function(){var e=this,t=new Date(this.year,this.month,1),i=Object(ar["getFirstDayOfMonth"])(t),n=Object(ar["getDayCountOfMonth"])(t.getFullYear(),t.getMonth()),s=Object(ar["getDayCountOfMonth"])(t.getFullYear(),0===t.getMonth()?11:t.getMonth()-1);i=0===i?7:i;for(var r=this.offsetDay,a=this.tableRows,o=1,l=this.startDate,c=this.disabledDate,u="dates"===this.selectionMode?Object(b["coerceTruthyValueToArray"])(this.value):[],h=sa(new Date),d=0;d<6;d++){var p=a[d];this.showWeekNumber&&(p[0]||(p[0]={type:"week",text:Object(ar["getWeekNumber"])(Object(ar["nextDate"])(l,7*d+1))}));for(var f=function(t){var a=p[e.showWeekNumber?t+1:t];a||(a={row:d,column:t,type:"normal",inRange:!1,start:!1,end:!1}),a.type="normal";var f=7*d+t,m=Object(ar["nextDate"])(l,f-r).getTime();a.inRange=m>=sa(e.minDate)&&m<=sa(e.maxDate),a.start=e.minDate&&m===sa(e.minDate),a.end=e.maxDate&&m===sa(e.maxDate);var v=m===h;if(v&&(a.type="today"),d>=0&&d<=1){var g=i+r<0?7+i+r:i+r;t+7*d>=g?a.text=o++:(a.text=s-(g-t%7)+1+7*d,a.type="prev-month")}else o<=n?a.text=o++:(a.text=o++-n,a.type="next-month");var y=new Date(m);a.disabled="function"===typeof c&&c(y),a.selected=Object(b["arrayFind"])(u,function(e){return e.getTime()===y.getTime()}),e.$set(p,e.showWeekNumber?t+1:t,a)},m=0;m<7;m++)f(m);if("week"===this.selectionMode){var v=this.showWeekNumber?1:0,g=this.showWeekNumber?7:6,y=this.isWeekActive(p[v+1]);p[v].inRange=y,p[v].start=y,p[g].inRange=y,p[g].end=y}}return a}},watch:{"rangeState.endDate":function(e){this.markRange(this.minDate,e)},minDate:function(e,t){sa(e)!==sa(t)&&this.markRange(this.minDate,this.maxDate)},maxDate:function(e,t){sa(e)!==sa(t)&&this.markRange(this.minDate,this.maxDate)}},data:function(){return{tableRows:[[],[],[],[],[],[]],lastRow:null,lastColumn:null}},methods:{cellMatchesDate:function(e,t){var i=new Date(t);return this.year===i.getFullYear()&&this.month===i.getMonth()&&Number(e.text)===i.getDate()},getCellClasses:function(e){var t=this,i=this.selectionMode,n=this.defaultValue?Array.isArray(this.defaultValue)?this.defaultValue:[this.defaultValue]:[],s=[];return"normal"!==e.type&&"today"!==e.type||e.disabled?s.push(e.type):(s.push("available"),"today"===e.type&&s.push("today")),"normal"===e.type&&n.some(function(i){return t.cellMatchesDate(e,i)})&&s.push("default"),"day"!==i||"normal"!==e.type&&"today"!==e.type||!this.cellMatchesDate(e,this.value)||s.push("current"),!e.inRange||"normal"!==e.type&&"today"!==e.type&&"week"!==this.selectionMode||(s.push("in-range"),e.start&&s.push("start-date"),e.end&&s.push("end-date")),e.disabled&&s.push("disabled"),e.selected&&s.push("selected"),s.join(" ")},getDateOfCell:function(e,t){var i=7*e+(t-(this.showWeekNumber?1:0))-this.offsetDay;return Object(ar["nextDate"])(this.startDate,i)},isWeekActive:function(e){if("week"!==this.selectionMode)return!1;var t=new Date(this.year,this.month,1),i=t.getFullYear(),n=t.getMonth();if("prev-month"===e.type&&(t.setMonth(0===n?11:n-1),t.setFullYear(0===n?i-1:i)),"next-month"===e.type&&(t.setMonth(11===n?0:n+1),t.setFullYear(11===n?i+1:i)),t.setDate(parseInt(e.text,10)),Object(ar["isDate"])(this.value)){var s=(this.value.getDay()-this.firstDayOfWeek+7)%7-1,r=Object(ar["prevDate"])(this.value,s);return r.getTime()===t.getTime()}return!1},markRange:function(e,t){e=sa(e),t=sa(t)||e;var i=[Math.min(e,t),Math.max(e,t)];e=i[0],t=i[1];for(var n=this.startDate,s=this.rows,r=0,a=s.length;r=e&&d<=t,u.start=e&&d===e,u.end=t&&d===t}},handleMouseMove:function(e){if(this.rangeState.selecting){var t=e.target;if("SPAN"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName){var i=t.parentNode.rowIndex-1,n=t.cellIndex;this.rows[i][n].disabled||i===this.lastRow&&n===this.lastColumn||(this.lastRow=i,this.lastColumn=n,this.$emit("changerange",{minDate:this.minDate,maxDate:this.maxDate,rangeState:{selecting:!0,endDate:this.getDateOfCell(i,n)}}))}}},handleClick:function(e){var t=e.target;if("SPAN"===t.tagName&&(t=t.parentNode.parentNode),"DIV"===t.tagName&&(t=t.parentNode),"TD"===t.tagName){var i=t.parentNode.rowIndex-1,n="week"===this.selectionMode?1:t.cellIndex,s=this.rows[i][n];if(!s.disabled&&"week"!==s.type){var r=this.getDateOfCell(i,n);if("range"===this.selectionMode)this.rangeState.selecting?(r>=this.minDate?this.$emit("pick",{minDate:this.minDate,maxDate:r}):this.$emit("pick",{minDate:r,maxDate:this.minDate}),this.rangeState.selecting=!1):(this.$emit("pick",{minDate:r,maxDate:null}),this.rangeState.selecting=!0);else if("day"===this.selectionMode)this.$emit("pick",r);else if("week"===this.selectionMode){var a=Object(ar["getWeekNumber"])(r),o=r.getFullYear()+"w"+a;this.$emit("pick",{year:r.getFullYear(),week:a,value:o,date:r})}else if("dates"===this.selectionMode){var l=this.value||[],c=s.selected?ra(l,function(e){return e.getTime()===r.getTime()}):[].concat(l,[r]);this.$emit("pick",c)}}}}}},oa=aa,la=o(oa,ta,ia,!1,null,null,null);la.options.__file="packages/date-picker/src/basic/date-table.vue";var ca=la.exports,ua={mixins:[g.a],directives:{Clickoutside:A.a},watch:{showTime:function(e){var t=this;e&&this.$nextTick(function(e){var i=t.$refs.input.$el;i&&(t.pickerWidth=i.getBoundingClientRect().width+10)})},value:function(e){"dates"===this.selectionMode&&this.value||(Object(ar["isDate"])(e)?this.date=new Date(e):this.date=this.getDefaultValue())},defaultValue:function(e){Object(ar["isDate"])(this.value)||(this.date=e?new Date(e):new Date)},timePickerVisible:function(e){var t=this;e&&this.$nextTick(function(){return t.$refs.timepicker.adjustSpinners()})},selectionMode:function(e){"month"===e?"year"===this.currentView&&"month"===this.currentView||(this.currentView="month"):"dates"===e&&(this.currentView="date")}},methods:{proxyTimePickerDataProperties:function(){var e=this,t=function(t){e.$refs.timepicker.format=t},i=function(t){e.$refs.timepicker.value=t},n=function(t){e.$refs.timepicker.date=t},s=function(t){e.$refs.timepicker.selectableRange=t};this.$watch("value",i),this.$watch("date",n),this.$watch("selectableRange",s),t(this.timeFormat),i(this.value),n(this.date),s(this.selectableRange)},handleClear:function(){this.date=this.getDefaultValue(),this.$emit("pick",null)},emit:function(e){for(var t=this,i=arguments.length,n=Array(i>1?i-1:0),s=1;s0)||Object(ar["timeWithinRange"])(e,this.selectableRange,this.format||"HH:mm:ss")}},components:{TimePicker:Vr,YearTable:qr,MonthTable:ea,DateTable:ca,ElInput:m.a,ElButton:ae.a},data:function(){return{popperClass:"",date:new Date,value:"",defaultValue:null,defaultTime:null,showTime:!1,selectionMode:"day",shortcuts:"",visible:!1,currentView:"date",disabledDate:"",selectableRange:[],firstDayOfWeek:7,showWeekNumber:!1,timePickerVisible:!1,format:"",arrowControl:!1,userInputDate:null,userInputTime:null}},computed:{year:function(){return this.date.getFullYear()},month:function(){return this.date.getMonth()},week:function(){return Object(ar["getWeekNumber"])(this.date)},monthDate:function(){return this.date.getDate()},footerVisible:function(){return this.showTime||"dates"===this.selectionMode},visibleTime:function(){return null!==this.userInputTime?this.userInputTime:Object(ar["formatDate"])(this.value||this.defaultValue,this.timeFormat)},visibleDate:function(){return null!==this.userInputDate?this.userInputDate:Object(ar["formatDate"])(this.value||this.defaultValue,this.dateFormat)},yearLabel:function(){var e=this.t("el.datepicker.year");if("year"===this.currentView){var t=10*Math.floor(this.year/10);return e?t+" "+e+" - "+(t+9)+" "+e:t+" - "+(t+9)}return this.year+" "+e},timeFormat:function(){return this.format?Object(ar["extractTimeFormat"])(this.format):"HH:mm:ss"},dateFormat:function(){return this.format?Object(ar["extractDateFormat"])(this.format):"yyyy-MM-dd"}}},ha=ua,da=o(ha,Sr,Dr,!1,null,null,null);da.options.__file="packages/date-picker/src/panel/date.vue";var pa=da.exports,fa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-range-picker el-popper",class:[{"has-sidebar":e.$slots.sidebar||e.shortcuts,"has-time":e.showTime},e.popperClass]},[i("div",{staticClass:"el-picker-panel__body-wrapper"},[e._t("sidebar"),e.shortcuts?i("div",{staticClass:"el-picker-panel__sidebar"},e._l(e.shortcuts,function(t,n){return i("button",{key:n,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(i){e.handleShortcutClick(t)}}},[e._v(e._s(t.text))])}),0):e._e(),i("div",{staticClass:"el-picker-panel__body"},[e.showTime?i("div",{staticClass:"el-date-range-picker__time-header"},[i("span",{staticClass:"el-date-range-picker__editors-wrap"},[i("span",{staticClass:"el-date-range-picker__time-picker-wrap"},[i("el-input",{ref:"minInput",staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.startDate"),value:e.minVisibleDate},on:{input:function(t){return e.handleDateInput(t,"min")},change:function(t){return e.handleDateChange(t,"min")}}})],1),i("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleMinTimeClose,expression:"handleMinTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[i("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.startTime"),value:e.minVisibleTime},on:{focus:function(t){e.minTimePickerVisible=!0},input:function(t){return e.handleTimeInput(t,"min")},change:function(t){return e.handleTimeChange(t,"min")}}}),i("time-picker",{ref:"minTimePicker",attrs:{"time-arrow-control":e.arrowControl,visible:e.minTimePickerVisible},on:{pick:e.handleMinTimePick,mounted:function(t){e.$refs.minTimePicker.format=e.timeFormat}}})],1)]),i("span",{staticClass:"el-icon-arrow-right"}),i("span",{staticClass:"el-date-range-picker__editors-wrap is-right"},[i("span",{staticClass:"el-date-range-picker__time-picker-wrap"},[i("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.endDate"),value:e.maxVisibleDate,readonly:!e.minDate},on:{input:function(t){return e.handleDateInput(t,"max")},change:function(t){return e.handleDateChange(t,"max")}}})],1),i("span",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.handleMaxTimeClose,expression:"handleMaxTimeClose"}],staticClass:"el-date-range-picker__time-picker-wrap"},[i("el-input",{staticClass:"el-date-range-picker__editor",attrs:{size:"small",disabled:e.rangeState.selecting,placeholder:e.t("el.datepicker.endTime"),value:e.maxVisibleTime,readonly:!e.minDate},on:{focus:function(t){e.minDate&&(e.maxTimePickerVisible=!0)},input:function(t){return e.handleTimeInput(t,"max")},change:function(t){return e.handleTimeChange(t,"max")}}}),i("time-picker",{ref:"maxTimePicker",attrs:{"time-arrow-control":e.arrowControl,visible:e.maxTimePickerVisible},on:{pick:e.handleMaxTimePick,mounted:function(t){e.$refs.maxTimePicker.format=e.timeFormat}}})],1)])]):e._e(),i("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-left"},[i("div",{staticClass:"el-date-range-picker__header"},[i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",attrs:{type:"button"},on:{click:e.leftPrevYear}}),i("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",attrs:{type:"button"},on:{click:e.leftPrevMonth}}),e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.leftNextYear}}):e._e(),e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",class:{"is-disabled":!e.enableMonthArrow},attrs:{type:"button",disabled:!e.enableMonthArrow},on:{click:e.leftNextMonth}}):e._e(),i("div",[e._v(e._s(e.leftLabel))])]),i("date-table",{attrs:{"selection-mode":"range",date:e.leftDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate,"first-day-of-week":e.firstDayOfWeek},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1),i("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-right"},[i("div",{staticClass:"el-date-range-picker__header"},[e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.rightPrevYear}}):e._e(),e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-left",class:{"is-disabled":!e.enableMonthArrow},attrs:{type:"button",disabled:!e.enableMonthArrow},on:{click:e.rightPrevMonth}}):e._e(),i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",attrs:{type:"button"},on:{click:e.rightNextYear}}),i("button",{staticClass:"el-picker-panel__icon-btn el-icon-arrow-right",attrs:{type:"button"},on:{click:e.rightNextMonth}}),i("div",[e._v(e._s(e.rightLabel))])]),i("date-table",{attrs:{"selection-mode":"range",date:e.rightDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate,"first-day-of-week":e.firstDayOfWeek},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1)])],2),e.showTime?i("div",{staticClass:"el-picker-panel__footer"},[i("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{size:"mini",type:"text"},on:{click:e.handleClear}},[e._v("\n "+e._s(e.t("el.datepicker.clear"))+"\n ")]),i("el-button",{staticClass:"el-picker-panel__link-btn",attrs:{plain:"",size:"mini",disabled:e.btnDisabled},on:{click:function(t){e.handleConfirm(!1)}}},[e._v("\n "+e._s(e.t("el.datepicker.confirm"))+"\n ")])],1):e._e()])])},ma=[];fa._withStripped=!0;var va=function(e){return Array.isArray(e)?[new Date(e[0]),new Date(e[1])]:e?[new Date(e),Object(ar["nextDate"])(new Date(e),1)]:[new Date,Object(ar["nextDate"])(new Date,1)]},ga={mixins:[g.a],directives:{Clickoutside:A.a},computed:{btnDisabled:function(){return!(this.minDate&&this.maxDate&&!this.selecting&&this.isValidValue([this.minDate,this.maxDate]))},leftLabel:function(){return this.leftDate.getFullYear()+" "+this.t("el.datepicker.year")+" "+this.t("el.datepicker.month"+(this.leftDate.getMonth()+1))},rightLabel:function(){return this.rightDate.getFullYear()+" "+this.t("el.datepicker.year")+" "+this.t("el.datepicker.month"+(this.rightDate.getMonth()+1))},leftYear:function(){return this.leftDate.getFullYear()},leftMonth:function(){return this.leftDate.getMonth()},leftMonthDate:function(){return this.leftDate.getDate()},rightYear:function(){return this.rightDate.getFullYear()},rightMonth:function(){return this.rightDate.getMonth()},rightMonthDate:function(){return this.rightDate.getDate()},minVisibleDate:function(){return null!==this.dateUserInput.min?this.dateUserInput.min:this.minDate?Object(ar["formatDate"])(this.minDate,this.dateFormat):""},maxVisibleDate:function(){return null!==this.dateUserInput.max?this.dateUserInput.max:this.maxDate||this.minDate?Object(ar["formatDate"])(this.maxDate||this.minDate,this.dateFormat):""},minVisibleTime:function(){return null!==this.timeUserInput.min?this.timeUserInput.min:this.minDate?Object(ar["formatDate"])(this.minDate,this.timeFormat):""},maxVisibleTime:function(){return null!==this.timeUserInput.max?this.timeUserInput.max:this.maxDate||this.minDate?Object(ar["formatDate"])(this.maxDate||this.minDate,this.timeFormat):""},timeFormat:function(){return this.format?Object(ar["extractTimeFormat"])(this.format):"HH:mm:ss"},dateFormat:function(){return this.format?Object(ar["extractDateFormat"])(this.format):"yyyy-MM-dd"},enableMonthArrow:function(){var e=(this.leftMonth+1)%12,t=this.leftMonth+1>=12?1:0;return this.unlinkPanels&&new Date(this.leftYear+t,e)=12}},data:function(){return{popperClass:"",value:[],defaultValue:null,defaultTime:null,minDate:"",maxDate:"",leftDate:new Date,rightDate:Object(ar["nextMonth"])(new Date),rangeState:{endDate:null,selecting:!1,row:null,column:null},showTime:!1,shortcuts:"",visible:"",disabledDate:"",firstDayOfWeek:7,minTimePickerVisible:!1,maxTimePickerVisible:!1,format:"",arrowControl:!1,unlinkPanels:!1,dateUserInput:{min:null,max:null},timeUserInput:{min:null,max:null}}},watch:{minDate:function(e){var t=this;this.dateUserInput.min=null,this.timeUserInput.min=null,this.$nextTick(function(){if(t.$refs.maxTimePicker&&t.maxDate&&t.maxDatethis.maxDate&&(this.maxDate=this.minDate)):(this.maxDate=Object(ar["modifyDate"])(this.maxDate,i.getFullYear(),i.getMonth(),i.getDate()),this.maxDatethis.maxDate&&(this.maxDate=this.minDate),this.$refs.minTimePicker.value=this.minDate,this.minTimePickerVisible=!1):(this.maxDate=Object(ar["modifyTime"])(this.maxDate,i.getHours(),i.getMinutes(),i.getSeconds()),this.maxDate1&&void 0!==arguments[1])||arguments[1],n=this.defaultTime||[],s=Object(ar["modifyWithTimeString"])(e.minDate,n[0]),r=Object(ar["modifyWithTimeString"])(e.maxDate,n[1]);this.maxDate===r&&this.minDate===s||(this.onPick&&this.onPick(e),this.maxDate=r,this.minDate=s,setTimeout(function(){t.maxDate=r,t.minDate=s},10),i&&!this.showTime&&this.handleConfirm())},handleShortcutClick:function(e){e.onClick&&e.onClick(this)},handleMinTimePick:function(e,t,i){this.minDate=this.minDate||new Date,e&&(this.minDate=Object(ar["modifyTime"])(this.minDate,e.getHours(),e.getMinutes(),e.getSeconds())),i||(this.minTimePickerVisible=t),(!this.maxDate||this.maxDate&&this.maxDate.getTime()this.maxDate.getTime()&&(this.minDate=new Date(this.maxDate))},handleMaxTimeClose:function(){this.maxTimePickerVisible=!1},leftPrevYear:function(){this.leftDate=Object(ar["prevYear"])(this.leftDate),this.unlinkPanels||(this.rightDate=Object(ar["nextMonth"])(this.leftDate))},leftPrevMonth:function(){this.leftDate=Object(ar["prevMonth"])(this.leftDate),this.unlinkPanels||(this.rightDate=Object(ar["nextMonth"])(this.leftDate))},rightNextYear:function(){this.unlinkPanels?this.rightDate=Object(ar["nextYear"])(this.rightDate):(this.leftDate=Object(ar["nextYear"])(this.leftDate),this.rightDate=Object(ar["nextMonth"])(this.leftDate))},rightNextMonth:function(){this.unlinkPanels?this.rightDate=Object(ar["nextMonth"])(this.rightDate):(this.leftDate=Object(ar["nextMonth"])(this.leftDate),this.rightDate=Object(ar["nextMonth"])(this.leftDate))},leftNextYear:function(){this.leftDate=Object(ar["nextYear"])(this.leftDate)},leftNextMonth:function(){this.leftDate=Object(ar["nextMonth"])(this.leftDate)},rightPrevYear:function(){this.rightDate=Object(ar["prevYear"])(this.rightDate)},rightPrevMonth:function(){this.rightDate=Object(ar["prevMonth"])(this.rightDate)},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isValidValue([this.minDate,this.maxDate])&&this.$emit("pick",[this.minDate,this.maxDate],e)},isValidValue:function(e){return Array.isArray(e)&&e&&e[0]&&e[1]&&Object(ar["isDate"])(e[0])&&Object(ar["isDate"])(e[1])&&e[0].getTime()<=e[1].getTime()&&("function"!==typeof this.disabledDate||!this.disabledDate(e[0])&&!this.disabledDate(e[1]))},resetView:function(){this.minDate=this.value&&Object(ar["isDate"])(this.value[0])?new Date(this.value[0]):null,this.maxDate=this.value&&Object(ar["isDate"])(this.value[0])?new Date(this.value[1]):null}},components:{TimePicker:Vr,DateTable:ca,ElInput:m.a,ElButton:ae.a}},ba=ga,ya=o(ba,fa,ma,!1,null,null,null);ya.options.__file="packages/date-picker/src/panel/date-range.vue";var _a=ya.exports,xa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-picker-panel el-date-range-picker el-popper",class:[{"has-sidebar":e.$slots.sidebar||e.shortcuts},e.popperClass]},[i("div",{staticClass:"el-picker-panel__body-wrapper"},[e._t("sidebar"),e.shortcuts?i("div",{staticClass:"el-picker-panel__sidebar"},e._l(e.shortcuts,function(t,n){return i("button",{key:n,staticClass:"el-picker-panel__shortcut",attrs:{type:"button"},on:{click:function(i){e.handleShortcutClick(t)}}},[e._v(e._s(t.text))])}),0):e._e(),i("div",{staticClass:"el-picker-panel__body"},[i("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-left"},[i("div",{staticClass:"el-date-range-picker__header"},[i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",attrs:{type:"button"},on:{click:e.leftPrevYear}}),e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.leftNextYear}}):e._e(),i("div",[e._v(e._s(e.leftLabel))])]),i("month-table",{attrs:{"selection-mode":"range",date:e.leftDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1),i("div",{staticClass:"el-picker-panel__content el-date-range-picker__content is-right"},[i("div",{staticClass:"el-date-range-picker__header"},[e.unlinkPanels?i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-left",class:{"is-disabled":!e.enableYearArrow},attrs:{type:"button",disabled:!e.enableYearArrow},on:{click:e.rightPrevYear}}):e._e(),i("button",{staticClass:"el-picker-panel__icon-btn el-icon-d-arrow-right",attrs:{type:"button"},on:{click:e.rightNextYear}}),i("div",[e._v(e._s(e.rightLabel))])]),i("month-table",{attrs:{"selection-mode":"range",date:e.rightDate,"default-value":e.defaultValue,"min-date":e.minDate,"max-date":e.maxDate,"range-state":e.rangeState,"disabled-date":e.disabledDate},on:{changerange:e.handleChangeRange,pick:e.handleRangePick}})],1)])],2)])])},Ca=[];xa._withStripped=!0;var wa=function(e){return Array.isArray(e)?[new Date(e[0]),new Date(e[1])]:e?[new Date(e),Object(ar["nextMonth"])(new Date(e))]:[new Date,Object(ar["nextMonth"])(new Date)]},ka={mixins:[g.a],directives:{Clickoutside:A.a},computed:{btnDisabled:function(){return!(this.minDate&&this.maxDate&&!this.selecting&&this.isValidValue([this.minDate,this.maxDate]))},leftLabel:function(){return this.leftDate.getFullYear()+" "+this.t("el.datepicker.year")},rightLabel:function(){return this.rightDate.getFullYear()+" "+this.t("el.datepicker.year")},leftYear:function(){return this.leftDate.getFullYear()},rightYear:function(){return this.rightDate.getFullYear()===this.leftDate.getFullYear()?this.leftDate.getFullYear()+1:this.rightDate.getFullYear()},enableYearArrow:function(){return this.unlinkPanels&&this.rightYear>this.leftYear+1}},data:function(){return{popperClass:"",value:[],defaultValue:null,defaultTime:null,minDate:"",maxDate:"",leftDate:new Date,rightDate:Object(ar["nextYear"])(new Date),rangeState:{endDate:null,selecting:!1,row:null,column:null},shortcuts:"",visible:"",disabledDate:"",format:"",arrowControl:!1,unlinkPanels:!1}},watch:{value:function(e){if(e){if(Array.isArray(e))if(this.minDate=Object(ar["isDate"])(e[0])?new Date(e[0]):null,this.maxDate=Object(ar["isDate"])(e[1])?new Date(e[1]):null,this.minDate)if(this.leftDate=this.minDate,this.unlinkPanels&&this.maxDate){var t=this.minDate.getFullYear(),i=this.maxDate.getFullYear();this.rightDate=t===i?Object(ar["nextYear"])(this.maxDate):this.maxDate}else this.rightDate=Object(ar["nextYear"])(this.leftDate);else this.leftDate=wa(this.defaultValue)[0],this.rightDate=Object(ar["nextYear"])(this.leftDate)}else this.minDate=null,this.maxDate=null},defaultValue:function(e){if(!Array.isArray(this.value)){var t=wa(e),i=t[0],n=t[1];this.leftDate=i,this.rightDate=e&&e[1]&&i.getFullYear()!==n.getFullYear()&&this.unlinkPanels?n:Object(ar["nextYear"])(this.leftDate)}}},methods:{handleClear:function(){this.minDate=null,this.maxDate=null,this.leftDate=wa(this.defaultValue)[0],this.rightDate=Object(ar["nextYear"])(this.leftDate),this.$emit("pick",null)},handleChangeRange:function(e){this.minDate=e.minDate,this.maxDate=e.maxDate,this.rangeState=e.rangeState},handleRangePick:function(e){var t=this,i=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.defaultTime||[],s=Object(ar["modifyWithTimeString"])(e.minDate,n[0]),r=Object(ar["modifyWithTimeString"])(e.maxDate,n[1]);this.maxDate===r&&this.minDate===s||(this.onPick&&this.onPick(e),this.maxDate=r,this.minDate=s,setTimeout(function(){t.maxDate=r,t.minDate=s},10),i&&this.handleConfirm())},handleShortcutClick:function(e){e.onClick&&e.onClick(this)},leftPrevYear:function(){this.leftDate=Object(ar["prevYear"])(this.leftDate),this.unlinkPanels||(this.rightDate=Object(ar["prevYear"])(this.rightDate))},rightNextYear:function(){this.unlinkPanels||(this.leftDate=Object(ar["nextYear"])(this.leftDate)),this.rightDate=Object(ar["nextYear"])(this.rightDate)},leftNextYear:function(){this.leftDate=Object(ar["nextYear"])(this.leftDate)},rightPrevYear:function(){this.rightDate=Object(ar["prevYear"])(this.rightDate)},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isValidValue([this.minDate,this.maxDate])&&this.$emit("pick",[this.minDate,this.maxDate],e)},isValidValue:function(e){return Array.isArray(e)&&e&&e[0]&&e[1]&&Object(ar["isDate"])(e[0])&&Object(ar["isDate"])(e[1])&&e[0].getTime()<=e[1].getTime()&&("function"!==typeof this.disabledDate||!this.disabledDate(e[0])&&!this.disabledDate(e[1]))},resetView:function(){this.minDate=this.value&&Object(ar["isDate"])(this.value[0])?new Date(this.value[0]):null,this.maxDate=this.value&&Object(ar["isDate"])(this.value[0])?new Date(this.value[1]):null}},components:{MonthTable:ea,ElInput:m.a,ElButton:ae.a}},Sa=ka,Da=o(Sa,xa,Ca,!1,null,null,null);Da.options.__file="packages/date-picker/src/panel/month-range.vue";var $a=Da.exports,Oa=function(e){return"daterange"===e||"datetimerange"===e?_a:"monthrange"===e?$a:pa},Ea={mixins:[kr],name:"ElDatePicker",props:{type:{type:String,default:"date"},timeArrowControl:Boolean},watch:{type:function(e){this.picker?(this.unmountPicker(),this.panel=Oa(e),this.mountPicker()):this.panel=Oa(e)}},created:function(){this.panel=Oa(this.type)},install:function(e){e.component(Ea.name,Ea)}},Ta=Ea,Pa=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"before-enter":e.handleMenuEnter,"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],ref:"popper",staticClass:"el-picker-panel time-select el-popper",class:e.popperClass,style:{width:e.width+"px"}},[i("el-scrollbar",{attrs:{noresize:"","wrap-class":"el-picker-panel__content"}},e._l(e.items,function(t){return i("div",{key:t.value,staticClass:"time-select-item",class:{selected:e.value===t.value,disabled:t.disabled,default:t.value===e.defaultValue},attrs:{disabled:t.disabled},on:{click:function(i){e.handleClick(t)}}},[e._v(e._s(t.value))])}),0)],1)])},Ma=[];Pa._withStripped=!0;var Ia=function(e){var t=(e||"").split(":");if(t.length>=2){var i=parseInt(t[0],10),n=parseInt(t[1],10);return{hours:i,minutes:n}}return null},Na=function(e,t){var i=Ia(e),n=Ia(t),s=i.minutes+60*i.hours,r=n.minutes+60*n.hours;return s===r?0:s>r?1:-1},ja=function(e){return(e.hours<10?"0"+e.hours:e.hours)+":"+(e.minutes<10?"0"+e.minutes:e.minutes)},Fa=function(e,t){var i=Ia(e),n=Ia(t),s={hours:i.hours,minutes:i.minutes};return s.minutes+=n.minutes,s.hours+=n.hours,s.hours+=Math.floor(s.minutes/60),s.minutes=s.minutes%60,ja(s)},La={components:{ElScrollbar:q.a},watch:{value:function(e){var t=this;e&&this.$nextTick(function(){return t.scrollToOption()})}},methods:{handleClick:function(e){e.disabled||this.$emit("pick",e.value)},handleClear:function(){this.$emit("pick",null)},scrollToOption:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:".selected",t=this.$refs.popper.querySelector(".el-picker-panel__content");nn()(t,t.querySelector(e))},handleMenuEnter:function(){var e=this,t=-1!==this.items.map(function(e){return e.value}).indexOf(this.value),i=-1!==this.items.map(function(e){return e.value}).indexOf(this.defaultValue),n=(t?".selected":i&&".default")||".time-select-item:not(.disabled)";this.$nextTick(function(){return e.scrollToOption(n)})},scrollDown:function(e){var t=this.items,i=t.length,n=t.length,s=t.map(function(e){return e.value}).indexOf(this.value);while(n--)if(s=(s+e+i)%i,!t[s].disabled)return void this.$emit("pick",t[s].value,!0)},isValidValue:function(e){return-1!==this.items.filter(function(e){return!e.disabled}).map(function(e){return e.value}).indexOf(e)},handleKeydown:function(e){var t=e.keyCode;if(38===t||40===t){var i={40:1,38:-1},n=i[t.toString()];return this.scrollDown(n),void e.stopPropagation()}}},data:function(){return{popperClass:"",start:"09:00",end:"18:00",step:"00:30",value:"",defaultValue:"",visible:!1,minTime:"",maxTime:"",width:0}},computed:{items:function(){var e=this.start,t=this.end,i=this.step,n=[];if(e&&t&&i){var s=e;while(Na(s,t)<=0)n.push({value:s,disabled:Na(s,this.minTime||"-1:-1")<=0||Na(s,this.maxTime||"100:100")>=0}),s=Fa(s,i)}return n}}},Va=La,Aa=o(Va,Pa,Ma,!1,null,null,null);Aa.options.__file="packages/date-picker/src/panel/time-select.vue";var za=Aa.exports,Ba={mixins:[kr],name:"ElTimeSelect",componentName:"ElTimeSelect",props:{type:{type:String,default:"time-select"}},beforeCreate:function(){this.panel=za},install:function(e){e.component(Ba.name,Ba)}},Ra=Ba,Ha=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":function(t){e.$emit("dodestroy")}}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-time-range-picker el-picker-panel el-popper",class:e.popperClass},[i("div",{staticClass:"el-time-range-picker__content"},[i("div",{staticClass:"el-time-range-picker__cell"},[i("div",{staticClass:"el-time-range-picker__header"},[e._v(e._s(e.t("el.datepicker.startTime")))]),i("div",{staticClass:"el-time-range-picker__body el-time-panel__content",class:{"has-seconds":e.showSeconds,"is-arrow":e.arrowControl}},[i("time-spinner",{ref:"minSpinner",attrs:{"show-seconds":e.showSeconds,"am-pm-mode":e.amPmMode,"arrow-control":e.arrowControl,date:e.minDate},on:{change:e.handleMinChange,"select-range":e.setMinSelectionRange}})],1)]),i("div",{staticClass:"el-time-range-picker__cell"},[i("div",{staticClass:"el-time-range-picker__header"},[e._v(e._s(e.t("el.datepicker.endTime")))]),i("div",{staticClass:"el-time-range-picker__body el-time-panel__content",class:{"has-seconds":e.showSeconds,"is-arrow":e.arrowControl}},[i("time-spinner",{ref:"maxSpinner",attrs:{"show-seconds":e.showSeconds,"am-pm-mode":e.amPmMode,"arrow-control":e.arrowControl,date:e.maxDate},on:{change:e.handleMaxChange,"select-range":e.setMaxSelectionRange}})],1)])]),i("div",{staticClass:"el-time-panel__footer"},[i("button",{staticClass:"el-time-panel__btn cancel",attrs:{type:"button"},on:{click:function(t){e.handleCancel()}}},[e._v(e._s(e.t("el.datepicker.cancel")))]),i("button",{staticClass:"el-time-panel__btn confirm",attrs:{type:"button",disabled:e.btnDisabled},on:{click:function(t){e.handleConfirm()}}},[e._v(e._s(e.t("el.datepicker.confirm")))])])])])},Wa=[];Ha._withStripped=!0;var qa=Object(ar["parseDate"])("00:00:00","HH:mm:ss"),Ya=Object(ar["parseDate"])("23:59:59","HH:mm:ss"),Ka=function(e){return Object(ar["modifyDate"])(qa,e.getFullYear(),e.getMonth(),e.getDate())},Ua=function(e){return Object(ar["modifyDate"])(Ya,e.getFullYear(),e.getMonth(),e.getDate())},Ga=function(e,t){return new Date(Math.min(e.getTime()+t,Ua(e).getTime()))},Xa={mixins:[g.a],components:{TimeSpinner:Nr},computed:{showSeconds:function(){return-1!==(this.format||"").indexOf("ss")},offset:function(){return this.showSeconds?11:8},spinner:function(){return this.selectionRange[0]this.maxDate.getTime()},amPmMode:function(){return-1!==(this.format||"").indexOf("A")?"A":-1!==(this.format||"").indexOf("a")?"a":""}},data:function(){return{popperClass:"",minDate:new Date,maxDate:new Date,value:[],oldValue:[new Date,new Date],defaultValue:null,format:"HH:mm:ss",visible:!1,selectionRange:[0,2],arrowControl:!1}},watch:{value:function(e){Array.isArray(e)?(this.minDate=new Date(e[0]),this.maxDate=new Date(e[1])):Array.isArray(this.defaultValue)?(this.minDate=new Date(this.defaultValue[0]),this.maxDate=new Date(this.defaultValue[1])):this.defaultValue?(this.minDate=new Date(this.defaultValue),this.maxDate=Ga(new Date(this.defaultValue),36e5)):(this.minDate=new Date,this.maxDate=Ga(new Date,36e5))},visible:function(e){var t=this;e&&(this.oldValue=this.value,this.$nextTick(function(){return t.$refs.minSpinner.emitSelectRange("hours")}))}},methods:{handleClear:function(){this.$emit("pick",null)},handleCancel:function(){this.$emit("pick",this.oldValue)},handleMinChange:function(e){this.minDate=Object(ar["clearMilliseconds"])(e),this.handleChange()},handleMaxChange:function(e){this.maxDate=Object(ar["clearMilliseconds"])(e),this.handleChange()},handleChange:function(){this.isValidValue([this.minDate,this.maxDate])&&(this.$refs.minSpinner.selectableRange=[[Ka(this.minDate),this.maxDate]],this.$refs.maxSpinner.selectableRange=[[this.minDate,Ua(this.maxDate)]],this.$emit("pick",[this.minDate,this.maxDate],!0))},setMinSelectionRange:function(e,t){this.$emit("select-range",e,t,"min"),this.selectionRange=[e,t]},setMaxSelectionRange:function(e,t){this.$emit("select-range",e,t,"max"),this.selectionRange=[e+this.offset,t+this.offset]},handleConfirm:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.$refs.minSpinner.selectableRange,i=this.$refs.maxSpinner.selectableRange;this.minDate=Object(ar["limitTimeRange"])(this.minDate,t,this.format),this.maxDate=Object(ar["limitTimeRange"])(this.maxDate,i,this.format),this.$emit("pick",[this.minDate,this.maxDate],e)},adjustSpinners:function(){this.$refs.minSpinner.adjustSpinners(),this.$refs.maxSpinner.adjustSpinners()},changeSelectionRange:function(e){var t=this.showSeconds?[0,3,6,11,14,17]:[0,3,8,11],i=["hours","minutes"].concat(this.showSeconds?["seconds"]:[]),n=t.indexOf(this.selectionRange[0]),s=(n+e+t.length)%t.length,r=t.length/2;s-1}},openDelay:{type:Number,default:0},title:String,disabled:Boolean,content:String,reference:{},popperClass:String,width:{},visibleArrow:{default:!0},arrowOffset:{type:Number,default:0},transition:{type:String,default:"fade-in-linear"},tabindex:{type:Number,default:0}},computed:{tooltipId:function(){return"el-popover-"+Object(b["generateId"])()}},watch:{showPopper:function(e){this.disabled||(e?this.$emit("show"):this.$emit("hide"))}},mounted:function(){var e=this,t=this.referenceElm=this.reference||this.$refs.reference,i=this.popper||this.$refs.popper;!t&&this.$slots.reference&&this.$slots.reference[0]&&(t=this.referenceElm=this.$slots.reference[0].elm),t&&(Object(Ve["addClass"])(t,"el-popover__reference"),t.setAttribute("aria-describedby",this.tooltipId),t.setAttribute("tabindex",this.tabindex),i.setAttribute("tabindex",0),"click"!==this.trigger&&(Object(Ve["on"])(t,"focusin",function(){e.handleFocus();var i=t.__vue__;i&&"function"===typeof i.focus&&i.focus()}),Object(Ve["on"])(i,"focusin",this.handleFocus),Object(Ve["on"])(t,"focusout",this.handleBlur),Object(Ve["on"])(i,"focusout",this.handleBlur)),Object(Ve["on"])(t,"keydown",this.handleKeydown),Object(Ve["on"])(t,"click",this.handleClick)),"click"===this.trigger?(Object(Ve["on"])(t,"click",this.doToggle),Object(Ve["on"])(document,"click",this.handleDocumentClick)):"hover"===this.trigger?(Object(Ve["on"])(t,"mouseenter",this.handleMouseEnter),Object(Ve["on"])(i,"mouseenter",this.handleMouseEnter),Object(Ve["on"])(t,"mouseleave",this.handleMouseLeave),Object(Ve["on"])(i,"mouseleave",this.handleMouseLeave)):"focus"===this.trigger&&(this.tabindex<0&&console.warn("[Element Warn][Popover]a negative taindex means that the element cannot be focused by tab key"),t.querySelector("input, textarea")?(Object(Ve["on"])(t,"focusin",this.doShow),Object(Ve["on"])(t,"focusout",this.doClose)):(Object(Ve["on"])(t,"mousedown",this.doShow),Object(Ve["on"])(t,"mouseup",this.doClose)))},beforeDestroy:function(){this.cleanup()},deactivated:function(){this.cleanup()},methods:{doToggle:function(){this.showPopper=!this.showPopper},doShow:function(){this.showPopper=!0},doClose:function(){this.showPopper=!1},handleFocus:function(){Object(Ve["addClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!0)},handleClick:function(){Object(Ve["removeClass"])(this.referenceElm,"focusing")},handleBlur:function(){Object(Ve["removeClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!1)},handleMouseEnter:function(){var e=this;clearTimeout(this._timer),this.openDelay?this._timer=setTimeout(function(){e.showPopper=!0},this.openDelay):this.showPopper=!0},handleKeydown:function(e){27===e.keyCode&&"manual"!==this.trigger&&this.doClose()},handleMouseLeave:function(){var e=this;clearTimeout(this._timer),this._timer=setTimeout(function(){e.showPopper=!1},200)},handleDocumentClick:function(e){var t=this.reference||this.$refs.reference,i=this.popper||this.$refs.popper;!t&&this.$slots.reference&&this.$slots.reference[0]&&(t=this.referenceElm=this.$slots.reference[0].elm),this.$el&&t&&!this.$el.contains(e.target)&&!t.contains(e.target)&&i&&!i.contains(e.target)&&(this.showPopper=!1)},handleAfterEnter:function(){this.$emit("after-enter")},handleAfterLeave:function(){this.$emit("after-leave"),this.doDestroy()},cleanup:function(){this.openDelay&&clearTimeout(this._timer)}},destroyed:function(){var e=this.reference;Object(Ve["off"])(e,"click",this.doToggle),Object(Ve["off"])(e,"mouseup",this.doClose),Object(Ve["off"])(e,"mousedown",this.doShow),Object(Ve["off"])(e,"focusin",this.doShow),Object(Ve["off"])(e,"focusout",this.doClose),Object(Ve["off"])(e,"mousedown",this.doShow),Object(Ve["off"])(e,"mouseup",this.doClose),Object(Ve["off"])(e,"mouseleave",this.handleMouseLeave),Object(Ve["off"])(e,"mouseenter",this.handleMouseEnter),Object(Ve["off"])(document,"click",this.handleDocumentClick)}},ro=so,ao=o(ro,io,no,!1,null,null,null);ao.options.__file="packages/popover/src/main.vue";var oo=ao.exports,lo=function(e,t,i){var n=t.expression?t.value:t.arg,s=i.context.$refs[n];s&&(Array.isArray(s)?s[0].$refs.reference=e:s.$refs.reference=e)},co={bind:function(e,t,i){lo(e,t,i)},inserted:function(e,t,i){lo(e,t,i)}};Wn.a.directive("popover",co),oo.install=function(e){e.directive("popover",co),e.component(oo.name,oo)},oo.directive=co;var uo=oo,ho={name:"ElTooltip",mixins:[H.a],props:{openDelay:{type:Number,default:0},disabled:Boolean,manual:Boolean,effect:{type:String,default:"dark"},arrowOffset:{type:Number,default:0},popperClass:String,content:String,visibleArrow:{default:!0},transition:{type:String,default:"el-fade-in-linear"},popperOptions:{default:function(){return{boundariesPadding:10,gpuAcceleration:!1}}},enterable:{type:Boolean,default:!0},hideAfter:{type:Number,default:0},tabindex:{type:Number,default:0}},data:function(){return{tooltipId:"el-tooltip-"+Object(b["generateId"])(),timeoutPending:null,focusing:!1}},beforeCreate:function(){var e=this;this.$isServer||(this.popperVM=new Wn.a({data:{node:""},render:function(e){return this.node}}).$mount(),this.debounceClose=L()(200,function(){return e.handleClosePopper()}))},render:function(e){var t=this;this.popperVM&&(this.popperVM.node=e("transition",{attrs:{name:this.transition},on:{afterLeave:this.doDestroy}},[e("div",{on:{mouseleave:function(){t.setExpectedState(!1),t.debounceClose()},mouseenter:function(){t.setExpectedState(!0)}},ref:"popper",attrs:{role:"tooltip",id:this.tooltipId,"aria-hidden":this.disabled||!this.showPopper?"true":"false"},directives:[{name:"show",value:!this.disabled&&this.showPopper}],class:["el-tooltip__popper","is-"+this.effect,this.popperClass]},[this.$slots.content||this.content])]));var i=this.getFirstElement();if(!i)return null;var n=i.data=i.data||{};return n.staticClass=this.addTooltipClass(n.staticClass),i},mounted:function(){var e=this;this.referenceElm=this.$el,1===this.$el.nodeType&&(this.$el.setAttribute("aria-describedby",this.tooltipId),this.$el.setAttribute("tabindex",this.tabindex),Object(Ve["on"])(this.referenceElm,"mouseenter",this.show),Object(Ve["on"])(this.referenceElm,"mouseleave",this.hide),Object(Ve["on"])(this.referenceElm,"focus",function(){if(e.$slots.default&&e.$slots.default.length){var t=e.$slots.default[0].componentInstance;t&&t.focus?t.focus():e.handleFocus()}else e.handleFocus()}),Object(Ve["on"])(this.referenceElm,"blur",this.handleBlur),Object(Ve["on"])(this.referenceElm,"click",this.removeFocusing)),this.value&&this.popperVM&&this.popperVM.$nextTick(function(){e.value&&e.updatePopper()})},watch:{focusing:function(e){e?Object(Ve["addClass"])(this.referenceElm,"focusing"):Object(Ve["removeClass"])(this.referenceElm,"focusing")}},methods:{show:function(){this.setExpectedState(!0),this.handleShowPopper()},hide:function(){this.setExpectedState(!1),this.debounceClose()},handleFocus:function(){this.focusing=!0,this.show()},handleBlur:function(){this.focusing=!1,this.hide()},removeFocusing:function(){this.focusing=!1},addTooltipClass:function(e){return e?"el-tooltip "+e.replace("el-tooltip",""):"el-tooltip"},handleShowPopper:function(){var e=this;this.expectedState&&!this.manual&&(clearTimeout(this.timeout),this.timeout=setTimeout(function(){e.showPopper=!0},this.openDelay),this.hideAfter>0&&(this.timeoutPending=setTimeout(function(){e.showPopper=!1},this.hideAfter)))},handleClosePopper:function(){this.enterable&&this.expectedState||this.manual||(clearTimeout(this.timeout),this.timeoutPending&&clearTimeout(this.timeoutPending),this.showPopper=!1,this.disabled&&this.doDestroy())},setExpectedState:function(e){!1===e&&clearTimeout(this.timeoutPending),this.expectedState=e},getFirstElement:function(){var e=this.$slots.default;if(!Array.isArray(e))return null;for(var t=null,i=0;i0){Oo=To.shift();var t=Oo.options;for(var i in t)t.hasOwnProperty(i)&&(Eo[i]=t[i]);void 0===t.callback&&(Eo.callback=Po);var n=Eo.callback;Eo.callback=function(t,i){n(t,i),e()},Object(ko["isVNode"])(Eo.message)?(Eo.$slots.default=[Eo.message],Eo.message=null):delete Eo.$slots.default,["modal","showClose","closeOnClickModal","closeOnPressEscape","closeOnHashChange"].forEach(function(e){void 0===Eo[e]&&(Eo[e]=!0)}),document.body.appendChild(Eo.$el),Wn.a.nextTick(function(){Eo.visible=!0})}},No=function e(t,i){if(!Wn.a.prototype.$isServer){if("string"===typeof t||Object(ko["isVNode"])(t)?(t={message:t},"string"===typeof arguments[1]&&(t.title=arguments[1])):t.callback&&!i&&(i=t.callback),"undefined"!==typeof Promise)return new Promise(function(n,s){To.push({options:St()({},Do,e.defaults,t),callback:i,resolve:n,reject:s}),Io()});To.push({options:St()({},Do,e.defaults,t),callback:i}),Io()}};No.setDefaults=function(e){No.defaults=e},No.alert=function(e,t,i){return"object"===("undefined"===typeof t?"undefined":So(t))?(i=t,t=""):void 0===t&&(t=""),No(St()({title:t,message:e,$type:"alert",closeOnPressEscape:!1,closeOnClickModal:!1},i))},No.confirm=function(e,t,i){return"object"===("undefined"===typeof t?"undefined":So(t))?(i=t,t=""):void 0===t&&(t=""),No(St()({title:t,message:e,$type:"confirm",showCancelButton:!0},i))},No.prompt=function(e,t,i){return"object"===("undefined"===typeof t?"undefined":So(t))?(i=t,t=""):void 0===t&&(t=""),No(St()({title:t,message:e,showCancelButton:!0,showInput:!0,$type:"prompt"},i))},No.close=function(){Eo.doClose(),Eo.visible=!1,To=[],Oo=null};var jo=No,Fo=jo,Lo=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-breadcrumb",attrs:{"aria-label":"Breadcrumb",role:"navigation"}},[e._t("default")],2)},Vo=[];Lo._withStripped=!0;var Ao={name:"ElBreadcrumb",props:{separator:{type:String,default:"/"},separatorClass:{type:String,default:""}},provide:function(){return{elBreadcrumb:this}},mounted:function(){var e=this.$el.querySelectorAll(".el-breadcrumb__item");e.length&&e[e.length-1].setAttribute("aria-current","page")}},zo=Ao,Bo=o(zo,Lo,Vo,!1,null,null,null);Bo.options.__file="packages/breadcrumb/src/breadcrumb.vue";var Ro=Bo.exports;Ro.install=function(e){e.component(Ro.name,Ro)};var Ho=Ro,Wo=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",{staticClass:"el-breadcrumb__item"},[i("span",{ref:"link",class:["el-breadcrumb__inner",e.to?"is-link":""],attrs:{role:"link"}},[e._t("default")],2),e.separatorClass?i("i",{staticClass:"el-breadcrumb__separator",class:e.separatorClass}):i("span",{staticClass:"el-breadcrumb__separator",attrs:{role:"presentation"}},[e._v(e._s(e.separator))])])},qo=[];Wo._withStripped=!0;var Yo={name:"ElBreadcrumbItem",props:{to:{},replace:Boolean},data:function(){return{separator:"",separatorClass:""}},inject:["elBreadcrumb"],mounted:function(){var e=this;this.separator=this.elBreadcrumb.separator,this.separatorClass=this.elBreadcrumb.separatorClass;var t=this.$refs.link;t.setAttribute("role","link"),t.addEventListener("click",function(t){var i=e.to,n=e.$router;i&&n&&(e.replace?n.replace(i):n.push(i))})}},Ko=Yo,Uo=o(Ko,Wo,qo,!1,null,null,null);Uo.options.__file="packages/breadcrumb/src/breadcrumb-item.vue";var Go=Uo.exports;Go.install=function(e){e.component(Go.name,Go)};var Xo=Go,Qo=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("form",{staticClass:"el-form",class:[e.labelPosition?"el-form--label-"+e.labelPosition:"",{"el-form--inline":e.inline}]},[e._t("default")],2)},Zo=[];Qo._withStripped=!0;var Jo={name:"ElForm",componentName:"ElForm",provide:function(){return{elForm:this}},props:{model:Object,rules:Object,labelPosition:String,labelWidth:String,labelSuffix:{type:String,default:""},inline:Boolean,inlineMessage:Boolean,statusIcon:Boolean,showMessage:{type:Boolean,default:!0},size:String,disabled:Boolean,validateOnRuleChange:{type:Boolean,default:!0},hideRequiredAsterisk:{type:Boolean,default:!1}},watch:{rules:function(){this.fields.forEach(function(e){e.removeValidateEvents(),e.addValidateEvents()}),this.validateOnRuleChange&&this.validate(function(){})}},computed:{autoLabelWidth:function(){if(!this.potentialLabelWidthArr.length)return 0;var e=Math.max.apply(Math,this.potentialLabelWidthArr);return e?e+"px":""}},data:function(){return{fields:[],potentialLabelWidthArr:[]}},created:function(){var e=this;this.$on("el.form.addField",function(t){t&&e.fields.push(t)}),this.$on("el.form.removeField",function(t){t.prop&&e.fields.splice(e.fields.indexOf(t),1)})},methods:{resetFields:function(){this.model?this.fields.forEach(function(e){e.resetField()}):console.warn("[Element Warn][Form]model is required for resetFields to work.")},clearValidate:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=e.length?"string"===typeof e?this.fields.filter(function(t){return e===t.prop}):this.fields.filter(function(t){return e.indexOf(t.prop)>-1}):this.fields;t.forEach(function(e){e.clearValidate()})},validate:function(e){var t=this;if(this.model){var i=void 0;"function"!==typeof e&&window.Promise&&(i=new window.Promise(function(t,i){e=function(e){e?t(e):i(e)}}));var n=!0,s=0;0===this.fields.length&&e&&e(!0);var r={};return this.fields.forEach(function(i){i.validate("",function(i,a){i&&(n=!1),r=St()({},r,a),"function"===typeof e&&++s===t.fields.length&&e(n,r)})}),i||void 0}console.warn("[Element Warn][Form]model is required for validate to work!")},validateField:function(e,t){e=[].concat(e);var i=this.fields.filter(function(t){return-1!==e.indexOf(t.prop)});i.length?i.forEach(function(e){e.validate("",t)}):console.warn("[Element Warn]please pass correct props!")},getLabelWidthIndex:function(e){var t=this.potentialLabelWidthArr.indexOf(e);if(-1===t)throw new Error("[ElementForm]unpected width ",e);return t},registerLabelWidth:function(e,t){if(e&&t){var i=this.getLabelWidthIndex(t);this.potentialLabelWidthArr.splice(i,1,e)}else e&&this.potentialLabelWidthArr.push(e)},deregisterLabelWidth:function(e){var t=this.getLabelWidthIndex(e);this.potentialLabelWidthArr.splice(t,1)}}},el=Jo,tl=o(el,Qo,Zo,!1,null,null,null);tl.options.__file="packages/form/src/form.vue";var il=tl.exports;il.install=function(e){e.component(il.name,il)};var nl=il,sl=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-form-item",class:[{"el-form-item--feedback":e.elForm&&e.elForm.statusIcon,"is-error":"error"===e.validateState,"is-validating":"validating"===e.validateState,"is-success":"success"===e.validateState,"is-required":e.isRequired||e.required,"is-no-asterisk":e.elForm&&e.elForm.hideRequiredAsterisk},e.sizeClass?"el-form-item--"+e.sizeClass:""]},[i("label-wrap",{attrs:{"is-auto-width":e.labelStyle&&"auto"===e.labelStyle.width,"update-all":"auto"===e.form.labelWidth}},[e.label||e.$slots.label?i("label",{staticClass:"el-form-item__label",style:e.labelStyle,attrs:{for:e.labelFor}},[e._t("label",[e._v(e._s(e.label+e.form.labelSuffix))])],2):e._e()]),i("div",{staticClass:"el-form-item__content",style:e.contentStyle},[e._t("default"),i("transition",{attrs:{name:"el-zoom-in-top"}},["error"===e.validateState&&e.showMessage&&e.form.showMessage?e._t("error",[i("div",{staticClass:"el-form-item__error",class:{"el-form-item__error--inline":"boolean"===typeof e.inlineMessage?e.inlineMessage:e.elForm&&e.elForm.inlineMessage||!1}},[e._v("\n "+e._s(e.validateMessage)+"\n ")])],{error:e.validateMessage}):e._e()],2)],2)],1)},rl=[];sl._withStripped=!0;var al,ol,ll=i(40),cl=i.n(ll),ul={props:{isAutoWidth:Boolean,updateAll:Boolean},inject:["elForm","elFormItem"],render:function(){var e=arguments[0],t=this.$slots.default;if(!t)return null;if(this.isAutoWidth){var i=this.elForm.autoLabelWidth,n={};if(i&&"auto"!==i){var s=parseInt(i,10)-this.computedWidth;s&&(n.marginLeft=s+"px")}return e("div",{class:"el-form-item__label-wrap",style:n},[t])}return t[0]},methods:{getLabelWidth:function(){if(this.$el&&this.$el.firstElementChild){var e=window.getComputedStyle(this.$el.firstElementChild).width;return Math.ceil(parseFloat(e))}return 0},updateLabelWidth:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"update";this.$slots.default&&this.isAutoWidth&&this.$el.firstElementChild&&("update"===e?this.computedWidth=this.getLabelWidth():"remove"===e&&this.elForm.deregisterLabelWidth(this.computedWidth))}},watch:{computedWidth:function(e,t){this.updateAll&&(this.elForm.registerLabelWidth(e,t),this.elFormItem.updateComputedLabelWidth(e))}},data:function(){return{computedWidth:0}},mounted:function(){this.updateLabelWidth("update")},updated:function(){this.updateLabelWidth("update")},beforeDestroy:function(){this.updateLabelWidth("remove")}},hl=ul,dl=o(hl,al,ol,!1,null,null,null);dl.options.__file="packages/form/src/label-wrap.vue";var pl=dl.exports,fl={name:"ElFormItem",componentName:"ElFormItem",mixins:[O.a],provide:function(){return{elFormItem:this}},inject:["elForm"],props:{label:String,labelWidth:String,prop:String,required:{type:Boolean,default:void 0},rules:[Object,Array],error:String,validateStatus:String,for:String,inlineMessage:{type:[String,Boolean],default:""},showMessage:{type:Boolean,default:!0},size:String},components:{LabelWrap:pl},watch:{error:{immediate:!0,handler:function(e){this.validateMessage=e,this.validateState=e?"error":""}},validateStatus:function(e){this.validateState=e}},computed:{labelFor:function(){return this.for||this.prop},labelStyle:function(){var e={};if("top"===this.form.labelPosition)return e;var t=this.labelWidth||this.form.labelWidth;return t&&(e.width=t),e},contentStyle:function(){var e={},t=this.label;if("top"===this.form.labelPosition||this.form.inline)return e;if(!t&&!this.labelWidth&&this.isNested)return e;var i=this.labelWidth||this.form.labelWidth;return"auto"===i?"auto"===this.labelWidth?e.marginLeft=this.computedLabelWidth:"auto"===this.form.labelWidth&&(e.marginLeft=this.elForm.autoLabelWidth):e.marginLeft=i,e},form:function(){var e=this.$parent,t=e.$options.componentName;while("ElForm"!==t)"ElFormItem"===t&&(this.isNested=!0),e=e.$parent,t=e.$options.componentName;return e},fieldValue:function(){var e=this.form.model;if(e&&this.prop){var t=this.prop;return-1!==t.indexOf(":")&&(t=t.replace(/:/,".")),Object(b["getPropByPath"])(e,t,!0).v}},isRequired:function(){var e=this.getRules(),t=!1;return e&&e.length&&e.every(function(e){return!e.required||(t=!0,!1)}),t},_formSize:function(){return this.elForm.size},elFormItemSize:function(){return this.size||this._formSize},sizeClass:function(){return this.elFormItemSize||(this.$ELEMENT||{}).size}},data:function(){return{validateState:"",validateMessage:"",validateDisabled:!1,validator:{},isNested:!1,computedLabelWidth:""}},methods:{validate:function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b["noop"];this.validateDisabled=!1;var n=this.getFilteredRule(e);if((!n||0===n.length)&&void 0===this.required)return i(),!0;this.validateState="validating";var s={};n&&n.length>0&&n.forEach(function(e){delete e.trigger}),s[this.prop]=n;var r=new cl.a(s),a={};a[this.prop]=this.fieldValue,r.validate(a,{firstFields:!0},function(e,n){t.validateState=e?"error":"success",t.validateMessage=e?e[0].message:"",i(t.validateMessage,n),t.elForm&&t.elForm.$emit("validate",t.prop,!e,t.validateMessage||null)})},clearValidate:function(){this.validateState="",this.validateMessage="",this.validateDisabled=!1},resetField:function(){var e=this;this.validateState="",this.validateMessage="";var t=this.form.model,i=this.fieldValue,n=this.prop;-1!==n.indexOf(":")&&(n=n.replace(/:/,"."));var s=Object(b["getPropByPath"])(t,n,!0);this.validateDisabled=!0,Array.isArray(i)?s.o[s.k]=[].concat(this.initialValue):s.o[s.k]=this.initialValue,this.$nextTick(function(){e.validateDisabled=!1}),this.broadcast("ElTimeSelect","fieldReset",this.initialValue)},getRules:function(){var e=this.form.rules,t=this.rules,i=void 0!==this.required?{required:!!this.required}:[],n=Object(b["getPropByPath"])(e,this.prop||"");return e=e?n.o[this.prop||""]||n.v:[],[].concat(t||e||[]).concat(i)},getFilteredRule:function(e){var t=this.getRules();return t.filter(function(t){return!t.trigger||""===e||(Array.isArray(t.trigger)?t.trigger.indexOf(e)>-1:t.trigger===e)}).map(function(e){return St()({},e)})},onFieldBlur:function(){this.validate("blur")},onFieldChange:function(){this.validateDisabled?this.validateDisabled=!1:this.validate("change")},updateComputedLabelWidth:function(e){this.computedLabelWidth=e?e+"px":""},addValidateEvents:function(){var e=this.getRules();(e.length||void 0!==this.required)&&(this.$on("el.form.blur",this.onFieldBlur),this.$on("el.form.change",this.onFieldChange))},removeValidateEvents:function(){this.$off()}},mounted:function(){if(this.prop){this.dispatch("ElForm","el.form.addField",[this]);var e=this.fieldValue;Array.isArray(e)&&(e=[].concat(e)),Object.defineProperty(this,"initialValue",{value:e}),this.addValidateEvents()}},beforeDestroy:function(){this.dispatch("ElForm","el.form.removeField",[this])}},ml=fl,vl=o(ml,sl,rl,!1,null,null,null);vl.options.__file="packages/form/src/form-item.vue";var gl=vl.exports;gl.install=function(e){e.component(gl.name,gl)};var bl=gl,yl=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-tabs__active-bar",class:"is-"+e.rootTabs.tabPosition,style:e.barStyle})},_l=[];yl._withStripped=!0;var xl={name:"TabBar",props:{tabs:Array},inject:["rootTabs"],computed:{barStyle:{get:function(){var e=this,t={},i=0,n=0,s=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height",r="width"===s?"x":"y",a=function(e){return e.toLowerCase().replace(/( |^)[a-z]/g,function(e){return e.toUpperCase()})};this.tabs.every(function(t,r){var o=Object(b["arrayFind"])(e.$parent.$refs.tabs||[],function(e){return e.id.replace("tab-","")===t.paneName});return!!o&&(t.active?(n=o["client"+a(s)],"width"===s&&e.tabs.length>1&&(n-=0===r||r===e.tabs.length-1?20:40),!1):(i+=o["client"+a(s)],!0))}),"width"===s&&0!==i&&(i+=20);var o="translate"+a(r)+"("+i+"px)";return t[s]=n+"px",t.transform=o,t.msTransform=o,t.webkitTransform=o,t}}}},Cl=xl,wl=o(Cl,yl,_l,!1,null,null,null);wl.options.__file="packages/tabs/src/tab-bar.vue";var kl=wl.exports;function Sl(){}var Dl,$l,Ol=function(e){return e.toLowerCase().replace(/( |^)[a-z]/g,function(e){return e.toUpperCase()})},El={name:"TabNav",components:{TabBar:kl},inject:["rootTabs"],props:{panes:Array,currentName:String,editable:Boolean,onTabClick:{type:Function,default:Sl},onTabRemove:{type:Function,default:Sl},type:String,stretch:Boolean},data:function(){return{scrollable:!1,navOffset:0,isFocus:!1,focusable:!0}},computed:{navStyle:function(){var e=-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"X":"Y";return{transform:"translate"+e+"(-"+this.navOffset+"px)"}},sizeName:function(){return-1!==["top","bottom"].indexOf(this.rootTabs.tabPosition)?"width":"height"}},methods:{scrollPrev:function(){var e=this.$refs.navScroll["offset"+Ol(this.sizeName)],t=this.navOffset;if(t){var i=t>e?t-e:0;this.navOffset=i}},scrollNext:function(){var e=this.$refs.nav["offset"+Ol(this.sizeName)],t=this.$refs.navScroll["offset"+Ol(this.sizeName)],i=this.navOffset;if(!(e-i<=t)){var n=e-i>2*t?i+t:e-t;this.navOffset=n}},scrollToActiveTab:function(){if(this.scrollable){var e=this.$refs.nav,t=this.$el.querySelector(".is-active");if(t){var i=this.$refs.navScroll,n=t.getBoundingClientRect(),s=i.getBoundingClientRect(),r=e.offsetWidth-s.width,a=this.navOffset,o=a;n.lefts.right&&(o=a+n.right-s.right),o=Math.max(o,0),this.navOffset=Math.min(o,r)}}},update:function(){if(this.$refs.nav){var e=this.sizeName,t=this.$refs.nav["offset"+Ol(e)],i=this.$refs.navScroll["offset"+Ol(e)],n=this.navOffset;if(i0&&(this.navOffset=0)}},changeTab:function(e){var t=e.keyCode,i=void 0,n=void 0,s=void 0;-1!==[37,38,39,40].indexOf(t)&&(s=e.currentTarget.querySelectorAll("[role=tab]"),n=Array.prototype.indexOf.call(s,e.target),i=37===t||38===t?0===n?s.length-1:n-1:n0&&void 0!==arguments[0]&&arguments[0];if(this.$slots.default){var i=this.$slots.default.filter(function(e){return e.tag&&e.componentOptions&&"ElTabPane"===e.componentOptions.Ctor.options.name}),n=i.map(function(e){var t=e.componentInstance;return t}),s=!(n.length===this.panes.length&&n.every(function(t,i){return t===e.panes[i]}));(t||s)&&(this.panes=n)}else 0!==this.panes.length&&(this.panes=[])},handleTabClick:function(e,t,i){e.disabled||(this.setCurrentName(t),this.$emit("tab-click",e,i))},handleTabRemove:function(e,t){e.disabled||(t.stopPropagation(),this.$emit("edit",e.name,"remove"),this.$emit("tab-remove",e.name))},handleTabAdd:function(){this.$emit("edit",null,"add"),this.$emit("tab-add")},setCurrentName:function(e){var t=this,i=function(){t.currentName=e,t.$emit("input",e)};if(this.currentName!==e&&this.beforeLeave){var n=this.beforeLeave(e,this.currentName);n&&n.then?n.then(function(){i(),t.$refs.nav&&t.$refs.nav.removeFocus()},function(){}):!1!==n&&i()}else i()}},render:function(e){var t,i=this.type,n=this.handleTabClick,s=this.handleTabRemove,r=this.handleTabAdd,a=this.currentName,o=this.panes,l=this.editable,c=this.addable,u=this.tabPosition,h=this.stretch,d=l||c?e("span",{class:"el-tabs__new-tab",on:{click:r,keydown:function(e){13===e.keyCode&&r()}},attrs:{tabindex:"0"}},[e("i",{class:"el-icon-plus"})]):null,p={props:{currentName:a,onTabClick:n,onTabRemove:s,editable:l,type:i,panes:o,stretch:h},ref:"nav"},f=e("div",{class:["el-tabs__header","is-"+u]},[d,e("tab-nav",p)]),m=e("div",{class:"el-tabs__content"},[this.$slots.default]);return e("div",{class:(t={"el-tabs":!0,"el-tabs--card":"card"===i},t["el-tabs--"+u]=!0,t["el-tabs--border-card"]="border-card"===i,t)},["bottom"!==u?[f,m]:[m,f]])},created:function(){this.currentName||this.setCurrentName("0"),this.$on("tab-nav-update",this.calcPaneInstances.bind(null,!0))},mounted:function(){this.calcPaneInstances()},updated:function(){this.calcPaneInstances()}},Fl=jl,Ll=o(Fl,Ml,Il,!1,null,null,null);Ll.options.__file="packages/tabs/src/tabs.vue";var Vl=Ll.exports;Vl.install=function(e){e.component(Vl.name,Vl)};var Al=Vl,zl=function(){var e=this,t=e.$createElement,i=e._self._c||t;return!e.lazy||e.loaded||e.active?i("div",{directives:[{name:"show",rawName:"v-show",value:e.active,expression:"active"}],staticClass:"el-tab-pane",attrs:{role:"tabpanel","aria-hidden":!e.active,id:"pane-"+e.paneName,"aria-labelledby":"tab-"+e.paneName}},[e._t("default")],2):e._e()},Bl=[];zl._withStripped=!0;var Rl={name:"ElTabPane",componentName:"ElTabPane",props:{label:String,labelContent:Function,name:String,closable:Boolean,disabled:Boolean,lazy:Boolean},data:function(){return{index:null,loaded:!1}},computed:{isClosable:function(){return this.closable||this.$parent.closable},active:function(){var e=this.$parent.currentName===(this.name||this.index);return e&&(this.loaded=!0),e},paneName:function(){return this.name||this.index}},updated:function(){this.$parent.$emit("tab-nav-update")}},Hl=Rl,Wl=o(Hl,zl,Bl,!1,null,null,null);Wl.options.__file="packages/tabs/src/tab-pane.vue";var ql=Wl.exports;ql.install=function(e){e.component(ql.name,ql)};var Yl,Kl,Ul=ql,Gl={name:"ElTag",props:{text:String,closable:Boolean,type:String,hit:Boolean,disableTransitions:Boolean,color:String,size:String,effect:{type:String,default:"light",validator:function(e){return["dark","light","plain"].includes(e)}}},methods:{handleClose:function(e){e.stopPropagation(),this.$emit("close",e)},handleClick:function(e){this.$emit("click",e)}},computed:{tagSize:function(){return this.size||(this.$ELEMENT||{}).size}},render:function(e){var t=this.type,i=this.tagSize,n=this.hit,s=this.effect,r=["el-tag",t?"el-tag--"+t:"",i?"el-tag--"+i:"",s?"el-tag--"+s:"",n&&"is-hit"],a=e("span",{class:r,style:{backgroundColor:this.color},on:{click:this.handleClick}},[this.$slots.default,this.closable&&e("i",{class:"el-tag__close el-icon-close",on:{click:this.handleClose}})]);return this.disableTransitions?a:e("transition",{attrs:{name:"el-zoom-in-center"}},[a])}},Xl=Gl,Ql=o(Xl,Yl,Kl,!1,null,null,null);Ql.options.__file="packages/tag/src/tag.vue";var Zl=Ql.exports;Zl.install=function(e){e.component(Zl.name,Zl)};var Jl=Zl,ec=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-tree",class:{"el-tree--highlight-current":e.highlightCurrent,"is-dragging":!!e.dragState.draggingNode,"is-drop-not-allow":!e.dragState.allowDrop,"is-drop-inner":"inner"===e.dragState.dropType},attrs:{role:"tree"}},[e._l(e.root.childNodes,function(t){return i("el-tree-node",{key:e.getNodeKey(t),attrs:{node:t,props:e.props,"render-after-expand":e.renderAfterExpand,"show-checkbox":e.showCheckbox,"render-content":e.renderContent},on:{"node-expand":e.handleNodeExpand}})}),e.isEmpty?i("div",{staticClass:"el-tree__empty-block"},[i("span",{staticClass:"el-tree__empty-text"},[e._v(e._s(e.emptyText))])]):e._e(),i("div",{directives:[{name:"show",rawName:"v-show",value:e.dragState.showDropIndicator,expression:"dragState.showDropIndicator"}],ref:"dropIndicator",staticClass:"el-tree__drop-indicator"})],2)},tc=[];ec._withStripped=!0;var ic="$treeNodeId",nc=function(e,t){t&&!t[ic]&&Object.defineProperty(t,ic,{value:e.id,enumerable:!1,configurable:!1,writable:!1})},sc=function(e,t){return e?t[e]:t[ic]},rc=function(e,t){var i=e;while(i&&"BODY"!==i.tagName){if(i.__vue__&&i.__vue__.$options.name===t)return i.__vue__;i=i.parentNode}return null},ac=function(){function e(e,t){for(var i=0;i0&&n.lazy&&n.defaultExpandAll&&this.expand(),Array.isArray(this.data)||nc(this,this.data),this.data){var a=n.defaultExpandedKeys,o=n.key;o&&a&&-1!==a.indexOf(this.key)&&this.expand(null,n.autoExpandParent),o&&void 0!==n.currentNodeKey&&this.key===n.currentNodeKey&&(n.currentNode=this,n.currentNode.isCurrent=!0),n.lazy&&n._initDefaultCheckedNode(this),this.updateLeafState()}}return e.prototype.setData=function(e){Array.isArray(e)||nc(this,e),this.data=e,this.childNodes=[];var t=void 0;t=0===this.level&&this.data instanceof Array?this.data:uc(this,"children")||[];for(var i=0,n=t.length;i1&&void 0!==arguments[1])||arguments[1],i=function i(n){for(var s=n.childNodes||[],r=!1,a=0,o=s.length;a-1&&t.splice(i,1);var n=this.childNodes.indexOf(e);n>-1&&(this.store&&this.store.deregisterNode(e),e.parent=null,this.childNodes.splice(n,1)),this.updateLeafState()},e.prototype.removeChildByData=function(e){for(var t=null,i=0;i0)n.expanded=!0,n=n.parent}i.expanded=!0,e&&e()};this.shouldLoadData()?this.loadData(function(e){e instanceof Array&&(i.checked?i.setChecked(!0,!0):i.store.checkStrictly||cc(i),n())}):n()},e.prototype.doCreateChildren=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.forEach(function(e){t.insertChild(St()({data:e},i),void 0,!0)})},e.prototype.collapse=function(){this.expanded=!1},e.prototype.shouldLoadData=function(){return!0===this.store.lazy&&this.store.load&&!this.loaded},e.prototype.updateLeafState=function(){if(!0!==this.store.lazy||!0===this.loaded||"undefined"===typeof this.isLeafByUser){var e=this.childNodes;!this.store.lazy||!0===this.store.lazy&&!0===this.loaded?this.isLeaf=!e||0===e.length:this.isLeaf=!1}else this.isLeaf=this.isLeafByUser},e.prototype.setChecked=function(e,t,i,n){var s=this;if(this.indeterminate="half"===e,this.checked=!0===e,!this.store.checkStrictly){if(!this.shouldLoadData()||this.store.checkDescendants){var r=lc(this.childNodes),a=r.all,o=r.allWithoutDisable;this.isLeaf||a||!o||(this.checked=!1,e=!1);var l=function(){if(t){for(var i=s.childNodes,r=0,a=i.length;r0&&void 0!==arguments[0]&&arguments[0];if(0===this.level)return this.data;var t=this.data;if(!t)return null;var i=this.store.props,n="children";return i&&(n=i.children||"children"),void 0===t[n]&&(t[n]=null),e&&!t[n]&&(t[n]=[]),t[n]},e.prototype.updateChildren=function(){var e=this,t=this.getChildren()||[],i=this.childNodes.map(function(e){return e.data}),n={},s=[];t.forEach(function(e,t){e[ic]?n[e[ic]]={index:t,data:e}:s.push({index:t,data:e})}),this.store.lazy||i.forEach(function(t){n[t[ic]]||e.removeChildByData(t)}),s.forEach(function(t){var i=t.index,n=t.data;e.insertChild({data:n},i)}),this.updateLeafState()},e.prototype.loadData=function(e){var t=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!0!==this.store.lazy||!this.store.load||this.loaded||this.loading&&!Object.keys(i).length)e&&e.call(this);else{this.loading=!0;var n=function(n){t.loaded=!0,t.loading=!1,t.childNodes=[],t.doCreateChildren(n,i),t.updateLeafState(),e&&e.call(t,n)};this.store.load(this,n)}},ac(e,[{key:"label",get:function(){return uc(this,"label")}},{key:"key",get:function(){var e=this.store.key;return this.data?this.data[e]:null}},{key:"disabled",get:function(){return uc(this,"disabled")}},{key:"nextSibling",get:function(){var e=this.parent;if(e){var t=e.childNodes.indexOf(this);if(t>-1)return e.childNodes[t+1]}return null}},{key:"previousSibling",get:function(){var e=this.parent;if(e){var t=e.childNodes.indexOf(this);if(t>-1)return t>0?e.childNodes[t-1]:null}return null}}]),e}(),pc=dc,fc="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function mc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var vc=function(){function e(t){var i=this;for(var n in mc(this,e),this.currentNode=null,this.currentNodeKey=null,t)t.hasOwnProperty(n)&&(this[n]=t[n]);if(this.nodesMap={},this.root=new pc({data:this.data,store:this}),this.lazy&&this.load){var s=this.load;s(this.root,function(e){i.root.doCreateChildren(e),i._initDefaultCheckedNodes()})}else this._initDefaultCheckedNodes()}return e.prototype.filter=function(e){var t=this.filterNodeMethod,i=this.lazy,n=function n(s){var r=s.root?s.root.childNodes:s.childNodes;if(r.forEach(function(i){i.visible=t.call(i,e,i.data,i),n(i)}),!s.visible&&r.length){var a=!0;r.forEach(function(e){e.visible&&(a=!1)}),s.root?s.root.visible=!1===a:s.visible=!1===a}e&&(!s.visible||s.isLeaf||i||s.expand())};n(this)},e.prototype.setData=function(e){var t=e!==this.root.data;t?(this.root.setData(e),this._initDefaultCheckedNodes()):this.root.updateChildren()},e.prototype.getNode=function(e){if(e instanceof pc)return e;var t="object"!==("undefined"===typeof e?"undefined":fc(e))?e:sc(this.key,e);return this.nodesMap[t]||null},e.prototype.insertBefore=function(e,t){var i=this.getNode(t);i.parent.insertBefore({data:e},i)},e.prototype.insertAfter=function(e,t){var i=this.getNode(t);i.parent.insertAfter({data:e},i)},e.prototype.remove=function(e){var t=this.getNode(e);t&&t.parent&&(t===this.currentNode&&(this.currentNode=null),t.parent.removeChild(t))},e.prototype.append=function(e,t){var i=t?this.getNode(t):this.root;i&&i.insertChild({data:e})},e.prototype._initDefaultCheckedNodes=function(){var e=this,t=this.defaultCheckedKeys||[],i=this.nodesMap;t.forEach(function(t){var n=i[t];n&&n.setChecked(!0,!e.checkStrictly)})},e.prototype._initDefaultCheckedNode=function(e){var t=this.defaultCheckedKeys||[];-1!==t.indexOf(e.key)&&e.setChecked(!0,!this.checkStrictly)},e.prototype.setDefaultCheckedKey=function(e){e!==this.defaultCheckedKeys&&(this.defaultCheckedKeys=e,this._initDefaultCheckedNodes())},e.prototype.registerNode=function(e){var t=this.key;if(t&&e&&e.data){var i=e.key;void 0!==i&&(this.nodesMap[e.key]=e)}},e.prototype.deregisterNode=function(e){var t=this,i=this.key;i&&e&&e.data&&(e.childNodes.forEach(function(e){t.deregisterNode(e)}),delete this.nodesMap[e.key])},e.prototype.getCheckedNodes=function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=[],n=function n(s){var r=s.root?s.root.childNodes:s.childNodes;r.forEach(function(s){(s.checked||t&&s.indeterminate)&&(!e||e&&s.isLeaf)&&i.push(s.data),n(s)})};return n(this),i},e.prototype.getCheckedKeys=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return this.getCheckedNodes(t).map(function(t){return(t||{})[e.key]})},e.prototype.getHalfCheckedNodes=function(){var e=[],t=function t(i){var n=i.root?i.root.childNodes:i.childNodes;n.forEach(function(i){i.indeterminate&&e.push(i.data),t(i)})};return t(this),e},e.prototype.getHalfCheckedKeys=function(){var e=this;return this.getHalfCheckedNodes().map(function(t){return(t||{})[e.key]})},e.prototype._getAllNodes=function(){var e=[],t=this.nodesMap;for(var i in t)t.hasOwnProperty(i)&&e.push(t[i]);return e},e.prototype.updateChildren=function(e,t){var i=this.nodesMap[e];if(i){for(var n=i.childNodes,s=n.length-1;s>=0;s--){var r=n[s];this.remove(r.data)}for(var a=0,o=t.length;a1&&void 0!==arguments[1]&&arguments[1],i=arguments[2],n=this._getAllNodes().sort(function(e,t){return t.level-e.level}),s=Object.create(null),r=Object.keys(i);n.forEach(function(e){return e.setChecked(!1,!1)});for(var a=0,o=n.length;a-1;if(u){var h=l.parent;while(h&&h.level>0)s[h.data[e]]=!0,h=h.parent;l.isLeaf||this.checkStrictly?l.setChecked(!0,!1):(l.setChecked(!0,!0),t&&function(){l.setChecked(!1,!1);var e=function e(t){var i=t.childNodes;i.forEach(function(t){t.isLeaf||t.setChecked(!1,!1),e(t)})};e(l)}())}else l.checked&&!s[c]&&l.setChecked(!1,!1)}},e.prototype.setCheckedNodes=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],i=this.key,n={};e.forEach(function(e){n[(e||{})[i]]=!0}),this._setCheckedKeys(i,t,n)},e.prototype.setCheckedKeys=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];this.defaultCheckedKeys=e;var i=this.key,n={};e.forEach(function(e){n[e]=!0}),this._setCheckedKeys(i,t,n)},e.prototype.setDefaultExpandedKeys=function(e){var t=this;e=e||[],this.defaultExpandedKeys=e,e.forEach(function(e){var i=t.getNode(e);i&&i.expand(null,t.autoExpandParent)})},e.prototype.setChecked=function(e,t,i){var n=this.getNode(e);n&&n.setChecked(!!t,i)},e.prototype.getCurrentNode=function(){return this.currentNode},e.prototype.setCurrentNode=function(e){var t=this.currentNode;t&&(t.isCurrent=!1),this.currentNode=e,this.currentNode.isCurrent=!0},e.prototype.setUserCurrentNode=function(e){var t=e[this.key],i=this.nodesMap[t];this.setCurrentNode(i)},e.prototype.setCurrentNodeKey=function(e){if(null!==e){var t=this.getNode(e);t&&this.setCurrentNode(t)}else this.currentNode=null},e}(),gc=vc,bc=function(){var e=this,t=this,i=t.$createElement,n=t._self._c||i;return n("div",{directives:[{name:"show",rawName:"v-show",value:t.node.visible,expression:"node.visible"}],ref:"node",staticClass:"el-tree-node",class:{"is-expanded":t.expanded,"is-current":t.node.isCurrent,"is-hidden":!t.node.visible,"is-focusable":!t.node.disabled,"is-checked":!t.node.disabled&&t.node.checked},attrs:{role:"treeitem",tabindex:"-1","aria-expanded":t.expanded,"aria-disabled":t.node.disabled,"aria-checked":t.node.checked,draggable:t.tree.draggable},on:{click:function(e){return e.stopPropagation(),t.handleClick(e)},contextmenu:function(t){return e.handleContextMenu(t)},dragstart:function(e){return e.stopPropagation(),t.handleDragStart(e)},dragover:function(e){return e.stopPropagation(),t.handleDragOver(e)},dragend:function(e){return e.stopPropagation(),t.handleDragEnd(e)},drop:function(e){return e.stopPropagation(),t.handleDrop(e)}}},[n("div",{staticClass:"el-tree-node__content",style:{"padding-left":(t.node.level-1)*t.tree.indent+"px"}},[n("span",{class:[{"is-leaf":t.node.isLeaf,expanded:!t.node.isLeaf&&t.expanded},"el-tree-node__expand-icon",t.tree.iconClass?t.tree.iconClass:"el-icon-caret-right"],on:{click:function(e){return e.stopPropagation(),t.handleExpandIconClick(e)}}}),t.showCheckbox?n("el-checkbox",{attrs:{indeterminate:t.node.indeterminate,disabled:!!t.node.disabled},on:{change:t.handleCheckChange},nativeOn:{click:function(e){e.stopPropagation()}},model:{value:t.node.checked,callback:function(e){t.$set(t.node,"checked",e)},expression:"node.checked"}}):t._e(),t.node.loading?n("span",{staticClass:"el-tree-node__loading-icon el-icon-loading"}):t._e(),n("node-content",{attrs:{node:t.node}})],1),n("el-collapse-transition",[!t.renderAfterExpand||t.childNodeRendered?n("div",{directives:[{name:"show",rawName:"v-show",value:t.expanded,expression:"expanded"}],staticClass:"el-tree-node__children",attrs:{role:"group","aria-expanded":t.expanded}},t._l(t.node.childNodes,function(e){return n("el-tree-node",{key:t.getNodeKey(e),attrs:{"render-content":t.renderContent,"render-after-expand":t.renderAfterExpand,"show-checkbox":t.showCheckbox,node:e},on:{"node-expand":t.handleChildNodeExpand}})}),1):t._e()])],1)},yc=[];bc._withStripped=!0;var _c={name:"ElTreeNode",componentName:"ElTreeNode",mixins:[O.a],props:{node:{default:function(){return{}}},props:{},renderContent:Function,renderAfterExpand:{type:Boolean,default:!0},showCheckbox:{type:Boolean,default:!1}},components:{ElCollapseTransition:Ke.a,ElCheckbox:Fn.a,NodeContent:{props:{node:{required:!0}},render:function(e){var t=this.$parent,i=t.tree,n=this.node,s=n.data,r=n.store;return t.renderContent?t.renderContent.call(t._renderProxy,e,{_self:i.$vnode.context,node:n,data:s,store:r}):i.$scopedSlots.default?i.$scopedSlots.default({node:n,data:s}):e("span",{class:"el-tree-node__label"},[n.label])}}},data:function(){return{tree:null,expanded:!1,childNodeRendered:!1,oldChecked:null,oldIndeterminate:null}},watch:{"node.indeterminate":function(e){this.handleSelectChange(this.node.checked,e)},"node.checked":function(e){this.handleSelectChange(e,this.node.indeterminate)},"node.expanded":function(e){var t=this;this.$nextTick(function(){return t.expanded=e}),e&&(this.childNodeRendered=!0)}},methods:{getNodeKey:function(e){return sc(this.tree.nodeKey,e.data)},handleSelectChange:function(e,t){this.oldChecked!==e&&this.oldIndeterminate!==t&&this.tree.$emit("check-change",this.node.data,e,t),this.oldChecked=e,this.indeterminate=t},handleClick:function(){var e=this.tree.store;e.setCurrentNode(this.node),this.tree.$emit("current-change",e.currentNode?e.currentNode.data:null,e.currentNode),this.tree.currentNode=this,this.tree.expandOnClickNode&&this.handleExpandIconClick(),this.tree.checkOnClickNode&&!this.node.disabled&&this.handleCheckChange(null,{target:{checked:!this.node.checked}}),this.tree.$emit("node-click",this.node.data,this.node,this)},handleContextMenu:function(e){this.tree._events["node-contextmenu"]&&this.tree._events["node-contextmenu"].length>0&&(e.stopPropagation(),e.preventDefault()),this.tree.$emit("node-contextmenu",e,this.node.data,this.node,this)},handleExpandIconClick:function(){this.node.isLeaf||(this.expanded?(this.tree.$emit("node-collapse",this.node.data,this.node,this),this.node.collapse()):(this.node.expand(),this.$emit("node-expand",this.node.data,this.node,this)))},handleCheckChange:function(e,t){var i=this;this.node.setChecked(t.target.checked,!this.tree.checkStrictly),this.$nextTick(function(){var e=i.tree.store;i.tree.$emit("check",i.node.data,{checkedNodes:e.getCheckedNodes(),checkedKeys:e.getCheckedKeys(),halfCheckedNodes:e.getHalfCheckedNodes(),halfCheckedKeys:e.getHalfCheckedKeys()})})},handleChildNodeExpand:function(e,t,i){this.broadcast("ElTreeNode","tree-node-expand",t),this.tree.$emit("node-expand",e,t,i)},handleDragStart:function(e){this.tree.draggable&&this.tree.$emit("tree-node-drag-start",e,this)},handleDragOver:function(e){this.tree.draggable&&(this.tree.$emit("tree-node-drag-over",e,this),e.preventDefault())},handleDrop:function(e){e.preventDefault()},handleDragEnd:function(e){this.tree.draggable&&this.tree.$emit("tree-node-drag-end",e,this)}},created:function(){var e=this,t=this.$parent;t.isTree?this.tree=t:this.tree=t.tree;var i=this.tree;i||console.warn("Can not find node's tree.");var n=i.props||{},s=n["children"]||"children";this.$watch("node.data."+s,function(){e.node.updateChildren()}),this.node.expanded&&(this.expanded=!0,this.childNodeRendered=!0),this.tree.accordion&&this.$on("tree-node-expand",function(t){e.node!==t&&e.node.collapse()})}},xc=_c,Cc=o(xc,bc,yc,!1,null,null,null);Cc.options.__file="packages/tree/src/tree-node.vue";var wc=Cc.exports,kc={name:"ElTree",mixins:[O.a],components:{ElTreeNode:wc},data:function(){return{store:null,root:null,currentNode:null,treeItems:null,checkboxItems:[],dragState:{showDropIndicator:!1,draggingNode:null,dropNode:null,allowDrop:!0}}},props:{data:{type:Array},emptyText:{type:String,default:function(){return Object(Ji["t"])("el.tree.emptyText")}},renderAfterExpand:{type:Boolean,default:!0},nodeKey:String,checkStrictly:Boolean,defaultExpandAll:Boolean,expandOnClickNode:{type:Boolean,default:!0},checkOnClickNode:Boolean,checkDescendants:{type:Boolean,default:!1},autoExpandParent:{type:Boolean,default:!0},defaultCheckedKeys:Array,defaultExpandedKeys:Array,currentNodeKey:[String,Number],renderContent:Function,showCheckbox:{type:Boolean,default:!1},draggable:{type:Boolean,default:!1},allowDrag:Function,allowDrop:Function,props:{default:function(){return{children:"children",label:"label",disabled:"disabled"}}},lazy:{type:Boolean,default:!1},highlightCurrent:Boolean,load:Function,filterNodeMethod:Function,accordion:Boolean,indent:{type:Number,default:18},iconClass:String},computed:{children:{set:function(e){this.data=e},get:function(){return this.data}},treeItemArray:function(){return Array.prototype.slice.call(this.treeItems)},isEmpty:function(){var e=this.root.childNodes;return!e||0===e.length||e.every(function(e){var t=e.visible;return!t})}},watch:{defaultCheckedKeys:function(e){this.store.setDefaultCheckedKey(e)},defaultExpandedKeys:function(e){this.store.defaultExpandedKeys=e,this.store.setDefaultExpandedKeys(e)},data:function(e){this.store.setData(e)},checkboxItems:function(e){Array.prototype.forEach.call(e,function(e){e.setAttribute("tabindex",-1)})},checkStrictly:function(e){this.store.checkStrictly=e}},methods:{filter:function(e){if(!this.filterNodeMethod)throw new Error("[Tree] filterNodeMethod is required when filter");this.store.filter(e)},getNodeKey:function(e){return sc(this.nodeKey,e.data)},getNodePath:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getNodePath");var t=this.store.getNode(e);if(!t)return[];var i=[t.data],n=t.parent;while(n&&n!==this.root)i.push(n.data),n=n.parent;return i.reverse()},getCheckedNodes:function(e,t){return this.store.getCheckedNodes(e,t)},getCheckedKeys:function(e){return this.store.getCheckedKeys(e)},getCurrentNode:function(){var e=this.store.getCurrentNode();return e?e.data:null},getCurrentKey:function(){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in getCurrentKey");var e=this.getCurrentNode();return e?e[this.nodeKey]:null},setCheckedNodes:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedNodes");this.store.setCheckedNodes(e,t)},setCheckedKeys:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCheckedKeys");this.store.setCheckedKeys(e,t)},setChecked:function(e,t,i){this.store.setChecked(e,t,i)},getHalfCheckedNodes:function(){return this.store.getHalfCheckedNodes()},getHalfCheckedKeys:function(){return this.store.getHalfCheckedKeys()},setCurrentNode:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentNode");this.store.setUserCurrentNode(e)},setCurrentKey:function(e){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in setCurrentKey");this.store.setCurrentNodeKey(e)},getNode:function(e){return this.store.getNode(e)},remove:function(e){this.store.remove(e)},append:function(e,t){this.store.append(e,t)},insertBefore:function(e,t){this.store.insertBefore(e,t)},insertAfter:function(e,t){this.store.insertAfter(e,t)},handleNodeExpand:function(e,t,i){this.broadcast("ElTreeNode","tree-node-expand",t),this.$emit("node-expand",e,t,i)},updateKeyChildren:function(e,t){if(!this.nodeKey)throw new Error("[Tree] nodeKey is required in updateKeyChild");this.store.updateChildren(e,t)},initTabIndex:function(){this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]");var e=this.$el.querySelectorAll(".is-checked[role=treeitem]");e.length?e[0].setAttribute("tabindex",0):this.treeItems[0]&&this.treeItems[0].setAttribute("tabindex",0)},handleKeydown:function(e){var t=e.target;if(-1!==t.className.indexOf("el-tree-node")){var i=e.keyCode;this.treeItems=this.$el.querySelectorAll(".is-focusable[role=treeitem]");var n=this.treeItemArray.indexOf(t),s=void 0;[38,40].indexOf(i)>-1&&(e.preventDefault(),s=38===i?0!==n?n-1:0:n-1&&(e.preventDefault(),t.click());var r=t.querySelector('[type="checkbox"]');[13,32].indexOf(i)>-1&&r&&(e.preventDefault(),r.click())}}},created:function(){var e=this;this.isTree=!0,this.store=new gc({key:this.nodeKey,data:this.data,lazy:this.lazy,props:this.props,load:this.load,currentNodeKey:this.currentNodeKey,checkStrictly:this.checkStrictly,checkDescendants:this.checkDescendants,defaultCheckedKeys:this.defaultCheckedKeys,defaultExpandedKeys:this.defaultExpandedKeys,autoExpandParent:this.autoExpandParent,defaultExpandAll:this.defaultExpandAll,filterNodeMethod:this.filterNodeMethod}),this.root=this.store.root;var t=this.dragState;this.$on("tree-node-drag-start",function(i,n){if("function"===typeof e.allowDrag&&!e.allowDrag(n.node))return i.preventDefault(),!1;i.dataTransfer.effectAllowed="move";try{i.dataTransfer.setData("text/plain","")}catch(s){}t.draggingNode=n,e.$emit("node-drag-start",n.node,i)}),this.$on("tree-node-drag-over",function(i,n){var s=rc(i.target,"ElTreeNode"),r=t.dropNode;r&&r!==s&&Object(Ve["removeClass"])(r.$el,"is-drop-inner");var a=t.draggingNode;if(a&&s){var o=!0,l=!0,c=!0,u=!0;"function"===typeof e.allowDrop&&(o=e.allowDrop(a.node,s.node,"prev"),u=l=e.allowDrop(a.node,s.node,"inner"),c=e.allowDrop(a.node,s.node,"next")),i.dataTransfer.dropEffect=l?"move":"none",(o||l||c)&&r!==s&&(r&&e.$emit("node-drag-leave",a.node,r.node,i),e.$emit("node-drag-enter",a.node,s.node,i)),(o||l||c)&&(t.dropNode=s),s.node.nextSibling===a.node&&(c=!1),s.node.previousSibling===a.node&&(o=!1),s.node.contains(a.node,!1)&&(l=!1),(a.node===s.node||a.node.contains(s.node))&&(o=!1,l=!1,c=!1);var h=s.$el.getBoundingClientRect(),d=e.$el.getBoundingClientRect(),p=void 0,f=o?l?.25:c?.45:1:-1,m=c?l?.75:o?.55:0:1,v=-9999,g=i.clientY-h.top;p=gh.height*m?"after":l?"inner":"none";var b=s.$el.querySelector(".el-tree-node__expand-icon").getBoundingClientRect(),y=e.$refs.dropIndicator;"before"===p?v=b.top-d.top:"after"===p&&(v=b.bottom-d.top),y.style.top=v+"px",y.style.left=b.right-d.left+"px","inner"===p?Object(Ve["addClass"])(s.$el,"is-drop-inner"):Object(Ve["removeClass"])(s.$el,"is-drop-inner"),t.showDropIndicator="before"===p||"after"===p,t.allowDrop=t.showDropIndicator||u,t.dropType=p,e.$emit("node-drag-over",a.node,s.node,i)}}),this.$on("tree-node-drag-end",function(i){var n=t.draggingNode,s=t.dropType,r=t.dropNode;if(i.preventDefault(),i.dataTransfer.dropEffect="move",n&&r){var a={data:n.node.data};"none"!==s&&n.node.remove(),"before"===s?r.node.parent.insertBefore(a,r.node):"after"===s?r.node.parent.insertAfter(a,r.node):"inner"===s&&r.node.insertChild(a),"none"!==s&&e.store.registerNode(a),Object(Ve["removeClass"])(r.$el,"is-drop-inner"),e.$emit("node-drag-end",n.node,r.node,s,i),"none"!==s&&e.$emit("node-drop",n.node,r.node,s,i)}n&&!r&&e.$emit("node-drag-end",n.node,null,s,i),t.showDropIndicator=!1,t.draggingNode=null,t.dropNode=null,t.allowDrop=!0})},mounted:function(){this.initTabIndex(),this.$el.addEventListener("keydown",this.handleKeydown)},updated:function(){this.treeItems=this.$el.querySelectorAll("[role=treeitem]"),this.checkboxItems=this.$el.querySelectorAll("input[type=checkbox]")}},Sc=kc,Dc=o(Sc,ec,tc,!1,null,null,null);Dc.options.__file="packages/tree/src/tree.vue";var $c=Dc.exports;$c.install=function(e){e.component($c.name,$c)};var Oc=$c,Ec=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-alert-fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-alert",class:[e.typeClass,e.center?"is-center":"","is-"+e.effect],attrs:{role:"alert"}},[e.showIcon?i("i",{staticClass:"el-alert__icon",class:[e.iconClass,e.isBigIcon]}):e._e(),i("div",{staticClass:"el-alert__content"},[e.title||e.$slots.title?i("span",{staticClass:"el-alert__title",class:[e.isBoldTitle]},[e._t("title",[e._v(e._s(e.title))])],2):e._e(),e.$slots.default&&!e.description?i("p",{staticClass:"el-alert__description"},[e._t("default")],2):e._e(),e.description&&!e.$slots.default?i("p",{staticClass:"el-alert__description"},[e._v(e._s(e.description))]):e._e(),i("i",{directives:[{name:"show",rawName:"v-show",value:e.closable,expression:"closable"}],staticClass:"el-alert__closebtn",class:{"is-customed":""!==e.closeText,"el-icon-close":""===e.closeText},on:{click:function(t){e.close()}}},[e._v(e._s(e.closeText))])])])])},Tc=[];Ec._withStripped=!0;var Pc={success:"el-icon-success",warning:"el-icon-warning",error:"el-icon-error"},Mc={name:"ElAlert",props:{title:{type:String,default:""},description:{type:String,default:""},type:{type:String,default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,default:"light",validator:function(e){return-1!==["light","dark"].indexOf(e)}}},data:function(){return{visible:!0}},methods:{close:function(){this.visible=!1,this.$emit("close")}},computed:{typeClass:function(){return"el-alert--"+this.type},iconClass:function(){return Pc[this.type]||"el-icon-info"},isBigIcon:function(){return this.description||this.$slots.default?"is-big":""},isBoldTitle:function(){return this.description||this.$slots.default?"is-bold":""}}},Ic=Mc,Nc=o(Ic,Ec,Tc,!1,null,null,null);Nc.options.__file="packages/alert/src/main.vue";var jc=Nc.exports;jc.install=function(e){e.component(jc.name,jc)};var Fc=jc,Lc=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-notification-fade"}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],class:["el-notification",e.customClass,e.horizontalClass],style:e.positionStyle,attrs:{role:"alert"},on:{mouseenter:function(t){e.clearTimer()},mouseleave:function(t){e.startTimer()},click:e.click}},[e.type||e.iconClass?i("i",{staticClass:"el-notification__icon",class:[e.typeClass,e.iconClass]}):e._e(),i("div",{staticClass:"el-notification__group",class:{"is-with-icon":e.typeClass||e.iconClass}},[i("h2",{staticClass:"el-notification__title",domProps:{textContent:e._s(e.title)}}),i("div",{directives:[{name:"show",rawName:"v-show",value:e.message,expression:"message"}],staticClass:"el-notification__content"},[e._t("default",[e.dangerouslyUseHTMLString?i("p",{domProps:{innerHTML:e._s(e.message)}}):i("p",[e._v(e._s(e.message))])])],2),e.showClose?i("div",{staticClass:"el-notification__closeBtn el-icon-close",on:{click:function(t){return t.stopPropagation(),e.close(t)}}}):e._e()])])])},Vc=[];Lc._withStripped=!0;var Ac={success:"success",info:"info",warning:"warning",error:"error"},zc={data:function(){return{visible:!1,title:"",message:"",duration:4500,type:"",showClose:!0,customClass:"",iconClass:"",onClose:null,onClick:null,closed:!1,verticalOffset:0,timer:null,dangerouslyUseHTMLString:!1,position:"top-right"}},computed:{typeClass:function(){return this.type&&Ac[this.type]?"el-icon-"+Ac[this.type]:""},horizontalClass:function(){return this.position.indexOf("right")>-1?"right":"left"},verticalProperty:function(){return/^top-/.test(this.position)?"top":"bottom"},positionStyle:function(){var e;return e={},e[this.verticalProperty]=this.verticalOffset+"px",e}},watch:{closed:function(e){e&&(this.visible=!1,this.$el.addEventListener("transitionend",this.destroyElement))}},methods:{destroyElement:function(){this.$el.removeEventListener("transitionend",this.destroyElement),this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},click:function(){"function"===typeof this.onClick&&this.onClick()},close:function(){this.closed=!0,"function"===typeof this.onClose&&this.onClose()},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var e=this;this.duration>0&&(this.timer=setTimeout(function(){e.closed||e.close()},this.duration))},keydown:function(e){46===e.keyCode||8===e.keyCode?this.clearTimer():27===e.keyCode?this.closed||this.close():this.startTimer()}},mounted:function(){var e=this;this.duration>0&&(this.timer=setTimeout(function(){e.closed||e.close()},this.duration)),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}},Bc=zc,Rc=o(Bc,Lc,Vc,!1,null,null,null);Rc.options.__file="packages/notification/src/main.vue";var Hc=Rc.exports,Wc=Wn.a.extend(Hc),qc=void 0,Yc=[],Kc=1,Uc=function e(t){if(!Wn.a.prototype.$isServer){t=t||{};var i=t.onClose,n="notification_"+Kc++,s=t.position||"top-right";t.onClose=function(){e.close(n,i)},qc=new Wc({data:t}),Object(ko["isVNode"])(t.message)&&(qc.$slots.default=[t.message],t.message="REPLACED_BY_VNODE"),qc.id=n,qc.$mount(),document.body.appendChild(qc.$el),qc.visible=!0,qc.dom=qc.$el,qc.dom.style.zIndex=w["PopupManager"].nextZIndex();var r=t.offset||0;return Yc.filter(function(e){return e.position===s}).forEach(function(e){r+=e.$el.offsetHeight+16}),r+=16,qc.verticalOffset=r,Yc.push(qc),qc}};["success","warning","info","error"].forEach(function(e){Uc[e]=function(t){return("string"===typeof t||Object(ko["isVNode"])(t))&&(t={message:t}),t.type=e,Uc(t)}}),Uc.close=function(e,t){var i=-1,n=Yc.length,s=Yc.filter(function(t,n){return t.id===e&&(i=n,!0)})[0];if(s&&("function"===typeof t&&t(s),Yc.splice(i,1),!(n<=1)))for(var r=s.position,a=s.dom.offsetHeight,o=i;o=0;e--)Yc[e].close()};var Gc=Uc,Xc=Gc,Qc=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-slider",class:{"is-vertical":e.vertical,"el-slider--with-input":e.showInput},attrs:{role:"slider","aria-valuemin":e.min,"aria-valuemax":e.max,"aria-orientation":e.vertical?"vertical":"horizontal","aria-disabled":e.sliderDisabled}},[e.showInput&&!e.range?i("el-input-number",{ref:"input",staticClass:"el-slider__input",attrs:{step:e.step,disabled:e.sliderDisabled,controls:e.showInputControls,min:e.min,max:e.max,debounce:e.debounce,size:e.inputSize},on:{change:function(t){e.$nextTick(e.emitChange)}},model:{value:e.firstValue,callback:function(t){e.firstValue=t},expression:"firstValue"}}):e._e(),i("div",{ref:"slider",staticClass:"el-slider__runway",class:{"show-input":e.showInput,disabled:e.sliderDisabled},style:e.runwayStyle,on:{click:e.onSliderClick}},[i("div",{staticClass:"el-slider__bar",style:e.barStyle}),i("slider-button",{ref:"button1",attrs:{vertical:e.vertical,"tooltip-class":e.tooltipClass},model:{value:e.firstValue,callback:function(t){e.firstValue=t},expression:"firstValue"}}),e.range?i("slider-button",{ref:"button2",attrs:{vertical:e.vertical,"tooltip-class":e.tooltipClass},model:{value:e.secondValue,callback:function(t){e.secondValue=t},expression:"secondValue"}}):e._e(),e._l(e.stops,function(t,n){return e.showStops?i("div",{key:n,staticClass:"el-slider__stop",style:e.getStopStyle(t)}):e._e()}),e.markList.length>0?[i("div",e._l(e.markList,function(t,n){return i("div",{key:n,staticClass:"el-slider__stop el-slider__marks-stop",style:e.getStopStyle(t.position)})}),0),i("div",{staticClass:"el-slider__marks"},e._l(e.markList,function(t,n){return i("slider-marker",{key:n,style:e.getStopStyle(t.position),attrs:{mark:t.mark}})}),1)]:e._e()],2)],1)},Zc=[];Qc._withStripped=!0;var Jc=i(41),eu=i.n(Jc),tu=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{ref:"button",staticClass:"el-slider__button-wrapper",class:{hover:e.hovering,dragging:e.dragging},style:e.wrapperStyle,attrs:{tabindex:"0"},on:{mouseenter:e.handleMouseEnter,mouseleave:e.handleMouseLeave,mousedown:e.onButtonDown,touchstart:e.onButtonDown,focus:e.handleMouseEnter,blur:e.handleMouseLeave,keydown:[function(t){return"button"in t||!e._k(t.keyCode,"left",37,t.key,["Left","ArrowLeft"])?"button"in t&&0!==t.button?null:e.onLeftKeyDown(t):null},function(t){return"button"in t||!e._k(t.keyCode,"right",39,t.key,["Right","ArrowRight"])?"button"in t&&2!==t.button?null:e.onRightKeyDown(t):null},function(t){return"button"in t||!e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?(t.preventDefault(),e.onLeftKeyDown(t)):null},function(t){return"button"in t||!e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?(t.preventDefault(),e.onRightKeyDown(t)):null}]}},[i("el-tooltip",{ref:"tooltip",attrs:{placement:"top","popper-class":e.tooltipClass,disabled:!e.showTooltip}},[i("span",{attrs:{slot:"content"},slot:"content"},[e._v(e._s(e.formatValue))]),i("div",{staticClass:"el-slider__button",class:{hover:e.hovering,dragging:e.dragging}})])],1)},iu=[];tu._withStripped=!0;var nu={name:"ElSliderButton",components:{ElTooltip:st.a},props:{value:{type:Number,default:0},vertical:{type:Boolean,default:!1},tooltipClass:String},data:function(){return{hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:null,oldValue:this.value}},computed:{disabled:function(){return this.$parent.sliderDisabled},max:function(){return this.$parent.max},min:function(){return this.$parent.min},step:function(){return this.$parent.step},showTooltip:function(){return this.$parent.showTooltip},precision:function(){return this.$parent.precision},currentPosition:function(){return(this.value-this.min)/(this.max-this.min)*100+"%"},enableFormat:function(){return this.$parent.formatTooltip instanceof Function},formatValue:function(){return this.enableFormat&&this.$parent.formatTooltip(this.value)||this.value},wrapperStyle:function(){return this.vertical?{bottom:this.currentPosition}:{left:this.currentPosition}}},watch:{dragging:function(e){this.$parent.dragging=e}},methods:{displayTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!0)},hideTooltip:function(){this.$refs.tooltip&&(this.$refs.tooltip.showPopper=!1)},handleMouseEnter:function(){this.hovering=!0,this.displayTooltip()},handleMouseLeave:function(){this.hovering=!1,this.hideTooltip()},onButtonDown:function(e){this.disabled||(e.preventDefault(),this.onDragStart(e),window.addEventListener("mousemove",this.onDragging),window.addEventListener("touchmove",this.onDragging),window.addEventListener("mouseup",this.onDragEnd),window.addEventListener("touchend",this.onDragEnd),window.addEventListener("contextmenu",this.onDragEnd))},onLeftKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)-this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onRightKeyDown:function(){this.disabled||(this.newPosition=parseFloat(this.currentPosition)+this.step/(this.max-this.min)*100,this.setPosition(this.newPosition),this.$parent.emitChange())},onDragStart:function(e){this.dragging=!0,this.isClick=!0,"touchstart"===e.type&&(e.clientY=e.touches[0].clientY,e.clientX=e.touches[0].clientX),this.vertical?this.startY=e.clientY:this.startX=e.clientX,this.startPosition=parseFloat(this.currentPosition),this.newPosition=this.startPosition},onDragging:function(e){if(this.dragging){this.isClick=!1,this.displayTooltip(),this.$parent.resetSize();var t=0;"touchmove"===e.type&&(e.clientY=e.touches[0].clientY,e.clientX=e.touches[0].clientX),this.vertical?(this.currentY=e.clientY,t=(this.startY-this.currentY)/this.$parent.sliderSize*100):(this.currentX=e.clientX,t=(this.currentX-this.startX)/this.$parent.sliderSize*100),this.newPosition=this.startPosition+t,this.setPosition(this.newPosition)}},onDragEnd:function(){var e=this;this.dragging&&(setTimeout(function(){e.dragging=!1,e.hideTooltip(),e.isClick||(e.setPosition(e.newPosition),e.$parent.emitChange())},0),window.removeEventListener("mousemove",this.onDragging),window.removeEventListener("touchmove",this.onDragging),window.removeEventListener("mouseup",this.onDragEnd),window.removeEventListener("touchend",this.onDragEnd),window.removeEventListener("contextmenu",this.onDragEnd))},setPosition:function(e){var t=this;if(null!==e&&!isNaN(e)){e<0?e=0:e>100&&(e=100);var i=100/((this.max-this.min)/this.step),n=Math.round(e/i),s=n*i*(this.max-this.min)*.01+this.min;s=parseFloat(s.toFixed(this.precision)),this.$emit("input",s),this.$nextTick(function(){t.displayTooltip(),t.$refs.tooltip&&t.$refs.tooltip.updatePopper()}),this.dragging||this.value===this.oldValue||(this.oldValue=this.value)}}}},su=nu,ru=o(su,tu,iu,!1,null,null,null);ru.options.__file="packages/slider/src/button.vue";var au=ru.exports,ou={name:"ElMarker",props:{mark:{type:[String,Object]}},render:function(){var e=arguments[0],t="string"===typeof this.mark?this.mark:this.mark.label;return e("div",{class:"el-slider__marks-text",style:this.mark.style||{}},[t])}},lu={name:"ElSlider",mixins:[O.a],inject:{elForm:{default:""}},props:{min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},value:{type:[Number,Array],default:0},showInput:{type:Boolean,default:!1},showInputControls:{type:Boolean,default:!0},inputSize:{type:String,default:"small"},showStops:{type:Boolean,default:!1},showTooltip:{type:Boolean,default:!0},formatTooltip:Function,disabled:{type:Boolean,default:!1},range:{type:Boolean,default:!1},vertical:{type:Boolean,default:!1},height:{type:String},debounce:{type:Number,default:300},label:{type:String},tooltipClass:String,marks:Object},components:{ElInputNumber:eu.a,SliderButton:au,SliderMarker:ou},data:function(){return{firstValue:null,secondValue:null,oldValue:null,dragging:!1,sliderSize:1}},watch:{value:function(e,t){this.dragging||Array.isArray(e)&&Array.isArray(t)&&e.every(function(e,i){return e===t[i]})||this.setValues()},dragging:function(e){e||this.setValues()},firstValue:function(e){this.range?this.$emit("input",[this.minValue,this.maxValue]):this.$emit("input",e)},secondValue:function(){this.range&&this.$emit("input",[this.minValue,this.maxValue])},min:function(){this.setValues()},max:function(){this.setValues()}},methods:{valueChanged:function(){var e=this;return this.range?![this.minValue,this.maxValue].every(function(t,i){return t===e.oldValue[i]}):this.value!==this.oldValue},setValues:function(){if(this.min>this.max)console.error("[Element Error][Slider]min should not be greater than max.");else{var e=this.value;this.range&&Array.isArray(e)?e[1]this.max?this.$emit("input",[this.max,this.max]):e[0]this.max?this.$emit("input",[e[0],this.max]):(this.firstValue=e[0],this.secondValue=e[1],this.valueChanged()&&(this.dispatch("ElFormItem","el.form.change",[this.minValue,this.maxValue]),this.oldValue=e.slice())):this.range||"number"!==typeof e||isNaN(e)||(ethis.max?this.$emit("input",this.max):(this.firstValue=e,this.valueChanged()&&(this.dispatch("ElFormItem","el.form.change",e),this.oldValue=e)))}},setPosition:function(e){var t=this.min+e*(this.max-this.min)/100;if(this.range){var i=void 0;i=Math.abs(this.minValue-t)this.secondValue?"button1":"button2",this.$refs[i].setPosition(e)}else this.$refs.button1.setPosition(e)},onSliderClick:function(e){if(!this.sliderDisabled&&!this.dragging){if(this.resetSize(),this.vertical){var t=this.$refs.slider.getBoundingClientRect().bottom;this.setPosition((t-e.clientY)/this.sliderSize*100)}else{var i=this.$refs.slider.getBoundingClientRect().left;this.setPosition((e.clientX-i)/this.sliderSize*100)}this.emitChange()}},resetSize:function(){this.$refs.slider&&(this.sliderSize=this.$refs.slider["client"+(this.vertical?"Height":"Width")])},emitChange:function(){var e=this;this.$nextTick(function(){e.$emit("change",e.range?[e.minValue,e.maxValue]:e.value)})},getStopStyle:function(e){return this.vertical?{bottom:e+"%"}:{left:e+"%"}}},computed:{stops:function(){var e=this;if(!this.showStops||this.min>this.max)return[];if(0===this.step)return[];for(var t=(this.max-this.min)/this.step,i=100*this.step/(this.max-this.min),n=[],s=1;s100*(e.maxValue-e.min)/(e.max-e.min)}):n.filter(function(t){return t>100*(e.firstValue-e.min)/(e.max-e.min)})},markList:function(){var e=this;if(!this.marks)return[];var t=Object.keys(this.marks);return t.map(parseFloat).sort(function(e,t){return e-t}).filter(function(t){return t<=e.max&&t>=e.min}).map(function(t){return{point:t,position:100*(t-e.min)/(e.max-e.min),mark:e.marks[t]}})},minValue:function(){return Math.min(this.firstValue,this.secondValue)},maxValue:function(){return Math.max(this.firstValue,this.secondValue)},barSize:function(){return this.range?100*(this.maxValue-this.minValue)/(this.max-this.min)+"%":100*(this.firstValue-this.min)/(this.max-this.min)+"%"},barStart:function(){return this.range?100*(this.minValue-this.min)/(this.max-this.min)+"%":"0%"},precision:function(){var e=[this.min,this.max,this.step].map(function(e){var t=(""+e).split(".")[1];return t?t.length:0});return Math.max.apply(null,e)},runwayStyle:function(){return this.vertical?{height:this.height}:{}},barStyle:function(){return this.vertical?{height:this.barSize,bottom:this.barStart}:{width:this.barSize,left:this.barStart}},sliderDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},mounted:function(){var e=void 0;this.range?(Array.isArray(this.value)?(this.firstValue=Math.max(this.min,this.value[0]),this.secondValue=Math.min(this.max,this.value[1])):(this.firstValue=this.min,this.secondValue=this.max),this.oldValue=[this.firstValue,this.secondValue],e=this.firstValue+"-"+this.secondValue):("number"!==typeof this.value||isNaN(this.value)?this.firstValue=this.min:this.firstValue=Math.min(this.max,Math.max(this.min,this.value)),this.oldValue=this.firstValue,e=this.firstValue),this.$el.setAttribute("aria-valuetext",e),this.$el.setAttribute("aria-label",this.label?this.label:"slider between "+this.min+" and "+this.max),this.resetSize(),window.addEventListener("resize",this.resetSize)},beforeDestroy:function(){window.removeEventListener("resize",this.resetSize)}},cu=lu,uu=o(cu,Qc,Zc,!1,null,null,null);uu.options.__file="packages/slider/src/main.vue";var hu=uu.exports;hu.install=function(e){e.component(hu.name,hu)};var du=hu,pu=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-loading-fade"},on:{"after-leave":e.handleAfterLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-loading-mask",class:[e.customClass,{"is-fullscreen":e.fullscreen}],style:{backgroundColor:e.background||""}},[i("div",{staticClass:"el-loading-spinner"},[e.spinner?i("i",{class:e.spinner}):i("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[i("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})]),e.text?i("p",{staticClass:"el-loading-text"},[e._v(e._s(e.text))]):e._e()])])])},fu=[];pu._withStripped=!0;var mu={data:function(){return{text:null,spinner:null,background:null,fullscreen:!0,visible:!1,customClass:""}},methods:{handleAfterLeave:function(){this.$emit("after-leave")},setText:function(e){this.text=e}}},vu=mu,gu=o(vu,pu,fu,!1,null,null,null);gu.options.__file="packages/loading/src/loading.vue";var bu=gu.exports,yu=i(31),_u=i.n(yu),xu=Wn.a.extend(bu),Cu={install:function(e){if(!e.prototype.$isServer){var t=function(t,n){n.value?e.nextTick(function(){n.modifiers.fullscreen?(t.originalPosition=Object(Ve["getStyle"])(document.body,"position"),t.originalOverflow=Object(Ve["getStyle"])(document.body,"overflow"),t.maskStyle.zIndex=w["PopupManager"].nextZIndex(),Object(Ve["addClass"])(t.mask,"is-fullscreen"),i(document.body,t,n)):(Object(Ve["removeClass"])(t.mask,"is-fullscreen"),n.modifiers.body?(t.originalPosition=Object(Ve["getStyle"])(document.body,"position"),["top","left"].forEach(function(e){var i="top"===e?"scrollTop":"scrollLeft";t.maskStyle[e]=t.getBoundingClientRect()[e]+document.body[i]+document.documentElement[i]-parseInt(Object(Ve["getStyle"])(document.body,"margin-"+e),10)+"px"}),["height","width"].forEach(function(e){t.maskStyle[e]=t.getBoundingClientRect()[e]+"px"}),i(document.body,t,n)):(t.originalPosition=Object(Ve["getStyle"])(t,"position"),i(t,t,n)))}):(_u()(t.instance,function(e){if(t.instance.hiding){t.domVisible=!1;var i=n.modifiers.fullscreen||n.modifiers.body?document.body:t;Object(Ve["removeClass"])(i,"el-loading-parent--relative"),Object(Ve["removeClass"])(i,"el-loading-parent--hidden"),t.instance.hiding=!1}},300,!0),t.instance.visible=!1,t.instance.hiding=!0)},i=function(t,i,n){i.domVisible||"none"===Object(Ve["getStyle"])(i,"display")||"hidden"===Object(Ve["getStyle"])(i,"visibility")?i.domVisible&&!0===i.instance.hiding&&(i.instance.visible=!0,i.instance.hiding=!1):(Object.keys(i.maskStyle).forEach(function(e){i.mask.style[e]=i.maskStyle[e]}),"absolute"!==i.originalPosition&&"fixed"!==i.originalPosition&&Object(Ve["addClass"])(t,"el-loading-parent--relative"),n.modifiers.fullscreen&&n.modifiers.lock&&Object(Ve["addClass"])(t,"el-loading-parent--hidden"),i.domVisible=!0,t.appendChild(i.mask),e.nextTick(function(){i.instance.hiding?i.instance.$emit("after-leave"):i.instance.visible=!0}),i.domInserted=!0)};e.directive("loading",{bind:function(e,i,n){var s=e.getAttribute("element-loading-text"),r=e.getAttribute("element-loading-spinner"),a=e.getAttribute("element-loading-background"),o=e.getAttribute("element-loading-custom-class"),l=n.context,c=new xu({el:document.createElement("div"),data:{text:l&&l[s]||s,spinner:l&&l[r]||r,background:l&&l[a]||a,customClass:l&&l[o]||o,fullscreen:!!i.modifiers.fullscreen}});e.instance=c,e.mask=c.$el,e.maskStyle={},i.value&&t(e,i)},update:function(e,i){e.instance.setText(e.getAttribute("element-loading-text")),i.oldValue!==i.value&&t(e,i)},unbind:function(e,i){e.domInserted&&(e.mask&&e.mask.parentNode&&e.mask.parentNode.removeChild(e.mask),t(e,{value:!1,modifiers:i.modifiers})),e.instance&&e.instance.$destroy()}})}}},wu=Cu,ku=Wn.a.extend(bu),Su={text:null,fullscreen:!0,body:!1,lock:!1,customClass:""},Du=void 0;ku.prototype.originalPosition="",ku.prototype.originalOverflow="",ku.prototype.close=function(){var e=this;this.fullscreen&&(Du=void 0),_u()(this,function(t){var i=e.fullscreen||e.body?document.body:e.target;Object(Ve["removeClass"])(i,"el-loading-parent--relative"),Object(Ve["removeClass"])(i,"el-loading-parent--hidden"),e.$el&&e.$el.parentNode&&e.$el.parentNode.removeChild(e.$el),e.$destroy()},300),this.visible=!1};var $u=function(e,t,i){var n={};e.fullscreen?(i.originalPosition=Object(Ve["getStyle"])(document.body,"position"),i.originalOverflow=Object(Ve["getStyle"])(document.body,"overflow"),n.zIndex=w["PopupManager"].nextZIndex()):e.body?(i.originalPosition=Object(Ve["getStyle"])(document.body,"position"),["top","left"].forEach(function(t){var i="top"===t?"scrollTop":"scrollLeft";n[t]=e.target.getBoundingClientRect()[t]+document.body[i]+document.documentElement[i]+"px"}),["height","width"].forEach(function(t){n[t]=e.target.getBoundingClientRect()[t]+"px"})):i.originalPosition=Object(Ve["getStyle"])(t,"position"),Object.keys(n).forEach(function(e){i.$el.style[e]=n[e]})},Ou=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!Wn.a.prototype.$isServer){if(e=St()({},Su,e),"string"===typeof e.target&&(e.target=document.querySelector(e.target)),e.target=e.target||document.body,e.target!==document.body?e.fullscreen=!1:e.body=!0,e.fullscreen&&Du)return Du;var t=e.body?document.body:e.target,i=new ku({el:document.createElement("div"),data:e});return $u(e,t,i),"absolute"!==i.originalPosition&&"fixed"!==i.originalPosition&&Object(Ve["addClass"])(t,"el-loading-parent--relative"),e.fullscreen&&e.lock&&Object(Ve["addClass"])(t,"el-loading-parent--hidden"),t.appendChild(i.$el),Wn.a.nextTick(function(){i.visible=!0}),e.fullscreen&&(Du=i),i}},Eu=Ou,Tu={install:function(e){e.use(wu),e.prototype.$loading=Eu},directive:wu,service:Eu},Pu=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("i",{class:"el-icon-"+e.name})},Mu=[];Pu._withStripped=!0;var Iu={name:"ElIcon",props:{name:String}},Nu=Iu,ju=o(Nu,Pu,Mu,!1,null,null,null);ju.options.__file="packages/icon/src/icon.vue";var Fu=ju.exports;Fu.install=function(e){e.component(Fu.name,Fu)};var Lu=Fu,Vu={name:"ElRow",componentName:"ElRow",props:{tag:{type:String,default:"div"},gutter:Number,type:String,justify:{type:String,default:"start"},align:{type:String,default:"top"}},computed:{style:function(){var e={};return this.gutter&&(e.marginLeft="-"+this.gutter/2+"px",e.marginRight=e.marginLeft),e}},render:function(e){return e(this.tag,{class:["el-row","start"!==this.justify?"is-justify-"+this.justify:"","top"!==this.align?"is-align-"+this.align:"",{"el-row--flex":"flex"===this.type}],style:this.style},this.$slots.default)},install:function(e){e.component(Vu.name,Vu)}},Au=Vu,zu="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Bu={name:"ElCol",props:{span:{type:Number,default:24},tag:{type:String,default:"div"},offset:Number,pull:Number,push:Number,xs:[Number,Object],sm:[Number,Object],md:[Number,Object],lg:[Number,Object],xl:[Number,Object]},computed:{gutter:function(){var e=this.$parent;while(e&&"ElRow"!==e.$options.componentName)e=e.$parent;return e?e.gutter:0}},render:function(e){var t=this,i=[],n={};return this.gutter&&(n.paddingLeft=this.gutter/2+"px",n.paddingRight=n.paddingLeft),["span","offset","pull","push"].forEach(function(e){(t[e]||0===t[e])&&i.push("span"!==e?"el-col-"+e+"-"+t[e]:"el-col-"+t[e])}),["xs","sm","md","lg","xl"].forEach(function(e){if("number"===typeof t[e])i.push("el-col-"+e+"-"+t[e]);else if("object"===zu(t[e])){var n=t[e];Object.keys(n).forEach(function(t){i.push("span"!==t?"el-col-"+e+"-"+t+"-"+n[t]:"el-col-"+e+"-"+n[t])})}}),e(this.tag,{class:["el-col",i],style:n},this.$slots.default)},install:function(e){e.component(Bu.name,Bu)}},Ru=Bu,Hu=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition-group",{class:["el-upload-list","el-upload-list--"+e.listType,{"is-disabled":e.disabled}],attrs:{tag:"ul",name:"el-list"}},e._l(e.files,function(t){return i("li",{key:t.uid,class:["el-upload-list__item","is-"+t.status,e.focusing?"focusing":""],attrs:{tabindex:"0"},on:{keydown:function(i){if(!("button"in i)&&e._k(i.keyCode,"delete",[8,46],i.key,["Backspace","Delete","Del"]))return null;!e.disabled&&e.$emit("remove",t)},focus:function(t){e.focusing=!0},blur:function(t){e.focusing=!1},click:function(t){e.focusing=!1}}},["uploading"!==t.status&&["picture-card","picture"].indexOf(e.listType)>-1?i("img",{staticClass:"el-upload-list__item-thumbnail",attrs:{src:t.url,alt:""}}):e._e(),i("a",{staticClass:"el-upload-list__item-name",on:{click:function(i){e.handleClick(t)}}},[i("i",{staticClass:"el-icon-document"}),e._v(e._s(t.name)+"\n ")]),i("label",{staticClass:"el-upload-list__item-status-label"},[i("i",{class:{"el-icon-upload-success":!0,"el-icon-circle-check":"text"===e.listType,"el-icon-check":["picture-card","picture"].indexOf(e.listType)>-1}})]),e.disabled?e._e():i("i",{staticClass:"el-icon-close",on:{click:function(i){e.$emit("remove",t)}}}),e.disabled?e._e():i("i",{staticClass:"el-icon-close-tip"},[e._v(e._s(e.t("el.upload.deleteTip")))]),"uploading"===t.status?i("el-progress",{attrs:{type:"picture-card"===e.listType?"circle":"line","stroke-width":"picture-card"===e.listType?6:2,percentage:e.parsePercentage(t.percentage)}}):e._e(),"picture-card"===e.listType?i("span",{staticClass:"el-upload-list__item-actions"},[e.handlePreview&&"picture-card"===e.listType?i("span",{staticClass:"el-upload-list__item-preview",on:{click:function(i){e.handlePreview(t)}}},[i("i",{staticClass:"el-icon-zoom-in"})]):e._e(),e.disabled?e._e():i("span",{staticClass:"el-upload-list__item-delete",on:{click:function(i){e.$emit("remove",t)}}},[i("i",{staticClass:"el-icon-delete"})])]):e._e()],1)}),0)},Wu=[];Hu._withStripped=!0;var qu=i(32),Yu=i.n(qu),Ku={name:"ElUploadList",mixins:[g.a],data:function(){return{focusing:!1}},components:{ElProgress:Yu.a},props:{files:{type:Array,default:function(){return[]}},disabled:{type:Boolean,default:!1},handlePreview:Function,listType:String},methods:{parsePercentage:function(e){return parseInt(e,10)},handleClick:function(e){this.handlePreview&&this.handlePreview(e)}}},Uu=Ku,Gu=o(Uu,Hu,Wu,!1,null,null,null);Gu.options.__file="packages/upload/src/upload-list.vue";var Xu=Gu.exports,Qu=i(24),Zu=i.n(Qu);function Ju(e,t,i){var n=void 0;n=i.response?""+(i.response.error||i.response):i.responseText?""+i.responseText:"fail to post "+e+" "+i.status;var s=new Error(n);return s.status=i.status,s.method="post",s.url=e,s}function eh(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(i){return t}}function th(e){if("undefined"!==typeof XMLHttpRequest){var t=new XMLHttpRequest,i=e.action;t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach(function(t){n.append(t,e.data[t])}),n.append(e.filename,e.file,e.file.name),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300)return e.onError(Ju(i,e,t));e.onSuccess(eh(t))},t.open("post",i,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var s=e.headers||{};for(var r in s)s.hasOwnProperty(r)&&null!==s[r]&&t.setRequestHeader(r,s[r]);return t.send(n),t}}var ih=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-upload-dragger",class:{"is-dragover":e.dragover},on:{drop:function(t){return t.preventDefault(),e.onDrop(t)},dragover:function(t){return t.preventDefault(),e.onDragover(t)},dragleave:function(t){t.preventDefault(),e.dragover=!1}}},[e._t("default")],2)},nh=[];ih._withStripped=!0;var sh={name:"ElUploadDrag",props:{disabled:Boolean},inject:{uploader:{default:""}},data:function(){return{dragover:!1}},methods:{onDragover:function(){this.disabled||(this.dragover=!0)},onDrop:function(e){if(!this.disabled&&this.uploader){var t=this.uploader.accept;this.dragover=!1,t?this.$emit("file",[].slice.call(e.dataTransfer.files).filter(function(e){var i=e.type,n=e.name,s=n.indexOf(".")>-1?"."+n.split(".").pop():"",r=i.replace(/\/.*$/,"");return t.split(",").map(function(e){return e.trim()}).filter(function(e){return e}).some(function(e){return/\..+$/.test(e)?s===e:/\/\*$/.test(e)?r===e.replace(/\/\*$/,""):!!/^[^\/]+\/[^\/]+$/.test(e)&&i===e})})):this.$emit("file",e.dataTransfer.files)}}}},rh=sh,ah=o(rh,ih,nh,!1,null,null,null);ah.options.__file="packages/upload/src/upload-dragger.vue";var oh,lh,ch=ah.exports,uh={inject:["uploader"],components:{UploadDragger:ch},props:{type:String,action:{type:String,required:!0},name:{type:String,default:"file"},data:Object,headers:Object,withCredentials:Boolean,multiple:Boolean,accept:String,onStart:Function,onProgress:Function,onSuccess:Function,onError:Function,beforeUpload:Function,drag:Boolean,onPreview:{type:Function,default:function(){}},onRemove:{type:Function,default:function(){}},fileList:Array,autoUpload:Boolean,listType:String,httpRequest:{type:Function,default:th},disabled:Boolean,limit:Number,onExceed:Function},data:function(){return{mouseover:!1,reqs:{}}},methods:{isImage:function(e){return-1!==e.indexOf("image")},handleChange:function(e){var t=e.target.files;t&&this.uploadFiles(t)},uploadFiles:function(e){var t=this;if(this.limit&&this.fileList.length+e.length>this.limit)this.onExceed&&this.onExceed(e,this.fileList);else{var i=Array.prototype.slice.call(e);this.multiple||(i=i.slice(0,1)),0!==i.length&&i.forEach(function(e){t.onStart(e),t.autoUpload&&t.upload(e)})}},upload:function(e){var t=this;if(this.$refs.input.value=null,!this.beforeUpload)return this.post(e);var i=this.beforeUpload(e);i&&i.then?i.then(function(i){var n=Object.prototype.toString.call(i);if("[object File]"===n||"[object Blob]"===n){for(var s in"[object Blob]"===n&&(i=new File([i],e.name,{type:e.type})),e)e.hasOwnProperty(s)&&(i[s]=e[s]);t.post(i)}else t.post(e)},function(){t.onRemove(null,e)}):!1!==i?this.post(e):this.onRemove(null,e)},abort:function(e){var t=this.reqs;if(e){var i=e;e.uid&&(i=e.uid),t[i]&&t[i].abort()}else Object.keys(t).forEach(function(e){t[e]&&t[e].abort(),delete t[e]})},post:function(e){var t=this,i=e.uid,n={headers:this.headers,withCredentials:this.withCredentials,file:e,data:this.data,filename:this.name,action:this.action,onProgress:function(i){t.onProgress(i,e)},onSuccess:function(n){t.onSuccess(n,e),delete t.reqs[i]},onError:function(n){t.onError(n,e),delete t.reqs[i]}},s=this.httpRequest(n);this.reqs[i]=s,s&&s.then&&s.then(n.onSuccess,n.onError)},handleClick:function(){this.disabled||(this.$refs.input.value=null,this.$refs.input.click())},handleKeydown:function(e){e.target===e.currentTarget&&(13!==e.keyCode&&32!==e.keyCode||this.handleClick())}},render:function(e){var t=this.handleClick,i=this.drag,n=this.name,s=this.handleChange,r=this.multiple,a=this.accept,o=this.listType,l=this.uploadFiles,c=this.disabled,u=this.handleKeydown,h={class:{"el-upload":!0},on:{click:t,keydown:u}};return h.class["el-upload--"+o]=!0,e("div",Zu()([h,{attrs:{tabindex:"0"}}]),[i?e("upload-dragger",{attrs:{disabled:c},on:{file:l}},[this.$slots.default]):this.$slots.default,e("input",{class:"el-upload__input",attrs:{type:"file",name:n,multiple:r,accept:a},ref:"input",on:{change:s}})])}},hh=uh,dh=o(hh,oh,lh,!1,null,null,null);dh.options.__file="packages/upload/src/upload.vue";var ph=dh.exports;function fh(){}var mh,vh,gh={name:"ElUpload",mixins:[D.a],components:{ElProgress:Yu.a,UploadList:Xu,Upload:ph},provide:function(){return{uploader:this}},inject:{elForm:{default:""}},props:{action:{type:String,required:!0},headers:{type:Object,default:function(){return{}}},data:Object,multiple:Boolean,name:{type:String,default:"file"},drag:Boolean,dragger:Boolean,withCredentials:Boolean,showFileList:{type:Boolean,default:!0},accept:String,type:{type:String,default:"select"},beforeUpload:Function,beforeRemove:Function,onRemove:{type:Function,default:fh},onChange:{type:Function,default:fh},onPreview:{type:Function},onSuccess:{type:Function,default:fh},onProgress:{type:Function,default:fh},onError:{type:Function,default:fh},fileList:{type:Array,default:function(){return[]}},autoUpload:{type:Boolean,default:!0},listType:{type:String,default:"text"},httpRequest:Function,disabled:Boolean,limit:Number,onExceed:{type:Function,default:fh}},data:function(){return{uploadFiles:[],dragOver:!1,draging:!1,tempIndex:1}},computed:{uploadDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{listType:function(e){"picture-card"!==e&&"picture"!==e||(this.uploadFiles=this.uploadFiles.map(function(e){if(!e.url&&e.raw)try{e.url=URL.createObjectURL(e.raw)}catch(t){console.error("[Element Error][Upload]",t)}return e}))},fileList:{immediate:!0,handler:function(e){var t=this;this.uploadFiles=e.map(function(e){return e.uid=e.uid||Date.now()+t.tempIndex++,e.status=e.status||"success",e})}}},methods:{handleStart:function(e){e.uid=Date.now()+this.tempIndex++;var t={status:"ready",name:e.name,size:e.size,percentage:0,uid:e.uid,raw:e};if("picture-card"===this.listType||"picture"===this.listType)try{t.url=URL.createObjectURL(e)}catch(i){return void console.error("[Element Error][Upload]",i)}this.uploadFiles.push(t),this.onChange(t,this.uploadFiles)},handleProgress:function(e,t){var i=this.getFile(t);this.onProgress(e,i,this.uploadFiles),i.status="uploading",i.percentage=e.percent||0},handleSuccess:function(e,t){var i=this.getFile(t);i&&(i.status="success",i.response=e,this.onSuccess(e,i,this.uploadFiles),this.onChange(i,this.uploadFiles))},handleError:function(e,t){var i=this.getFile(t),n=this.uploadFiles;i.status="fail",n.splice(n.indexOf(i),1),this.onError(e,i,this.uploadFiles),this.onChange(i,this.uploadFiles)},handleRemove:function(e,t){var i=this;t&&(e=this.getFile(t));var n=function(){i.abort(e);var t=i.uploadFiles;t.splice(t.indexOf(e),1),i.onRemove(e,t)};if(this.beforeRemove){if("function"===typeof this.beforeRemove){var s=this.beforeRemove(e,this.uploadFiles);s&&s.then?s.then(function(){n()},fh):!1!==s&&n()}}else n()},getFile:function(e){var t=this.uploadFiles,i=void 0;return t.every(function(t){return i=e.uid===t.uid?t:null,!i}),i},abort:function(e){this.$refs["upload-inner"].abort(e)},clearFiles:function(){this.uploadFiles=[]},submit:function(){var e=this;this.uploadFiles.filter(function(e){return"ready"===e.status}).forEach(function(t){e.$refs["upload-inner"].upload(t.raw)})},getMigratingConfig:function(){return{props:{"default-file-list":"default-file-list is renamed to file-list.","show-upload-list":"show-upload-list is renamed to show-file-list.","thumbnail-mode":"thumbnail-mode has been deprecated, you can implement the same effect according to this case: http://element.eleme.io/#/zh-CN/component/upload#yong-hu-tou-xiang-shang-chuan"}}}},beforeDestroy:function(){this.uploadFiles.forEach(function(e){e.url&&0===e.url.indexOf("blob:")&&URL.revokeObjectURL(e.url)})},render:function(e){var t=void 0;this.showFileList&&(t=e(Xu,{attrs:{disabled:this.uploadDisabled,listType:this.listType,files:this.uploadFiles,handlePreview:this.onPreview},on:{remove:this.handleRemove}}));var i={props:{type:this.type,drag:this.drag,action:this.action,multiple:this.multiple,"before-upload":this.beforeUpload,"with-credentials":this.withCredentials,headers:this.headers,name:this.name,data:this.data,accept:this.accept,fileList:this.uploadFiles,autoUpload:this.autoUpload,listType:this.listType,disabled:this.uploadDisabled,limit:this.limit,"on-exceed":this.onExceed,"on-start":this.handleStart,"on-progress":this.handleProgress,"on-success":this.handleSuccess,"on-error":this.handleError,"on-preview":this.onPreview,"on-remove":this.handleRemove,"http-request":this.httpRequest},ref:"upload-inner"},n=this.$slots.trigger||this.$slots.default,s=e("upload",i,[n]);return e("div",["picture-card"===this.listType?t:"",this.$slots.trigger?[s,this.$slots.default]:s,this.$slots.tip,"picture-card"!==this.listType?t:""])}},bh=gh,yh=o(bh,mh,vh,!1,null,null,null);yh.options.__file="packages/upload/src/index.vue";var _h=yh.exports;_h.install=function(e){e.component(_h.name,_h)};var xh=_h,Ch=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-progress",class:["el-progress--"+e.type,e.status?"is-"+e.status:"",{"el-progress--without-text":!e.showText,"el-progress--text-inside":e.textInside}],attrs:{role:"progressbar","aria-valuenow":e.percentage,"aria-valuemin":"0","aria-valuemax":"100"}},["line"===e.type?i("div",{staticClass:"el-progress-bar"},[i("div",{staticClass:"el-progress-bar__outer",style:{height:e.strokeWidth+"px"}},[i("div",{staticClass:"el-progress-bar__inner",style:e.barStyle},[e.showText&&e.textInside?i("div",{staticClass:"el-progress-bar__innerText"},[e._v(e._s(e.content))]):e._e()])])]):i("div",{staticClass:"el-progress-circle",style:{height:e.width+"px",width:e.width+"px"}},[i("svg",{attrs:{viewBox:"0 0 100 100"}},[i("path",{staticClass:"el-progress-circle__track",style:e.trailPathStyle,attrs:{d:e.trackPath,stroke:"#e5e9f2","stroke-width":e.relativeStrokeWidth,fill:"none"}}),i("path",{staticClass:"el-progress-circle__path",style:e.circlePathStyle,attrs:{d:e.trackPath,stroke:e.stroke,fill:"none","stroke-linecap":"round","stroke-width":e.percentage?e.relativeStrokeWidth:0}})])]),e.showText&&!e.textInside?i("div",{staticClass:"el-progress__text",style:{fontSize:e.progressTextSize+"px"}},[e.status?i("i",{class:e.iconClass}):[e._v(e._s(e.content))]],2):e._e()])},wh=[];Ch._withStripped=!0;var kh={name:"ElProgress",props:{type:{type:String,default:"line",validator:function(e){return["line","circle","dashboard"].indexOf(e)>-1}},percentage:{type:Number,default:0,required:!0,validator:function(e){return e>=0&&e<=100}},status:{type:String,validator:function(e){return["success","exception","warning"].indexOf(e)>-1}},strokeWidth:{type:Number,default:6},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle:function(){var e={};return e.width=this.percentage+"%",e.backgroundColor=this.getCurrentColor(this.percentage),e},relativeStrokeWidth:function(){return(this.strokeWidth/this.width*100).toFixed(1)},radius:function(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath:function(){var e=this.radius,t="dashboard"===this.type;return"\n M 50 50\n m 0 "+(t?"":"-")+e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"-":"")+2*e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"":"-")+2*e+"\n "},perimeter:function(){return 2*Math.PI*this.radius},rate:function(){return"dashboard"===this.type?.75:1},strokeDashoffset:function(){var e=-1*this.perimeter*(1-this.rate)/2;return e+"px"},trailPathStyle:function(){return{strokeDasharray:this.perimeter*this.rate+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset}},circlePathStyle:function(){return{strokeDasharray:this.perimeter*this.rate*(this.percentage/100)+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke:function(){var e=void 0;if(this.color)e=this.getCurrentColor(this.percentage);else switch(this.status){case"success":e="#13ce66";break;case"exception":e="#ff4949";break;case"warning":e="#e6a23c";break;default:e="#20a0ff"}return e},iconClass:function(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize:function(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content:function(){return"function"===typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor:function(e){return"function"===typeof this.color?this.color(e):"string"===typeof this.color?this.color:this.getLevelColor(e)},getLevelColor:function(e){for(var t=this.getColorArray().sort(function(e,t){return e.percentage-t.percentage}),i=0;ie)return t[i].color;return t[t.length-1].color},getColorArray:function(){var e=this.color,t=100/e.length;return e.map(function(e,i){return"string"===typeof e?{color:e,progress:(i+1)*t}:e})}}},Sh=kh,Dh=o(Sh,Ch,wh,!1,null,null,null);Dh.options.__file="packages/progress/src/progress.vue";var $h=Dh.exports;$h.install=function(e){e.component($h.name,$h)};var Oh=$h,Eh=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("span",{staticClass:"el-spinner"},[i("svg",{staticClass:"el-spinner-inner",style:{width:e.radius/2+"px",height:e.radius/2+"px"},attrs:{viewBox:"0 0 50 50"}},[i("circle",{staticClass:"path",attrs:{cx:"25",cy:"25",r:"20",fill:"none",stroke:e.strokeColor,"stroke-width":e.strokeWidth}})])])},Th=[];Eh._withStripped=!0;var Ph={name:"ElSpinner",props:{type:String,radius:{type:Number,default:100},strokeWidth:{type:Number,default:5},strokeColor:{type:String,default:"#efefef"}}},Mh=Ph,Ih=o(Mh,Eh,Th,!1,null,null,null);Ih.options.__file="packages/spinner/src/spinner.vue";var Nh=Ih.exports;Nh.install=function(e){e.component(Nh.name,Nh)};var jh=Nh,Fh=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-message-fade"},on:{"after-leave":e.handleAfterLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],class:["el-message",e.type&&!e.iconClass?"el-message--"+e.type:"",e.center?"is-center":"",e.showClose?"is-closable":"",e.customClass],style:e.positionStyle,attrs:{role:"alert"},on:{mouseenter:e.clearTimer,mouseleave:e.startTimer}},[e.iconClass?i("i",{class:e.iconClass}):i("i",{class:e.typeClass}),e._t("default",[e.dangerouslyUseHTMLString?i("p",{staticClass:"el-message__content",domProps:{innerHTML:e._s(e.message)}}):i("p",{staticClass:"el-message__content"},[e._v(e._s(e.message))])]),e.showClose?i("i",{staticClass:"el-message__closeBtn el-icon-close",on:{click:e.close}}):e._e()],2)])},Lh=[];Fh._withStripped=!0;var Vh={success:"success",info:"info",warning:"warning",error:"error"},Ah={data:function(){return{visible:!1,message:"",duration:3e3,type:"info",iconClass:"",customClass:"",onClose:null,showClose:!1,closed:!1,verticalOffset:20,timer:null,dangerouslyUseHTMLString:!1,center:!1}},computed:{typeClass:function(){return this.type&&!this.iconClass?"el-message__icon el-icon-"+Vh[this.type]:""},positionStyle:function(){return{top:this.verticalOffset+"px"}}},watch:{closed:function(e){e&&(this.visible=!1)}},methods:{handleAfterLeave:function(){this.$destroy(!0),this.$el.parentNode.removeChild(this.$el)},close:function(){this.closed=!0,"function"===typeof this.onClose&&this.onClose(this)},clearTimer:function(){clearTimeout(this.timer)},startTimer:function(){var e=this;this.duration>0&&(this.timer=setTimeout(function(){e.closed||e.close()},this.duration))},keydown:function(e){27===e.keyCode&&(this.closed||this.close())}},mounted:function(){this.startTimer(),document.addEventListener("keydown",this.keydown)},beforeDestroy:function(){document.removeEventListener("keydown",this.keydown)}},zh=Ah,Bh=o(zh,Fh,Lh,!1,null,null,null);Bh.options.__file="packages/message/src/main.vue";var Rh=Bh.exports,Hh=Wn.a.extend(Rh),Wh=void 0,qh=[],Yh=1,Kh=function e(t){if(!Wn.a.prototype.$isServer){t=t||{},"string"===typeof t&&(t={message:t});var i=t.onClose,n="message_"+Yh++;t.onClose=function(){e.close(n,i)},Wh=new Hh({data:t}),Wh.id=n,Object(ko["isVNode"])(Wh.message)&&(Wh.$slots.default=[Wh.message],Wh.message=null),Wh.$mount(),document.body.appendChild(Wh.$el);var s=t.offset||20;return qh.forEach(function(e){s+=e.$el.offsetHeight+16}),Wh.verticalOffset=s,Wh.visible=!0,Wh.$el.style.zIndex=w["PopupManager"].nextZIndex(),qh.push(Wh),Wh}};["success","warning","info","error"].forEach(function(e){Kh[e]=function(t){return"string"===typeof t&&(t={message:t}),t.type=e,Kh(t)}}),Kh.close=function(e,t){for(var i=qh.length,n=-1,s=0;sqh.length-1))for(var r=qh[n].$el.offsetHeight,a=n;a=0;e--)qh[e].close()};var Uh=Kh,Gh=Uh,Xh=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-badge"},[e._t("default"),i("transition",{attrs:{name:"el-zoom-in-center"}},[i("sup",{directives:[{name:"show",rawName:"v-show",value:!e.hidden&&(e.content||0===e.content||e.isDot),expression:"!hidden && (content || content === 0 || isDot)"}],staticClass:"el-badge__content",class:["el-badge__content--"+e.type,{"is-fixed":e.$slots.default,"is-dot":e.isDot}],domProps:{textContent:e._s(e.content)}})])],2)},Qh=[];Xh._withStripped=!0;var Zh={name:"ElBadge",props:{value:{},max:Number,isDot:Boolean,hidden:Boolean,type:{type:String,validator:function(e){return["primary","success","warning","info","danger"].indexOf(e)>-1}}},computed:{content:function(){if(!this.isDot){var e=this.value,t=this.max;return"number"===typeof e&&"number"===typeof t&&t0&&e-1this.value,i=this.allowHalf&&this.pointerAtLeftHalf&&e-.5<=this.currentValue&&e>this.currentValue;return t||i},getIconStyle:function(e){var t=this.rateDisabled?this.disabledVoidColor:this.voidColor;return{color:e<=this.currentValue?this.activeColor:t}},selectValue:function(e){this.rateDisabled||(this.allowHalf&&this.pointerAtLeftHalf?(this.$emit("input",this.currentValue),this.$emit("change",this.currentValue)):(this.$emit("input",e),this.$emit("change",e)))},handleKey:function(e){if(!this.rateDisabled){var t=this.currentValue,i=e.keyCode;38===i||39===i?(this.allowHalf?t+=.5:t+=1,e.stopPropagation(),e.preventDefault()):37!==i&&40!==i||(this.allowHalf?t-=.5:t-=1,e.stopPropagation(),e.preventDefault()),t=t<0?0:t,t=t>this.max?this.max:t,this.$emit("input",t),this.$emit("change",t)}},setCurrentValue:function(e,t){if(!this.rateDisabled){if(this.allowHalf){var i=t.target;Object(Ve["hasClass"])(i,"el-rate__item")&&(i=i.querySelector(".el-rate__icon")),Object(Ve["hasClass"])(i,"el-rate__decimal")&&(i=i.parentNode),this.pointerAtLeftHalf=2*t.offsetX<=i.clientWidth,this.currentValue=this.pointerAtLeftHalf?e-.5:e}else this.currentValue=e;this.hoverIndex=e}},resetCurrentValue:function(){this.rateDisabled||(this.allowHalf&&(this.pointerAtLeftHalf=this.value!==Math.floor(this.value)),this.currentValue=this.value,this.hoverIndex=-1)}},created:function(){this.value||this.$emit("input",0)}},fd=pd,md=o(fd,ud,hd,!1,null,null,null);md.options.__file="packages/rate/src/main.vue";var vd=md.exports;vd.install=function(e){e.component(vd.name,vd)};var gd=vd,bd=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-steps",class:[!e.simple&&"el-steps--"+e.direction,e.simple&&"el-steps--simple"]},[e._t("default")],2)},yd=[];bd._withStripped=!0;var _d={name:"ElSteps",mixins:[D.a],props:{space:[Number,String],active:Number,direction:{type:String,default:"horizontal"},alignCenter:Boolean,simple:Boolean,finishStatus:{type:String,default:"finish"},processStatus:{type:String,default:"process"}},data:function(){return{steps:[],stepOffset:0}},methods:{getMigratingConfig:function(){return{props:{center:"center is removed."}}}},watch:{active:function(e,t){this.$emit("change",e,t)},steps:function(e){e.forEach(function(e,t){e.index=t})}}},xd=_d,Cd=o(xd,bd,yd,!1,null,null,null);Cd.options.__file="packages/steps/src/steps.vue";var wd=Cd.exports;wd.install=function(e){e.component(wd.name,wd)};var kd=wd,Sd=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-step",class:[!e.isSimple&&"is-"+e.$parent.direction,e.isSimple&&"is-simple",e.isLast&&!e.space&&!e.isCenter&&"is-flex",e.isCenter&&!e.isVertical&&!e.isSimple&&"is-center"],style:e.style},[i("div",{staticClass:"el-step__head",class:"is-"+e.currentStatus},[i("div",{staticClass:"el-step__line",style:e.isLast?"":{marginRight:e.$parent.stepOffset+"px"}},[i("i",{staticClass:"el-step__line-inner",style:e.lineStyle})]),i("div",{staticClass:"el-step__icon",class:"is-"+(e.icon?"icon":"text")},["success"!==e.currentStatus&&"error"!==e.currentStatus?e._t("icon",[e.icon?i("i",{staticClass:"el-step__icon-inner",class:[e.icon]}):e._e(),e.icon||e.isSimple?e._e():i("div",{staticClass:"el-step__icon-inner"},[e._v(e._s(e.index+1))])]):i("i",{staticClass:"el-step__icon-inner is-status",class:["el-icon-"+("success"===e.currentStatus?"check":"close")]})],2)]),i("div",{staticClass:"el-step__main"},[i("div",{ref:"title",staticClass:"el-step__title",class:["is-"+e.currentStatus]},[e._t("title",[e._v(e._s(e.title))])],2),e.isSimple?i("div",{staticClass:"el-step__arrow"}):i("div",{staticClass:"el-step__description",class:["is-"+e.currentStatus]},[e._t("description",[e._v(e._s(e.description))])],2)])])},Dd=[];Sd._withStripped=!0;var $d={name:"ElStep",props:{title:String,icon:String,description:String,status:String},data:function(){return{index:-1,lineStyle:{},internalStatus:""}},beforeCreate:function(){this.$parent.steps.push(this)},beforeDestroy:function(){var e=this.$parent.steps,t=e.indexOf(this);t>=0&&e.splice(t,1)},computed:{currentStatus:function(){return this.status||this.internalStatus},prevStatus:function(){var e=this.$parent.steps[this.index-1];return e?e.currentStatus:"wait"},isCenter:function(){return this.$parent.alignCenter},isVertical:function(){return"vertical"===this.$parent.direction},isSimple:function(){return this.$parent.simple},isLast:function(){var e=this.$parent;return e.steps[e.steps.length-1]===this},stepsCount:function(){return this.$parent.steps.length},space:function(){var e=this.isSimple,t=this.$parent.space;return e?"":t},style:function(){var e={},t=this.$parent,i=t.steps.length,n="number"===typeof this.space?this.space+"px":this.space?this.space:100/(i-(this.isCenter?0:1))+"%";return e.flexBasis=n,this.isVertical?e:(this.isLast?e.maxWidth=100/this.stepsCount+"%":e.marginRight=-this.$parent.stepOffset+"px",e)}},methods:{updateStatus:function(e){var t=this.$parent.$children[this.index-1];e>this.index?this.internalStatus=this.$parent.finishStatus:e===this.index&&"error"!==this.prevStatus?this.internalStatus=this.$parent.processStatus:this.internalStatus="wait",t&&t.calcProgress(this.internalStatus)},calcProgress:function(e){var t=100,i={};i.transitionDelay=150*this.index+"ms",e===this.$parent.processStatus?(this.currentStatus,t=0):"wait"===e&&(t=0,i.transitionDelay=-150*this.index+"ms"),i.borderWidth=t&&!this.isSimple?"1px":0,"vertical"===this.$parent.direction?i.height=t+"%":i.width=t+"%",this.lineStyle=i}},mounted:function(){var e=this,t=this.$watch("index",function(i){e.$watch("$parent.active",e.updateStatus,{immediate:!0}),e.$watch("$parent.processStatus",function(){var t=e.$parent.active;e.updateStatus(t)},{immediate:!0}),t()})}},Od=$d,Ed=o(Od,Sd,Dd,!1,null,null,null);Ed.options.__file="packages/steps/src/step.vue";var Td=Ed.exports;Td.install=function(e){e.component(Td.name,Td)};var Pd=Td,Md=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:e.carouselClasses,on:{mouseenter:function(t){return t.stopPropagation(),e.handleMouseEnter(t)},mouseleave:function(t){return t.stopPropagation(),e.handleMouseLeave(t)}}},[i("div",{staticClass:"el-carousel__container",style:{height:e.height}},[e.arrowDisplay?i("transition",{attrs:{name:"carousel-arrow-left"}},[i("button",{directives:[{name:"show",rawName:"v-show",value:("always"===e.arrow||e.hover)&&(e.loop||e.activeIndex>0),expression:"(arrow === 'always' || hover) && (loop || activeIndex > 0)"}],staticClass:"el-carousel__arrow el-carousel__arrow--left",attrs:{type:"button"},on:{mouseenter:function(t){e.handleButtonEnter("left")},mouseleave:e.handleButtonLeave,click:function(t){t.stopPropagation(),e.throttledArrowClick(e.activeIndex-1)}}},[i("i",{staticClass:"el-icon-arrow-left"})])]):e._e(),e.arrowDisplay?i("transition",{attrs:{name:"carousel-arrow-right"}},[i("button",{directives:[{name:"show",rawName:"v-show",value:("always"===e.arrow||e.hover)&&(e.loop||e.activeIndex0})},carouselClasses:function(){var e=["el-carousel","el-carousel--"+this.direction];return"card"===this.type&&e.push("el-carousel--card"),e},indicatorsClasses:function(){var e=["el-carousel__indicators","el-carousel__indicators--"+this.direction];return this.hasLabel&&e.push("el-carousel__indicators--labels"),"outside"!==this.indicatorPosition&&"card"!==this.type||e.push("el-carousel__indicators--outside"),e}},watch:{items:function(e){e.length>0&&this.setActiveItem(this.initialIndex)},activeIndex:function(e,t){this.resetItemPosition(t),this.$emit("change",e,t)},autoplay:function(e){e?this.startTimer():this.pauseTimer()},loop:function(){this.setActiveItem(this.activeIndex)}},methods:{handleMouseEnter:function(){this.hover=!0,this.pauseTimer()},handleMouseLeave:function(){this.hover=!1,this.startTimer()},itemInStage:function(e,t){var i=this.items.length;return t===i-1&&e.inStage&&this.items[0].active||e.inStage&&this.items[t+1]&&this.items[t+1].active?"left":!!(0===t&&e.inStage&&this.items[i-1].active||e.inStage&&this.items[t-1]&&this.items[t-1].active)&&"right"},handleButtonEnter:function(e){var t=this;"vertical"!==this.direction&&this.items.forEach(function(i,n){e===t.itemInStage(i,n)&&(i.hover=!0)})},handleButtonLeave:function(){"vertical"!==this.direction&&this.items.forEach(function(e){e.hover=!1})},updateItems:function(){this.items=this.$children.filter(function(e){return"ElCarouselItem"===e.$options.name})},resetItemPosition:function(e){var t=this;this.items.forEach(function(i,n){i.translateItem(n,t.activeIndex,e)})},playSlides:function(){this.activeIndex0&&(e=this.items.indexOf(t[0]))}if(e=Number(e),isNaN(e)||e!==Math.floor(e))console.warn("[Element Warn][Carousel]index must be an integer.");else{var i=this.items.length,n=this.activeIndex;this.activeIndex=e<0?this.loop?i-1:0:e>=i?this.loop?0:i-1:e,n===this.activeIndex&&this.resetItemPosition(n)}},prev:function(){this.setActiveItem(this.activeIndex-1)},next:function(){this.setActiveItem(this.activeIndex+1)},handleIndicatorClick:function(e){this.activeIndex=e},handleIndicatorHover:function(e){"hover"===this.trigger&&e!==this.activeIndex&&(this.activeIndex=e)}},created:function(){var e=this;this.throttledArrowClick=jd()(300,!0,function(t){e.setActiveItem(t)}),this.throttledIndicatorHover=jd()(300,function(t){e.handleIndicatorHover(t)})},mounted:function(){var e=this;this.updateItems(),this.$nextTick(function(){Object(Zi["addResizeListener"])(e.$el,e.resetItemPosition),e.initialIndex=0&&(e.activeIndex=e.initialIndex),e.startTimer()})},beforeDestroy:function(){this.$el&&Object(Zi["removeResizeListener"])(this.$el,this.resetItemPosition),this.pauseTimer()}},Ld=Fd,Vd=o(Ld,Md,Id,!1,null,null,null);Vd.options.__file="packages/carousel/src/main.vue";var Ad=Vd.exports;Ad.install=function(e){e.component(Ad.name,Ad)};var zd=Ad,Bd={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}};function Rd(e){var t=e.move,i=e.size,n=e.bar,s={},r="translate"+n.axis+"("+t+"%)";return s[n.size]=i,s.transform=r,s.msTransform=r,s.webkitTransform=r,s}var Hd={name:"Bar",props:{vertical:Boolean,size:String,move:Number},computed:{bar:function(){return Bd[this.vertical?"vertical":"horizontal"]},wrap:function(){return this.$parent.wrap}},render:function(e){var t=this.size,i=this.move,n=this.bar;return e("div",{class:["el-scrollbar__bar","is-"+n.key],on:{mousedown:this.clickTrackHandler}},[e("div",{ref:"thumb",class:"el-scrollbar__thumb",on:{mousedown:this.clickThumbHandler},style:Rd({size:t,move:i,bar:n})})])},methods:{clickThumbHandler:function(e){e.ctrlKey||2===e.button||(this.startDrag(e),this[this.bar.axis]=e.currentTarget[this.bar.offset]-(e[this.bar.client]-e.currentTarget.getBoundingClientRect()[this.bar.direction]))},clickTrackHandler:function(e){var t=Math.abs(e.target.getBoundingClientRect()[this.bar.direction]-e[this.bar.client]),i=this.$refs.thumb[this.bar.offset]/2,n=100*(t-i)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=n*this.wrap[this.bar.scrollSize]/100},startDrag:function(e){e.stopImmediatePropagation(),this.cursorDown=!0,Object(Ve["on"])(document,"mousemove",this.mouseMoveDocumentHandler),Object(Ve["on"])(document,"mouseup",this.mouseUpDocumentHandler),document.onselectstart=function(){return!1}},mouseMoveDocumentHandler:function(e){if(!1!==this.cursorDown){var t=this[this.bar.axis];if(t){var i=-1*(this.$el.getBoundingClientRect()[this.bar.direction]-e[this.bar.client]),n=this.$refs.thumb[this.bar.offset]-t,s=100*(i-n)/this.$el[this.bar.offset];this.wrap[this.bar.scroll]=s*this.wrap[this.bar.scrollSize]/100}}},mouseUpDocumentHandler:function(e){this.cursorDown=!1,this[this.bar.axis]=0,Object(Ve["off"])(document,"mousemove",this.mouseMoveDocumentHandler),document.onselectstart=null}},destroyed:function(){Object(Ve["off"])(document,"mouseup",this.mouseUpDocumentHandler)}},Wd={name:"ElScrollbar",components:{Bar:Hd},props:{native:Boolean,wrapStyle:{},wrapClass:{},viewClass:{},viewStyle:{},noresize:Boolean,tag:{type:String,default:"div"}},data:function(){return{sizeWidth:"0",sizeHeight:"0",moveX:0,moveY:0}},computed:{wrap:function(){return this.$refs.wrap}},render:function(e){var t=ys()(),i=this.wrapStyle;if(t){var n="-"+t+"px",s="margin-bottom: "+n+"; margin-right: "+n+";";Array.isArray(this.wrapStyle)?(i=Object(b["toObject"])(this.wrapStyle),i.marginRight=i.marginBottom=n):"string"===typeof this.wrapStyle?i+=s:i=s}var r=e(this.tag,{class:["el-scrollbar__view",this.viewClass],style:this.viewStyle,ref:"resize"},this.$slots.default),a=e("div",{ref:"wrap",style:i,on:{scroll:this.handleScroll},class:[this.wrapClass,"el-scrollbar__wrap",t?"":"el-scrollbar__wrap--hidden-default"]},[[r]]),o=void 0;return o=this.native?[e("div",{ref:"wrap",class:[this.wrapClass,"el-scrollbar__wrap"],style:i},[[r]])]:[a,e(Hd,{attrs:{move:this.moveX,size:this.sizeWidth}}),e(Hd,{attrs:{vertical:!0,move:this.moveY,size:this.sizeHeight}})],e("div",{class:"el-scrollbar"},o)},methods:{handleScroll:function(){var e=this.wrap;this.moveY=100*e.scrollTop/e.clientHeight,this.moveX=100*e.scrollLeft/e.clientWidth},update:function(){var e=void 0,t=void 0,i=this.wrap;i&&(e=100*i.clientHeight/i.scrollHeight,t=100*i.clientWidth/i.scrollWidth,this.sizeHeight=e<100?e+"%":"",this.sizeWidth=t<100?t+"%":"")}},mounted:function(){this.native||(this.$nextTick(this.update),!this.noresize&&Object(Zi["addResizeListener"])(this.$refs.resize,this.update))},beforeDestroy:function(){this.native||!this.noresize&&Object(Zi["removeResizeListener"])(this.$refs.resize,this.update)},install:function(e){e.component(Wd.name,Wd)}},qd=Wd,Yd=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"show",rawName:"v-show",value:e.ready,expression:"ready"}],staticClass:"el-carousel__item",class:{"is-active":e.active,"el-carousel__item--card":"card"===e.$parent.type,"is-in-stage":e.inStage,"is-hover":e.hover,"is-animating":e.animating},style:e.itemStyle,on:{click:e.handleItemClick}},["card"===e.$parent.type?i("div",{directives:[{name:"show",rawName:"v-show",value:!e.active,expression:"!active"}],staticClass:"el-carousel__mask"}):e._e(),e._t("default")],2)},Kd=[];Yd._withStripped=!0;var Ud=.83,Gd={name:"ElCarouselItem",props:{name:String,label:{type:[String,Number],default:""}},data:function(){return{hover:!1,translate:0,scale:1,active:!1,ready:!1,inStage:!1,animating:!1}},methods:{processIndex:function(e,t,i){return 0===t&&e===i-1?-1:t===i-1&&0===e?i:e=i/2?i+1:e>t+1&&e-t>=i/2?-2:e},calcCardTranslate:function(e,t){var i=this.$parent.$el.offsetWidth;return this.inStage?i*((2-Ud)*(e-t)+1)/4:e2&&this.$parent.loop&&(e=this.processIndex(e,t,r)),"card"===n)"vertical"===s&&console.warn("[Element Warn][Carousel]vertical directionis not supported in card mode"),this.inStage=Math.round(Math.abs(e-t))<=1,this.active=e===t,this.translate=this.calcCardTranslate(e,t),this.scale=this.active?1:Ud;else{this.active=e===t;var a="vertical"===s;this.translate=this.calcTranslate(e,t,a)}this.ready=!0},handleItemClick:function(){var e=this.$parent;if(e&&"card"===e.type){var t=e.items.indexOf(this);e.setActiveItem(t)}}},computed:{parentDirection:function(){return this.$parent.direction},itemStyle:function(){var e="vertical"===this.parentDirection?"translateY":"translateX",t=e+"("+this.translate+"px) scale("+this.scale+")",i={transform:t};return Object(b["autoprefixer"])(i)}},created:function(){this.$parent&&this.$parent.updateItems()},destroyed:function(){this.$parent&&this.$parent.updateItems()}},Xd=Gd,Qd=o(Xd,Yd,Kd,!1,null,null,null);Qd.options.__file="packages/carousel/src/item.vue";var Zd=Qd.exports;Zd.install=function(e){e.component(Zd.name,Zd)};var Jd=Zd,ep=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-collapse",attrs:{role:"tablist","aria-multiselectable":"true"}},[e._t("default")],2)},tp=[];ep._withStripped=!0;var ip={name:"ElCollapse",componentName:"ElCollapse",props:{accordion:Boolean,value:{type:[Array,String,Number],default:function(){return[]}}},data:function(){return{activeNames:[].concat(this.value)}},provide:function(){return{collapse:this}},watch:{value:function(e){this.activeNames=[].concat(e)}},methods:{setActiveNames:function(e){e=[].concat(e);var t=this.accordion?e[0]:e;this.activeNames=e,this.$emit("input",t),this.$emit("change",t)},handleItemClick:function(e){if(this.accordion)this.setActiveNames(!this.activeNames[0]&&0!==this.activeNames[0]||this.activeNames[0]!==e.name?e.name:"");else{var t=this.activeNames.slice(0),i=t.indexOf(e.name);i>-1?t.splice(i,1):t.push(e.name),this.setActiveNames(t)}}},created:function(){this.$on("item-click",this.handleItemClick)}},np=ip,sp=o(np,ep,tp,!1,null,null,null);sp.options.__file="packages/collapse/src/collapse.vue";var rp=sp.exports;rp.install=function(e){e.component(rp.name,rp)};var ap=rp,op=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-collapse-item",class:{"is-active":e.isActive,"is-disabled":e.disabled}},[i("div",{attrs:{role:"tab","aria-expanded":e.isActive,"aria-controls":"el-collapse-content-"+e.id,"aria-describedby":"el-collapse-content-"+e.id}},[i("div",{staticClass:"el-collapse-item__header",class:{focusing:e.focusing,"is-active":e.isActive},attrs:{role:"button",id:"el-collapse-head-"+e.id,tabindex:e.disabled?void 0:0},on:{click:e.handleHeaderClick,keyup:function(t){return"button"in t||!e._k(t.keyCode,"space",32,t.key,[" ","Spacebar"])||!e._k(t.keyCode,"enter",13,t.key,"Enter")?(t.stopPropagation(),e.handleEnterClick(t)):null},focus:e.handleFocus,blur:function(t){e.focusing=!1}}},[e._t("title",[e._v(e._s(e.title))]),i("i",{staticClass:"el-collapse-item__arrow el-icon-arrow-right",class:{"is-active":e.isActive}})],2)]),i("el-collapse-transition",[i("div",{directives:[{name:"show",rawName:"v-show",value:e.isActive,expression:"isActive"}],staticClass:"el-collapse-item__wrap",attrs:{role:"tabpanel","aria-hidden":!e.isActive,"aria-labelledby":"el-collapse-head-"+e.id,id:"el-collapse-content-"+e.id}},[i("div",{staticClass:"el-collapse-item__content"},[e._t("default")],2)])])],1)},lp=[];op._withStripped=!0;var cp={name:"ElCollapseItem",componentName:"ElCollapseItem",mixins:[O.a],components:{ElCollapseTransition:Ke.a},data:function(){return{contentWrapStyle:{height:"auto",display:"block"},contentHeight:0,focusing:!1,isClick:!1,id:Object(b["generateId"])()}},inject:["collapse"],props:{title:String,name:{type:[String,Number],default:function(){return this._uid}},disabled:Boolean},computed:{isActive:function(){return this.collapse.activeNames.indexOf(this.name)>-1}},methods:{handleFocus:function(){var e=this;setTimeout(function(){e.isClick?e.isClick=!1:e.focusing=!0},50)},handleHeaderClick:function(){this.disabled||(this.dispatch("ElCollapse","item-click",this),this.focusing=!1,this.isClick=!0)},handleEnterClick:function(){this.dispatch("ElCollapse","item-click",this)}}},up=cp,hp=o(up,op,lp,!1,null,null,null);hp.options.__file="packages/collapse/src/collapse-item.vue";var dp=hp.exports;dp.install=function(e){e.component(dp.name,dp)};var pp=dp,fp=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:function(){return e.toggleDropDownVisible(!1)},expression:"() => toggleDropDownVisible(false)"}],ref:"reference",class:["el-cascader",e.realSize&&"el-cascader--"+e.realSize,{"is-disabled":e.isDisabled}],on:{mouseenter:function(t){e.inputHover=!0},mouseleave:function(t){e.inputHover=!1},click:function(){return e.toggleDropDownVisible(!e.readonly||void 0)},keydown:e.handleKeyDown}},[i("el-input",{ref:"input",class:{"is-focus":e.dropDownVisible},attrs:{size:e.realSize,placeholder:e.placeholder,readonly:e.readonly,disabled:e.isDisabled,"validate-event":!1},on:{focus:e.handleFocus,blur:e.handleBlur,input:e.handleInput},model:{value:e.multiple?e.presentText:e.inputValue,callback:function(t){e.multiple?e.presentText:e.inputValue=t},expression:"multiple ? presentText : inputValue"}},[i("template",{slot:"suffix"},[e.clearBtnVisible?i("i",{key:"clear",staticClass:"el-input__icon el-icon-circle-close",on:{click:function(t){return t.stopPropagation(),e.handleClear(t)}}}):i("i",{key:"arrow-down",class:["el-input__icon","el-icon-arrow-down",e.dropDownVisible&&"is-reverse"],on:{click:function(t){t.stopPropagation(),e.toggleDropDownVisible()}}})])],2),e.multiple?i("div",{staticClass:"el-cascader__tags"},[e._l(e.presentTags,function(t,n){return i("el-tag",{key:t.key,attrs:{type:"info",size:e.tagSize,hit:t.hitState,closable:t.closable,"disable-transitions":""},on:{close:function(t){e.deleteTag(n)}}},[i("span",[e._v(e._s(t.text))])])}),e.filterable&&!e.isDisabled?i("input",{directives:[{name:"model",rawName:"v-model.trim",value:e.inputValue,expression:"inputValue",modifiers:{trim:!0}}],staticClass:"el-cascader__search-input",attrs:{type:"text",placeholder:e.presentTags.length?"":e.placeholder},domProps:{value:e.inputValue},on:{input:[function(t){t.target.composing||(e.inputValue=t.target.value.trim())},function(t){return e.handleInput(e.inputValue,t)}],click:function(t){t.stopPropagation(),e.toggleDropDownVisible(!0)},keydown:function(t){return"button"in t||!e._k(t.keyCode,"delete",[8,46],t.key,["Backspace","Delete","Del"])?e.handleDelete(t):null},blur:function(t){e.$forceUpdate()}}}):e._e()],2):e._e(),i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.handleDropdownLeave}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.dropDownVisible,expression:"dropDownVisible"}],ref:"popper",class:["el-popper","el-cascader__dropdown",e.popperClass]},[i("el-cascader-panel",{directives:[{name:"show",rawName:"v-show",value:!e.filtering,expression:"!filtering"}],ref:"panel",attrs:{options:e.options,props:e.config,border:!1,"render-label":e.$scopedSlots.default},on:{"expand-change":e.handleExpandChange,close:function(t){e.toggleDropDownVisible(!1)}},model:{value:e.checkedValue,callback:function(t){e.checkedValue=t},expression:"checkedValue"}}),e.filterable?i("el-scrollbar",{directives:[{name:"show",rawName:"v-show",value:e.filtering,expression:"filtering"}],ref:"suggestionPanel",staticClass:"el-cascader__suggestion-panel",attrs:{tag:"ul","view-class":"el-cascader__suggestion-list"},nativeOn:{keydown:function(t){return e.handleSuggestionKeyDown(t)}}},[e.suggestions.length?e._l(e.suggestions,function(t,n){return i("li",{key:t.uid,class:["el-cascader__suggestion-item",t.checked&&"is-checked"],attrs:{tabindex:-1},on:{click:function(t){e.handleSuggestionClick(n)}}},[i("span",[e._v(e._s(t.text))]),t.checked?i("i",{staticClass:"el-icon-check"}):e._e()])}):e._t("empty",[i("li",{staticClass:"el-cascader__empty-text"},[e._v(e._s(e.t("el.cascader.noMatch")))])])],2):e._e()],1)])],1)},mp=[];fp._withStripped=!0;var vp=i(42),gp=i.n(vp),bp=i(33),yp=i.n(bp),_p=yp.a.keys,xp={expandTrigger:{newProp:"expandTrigger",type:String},changeOnSelect:{newProp:"checkStrictly",type:Boolean},hoverThreshold:{newProp:"hoverThreshold",type:Number}},Cp={props:{placement:{type:String,default:"bottom-start"},appendToBody:H.a.props.appendToBody,visibleArrow:{type:Boolean,default:!0},arrowOffset:H.a.props.arrowOffset,offset:H.a.props.offset,boundariesPadding:H.a.props.boundariesPadding,popperOptions:H.a.props.popperOptions},methods:H.a.methods,data:H.a.data,beforeDestroy:H.a.beforeDestroy},wp={medium:36,small:32,mini:28},kp={name:"ElCascader",directives:{Clickoutside:A.a},mixins:[Cp,O.a,g.a,D.a],inject:{elForm:{default:""},elFormItem:{default:""}},components:{ElInput:m.a,ElTag:Qi.a,ElScrollbar:q.a,ElCascaderPanel:gp.a},props:{value:{},options:Array,props:Object,size:String,placeholder:{type:String,default:function(){return Object(Ji["t"])("el.cascader.placeholder")}},disabled:Boolean,clearable:Boolean,filterable:Boolean,filterMethod:Function,separator:{type:String,default:" / "},showAllLevels:{type:Boolean,default:!0},collapseTags:Boolean,debounce:{type:Number,default:300},beforeFilter:{type:Function,default:function(){return function(){}}},popperClass:String},data:function(){return{dropDownVisible:!1,checkedValue:this.value||null,inputHover:!1,inputValue:null,presentText:null,presentTags:[],checkedNodes:[],filtering:!1,suggestions:[],inputInitialHeight:0,pressDeleteCount:0}},computed:{realSize:function(){var e=(this.elFormItem||{}).elFormItemSize;return this.size||e||(this.$ELEMENT||{}).size},tagSize:function(){return["small","mini"].indexOf(this.realSize)>-1?"mini":"small"},isDisabled:function(){return this.disabled||(this.elForm||{}).disabled},config:function(){var e=this.props||{},t=this.$attrs;return Object.keys(xp).forEach(function(i){var n=xp[i],s=n.newProp,r=n.type,a=t[i]||t[Object(b["kebabCase"])(i)];Object(rn["isDef"])(i)&&!Object(rn["isDef"])(e[s])&&(r===Boolean&&""===a&&(a=!0),e[s]=a)}),e},multiple:function(){return this.config.multiple},leafOnly:function(){return!this.config.checkStrictly},readonly:function(){return!this.filterable||this.multiple},clearBtnVisible:function(){return!(!this.clearable||this.isDisabled||this.filtering||!this.inputHover)&&(this.multiple?!!this.checkedNodes.filter(function(e){return!e.isDisabled}).length:!!this.presentText)},panel:function(){return this.$refs.panel}},watch:{value:function(e){Object(b["isEqual"])(e,this.checkedValue)||(this.checkedValue=e,this.computePresentContent())},checkedValue:function(e){var t=this.value;Object(b["isEqual"])(e,t)&&!Object(dd["isUndefined"])(t)||(this.$emit("input",e),this.$emit("change",e),this.dispatch("ElFormItem","el.form.change",[e]),this.computePresentContent())},options:{handler:function(){this.$nextTick(this.computePresentContent)},deep:!0},presentText:function(e){this.inputValue=e},presentTags:function(e,t){this.multiple&&(e.length||t.length)&&this.$nextTick(this.updateStyle)},filtering:function(e){this.$nextTick(this.updatePopper)}},mounted:function(){var e=this,t=this.$refs.input;t&&t.$el&&(this.inputInitialHeight=t.$el.offsetHeight||wp[this.realSize]||40),Object(b["isEmpty"])(this.value)||this.computePresentContent(),this.filterHandler=L()(this.debounce,function(){var t=e.inputValue;if(t){var i=e.beforeFilter(t);i&&i.then?i.then(e.getSuggestions):!1!==i?e.getSuggestions():e.filtering=!1}else e.filtering=!1}),Object(Zi["addResizeListener"])(this.$el,this.updateStyle)},beforeDestroy:function(){Object(Zi["removeResizeListener"])(this.$el,this.updateStyle)},methods:{getMigratingConfig:function(){return{props:{"expand-trigger":"expand-trigger is removed, use `props.expandTrigger` instead.","change-on-select":"change-on-select is removed, use `props.checkStrictly` instead.","hover-threshold":"hover-threshold is removed, use `props.hoverThreshold` instead"},events:{"active-item-change":"active-item-change is renamed to expand-change"}}},toggleDropDownVisible:function(e){var t=this;if(!this.isDisabled){var i=this.dropDownVisible,n=this.$refs.input;e=Object(rn["isDef"])(e)?e:!i,e!==i&&(this.dropDownVisible=e,e&&this.$nextTick(function(){t.updatePopper(),t.panel.scrollIntoView()}),n.$refs.input.setAttribute("aria-expanded",e),this.$emit("visible-change",e))}},handleDropdownLeave:function(){this.filtering=!1,this.inputValue=this.presentText},handleKeyDown:function(e){switch(e.keyCode){case _p.enter:this.toggleDropDownVisible();break;case _p.down:this.toggleDropDownVisible(!0),this.focusFirstNode(),e.preventDefault();break;case _p.esc:case _p.tab:this.toggleDropDownVisible(!1);break}},handleFocus:function(e){this.$emit("focus",e)},handleBlur:function(e){this.$emit("blur",e)},handleInput:function(e,t){!this.dropDownVisible&&this.toggleDropDownVisible(!0),t&&t.isComposing||(e?this.filterHandler():this.filtering=!1)},handleClear:function(){this.presentText="",this.panel.clearCheckedNodes()},handleExpandChange:function(e){this.$nextTick(this.updatePopper.bind(this)),this.$emit("expand-change",e),this.$emit("active-item-change",e)},focusFirstNode:function(){var e=this;this.$nextTick(function(){var t=e.filtering,i=e.$refs,n=i.popper,s=i.suggestionPanel,r=null;if(t&&s)r=s.$el.querySelector(".el-cascader__suggestion-item");else{var a=n.querySelector(".el-cascader-menu");r=a.querySelector('.el-cascader-node[tabindex="-1"]')}r&&(r.focus(),!t&&r.click())})},computePresentContent:function(){var e=this;this.$nextTick(function(){var t=e.config,i=t.multiple,n=t.checkStrictly;i?(e.computePresentTags(),e.presentText=e.presentTags.length?" ":null):(e.computePresentText(),!n&&e.dropDownVisible&&e.toggleDropDownVisible(!1))})},computePresentText:function(){var e=this.checkedValue,t=this.config;if(!Object(b["isEmpty"])(e)){var i=this.panel.getNodeByValue(e);if(i&&(t.checkStrictly||i.isLeaf))return void(this.presentText=i.getText(this.showAllLevels,this.separator))}this.presentText=null},computePresentTags:function(){var e=this.isDisabled,t=this.leafOnly,i=this.showAllLevels,n=this.separator,s=this.collapseTags,r=this.getCheckedNodes(t),a=[],o=function(t){return{node:t,key:t.uid,text:t.getText(i,n),hitState:!1,closable:!e&&!t.isDisabled}};if(r.length){var l=r[0],c=r.slice(1),u=c.length;a.push(o(l)),u&&(s?a.push({key:-1,text:"+ "+u,closable:!1}):c.forEach(function(e){return a.push(o(e))}))}this.checkedNodes=r,this.presentTags=a},getSuggestions:function(){var e=this,t=this.filterMethod;Object(dd["isFunction"])(t)||(t=function(e,t){return e.text.includes(t)});var i=this.panel.getFlattedNodes(this.leafOnly).filter(function(i){return!i.isDisabled&&(i.text=i.getText(e.showAllLevels,e.separator)||"",t(i,e.inputValue))});this.multiple?this.presentTags.forEach(function(e){e.hitState=!1}):i.forEach(function(t){t.checked=Object(b["isEqual"])(e.checkedValue,t.getValueByOption())}),this.filtering=!0,this.suggestions=i,this.$nextTick(this.updatePopper)},handleSuggestionKeyDown:function(e){var t=e.keyCode,i=e.target;switch(t){case _p.enter:i.click();break;case _p.up:var n=i.previousElementSibling;n&&n.focus();break;case _p.down:var s=i.nextElementSibling;s&&s.focus();break;case _p.esc:case _p.tab:this.toggleDropDownVisible(!1);break}},handleDelete:function(){var e=this.inputValue,t=this.pressDeleteCount,i=this.presentTags,n=i.length-1,s=i[n];this.pressDeleteCount=e?0:t+1,s&&this.pressDeleteCount&&(s.hitState?this.deleteTag(n):s.hitState=!0)},handleSuggestionClick:function(e){var t=this.multiple,i=this.suggestions[e];if(t){var n=i.checked;i.doCheck(!n),this.panel.calculateMultiCheckedValue()}else this.checkedValue=i.getValueByOption(),this.toggleDropDownVisible(!1)},deleteTag:function(e){var t=this.checkedValue,i=t[e];this.checkedValue=t.filter(function(t,i){return i!==e}),this.$emit("remove-tag",i)},updateStyle:function(){var e=this.$el,t=this.inputInitialHeight;if(!this.$isServer&&e){var i=this.$refs.suggestionPanel,n=e.querySelector(".el-input__inner");if(n){var s=e.querySelector(".el-cascader__tags"),r=null;if(i&&(r=i.$el)){var a=r.querySelector(".el-cascader__suggestion-list");a.style.minWidth=n.offsetWidth+"px"}if(s){var o=s.offsetHeight,l=Math.max(o+6,t)+"px";n.style.height=l,this.updatePopper()}}}},getCheckedNodes:function(e){return this.panel.getCheckedNodes(e)}}},Sp=kp,Dp=o(Sp,fp,mp,!1,null,null,null);Dp.options.__file="packages/cascader/src/cascader.vue";var $p=Dp.exports;$p.install=function(e){e.component($p.name,$p)};var Op=$p,Ep=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{directives:[{name:"clickoutside",rawName:"v-clickoutside",value:e.hide,expression:"hide"}],class:["el-color-picker",e.colorDisabled?"is-disabled":"",e.colorSize?"el-color-picker--"+e.colorSize:""]},[e.colorDisabled?i("div",{staticClass:"el-color-picker__mask"}):e._e(),i("div",{staticClass:"el-color-picker__trigger",on:{click:e.handleTrigger}},[i("span",{staticClass:"el-color-picker__color",class:{"is-alpha":e.showAlpha}},[i("span",{staticClass:"el-color-picker__color-inner",style:{backgroundColor:e.displayedColor}}),e.value||e.showPanelColor?e._e():i("span",{staticClass:"el-color-picker__empty el-icon-close"})]),i("span",{directives:[{name:"show",rawName:"v-show",value:e.value||e.showPanelColor,expression:"value || showPanelColor"}],staticClass:"el-color-picker__icon el-icon-arrow-down"})]),i("picker-dropdown",{ref:"dropdown",class:["el-color-picker__panel",e.popperClass||""],attrs:{color:e.color,"show-alpha":e.showAlpha,predefine:e.predefine},on:{pick:e.confirmValue,clear:e.clearValue},model:{value:e.showPicker,callback:function(t){e.showPicker=t},expression:"showPicker"}})],1)},Tp=[];Ep._withStripped=!0;var Pp="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"===typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function Mp(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var Ip=function(e,t,i){return[e,t*i/((e=(2-t)*i)<1?e:2-e)||0,e/2]},Np=function(e){return"string"===typeof e&&-1!==e.indexOf(".")&&1===parseFloat(e)},jp=function(e){return"string"===typeof e&&-1!==e.indexOf("%")},Fp=function(e,t){Np(e)&&(e="100%");var i=jp(e);return e=Math.min(t,Math.max(0,parseFloat(e))),i&&(e=parseInt(e*t,10)/100),Math.abs(e-t)<1e-6?1:e%t/parseFloat(t)},Lp={10:"A",11:"B",12:"C",13:"D",14:"E",15:"F"},Vp=function(e){var t=e.r,i=e.g,n=e.b,s=function(e){e=Math.min(Math.round(e),255);var t=Math.floor(e/16),i=e%16;return""+(Lp[t]||t)+(Lp[i]||i)};return isNaN(t)||isNaN(i)||isNaN(n)?"":"#"+s(t)+s(i)+s(n)},Ap={A:10,B:11,C:12,D:13,E:14,F:15},zp=function(e){return 2===e.length?16*(Ap[e[0].toUpperCase()]||+e[0])+(Ap[e[1].toUpperCase()]||+e[1]):Ap[e[1].toUpperCase()]||+e[1]},Bp=function(e,t,i){t/=100,i/=100;var n=t,s=Math.max(i,.01),r=void 0,a=void 0;return i*=2,t*=i<=1?i:2-i,n*=s<=1?s:2-s,a=(i+t)/2,r=0===i?2*n/(s+n):2*t/(i+t),{h:e,s:100*r,v:100*a}},Rp=function(e,t,i){e=Fp(e,255),t=Fp(t,255),i=Fp(i,255);var n=Math.max(e,t,i),s=Math.min(e,t,i),r=void 0,a=void 0,o=n,l=n-s;if(a=0===n?0:l/n,n===s)r=0;else{switch(n){case e:r=(t-i)/l+(t2?parseFloat(e):parseInt(e,10)});if(4===n.length?this._alpha=Math.floor(100*parseFloat(n[3])):3===n.length&&(this._alpha=100),n.length>=3){var s=Bp(n[0],n[1],n[2]),r=s.h,a=s.s,o=s.v;i(r,a,o)}}else if(-1!==e.indexOf("hsv")){var l=e.replace(/hsva|hsv|\(|\)/gm,"").split(/\s|,/g).filter(function(e){return""!==e}).map(function(e,t){return t>2?parseFloat(e):parseInt(e,10)});4===l.length?this._alpha=Math.floor(100*parseFloat(l[3])):3===l.length&&(this._alpha=100),l.length>=3&&i(l[0],l[1],l[2])}else if(-1!==e.indexOf("rgb")){var c=e.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(function(e){return""!==e}).map(function(e,t){return t>2?parseFloat(e):parseInt(e,10)});if(4===c.length?this._alpha=Math.floor(100*parseFloat(c[3])):3===c.length&&(this._alpha=100),c.length>=3){var u=Rp(c[0],c[1],c[2]),h=u.h,d=u.s,p=u.v;i(h,d,p)}}else if(-1!==e.indexOf("#")){var f=e.replace("#","").trim();if(!/^(?:[0-9a-fA-F]{3}){1,2}$/.test(f))return;var m=void 0,v=void 0,g=void 0;3===f.length?(m=zp(f[0]+f[0]),v=zp(f[1]+f[1]),g=zp(f[2]+f[2])):6!==f.length&&8!==f.length||(m=zp(f.substring(0,2)),v=zp(f.substring(2,4)),g=zp(f.substring(4,6))),8===f.length?this._alpha=Math.floor(zp(f.substring(6))/255*100):3!==f.length&&6!==f.length||(this._alpha=100);var b=Rp(m,v,g),y=b.h,_=b.s,x=b.v;i(y,_,x)}},e.prototype.compare=function(e){return Math.abs(e._hue-this._hue)<2&&Math.abs(e._saturation-this._saturation)<1&&Math.abs(e._value-this._value)<1&&Math.abs(e._alpha-this._alpha)<1},e.prototype.doOnChange=function(){var e=this._hue,t=this._saturation,i=this._value,n=this._alpha,s=this.format;if(this.enableAlpha)switch(s){case"hsl":var r=Ip(e,t/100,i/100);this.value="hsla("+e+", "+Math.round(100*r[1])+"%, "+Math.round(100*r[2])+"%, "+n/100+")";break;case"hsv":this.value="hsva("+e+", "+Math.round(t)+"%, "+Math.round(i)+"%, "+n/100+")";break;default:var a=Hp(e,t,i),o=a.r,l=a.g,c=a.b;this.value="rgba("+o+", "+l+", "+c+", "+n/100+")"}else switch(s){case"hsl":var u=Ip(e,t/100,i/100);this.value="hsl("+e+", "+Math.round(100*u[1])+"%, "+Math.round(100*u[2])+"%)";break;case"hsv":this.value="hsv("+e+", "+Math.round(t)+"%, "+Math.round(i)+"%)";break;case"rgb":var h=Hp(e,t,i),d=h.r,p=h.g,f=h.b;this.value="rgb("+d+", "+p+", "+f+")";break;default:this.value=Vp(Hp(e,t,i))}},e}(),qp=Wp,Yp=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("transition",{attrs:{name:"el-zoom-in-top"},on:{"after-leave":e.doDestroy}},[i("div",{directives:[{name:"show",rawName:"v-show",value:e.showPopper,expression:"showPopper"}],staticClass:"el-color-dropdown"},[i("div",{staticClass:"el-color-dropdown__main-wrapper"},[i("hue-slider",{ref:"hue",staticStyle:{float:"right"},attrs:{color:e.color,vertical:""}}),i("sv-panel",{ref:"sl",attrs:{color:e.color}})],1),e.showAlpha?i("alpha-slider",{ref:"alpha",attrs:{color:e.color}}):e._e(),e.predefine?i("predefine",{attrs:{color:e.color,colors:e.predefine}}):e._e(),i("div",{staticClass:"el-color-dropdown__btns"},[i("span",{staticClass:"el-color-dropdown__value"},[i("el-input",{attrs:{"validate-event":!1,size:"mini"},on:{blur:e.handleConfirm},nativeOn:{keyup:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.handleConfirm(t):null}},model:{value:e.customInput,callback:function(t){e.customInput=t},expression:"customInput"}})],1),i("el-button",{staticClass:"el-color-dropdown__link-btn",attrs:{size:"mini",type:"text"},on:{click:function(t){e.$emit("clear")}}},[e._v("\n "+e._s(e.t("el.colorpicker.clear"))+"\n ")]),i("el-button",{staticClass:"el-color-dropdown__btn",attrs:{plain:"",size:"mini"},on:{click:e.confirmValue}},[e._v("\n "+e._s(e.t("el.colorpicker.confirm"))+"\n ")])],1)],1)])},Kp=[];Yp._withStripped=!0;var Up=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-color-svpanel",style:{backgroundColor:e.background}},[i("div",{staticClass:"el-color-svpanel__white"}),i("div",{staticClass:"el-color-svpanel__black"}),i("div",{staticClass:"el-color-svpanel__cursor",style:{top:e.cursorTop+"px",left:e.cursorLeft+"px"}},[i("div")])])},Gp=[];Up._withStripped=!0;var Xp=!1,Qp=function(e,t){if(!Wn.a.prototype.$isServer){var i=function(e){t.drag&&t.drag(e)},n=function e(n){document.removeEventListener("mousemove",i),document.removeEventListener("mouseup",e),document.onselectstart=null,document.ondragstart=null,Xp=!1,t.end&&t.end(n)};e.addEventListener("mousedown",function(e){Xp||(document.onselectstart=function(){return!1},document.ondragstart=function(){return!1},document.addEventListener("mousemove",i),document.addEventListener("mouseup",n),Xp=!0,t.start&&t.start(e))})}},Zp={name:"el-sl-panel",props:{color:{required:!0}},computed:{colorValue:function(){var e=this.color.get("hue"),t=this.color.get("value");return{hue:e,value:t}}},watch:{colorValue:function(){this.update()}},methods:{update:function(){var e=this.color.get("saturation"),t=this.color.get("value"),i=this.$el,n=i.clientWidth,s=i.clientHeight;this.cursorLeft=e*n/100,this.cursorTop=(100-t)*s/100,this.background="hsl("+this.color.get("hue")+", 100%, 50%)"},handleDrag:function(e){var t=this.$el,i=t.getBoundingClientRect(),n=e.clientX-i.left,s=e.clientY-i.top;n=Math.max(0,n),n=Math.min(n,i.width),s=Math.max(0,s),s=Math.min(s,i.height),this.cursorLeft=n,this.cursorTop=s,this.color.set({saturation:n/i.width*100,value:100-s/i.height*100})}},mounted:function(){var e=this;Qp(this.$el,{drag:function(t){e.handleDrag(t)},end:function(t){e.handleDrag(t)}}),this.update()},data:function(){return{cursorTop:0,cursorLeft:0,background:"hsl(0, 100%, 50%)"}}},Jp=Zp,ef=o(Jp,Up,Gp,!1,null,null,null);ef.options.__file="packages/color-picker/src/components/sv-panel.vue";var tf=ef.exports,nf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-color-hue-slider",class:{"is-vertical":e.vertical}},[i("div",{ref:"bar",staticClass:"el-color-hue-slider__bar",on:{click:e.handleClick}}),i("div",{ref:"thumb",staticClass:"el-color-hue-slider__thumb",style:{left:e.thumbLeft+"px",top:e.thumbTop+"px"}})])},sf=[];nf._withStripped=!0;var rf={name:"el-color-hue-slider",props:{color:{required:!0},vertical:Boolean},data:function(){return{thumbLeft:0,thumbTop:0}},computed:{hueValue:function(){var e=this.color.get("hue");return e}},watch:{hueValue:function(){this.update()}},methods:{handleClick:function(e){var t=this.$refs.thumb,i=e.target;i!==t&&this.handleDrag(e)},handleDrag:function(e){var t=this.$el.getBoundingClientRect(),i=this.$refs.thumb,n=void 0;if(this.vertical){var s=e.clientY-t.top;s=Math.min(s,t.height-i.offsetHeight/2),s=Math.max(i.offsetHeight/2,s),n=Math.round((s-i.offsetHeight/2)/(t.height-i.offsetHeight)*360)}else{var r=e.clientX-t.left;r=Math.min(r,t.width-i.offsetWidth/2),r=Math.max(i.offsetWidth/2,r),n=Math.round((r-i.offsetWidth/2)/(t.width-i.offsetWidth)*360)}this.color.set("hue",n)},getThumbLeft:function(){if(this.vertical)return 0;var e=this.$el,t=this.color.get("hue");if(!e)return 0;var i=this.$refs.thumb;return Math.round(t*(e.offsetWidth-i.offsetWidth/2)/360)},getThumbTop:function(){if(!this.vertical)return 0;var e=this.$el,t=this.color.get("hue");if(!e)return 0;var i=this.$refs.thumb;return Math.round(t*(e.offsetHeight-i.offsetHeight/2)/360)},update:function(){this.thumbLeft=this.getThumbLeft(),this.thumbTop=this.getThumbTop()}},mounted:function(){var e=this,t=this.$refs,i=t.bar,n=t.thumb,s={drag:function(t){e.handleDrag(t)},end:function(t){e.handleDrag(t)}};Qp(i,s),Qp(n,s),this.update()}},af=rf,of=o(af,nf,sf,!1,null,null,null);of.options.__file="packages/color-picker/src/components/hue-slider.vue";var lf=of.exports,cf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-color-alpha-slider",class:{"is-vertical":e.vertical}},[i("div",{ref:"bar",staticClass:"el-color-alpha-slider__bar",style:{background:e.background},on:{click:e.handleClick}}),i("div",{ref:"thumb",staticClass:"el-color-alpha-slider__thumb",style:{left:e.thumbLeft+"px",top:e.thumbTop+"px"}})])},uf=[];cf._withStripped=!0;var hf={name:"el-color-alpha-slider",props:{color:{required:!0},vertical:Boolean},watch:{"color._alpha":function(){this.update()},"color.value":function(){this.update()}},methods:{handleClick:function(e){var t=this.$refs.thumb,i=e.target;i!==t&&this.handleDrag(e)},handleDrag:function(e){var t=this.$el.getBoundingClientRect(),i=this.$refs.thumb;if(this.vertical){var n=e.clientY-t.top;n=Math.max(i.offsetHeight/2,n),n=Math.min(n,t.height-i.offsetHeight/2),this.color.set("alpha",Math.round((n-i.offsetHeight/2)/(t.height-i.offsetHeight)*100))}else{var s=e.clientX-t.left;s=Math.max(i.offsetWidth/2,s),s=Math.min(s,t.width-i.offsetWidth/2),this.color.set("alpha",Math.round((s-i.offsetWidth/2)/(t.width-i.offsetWidth)*100))}},getThumbLeft:function(){if(this.vertical)return 0;var e=this.$el,t=this.color._alpha;if(!e)return 0;var i=this.$refs.thumb;return Math.round(t*(e.offsetWidth-i.offsetWidth/2)/100)},getThumbTop:function(){if(!this.vertical)return 0;var e=this.$el,t=this.color._alpha;if(!e)return 0;var i=this.$refs.thumb;return Math.round(t*(e.offsetHeight-i.offsetHeight/2)/100)},getBackground:function(){if(this.color&&this.color.value){var e=this.color.toRgb(),t=e.r,i=e.g,n=e.b;return"linear-gradient(to right, rgba("+t+", "+i+", "+n+", 0) 0%, rgba("+t+", "+i+", "+n+", 1) 100%)"}return null},update:function(){this.thumbLeft=this.getThumbLeft(),this.thumbTop=this.getThumbTop(),this.background=this.getBackground()}},data:function(){return{thumbLeft:0,thumbTop:0,background:null}},mounted:function(){var e=this,t=this.$refs,i=t.bar,n=t.thumb,s={drag:function(t){e.handleDrag(t)},end:function(t){e.handleDrag(t)}};Qp(i,s),Qp(n,s),this.update()}},df=hf,pf=o(df,cf,uf,!1,null,null,null);pf.options.__file="packages/color-picker/src/components/alpha-slider.vue";var ff=pf.exports,mf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-color-predefine"},[i("div",{staticClass:"el-color-predefine__colors"},e._l(e.rgbaColors,function(t,n){return i("div",{key:e.colors[n],staticClass:"el-color-predefine__color-selector",class:{selected:t.selected,"is-alpha":t._alpha<100},on:{click:function(t){e.handleSelect(n)}}},[i("div",{style:{"background-color":t.value}})])}),0)])},vf=[];mf._withStripped=!0;var gf={props:{colors:{type:Array,required:!0},color:{required:!0}},data:function(){return{rgbaColors:this.parseColors(this.colors,this.color)}},methods:{handleSelect:function(e){this.color.fromString(this.colors[e])},parseColors:function(e,t){return e.map(function(e){var i=new qp;return i.enableAlpha=!0,i.format="rgba",i.fromString(e),i.selected=i.value===t.value,i})}},watch:{"$parent.currentColor":function(e){var t=new qp;t.fromString(e),this.rgbaColors.forEach(function(e){e.selected=t.compare(e)})},colors:function(e){this.rgbaColors=this.parseColors(e,this.color)},color:function(e){this.rgbaColors=this.parseColors(this.colors,e)}}},bf=gf,yf=o(bf,mf,vf,!1,null,null,null);yf.options.__file="packages/color-picker/src/components/predefine.vue";var _f=yf.exports,xf={name:"el-color-picker-dropdown",mixins:[H.a,g.a],components:{SvPanel:tf,HueSlider:lf,AlphaSlider:ff,ElInput:m.a,ElButton:ae.a,Predefine:_f},props:{color:{required:!0},showAlpha:Boolean,predefine:Array},data:function(){return{customInput:""}},computed:{currentColor:function(){var e=this.$parent;return e.value||e.showPanelColor?e.color.value:""}},methods:{confirmValue:function(){this.$emit("pick")},handleConfirm:function(){this.color.fromString(this.customInput)}},mounted:function(){this.$parent.popperElm=this.popperElm=this.$el,this.referenceElm=this.$parent.$el},watch:{showPopper:function(e){var t=this;!0===e&&this.$nextTick(function(){var e=t.$refs,i=e.sl,n=e.hue,s=e.alpha;i&&i.update(),n&&n.update(),s&&s.update()})},currentColor:{immediate:!0,handler:function(e){this.customInput=e}}}},Cf=xf,wf=o(Cf,Yp,Kp,!1,null,null,null);wf.options.__file="packages/color-picker/src/components/picker-dropdown.vue";var kf=wf.exports,Sf={name:"ElColorPicker",mixins:[O.a],props:{value:String,showAlpha:Boolean,colorFormat:String,disabled:Boolean,size:String,popperClass:String,predefine:Array},inject:{elForm:{default:""},elFormItem:{default:""}},directives:{Clickoutside:A.a},computed:{displayedColor:function(){return this.value||this.showPanelColor?this.displayedRgb(this.color,this.showAlpha):"transparent"},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},colorSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},colorDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},watch:{value:function(e){e?e&&e!==this.color.value&&this.color.fromString(e):this.showPanelColor=!1},color:{deep:!0,handler:function(){this.showPanelColor=!0}},displayedColor:function(e){if(this.showPicker){var t=new qp({enableAlpha:this.showAlpha,format:this.colorFormat});t.fromString(this.value);var i=this.displayedRgb(t,this.showAlpha);e!==i&&this.$emit("active-change",e)}}},methods:{handleTrigger:function(){this.colorDisabled||(this.showPicker=!this.showPicker)},confirmValue:function(){var e=this.color.value;this.$emit("input",e),this.$emit("change",e),this.dispatch("ElFormItem","el.form.change",e),this.showPicker=!1},clearValue:function(){this.$emit("input",null),this.$emit("change",null),null!==this.value&&this.dispatch("ElFormItem","el.form.change",null),this.showPanelColor=!1,this.showPicker=!1,this.resetColor()},hide:function(){this.showPicker=!1,this.resetColor()},resetColor:function(){var e=this;this.$nextTick(function(t){e.value?e.color.fromString(e.value):e.showPanelColor=!1})},displayedRgb:function(e,t){if(!(e instanceof qp))throw Error("color should be instance of Color Class");var i=e.toRgb(),n=i.r,s=i.g,r=i.b;return t?"rgba("+n+", "+s+", "+r+", "+e.get("alpha")/100+")":"rgb("+n+", "+s+", "+r+")"}},mounted:function(){var e=this.value;e&&this.color.fromString(e),this.popperElm=this.$refs.dropdown.$el},data:function(){var e=new qp({enableAlpha:this.showAlpha,format:this.colorFormat});return{color:e,showPicker:!1,showPanelColor:!1}},components:{PickerDropdown:kf}},Df=Sf,$f=o(Df,Ep,Tp,!1,null,null,null);$f.options.__file="packages/color-picker/src/main.vue";var Of=$f.exports;Of.install=function(e){e.component(Of.name,Of)};var Ef=Of,Tf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-transfer"},[i("transfer-panel",e._b({ref:"leftPanel",attrs:{data:e.sourceData,title:e.titles[0]||e.t("el.transfer.titles.0"),"default-checked":e.leftDefaultChecked,placeholder:e.filterPlaceholder||e.t("el.transfer.filterPlaceholder")},on:{"checked-change":e.onSourceCheckedChange}},"transfer-panel",e.$props,!1),[e._t("left-footer")],2),i("div",{staticClass:"el-transfer__buttons"},[i("el-button",{class:["el-transfer__button",e.hasButtonTexts?"is-with-texts":""],attrs:{type:"primary",disabled:0===e.rightChecked.length},nativeOn:{click:function(t){return e.addToLeft(t)}}},[i("i",{staticClass:"el-icon-arrow-left"}),void 0!==e.buttonTexts[0]?i("span",[e._v(e._s(e.buttonTexts[0]))]):e._e()]),i("el-button",{class:["el-transfer__button",e.hasButtonTexts?"is-with-texts":""],attrs:{type:"primary",disabled:0===e.leftChecked.length},nativeOn:{click:function(t){return e.addToRight(t)}}},[void 0!==e.buttonTexts[1]?i("span",[e._v(e._s(e.buttonTexts[1]))]):e._e(),i("i",{staticClass:"el-icon-arrow-right"})])],1),i("transfer-panel",e._b({ref:"rightPanel",attrs:{data:e.targetData,title:e.titles[1]||e.t("el.transfer.titles.1"),"default-checked":e.rightDefaultChecked,placeholder:e.filterPlaceholder||e.t("el.transfer.filterPlaceholder")},on:{"checked-change":e.onTargetCheckedChange}},"transfer-panel",e.$props,!1),[e._t("right-footer")],2)],1)},Pf=[];Tf._withStripped=!0;var Mf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-transfer-panel"},[i("p",{staticClass:"el-transfer-panel__header"},[i("el-checkbox",{attrs:{indeterminate:e.isIndeterminate},on:{change:e.handleAllCheckedChange},model:{value:e.allChecked,callback:function(t){e.allChecked=t},expression:"allChecked"}},[e._v("\n "+e._s(e.title)+"\n "),i("span",[e._v(e._s(e.checkedSummary))])])],1),i("div",{class:["el-transfer-panel__body",e.hasFooter?"is-with-footer":""]},[e.filterable?i("el-input",{staticClass:"el-transfer-panel__filter",attrs:{size:"small",placeholder:e.placeholder},nativeOn:{mouseenter:function(t){e.inputHover=!0},mouseleave:function(t){e.inputHover=!1}},model:{value:e.query,callback:function(t){e.query=t},expression:"query"}},[i("i",{class:["el-input__icon","el-icon-"+e.inputIcon],attrs:{slot:"prefix"},on:{click:e.clearQuery},slot:"prefix"})]):e._e(),i("el-checkbox-group",{directives:[{name:"show",rawName:"v-show",value:!e.hasNoMatch&&e.data.length>0,expression:"!hasNoMatch && data.length > 0"}],staticClass:"el-transfer-panel__list",class:{"is-filterable":e.filterable},model:{value:e.checked,callback:function(t){e.checked=t},expression:"checked"}},e._l(e.filteredData,function(t){return i("el-checkbox",{key:t[e.keyProp],staticClass:"el-transfer-panel__item",attrs:{label:t[e.keyProp],disabled:t[e.disabledProp]}},[i("option-content",{attrs:{option:t}})],1)}),1),i("p",{directives:[{name:"show",rawName:"v-show",value:e.hasNoMatch,expression:"hasNoMatch"}],staticClass:"el-transfer-panel__empty"},[e._v(e._s(e.t("el.transfer.noMatch")))]),i("p",{directives:[{name:"show",rawName:"v-show",value:0===e.data.length&&!e.hasNoMatch,expression:"data.length === 0 && !hasNoMatch"}],staticClass:"el-transfer-panel__empty"},[e._v(e._s(e.t("el.transfer.noData")))])],1),e.hasFooter?i("p",{staticClass:"el-transfer-panel__footer"},[e._t("default")],2):e._e()])},If=[];Mf._withStripped=!0;var Nf={mixins:[g.a],name:"ElTransferPanel",componentName:"ElTransferPanel",components:{ElCheckboxGroup:Ms.a,ElCheckbox:Fn.a,ElInput:m.a,OptionContent:{props:{option:Object},render:function(e){var t=function e(t){return"ElTransferPanel"===t.$options.componentName?t:t.$parent?e(t.$parent):t},i=t(this),n=i.$parent||i;return i.renderContent?i.renderContent(e,this.option):n.$scopedSlots.default?n.$scopedSlots.default({option:this.option}):e("span",[this.option[i.labelProp]||this.option[i.keyProp]])}}},props:{data:{type:Array,default:function(){return[]}},renderContent:Function,placeholder:String,title:String,filterable:Boolean,format:Object,filterMethod:Function,defaultChecked:Array,props:Object},data:function(){return{checked:[],allChecked:!1,query:"",inputHover:!1,checkChangeByUser:!0}},watch:{checked:function(e,t){if(this.updateAllChecked(),this.checkChangeByUser){var i=e.concat(t).filter(function(i){return-1===e.indexOf(i)||-1===t.indexOf(i)});this.$emit("checked-change",e,i)}else this.$emit("checked-change",e),this.checkChangeByUser=!0},data:function(){var e=this,t=[],i=this.filteredData.map(function(t){return t[e.keyProp]});this.checked.forEach(function(e){i.indexOf(e)>-1&&t.push(e)}),this.checkChangeByUser=!1,this.checked=t},checkableData:function(){this.updateAllChecked()},defaultChecked:{immediate:!0,handler:function(e,t){var i=this;if(!t||e.length!==t.length||!e.every(function(e){return t.indexOf(e)>-1})){var n=[],s=this.checkableData.map(function(e){return e[i.keyProp]});e.forEach(function(e){s.indexOf(e)>-1&&n.push(e)}),this.checkChangeByUser=!1,this.checked=n}}}},computed:{filteredData:function(){var e=this;return this.data.filter(function(t){if("function"===typeof e.filterMethod)return e.filterMethod(e.query,t);var i=t[e.labelProp]||t[e.keyProp].toString();return i.toLowerCase().indexOf(e.query.toLowerCase())>-1})},checkableData:function(){var e=this;return this.filteredData.filter(function(t){return!t[e.disabledProp]})},checkedSummary:function(){var e=this.checked.length,t=this.data.length,i=this.format,n=i.noChecked,s=i.hasChecked;return n&&s?e>0?s.replace(/\${checked}/g,e).replace(/\${total}/g,t):n.replace(/\${total}/g,t):e+"/"+t},isIndeterminate:function(){var e=this.checked.length;return e>0&&e0&&0===this.filteredData.length},inputIcon:function(){return this.query.length>0&&this.inputHover?"circle-close":"search"},labelProp:function(){return this.props.label||"label"},keyProp:function(){return this.props.key||"key"},disabledProp:function(){return this.props.disabled||"disabled"},hasFooter:function(){return!!this.$slots.default}},methods:{updateAllChecked:function(){var e=this,t=this.checkableData.map(function(t){return t[e.keyProp]});this.allChecked=t.length>0&&t.every(function(t){return e.checked.indexOf(t)>-1})},handleAllCheckedChange:function(e){var t=this;this.checked=e?this.checkableData.map(function(e){return e[t.keyProp]}):[]},clearQuery:function(){"circle-close"===this.inputIcon&&(this.query="")}}},jf=Nf,Ff=o(jf,Mf,If,!1,null,null,null);Ff.options.__file="packages/transfer/src/transfer-panel.vue";var Lf=Ff.exports,Vf={name:"ElTransfer",mixins:[O.a,g.a,D.a],components:{TransferPanel:Lf,ElButton:ae.a},props:{data:{type:Array,default:function(){return[]}},titles:{type:Array,default:function(){return[]}},buttonTexts:{type:Array,default:function(){return[]}},filterPlaceholder:{type:String,default:""},filterMethod:Function,leftDefaultChecked:{type:Array,default:function(){return[]}},rightDefaultChecked:{type:Array,default:function(){return[]}},renderContent:Function,value:{type:Array,default:function(){return[]}},format:{type:Object,default:function(){return{}}},filterable:Boolean,props:{type:Object,default:function(){return{label:"label",key:"key",disabled:"disabled"}}},targetOrder:{type:String,default:"original"}},data:function(){return{leftChecked:[],rightChecked:[]}},computed:{dataObj:function(){var e=this.props.key;return this.data.reduce(function(t,i){return(t[i[e]]=i)&&t},{})},sourceData:function(){var e=this;return this.data.filter(function(t){return-1===e.value.indexOf(t[e.props.key])})},targetData:function(){var e=this;return"original"===this.targetOrder?this.data.filter(function(t){return e.value.indexOf(t[e.props.key])>-1}):this.value.reduce(function(t,i){var n=e.dataObj[i];return n&&t.push(n),t},[])},hasButtonTexts:function(){return 2===this.buttonTexts.length}},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",e)}},methods:{getMigratingConfig:function(){return{props:{"footer-format":"footer-format is renamed to format."}}},onSourceCheckedChange:function(e,t){this.leftChecked=e,void 0!==t&&this.$emit("left-check-change",e,t)},onTargetCheckedChange:function(e,t){this.rightChecked=e,void 0!==t&&this.$emit("right-check-change",e,t)},addToLeft:function(){var e=this.value.slice();this.rightChecked.forEach(function(t){var i=e.indexOf(t);i>-1&&e.splice(i,1)}),this.$emit("input",e),this.$emit("change",e,"left",this.rightChecked)},addToRight:function(){var e=this,t=this.value.slice(),i=[],n=this.props.key;this.data.forEach(function(t){var s=t[n];e.leftChecked.indexOf(s)>-1&&-1===e.value.indexOf(s)&&i.push(s)}),t="unshift"===this.targetOrder?i.concat(t):t.concat(i),this.$emit("input",t),this.$emit("change",t,"right",this.leftChecked)},clearQuery:function(e){"left"===e?this.$refs.leftPanel.query="":"right"===e&&(this.$refs.rightPanel.query="")}}},Af=Vf,zf=o(Af,Tf,Pf,!1,null,null,null);zf.options.__file="packages/transfer/src/main.vue";var Bf=zf.exports;Bf.install=function(e){e.component(Bf.name,Bf)};var Rf=Bf,Hf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("section",{staticClass:"el-container",class:{"is-vertical":e.isVertical}},[e._t("default")],2)},Wf=[];Hf._withStripped=!0;var qf={name:"ElContainer",componentName:"ElContainer",props:{direction:String},computed:{isVertical:function(){return"vertical"===this.direction||"horizontal"!==this.direction&&(!(!this.$slots||!this.$slots.default)&&this.$slots.default.some(function(e){var t=e.componentOptions&&e.componentOptions.tag;return"el-header"===t||"el-footer"===t}))}}},Yf=qf,Kf=o(Yf,Hf,Wf,!1,null,null,null);Kf.options.__file="packages/container/src/main.vue";var Uf=Kf.exports;Uf.install=function(e){e.component(Uf.name,Uf)};var Gf=Uf,Xf=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("header",{staticClass:"el-header",style:{height:e.height}},[e._t("default")],2)},Qf=[];Xf._withStripped=!0;var Zf={name:"ElHeader",componentName:"ElHeader",props:{height:{type:String,default:"60px"}}},Jf=Zf,em=o(Jf,Xf,Qf,!1,null,null,null);em.options.__file="packages/header/src/main.vue";var tm=em.exports;tm.install=function(e){e.component(tm.name,tm)};var im=tm,nm=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("aside",{staticClass:"el-aside",style:{width:e.width}},[e._t("default")],2)},sm=[];nm._withStripped=!0;var rm={name:"ElAside",componentName:"ElAside",props:{width:{type:String,default:"300px"}}},am=rm,om=o(am,nm,sm,!1,null,null,null);om.options.__file="packages/aside/src/main.vue";var lm=om.exports;lm.install=function(e){e.component(lm.name,lm)};var cm=lm,um=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("main",{staticClass:"el-main"},[e._t("default")],2)},hm=[];um._withStripped=!0;var dm={name:"ElMain",componentName:"ElMain"},pm=dm,fm=o(pm,um,hm,!1,null,null,null);fm.options.__file="packages/main/src/main.vue";var mm=fm.exports;mm.install=function(e){e.component(mm.name,mm)};var vm=mm,gm=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("footer",{staticClass:"el-footer",style:{height:e.height}},[e._t("default")],2)},bm=[];gm._withStripped=!0;var ym={name:"ElFooter",componentName:"ElFooter",props:{height:{type:String,default:"60px"}}},_m=ym,xm=o(_m,gm,bm,!1,null,null,null);xm.options.__file="packages/footer/src/main.vue";var Cm=xm.exports;Cm.install=function(e){e.component(Cm.name,Cm)};var wm=Cm,km=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("ul",{staticClass:"el-timeline",class:{"is-reverse":e.reverse}},[e._t("default")],2)},Sm=[];km._withStripped=!0;var Dm={name:"ElTimeline",props:{reverse:{type:Boolean,default:!1}},provide:function(){return{timeline:this}},watch:{reverse:{handler:function(e){e&&(this.$slots.default=[].concat(this.$slots.default).reverse())},immediate:!0}}},$m=Dm,Om=o($m,km,Sm,!1,null,null,null);Om.options.__file="packages/timeline/src/main.vue";var Em=Om.exports;Em.install=function(e){e.component(Em.name,Em)};var Tm=Em,Pm=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("li",{staticClass:"el-timeline-item"},[i("div",{staticClass:"el-timeline-item__tail"}),e.$slots.dot?e._e():i("div",{staticClass:"el-timeline-item__node",class:["el-timeline-item__node--"+(e.size||""),"el-timeline-item__node--"+(e.type||"")],style:{backgroundColor:e.color}},[e.icon?i("i",{staticClass:"el-timeline-item__icon",class:e.icon}):e._e()]),e.$slots.dot?i("div",{staticClass:"el-timeline-item__dot"},[e._t("dot")],2):e._e(),i("div",{staticClass:"el-timeline-item__wrapper"},[e.hideTimestamp||"top"!==e.placement?e._e():i("div",{staticClass:"el-timeline-item__timestamp is-top"},[e._v("\n "+e._s(e.timestamp)+"\n ")]),i("div",{staticClass:"el-timeline-item__content"},[e._t("default")],2),e.hideTimestamp||"bottom"!==e.placement?e._e():i("div",{staticClass:"el-timeline-item__timestamp is-bottom"},[e._v("\n "+e._s(e.timestamp)+"\n ")])])])},Mm=[];Pm._withStripped=!0;var Im={name:"ElTimelineItem",inject:["timeline"],props:{timestamp:String,hideTimestamp:{type:Boolean,default:!1},placement:{type:String,default:"bottom"},type:String,color:String,size:{type:String,default:"normal"},icon:String}},Nm=Im,jm=o(Nm,Pm,Mm,!1,null,null,null);jm.options.__file="packages/timeline/src/item.vue";var Fm=jm.exports;Fm.install=function(e){e.component(Fm.name,Fm)};var Lm=Fm,Vm=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("a",e._b({class:["el-link",e.type?"el-link--"+e.type:"",e.disabled&&"is-disabled",e.underline&&!e.disabled&&"is-underline"],attrs:{href:e.disabled?null:e.href},on:{click:e.handleClick}},"a",e.$attrs,!1),[e.icon?i("i",{class:e.icon}):e._e(),e.$slots.default?i("span",{staticClass:"el-link--inner"},[e._t("default")],2):e._e(),e.$slots.icon?[e.$slots.icon?e._t("icon"):e._e()]:e._e()],2)},Am=[];Vm._withStripped=!0;var zm={name:"ElLink",props:{type:{type:String,default:"default"},underline:{type:Boolean,default:!0},disabled:Boolean,href:String,icon:String},methods:{handleClick:function(e){this.disabled||this.href||this.$emit("click",e)}}},Bm=zm,Rm=o(Bm,Vm,Am,!1,null,null,null);Rm.options.__file="packages/link/src/main.vue";var Hm=Rm.exports;Hm.install=function(e){e.component(Hm.name,Hm)};var Wm=Hm,qm={functional:!0,name:"ElDivider",props:{direction:{type:String,default:"horizontal",validator:function(e){return-1!==["horizontal","vertical"].indexOf(e)}},contentPosition:{type:String,default:"center",validator:function(e){return-1!==["left","center","right"].indexOf(e)}}},render:function(e,t){var i=t.slots(),n=t.props,s=n.direction,r=n.contentPosition;return e("div",{class:["el-divider","el-divider--"+s]},[i.default&&"vertical"!==s?e("div",{class:["el-divider__text","is-"+r]},[i.default]):null])},install:function(e){e.component(qm.name,qm)}},Ym=qm,Km=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-image"},[e.loading?e._t("placeholder",[i("div",{staticClass:"el-image__placeholder"})]):e.error?e._t("error",[i("div",{staticClass:"el-image__error"},[e._v(e._s(e.t("el.image.error")))])]):i("img",e._g(e._b({staticClass:"el-image__inner",class:{"el-image__inner--center":e.alignCenter},style:e.imageStyle,attrs:{src:e.src}},"img",e.$attrs,!1),e.$listeners))],2)},Um=[];Km._withStripped=!0;var Gm=function(){return void 0!==document.documentElement.style.objectFit},Xm={NONE:"none",CONTAIN:"contain",COVER:"cover",FILL:"fill",SCALE_DOWN:"scale-down"},Qm={name:"ElImage",mixins:[g.a],inheritAttrs:!1,props:{src:String,fit:String,lazy:Boolean,scrollContainer:{}},data:function(){return{loading:!0,error:!1,show:!this.lazy,imageWidth:0,imageHeight:0}},computed:{imageStyle:function(){var e=this.fit;return!this.$isServer&&e?Gm()?{"object-fit":e}:this.getImageStyle(e):{}},alignCenter:function(){return!this.$isServer&&!Gm()&&this.fit!==Xm.FILL}},watch:{src:function(e){this.show&&this.loadImage()},show:function(e){e&&this.loadImage()}},mounted:function(){this.lazy?this.addLazyLoadListener():this.loadImage()},beforeDestroy:function(){this.lazy&&this.removeLazyLoadListener()},methods:{loadImage:function(){var e=this;if(!this.$isServer){this.loading=!0,this.error=!1;var t=new Image;t.onload=function(i){return e.handleLoad(i,t)},t.onerror=this.handleError.bind(this),Object.keys(this.$attrs).forEach(function(i){var n=e.$attrs[i];t.setAttribute(i,n)}),t.src=this.src}},handleLoad:function(e,t){this.imageWidth=t.width,this.imageHeight=t.height,this.loading=!1},handleError:function(e){this.loading=!1,this.error=!0,this.$emit("error",e)},handleLazyLoad:function(){Object(Ve["isInContainer"])(this.$el,this._scrollContainer)&&(this.show=!0,this.removeLazyLoadListener())},addLazyLoadListener:function(){if(!this.$isServer){var e=this.scrollContainer,t=null;t=Object(dd["isHtmlElement"])(e)?e:Object(dd["isString"])(e)?document.querySelector(e):Object(Ve["getScrollContainer"])(this.$el),t&&(this._scrollContainer=t,this._lazyLoadHandler=jd()(200,this.handleLazyLoad),Object(Ve["on"])(t,"scroll",this._lazyLoadHandler),this.handleLazyLoad())}},removeLazyLoadListener:function(){var e=this._scrollContainer,t=this._lazyLoadHandler;!this.$isServer&&e&&t&&(Object(Ve["off"])(e,"scroll",t),this._scrollContainer=null,this._lazyLoadHandler=null)},getImageStyle:function(e){var t=this.imageWidth,i=this.imageHeight,n=this.$el,s=n.clientWidth,r=n.clientHeight;if(!t||!i||!s||!r)return{};var a=t/i<1;if(e===Xm.SCALE_DOWN){var o=tr)return console.warn("[ElementCalendar]end time should be greater than start time"),[];if(Object(ar["validateRangeInOneMonth"])(s,r))return[[s,r]];var a=[],o=new Date(s.getFullYear(),s.getMonth()+1,1),l=this.toDate(o.getTime()-pv);if(!Object(ar["validateRangeInOneMonth"])(o,r))return console.warn("[ElementCalendar]start time and end time interval must not exceed two months"),[];a.push([s,l]);var c=o.getDay();return c=c<=1?Math.abs(c-1):8-c,o=this.toDate(o.getTime()+c*pv),o.getDate()=this.visibilityHeight},handleClick:function(e){this.scrollToTop(),this.$emit("click",e)},scrollToTop:function(){var e=this.el,t=0,i=setInterval(function(){e.scrollTop<=0?clearInterval(i):(t+=10,e.scrollTop-=t)},20)}},beforeDestroy:function(){this.container.removeEventListener("scroll",this.throttledScrollHandler)}},Cv=xv,wv=o(Cv,yv,_v,!1,null,null,null);wv.options.__file="packages/backtop/src/main.vue";var kv=wv.exports;kv.install=function(e){e.component(kv.name,kv)};var Sv=kv,Dv=function(e,t){if(e===window&&(e=document.documentElement),1!==e.nodeType)return[];var i=window.getComputedStyle(e,null);return t?i[t]:i},$v=function(e){return Object.keys(e||{}).map(function(t){return[t,e[t]]})},Ov=function(e,t){return e===window||e===document?document.documentElement[t]:e[t]},Ev=function(e){return Ov(e,"offsetHeight")},Tv=function(e){return Ov(e,"clientHeight")},Pv="ElInfiniteScroll",Mv={delay:{type:Number,default:200},distance:{type:Number,default:0},disabled:{type:Boolean,default:!1},immediate:{type:Boolean,default:!0}},Iv=function(e,t){return Object(dd["isHtmlElement"])(e)?$v(Mv).reduce(function(i,n){var s=n[0],r=n[1],a=r.type,o=r.default,l=e.getAttribute("infinite-scroll-"+s);switch(l=Object(dd["isUndefined"])(t[l])?l:t[l],a){case Number:l=Number(l),l=Number.isNaN(l)?o:l;break;case Boolean:l=Object(dd["isDefined"])(l)?"false"!==l&&Boolean(l):o;break;default:l=a(l)}return i[s]=l,i},{}):{}},Nv=function(e){return e.getBoundingClientRect().top},jv=function(e){var t=this[Pv],i=t.el,n=t.vm,s=t.container,r=t.observer,a=Iv(i,n),o=a.distance,l=a.disabled;if(!l){var c=!1;if(s===i){var u=s.scrollTop+Tv(s);c=s.scrollHeight-u<=o}else{var h=Ev(i)+Nv(i)-Nv(s),d=Ev(s),p=Number.parseFloat(Dv(s,"borderBottomWidth"));c=h-d+p<=o}c&&Object(dd["isFunction"])(e)?e.call(n):r&&(r.disconnect(),this[Pv].observer=null)}},Fv={name:"InfiniteScroll",inserted:function(e,t,i){var n=t.value,s=i.context,r=Object(Ve["getScrollContainer"])(e,!0),a=Iv(e,s),o=a.delay,l=a.immediate,c=L()(o,jv.bind(e,n));if(e[Pv]={el:e,vm:s,container:r,onScroll:c},r&&(r.addEventListener("scroll",c),l)){var u=e[Pv].observer=new MutationObserver(c);u.observe(r,{childList:!0,subtree:!0}),c()}},unbind:function(e){var t=e[Pv],i=t.container,n=t.onScroll;i&&i.removeEventListener("scroll",n)},install:function(e){e.directive(Fv.name,Fv)}},Lv=Fv,Vv=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{staticClass:"el-page-header"},[i("div",{staticClass:"el-page-header__left",on:{click:function(t){e.$emit("back")}}},[i("i",{staticClass:"el-icon-back"}),i("div",{staticClass:"el-page-header__title"},[e._t("title",[e._v(e._s(e.title))])],2)]),i("div",{staticClass:"el-page-header__content"},[e._t("content",[e._v(e._s(e.content))])],2)])},Av=[];Vv._withStripped=!0;var zv={name:"ElPageHeader",props:{title:{type:String,default:function(){return Object(Ji["t"])("el.pageHeader.title")}},content:String}},Bv=zv,Rv=o(Bv,Vv,Av,!1,null,null,null);Rv.options.__file="packages/page-header/src/main.vue";var Hv=Rv.exports;Hv.install=function(e){e.component(Hv.name,Hv)};var Wv=Hv,qv=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["el-cascader-panel",e.border&&"is-bordered"],on:{keydown:e.handleKeyDown}},e._l(e.menus,function(e,t){return i("cascader-menu",{key:t,ref:"menu",refInFor:!0,attrs:{index:t,nodes:e}})}),1)},Yv=[];qv._withStripped=!0;var Kv,Uv,Gv=i(43),Xv=i.n(Gv),Qv=function(e){return e.stopPropagation()},Zv={inject:["panel"],components:{ElCheckbox:Fn.a,ElRadio:Xv.a},props:{node:{required:!0},nodeId:String},computed:{config:function(){return this.panel.config},isLeaf:function(){return this.node.isLeaf},isDisabled:function(){return this.node.isDisabled},checkedValue:function(){return this.panel.checkedValue},isChecked:function(){return this.node.isSameNode(this.checkedValue)},inActivePath:function(){return this.isInPath(this.panel.activePath)},inCheckedPath:function(){var e=this;return!!this.config.checkStrictly&&this.panel.checkedNodePaths.some(function(t){return e.isInPath(t)})},value:function(){return this.node.getValueByOption()}},methods:{handleExpand:function(){var e=this,t=this.panel,i=this.node,n=this.isDisabled,s=this.config,r=s.multiple,a=s.checkStrictly;!a&&n||i.loading||(s.lazy&&!i.loaded?t.lazyLoad(i,function(){var t=e.isLeaf;if(t||e.handleExpand(),r){var n=!!t&&i.checked;e.handleMultiCheckChange(n)}}):t.handleExpand(i))},handleCheckChange:function(){var e=this.panel,t=this.value;e.handleCheckChange(t)},handleMultiCheckChange:function(e){this.node.doCheck(e),this.panel.calculateMultiCheckedValue()},isInPath:function(e){var t=this.node,i=e[t.level-1]||{};return i.uid===t.uid},renderPrefix:function(e){var t=this.isLeaf,i=this.isChecked,n=this.config,s=n.checkStrictly,r=n.multiple;return r?this.renderCheckbox(e):s?this.renderRadio(e):t&&i?this.renderCheckIcon(e):null},renderPostfix:function(e){var t=this.node,i=this.isLeaf;return t.loading?this.renderLoadingIcon(e):i?null:this.renderExpandIcon(e)},renderCheckbox:function(e){var t=this.node,i=this.config,n=this.isDisabled,s={on:{change:this.handleMultiCheckChange},nativeOn:{}};return i.checkStrictly&&(s.nativeOn.click=Qv),e("el-checkbox",Zu()([{attrs:{value:t.checked,indeterminate:t.indeterminate,disabled:n}},s]))},renderRadio:function(e){var t=this.checkedValue,i=this.value,n=this.isDisabled;return Object(b["isEqual"])(i,t)&&(i=t),e("el-radio",{attrs:{value:t,label:i,disabled:n},on:{change:this.handleCheckChange},nativeOn:{click:Qv}},[e("span")])},renderCheckIcon:function(e){return e("i",{class:"el-icon-check el-cascader-node__prefix"})},renderLoadingIcon:function(e){return e("i",{class:"el-icon-loading el-cascader-node__postfix"})},renderExpandIcon:function(e){return e("i",{class:"el-icon-arrow-right el-cascader-node__postfix"})},renderContent:function(e){var t=this.panel,i=this.node,n=t.renderLabelFn,s=n?n({node:i,data:i.data}):null;return e("span",{class:"el-cascader-node__label"},[s||i.label])}},render:function(e){var t=this,i=this.inActivePath,n=this.inCheckedPath,s=this.isChecked,r=this.isLeaf,a=this.isDisabled,o=this.config,l=this.nodeId,c=o.expandTrigger,u=o.checkStrictly,h=o.multiple,d=!u&&a,p={on:{}};return r?a||u||h||(p.on.click=this.handleCheckChange):"click"===c?p.on.click=this.handleExpand:(p.on.mouseenter=function(e){t.handleExpand(),t.$emit("expand",e)},p.on.focus=function(e){t.handleExpand(),t.$emit("expand",e)}),e("li",Zu()([{attrs:{role:"menuitem",id:l,"aria-expanded":i,tabindex:d?null:-1},class:{"el-cascader-node":!0,"is-selectable":u,"in-active-path":i,"in-checked-path":n,"is-active":s,"is-disabled":d}},p]),[this.renderPrefix(e),this.renderContent(e),this.renderPostfix(e)])}},Jv=Zv,eg=o(Jv,Kv,Uv,!1,null,null,null);eg.options.__file="packages/cascader-panel/src/cascader-node.vue";var tg,ig,ng=eg.exports,sg={name:"ElCascaderMenu",mixins:[g.a],inject:["panel"],components:{ElScrollbar:q.a,CascaderNode:ng},props:{nodes:{type:Array,required:!0},index:Number},data:function(){return{activeNode:null,hoverTimer:null,id:Object(b["generateId"])()}},computed:{isEmpty:function(){return!this.nodes.length},menuId:function(){return"cascader-menu-"+this.id+"-"+this.index}},methods:{handleExpand:function(e){this.activeNode=e.target},handleMouseMove:function(e){var t=this.activeNode,i=this.hoverTimer,n=this.$refs.hoverZone;if(t&&n)if(t.contains(e.target)){clearTimeout(i);var s=this.$el.getBoundingClientRect(),r=s.left,a=e.clientX-r,o=this.$el,l=o.offsetWidth,c=o.offsetHeight,u=t.offsetTop,h=u+t.offsetHeight;n.innerHTML='\n \n \n '}else i||(this.hoverTimer=setTimeout(this.clearHoverZone,this.panel.config.hoverThreshold))},clearHoverZone:function(){var e=this.$refs.hoverZone;e&&(e.innerHTML="")},renderEmptyText:function(e){return e("div",{class:"el-cascader-menu__empty-text"},[this.t("el.cascader.noData")])},renderNodeList:function(e){var t=this.menuId,i=this.panel.isHoverMenu,n={on:{}};i&&(n.on.expand=this.handleExpand);var s=this.nodes.map(function(i,s){var r=i.hasChildren;return e("cascader-node",Zu()([{key:i.uid,attrs:{node:i,"node-id":t+"-"+s,"aria-haspopup":r,"aria-owns":r?t:null}},n]))});return[].concat(s,[i?e("svg",{ref:"hoverZone",class:"el-cascader-menu__hover-zone"}):null])}},render:function(e){var t=this.isEmpty,i=this.menuId,n={nativeOn:{}};return this.panel.isHoverMenu&&(n.nativeOn.mousemove=this.handleMouseMove),e("el-scrollbar",Zu()([{attrs:{tag:"ul",role:"menu",id:i,"wrap-class":"el-cascader-menu__wrap","view-class":{"el-cascader-menu__list":!0,"is-empty":t}},class:"el-cascader-menu"},n]),[t?this.renderEmptyText(e):this.renderNodeList(e)])}},rg=sg,ag=o(rg,tg,ig,!1,null,null,null);ag.options.__file="packages/cascader-panel/src/cascader-menu.vue";var og=ag.exports,lg=function(){function e(e,t){for(var i=0;i1?t-1:0),n=1;n1?n-1:0),r=1;r0},e.prototype.syncCheckState=function(e){var t=this.getValueByOption(),i=this.isSameNode(e,t);this.doCheck(i)},e.prototype.doCheck=function(e){this.checked!==e&&(this.config.checkStrictly?this.checked=e:(this.broadcast("check",e),this.setCheckState(e),this.emit("check")))},lg(e,[{key:"isDisabled",get:function(){var e=this.data,t=this.parent,i=this.config,n=i.disabled,s=i.checkStrictly;return e[n]||!s&&t&&t.isDisabled}},{key:"isLeaf",get:function(){var e=this.data,t=this.loaded,i=this.hasChildren,n=this.children,s=this.config,r=s.lazy,a=s.leaf;if(r){var o=Object(rn["isDef"])(e[a])?e[a]:!!t&&!n.length;return this.hasChildren=!o,o}return!i}}]),e}(),dg=hg;function pg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var fg=function e(t,i){return t.reduce(function(t,n){return n.isLeaf?t.push(n):(!i&&t.push(n),t=t.concat(e(n.children,i))),t},[])},mg=function(){function e(t,i){pg(this,e),this.config=i,this.initNodes(t)}return e.prototype.initNodes=function(e){var t=this;e=Object(b["coerceTruthyValueToArray"])(e),this.nodes=e.map(function(e){return new dg(e,t.config)}),this.flattedNodes=this.getFlattedNodes(!1,!1),this.leafNodes=this.getFlattedNodes(!0,!1)},e.prototype.appendNode=function(e,t){var i=new dg(e,this.config,t),n=t?t.children:this.nodes;n.push(i)},e.prototype.appendNodes=function(e,t){var i=this;e=Object(b["coerceTruthyValueToArray"])(e),e.forEach(function(e){return i.appendNode(e,t)})},e.prototype.getNodes=function(){return this.nodes},e.prototype.getFlattedNodes=function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],i=e?this.leafNodes:this.flattedNodes;return t?i:fg(this.nodes,e)},e.prototype.getNodeByValue=function(e){if(e){e=Array.isArray(e)?e[e.length-1]:e;var t=this.getFlattedNodes(!1,!this.config.lazy).filter(function(t){return t.value===e});return t&&t.length?t[0]:null}return null},e}(),vg=mg,gg=Object.assign||function(e){for(var t=1;t1&&void 0!==arguments[1]?arguments[1]:{};en.a.use(t.locale),en.a.i18n(t.i18n),Tg.forEach(function(t){e.component(t.name,t)}),e.use(Lv),e.use(Tu.directive),e.prototype.$ELEMENT={size:t.size||"",zIndex:t.zIndex||2e3},e.prototype.$loading=Tu.service,e.prototype.$msgbox=Fo,e.prototype.$alert=Fo.alert,e.prototype.$confirm=Fo.confirm,e.prototype.$prompt=Fo.prompt,e.prototype.$notify=Xc,e.prototype.$message=Gh};"undefined"!==typeof window&&window.Vue&&Pg(window.Vue);t["default"]={version:"2.9.1",locale:en.a.use,i18n:en.a.i18n,install:Pg,CollapseTransition:Ke.a,Loading:Tu,Pagination:_,Dialog:I,Autocomplete:se,Dropdown:pe,DropdownMenu:_e,DropdownItem:$e,Menu:qe,Submenu:et,MenuItem:ct,MenuItemGroup:vt,Input:Tt,InputNumber:Vt,Radio:qt,RadioGroup:Jt,RadioButton:ai,Checkbox:pi,CheckboxButton:_i,CheckboxGroup:$i,Switch:Ni,Select:un,Option:hn,OptionGroup:bn,Button:Sn,ButtonGroup:Mn,Table:Gs,TableColumn:nr,DatePicker:Ta,TimeSelect:Ra,TimePicker:to,Popover:uo,Tooltip:po,MessageBox:Fo,Breadcrumb:Ho,BreadcrumbItem:Xo,Form:nl,FormItem:bl,Tabs:Al,TabPane:Ul,Tag:Jl,Tree:Oc,Alert:Fc,Notification:Xc,Slider:du,Icon:Lu,Row:Au,Col:Ru,Upload:xh,Progress:Oh,Spinner:jh,Message:Gh,Badge:id,Card:cd,Rate:gd,Steps:kd,Step:Pd,Carousel:zd,Scrollbar:qd,CarouselItem:Jd,Collapse:ap,CollapseItem:pp,Cascader:Op,ColorPicker:Ef,Transfer:Rf,Container:Gf,Header:im,Aside:cm,Main:vm,Footer:wm,Timeline:Tm,TimelineItem:Lm,Link:Wm,Divider:Ym,Image:tv,Calendar:bv,Backtop:Sv,InfiniteScroll:Lv,PageHeader:Wv,CascaderPanel:Eg}}])["default"]},6167:function(e,t,i){"use strict";var n,s;"function"===typeof Symbol&&Symbol.iterator;(function(r,a){n=a,s="function"===typeof n?n.call(t,i,t,e):n,void 0===s||(e.exports=s)})(0,function(){var e=window,t={placement:"bottom",gpuAcceleration:!0,offset:0,boundariesElement:"viewport",boundariesPadding:5,preventOverflowOrder:["left","right","top","bottom"],flipBehavior:"flip",arrowElement:"[x-arrow]",arrowOffset:0,modifiers:["shift","offset","preventOverflow","keepTogether","arrow","flip","applyStyle"],modifiersIgnored:[],forceAbsolute:!1};function i(e,i,n){this._reference=e.jquery?e[0]:e,this.state={};var s="undefined"===typeof i||null===i,r=i&&"[object Object]"===Object.prototype.toString.call(i);return this._popper=s||r?this.parse(r?i:{}):i.jquery?i[0]:i,this._options=Object.assign({},t,n),this._options.modifiers=this._options.modifiers.map(function(e){if(-1===this._options.modifiersIgnored.indexOf(e))return"applyStyle"===e&&this._popper.setAttribute("x-placement",this._options.placement),this.modifiers[e]||e}.bind(this)),this.state.position=this._getPosition(this._popper,this._reference),h(this._popper,{position:this.state.position,top:0}),this.update(),this._setupEventListeners(),this}function n(t){var i=t.style.display,n=t.style.visibility;t.style.display="block",t.style.visibility="hidden";t.offsetWidth;var s=e.getComputedStyle(t),r=parseFloat(s.marginTop)+parseFloat(s.marginBottom),a=parseFloat(s.marginLeft)+parseFloat(s.marginRight),o={width:t.offsetWidth+a,height:t.offsetHeight+r};return t.style.display=i,t.style.visibility=n,o}function s(e){var t={left:"right",right:"left",bottom:"top",top:"bottom"};return e.replace(/left|right|bottom|top/g,function(e){return t[e]})}function r(e){var t=Object.assign({},e);return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function a(e,t){var i,n=0;for(i in e){if(e[i]===t)return n;n++}return null}function o(t,i){var n=e.getComputedStyle(t,null);return n[i]}function l(t){var i=t.offsetParent;return i!==e.document.body&&i?i:e.document.documentElement}function c(t){var i=t.parentNode;return i?i===e.document?e.document.body.scrollTop||e.document.body.scrollLeft?e.document.body:e.document.documentElement:-1!==["scroll","auto"].indexOf(o(i,"overflow"))||-1!==["scroll","auto"].indexOf(o(i,"overflow-x"))||-1!==["scroll","auto"].indexOf(o(i,"overflow-y"))?i:c(t.parentNode):t}function u(t){return t!==e.document.body&&("fixed"===o(t,"position")||(t.parentNode?u(t.parentNode):t))}function h(e,t){function i(e){return""!==e&&!isNaN(parseFloat(e))&&isFinite(e)}Object.keys(t).forEach(function(n){var s="";-1!==["width","height","top","right","bottom","left"].indexOf(n)&&i(t[n])&&(s="px"),e.style[n]=t[n]+s})}function d(e){var t={};return e&&"[object Function]"===t.toString.call(e)}function p(e){var t={width:e.offsetWidth,height:e.offsetHeight,left:e.offsetLeft,top:e.offsetTop};return t.right=t.left+t.width,t.bottom=t.top+t.height,t}function f(e){var t=e.getBoundingClientRect(),i=-1!=navigator.userAgent.indexOf("MSIE"),n=i&&"HTML"===e.tagName?-e.scrollTop:t.top;return{left:t.left,top:n,right:t.right,bottom:t.bottom,width:t.right-t.left,height:t.bottom-n}}function m(e,t,i){var n=f(e),s=f(t);if(i){var r=c(t);s.top+=r.scrollTop,s.bottom+=r.scrollTop,s.left+=r.scrollLeft,s.right+=r.scrollLeft}var a={top:n.top-s.top,left:n.left-s.left,bottom:n.top-s.top+n.height,right:n.left-s.left+n.width,width:n.width,height:n.height};return a}function v(t){for(var i=["","ms","webkit","moz","o"],n=0;n1&&console.warn("WARNING: the given `parent` query("+t.parent+") matched more than one element, the first one will be used"),0===a.length)throw"ERROR: the given `parent` doesn't exists!";a=a[0]}return a.length>1&&a instanceof Element===!1&&(console.warn("WARNING: you have passed as parent a list of elements, the first one will be used"),a=a[0]),a.appendChild(s),s;function o(e,t){t.forEach(function(t){e.classList.add(t)})}function l(e,t){t.forEach(function(t){e.setAttribute(t.split(":")[0],t.split(":")[1]||"")})}},i.prototype._getPosition=function(e,t){var i=l(t);if(this._options.forceAbsolute)return"absolute";var n=u(t,i);return n?"fixed":"absolute"},i.prototype._getOffsets=function(e,t,i){i=i.split("-")[0];var s={};s.position=this.state.position;var r="fixed"===s.position,a=m(t,l(e),r),o=n(e);return-1!==["right","left"].indexOf(i)?(s.top=a.top+a.height/2-o.height/2,s.left="left"===i?a.left-o.width:a.right):(s.left=a.left+a.width/2-o.width/2,s.top="top"===i?a.top-o.height:a.bottom),s.width=o.width,s.height=o.height,{popper:s,reference:a}},i.prototype._setupEventListeners=function(){if(this.state.updateBound=this.update.bind(this),e.addEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement){var t=c(this._reference);t!==e.document.body&&t!==e.document.documentElement||(t=e),t.addEventListener("scroll",this.state.updateBound),this.state.scrollTarget=t}},i.prototype._removeEventListeners=function(){e.removeEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement&&this.state.scrollTarget&&(this.state.scrollTarget.removeEventListener("scroll",this.state.updateBound),this.state.scrollTarget=null),this.state.updateBound=null},i.prototype._getBoundaries=function(t,i,n){var s,r,a={};if("window"===n){var o=e.document.body,u=e.document.documentElement;r=Math.max(o.scrollHeight,o.offsetHeight,u.clientHeight,u.scrollHeight,u.offsetHeight),s=Math.max(o.scrollWidth,o.offsetWidth,u.clientWidth,u.scrollWidth,u.offsetWidth),a={top:0,right:s,bottom:r,left:0}}else if("viewport"===n){var h=l(this._popper),d=c(this._popper),f=p(h),m=function(e){return e==document.body?Math.max(document.documentElement.scrollTop,document.body.scrollTop):e.scrollTop},v=function(e){return e==document.body?Math.max(document.documentElement.scrollLeft,document.body.scrollLeft):e.scrollLeft},g="fixed"===t.offsets.popper.position?0:m(d),b="fixed"===t.offsets.popper.position?0:v(d);a={top:0-(f.top-g),right:e.document.documentElement.clientWidth-(f.left-b),bottom:e.document.documentElement.clientHeight-(f.top-g),left:0-(f.left-b)}}else a=l(this._popper)===n?{top:0,left:0,right:n.clientWidth,bottom:n.clientHeight}:p(n);return a.left+=i,a.right-=i,a.top=a.top+i,a.bottom=a.bottom-i,a},i.prototype.runModifiers=function(e,t,i){var n=t.slice();return void 0!==i&&(n=this._options.modifiers.slice(0,a(this._options.modifiers,i))),n.forEach(function(t){d(t)&&(e=t.call(this,e))}.bind(this)),e},i.prototype.isModifierRequired=function(e,t){var i=a(this._options.modifiers,e);return!!this._options.modifiers.slice(0,i).filter(function(e){return e===t}).length},i.prototype.modifiers={},i.prototype.modifiers.applyStyle=function(e){var t,i={position:e.offsets.popper.position},n=Math.round(e.offsets.popper.left),s=Math.round(e.offsets.popper.top);return this._options.gpuAcceleration&&(t=v("transform"))?(i[t]="translate3d("+n+"px, "+s+"px, 0)",i.top=0,i.left=0):(i.left=n,i.top=s),Object.assign(i,e.styles),h(this._popper,i),this._popper.setAttribute("x-placement",e.placement),this.isModifierRequired(this.modifiers.applyStyle,this.modifiers.arrow)&&e.offsets.arrow&&h(e.arrowElement,e.offsets.arrow),e},i.prototype.modifiers.shift=function(e){var t=e.placement,i=t.split("-")[0],n=t.split("-")[1];if(n){var s=e.offsets.reference,a=r(e.offsets.popper),o={y:{start:{top:s.top},end:{top:s.top+s.height-a.height}},x:{start:{left:s.left},end:{left:s.left+s.width-a.width}}},l=-1!==["bottom","top"].indexOf(i)?"x":"y";e.offsets.popper=Object.assign(a,o[l][n])}return e},i.prototype.modifiers.preventOverflow=function(e){var t=this._options.preventOverflowOrder,i=r(e.offsets.popper),n={left:function(){var t=i.left;return i.lefte.boundaries.right&&(t=Math.min(i.left,e.boundaries.right-i.width)),{left:t}},top:function(){var t=i.top;return i.tope.boundaries.bottom&&(t=Math.min(i.top,e.boundaries.bottom-i.height)),{top:t}}};return t.forEach(function(t){e.offsets.popper=Object.assign(i,n[t]())}),e},i.prototype.modifiers.keepTogether=function(e){var t=r(e.offsets.popper),i=e.offsets.reference,n=Math.floor;return t.rightn(i.right)&&(e.offsets.popper.left=n(i.right)),t.bottomn(i.bottom)&&(e.offsets.popper.top=n(i.bottom)),e},i.prototype.modifiers.flip=function(e){if(!this.isModifierRequired(this.modifiers.flip,this.modifiers.preventOverflow))return console.warn("WARNING: preventOverflow modifier is required by flip modifier in order to work, be sure to include it before flip!"),e;if(e.flipped&&e.placement===e._originalPlacement)return e;var t=e.placement.split("-")[0],i=s(t),n=e.placement.split("-")[1]||"",a=[];return a="flip"===this._options.flipBehavior?[t,i]:this._options.flipBehavior,a.forEach(function(o,l){if(t===o&&a.length!==l+1){t=e.placement.split("-")[0],i=s(t);var c=r(e.offsets.popper),u=-1!==["right","bottom"].indexOf(t);(u&&Math.floor(e.offsets.reference[t])>Math.floor(c[i])||!u&&Math.floor(e.offsets.reference[t])o[p]&&(e.offsets.popper[h]+=l[h]+f-o[p]);var m=l[h]+(i||l[u]/2-f/2),v=m-o[h];return v=Math.max(Math.min(o[u]-f-8,v),8),s[h]=v,s[d]="",e.offsets.arrow=s,e.arrowElement=t,e},Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(void 0===e||null===e)throw new TypeError("Cannot convert first argument to object");for(var t=Object(e),i=1;i0&&void 0!==arguments[0]?arguments[0]:"";return String(e).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")};var f=t.arrayFindIndex=function(e,t){for(var i=0;i!==e.length;++i)if(t(e[i]))return i;return-1},m=(t.arrayFind=function(e,t){var i=f(e,t);return-1!==i?e[i]:void 0},t.coerceTruthyValueToArray=function(e){return Array.isArray(e)?e:e?[e]:[]},t.isIE=function(){return!r.default.prototype.$isServer&&!isNaN(Number(document.documentMode))},t.isEdge=function(){return!r.default.prototype.$isServer&&navigator.userAgent.indexOf("Edge")>-1},t.autoprefixer=function(e){if("object"!==("undefined"===typeof e?"undefined":n(e)))return e;var t=["transform","transition","animation"],i=["ms-","webkit-"];return t.forEach(function(t){var n=e[t];t&&n&&i.forEach(function(i){e[i+t]=n})}),e},t.kebabCase=function(e){var t=/([^-])([A-Z])/g;return e.replace(t,"$1-$2").replace(t,"$1-$2").toLowerCase()},t.capitalize=function(e){return(0,a.isString)(e)?e.charAt(0).toUpperCase()+e.slice(1):e},t.looseEqual=function(e,t){var i=(0,a.isObject)(e),n=(0,a.isObject)(t);return i&&n?JSON.stringify(e)===JSON.stringify(t):!i&&!n&&String(e)===String(t)}),v=t.arrayEquals=function(e,t){if(e=e||[],t=t||[],e.length!==t.length)return!1;for(var i=0;i1?t-1:0),a=1;a-1}},percentage:{type:Number,default:0,required:!0,validator:function(e){return e>=0&&e<=100}},status:{type:String,validator:function(e){return["success","exception","warning"].indexOf(e)>-1}},strokeWidth:{type:Number,default:6},textInside:{type:Boolean,default:!1},width:{type:Number,default:126},showText:{type:Boolean,default:!0},color:{type:[String,Array,Function],default:""},format:Function},computed:{barStyle:function(){var e={};return e.width=this.percentage+"%",e.backgroundColor=this.getCurrentColor(this.percentage),e},relativeStrokeWidth:function(){return(this.strokeWidth/this.width*100).toFixed(1)},radius:function(){return"circle"===this.type||"dashboard"===this.type?parseInt(50-parseFloat(this.relativeStrokeWidth)/2,10):0},trackPath:function(){var e=this.radius,t="dashboard"===this.type;return"\n M 50 50\n m 0 "+(t?"":"-")+e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"-":"")+2*e+"\n a "+e+" "+e+" 0 1 1 0 "+(t?"":"-")+2*e+"\n "},perimeter:function(){return 2*Math.PI*this.radius},rate:function(){return"dashboard"===this.type?.75:1},strokeDashoffset:function(){var e=-1*this.perimeter*(1-this.rate)/2;return e+"px"},trailPathStyle:function(){return{strokeDasharray:this.perimeter*this.rate+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset}},circlePathStyle:function(){return{strokeDasharray:this.perimeter*this.rate*(this.percentage/100)+"px, "+this.perimeter+"px",strokeDashoffset:this.strokeDashoffset,transition:"stroke-dasharray 0.6s ease 0s, stroke 0.6s ease"}},stroke:function(){var e=void 0;if(this.color)e=this.getCurrentColor(this.percentage);else switch(this.status){case"success":e="#13ce66";break;case"exception":e="#ff4949";break;case"warning":e="#e6a23c";break;default:e="#20a0ff"}return e},iconClass:function(){return"warning"===this.status?"el-icon-warning":"line"===this.type?"success"===this.status?"el-icon-circle-check":"el-icon-circle-close":"success"===this.status?"el-icon-check":"el-icon-close"},progressTextSize:function(){return"line"===this.type?12+.4*this.strokeWidth:.111111*this.width+2},content:function(){return"function"===typeof this.format?this.format(this.percentage)||"":this.percentage+"%"}},methods:{getCurrentColor:function(e){return"function"===typeof this.color?this.color(e):"string"===typeof this.color?this.color:this.getLevelColor(e)},getLevelColor:function(e){for(var t=this.getColorArray().sort(function(e,t){return e.percentage-t.percentage}),i=0;ie)return t[i].color;return t[t.length-1].color},getColorArray:function(){var e=this.color,t=100/e.length;return e.map(function(e,i){return"string"===typeof e?{color:e,progress:(i+1)*t}:e})}}},a=r,o=i(0),l=Object(o["a"])(a,n,s,!1,null,null,null);l.options.__file="packages/progress/src/progress.vue";var c=l.exports;c.install=function(e){e.component(c.name,c)};t["default"]=c}})},c56a:function(e,t,i){"use strict";t.__esModule=!0,t.default=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:300,n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!t)throw new Error("instance & callback is required");var s=!1,r=function(){s||(s=!0,t&&t.apply(null,arguments))};n?e.$once("after-leave",r):e.$on("after-leave",r),setTimeout(function(){r()},i+100)}},d010:function(e,t,i){"use strict";function n(e,t,i){this.$children.forEach(function(s){var r=s.$options.componentName;r===e?s.$emit.apply(s,[t].concat(i)):n.apply(s,[e,t].concat([i]))})}t.__esModule=!0,t.default={methods:{dispatch:function(e,t,i){var n=this.$parent||this.$root,s=n.$options.componentName;while(n&&(!s||s!==e))n=n.$parent,n&&(s=n.$options.componentName);n&&n.$emit.apply(n,[t].concat(i))},broadcast:function(e,t,i){n.call(this,e,t,i)}}}},d397:function(e,t,i){"use strict";function n(e){return void 0!==e&&null!==e}function s(e){var t=/([(\uAC00-\uD7AF)|(\u3130-\u318F)])+/gi;return t.test(e)}t.__esModule=!0,t.isDef=n,t.isKorean=s},d7d1:function(e,t,i){"use strict";var n;(function(s){var r={},a=/d{1,4}|M{1,4}|yy(?:yy)?|S{1,3}|Do|ZZ|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g,o="\\d\\d?",l="\\d{3}",c="\\d{4}",u="[^\\s]+",h=/\[([^]*?)\]/gm,d=function(){};function p(e){return e.replace(/[|\\{()[^$+*?.-]/g,"\\$&")}function f(e,t){for(var i=[],n=0,s=e.length;n3?0:(e-e%10!==10)*e%10]}};var x={D:function(e){return e.getDay()},DD:function(e){return v(e.getDay())},Do:function(e,t){return t.DoFn(e.getDate())},d:function(e){return e.getDate()},dd:function(e){return v(e.getDate())},ddd:function(e,t){return t.dayNamesShort[e.getDay()]},dddd:function(e,t){return t.dayNames[e.getDay()]},M:function(e){return e.getMonth()+1},MM:function(e){return v(e.getMonth()+1)},MMM:function(e,t){return t.monthNamesShort[e.getMonth()]},MMMM:function(e,t){return t.monthNames[e.getMonth()]},yy:function(e){return v(String(e.getFullYear()),4).substr(2)},yyyy:function(e){return v(e.getFullYear(),4)},h:function(e){return e.getHours()%12||12},hh:function(e){return v(e.getHours()%12||12)},H:function(e){return e.getHours()},HH:function(e){return v(e.getHours())},m:function(e){return e.getMinutes()},mm:function(e){return v(e.getMinutes())},s:function(e){return e.getSeconds()},ss:function(e){return v(e.getSeconds())},S:function(e){return Math.round(e.getMilliseconds()/100)},SS:function(e){return v(Math.round(e.getMilliseconds()/10),2)},SSS:function(e){return v(e.getMilliseconds(),3)},a:function(e,t){return e.getHours()<12?t.amPm[0]:t.amPm[1]},A:function(e,t){return e.getHours()<12?t.amPm[0].toUpperCase():t.amPm[1].toUpperCase()},ZZ:function(e){var t=e.getTimezoneOffset();return(t>0?"-":"+")+v(100*Math.floor(Math.abs(t)/60)+Math.abs(t)%60,4)}},C={d:[o,function(e,t){e.day=t}],Do:[o+u,function(e,t){e.day=parseInt(t,10)}],M:[o,function(e,t){e.month=t-1}],yy:[o,function(e,t){var i=new Date,n=+(""+i.getFullYear()).substr(0,2);e.year=""+(t>68?n-1:n)+t}],h:[o,function(e,t){e.hour=t}],m:[o,function(e,t){e.minute=t}],s:[o,function(e,t){e.second=t}],yyyy:[c,function(e,t){e.year=t}],S:["\\d",function(e,t){e.millisecond=100*t}],SS:["\\d{2}",function(e,t){e.millisecond=10*t}],SSS:[l,function(e,t){e.millisecond=t}],D:[o,d],ddd:[u,d],MMM:[u,m("monthNamesShort")],MMMM:[u,m("monthNames")],a:[u,function(e,t,i){var n=t.toLowerCase();n===i.amPm[0]?e.isPm=!1:n===i.amPm[1]&&(e.isPm=!0)}],ZZ:["[^\\s]*?[\\+\\-]\\d\\d:?\\d\\d|[^\\s]*?Z",function(e,t){var i,n=(t+"").match(/([+-]|\d\d)/gi);n&&(i=60*n[1]+parseInt(n[2],10),e.timezoneOffset="+"===n[0]?i:-i)}]};C.dd=C.d,C.dddd=C.ddd,C.DD=C.D,C.mm=C.m,C.hh=C.H=C.HH=C.h,C.MM=C.M,C.ss=C.s,C.A=C.a,r.masks={default:"ddd MMM dd yyyy HH:mm:ss",shortDate:"M/D/yy",mediumDate:"MMM d, yyyy",longDate:"MMMM d, yyyy",fullDate:"dddd, MMMM d, yyyy",shortTime:"HH:mm",mediumTime:"HH:mm:ss",longTime:"HH:mm:ss.SSS"},r.format=function(e,t,i){var n=i||r.i18n;if("number"===typeof e&&(e=new Date(e)),"[object Date]"!==Object.prototype.toString.call(e)||isNaN(e.getTime()))throw new Error("Invalid Date in fecha.format");t=r.masks[t]||t||r.masks["default"];var s=[];return t=t.replace(h,function(e,t){return s.push(t),"@@@"}),t=t.replace(a,function(t){return t in x?x[t](e,n):t.slice(1,t.length-1)}),t.replace(/@@@/g,function(){return s.shift()})},r.parse=function(e,t,i){var n=i||r.i18n;if("string"!==typeof t)throw new Error("Invalid format in fecha.parse");if(t=r.masks[t]||t,e.length>1e3)return null;var s={},o=[],l=[];t=t.replace(h,function(e,t){return l.push(t),"@@@"});var c=p(t).replace(a,function(e){if(C[e]){var t=C[e];return o.push(t[1]),"("+t[0]+")"}return e});c=c.replace(/@@@/g,function(){return l.shift()});var u=e.match(new RegExp(c,"i"));if(!u)return null;for(var d=1;d1&&void 0!==arguments[1]?arguments[1]:1;return new Date(e.getFullYear(),e.getMonth(),e.getDate()-t)});t.nextDate=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1;return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)},t.getStartDateOfMonth=function(e,t){var i=new Date(e,t,1),n=i.getDay();return m(i,0===n?7:n)},t.getWeekNumber=function(e){if(!d(e))return null;var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var i=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},t.getRangeHours=function(e){var t=[],i=[];if((e||[]).forEach(function(e){var t=e.map(function(e){return e.getHours()});i=i.concat(c(t[0],t[1]))}),i.length)for(var n=0;n<24;n++)t[n]=-1===i.indexOf(n);else for(var s=0;s<24;s++)t[s]=!1;return t},t.getPrevMonthLastDays=function(e,t){if(t<=0)return[];var i=new Date(e.getTime());i.setDate(0);var n=i.getDate();return g(t).map(function(e,i){return n-(t-i-1)})},t.getMonthDays=function(e){var t=new Date(e.getFullYear(),e.getMonth()+1,0),i=t.getDate();return g(i).map(function(e,t){return t+1})};function v(e,t,i,n){for(var s=t;s0?e.forEach(function(e){var n=e[0],s=e[1],r=n.getHours(),a=n.getMinutes(),o=s.getHours(),l=s.getMinutes();r===t&&o!==t?v(i,a,60,!0):r===t&&o===t?v(i,a,l+1,!0):r!==t&&o===t?v(i,0,l+1,!0):rt&&v(i,0,60,!0)}):v(i,0,60,!0),i};var g=t.range=function(e){return Array.apply(null,{length:e}).map(function(e,t){return t})},b=t.modifyDate=function(e,t,i,n){return new Date(t,i,n,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())},y=t.modifyTime=function(e,t,i,n){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),t,i,n,e.getMilliseconds())},_=(t.modifyWithTimeString=function(e,t){return null!=e&&t?(t=p(t,"HH:mm:ss"),y(e,t.getHours(),t.getMinutes(),t.getSeconds())):e},t.clearTime=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())},t.clearMilliseconds=function(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),0)},t.limitTimeRange=function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"HH:mm:ss";if(0===t.length)return e;var n=function(e){return s.default.parse(s.default.format(e,i),i)},r=n(e),a=t.map(function(e){return e.map(n)});if(a.some(function(e){return r>=e[0]&&r<=e[1]}))return e;var o=a[0][0],l=a[0][0];a.forEach(function(e){o=new Date(Math.min(e[0],o)),l=new Date(Math.max(e[1],o))});var c=r1&&void 0!==arguments[1]?arguments[1]:1,i=e.getFullYear(),n=e.getMonth();return x(e,i-t,n)},t.nextYear=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=e.getFullYear(),n=e.getMonth();return x(e,i+t,n)},t.extractDateFormat=function(e){return e.replace(/\W?m{1,2}|\W?ZZ/g,"").replace(/\W?h{1,2}|\W?s{1,3}|\W?a/gi,"").trim()},t.extractTimeFormat=function(e){return e.replace(/\W?D{1,2}|\W?Do|\W?d{1,4}|\W?M{1,4}|\W?y{2,4}/g,"").trim()},t.validateRangeInOneMonth=function(e,t){return e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}},dcdc:function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=102)}({0:function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,this.$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",function(){return n})},102:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("label",{staticClass:"el-checkbox",class:[e.border&&e.checkboxSize?"el-checkbox--"+e.checkboxSize:"",{"is-disabled":e.isDisabled},{"is-bordered":e.border},{"is-checked":e.isChecked}],attrs:{role:"checkbox","aria-checked":e.indeterminate?"mixed":e.isChecked,"aria-disabled":e.isDisabled,id:e.id}},[i("span",{staticClass:"el-checkbox__input",class:{"is-disabled":e.isDisabled,"is-checked":e.isChecked,"is-indeterminate":e.indeterminate,"is-focus":e.focus},attrs:{"aria-checked":"mixed"}},[i("span",{staticClass:"el-checkbox__inner"}),e.trueLabel||e.falseLabel?i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":"true",name:e.name,disabled:e.isDisabled,"true-value":e.trueLabel,"false-value":e.falseLabel},domProps:{checked:Array.isArray(e.model)?e._i(e.model,null)>-1:e._q(e.model,e.trueLabel)},on:{change:[function(t){var i=e.model,n=t.target,s=n.checked?e.trueLabel:e.falseLabel;if(Array.isArray(i)){var r=null,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):i("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":"true",disabled:e.isDisabled,name:e.name},domProps:{value:e.label,checked:Array.isArray(e.model)?e._i(e.model,e.label)>-1:e.model},on:{change:[function(t){var i=e.model,n=t.target,s=!!n.checked;if(Array.isArray(i)){var r=e.label,a=e._i(i,r);n.checked?a<0&&(e.model=i.concat([r])):a>-1&&(e.model=i.slice(0,a).concat(i.slice(a+1)))}else e.model=s},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})]),e.$slots.default||e.label?i("span",{staticClass:"el-checkbox__label"},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2):e._e()])},s=[];n._withStripped=!0;var r=i(4),a=i.n(r),o={name:"ElCheckbox",mixins:[a.a],inject:{elForm:{default:""},elFormItem:{default:""}},componentName:"ElCheckbox",data:function(){return{selfModel:!1,focus:!1,isLimitExceeded:!1}},computed:{model:{get:function(){return this.isGroup?this.store:void 0!==this.value?this.value:this.selfModel},set:function(e){this.isGroup?(this.isLimitExceeded=!1,void 0!==this._checkboxGroup.min&&e.lengththis._checkboxGroup.max&&(this.isLimitExceeded=!0),!1===this.isLimitExceeded&&this.dispatch("ElCheckboxGroup","input",[e])):(this.$emit("input",e),this.selfModel=e)}},isChecked:function(){return"[object Boolean]"==={}.toString.call(this.model)?this.model:Array.isArray(this.model)?this.model.indexOf(this.label)>-1:null!==this.model&&void 0!==this.model?this.model===this.trueLabel:void 0},isGroup:function(){var e=this.$parent;while(e){if("ElCheckboxGroup"===e.$options.componentName)return this._checkboxGroup=e,!0;e=e.$parent}return!1},store:function(){return this._checkboxGroup?this._checkboxGroup.value:this.value},isLimitDisabled:function(){var e=this._checkboxGroup,t=e.max,i=e.min;return!(!t&&!i)&&this.model.length>=t&&!this.isChecked||this.model.length<=i&&this.isChecked},isDisabled:function(){return this.isGroup?this._checkboxGroup.disabled||this.disabled||(this.elForm||{}).disabled||this.isLimitDisabled:this.disabled||(this.elForm||{}).disabled},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},checkboxSize:function(){var e=this.size||this._elFormItemSize||(this.$ELEMENT||{}).size;return this.isGroup&&this._checkboxGroup.checkboxGroupSize||e}},props:{value:{},label:{},indeterminate:Boolean,disabled:Boolean,checked:Boolean,name:String,trueLabel:[String,Number],falseLabel:[String,Number],id:String,controls:String,border:Boolean,size:String},methods:{addToStore:function(){Array.isArray(this.model)&&-1===this.model.indexOf(this.label)?this.model.push(this.label):this.model=this.trueLabel||!0},handleChange:function(e){var t=this;if(!this.isLimitExceeded){var i=void 0;i=e.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",i,e),this.$nextTick(function(){t.isGroup&&t.dispatch("ElCheckboxGroup","change",[t._checkboxGroup.value])})}}},created:function(){this.checked&&this.addToStore()},mounted:function(){this.indeterminate&&this.$el.setAttribute("aria-controls",this.controls)},watch:{value:function(e){this.dispatch("ElFormItem","el.form.change",e)}}},l=o,c=i(0),u=Object(c["a"])(l,n,s,!1,null,null,null);u.options.__file="packages/checkbox/src/checkbox.vue";var h=u.exports;h.install=function(e){e.component(h.name,h)};t["default"]=h},4:function(e,t){e.exports=i("d010")}})},e450:function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=89)}({0:function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,this.$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",function(){return n})},10:function(e,t){e.exports=i("f3ad")},2:function(e,t){e.exports=i("5924")},21:function(e,t){e.exports=i("12f2")},30:function(e,t,i){"use strict";var n=i(2);t["a"]={bind:function(e,t,i){var s=null,r=void 0,a=function(){return i.context[t.expression].apply()},o=function(){Date.now()-r<100&&a(),clearInterval(s),s=null};Object(n["on"])(e,"mousedown",function(e){0===e.button&&(r=Date.now(),Object(n["once"])(document,"mouseup",o),clearInterval(s),s=setInterval(a,100))})}}},89:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["el-input-number",e.inputNumberSize?"el-input-number--"+e.inputNumberSize:"",{"is-disabled":e.inputNumberDisabled},{"is-without-controls":!e.controls},{"is-controls-right":e.controlsAtRight}],on:{dragstart:function(e){e.preventDefault()}}},[e.controls?i("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.decrease,expression:"decrease"}],staticClass:"el-input-number__decrease",class:{"is-disabled":e.minDisabled},attrs:{role:"button"},on:{keydown:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.decrease(t):null}}},[i("i",{class:"el-icon-"+(e.controlsAtRight?"arrow-down":"minus")})]):e._e(),e.controls?i("span",{directives:[{name:"repeat-click",rawName:"v-repeat-click",value:e.increase,expression:"increase"}],staticClass:"el-input-number__increase",class:{"is-disabled":e.maxDisabled},attrs:{role:"button"},on:{keydown:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.increase(t):null}}},[i("i",{class:"el-icon-"+(e.controlsAtRight?"arrow-up":"plus")})]):e._e(),i("el-input",{ref:"input",attrs:{value:e.displayValue,placeholder:e.placeholder,disabled:e.inputNumberDisabled,size:e.inputNumberSize,max:e.max,min:e.min,name:e.name,label:e.label},on:{blur:e.handleBlur,focus:e.handleFocus,input:e.handleInput,change:e.handleInputChange},nativeOn:{keydown:[function(t){return"button"in t||!e._k(t.keyCode,"up",38,t.key,["Up","ArrowUp"])?(t.preventDefault(),e.increase(t)):null},function(t){return"button"in t||!e._k(t.keyCode,"down",40,t.key,["Down","ArrowDown"])?(t.preventDefault(),e.decrease(t)):null}]}})],1)},s=[];n._withStripped=!0;var r=i(10),a=i.n(r),o=i(21),l=i.n(o),c=i(30),u={name:"ElInputNumber",mixins:[l()("input")],inject:{elForm:{default:""},elFormItem:{default:""}},directives:{repeatClick:c["a"]},components:{ElInput:a.a},props:{step:{type:Number,default:1},stepStrictly:{type:Boolean,default:!1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},value:{},disabled:Boolean,size:String,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:""},name:String,label:String,placeholder:String,precision:{type:Number,validator:function(e){return e>=0&&e===parseInt(e,10)}}},data:function(){return{currentValue:0,userInput:null}},watch:{value:{immediate:!0,handler:function(e){var t=void 0===e?e:Number(e);if(void 0!==t){if(isNaN(t))return;if(this.stepStrictly){var i=this.getPrecision(this.step),n=Math.pow(10,i);t=Math.round(t/this.step)*n*this.step/n}void 0!==this.precision&&(t=this.toPrecision(t,this.precision))}t>=this.max&&(t=this.max),t<=this.min&&(t=this.min),this.currentValue=t,this.userInput=null,this.$emit("input",t)}}},computed:{minDisabled:function(){return this._decrease(this.value,this.step)this.max},numPrecision:function(){var e=this.value,t=this.step,i=this.getPrecision,n=this.precision,s=i(t);return void 0!==n?(s>n&&console.warn("[Element Warn][InputNumber]precision should not be less than the decimal places of step"),n):Math.max(i(e),s)},controlsAtRight:function(){return this.controls&&"right"===this.controlsPosition},_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},inputNumberSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputNumberDisabled:function(){return this.disabled||(this.elForm||{}).disabled},displayValue:function(){if(null!==this.userInput)return this.userInput;var e=this.currentValue;if("number"===typeof e){if(this.stepStrictly){var t=this.getPrecision(this.step),i=Math.pow(10,t);e=Math.round(e/this.step)*i*this.step/i}void 0!==this.precision&&(e=e.toFixed(this.precision))}return e}},methods:{toPrecision:function(e,t){return void 0===t&&(t=this.numPrecision),parseFloat(Math.round(e*Math.pow(10,t))/Math.pow(10,t))},getPrecision:function(e){if(void 0===e)return 0;var t=e.toString(),i=t.indexOf("."),n=0;return-1!==i&&(n=t.length-i-1),n},_increase:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*e+i*t)/i)},_decrease:function(e,t){if("number"!==typeof e&&void 0!==e)return this.currentValue;var i=Math.pow(10,this.numPrecision);return this.toPrecision((i*e-i*t)/i)},increase:function(){if(!this.inputNumberDisabled&&!this.maxDisabled){var e=this.value||0,t=this._increase(e,this.step);this.setCurrentValue(t)}},decrease:function(){if(!this.inputNumberDisabled&&!this.minDisabled){var e=this.value||0,t=this._decrease(e,this.step);this.setCurrentValue(t)}},handleBlur:function(e){this.$emit("blur",e)},handleFocus:function(e){this.$emit("focus",e)},setCurrentValue:function(e){var t=this.currentValue;"number"===typeof e&&void 0!==this.precision&&(e=this.toPrecision(e,this.precision)),e>=this.max&&(e=this.max),e<=this.min&&(e=this.min),t!==e&&(this.userInput=null,this.$emit("input",e),this.$emit("change",e,t),this.currentValue=e)},handleInput:function(e){this.userInput=e},handleInputChange:function(e){var t=""===e?void 0:Number(e);isNaN(t)&&""!==e||this.setCurrentValue(t),this.userInput=null},select:function(){this.$refs.input.select()}},mounted:function(){var e=this.$refs.input.$refs.input;e.setAttribute("role","spinbutton"),e.setAttribute("aria-valuemax",this.max),e.setAttribute("aria-valuemin",this.min),e.setAttribute("aria-valuenow",this.currentValue),e.setAttribute("aria-disabled",this.inputNumberDisabled)},updated:function(){if(this.$refs&&this.$refs.input){var e=this.$refs.input.$refs.input;e.setAttribute("aria-valuenow",this.currentValue)}}},h=u,d=i(0),p=Object(d["a"])(h,n,s,!1,null,null,null);p.options.__file="packages/input-number/src/input-number.vue";var f=p.exports;f.install=function(e){e.component(f.name,f)};t["default"]=f}})},e452:function(e,t,i){"use strict";t.__esModule=!0;var n=n||{};n.Utils=n.Utils||{},n.Utils.focusFirstDescendant=function(e){for(var t=0;t=0;t--){var i=e.childNodes[t];if(n.Utils.attemptFocus(i)||n.Utils.focusLastDescendant(i))return!0}return!1},n.Utils.attemptFocus=function(e){if(!n.Utils.isFocusable(e))return!1;n.Utils.IgnoreUtilFocusChanges=!0;try{e.focus()}catch(t){}return n.Utils.IgnoreUtilFocusChanges=!1,document.activeElement===e},n.Utils.isFocusable=function(e){if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!==e.rel;case"INPUT":return"hidden"!==e.type&&"file"!==e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},n.Utils.triggerEvent=function(e,t){var i=void 0;i=/^mouse|click/.test(t)?"MouseEvents":/^key/.test(t)?"KeyboardEvent":"HTMLEvents";for(var n=document.createEvent(i),s=arguments.length,r=Array(s>2?s-2:0),a=2;a=this.select.multipleLimit&&this.select.multipleLimit>0)}},watch:{currentLabel:function(){this.created||this.select.remote||this.dispatch("ElSelect","setSelected")},value:function(e,t){var i=this.select,n=i.remote,s=i.valueKey;if(!this.created&&!n){if(s&&"object"===("undefined"===typeof e?"undefined":l(e))&&"object"===("undefined"===typeof t?"undefined":l(t))&&e[s]===t[s])return;this.dispatch("ElSelect","setSelected")}}},methods:{isEqual:function(e,t){if(this.isObject){var i=this.select.valueKey;return Object(o["getValueByPath"])(e,i)===Object(o["getValueByPath"])(t,i)}return e===t},contains:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments[1];if(this.isObject){var i=this.select.valueKey;return e&&e.some(function(e){return Object(o["getValueByPath"])(e,i)===Object(o["getValueByPath"])(t,i)})}return e&&e.indexOf(t)>-1},handleGroupDisabled:function(e){this.groupDisabled=e},hoverItem:function(){this.disabled||this.groupDisabled||(this.select.hoverIndex=this.select.options.indexOf(this))},selectOptionClick:function(){!0!==this.disabled&&!0!==this.groupDisabled&&this.dispatch("ElSelect","handleOptionClick",[this,!0])},queryChange:function(e){this.visible=new RegExp(Object(o["escapeRegexpString"])(e),"i").test(this.currentLabel)||this.created,this.visible||this.select.filteredOptionsCount--}},created:function(){this.select.options.push(this),this.select.cachedOptions.push(this),this.select.optionsCount++,this.select.filteredOptionsCount++,this.$on("queryChange",this.queryChange),this.$on("handleGroupDisabled",this.handleGroupDisabled)},beforeDestroy:function(){this.select.onOptionDestroy(this.select.options.indexOf(this))}},u=c,h=i(0),d=Object(h["a"])(u,n,s,!1,null,null,null);d.options.__file="packages/select/src/option.vue";t["a"]=d.exports},4:function(e,t){e.exports=i("d010")},52:function(e,t,i){"use strict";i.r(t);var n=i(33);n["a"].install=function(e){e.component(n["a"].name,n["a"])},t["default"]=n["a"]}})},e974:function(e,t,i){"use strict";t.__esModule=!0;var n=i("2b0e"),s=a(n),r=i("5128");function a(e){return e&&e.__esModule?e:{default:e}}var o=s.default.prototype.$isServer?function(){}:i("6167"),l=function(e){return e.stopPropagation()};t.default={props:{transformOrigin:{type:[Boolean,String],default:!0},placement:{type:String,default:"bottom"},boundariesPadding:{type:Number,default:5},reference:{},popper:{},offset:{default:0},value:Boolean,visibleArrow:Boolean,arrowOffset:{type:Number,default:35},appendToBody:{type:Boolean,default:!0},popperOptions:{type:Object,default:function(){return{gpuAcceleration:!1}}}},data:function(){return{showPopper:!1,currentPlacement:""}},watch:{value:{immediate:!0,handler:function(e){this.showPopper=e,this.$emit("input",e)}},showPopper:function(e){this.disabled||(e?this.updatePopper():this.destroyPopper(),this.$emit("input",e))}},methods:{createPopper:function(){var e=this;if(!this.$isServer&&(this.currentPlacement=this.currentPlacement||this.placement,/^(top|bottom|left|right)(-start|-end)?$/g.test(this.currentPlacement))){var t=this.popperOptions,i=this.popperElm=this.popperElm||this.popper||this.$refs.popper,n=this.referenceElm=this.referenceElm||this.reference||this.$refs.reference;!n&&this.$slots.reference&&this.$slots.reference[0]&&(n=this.referenceElm=this.$slots.reference[0].elm),i&&n&&(this.visibleArrow&&this.appendArrow(i),this.appendToBody&&document.body.appendChild(this.popperElm),this.popperJS&&this.popperJS.destroy&&this.popperJS.destroy(),t.placement=this.currentPlacement,t.offset=this.offset,t.arrowOffset=this.arrowOffset,this.popperJS=new o(n,i,t),this.popperJS.onCreate(function(t){e.$emit("created",e),e.resetTransformOrigin(),e.$nextTick(e.updatePopper)}),"function"===typeof t.onUpdate&&this.popperJS.onUpdate(t.onUpdate),this.popperJS._popper.style.zIndex=r.PopupManager.nextZIndex(),this.popperElm.addEventListener("click",l))}},updatePopper:function(){var e=this.popperJS;e?(e.update(),e._popper&&(e._popper.style.zIndex=r.PopupManager.nextZIndex())):this.createPopper()},doDestroy:function(e){!this.popperJS||this.showPopper&&!e||(this.popperJS.destroy(),this.popperJS=null)},destroyPopper:function(){this.popperJS&&this.resetTransformOrigin()},resetTransformOrigin:function(){if(this.transformOrigin){var e={top:"bottom",bottom:"top",left:"right",right:"left"},t=this.popperJS._popper.getAttribute("x-placement").split("-")[0],i=e[t];this.popperJS._popper.style.transformOrigin="string"===typeof this.transformOrigin?this.transformOrigin:["top","bottom"].indexOf(t)>-1?"center "+i:i+" center"}},appendArrow:function(e){var t=void 0;if(!this.appended){for(var i in this.appended=!0,e.attributes)if(/^_v-/.test(e.attributes[i].name)){t=e.attributes[i].name;break}var n=document.createElement("div");t&&n.setAttribute(t,""),n.setAttribute("x-arrow",""),n.className="popper__arrow",e.appendChild(n)}}},beforeDestroy:function(){this.doDestroy(!0),this.popperElm&&this.popperElm.parentNode===document.body&&(this.popperElm.removeEventListener("click",l),document.body.removeChild(this.popperElm))},deactivated:function(){this.$options.beforeDestroy[0].call(this)}}},eedf:function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=100)}({0:function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,this.$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",function(){return n})},100:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("button",{staticClass:"el-button",class:[e.type?"el-button--"+e.type:"",e.buttonSize?"el-button--"+e.buttonSize:"",{"is-disabled":e.buttonDisabled,"is-loading":e.loading,"is-plain":e.plain,"is-round":e.round,"is-circle":e.circle}],attrs:{disabled:e.buttonDisabled||e.loading,autofocus:e.autofocus,type:e.nativeType},on:{click:e.handleClick}},[e.loading?i("i",{staticClass:"el-icon-loading"}):e._e(),e.icon&&!e.loading?i("i",{class:e.icon}):e._e(),e.$slots.default?i("span",[e._t("default")],2):e._e()])},s=[];n._withStripped=!0;var r={name:"ElButton",inject:{elForm:{default:""},elFormItem:{default:""}},props:{type:{type:String,default:"default"},size:String,icon:{type:String,default:""},nativeType:{type:String,default:"button"},loading:Boolean,disabled:Boolean,plain:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},buttonSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},buttonDisabled:function(){return this.disabled||(this.elForm||{}).disabled}},methods:{handleClick:function(e){this.$emit("click",e)}}},a=r,o=i(0),l=Object(o["a"])(a,n,s,!1,null,null,null);l.options.__file="packages/button/src/button.vue";var c=l.exports;c.install=function(e){e.component(c.name,c)};t["default"]=c}})},f0d9:function(e,t,i){"use strict";t.__esModule=!0,t.default={el:{colorpicker:{confirm:"确定",clear:"清空"},datepicker:{now:"此刻",today:"今天",cancel:"取消",clear:"清空",confirm:"确定",selectDate:"选择日期",selectTime:"选择时间",startDate:"开始日期",startTime:"开始时间",endDate:"结束日期",endTime:"结束时间",prevYear:"前一年",nextYear:"后一年",prevMonth:"上个月",nextMonth:"下个月",year:"年",month1:"1 月",month2:"2 月",month3:"3 月",month4:"4 月",month5:"5 月",month6:"6 月",month7:"7 月",month8:"8 月",month9:"9 月",month10:"10 月",month11:"11 月",month12:"12 月",weeks:{sun:"日",mon:"一",tue:"二",wed:"三",thu:"四",fri:"五",sat:"六"},months:{jan:"一月",feb:"二月",mar:"三月",apr:"四月",may:"五月",jun:"六月",jul:"七月",aug:"八月",sep:"九月",oct:"十月",nov:"十一月",dec:"十二月"}},select:{loading:"加载中",noMatch:"无匹配数据",noData:"无数据",placeholder:"请选择"},cascader:{noMatch:"无匹配数据",loading:"加载中",placeholder:"请选择",noData:"暂无数据"},pagination:{goto:"前往",pagesize:"条/页",total:"共 {total} 条",pageClassifier:"页"},messagebox:{title:"提示",confirm:"确定",cancel:"取消",error:"输入的数据不合法!"},upload:{deleteTip:"按 delete 键可删除",delete:"删除",preview:"查看图片",continue:"继续上传"},table:{emptyText:"暂无数据",confirmFilter:"筛选",resetFilter:"重置",clearFilter:"全部",sumText:"合计"},tree:{emptyText:"暂无数据"},transfer:{noMatch:"无匹配数据",noData:"无数据",titles:["列表 1","列表 2"],filterPlaceholder:"请输入搜索内容",noCheckedFormat:"共 {total} 项",hasCheckedFormat:"已选 {checked}/{total} 项"},image:{error:"加载失败"},pageHeader:{title:"返回"}}}},f3ad:function(e,t,i){e.exports=function(e){var t={};function i(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,i),s.l=!0,s.exports}return i.m=e,i.c=t,i.d=function(e,t,n){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},i.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(n,s,function(t){return e[t]}.bind(null,s));return n},i.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="/dist/",i(i.s=69)}({0:function(e,t,i){"use strict";function n(e,t,i,n,s,r,a,o){var l,c="function"===typeof e?e.options:e;if(t&&(c.render=t,c.staticRenderFns=i,c._compiled=!0),n&&(c.functional=!0),r&&(c._scopeId="data-v-"+r),a?(l=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),s&&s.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},c._ssrRegister=l):s&&(l=o?function(){s.call(this,this.$root.$options.shadowRoot)}:s),l)if(c.functional){c._injectStyles=l;var u=c.render;c.render=function(e,t){return l.call(t),u(e,t)}}else{var h=c.beforeCreate;c.beforeCreate=h?[].concat(h,l):[l]}return{exports:e,options:c}}i.d(t,"a",function(){return n})},11:function(e,t){e.exports=i("2bb5")},4:function(e,t){e.exports=i("d010")},69:function(e,t,i){"use strict";i.r(t);var n=function(){var e=this,t=e.$createElement,i=e._self._c||t;return i("div",{class:["textarea"===e.type?"el-textarea":"el-input",e.inputSize?"el-input--"+e.inputSize:"",{"is-disabled":e.inputDisabled,"is-exceed":e.inputExceed,"el-input-group":e.$slots.prepend||e.$slots.append,"el-input-group--append":e.$slots.append,"el-input-group--prepend":e.$slots.prepend,"el-input--prefix":e.$slots.prefix||e.prefixIcon,"el-input--suffix":e.$slots.suffix||e.suffixIcon||e.clearable||e.showPassword}],on:{mouseenter:function(t){e.hovering=!0},mouseleave:function(t){e.hovering=!1}}},["textarea"!==e.type?[e.$slots.prepend?i("div",{staticClass:"el-input-group__prepend"},[e._t("prepend")],2):e._e(),"textarea"!==e.type?i("input",e._b({ref:"input",staticClass:"el-input__inner",attrs:{tabindex:e.tabindex,type:e.showPassword?e.passwordVisible?"text":"password":e.type,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"input",e.$attrs,!1)):e._e(),e.$slots.prefix||e.prefixIcon?i("span",{staticClass:"el-input__prefix"},[e._t("prefix"),e.prefixIcon?i("i",{staticClass:"el-input__icon",class:e.prefixIcon}):e._e()],2):e._e(),e.getSuffixVisible()?i("span",{staticClass:"el-input__suffix"},[i("span",{staticClass:"el-input__suffix-inner"},[e.showClear&&e.showPwdVisible&&e.isWordLimitVisible?e._e():[e._t("suffix"),e.suffixIcon?i("i",{staticClass:"el-input__icon",class:e.suffixIcon}):e._e()],e.showClear?i("i",{staticClass:"el-input__icon el-icon-circle-close el-input__clear",on:{click:e.clear}}):e._e(),e.showPwdVisible?i("i",{staticClass:"el-input__icon el-icon-view el-input__clear",on:{click:e.handlePasswordVisible}}):e._e(),e.isWordLimitVisible?i("span",{staticClass:"el-input__count"},[i("span",{staticClass:"el-input__count-inner"},[e._v("\n "+e._s(e.textLength)+"/"+e._s(e.upperLimit)+"\n ")])]):e._e()],2),e.validateState?i("i",{staticClass:"el-input__icon",class:["el-input__validateIcon",e.validateIcon]}):e._e()]):e._e(),e.$slots.append?i("div",{staticClass:"el-input-group__append"},[e._t("append")],2):e._e()]:i("textarea",e._b({ref:"textarea",staticClass:"el-textarea__inner",style:e.textareaStyle,attrs:{tabindex:e.tabindex,disabled:e.inputDisabled,readonly:e.readonly,autocomplete:e.autoComplete||e.autocomplete,"aria-label":e.label},on:{compositionstart:e.handleCompositionStart,compositionend:e.handleCompositionEnd,input:e.handleInput,focus:e.handleFocus,blur:e.handleBlur,change:e.handleChange}},"textarea",e.$attrs,!1)),e.isWordLimitVisible&&"textarea"===e.type?i("span",{staticClass:"el-input__count"},[e._v(e._s(e.textLength)+"/"+e._s(e.upperLimit))]):e._e()],2)},s=[];n._withStripped=!0;var r=i(4),a=i.n(r),o=i(11),l=i.n(o),c=void 0,u="\n height:0 !important;\n visibility:hidden !important;\n overflow:hidden !important;\n position:absolute !important;\n z-index:-1000 !important;\n top:0 !important;\n right:0 !important\n",h=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function d(e){var t=window.getComputedStyle(e),i=t.getPropertyValue("box-sizing"),n=parseFloat(t.getPropertyValue("padding-bottom"))+parseFloat(t.getPropertyValue("padding-top")),s=parseFloat(t.getPropertyValue("border-bottom-width"))+parseFloat(t.getPropertyValue("border-top-width")),r=h.map(function(e){return e+":"+t.getPropertyValue(e)}).join(";");return{contextStyle:r,paddingSize:n,borderSize:s,boxSizing:i}}function p(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;c||(c=document.createElement("textarea"),document.body.appendChild(c));var n=d(e),s=n.paddingSize,r=n.borderSize,a=n.boxSizing,o=n.contextStyle;c.setAttribute("style",o+";"+u),c.value=e.value||e.placeholder||"";var l=c.scrollHeight,h={};"border-box"===a?l+=r:"content-box"===a&&(l-=s),c.value="";var p=c.scrollHeight-s;if(null!==t){var f=p*t;"border-box"===a&&(f=f+s+r),l=Math.max(f,l),h.minHeight=f+"px"}if(null!==i){var m=p*i;"border-box"===a&&(m=m+s+r),l=Math.min(m,l)}return h.height=l+"px",c.parentNode&&c.parentNode.removeChild(c),c=null,h}var f=i(9),m=i.n(f),v={name:"ElInput",componentName:"ElInput",mixins:[a.a,l.a],inheritAttrs:!1,inject:{elForm:{default:""},elFormItem:{default:""}},data:function(){return{textareaCalcStyle:{},hovering:!1,focused:!1,isComposing:!1,passwordVisible:!1}},props:{value:[String,Number],size:String,resize:String,form:String,disabled:Boolean,readonly:Boolean,type:{type:String,default:"text"},autosize:{type:[Boolean,Object],default:!1},autocomplete:{type:String,default:"off"},autoComplete:{type:String,validator:function(e){return!0}},validateEvent:{type:Boolean,default:!0},suffixIcon:String,prefixIcon:String,label:String,clearable:{type:Boolean,default:!1},showPassword:{type:Boolean,default:!1},showWordLimit:{type:Boolean,default:!1},tabindex:String},computed:{_elFormItemSize:function(){return(this.elFormItem||{}).elFormItemSize},validateState:function(){return this.elFormItem?this.elFormItem.validateState:""},needStatusIcon:function(){return!!this.elForm&&this.elForm.statusIcon},validateIcon:function(){return{validating:"el-icon-loading",success:"el-icon-circle-check",error:"el-icon-circle-close"}[this.validateState]},textareaStyle:function(){return m()({},this.textareaCalcStyle,{resize:this.resize})},inputSize:function(){return this.size||this._elFormItemSize||(this.$ELEMENT||{}).size},inputDisabled:function(){return this.disabled||(this.elForm||{}).disabled},nativeInputValue:function(){return null===this.value||void 0===this.value?"":String(this.value)},showClear:function(){return this.clearable&&!this.inputDisabled&&!this.readonly&&this.nativeInputValue&&(this.focused||this.hovering)},showPwdVisible:function(){return this.showPassword&&!this.inputDisabled&&!this.readonly&&(!!this.nativeInputValue||this.focused)},isWordLimitVisible:function(){return this.showWordLimit&&this.$attrs.maxlength&&("text"===this.type||"textarea"===this.type)&&!this.inputDisabled&&!this.readonly&&!this.showPassword},upperLimit:function(){return this.$attrs.maxlength},textLength:function(){return"number"===typeof this.value?String(this.value).length:(this.value||"").length},inputExceed:function(){return this.isWordLimitVisible&&this.textLength>this.upperLimit}},watch:{value:function(e){this.$nextTick(this.resizeTextarea),this.validateEvent&&this.dispatch("ElFormItem","el.form.change",[e])},nativeInputValue:function(){this.setNativeInputValue()},type:function(){var e=this;this.$nextTick(function(){e.setNativeInputValue(),e.resizeTextarea(),e.updateIconOffset()})}},methods:{focus:function(){this.getInput().focus()},blur:function(){this.getInput().blur()},getMigratingConfig:function(){return{props:{icon:"icon is removed, use suffix-icon / prefix-icon instead.","on-icon-click":"on-icon-click is removed."},events:{click:"click is removed."}}},handleBlur:function(e){this.focused=!1,this.$emit("blur",e),this.validateEvent&&this.dispatch("ElFormItem","el.form.blur",[this.value])},select:function(){this.getInput().select()},resizeTextarea:function(){if(!this.$isServer){var e=this.autosize,t=this.type;if("textarea"===t)if(e){var i=e.minRows,n=e.maxRows;this.textareaCalcStyle=p(this.$refs.textarea,i,n)}else this.textareaCalcStyle={minHeight:p(this.$refs.textarea).minHeight}}},setNativeInputValue:function(){var e=this.getInput();e&&e.value!==this.nativeInputValue&&(e.value=this.nativeInputValue)},handleFocus:function(e){this.focused=!0,this.$emit("focus",e)},handleCompositionStart:function(){this.isComposing=!0},handleCompositionEnd:function(e){this.isComposing=!1,this.handleInput(e)},handleInput:function(e){this.isComposing||e.target.value!==this.nativeInputValue&&(this.$emit("input",e.target.value),this.$nextTick(this.setNativeInputValue))},handleChange:function(e){this.$emit("change",e.target.value)},calcIconOffset:function(e){var t=[].slice.call(this.$el.querySelectorAll(".el-input__"+e)||[]);if(t.length){for(var i=null,n=0;no)J(t,n=r[o++],e[n]);return t},Z=function(t,e){return void 0===e?E(t):Y(E(t),e)},Q=function(t){var e=D.call(this,t=x(t,!0));return!(this===V&&o(U,t)&&!o(B,t))&&(!(e||!o(this,t)||!o(U,t)||o(this,F)&&this[F][t])||e)},tt=function(t,e){if(t=_(t),e=x(e,!0),t!==V||!o(U,e)||o(B,e)){var n=T(t,e);return!n||!o(U,e)||o(t,F)&&t[F][e]||(n.enumerable=!0),n}},et=function(t){var e,n=M(_(t)),r=[],i=0;while(n.length>i)o(U,e=n[i++])||e==F||e==c||r.push(e);return r},nt=function(t){var e,n=t===V,r=M(n?B:_(t)),i=[],a=0;while(r.length>a)!o(U,e=r[a++])||n&&!o(V,e)||i.push(U[e]);return i};H||(P=function(){if(this instanceof P)throw TypeError("Symbol is not a constructor!");var t=p(arguments.length>0?arguments[0]:void 0),e=function(n){this===V&&e.call(B,n),o(this,F)&&o(this[F],t)&&(this[F][t]=!1),W(this,t,O(1,n))};return i&&G&&W(V,t,{configurable:!0,set:e}),X(t)},s(P[N],"toString",function(){return this._k}),A.f=tt,k.f=J,n("6abf").f=S.f=et,n("355d").f=Q,C.f=nt,i&&!n("b8e3")&&s(V,"propertyIsEnumerable",Q,!0),h.f=function(t){return X(d(t))}),a(a.G+a.W+a.F*!H,{Symbol:P});for(var rt="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),ot=0;rt.length>ot;)d(rt[ot++]);for(var it=j(d.store),at=0;it.length>at;)v(it[at++]);a(a.S+a.F*!H,"Symbol",{for:function(t){return o(q,t+="")?q[t]:q[t]=P(t)},keyFor:function(t){if(!K(t))throw TypeError(t+" is not a symbol!");for(var e in q)if(q[e]===t)return e},useSetter:function(){G=!0},useSimple:function(){G=!1}}),a(a.S+a.F*!H,"Object",{create:Z,defineProperty:J,defineProperties:Y,getOwnPropertyDescriptor:tt,getOwnPropertyNames:et,getOwnPropertySymbols:nt});var st=u(function(){C.f(1)});a(a.S+a.F*st,"Object",{getOwnPropertySymbols:function(t){return C.f(w(t))}}),L&&a(a.S+a.F*(!H||u(function(){var t=P();return"[null]"!=R([t])||"{}"!=R({a:t})||"{}"!=R(Object(t))})),"JSON",{stringify:function(t){var e,n,r=[t],o=1;while(arguments.length>o)r.push(arguments[o++]);if(n=e=r[1],(b(e)||void 0!==t)&&!K(t))return m(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!K(e))return e}),r[1]=e,R.apply(L,r)}}),P[N][I]||n("35e8")(P[N],I,P[N].valueOf),l(P,"Symbol"),l(Math,"Math",!0),l(r.JSON,"JSON",!0)},"01f9":function(t,e,n){"use strict";var r=n("2d00"),o=n("5ca1"),i=n("2aba"),a=n("32e9"),s=n("84f2"),c=n("41a0"),u=n("7f20"),f=n("38fd"),l=n("2b4c")("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",h="keys",v="values",y=function(){return this};t.exports=function(t,e,n,m,g,b,w){c(n,e,m);var _,x,O,E=function(t){if(!p&&t in k)return k[t];switch(t){case h:return function(){return new n(this,t)};case v:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",A=g==v,C=!1,k=t.prototype,j=k[l]||k[d]||g&&k[g],T=j||E(g),$=g?A?E("entries"):T:void 0,M="Array"==e&&k.entries||j;if(M&&(O=f(M.call(new t)),O!==Object.prototype&&O.next&&(u(O,S,!0),r||"function"==typeof O[l]||a(O,l,y))),A&&j&&j.name!==v&&(C=!0,T=function(){return j.call(this)}),r&&!w||!p&&!C&&k[l]||a(k,l,T),s[e]=T,s[S]=y,g)if(_={values:A?T:E(v),keys:b?T:E(h),entries:$},w)for(x in _)x in k||i(k,x,_[x]);else o(o.P+o.F*(p||C),e,_);return _}},"0395":function(t,e,n){var r=n("36c3"),o=n("6abf").f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],s=function(t){try{return o(t)}catch(e){return a.slice()}};t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?s(t):o(r(t))}},"044b":function(t,e){function n(t){return!!t.constructor&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function r(t){return"function"===typeof t.readFloatLE&&"function"===typeof t.slice&&n(t.slice(0,0))} +/*! + * Determine if an object is a Buffer + * + * @author Feross Aboukhadijeh + * @license MIT + */ +t.exports=function(t){return null!=t&&(n(t)||r(t)||!!t._isBuffer)}},"07e3":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"097d":function(t,e,n){"use strict";var r=n("5ca1"),o=n("8378"),i=n("7726"),a=n("ebd6"),s=n("bcaa");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,o.Promise||i.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then(function(){return n})}:t,n?function(n){return s(e,t()).then(function(){throw n})}:t)}})},"0a06":function(t,e,n){"use strict";var r=n("2444"),o=n("c532"),i=n("f6b4"),a=n("5270");function s(t){this.defaults=t,this.interceptors={request:new i,response:new i}}s.prototype.request=function(t){"string"===typeof t&&(t=o.merge({url:arguments[0]},arguments[1])),t=o.merge(r,{method:"get"},this.defaults,t),t.method=t.method.toLowerCase();var e=[a,void 0],n=Promise.resolve(t);this.interceptors.request.forEach(function(t){e.unshift(t.fulfilled,t.rejected)}),this.interceptors.response.forEach(function(t){e.push(t.fulfilled,t.rejected)});while(e.length)n=n.then(e.shift(),e.shift());return n},o.forEach(["delete","get","head","options"],function(t){s.prototype[t]=function(e,n){return this.request(o.merge(n||{},{method:t,url:e}))}}),o.forEach(["post","put","patch"],function(t){s.prototype[t]=function(e,n,r){return this.request(o.merge(r||{},{method:t,url:e,data:n}))}}),t.exports=s},"0d58":function(t,e,n){var r=n("ce10"),o=n("e11e");t.exports=Object.keys||function(t){return r(t,o)}},"0df6":function(t,e,n){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},"0e15":function(t,e,n){var r=n("597f");t.exports=function(t,e,n){return void 0===n?r(t,e,!1):r(t,n,!1!==e)}},"0fc9":function(t,e,n){var r=n("3a38"),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},1098:function(t,e,n){"use strict";e.__esModule=!0;var r=n("17ed"),o=c(r),i=n("f893"),a=c(i),s="function"===typeof a.default&&"symbol"===typeof o.default?function(t){return typeof t}:function(t){return t&&"function"===typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":typeof t};function c(t){return t&&t.__esModule?t:{default:t}}e.default="function"===typeof a.default&&"symbol"===s(o.default)?function(t){return"undefined"===typeof t?"undefined":s(t)}:function(t){return t&&"function"===typeof a.default&&t.constructor===a.default&&t!==a.default.prototype?"symbol":"undefined"===typeof t?"undefined":s(t)}},1173:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},1495:function(t,e,n){var r=n("86cc"),o=n("cb7c"),i=n("0d58");t.exports=n("9e1e")?Object.defineProperties:function(t,e){o(t);var n,a=i(e),s=a.length,c=0;while(s>c)r.f(t,n=a[c++],e[n]);return t}},1654:function(t,e,n){"use strict";var r=n("71c1")(!0);n("30f1")(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=r(e,n),this._i+=t.length,{value:t,done:!1})})},1691:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},"17ed":function(t,e,n){t.exports={default:n("d8d6"),__esModule:!0}},1991:function(t,e,n){var r,o,i,a=n("9b43"),s=n("31f4"),c=n("fab2"),u=n("230e"),f=n("7726"),l=f.process,p=f.setImmediate,d=f.clearImmediate,h=f.MessageChannel,v=f.Dispatch,y=0,m={},g="onreadystatechange",b=function(){var t=+this;if(m.hasOwnProperty(t)){var e=m[t];delete m[t],e()}},w=function(t){b.call(t.data)};p&&d||(p=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return m[++y]=function(){s("function"==typeof t?t:Function(t),e)},r(y),y},d=function(t){delete m[t]},"process"==n("2d95")(l)?r=function(t){l.nextTick(a(b,t,1))}:v&&v.now?r=function(t){v.now(a(b,t,1))}:h?(o=new h,i=o.port2,o.port1.onmessage=w,r=a(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",w,!1)):r=g in u("script")?function(t){c.appendChild(u("script"))[g]=function(){c.removeChild(this),b.call(t)}}:function(t){setTimeout(a(b,t,1),0)}),t.exports={set:p,clear:d}},"1bc3":function(t,e,n){var r=n("f772");t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},"1d2b":function(t,e,n){"use strict";t.exports=function(t,e){return function(){for(var n=new Array(arguments.length),r=0;r>>0,1)},emit:function(e,n){(t[e]||[]).map(function(t){t(n)}),(t["*"]||[]).map(function(t){t(e,n)})}}}var o=t(function(t,e){var n={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};e.default=n,t.exports=e.default}),i=function(t){return Object.keys(t).map(function(e){var n=t[e].toString().replace(/"/g,""");return e+'="'+n+'"'}).join(" ")},a=o.svg,s=o.xlink,c={};c[a.name]=a.uri,c[s.name]=s.uri;var u,f=function(t,e){void 0===t&&(t="");var r=n(c,e||{}),o=i(r);return""+t+""},l=o.svg,p=o.xlink,d={attrs:(u={style:["position: absolute","width: 0","height: 0"].join("; ")},u[l.name]=l.uri,u[p.name]=p.uri,u)},h=function(t){this.config=n(d,t||{}),this.symbols=[]};h.prototype.add=function(t){var e=this,n=e.symbols,r=this.find(t.id);return r?(n[n.indexOf(r)]=t,!1):(n.push(t),!0)},h.prototype.remove=function(t){var e=this,n=e.symbols,r=this.find(t);return!!r&&(n.splice(n.indexOf(r),1),r.destroy(),!0)},h.prototype.find=function(t){return this.symbols.filter(function(e){return e.id===t})[0]||null},h.prototype.has=function(t){return null!==this.find(t)},h.prototype.stringify=function(){var t=this.config,e=t.attrs,n=this.symbols.map(function(t){return t.stringify()}).join("");return f(n,e)},h.prototype.toString=function(){return this.stringify()},h.prototype.destroy=function(){this.symbols.forEach(function(t){return t.destroy()})};var v=function(t){var e=t.id,n=t.viewBox,r=t.content;this.id=e,this.viewBox=n,this.content=r};v.prototype.stringify=function(){return this.content},v.prototype.toString=function(){return this.stringify()},v.prototype.destroy=function(){var t=this;["id","viewBox","content"].forEach(function(e){return delete t[e]})};var y=function(t){var e=!!document.importNode,n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;return e?document.importNode(n,!0):n},m=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var n={isMounted:{}};return n.isMounted.get=function(){return!!this.node},e.createFromExistingNode=function(t){return new e({id:t.getAttribute("id"),viewBox:t.getAttribute("viewBox"),content:t.outerHTML})},e.prototype.destroy=function(){this.isMounted&&this.unmount(),t.prototype.destroy.call(this)},e.prototype.mount=function(t){if(this.isMounted)return this.node;var e="string"===typeof t?document.querySelector(t):t,n=this.render();return this.node=n,e.appendChild(n),n},e.prototype.render=function(){var t=this.stringify();return y(f(t)).childNodes[0]},e.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(e.prototype,n),e}(v),g={autoConfigure:!0,mountTo:"body",syncUrlsWithBaseTag:!1,listenLocationChangeEvent:!0,locationChangeEvent:"locationChange",locationChangeAngularEmitter:!1,usagesToUpdate:"use[*|href]",moveGradientsOutsideSymbol:!1},b=function(t){return Array.prototype.slice.call(t,0)},w=navigator.userAgent,_={isChrome:/chrome/i.test(w),isFirefox:/firefox/i.test(w),isIE:/msie/i.test(w)||/trident/i.test(w),isEdge:/edge/i.test(w)},x=function(t,e){var n=document.createEvent("CustomEvent");n.initCustomEvent(t,!1,!1,e),window.dispatchEvent(n)},O=function(t){var e=[];return b(t.querySelectorAll("style")).forEach(function(t){t.textContent+="",e.push(t)}),e},E=function(t){return(t||window.location.href).split("#")[0]},S=function(t){angular.module("ng").run(["$rootScope",function(e){e.$on("$locationChangeSuccess",function(e,n,r){x(t,{oldUrl:r,newUrl:n})})}])},A="linearGradient, radialGradient, pattern",C=function(t,e){return void 0===e&&(e=A),b(t.querySelectorAll("symbol")).forEach(function(t){b(t.querySelectorAll(e)).forEach(function(e){t.parentNode.insertBefore(e,t)})}),t};function k(t,e){var n=b(t).reduce(function(t,n){if(!n.attributes)return t;var r=b(n.attributes),o=e?r.filter(e):r;return t.concat(o)},[]);return n}var j=o.xlink.uri,T="xlink:href",$=/[{}|\\\^\[\]`"<>]/g;function M(t){return t.replace($,function(t){return"%"+t[0].charCodeAt(0).toString(16).toUpperCase()})}function P(t,e,n){return b(t).forEach(function(t){var r=t.getAttribute(T);if(r&&0===r.indexOf(e)){var o=r.replace(e,n);t.setAttributeNS(j,T,o)}}),t}var L,R=["clipPath","colorProfile","src","cursor","fill","filter","marker","markerStart","markerMid","markerEnd","mask","stroke","style"],N=R.map(function(t){return"["+t+"]"}).join(","),F=function(t,e,n,r){var o=M(n),i=M(r),a=t.querySelectorAll(N),s=k(a,function(t){var e=t.localName,n=t.value;return-1!==R.indexOf(e)&&-1!==n.indexOf("url("+o)});s.forEach(function(t){return t.value=t.value.replace(o,i)}),P(e,o,i)},I={MOUNT:"mount",SYMBOL_MOUNT:"symbol_mount"},D=function(t){function e(e){var o=this;void 0===e&&(e={}),t.call(this,n(g,e));var i=r();this._emitter=i,this.node=null;var a=this,s=a.config;if(s.autoConfigure&&this._autoConfigure(e),s.syncUrlsWithBaseTag){var c=document.getElementsByTagName("base")[0].getAttribute("href");i.on(I.MOUNT,function(){return o.updateUrls("#",c)})}var u=this._handleLocationChange.bind(this);this._handleLocationChange=u,s.listenLocationChangeEvent&&window.addEventListener(s.locationChangeEvent,u),s.locationChangeAngularEmitter&&S(s.locationChangeEvent),i.on(I.MOUNT,function(t){s.moveGradientsOutsideSymbol&&C(t)}),i.on(I.SYMBOL_MOUNT,function(t){s.moveGradientsOutsideSymbol&&C(t.parentNode),(_.isIE||_.isEdge)&&O(t)})}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var o={isMounted:{}};return o.isMounted.get=function(){return!!this.node},e.prototype._autoConfigure=function(t){var e=this,n=e.config;"undefined"===typeof t.syncUrlsWithBaseTag&&(n.syncUrlsWithBaseTag="undefined"!==typeof document.getElementsByTagName("base")[0]),"undefined"===typeof t.locationChangeAngularEmitter&&(n.locationChangeAngularEmitter="angular"in window),"undefined"===typeof t.moveGradientsOutsideSymbol&&(n.moveGradientsOutsideSymbol=_.isFirefox)},e.prototype._handleLocationChange=function(t){var e=t.detail,n=e.oldUrl,r=e.newUrl;this.updateUrls(n,r)},e.prototype.add=function(e){var n=this,r=t.prototype.add.call(this,e);return this.isMounted&&r&&(e.mount(n.node),this._emitter.emit(I.SYMBOL_MOUNT,e.node)),r},e.prototype.attach=function(t){var e=this,n=this;if(n.isMounted)return n.node;var r="string"===typeof t?document.querySelector(t):t;return n.node=r,this.symbols.forEach(function(t){t.mount(n.node),e._emitter.emit(I.SYMBOL_MOUNT,t.node)}),b(r.querySelectorAll("symbol")).forEach(function(t){var e=m.createFromExistingNode(t);e.node=t,n.add(e)}),this._emitter.emit(I.MOUNT,r),r},e.prototype.destroy=function(){var t=this,e=t.config,n=t.symbols,r=t._emitter;n.forEach(function(t){return t.destroy()}),r.off("*"),window.removeEventListener(e.locationChangeEvent,this._handleLocationChange),this.isMounted&&this.unmount()},e.prototype.mount=function(t,e){void 0===t&&(t=this.config.mountTo),void 0===e&&(e=!1);var n=this;if(n.isMounted)return n.node;var r="string"===typeof t?document.querySelector(t):t,o=n.render();return this.node=o,e&&r.childNodes[0]?r.insertBefore(o,r.childNodes[0]):r.appendChild(o),this._emitter.emit(I.MOUNT,o),o},e.prototype.render=function(){return y(this.stringify())},e.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},e.prototype.updateUrls=function(t,e){if(!this.isMounted)return!1;var n=document.querySelectorAll(this.config.usagesToUpdate);return F(this.node,n,E(t)+"#",E(e)+"#"),!0},Object.defineProperties(e.prototype,o),e}(h),q=t(function(t){ +/*! + * domready (c) Dustin Diaz 2014 - License MIT + */ +!function(e,n){t.exports=n()}(0,function(){var t,e=[],n=document,r=n.documentElement.doScroll,o="DOMContentLoaded",i=(r?/^loaded|^c/:/^loaded|^i|^c/).test(n.readyState);return i||n.addEventListener(o,t=function(){n.removeEventListener(o,t),i=1;while(t=e.shift())t()}),function(t){i?setTimeout(t,0):e.push(t)}})}),U="__SVG_SPRITE_NODE__",B="__SVG_SPRITE__",V=!!window[B];V?L=window[B]:(L=new D({attrs:{id:U}}),window[B]=L);var H=function(){var t=document.getElementById(U);t?L.attach(t):L.mount(document.body,!0)};document.body?H():q(H);var z=L;return z})}).call(this,n("c8ba"))},"230e":function(t,e,n){var r=n("d3f4"),o=n("7726").document,i=r(o)&&r(o.createElement);t.exports=function(t){return i?o.createElement(t):{}}},"23c6":function(t,e,n){var r=n("2d95"),o=n("2b4c")("toStringTag"),i="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),o))?n:i?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},"241e":function(t,e,n){var r=n("25eb");t.exports=function(t){return Object(r(t))}},2444:function(t,e,n){"use strict";(function(e){var r=n("c532"),o=n("c8af"),i={"Content-Type":"application/x-www-form-urlencoded"};function a(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function s(){var t;return"undefined"!==typeof XMLHttpRequest?t=n("b50d"):"undefined"!==typeof e&&(t=n("b50d")),t}var c={adapter:s(),transformRequest:[function(t,e){return o(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(a(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)?(a(e,"application/json;charset=utf-8"),JSON.stringify(t)):t}],transformResponse:[function(t){if("string"===typeof t)try{t=JSON.parse(t)}catch(e){}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],function(t){c.headers[t]={}}),r.forEach(["post","put","patch"],function(t){c.headers[t]=r.merge(i)}),t.exports=c}).call(this,n("4362"))},"24c5":function(t,e,n){"use strict";var r,o,i,a,s=n("b8e3"),c=n("e53d"),u=n("d864"),f=n("40c3"),l=n("63b6"),p=n("f772"),d=n("79aa"),h=n("1173"),v=n("a22a"),y=n("f201"),m=n("4178").set,g=n("aba2")(),b=n("656e"),w=n("4439"),_=n("bc13"),x=n("cd78"),O="Promise",E=c.TypeError,S=c.process,A=S&&S.versions,C=A&&A.v8||"",k=c[O],j="process"==f(S),T=function(){},$=o=b.f,M=!!function(){try{var t=k.resolve(1),e=(t.constructor={})[n("5168")("species")]=function(t){t(T,T)};return(j||"function"==typeof PromiseRejectionEvent)&&t.then(T)instanceof e&&0!==C.indexOf("6.6")&&-1===_.indexOf("Chrome/66")}catch(r){}}(),P=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},L=function(t,e){if(!t._n){t._n=!0;var n=t._c;g(function(){var r=t._v,o=1==t._s,i=0,a=function(e){var n,i,a,s=o?e.ok:e.fail,c=e.resolve,u=e.reject,f=e.domain;try{s?(o||(2==t._h&&F(t),t._h=1),!0===s?n=r:(f&&f.enter(),n=s(r),f&&(f.exit(),a=!0)),n===e.promise?u(E("Promise-chain cycle")):(i=P(n))?i.call(n,c,u):c(n)):u(r)}catch(l){f&&!a&&f.exit(),u(l)}};while(n.length>i)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&R(t)})}},R=function(t){m.call(c,function(){var e,n,r,o=t._v,i=N(t);if(i&&(e=w(function(){j?S.emit("unhandledRejection",o,t):(n=c.onunhandledrejection)?n({promise:t,reason:o}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=j||N(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},N=function(t){return 1!==t._h&&0===(t._a||t._c).length},F=function(t){m.call(c,function(){var e;j?S.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})})},I=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),L(e,!0))},D=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw E("Promise can't be resolved itself");(e=P(t))?g(function(){var r={_w:n,_d:!1};try{e.call(t,u(D,r,1),u(I,r,1))}catch(o){I.call(r,o)}}):(n._v=t,n._s=1,L(n,!1))}catch(r){I.call({_w:n,_d:!1},r)}}};M||(k=function(t){h(this,k,O,"_h"),d(t),r.call(this);try{t(u(D,this,1),u(I,this,1))}catch(e){I.call(this,e)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("5c95")(k.prototype,{then:function(t,e){var n=$(y(this,k));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=j?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&L(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=u(D,t,1),this.reject=u(I,t,1)},b.f=$=function(t){return t===k||t===a?new i(t):o(t)}),l(l.G+l.W+l.F*!M,{Promise:k}),n("45f2")(k,O),n("4c95")(O),a=n("584a")[O],l(l.S+l.F*!M,O,{reject:function(t){var e=$(this),n=e.reject;return n(t),e.promise}}),l(l.S+l.F*(s||!M),O,{resolve:function(t){return x(s&&this===a?k:this,t)}}),l(l.S+l.F*!(M&&n("4ee1")(function(t){k.all(t)["catch"](T)})),O,{all:function(t){var e=this,n=$(e),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,a=1;v(t,!1,function(t){var s=i++,c=!1;n.push(void 0),a++,e.resolve(t).then(function(t){c||(c=!0,n[s]=t,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=$(e),r=n.reject,o=w(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},"25eb":function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},2621:function(t,e){e.f=Object.getOwnPropertySymbols},"268f":function(t,e,n){t.exports=n("fde4")},"27ee":function(t,e,n){var r=n("23c6"),o=n("2b4c")("iterator"),i=n("84f2");t.exports=n("8378").getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},2877:function(t,e,n){"use strict";function r(t,e,n,r,o,i,a,s){var c,u="function"===typeof t?t.options:t;if(e&&(u.render=e,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),a?(c=function(t){t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,t||"undefined"===typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(a)},u._ssrRegister=c):o&&(c=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(u.functional){u._injectStyles=c;var f=u.render;u.render=function(t,e){return c.call(e),f(t,e)}}else{var l=u.beforeCreate;u.beforeCreate=l?[].concat(l,c):[c]}return{exports:t,options:u}}n.d(e,"a",function(){return r})},"294c":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"2aba":function(t,e,n){var r=n("7726"),o=n("32e9"),i=n("69a8"),a=n("ca5a")("src"),s=n("fa5b"),c="toString",u=(""+s).split(c);n("8378").inspectSource=function(t){return s.call(t)},(t.exports=function(t,e,n,s){var c="function"==typeof n;c&&(i(n,"name")||o(n,"name",e)),t[e]!==n&&(c&&(i(n,a)||o(n,a,t[e]?""+t[e]:u.join(String(e)))),t===r?t[e]=n:s?t[e]?t[e]=n:o(t,e,n):(delete t[e],o(t,e,n)))})(Function.prototype,c,function(){return"function"==typeof this&&this[a]||s.call(this)})},"2aeb":function(t,e,n){var r=n("cb7c"),o=n("1495"),i=n("e11e"),a=n("613b")("IE_PROTO"),s=function(){},c="prototype",u=function(){var t,e=n("230e")("iframe"),r=i.length,o="<",a=">";e.style.display="none",n("fab2").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+a+"document.F=Object"+o+"/script"+a),t.close(),u=t.F;while(r--)delete u[c][i[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s[c]=r(t),n=new s,s[c]=null,n[a]=t):n=u(),void 0===e?n:o(n,e)}},"2b0e":function(t,e,n){"use strict";n.r(e),function(t){ +/*! + * Vue.js v2.6.10 + * (c) 2014-2019 Evan You + * Released under the MIT License. + */ +var n=Object.freeze({});function r(t){return void 0===t||null===t}function o(t){return void 0!==t&&null!==t}function i(t){return!0===t}function a(t){return!1===t}function s(t){return"string"===typeof t||"number"===typeof t||"symbol"===typeof t||"boolean"===typeof t}function c(t){return null!==t&&"object"===typeof t}var u=Object.prototype.toString;function f(t){return"[object Object]"===u.call(t)}function l(t){return"[object RegExp]"===u.call(t)}function p(t){var e=parseFloat(String(t));return e>=0&&Math.floor(e)===e&&isFinite(t)}function d(t){return o(t)&&"function"===typeof t.then&&"function"===typeof t.catch}function h(t){return null==t?"":Array.isArray(t)||f(t)&&t.toString===u?JSON.stringify(t,null,2):String(t)}function v(t){var e=parseFloat(t);return isNaN(e)?t:e}function y(t,e){for(var n=Object.create(null),r=t.split(","),o=0;o-1)return t.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function w(t,e){return b.call(t,e)}function _(t){var e=Object.create(null);return function(n){var r=e[n];return r||(e[n]=t(n))}}var x=/-(\w)/g,O=_(function(t){return t.replace(x,function(t,e){return e?e.toUpperCase():""})}),E=_(function(t){return t.charAt(0).toUpperCase()+t.slice(1)}),S=/\B([A-Z])/g,A=_(function(t){return t.replace(S,"-$1").toLowerCase()});function C(t,e){function n(n){var r=arguments.length;return r?r>1?t.apply(e,arguments):t.call(e,n):t.call(e)}return n._length=t.length,n}function k(t,e){return t.bind(e)}var j=Function.prototype.bind?k:C;function T(t,e){e=e||0;var n=t.length-e,r=new Array(n);while(n--)r[n]=t[n+e];return r}function $(t,e){for(var n in e)t[n]=e[n];return t}function M(t){for(var e={},n=0;n0,nt=Q&&Q.indexOf("edge/")>0,rt=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===Z),ot=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),it={}.watch,at=!1;if(J)try{var st={};Object.defineProperty(st,"passive",{get:function(){at=!0}}),window.addEventListener("test-passive",null,st)}catch(Oa){}var ct=function(){return void 0===X&&(X=!J&&!Y&&"undefined"!==typeof t&&(t["process"]&&"server"===t["process"].env.VUE_ENV)),X},ut=J&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ft(t){return"function"===typeof t&&/native code/.test(t.toString())}var lt,pt="undefined"!==typeof Symbol&&ft(Symbol)&&"undefined"!==typeof Reflect&&ft(Reflect.ownKeys);lt="undefined"!==typeof Set&&ft(Set)?Set:function(){function t(){this.set=Object.create(null)}return t.prototype.has=function(t){return!0===this.set[t]},t.prototype.add=function(t){this.set[t]=!0},t.prototype.clear=function(){this.set=Object.create(null)},t}();var dt=P,ht=0,vt=function(){this.id=ht++,this.subs=[]};vt.prototype.addSub=function(t){this.subs.push(t)},vt.prototype.removeSub=function(t){g(this.subs,t)},vt.prototype.depend=function(){vt.target&&vt.target.addDep(this)},vt.prototype.notify=function(){var t=this.subs.slice();for(var e=0,n=t.length;e-1)if(i&&!w(o,"default"))a=!1;else if(""===a||a===A(t)){var c=te(String,o.type);(c<0||s0&&(a=Ce(a,(e||"")+"_"+n),Ae(a[0])&&Ae(u)&&(f[c]=xt(u.text+a[0].text),a.shift()),f.push.apply(f,a)):s(a)?Ae(u)?f[c]=xt(u.text+a):""!==a&&f.push(xt(a)):Ae(a)&&Ae(u)?f[c]=xt(u.text+a.text):(i(t._isVList)&&o(a.tag)&&r(a.key)&&o(e)&&(a.key="__vlist"+e+"_"+n+"__"),f.push(a)));return f}function ke(t){var e=t.$options.provide;e&&(t._provided="function"===typeof e?e.call(t):e)}function je(t){var e=Te(t.$options.inject,t);e&&(jt(!1),Object.keys(e).forEach(function(n){Lt(t,n,e[n])}),jt(!0))}function Te(t,e){if(t){for(var n=Object.create(null),r=pt?Reflect.ownKeys(t):Object.keys(t),o=0;o0,a=t?!!t.$stable:!i,s=t&&t.$key;if(t){if(t._normalized)return t._normalized;if(a&&r&&r!==n&&s===r.$key&&!i&&!r.$hasNormal)return r;for(var c in o={},t)t[c]&&"$"!==c[0]&&(o[c]=Le(e,c,t[c]))}else o={};for(var u in e)u in o||(o[u]=Re(e,u));return t&&Object.isExtensible(t)&&(t._normalized=o),z(o,"$stable",a),z(o,"$key",s),z(o,"$hasNormal",i),o}function Le(t,e,n){var r=function(){var t=arguments.length?n.apply(null,arguments):n({});return t=t&&"object"===typeof t&&!Array.isArray(t)?[t]:Se(t),t&&(0===t.length||1===t.length&&t[0].isComment)?void 0:t};return n.proxy&&Object.defineProperty(t,e,{get:r,enumerable:!0,configurable:!0}),r}function Re(t,e){return function(){return t[e]}}function Ne(t,e){var n,r,i,a,s;if(Array.isArray(t)||"string"===typeof t)for(n=new Array(t.length),r=0,i=t.length;r1?T(n):n;for(var r=T(arguments,1),o='event handler for "'+t+'"',i=0,a=n.length;idocument.createEvent("Event").timeStamp&&(Xn=function(){return Kn.now()})}function Jn(){var t,e;for(Wn=Xn(),Hn=!0,qn.sort(function(t,e){return t.id-e.id}),zn=0;znzn&&qn[n].id>t.id)n--;qn.splice(n+1,0,t)}else qn.push(t);Vn||(Vn=!0,he(Jn))}}var er=0,nr=function(t,e,n,r,o){this.vm=t,o&&(t._watcher=this),t._watchers.push(this),r?(this.deep=!!r.deep,this.user=!!r.user,this.lazy=!!r.lazy,this.sync=!!r.sync,this.before=r.before):this.deep=this.user=this.lazy=this.sync=!1,this.cb=n,this.id=++er,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new lt,this.newDepIds=new lt,this.expression="","function"===typeof e?this.getter=e:(this.getter=W(e),this.getter||(this.getter=P)),this.value=this.lazy?void 0:this.get()};nr.prototype.get=function(){var t;mt(this);var e=this.vm;try{t=this.getter.call(e,e)}catch(Oa){if(!this.user)throw Oa;ee(Oa,e,'getter for watcher "'+this.expression+'"')}finally{this.deep&&ye(t),gt(),this.cleanupDeps()}return t},nr.prototype.addDep=function(t){var e=t.id;this.newDepIds.has(e)||(this.newDepIds.add(e),this.newDeps.push(t),this.depIds.has(e)||t.addSub(this))},nr.prototype.cleanupDeps=function(){var t=this.deps.length;while(t--){var e=this.deps[t];this.newDepIds.has(e.id)||e.removeSub(this)}var n=this.depIds;this.depIds=this.newDepIds,this.newDepIds=n,this.newDepIds.clear(),n=this.deps,this.deps=this.newDeps,this.newDeps=n,this.newDeps.length=0},nr.prototype.update=function(){this.lazy?this.dirty=!0:this.sync?this.run():tr(this)},nr.prototype.run=function(){if(this.active){var t=this.get();if(t!==this.value||c(t)||this.deep){var e=this.value;if(this.value=t,this.user)try{this.cb.call(this.vm,t,e)}catch(Oa){ee(Oa,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,t,e)}}},nr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},nr.prototype.depend=function(){var t=this.deps.length;while(t--)this.deps[t].depend()},nr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||g(this.vm._watchers,this);var t=this.deps.length;while(t--)this.deps[t].removeSub(this);this.active=!1}};var rr={enumerable:!0,configurable:!0,get:P,set:P};function or(t,e,n){rr.get=function(){return this[e][n]},rr.set=function(t){this[e][n]=t},Object.defineProperty(t,n,rr)}function ir(t){t._watchers=[];var e=t.$options;e.props&&ar(t,e.props),e.methods&&hr(t,e.methods),e.data?sr(t):Pt(t._data={},!0),e.computed&&fr(t,e.computed),e.watch&&e.watch!==it&&vr(t,e.watch)}function ar(t,e){var n=t.$options.propsData||{},r=t._props={},o=t.$options._propKeys=[],i=!t.$parent;i||jt(!1);var a=function(i){o.push(i);var a=Jt(i,e,n,t);Lt(r,i,a),i in t||or(t,"_props",i)};for(var s in e)a(s);jt(!0)}function sr(t){var e=t.$options.data;e=t._data="function"===typeof e?cr(e,t):e||{},f(e)||(e={});var n=Object.keys(e),r=t.$options.props,o=(t.$options.methods,n.length);while(o--){var i=n[o];0,r&&w(r,i)||H(i)||or(t,"_data",i)}Pt(e,!0)}function cr(t,e){mt();try{return t.call(e,e)}catch(Oa){return ee(Oa,e,"data()"),{}}finally{gt()}}var ur={lazy:!0};function fr(t,e){var n=t._computedWatchers=Object.create(null),r=ct();for(var o in e){var i=e[o],a="function"===typeof i?i:i.get;0,r||(n[o]=new nr(t,a||P,P,ur)),o in t||lr(t,o,i)}}function lr(t,e,n){var r=!ct();"function"===typeof n?(rr.get=r?pr(e):dr(n),rr.set=P):(rr.get=n.get?r&&!1!==n.cache?pr(e):dr(n.get):P,rr.set=n.set||P),Object.defineProperty(t,e,rr)}function pr(t){return function(){var e=this._computedWatchers&&this._computedWatchers[t];if(e)return e.dirty&&e.evaluate(),vt.target&&e.depend(),e.value}}function dr(t){return function(){return t.call(this,this)}}function hr(t,e){t.$options.props;for(var n in e)t[n]="function"!==typeof e[n]?P:j(e[n],t)}function vr(t,e){for(var n in e){var r=e[n];if(Array.isArray(r))for(var o=0;o-1)return this;var n=T(arguments,1);return n.unshift(this),"function"===typeof t.install?t.install.apply(t,n):"function"===typeof t&&t.apply(null,n),e.push(t),this}}function Sr(t){t.mixin=function(t){return this.options=Xt(this.options,t),this}}function Ar(t){t.cid=0;var e=1;t.extend=function(t){t=t||{};var n=this,r=n.cid,o=t._Ctor||(t._Ctor={});if(o[r])return o[r];var i=t.name||n.options.name;var a=function(t){this._init(t)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=e++,a.options=Xt(n.options,t),a["super"]=n,a.options.props&&Cr(a),a.options.computed&&kr(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,q.forEach(function(t){a[t]=n[t]}),i&&(a.options.components[i]=a),a.superOptions=n.options,a.extendOptions=t,a.sealedOptions=$({},a.options),o[r]=a,a}}function Cr(t){var e=t.options.props;for(var n in e)or(t.prototype,"_props",n)}function kr(t){var e=t.options.computed;for(var n in e)lr(t.prototype,n,e[n])}function jr(t){q.forEach(function(e){t[e]=function(t,n){return n?("component"===e&&f(n)&&(n.name=n.name||t,n=this.options._base.extend(n)),"directive"===e&&"function"===typeof n&&(n={bind:n,update:n}),this.options[e+"s"][t]=n,n):this.options[e+"s"][t]}})}function Tr(t){return t&&(t.Ctor.options.name||t.tag)}function $r(t,e){return Array.isArray(t)?t.indexOf(e)>-1:"string"===typeof t?t.split(",").indexOf(e)>-1:!!l(t)&&t.test(e)}function Mr(t,e){var n=t.cache,r=t.keys,o=t._vnode;for(var i in n){var a=n[i];if(a){var s=Tr(a.componentOptions);s&&!e(s)&&Pr(n,i,r,o)}}}function Pr(t,e,n,r){var o=t[e];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),t[e]=null,g(n,e)}br(Or),mr(Or),jn(Or),Pn(Or),gn(Or);var Lr=[String,RegExp,Array],Rr={name:"keep-alive",abstract:!0,props:{include:Lr,exclude:Lr,max:[String,Number]},created:function(){this.cache=Object.create(null),this.keys=[]},destroyed:function(){for(var t in this.cache)Pr(this.cache,t,this.keys)},mounted:function(){var t=this;this.$watch("include",function(e){Mr(t,function(t){return $r(e,t)})}),this.$watch("exclude",function(e){Mr(t,function(t){return!$r(e,t)})})},render:function(){var t=this.$slots.default,e=On(t),n=e&&e.componentOptions;if(n){var r=Tr(n),o=this,i=o.include,a=o.exclude;if(i&&(!r||!$r(i,r))||a&&r&&$r(a,r))return e;var s=this,c=s.cache,u=s.keys,f=null==e.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):e.key;c[f]?(e.componentInstance=c[f].componentInstance,g(u,f),u.push(f)):(c[f]=e,u.push(f),this.max&&u.length>parseInt(this.max)&&Pr(c,u[0],u,this._vnode)),e.data.keepAlive=!0}return e||t&&t[0]}},Nr={KeepAlive:Rr};function Fr(t){var e={get:function(){return B}};Object.defineProperty(t,"config",e),t.util={warn:dt,extend:$,mergeOptions:Xt,defineReactive:Lt},t.set=Rt,t.delete=Nt,t.nextTick=he,t.observable=function(t){return Pt(t),t},t.options=Object.create(null),q.forEach(function(e){t.options[e+"s"]=Object.create(null)}),t.options._base=t,$(t.options.components,Nr),Er(t),Sr(t),Ar(t),jr(t)}Fr(Or),Object.defineProperty(Or.prototype,"$isServer",{get:ct}),Object.defineProperty(Or.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Or,"FunctionalRenderContext",{value:Ye}),Or.version="2.6.10";var Ir=y("style,class"),Dr=y("input,textarea,option,select,progress"),qr=function(t,e,n){return"value"===n&&Dr(t)&&"button"!==e||"selected"===n&&"option"===t||"checked"===n&&"input"===t||"muted"===n&&"video"===t},Ur=y("contenteditable,draggable,spellcheck"),Br=y("events,caret,typing,plaintext-only"),Vr=function(t,e){return Xr(e)||"false"===e?"false":"contenteditable"===t&&Br(e)?e:"true"},Hr=y("allowfullscreen,async,autofocus,autoplay,checked,compact,controls,declare,default,defaultchecked,defaultmuted,defaultselected,defer,disabled,enabled,formnovalidate,hidden,indeterminate,inert,ismap,itemscope,loop,multiple,muted,nohref,noresize,noshade,novalidate,nowrap,open,pauseonexit,readonly,required,reversed,scoped,seamless,selected,sortable,translate,truespeed,typemustmatch,visible"),zr="http://www.w3.org/1999/xlink",Gr=function(t){return":"===t.charAt(5)&&"xlink"===t.slice(0,5)},Wr=function(t){return Gr(t)?t.slice(6,t.length):""},Xr=function(t){return null==t||!1===t};function Kr(t){var e=t.data,n=t,r=t;while(o(r.componentInstance))r=r.componentInstance._vnode,r&&r.data&&(e=Jr(r.data,e));while(o(n=n.parent))n&&n.data&&(e=Jr(e,n.data));return Yr(e.staticClass,e.class)}function Jr(t,e){return{staticClass:Zr(t.staticClass,e.staticClass),class:o(t.class)?[t.class,e.class]:e.class}}function Yr(t,e){return o(t)||o(e)?Zr(t,Qr(e)):""}function Zr(t,e){return t?e?t+" "+e:t:e||""}function Qr(t){return Array.isArray(t)?to(t):c(t)?eo(t):"string"===typeof t?t:""}function to(t){for(var e,n="",r=0,i=t.length;r-1?so[t]=e.constructor===window.HTMLUnknownElement||e.constructor===window.HTMLElement:so[t]=/HTMLUnknownElement/.test(e.toString())}var uo=y("text,number,password,search,email,tel,url");function fo(t){if("string"===typeof t){var e=document.querySelector(t);return e||document.createElement("div")}return t}function lo(t,e){var n=document.createElement(t);return"select"!==t?n:(e.data&&e.data.attrs&&void 0!==e.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n)}function po(t,e){return document.createElementNS(no[t],e)}function ho(t){return document.createTextNode(t)}function vo(t){return document.createComment(t)}function yo(t,e,n){t.insertBefore(e,n)}function mo(t,e){t.removeChild(e)}function go(t,e){t.appendChild(e)}function bo(t){return t.parentNode}function wo(t){return t.nextSibling}function _o(t){return t.tagName}function xo(t,e){t.textContent=e}function Oo(t,e){t.setAttribute(e,"")}var Eo=Object.freeze({createElement:lo,createElementNS:po,createTextNode:ho,createComment:vo,insertBefore:yo,removeChild:mo,appendChild:go,parentNode:bo,nextSibling:wo,tagName:_o,setTextContent:xo,setStyleScope:Oo}),So={create:function(t,e){Ao(e)},update:function(t,e){t.data.ref!==e.data.ref&&(Ao(t,!0),Ao(e))},destroy:function(t){Ao(t,!0)}};function Ao(t,e){var n=t.data.ref;if(o(n)){var r=t.context,i=t.componentInstance||t.elm,a=r.$refs;e?Array.isArray(a[n])?g(a[n],i):a[n]===i&&(a[n]=void 0):t.data.refInFor?Array.isArray(a[n])?a[n].indexOf(i)<0&&a[n].push(i):a[n]=[i]:a[n]=i}}var Co=new bt("",{},[]),ko=["create","activate","update","remove","destroy"];function jo(t,e){return t.key===e.key&&(t.tag===e.tag&&t.isComment===e.isComment&&o(t.data)===o(e.data)&&To(t,e)||i(t.isAsyncPlaceholder)&&t.asyncFactory===e.asyncFactory&&r(e.asyncFactory.error))}function To(t,e){if("input"!==t.tag)return!0;var n,r=o(n=t.data)&&o(n=n.attrs)&&n.type,i=o(n=e.data)&&o(n=n.attrs)&&n.type;return r===i||uo(r)&&uo(i)}function $o(t,e,n){var r,i,a={};for(r=e;r<=n;++r)i=t[r].key,o(i)&&(a[i]=r);return a}function Mo(t){var e,n,a={},c=t.modules,u=t.nodeOps;for(e=0;ev?(l=r(n[g+1])?null:n[g+1].elm,O(t,l,n,h,g,i)):h>g&&S(t,e,p,v)}function k(t,e,n,r){for(var i=n;i-1?Vo(t,e,n):Hr(e)?Xr(n)?t.removeAttribute(e):(n="allowfullscreen"===e&&"EMBED"===t.tagName?"true":e,t.setAttribute(e,n)):Ur(e)?t.setAttribute(e,Vr(e,n)):Gr(e)?Xr(n)?t.removeAttributeNS(zr,Wr(e)):t.setAttributeNS(zr,e,n):Vo(t,e,n)}function Vo(t,e,n){if(Xr(n))t.removeAttribute(e);else{if(tt&&!et&&"TEXTAREA"===t.tagName&&"placeholder"===e&&""!==n&&!t.__ieph){var r=function(e){e.stopImmediatePropagation(),t.removeEventListener("input",r)};t.addEventListener("input",r),t.__ieph=!0}t.setAttribute(e,n)}}var Ho={create:Uo,update:Uo};function zo(t,e){var n=e.elm,i=e.data,a=t.data;if(!(r(i.staticClass)&&r(i.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=Kr(e),c=n._transitionClasses;o(c)&&(s=Zr(s,Qr(c))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var Go,Wo={create:zo,update:zo},Xo="__r",Ko="__c";function Jo(t){if(o(t[Xo])){var e=tt?"change":"input";t[e]=[].concat(t[Xo],t[e]||[]),delete t[Xo]}o(t[Ko])&&(t.change=[].concat(t[Ko],t.change||[]),delete t[Ko])}function Yo(t,e,n){var r=Go;return function o(){var i=e.apply(null,arguments);null!==i&&ti(t,o,n,r)}}var Zo=ae&&!(ot&&Number(ot[1])<=53);function Qo(t,e,n,r){if(Zo){var o=Wn,i=e;e=i._wrapper=function(t){if(t.target===t.currentTarget||t.timeStamp>=o||t.timeStamp<=0||t.target.ownerDocument!==document)return i.apply(this,arguments)}}Go.addEventListener(t,e,at?{capture:n,passive:r}:n)}function ti(t,e,n,r){(r||Go).removeEventListener(t,e._wrapper||e,n)}function ei(t,e){if(!r(t.data.on)||!r(e.data.on)){var n=e.data.on||{},o=t.data.on||{};Go=e.elm,Jo(n),we(n,o,Qo,ti,Yo,e.context),Go=void 0}}var ni,ri={create:ei,update:ei};function oi(t,e){if(!r(t.data.domProps)||!r(e.data.domProps)){var n,i,a=e.elm,s=t.data.domProps||{},c=e.data.domProps||{};for(n in o(c.__ob__)&&(c=e.data.domProps=$({},c)),s)n in c||(a[n]="");for(n in c){if(i=c[n],"textContent"===n||"innerHTML"===n){if(e.children&&(e.children.length=0),i===s[n])continue;1===a.childNodes.length&&a.removeChild(a.childNodes[0])}if("value"===n&&"PROGRESS"!==a.tagName){a._value=i;var u=r(i)?"":String(i);ii(a,u)&&(a.value=u)}else if("innerHTML"===n&&oo(a.tagName)&&r(a.innerHTML)){ni=ni||document.createElement("div"),ni.innerHTML=""+i+"";var f=ni.firstChild;while(a.firstChild)a.removeChild(a.firstChild);while(f.firstChild)a.appendChild(f.firstChild)}else if(i!==s[n])try{a[n]=i}catch(Oa){}}}}function ii(t,e){return!t.composing&&("OPTION"===t.tagName||ai(t,e)||si(t,e))}function ai(t,e){var n=!0;try{n=document.activeElement!==t}catch(Oa){}return n&&t.value!==e}function si(t,e){var n=t.value,r=t._vModifiers;if(o(r)){if(r.number)return v(n)!==v(e);if(r.trim)return n.trim()!==e.trim()}return n!==e}var ci={create:oi,update:oi},ui=_(function(t){var e={},n=/;(?![^(]*\))/g,r=/:(.+)/;return t.split(n).forEach(function(t){if(t){var n=t.split(r);n.length>1&&(e[n[0].trim()]=n[1].trim())}}),e});function fi(t){var e=li(t.style);return t.staticStyle?$(t.staticStyle,e):e}function li(t){return Array.isArray(t)?M(t):"string"===typeof t?ui(t):t}function pi(t,e){var n,r={};if(e){var o=t;while(o.componentInstance)o=o.componentInstance._vnode,o&&o.data&&(n=fi(o.data))&&$(r,n)}(n=fi(t.data))&&$(r,n);var i=t;while(i=i.parent)i.data&&(n=fi(i.data))&&$(r,n);return r}var di,hi=/^--/,vi=/\s*!important$/,yi=function(t,e,n){if(hi.test(e))t.style.setProperty(e,n);else if(vi.test(n))t.style.setProperty(A(e),n.replace(vi,""),"important");else{var r=gi(e);if(Array.isArray(n))for(var o=0,i=n.length;o-1?e.split(_i).forEach(function(e){return t.classList.add(e)}):t.classList.add(e);else{var n=" "+(t.getAttribute("class")||"")+" ";n.indexOf(" "+e+" ")<0&&t.setAttribute("class",(n+e).trim())}}function Oi(t,e){if(e&&(e=e.trim()))if(t.classList)e.indexOf(" ")>-1?e.split(_i).forEach(function(e){return t.classList.remove(e)}):t.classList.remove(e),t.classList.length||t.removeAttribute("class");else{var n=" "+(t.getAttribute("class")||"")+" ",r=" "+e+" ";while(n.indexOf(r)>=0)n=n.replace(r," ");n=n.trim(),n?t.setAttribute("class",n):t.removeAttribute("class")}}function Ei(t){if(t){if("object"===typeof t){var e={};return!1!==t.css&&$(e,Si(t.name||"v")),$(e,t),e}return"string"===typeof t?Si(t):void 0}}var Si=_(function(t){return{enterClass:t+"-enter",enterToClass:t+"-enter-to",enterActiveClass:t+"-enter-active",leaveClass:t+"-leave",leaveToClass:t+"-leave-to",leaveActiveClass:t+"-leave-active"}}),Ai=J&&!et,Ci="transition",ki="animation",ji="transition",Ti="transitionend",$i="animation",Mi="animationend";Ai&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ji="WebkitTransition",Ti="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&($i="WebkitAnimation",Mi="webkitAnimationEnd"));var Pi=J?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(t){return t()};function Li(t){Pi(function(){Pi(t)})}function Ri(t,e){var n=t._transitionClasses||(t._transitionClasses=[]);n.indexOf(e)<0&&(n.push(e),xi(t,e))}function Ni(t,e){t._transitionClasses&&g(t._transitionClasses,e),Oi(t,e)}function Fi(t,e,n){var r=Di(t,e),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s=o===Ci?Ti:Mi,c=0,u=function(){t.removeEventListener(s,f),n()},f=function(e){e.target===t&&++c>=a&&u()};setTimeout(function(){c0&&(n=Ci,f=a,l=i.length):e===ki?u>0&&(n=ki,f=u,l=c.length):(f=Math.max(a,u),n=f>0?a>u?Ci:ki:null,l=n?n===Ci?i.length:c.length:0);var p=n===Ci&&Ii.test(r[ji+"Property"]);return{type:n,timeout:f,propCount:l,hasTransform:p}}function qi(t,e){while(t.length1}function Gi(t,e){!0!==e.data.show&&Bi(e)}var Wi=J?{create:Gi,activate:Gi,remove:function(t,e){!0!==t.data.show?Vi(t,e):e()}}:{},Xi=[Ho,Wo,ri,ci,wi,Wi],Ki=Xi.concat(qo),Ji=Mo({nodeOps:Eo,modules:Ki});et&&document.addEventListener("selectionchange",function(){var t=document.activeElement;t&&t.vmodel&&oa(t,"input")});var Yi={inserted:function(t,e,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?_e(n,"postpatch",function(){Yi.componentUpdated(t,e,n)}):Zi(t,e,n.context),t._vOptions=[].map.call(t.options,ea)):("textarea"===n.tag||uo(t.type))&&(t._vModifiers=e.modifiers,e.modifiers.lazy||(t.addEventListener("compositionstart",na),t.addEventListener("compositionend",ra),t.addEventListener("change",ra),et&&(t.vmodel=!0)))},componentUpdated:function(t,e,n){if("select"===n.tag){Zi(t,e,n.context);var r=t._vOptions,o=t._vOptions=[].map.call(t.options,ea);if(o.some(function(t,e){return!N(t,r[e])})){var i=t.multiple?e.value.some(function(t){return ta(t,o)}):e.value!==e.oldValue&&ta(e.value,o);i&&oa(t,"change")}}}};function Zi(t,e,n){Qi(t,e,n),(tt||nt)&&setTimeout(function(){Qi(t,e,n)},0)}function Qi(t,e,n){var r=e.value,o=t.multiple;if(!o||Array.isArray(r)){for(var i,a,s=0,c=t.options.length;s-1,a.selected!==i&&(a.selected=i);else if(N(ea(a),r))return void(t.selectedIndex!==s&&(t.selectedIndex=s));o||(t.selectedIndex=-1)}}function ta(t,e){return e.every(function(e){return!N(e,t)})}function ea(t){return"_value"in t?t._value:t.value}function na(t){t.target.composing=!0}function ra(t){t.target.composing&&(t.target.composing=!1,oa(t.target,"input"))}function oa(t,e){var n=document.createEvent("HTMLEvents");n.initEvent(e,!0,!0),t.dispatchEvent(n)}function ia(t){return!t.componentInstance||t.data&&t.data.transition?t:ia(t.componentInstance._vnode)}var aa={bind:function(t,e,n){var r=e.value;n=ia(n);var o=n.data&&n.data.transition,i=t.__vOriginalDisplay="none"===t.style.display?"":t.style.display;r&&o?(n.data.show=!0,Bi(n,function(){t.style.display=i})):t.style.display=r?i:"none"},update:function(t,e,n){var r=e.value,o=e.oldValue;if(!r!==!o){n=ia(n);var i=n.data&&n.data.transition;i?(n.data.show=!0,r?Bi(n,function(){t.style.display=t.__vOriginalDisplay}):Vi(n,function(){t.style.display="none"})):t.style.display=r?t.__vOriginalDisplay:"none"}},unbind:function(t,e,n,r,o){o||(t.style.display=t.__vOriginalDisplay)}},sa={model:Yi,show:aa},ca={name:String,appear:Boolean,css:Boolean,mode:String,type:String,enterClass:String,leaveClass:String,enterToClass:String,leaveToClass:String,enterActiveClass:String,leaveActiveClass:String,appearClass:String,appearActiveClass:String,appearToClass:String,duration:[Number,String,Object]};function ua(t){var e=t&&t.componentOptions;return e&&e.Ctor.options.abstract?ua(On(e.children)):t}function fa(t){var e={},n=t.$options;for(var r in n.propsData)e[r]=t[r];var o=n._parentListeners;for(var i in o)e[O(i)]=o[i];return e}function la(t,e){if(/\d-keep-alive$/.test(e.tag))return t("keep-alive",{props:e.componentOptions.propsData})}function pa(t){while(t=t.parent)if(t.data.transition)return!0}function da(t,e){return e.key===t.key&&e.tag===t.tag}var ha=function(t){return t.tag||xn(t)},va=function(t){return"show"===t.name},ya={name:"transition",props:ca,abstract:!0,render:function(t){var e=this,n=this.$slots.default;if(n&&(n=n.filter(ha),n.length)){0;var r=this.mode;0;var o=n[0];if(pa(this.$vnode))return o;var i=ua(o);if(!i)return o;if(this._leaving)return la(t,o);var a="__transition-"+this._uid+"-";i.key=null==i.key?i.isComment?a+"comment":a+i.tag:s(i.key)?0===String(i.key).indexOf(a)?i.key:a+i.key:i.key;var c=(i.data||(i.data={})).transition=fa(this),u=this._vnode,f=ua(u);if(i.data.directives&&i.data.directives.some(va)&&(i.data.show=!0),f&&f.data&&!da(i,f)&&!xn(f)&&(!f.componentInstance||!f.componentInstance._vnode.isComment)){var l=f.data.transition=$({},c);if("out-in"===r)return this._leaving=!0,_e(l,"afterLeave",function(){e._leaving=!1,e.$forceUpdate()}),la(t,o);if("in-out"===r){if(xn(i))return u;var p,d=function(){p()};_e(c,"afterEnter",d),_e(c,"enterCancelled",d),_e(l,"delayLeave",function(t){p=t})}}return o}}},ma=$({tag:String,moveClass:String},ca);delete ma.mode;var ga={props:ma,beforeMount:function(){var t=this,e=this._update;this._update=function(n,r){var o=$n(t);t.__patch__(t._vnode,t.kept,!1,!0),t._vnode=t.kept,o(),e.call(t,n,r)}},render:function(t){for(var e=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=fa(this),s=0;s=2)t.mixin({beforeCreate:r});else{var n=t.prototype._init;t.prototype._init=function(t){void 0===t&&(t={}),t.init=t.init?[r].concat(t.init):r,n.call(this,t)}}function r(){var t=this.$options;t.store?this.$store="function"===typeof t.store?t.store():t.store:t.parent&&t.parent.$store&&(this.$store=t.parent.$store)}}n.d(e,"b",function(){return $});var o="undefined"!==typeof window&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function i(t){o&&(t._devtoolHook=o,o.emit("vuex:init",t),o.on("vuex:travel-to-state",function(e){t.replaceState(e)}),t.subscribe(function(t,e){o.emit("vuex:mutation",t,e)}))}function a(t,e){Object.keys(t).forEach(function(n){return e(t[n],n)})}function s(t){return null!==t&&"object"===typeof t}function c(t){return t&&"function"===typeof t.then}var u=function(t,e){this.runtime=e,this._children=Object.create(null),this._rawModule=t;var n=t.state;this.state=("function"===typeof n?n():n)||{}},f={namespaced:{configurable:!0}};f.namespaced.get=function(){return!!this._rawModule.namespaced},u.prototype.addChild=function(t,e){this._children[t]=e},u.prototype.removeChild=function(t){delete this._children[t]},u.prototype.getChild=function(t){return this._children[t]},u.prototype.update=function(t){this._rawModule.namespaced=t.namespaced,t.actions&&(this._rawModule.actions=t.actions),t.mutations&&(this._rawModule.mutations=t.mutations),t.getters&&(this._rawModule.getters=t.getters)},u.prototype.forEachChild=function(t){a(this._children,t)},u.prototype.forEachGetter=function(t){this._rawModule.getters&&a(this._rawModule.getters,t)},u.prototype.forEachAction=function(t){this._rawModule.actions&&a(this._rawModule.actions,t)},u.prototype.forEachMutation=function(t){this._rawModule.mutations&&a(this._rawModule.mutations,t)},Object.defineProperties(u.prototype,f);var l=function(t){this.register([],t,!1)};function p(t,e,n){if(e.update(n),n.modules)for(var r in n.modules){if(!e.getChild(r))return void 0;p(t.concat(r),e.getChild(r),n.modules[r])}}l.prototype.get=function(t){return t.reduce(function(t,e){return t.getChild(e)},this.root)},l.prototype.getNamespace=function(t){var e=this.root;return t.reduce(function(t,n){return e=e.getChild(n),t+(e.namespaced?n+"/":"")},"")},l.prototype.update=function(t){p([],this.root,t)},l.prototype.register=function(t,e,n){var r=this;void 0===n&&(n=!0);var o=new u(e,n);if(0===t.length)this.root=o;else{var i=this.get(t.slice(0,-1));i.addChild(t[t.length-1],o)}e.modules&&a(e.modules,function(e,o){r.register(t.concat(o),e,n)})},l.prototype.unregister=function(t){var e=this.get(t.slice(0,-1)),n=t[t.length-1];e.getChild(n).runtime&&e.removeChild(n)};var d;var h=function(t){var e=this;void 0===t&&(t={}),!d&&"undefined"!==typeof window&&window.Vue&&k(window.Vue);var n=t.plugins;void 0===n&&(n=[]);var r=t.strict;void 0===r&&(r=!1),this._committing=!1,this._actions=Object.create(null),this._actionSubscribers=[],this._mutations=Object.create(null),this._wrappedGetters=Object.create(null),this._modules=new l(t),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new d;var o=this,a=this,s=a.dispatch,c=a.commit;this.dispatch=function(t,e){return s.call(o,t,e)},this.commit=function(t,e,n){return c.call(o,t,e,n)},this.strict=r;var u=this._modules.root.state;b(this,u,[],this._modules.root),g(this,u),n.forEach(function(t){return t(e)});var f=void 0!==t.devtools?t.devtools:d.config.devtools;f&&i(this)},v={state:{configurable:!0}};function y(t,e){return e.indexOf(t)<0&&e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function m(t,e){t._actions=Object.create(null),t._mutations=Object.create(null),t._wrappedGetters=Object.create(null),t._modulesNamespaceMap=Object.create(null);var n=t.state;b(t,n,[],t._modules.root,!0),g(t,n,e)}function g(t,e,n){var r=t._vm;t.getters={};var o=t._wrappedGetters,i={};a(o,function(e,n){i[n]=function(){return e(t)},Object.defineProperty(t.getters,n,{get:function(){return t._vm[n]},enumerable:!0})});var s=d.config.silent;d.config.silent=!0,t._vm=new d({data:{$$state:e},computed:i}),d.config.silent=s,t.strict&&S(t),r&&(n&&t._withCommit(function(){r._data.$$state=null}),d.nextTick(function(){return r.$destroy()}))}function b(t,e,n,r,o){var i=!n.length,a=t._modules.getNamespace(n);if(r.namespaced&&(t._modulesNamespaceMap[a]=r),!i&&!o){var s=A(e,n.slice(0,-1)),c=n[n.length-1];t._withCommit(function(){d.set(s,c,r.state)})}var u=r.context=w(t,a,n);r.forEachMutation(function(e,n){var r=a+n;x(t,r,e,u)}),r.forEachAction(function(e,n){var r=e.root?n:a+n,o=e.handler||e;O(t,r,o,u)}),r.forEachGetter(function(e,n){var r=a+n;E(t,r,e,u)}),r.forEachChild(function(r,i){b(t,e,n.concat(i),r,o)})}function w(t,e,n){var r=""===e,o={dispatch:r?t.dispatch:function(n,r,o){var i=C(n,r,o),a=i.payload,s=i.options,c=i.type;return s&&s.root||(c=e+c),t.dispatch(c,a)},commit:r?t.commit:function(n,r,o){var i=C(n,r,o),a=i.payload,s=i.options,c=i.type;s&&s.root||(c=e+c),t.commit(c,a,s)}};return Object.defineProperties(o,{getters:{get:r?function(){return t.getters}:function(){return _(t,e)}},state:{get:function(){return A(t.state,n)}}}),o}function _(t,e){var n={},r=e.length;return Object.keys(t.getters).forEach(function(o){if(o.slice(0,r)===e){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return t.getters[o]},enumerable:!0})}}),n}function x(t,e,n,r){var o=t._mutations[e]||(t._mutations[e]=[]);o.push(function(e){n.call(t,r.state,e)})}function O(t,e,n,r){var o=t._actions[e]||(t._actions[e]=[]);o.push(function(e,o){var i=n.call(t,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:t.getters,rootState:t.state},e,o);return c(i)||(i=Promise.resolve(i)),t._devtoolHook?i.catch(function(e){throw t._devtoolHook.emit("vuex:error",e),e}):i})}function E(t,e,n,r){t._wrappedGetters[e]||(t._wrappedGetters[e]=function(t){return n(r.state,r.getters,t.state,t.getters)})}function S(t){t._vm.$watch(function(){return this._data.$$state},function(){0},{deep:!0,sync:!0})}function A(t,e){return e.length?e.reduce(function(t,e){return t[e]},t):t}function C(t,e,n){return s(t)&&t.type&&(n=e,e=t,t=t.type),{type:t,payload:e,options:n}}function k(t){d&&t===d||(d=t,r(d))}v.state.get=function(){return this._vm._data.$$state},v.state.set=function(t){0},h.prototype.commit=function(t,e,n){var r=this,o=C(t,e,n),i=o.type,a=o.payload,s=(o.options,{type:i,payload:a}),c=this._mutations[i];c&&(this._withCommit(function(){c.forEach(function(t){t(a)})}),this._subscribers.forEach(function(t){return t(s,r.state)}))},h.prototype.dispatch=function(t,e){var n=this,r=C(t,e),o=r.type,i=r.payload,a={type:o,payload:i},s=this._actions[o];if(s){try{this._actionSubscribers.filter(function(t){return t.before}).forEach(function(t){return t.before(a,n.state)})}catch(u){0}var c=s.length>1?Promise.all(s.map(function(t){return t(i)})):s[0](i);return c.then(function(t){try{n._actionSubscribers.filter(function(t){return t.after}).forEach(function(t){return t.after(a,n.state)})}catch(u){0}return t})}},h.prototype.subscribe=function(t){return y(t,this._subscribers)},h.prototype.subscribeAction=function(t){var e="function"===typeof t?{before:t}:t;return y(e,this._actionSubscribers)},h.prototype.watch=function(t,e,n){var r=this;return this._watcherVM.$watch(function(){return t(r.state,r.getters)},e,n)},h.prototype.replaceState=function(t){var e=this;this._withCommit(function(){e._vm._data.$$state=t})},h.prototype.registerModule=function(t,e,n){void 0===n&&(n={}),"string"===typeof t&&(t=[t]),this._modules.register(t,e),b(this,this.state,t,this._modules.get(t),n.preserveState),g(this,this.state)},h.prototype.unregisterModule=function(t){var e=this;"string"===typeof t&&(t=[t]),this._modules.unregister(t),this._withCommit(function(){var n=A(e.state,t.slice(0,-1));d.delete(n,t[t.length-1])}),m(this)},h.prototype.hotUpdate=function(t){this._modules.update(t),m(this,!0)},h.prototype._withCommit=function(t){var e=this._committing;this._committing=!0,t(),this._committing=e},Object.defineProperties(h.prototype,v);var j=R(function(t,e){var n={};return L(e).forEach(function(e){var r=e.key,o=e.val;n[r]=function(){var e=this.$store.state,n=this.$store.getters;if(t){var r=N(this.$store,"mapState",t);if(!r)return;e=r.context.state,n=r.context.getters}return"function"===typeof o?o.call(this,e,n):e[o]},n[r].vuex=!0}),n}),T=R(function(t,e){var n={};return L(e).forEach(function(e){var r=e.key,o=e.val;n[r]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var r=this.$store.commit;if(t){var i=N(this.$store,"mapMutations",t);if(!i)return;r=i.context.commit}return"function"===typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}}),n}),$=R(function(t,e){var n={};return L(e).forEach(function(e){var r=e.key,o=e.val;o=t+o,n[r]=function(){if(!t||N(this.$store,"mapGetters",t))return this.$store.getters[o]},n[r].vuex=!0}),n}),M=R(function(t,e){var n={};return L(e).forEach(function(e){var r=e.key,o=e.val;n[r]=function(){var e=[],n=arguments.length;while(n--)e[n]=arguments[n];var r=this.$store.dispatch;if(t){var i=N(this.$store,"mapActions",t);if(!i)return;r=i.context.dispatch}return"function"===typeof o?o.apply(this,[r].concat(e)):r.apply(this.$store,[o].concat(e))}}),n}),P=function(t){return{mapState:j.bind(null,t),mapGetters:$.bind(null,t),mapMutations:T.bind(null,t),mapActions:M.bind(null,t)}};function L(t){return Array.isArray(t)?t.map(function(t){return{key:t,val:t}}):Object.keys(t).map(function(e){return{key:e,val:t[e]}})}function R(t){return function(e,n){return"string"!==typeof e?(n=e,e=""):"/"!==e.charAt(e.length-1)&&(e+="/"),t(e,n)}}function N(t,e,n){var r=t._modulesNamespaceMap[n];return r}var F={Store:h,install:k,version:"3.1.0",mapState:j,mapMutations:T,mapGetters:$,mapActions:M,createNamespacedHelpers:P};e["a"]=F},3024:function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},"30b5":function(t,e,n){"use strict";var r=n("c532");function o(t){return encodeURIComponent(t).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}t.exports=function(t,e,n){if(!e)return t;var i;if(n)i=n(e);else if(r.isURLSearchParams(e))i=e.toString();else{var a=[];r.forEach(e,function(t,e){null!==t&&"undefined"!==typeof t&&(r.isArray(t)?e+="[]":t=[t],r.forEach(t,function(t){r.isDate(t)?t=t.toISOString():r.isObject(t)&&(t=JSON.stringify(t)),a.push(o(e)+"="+o(t))}))}),i=a.join("&")}return i&&(t+=(-1===t.indexOf("?")?"?":"&")+i),t}},"30f1":function(t,e,n){"use strict";var r=n("b8e3"),o=n("63b6"),i=n("9138"),a=n("35e8"),s=n("481b"),c=n("8f60"),u=n("45f2"),f=n("53e2"),l=n("5168")("iterator"),p=!([].keys&&"next"in[].keys()),d="@@iterator",h="keys",v="values",y=function(){return this};t.exports=function(t,e,n,m,g,b,w){c(n,e,m);var _,x,O,E=function(t){if(!p&&t in k)return k[t];switch(t){case h:return function(){return new n(this,t)};case v:return function(){return new n(this,t)}}return function(){return new n(this,t)}},S=e+" Iterator",A=g==v,C=!1,k=t.prototype,j=k[l]||k[d]||g&&k[g],T=j||E(g),$=g?A?E("entries"):T:void 0,M="Array"==e&&k.entries||j;if(M&&(O=f(M.call(new t)),O!==Object.prototype&&O.next&&(u(O,S,!0),r||"function"==typeof O[l]||a(O,l,y))),A&&j&&j.name!==v&&(C=!0,T=function(){return j.call(this)}),r&&!w||!p&&!C&&k[l]||a(k,l,T),s[e]=T,s[S]=y,g)if(_={values:A?T:E(v),keys:b?T:E(h),entries:$},w)for(x in _)x in k||i(k,x,_[x]);else o(o.P+o.F*(p||C),e,_);return _}},"31f4":function(t,e){t.exports=function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}return t.apply(n,e)}},"323e":function(t,e,n){var r,o; +/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress + * @license MIT */(function(i,a){r=a,o="function"===typeof r?r.call(e,n,e,t):r,void 0===o||(t.exports=o)})(0,function(){var t={version:"0.2.0"},e=t.settings={minimum:.08,easing:"ease",positionUsing:"",speed:200,trickle:!0,trickleRate:.02,trickleSpeed:800,showSpinner:!0,barSelector:'[role="bar"]',spinnerSelector:'[role="spinner"]',parent:"body",template:'
'};function n(t,e,n){return tn?n:t}function r(t){return 100*(-1+t)}function o(t,n,o){var i;return i="translate3d"===e.positionUsing?{transform:"translate3d("+r(t)+"%,0,0)"}:"translate"===e.positionUsing?{transform:"translate("+r(t)+"%,0)"}:{"margin-left":r(t)+"%"},i.transition="all "+n+"ms "+o,i}t.configure=function(t){var n,r;for(n in t)r=t[n],void 0!==r&&t.hasOwnProperty(n)&&(e[n]=r);return this},t.status=null,t.set=function(r){var s=t.isStarted();r=n(r,e.minimum,1),t.status=1===r?null:r;var c=t.render(!s),u=c.querySelector(e.barSelector),f=e.speed,l=e.easing;return c.offsetWidth,i(function(n){""===e.positionUsing&&(e.positionUsing=t.getPositioningCSS()),a(u,o(r,f,l)),1===r?(a(c,{transition:"none",opacity:1}),c.offsetWidth,setTimeout(function(){a(c,{transition:"all "+f+"ms linear",opacity:0}),setTimeout(function(){t.remove(),n()},f)},f)):setTimeout(n,f)}),this},t.isStarted=function(){return"number"===typeof t.status},t.start=function(){t.status||t.set(0);var n=function(){setTimeout(function(){t.status&&(t.trickle(),n())},e.trickleSpeed)};return e.trickle&&n(),this},t.done=function(e){return e||t.status?t.inc(.3+.5*Math.random()).set(1):this},t.inc=function(e){var r=t.status;return r?("number"!==typeof e&&(e=(1-r)*n(Math.random()*r,.1,.95)),r=n(r+e,0,.994),t.set(r)):t.start()},t.trickle=function(){return t.inc(Math.random()*e.trickleRate)},function(){var e=0,n=0;t.promise=function(r){return r&&"resolved"!==r.state()?(0===n&&t.start(),e++,n++,r.always(function(){n--,0===n?(e=0,t.done()):t.set((e-n)/e)}),this):this}}(),t.render=function(n){if(t.isRendered())return document.getElementById("nprogress");c(document.documentElement,"nprogress-busy");var o=document.createElement("div");o.id="nprogress",o.innerHTML=e.template;var i,s=o.querySelector(e.barSelector),u=n?"-100":r(t.status||0),f=document.querySelector(e.parent);return a(s,{transition:"all 0 linear",transform:"translate3d("+u+"%,0,0)"}),e.showSpinner||(i=o.querySelector(e.spinnerSelector),i&&l(i)),f!=document.body&&c(f,"nprogress-custom-parent"),f.appendChild(o),o},t.remove=function(){u(document.documentElement,"nprogress-busy"),u(document.querySelector(e.parent),"nprogress-custom-parent");var t=document.getElementById("nprogress");t&&l(t)},t.isRendered=function(){return!!document.getElementById("nprogress")},t.getPositioningCSS=function(){var t=document.body.style,e="WebkitTransform"in t?"Webkit":"MozTransform"in t?"Moz":"msTransform"in t?"ms":"OTransform"in t?"O":"";return e+"Perspective"in t?"translate3d":e+"Transform"in t?"translate":"margin"};var i=function(){var t=[];function e(){var n=t.shift();n&&n(e)}return function(n){t.push(n),1==t.length&&e()}}(),a=function(){var t=["Webkit","O","Moz","ms"],e={};function n(t){return t.replace(/^-ms-/,"ms-").replace(/-([\da-z])/gi,function(t,e){return e.toUpperCase()})}function r(e){var n=document.body.style;if(e in n)return e;var r,o=t.length,i=e.charAt(0).toUpperCase()+e.slice(1);while(o--)if(r=t[o]+i,r in n)return r;return e}function o(t){return t=n(t),e[t]||(e[t]=r(t))}function i(t,e,n){e=o(e),t.style[e]=n}return function(t,e){var n,r,o=arguments;if(2==o.length)for(n in e)r=e[n],void 0!==r&&e.hasOwnProperty(n)&&i(t,n,r);else i(t,o[1],o[2])}}();function s(t,e){var n="string"==typeof t?t:f(t);return n.indexOf(" "+e+" ")>=0}function c(t,e){var n=f(t),r=n+e;s(n,e)||(t.className=r.substring(1))}function u(t,e){var n,r=f(t);s(t,e)&&(n=r.replace(" "+e+" "," "),t.className=n.substring(1,n.length-1))}function f(t){return(" "+(t.className||"")+" ").replace(/\s+/gi," ")}function l(t){t&&t.parentNode&&t.parentNode.removeChild(t)}return t})},"32a6":function(t,e,n){var r=n("241e"),o=n("c3a1");n("ce7e")("keys",function(){return function(t){return o(r(t))}})},"32e9":function(t,e,n){var r=n("86cc"),o=n("4630");t.exports=n("9e1e")?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},"32fc":function(t,e,n){var r=n("e53d").document;t.exports=r&&r.documentElement},"335c":function(t,e,n){var r=n("6b4c");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},"33a4":function(t,e,n){var r=n("84f2"),o=n("2b4c")("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},"355d":function(t,e){e.f={}.propertyIsEnumerable},"35e8":function(t,e,n){var r=n("d9f6"),o=n("aebd");t.exports=n("8e60")?function(t,e,n){return r.f(t,e,o(1,n))}:function(t,e,n){return t[e]=n,t}},"36c3":function(t,e,n){var r=n("335c"),o=n("25eb");t.exports=function(t){return r(o(t))}},3702:function(t,e,n){var r=n("481b"),o=n("5168")("iterator"),i=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||i[o]===t)}},"387f":function(t,e,n){"use strict";t.exports=function(t,e,n,r,o){return t.config=e,n&&(t.code=n),t.request=r,t.response=o,t}},"38fd":function(t,e,n){var r=n("69a8"),o=n("4bf8"),i=n("613b")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},3934:function(t,e,n){"use strict";var r=n("c532");t.exports=r.isStandardBrowserEnv()?function(){var t,e=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function o(t){var r=t;return e&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return t=o(window.location.href),function(e){var n=r.isString(e)?o(e):e;return n.protocol===t.protocol&&n.host===t.host}}():function(){return function(){return!0}}()},"3a38":function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},"3b8d":function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n("795b"),o=n.n(r);function i(t,e,n,r,i,a,s){try{var c=t[a](s),u=c.value}catch(f){return void n(f)}c.done?e(u):o.a.resolve(u).then(r,i)}function a(t){return function(){var e=this,n=arguments;return new o.a(function(r,o){var a=t.apply(e,n);function s(t){i(a,r,o,s,c,"next",t)}function c(t){i(a,r,o,s,c,"throw",t)}s(void 0)})}}},"3c11":function(t,e,n){"use strict";var r=n("63b6"),o=n("584a"),i=n("e53d"),a=n("f201"),s=n("cd78");r(r.P+r.R,"Promise",{finally:function(t){var e=a(this,o.Promise||i.Promise),n="function"==typeof t;return this.then(n?function(n){return s(e,t()).then(function(){return n})}:t,n?function(n){return s(e,t()).then(function(){throw n})}:t)}})},"3c4e":function(t,e,n){"use strict";var r=function(t){return o(t)&&!i(t)};function o(t){return!!t&&"object"===typeof t}function i(t){var e=Object.prototype.toString.call(t);return"[object RegExp]"===e||"[object Date]"===e||c(t)}var a="function"===typeof Symbol&&Symbol.for,s=a?Symbol.for("react.element"):60103;function c(t){return t.$$typeof===s}function u(t){return Array.isArray(t)?[]:{}}function f(t,e){var n=e&&!0===e.clone;return n&&r(t)?d(u(t),t,e):t}function l(t,e,n){var o=t.slice();return e.forEach(function(e,i){"undefined"===typeof o[i]?o[i]=f(e,n):r(e)?o[i]=d(t[i],e,n):-1===t.indexOf(e)&&o.push(f(e,n))}),o}function p(t,e,n){var o={};return r(t)&&Object.keys(t).forEach(function(e){o[e]=f(t[e],n)}),Object.keys(e).forEach(function(i){r(e[i])&&t[i]?o[i]=d(t[i],e[i],n):o[i]=f(e[i],n)}),o}function d(t,e,n){var r=Array.isArray(e),o=Array.isArray(t),i=n||{arrayMerge:l},a=r===o;if(a){if(r){var s=i.arrayMerge||l;return s(t,e,n)}return p(t,e,n)}return f(e,n)}d.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce(function(t,n){return d(t,n,e)})};var h=d;t.exports=h},"3f6b":function(t,e,n){t.exports={default:n("51b6"),__esModule:!0}},"40c3":function(t,e,n){var r=n("6b4c"),o=n("5168")("toStringTag"),i="Arguments"==r(function(){return arguments}()),a=function(t,e){try{return t[e]}catch(n){}};t.exports=function(t){var e,n,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=a(e=Object(t),o))?n:i?r(e):"Object"==(s=r(e))&&"function"==typeof e.callee?"Arguments":s}},4178:function(t,e,n){var r,o,i,a=n("d864"),s=n("3024"),c=n("32fc"),u=n("1ec9"),f=n("e53d"),l=f.process,p=f.setImmediate,d=f.clearImmediate,h=f.MessageChannel,v=f.Dispatch,y=0,m={},g="onreadystatechange",b=function(){var t=+this;if(m.hasOwnProperty(t)){var e=m[t];delete m[t],e()}},w=function(t){b.call(t.data)};p&&d||(p=function(t){var e=[],n=1;while(arguments.length>n)e.push(arguments[n++]);return m[++y]=function(){s("function"==typeof t?t:Function(t),e)},r(y),y},d=function(t){delete m[t]},"process"==n("6b4c")(l)?r=function(t){l.nextTick(a(b,t,1))}:v&&v.now?r=function(t){v.now(a(b,t,1))}:h?(o=new h,i=o.port2,o.port1.onmessage=w,r=a(i.postMessage,i,1)):f.addEventListener&&"function"==typeof postMessage&&!f.importScripts?(r=function(t){f.postMessage(t+"","*")},f.addEventListener("message",w,!1)):r=g in u("script")?function(t){c.appendChild(u("script"))[g]=function(){c.removeChild(this),b.call(t)}}:function(t){setTimeout(a(b,t,1),0)}),t.exports={set:p,clear:d}},"41a0":function(t,e,n){"use strict";var r=n("2aeb"),o=n("4630"),i=n("7f20"),a={};n("32e9")(a,n("2b4c")("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},"41b2":function(t,e,n){"use strict";e.__esModule=!0;var r=n("3f6b"),o=i(r);function i(t){return t&&t.__esModule?t:{default:t}}e.default=o.default||function(t){for(var e=1;e0?r:n)(t)}},"45f2":function(t,e,n){var r=n("d9f6").f,o=n("07e3"),i=n("5168")("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},4630:function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"467f":function(t,e,n){"use strict";var r=n("2d83");t.exports=function(t,e,n){var o=n.config.validateStatus;n.status&&o&&!o(n.status)?e(r("Request failed with status code "+n.status,n.config,null,n.request,n)):t(n)}},"46a7":function(t,e,n){var r=n("63b6");r(r.S+r.F*!n("8e60"),"Object",{defineProperty:n("d9f6").f})},"47ee":function(t,e,n){var r=n("c3a1"),o=n("9aa9"),i=n("355d");t.exports=function(t){var e=r(t),n=o.f;if(n){var a,s=n(t),c=i.f,u=0;while(s.length>u)c.call(t,a=s[u++])&&e.push(a)}return e}},"481b":function(t,e){t.exports={}},"4a59":function(t,e,n){var r=n("9b43"),o=n("1fa8"),i=n("33a4"),a=n("cb7c"),s=n("9def"),c=n("27ee"),u={},f={};e=t.exports=function(t,e,n,l,p){var d,h,v,y,m=p?function(){return t}:c(t),g=r(n,l,e?2:1),b=0;if("function"!=typeof m)throw TypeError(t+" is not iterable!");if(i(m)){for(d=s(t.length);d>b;b++)if(y=e?g(a(h=t[b])[0],h[1]):g(t[b]),y===u||y===f)return y}else for(v=m.call(t);!(h=v.next()).done;)if(y=o(v,g,h.value,e),y===u||y===f)return y};e.BREAK=u,e.RETURN=f},"4bf8":function(t,e,n){var r=n("be13");t.exports=function(t){return Object(r(t))}},"4c95":function(t,e,n){"use strict";var r=n("e53d"),o=n("584a"),i=n("d9f6"),a=n("8e60"),s=n("5168")("species");t.exports=function(t){var e="function"==typeof o[t]?o[t]:r[t];a&&e&&!e[s]&&i.f(e,s,{configurable:!0,get:function(){return this}})}},"4ee1":function(t,e,n){var r=n("5168")("iterator"),o=!1;try{var i=[7][r]();i["return"]=function(){o=!0},Array.from(i,function(){throw 2})}catch(a){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},t(i)}catch(a){}return n}},"50ed":function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},5147:function(t,e,n){var r=n("2b4c")("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[r]=!1,!"/./"[t](e)}catch(o){}}return!0}},5168:function(t,e,n){var r=n("dbdb")("wks"),o=n("62a0"),i=n("e53d").Symbol,a="function"==typeof i,s=t.exports=function(t){return r[t]||(r[t]=a&&i[t]||(a?i:o)("Symbol."+t))};s.store=r},"51b6":function(t,e,n){n("a3c3"),t.exports=n("584a").Object.assign},5270:function(t,e,n){"use strict";var r=n("c532"),o=n("c401"),i=n("2e67"),a=n("2444"),s=n("d925"),c=n("e683");function u(t){t.cancelToken&&t.cancelToken.throwIfRequested()}t.exports=function(t){u(t),t.baseURL&&!s(t.url)&&(t.url=c(t.baseURL,t.url)),t.headers=t.headers||{},t.data=o(t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers||{}),r.forEach(["delete","get","head","post","put","patch","common"],function(e){delete t.headers[e]});var e=t.adapter||a.adapter;return e(t).then(function(e){return u(t),e.data=o(e.data,e.headers,t.transformResponse),e},function(e){return i(e)||(u(t),e&&e.response&&(e.response.data=o(e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)})}},"52a7":function(t,e){e.f={}.propertyIsEnumerable},"53e2":function(t,e,n){var r=n("07e3"),o=n("241e"),i=n("5559")("IE_PROTO"),a=Object.prototype;t.exports=Object.getPrototypeOf||function(t){return t=o(t),r(t,i)?t[i]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?a:null}},"551c":function(t,e,n){"use strict";var r,o,i,a,s=n("2d00"),c=n("7726"),u=n("9b43"),f=n("23c6"),l=n("5ca1"),p=n("d3f4"),d=n("d8e8"),h=n("f605"),v=n("4a59"),y=n("ebd6"),m=n("1991").set,g=n("8079")(),b=n("a5b8"),w=n("9c80"),_=n("a25f"),x=n("bcaa"),O="Promise",E=c.TypeError,S=c.process,A=S&&S.versions,C=A&&A.v8||"",k=c[O],j="process"==f(S),T=function(){},$=o=b.f,M=!!function(){try{var t=k.resolve(1),e=(t.constructor={})[n("2b4c")("species")]=function(t){t(T,T)};return(j||"function"==typeof PromiseRejectionEvent)&&t.then(T)instanceof e&&0!==C.indexOf("6.6")&&-1===_.indexOf("Chrome/66")}catch(r){}}(),P=function(t){var e;return!(!p(t)||"function"!=typeof(e=t.then))&&e},L=function(t,e){if(!t._n){t._n=!0;var n=t._c;g(function(){var r=t._v,o=1==t._s,i=0,a=function(e){var n,i,a,s=o?e.ok:e.fail,c=e.resolve,u=e.reject,f=e.domain;try{s?(o||(2==t._h&&F(t),t._h=1),!0===s?n=r:(f&&f.enter(),n=s(r),f&&(f.exit(),a=!0)),n===e.promise?u(E("Promise-chain cycle")):(i=P(n))?i.call(n,c,u):c(n)):u(r)}catch(l){f&&!a&&f.exit(),u(l)}};while(n.length>i)a(n[i++]);t._c=[],t._n=!1,e&&!t._h&&R(t)})}},R=function(t){m.call(c,function(){var e,n,r,o=t._v,i=N(t);if(i&&(e=w(function(){j?S.emit("unhandledRejection",o,t):(n=c.onunhandledrejection)?n({promise:t,reason:o}):(r=c.console)&&r.error&&r.error("Unhandled promise rejection",o)}),t._h=j||N(t)?2:1),t._a=void 0,i&&e.e)throw e.v})},N=function(t){return 1!==t._h&&0===(t._a||t._c).length},F=function(t){m.call(c,function(){var e;j?S.emit("rejectionHandled",t):(e=c.onrejectionhandled)&&e({promise:t,reason:t._v})})},I=function(t){var e=this;e._d||(e._d=!0,e=e._w||e,e._v=t,e._s=2,e._a||(e._a=e._c.slice()),L(e,!0))},D=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw E("Promise can't be resolved itself");(e=P(t))?g(function(){var r={_w:n,_d:!1};try{e.call(t,u(D,r,1),u(I,r,1))}catch(o){I.call(r,o)}}):(n._v=t,n._s=1,L(n,!1))}catch(r){I.call({_w:n,_d:!1},r)}}};M||(k=function(t){h(this,k,O,"_h"),d(t),r.call(this);try{t(u(D,this,1),u(I,this,1))}catch(e){I.call(this,e)}},r=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1},r.prototype=n("dcbc")(k.prototype,{then:function(t,e){var n=$(y(this,k));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=j?S.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&L(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),i=function(){var t=new r;this.promise=t,this.resolve=u(D,t,1),this.reject=u(I,t,1)},b.f=$=function(t){return t===k||t===a?new i(t):o(t)}),l(l.G+l.W+l.F*!M,{Promise:k}),n("7f20")(k,O),n("7a56")(O),a=n("8378")[O],l(l.S+l.F*!M,O,{reject:function(t){var e=$(this),n=e.reject;return n(t),e.promise}}),l(l.S+l.F*(s||!M),O,{resolve:function(t){return x(s&&this===a?k:this,t)}}),l(l.S+l.F*!(M&&n("5cc5")(function(t){k.all(t)["catch"](T)})),O,{all:function(t){var e=this,n=$(e),r=n.resolve,o=n.reject,i=w(function(){var n=[],i=0,a=1;v(t,!1,function(t){var s=i++,c=!1;n.push(void 0),a++,e.resolve(t).then(function(t){c||(c=!0,n[s]=t,--a||r(n))},o)}),--a||r(n)});return i.e&&o(i.v),n.promise},race:function(t){var e=this,n=$(e),r=n.reject,o=w(function(){v(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return o.e&&r(o.v),n.promise}})},5537:function(t,e,n){var r=n("8378"),o=n("7726"),i="__core-js_shared__",a=o[i]||(o[i]={});(t.exports=function(t,e){return a[t]||(a[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n("2d00")?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},5559:function(t,e,n){var r=n("dbdb")("keys"),o=n("62a0");t.exports=function(t){return r[t]||(r[t]=o(t))}},"584a":function(t,e){var n=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},"597f":function(t,e){t.exports=function(t,e,n,r){var o,i=0;function a(){var a=this,s=Number(new Date)-i,c=arguments;function u(){i=Number(new Date),n.apply(a,c)}function f(){o=void 0}r&&!o&&u(),o&&clearTimeout(o),void 0===r&&s>t?u():!0!==e&&(o=setTimeout(r?f:u,void 0===r?t-s:t))}return"boolean"!==typeof e&&(r=n,n=e,e=void 0),a}},"5b4e":function(t,e,n){var r=n("36c3"),o=n("b447"),i=n("0fc9");t.exports=function(t){return function(e,n,a){var s,c=r(e),u=o(c.length),f=i(a,u);if(t&&n!=n){while(u>f)if(s=c[f++],s!=s)return!0}else for(;u>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},"5bba":function(t,e,n){n("9d98");var r=n("584a").Object;t.exports=function(t,e){return r.defineProperties(t,e)}},"5c95":function(t,e,n){var r=n("35e8");t.exports=function(t,e,n){for(var o in e)n&&t[o]?t[o]=e[o]:r(t,o,e[o]);return t}},"5ca1":function(t,e,n){var r=n("7726"),o=n("8378"),i=n("32e9"),a=n("2aba"),s=n("9b43"),c="prototype",u=function(t,e,n){var f,l,p,d,h=t&u.F,v=t&u.G,y=t&u.S,m=t&u.P,g=t&u.B,b=v?r:y?r[e]||(r[e]={}):(r[e]||{})[c],w=v?o:o[e]||(o[e]={}),_=w[c]||(w[c]={});for(f in v&&(n=e),n)l=!h&&b&&void 0!==b[f],p=(l?b:n)[f],d=g&&l?s(p,r):m&&"function"==typeof p?s(Function.call,p):p,b&&a(b,f,p,t&u.U),w[f]!=p&&i(w,f,d),m&&_[f]!=p&&(_[f]=p)};r.core=o,u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},"5cc5":function(t,e,n){var r=n("2b4c")("iterator"),o=!1;try{var i=[7][r]();i["return"]=function(){o=!0},Array.from(i,function(){throw 2})}catch(a){}t.exports=function(t,e){if(!e&&!o)return!1;var n=!1;try{var i=[7],s=i[r]();s.next=function(){return{done:n=!0}},i[r]=function(){return s},t(i)}catch(a){}return n}},"5e83":function(t,e,n){t.exports=n("8580")},"613b":function(t,e,n){var r=n("5537")("keys"),o=n("ca5a");t.exports=function(t){return r[t]||(r[t]=o(t))}},"626a":function(t,e,n){var r=n("2d95");t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},"62a0":function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},"63b6":function(t,e,n){var r=n("e53d"),o=n("584a"),i=n("d864"),a=n("35e8"),s=n("07e3"),c="prototype",u=function(t,e,n){var f,l,p,d=t&u.F,h=t&u.G,v=t&u.S,y=t&u.P,m=t&u.B,g=t&u.W,b=h?o:o[e]||(o[e]={}),w=b[c],_=h?r:v?r[e]:(r[e]||{})[c];for(f in h&&(n=e),n)l=!d&&_&&void 0!==_[f],l&&s(b,f)||(p=l?_[f]:n[f],b[f]=h&&"function"!=typeof _[f]?n[f]:m&&l?i(p,r):g&&_[f]==p?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e[c]=t[c],e}(p):y&&"function"==typeof p?i(Function.call,p):p,y&&((b.virtual||(b.virtual={}))[f]=p,t&u.R&&w&&!w[f]&&a(w,f,p)))};u.F=1,u.G=2,u.S=4,u.P=8,u.B=16,u.W=32,u.U=64,u.R=128,t.exports=u},"656e":function(t,e,n){"use strict";var r=n("79aa");function o(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new o(t)}},6718:function(t,e,n){var r=n("e53d"),o=n("584a"),i=n("b8e3"),a=n("ccb9"),s=n("d9f6").f;t.exports=function(t){var e=o.Symbol||(o.Symbol=i?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||s(e,t,{value:a.f(t)})}},6821:function(t,e,n){var r=n("626a"),o=n("be13");t.exports=function(t){return r(o(t))}},"696e":function(t,e,n){n("c207"),n("1654"),n("6c1c"),n("24c5"),n("3c11"),n("43fc"),t.exports=n("584a").Promise},"69a8":function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},"69d3":function(t,e,n){n("6718")("asyncIterator")},"6a99":function(t,e,n){var r=n("d3f4");t.exports=function(t,e){if(!r(t))return t;var n,o;if(e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;if("function"==typeof(n=t.valueOf)&&!r(o=n.call(t)))return o;if(!e&&"function"==typeof(n=t.toString)&&!r(o=n.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},"6abf":function(t,e,n){var r=n("e6f3"),o=n("1691").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,o)}},"6b4c":function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},"6c1c":function(t,e,n){n("c367");for(var r=n("e53d"),o=n("35e8"),i=n("481b"),a=n("5168")("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(","),c=0;c0},t.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),f?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},t.prototype.disconnect_=function(){r&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},t.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=void 0===e?"":e,r=u.some(function(t){return!!~n.indexOf(t)});r&&this.refresh()},t.getInstance=function(){return this.instance_||(this.instance_=new t),this.instance_},t.instance_=null,t}(),p=function(t,e){for(var n=0,r=Object.keys(e);n0},t}(),k="undefined"!==typeof WeakMap?new WeakMap:new n,j=function(){function t(e){if(!(this instanceof t))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var n=l.getInstance(),r=new C(e,n,this);k.set(this,r)}return t}();["observe","unobserve","disconnect"].forEach(function(t){j.prototype[t]=function(){var e;return(e=k.get(this))[t].apply(e,arguments)}});var T=function(){return"undefined"!==typeof o.ResizeObserver?o.ResizeObserver:j}();e["default"]=T}.call(this,n("c8ba"))},"71c1":function(t,e,n){var r=n("3a38"),o=n("25eb");t.exports=function(t){return function(e,n){var i,a,s=String(o(e)),c=r(n),u=s.length;return c<0||c>=u?t?"":void 0:(i=s.charCodeAt(c),i<55296||i>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):i:t?s.slice(c,c+2):a-56320+(i-55296<<10)+65536)}}},7333:function(t,e,n){"use strict";var r=n("9e1e"),o=n("0d58"),i=n("2621"),a=n("52a7"),s=n("4bf8"),c=n("626a"),u=Object.assign;t.exports=!u||n("79e5")(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r})?function(t,e){var n=s(t),u=arguments.length,f=1,l=i.f,p=a.f;while(u>f){var d,h=c(arguments[f++]),v=l?o(h).concat(l(h)):o(h),y=v.length,m=0;while(y>m)d=v[m++],r&&!p.call(h,d)||(n[d]=h[d])}return n}:u},"765d":function(t,e,n){n("6718")("observable")},7726:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},"77f1":function(t,e,n){var r=n("4588"),o=Math.max,i=Math.min;t.exports=function(t,e){return t=r(t),t<0?o(t+e,0):i(t,e)}},"794b":function(t,e,n){t.exports=!n("8e60")&&!n("294c")(function(){return 7!=Object.defineProperty(n("1ec9")("div"),"a",{get:function(){return 7}}).a})},"795b":function(t,e,n){t.exports=n("696e")},"79aa":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},"79e5":function(t,e){t.exports=function(t){try{return!!t()}catch(e){return!0}}},"7a56":function(t,e,n){"use strict";var r=n("7726"),o=n("86cc"),i=n("9e1e"),a=n("2b4c")("species");t.exports=function(t){var e=r[t];i&&e&&!e[a]&&o.f(e,a,{configurable:!0,get:function(){return this}})}},"7a77":function(t,e,n){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},"7aac":function(t,e,n){"use strict";var r=n("c532");t.exports=r.isStandardBrowserEnv()?function(){return{write:function(t,e,n,o,i,a){var s=[];s.push(t+"="+encodeURIComponent(e)),r.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),r.isString(o)&&s.push("path="+o),r.isString(i)&&s.push("domain="+i),!0===a&&s.push("secure"),document.cookie=s.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"7b3e":function(t,e,n){"use strict";var r,o=n("a3de"); +/** + * Checks if an event is supported in the current execution environment. + * + * NOTE: This will not work correctly for non-generic events such as `change`, + * `reset`, `load`, `error`, and `select`. + * + * Borrows from Modernizr. + * + * @param {string} eventNameSuffix Event name, e.g. "click". + * @param {?boolean} capture Check if the capture phase is supported. + * @return {boolean} True if the event is supported. + * @internal + * @license Modernizr 3.0.0pre (Custom Build) | MIT + */ +function i(t,e){if(!o.canUseDOM||e&&!("addEventListener"in document))return!1;var n="on"+t,i=n in document;if(!i){var a=document.createElement("div");a.setAttribute(n,"return;"),i="function"===typeof a[n]}return!i&&r&&"wheel"===t&&(i=document.implementation.hasFeature("Events.wheel","3.0")),i}o.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=i},"7cd6":function(t,e,n){var r=n("40c3"),o=n("5168")("iterator"),i=n("481b");t.exports=n("584a").getIteratorMethod=function(t){if(void 0!=t)return t[o]||t["@@iterator"]||i[r(t)]}},"7e90":function(t,e,n){var r=n("d9f6"),o=n("e4ae"),i=n("c3a1");t.exports=n("8e60")?Object.defineProperties:function(t,e){o(t);var n,a=i(e),s=a.length,c=0;while(s>c)r.f(t,n=a[c++],e[n]);return t}},"7f20":function(t,e,n){var r=n("86cc").f,o=n("69a8"),i=n("2b4c")("toStringTag");t.exports=function(t,e,n){t&&!o(t=n?t:t.prototype,i)&&r(t,i,{configurable:!0,value:e})}},"7f7f":function(t,e,n){var r=n("86cc").f,o=Function.prototype,i=/^\s*function ([^ (]*)/,a="name";a in o||n("9e1e")&&r(o,a,{configurable:!0,get:function(){try{return(""+this).match(i)[1]}catch(t){return""}}})},8079:function(t,e,n){var r=n("7726"),o=n("1991").set,i=r.MutationObserver||r.WebKitMutationObserver,a=r.process,s=r.Promise,c="process"==n("2d95")(a);t.exports=function(){var t,e,n,u=function(){var r,o;c&&(r=a.domain)&&r.exit();while(t){o=t.fn,t=t.next;try{o()}catch(i){throw t?n():e=void 0,i}}e=void 0,r&&r.enter()};if(c)n=function(){a.nextTick(u)};else if(!i||r.navigator&&r.navigator.standalone)if(s&&s.resolve){var f=s.resolve(void 0);n=function(){f.then(u)}}else n=function(){o.call(r,u)};else{var l=!0,p=document.createTextNode("");new i(u).observe(p,{characterData:!0}),n=function(){p.data=l=!l}}return function(r){var o={fn:r,next:void 0};e&&(e.next=o),t||(t=o,n()),e=o}}},8378:function(t,e){var n=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},8436:function(t,e){t.exports=function(){}},"84f2":function(t,e){t.exports={}},8580:function(t,e,n){n("ee6d"),t.exports=n("584a").Object.getOwnPropertyDescriptors},"85f2":function(t,e,n){t.exports=n("454f")},"86cc":function(t,e,n){var r=n("cb7c"),o=n("c69a"),i=n("6a99"),a=Object.defineProperty;e.f=n("9e1e")?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},"8aae":function(t,e,n){n("32a6"),t.exports=n("584a").Object.keys},"8c4f":function(t,e,n){"use strict"; +/*! + * vue-router v3.0.6 + * (c) 2019 Evan You + * @license MIT + */function r(t,e){0}function o(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}function i(t,e){for(var n in e)t[n]=e[n];return t}var a={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(t,e){var n=e.props,r=e.children,o=e.parent,a=e.data;a.routerView=!0;var c=o.$createElement,u=n.name,f=o.$route,l=o._routerViewCache||(o._routerViewCache={}),p=0,d=!1;while(o&&o._routerRoot!==o){var h=o.$vnode&&o.$vnode.data;h&&(h.routerView&&p++,h.keepAlive&&o._inactive&&(d=!0)),o=o.$parent}if(a.routerViewDepth=p,d)return c(l[u],a,r);var v=f.matched[p];if(!v)return l[u]=null,c();var y=l[u]=v.components[u];a.registerRouteInstance=function(t,e){var n=v.instances[u];(e&&n!==t||!e&&n===t)&&(v.instances[u]=e)},(a.hook||(a.hook={})).prepatch=function(t,e){v.instances[u]=e.componentInstance},a.hook.init=function(t){t.data.keepAlive&&t.componentInstance&&t.componentInstance!==v.instances[u]&&(v.instances[u]=t.componentInstance)};var m=a.props=s(f,v.props&&v.props[u]);if(m){m=a.props=i({},m);var g=a.attrs=a.attrs||{};for(var b in m)y.props&&b in y.props||(g[b]=m[b],delete m[b])}return c(y,a,r)}};function s(t,e){switch(typeof e){case"undefined":return;case"object":return e;case"function":return e(t);case"boolean":return e?t.params:void 0;default:0}}var c=/[!'()*]/g,u=function(t){return"%"+t.charCodeAt(0).toString(16)},f=/%2C/g,l=function(t){return encodeURIComponent(t).replace(c,u).replace(f,",")},p=decodeURIComponent;function d(t,e,n){void 0===e&&(e={});var r,o=n||h;try{r=o(t||"")}catch(a){r={}}for(var i in e)r[i]=e[i];return r}function h(t){var e={};return t=t.trim().replace(/^(\?|#|&)/,""),t?(t.split("&").forEach(function(t){var n=t.replace(/\+/g," ").split("="),r=p(n.shift()),o=n.length>0?p(n.join("=")):null;void 0===e[r]?e[r]=o:Array.isArray(e[r])?e[r].push(o):e[r]=[e[r],o]}),e):e}function v(t){var e=t?Object.keys(t).map(function(e){var n=t[e];if(void 0===n)return"";if(null===n)return l(e);if(Array.isArray(n)){var r=[];return n.forEach(function(t){void 0!==t&&(null===t?r.push(l(e)):r.push(l(e)+"="+l(t)))}),r.join("&")}return l(e)+"="+l(n)}).filter(function(t){return t.length>0}).join("&"):null;return e?"?"+e:""}var y=/\/?$/;function m(t,e,n,r){var o=r&&r.options.stringifyQuery,i=e.query||{};try{i=g(i)}catch(s){}var a={name:e.name||t&&t.name,meta:t&&t.meta||{},path:e.path||"/",hash:e.hash||"",query:i,params:e.params||{},fullPath:_(e,o),matched:t?w(t):[]};return n&&(a.redirectedFrom=_(n,o)),Object.freeze(a)}function g(t){if(Array.isArray(t))return t.map(g);if(t&&"object"===typeof t){var e={};for(var n in t)e[n]=g(t[n]);return e}return t}var b=m(null,{path:"/"});function w(t){var e=[];while(t)e.unshift(t),t=t.parent;return e}function _(t,e){var n=t.path,r=t.query;void 0===r&&(r={});var o=t.hash;void 0===o&&(o="");var i=e||v;return(n||"/")+i(r)+o}function x(t,e){return e===b?t===e:!!e&&(t.path&&e.path?t.path.replace(y,"")===e.path.replace(y,"")&&t.hash===e.hash&&O(t.query,e.query):!(!t.name||!e.name)&&(t.name===e.name&&t.hash===e.hash&&O(t.query,e.query)&&O(t.params,e.params)))}function O(t,e){if(void 0===t&&(t={}),void 0===e&&(e={}),!t||!e)return t===e;var n=Object.keys(t),r=Object.keys(e);return n.length===r.length&&n.every(function(n){var r=t[n],o=e[n];return"object"===typeof r&&"object"===typeof o?O(r,o):String(r)===String(o)})}function E(t,e){return 0===t.path.replace(y,"/").indexOf(e.path.replace(y,"/"))&&(!e.hash||t.hash===e.hash)&&S(t.query,e.query)}function S(t,e){for(var n in e)if(!(n in t))return!1;return!0}var A,C=[String,Object],k=[String,Array],j={name:"RouterLink",props:{to:{type:C,required:!0},tag:{type:String,default:"a"},exact:Boolean,append:Boolean,replace:Boolean,activeClass:String,exactActiveClass:String,event:{type:k,default:"click"}},render:function(t){var e=this,n=this.$router,r=this.$route,o=n.resolve(this.to,r,this.append),a=o.location,s=o.route,c=o.href,u={},f=n.options.linkActiveClass,l=n.options.linkExactActiveClass,p=null==f?"router-link-active":f,d=null==l?"router-link-exact-active":l,h=null==this.activeClass?p:this.activeClass,v=null==this.exactActiveClass?d:this.exactActiveClass,y=a.path?m(null,a,null,n):s;u[v]=x(r,y),u[h]=this.exact?u[v]:E(r,y);var g=function(t){T(t)&&(e.replace?n.replace(a):n.push(a))},b={click:T};Array.isArray(this.event)?this.event.forEach(function(t){b[t]=g}):b[this.event]=g;var w={class:u};if("a"===this.tag)w.on=b,w.attrs={href:c};else{var _=$(this.$slots.default);if(_){_.isStatic=!1;var O=_.data=i({},_.data);O.on=b;var S=_.data.attrs=i({},_.data.attrs);S.href=c}else w.on=b}return t(this.tag,w,this.$slots.default)}};function T(t){if(!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)&&!t.defaultPrevented&&(void 0===t.button||0===t.button)){if(t.currentTarget&&t.currentTarget.getAttribute){var e=t.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(e))return}return t.preventDefault&&t.preventDefault(),!0}}function $(t){if(t)for(var e,n=0;n=0&&(e=t.slice(r),t=t.slice(0,r));var o=t.indexOf("?");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{path:t,query:n,hash:e}}function N(t){return t.replace(/\/\//g,"/")}var F=Array.isArray||function(t){return"[object Array]"==Object.prototype.toString.call(t)},I=rt,D=H,q=z,U=X,B=nt,V=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function H(t,e){var n,r=[],o=0,i=0,a="",s=e&&e.delimiter||"/";while(null!=(n=V.exec(t))){var c=n[0],u=n[1],f=n.index;if(a+=t.slice(i,f),i=f+c.length,u)a+=u[1];else{var l=t[i],p=n[2],d=n[3],h=n[4],v=n[5],y=n[6],m=n[7];a&&(r.push(a),a="");var g=null!=p&&null!=l&&l!==p,b="+"===y||"*"===y,w="?"===y||"*"===y,_=n[2]||s,x=h||v;r.push({name:d||o++,prefix:p||"",delimiter:_,optional:w,repeat:b,partial:g,asterisk:!!m,pattern:x?J(x):m?".*":"[^"+K(_)+"]+?"})}}return i-1&&(s.params[p]=n.params[p]);if(u)return s.path=it(u.path,s.params,'named route "'+c+'"'),f(u,s,a)}else if(s.path){s.params={};for(var d=0;d=t.length?n():t[o]?e(t[o],function(){r(o+1)}):r(o+1)};r(0)}function Lt(t){return function(e,n,r){var i=!1,a=0,s=null;Rt(t,function(t,e,n,c){if("function"===typeof t&&void 0===t.cid){i=!0,a++;var u,f=Dt(function(e){It(e)&&(e=e.default),t.resolved="function"===typeof e?e:A.extend(e),n.components[c]=e,a--,a<=0&&r()}),l=Dt(function(t){var e="Failed to resolve async component "+c+": "+t;s||(s=o(t)?t:new Error(e),r(s))});try{u=t(f,l)}catch(d){l(d)}if(u)if("function"===typeof u.then)u.then(f,l);else{var p=u.component;p&&"function"===typeof p.then&&p.then(f,l)}}}),i||r()}}function Rt(t,e){return Nt(t.map(function(t){return Object.keys(t.components).map(function(n){return e(t.components[n],t.instances[n],t,n)})}))}function Nt(t){return Array.prototype.concat.apply([],t)}var Ft="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;function It(t){return t.__esModule||Ft&&"Module"===t[Symbol.toStringTag]}function Dt(t){var e=!1;return function(){var n=[],r=arguments.length;while(r--)n[r]=arguments[r];if(!e)return e=!0,t.apply(this,n)}}var qt=function(t,e){this.router=t,this.base=Ut(e),this.current=b,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function Ut(t){if(!t)if(P){var e=document.querySelector("base");t=e&&e.getAttribute("href")||"/",t=t.replace(/^https?:\/\/[^\/]+/,"")}else t="/";return"/"!==t.charAt(0)&&(t="/"+t),t.replace(/\/$/,"")}function Bt(t,e){var n,r=Math.max(t.length,e.length);for(n=0;n-1?decodeURI(t.slice(0,r))+t.slice(r):decodeURI(t)}else n>-1&&(t=decodeURI(t.slice(0,n))+t.slice(n));return t}function re(t){var e=window.location.href,n=e.indexOf("#"),r=n>=0?e.slice(0,n):e;return r+"#"+t}function oe(t){St?$t(re(t)):window.location.hash=t}function ie(t){St?Mt(re(t)):window.location.replace(re(t))}var ae=function(t){function e(e,n){t.call(this,e,n),this.stack=[],this.index=-1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.push=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index+1).concat(t),r.index++,e&&e(t)},n)},e.prototype.replace=function(t,e,n){var r=this;this.transitionTo(t,function(t){r.stack=r.stack.slice(0,r.index).concat(t),e&&e(t)},n)},e.prototype.go=function(t){var e=this,n=this.index+t;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,function(){e.index=n,e.updateRoute(r)})}},e.prototype.getCurrentLocation=function(){var t=this.stack[this.stack.length-1];return t?t.fullPath:"/"},e.prototype.ensureURL=function(){},e}(qt),se=function(t){void 0===t&&(t={}),this.app=null,this.apps=[],this.options=t,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=lt(t.routes||[],this);var e=t.mode||"hash";switch(this.fallback="history"===e&&!St&&!1!==t.fallback,this.fallback&&(e="hash"),P||(e="abstract"),this.mode=e,e){case"history":this.history=new Yt(this,t.base);break;case"hash":this.history=new Qt(this,t.base,this.fallback);break;case"abstract":this.history=new ae(this,t.base);break;default:0}},ce={currentRoute:{configurable:!0}};function ue(t,e){return t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function fe(t,e,n){var r="hash"===n?"#"+e:e;return t?N(t+"/"+r):r}se.prototype.match=function(t,e,n){return this.matcher.match(t,e,n)},ce.currentRoute.get=function(){return this.history&&this.history.current},se.prototype.init=function(t){var e=this;if(this.apps.push(t),t.$once("hook:destroyed",function(){var n=e.apps.indexOf(t);n>-1&&e.apps.splice(n,1),e.app===t&&(e.app=e.apps[0]||null)}),!this.app){this.app=t;var n=this.history;if(n instanceof Yt)n.transitionTo(n.getCurrentLocation());else if(n instanceof Qt){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen(function(t){e.apps.forEach(function(e){e._route=t})})}},se.prototype.beforeEach=function(t){return ue(this.beforeHooks,t)},se.prototype.beforeResolve=function(t){return ue(this.resolveHooks,t)},se.prototype.afterEach=function(t){return ue(this.afterHooks,t)},se.prototype.onReady=function(t,e){this.history.onReady(t,e)},se.prototype.onError=function(t){this.history.onError(t)},se.prototype.push=function(t,e,n){this.history.push(t,e,n)},se.prototype.replace=function(t,e,n){this.history.replace(t,e,n)},se.prototype.go=function(t){this.history.go(t)},se.prototype.back=function(){this.go(-1)},se.prototype.forward=function(){this.go(1)},se.prototype.getMatchedComponents=function(t){var e=t?t.matched?t:this.resolve(t).route:this.currentRoute;return e?[].concat.apply([],e.matched.map(function(t){return Object.keys(t.components).map(function(e){return t.components[e]})})):[]},se.prototype.resolve=function(t,e,n){e=e||this.history.current;var r=ft(t,e,n,this),o=this.match(r,e),i=o.redirectedFrom||o.fullPath,a=this.history.base,s=fe(a,i,this.mode);return{location:r,route:o,href:s,normalizedTo:r,resolved:o}},se.prototype.addRoutes=function(t){this.matcher.addRoutes(t),this.history.current!==b&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(se.prototype,ce),se.install=M,se.version="3.0.6",P&&window.Vue&&window.Vue.use(se),e["a"]=se},"8df4":function(t,e,n){"use strict";var r=n("7a77");function o(t){if("function"!==typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise(function(t){e=t});var n=this;t(function(t){n.reason||(n.reason=new r(t),e(n.reason))})}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var t,e=new o(function(e){t=e});return{token:e,cancel:t}},t.exports=o},"8e60":function(t,e,n){t.exports=!n("294c")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"8eb7":function(t,e){var n,r,o,i,a,s,c,u,f,l,p,d,h,v,y,m=!1;function g(){if(!m){m=!0;var t=navigator.userAgent,e=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(t),g=/(Mac OS X)|(Windows)|(Linux)/.exec(t);if(d=/\b(iPhone|iP[ao]d)/.exec(t),h=/\b(iP[ao]d)/.exec(t),l=/Android/i.exec(t),v=/FBAN\/\w+;/i.exec(t),y=/Mobile/i.exec(t),p=!!/Win64/.exec(t),e){n=e[1]?parseFloat(e[1]):e[5]?parseFloat(e[5]):NaN,n&&document&&document.documentMode&&(n=document.documentMode);var b=/(?:Trident\/(\d+.\d+))/.exec(t);s=b?parseFloat(b[1])+4:n,r=e[2]?parseFloat(e[2]):NaN,o=e[3]?parseFloat(e[3]):NaN,i=e[4]?parseFloat(e[4]):NaN,i?(e=/(?:Chrome\/(\d+\.\d+))/.exec(t),a=e&&e[1]?parseFloat(e[1]):NaN):a=NaN}else n=r=o=a=i=NaN;if(g){if(g[1]){var w=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(t);c=!w||parseFloat(w[1].replace("_","."))}else c=!1;u=!!g[2],f=!!g[3]}else c=u=f=!1}}var b={ie:function(){return g()||n},ieCompatibilityMode:function(){return g()||s>n},ie64:function(){return b.ie()&&p},firefox:function(){return g()||r},opera:function(){return g()||o},webkit:function(){return g()||i},safari:function(){return b.webkit()},chrome:function(){return g()||a},windows:function(){return g()||u},osx:function(){return g()||c},linux:function(){return g()||f},iphone:function(){return g()||d},mobile:function(){return g()||d||h||l||y},nativeApp:function(){return g()||v},android:function(){return g()||l},ipad:function(){return g()||h}};t.exports=b},"8f60":function(t,e,n){"use strict";var r=n("a159"),o=n("aebd"),i=n("45f2"),a={};n("35e8")(a,n("5168")("iterator"),function(){return this}),t.exports=function(t,e,n){t.prototype=r(a,{next:o(1,n)}),i(t,e+" Iterator")}},9003:function(t,e,n){var r=n("6b4c");t.exports=Array.isArray||function(t){return"Array"==r(t)}},9138:function(t,e,n){t.exports=n("35e8")},"92fa":function(t,e){var n=/^(attrs|props|on|nativeOn|class|style|hook)$/;function r(t,e){return function(){t&&t.apply(this,arguments),e&&e.apply(this,arguments)}}t.exports=function(t){return t.reduce(function(t,e){var o,i,a,s,c;for(a in e)if(o=t[a],i=e[a],o&&n.test(a))if("class"===a&&("string"===typeof o&&(c=o,t[a]=o={},o[c]=!0),"string"===typeof i&&(c=i,e[a]=i={},i[c]=!0)),"on"===a||"nativeOn"===a||"hook"===a)for(s in i)o[s]=r(o[s],i[s]);else if(Array.isArray(o))t[a]=o.concat(i);else if(Array.isArray(i))t[a]=[o].concat(i);else for(s in i)o[s]=i[s];else t[a]=e[a];return t},{})}},9306:function(t,e,n){"use strict";var r=n("8e60"),o=n("c3a1"),i=n("9aa9"),a=n("355d"),s=n("241e"),c=n("335c"),u=Object.assign;t.exports=!u||n("294c")(function(){var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=u({},t)[n]||Object.keys(u({},e)).join("")!=r})?function(t,e){var n=s(t),u=arguments.length,f=1,l=i.f,p=a.f;while(u>f){var d,h=c(arguments[f++]),v=l?o(h).concat(l(h)):o(h),y=v.length,m=0;while(y>m)d=v[m++],r&&!p.call(h,d)||(n[d]=h[d])}return n}:u},9619:function(t,e,n){var r=n("597f"),o=n("0e15");t.exports={throttle:r,debounce:o}},"96cf":function(t,e){!function(e){"use strict";var n,r=Object.prototype,o=r.hasOwnProperty,i="function"===typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",s=i.asyncIterator||"@@asyncIterator",c=i.toStringTag||"@@toStringTag",u="object"===typeof t,f=e.regeneratorRuntime;if(f)u&&(t.exports=f);else{f=e.regeneratorRuntime=u?t.exports:{},f.wrap=w;var l="suspendedStart",p="suspendedYield",d="executing",h="completed",v={},y={};y[a]=function(){return this};var m=Object.getPrototypeOf,g=m&&m(m(M([])));g&&g!==r&&o.call(g,a)&&(y=g);var b=E.prototype=x.prototype=Object.create(y);O.prototype=b.constructor=E,E.constructor=O,E[c]=O.displayName="GeneratorFunction",f.isGeneratorFunction=function(t){var e="function"===typeof t&&t.constructor;return!!e&&(e===O||"GeneratorFunction"===(e.displayName||e.name))},f.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,E):(t.__proto__=E,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(b),t},f.awrap=function(t){return{__await:t}},S(A.prototype),A.prototype[s]=function(){return this},f.AsyncIterator=A,f.async=function(t,e,n,r){var o=new A(w(t,e,n,r));return f.isGeneratorFunction(e)?o:o.next().then(function(t){return t.done?t.value:o.next()})},S(b),b[c]="Generator",b[a]=function(){return this},b.toString=function(){return"[object Generator]"},f.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){while(e.length){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},f.values=M,$.prototype={constructor:$,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0],e=t.completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return s.type="throw",s.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=o.call(a,"catchLoc"),u=o.call(a,"finallyLoc");if(c&&u){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&o.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),v}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;T(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:M(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),v}}}function w(t,e,n,r){var o=e&&e.prototype instanceof x?e:x,i=Object.create(o.prototype),a=new $(r||[]);return i._invoke=C(t,n,a),i}function _(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(r){return{type:"throw",arg:r}}}function x(){}function O(){}function E(){}function S(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function A(t){function e(n,r,i,a){var s=_(t[n],t,r);if("throw"!==s.type){var c=s.arg,u=c.value;return u&&"object"===typeof u&&o.call(u,"__await")?Promise.resolve(u.__await).then(function(t){e("next",t,i,a)},function(t){e("throw",t,i,a)}):Promise.resolve(u).then(function(t){c.value=t,i(c)},a)}a(s.arg)}var n;function r(t,r){function o(){return new Promise(function(n,o){e(t,r,n,o)})}return n=n?n.then(o,o):o()}this._invoke=r}function C(t,e,n){var r=l;return function(o,i){if(r===d)throw new Error("Generator is already running");if(r===h){if("throw"===o)throw i;return P()}n.method=o,n.arg=i;while(1){var a=n.delegate;if(a){var s=k(a,n);if(s){if(s===v)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===l)throw r=h,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=_(t,e,n);if("normal"===c.type){if(r=n.done?h:p,c.arg===v)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=h,n.method="throw",n.arg=c.arg)}}}function k(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,k(t,e),"throw"===e.method))return v;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return v}var o=_(r,t.iterator,e.arg);if("throw"===o.type)return e.method="throw",e.arg=o.arg,e.delegate=null,v;var i=o.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,v):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,v)}function j(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function $(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(j,this),this.reset(!0)}function M(t){if(t){var e=t[a];if(e)return e.call(t);if("function"===typeof t.next)return t;if(!isNaN(t.length)){var r=-1,i=function e(){while(++r0?o(r(t),9007199254740991):0}},"9e1e":function(t,e,n){t.exports=!n("79e5")(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},"9fa6":function(t,e,n){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function o(){this.message="String contains an invalid character"}function i(t){for(var e,n,i=String(t),a="",s=0,c=r;i.charAt(0|s)||(c="=",s%1);a+=c.charAt(63&e>>8-s%1*8)){if(n=i.charCodeAt(s+=.75),n>255)throw new o;e=e<<8|n}return a}o.prototype=new Error,o.prototype.code=5,o.prototype.name="InvalidCharacterError",t.exports=i},a159:function(t,e,n){var r=n("e4ae"),o=n("7e90"),i=n("1691"),a=n("5559")("IE_PROTO"),s=function(){},c="prototype",u=function(){var t,e=n("1ec9")("iframe"),r=i.length,o="<",a=">";e.style.display="none",n("32fc").appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write(o+"script"+a+"document.F=Object"+o+"/script"+a),t.close(),u=t.F;while(r--)delete u[c][i[r]];return u()};t.exports=Object.create||function(t,e){var n;return null!==t?(s[c]=r(t),n=new s,s[c]=null,n[a]=t):n=u(),void 0===e?n:o(n,e)}},a15e:function(t,e,n){"use strict";n.r(e);var r=n("41b2"),o=n.n(r),i=n("1098"),a=n.n(i),s=/%[sdj%]/g,c=function(){};function u(){for(var t=arguments.length,e=Array(t),n=0;n=i)return t;switch(t){case"%s":return String(e[r++]);case"%d":return Number(e[r++]);case"%j":try{return JSON.stringify(e[r++])}catch(n){return"[Circular]"}break;default:return t}}),c=e[r];r()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,url:new RegExp("^(?!mailto:)(?:(?:http|https|ftp)://|//)(?:\\S+(?::\\S*)?@)?(?:(?:(?:[1-9]\\d?|1\\d\\d|2[01]\\d|22[0-3])(?:\\.(?:1?\\d{1,2}|2[0-4]\\d|25[0-5])){2}(?:\\.(?:[0-9]\\d?|1\\d\\d|2[0-4]\\d|25[0-4]))|(?:(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)(?:\\.(?:[a-z\\u00a1-\\uffff0-9]+-?)*[a-z\\u00a1-\\uffff0-9]+)*(?:\\.(?:[a-z\\u00a1-\\uffff]{2,})))|localhost)(?::\\d{2,5})?(?:(/|\\?|#)[^\\s]*)?$","i"),hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},O={integer:function(t){return O.number(t)&&parseInt(t,10)===t},float:function(t){return O.number(t)&&!O.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch(e){return!1}},date:function(t){return"function"===typeof t.getTime&&"function"===typeof t.getMonth&&"function"===typeof t.getYear},number:function(t){return!isNaN(t)&&"number"===typeof t},object:function(t){return"object"===("undefined"===typeof t?"undefined":a()(t))&&!O.array(t)},method:function(t){return"function"===typeof t},email:function(t){return"string"===typeof t&&!!t.match(x.email)&&t.length<255},url:function(t){return"string"===typeof t&&!!t.match(x.url)},hex:function(t){return"string"===typeof t&&!!t.match(x.hex)}};function E(t,e,n,r,o){if(t.required&&void 0===e)b(t,e,n,r,o);else{var i=["integer","float","array","regexp","object","method","email","number","date","url","hex"],s=t.type;i.indexOf(s)>-1?O[s](e)||r.push(u(o.messages.types[s],t.fullField,t.type)):s&&("undefined"===typeof e?"undefined":a()(e))!==t.type&&r.push(u(o.messages.types[s],t.fullField,t.type))}}var S=E;function A(t,e,n,r,o){var i="number"===typeof t.len,a="number"===typeof t.min,s="number"===typeof t.max,c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=e,l=null,p="number"===typeof e,d="string"===typeof e,h=Array.isArray(e);if(p?l="number":d?l="string":h&&(l="array"),!l)return!1;h&&(f=e.length),d&&(f=e.replace(c,"_").length),i?f!==t.len&&r.push(u(o.messages[l].len,t.fullField,t.len)):a&&!s&&ft.max?r.push(u(o.messages[l].max,t.fullField,t.max)):a&&s&&(ft.max)&&r.push(u(o.messages[l].range,t.fullField,t.min,t.max))}var C=A,k="enum";function j(t,e,n,r,o){t[k]=Array.isArray(t[k])?t[k]:[],-1===t[k].indexOf(e)&&r.push(u(o.messages[k],t.fullField,t[k].join(", ")))}var T=j;function $(t,e,n,r,o){if(t.pattern)if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(e)||r.push(u(o.messages.pattern.mismatch,t.fullField,e,t.pattern));else if("string"===typeof t.pattern){var i=new RegExp(t.pattern);i.test(e)||r.push(u(o.messages.pattern.mismatch,t.fullField,e,t.pattern))}}var M=$,P={required:b,whitespace:_,type:S,range:C,enum:T,pattern:M};function L(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e,"string")&&!t.required)return n();P.required(t,e,r,i,o,"string"),l(e,"string")||(P.type(t,e,r,i,o),P.range(t,e,r,i,o),P.pattern(t,e,r,i,o),!0===t.whitespace&&P.whitespace(t,e,r,i,o))}n(i)}var R=L;function N(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e)&&!t.required)return n();P.required(t,e,r,i,o),void 0!==e&&P.type(t,e,r,i,o)}n(i)}var F=N;function I(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e)&&!t.required)return n();P.required(t,e,r,i,o),void 0!==e&&(P.type(t,e,r,i,o),P.range(t,e,r,i,o))}n(i)}var D=I;function q(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e)&&!t.required)return n();P.required(t,e,r,i,o),void 0!==e&&P.type(t,e,r,i,o)}n(i)}var U=q;function B(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e)&&!t.required)return n();P.required(t,e,r,i,o),l(e)||P.type(t,e,r,i,o)}n(i)}var V=B;function H(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e)&&!t.required)return n();P.required(t,e,r,i,o),void 0!==e&&(P.type(t,e,r,i,o),P.range(t,e,r,i,o))}n(i)}var z=H;function G(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e)&&!t.required)return n();P.required(t,e,r,i,o),void 0!==e&&(P.type(t,e,r,i,o),P.range(t,e,r,i,o))}n(i)}var W=G;function X(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e,"array")&&!t.required)return n();P.required(t,e,r,i,o,"array"),l(e,"array")||(P.type(t,e,r,i,o),P.range(t,e,r,i,o))}n(i)}var K=X;function J(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e)&&!t.required)return n();P.required(t,e,r,i,o),void 0!==e&&P.type(t,e,r,i,o)}n(i)}var Y=J,Z="enum";function Q(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e)&&!t.required)return n();P.required(t,e,r,i,o),e&&P[Z](t,e,r,i,o)}n(i)}var tt=Q;function et(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e,"string")&&!t.required)return n();P.required(t,e,r,i,o),l(e,"string")||P.pattern(t,e,r,i,o)}n(i)}var nt=et;function rt(t,e,n,r,o){var i=[],a=t.required||!t.required&&r.hasOwnProperty(t.field);if(a){if(l(e)&&!t.required)return n();if(P.required(t,e,r,i,o),!l(e)){var s=void 0;s="number"===typeof e?new Date(e):e,P.type(t,s,r,i,o),s&&P.range(t,s.getTime(),r,i,o)}}n(i)}var ot=rt;function it(t,e,n,r,o){var i=[],s=Array.isArray(e)?"array":"undefined"===typeof e?"undefined":a()(e);P.required(t,e,r,i,o,s),n(i)}var at=it;function st(t,e,n,r,o){var i=t.type,a=[],s=t.required||!t.required&&r.hasOwnProperty(t.field);if(s){if(l(e,i)&&!t.required)return n();P.required(t,e,r,a,o,i),l(e,i)||P.type(t,e,r,a,o)}n(a)}var ct=st,ut={string:R,method:F,number:D,boolean:U,regexp:V,integer:z,float:W,array:K,object:Y,enum:tt,pattern:nt,date:ot,url:ct,hex:ct,email:ct,required:at};function ft(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var lt=ft();function pt(t){this.rules=null,this._messages=lt,this.define(t)}pt.prototype={messages:function(t){return t&&(this._messages=m(ft(),t)),this._messages},define:function(t){if(!t)throw new Error("Cannot configure a schema with no rules");if("object"!==("undefined"===typeof t?"undefined":a()(t))||Array.isArray(t))throw new Error("Rules must be an object");this.rules={};var e=void 0,n=void 0;for(e in t)t.hasOwnProperty(e)&&(n=t[e],this.rules[e]=Array.isArray(n)?n:[n])},validate:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2],i=t,s=n,f=r;if("function"===typeof s&&(f=s,s={}),this.rules&&0!==Object.keys(this.rules).length){if(s.messages){var l=this.messages();l===lt&&(l=ft()),m(l,s.messages),s.messages=l}else s.messages=this.messages();var p=void 0,d=void 0,h={},g=s.keys||Object.keys(this.rules);g.forEach(function(n){p=e.rules[n],d=i[n],p.forEach(function(r){var a=r;"function"===typeof a.transform&&(i===t&&(i=o()({},i)),d=i[n]=a.transform(d)),a="function"===typeof a?{validator:a}:o()({},a),a.validator=e.getValidationMethod(a),a.field=n,a.fullField=a.fullField||n,a.type=e.getType(a),a.validator&&(h[n]=h[n]||[],h[n].push({rule:a,value:d,source:i,field:n}))})});var b={};v(h,s,function(t,e){var n=t.rule,r=("object"===n.type||"array"===n.type)&&("object"===a()(n.fields)||"object"===a()(n.defaultField));function i(t,e){return o()({},e,{fullField:n.fullField+"."+t})}function f(){var a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],f=a;if(Array.isArray(f)||(f=[f]),f.length&&c("async-validator:",f),f.length&&n.message&&(f=[].concat(n.message)),f=f.map(y(n)),s.first&&f.length)return b[n.field]=1,e(f);if(r){if(n.required&&!t.value)return f=n.message?[].concat(n.message).map(y(n)):s.error?[s.error(n,u(s.messages.required,n.field))]:[],e(f);var l={};if(n.defaultField)for(var p in t.value)t.value.hasOwnProperty(p)&&(l[p]=n.defaultField);for(var d in l=o()({},l,t.rule.fields),l)if(l.hasOwnProperty(d)){var h=Array.isArray(l[d])?l[d]:[l[d]];l[d]=h.map(i.bind(null,d))}var v=new pt(l);v.messages(s.messages),t.rule.options&&(t.rule.options.messages=s.messages,t.rule.options.error=s.error),v.validate(t.value,t.rule.options||s,function(t){e(t&&t.length?f.concat(t):t)})}else e(f)}r=r&&(n.required||!n.required&&t.value),n.field=t.field;var l=n.validator(n,t.value,f,t.source,s);l&&l.then&&l.then(function(){return f()},function(t){return f(t)})},function(t){w(t)})}else f&&f();function w(t){var e=void 0,n=void 0,r=[],o={};function i(t){Array.isArray(t)?r=r.concat.apply(r,t):r.push(t)}for(e=0;eb;b++)if(y=e?g(a(h=t[b])[0],h[1]):g(t[b]),y===u||y===f)return y}else for(v=m.call(t);!(h=v.next()).done;)if(y=o(v,g,h.value,e),y===u||y===f)return y};e.BREAK=u,e.RETURN=f},a25f:function(t,e,n){var r=n("7726"),o=r.navigator;t.exports=o&&o.userAgent||""},a3c3:function(t,e,n){var r=n("63b6");r(r.S+r.F,"Object",{assign:n("9306")})},a3de:function(t,e,n){"use strict";var r=!("undefined"===typeof window||!window.document||!window.document.createElement),o={canUseDOM:r,canUseWorkers:"undefined"!==typeof Worker,canUseEventListeners:r&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r};t.exports=o},a4bb:function(t,e,n){t.exports=n("8aae")},a5b8:function(t,e,n){"use strict";var r=n("d8e8");function o(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=r(e),this.reject=r(n)}t.exports.f=function(t){return new o(t)}},a5d8:function(t,e,n){},a78e:function(t,e,n){var r,o; +/*! + * JavaScript Cookie v2.2.0 + * https://github.com/js-cookie/js-cookie + * + * Copyright 2006, 2015 Klaus Hartl & Fagner Brack + * Released under the MIT license + */(function(i){var a=!1;if(r=i,o="function"===typeof r?r.call(e,n,e,t):r,void 0===o||(t.exports=o),a=!0,t.exports=i(),a=!0,!a){var s=window.Cookies,c=window.Cookies=i();c.noConflict=function(){return window.Cookies=s,c}}})(function(){function t(){for(var t=0,e={};t1){if(i=t({path:"/"},r.defaults,i),"number"===typeof i.expires){var s=new Date;s.setMilliseconds(s.getMilliseconds()+864e5*i.expires),i.expires=s}i.expires=i.expires?i.expires.toUTCString():"";try{a=JSON.stringify(o),/^[\{\[]/.test(a)&&(o=a)}catch(y){}o=n.write?n.write(o,e):encodeURIComponent(String(o)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)),e=e.replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent),e=e.replace(/[\(\)]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u]));return document.cookie=e+"="+o+c}e||(a={});for(var f=document.cookie?document.cookie.split("; "):[],l=/(%[0-9A-Z]{2})+/g,p=0;p1?arguments[1]:void 0,r=o(e.length),c=void 0===n?r:Math.min(o(n),r),u=String(t);return s?s.call(e,u,c):e.slice(c-u.length,c)===u}})},b0dc:function(t,e,n){var r=n("e4ae");t.exports=function(t,e,n,o){try{return o?e(r(n)[0],n[1]):e(n)}catch(a){var i=t["return"];throw void 0!==i&&r(i.call(t)),a}}},b447:function(t,e,n){var r=n("3a38"),o=Math.min;t.exports=function(t){return t>0?o(r(t),9007199254740991):0}},b50d:function(t,e,n){"use strict";var r=n("c532"),o=n("467f"),i=n("30b5"),a=n("c345"),s=n("3934"),c=n("2d83"),u="undefined"!==typeof window&&window.btoa&&window.btoa.bind(window)||n("9fa6");t.exports=function(t){return new Promise(function(e,f){var l=t.data,p=t.headers;r.isFormData(l)&&delete p["Content-Type"];var d=new XMLHttpRequest,h="onreadystatechange",v=!1;if("undefined"===typeof window||!window.XDomainRequest||"withCredentials"in d||s(t.url)||(d=new window.XDomainRequest,h="onload",v=!0,d.onprogress=function(){},d.ontimeout=function(){}),t.auth){var y=t.auth.username||"",m=t.auth.password||"";p.Authorization="Basic "+u(y+":"+m)}if(d.open(t.method.toUpperCase(),i(t.url,t.params,t.paramsSerializer),!0),d.timeout=t.timeout,d[h]=function(){if(d&&(4===d.readyState||v)&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var n="getAllResponseHeaders"in d?a(d.getAllResponseHeaders()):null,r=t.responseType&&"text"!==t.responseType?d.response:d.responseText,i={data:r,status:1223===d.status?204:d.status,statusText:1223===d.status?"No Content":d.statusText,headers:n,config:t,request:d};o(e,f,i),d=null}},d.onerror=function(){f(c("Network Error",t,null,d)),d=null},d.ontimeout=function(){f(c("timeout of "+t.timeout+"ms exceeded",t,"ECONNABORTED",d)),d=null},r.isStandardBrowserEnv()){var g=n("7aac"),b=(t.withCredentials||s(t.url))&&t.xsrfCookieName?g.read(t.xsrfCookieName):void 0;b&&(p[t.xsrfHeaderName]=b)}if("setRequestHeader"in d&&r.forEach(p,function(t,e){"undefined"===typeof l&&"content-type"===e.toLowerCase()?delete p[e]:d.setRequestHeader(e,t)}),t.withCredentials&&(d.withCredentials=!0),t.responseType)try{d.responseType=t.responseType}catch(w){if("json"!==t.responseType)throw w}"function"===typeof t.onDownloadProgress&&d.addEventListener("progress",t.onDownloadProgress),"function"===typeof t.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",t.onUploadProgress),t.cancelToken&&t.cancelToken.promise.then(function(t){d&&(d.abort(),f(t),d=null)}),void 0===l&&(l=null),d.send(l)})}},b8e3:function(t,e){t.exports=!0},ba99:function(t,e,n){var r=n("6abf"),o=n("9aa9"),i=n("e4ae"),a=n("e53d").Reflect;t.exports=a&&a.ownKeys||function(t){var e=r.f(i(t)),n=o.f;return n?e.concat(n(t)):e}},bc13:function(t,e,n){var r=n("e53d"),o=r.navigator;t.exports=o&&o.userAgent||""},bc3a:function(t,e,n){t.exports=n("cee4")},bcaa:function(t,e,n){var r=n("cb7c"),o=n("d3f4"),i=n("a5b8");t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t),a=n.resolve;return a(e),n.promise}},bd11:function(t,e){t.exports=v,t.exports.parse=i,t.exports.compile=a,t.exports.tokensToFunction=s,t.exports.tokensToRegExp=h;var n="/",r="./",o=new RegExp(["(\\\\.)","(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?"].join("|"),"g");function i(t,e){var i,a=[],s=0,f=0,l="",p=e&&e.delimiter||n,d=e&&e.delimiters||r,h=!1;while(null!==(i=o.exec(t))){var v=i[0],y=i[1],m=i.index;if(l+=t.slice(f,m),f=m+v.length,y)l+=y[1],h=!0;else{var g="",b=t[f],w=i[2],_=i[3],x=i[4],O=i[5];if(!h&&l.length){var E=l.length-1;d.indexOf(l[E])>-1&&(g=l[E],l=l.slice(0,E))}l&&(a.push(l),l="",h=!1);var S=""!==g&&void 0!==b&&b!==g,A="+"===O||"*"===O,C="?"===O||"*"===O,k=g||p,j=_||x;a.push({name:w||s++,prefix:g,delimiter:k,optional:C,repeat:A,partial:S,pattern:j?u(j):"[^"+c(k)+"]+?"})}}return(l||f-1;else{var m=y.repeat?"(?:"+y.pattern+")(?:"+c(y.delimiter)+"(?:"+y.pattern+"))*":y.pattern;e&&e.push(y),y.optional?y.partial?d+=c(y.prefix)+"("+m+")?":d+="(?:"+c(y.prefix)+"("+m+"))?":d+=c(y.prefix)+"("+m+")"}}return s?(i||(d+="(?:"+u+")?"),d+="$"===p?"$":"(?="+p+")"):(i||(d+="(?:"+u+"(?="+p+"))?"),h||(d+="(?="+u+"|"+p+")")),new RegExp(d,f(o))}function v(t,e,n){return t instanceof RegExp?l(t,e):Array.isArray(t)?p(t,e,n):d(t,e,n)}},be13:function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},bf0b:function(t,e,n){var r=n("355d"),o=n("aebd"),i=n("36c3"),a=n("1bc3"),s=n("07e3"),c=n("794b"),u=Object.getOwnPropertyDescriptor;e.f=n("8e60")?u:function(t,e){if(t=i(t),e=a(e,!0),c)try{return u(t,e)}catch(n){}if(s(t,e))return o(!r.f.call(t,e),t[e])}},bf90d:function(t,e,n){var r=n("36c3"),o=n("bf0b").f;n("ce7e")("getOwnPropertyDescriptor",function(){return function(t,e){return o(r(t),e)}})},c098:function(t,e,n){t.exports=n("d4af")},c207:function(t,e){},c345:function(t,e,n){"use strict";var r=n("c532"),o=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,n,i,a={};return t?(r.forEach(t.split("\n"),function(t){if(i=t.indexOf(":"),e=r.trim(t.substr(0,i)).toLowerCase(),n=r.trim(t.substr(i+1)),e){if(a[e]&&o.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([n]):a[e]?a[e]+", "+n:n}}),a):a}},c366:function(t,e,n){var r=n("6821"),o=n("9def"),i=n("77f1");t.exports=function(t){return function(e,n,a){var s,c=r(e),u=o(c.length),f=i(a,u);if(t&&n!=n){while(u>f)if(s=c[f++],s!=s)return!0}else for(;u>f;f++)if((t||f in c)&&c[f]===n)return t||f||0;return!t&&-1}}},c367:function(t,e,n){"use strict";var r=n("8436"),o=n("50ed"),i=n("481b"),a=n("36c3");t.exports=n("30f1")(Array,"Array",function(t,e){this._t=a(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},c3a1:function(t,e,n){var r=n("e6f3"),o=n("1691");t.exports=Object.keys||function(t){return r(t,o)}},c401:function(t,e,n){"use strict";var r=n("c532");t.exports=function(t,e,n){return r.forEach(n,function(n){t=n(t,e)}),t}},c532:function(t,e,n){"use strict";var r=n("1d2b"),o=n("044b"),i=Object.prototype.toString;function a(t){return"[object Array]"===i.call(t)}function s(t){return"[object ArrayBuffer]"===i.call(t)}function c(t){return"undefined"!==typeof FormData&&t instanceof FormData}function u(t){var e;return e="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function f(t){return"string"===typeof t}function l(t){return"number"===typeof t}function p(t){return"undefined"===typeof t}function d(t){return null!==t&&"object"===typeof t}function h(t){return"[object Date]"===i.call(t)}function v(t){return"[object File]"===i.call(t)}function y(t){return"[object Blob]"===i.call(t)}function m(t){return"[object Function]"===i.call(t)}function g(t){return d(t)&&m(t.pipe)}function b(t){return"undefined"!==typeof URLSearchParams&&t instanceof URLSearchParams}function w(t){return t.replace(/^\s*/,"").replace(/\s*$/,"")}function _(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function x(t,e){if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),a(t))for(var n=0,r=t.length;n=t.length?(this._t=void 0,o(1)):o(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},cb7c:function(t,e,n){var r=n("d3f4");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},ccb9:function(t,e,n){e.f=n("5168")},cd78:function(t,e,n){var r=n("e4ae"),o=n("f772"),i=n("656e");t.exports=function(t,e){if(r(t),o(e)&&e.constructor===t)return e;var n=i.f(t),a=n.resolve;return a(e),n.promise}},ce10:function(t,e,n){var r=n("69a8"),o=n("6821"),i=n("c366")(!1),a=n("613b")("IE_PROTO");t.exports=function(t,e){var n,s=o(t),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);while(e.length>c)r(s,n=e[c++])&&(~i(u,n)||u.push(n));return u}},ce7e:function(t,e,n){var r=n("63b6"),o=n("584a"),i=n("294c");t.exports=function(t,e){var n=(o.Object||{})[t]||Object[t],a={};a[t]=e(n),r(r.S+r.F*i(function(){n(1)}),"Object",a)}},cee4:function(t,e,n){"use strict";var r=n("c532"),o=n("1d2b"),i=n("0a06"),a=n("2444");function s(t){var e=new i(t),n=o(i.prototype.request,e);return r.extend(n,i.prototype,e),r.extend(n,e),n}var c=s(a);c.Axios=i,c.create=function(t){return s(r.merge(a,t))},c.Cancel=n("7a77"),c.CancelToken=n("8df4"),c.isCancel=n("2e67"),c.all=function(t){return Promise.all(t)},c.spread=n("0df6"),t.exports=c,t.exports.default=c},d2c8:function(t,e,n){var r=n("aae3"),o=n("be13");t.exports=function(t,e,n){if(r(e))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(t))}},d3f4:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},d4af:function(t,e,n){"use strict";var r=n("8eb7"),o=n("7b3e"),i=10,a=40,s=800;function c(t){var e=0,n=0,r=0,o=0;return"detail"in t&&(n=t.detail),"wheelDelta"in t&&(n=-t.wheelDelta/120),"wheelDeltaY"in t&&(n=-t.wheelDeltaY/120),"wheelDeltaX"in t&&(e=-t.wheelDeltaX/120),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=n,n=0),r=e*i,o=n*i,"deltaY"in t&&(o=t.deltaY),"deltaX"in t&&(r=t.deltaX),(r||o)&&t.deltaMode&&(1==t.deltaMode?(r*=a,o*=a):(r*=s,o*=s)),r&&!e&&(e=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:e,spinY:n,pixelX:r,pixelY:o}}c.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},t.exports=c},d53b:function(t,e){t.exports=function(t,e){return{value:e,done:!!t}}},d847:function(t,e,n){t.exports=n("5bba")},d864:function(t,e,n){var r=n("79aa");t.exports=function(t,e,n){if(r(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,o){return t.call(e,n,r,o)}}return function(){return t.apply(e,arguments)}}},d8d6:function(t,e,n){n("1654"),n("6c1c"),t.exports=n("ccb9").f("iterator")},d8e8:function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t}},d925:function(t,e,n){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},d9f6:function(t,e,n){var r=n("e4ae"),o=n("794b"),i=n("1bc3"),a=Object.defineProperty;e.f=n("8e60")?Object.defineProperty:function(t,e,n){if(r(t),e=i(e,!0),r(n),o)try{return a(t,e,n)}catch(s){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},db72:function(t,e,n){"use strict";var r=n("85f2"),o=n.n(r),i=n("d847"),a=n.n(i),s=n("5e83"),c=n.n(s),u=n("268f"),f=n.n(u),l=n("e265"),p=n.n(l),d=n("a4bb"),h=n.n(d);function v(t,e,n){return e in t?o()(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t,e){var n=h()(t);if(p.a){var r=p()(t);e&&(r=r.filter(function(e){return f()(t,e).enumerable})),n.push.apply(n,r)}return n}function m(t){for(var e=1;e=0;r--){var o=t[r];"."===o?t.splice(r,1):".."===o?(t.splice(r,1),n++):n&&(t.splice(r,1),n--)}if(e)for(;n--;n)t.unshift("..");return t}function r(t){"string"!==typeof t&&(t+="");var e,n=0,r=-1,o=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!o){n=e+1;break}}else-1===r&&(o=!1,r=e+1);return-1===r?"":t.slice(n,r)}function o(t,e){if(t.filter)return t.filter(e);for(var n=[],r=0;r=-1&&!r;i--){var a=i>=0?arguments[i]:t.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,r="/"===a.charAt(0))}return e=n(o(e.split("/"),function(t){return!!t}),!r).join("/"),(r?"/":"")+e||"."},e.normalize=function(t){var r=e.isAbsolute(t),a="/"===i(t,-1);return t=n(o(t.split("/"),function(t){return!!t}),!r).join("/"),t||r||(t="."),t&&a&&(t+="/"),(r?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(o(t,function(t,e){if("string"!==typeof t)throw new TypeError("Arguments to path.join must be strings");return t}).join("/"))},e.relative=function(t,n){function r(t){for(var e=0;e=0;n--)if(""!==t[n])break;return e>n?[]:t.slice(e,n-e+1)}t=e.resolve(t).substr(1),n=e.resolve(n).substr(1);for(var o=r(t.split("/")),i=r(n.split("/")),a=Math.min(o.length,i.length),s=a,c=0;c=1;--i)if(e=t.charCodeAt(i),47===e){if(!o){r=i;break}}else o=!1;return-1===r?n?"/":".":n&&1===r?"/":t.slice(0,r)},e.basename=function(t,e){var n=r(t);return e&&n.substr(-1*e.length)===e&&(n=n.substr(0,n.length-e.length)),n},e.extname=function(t){"string"!==typeof t&&(t+="");for(var e=-1,n=0,r=-1,o=!0,i=0,a=t.length-1;a>=0;--a){var s=t.charCodeAt(a);if(47!==s)-1===r&&(o=!1,r=a+1),46===s?-1===e?e=a:1!==i&&(i=1):-1!==e&&(i=-1);else if(!o){n=a+1;break}}return-1===e||-1===r||0===i||1===i&&e===r-1&&e===n+1?"":t.slice(e,r)};var i="b"==="ab".substr(-1)?function(t,e,n){return t.substr(e,n)}:function(t,e,n){return e<0&&(e=t.length+e),t.substr(e,n)}}).call(this,n("4362"))},e017:function(t,e,n){(function(e){(function(e,n){t.exports=n()})(0,function(){"use strict";var t=function(t){var e=t.id,n=t.viewBox,r=t.content;this.id=e,this.viewBox=n,this.content=r};t.prototype.stringify=function(){return this.content},t.prototype.toString=function(){return this.stringify()},t.prototype.destroy=function(){var t=this;["id","viewBox","content"].forEach(function(e){return delete t[e]})};var n=function(t){var e=!!document.importNode,n=(new DOMParser).parseFromString(t,"image/svg+xml").documentElement;return e?document.importNode(n,!0):n};"undefined"!==typeof window?window:"undefined"!==typeof e||"undefined"!==typeof self&&self;function r(t,e){return e={exports:{}},t(e,e.exports),e.exports}var o=r(function(t,e){(function(e,n){t.exports=n()})(0,function(){function t(t){var e=t&&"object"===typeof t;return e&&"[object RegExp]"!==Object.prototype.toString.call(t)&&"[object Date]"!==Object.prototype.toString.call(t)}function e(t){return Array.isArray(t)?[]:{}}function n(n,r){var o=r&&!0===r.clone;return o&&t(n)?i(e(n),n,r):n}function r(e,r,o){var a=e.slice();return r.forEach(function(r,s){"undefined"===typeof a[s]?a[s]=n(r,o):t(r)?a[s]=i(e[s],r,o):-1===e.indexOf(r)&&a.push(n(r,o))}),a}function o(e,r,o){var a={};return t(e)&&Object.keys(e).forEach(function(t){a[t]=n(e[t],o)}),Object.keys(r).forEach(function(s){t(r[s])&&e[s]?a[s]=i(e[s],r[s],o):a[s]=n(r[s],o)}),a}function i(t,e,i){var a=Array.isArray(e),s=i||{arrayMerge:r},c=s.arrayMerge||r;return a?Array.isArray(t)?c(t,e,i):n(e,i):o(t,e,i)}return i.all=function(t,e){if(!Array.isArray(t)||t.length<2)throw new Error("first argument should be an array with at least two elements");return t.reduce(function(t,n){return i(t,n,e)})},i})}),i=r(function(t,e){var n={svg:{name:"xmlns",uri:"http://www.w3.org/2000/svg"},xlink:{name:"xmlns:xlink",uri:"http://www.w3.org/1999/xlink"}};e.default=n,t.exports=e.default}),a=function(t){return Object.keys(t).map(function(e){var n=t[e].toString().replace(/"/g,""");return e+'="'+n+'"'}).join(" ")},s=i.svg,c=i.xlink,u={};u[s.name]=s.uri,u[c.name]=c.uri;var f=function(t,e){void 0===t&&(t="");var n=o(u,e||{}),r=a(n);return""+t+""},l=function(t){function e(){t.apply(this,arguments)}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var r={isMounted:{}};return r.isMounted.get=function(){return!!this.node},e.createFromExistingNode=function(t){return new e({id:t.getAttribute("id"),viewBox:t.getAttribute("viewBox"),content:t.outerHTML})},e.prototype.destroy=function(){this.isMounted&&this.unmount(),t.prototype.destroy.call(this)},e.prototype.mount=function(t){if(this.isMounted)return this.node;var e="string"===typeof t?document.querySelector(t):t,n=this.render();return this.node=n,e.appendChild(n),n},e.prototype.render=function(){var t=this.stringify();return n(f(t)).childNodes[0]},e.prototype.unmount=function(){this.node.parentNode.removeChild(this.node)},Object.defineProperties(e.prototype,r),e}(t);return l})}).call(this,n("c8ba"))},e11e:function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},e265:function(t,e,n){t.exports=n("ed33")},e4ae:function(t,e,n){var r=n("f772");t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},e53d:function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},e683:function(t,e,n){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},e6f3:function(t,e,n){var r=n("07e3"),o=n("36c3"),i=n("5b4e")(!1),a=n("5559")("IE_PROTO");t.exports=function(t,e){var n,s=o(t),c=0,u=[];for(n in s)n!=a&&r(s,n)&&u.push(n);while(e.length>c)r(s,n=e[c++])&&(~i(u,n)||u.push(n));return u}},ebd6:function(t,e,n){var r=n("cb7c"),o=n("d8e8"),i=n("2b4c")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[i])?e:o(n)}},ebfd:function(t,e,n){var r=n("62a0")("meta"),o=n("f772"),i=n("07e3"),a=n("d9f6").f,s=0,c=Object.isExtensible||function(){return!0},u=!n("294c")(function(){return c(Object.preventExtensions({}))}),f=function(t){a(t,r,{value:{i:"O"+ ++s,w:{}}})},l=function(t,e){if(!o(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!i(t,r)){if(!c(t))return"F";if(!e)return"E";f(t)}return t[r].i},p=function(t,e){if(!i(t,r)){if(!c(t))return!0;if(!e)return!1;f(t)}return t[r].w},d=function(t){return u&&h.NEED&&c(t)&&!i(t,r)&&f(t),t},h=t.exports={KEY:r,NEED:!1,fastKey:l,getWeak:p,onFreeze:d}},ed33:function(t,e,n){n("014b"),t.exports=n("584a").Object.getOwnPropertySymbols},ee6d:function(t,e,n){var r=n("63b6"),o=n("ba99"),i=n("36c3"),a=n("bf0b"),s=n("20fd");r(r.S,"Object",{getOwnPropertyDescriptors:function(t){var e,n,r=i(t),c=a.f,u=o(r),f={},l=0;while(u.length>l)n=c(r,e=u[l++]),void 0!==n&&s(f,e,n);return f}})},f201:function(t,e,n){var r=n("e4ae"),o=n("79aa"),i=n("5168")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||void 0==(n=r(a)[i])?e:o(n)}},f559:function(t,e,n){"use strict";var r=n("5ca1"),o=n("9def"),i=n("d2c8"),a="startsWith",s=""[a];r(r.P+r.F*n("5147")(a),"String",{startsWith:function(t){var e=i(this,t,a),n=o(Math.min(arguments.length>1?arguments[1]:void 0,e.length)),r=String(t);return s?s.call(e,r,n):e.slice(n,n+r.length)===r}})},f5df:function(t,e,n){},f605:function(t,e){t.exports=function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!");return t}},f6b4:function(t,e,n){"use strict";var r=n("c532");function o(){this.handlers=[]}o.prototype.use=function(t,e){return this.handlers.push({fulfilled:t,rejected:e}),this.handlers.length-1},o.prototype.eject=function(t){this.handlers[t]&&(this.handlers[t]=null)},o.prototype.forEach=function(t){r.forEach(this.handlers,function(e){null!==e&&t(e)})},t.exports=o},f751:function(t,e,n){var r=n("5ca1");r(r.S+r.F,"Object",{assign:n("7333")})},f772:function(t,e){t.exports=function(t){return"object"===typeof t?null!==t:"function"===typeof t}},f893:function(t,e,n){t.exports={default:n("f921"),__esModule:!0}},f921:function(t,e,n){n("014b"),n("c207"),n("69d3"),n("765d"),t.exports=n("584a").Symbol},fa5b:function(t,e,n){t.exports=n("5537")("native-function-to-string",Function.toString)},fab2:function(t,e,n){var r=n("7726").document;t.exports=r&&r.documentElement},fde4:function(t,e,n){n("bf90d");var r=n("584a").Object;t.exports=function(t,e){return r.getOwnPropertyDescriptor(t,e)}}}]); \ No newline at end of file diff --git a/sop-auth/.gitignore b/sop-auth/.gitignore new file mode 100644 index 00000000..153c9335 --- /dev/null +++ b/sop-auth/.gitignore @@ -0,0 +1,29 @@ +HELP.md +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +/build/ + +### VS Code ### +.vscode/ diff --git a/sop-auth/pom.xml b/sop-auth/pom.xml new file mode 100644 index 00000000..f05332e8 --- /dev/null +++ b/sop-auth/pom.xml @@ -0,0 +1,135 @@ + + + 4.0.0 + + org.springframework.boot + spring-boot-starter-parent + 2.1.2.RELEASE + + + com.gitee.sop + sop-auth + 1.0.0-SNAPSHOT + sop-auth + 授权程序 + + + 1.8 + Greenwich.RELEASE + 0.31 + + + + + + + com.gitee.sop + sop-service-common + 2.0.0-SNAPSHOT + + + + + + org.springframework.cloud + spring-cloud-starter-alibaba-nacos-discovery + 0.2.2.RELEASE + + + com.alibaba.nacos + nacos-client + + + + + com.alibaba.nacos + nacos-client + 1.1.0 + + + + com.gitee.sop + sdk-java + 1.0.0-SNAPSHOT + + + + net.oschina.durcframework + fastmybatis-spring-boot-starter + 1.7.1 + + + mysql + mysql-connector-java + runtime + + + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.authzserver + ${oltu.version} + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.resourceserver + ${oltu.version} + + + + org.springframework.boot + spring-boot-starter-web + + + org.springframework.boot + spring-boot-starter-thymeleaf + + + org.springframework.boot + spring-boot-starter-data-redis + + + + org.projectlombok + lombok + true + + + org.springframework.boot + spring-boot-starter-test + test + + + com.google.guava + guava + 27.1-jre + compile + + + + + + + org.springframework.cloud + spring-cloud-dependencies + ${spring-cloud.version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-maven-plugin + + + + + diff --git a/sop-auth/readme.md b/sop-auth/readme.md new file mode 100644 index 00000000..6c11e032 --- /dev/null +++ b/sop-auth/readme.md @@ -0,0 +1,11 @@ +# 应用授权服务 + +- 启动注册中心、网关、本服务(sop-auth) +- 浏览器访问:http://localhost:8087/oauth2/appToAppAuth?app_id=2019032617262200001&redirect_uri=http%3a%2f%2flocalhost%3a8087%2foauth2callback +- 输入用户名密码登录,这里是`zhangsan/123456` + +授权接口在`OAuth2Controller`中,查看回调接口在`CallbackController`中 + +回调接口应该由开发者实现,这里为了演示,写在一起。 + +token的维护,重点关注`OAuth2ManagerRedis.java` diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/SopAuthApplication.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/SopAuthApplication.java new file mode 100644 index 00000000..29595038 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/SopAuthApplication.java @@ -0,0 +1,15 @@ +package com.gitee.sop.sopauth; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; +import org.springframework.cloud.client.discovery.EnableDiscoveryClient; + +@EnableDiscoveryClient +@SpringBootApplication +public class SopAuthApplication { + + public static void main(String[] args) { + SpringApplication.run(SopAuthApplication.class, args); + } + +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/AccessToken.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/AccessToken.java new file mode 100644 index 00000000..83cc9925 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/AccessToken.java @@ -0,0 +1,44 @@ +package com.gitee.sop.sopauth.auth; + +/** + * @author tanghc + */ +public class AccessToken { + /** 过期时间,毫秒 */ + private long expireTimeMillis; + private OpenUser openUser; + + /** + * @param expireIn 有效时长,秒 + * @param openUser + */ + public AccessToken(long expireIn, OpenUser openUser) { + super(); + if(expireIn <= 0) { + throw new IllegalArgumentException("expireIn必须大于0"); + } + this.expireTimeMillis = System.currentTimeMillis() + (expireIn * 1000); + this.openUser = openUser; + } + + public boolean isExpired() { + return expireTimeMillis < System.currentTimeMillis(); + } + + public long getExpireTimeMillis() { + return expireTimeMillis; + } + + public void setExpireTimeMillis(long expireTimeMillis) { + this.expireTimeMillis = expireTimeMillis; + } + + public OpenUser getOpenUser() { + return openUser; + } + + public void setOpenUser(OpenUser openUser) { + this.openUser = openUser; + } + +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/AppIdManager.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/AppIdManager.java new file mode 100644 index 00000000..4d9eb26d --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/AppIdManager.java @@ -0,0 +1,14 @@ +package com.gitee.sop.sopauth.auth; + +/** + * @author tanghc + */ +public interface AppIdManager { + /** + * 是否是合法的appId + * + * @param appId + * @return true:合法 + */ + boolean isValidAppId(String appId); +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/FetchTokenParam.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/FetchTokenParam.java new file mode 100644 index 00000000..2acc1a16 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/FetchTokenParam.java @@ -0,0 +1,30 @@ +package com.gitee.sop.sopauth.auth; + +import lombok.Data; + +import javax.validation.constraints.NotBlank; + +/** + * 获取accessToken参数对象 + * @author tanghc + */ +@Data +public class FetchTokenParam { + /** + * 授权类型。
+ * 如果使用app_auth_code换取token,则为authorization_code, + * 如果使用refresh_token换取新的token,则为refresh_token + */ + @NotBlank(message = "授权类型不能为空") + private String grant_type; + + /** + * 授权码.与refresh_token二选一,用户对应用授权后得到,即第一步中开发者获取到的app_auth_code值 + */ + private String code; + + /** + * 刷新令牌.与code二选一,可为空,刷新令牌时使用 + */ + private String refresh_token; +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/FetchTokenResult.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/FetchTokenResult.java new file mode 100644 index 00000000..be4360b2 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/FetchTokenResult.java @@ -0,0 +1,39 @@ +package com.gitee.sop.sopauth.auth; + +import lombok.Data; + +/** + * 使用app_auth_code换取app_auth_token返回结果 + * @author tanghc + */ +@Data +public class FetchTokenResult { + /** + * 授权令牌 + */ + private String app_auth_token; + + /** + * 用户id + */ + private String user_id; + + /** + * 令牌有效期. -1:永久有效 + */ + private long expires_in = -1; + + /** + * 刷新令牌有效期. -1:永久有效 + */ + private long re_expires_in = -1; + + /** + * 刷新令牌时使用。 + * 刷新令牌后,我们会保证老的app_auth_token从刷新开始10分钟内可继续使用,请及时替换为最新token + */ + private String app_refresh_token; + + private String error; + private String error_description; +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OAuth2Config.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OAuth2Config.java new file mode 100644 index 00000000..6a021dc0 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OAuth2Config.java @@ -0,0 +1,46 @@ +package com.gitee.sop.sopauth.auth; + +import lombok.Data; + +/** + * @author tanghc + */ +@Data +public class OAuth2Config { + + private static OAuth2Config instance = new OAuth2Config(); + + public static OAuth2Config getInstance() { + return instance; + } + + public static void setInstance(OAuth2Config instance) { + OAuth2Config.instance = instance; + } + + /** + * 应用授权的app_auth_code唯一的;app_auth_code使用一次后失效,一天(从生成app_auth_code开始的24小时)未被使用自动过期; + * app_auth_token永久有效。 + */ + private int codeTimeoutSeconds = 86400; + /** + * accessToken有效时间,单位秒 + * -1 永久有效 + */ + private int accessTokenExpiresIn = -1; + + /** + * app_refresh_token有效时间,单位秒,accessToken有效时间的3倍。当小于0,永久有效 + */ + private int refreshTokenExpiresIn = accessTokenExpiresIn * 3; + + /** + * 刷新令牌后,我们会保证老的app_auth_token从刷新开始10分钟内可继续使用,请及时替换为最新token + */ + private int afterRefreshExpiresIn = 60 * 10; + + /** + * 登录视图页面用于,mvc视图,如:loginView + */ + private String oauth2LoginUri = "/oauth2/login"; +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OAuth2Manager.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OAuth2Manager.java new file mode 100644 index 00000000..5f28f956 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OAuth2Manager.java @@ -0,0 +1,85 @@ +package com.gitee.sop.sopauth.auth; + + +import com.gitee.sop.sopauth.auth.exception.LoginErrorException; + +import javax.servlet.http.HttpServletRequest; + +/** + * 认证服务,需要自己实现 + * @author tanghc + * + */ +public interface OAuth2Manager { + + /** + * 添加 auth code + * + * @param authCode + * code值 + * @param authUser + * 用户 + */ + void addAuthCode(String authCode, OpenUser authUser); + + /** + * 添加accessToken + * @param accessToken token值 + * @param refreshToken refreshToken + * @param authUser 用户 + */ + void addAccessToken(String accessToken, String refreshToken, OpenUser authUser); + + + /** + * 删除这个accessToken + * @param accessToken + */ + void removeAccessToken(String accessToken); + + /** + * 删除这个refreshToken + * @param refreshToken + */ + void removeRefreshToken(String refreshToken); + + /** + * 获取RefreshToken + * @param refreshToken + * @return 返回Token信息 + */ + RefreshToken getRefreshToken(String refreshToken); + + /** + * 验证auth code是否有效 + * + * @param authCode + * @return 无效返回false + */ + boolean checkAuthCode(String authCode); + + /** + * 根据auth code获取用户 + * + * @param authCode + * @return 返回用户 + */ + OpenUser getUserByAuthCode(String authCode); + + /** + * 根据access token获取用户 + * + * @param accessToken + * token值 + * @return 返回用户 + */ + OpenUser getUserByAccessToken(String accessToken); + + /** + * 用户登录,需判断是否已经登录 + * @param request + * @return 返回用户对象 + * @throws LoginErrorException 登录失败异常 + */ + OpenUser login(HttpServletRequest request) throws LoginErrorException; +} \ No newline at end of file diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OAuth2Service.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OAuth2Service.java new file mode 100644 index 00000000..ecc9d26e --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OAuth2Service.java @@ -0,0 +1,44 @@ +package com.gitee.sop.sopauth.auth; + +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; +import org.apache.oltu.oauth2.common.message.OAuthResponse; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.net.URISyntaxException; + +/** + * @author tanghc + */ +public interface OAuth2Service { + + /** + * oauth2授权,获取code. + *
+     *  1、首先通过如http://localhost:8080/api/authorize?client_id=test&response_type=code&redirect_uri=http%3A%2F%2Flocalhost%3A8080%2Foauth2callback访问授权页面;
+        2、该控制器首先检查clientId是否正确;如果错误将返回相应的错误信息;
+        3、然后判断用户是否登录了,如果没有登录首先到登录页面登录;
+        4、登录成功后生成相应的code即授权码,然后重定向到客户端地址,如http://localhost:8080/oauth2callback?code=6d250650831fea227749f49a5b49ccad;在重定向到的地址中会带上code参数(授权码),接着客户端可以根据授权码去换取accessToken。
+     * 
+ * + * @param request req + * @param response resp + * @param authConfig 配置 + * @return 返回响应内容 + * @throws URISyntaxException + * @throws OAuthSystemException + */ + OAuthResponse authorize(HttpServletRequest request, HttpServletResponse response, OAuth2Config authConfig) + throws URISyntaxException, OAuthSystemException; + + + /** + * 通过code获取accessToken. + * @param fetchTokenParam + * @param authConfig 配置项 + * @return 返回响应内容 + * @throws URISyntaxException + * @throws OAuthSystemException + */ + FetchTokenResult accessToken(FetchTokenParam fetchTokenParam, OAuth2Config authConfig); +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OpenUser.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OpenUser.java new file mode 100644 index 00000000..5e7338b3 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/OpenUser.java @@ -0,0 +1,22 @@ +package com.gitee.sop.sopauth.auth; + +import java.io.Serializable; + +/** + * 如果要使用oauth2功能,自己的用户类需要实现这个对象 + * + * @author tanghc + */ +public interface OpenUser extends Serializable { + /** + * 返回用户id + * @return + */ + String getUserId(); + /** + * 返回用户名 + * + * @return 返回用户名 + */ + String getUsername(); +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/RefreshToken.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/RefreshToken.java new file mode 100644 index 00000000..acd04d54 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/RefreshToken.java @@ -0,0 +1,40 @@ +package com.gitee.sop.sopauth.auth; + +import java.io.Serializable; + +/** + * @author tanghc + */ +public class RefreshToken implements Serializable { + private static final long serialVersionUID = 1L; + + private String accessToken; + private OpenUser openUser; + + public RefreshToken(String accessToken, OpenUser openUser) { + super(); + this.accessToken = accessToken; + this.openUser = openUser; + } + + public RefreshToken() { + super(); + } + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public OpenUser getOpenUser() { + return openUser; + } + + public void setOpenUser(OpenUser openUser) { + this.openUser = openUser; + } + +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/TokenPair.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/TokenPair.java new file mode 100644 index 00000000..07e11214 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/TokenPair.java @@ -0,0 +1,29 @@ +package com.gitee.sop.sopauth.auth; + +/** + * 存放accessToken和refreshToken + * + * @author tanghc + * + */ +public class TokenPair { + private String accessToken; + private String refreshToken; + + public String getAccessToken() { + return accessToken; + } + + public void setAccessToken(String accessToken) { + this.accessToken = accessToken; + } + + public String getRefreshToken() { + return refreshToken; + } + + public void setRefreshToken(String refreshToken) { + this.refreshToken = refreshToken; + } + +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/exception/LoginErrorException.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/exception/LoginErrorException.java new file mode 100644 index 00000000..92e61d6a --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/exception/LoginErrorException.java @@ -0,0 +1,25 @@ +package com.gitee.sop.sopauth.auth.exception; + +/** + * @author tanghc + */ +public class LoginErrorException extends Exception { + private static final long serialVersionUID = -6721499454527023339L; + + public LoginErrorException() { + super(); + } + + public LoginErrorException(String message, Throwable cause) { + super(message, cause); + } + + public LoginErrorException(String message) { + super(message); + } + + public LoginErrorException(Throwable cause) { + super(cause); + } + +} \ No newline at end of file diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/AppIdManagerImpl.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/AppIdManagerImpl.java new file mode 100644 index 00000000..9c49954b --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/AppIdManagerImpl.java @@ -0,0 +1,33 @@ +package com.gitee.sop.sopauth.auth.impl; + +import com.gitee.sop.sopauth.auth.AppIdManager; +import com.gitee.sop.sopauth.entity.IsvInfo; +import com.gitee.sop.sopauth.mapper.IsvInfoMapper; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * @author tanghc + */ +@Service +@Slf4j +public class AppIdManagerImpl implements AppIdManager { + + public static final int FORBIDDEN = 2; + @Autowired + private IsvInfoMapper isvInfoMapper; + + @Override + public boolean isValidAppId(String appId) { + IsvInfo isvInfo = isvInfoMapper.getByColumn("app_key", appId); + if (isvInfo == null) { + return false; + } + if (isvInfo.getStatus().intValue() == FORBIDDEN) { + log.error("appId已禁用:{}", appId); + return false; + } + return true; + } +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerCache.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerCache.java new file mode 100644 index 00000000..0055759e --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerCache.java @@ -0,0 +1,128 @@ +package com.gitee.sop.sopauth.auth.impl; + +import com.gitee.fastmybatis.core.query.Query; +import com.gitee.sop.sopauth.auth.OAuth2Config; +import com.gitee.sop.sopauth.auth.OAuth2Manager; +import com.gitee.sop.sopauth.auth.OpenUser; +import com.gitee.sop.sopauth.auth.RefreshToken; +import com.gitee.sop.sopauth.auth.exception.LoginErrorException; +import com.gitee.sop.sopauth.entity.UserInfo; +import com.gitee.sop.sopauth.mapper.UserInfoMapper; +import com.google.common.cache.CacheBuilder; +import com.google.common.cache.CacheLoader; +import com.google.common.cache.LoadingCache; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import javax.servlet.http.HttpServletRequest; +import java.util.concurrent.TimeUnit; + +/** + * oauth2管理,默认谷歌缓存实现,跟redis实现只能用一个。 + * 这里为了演示,使用本地缓存,正式环境请使用redis保存 + * @see OAuth2ManagerRedis OAuth2ManagerRedis + * @author tanghc + * + */ +@Service +public class OAuth2ManagerCache implements OAuth2Manager { + /** + * 应用授权的app_auth_code唯一的;app_auth_code使用一次后失效,一天(从生成app_auth_code开始的24小时)未被使用自动过期; + * app_auth_token永久有效。 + */ + private int codeTimeoutSeconds = OAuth2Config.getInstance().getCodeTimeoutSeconds(); + /** + * accessToken过期时间 + * -1 永久有效 + */ + private int accessTokenTimeoutSeconds = OAuth2Config.getInstance().getAccessTokenExpiresIn(); + + private int refreshTokenTimeoutSeconds = OAuth2Config.getInstance().getRefreshTokenExpiresIn(); + + private LoadingCache codeCache = buildCache(codeTimeoutSeconds); + private LoadingCache accessTokenCache = buildCache(accessTokenTimeoutSeconds); + private LoadingCache refreshTokenCache = buildCache(refreshTokenTimeoutSeconds); + + @Autowired + private UserInfoMapper userInfoMapper; + + + private static LoadingCache buildCache(int timeout) { + CacheBuilder cacheBuilder = CacheBuilder.newBuilder(); + if (timeout > 0) { + cacheBuilder.expireAfterAccess(timeout, TimeUnit.SECONDS); + } + return cacheBuilder + .build(new CacheLoader() { + @Override + public T load(String key) throws Exception { + return null; + } + }); + } + + @Override + public void addAuthCode(String authCode, OpenUser authUser) { + codeCache.put(authCode, authUser); + } + + + @Override + public void addAccessToken(String accessToken, String refreshToken, OpenUser authUser) { + accessTokenCache.put(accessToken, authUser); + refreshTokenCache.put(refreshToken, new RefreshToken(accessToken, authUser)); + } + + @Override + public void removeAccessToken(String accessToken) { + accessTokenCache.asMap().remove(accessToken); + } + + @Override + public void removeRefreshToken(String refreshToken) { + refreshTokenCache.asMap().remove(refreshToken); + } + + @Override + public RefreshToken getRefreshToken(String refreshToken) { + return refreshTokenCache.getIfPresent(refreshToken); + } + + @Override + public boolean checkAuthCode(String authCode) { + return codeCache.asMap().containsKey(authCode); + } + + @Override + public OpenUser getUserByAuthCode(String authCode) { + return codeCache.getIfPresent(authCode); + } + + @Override + public OpenUser getUserByAccessToken(String accessToken) { + return accessTokenCache.getIfPresent(accessToken); + } + + @Override + public OpenUser login(HttpServletRequest request) throws LoginErrorException { + // 这里应该先检查用户有没有登录,如果登录直接返回openUser + String username = request.getParameter("username"); + String password = request.getParameter("password"); + if(StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) { + throw new LoginErrorException("用户名密码不能为空"); + } + + Query query = new Query(); + query.eq("username", username) + .eq("password", password); + UserInfo userInfo = userInfoMapper.getByQuery(query); + + if(userInfo == null) { + throw new LoginErrorException("用户名密码不正确"); + } + + return userInfo; + } + +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerRedis.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerRedis.java new file mode 100644 index 00000000..3cabfd59 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ManagerRedis.java @@ -0,0 +1,168 @@ +package com.gitee.sop.sopauth.auth.impl; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.gitee.fastmybatis.core.query.Query; +import com.gitee.sop.sopauth.auth.OAuth2Config; +import com.gitee.sop.sopauth.auth.OAuth2Manager; +import com.gitee.sop.sopauth.auth.OpenUser; +import com.gitee.sop.sopauth.auth.RefreshToken; +import com.gitee.sop.sopauth.auth.exception.LoginErrorException; +import com.gitee.sop.sopauth.entity.UserInfo; +import com.gitee.sop.sopauth.mapper.UserInfoMapper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.data.redis.core.StringRedisTemplate; +import org.springframework.util.StringUtils; + +import javax.servlet.http.HttpServletRequest; +import java.util.concurrent.TimeUnit; + +/** + * + * oauth2管理redis实现,这个类跟OAuth2ManagerCache类只能用一个, + * 如果要用这个类, + * 1、注释掉OAuth2ManagerCache的@Service。 + * 2、打开yml中redis部分 + * 3、启用这个类的@Service + * + * @author tanghc + */ +//@Service +public class OAuth2ManagerRedis implements OAuth2Manager { + + private static String CODE_PREFIX = "com.gitee.sop.oauth2_code:"; + private static String ACCESS_TOKEN_PREFIX = "com.gitee.sop.oauth2_access_token:"; + private static String REFRESH_TOKEN_PREFIX = "com.gitee.sop.oauth2_refresh_token:"; + + @Autowired + private StringRedisTemplate redisTemplate; + + @Autowired + private UserInfoMapper userInfoMapper; + + public static String getCodeKey(String code) { + return CODE_PREFIX + code; + } + + public static String getAccessTokenKey(String accessToken) { + return ACCESS_TOKEN_PREFIX + accessToken; + } + + public static String getRefreshTokenKey(String refreshToken) { + return REFRESH_TOKEN_PREFIX + refreshToken; + } + + @Override + public void addAuthCode(String authCode, OpenUser authUser) { + long codeTimeoutSeconds = OAuth2Config.getInstance().getCodeTimeoutSeconds(); + redisTemplate.opsForValue().set(getCodeKey(authCode), + JSON.toJSONString(authUser), + codeTimeoutSeconds, + TimeUnit.SECONDS); + } + + + @Override + public void addAccessToken(String accessToken, String refreshToken, OpenUser authUser) { + // 存accessToken + long expiresIn = OAuth2Config.getInstance().getAccessTokenExpiresIn(); + long reExpiresIn = OAuth2Config.getInstance().getRefreshTokenExpiresIn(); + if (expiresIn > 0) { + redisTemplate.opsForValue().set(getAccessTokenKey(accessToken), JSON.toJSONString(authUser), expiresIn, TimeUnit.SECONDS); + } else { + redisTemplate.opsForValue().set(getAccessTokenKey(accessToken), JSON.toJSONString(authUser)); + } + // 存refreshToken + if (reExpiresIn > 0) { + redisTemplate.opsForValue().set( + getRefreshTokenKey(refreshToken), + JSON.toJSONString(new RefreshToken(accessToken, authUser)), + // refreshToken过期时间 + reExpiresIn, + TimeUnit.SECONDS); + } else { + redisTemplate.opsForValue().set( + getRefreshTokenKey(refreshToken), + JSON.toJSONString(new RefreshToken(accessToken, authUser))); + } + + } + + @Override + public void removeAccessToken(String accessToken) { + String accessTokenKey = getAccessTokenKey(accessToken); + int afterRefreshExpiresIn = OAuth2Config.getInstance().getAfterRefreshExpiresIn(); + // 刷新令牌后,保证老的app_auth_token从刷新开始10分钟内可继续使用 + redisTemplate.expire(accessTokenKey, afterRefreshExpiresIn, TimeUnit.SECONDS); + } + + @Override + public void removeRefreshToken(String refreshToken) { + redisTemplate.delete(getRefreshTokenKey(refreshToken)); + } + + @Override + public RefreshToken getRefreshToken(String refreshToken) { + String json = redisTemplate.opsForValue().get(getRefreshTokenKey(refreshToken)); + if(StringUtils.isEmpty(json)) { + return null; + } + JSONObject jsonObj = JSON.parseObject(json); + + String userJson = jsonObj.getString("openUser"); + UserInfo user = JSON.parseObject(userJson, UserInfo.class); + String accessToken = jsonObj.getString("accessToken"); + + return new RefreshToken(accessToken, user); + } + + @Override + public boolean checkAuthCode(String authCode) { + if(StringUtils.isEmpty(authCode)) { + return false; + } + return redisTemplate.hasKey(getCodeKey(authCode)); + } + + @Override + public OpenUser getUserByAuthCode(String authCode) { + String json = redisTemplate.opsForValue().get(getCodeKey(authCode)); + if(StringUtils.isEmpty(json)) { + return null; + } + return JSON.parseObject(json, UserInfo.class); + } + + @Override + public OpenUser getUserByAccessToken(String accessToken) { + String json = redisTemplate.opsForValue().get(getAccessTokenKey(accessToken)); + if(StringUtils.isEmpty(json)) { + return null; + } + return JSON.parseObject(json, UserInfo.class); + } + + + @Override + public OpenUser login(HttpServletRequest request) throws LoginErrorException { + // 这里应该先检查用户有没有登录,如果登录直接返回openUser + + String username = request.getParameter("username"); + String password = request.getParameter("password"); + if(StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) { + throw new LoginErrorException("用户名密码不能为空"); + } + + Query query = new Query(); + query.eq("username", username) + .eq("password", password); + UserInfo userInfo = userInfoMapper.getByQuery(query); + + if(userInfo == null) { + throw new LoginErrorException("用户名密码不正确"); + } + + return userInfo; + } + +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ServiceImpl.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ServiceImpl.java new file mode 100644 index 00000000..f7de6af1 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/auth/impl/OAuth2ServiceImpl.java @@ -0,0 +1,262 @@ +package com.gitee.sop.sopauth.auth.impl; + +import com.gitee.sop.sopauth.auth.AppIdManager; +import com.gitee.sop.sopauth.auth.FetchTokenParam; +import com.gitee.sop.sopauth.auth.FetchTokenResult; +import com.gitee.sop.sopauth.auth.OAuth2Config; +import com.gitee.sop.sopauth.auth.OAuth2Manager; +import com.gitee.sop.sopauth.auth.OAuth2Service; +import com.gitee.sop.sopauth.auth.OpenUser; +import com.gitee.sop.sopauth.auth.RefreshToken; +import com.gitee.sop.sopauth.auth.TokenPair; +import com.gitee.sop.sopauth.auth.exception.LoginErrorException; +import lombok.extern.slf4j.Slf4j; +import org.apache.oltu.oauth2.as.issuer.MD5Generator; +import org.apache.oltu.oauth2.as.issuer.OAuthIssuer; +import org.apache.oltu.oauth2.as.issuer.OAuthIssuerImpl; +import org.apache.oltu.oauth2.as.request.OAuthAuthzRequest; +import org.apache.oltu.oauth2.as.response.OAuthASResponse; +import org.apache.oltu.oauth2.common.OAuth; +import org.apache.oltu.oauth2.common.error.OAuthError; +import org.apache.oltu.oauth2.common.exception.OAuthProblemException; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; +import org.apache.oltu.oauth2.common.message.OAuthResponse; +import org.apache.oltu.oauth2.common.message.types.GrantType; +import org.apache.oltu.oauth2.common.message.types.ResponseType; +import org.apache.oltu.oauth2.common.utils.OAuthUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.net.URISyntaxException; + +/** + * oauth2服务端默认实现 + * + * @author tanghc + */ +@Service +@Slf4j +public class OAuth2ServiceImpl implements OAuth2Service { + + + private static final String TOKEN_TYPE = "Bearer"; + public static final String APP_ID_NAME = "app_id"; + + private OAuthIssuer oauthIssuer = new OAuthIssuerImpl(new MD5Generator()); + + @Autowired + private OAuth2Manager oauth2Manager; + + @Autowired + private AppIdManager appIdManager; + + @Override + public OAuthResponse authorize(HttpServletRequest request, HttpServletResponse resp, OAuth2Config authConfig) + throws URISyntaxException, OAuthSystemException { + try { + // 构建OAuth 授权请求 + OAuthAuthzRequest oauthRequest = new OAuthAuthzRequest(request); + String clientId = oauthRequest.getClientId(); + // 检查传入的客户端id是否正确 + if (!appIdManager.isValidAppId(clientId)) { + return OAuthASResponse.errorResponse(HttpServletResponse.SC_BAD_REQUEST) + .setError(OAuthError.TokenResponse.INVALID_CLIENT) + .setErrorDescription(OAuthError.TokenResponse.INVALID_CLIENT).buildJSONMessage(); + } + + // 如果用户没有登录,跳转到登陆页面 + OpenUser user = null; + try { + user = oauth2Manager.login(request); + } catch (LoginErrorException e) { + log.error(e.getMessage(), e); + request.setAttribute("error", e.getMessage()); + try { + request.getRequestDispatcher(authConfig.getOauth2LoginUri()).forward(request, resp); + return null; + } catch (Exception e1) { + log.error(e1.getMessage(), e1); + throw new RuntimeException(e1); + } + } + + // 生成授权码 + String authorizationCode = null; + // responseType目前仅支持CODE,另外还有TOKEN + String responseType = oauthRequest.getParam(OAuth.OAUTH_RESPONSE_TYPE); + if (responseType.equals(ResponseType.CODE.toString())) { + OAuthIssuerImpl oauthIssuerImpl = new OAuthIssuerImpl(new MD5Generator()); + authorizationCode = oauthIssuerImpl.authorizationCode(); + oauth2Manager.addAuthCode(authorizationCode, user); + } + // 进行OAuth响应构建 + OAuthASResponse.OAuthAuthorizationResponseBuilder builder = OAuthASResponse.authorizationResponse(request, + HttpServletResponse.SC_FOUND); + // 设置授权码 + builder.setCode(authorizationCode); + builder.setParam(APP_ID_NAME, clientId); + // 得到到客户端重定向地址 + String redirectURI = oauthRequest.getParam(OAuth.OAUTH_REDIRECT_URI); + + // 构建响应 + return builder.location(redirectURI).buildQueryMessage(); + } catch (OAuthProblemException e) { + // 出错处理 + String redirectUri = e.getRedirectUri(); + if (OAuthUtils.isEmpty(redirectUri)) { + // 告诉客户端没有传入redirectUri直接报错 + String error = "OAuth redirectUri needs to be provided by client!!!"; + return OAuthASResponse.errorResponse(HttpServletResponse.SC_FOUND) + .error(OAuthProblemException.error(error)).location(redirectUri).buildQueryMessage(); + } else { + // 返回错误消息(如?error=) + return OAuthASResponse.errorResponse(HttpServletResponse.SC_FOUND).error(e).location(redirectUri) + .buildQueryMessage(); + } + + } + } + + + @Override + public FetchTokenResult accessToken(FetchTokenParam fetchTokenParam, OAuth2Config authConfig) { + try { + // 这里需要检查client_id和client_secret,但是已经通过网关接口访问进来了 + // 表示client_id和client_secret是合法的 + + // 检查验证类型,如果是第一次进来用code换取accessToken + String grant_type = fetchTokenParam.getGrant_type(); + if (GrantType.AUTHORIZATION_CODE.toString().equals(grant_type)) { + String authCode = fetchTokenParam.getCode(); + if (!oauth2Manager.checkAuthCode(authCode)) { + FetchTokenResult errorResult = new FetchTokenResult(); + errorResult.setError(OAuthError.CodeResponse.INVALID_REQUEST); + errorResult.setError_description("invalid request"); + return errorResult; + } + // 生成Access Token + OpenUser user = oauth2Manager.getUserByAuthCode(authCode); + if (user == null) { + throw OAuthProblemException.error("Can not found user by code."); + } + + TokenPair tokenPair = this.createNewToken(user); + + oauth2Manager.addAccessToken(tokenPair.getAccessToken(), tokenPair.getRefreshToken(), user); + + // 生成OAuth响应 + return this.buildTokenResult(tokenPair, user); + } else if (GrantType.REFRESH_TOKEN.toString().equals(grant_type)) { + // 用refreshToken来刷新accessToken + String refreshToken = fetchTokenParam.getRefresh_token(); + if (StringUtils.isEmpty(refreshToken)) { + FetchTokenResult errorResult = new FetchTokenResult(); + errorResult.setError(OAuthError.ResourceResponse.EXPIRED_TOKEN); + errorResult.setError_description("expired token"); + return errorResult; + } + + RefreshToken refreshTokenObj = oauth2Manager.getRefreshToken(refreshToken); + if (refreshTokenObj == null) { + FetchTokenResult errorResult = new FetchTokenResult(); + errorResult.setError(OAuthError.ResourceResponse.INVALID_TOKEN); + errorResult.setError_description("invalid token"); + return errorResult; + } + + OpenUser user = refreshTokenObj.getOpenUser(); + // 老的token对 + TokenPair oldTokenPair = new TokenPair(); + oldTokenPair.setAccessToken(refreshTokenObj.getAccessToken()); + oldTokenPair.setRefreshToken(refreshToken); + // 创建一对新的accessToken和refreshToken + TokenPair newTokenPair = this.createRefreshToken(user, oldTokenPair); + + this.afterRefreshToken(oldTokenPair, newTokenPair, user); + + // 返回新的accessToken和refreshToken + return this.buildTokenResult(newTokenPair, user); + } else { + FetchTokenResult errorResult = new FetchTokenResult(); + errorResult.setError(OAuthError.TokenResponse.INVALID_GRANT); + errorResult.setError_description("invalid grant"); + return errorResult; + } + + } catch (OAuthProblemException e) { + log.error(e.getMessage(), e); + FetchTokenResult errorResult = new FetchTokenResult(); + errorResult.setError(e.getMessage()); + errorResult.setError_description("invalid grant"); + return errorResult; + } + } + + /** + * 刷新token后续操作 + * + * @param oldTokenPair 老的token + * @param newTokenPair 新的token + * @param user 用户 + */ + protected void afterRefreshToken(TokenPair oldTokenPair, TokenPair newTokenPair, OpenUser user) { + // 保存token + oauth2Manager.addAccessToken(newTokenPair.getAccessToken(), newTokenPair.getRefreshToken(), user); + + // 删除老的accessToken + oauth2Manager.removeAccessToken(oldTokenPair.getAccessToken()); + // 删除老的refreshToken + oauth2Manager.removeRefreshToken(oldTokenPair.getRefreshToken()); + } + + /** + * 创建新的token + * + * @param user + * @return 返回新token + */ + protected TokenPair createNewToken(OpenUser user) { + return this.createDefaultTokenPair(); + } + + /** + * 返回刷新后token + * + * @param user 用户 + * @param oldTokenPair 旧的token + * @return 返回新的token + */ + protected TokenPair createRefreshToken(OpenUser user, TokenPair oldTokenPair) { + return this.createDefaultTokenPair(); + } + + private TokenPair createDefaultTokenPair() { + TokenPair tokenPair = new TokenPair(); + try { + String accessToken = oauthIssuer.accessToken(); + String refreshToken = oauthIssuer.refreshToken(); + + tokenPair.setAccessToken(accessToken); + tokenPair.setRefreshToken(refreshToken); + + return tokenPair; + } catch (OAuthSystemException e) { + throw new RuntimeException(e); + } + } + + private FetchTokenResult buildTokenResult(TokenPair tokenPair, OpenUser user) { + OAuth2Config auth2Config = OAuth2Config.getInstance(); + FetchTokenResult fetchTokenResult = new FetchTokenResult(); + fetchTokenResult.setApp_auth_token(tokenPair.getAccessToken()); + fetchTokenResult.setApp_refresh_token(tokenPair.getRefreshToken()); + fetchTokenResult.setUser_id(user.getUserId()); + fetchTokenResult.setExpires_in(auth2Config.getAccessTokenExpiresIn()); + fetchTokenResult.setRe_expires_in(auth2Config.getRefreshTokenExpiresIn()); + return fetchTokenResult; + } + +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/config/OpenServiceConfig.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/config/OpenServiceConfig.java new file mode 100644 index 00000000..94298534 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/config/OpenServiceConfig.java @@ -0,0 +1,20 @@ +package com.gitee.sop.sopauth.config; + +import com.gitee.sop.servercommon.bean.ServiceConfig; +import com.gitee.sop.servercommon.configuration.AlipayServiceConfiguration; +import org.springframework.context.annotation.Configuration; + +/** + * 使用支付宝开放平台功能 + * + * @author tanghc + */ +@Configuration +public class OpenServiceConfig extends AlipayServiceConfiguration { + + + static { + ServiceConfig.getInstance().getI18nModules().add("i18n/isp/goods_error"); + } + +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/controller/CallbackController.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/controller/CallbackController.java new file mode 100644 index 00000000..4f1cf437 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/controller/CallbackController.java @@ -0,0 +1,54 @@ +package com.gitee.sop.sopauth.controller; + +import com.gitee.sop.sdk.client.OpenClient; +import com.gitee.sop.sdk.model.OpenAuthTokenAppModel; +import com.gitee.sop.sdk.request.OpenAuthTokenAppRequest; +import com.gitee.sop.sdk.response.OpenAuthTokenAppResponse; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author tanghc + */ +@Controller +@Slf4j +public class CallbackController { + String url = "http://localhost:8081"; + String appId = "2019032617262200001"; + // 平台提供的私钥 + String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCXJv1pQFqWNA/++OYEV7WYXwexZK/J8LY1OWlP9X0T6wHFOvxNKRvMkJ5544SbgsJpVcvRDPrcxmhPbi/sAhdO4x2PiPKIz9Yni2OtYCCeaiE056B+e1O2jXoLeXbfi9fPivJZkxH/tb4xfLkH3bA8ZAQnQsoXA0SguykMRZntF0TndUfvDrLqwhlR8r5iRdZLB6F8o8qXH6UPDfNEnf/K8wX5T4EB1b8x8QJ7Ua4GcIUqeUxGHdQpzNbJdaQvoi06lgccmL+PHzminkFYON7alj1CjDN833j7QMHdPtS9l7B67fOU/p2LAAkPMtoVBfxQt9aFj7B8rEhGCz02iJIBAgMBAAECggEARqOuIpY0v6WtJBfmR3lGIOOokLrhfJrGTLF8CiZMQha+SRJ7/wOLPlsH9SbjPlopyViTXCuYwbzn2tdABigkBHYXxpDV6CJZjzmRZ+FY3S/0POlTFElGojYUJ3CooWiVfyUMhdg5vSuOq0oCny53woFrf32zPHYGiKdvU5Djku1onbDU0Lw8w+5tguuEZ76kZ/lUcccGy5978FFmYpzY/65RHCpvLiLqYyWTtaNT1aQ/9pw4jX9HO9NfdJ9gYFK8r/2f36ZE4hxluAfeOXQfRC/WhPmiw/ReUhxPznG/WgKaa/OaRtAx3inbQ+JuCND7uuKeRe4osP2jLPHPP6AUwQKBgQDUNu3BkLoKaimjGOjCTAwtp71g1oo+k5/uEInAo7lyEwpV0EuUMwLA/HCqUgR4K9pyYV+Oyb8d6f0+Hz0BMD92I2pqlXrD7xV2WzDvyXM3s63NvorRooKcyfd9i6ccMjAyTR2qfLkxv0hlbBbsPHz4BbU63xhTJp3Ghi0/ey/1HQKBgQC2VsgqC6ykfSidZUNLmQZe3J0p/Qf9VLkfrQ+xaHapOs6AzDU2H2osuysqXTLJHsGfrwVaTs00ER2z8ljTJPBUtNtOLrwNRlvgdnzyVAKHfOgDBGwJgiwpeE9voB1oAV/mXqSaUWNnuwlOIhvQEBwekqNyWvhLqC7nCAIhj3yvNQKBgQCqYbeec56LAhWP903Zwcj9VvG7sESqXUhIkUqoOkuIBTWFFIm54QLTA1tJxDQGb98heoCIWf5x/A3xNI98RsqNBX5JON6qNWjb7/dobitti3t99v/ptDp9u8JTMC7penoryLKK0Ty3bkan95Kn9SC42YxaSghzqkt+uvfVQgiNGQKBgGxU6P2aDAt6VNwWosHSe+d2WWXt8IZBhO9d6dn0f7ORvcjmCqNKTNGgrkewMZEuVcliueJquR47IROdY8qmwqcBAN7Vg2K7r7CPlTKAWTRYMJxCT1Hi5gwJb+CZF3+IeYqsJk2NF2s0w5WJTE70k1BSvQsfIzAIDz2yE1oPHvwVAoGAA6e+xQkVH4fMEph55RJIZ5goI4Y76BSvt2N5OKZKd4HtaV+eIhM3SDsVYRLIm9ZquJHMiZQGyUGnsvrKL6AAVNK7eQZCRDk9KQz+0GKOGqku0nOZjUbAu6A2/vtXAaAuFSFx1rUQVVjFulLexkXR3KcztL1Qu2k5pB6Si0K/uwQ="; + + OpenClient openClient = new OpenClient(url, appId, privateKey); + + /** + * 模拟开发者回调,这里需要开发者自己实现.通过code换取token + * @return + */ + @GetMapping("oauth2callback") + @ResponseBody + public OpenAuthTokenAppResponse callback(HttpServletRequest servletRequest, HttpServletResponse servletResponse) { + String app_id = servletRequest.getParameter("app_id"); + String code = servletRequest.getParameter("code"); + log.info("app_id:{}, code:{}", app_id, code); + + OpenAuthTokenAppRequest request = new OpenAuthTokenAppRequest(); + OpenAuthTokenAppModel model = new OpenAuthTokenAppModel(); + model.setCode(code); + model.setGrant_type("authorization_code"); + request.setBizModel(model); + + // 根据code获取token + OpenAuthTokenAppResponse response = openClient.execute(request); + if (response.isSuccess()) { + // 成功拿到token,开发者在这里保存token信息 + // 后续使用token进行接口访问 + log.info("授权成功,body:{}", response.getBody()); + } + return response; + } +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/controller/OAuth2Controller.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/controller/OAuth2Controller.java new file mode 100644 index 00000000..97fcfc6e --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/controller/OAuth2Controller.java @@ -0,0 +1,87 @@ +package com.gitee.sop.sopauth.controller; + +import com.gitee.sop.servercommon.annotation.ApiMapping; +import com.gitee.sop.sopauth.auth.FetchTokenParam; +import com.gitee.sop.sopauth.auth.FetchTokenResult; +import com.gitee.sop.sopauth.auth.OAuth2Config; +import com.gitee.sop.sopauth.auth.OAuth2Service; +import org.apache.oltu.oauth2.common.exception.OAuthSystemException; +import org.apache.oltu.oauth2.common.message.OAuthResponse; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.net.URI; +import java.net.URISyntaxException; + +/** + * 授权认证 + * + * @author tanghc + */ +@Controller +@RequestMapping("oauth2") +public class OAuth2Controller { + + @Autowired + private OAuth2Service oAuth2Service; + + // 第一步:授权URL拼装 + // https://localhost:8087/oauth2/appToAppAuth?app_id=2019032617262200001&redirect_uri=http%3a%2f%2flocalhost%3a8087%2foauth2callback + @GetMapping("appToAppAuth") + public String appToAppAuth(HttpServletRequest request, ModelMap modelMap) { + String app_id = request.getParameter("app_id"); + String redirect_uri = request.getParameter("redirect_uri"); + modelMap.put("response_type", "code"); + modelMap.put("client_id", app_id); + modelMap.put("redirect_uri", redirect_uri); + return "oauth2login"; + } + + /** + * 第二步:点击登录,到这里拿code + * oauth2认证获取code + * @param request + * @param resp + * @return 返回code + * @throws URISyntaxException + * @throws OAuthSystemException + */ + @RequestMapping("authorize") + public Object authorize(HttpServletRequest request, HttpServletResponse resp) throws URISyntaxException, OAuthSystemException { + OAuthResponse response = oAuth2Service.authorize(request, resp, OAuth2Config.getInstance()); + if(response == null) { + return null; + } + HttpHeaders headers = new HttpHeaders(); + headers.setLocation(new URI(response.getLocationUri())); + return new ResponseEntity(headers, HttpStatus.valueOf(response.getResponseStatus())); + } + + + /** + * 第三步,通过code获取token + * 或者,通过refresh_token换取token + * @param param + * @return + */ + @ApiMapping("open.auth.token.app") + @ResponseBody + public FetchTokenResult fetchToken(FetchTokenParam param) { + FetchTokenResult fetchTokenResult = oAuth2Service.accessToken(param, OAuth2Config.getInstance()); + return fetchTokenResult; + } + + @RequestMapping("login") + public String oauth2login() { + return "oauth2login"; + } +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/entity/IsvInfo.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/entity/IsvInfo.java new file mode 100644 index 00000000..64361500 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/entity/IsvInfo.java @@ -0,0 +1,32 @@ +package com.gitee.sop.sopauth.entity; + +import lombok.Data; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; + + +/** + * 表名:isv_info + * 备注:isv信息表 + * + * @author tanghc + */ +@Table(name = "isv_info") +@Data +public class IsvInfo { + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + /** 数据库字段:id */ + private Long id; + + /** appKey, 数据库字段:app_key */ + private String appKey; + + /** 1启用,2禁用, 数据库字段:status */ + private Byte status; +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/entity/UserInfo.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/entity/UserInfo.java new file mode 100644 index 00000000..bf0ec7c3 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/entity/UserInfo.java @@ -0,0 +1,50 @@ +package com.gitee.sop.sopauth.entity; + +import com.alibaba.fastjson.annotation.JSONField; +import com.gitee.sop.sopauth.auth.OpenUser; +import lombok.Data; + +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.Date; + + +/** + * 表名:user_info + * 备注:用户信息表 + * + * @author tanghc + */ +@Table(name = "user_info") +@Data +public class UserInfo implements OpenUser { + @Id + @Column(name = "id") + @GeneratedValue(strategy = GenerationType.IDENTITY) + /** 数据库字段:id */ + private Long id; + + /** 用户名, 数据库字段:username */ + private String username; + + /** 密码, 数据库字段:password */ + @JSONField(serialize = false) + private String password; + + /** 昵称, 数据库字段:nickname */ + private String nickname; + + /** 数据库字段:gmt_create */ + private Date gmtCreate; + + /** 数据库字段:gmt_modified */ + private Date gmtModified; + + @Override + public String getUserId() { + return String.valueOf(id); + } +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/mapper/IsvInfoMapper.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/mapper/IsvInfoMapper.java new file mode 100644 index 00000000..64687a97 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/mapper/IsvInfoMapper.java @@ -0,0 +1,11 @@ +package com.gitee.sop.sopauth.mapper; + +import com.gitee.fastmybatis.core.mapper.CrudMapper; +import com.gitee.sop.sopauth.entity.IsvInfo; + + +/** + * @author tanghc + */ +public interface IsvInfoMapper extends CrudMapper { +} diff --git a/sop-auth/src/main/java/com/gitee/sop/sopauth/mapper/UserInfoMapper.java b/sop-auth/src/main/java/com/gitee/sop/sopauth/mapper/UserInfoMapper.java new file mode 100644 index 00000000..0c1c8219 --- /dev/null +++ b/sop-auth/src/main/java/com/gitee/sop/sopauth/mapper/UserInfoMapper.java @@ -0,0 +1,11 @@ +package com.gitee.sop.sopauth.mapper; + +import com.gitee.fastmybatis.core.mapper.CrudMapper; +import com.gitee.sop.sopauth.entity.UserInfo; + + +/** + * @author tanghc + */ +public interface UserInfoMapper extends CrudMapper { +} diff --git a/sop-auth/src/main/resources/application-dev.properties b/sop-auth/src/main/resources/application-dev.properties new file mode 100644 index 00000000..6a15f1c6 --- /dev/null +++ b/sop-auth/src/main/resources/application-dev.properties @@ -0,0 +1,26 @@ +server.port=8087 +spring.application.name=sop-auth + +# ------- 需要改的配置 ------- +# mysql数据库账号 +mysql.host=localhost:3306 +mysql.username=root +mysql.password=root + +# nacos地址 +nacos.url=127.0.0.1:8848 + +# ------- 需要改的配置end ------- + +# nacos cloud配置 +spring.cloud.nacos.discovery.server-addr=${nacos.url} + +# 数据库配置 +spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver +spring.datasource.url=jdbc:mysql://${mysql.host}/sop?useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&serverTimezone=Asia/Shanghai +spring.datasource.username=${mysql.username} +spring.datasource.password=${mysql.password} + +spring.thymeleaf.cache=false + +logging.level.com.gitee=debug diff --git a/sop-auth/src/main/resources/application.properties b/sop-auth/src/main/resources/application.properties new file mode 100644 index 00000000..257b3064 --- /dev/null +++ b/sop-auth/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.profiles.active=dev \ No newline at end of file diff --git a/sop-auth/src/main/resources/templates/oauth2login.html b/sop-auth/src/main/resources/templates/oauth2login.html new file mode 100644 index 00000000..5c089835 --- /dev/null +++ b/sop-auth/src/main/resources/templates/oauth2login.html @@ -0,0 +1,19 @@ + + + +用户登录 + + +
+
+ + + + 用户名:
+ 密码:
+ +
+ + \ No newline at end of file diff --git a/sop-auth/src/test/java/com/gitee/sop/sopauth/RefreshTokenTest.java b/sop-auth/src/test/java/com/gitee/sop/sopauth/RefreshTokenTest.java new file mode 100644 index 00000000..5c597e55 --- /dev/null +++ b/sop-auth/src/test/java/com/gitee/sop/sopauth/RefreshTokenTest.java @@ -0,0 +1,40 @@ +package com.gitee.sop.sopauth; + +import com.gitee.sop.sdk.client.OpenClient; +import com.gitee.sop.sdk.model.OpenAuthTokenAppModel; +import com.gitee.sop.sdk.request.OpenAuthTokenAppRequest; +import com.gitee.sop.sdk.response.OpenAuthTokenAppResponse; +import junit.framework.TestCase; +import lombok.extern.slf4j.Slf4j; + +/** + * @author tanghc + */ +@Slf4j +public class RefreshTokenTest extends TestCase { + String url = "http://localhost:8081"; + String appId = "2019032617262200001"; + // 平台提供的私钥 + String privateKey = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCXJv1pQFqWNA/++OYEV7WYXwexZK/J8LY1OWlP9X0T6wHFOvxNKRvMkJ5544SbgsJpVcvRDPrcxmhPbi/sAhdO4x2PiPKIz9Yni2OtYCCeaiE056B+e1O2jXoLeXbfi9fPivJZkxH/tb4xfLkH3bA8ZAQnQsoXA0SguykMRZntF0TndUfvDrLqwhlR8r5iRdZLB6F8o8qXH6UPDfNEnf/K8wX5T4EB1b8x8QJ7Ua4GcIUqeUxGHdQpzNbJdaQvoi06lgccmL+PHzminkFYON7alj1CjDN833j7QMHdPtS9l7B67fOU/p2LAAkPMtoVBfxQt9aFj7B8rEhGCz02iJIBAgMBAAECggEARqOuIpY0v6WtJBfmR3lGIOOokLrhfJrGTLF8CiZMQha+SRJ7/wOLPlsH9SbjPlopyViTXCuYwbzn2tdABigkBHYXxpDV6CJZjzmRZ+FY3S/0POlTFElGojYUJ3CooWiVfyUMhdg5vSuOq0oCny53woFrf32zPHYGiKdvU5Djku1onbDU0Lw8w+5tguuEZ76kZ/lUcccGy5978FFmYpzY/65RHCpvLiLqYyWTtaNT1aQ/9pw4jX9HO9NfdJ9gYFK8r/2f36ZE4hxluAfeOXQfRC/WhPmiw/ReUhxPznG/WgKaa/OaRtAx3inbQ+JuCND7uuKeRe4osP2jLPHPP6AUwQKBgQDUNu3BkLoKaimjGOjCTAwtp71g1oo+k5/uEInAo7lyEwpV0EuUMwLA/HCqUgR4K9pyYV+Oyb8d6f0+Hz0BMD92I2pqlXrD7xV2WzDvyXM3s63NvorRooKcyfd9i6ccMjAyTR2qfLkxv0hlbBbsPHz4BbU63xhTJp3Ghi0/ey/1HQKBgQC2VsgqC6ykfSidZUNLmQZe3J0p/Qf9VLkfrQ+xaHapOs6AzDU2H2osuysqXTLJHsGfrwVaTs00ER2z8ljTJPBUtNtOLrwNRlvgdnzyVAKHfOgDBGwJgiwpeE9voB1oAV/mXqSaUWNnuwlOIhvQEBwekqNyWvhLqC7nCAIhj3yvNQKBgQCqYbeec56LAhWP903Zwcj9VvG7sESqXUhIkUqoOkuIBTWFFIm54QLTA1tJxDQGb98heoCIWf5x/A3xNI98RsqNBX5JON6qNWjb7/dobitti3t99v/ptDp9u8JTMC7penoryLKK0Ty3bkan95Kn9SC42YxaSghzqkt+uvfVQgiNGQKBgGxU6P2aDAt6VNwWosHSe+d2WWXt8IZBhO9d6dn0f7ORvcjmCqNKTNGgrkewMZEuVcliueJquR47IROdY8qmwqcBAN7Vg2K7r7CPlTKAWTRYMJxCT1Hi5gwJb+CZF3+IeYqsJk2NF2s0w5WJTE70k1BSvQsfIzAIDz2yE1oPHvwVAoGAA6e+xQkVH4fMEph55RJIZ5goI4Y76BSvt2N5OKZKd4HtaV+eIhM3SDsVYRLIm9ZquJHMiZQGyUGnsvrKL6AAVNK7eQZCRDk9KQz+0GKOGqku0nOZjUbAu6A2/vtXAaAuFSFx1rUQVVjFulLexkXR3KcztL1Qu2k5pB6Si0K/uwQ="; + + OpenClient openClient = new OpenClient(url, appId, privateKey); + + /** + * 根据refreshToken换取token + */ + public void testRefreshToken() { + OpenAuthTokenAppRequest request = new OpenAuthTokenAppRequest(); + OpenAuthTokenAppModel model = new OpenAuthTokenAppModel(); + model.setGrant_type("refresh_token"); + model.setRefresh_token("c9e4003c06fe59066eed73d64ea074ca"); + request.setBizModel(model); + + OpenAuthTokenAppResponse response = openClient.execute(request); + if (response.isSuccess()) { + // 成功拿到token,开发者在这里保存token信息 + // 后续使用token进行接口访问 + log.info("换取token成功,body:{}", response.getBody()); + } + } + +} diff --git a/sop-auth/src/test/java/com/gitee/sop/sopauth/SopAuthApplicationTests.java b/sop-auth/src/test/java/com/gitee/sop/sopauth/SopAuthApplicationTests.java new file mode 100644 index 00000000..b5902b77 --- /dev/null +++ b/sop-auth/src/test/java/com/gitee/sop/sopauth/SopAuthApplicationTests.java @@ -0,0 +1,16 @@ +package com.gitee.sop.sopauth; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class SopAuthApplicationTests { + + @Test + public void contextLoads() { + } + +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/GatewayFilterDefinition.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/GatewayFilterDefinition.java new file mode 100644 index 00000000..1ee1c2a6 --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/GatewayFilterDefinition.java @@ -0,0 +1,17 @@ +package com.gitee.sop.gatewaycommon.bean; + +import lombok.Data; + +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @author tanghc + */ +@Data +public class GatewayFilterDefinition { + /** Filter Name */ + private String name; + /** 对应的路由规则 */ + private Map args = new LinkedHashMap<>(); +} \ No newline at end of file diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/GatewayPredicateDefinition.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/GatewayPredicateDefinition.java new file mode 100644 index 00000000..06a6c0e5 --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/GatewayPredicateDefinition.java @@ -0,0 +1,42 @@ +package com.gitee.sop.gatewaycommon.bean; + +import lombok.Data; +import org.springframework.util.StringUtils; + +import javax.validation.ValidationException; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * @author tanghc + */ +@Data +public class GatewayPredicateDefinition { + public static final String GEN_KEY = "_genkey_"; + /** 断言对应的Name */ + private String name; + /** 配置的断言规则 */ + private Map args = new LinkedHashMap<>(); + + public GatewayPredicateDefinition() { + } + + public GatewayPredicateDefinition(String text) { + int eqIdx = text.indexOf(61); + if (eqIdx <= 0) { + throw new ValidationException("Unable to parse GatewayPredicateDefinition text '" + text + "', must be of the form name=value"); + } else { + this.setName(text.substring(0, eqIdx)); + String[] params = StringUtils.tokenizeToStringArray(text.substring(eqIdx + 1), ","); + + for(int i = 0; i < params.length; ++i) { + this.args.put(generateName(i), params[i]); + } + + } + } + + public static String generateName(int i) { + return GEN_KEY + i; + } +} \ No newline at end of file diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/NacosConfigs.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/NacosConfigs.java new file mode 100644 index 00000000..15fd1423 --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/NacosConfigs.java @@ -0,0 +1,29 @@ +package com.gitee.sop.gatewaycommon.bean; + +/** + * @author tanghc + */ +public class NacosConfigs { + + public static final String GROUP_CHANNEL = "sop:channel"; + + public static final String GROUP_ROUTE = "sop:route"; + + public static final String DATA_ID_GRAY = "com.gitee.sop.channel.gray"; + + public static final String DATA_ID_IP_BLACKLIST = "com.gitee.sop.channel.ipblacklist"; + + public static final String DATA_ID_ISV = "com.gitee.sop.channel.isv"; + + public static final String DATA_ID_ROUTE_PERMISSION = "com.gitee.sop.channel.routepermission"; + + public static final String DATA_ID_LIMIT_CONFIG = "com.gitee.sop.channel.limitconfig"; + + public static final String DATA_ID_ROUTE_CONFIG = "com.gitee.sop.channel.routeconfig"; + + private static final String DATA_ID_TPL = "com.gitee.sop.route.%s"; + + public static String getRouteDataId(String serviceId) { + return String.format(DATA_ID_TPL, serviceId); + } +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/RouteDefinition.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/RouteDefinition.java new file mode 100644 index 00000000..73cac867 --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/RouteDefinition.java @@ -0,0 +1,72 @@ +package com.gitee.sop.gatewaycommon.bean; + +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class RouteDefinition { + /** + * 路由的Id(接口名+版本号),确保此id全局唯一 + */ + private String id; + + /** + * 接口名 + */ + private String name; + + /** + * 版本号 + */ + private String version; + + /** + * 路由断言集合配置 + */ + private List predicates = new ArrayList<>(); + + /** + * 路由过滤器集合配置 + */ + private List filters = new ArrayList<>(); + + /** + * 路由规则转发的目标uri + */ + private String uri; + + /** + * uri后面跟的path + */ + private String path; + + /** + * 路由执行的顺序 + */ + private int order = 0; + + /** + * 是否忽略验证,业务参数验证除外 + */ + private int ignoreValidate; + + /** + * 状态,0:待审核,1:启用,2:禁用 + */ + private int status = 1; + + /** + * 是否合并结果 + */ + private int mergeResult; + + /** + * 是否需要授权才能访问 + */ + private int permission; +} \ No newline at end of file diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ServiceRouteInfo.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ServiceRouteInfo.java new file mode 100644 index 00000000..6114d98d --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/bean/ServiceRouteInfo.java @@ -0,0 +1,38 @@ +package com.gitee.sop.gatewaycommon.bean; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class ServiceRouteInfo { + + /** + * 服务名称,对应spring.application.name + */ + private String serviceId; + + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date createTime = new Date(); + + @JSONField(format = "yyyy-MM-dd HH:mm:ss") + private Date updateTime = new Date(); + + private String description; + + /** + * 路由信息md5,md5(sort(routeIdList)) + */ + private String md5; + + private List routeDefinitionList; + + public String fetchServiceIdLowerCase() { + return serviceId.toLowerCase(); + } +} \ No newline at end of file diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/EnvGrayFilter.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/EnvGrayFilter.java new file mode 100644 index 00000000..38c9aebe --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/filter/EnvGrayFilter.java @@ -0,0 +1,46 @@ +package com.gitee.sop.gatewaycommon.gateway.filter; + +import com.gitee.sop.gatewaycommon.bean.TargetRoute; +import com.gitee.sop.gatewaycommon.gateway.ServerWebExchangeUtil; +import com.gitee.sop.gatewaycommon.manager.EnvGrayManager; +import com.gitee.sop.gatewaycommon.manager.RouteRepositoryContext; +import com.gitee.sop.gatewaycommon.param.ApiParam; +import com.gitee.sop.gatewaycommon.param.ParamNames; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.gateway.filter.GatewayFilterChain; +import org.springframework.cloud.gateway.filter.GlobalFilter; +import org.springframework.core.Ordered; +import org.springframework.web.server.ServerWebExchange; +import reactor.core.publisher.Mono; + +/** + * @author tanghc + */ +public class EnvGrayFilter implements GlobalFilter, Ordered { + + @Autowired + private EnvGrayManager envGrayManager; + + @Override + public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { + ApiParam apiParam = ServerWebExchangeUtil.getApiParam(exchange); + String nameVersion = apiParam.fetchNameVersion(); + TargetRoute targetRoute = RouteRepositoryContext.getRouteRepository().get(nameVersion); + if (targetRoute == null) { + return null; + } + String serviceId = targetRoute.getServiceRouteInfo().fetchServiceIdLowerCase(); + // 如果服务在灰度阶段,返回一个灰度版本号 + String version = envGrayManager.getVersion(serviceId, nameVersion); + if (version != null && envGrayManager.containsKey(serviceId, apiParam.fetchAppKey())) { + ServerWebExchange serverWebExchange = ServerWebExchangeUtil.addHeaders(exchange, httpHeaders -> httpHeaders.set(ParamNames.HEADER_VERSION_NAME, version)); + return chain.filter(serverWebExchange); + } + return chain.filter(exchange); + } + + @Override + public int getOrder() { + return Orders.ENV_GRAY_FILTER_ORDER; + } +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/route/GatewayRouteCache.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/route/GatewayRouteCache.java new file mode 100644 index 00000000..3d0ada69 --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/gateway/route/GatewayRouteCache.java @@ -0,0 +1,62 @@ +package com.gitee.sop.gatewaycommon.gateway.route; + +import com.gitee.sop.gatewaycommon.bean.RouteDefinition; +import com.gitee.sop.gatewaycommon.bean.ServiceRouteInfo; +import com.gitee.sop.gatewaycommon.manager.BaseRouteCache; +import com.gitee.sop.gatewaycommon.manager.RouteRepository; +import org.springframework.beans.BeanUtils; +import org.springframework.cloud.gateway.filter.FilterDefinition; +import org.springframework.cloud.gateway.handler.predicate.PredicateDefinition; + +import java.net.URI; +import java.util.LinkedList; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author tanghc + */ +public class GatewayRouteCache extends BaseRouteCache { + + public GatewayRouteCache(RouteRepository routeRepository) { + super(routeRepository); + } + + @Override + protected GatewayTargetRoute buildTargetRoute(ServiceRouteInfo serviceRouteInfo, RouteDefinition routeDefinition) { + org.springframework.cloud.gateway.route.RouteDefinition targetRoute = new org.springframework.cloud.gateway.route.RouteDefinition(); + targetRoute.setId(routeDefinition.getId()); + targetRoute.setUri(URI.create(routeDefinition.getUri() + "#" + routeDefinition.getPath())); + targetRoute.setOrder(routeDefinition.getOrder()); + // 添加过滤器 + List filterDefinitionList = routeDefinition.getFilters() + .stream() + .map(filter -> { + FilterDefinition filterDefinition = new FilterDefinition(); + BeanUtils.copyProperties(filter, filterDefinition); + return filterDefinition; + }) + .collect(Collectors.toList()); + + + LinkedList predicateDefinitionList = routeDefinition.getPredicates() + .stream() + .map(predicate -> { + PredicateDefinition predicateDefinition = new PredicateDefinition(); + BeanUtils.copyProperties(predicate, predicateDefinition); + return predicateDefinition; + }) + .collect(Collectors.toCollection(LinkedList::new)); + // 下面两个自定义的断言添加到顶部,注意:ReadBody需要放在最前面 + // 对应断言: + // NameVersion -> com.gitee.sop.gatewaycommon.gateway.route.NameVersionRoutePredicateFactory + // ReadBody -> com.gitee.sop.gatewaycommon.gateway.route.ReadBodyRoutePredicateFactory + predicateDefinitionList.addFirst(new PredicateDefinition("NameVersion=" + routeDefinition.getId())); + predicateDefinitionList.addFirst(new PredicateDefinition("ReadBody=")); + + targetRoute.setFilters(filterDefinitionList); + targetRoute.setPredicates(predicateDefinitionList); + return new GatewayTargetRoute(serviceRouteInfo, routeDefinition, targetRoute); + } + +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/BaseRouteCache.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/BaseRouteCache.java new file mode 100644 index 00000000..4160f5dd --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/BaseRouteCache.java @@ -0,0 +1,70 @@ +package com.gitee.sop.gatewaycommon.manager; + +import com.alibaba.fastjson.JSON; +import com.gitee.sop.gatewaycommon.bean.RouteDefinition; +import com.gitee.sop.gatewaycommon.bean.ServiceRouteInfo; +import com.gitee.sop.gatewaycommon.bean.TargetRoute; +import lombok.extern.slf4j.Slf4j; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.function.Consumer; + +/** + * @author tanghc + */ +@Slf4j +public abstract class BaseRouteCache implements RouteLoader { + + /** + * KEY:serviceId, value: md5 + */ + private Map serviceIdMd5Map = new HashMap<>(); + + private RouteRepository routeRepository; + + /** + * 构建目标路由对象,zuul和gateway定义的路由对象 + * + * @param serviceRouteInfo 路由服务对象 + * @param gatewayRouteDefinition 路由对象 + * @return 返回目标路由对象 + */ + protected abstract T buildTargetRoute(ServiceRouteInfo serviceRouteInfo, RouteDefinition gatewayRouteDefinition); + + public BaseRouteCache(RouteRepository routeRepository) { + this.routeRepository = routeRepository; + } + + @Override + public void load(ServiceRouteInfo serviceRouteInfo, Consumer callback) { + try { + String serviceId = serviceRouteInfo.getServiceId(); + String newMd5 = serviceRouteInfo.getMd5(); + String oldMd5 = serviceIdMd5Map.get(serviceId); + if (Objects.equals(newMd5, oldMd5)) { + return; + } + serviceIdMd5Map.put(serviceId, newMd5); + List routeDefinitionList = serviceRouteInfo.getRouteDefinitionList(); + for (RouteDefinition routeDefinition : routeDefinitionList) { + T targetRoute = this.buildTargetRoute(serviceRouteInfo, routeDefinition); + routeRepository.add(targetRoute); + if (log.isDebugEnabled()) { + log.debug("新增路由:{}", JSON.toJSONString(routeDefinition)); + } + } + callback.accept(null); + } catch (Exception e) { + log.error("加载路由信息失败,serviceRouteInfo:{}", serviceRouteInfo, e); + } + } + + @Override + public void remove(String serviceId) { + serviceIdMd5Map.remove(serviceId); + routeRepository.deleteAll(serviceId); + } +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/RouteLoader.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/RouteLoader.java new file mode 100644 index 00000000..7dba7bfd --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/RouteLoader.java @@ -0,0 +1,25 @@ +package com.gitee.sop.gatewaycommon.manager; + +import com.gitee.sop.gatewaycommon.bean.ServiceRouteInfo; + +import java.util.function.Consumer; + +/** + * @author tanghc + */ +public interface RouteLoader { + /** + * 加载路由 + * + * @param serviceRouteInfo 服务路由信息 + * @param callback 加载成功后回调 + */ + void load(ServiceRouteInfo serviceRouteInfo, Consumer callback); + + /** + * 移除某个微服务下的所有路由信息 + * + * @param serviceId 服务id + */ + void remove(String serviceId); +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/ServiceRoutesLoader.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/ServiceRoutesLoader.java new file mode 100644 index 00000000..09021c1f --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/manager/ServiceRoutesLoader.java @@ -0,0 +1,136 @@ +package com.gitee.sop.gatewaycommon.manager; + +import com.alibaba.fastjson.JSON; +import com.alibaba.nacos.api.annotation.NacosInjected; +import com.alibaba.nacos.api.config.ConfigService; +import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.api.naming.NamingService; +import com.alibaba.nacos.api.naming.pojo.Instance; +import com.alibaba.nacos.api.naming.pojo.ServiceInfo; +import com.gitee.sop.gatewaycommon.bean.NacosConfigs; +import com.gitee.sop.gatewaycommon.bean.ServiceRouteInfo; +import com.gitee.sop.gatewaycommon.bean.TargetRoute; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.alibaba.nacos.NacosDiscoveryProperties; +import org.springframework.context.ApplicationEvent; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.util.CollectionUtils; +import org.springframework.util.DigestUtils; +import org.springframework.web.client.DefaultResponseErrorHandler; +import org.springframework.web.client.RestTemplate; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * 发现新服务,更新路由信息 + * + * @author tanghc + */ +@Slf4j +public class ServiceRoutesLoader { + + private static final String SECRET = "a3d9sf!1@odl90zd>fkASwq"; + + private static final int FIVE_SECONDS = 1000 * 5; + + @Autowired + private NacosDiscoveryProperties nacosDiscoveryProperties; + + @NacosInjected + private ConfigService configService; + + @Autowired + private BaseRouteCache baseRouteCache; + + private RestTemplate restTemplate = new RestTemplate(); + + private Map updateTimeMap = new HashMap<>(16); + + public ServiceRoutesLoader() { + // 解决statusCode不等于200,就抛异常问题 + restTemplate.setErrorHandler(new DefaultResponseErrorHandler() { + @Override + protected boolean hasError(HttpStatus statusCode) { + return statusCode == null; + } + }); + } + + public synchronized void load(ApplicationEvent event) { + NamingService namingService = nacosDiscoveryProperties.namingServiceInstance(); + List subscribes = null; + try { + subscribes = namingService.getSubscribeServices(); + } catch (NacosException e) { + log.error("namingService.getSubscribeServices()错误", e); + } + if (CollectionUtils.isEmpty(subscribes)) { + return; + } + // subscribe + String thisServiceId = nacosDiscoveryProperties.getService(); +// ConfigService configService = nacosConfigProperties.configServiceInstance(); + for (ServiceInfo serviceInfo : subscribes) { + String serviceName = serviceInfo.getName(); + // 如果是本机服务,跳过 + if (Objects.equals(thisServiceId, serviceName)) { + continue; + } + // nacos会不停的触发事件,这里做了一层拦截 + // 同一个serviceId5秒内允许访问一次 + Long lastUpdateTime = updateTimeMap.getOrDefault(serviceName, 0L); + long now = System.currentTimeMillis(); + if (now - lastUpdateTime < FIVE_SECONDS) { + continue; + } + updateTimeMap.put(serviceName, now); + try { + String dataId = NacosConfigs.getRouteDataId(serviceName); + String groupId = NacosConfigs.GROUP_ROUTE; + List allInstances = namingService.getAllInstances(serviceName); + if (CollectionUtils.isEmpty(allInstances)) { + // 如果没有服务列表,则删除所有路由信息 + baseRouteCache.remove(serviceName); + configService.removeConfig(dataId, groupId); + } else { + for (Instance instance : allInstances) { + String url = getRouteRequestUrl(instance); + ResponseEntity responseEntity = restTemplate.getForEntity(url, String.class); + if (responseEntity.getStatusCode() == HttpStatus.OK) { + String body = responseEntity.getBody(); + ServiceRouteInfo serviceRouteInfo = JSON.parseObject(body, ServiceRouteInfo.class); + baseRouteCache.load(serviceRouteInfo, callback -> { + try { + log.info("加载服务路由,serviceId:{}, instance:{}",serviceName, instance); + configService.publishConfig(dataId, groupId, body); + } catch (NacosException e) { + log.error("nacos推送失败,serviceId:{}, instance:{}",serviceName, instance); + } + }); + } + } + } + } catch (NacosException e) { + log.error("选择服务实例失败,serviceName:{}", serviceName, e); + } + } + } + + private static String getRouteRequestUrl(Instance instance) { + String query = buildQuery(SECRET); + return "http://" + instance.getIp() + ":" + instance.getPort() + "/sop/routes" + query; + } + + private static String buildQuery(String secret) { + String time = String.valueOf(System.currentTimeMillis()); + String source = secret + time + secret; + String sign = DigestUtils.md5DigestAsHex(source.getBytes()); + return "?time=" + time + "&sign=" + sign; + } + +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/RequestContextUtil.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/RequestContextUtil.java new file mode 100644 index 00000000..bea76c79 --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/RequestContextUtil.java @@ -0,0 +1,37 @@ +package com.gitee.sop.gatewaycommon.zuul; + +import com.netflix.util.Pair; +import com.netflix.zuul.context.RequestContext; +import org.apache.commons.lang3.StringUtils; +import org.springframework.http.HttpHeaders; + +import java.util.List; + +/** + * @author tanghc + */ +public class RequestContextUtil { + + /** + * 获取微服务端传递过来的header + * + * @param name header名 + * @return 返回value,没有返回null + */ + public static String getZuulResponseHeader(RequestContext requestContext, String name) { + List> zuulResponseHeaders = requestContext.getZuulResponseHeaders(); + return zuulResponseHeaders.stream() + .filter(pair -> StringUtils.containsIgnoreCase(pair.first(), name)) + .findFirst() + .map(Pair::second) + .orElse(null); + } + + /** + * 获取微服务端的content-type + * @return 返回content-type + */ + public static String getZuulContentType(RequestContext requestContext) { + return getZuulResponseHeader(requestContext, HttpHeaders.CONTENT_TYPE); + } +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/filter/PreEnvGrayFilter.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/filter/PreEnvGrayFilter.java new file mode 100644 index 00000000..7245cb74 --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/filter/PreEnvGrayFilter.java @@ -0,0 +1,49 @@ +package com.gitee.sop.gatewaycommon.zuul.filter; + +import com.gitee.sop.gatewaycommon.bean.TargetRoute; +import com.gitee.sop.gatewaycommon.manager.EnvGrayManager; +import com.gitee.sop.gatewaycommon.manager.RouteRepositoryContext; +import com.gitee.sop.gatewaycommon.param.ApiParam; +import com.gitee.sop.gatewaycommon.param.ParamNames; +import com.gitee.sop.gatewaycommon.zuul.ZuulContext; +import com.netflix.zuul.context.RequestContext; +import com.netflix.zuul.exception.ZuulException; +import org.springframework.beans.factory.annotation.Autowired; + +/** + * 灰度发布判断,改变版本号 + * + * @author tanghc + */ +public class PreEnvGrayFilter extends BaseZuulFilter { + + @Autowired + private EnvGrayManager envGrayManager; + + @Override + protected FilterType getFilterType() { + return FilterType.PRE; + } + + @Override + protected int getFilterOrder() { + return PRE_ENV_GRAY_FILTER_ORDER; + } + + @Override + protected Object doRun(RequestContext requestContext) throws ZuulException { + ApiParam apiParam = ZuulContext.getApiParam(); + String nameVersion = apiParam.fetchNameVersion(); + TargetRoute targetRoute = RouteRepositoryContext.getRouteRepository().get(nameVersion); + if (targetRoute == null) { + return null; + } + String serviceId = targetRoute.getServiceRouteInfo().fetchServiceIdLowerCase(); + // 如果服务在灰度阶段,返回一个灰度版本号 + String version = envGrayManager.getVersion(serviceId, nameVersion); + if (version != null && envGrayManager.containsKey(serviceId, apiParam.fetchAppKey())) { + requestContext.addZuulRequestHeader(ParamNames.HEADER_VERSION_NAME, version); + } + return null; + } +} diff --git a/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/route/ZuulRouteCache.java b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/route/ZuulRouteCache.java new file mode 100644 index 00000000..df6c64b7 --- /dev/null +++ b/sop-common/sop-gateway-common/src/main/java/com/gitee/sop/gatewaycommon/zuul/route/ZuulRouteCache.java @@ -0,0 +1,34 @@ +package com.gitee.sop.gatewaycommon.zuul.route; + +import com.gitee.sop.gatewaycommon.bean.RouteDefinition; +import com.gitee.sop.gatewaycommon.bean.ServiceRouteInfo; +import com.gitee.sop.gatewaycommon.manager.BaseRouteCache; +import com.gitee.sop.gatewaycommon.manager.RouteRepository; +import com.gitee.sop.gatewaycommon.util.RouteUtil; +import org.springframework.cloud.netflix.zuul.filters.Route; + +/** + * @author tanghc + */ +public class ZuulRouteCache extends BaseRouteCache { + + /** 路由重试 */ + private static final boolean RETRYABLE = true; + + public ZuulRouteCache(RouteRepository routeRepository) { + super(routeRepository); + } + + @Override + protected ZuulTargetRoute buildTargetRoute(ServiceRouteInfo serviceRouteInfo, RouteDefinition gatewayRouteDefinition) { + Route route = new Route( + gatewayRouteDefinition.getId() + , gatewayRouteDefinition.getPath() + , RouteUtil.getZuulLocation(gatewayRouteDefinition.getUri()) + , "" + , RETRYABLE + , null + ); + return new ZuulTargetRoute(serviceRouteInfo, gatewayRouteDefinition, route); + } +} diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/easyopen/EasyopenApiMetaBuilder.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/easyopen/EasyopenApiMetaBuilder.java new file mode 100644 index 00000000..adcd450f --- /dev/null +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/easyopen/EasyopenApiMetaBuilder.java @@ -0,0 +1,91 @@ +package com.gitee.sop.servercommon.easyopen; + +import com.gitee.easyopen.annotation.Api; +import com.gitee.easyopen.util.ReflectionUtil; +import com.gitee.sop.servercommon.bean.ServiceApiInfo; +import com.gitee.sop.servercommon.manager.ApiMetaBuilder; +import org.apache.commons.lang3.BooleanUtils; +import org.springframework.context.ApplicationContext; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.core.env.Environment; +import org.springframework.util.StringUtils; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Consumer; + +/** + * @author tanghc + */ +public class EasyopenApiMetaBuilder extends ApiMetaBuilder { + + /** IndexController上面的@RequestMapping()中的值,如:/api */ + private final String prefixPath; + + private final String contextPath; + + private ApplicationContext applicationContext; + + private Environment environment; + + public EasyopenApiMetaBuilder(ApplicationContext applicationContext, Environment environment) { + this.applicationContext = applicationContext; + this.environment = environment; + String path = environment.getProperty("easyopen.prefix-path"); + if (path == null) { + throw new IllegalArgumentException("请在application.propertis中设置easyopen.prefix-path属性,填IndexController上面的@RequestMapping()中的值"); + } + if (!path.startsWith("/")) { + path = "/" + path; + } + this.prefixPath = path; + this.contextPath = environment.getProperty("server.servlet.context-path", "/"); + } + + @Override + protected List buildApiMetaList(RequestMappingHandlerMapping requestMappingHandlerMapping) { + String[] apiServiceNames = ReflectionUtil.findApiServiceNames(applicationContext); + List apiMetaList = new ArrayList<>(); + for (String apiServiceName : apiServiceNames) { + Object bean = applicationContext.getBean(apiServiceName); + doWithMethods(bean.getClass(), method -> { + Api api = AnnotationUtils.findAnnotation(method, Api.class); + ServiceApiInfo.ApiMeta apiMeta = new ServiceApiInfo.ApiMeta(); + apiMeta.setName(api.name()); + apiMeta.setVersion(api.version()); + apiMeta.setIgnoreValidate(BooleanUtils.toInteger(api.ignoreValidate())); + // 对结果不合并 + apiMeta.setMergeResult(BooleanUtils.toInteger(false)); + // /api/goods.get/ + String servletPath = this.buildPath(api); + apiMeta.setPath(servletPath); + apiMetaList.add(apiMeta); + }); + } + return apiMetaList; + } + + protected void doWithMethods(Class clazz, Consumer consumer) { + // Keep backing up the inheritance hierarchy. + Method[] methods = clazz.getDeclaredMethods(); + for (Method method : methods) { + boolean match = !method.isSynthetic() && AnnotationUtils.findAnnotation(method, Api.class) != null; + if (match) { + consumer.accept(method); + } + } + } + + protected String buildPath(Api api) { + // /api/goods.get/ + String servletPath = prefixPath + "/" + api.name() + "/"; + String version = api.version(); + if (StringUtils.hasLength(version)) { + // /api/goods.get/1.0/ + servletPath = servletPath + version + "/"; + } + return contextPath + prefixPath + servletPath; + } +} diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/easyopen/EasyopenServiceConfiguration.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/easyopen/EasyopenServiceConfiguration.java new file mode 100644 index 00000000..a84bf30f --- /dev/null +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/easyopen/EasyopenServiceConfiguration.java @@ -0,0 +1,24 @@ +package com.gitee.sop.servercommon.easyopen; + +import com.gitee.easyopen.ApiContext; +import com.gitee.sop.servercommon.configuration.BaseServiceConfiguration; +import com.gitee.sop.servercommon.manager.ServiceRouteController; +import org.springframework.context.annotation.Bean; + +/** + * 提供给easyopen项目使用 + * + * @author tanghc + */ +public class EasyopenServiceConfiguration extends BaseServiceConfiguration { + + static { + ApiContext.getApiConfig().setIgnoreValidate(true); + } + + @Bean + ServiceRouteController serviceRouteController() { + return new EasyopenServiceRouteController(); + } + +} diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/easyopen/EasyopenServiceRouteController.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/easyopen/EasyopenServiceRouteController.java new file mode 100644 index 00000000..afff6f8d --- /dev/null +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/easyopen/EasyopenServiceRouteController.java @@ -0,0 +1,27 @@ +package com.gitee.sop.servercommon.easyopen; + +import com.gitee.sop.servercommon.manager.ApiMetaBuilder; +import com.gitee.sop.servercommon.manager.ServiceRouteController; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.web.bind.annotation.RestController; + +/** + * @author tanghc + */ +@RestController +public class EasyopenServiceRouteController extends ServiceRouteController implements ApplicationContextAware { + + private ApplicationContext applicationContext; + + @Override + protected ApiMetaBuilder getApiMetaBuilder() { + return new EasyopenApiMetaBuilder(applicationContext, getEnvironment()); + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } +} \ No newline at end of file diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ApiMetaBuilder.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ApiMetaBuilder.java new file mode 100644 index 00000000..4ca6f95e --- /dev/null +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ApiMetaBuilder.java @@ -0,0 +1,100 @@ +package com.gitee.sop.servercommon.manager; + +import com.gitee.sop.servercommon.bean.ServiceApiInfo; +import com.gitee.sop.servercommon.bean.ServiceConfig; +import com.gitee.sop.servercommon.mapping.ApiMappingInfo; +import com.gitee.sop.servercommon.mapping.ApiMappingRequestCondition; +import com.gitee.sop.servercommon.mapping.RouteUtil; +import org.apache.commons.lang3.BooleanUtils; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.mvc.condition.RequestCondition; +import org.springframework.web.servlet.mvc.method.RequestMappingInfo; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * @author tanghc + */ +public class ApiMetaBuilder { + + /** 接口名规则:允许字母、数字、点、下划线 */ + private static final String REGEX_API_NAME = "^[a-zA-Z0-9\\.\\_\\-]+$"; + + public ServiceApiInfo getServiceApiInfo(String serviceId, RequestMappingHandlerMapping requestMappingHandlerMapping) { + if (serviceId == null) { + throw new IllegalArgumentException("请在application.properties中指定spring.application.name属性"); + } + List apis = this.buildApiMetaList(requestMappingHandlerMapping); + // 排序 + apis.sort(Comparator.comparing(ServiceApiInfo.ApiMeta::fetchNameVersion)); + + ServiceApiInfo serviceApiInfo = new ServiceApiInfo(); + serviceApiInfo.setServiceId(serviceId); + serviceApiInfo.setApis(apis); + + return serviceApiInfo; + } + + protected List buildApiMetaList(RequestMappingHandlerMapping requestMappingHandlerMapping) { + Map handlerMethods = requestMappingHandlerMapping.getHandlerMethods(); + Set requestMappingInfos = handlerMethods.keySet(); + List store = new ArrayList<>(); + List apis = new ArrayList<>(requestMappingInfos.size()); + + for (Map.Entry handlerMethodEntry : handlerMethods.entrySet()) { + ServiceApiInfo.ApiMeta apiMeta = this.buildApiMeta(handlerMethodEntry); + if (apiMeta == null) { + continue; + } + String key = apiMeta.fetchNameVersion(); + if (store.contains(key)) { + throw new IllegalArgumentException("重复申明接口,请检查path和version,path:" + apiMeta.getPath() + ", version:" + apiMeta.getVersion()); + } else { + store.add(key); + } + apis.add(apiMeta); + } + return apis; + } + + protected ServiceApiInfo.ApiMeta buildApiMeta(Map.Entry handlerMethodEntry) { + RequestMappingInfo requestMappingInfo = handlerMethodEntry.getKey(); + Set patterns = requestMappingInfo.getPatternsCondition().getPatterns(); + RequestCondition customCondition = requestMappingInfo.getCustomCondition(); + if (customCondition instanceof ApiMappingRequestCondition) { + ApiMappingRequestCondition condition = (ApiMappingRequestCondition) customCondition; + ApiMappingInfo apiMappingInfo = condition.getApiMappingInfo(); + String name = apiMappingInfo.getName(); + String version = apiMappingInfo.getVersion(); + // 方法完整的path,如: /goods/listGoods,/users/user/get + String path = patterns.iterator().next(); + // 不是ApiMapping注解的接口,name属性是null + if (name == null || ServiceConfig.getInstance().isWebappMode()) { + name = buildName(path); + } + this.checkApiName(name); + ServiceApiInfo.ApiMeta apiMeta = new ServiceApiInfo.ApiMeta(name, path, version); + apiMeta.setIgnoreValidate(BooleanUtils.toInteger(apiMappingInfo.isIgnoreValidate())); + apiMeta.setMergeResult(BooleanUtils.toInteger(apiMappingInfo.isMergeResult())); + apiMeta.setPermission(BooleanUtils.toInteger(apiMappingInfo.isPermission())); + return apiMeta; + } + return null; + } + + protected void checkApiName(String name) { + if (!name.matches(REGEX_API_NAME)) { + throw new IllegalArgumentException("接口名称只允许【字母、数字、点(.)、下划线(_)、减号(-)】,错误接口:" + name); + } + } + + + protected String buildName(String path) { + return RouteUtil.buildApiName(path); + } +} diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ServiceRouteController.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ServiceRouteController.java new file mode 100644 index 00000000..50ddca39 --- /dev/null +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ServiceRouteController.java @@ -0,0 +1,55 @@ +package com.gitee.sop.servercommon.manager; + +import com.gitee.sop.servercommon.bean.ServiceApiInfo; +import com.gitee.sop.servercommon.route.ServiceRouteInfo; +import com.gitee.sop.servercommon.util.OpenUtil; +import lombok.Getter; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.core.env.Environment; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +/** + * @author tanghc + */ +@Slf4j +@Getter +@RestController +public class ServiceRouteController { + + private static final String SECRET = "a3d9sf!1@odl90zd>fkASwq"; + + @Autowired + private RequestMappingHandlerMapping requestMappingHandlerMapping; + + @Autowired + private Environment environment; + + + @RequestMapping("/sop/routes") + public ServiceRouteInfo listRoutes(HttpServletRequest request, HttpServletResponse response) { + if (!OpenUtil.validateSimpleSign(request, SECRET)) { + log.error("签名验证失败, params:{}", request.getQueryString()); + return null; + } + return getServiceRouteInfo(request, response); + } + + protected ApiMetaBuilder getApiMetaBuilder() { + return new ApiMetaBuilder(); + } + + protected ServiceRouteInfo getServiceRouteInfo(HttpServletRequest request, HttpServletResponse response) { + String serviceId = environment.getProperty("spring.application.name"); + ApiMetaBuilder apiMetaBuilder = getApiMetaBuilder(); + ServiceApiInfo serviceApiInfo = apiMetaBuilder.getServiceApiInfo(serviceId, requestMappingHandlerMapping); + ServiceRouteInfoBuilder serviceRouteInfoBuilder = new ServiceRouteInfoBuilder(environment); + return serviceRouteInfoBuilder.build(serviceApiInfo); + } + +} diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ServiceRouteInfoBuilder.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ServiceRouteInfoBuilder.java new file mode 100644 index 00000000..13784204 --- /dev/null +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ServiceRouteInfoBuilder.java @@ -0,0 +1,134 @@ +package com.gitee.sop.servercommon.manager; + +import com.alibaba.fastjson.JSON; +import com.gitee.sop.servercommon.bean.ServiceApiInfo; +import com.gitee.sop.servercommon.route.RouteDefinition; +import com.gitee.sop.servercommon.route.ServiceRouteInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.core.env.Environment; +import org.springframework.util.DigestUtils; +import org.springframework.util.StringUtils; + +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author tanghc + */ +@Slf4j +public class ServiceRouteInfoBuilder { + + /** + * 网关对应的LoadBalance协议 + */ + private static final String PROTOCOL_LOAD_BALANCE = "lb://"; + + private static final String PATH_SPLIT = "/"; + + private static final String DEFAULT_CONTEXT_PATH = "/"; + + private static ServiceApiInfo.ApiMeta FIRST_API_META = new ServiceApiInfo.ApiMeta("_first_route_", "/", "1.0.0"); + + private Environment environment; + + public ServiceRouteInfoBuilder(Environment environment) { + this.environment = environment; + } + + public ServiceRouteInfo build(ServiceApiInfo serviceApiInfo) { + return this.buildServiceGatewayInfo(serviceApiInfo); + } + + /** + * 构建接口信息,符合spring cloud gateway的格式 + * + * @param serviceApiInfo 服务接口信息 + * @return 返回服务路由信息 + */ + protected ServiceRouteInfo buildServiceGatewayInfo(ServiceApiInfo serviceApiInfo) { + List apis = serviceApiInfo.getApis(); + List routeDefinitionList = new ArrayList<>(apis.size() + 1); + // 在第一个位置放一个没用的路由,SpringCloudGateway会从第二个路由开始找,原因不详 + routeDefinitionList.add(this.getFirstRoute(serviceApiInfo)); + for (ServiceApiInfo.ApiMeta apiMeta : apis) { + RouteDefinition gatewayRouteDefinition = this.buildGatewayRouteDefinition(serviceApiInfo, apiMeta); + routeDefinitionList.add(gatewayRouteDefinition); + } + ServiceRouteInfo serviceRouteInfo = new ServiceRouteInfo(); + serviceRouteInfo.setServiceId(serviceApiInfo.getServiceId()); + serviceRouteInfo.setRouteDefinitionList(routeDefinitionList); + String md5 = buildMd5(routeDefinitionList); + serviceRouteInfo.setMd5(md5); + return serviceRouteInfo; + } + + /** + * 添加com.gitee.sop.gatewaycommon.routeDefinition.ReadBodyRoutePredicateFactory,解决form表单获取不到问题 + * + * @return 返回路由定义 + */ + protected RouteDefinition getFirstRoute(ServiceApiInfo serviceApiInfo) { + RouteDefinition firstRoute = this.buildGatewayRouteDefinition(serviceApiInfo, FIRST_API_META); + firstRoute.setOrder(Integer.MIN_VALUE); + return firstRoute; + } + + /** + * 构建路由id MD5 + * + * @param routeDefinitionList 路由列表 + * @return 返回MD5 + */ + protected String buildMd5(List routeDefinitionList) { + List routeIdList = routeDefinitionList.stream() + .map(JSON::toJSONString) + .sorted() + .collect(Collectors.toList()); + String md5Source = org.apache.commons.lang3.StringUtils.join(routeIdList, ""); + return DigestUtils.md5DigestAsHex(md5Source.getBytes(StandardCharsets.UTF_8)); + } + + protected RouteDefinition buildGatewayRouteDefinition(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) { + RouteDefinition routeDefinition = new RouteDefinition(); + // 唯一id规则:接口名 + 版本号 + String routeId = apiMeta.fetchNameVersion(); + this.checkPath(routeId, "接口定义(" + routeId + ")不能有斜杠字符'/'"); + BeanUtils.copyProperties(apiMeta, routeDefinition); + routeDefinition.setId(routeId); + routeDefinition.setFilters(Collections.emptyList()); + routeDefinition.setPredicates(Collections.emptyList()); + String uri = this.buildUri(serviceApiInfo, apiMeta); + String path = this.buildServletPath(serviceApiInfo, apiMeta); + routeDefinition.setUri(uri); + routeDefinition.setPath(path); + return routeDefinition; + } + + protected String buildUri(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) { + return PROTOCOL_LOAD_BALANCE + serviceApiInfo.getServiceId(); + } + + protected String buildServletPath(ServiceApiInfo serviceApiInfo, ServiceApiInfo.ApiMeta apiMeta) { + String contextPath = environment.getProperty("server.servlet.context-path", DEFAULT_CONTEXT_PATH); + String servletPath = apiMeta.getPath(); + if (servletPath == null) { + servletPath = ""; + } + servletPath = StringUtils.trimLeadingCharacter(servletPath, '/'); + return contextPath + servletPath; + } + + private void checkPath(String path, String errorMsg) { + if (path.contains(PATH_SPLIT)) { + throw new IllegalArgumentException(errorMsg); + } + } + + public Environment getEnvironment() { + return environment; + } +} diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ServiceRouteInfoHandler.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ServiceRouteInfoHandler.java new file mode 100644 index 00000000..882963ea --- /dev/null +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/manager/ServiceRouteInfoHandler.java @@ -0,0 +1,9 @@ +package com.gitee.sop.servercommon.manager; + +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * @author tanghc + */ +public interface ServiceRouteInfoHandler { +} diff --git a/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/route/RouteDefinition.java b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/route/RouteDefinition.java new file mode 100644 index 00000000..5cd8a343 --- /dev/null +++ b/sop-common/sop-service-common/src/main/java/com/gitee/sop/servercommon/route/RouteDefinition.java @@ -0,0 +1,71 @@ +package com.gitee.sop.servercommon.route; + +import lombok.Data; + +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class RouteDefinition { + /** + * 路由的Id(接口名+版本号),确保此id全局唯一 + */ + private String id; + + /** + * 接口名 + */ + private String name; + + /** + * 版本号 + */ + private String version; + + /** + * 路由断言集合配置 + */ + private List predicates; + + /** + * 路由过滤器集合配置 + */ + private List filters; + + /** + * 路由规则转发的目标uri + */ + private String uri; + + /** + * uri后面跟的path + */ + private String path; + + /** + * 路由执行的顺序 + */ + private int order = 0; + + /** + * 是否忽略验证,业务参数验证除外 + */ + private int ignoreValidate; + + /** + * 状态,0:待审核,1:启用,2:禁用 + */ + private int status = 1; + + /** + * 是否合并结果 + */ + private int mergeResult; + + /** + * 是否需要授权才能访问 + */ + private int permission; +} \ No newline at end of file diff --git a/sop-example/sop-easyopen/src/main/resources/application-dev.properties b/sop-example/sop-easyopen/src/main/resources/application-dev.properties new file mode 100644 index 00000000..c65f550f --- /dev/null +++ b/sop-example/sop-easyopen/src/main/resources/application-dev.properties @@ -0,0 +1,7 @@ +server.port=2121 +spring.application.name=easyopen-service + +# nacos注册中心 +spring.cloud.nacos.discovery.server-addr=127.0.0.1:8848 + +easyopen.prefix-path=/api diff --git a/sop-example/sop-easyopen/src/main/resources/application.properties b/sop-example/sop-easyopen/src/main/resources/application.properties new file mode 100644 index 00000000..257b3064 --- /dev/null +++ b/sop-example/sop-easyopen/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.profiles.active=dev \ No newline at end of file diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/param/CategoryParam.java b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/param/CategoryParam.java new file mode 100644 index 00000000..9787d163 --- /dev/null +++ b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/param/CategoryParam.java @@ -0,0 +1,13 @@ +package com.gitee.sop.storyweb.controller.param; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class CategoryParam { + @ApiModelProperty(value = "分类名称", example = "娱乐") + private String categoryName; + + @ApiModelProperty(value = "分类故事") + private StoryParam storyParam; +} \ No newline at end of file diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/result/CategoryResult.java b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/result/CategoryResult.java new file mode 100644 index 00000000..47311198 --- /dev/null +++ b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/result/CategoryResult.java @@ -0,0 +1,13 @@ +package com.gitee.sop.storyweb.controller.result; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +public class CategoryResult { + @ApiModelProperty(value = "分类名称", example = "娱乐") + private String categoryName; + + @ApiModelProperty(value = "分类故事") + private StoryResult storyResult; +} \ No newline at end of file diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/result/FileUploadResult.java b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/result/FileUploadResult.java new file mode 100644 index 00000000..447292ad --- /dev/null +++ b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/result/FileUploadResult.java @@ -0,0 +1,36 @@ +package com.gitee.sop.storyweb.controller.result; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.ArrayList; +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class FileUploadResult { + + private List files = new ArrayList(); + + @Data + public static class FileMeta { + + public FileMeta(String filename, long size, String content) { + this.filename = filename; + this.size = size; + this.content = content; + } + + public FileMeta() { + } + + @ApiModelProperty(value = "文件名称", example = "1.txt") + private String filename; + @ApiModelProperty(value = "文件大小", example = "109") + private long size; + @ApiModelProperty(value = "文件内容", example = "啊啊啊") + private String content; + } +} diff --git a/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/result/StoryResult.java b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/result/StoryResult.java new file mode 100644 index 00000000..b3bf99ef --- /dev/null +++ b/sop-example/sop-story/sop-story-web/src/main/java/com/gitee/sop/storyweb/controller/result/StoryResult.java @@ -0,0 +1,23 @@ +package com.gitee.sop.storyweb.controller.result; + +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import org.hibernate.validator.constraints.Length; + +import javax.validation.constraints.NotBlank; +import java.util.Date; + +/** + * @author tanghc + */ +@Data +public class StoryResult { + @ApiModelProperty(value = "故事ID", example = "1") + private Long id; + + @ApiModelProperty(value = "故事名称", example = "海底小纵队") + private String name; + + @ApiModelProperty(value = "创建时间", example = "2019-04-14 19:02:12") + private Date gmt_create; +} diff --git a/sop-test/src/main/resources/file1.txt b/sop-test/src/main/resources/file1.txt new file mode 100644 index 00000000..3b760675 --- /dev/null +++ b/sop-test/src/main/resources/file1.txt @@ -0,0 +1 @@ +file1 content,内容1 \ No newline at end of file diff --git a/sop-test/src/main/resources/file2.txt b/sop-test/src/main/resources/file2.txt new file mode 100644 index 00000000..fd7656f3 --- /dev/null +++ b/sop-test/src/main/resources/file2.txt @@ -0,0 +1 @@ +file2 content,内容2 \ No newline at end of file diff --git a/sop-website/.gitignore b/sop-website/.gitignore new file mode 100644 index 00000000..153c9335 --- /dev/null +++ b/sop-website/.gitignore @@ -0,0 +1,29 @@ +HELP.md +/target/ +!.mvn/wrapper/maven-wrapper.jar + +### STS ### +.apt_generated +.classpath +.factorypath +.project +.settings +.springBeans +.sts4-cache + +### IntelliJ IDEA ### +.idea +*.iws +*.iml +*.ipr + +### NetBeans ### +/nbproject/private/ +/nbbuild/ +/dist/ +/nbdist/ +/.nb-gradle/ +/build/ + +### VS Code ### +.vscode/ diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/WebsiteServerApplication.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/WebsiteServerApplication.java new file mode 100644 index 00000000..e9e729b4 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/WebsiteServerApplication.java @@ -0,0 +1,13 @@ +package com.gitee.sop.websiteserver; + +import org.springframework.boot.SpringApplication; +import org.springframework.boot.autoconfigure.SpringBootApplication; + +@SpringBootApplication +public class WebsiteServerApplication { + + public static void main(String[] args) { + SpringApplication.run(WebsiteServerApplication.class, args); + } + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocInfo.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocInfo.java new file mode 100644 index 00000000..82e90129 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocInfo.java @@ -0,0 +1,17 @@ +package com.gitee.sop.websiteserver.bean; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; + +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class DocInfo { + private String title; + @JSONField(serialize = false) + private String serviceId; + private List docModuleList; +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocItem.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocItem.java new file mode 100644 index 00000000..2f68b9ef --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocItem.java @@ -0,0 +1,51 @@ +package com.gitee.sop.websiteserver.bean; + +import lombok.Data; + +import java.util.Collection; +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class DocItem { + private String module; + private String name; + private String version; + private String summary; + private String description; + /** 是否多文件上传 */ + private boolean multiple; + /** http method列表 */ + private Collection httpMethodList; + + private Collection produces; + + private int moduleOrder; + + List requestParameters; + List responseParameters; + + public String getNameVersion() { + return name + version; + } + + /** + * 是否是上传文件请求 + * @return + */ + public boolean isUploadRequest() { + boolean upload = false; + if (requestParameters != null) { + for (DocParameter requestParameter : requestParameters) { + String type = requestParameter.getType(); + if ("file".equalsIgnoreCase(type)) { + upload = true; + break; + } + } + } + return multiple || upload; + } +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocModule.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocModule.java new file mode 100644 index 00000000..d51d1c8c --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocModule.java @@ -0,0 +1,15 @@ +package com.gitee.sop.websiteserver.bean; + +import lombok.Data; + +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class DocModule { + private String module; + private List docItems; + private int order; +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocParameter.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocParameter.java new file mode 100644 index 00000000..658c36c8 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocParameter.java @@ -0,0 +1,31 @@ +package com.gitee.sop.websiteserver.bean; + +import com.alibaba.fastjson.annotation.JSONField; +import lombok.Data; +import org.apache.commons.lang.StringUtils; + +import java.util.List; + +/** + * 参数 类型 是否必填 最大长度 描述 示例值 + * @author tanghc + */ +@Data +public class DocParameter { + private String module; + private String name; + private String type; + private String maxLength = "-"; + private boolean required; + private String description; + private String example = ""; + + @JSONField(name = "x-example") + private String x_example = ""; + + private List refs; + + public String getParamExample() { + return StringUtils.isBlank(example) ? x_example : example; + } +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocParserContext.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocParserContext.java new file mode 100644 index 00000000..8d79195b --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/DocParserContext.java @@ -0,0 +1,16 @@ +package com.gitee.sop.websiteserver.bean; + +import com.google.common.collect.Sets; + +import java.util.Set; + +/** + * @author tanghc + */ +public class DocParserContext { + + /** + * 忽略显示 + */ + public static volatile Set ignoreHttpMethods = Sets.newHashSet("put", "options", "head", "put", "delete", "patch"); +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaApplication.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaApplication.java new file mode 100644 index 00000000..d39a78eb --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaApplication.java @@ -0,0 +1,14 @@ +package com.gitee.sop.websiteserver.bean; + +import lombok.Data; + +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class EurekaApplication { + private String name; + private List instance; +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaApplications.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaApplications.java new file mode 100644 index 00000000..c7f001c1 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaApplications.java @@ -0,0 +1,13 @@ +package com.gitee.sop.websiteserver.bean; + +import lombok.Data; + +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class EurekaApplications { + private List application; +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaApps.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaApps.java new file mode 100644 index 00000000..23102246 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaApps.java @@ -0,0 +1,11 @@ +package com.gitee.sop.websiteserver.bean; + +import lombok.Data; + +/** + * @author tanghc + */ +@Data +public class EurekaApps { + private EurekaApplications applications; +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaInstance.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaInstance.java new file mode 100644 index 00000000..a769a64a --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaInstance.java @@ -0,0 +1,29 @@ +package com.gitee.sop.websiteserver.bean; + +import lombok.Data; +import org.springframework.util.CollectionUtils; + +import java.util.Map; + +/** + * @author tanghc + */ +@Data +public class EurekaInstance { + private String instanceId; + private String ipAddr; + private Map port; + + private String status; + private String statusPageUrl; + private String healthCheckUrl; + private String lastUpdatedTimestamp; + + public String fetchPort() { + if (CollectionUtils.isEmpty(port)) { + return ""; + } + return String.valueOf(port.getOrDefault("$", "")); + } + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaUri.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaUri.java new file mode 100644 index 00000000..8f4b2d1b --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/EurekaUri.java @@ -0,0 +1,70 @@ +package com.gitee.sop.websiteserver.bean; + +import okhttp3.MediaType; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.internal.http.HttpMethod; +import org.apache.commons.lang.ArrayUtils; +import org.springframework.web.bind.annotation.RequestMethod; + +/** + * https://github.com/Netflix/eureka/wiki/Eureka-REST-operations + * + * @author tanghc + */ +public enum EurekaUri { + + /** + * 查询所有实例 Query for all instances + */ + QUERY_APPS(RequestMethod.GET, "/apps"), + /** + * 下线 Take instance out of service + */ + OFFLINE_SERVICE(RequestMethod.PUT, "/apps/%s/%s/status?value=OUT_OF_SERVICE"), + /** + * 上线 Move instance back into service (remove override) + */ + ONLINE_SERVICE(RequestMethod.DELETE, "/apps/%s/%s/status?value=UP"), + ; + public static final String URL_PREFIX = "/"; + + String uri; + RequestMethod requestMethod; + + EurekaUri(RequestMethod httpMethod, String uri) { + if (!uri.startsWith(URL_PREFIX)) { + uri = "/" + uri; + } + this.uri = uri; + this.requestMethod = httpMethod; + } + + public String getUri(String... args) { + if (ArrayUtils.isEmpty(args)) { + return uri; + } + Object[] param = ArrayUtils.clone(args); + return String.format(uri, param); + } + + public Request getRequest(String url, String... args) { + String requestUrl = url + getUri(args); + Request request = this.getBuilder() + .url(requestUrl) + .addHeader("Content-Type", "application/json") + .addHeader("Accept", "application/json") + .build(); + return request; + } + + public Request.Builder getBuilder() { + String method = requestMethod.name(); + RequestBody requestBody = null; + if (HttpMethod.requiresRequestBody(method)) { + MediaType contentType = MediaType.parse(org.springframework.http.MediaType.APPLICATION_JSON_VALUE); + requestBody = RequestBody.create(contentType, "{}"); + } + return new Request.Builder().method(requestMethod.name(), requestBody); + } +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/HttpTool.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/HttpTool.java new file mode 100644 index 00000000..61623a8b --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/bean/HttpTool.java @@ -0,0 +1,437 @@ +package com.gitee.sop.websiteserver.bean; + +import lombok.Data; +import lombok.Getter; +import lombok.Setter; +import okhttp3.Cookie; +import okhttp3.CookieJar; +import okhttp3.FormBody; +import okhttp3.HttpUrl; +import okhttp3.MediaType; +import okhttp3.MultipartBody; +import okhttp3.OkHttpClient; +import okhttp3.Request; +import okhttp3.RequestBody; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.apache.commons.codec.digest.DigestUtils; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * http请求工具,基于OKHTTP3 + * @author tanghc + */ +public class HttpTool { + private static final MediaType MEDIA_TYPE_JSON = MediaType.parse("application/json; charset=utf-8"); + + private Map> cookieStore = new HashMap>(); + + private OkHttpClient httpClient; + + public HttpTool() { + this(new HttpToolConfig()); + } + + public HttpTool(HttpToolConfig httpToolConfig) { + this.initHttpClient(httpToolConfig); + } + + protected void initHttpClient(HttpToolConfig httpToolConfig) { + httpClient = new OkHttpClient.Builder() + // 设置链接超时时间,默认10秒 + .connectTimeout(httpToolConfig.connectTimeoutSeconds, TimeUnit.SECONDS) + .readTimeout(httpToolConfig.readTimeoutSeconds, TimeUnit.SECONDS) + .writeTimeout(httpToolConfig.writeTimeoutSeconds, TimeUnit.SECONDS) + .cookieJar(new CookieJar() { + @Override + public void saveFromResponse(HttpUrl httpUrl, List list) { + cookieStore.put(httpUrl.host(), list); + } + + @Override + public List loadForRequest(HttpUrl httpUrl) { + List cookies = cookieStore.get(httpUrl.host()); + return cookies != null ? cookies : new ArrayList(); + } + }).build(); + } + + @Data + public static class HttpToolConfig { + /** + * 请求超时时间 + */ + private int connectTimeoutSeconds = 10; + /** + * http读取超时时间 + */ + private int readTimeoutSeconds = 10; + /** + * http写超时时间 + */ + private int writeTimeoutSeconds = 10; + } + + /** + * get请求 + * + * @param url + * @param header + * @return + * @throws IOException + */ + public String get(String url, Map header) throws IOException { + Request.Builder builder = new Request.Builder().url(url).get(); + // 添加header + addHeader(builder, header); + + Request request = builder.build(); + Response response = httpClient.newCall(request).execute(); + return response.body().string(); + } + + /** + * 提交表单 + * + * @param url url + * @param form 参数 + * @param header header + * @param method 请求方式,post,get等 + * @return + * @throws IOException + */ + public String request(String url, Map form, Map header, HTTPMethod method) throws IOException { + Request.Builder requestBuilder = buildRequestBuilder(url, form, method); + // 添加header + addHeader(requestBuilder, header); + + Request request = requestBuilder.build(); + Response response = httpClient + .newCall(request) + .execute(); + try { + return response.body().string(); + } finally { + response.close(); + } + } + + /** + * 请求json数据,contentType=application/json + * @param url 请求路径 + * @param json json数据 + * @param header header + * @return 返回响应结果 + * @throws IOException + */ + public String requestJson(String url, String json, Map header) throws IOException { + RequestBody body = RequestBody.create(MEDIA_TYPE_JSON, json); + Request.Builder requestBuilder = new Request.Builder() + .url(url) + .post(body); + // 添加header + addHeader(requestBuilder, header); + + Request request = requestBuilder.build(); + Response response = httpClient + .newCall(request) + .execute(); + try { + return response.body().string(); + } finally { + response.close(); + } + } + + public static Request.Builder buildRequestBuilder(String url, Map form, HTTPMethod method) { + switch (method) { + case GET: + return new Request.Builder() + .url(buildHttpUrl(url, form)) + .get(); + case HEAD: + return new Request.Builder() + .url(buildHttpUrl(url, form)) + .head(); + case PUT: + return new Request.Builder() + .url(url) + .put(buildFormBody(form)); + case DELETE: + return new Request.Builder() + .url(url) + .delete(buildFormBody(form)); + default: + return new Request.Builder() + .url(url) + .post(buildFormBody(form)); + } + } + + public static HttpUrl buildHttpUrl(String url, Map form) { + HttpUrl.Builder urlBuilder = HttpUrl.parse(url).newBuilder(); + for (Map.Entry entry : form.entrySet()) { + urlBuilder.addQueryParameter(entry.getKey(), String.valueOf(entry.getValue())); + } + return urlBuilder.build(); + } + + public static FormBody buildFormBody(Map form) { + FormBody.Builder paramBuilder = new FormBody.Builder(StandardCharsets.UTF_8); + for (Map.Entry entry : form.entrySet()) { + paramBuilder.add(entry.getKey(), String.valueOf(entry.getValue())); + } + return paramBuilder.build(); + } + + /** + * 提交表单,并且上传文件 + * + * @param url + * @param form + * @param header + * @param files + * @return + * @throws IOException + */ + public String requestFile(String url, Map form, Map header, List files) + throws IOException { + // 创建MultipartBody.Builder,用于添加请求的数据 + MultipartBody.Builder bodyBuilder = new MultipartBody.Builder(); + bodyBuilder.setType(MultipartBody.FORM); + + for (UploadFile uploadFile : files) { + // 请求的名字 + bodyBuilder.addFormDataPart(uploadFile.getName(), + // 文件的文字,服务器端用来解析的 + uploadFile.getFileName(), + // 创建RequestBody,把上传的文件放入 + RequestBody.create(null, uploadFile.getFileData()) + ); + } + + for (Map.Entry entry : form.entrySet()) { + bodyBuilder.addFormDataPart(entry.getKey(), String.valueOf(entry.getValue())); + } + + RequestBody requestBody = bodyBuilder.build(); + + Request.Builder builder = new Request.Builder().url(url).post(requestBody); + + // 添加header + addHeader(builder, header); + + Request request = builder.build(); + Response response = httpClient.newCall(request).execute(); + try { + return response.body().string(); + } finally { + response.close(); + } + } + + /** + * 请求数据 + * + * @param url 请求url + * @param form 请求数据 + * @param header header + * @return 返回Response + * @throws IOException + */ + public Response requestForResponse(String url, Map form, Map header, HTTPMethod method) throws IOException { + Request.Builder requestBuilder = buildRequestBuilder(url, form, method); + // 添加header + addHeader(requestBuilder, header); + + Request request = requestBuilder.build(); + return httpClient + .newCall(request) + .execute(); + } + + /** + * 下载文件 + * + * @param url 请求url + * @param form 请求数据 + * @param header header + * @return 返回文件流 + * @throws IOException + */ + public InputStream downloadFile(String url, Map form, Map header) throws IOException { + Request.Builder requestBuilder = buildRequestBuilder(url, form, HTTPMethod.GET); + // 添加header + addHeader(requestBuilder, header); + + Request request = requestBuilder.build(); + Response response = httpClient + .newCall(request) + .execute(); + if (response.isSuccessful()) { + ResponseBody body = response.body(); + return body == null ? null : body.byteStream(); + } + return null; + } + + private void addHeader(Request.Builder builder, Map header) { + if (header != null) { + Set> entrySet = header.entrySet(); + for (Map.Entry entry : entrySet) { + builder.addHeader(entry.getKey(), String.valueOf(entry.getValue())); + } + } + } + + public void setCookieStore(Map> cookieStore) { + this.cookieStore = cookieStore; + } + + public void setHttpClient(OkHttpClient httpClient) { + this.httpClient = httpClient; + } + + public enum HTTPMethod { + /** http GET */ + GET, + /** http POST */ + POST, + /** http PUT */ + PUT, + /** http HEAD */ + HEAD, + /** http DELETE */ + DELETE; + + private HTTPMethod() { + } + + public String value() { + return this.name(); + } + + public static HTTPMethod fromValue(String v) { + return valueOf(v.toUpperCase()); + } + } + + /** + * 文件上传类 + * @author tanghc + */ + @Getter + @Setter + public static class UploadFile implements Serializable { + private static final long serialVersionUID = -1100614660944996398L; + + /** + * @param name 表单名称,不能重复 + * @param file 文件 + * @throws IOException + */ + public UploadFile(String name, File file) throws IOException { + this(name, file.getName(), FileUtil.toBytes(file)); + } + + /** + * @param name 表单名称,不能重复 + * @param fileName 文件名 + * @param input 文件流 + * @throws IOException + */ + public UploadFile(String name, String fileName, InputStream input) throws IOException { + this(name, fileName, FileUtil.toBytes(input)); + } + + /** + * @param name 表单名称,不能重复 + * @param fileName 文件名 + * @param fileData 文件数据 + */ + public UploadFile(String name, String fileName, byte[] fileData) { + super(); + this.name = name; + this.fileName = fileName; + this.fileData = fileData; + this.md5 = DigestUtils.md5Hex(fileData); + } + + private String name; + private String fileName; + private byte[] fileData; + private String md5; + + } + + public static class FileUtil { + + /** + * The default buffer size to use. + */ + private static final int DEFAULT_BUFFER_SIZE = 1024 * 4; + private static final int EOF = -1; + + /** + * 将文件流转换成byte[] + * @param input + * @return + * @throws IOException + */ + public static byte[] toBytes(InputStream input) throws IOException { + ByteArrayOutputStream output = new ByteArrayOutputStream(); + int n = 0; + byte[] buffer = new byte[DEFAULT_BUFFER_SIZE]; + + while (EOF != (n = input.read(buffer))) { + output.write(buffer, 0, n); + } + return output.toByteArray(); + } + + /** + * 将文件转换成数据流 + * @param file 文件 + * @return 返回数据流 + * @throws IOException + */ + public static byte[] toBytes(File file) throws IOException { + if (file.exists()) { + if (file.isDirectory()) { + throw new IOException("File '" + file + "' exists but is a directory"); + } + if (file.canRead() == false) { + throw new IOException("File '" + file + "' cannot be read"); + } + } else { + throw new FileNotFoundException("File '" + file + "' does not exist"); + } + InputStream input = null; + try { + input = new FileInputStream(file); + return toBytes(input); + } finally { + try { + if (input != null) { + input.close(); + } + } catch (IOException ioe) { + } + } + } + } +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/config/CorsConfig.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/config/CorsConfig.java new file mode 100644 index 00000000..be284325 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/config/CorsConfig.java @@ -0,0 +1,37 @@ +package com.gitee.sop.websiteserver.config; + +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.web.cors.CorsConfiguration; +import org.springframework.web.cors.UrlBasedCorsConfigurationSource; +import org.springframework.web.filter.CorsFilter; + +/** + * 解决js跨域 + * @author tanghc + */ +@Configuration +public class CorsConfig { + + /** + * 跨域过滤器 + * + * @return + */ + @Bean + public CorsFilter corsFilter() { + UrlBasedCorsConfigurationSource source = new UrlBasedCorsConfigurationSource(); + source.registerCorsConfiguration("/**", buildConfig()); // 4 + return new CorsFilter(source); + } + + private CorsConfiguration buildConfig() { + CorsConfiguration corsConfiguration = new CorsConfiguration(); + corsConfiguration.addAllowedOrigin("*"); + corsConfiguration.addAllowedHeader("*"); + corsConfiguration.addAllowedMethod("*"); + return corsConfiguration; + } + + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/config/WebsiteConfig.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/config/WebsiteConfig.java new file mode 100644 index 00000000..cdf8d8ae --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/config/WebsiteConfig.java @@ -0,0 +1,45 @@ +package com.gitee.sop.websiteserver.config; + +import com.alibaba.fastjson.serializer.SerializerFeature; +import com.alibaba.fastjson.support.config.FastJsonConfig; +import com.alibaba.fastjson.support.spring.FastJsonHttpMessageConverter; +import com.gitee.sop.websiteserver.manager.DocManager; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.ApplicationArguments; +import org.springframework.boot.ApplicationRunner; +import org.springframework.boot.autoconfigure.http.HttpMessageConverters; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author tanghc + */ +@Configuration +public class WebsiteConfig implements ApplicationRunner { + + @Autowired + DocManager docManager; + + /** + * 使用fastjson代替jackson + * @return + */ + @Bean + public HttpMessageConverters fastJsonConfigure(){ + FastJsonHttpMessageConverter converter = new FastJsonHttpMessageConverter(); + FastJsonConfig fastJsonConfig = new FastJsonConfig(); + fastJsonConfig.setSerializerFeatures(SerializerFeature.WriteNullStringAsEmpty, SerializerFeature.WriteMapNullValue); + // 日期格式化 + fastJsonConfig.setDateFormat("yyyy-MM-dd HH:mm:ss"); + converter.setFastJsonConfig(fastJsonConfig); + return new HttpMessageConverters(converter); + } + + /** + * SpringBoot启动完毕执行 + */ + @Override + public void run(ApplicationArguments args) throws Exception { +// docManager.load(null); + } +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/controller/DocController.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/controller/DocController.java new file mode 100644 index 00000000..ed2e972e --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/controller/DocController.java @@ -0,0 +1,60 @@ +package com.gitee.sop.websiteserver.controller; + +import com.gitee.sop.websiteserver.bean.DocInfo; +import com.gitee.sop.websiteserver.manager.DocManager; +import com.gitee.sop.websiteserver.vo.DocBaseInfoVO; +import com.gitee.sop.websiteserver.vo.DocInfoVO; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author tanghc + */ +@RestController +@RequestMapping("doc") +public class DocController { + + @Autowired + DocManager docManager; + + @Value("${api.url-test}") + String urlTest; + + @Value("${api.url-prod}") + String urlProd; + + @Value("${api.pwd}") + String pwd; + + @GetMapping("/getDocBaseInfo") + public DocBaseInfoVO getDocBaseInfo() { + List docInfoList = docManager.listAll() + .stream() + .map(docInfo -> { + DocInfoVO vo = new DocInfoVO(); + BeanUtils.copyProperties(docInfo, vo); + return vo; + }) + .collect(Collectors.toList()); + + DocBaseInfoVO baseInfoVO = new DocBaseInfoVO(); + baseInfoVO.setUrlTest(urlTest); + baseInfoVO.setUrlProd(urlProd); + baseInfoVO.setDocInfoList(docInfoList); + return baseInfoVO; + } + + @GetMapping("/docinfo/{title}") + public DocInfo getDocModule(@PathVariable("title") String title) { + return docManager.getByTitle(title); + } + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/controller/IndexController.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/controller/IndexController.java new file mode 100644 index 00000000..05f85092 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/controller/IndexController.java @@ -0,0 +1,17 @@ +package com.gitee.sop.websiteserver.controller; + +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; + +/** + * @author tanghc + */ +@Controller +public class IndexController { + + @RequestMapping("/") + public String index() { + return "redirect:index.html"; + } + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/controller/SandboxController.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/controller/SandboxController.java new file mode 100644 index 00000000..7afb7bd2 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/controller/SandboxController.java @@ -0,0 +1,208 @@ +package com.gitee.sop.websiteserver.controller; + +import com.gitee.sop.websiteserver.bean.HttpTool; +import com.gitee.sop.websiteserver.sign.AlipayApiException; +import com.gitee.sop.websiteserver.sign.AlipaySignature; +import com.gitee.sop.websiteserver.util.UploadUtil; +import lombok.Data; +import lombok.extern.slf4j.Slf4j; +import okhttp3.Headers; +import okhttp3.Response; +import okhttp3.ResponseBody; +import org.apache.commons.io.IOUtils; +import org.apache.commons.lang.StringUtils; +import org.apache.http.NameValuePair; +import org.apache.http.client.entity.UrlEncodedFormEntity; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.apache.http.message.BasicNameValuePair; +import org.apache.http.util.EntityUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.util.Assert; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.multipart.MultipartFile; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; + + +/** + * 沙箱环境代理类 + * @author tanghc + */ +@Slf4j +@RestController +@RequestMapping("sandbox") +public class SandboxController { + + @Value("${api.url-sandbox}") + private String url; + + static HttpTool httpTool = new HttpTool(); + + @RequestMapping("/test") + public SandboxResult proxy( + @RequestParam String appId + , @RequestParam String privateKey + , @RequestParam String method + , @RequestParam String version + , @RequestParam String bizContent + , @RequestParam(defaultValue = "get") String httpMethod + , @RequestParam(defaultValue = "false") boolean isDownloadRequest + , HttpServletRequest request + , HttpServletResponse response + ) throws AlipayApiException { + + Assert.isTrue(StringUtils.isNotBlank(appId), "AppId不能为空"); + Assert.isTrue(StringUtils.isNotBlank(privateKey), "PrivateKey不能为空"); + Assert.isTrue(StringUtils.isNotBlank(method), "method不能为空"); + + // 公共请求参数 + Map params = new HashMap(); + params.put("app_id", appId); + params.put("method", method); + params.put("format", "json"); + params.put("charset", "utf-8"); + params.put("sign_type", "RSA2"); + params.put("timestamp", new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date())); + params.put("version", version); + + // 业务参数 + params.put("biz_content", bizContent); + + SandboxResult result = new SandboxResult(); + + result.params = buildParamQuery(params); + + String content = AlipaySignature.getSignContent(params); + result.beforeSign = content; + + String sign = null; + try { + sign = AlipaySignature.rsa256Sign(content, privateKey, "utf-8"); + } catch (AlipayApiException e) { + throw new RuntimeException("构建签名失败"); + } + result.sign = sign; + + params.put("sign", sign); + + Collection uploadFiles = UploadUtil.getUploadFiles(request); + List files = uploadFiles.stream() + .map(multipartFile -> { + try { + return new HttpTool.UploadFile(multipartFile.getName(), multipartFile.getOriginalFilename(), multipartFile.getBytes()); + } catch (IOException e) { + log.error("封装文件失败", e); + return null; + } + }) + .filter(Objects::nonNull) + .collect(Collectors.toList()); + + try { + String responseData; + if (isDownloadRequest) { + Response resp = httpTool.requestForResponse(url, params, Collections.emptyMap(), HttpTool.HTTPMethod.GET); + Headers respHeaders = resp.headers(); + ResponseBody body = resp.body(); + if (body == null) { + return null; + } + respHeaders + .names() + .forEach(name -> response.setHeader(name, respHeaders.get(name))); + + IOUtils.copy(body.byteStream(), response.getOutputStream()); + response.flushBuffer(); + return null; + } else if (!CollectionUtils.isEmpty(files)) { + responseData = httpTool.requestFile(url, params, Collections.emptyMap(), files); + } else { + responseData = httpTool.request(url, params, Collections.emptyMap(), HttpTool.HTTPMethod.fromValue(httpMethod)); + } + result.apiResult = responseData; + return result; + } catch (Exception e) { + log.error("请求失败", e); + throw new RuntimeException("请求失败"); + } + } + + @Data + public static class SandboxResult { + private String params; + private String beforeSign; + private String sign; + + private String apiResult; + } + + + /** + * 发送get请求 + * @param url + * @return JSON或者字符串 + * @throws Exception + */ + public static String get(String url, Map params) { + CloseableHttpClient httpClient = null; + CloseableHttpResponse response = null; + try{ + httpClient = HttpClients.createDefault(); + List nameValuePairs = params.entrySet() + .stream() + .map(entry -> new BasicNameValuePair(entry.getKey(), String.valueOf(entry.getValue()))) + .collect(Collectors.toList()); + /** + * 包装成一个Entity对象 + */ + UrlEncodedFormEntity entity = new UrlEncodedFormEntity(nameValuePairs, "UTF-8"); + //参数转换为字符串 + String paramsStr = EntityUtils.toString(entity); + url = url + "?" + paramsStr; + /** + * 创建一个post对象 + */ + HttpGet get = new HttpGet(url); + + /** + * 执行post请求 + */ + response = httpClient.execute(get); + /** + * 通过EntityUitls获取返回内容 + */ + return EntityUtils.toString(response.getEntity(),"UTF-8"); + }catch (Exception e){ + e.printStackTrace(); + }finally { + IOUtils.closeQuietly(httpClient); + IOUtils.closeQuietly(response); + } + return null; + } + + protected String buildParamQuery(Map params) { + StringBuilder sb = new StringBuilder(); + for (Map.Entry entry : params.entrySet()) { + sb.append("&").append(entry.getKey()).append("=").append(entry.getValue()); + } + return sb.toString().substring(1); + } +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocDiscovery.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocDiscovery.java new file mode 100644 index 00000000..55d1a38b --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocDiscovery.java @@ -0,0 +1,116 @@ +package com.gitee.sop.websiteserver.manager; + +import com.alibaba.nacos.api.exception.NacosException; +import com.alibaba.nacos.api.naming.NamingService; +import com.alibaba.nacos.api.naming.pojo.Instance; +import com.alibaba.nacos.api.naming.pojo.ServiceInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.alibaba.nacos.NacosDiscoveryProperties; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.stereotype.Service; +import org.springframework.util.CollectionUtils; +import org.springframework.util.DigestUtils; +import org.springframework.web.client.DefaultResponseErrorHandler; +import org.springframework.web.client.RestTemplate; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; + +/** + * @author tanghc + */ +@Slf4j +@Service +public class DocDiscovery { + + private static final String SECRET = "b749a2ec000f4f29"; + + private static final int FIVE_SECONDS = 1000 * 5; + + @Autowired + private NacosDiscoveryProperties nacosDiscoveryProperties; + + private RestTemplate restTemplate = new RestTemplate(); + + private Map updateTimeMap = new HashMap<>(16); + + public DocDiscovery() { + // 解决statusCode不等于200,就抛异常问题 + restTemplate.setErrorHandler(new DefaultResponseErrorHandler() { + @Override + protected boolean hasError(HttpStatus statusCode) { + return statusCode == null; + } + }); + } + + public synchronized void refresh(DocManager docManager) { + NamingService namingService = nacosDiscoveryProperties.namingServiceInstance(); + List subscribes = null; + try { + subscribes = namingService.getSubscribeServices(); + } catch (NacosException e) { + log.error("namingService.getSubscribeServices()错误", e); + } + if (CollectionUtils.isEmpty(subscribes)) { + return; + } + // subscribe + String thisServiceId = nacosDiscoveryProperties.getService(); + for (ServiceInfo serviceInfo : subscribes) { + String serviceId = serviceInfo.getName(); + // 如果是本机服务,跳过 + if (Objects.equals(thisServiceId, serviceId) || "api-gateway".equalsIgnoreCase(serviceId)) { + continue; + } + // nacos会不停的触发事件,这里做了一层拦截 + // 同一个serviceId5秒内允许访问一次 + Long lastUpdateTime = updateTimeMap.getOrDefault(serviceId, 0L); + long now = System.currentTimeMillis(); + if (now - lastUpdateTime < FIVE_SECONDS) { + continue; + } + updateTimeMap.put(serviceId, now); + try { + List allInstances = namingService.getAllInstances(serviceId); + if (CollectionUtils.isEmpty(allInstances)) { + // 如果没有服务列表,则删除所有路由信息 + docManager.remove(serviceId); + } else { + for (Instance instance : allInstances) { + String url = getRouteRequestUrl(instance); + ResponseEntity responseEntity = restTemplate.getForEntity(url, String.class); + if (responseEntity.getStatusCode() == HttpStatus.OK) { + String body = responseEntity.getBody(); + docManager.addDocInfo( + serviceId + , body + , callback -> log.info("加载服务文档,serviceId={}, 机器={}" + , serviceId, instance.getIp() + ":" + instance.getPort()) + ); + } + } + } + } catch (NacosException e) { + log.error("选择服务实例失败,serviceId:{}", serviceId, e); + } + } + } + + private static String getRouteRequestUrl(Instance instance) { + String query = buildQuery(SECRET); + return "http://" + instance.getIp() + ":" + instance.getPort() + "/v2/api-docs" + query; + } + + private static String buildQuery(String secret) { + String time = String.valueOf(System.currentTimeMillis()); + String source = secret + time + secret; + String sign = DigestUtils.md5DigestAsHex(source.getBytes()); + return "?time=" + time + "&sign=" + sign; + } + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocManager.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocManager.java new file mode 100644 index 00000000..ddb5806d --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocManager.java @@ -0,0 +1,20 @@ +package com.gitee.sop.websiteserver.manager; + +import com.gitee.sop.websiteserver.bean.DocInfo; + +import java.util.Collection; +import java.util.function.Consumer; + +/** + * @author tanghc + */ +public interface DocManager { + + void addDocInfo(String serviceId, String docJson, Consumer callback); + + DocInfo getByTitle(String title); + + Collection listAll(); + + void remove(String serviceId); +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocManagerImpl.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocManagerImpl.java new file mode 100644 index 00000000..9d7e3114 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocManagerImpl.java @@ -0,0 +1,89 @@ +package com.gitee.sop.websiteserver.manager; + +import com.alibaba.fastjson.JSON; +import com.alibaba.fastjson.JSONObject; +import com.alibaba.fastjson.parser.Feature; +import com.gitee.sop.websiteserver.bean.DocInfo; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.cloud.client.discovery.event.HeartbeatEvent; +import org.springframework.context.ApplicationListener; +import org.springframework.stereotype.Service; +import org.springframework.util.DigestUtils; + +import java.nio.charset.StandardCharsets; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import java.util.function.Consumer; + +/** + * @author tanghc + */ +@Service +@Slf4j +public class DocManagerImpl implements DocManager, ApplicationListener { + + // key:title + private Map docDefinitionMap = new HashMap<>(); + + /** + * KEY:serviceId, value: md5 + */ + private Map serviceIdMd5Map = new HashMap<>(); + + private DocParser swaggerDocParser = new SwaggerDocParser(); + + private DocParser easyopenDocParser = new EasyopenDocParser(); + + @Autowired + private DocDiscovery docDiscovery; + + @Override + public void addDocInfo(String serviceId, String docInfoJson, Consumer callback) { + String newMd5 = DigestUtils.md5DigestAsHex(docInfoJson.getBytes(StandardCharsets.UTF_8)); + String oldMd5 = serviceIdMd5Map.get(serviceId); + if (Objects.equals(newMd5, oldMd5)) { + return; + } + serviceIdMd5Map.put(serviceId, newMd5); + JSONObject docRoot = JSON.parseObject(docInfoJson, Feature.OrderedField, Feature.DisableCircularReferenceDetect); + DocParser docParser = this.buildDocParser(docRoot); + DocInfo docInfo = docParser.parseJson(docRoot); + docInfo.setServiceId(serviceId); + docDefinitionMap.put(docInfo.getTitle(), docInfo); + callback.accept(docInfo); + } + + protected DocParser buildDocParser(JSONObject rootDoc) { + Object easyopen = rootDoc.get("easyopen"); + if (easyopen != null) { + return easyopenDocParser; + } else { + return swaggerDocParser; + } + } + + @Override + public DocInfo getByTitle(String title) { + return docDefinitionMap.get(title); + } + + @Override + public Collection listAll() { + return docDefinitionMap.values(); + } + + @Override + public void remove(String serviceId) { + serviceIdMd5Map.remove(serviceId); + docDefinitionMap.entrySet().removeIf(entry -> serviceId.equalsIgnoreCase(entry.getValue().getServiceId())); + } + + @Override + public void onApplicationEvent(HeartbeatEvent heartbeatEvent) { + docDiscovery.refresh(this); + } + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocParser.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocParser.java new file mode 100644 index 00000000..70a4c3f7 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/DocParser.java @@ -0,0 +1,11 @@ +package com.gitee.sop.websiteserver.manager; + +import com.alibaba.fastjson.JSONObject; +import com.gitee.sop.websiteserver.bean.DocInfo; + +/** + * @author tanghc + */ +public interface DocParser { + DocInfo parseJson(JSONObject docRoot); +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/EasyopenDocParser.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/EasyopenDocParser.java new file mode 100644 index 00000000..7745a603 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/EasyopenDocParser.java @@ -0,0 +1,83 @@ +package com.gitee.sop.websiteserver.manager; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gitee.sop.websiteserver.bean.DocInfo; +import com.gitee.sop.websiteserver.bean.DocItem; +import com.gitee.sop.websiteserver.bean.DocModule; +import com.gitee.sop.websiteserver.bean.DocParameter; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; + +/** + * @author tanghc + */ +public class EasyopenDocParser implements DocParser { + @Override + public DocInfo parseJson(JSONObject docRoot) { + String title = docRoot.getString("title"); + List docItems = new ArrayList<>(); + JSONArray apiModules = docRoot.getJSONArray("apiModules"); + for (int i = 0; i < apiModules.size(); i++) { + JSONObject module = apiModules.getJSONObject(i); + JSONArray moduleItems = module.getJSONArray("moduleItems"); + for (int k = 0; k < moduleItems.size(); k++) { + JSONObject docInfo = moduleItems.getJSONObject(k); + DocItem docItem = buildDocItem(docInfo); + docItem.setModule(module.getString("name")); + docItems.add(docItem); + } + } + + List docModuleList = docItems.stream() + .collect(Collectors.groupingBy(DocItem::getModule)) + .entrySet() + .stream() + .map(entry -> { + DocModule docModule = new DocModule(); + docModule.setModule(entry.getKey()); + docModule.setDocItems(entry.getValue()); + return docModule; + }) + .collect(Collectors.toList()); + + DocInfo docInfo = new DocInfo(); + docInfo.setTitle(title); + docInfo.setDocModuleList(docModuleList); + return docInfo; + } + + protected DocItem buildDocItem(JSONObject docInfo) { + DocItem docItem = new DocItem(); + docItem.setName(docInfo.getString("name")); + docItem.setVersion(docInfo.getString("version")); + docItem.setSummary(docInfo.getString("description")); + docItem.setDescription(docInfo.getString("description")); + List docParameterList = this.buildParameterList(docInfo, "paramDefinitions"); + docItem.setRequestParameters(docParameterList); + + List responseParameterList = this.buildParameterList(docInfo, "resultDefinitions"); + docItem.setResponseParameters(responseParameterList); + + return docItem; + } + + protected List buildParameterList(JSONObject docInfo, String key) { + JSONArray params = docInfo.getJSONArray(key); + if (params == null) { + return Collections.emptyList(); + } + List docParameterList = new ArrayList<>(); + for (int i = 0; i < params.size(); i++) { + JSONObject jsonObject = params.getJSONObject(i); + DocParameter docParameter = jsonObject.toJavaObject(DocParameter.class); + docParameter.setType(jsonObject.getString("dataType")); + docParameterList.add(docParameter); + } + return docParameterList; + } + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/SwaggerDocParser.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/SwaggerDocParser.java new file mode 100644 index 00000000..ae83b3ab --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/manager/SwaggerDocParser.java @@ -0,0 +1,290 @@ +package com.gitee.sop.websiteserver.manager; + +import com.alibaba.fastjson.JSONArray; +import com.alibaba.fastjson.JSONObject; +import com.gitee.sop.websiteserver.bean.DocInfo; +import com.gitee.sop.websiteserver.bean.DocItem; +import com.gitee.sop.websiteserver.bean.DocModule; +import com.gitee.sop.websiteserver.bean.DocParameter; +import com.gitee.sop.websiteserver.bean.DocParserContext; +import com.google.common.collect.Sets; +import org.apache.commons.lang3.math.NumberUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.util.CollectionUtils; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.stream.Collectors; + +/** + * 解析swagger的json内容 + * + * @author tanghc + */ +public class SwaggerDocParser implements DocParser { + @Override + public DocInfo parseJson(JSONObject docRoot) { + String title = docRoot.getJSONObject("info").getString("title"); + List docItems = new ArrayList<>(); + + JSONObject paths = docRoot.getJSONObject("paths"); + Set pathNameSet = paths.keySet(); + for (String apiPath : pathNameSet) { + JSONObject pathInfo = paths.getJSONObject(apiPath); + // key: get,post,head... + Collection httpMethodList = getHttpMethods(pathInfo); + Optional first = httpMethodList.stream().findFirst(); + if (first.isPresent()) { + String method = first.get(); + JSONObject docInfo = pathInfo.getJSONObject(method); + DocItem docItem = buildDocItem(docInfo, docRoot); + if (docItem.isUploadRequest()) { + docItem.setHttpMethodList(Sets.newHashSet("post")); + } else { + docItem.setHttpMethodList(httpMethodList); + } + docItems.add(docItem); + } + } + + List docModuleList = docItems.stream() + .collect(Collectors.groupingBy(DocItem::getModule)) + .entrySet() + .stream() + .map(entry -> { + List docItemList = entry.getValue(); + DocModule docModule = new DocModule(); + docModule.setModule(entry.getKey()); + docModule.setDocItems(docItemList); + docModule.setOrder(getMuduleOrder(docItemList)); + return docModule; + }).sorted(Comparator.comparing(DocModule::getOrder)) + .collect(Collectors.toList()); + + DocInfo docInfo = new DocInfo(); + docInfo.setTitle(title); + docInfo.setDocModuleList(docModuleList); + return docInfo; + } + + private int getMuduleOrder(List items) { + if (CollectionUtils.isEmpty(items)) { + return Integer.MAX_VALUE; + } + List docItemList = new ArrayList<>(items); + docItemList.sort(Comparator.comparing(DocItem::getModuleOrder)); + return docItemList.get(0).getModuleOrder(); + } + + protected Collection getHttpMethods(JSONObject pathInfo) { + // key: get,post,head... + List retList; + Set httpMethodList = pathInfo.keySet(); + if (httpMethodList.size() <= 2) { + retList = new ArrayList<>(httpMethodList); + } else { + Set ignoreHttpMethods = DocParserContext.ignoreHttpMethods; + retList = httpMethodList.stream() + .filter(method -> !ignoreHttpMethods.contains(method.toLowerCase())) + .collect(Collectors.toList()); + } + Collections.sort(retList); + return retList; + } + + protected DocItem buildDocItem(JSONObject docInfo, JSONObject docRoot) { + DocItem docItem = new DocItem(); + docItem.setName(docInfo.getString("sop_name")); + docItem.setVersion(docInfo.getString("sop_version")); + docItem.setSummary(docInfo.getString("summary")); + docItem.setDescription(docInfo.getString("description")); + docItem.setMultiple(docInfo.getString("multiple") != null); + docItem.setProduces(docInfo.getJSONArray("produces").toJavaList(String.class)); + docItem.setModuleOrder(NumberUtils.toInt(docInfo.getString("module_order"), 0)); + String moduleName = this.buildModuleName(docInfo, docRoot); + docItem.setModule(moduleName); + List docParameterList = this.buildRequestParameterList(docInfo, docRoot); + docItem.setRequestParameters(docParameterList); + + List responseParameterList = this.buildResponseParameterList(docInfo, docRoot); + docItem.setResponseParameters(responseParameterList); + + return docItem; + } + + protected String buildModuleName(JSONObject docInfo, JSONObject docRoot) { + String title = docRoot.getJSONObject("info").getString("title"); + JSONArray tags = docInfo.getJSONArray("tags"); + if (tags != null && tags.size() > 0) { + return tags.getString(0); + } + return title; + } + + protected List buildRequestParameterList(JSONObject docInfo, JSONObject docRoot) { + Optional parametersOptional = Optional.ofNullable(docInfo.getJSONArray("parameters")); + JSONArray parameters = parametersOptional.orElse(new JSONArray()); + List docParameterList = new ArrayList<>(); + for (int i = 0; i < parameters.size(); i++) { + JSONObject fieldJson = parameters.getJSONObject(i); + DocParameter docParameter = fieldJson.toJavaObject(DocParameter.class); + docParameterList.add(docParameter); + } + + Map> collect = docParameterList.stream() + .filter(docParameter -> docParameter.getName().contains(".")) + .map(docParameter -> { + String name = docParameter.getName(); + int index = name.indexOf('.'); + String module = name.substring(0, index); + String newName = name.substring(index + 1); + DocParameter ret = new DocParameter(); + BeanUtils.copyProperties(docParameter, ret); + ret.setName(newName); + ret.setModule(module); + return ret; + }) + .collect(Collectors.groupingBy(DocParameter::getModule)); + + collect.forEach((key, value) -> { + DocParameter moduleDoc = new DocParameter(); + moduleDoc.setName(key); + moduleDoc.setType("object"); + moduleDoc.setRefs(value); + docParameterList.add(moduleDoc); + }); + + return docParameterList.stream() + .filter(docParameter -> !docParameter.getName().contains(".")) + .collect(Collectors.toList()); + } + + protected List buildResponseParameterList(JSONObject docInfo, JSONObject docRoot) { + RefInfo refInfo = getResponseRefInfo(docInfo); + List respParameterList = Collections.emptyList(); + if (refInfo != null) { + String responseRef = refInfo.ref; + respParameterList = this.buildDocParameters(responseRef, docRoot); + // 如果返回数组 + if (refInfo.isArray) { + DocParameter docParameter = new DocParameter(); + docParameter.setName("items"); + docParameter.setType("array"); + docParameter.setRefs(respParameterList); + respParameterList = Collections.singletonList(docParameter); + } + } + return respParameterList; + } + + protected List buildDocParameters(String ref, JSONObject docRoot) { + JSONObject responseObject = docRoot.getJSONObject("definitions").getJSONObject(ref); + JSONObject properties = responseObject.getJSONObject("properties"); + Set fieldNames = properties.keySet(); + List docParameterList = new ArrayList<>(); + for (String fieldName : fieldNames) { + /* + { + "description": "分类故事", + "$ref": "#/definitions/StoryVO" + } + */ + JSONObject fieldInfo = properties.getJSONObject(fieldName); + DocParameter docParameter = fieldInfo.toJavaObject(DocParameter.class); + docParameter.setName(fieldName); + docParameterList.add(docParameter); + RefInfo refInfo = this.getRefInfo(fieldInfo); + if (refInfo != null) { + List refs = buildDocParameters(refInfo.ref, docRoot); + docParameter.setRefs(refs); + } + } + return docParameterList; + } + + + /** + * 简单对象返回: + * "responses": { + * "200": { + * "description": "OK", + * "schema": { + * "$ref": "#/definitions/FileUploadVO" + * } + * }, + * "401": { + * "description": "Unauthorized" + * }, + * "403": { + * "description": "Forbidden" + * }, + * "404": { + * "description": "Not Found" + * } + * } + * 纯数组返回: + * "responses": { + * "200": { + * "description": "OK", + * "schema": { + * "type": "array", + * "items": { + * "$ref": "#/definitions/StoryVO" + * } + * } + * }, + * "401": { + * "description": "Unauthorized" + * }, + * "403": { + * "description": "Forbidden" + * }, + * "404": { + * "description": "Not Found" + * } + * } + * @param docInfo + * @return + */ + protected RefInfo getResponseRefInfo(JSONObject docInfo) { + return Optional.ofNullable(docInfo.getJSONObject("responses")) + .flatMap(jsonObject -> Optional.ofNullable(jsonObject.getJSONObject("200"))) + .flatMap(jsonObject -> Optional.ofNullable(jsonObject.getJSONObject("schema"))) + .map(this::getRefInfo) + .orElse(null); + } + + private RefInfo getRefInfo(JSONObject jsonObject) { + String ref; + boolean isArray = "array".equals(jsonObject.getString("type")); + if (isArray) { + ref = jsonObject.getJSONObject("items").getString("$ref"); + } else { + // #/definitions/Category + ref = jsonObject.getString("$ref"); + } + if (ref == null) { + return null; + } + int index = ref.lastIndexOf("/"); + if (index > -1) { + ref = ref.substring(index + 1); + } + RefInfo refInfo = new RefInfo(); + refInfo.isArray = isArray; + refInfo.ref = ref; + return refInfo; + } + + private static class RefInfo { + private boolean isArray; + private String ref; + } + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/AlipayApiException.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/AlipayApiException.java new file mode 100644 index 00000000..a6079c53 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/AlipayApiException.java @@ -0,0 +1,49 @@ +/** + * Alipay.com Inc. + * Copyright (c) 2004-2012 All Rights Reserved. + */ +package com.gitee.sop.websiteserver.sign; + + +/** + * + * @author runzhi + */ +public class AlipayApiException extends Exception { + + private static final long serialVersionUID = -238091758285157331L; + + private String errCode; + private String errMsg; + + public AlipayApiException() { + super(); + } + + public AlipayApiException(String message, Throwable cause) { + super(message, cause); + } + + public AlipayApiException(String message) { + super(message); + } + + public AlipayApiException(Throwable cause) { + super(cause); + } + + public AlipayApiException(String errCode, String errMsg) { + super(errCode + ":" + errMsg); + this.errCode = errCode; + this.errMsg = errMsg; + } + + public String getErrCode() { + return this.errCode; + } + + public String getErrMsg() { + return this.errMsg; + } + +} \ No newline at end of file diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/AlipayConstants.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/AlipayConstants.java new file mode 100644 index 00000000..9efd0794 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/AlipayConstants.java @@ -0,0 +1,97 @@ +/** + * Alipay.com Inc. + * Copyright (c) 2004-2012 All Rights Reserved. + */ +package com.gitee.sop.websiteserver.sign; + +/** + * + * @author runzhi + */ +public class AlipayConstants { + + public static final String SIGN_TYPE = "sign_type"; + + public static final String SIGN_TYPE_RSA = "RSA"; + + /** + * sha256WithRsa 算法请求类型 + */ + public static final String SIGN_TYPE_RSA2 = "RSA2"; + + public static final String SIGN_ALGORITHMS = "SHA1WithRSA"; + + public static final String SIGN_SHA256RSA_ALGORITHMS = "SHA256WithRSA"; + + public static final String ENCRYPT_TYPE_AES = "AES"; + + public static final String APP_ID = "app_id"; + + public static final String FORMAT = "format"; + + public static final String METHOD = "method"; + + public static final String TIMESTAMP = "timestamp"; + + public static final String VERSION = "version"; + + public static final String SIGN = "sign"; + + public static final String ALIPAY_SDK = "alipay_sdk"; + + public static final String ACCESS_TOKEN = "auth_token"; + + public static final String APP_AUTH_TOKEN = "app_auth_token"; + + public static final String TERMINAL_TYPE = "terminal_type"; + + public static final String TERMINAL_INFO = "terminal_info"; + + public static final String CHARSET = "charset"; + + public static final String NOTIFY_URL = "notify_url"; + + public static final String RETURN_URL = "return_url"; + + public static final String ENCRYPT_TYPE = "encrypt_type"; + + //-----===-------/// + + public static final String BIZ_CONTENT_KEY = "biz_content"; + + /** 默认时间格式 **/ + public static final String DATE_TIME_FORMAT = "yyyy-MM-dd HH:mm:ss"; + + /** Date默认时区 **/ + public static final String DATE_TIMEZONE = "GMT+8"; + + /** UTF-8字符集 **/ + public static final String CHARSET_UTF8 = "UTF-8"; + + /** GBK字符集 **/ + public static final String CHARSET_GBK = "GBK"; + + /** JSON 应格式 */ + public static final String FORMAT_JSON = "json"; + + /** XML 应格式 */ + public static final String FORMAT_XML = "xml"; + + /** SDK版本号 */ + public static final String SDK_VERSION = "alipay-sdk-java-3.6.0.ALL"; + + public static final String PROD_CODE = "prod_code"; + + /** 老版本失败节点 */ + public static final String ERROR_RESPONSE = "error_response"; + + /** 新版本节点后缀 */ + public static final String RESPONSE_SUFFIX = "_response"; + + /** 加密后XML返回报文的节点名字 */ + public static final String RESPONSE_XML_ENCRYPT_NODE_NAME = "response_encrypted"; + + /** 批量请求id **/ + public static final String BATCH_REQUEST_ID = "batch_request_id"; + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/AlipaySignature.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/AlipaySignature.java new file mode 100644 index 00000000..c02240af --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/AlipaySignature.java @@ -0,0 +1,611 @@ +/** + * Alipay.com Inc. + * Copyright (c) 2004-2012 All Rights Reserved. + */ +package com.gitee.sop.websiteserver.sign; + + +import org.apache.commons.codec.binary.Base64; + +import javax.crypto.Cipher; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.StringWriter; +import java.security.KeyFactory; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.PKCS8EncodedKeySpec; +import java.security.spec.X509EncodedKeySpec; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * + * @author runzhi + */ +public class AlipaySignature { + + /** RSA最大加密明文大小 */ + private static final int MAX_ENCRYPT_BLOCK = 117; + + /** RSA最大解密密文大小 */ + private static final int MAX_DECRYPT_BLOCK = 128; + + + + /** + * + * @param sortedParams + * @return + */ + public static String getSignContent(Map sortedParams) { + StringBuffer content = new StringBuffer(); + List keys = new ArrayList(sortedParams.keySet()); + Collections.sort(keys); + int index = 0; + for (int i = 0; i < keys.size(); i++) { + String key = keys.get(i); + String value = sortedParams.get(key); + if (StringUtils.areNotEmpty(key, value)) { + content.append((index == 0 ? "" : "&") + key + "=" + value); + index++; + } + } + return content.toString(); + } + + /** + * rsa内容签名 + * + * @param content + * @param privateKey + * @param charset + * @return + * @throws AlipayApiException + */ + public static String rsaSign(String content, String privateKey, String charset, + String signType) throws AlipayApiException { + + if (AlipayConstants.SIGN_TYPE_RSA.equals(signType)) { + + return rsaSign(content, privateKey, charset); + } else if (AlipayConstants.SIGN_TYPE_RSA2.equals(signType)) { + + return rsa256Sign(content, privateKey, charset); + } else { + + throw new AlipayApiException("Sign Type is Not Support : signType=" + signType); + } + + } + + /** + * sha256WithRsa 加签 + * + * @param content + * @param privateKey + * @param charset + * @return + * @throws AlipayApiException + */ + public static String rsa256Sign(String content, String privateKey, + String charset) throws AlipayApiException { + + try { + PrivateKey priKey = getPrivateKeyFromPKCS8(AlipayConstants.SIGN_TYPE_RSA, + new ByteArrayInputStream(privateKey.getBytes())); + + java.security.Signature signature = java.security.Signature + .getInstance(AlipayConstants.SIGN_SHA256RSA_ALGORITHMS); + + signature.initSign(priKey); + + if (StringUtils.isEmpty(charset)) { + signature.update(content.getBytes()); + } else { + signature.update(content.getBytes(charset)); + } + + byte[] signed = signature.sign(); + + return new String(Base64.encodeBase64(signed)); + } catch (Exception e) { + throw new AlipayApiException("RSAcontent = " + content + "; charset = " + charset, e); + } + + } + + /** + * sha1WithRsa 加签 + * + * @param content + * @param privateKey + * @param charset + * @return + * @throws AlipayApiException + */ + public static String rsaSign(String content, String privateKey, + String charset) throws AlipayApiException { + try { + PrivateKey priKey = getPrivateKeyFromPKCS8(AlipayConstants.SIGN_TYPE_RSA, + new ByteArrayInputStream(privateKey.getBytes())); + + java.security.Signature signature = java.security.Signature + .getInstance(AlipayConstants.SIGN_ALGORITHMS); + + signature.initSign(priKey); + + if (StringUtils.isEmpty(charset)) { + signature.update(content.getBytes()); + } else { + signature.update(content.getBytes(charset)); + } + + byte[] signed = signature.sign(); + + return new String(Base64.encodeBase64(signed)); + } catch (InvalidKeySpecException ie) { + throw new AlipayApiException("RSA私钥格式不正确,请检查是否正确配置了PKCS8格式的私钥", ie); + } catch (Exception e) { + throw new AlipayApiException("RSAcontent = " + content + "; charset = " + charset, e); + } + } + + public static String rsaSign(Map params, String privateKey, + String charset) throws AlipayApiException { + String signContent = getSignContent(params); + + return rsaSign(signContent, privateKey, charset); + + } + + public static PrivateKey getPrivateKeyFromPKCS8(String algorithm, + InputStream ins) throws Exception { + if (ins == null || StringUtils.isEmpty(algorithm)) { + return null; + } + + KeyFactory keyFactory = KeyFactory.getInstance(algorithm); + + byte[] encodedKey = StreamUtil.readText(ins).getBytes(); + + encodedKey = Base64.decodeBase64(encodedKey); + + return keyFactory.generatePrivate(new PKCS8EncodedKeySpec(encodedKey)); + } + + public static String getSignCheckContentV1(Map params) { + if (params == null) { + return null; + } + + params.remove("sign"); + params.remove("sign_type"); + + StringBuffer content = new StringBuffer(); + List keys = new ArrayList(params.keySet()); + Collections.sort(keys); + + for (int i = 0; i < keys.size(); i++) { + String key = keys.get(i); + String value = params.get(key); + content.append((i == 0 ? "" : "&") + key + "=" + value); + } + + return content.toString(); + } + + public static String getSignCheckContentV2(Map params) { + if (params == null) { + return null; + } + + params.remove("sign"); + + StringBuffer content = new StringBuffer(); + List keys = new ArrayList(params.keySet()); + Collections.sort(keys); + + for (int i = 0; i < keys.size(); i++) { + String key = keys.get(i); + String value = params.get(key); + content.append((i == 0 ? "" : "&") + key + "=" + value); + } + + return content.toString(); + } + + public static boolean rsaCheckV1(Map params, String publicKey, + String charset) throws AlipayApiException { + String sign = params.get("sign"); + String content = getSignCheckContentV1(params); + + return rsaCheckContent(content, sign, publicKey, charset); + } + + public static boolean rsaCheckV1(Map params, String publicKey, + String charset,String signType) throws AlipayApiException { + String sign = params.get("sign"); + String content = getSignCheckContentV1(params); + + return rsaCheck(content, sign, publicKey, charset,signType); + } + + public static boolean rsaCheckV2(Map params, String publicKey, + String charset) throws AlipayApiException { + String sign = params.get("sign"); + String content = getSignCheckContentV2(params); + + return rsaCheckContent(content, sign, publicKey, charset); + } + + public static boolean rsaCheckV2(Map params, String publicKey, + String charset,String signType) throws AlipayApiException { + String sign = params.get("sign"); + String content = getSignCheckContentV2(params); + + return rsaCheck(content, sign, publicKey, charset,signType); + } + + public static boolean rsaCheck(String content, String sign, String publicKey, String charset, + String signType) throws AlipayApiException { + + if (AlipayConstants.SIGN_TYPE_RSA.equals(signType)) { + + return rsaCheckContent(content, sign, publicKey, charset); + + } else if (AlipayConstants.SIGN_TYPE_RSA2.equals(signType)) { + + return rsa256CheckContent(content, sign, publicKey, charset); + + } else { + + throw new AlipayApiException("Sign Type is Not Support : signType=" + signType); + } + + } + + public static boolean rsa256CheckContent(String content, String sign, String publicKey, + String charset) throws AlipayApiException { + try { + PublicKey pubKey = getPublicKeyFromX509("RSA", + new ByteArrayInputStream(publicKey.getBytes())); + + java.security.Signature signature = java.security.Signature + .getInstance(AlipayConstants.SIGN_SHA256RSA_ALGORITHMS); + + signature.initVerify(pubKey); + + if (StringUtils.isEmpty(charset)) { + signature.update(content.getBytes()); + } else { + signature.update(content.getBytes(charset)); + } + + return signature.verify(Base64.decodeBase64(sign.getBytes())); + } catch (Exception e) { + throw new AlipayApiException( + "RSAcontent = " + content + ",sign=" + sign + ",charset = " + charset, e); + } + } + + public static boolean rsaCheckContent(String content, String sign, String publicKey, + String charset) throws AlipayApiException { + try { + PublicKey pubKey = getPublicKeyFromX509("RSA", + new ByteArrayInputStream(publicKey.getBytes())); + + java.security.Signature signature = java.security.Signature + .getInstance(AlipayConstants.SIGN_ALGORITHMS); + + signature.initVerify(pubKey); + + if (StringUtils.isEmpty(charset)) { + signature.update(content.getBytes()); + } else { + signature.update(content.getBytes(charset)); + } + + return signature.verify(Base64.decodeBase64(sign.getBytes())); + } catch (Exception e) { + throw new AlipayApiException( + "RSAcontent = " + content + ",sign=" + sign + ",charset = " + charset, e); + } + } + + public static PublicKey getPublicKeyFromX509(String algorithm, + InputStream ins) throws Exception { + KeyFactory keyFactory = KeyFactory.getInstance(algorithm); + + StringWriter writer = new StringWriter(); + StreamUtil.io(new InputStreamReader(ins), writer); + + byte[] encodedKey = writer.toString().getBytes(); + + encodedKey = Base64.decodeBase64(encodedKey); + + return keyFactory.generatePublic(new X509EncodedKeySpec(encodedKey)); + } + + /** + * 验签并解密 + *

+ * 目前适用于公众号
+ * params参数示例: + *
{ + *
biz_content=M0qGiGz+8kIpxe8aF4geWJdBn0aBTuJRQItLHo9R7o5JGhpic/MIUjvXo2BLB++BbkSq2OsJCEQFDZ0zK5AJYwvBgeRX30gvEj6eXqXRt16/IkB9HzAccEqKmRHrZJ7PjQWE0KfvDAHsJqFIeMvEYk1Zei2QkwSQPlso7K0oheo/iT+HYE8aTATnkqD/ByD9iNDtGg38pCa2xnnns63abKsKoV8h0DfHWgPH62urGY7Pye3r9FCOXA2Ykm8X4/Bl1bWFN/PFCEJHWe/HXj8KJKjWMO6ttsoV0xRGfeyUO8agu6t587Dl5ux5zD/s8Lbg5QXygaOwo3Fz1G8EqmGhi4+soEIQb8DBYanQOS3X+m46tVqBGMw8Oe+hsyIMpsjwF4HaPKMr37zpW3fe7xOMuimbZ0wq53YP/jhQv6XWodjT3mL0H5ACqcsSn727B5ztquzCPiwrqyjUHjJQQefFTzOse8snaWNQTUsQS7aLsHq0FveGpSBYORyA90qPdiTjXIkVP7mAiYiAIWW9pCEC7F3XtViKTZ8FRMM9ySicfuAlf3jtap6v2KPMtQv70X+hlmzO/IXB6W0Ep8DovkF5rB4r/BJYJLw/6AS0LZM9w5JfnAZhfGM2rKzpfNsgpOgEZS1WleG4I2hoQC0nxg9IcP0Hs+nWIPkEUcYNaiXqeBc=, + *
sign=rlqgA8O+RzHBVYLyHmrbODVSANWPXf3pSrr82OCO/bm3upZiXSYrX5fZr6UBmG6BZRAydEyTIguEW6VRuAKjnaO/sOiR9BsSrOdXbD5Rhos/Xt7/mGUWbTOt/F+3W0/XLuDNmuYg1yIC/6hzkg44kgtdSTsQbOC9gWM7ayB4J4c=, + * sign_type=RSA, + *
charset=UTF-8 + *
} + *

+ * @param params + * @param alipayPublicKey 支付宝公钥 + * @param cusPrivateKey 商户私钥 + * @param isCheckSign 是否验签 + * @param isDecrypt 是否解密 + * @return 解密后明文,验签失败则异常抛出 + * @throws AlipayApiException + */ + public static String checkSignAndDecrypt(Map params, String alipayPublicKey, + String cusPrivateKey, boolean isCheckSign, + boolean isDecrypt) throws AlipayApiException { + String charset = params.get("charset"); + String bizContent = params.get("biz_content"); + if (isCheckSign) { + if (!rsaCheckV2(params, alipayPublicKey, charset)) { + throw new AlipayApiException("rsaCheck failure:rsaParams=" + params); + } + } + + if (isDecrypt) { + return rsaDecrypt(bizContent, cusPrivateKey, charset); + } + + return bizContent; + } + + /** + * 验签并解密 + *

+ * 目前适用于公众号
+ * params参数示例: + *
{ + *
biz_content=M0qGiGz+8kIpxe8aF4geWJdBn0aBTuJRQItLHo9R7o5JGhpic/MIUjvXo2BLB++BbkSq2OsJCEQFDZ0zK5AJYwvBgeRX30gvEj6eXqXRt16/IkB9HzAccEqKmRHrZJ7PjQWE0KfvDAHsJqFIeMvEYk1Zei2QkwSQPlso7K0oheo/iT+HYE8aTATnkqD/ByD9iNDtGg38pCa2xnnns63abKsKoV8h0DfHWgPH62urGY7Pye3r9FCOXA2Ykm8X4/Bl1bWFN/PFCEJHWe/HXj8KJKjWMO6ttsoV0xRGfeyUO8agu6t587Dl5ux5zD/s8Lbg5QXygaOwo3Fz1G8EqmGhi4+soEIQb8DBYanQOS3X+m46tVqBGMw8Oe+hsyIMpsjwF4HaPKMr37zpW3fe7xOMuimbZ0wq53YP/jhQv6XWodjT3mL0H5ACqcsSn727B5ztquzCPiwrqyjUHjJQQefFTzOse8snaWNQTUsQS7aLsHq0FveGpSBYORyA90qPdiTjXIkVP7mAiYiAIWW9pCEC7F3XtViKTZ8FRMM9ySicfuAlf3jtap6v2KPMtQv70X+hlmzO/IXB6W0Ep8DovkF5rB4r/BJYJLw/6AS0LZM9w5JfnAZhfGM2rKzpfNsgpOgEZS1WleG4I2hoQC0nxg9IcP0Hs+nWIPkEUcYNaiXqeBc=, + *
sign=rlqgA8O+RzHBVYLyHmrbODVSANWPXf3pSrr82OCO/bm3upZiXSYrX5fZr6UBmG6BZRAydEyTIguEW6VRuAKjnaO/sOiR9BsSrOdXbD5Rhos/Xt7/mGUWbTOt/F+3W0/XLuDNmuYg1yIC/6hzkg44kgtdSTsQbOC9gWM7ayB4J4c=, + * sign_type=RSA, + *
charset=UTF-8 + *
} + *

+ * @param params + * @param alipayPublicKey 支付宝公钥 + * @param cusPrivateKey 商户私钥 + * @param isCheckSign 是否验签 + * @param isDecrypt 是否解密 + * @return 解密后明文,验签失败则异常抛出 + * @throws AlipayApiException + */ + public static String checkSignAndDecrypt(Map params, String alipayPublicKey, + String cusPrivateKey, boolean isCheckSign, + boolean isDecrypt, String signType) throws AlipayApiException { + String charset = params.get("charset"); + String bizContent = params.get("biz_content"); + if (isCheckSign) { + if (!rsaCheckV2(params, alipayPublicKey, charset,signType)) { + throw new AlipayApiException("rsaCheck failure:rsaParams=" + params); + } + } + + if (isDecrypt) { + return rsaDecrypt(bizContent, cusPrivateKey, charset); + } + + return bizContent; + } + + /** + * 加密并签名
+ * 目前适用于公众号 + * @param bizContent 待加密、签名内容 + * @param alipayPublicKey 支付宝公钥 + * @param cusPrivateKey 商户私钥 + * @param charset 字符集,如UTF-8, GBK, GB2312 + * @param isEncrypt 是否加密,true-加密 false-不加密 + * @param isSign 是否签名,true-签名 false-不签名 + * @return 加密、签名后xml内容字符串 + *

+ * 返回示例: + * + * 密文 + * RSA + * sign + * RSA + * + *

+ * @throws AlipayApiException + */ + public static String encryptAndSign(String bizContent, String alipayPublicKey, + String cusPrivateKey, String charset, boolean isEncrypt, + boolean isSign) throws AlipayApiException { + StringBuilder sb = new StringBuilder(); + if (StringUtils.isEmpty(charset)) { + charset = AlipayConstants.CHARSET_GBK; + } + sb.append(""); + if (isEncrypt) {// 加密 + sb.append(""); + String encrypted = rsaEncrypt(bizContent, alipayPublicKey, charset); + sb.append("" + encrypted + ""); + sb.append("RSA"); + if (isSign) { + String sign = rsaSign(encrypted, cusPrivateKey, charset); + sb.append("" + sign + ""); + sb.append("RSA"); + } + sb.append(""); + } else if (isSign) {// 不加密,但需要签名 + sb.append(""); + sb.append("" + bizContent + ""); + String sign = rsaSign(bizContent, cusPrivateKey, charset); + sb.append("" + sign + ""); + sb.append("RSA"); + sb.append(""); + } else {// 不加密,不加签 + sb.append(bizContent); + } + return sb.toString(); + } + + /** + * 加密并签名
+ * 目前适用于公众号 + * @param bizContent 待加密、签名内容 + * @param alipayPublicKey 支付宝公钥 + * @param cusPrivateKey 商户私钥 + * @param charset 字符集,如UTF-8, GBK, GB2312 + * @param isEncrypt 是否加密,true-加密 false-不加密 + * @param isSign 是否签名,true-签名 false-不签名 + * @return 加密、签名后xml内容字符串 + *

+ * 返回示例: + * + * 密文 + * RSA + * sign + * RSA + * + *

+ * @throws AlipayApiException + */ + public static String encryptAndSign(String bizContent, String alipayPublicKey, + String cusPrivateKey, String charset, boolean isEncrypt, + boolean isSign,String signType) throws AlipayApiException { + StringBuilder sb = new StringBuilder(); + if (StringUtils.isEmpty(charset)) { + charset = AlipayConstants.CHARSET_GBK; + } + sb.append(""); + if (isEncrypt) {// 加密 + sb.append(""); + String encrypted = rsaEncrypt(bizContent, alipayPublicKey, charset); + sb.append("" + encrypted + ""); + sb.append("RSA"); + if (isSign) { + String sign = rsaSign(encrypted, cusPrivateKey, charset, signType); + sb.append("" + sign + ""); + sb.append(""); + sb.append(signType); + sb.append(""); + } + sb.append(""); + } else if (isSign) {// 不加密,但需要签名 + sb.append(""); + sb.append("" + bizContent + ""); + String sign = rsaSign(bizContent, cusPrivateKey, charset, signType); + sb.append("" + sign + ""); + sb.append(""); + sb.append(signType); + sb.append(""); + sb.append(""); + } else {// 不加密,不加签 + sb.append(bizContent); + } + return sb.toString(); + } + + /** + * 公钥加密 + * + * @param content 待加密内容 + * @param publicKey 公钥 + * @param charset 字符集,如UTF-8, GBK, GB2312 + * @return 密文内容 + * @throws AlipayApiException + */ + public static String rsaEncrypt(String content, String publicKey, + String charset) throws AlipayApiException { + try { + PublicKey pubKey = getPublicKeyFromX509(AlipayConstants.SIGN_TYPE_RSA, + new ByteArrayInputStream(publicKey.getBytes())); + Cipher cipher = Cipher.getInstance(AlipayConstants.SIGN_TYPE_RSA); + cipher.init(Cipher.ENCRYPT_MODE, pubKey); + byte[] data = StringUtils.isEmpty(charset) ? content.getBytes() + : content.getBytes(charset); + int inputLen = data.length; + ByteArrayOutputStream out = new ByteArrayOutputStream(); + int offSet = 0; + byte[] cache; + int i = 0; + // 对数据分段加密 + while (inputLen - offSet > 0) { + if (inputLen - offSet > MAX_ENCRYPT_BLOCK) { + cache = cipher.doFinal(data, offSet, MAX_ENCRYPT_BLOCK); + } else { + cache = cipher.doFinal(data, offSet, inputLen - offSet); + } + out.write(cache, 0, cache.length); + i++; + offSet = i * MAX_ENCRYPT_BLOCK; + } + byte[] encryptedData = Base64.encodeBase64(out.toByteArray()); + out.close(); + + return StringUtils.isEmpty(charset) ? new String(encryptedData) + : new String(encryptedData, charset); + } catch (Exception e) { + throw new AlipayApiException("EncryptContent = " + content + ",charset = " + charset, + e); + } + } + + /** + * 私钥解密 + * + * @param content 待解密内容 + * @param privateKey 私钥 + * @param charset 字符集,如UTF-8, GBK, GB2312 + * @return 明文内容 + * @throws AlipayApiException + */ + public static String rsaDecrypt(String content, String privateKey, + String charset) throws AlipayApiException { + try { + PrivateKey priKey = getPrivateKeyFromPKCS8(AlipayConstants.SIGN_TYPE_RSA, + new ByteArrayInputStream(privateKey.getBytes())); + Cipher cipher = Cipher.getInstance(AlipayConstants.SIGN_TYPE_RSA); + cipher.init(Cipher.DECRYPT_MODE, priKey); + byte[] encryptedData = StringUtils.isEmpty(charset) + ? Base64.decodeBase64(content.getBytes()) + : Base64.decodeBase64(content.getBytes(charset)); + int inputLen = encryptedData.length; + ByteArrayOutputStream out = new ByteArrayOutputStream(); + int offSet = 0; + byte[] cache; + int i = 0; + // 对数据分段解密 + while (inputLen - offSet > 0) { + if (inputLen - offSet > MAX_DECRYPT_BLOCK) { + cache = cipher.doFinal(encryptedData, offSet, MAX_DECRYPT_BLOCK); + } else { + cache = cipher.doFinal(encryptedData, offSet, inputLen - offSet); + } + out.write(cache, 0, cache.length); + i++; + offSet = i * MAX_DECRYPT_BLOCK; + } + byte[] decryptedData = out.toByteArray(); + out.close(); + + return StringUtils.isEmpty(charset) ? new String(decryptedData) + : new String(decryptedData, charset); + } catch (Exception e) { + throw new AlipayApiException("EncodeContent = " + content + ",charset = " + charset, e); + } + } + +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/StreamUtil.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/StreamUtil.java new file mode 100644 index 00000000..437a8441 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/StreamUtil.java @@ -0,0 +1,139 @@ +/** + * Alipay.com Inc. + * Copyright (c) 2004-2012 All Rights Reserved. + */ +package com.gitee.sop.websiteserver.sign; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.Reader; +import java.io.StringWriter; +import java.io.Writer; + +/** + * + * @author runzhi + */ +public class StreamUtil { + private static final int DEFAULT_BUFFER_SIZE = 8192; + + public static void io(InputStream in, OutputStream out) throws IOException { + io(in, out, -1); + } + + public static void io(InputStream in, OutputStream out, int bufferSize) throws IOException { + if (bufferSize == -1) { + bufferSize = DEFAULT_BUFFER_SIZE; + } + + byte[] buffer = new byte[bufferSize]; + int amount; + + while ((amount = in.read(buffer)) >= 0) { + out.write(buffer, 0, amount); + } + } + + public static void io(Reader in, Writer out) throws IOException { + io(in, out, -1); + } + + public static void io(Reader in, Writer out, int bufferSize) throws IOException { + if (bufferSize == -1) { + bufferSize = DEFAULT_BUFFER_SIZE >> 1; + } + + char[] buffer = new char[bufferSize]; + int amount; + + while ((amount = in.read(buffer)) >= 0) { + out.write(buffer, 0, amount); + } + } + + public static OutputStream synchronizedOutputStream(OutputStream out) { + return new SynchronizedOutputStream(out); + } + + public static OutputStream synchronizedOutputStream(OutputStream out, Object lock) { + return new SynchronizedOutputStream(out, lock); + } + + public static String readText(InputStream in) throws IOException { + return readText(in, null, -1); + } + + public static String readText(InputStream in, String encoding) throws IOException { + return readText(in, encoding, -1); + } + + public static String readText(InputStream in, String encoding, int bufferSize) + throws IOException { + Reader reader = (encoding == null) ? new InputStreamReader(in) : new InputStreamReader(in, + encoding); + + return readText(reader, bufferSize); + } + + public static String readText(Reader reader) throws IOException { + return readText(reader, -1); + } + + public static String readText(Reader reader, int bufferSize) throws IOException { + StringWriter writer = new StringWriter(); + + io(reader, writer, bufferSize); + return writer.toString(); + } + + private static class SynchronizedOutputStream extends OutputStream { + private OutputStream out; + private Object lock; + + SynchronizedOutputStream(OutputStream out) { + this(out, out); + } + + SynchronizedOutputStream(OutputStream out, Object lock) { + this.out = out; + this.lock = lock; + } + + @Override + public void write(int datum) throws IOException { + synchronized (lock) { + out.write(datum); + } + } + + @Override + public void write(byte[] data) throws IOException { + synchronized (lock) { + out.write(data); + } + } + + @Override + public void write(byte[] data, int offset, int length) throws IOException { + synchronized (lock) { + out.write(data, offset, length); + } + } + + @Override + public void flush() throws IOException { + synchronized (lock) { + out.flush(); + } + } + + @Override + public void close() throws IOException { + synchronized (lock) { + out.close(); + } + } + } +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/StringUtils.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/StringUtils.java new file mode 100644 index 00000000..d089b7b5 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/sign/StringUtils.java @@ -0,0 +1,171 @@ +package com.gitee.sop.websiteserver.sign; + +/** + * 字符串工具类。 + * + * @author carver.gu + * @since 1.0, Sep 12, 2009 + */ +public abstract class StringUtils { + + private StringUtils() {} + + /** + * 检查指定的字符串是否为空。 + *
    + *
  • SysUtils.isEmpty(null) = true
  • + *
  • SysUtils.isEmpty("") = true
  • + *
  • SysUtils.isEmpty(" ") = true
  • + *
  • SysUtils.isEmpty("abc") = false
  • + *
+ * + * @param value 待检查的字符串 + * @return true/false + */ + public static boolean isEmpty(String value) { + int strLen; + if (value == null || (strLen = value.length()) == 0) { + return true; + } + for (int i = 0; i < strLen; i++) { + if ((Character.isWhitespace(value.charAt(i)) == false)) { + return false; + } + } + return true; + } + + /** + * 检查对象是否为数字型字符串,包含负数开头的。 + */ + public static boolean isNumeric(Object obj) { + if (obj == null) { + return false; + } + char[] chars = obj.toString().toCharArray(); + int length = chars.length; + if(length < 1) { + return false; + } + + int i = 0; + if(length > 1 && chars[0] == '-') { + i = 1; + } + + for (; i < length; i++) { + if (!Character.isDigit(chars[i])) { + return false; + } + } + return true; + } + + /** + * 检查指定的字符串列表是否不为空。 + */ + public static boolean areNotEmpty(String... values) { + boolean result = true; + if (values == null || values.length == 0) { + result = false; + } else { + for (String value : values) { + result &= !isEmpty(value); + } + } + return result; + } + + /** + * 把通用字符编码的字符串转化为汉字编码。 + */ + public static String unicodeToChinese(String unicode) { + StringBuilder out = new StringBuilder(); + if (!isEmpty(unicode)) { + for (int i = 0; i < unicode.length(); i++) { + out.append(unicode.charAt(i)); + } + } + return out.toString(); + } + + /** + * 过滤不可见字符 + */ + public static String stripNonValidXMLCharacters(String input) { + if (input == null || ("".equals(input))) { + return ""; + } + StringBuilder out = new StringBuilder(); + char current; + for (int i = 0; i < input.length(); i++) { + current = input.charAt(i); + if ((current == 0x9) || (current == 0xA) || (current == 0xD) + || ((current >= 0x20) && (current <= 0xD7FF)) + || ((current >= 0xE000) && (current <= 0xFFFD)) + || ((current >= 0x10000) && (current <= 0x10FFFF))) { + out.append(current); + } + } + return out.toString(); + } + + public static String leftPad(String str, int size, char padChar) { + if (str == null) { + return null; + } else { + int pads = size - str.length(); + if (pads <= 0) { + return str; + } else { + return pads > 8192 ? leftPad(str, size, String.valueOf(padChar)) : padding(pads, padChar).concat(str); + } + } + } + + public static String leftPad(String str, int size, String padStr) { + if (str == null) { + return null; + } else { + if (isEmpty(padStr)) { + padStr = " "; + } + + int padLen = padStr.length(); + int strLen = str.length(); + int pads = size - strLen; + if (pads <= 0) { + return str; + } else if (padLen == 1 && pads <= 8192) { + return leftPad(str, size, padStr.charAt(0)); + } else if (pads == padLen) { + return padStr.concat(str); + } else if (pads < padLen) { + return padStr.substring(0, pads).concat(str); + } else { + char[] padding = new char[pads]; + char[] padChars = padStr.toCharArray(); + + for(int i = 0; i < pads; ++i) { + padding[i] = padChars[i % padLen]; + } + + return (new String(padding)).concat(str); + } + } + } + + private static String padding(int repeat, char padChar) throws IndexOutOfBoundsException { + if (repeat < 0) { + throw new IndexOutOfBoundsException("Cannot pad a negative amount: " + repeat); + } else { + char[] buf = new char[repeat]; + + for(int i = 0; i < buf.length; ++i) { + buf[i] = padChar; + } + + return new String(buf); + } + } +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/util/UploadUtil.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/util/UploadUtil.java new file mode 100644 index 00000000..565d4cf4 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/util/UploadUtil.java @@ -0,0 +1,38 @@ +package com.gitee.sop.websiteserver.util; + +import org.apache.tomcat.util.http.fileupload.servlet.ServletFileUpload; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; + +import javax.servlet.http.HttpServletRequest; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Optional; + +/** + * 文件上传工具类 + * + * @author tanghc + */ +public class UploadUtil { + + /** + * 获取上传文件 + * + * @param request + * @return + */ + public static Collection getUploadFiles(HttpServletRequest request) { + Map fileMap = null; + //检查form中是否有enctype="multipart/form-data" + if (ServletFileUpload.isMultipartContent(request)) { + //将request变成多部分request + MultipartHttpServletRequest multiRequest = (MultipartHttpServletRequest) request; + fileMap = multiRequest.getFileMap(); + } + return Optional.ofNullable(fileMap) + .map(map -> map.values()) + .orElse(Collections.emptyList()); + } +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/vo/DocBaseInfoVO.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/vo/DocBaseInfoVO.java new file mode 100644 index 00000000..ac893f7d --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/vo/DocBaseInfoVO.java @@ -0,0 +1,15 @@ +package com.gitee.sop.websiteserver.vo; + +import lombok.Data; + +import java.util.List; + +/** + * @author tanghc + */ +@Data +public class DocBaseInfoVO { + private String urlTest; + private String urlProd; + private List docInfoList; +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/vo/DocInfoVO.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/vo/DocInfoVO.java new file mode 100644 index 00000000..307a02b4 --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/vo/DocInfoVO.java @@ -0,0 +1,11 @@ +package com.gitee.sop.websiteserver.vo; + +import lombok.Data; + +/** + * @author tanghc + */ +@Data +public class DocInfoVO { + private String title; +} diff --git a/sop-website/src/main/java/com/gitee/sop/websiteserver/vo/ServiceInfoVO.java b/sop-website/src/main/java/com/gitee/sop/websiteserver/vo/ServiceInfoVO.java new file mode 100644 index 00000000..fd3f3a1f --- /dev/null +++ b/sop-website/src/main/java/com/gitee/sop/websiteserver/vo/ServiceInfoVO.java @@ -0,0 +1,17 @@ +package com.gitee.sop.websiteserver.vo; + +import lombok.Data; + +/** + * @author tanghc + */ +@Data +public class ServiceInfoVO { + + private String name; + + private String ipAddr; + + private String serverPort; + +} diff --git a/sop-website/src/main/resources/api.json b/sop-website/src/main/resources/api.json new file mode 100644 index 00000000..1c5ad911 --- /dev/null +++ b/sop-website/src/main/resources/api.json @@ -0,0 +1,1947 @@ +{ + "swagger": "2.0", + "info": { + "description": "文档描述", + "version": "1.0", + "title": "故事API", + "termsOfService": "文档" + }, + "host": "10.1.30.157:2222", + "basePath": "/", + "tags": [ + { + "name": "故事接口", + "description": "Alipay Controller" + }, + { + "name": "故事接口2", + "description": "Story 2 Controller" + }, + { + "name": "文件上传", + "description": "File Upload Demo Controller" + } + ], + "paths": { + "/alipay.category.get/": { + "get": { + "tags": [ + "故事接口" + ], + "summary": "获取分类信息", + "description": "演示表格树", + "operationId": "getCategoryUsingGET", + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "categoryName", + "in": "query", + "description": "分类名称", + "required": false, + "type": "string", + "x-example": "娱乐" + }, + { + "name": "story.gmt_create", + "in": "query", + "description": "创建时间", + "required": false, + "type": "string", + "format": "date-time", + "x-example": "2019-04-14 19:02:12" + }, + { + "name": "story.id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int64", + "x-example": 1 + }, + { + "name": "story.name", + "in": "query", + "description": "故事名称", + "required": false, + "type": "string", + "x-example": "海底小纵队" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Category", + "originalRef": "Category" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "alipay.category.get", + "sop_version": "1.0" + }, + "head": { + "tags": [ + "故事接口" + ], + "summary": "获取分类信息", + "description": "演示表格树", + "operationId": "getCategoryUsingHEAD", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "categoryName", + "in": "query", + "description": "分类名称", + "required": false, + "type": "string", + "x-example": "娱乐" + }, + { + "name": "story.gmt_create", + "in": "query", + "description": "创建时间", + "required": false, + "type": "string", + "format": "date-time", + "x-example": "2019-04-14 19:02:12" + }, + { + "name": "story.id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int64", + "x-example": 1 + }, + { + "name": "story.name", + "in": "query", + "description": "故事名称", + "required": false, + "type": "string", + "x-example": "海底小纵队" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Category", + "originalRef": "Category" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "alipay.category.get", + "sop_version": "1.0" + }, + "post": { + "tags": [ + "故事接口" + ], + "summary": "获取分类信息", + "description": "演示表格树", + "operationId": "getCategoryUsingPOST", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "categoryName", + "in": "query", + "description": "分类名称", + "required": false, + "type": "string", + "x-example": "娱乐" + }, + { + "name": "story.gmt_create", + "in": "query", + "description": "创建时间", + "required": false, + "type": "string", + "format": "date-time", + "x-example": "2019-04-14 19:02:12" + }, + { + "name": "story.id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int64", + "x-example": 1 + }, + { + "name": "story.name", + "in": "query", + "description": "故事名称", + "required": false, + "type": "string", + "x-example": "海底小纵队" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Category", + "originalRef": "Category" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "alipay.category.get", + "sop_version": "1.0" + }, + "put": { + "tags": [ + "故事接口" + ], + "summary": "获取分类信息", + "description": "演示表格树", + "operationId": "getCategoryUsingPUT", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "categoryName", + "in": "query", + "description": "分类名称", + "required": false, + "type": "string", + "x-example": "娱乐" + }, + { + "name": "story.gmt_create", + "in": "query", + "description": "创建时间", + "required": false, + "type": "string", + "format": "date-time", + "x-example": "2019-04-14 19:02:12" + }, + { + "name": "story.id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int64", + "x-example": 1 + }, + { + "name": "story.name", + "in": "query", + "description": "故事名称", + "required": false, + "type": "string", + "x-example": "海底小纵队" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Category", + "originalRef": "Category" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "alipay.category.get", + "sop_version": "1.0" + }, + "delete": { + "tags": [ + "故事接口" + ], + "summary": "获取分类信息", + "description": "演示表格树", + "operationId": "getCategoryUsingDELETE", + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "categoryName", + "in": "query", + "description": "分类名称", + "required": false, + "type": "string", + "x-example": "娱乐" + }, + { + "name": "story.gmt_create", + "in": "query", + "description": "创建时间", + "required": false, + "type": "string", + "format": "date-time", + "x-example": "2019-04-14 19:02:12" + }, + { + "name": "story.id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int64", + "x-example": 1 + }, + { + "name": "story.name", + "in": "query", + "description": "故事名称", + "required": false, + "type": "string", + "x-example": "海底小纵队" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Category", + "originalRef": "Category" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "alipay.category.get", + "sop_version": "1.0" + }, + "options": { + "tags": [ + "故事接口" + ], + "summary": "获取分类信息", + "description": "演示表格树", + "operationId": "getCategoryUsingOPTIONS", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "categoryName", + "in": "query", + "description": "分类名称", + "required": false, + "type": "string", + "x-example": "娱乐" + }, + { + "name": "story.gmt_create", + "in": "query", + "description": "创建时间", + "required": false, + "type": "string", + "format": "date-time", + "x-example": "2019-04-14 19:02:12" + }, + { + "name": "story.id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int64", + "x-example": 1 + }, + { + "name": "story.name", + "in": "query", + "description": "故事名称", + "required": false, + "type": "string", + "x-example": "海底小纵队" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Category", + "originalRef": "Category" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "alipay.category.get", + "sop_version": "1.0" + }, + "patch": { + "tags": [ + "故事接口" + ], + "summary": "获取分类信息", + "description": "演示表格树", + "operationId": "getCategoryUsingPATCH", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "categoryName", + "in": "query", + "description": "分类名称", + "required": false, + "type": "string", + "x-example": "娱乐" + }, + { + "name": "story.gmt_create", + "in": "query", + "description": "创建时间", + "required": false, + "type": "string", + "format": "date-time", + "x-example": "2019-04-14 19:02:12" + }, + { + "name": "story.id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int64", + "x-example": 1 + }, + { + "name": "story.name", + "in": "query", + "description": "故事名称", + "required": false, + "type": "string", + "x-example": "海底小纵队" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Category", + "originalRef": "Category" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "alipay.category.get", + "sop_version": "1.0" + } + }, + "/alipay.story.find/": { + "get": { + "tags": [ + "故事接口" + ], + "summary": "获取故事信息", + "description": "说明接口的详细信息,介绍,用途,注意事项等。", + "operationId": "getStory2UsingGET", + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 111 + }, + { + "name": "name", + "in": "query", + "description": "故事名称", + "required": true, + "type": "string", + "x-example": "白雪公主" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StoryVO", + "originalRef": "StoryVO" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "alipay.story.find", + "sop_version": "1.0" + }, + "head": { + "tags": [ + "故事接口" + ], + "summary": "获取故事信息", + "description": "说明接口的详细信息,介绍,用途,注意事项等。", + "operationId": "getStory2UsingHEAD", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 111 + }, + { + "name": "name", + "in": "query", + "description": "故事名称", + "required": true, + "type": "string", + "x-example": "白雪公主" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StoryVO", + "originalRef": "StoryVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "alipay.story.find", + "sop_version": "1.0" + }, + "post": { + "tags": [ + "故事接口" + ], + "summary": "获取故事信息", + "description": "说明接口的详细信息,介绍,用途,注意事项等。", + "operationId": "getStory2UsingPOST", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 111 + }, + { + "name": "name", + "in": "query", + "description": "故事名称", + "required": true, + "type": "string", + "x-example": "白雪公主" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StoryVO", + "originalRef": "StoryVO" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "alipay.story.find", + "sop_version": "1.0" + }, + "put": { + "tags": [ + "故事接口" + ], + "summary": "获取故事信息", + "description": "说明接口的详细信息,介绍,用途,注意事项等。", + "operationId": "getStory2UsingPUT", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 111 + }, + { + "name": "name", + "in": "query", + "description": "故事名称", + "required": true, + "type": "string", + "x-example": "白雪公主" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StoryVO", + "originalRef": "StoryVO" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "alipay.story.find", + "sop_version": "1.0" + }, + "delete": { + "tags": [ + "故事接口" + ], + "summary": "获取故事信息", + "description": "说明接口的详细信息,介绍,用途,注意事项等。", + "operationId": "getStory2UsingDELETE", + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 111 + }, + { + "name": "name", + "in": "query", + "description": "故事名称", + "required": true, + "type": "string", + "x-example": "白雪公主" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StoryVO", + "originalRef": "StoryVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "alipay.story.find", + "sop_version": "1.0" + }, + "options": { + "tags": [ + "故事接口" + ], + "summary": "获取故事信息", + "description": "说明接口的详细信息,介绍,用途,注意事项等。", + "operationId": "getStory2UsingOPTIONS", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 111 + }, + { + "name": "name", + "in": "query", + "description": "故事名称", + "required": true, + "type": "string", + "x-example": "白雪公主" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StoryVO", + "originalRef": "StoryVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "alipay.story.find", + "sop_version": "1.0" + }, + "patch": { + "tags": [ + "故事接口" + ], + "summary": "获取故事信息", + "description": "说明接口的详细信息,介绍,用途,注意事项等。", + "operationId": "getStory2UsingPATCH", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "id", + "in": "query", + "description": "故事ID", + "required": false, + "type": "integer", + "format": "int32", + "x-example": 111 + }, + { + "name": "name", + "in": "query", + "description": "故事名称", + "required": true, + "type": "string", + "x-example": "白雪公主" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/StoryVO", + "originalRef": "StoryVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "alipay.story.find", + "sop_version": "1.0" + } + }, + "/demo.file.upload/": { + "get": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例1", + "description": "上传文件demo", + "operationId": "file1UsingGET", + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "file1", + "in": "query", + "description": "文件1", + "required": true, + "type": "file" + }, + { + "name": "file2", + "in": "query", + "description": "文件2", + "required": true, + "type": "file" + }, + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "demo.file.upload", + "sop_version": "1.0" + }, + "head": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例1", + "description": "上传文件demo", + "operationId": "file1UsingHEAD", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "file1", + "in": "query", + "description": "文件1", + "required": true, + "type": "file" + }, + { + "name": "file2", + "in": "query", + "description": "文件2", + "required": true, + "type": "file" + }, + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "demo.file.upload", + "sop_version": "1.0" + }, + "post": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例1", + "description": "上传文件demo", + "operationId": "file1UsingPOST", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "file1", + "in": "query", + "description": "文件1", + "required": true, + "type": "file" + }, + { + "name": "file2", + "in": "query", + "description": "文件2", + "required": true, + "type": "file" + }, + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "demo.file.upload", + "sop_version": "1.0" + }, + "put": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例1", + "description": "上传文件demo", + "operationId": "file1UsingPUT", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "file1", + "in": "query", + "description": "文件1", + "required": true, + "type": "file" + }, + { + "name": "file2", + "in": "query", + "description": "文件2", + "required": true, + "type": "file" + }, + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "demo.file.upload", + "sop_version": "1.0" + }, + "delete": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例1", + "description": "上传文件demo", + "operationId": "file1UsingDELETE", + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "file1", + "in": "query", + "description": "文件1", + "required": true, + "type": "file" + }, + { + "name": "file2", + "in": "query", + "description": "文件2", + "required": true, + "type": "file" + }, + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "demo.file.upload", + "sop_version": "1.0" + }, + "options": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例1", + "description": "上传文件demo", + "operationId": "file1UsingOPTIONS", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "file1", + "in": "query", + "description": "文件1", + "required": true, + "type": "file" + }, + { + "name": "file2", + "in": "query", + "description": "文件2", + "required": true, + "type": "file" + }, + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "demo.file.upload", + "sop_version": "1.0" + }, + "patch": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例1", + "description": "上传文件demo", + "operationId": "file1UsingPATCH", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "file1", + "in": "query", + "description": "文件1", + "required": true, + "type": "file" + }, + { + "name": "file2", + "in": "query", + "description": "文件2", + "required": true, + "type": "file" + }, + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "demo.file.upload", + "sop_version": "1.0" + } + }, + "/demo.file.upload2/": { + "get": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例2", + "description": "可上传多个文件", + "operationId": "file2UsingGET", + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "multiple": "multiple", + "sop_name": "demo.file.upload2", + "sop_version": "1.0" + }, + "head": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例2", + "description": "可上传多个文件", + "operationId": "file2UsingHEAD", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "multiple": "multiple", + "sop_name": "demo.file.upload2", + "sop_version": "1.0" + }, + "post": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例2", + "description": "可上传多个文件", + "operationId": "file2UsingPOST", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "multiple": "multiple", + "sop_name": "demo.file.upload2", + "sop_version": "1.0" + }, + "put": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例2", + "description": "可上传多个文件", + "operationId": "file2UsingPUT", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "multiple": "multiple", + "sop_name": "demo.file.upload2", + "sop_version": "1.0" + }, + "delete": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例2", + "description": "可上传多个文件", + "operationId": "file2UsingDELETE", + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "multiple": "multiple", + "sop_name": "demo.file.upload2", + "sop_version": "1.0" + }, + "options": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例2", + "description": "可上传多个文件", + "operationId": "file2UsingOPTIONS", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "multiple": "multiple", + "sop_name": "demo.file.upload2", + "sop_version": "1.0" + }, + "patch": { + "tags": [ + "文件上传" + ], + "summary": "文件上传例2", + "description": "可上传多个文件", + "operationId": "file2UsingPATCH", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "parameters": [ + { + "name": "remark", + "in": "query", + "required": false, + "type": "string" + } + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/FileUploadVO", + "originalRef": "FileUploadVO" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "multiple": "multiple", + "sop_name": "demo.file.upload2", + "sop_version": "1.0" + } + }, + "/story2/getStory4": { + "get": { + "tags": [ + "故事接口2" + ], + "summary": "获取故事信息2", + "description": "获取故事信息2的详细信息", + "operationId": "storygetUsingGET", + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Story", + "originalRef": "Story" + } + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "story2.getStory4", + "sop_version": "1.4" + }, + "head": { + "tags": [ + "故事接口2" + ], + "summary": "获取故事信息2", + "description": "获取故事信息2的详细信息", + "operationId": "storygetUsingHEAD", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Story", + "originalRef": "Story" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "story2.getStory4", + "sop_version": "1.4" + }, + "post": { + "tags": [ + "故事接口2" + ], + "summary": "获取故事信息2", + "description": "获取故事信息2的详细信息", + "operationId": "storygetUsingPOST", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Story", + "originalRef": "Story" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "story2.getStory4", + "sop_version": "1.4" + }, + "put": { + "tags": [ + "故事接口2" + ], + "summary": "获取故事信息2", + "description": "获取故事信息2的详细信息", + "operationId": "storygetUsingPUT", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Story", + "originalRef": "Story" + } + }, + "201": { + "description": "Created" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + }, + "404": { + "description": "Not Found" + } + }, + "deprecated": false, + "sop_name": "story2.getStory4", + "sop_version": "1.4" + }, + "delete": { + "tags": [ + "故事接口2" + ], + "summary": "获取故事信息2", + "description": "获取故事信息2的详细信息", + "operationId": "storygetUsingDELETE", + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Story", + "originalRef": "Story" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "story2.getStory4", + "sop_version": "1.4" + }, + "options": { + "tags": [ + "故事接口2" + ], + "summary": "获取故事信息2", + "description": "获取故事信息2的详细信息", + "operationId": "storygetUsingOPTIONS", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Story", + "originalRef": "Story" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "story2.getStory4", + "sop_version": "1.4" + }, + "patch": { + "tags": [ + "故事接口2" + ], + "summary": "获取故事信息2", + "description": "获取故事信息2的详细信息", + "operationId": "storygetUsingPATCH", + "consumes": [ + "application/json" + ], + "produces": [ + "*/*" + ], + "responses": { + "200": { + "description": "OK", + "schema": { + "$ref": "#/definitions/Story", + "originalRef": "Story" + } + }, + "204": { + "description": "No Content" + }, + "401": { + "description": "Unauthorized" + }, + "403": { + "description": "Forbidden" + } + }, + "deprecated": false, + "sop_name": "story2.getStory4", + "sop_version": "1.4" + } + } + }, + "definitions": { + "Category": { + "type": "object", + "properties": { + "categoryName": { + "type": "string", + "example": "娱乐", + "description": "分类名称" + }, + "story": { + "description": "分类故事", + "$ref": "#/definitions/StoryVO", + "originalRef": "StoryVO" + } + }, + "title": "Category" + }, + "FileMeta": { + "type": "object", + "properties": { + "content": { + "type": "string" + }, + "filename": { + "type": "string" + }, + "size": { + "type": "integer", + "format": "int64" + } + }, + "title": "FileMeta" + }, + "FileUploadVO": { + "type": "object", + "properties": { + "files": { + "type": "array", + "items": { + "$ref": "#/definitions/FileMeta", + "originalRef": "FileMeta" + } + } + }, + "title": "FileUploadVO" + }, + "Story": { + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32" + }, + "name": { + "type": "string" + } + }, + "title": "Story" + }, + "StoryVO": { + "type": "object", + "properties": { + "gmt_create": { + "type": "string", + "format": "date-time", + "example": "2019-04-14 19:02:12", + "description": "创建时间" + }, + "id": { + "type": "integer", + "format": "int64", + "example": 1, + "description": "故事ID" + }, + "name": { + "type": "string", + "example": "海底小纵队", + "description": "故事名称" + } + }, + "title": "StoryVO" + } + } +} \ No newline at end of file diff --git a/sop-website/src/main/resources/application-dev.properties b/sop-website/src/main/resources/application-dev.properties new file mode 100644 index 00000000..32eaeb91 --- /dev/null +++ b/sop-website/src/main/resources/application-dev.properties @@ -0,0 +1,18 @@ +server.port=8083 +spring.application.name=website-server + +# ------- 需要改的配置 ------- +# nacos地址 +nacos.url=127.0.0.1:8848 +# ------- 需要改的配置end ------- + +# nacos cloud配置 +spring.cloud.nacos.discovery.server-addr=${nacos.url} + +# 测试环境 +api.url-test=http://open-test.yourdomain.com +# 沙箱环境 +api.url-sandbox=http://localhost:8081 +# 正式环境 +api.url-prod=http://open.yourdomain.com +api.pwd=doc#123 diff --git a/sop-website/src/main/resources/application.properties b/sop-website/src/main/resources/application.properties new file mode 100644 index 00000000..257b3064 --- /dev/null +++ b/sop-website/src/main/resources/application.properties @@ -0,0 +1 @@ +spring.profiles.active=dev \ No newline at end of file diff --git a/sop-website/src/main/resources/public/assets/css/global.css b/sop-website/src/main/resources/public/assets/css/global.css new file mode 100644 index 00000000..30358ed4 --- /dev/null +++ b/sop-website/src/main/resources/public/assets/css/global.css @@ -0,0 +1,483 @@ +/** + + layui官网 + By 贤心 + +*/ + +h1,h2,h3{font-size: 14px;} +::-webkit-input-placeholder{color: #999} + +/* 布局 */ +.site-inline{font-size: 0;} +.site-tree, .site-content{display: inline-block; *display:inline; *zoom:1; vertical-align: top; font-size: 14px;} +.site-tree{width: 220px; min-height: 900px; padding: 5px 0 20px;} +.site-content{width: 899px; min-height: 900px; padding: 20px 0 10px 20px;} + +/* 头部 */ +.header{height: 59px; border-bottom: 1px solid #404553; background-color: #393D49;} +.logo{position: absolute; left: 0; top: 20px; font-size: 16px} +.logo img{width: 82px; height: 31px;} + +.header .layui-nav{position: absolute; right: 0; top: 0; padding: 0; background: none;} +.header .layui-nav .layui-nav-item{margin: 0 20px; } +.header .layui-nav .layui-nav-item[mobile]{display: none;} + +.header .layui-container .logo{left: 15px;} +.header .layui-container .layui-nav{right: 15px;} + +.menu{position: absolute; right: 0; top: 0; line-height: 65px;} +.menu a{display:inline-block; *display:inline; *zoom:1; vertical-align:top;} +.menu a{position: relative; padding: 0 20px; margin: 0 20px; color: #c2c2c2; font-size: 14px;} +.menu a:hover{color: #fff; transition: all .5s; -webkit-transition: all .5s} +.menu a.this{color: #fff} +.menu a.this::after{content: ''; position: absolute; left: 0; bottom: -1px; width: 100%; height: 5px; background-color: #5FB878;} + +.header-index{background-color: #05031A; border: none;} +.header-index .site-banner-bg{} +.header-index[spring]{background-color: #0D1206} +.header-index[summer]{background-color: #0A0E11} +.header-index[autumn]{background-color: #100903} +.header-index[winter]{background-color: #110F25/*#06041C*/} + +.header-demo{height: 60px; border-bottom: none;} +.header-demo .logo{left: 40px;} +.header-demo .layui-nav{top: 0;} +.header-demo .layui-nav .layui-nav-item{margin: 0 10px;} + +.header-demo .layui-nav .layui-this a{padding: 0 30px;} + +.component{position: absolute; width: 160px; left: 120px; top: 16px; } +.component .layui-input{height: 30px; padding-left: 12px; background-color: #424652; background-color: rgba(255,255,255,.05); border: none 0; color: #fff; color: rgba(255,255,255,.5); font-size: 12px;} +.component .layui-form-select .layui-edge{display: none; border-top-color: #999;} +.component .layui-form-select dl{top: 36px; background-color: rgba(255,255,255,.9)} +.header-demo .component{left: 185px;} + + +/* 子侧边 */ +.layui-side-child{width: 160px!important; left: 200px; bottom: 60px!important; border-right: 1px solid #eee; background-color: #fff;} +.layui-side-child .layui-side-scroll{width: 170px;} +.layui-side-child .layui-nav{padding: 10px 0; width: 160px; border-radius: 0; background: none} +.layui-side-child .layui-nav-child{border-radius: 0;} +.layui-side-child .layui-nav .layui-nav-title a, +.layui-side-child .layui-nav .layui-nav-title a:hover, +.layui-side-child .layui-nav-itemed>a{color: #666 !important;} +.layui-side-child .layui-nav-itemed .layui-nav-child{margin-bottom: 10px; background: none !important;} +.layui-side-child .layui-nav .layui-nav-item a{height: 30px; line-height: 30px; color: #666;} +.layui-side-child .layui-nav .layui-nav-item a:hover{background: none !important;} +.layui-side-child .layui-nav .layui-nav-child a{color: #999 !important;} +.layui-side-child .layui-nav .layui-nav-more{display: none;} +.layui-side-child .layui-nav-tree .layui-this, +.layui-side-child .layui-nav-tree .layui-this>a, +.layui-side-child .layui-nav-tree .layui-nav-child dd.layui-this, +.layui-side-child .layui-nav-tree .layui-nav-child dd.layui-this a{background: none; color: #5FB878 !important;} +.layui-side-child .layui-nav .layui-nav-child a:hover{color: #009688 !important} +.layui-side-child .layui-nav-bar{background-color: #5FB878;} + + +/* 底部 */ +.footer{padding: 30px 0; line-height: 30px; text-align: center; color: #666; font-weight: 300;} +body .layui-layout-admin .footer-demo{height: 50px; padding: 5px 0;} +.footer a{padding: 0 5px;} +.site-union{margin-top: 10px; color: #999;} +.site-union>*{display: inline-block; vertical-align: middle;} +.site-union a[upyun] img{width: 80px;} +.site-union span{position: relative; top: 3px;} +.site-union span a{padding: 0; display: inline; color: #999;} +.site-union span a:hover{text-decoration: underline;} + +.footer-demo p{display: inline-block; vertical-align: middle; height: 50px; padding-right: 10px;} +.footer-demo .site-union{position: relative; top: -9px;} + +/* 首页banner部分 */ +.site-banner{position: relative; height: 600px; text-align: center; overflow: hidden; background-color: #393D49;} +.site-banner-bg +,.site-banner-main{position: absolute; left: 0; top: 0; width: 100%; height: 100%;} +.site-banner-bg{background-position: center 0;} + + +.site-zfj{padding-top: 25px; height: 220px;} +.site-zfj i{position: absolute; left: 50%; top: 50px; width: 200px; height: 200px; margin-left: -100px; font-size: 180px; color: #c2c2c2;} + +@-webkit-keyframes site-zfj { + 0% {opacity: 1; -webkit-transform: translate3d(0, 0, 0) rotate(0deg) scale(1);} + 10% {opacity: 0.8; -webkit-transform: translate3d(-100px, 0px, 0) rotate(10deg) scale(0.7);} + 35% {opacity: 0.6; -webkit-transform: translate3d(100px, 0px, 0) rotate(30deg) scale(0.4);} + 50% {opacity: 0.4; -webkit-transform: translate3d(0, 0, 0) rotate(360deg) scale(0);} + 80% {opacity: 0.2; -webkit-transform: translate3d(0, 0, 0) rotate(720deg) scale(1);} + 90% {opacity: 0.1; -webkit-transform: translate3d(0, 0, 0) rotate(3600deg) scale(6);} + 100% {opacity: 1; -webkit-transform: translate3d(0, 0, 0) rotate(3600deg) scale(1);} +} +@keyframes site-zfj { + 0% {opacity: 1; transform: translate3d(0, 0, 0) rotate(0deg) scale(1);} + 10% {opacity: 0.8; transform: translate3d(-100px, 0px, 0) rotate(10deg) scale(0.7);} + 35% {opacity: 0.6; transform: translate3d(100px, 0px, 0) rotate(30deg) scale(0.4);} + 50% {opacity: 0.4; transform: translate3d(0, 0, 0) rotate(360deg) scale(0);} + 80% {opacity: 0.2; transform: translate3d(0, 0, 0) rotate(720deg) scale(1);} + 90% {opacity: 0.1; transform: translate3d(0, 0, 0) rotate(3600deg) scale(6);} + 100% {opacity: 1; transform: translate3d(0, 0, 0) rotate(3600deg) scale(1);} +} + +@-webkit-keyframes site-desc { + 0% { -webkit-transform: scale(1.1);} + 100% {opacity: 1; -webkit-transform: scale(1);} +} +@keyframes site-desc { + 0% { transform: scale(1.1);} + 100% {transform: scale(1);} +} + +.site-zfj-anim i{-webkit-animation-name: site-zfj; animation-name: site-zfj; -webkit-animation-duration: 5s; animation-duration: 5s; -webkit-animation-timing-function: linear; animation-timing-function: linear;} + + +/* 描述字体 */ +@font-face {font-family: 'webfont-desc'; + src: url('//at.alicdn.com/t/webfont_eovt4pxxy5.eot'); /* IE9*/ + src: url('//at.alicdn.com/t/webfont_eovt4pxxy5.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('//at.alicdn.com/t/webfont_eovt4pxxy5.woff') format('woff'), /* chrome、firefox */ + url('//at.alicdn.com/t/webfont_eovt4pxxy5.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/ + url('//at.alicdn.com/t/webfont_eovt4pxxy5.svg#思源黑体-极细') format('svg'); /* iOS 4.1- */ +} +.web-font-desc{ + font-family:"webfont-desc" !important; + font-size:16px;font-style:normal; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; +} + + +.site-desc{position: relative; height: 70px; margin-top: 20px;} +.site-desc .web-font-desc{color: #fff; color: rgba(255,255,255,.8); font-size: 61px;} + +.site-desc-anim{-webkit-animation-name: site-desc; animation-name: site-desc;} +.site-desc cite{position: absolute; bottom: -40px; left: 0; width: 100%; color: #c2c2c2; font-style: normal;} + +.site-download{margin-top: 80px; font-size: 0;} +.site-download a{position: relative; padding: 0 45px 0 90px; height: 60px; line-height: 60px; border: 1px solid #c2c2c2; border-color: rgba(255,255,255,.2); font-size: 24px; color: #ccc; transition: all .5s; -webkit-transition: all .5s;} +.site-download a:hover{border-color: rgba(255,255,255,.3); color: #fff; background-color: rgba(255,255,255,.05); border-radius: 30px;} +.site-download a cite{position: absolute; left: 45px; font-size: 30px;} +.site-version{position: relative; margin-top: 15px; color: #ccc; font-size: 12px;} +.site-version span{padding: 0 3px;} +.site-version *{font-style: normal;} +.site-version a{color: #e2e2e2; text-decoration: underline;} + +.site-banner-other{position: absolute; left: 0; bottom: 35px; width: 100%; text-align: center; font-size: 0;} +.site-banner-other iframe{border: none;} +.site-banner-other a{display: inline-block; vertical-align: middle; height: 28px; line-height: 28px; margin: 0 5px; padding: 0 8px; border-radius: 2px; color: #c2c2c2; color: rgba(255,255,255,.8); border: 1px solid #c2c2c2; border-color: rgba(255,255,255,.2); font-size: 14px; transition: all .5s; -webkit-transition: all .5s;} +.site-banner-other a:hover{color: #fff; background-color: rgba(255,255,255,.1);} + + +.site-idea{margin: 50px 0; font-size: 0; text-align: center; font-weight: 300;} +.site-idea li{display: inline-block; vertical-align: top; *display: inline; *zoom:1; font-size: 14px; } +.site-idea li{width: 298px; height: 150px; padding: 30px; line-height: 24px; margin-left: 30px; border: 1px solid #d2d2d2; text-align: left;} +.site-idea li:first-child{margin-left: 0} +.site-idea .layui-field-title{border-color: #d2d2d2} +.site-idea .layui-field-title legend{margin: 0 20px 20px 0; padding: 0 20px; text-align: center;} + +/* 赞助商 */ +.site-sponsor-home{margin-top: 40px; text-align: center;} +.site-sponsor-home .layui-btn{position: relative; width: 233px; height: 65px; line-height: 65px; background: none; border-color: #212121; font-size: 26px; border-radius: 6px; /*padding-left: 55px;*/} +.site-sponsor-home .layui-btn:hover{background: #4A4855; color: #BAB8C3;} +.site-sponsor-home .layui-btn:before{/*position: absolute; left: 15px; top: 15px; content: ''; width: 30px; height: 30px; background: url(http://cdn.layui.com/upload/2018_1/168_1514869467160_26113.png) center; background-repeat: no-repeat; background-size: contain;*/} +.site-sponsor-home p{position: relative; padding-top: 15px; font-size: 22px; color: #212121;} +.site-sponsor-home p:before{content: ''; position: relative; top: -2px; display: inline-block; vertical-align: middle; width: 30px; height: 30px; margin-right: 10px; background: url(http://cdn.layui.com/upload/2018_1/168_1514869467160_26113.png) center; background-repeat: no-repeat; background-size: contain;} +@media screen and (max-width: 750px) { + .site-sponsor-home .layui-btn{width: 180px; height: 45px; line-height: 45px; font-size: 20px;} + .site-sponsor-home p{font-size: 16px;} + .site-sponsor-home p:before{width: 20px; height: 20px;} +} + + + +/* 辅助 */ +.site-tips{margin-bottom: 10px; padding: 15px; line-height: 22px; border-left: 5px solid #0078AD; background-color: #f2f2f2;} +body .site-tips p{margin: 0;} +body .layui-layer-notice .layui-layer-content{padding: 20px; line-height: 26px; background-color: #393D49; color: #fff; font-weight: 300;} +.layui-layer-notice .layui-text{color: #f8f8f8;} +.layui-layer-notice .layui-text a{color: #009688;} + +/* 目录 */ +.site-dir{display: none;} +.site-dir li{line-height: 26px; margin-left: 20px; overflow: visible; list-style-type: disc;} +.site-dir li a{display: block;} +.site-dir li a:active{color: #01AAED;} +.site-dir li a.layui-this{color: #01AAED;} +body .layui-layer-dir{box-shadow: none; border: 1px solid #d2d2d2;} +body .layui-layer-dir .layui-layer-content{padding: 10px;} +.site-dir a em{padding-left: 5px; font-size: 12px; color: #c2c2c2; font-style: normal;} + +/* 文档 */ +.site-tree{border-right: 1px solid #eee; } +.site-tree .layui-tree{line-height: 32px;} +.site-tree .layui-tree li i{position: relative; font-size: 22px; color: #000} +.site-tree .layui-tree li a cite{padding: 0 8px;} +.site-tree .layui-tree .site-tree-noicon a cite{padding-left: 15px;} +.site-tree .layui-tree li a em{font-size: 12px; color: #bbb; padding-right: 5px; font-style: normal;} +.site-tree .layui-tree li h2{line-height: 36px; border-left: 5px solid #009E94; margin: 15px 0 5px; padding: 0 10px; background-color: #f2f2f2;} +.site-tree .layui-tree li ul{margin-left: 27px; line-height: 28px;} +.site-tree .layui-tree li ul a, +.site-tree .layui-tree li ul a i{color: #777;} +.site-tree .layui-tree li ul a:hover{color: #333;} +.site-tree .layui-tree li ul li{margin-left: 25px; overflow: visible; list-style-type: disc; /*list-style-position: inside;*/} +.site-tree .layui-tree li ul li cite, +.site-tree .layui-tree .site-tree-noicon ul li cite{padding-left: 0;} + +.site-tree .layui-tree .layui-this a{color: #01AAED;} +.site-tree .layui-tree .layui-this .layui-icon{color: #01AAED;} + +.site-fix .site-tree{position: fixed; top: 0; bottom: 0; z-index: 666; min-height: 0; overflow: auto; background-color: #fff;} +.site-fix .site-content{margin-left: 220px;} +.site-fix-footer .site-tree{/*margin-bottom: 120px;*/} + + +.site-title{ margin: 30px 0 20px;} +.site-title fieldset{border: none; padding: 0; border-top: 1px solid #eee;} +.site-title fieldset legend{margin-left: 20px; padding: 0 10px; font-size: 22px; font-weight: 300;} + +.site-text a{color: #01AAED;} +.site-h1{margin-bottom: 20px; line-height: 60px; padding-bottom: 10px; color: #393D49; border-bottom: 1px solid #eee; font-size: 28px; font-weight: 300;} +.site-h1 .layui-icon{position: relative; top: 5px; font-size: 35px; margin-right: 10px;} +.site-text{position:relative;} +.site-text p{margin-bottom: 10px; line-height:22px;} +.site-text em{padding: 0 3px; font-weight: 500; font-style: italic; color: #666;} +.site-text code{margin:0 5px; padding: 3px 10px; border: 1px solid #e2e2e2; background-color: #fbfbfb; color: #666; border-radius: 2px;} + +.site-table{width: 100%; margin: 10px 0;} +.site-table thead{background-color:#f2f2f2; } +.site-table th, +.site-table td{padding: 6px 15px; min-height: 20px; line-height: 20px; border:1px solid #ddd; font-size: 14px; font-weight: 400;} +.site-table tr:nth-child(even){background: #fbfbfb;} + +.site-block{padding: 20px; border: 1px solid #eee;} +.site-block .layui-form{margin-right: 200px;} + +/* 更新日志 */ +.site-changelog .layui-timeline-title h2{display: inline-block;} +.site-changelog .layui-timeline-title .layui-badge-rim{top: -2px; left: 10px;} + +/* 颜色 */ +.site-doc-color{font-size: 0;} +.site-doc-color li{display: inline-block; vertical-align: middle; width: 180px; margin-left: 20px; margin-bottom: 20px; padding: 20px 10px; color: #fff; text-align: center; border-radius: 2px; line-height: 22px; font-size: 14px;} +.site-doc-color li p[tips]{opacity: 0.8; font-size: 12px;} + +.site-doc-necolor li{width: 108px; margin-top: 15px; margin-left: 0; border-radius: 0;} + +.site-doc-bgcolor li{padding: 10px;} + +/* 宫格 */ +.site-doc-icon{margin-bottom: 50px; font-size: 0;} +.site-doc-icon li{display: inline-block; vertical-align: middle; width: 127px; height: 105px; line-height: 25px; padding: 20px 0; margin-right: -1px; margin-bottom: -1px; border: 1px solid #e2e2e2; font-size: 14px; text-align: center; color: #666; transition: all .3s; -webkit-transition: all .3s;} +.site-doc-anim li{height: auto;} +.site-doc-icon li .layui-icon{display: inline-block; font-size: 36px;} + +.site-doc-icon li .doc-icon-name, +.site-doc-icon li .doc-icon-code{color: #c2c2c2;} +.site-doc-icon li .doc-icon-fontclass{height: 40px; line-height: 20px; padding: 0 5px; font-size: 13px; color: #333; } +.site-doc-icon li:hover{background-color: #f2f2f2; color: #000;} + +/* 栅格示例 */ +.grid-demo{padding: 10px; line-height: 50px; text-align: center; background-color: #79C48C; color: #fff;} +.grid-demo-bg1{background-color: #63BA79;} +.grid-demo-bg2{background-color: #49A761;} +.grid-demo-bg3{background-color: #38814A;} + + +/* 演示 */ +body .layui-layout-admin .site-demo{bottom: 60px; padding: 0;} +body .site-demo-nav .layui-nav-item{line-height: 40px} +.layui-nav-item .layui-icon{position: relative; font-size: 20px;} +.layui-nav-item a cite{padding: 0 10px;} +.site-demo .layui-main{margin: 15px; line-height: 22px;} +.site-demo-editor{position: absolute; top: 0; bottom: 0; left: 0; width: 50%; } +.site-demo-area{position: absolute; top: 0; bottom: 0; width: 100%;} +.site-demo-editor textarea{position: absolute; width: 100%; height: 100%; padding: 10px; border: none; resize: none; background-color: #F7FBFF; background-color: #13151A; color: #999; font-family: Courier New; font-size: 12px; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;} +.site-demo-btn{position: absolute; bottom: 15px; right: 20px;} +.site-demo-zanzhu{position: absolute; bottom: 0; left: 0; width: 100%; height: 90px; text-align: center; background-color: #e2e2e2; overflow: hidden;} +.site-demo-zanzhu>*{position: relative; z-index: 1;} +.site-demo-zanzhu:before{content: ""; position: absolute; z-index: 0; top: 50%; left: 50%; width: 120px; margin: -10px 0px 0px -60px; text-align: center; color: rgb(170, 170, 170); font-size: 18px; font-weight: 300; } + +.site-demo-result{position: absolute; right: 0; top: 0; bottom: 0; width: 50%;} +.site-demo-result iframe{position: absolute; width: 100%; height: 100%;} + +.site-demo-button{margin-bottom: 30px;} +.site-demo-button div{margin: 20px 30px 10px;} +.site-demo-button .layui-btn+.layui-btn{margin-left: 0;} +.site-demo-button .layui-btn{margin: 0 7px 10px 0; } + +.site-demo-text a{color: #01AAED;} + +.site-demo-laytpl{text-align: center;} +.site-demo-laytpl textarea, +.site-demo-laytpl div span{width: 40%; padding: 15px; margin: 0 15px;} +.site-demo-laytpl textarea{height: 300px; border: none; background-color: #3F3F3F; color: #E3CEAB; font-family: Courier New; resize: none;} +.site-demo-laytpl div span{display: inline-block; text-align: center; background: #101010; color: #fff;} +.site-demo-tplres{margin: 10px 0; text-align: center} +.site-demo-tplres .site-demo-tplh2, +.site-demo-tplres .site-demo-tplview{display: inline-block; width: 50%;} +.site-demo-tplres h2{padding: 15px; background: #e2e2e2;} +.site-demo-tplres h3{font-weight: 700;} +.site-demo-tplres div{padding: 14px; border: 1px solid #e2e2e2; text-align: left;} + +.site-demo-upload, +.site-demo-upload img{width: 200px; height: 200px; border-radius: 100%;} +.site-demo-upload{position: relative; background: #e2e2e2;} +.site-demo-upload .site-demo-upbar{position: absolute; top: 50%; left: 50%; margin: -18px 0 0 -56px;} +.site-demo-upload .layui-upload-button{background-color: rgba(0,0,0,.2); color: rgba(255,255,255,1);} + +.site-demo-util{position: relative; width: 300px;} +.site-demo-util img{width: 300px; border-radius: 100%;} +.site-demo-util span{position: absolute; left: 0; top: 0; width: 100%; height: 100%; background: #333; cursor: pointer;} +@-webkit-keyframes demo-fengjie { + 0% {-webkit-filter: blur(0); opacity: 1; background: #fff; height: 300px; border-radius: 100%;} + 80% {-webkit-filter: blur(50px); opacity: 0.95;} + 100% {-webkit-filter: blur(20px); opacity: 0; background: #fff;} +} +@keyframes demo-fengjie { + 0% {filter: blur(0); opacity: 1; background: #fff; height: 300px; border-radius: 100%;} + 80% {filter: blur(50px); opacity: 0.95;} + 100% {filter: blur(20px); opacity: 0; background: #fff;} +} +.site-demo-fengjie{-webkit-animation-name: demo-fengjie; animation-name: demo-fengjie; -webkit-animation-duration: 5s; animation-duration: 5s;} + +.layui-layout-admin .site-demo-body{top: 106px;} +.site-demo-title{position: fixed; left: 200px; right: 0; top: 65px;} +.site-demo-code{position: absolute; left: 0; top: 0; width: 100%; height: 100%; border: none; padding: 10px; resize: none; font-size: 12px; background-color: #F7FBFF; color: #881280; font-family: Courier New;} + +.site-demo-overflow{overflow: hidden;} + +/* 其它 */ +#trans-tooltip, +#tip-arrow-bottom, +#tip-arrow-top{display: none !important;} + + +/* 独立组件 与 主页 */ +.alone{text-align: center; background-color: #009688; color: #fff; font-weight: 300; transition: all .3s; -webkit-transition: all .3s;} +.alone:hover{background-color: #5FB878;} +.alone a{display: block; padding: 50px 20px; color: #fff; font-size: 30px;} +.alone a cite{display: block; padding-top: 10px; font-size: 14px;} + + +.alone-banner{height: 190px; text-align: center; font-weight: 300; background-color: #009688; color:#fff;} +.alone-banner h1{padding-top: 60px; line-height: 32px; font-size: 30px; font-weight: 300;} +.alone-banner p{padding-top: 20px; color: #e2e2e2; color: rgba(255,255,255,.8);} + +.alone-nav .layui-tab-title li{margin-right: 30px; padding: 0; color: #666;} +.alone-nav .layui-tab-title li a{ padding: 0 20px;} + +.alone-download{margin: 30px 0;} +.alone-download .layui-btn{margin-right: 10px;} +.alone-download span{display: inline-block; line-height: 44px; padding-right: 20px;} +.alone-download span em{color: #999;} + +.alone-title{margin-top: 20px;} + +.alone-download-btn{text-align: center; margin-top: 50px; font-size: 0;} +.alone-download-btn .layui-btn{position: relative; width: 206px; height: 60px; line-height: 60px; font-size: 26px; font-weight: 300;} +.alone-download-btn .layui-btn+.layui-btn{margin: 0;} +.alone-download-btn .alone-download-right{margin-left: 20px !important; border-color: #009688; background: none; color: #009688;} +.alone-download-btn .layui-btn img{position: relative; top: -3px; width: 118px;} + + + +/* 适配多设备 */ +@media screen and (max-width: 750px) { + .layui-main{width: auto; margin: 0 10px;} + .logo, + .header-demo .logo{left: 10px;} + .component{display: none} + + .header .layui-nav-child{left: auto; right: 0;} + .site-demo-overflow{overflow: auto;} + + .site-nav-layim{display: none !important;} + .header .layui-nav .layui-nav-item{margin: 0;} + .header .layui-nav .layui-nav-item a{padding: 0 20px;} + .header .layui-nav .layui-nav-item[pc]{display: none;} + .header .layui-nav .layui-nav-item[mobile]{display: inline-block;} + .site-banner{height: 300px;} + .site-banner-bg{background-size: cover;} + .site-zfj{height: 100px; padding-top: 5px;} + .site-zfj i{top: 10px; width: 100px; height: 100px; margin-left: -50px; font-size: 100px;} + .site-desc{background-size: 70%; margin: 0;} + .site-desc .web-font-desc{padding-top: 20px; font-size: 30px;} + .site-desc cite{display: none;} + .site-download{margin-top: 0; } + .site-download a{height: 40px; line-height: 40px; padding: 0 25px 0 60px; border-radius: 30px; color: #fff; font-size: 16px;} + .site-download a cite{left: 20px;} + .site-banner-other{bottom: 10px;} + + .site-idea{margin: 20px 0;} + .site-idea li{margin: 0 0 20px 0; width: 100%; height: auto; -webkit-box-sizing: border-box !important; -moz-box-sizing: border-box !important; box-sizing: border-box !important;} + .site-hengfu img{max-width: 100%} + + .site-block .layui-form{margin-right: 0;} + + .layui-layer-dir{display: none;} + .site-tree{position: fixed; top: 0; bottom: 0; min-height: 0; overflow: auto; z-index: 1000; left: -260px; background-color: #fff; transition: all .3s; -webkit-transition: all .3s;} + .site-content{width: 100%; padding: 0; overflow: auto;} + .site-content img{max-width: 100%;} + .site-tree-mobile{display: block!important; position: fixed; z-index: 100000; bottom: 15px; left: 15px; width: 50px; height: 50px; line-height: 50px; border-radius: 2px; text-align: center; background-color: rgba(0,0,0,.7); color: #fff;} + .site-home .site-tree-mobile{display: none!important;} + .site-mobile .site-tree-mobile{display: none !important;} + .site-mobile .site-tree{left: 0;} + .site-mobile .site-mobile-shade{content: ''; position: fixed; top: 0; bottom: 0; left: 0; right: 0; background-color: rgba(0,0,0,.8); z-index: 999;} + .site-tree-mobile i{font-size: 20px;} + .layui-code-view{-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;} + + .layui-layout-admin .layui-side{position: fixed; top: 0; left: -260px; transition: all .3s; -webkit-transition: all .3s; z-index: 10000;} + .layui-body{position: static; bottom: 0; left: 0;} + .site-mobile .layui-side{left: 0;} + .site-mobile .layui-side-child{top: 50%; left: 200px; height: 300px; margin-top: -100px;} + + body .layui-layout-admin .footer-demo{position: static; height: auto; line-height: 30px;} + .footer-demo p{height: auto;} + + .site-demo-area, + .site-demo-editor, + .site-demo-result, + .site-demo-editor textarea, + .site-demo-result iframe{position: static; width: 100%;} + .site-demo-editor textarea{height: 350px;} + .site-demo-zanzhu{display: none;} + .site-demo-btn{bottom: auto; top: 370px;} + .site-demo-result iframe{height: 500px;} + + .site-demo-laytpl textarea, .site-demo-laytpl div span{margin: 0;} + .site-demo-tplres .site-demo-tplh2, .site-demo-tplres .site-demo-tplview{width: 100%; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;} + + .site-demo-title{position: static; left: 0;} + body .layui-layout-admin .site-demo{position: static;} + .site-demo-code{position: static; height: 350px;} +} + + + +@-webkit-keyframes site-anim-closeup{ /* 特写 */ + from {-webkit-transform: translate3d(0, 0, 0) scale(1); opacity: 1;} + to { -webkit-transform: translate3d(0, 400px, 0) scale(2); opacity: 0.5;} +} +@keyframes site-anim-closeup{ + from {transform: translate3d(0, 0, 0) scale(1); opacity: 1;} + to {transform: translate3d(0, 400px, 0) scale(2); opacity: 0.5;} +} +.site-out-up{-webkit-animation-duration: 3s; animation-duration: 3s; -webkit-animation-fill-mode: both; animation-fill-mode: both; -webkit-animation-name: site-anim-closeup; animation-name: site-anim-closeup; overflow: hidden;} + +.layui-table-input { + display: block; + width: 100%; + padding-left: 10px; + + height: 28px; + line-height: 1.3; + line-height: 38px\9; + border-width: 1px; + border-style: solid; + background-color: #fff; + border-radius: 2px; + border-color: #e6e6e6; +} + +.layui-table-cell .layui-input,td .layui-input,th .layui-input { + height: 28px; +} diff --git a/sop-website/src/main/resources/public/assets/image/auth.png b/sop-website/src/main/resources/public/assets/image/auth.png new file mode 100644 index 00000000..6965e7e9 Binary files /dev/null and b/sop-website/src/main/resources/public/assets/image/auth.png differ diff --git a/sop-website/src/main/resources/public/assets/js/format.js b/sop-website/src/main/resources/public/assets/js/format.js new file mode 100644 index 00000000..0e8a22f3 --- /dev/null +++ b/sop-website/src/main/resources/public/assets/js/format.js @@ -0,0 +1,44 @@ +/** + * 格式化json字符串. + * alert(formatJson('{"code":"0","data":[{"goods_name":"iPhoneX","id":1,"price":8000},{"goods_name":"三星","id":2,"price":7000}]}')) + * @param txt json串 + * @param compress + * @returns + */ +function formatJson(txt,compress/*是否为压缩模式*/){/* 格式化JSON源码(对象转换为JSON文本) */ + var indentChar = ' '; + if(/^\s*$/.test(txt)){ + return ''; + } + try{var data=eval('('+txt+')');} + catch(e){ + console.error('json格式错误,无法格式化,格式化内容:' + txt); + return txt; + }; + var draw=[],last=false,This=this,line=compress?'':'\n',nodeCount=0,maxDepth=0; + + var notify=function(name,value,isLast,indent/*缩进*/,formObj){ + nodeCount++;/*节点计数*/ + for (var i=0,tab='';i=0&&c0&&b-1 in a)}var x=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+1*new Date,v=a.document,w=0,x=0,y=ha(),z=ha(),A=ha(),B=function(a,b){return a===b&&(l=!0),0},C={}.hasOwnProperty,D=[],E=D.pop,F=D.push,G=D.push,H=D.slice,I=function(a,b){for(var c=0,d=a.length;c+~]|"+K+")"+K+"*"),S=new RegExp("="+K+"*([^\\]'\"]*?)"+K+"*\\]","g"),T=new RegExp(N),U=new RegExp("^"+L+"$"),V={ID:new RegExp("^#("+L+")"),CLASS:new RegExp("^\\.("+L+")"),TAG:new RegExp("^("+L+"|[*])"),ATTR:new RegExp("^"+M),PSEUDO:new RegExp("^"+N),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+K+"*(even|odd|(([+-]|)(\\d*)n|)"+K+"*(?:([+-]|)"+K+"*(\\d+)|))"+K+"*\\)|)","i"),bool:new RegExp("^(?:"+J+")$","i"),needsContext:new RegExp("^"+K+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+K+"*((?:-\\d)?\\d*)"+K+"*\\)|)(?=[^-]|$)","i")},W=/^(?:input|select|textarea|button)$/i,X=/^h\d$/i,Y=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,$=/[+~]/,_=new RegExp("\\\\([\\da-f]{1,6}"+K+"?|("+K+")|.)","ig"),aa=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:d<0?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)},ba=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ca=function(a,b){return b?"\0"===a?"\ufffd":a.slice(0,-1)+"\\"+a.charCodeAt(a.length-1).toString(16)+" ":"\\"+a},da=function(){m()},ea=ta(function(a){return a.disabled===!0&&("form"in a||"label"in a)},{dir:"parentNode",next:"legend"});try{G.apply(D=H.call(v.childNodes),v.childNodes),D[v.childNodes.length].nodeType}catch(fa){G={apply:D.length?function(a,b){F.apply(a,H.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function ga(a,b,d,e){var f,h,j,k,l,o,r,s=b&&b.ownerDocument,w=b?b.nodeType:9;if(d=d||[],"string"!=typeof a||!a||1!==w&&9!==w&&11!==w)return d;if(!e&&((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,p)){if(11!==w&&(l=Z.exec(a)))if(f=l[1]){if(9===w){if(!(j=b.getElementById(f)))return d;if(j.id===f)return d.push(j),d}else if(s&&(j=s.getElementById(f))&&t(b,j)&&j.id===f)return d.push(j),d}else{if(l[2])return G.apply(d,b.getElementsByTagName(a)),d;if((f=l[3])&&c.getElementsByClassName&&b.getElementsByClassName)return G.apply(d,b.getElementsByClassName(f)),d}if(c.qsa&&!A[a+" "]&&(!q||!q.test(a))){if(1!==w)s=b,r=a;else if("object"!==b.nodeName.toLowerCase()){(k=b.getAttribute("id"))?k=k.replace(ba,ca):b.setAttribute("id",k=u),o=g(a),h=o.length;while(h--)o[h]="#"+k+" "+sa(o[h]);r=o.join(","),s=$.test(a)&&qa(b.parentNode)||b}if(r)try{return G.apply(d,s.querySelectorAll(r)),d}catch(x){}finally{k===u&&b.removeAttribute("id")}}}return i(a.replace(P,"$1"),b,d,e)}function ha(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function ia(a){return a[u]=!0,a}function ja(a){var b=n.createElement("fieldset");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function ka(a,b){var c=a.split("|"),e=c.length;while(e--)d.attrHandle[c[e]]=b}function la(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&a.sourceIndex-b.sourceIndex;if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function ma(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function na(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function oa(a){return function(b){return"form"in b?b.parentNode&&b.disabled===!1?"label"in b?"label"in b.parentNode?b.parentNode.disabled===a:b.disabled===a:b.isDisabled===a||b.isDisabled!==!a&&ea(b)===a:b.disabled===a:"label"in b&&b.disabled===a}}function pa(a){return ia(function(b){return b=+b,ia(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function qa(a){return a&&"undefined"!=typeof a.getElementsByTagName&&a}c=ga.support={},f=ga.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return!!b&&"HTML"!==b.nodeName},m=ga.setDocument=function(a){var b,e,g=a?a.ownerDocument||a:v;return g!==n&&9===g.nodeType&&g.documentElement?(n=g,o=n.documentElement,p=!f(n),v!==n&&(e=n.defaultView)&&e.top!==e&&(e.addEventListener?e.addEventListener("unload",da,!1):e.attachEvent&&e.attachEvent("onunload",da)),c.attributes=ja(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ja(function(a){return a.appendChild(n.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=Y.test(n.getElementsByClassName),c.getById=ja(function(a){return o.appendChild(a).id=u,!n.getElementsByName||!n.getElementsByName(u).length}),c.getById?(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){return a.getAttribute("id")===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c=b.getElementById(a);return c?[c]:[]}}):(d.filter.ID=function(a){var b=a.replace(_,aa);return function(a){var c="undefined"!=typeof a.getAttributeNode&&a.getAttributeNode("id");return c&&c.value===b}},d.find.ID=function(a,b){if("undefined"!=typeof b.getElementById&&p){var c,d,e,f=b.getElementById(a);if(f){if(c=f.getAttributeNode("id"),c&&c.value===a)return[f];e=b.getElementsByName(a),d=0;while(f=e[d++])if(c=f.getAttributeNode("id"),c&&c.value===a)return[f]}return[]}}),d.find.TAG=c.getElementsByTagName?function(a,b){return"undefined"!=typeof b.getElementsByTagName?b.getElementsByTagName(a):c.qsa?b.querySelectorAll(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){if("undefined"!=typeof b.getElementsByClassName&&p)return b.getElementsByClassName(a)},r=[],q=[],(c.qsa=Y.test(n.querySelectorAll))&&(ja(function(a){o.appendChild(a).innerHTML="",a.querySelectorAll("[msallowcapture^='']").length&&q.push("[*^$]="+K+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+K+"*(?:value|"+J+")"),a.querySelectorAll("[id~="+u+"-]").length||q.push("~="),a.querySelectorAll(":checked").length||q.push(":checked"),a.querySelectorAll("a#"+u+"+*").length||q.push(".#.+[+~]")}),ja(function(a){a.innerHTML="";var b=n.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+K+"*[*^$|!~]?="),2!==a.querySelectorAll(":enabled").length&&q.push(":enabled",":disabled"),o.appendChild(a).disabled=!0,2!==a.querySelectorAll(":disabled").length&&q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=Y.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ja(function(a){c.disconnectedMatch=s.call(a,"*"),s.call(a,"[s!='']:x"),r.push("!=",N)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=Y.test(o.compareDocumentPosition),t=b||Y.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===n||a.ownerDocument===v&&t(v,a)?-1:b===n||b.ownerDocument===v&&t(v,b)?1:k?I(k,a)-I(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,e=a.parentNode,f=b.parentNode,g=[a],h=[b];if(!e||!f)return a===n?-1:b===n?1:e?-1:f?1:k?I(k,a)-I(k,b):0;if(e===f)return la(a,b);c=a;while(c=c.parentNode)g.unshift(c);c=b;while(c=c.parentNode)h.unshift(c);while(g[d]===h[d])d++;return d?la(g[d],h[d]):g[d]===v?-1:h[d]===v?1:0},n):n},ga.matches=function(a,b){return ga(a,null,null,b)},ga.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(S,"='$1']"),c.matchesSelector&&p&&!A[b+" "]&&(!r||!r.test(b))&&(!q||!q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return ga(b,n,null,[a]).length>0},ga.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},ga.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&C.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},ga.escape=function(a){return(a+"").replace(ba,ca)},ga.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},ga.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=ga.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=ga.selectors={cacheLength:50,createPseudo:ia,match:V,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(_,aa),a[3]=(a[3]||a[4]||a[5]||"").replace(_,aa),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||ga.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&ga.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return V.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&T.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(_,aa).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+K+")"+a+"("+K+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||"undefined"!=typeof a.getAttribute&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=ga.attr(d,a);return null==e?"!="===b:!b||(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e.replace(O," ")+" ").indexOf(c)>-1:"|="===b&&(e===c||e.slice(0,c.length+1)===c+"-"))}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h,t=!1;if(q){if(f){while(p){m=b;while(m=m[p])if(h?m.nodeName.toLowerCase()===r:1===m.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){m=q,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n&&j[2],m=n&&q.childNodes[n];while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if(1===m.nodeType&&++t&&m===b){k[a]=[w,n,t];break}}else if(s&&(m=b,l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),j=k[a]||[],n=j[0]===w&&j[1],t=n),t===!1)while(m=++n&&m&&m[p]||(t=n=0)||o.pop())if((h?m.nodeName.toLowerCase()===r:1===m.nodeType)&&++t&&(s&&(l=m[u]||(m[u]={}),k=l[m.uniqueID]||(l[m.uniqueID]={}),k[a]=[w,t]),m===b))break;return t-=e,t===d||t%d===0&&t/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||ga.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?ia(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=I(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:ia(function(a){var b=[],c=[],d=h(a.replace(P,"$1"));return d[u]?ia(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),b[0]=null,!c.pop()}}),has:ia(function(a){return function(b){return ga(a,b).length>0}}),contains:ia(function(a){return a=a.replace(_,aa),function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:ia(function(a){return U.test(a||"")||ga.error("unsupported lang: "+a),a=a.replace(_,aa).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:oa(!1),disabled:oa(!0),checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return X.test(a.nodeName)},input:function(a){return W.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:pa(function(){return[0]}),last:pa(function(a,b){return[b-1]}),eq:pa(function(a,b,c){return[c<0?c+b:c]}),even:pa(function(a,b){for(var c=0;c=0;)a.push(d);return a}),gt:pa(function(a,b,c){for(var d=c<0?c+b:c;++d1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function va(a,b,c){for(var d=0,e=b.length;d-1&&(f[j]=!(g[j]=l))}}else r=wa(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):G.apply(g,r)})}function ya(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=ta(function(a){return a===b},h,!0),l=ta(function(a){return I(b,a)>-1},h,!0),m=[function(a,c,d){var e=!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d));return b=null,e}];i1&&ua(m),i>1&&sa(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(P,"$1"),c,i0,e=a.length>0,f=function(f,g,h,i,k){var l,o,q,r=0,s="0",t=f&&[],u=[],v=j,x=f||e&&d.find.TAG("*",k),y=w+=null==v?1:Math.random()||.1,z=x.length;for(k&&(j=g===n||g||k);s!==z&&null!=(l=x[s]);s++){if(e&&l){o=0,g||l.ownerDocument===n||(m(l),h=!p);while(q=a[o++])if(q(l,g||n,h)){i.push(l);break}k&&(w=y)}c&&((l=!q&&l)&&r--,f&&t.push(l))}if(r+=s,c&&s!==r){o=0;while(q=b[o++])q(t,u,g,h);if(f){if(r>0)while(s--)t[s]||u[s]||(u[s]=E.call(i));u=wa(u)}G.apply(i,u),k&&!f&&u.length>0&&r+b.length>1&&ga.uniqueSort(i)}return k&&(w=y,j=v),t};return c?ia(f):f}return h=ga.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=ya(b[c]),f[u]?d.push(f):e.push(f);f=A(a,za(e,d)),f.selector=a}return f},i=ga.select=function(a,b,c,e){var f,i,j,k,l,m="function"==typeof a&&a,n=!e&&g(a=m.selector||a);if(c=c||[],1===n.length){if(i=n[0]=n[0].slice(0),i.length>2&&"ID"===(j=i[0]).type&&9===b.nodeType&&p&&d.relative[i[1].type]){if(b=(d.find.ID(j.matches[0].replace(_,aa),b)||[])[0],!b)return c;m&&(b=b.parentNode),a=a.slice(i.shift().value.length)}f=V.needsContext.test(a)?0:i.length;while(f--){if(j=i[f],d.relative[k=j.type])break;if((l=d.find[k])&&(e=l(j.matches[0].replace(_,aa),$.test(i[0].type)&&qa(b.parentNode)||b))){if(i.splice(f,1),a=e.length&&sa(i),!a)return G.apply(c,e),c;break}}}return(m||h(a,n))(e,b,!p,c,!b||$.test(a)&&qa(b.parentNode)||b),c},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ja(function(a){return 1&a.compareDocumentPosition(n.createElement("fieldset"))}),ja(function(a){return a.innerHTML="","#"===a.firstChild.getAttribute("href")})||ka("type|href|height|width",function(a,b,c){if(!c)return a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ja(function(a){return a.innerHTML="",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||ka("value",function(a,b,c){if(!c&&"input"===a.nodeName.toLowerCase())return a.defaultValue}),ja(function(a){return null==a.getAttribute("disabled")})||ka(J,function(a,b,c){var d;if(!c)return a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),ga}(a);r.find=x,r.expr=x.selectors,r.expr[":"]=r.expr.pseudos,r.uniqueSort=r.unique=x.uniqueSort,r.text=x.getText,r.isXMLDoc=x.isXML,r.contains=x.contains,r.escapeSelector=x.escape;var y=function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&r(a).is(c))break;d.push(a)}return d},z=function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c},A=r.expr.match.needsContext;function B(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()}var C=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i,D=/^.[^:#\[\.,]*$/;function E(a,b,c){return r.isFunction(b)?r.grep(a,function(a,d){return!!b.call(a,d,a)!==c}):b.nodeType?r.grep(a,function(a){return a===b!==c}):"string"!=typeof b?r.grep(a,function(a){return i.call(b,a)>-1!==c}):D.test(b)?r.filter(b,a,c):(b=r.filter(b,a),r.grep(a,function(a){return i.call(b,a)>-1!==c&&1===a.nodeType}))}r.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?r.find.matchesSelector(d,a)?[d]:[]:r.find.matches(a,r.grep(b,function(a){return 1===a.nodeType}))},r.fn.extend({find:function(a){var b,c,d=this.length,e=this;if("string"!=typeof a)return this.pushStack(r(a).filter(function(){for(b=0;b1?r.uniqueSort(c):c},filter:function(a){return this.pushStack(E(this,a||[],!1))},not:function(a){return this.pushStack(E(this,a||[],!0))},is:function(a){return!!E(this,"string"==typeof a&&A.test(a)?r(a):a||[],!1).length}});var F,G=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/,H=r.fn.init=function(a,b,c){var e,f;if(!a)return this;if(c=c||F,"string"==typeof a){if(e="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:G.exec(a),!e||!e[1]&&b)return!b||b.jquery?(b||c).find(a):this.constructor(b).find(a);if(e[1]){if(b=b instanceof r?b[0]:b,r.merge(this,r.parseHTML(e[1],b&&b.nodeType?b.ownerDocument||b:d,!0)),C.test(e[1])&&r.isPlainObject(b))for(e in b)r.isFunction(this[e])?this[e](b[e]):this.attr(e,b[e]);return this}return f=d.getElementById(e[2]),f&&(this[0]=f,this.length=1),this}return a.nodeType?(this[0]=a,this.length=1,this):r.isFunction(a)?void 0!==c.ready?c.ready(a):a(r):r.makeArray(a,this)};H.prototype=r.fn,F=r(d);var I=/^(?:parents|prev(?:Until|All))/,J={children:!0,contents:!0,next:!0,prev:!0};r.fn.extend({has:function(a){var b=r(a,this),c=b.length;return this.filter(function(){for(var a=0;a-1:1===c.nodeType&&r.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?r.uniqueSort(f):f)},index:function(a){return a?"string"==typeof a?i.call(r(a),this[0]):i.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(r.uniqueSort(r.merge(this.get(),r(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function K(a,b){while((a=a[b])&&1!==a.nodeType);return a}r.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return y(a,"parentNode")},parentsUntil:function(a,b,c){return y(a,"parentNode",c)},next:function(a){return K(a,"nextSibling")},prev:function(a){return K(a,"previousSibling")},nextAll:function(a){return y(a,"nextSibling")},prevAll:function(a){return y(a,"previousSibling")},nextUntil:function(a,b,c){return y(a,"nextSibling",c)},prevUntil:function(a,b,c){return y(a,"previousSibling",c)},siblings:function(a){return z((a.parentNode||{}).firstChild,a)},children:function(a){return z(a.firstChild)},contents:function(a){return B(a,"iframe")?a.contentDocument:(B(a,"template")&&(a=a.content||a),r.merge([],a.childNodes))}},function(a,b){r.fn[a]=function(c,d){var e=r.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=r.filter(d,e)),this.length>1&&(J[a]||r.uniqueSort(e),I.test(a)&&e.reverse()),this.pushStack(e)}});var L=/[^\x20\t\r\n\f]+/g;function M(a){var b={};return r.each(a.match(L)||[],function(a,c){b[c]=!0}),b}r.Callbacks=function(a){a="string"==typeof a?M(a):r.extend({},a);var b,c,d,e,f=[],g=[],h=-1,i=function(){for(e=e||a.once,d=b=!0;g.length;h=-1){c=g.shift();while(++h-1)f.splice(c,1),c<=h&&h--}),this},has:function(a){return a?r.inArray(a,f)>-1:f.length>0},empty:function(){return f&&(f=[]),this},disable:function(){return e=g=[],f=c="",this},disabled:function(){return!f},lock:function(){return e=g=[],c||b||(f=c=""),this},locked:function(){return!!e},fireWith:function(a,c){return e||(c=c||[],c=[a,c.slice?c.slice():c],g.push(c),b||i()),this},fire:function(){return j.fireWith(this,arguments),this},fired:function(){return!!d}};return j};function N(a){return a}function O(a){throw a}function P(a,b,c,d){var e;try{a&&r.isFunction(e=a.promise)?e.call(a).done(b).fail(c):a&&r.isFunction(e=a.then)?e.call(a,b,c):b.apply(void 0,[a].slice(d))}catch(a){c.apply(void 0,[a])}}r.extend({Deferred:function(b){var c=[["notify","progress",r.Callbacks("memory"),r.Callbacks("memory"),2],["resolve","done",r.Callbacks("once memory"),r.Callbacks("once memory"),0,"resolved"],["reject","fail",r.Callbacks("once memory"),r.Callbacks("once memory"),1,"rejected"]],d="pending",e={state:function(){return d},always:function(){return f.done(arguments).fail(arguments),this},"catch":function(a){return e.then(null,a)},pipe:function(){var a=arguments;return r.Deferred(function(b){r.each(c,function(c,d){var e=r.isFunction(a[d[4]])&&a[d[4]];f[d[1]](function(){var a=e&&e.apply(this,arguments);a&&r.isFunction(a.promise)?a.promise().progress(b.notify).done(b.resolve).fail(b.reject):b[d[0]+"With"](this,e?[a]:arguments)})}),a=null}).promise()},then:function(b,d,e){var f=0;function g(b,c,d,e){return function(){var h=this,i=arguments,j=function(){var a,j;if(!(b=f&&(d!==O&&(h=void 0,i=[a]),c.rejectWith(h,i))}};b?k():(r.Deferred.getStackHook&&(k.stackTrace=r.Deferred.getStackHook()),a.setTimeout(k))}}return r.Deferred(function(a){c[0][3].add(g(0,a,r.isFunction(e)?e:N,a.notifyWith)),c[1][3].add(g(0,a,r.isFunction(b)?b:N)),c[2][3].add(g(0,a,r.isFunction(d)?d:O))}).promise()},promise:function(a){return null!=a?r.extend(a,e):e}},f={};return r.each(c,function(a,b){var g=b[2],h=b[5];e[b[1]]=g.add,h&&g.add(function(){d=h},c[3-a][2].disable,c[0][2].lock),g.add(b[3].fire),f[b[0]]=function(){return f[b[0]+"With"](this===f?void 0:this,arguments),this},f[b[0]+"With"]=g.fireWith}),e.promise(f),b&&b.call(f,f),f},when:function(a){var b=arguments.length,c=b,d=Array(c),e=f.call(arguments),g=r.Deferred(),h=function(a){return function(c){d[a]=this,e[a]=arguments.length>1?f.call(arguments):c,--b||g.resolveWith(d,e)}};if(b<=1&&(P(a,g.done(h(c)).resolve,g.reject,!b),"pending"===g.state()||r.isFunction(e[c]&&e[c].then)))return g.then();while(c--)P(e[c],h(c),g.reject);return g.promise()}});var Q=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;r.Deferred.exceptionHook=function(b,c){a.console&&a.console.warn&&b&&Q.test(b.name)&&a.console.warn("jQuery.Deferred exception: "+b.message,b.stack,c)},r.readyException=function(b){a.setTimeout(function(){throw b})};var R=r.Deferred();r.fn.ready=function(a){return R.then(a)["catch"](function(a){r.readyException(a)}),this},r.extend({isReady:!1,readyWait:1,ready:function(a){(a===!0?--r.readyWait:r.isReady)||(r.isReady=!0,a!==!0&&--r.readyWait>0||R.resolveWith(d,[r]))}}),r.ready.then=R.then;function S(){d.removeEventListener("DOMContentLoaded",S), + a.removeEventListener("load",S),r.ready()}"complete"===d.readyState||"loading"!==d.readyState&&!d.documentElement.doScroll?a.setTimeout(r.ready):(d.addEventListener("DOMContentLoaded",S),a.addEventListener("load",S));var T=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===r.type(c)){e=!0;for(h in c)T(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,r.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(r(a),c)})),b))for(;h1,null,!0)},removeData:function(a){return this.each(function(){X.remove(this,a)})}}),r.extend({queue:function(a,b,c){var d;if(a)return b=(b||"fx")+"queue",d=W.get(a,b),c&&(!d||Array.isArray(c)?d=W.access(a,b,r.makeArray(c)):d.push(c)),d||[]},dequeue:function(a,b){b=b||"fx";var c=r.queue(a,b),d=c.length,e=c.shift(),f=r._queueHooks(a,b),g=function(){r.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return W.get(a,c)||W.access(a,c,{empty:r.Callbacks("once memory").add(function(){W.remove(a,[b+"queue",c])})})}}),r.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length\x20\t\r\n\f]+)/i,la=/^$|\/(?:java|ecma)script/i,ma={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};ma.optgroup=ma.option,ma.tbody=ma.tfoot=ma.colgroup=ma.caption=ma.thead,ma.th=ma.td;function na(a,b){var c;return c="undefined"!=typeof a.getElementsByTagName?a.getElementsByTagName(b||"*"):"undefined"!=typeof a.querySelectorAll?a.querySelectorAll(b||"*"):[],void 0===b||b&&B(a,b)?r.merge([a],c):c}function oa(a,b){for(var c=0,d=a.length;c-1)e&&e.push(f);else if(j=r.contains(f.ownerDocument,f),g=na(l.appendChild(f),"script"),j&&oa(g),c){k=0;while(f=g[k++])la.test(f.type||"")&&c.push(f)}return l}!function(){var a=d.createDocumentFragment(),b=a.appendChild(d.createElement("div")),c=d.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),o.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="",o.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var ra=d.documentElement,sa=/^key/,ta=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,ua=/^([^.]*)(?:\.(.+)|)/;function va(){return!0}function wa(){return!1}function xa(){try{return d.activeElement}catch(a){}}function ya(a,b,c,d,e,f){var g,h;if("object"==typeof b){"string"!=typeof c&&(d=d||c,c=void 0);for(h in b)ya(a,h,c,d,b[h],f);return a}if(null==d&&null==e?(e=c,d=c=void 0):null==e&&("string"==typeof c?(e=d,d=void 0):(e=d,d=c,c=void 0)),e===!1)e=wa;else if(!e)return a;return 1===f&&(g=e,e=function(a){return r().off(a),g.apply(this,arguments)},e.guid=g.guid||(g.guid=r.guid++)),a.each(function(){r.event.add(this,b,e,d,c)})}r.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.get(a);if(q){c.handler&&(f=c,c=f.handler,e=f.selector),e&&r.find.matchesSelector(ra,e),c.guid||(c.guid=r.guid++),(i=q.events)||(i=q.events={}),(g=q.handle)||(g=q.handle=function(b){return"undefined"!=typeof r&&r.event.triggered!==b.type?r.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(L)||[""],j=b.length;while(j--)h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n&&(l=r.event.special[n]||{},n=(e?l.delegateType:l.bindType)||n,l=r.event.special[n]||{},k=r.extend({type:n,origType:p,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&r.expr.match.needsContext.test(e),namespace:o.join(".")},f),(m=i[n])||(m=i[n]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,o,g)!==!1||a.addEventListener&&a.addEventListener(n,g)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),r.event.global[n]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,n,o,p,q=W.hasData(a)&&W.get(a);if(q&&(i=q.events)){b=(b||"").match(L)||[""],j=b.length;while(j--)if(h=ua.exec(b[j])||[],n=p=h[1],o=(h[2]||"").split(".").sort(),n){l=r.event.special[n]||{},n=(d?l.delegateType:l.bindType)||n,m=i[n]||[],h=h[2]&&new RegExp("(^|\\.)"+o.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&p!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,o,q.handle)!==!1||r.removeEvent(a,n,q.handle),delete i[n])}else for(n in i)r.event.remove(a,n+b[j],c,d,!0);r.isEmptyObject(i)&&W.remove(a,"handle events")}},dispatch:function(a){var b=r.event.fix(a),c,d,e,f,g,h,i=new Array(arguments.length),j=(W.get(this,"events")||{})[b.type]||[],k=r.event.special[b.type]||{};for(i[0]=b,c=1;c=1))for(;j!==this;j=j.parentNode||this)if(1===j.nodeType&&("click"!==a.type||j.disabled!==!0)){for(f=[],g={},c=0;c-1:r.find(e,this,null,[j]).length),g[e]&&f.push(d);f.length&&h.push({elem:j,handlers:f})}return j=this,i\x20\t\r\n\f]*)[^>]*)\/>/gi,Aa=/\s*$/g;function Ea(a,b){return B(a,"table")&&B(11!==b.nodeType?b:b.firstChild,"tr")?r(">tbody",a)[0]||a:a}function Fa(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function Ga(a){var b=Ca.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function Ha(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(W.hasData(a)&&(f=W.access(a),g=W.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;c1&&"string"==typeof q&&!o.checkClone&&Ba.test(q))return a.each(function(e){var f=a.eq(e);s&&(b[0]=q.call(this,e,f.html())),Ja(f,b,c,d)});if(m&&(e=qa(b,a[0].ownerDocument,!1,a,d),f=e.firstChild,1===e.childNodes.length&&(e=f),f||d)){for(h=r.map(na(e,"script"),Fa),i=h.length;l")},clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=r.contains(a.ownerDocument,a);if(!(o.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||r.isXMLDoc(a)))for(g=na(h),f=na(a),d=0,e=f.length;d0&&oa(g,!i&&na(a,"script")),h},cleanData:function(a){for(var b,c,d,e=r.event.special,f=0;void 0!==(c=a[f]);f++)if(U(c)){if(b=c[W.expando]){if(b.events)for(d in b.events)e[d]?r.event.remove(c,d):r.removeEvent(c,d,b.handle);c[W.expando]=void 0}c[X.expando]&&(c[X.expando]=void 0)}}}),r.fn.extend({detach:function(a){return Ka(this,a,!0)},remove:function(a){return Ka(this,a)},text:function(a){return T(this,function(a){return void 0===a?r.text(this):this.empty().each(function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=a)})},null,a,arguments.length)},append:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.appendChild(a)}})},prepend:function(){return Ja(this,arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=Ea(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return Ja(this,arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(r.cleanData(na(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null!=a&&a,b=null==b?a:b,this.map(function(){return r.clone(this,a,b)})},html:function(a){return T(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!Aa.test(a)&&!ma[(ka.exec(a)||["",""])[1].toLowerCase()]){a=r.htmlPrefilter(a);try{for(;c1)}});function _a(a,b,c,d,e){return new _a.prototype.init(a,b,c,d,e)}r.Tween=_a,_a.prototype={constructor:_a,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||r.easing._default,this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(r.cssNumber[c]?"":"px")},cur:function(){var a=_a.propHooks[this.prop];return a&&a.get?a.get(this):_a.propHooks._default.get(this)},run:function(a){var b,c=_a.propHooks[this.prop];return this.options.duration?this.pos=b=r.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):this.pos=b=a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):_a.propHooks._default.set(this),this}},_a.prototype.init.prototype=_a.prototype,_a.propHooks={_default:{get:function(a){var b;return 1!==a.elem.nodeType||null!=a.elem[a.prop]&&null==a.elem.style[a.prop]?a.elem[a.prop]:(b=r.css(a.elem,a.prop,""),b&&"auto"!==b?b:0)},set:function(a){r.fx.step[a.prop]?r.fx.step[a.prop](a):1!==a.elem.nodeType||null==a.elem.style[r.cssProps[a.prop]]&&!r.cssHooks[a.prop]?a.elem[a.prop]=a.now:r.style(a.elem,a.prop,a.now+a.unit)}}},_a.propHooks.scrollTop=_a.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},r.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2},_default:"swing"},r.fx=_a.prototype.init,r.fx.step={};var ab,bb,cb=/^(?:toggle|show|hide)$/,db=/queueHooks$/;function eb(){bb&&(d.hidden===!1&&a.requestAnimationFrame?a.requestAnimationFrame(eb):a.setTimeout(eb,r.fx.interval),r.fx.tick())}function fb(){return a.setTimeout(function(){ab=void 0}),ab=r.now()}function gb(a,b){var c,d=0,e={height:a};for(b=b?1:0;d<4;d+=2-b)c=ca[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function hb(a,b,c){for(var d,e=(kb.tweeners[b]||[]).concat(kb.tweeners["*"]),f=0,g=e.length;f1)},removeAttr:function(a){return this.each(function(){r.removeAttr(this,a)})}}),r.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return"undefined"==typeof a.getAttribute?r.prop(a,b,c):(1===f&&r.isXMLDoc(a)||(e=r.attrHooks[b.toLowerCase()]||(r.expr.match.bool.test(b)?lb:void 0)),void 0!==c?null===c?void r.removeAttr(a,b):e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:(a.setAttribute(b,c+""),c):e&&"get"in e&&null!==(d=e.get(a,b))?d:(d=r.find.attr(a,b), + null==d?void 0:d))},attrHooks:{type:{set:function(a,b){if(!o.radioValue&&"radio"===b&&B(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}},removeAttr:function(a,b){var c,d=0,e=b&&b.match(L);if(e&&1===a.nodeType)while(c=e[d++])a.removeAttribute(c)}}),lb={set:function(a,b,c){return b===!1?r.removeAttr(a,c):a.setAttribute(c,c),c}},r.each(r.expr.match.bool.source.match(/\w+/g),function(a,b){var c=mb[b]||r.find.attr;mb[b]=function(a,b,d){var e,f,g=b.toLowerCase();return d||(f=mb[g],mb[g]=e,e=null!=c(a,b,d)?g:null,mb[g]=f),e}});var nb=/^(?:input|select|textarea|button)$/i,ob=/^(?:a|area)$/i;r.fn.extend({prop:function(a,b){return T(this,r.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[r.propFix[a]||a]})}}),r.extend({prop:function(a,b,c){var d,e,f=a.nodeType;if(3!==f&&8!==f&&2!==f)return 1===f&&r.isXMLDoc(a)||(b=r.propFix[b]||b,e=r.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){var b=r.find.attr(a,"tabindex");return b?parseInt(b,10):nb.test(a.nodeName)||ob.test(a.nodeName)&&a.href?0:-1}}},propFix:{"for":"htmlFor","class":"className"}}),o.optSelected||(r.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null},set:function(a){var b=a.parentNode;b&&(b.selectedIndex,b.parentNode&&b.parentNode.selectedIndex)}}),r.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){r.propFix[this.toLowerCase()]=this});function pb(a){var b=a.match(L)||[];return b.join(" ")}function qb(a){return a.getAttribute&&a.getAttribute("class")||""}r.fn.extend({addClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).addClass(a.call(this,b,qb(this)))});if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])d.indexOf(" "+f+" ")<0&&(d+=f+" ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},removeClass:function(a){var b,c,d,e,f,g,h,i=0;if(r.isFunction(a))return this.each(function(b){r(this).removeClass(a.call(this,b,qb(this)))});if(!arguments.length)return this.attr("class","");if("string"==typeof a&&a){b=a.match(L)||[];while(c=this[i++])if(e=qb(c),d=1===c.nodeType&&" "+pb(e)+" "){g=0;while(f=b[g++])while(d.indexOf(" "+f+" ")>-1)d=d.replace(" "+f+" "," ");h=pb(d),e!==h&&c.setAttribute("class",h)}}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):r.isFunction(a)?this.each(function(c){r(this).toggleClass(a.call(this,c,qb(this),b),b)}):this.each(function(){var b,d,e,f;if("string"===c){d=0,e=r(this),f=a.match(L)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else void 0!==a&&"boolean"!==c||(b=qb(this),b&&W.set(this,"__className__",b),this.setAttribute&&this.setAttribute("class",b||a===!1?"":W.get(this,"__className__")||""))})},hasClass:function(a){var b,c,d=0;b=" "+a+" ";while(c=this[d++])if(1===c.nodeType&&(" "+pb(qb(c))+" ").indexOf(b)>-1)return!0;return!1}});var rb=/\r/g;r.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=r.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,r(this).val()):a,null==e?e="":"number"==typeof e?e+="":Array.isArray(e)&&(e=r.map(e,function(a){return null==a?"":a+""})),b=r.valHooks[this.type]||r.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=r.valHooks[e.type]||r.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(rb,""):null==c?"":c)}}}),r.extend({valHooks:{option:{get:function(a){var b=r.find.attr(a,"value");return null!=b?b:pb(r.text(a))}},select:{get:function(a){var b,c,d,e=a.options,f=a.selectedIndex,g="select-one"===a.type,h=g?null:[],i=g?f+1:e.length;for(d=f<0?i:g?f:0;d-1)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),r.each(["radio","checkbox"],function(){r.valHooks[this]={set:function(a,b){if(Array.isArray(b))return a.checked=r.inArray(r(a).val(),b)>-1}},o.checkOn||(r.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})});var sb=/^(?:focusinfocus|focusoutblur)$/;r.extend(r.event,{trigger:function(b,c,e,f){var g,h,i,j,k,m,n,o=[e||d],p=l.call(b,"type")?b.type:b,q=l.call(b,"namespace")?b.namespace.split("."):[];if(h=i=e=e||d,3!==e.nodeType&&8!==e.nodeType&&!sb.test(p+r.event.triggered)&&(p.indexOf(".")>-1&&(q=p.split("."),p=q.shift(),q.sort()),k=p.indexOf(":")<0&&"on"+p,b=b[r.expando]?b:new r.Event(p,"object"==typeof b&&b),b.isTrigger=f?2:3,b.namespace=q.join("."),b.rnamespace=b.namespace?new RegExp("(^|\\.)"+q.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=e),c=null==c?[b]:r.makeArray(c,[b]),n=r.event.special[p]||{},f||!n.trigger||n.trigger.apply(e,c)!==!1)){if(!f&&!n.noBubble&&!r.isWindow(e)){for(j=n.delegateType||p,sb.test(j+p)||(h=h.parentNode);h;h=h.parentNode)o.push(h),i=h;i===(e.ownerDocument||d)&&o.push(i.defaultView||i.parentWindow||a)}g=0;while((h=o[g++])&&!b.isPropagationStopped())b.type=g>1?j:n.bindType||p,m=(W.get(h,"events")||{})[b.type]&&W.get(h,"handle"),m&&m.apply(h,c),m=k&&h[k],m&&m.apply&&U(h)&&(b.result=m.apply(h,c),b.result===!1&&b.preventDefault());return b.type=p,f||b.isDefaultPrevented()||n._default&&n._default.apply(o.pop(),c)!==!1||!U(e)||k&&r.isFunction(e[p])&&!r.isWindow(e)&&(i=e[k],i&&(e[k]=null),r.event.triggered=p,e[p](),r.event.triggered=void 0,i&&(e[k]=i)),b.result}},simulate:function(a,b,c){var d=r.extend(new r.Event,c,{type:a,isSimulated:!0});r.event.trigger(d,null,b)}}),r.fn.extend({trigger:function(a,b){return this.each(function(){r.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];if(c)return r.event.trigger(a,b,c,!0)}}),r.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(a,b){r.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),r.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)}}),o.focusin="onfocusin"in a,o.focusin||r.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){r.event.simulate(b,a.target,r.event.fix(a))};r.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=W.access(d,b);e||d.addEventListener(a,c,!0),W.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=W.access(d,b)-1;e?W.access(d,b,e):(d.removeEventListener(a,c,!0),W.remove(d,b))}}});var tb=a.location,ub=r.now(),vb=/\?/;r.parseXML=function(b){var c;if(!b||"string"!=typeof b)return null;try{c=(new a.DOMParser).parseFromString(b,"text/xml")}catch(d){c=void 0}return c&&!c.getElementsByTagName("parsererror").length||r.error("Invalid XML: "+b),c};var wb=/\[\]$/,xb=/\r?\n/g,yb=/^(?:submit|button|image|reset|file)$/i,zb=/^(?:input|select|textarea|keygen)/i;function Ab(a,b,c,d){var e;if(Array.isArray(b))r.each(b,function(b,e){c||wb.test(a)?d(a,e):Ab(a+"["+("object"==typeof e&&null!=e?b:"")+"]",e,c,d)});else if(c||"object"!==r.type(b))d(a,b);else for(e in b)Ab(a+"["+e+"]",b[e],c,d)}r.param=function(a,b){var c,d=[],e=function(a,b){var c=r.isFunction(b)?b():b;d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(null==c?"":c)};if(Array.isArray(a)||a.jquery&&!r.isPlainObject(a))r.each(a,function(){e(this.name,this.value)});else for(c in a)Ab(c,a[c],b,e);return d.join("&")},r.fn.extend({serialize:function(){return r.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=r.prop(this,"elements");return a?r.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!r(this).is(":disabled")&&zb.test(this.nodeName)&&!yb.test(a)&&(this.checked||!ja.test(a))}).map(function(a,b){var c=r(this).val();return null==c?null:Array.isArray(c)?r.map(c,function(a){return{name:b.name,value:a.replace(xb,"\r\n")}}):{name:b.name,value:c.replace(xb,"\r\n")}}).get()}});var Bb=/%20/g,Cb=/#.*$/,Db=/([?&])_=[^&]*/,Eb=/^(.*?):[ \t]*([^\r\n]*)$/gm,Fb=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,Gb=/^(?:GET|HEAD)$/,Hb=/^\/\//,Ib={},Jb={},Kb="*/".concat("*"),Lb=d.createElement("a");Lb.href=tb.href;function Mb(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(L)||[];if(r.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function Nb(a,b,c,d){var e={},f=a===Jb;function g(h){var i;return e[h]=!0,r.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function Ob(a,b){var c,d,e=r.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&r.extend(!0,a,d),a}function Pb(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}if(f)return f!==i[0]&&i.unshift(f),c[f]}function Qb(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}r.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:tb.href,type:"GET",isLocal:Fb.test(tb.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Kb,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":r.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?Ob(Ob(a,r.ajaxSettings),b):Ob(r.ajaxSettings,a)},ajaxPrefilter:Mb(Ib),ajaxTransport:Mb(Jb),ajax:function(b,c){"object"==typeof b&&(c=b,b=void 0),c=c||{};var e,f,g,h,i,j,k,l,m,n,o=r.ajaxSetup({},c),p=o.context||o,q=o.context&&(p.nodeType||p.jquery)?r(p):r.event,s=r.Deferred(),t=r.Callbacks("once memory"),u=o.statusCode||{},v={},w={},x="canceled",y={readyState:0,getResponseHeader:function(a){var b;if(k){if(!h){h={};while(b=Eb.exec(g))h[b[1].toLowerCase()]=b[2]}b=h[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return k?g:null},setRequestHeader:function(a,b){return null==k&&(a=w[a.toLowerCase()]=w[a.toLowerCase()]||a,v[a]=b),this},overrideMimeType:function(a){return null==k&&(o.mimeType=a),this},statusCode:function(a){var b;if(a)if(k)y.always(a[y.status]);else for(b in a)u[b]=[u[b],a[b]];return this},abort:function(a){var b=a||x;return e&&e.abort(b),A(0,b),this}};if(s.promise(y),o.url=((b||o.url||tb.href)+"").replace(Hb,tb.protocol+"//"),o.type=c.method||c.type||o.method||o.type,o.dataTypes=(o.dataType||"*").toLowerCase().match(L)||[""],null==o.crossDomain){j=d.createElement("a");try{j.href=o.url,j.href=j.href,o.crossDomain=Lb.protocol+"//"+Lb.host!=j.protocol+"//"+j.host}catch(z){o.crossDomain=!0}}if(o.data&&o.processData&&"string"!=typeof o.data&&(o.data=r.param(o.data,o.traditional)),Nb(Ib,o,c,y),k)return y;l=r.event&&o.global,l&&0===r.active++&&r.event.trigger("ajaxStart"),o.type=o.type.toUpperCase(),o.hasContent=!Gb.test(o.type),f=o.url.replace(Cb,""),o.hasContent?o.data&&o.processData&&0===(o.contentType||"").indexOf("application/x-www-form-urlencoded")&&(o.data=o.data.replace(Bb,"+")):(n=o.url.slice(f.length),o.data&&(f+=(vb.test(f)?"&":"?")+o.data,delete o.data),o.cache===!1&&(f=f.replace(Db,"$1"),n=(vb.test(f)?"&":"?")+"_="+ub++ +n),o.url=f+n),o.ifModified&&(r.lastModified[f]&&y.setRequestHeader("If-Modified-Since",r.lastModified[f]),r.etag[f]&&y.setRequestHeader("If-None-Match",r.etag[f])),(o.data&&o.hasContent&&o.contentType!==!1||c.contentType)&&y.setRequestHeader("Content-Type",o.contentType),y.setRequestHeader("Accept",o.dataTypes[0]&&o.accepts[o.dataTypes[0]]?o.accepts[o.dataTypes[0]]+("*"!==o.dataTypes[0]?", "+Kb+"; q=0.01":""):o.accepts["*"]);for(m in o.headers)y.setRequestHeader(m,o.headers[m]);if(o.beforeSend&&(o.beforeSend.call(p,y,o)===!1||k))return y.abort();if(x="abort",t.add(o.complete),y.done(o.success),y.fail(o.error),e=Nb(Jb,o,c,y)){if(y.readyState=1,l&&q.trigger("ajaxSend",[y,o]),k)return y;o.async&&o.timeout>0&&(i=a.setTimeout(function(){y.abort("timeout")},o.timeout));try{k=!1,e.send(v,A)}catch(z){if(k)throw z;A(-1,z)}}else A(-1,"No Transport");function A(b,c,d,h){var j,m,n,v,w,x=c;k||(k=!0,i&&a.clearTimeout(i),e=void 0,g=h||"",y.readyState=b>0?4:0,j=b>=200&&b<300||304===b,d&&(v=Pb(o,y,d)),v=Qb(o,v,y,j),j?(o.ifModified&&(w=y.getResponseHeader("Last-Modified"),w&&(r.lastModified[f]=w),w=y.getResponseHeader("etag"),w&&(r.etag[f]=w)),204===b||"HEAD"===o.type?x="nocontent":304===b?x="notmodified":(x=v.state,m=v.data,n=v.error,j=!n)):(n=x,!b&&x||(x="error",b<0&&(b=0))),y.status=b,y.statusText=(c||x)+"",j?s.resolveWith(p,[m,x,y]):s.rejectWith(p,[y,x,n]),y.statusCode(u),u=void 0,l&&q.trigger(j?"ajaxSuccess":"ajaxError",[y,o,j?m:n]),t.fireWith(p,[y,x]),l&&(q.trigger("ajaxComplete",[y,o]),--r.active||r.event.trigger("ajaxStop")))}return y},getJSON:function(a,b,c){return r.get(a,b,c,"json")},getScript:function(a,b){return r.get(a,void 0,b,"script")}}),r.each(["get","post"],function(a,b){r[b]=function(a,c,d,e){return r.isFunction(c)&&(e=e||d,d=c,c=void 0),r.ajax(r.extend({url:a,type:b,dataType:e,data:c,success:d},r.isPlainObject(a)&&a))}}),r._evalUrl=function(a){return r.ajax({url:a,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,"throws":!0})},r.fn.extend({wrapAll:function(a){var b;return this[0]&&(r.isFunction(a)&&(a=a.call(this[0])),b=r(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this},wrapInner:function(a){return r.isFunction(a)?this.each(function(b){r(this).wrapInner(a.call(this,b))}):this.each(function(){var b=r(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=r.isFunction(a);return this.each(function(c){r(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(a){return this.parent(a).not("body").each(function(){r(this).replaceWith(this.childNodes)}),this}}),r.expr.pseudos.hidden=function(a){return!r.expr.pseudos.visible(a)},r.expr.pseudos.visible=function(a){return!!(a.offsetWidth||a.offsetHeight||a.getClientRects().length)},r.ajaxSettings.xhr=function(){try{return new a.XMLHttpRequest}catch(b){}};var Rb={0:200,1223:204},Sb=r.ajaxSettings.xhr();o.cors=!!Sb&&"withCredentials"in Sb,o.ajax=Sb=!!Sb,r.ajaxTransport(function(b){var c,d;if(o.cors||Sb&&!b.crossDomain)return{send:function(e,f){var g,h=b.xhr();if(h.open(b.type,b.url,b.async,b.username,b.password),b.xhrFields)for(g in b.xhrFields)h[g]=b.xhrFields[g];b.mimeType&&h.overrideMimeType&&h.overrideMimeType(b.mimeType),b.crossDomain||e["X-Requested-With"]||(e["X-Requested-With"]="XMLHttpRequest");for(g in e)h.setRequestHeader(g,e[g]);c=function(a){return function(){c&&(c=d=h.onload=h.onerror=h.onabort=h.onreadystatechange=null,"abort"===a?h.abort():"error"===a?"number"!=typeof h.status?f(0,"error"):f(h.status,h.statusText):f(Rb[h.status]||h.status,h.statusText,"text"!==(h.responseType||"text")||"string"!=typeof h.responseText?{binary:h.response}:{text:h.responseText},h.getAllResponseHeaders()))}},h.onload=c(),d=h.onerror=c("error"),void 0!==h.onabort?h.onabort=d:h.onreadystatechange=function(){4===h.readyState&&a.setTimeout(function(){c&&d()})},c=c("abort");try{h.send(b.hasContent&&b.data||null)}catch(i){if(c)throw i}},abort:function(){c&&c()}}}),r.ajaxPrefilter(function(a){a.crossDomain&&(a.contents.script=!1)}),r.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(a){return r.globalEval(a),a}}}),r.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),r.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(e,f){b=r(" + + \ No newline at end of file diff --git a/sop-website/src/main/resources/public/pages/doc/auth.html b/sop-website/src/main/resources/public/pages/doc/auth.html new file mode 100644 index 00000000..429a7ade --- /dev/null +++ b/sop-website/src/main/resources/public/pages/doc/auth.html @@ -0,0 +1,288 @@ + + + + + 应用授权 + + + + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+
+

第三方应用授权

+
+
+ 概述 +
+
+
+

1、用户对开发者进行应用授权后,开发者可以帮助用户完成相应的业务逻辑。

+

2、授权采用标准的OAuth 2.0流程。

+
+ +

授权流程

+ + +
+
+ 快速接入 +
+
+
+

第一步:应用授权URL拼装

+

拼接规则:

+

http://openauth.yourdomain.com/oauth2/appToAppAuth?app_id=2019032617262200001&redirect_uri=http%3a%2f%2flocalhost%3a8087%2foauth2callback

+

参数说明:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数参数名称类型必填描述范例
app_id开发者应用的AppIdString开发者应用的AppId2015101400446982
redirect_uri回调页面String参数需要UrlEncodehttp%3A%2F%2Fexample.com
+ +

第二步:获取code

+

授权成功后,客户端会跳转至开发者定义的回调页面(即redirect_uri参数对应的url),在回调页面请求中会带上当次授权的授权码code和开发者的app_id,示例如下:

+

http://devloper.domain.com/oauth2callback?app_id=2015101400446982&code=ca34ea491e7146cc87d25fca24c4cD11

+ +

第三步:使用code换取app_auth_token

+

接口名称:open.auth.token.app

+

开发者通过code可以换取app_auth_token、授权用户的userId。

+

注意:应用授权的code唯一,code使用一次后失效,有效期24小时; app_auth_token永久有效。

+

请求参数说明

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数参数名称类型必填描述范例
grant_type授权类型String如果使用code换取token,则为authorization_code,如果使用refresh_token换取新的token,则为refresh_tokenauthorization_code
code授权码String与refresh_token二选一,用户对应用授权后得到,即第一步中开发者获取到的code值bf67d8d5ed754af297f72cc482287X62
refresh_token刷新令牌String与code二选一,可为空,刷新令牌时使用201510BB0c409dd5758b4d939d4008a525463X62
+ +

接口请求SDK示例

+
+   @GetMapping("oauth2callback")
+    @ResponseBody
+    public String callback(HttpServletRequest servletRequest, HttpServletResponse servletResponse) {
+        String app_id = servletRequest.getParameter("app_id");
+        String code = servletRequest.getParameter("code");
+
+        OpenAuthTokenAppRequest request = new OpenAuthTokenAppRequest();
+        OpenAuthTokenAppModel model = new OpenAuthTokenAppModel();
+        model.setCode(code);
+        model.setGrant_type("authorization_code");
+        request.setBizModel(model);
+
+        // 根据code获取token
+        OpenAuthTokenAppResponse response = openClient.execute(request);
+        if (response.isSuccess()) {
+            // 成功拿到token,开发者在这里保存token信息
+            // 后续使用token进行接口访问
+            log.info("授权成功,body:{}", response.getBody());
+        }
+        return response.getBody();
+    }
+
+
+

同步响应参数说明

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数参数名称类型必填描述范例
app_auth_token用户授权令牌String通过该令牌来帮助用户发起请求,完成业务856faf8d77d3b985c1073557ce6ea724
user_id授权用户的IDString授权者id1
expires_in令牌有效期Long负值表示永久有效-1
re_expires_in刷新令牌有效期Long负值表示永久有效-3
app_refresh_token刷新令牌时使用String刷新令牌后,我们会保证老的app_auth_token从刷新开始10分钟内可继续使用,请及时替换为最新token88e68196d2359667f0dc8136e6c86803
+

同步响应结果示例

+
{
+    "open_auth_token_app_response": {
+        "code": "10000",
+        "msg": "Success",
+        "app_auth_token": "88e68196d2359667f0dc8136e6c86803",
+        "app_refresh_token": "856faf8d77d3b985c1073557ce6ea724",
+        "expires_in": -1,
+        "re_expires_in": -3,
+        "user_id": "1"
+    },
+    "sign": "xxx"
+}
+
+ +

刷新token

+

+OpenAuthTokenAppRequest request = new OpenAuthTokenAppRequest();
+OpenAuthTokenAppModel model = new OpenAuthTokenAppModel();
+model.setGrant_type("refresh_token");
+model.setRefresh_token("856faf8d77d3b985c1073557ce6ea724");
+request.setBizModel(model);
+
+OpenAuthTokenAppResponse response = openClient.execute(request);
+if (response.isSuccess()) {
+    // 成功拿到token,开发者在这里保存token信息
+    // 后续使用token进行接口访问
+    log.info("换取token成功,body:{}", response.getBody());
+}
+        
+
+
+ + + + + + + \ No newline at end of file diff --git a/sop-website/src/main/resources/public/pages/doc/code.html b/sop-website/src/main/resources/public/pages/doc/code.html new file mode 100644 index 00000000..9fecb963 --- /dev/null +++ b/sop-website/src/main/resources/public/pages/doc/code.html @@ -0,0 +1,647 @@ + + + + + 返回状态码 + + + + + + + + + + + + + + + +
+ +
+ + +
+
+ +
+ +
+
+
+ 公共错误码 +
+
+
+

网关会对开发者的接口非业务调用错误做统一处理,返回码如下:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
code(返回码)
+
+
msg(返回码描述)
+
+
sub_code(明细返回码)
+
+
sub_msg(明细返回码描述)
+
+
解决方案
+
+
10000
+
+
Success(接口调用成功)
+
+
 
+
+
 
+
+
 
+
+
20000
+
+
服务不可用
+
+
isp.unknown-error
+
+
服务暂不可用(业务系统不可用)
+
+
稍后重试
+
+
aop.unknow-error
+
+
服务暂不可用(网关自身的未知错误)
+
+
稍后重试
+
+
isp.service-not-available
+
+
服务暂不可用
+
+
稍后重试
+
+
20001
+
+
授权权限不足
+
+
aop.invalid-auth-token
+
+
无效的访问令牌
+
+
请刷新授权令牌或重新授权获取新的令牌
+
+
aop.auth-token-time-out
+
+
访问令牌已过期
+
+
请刷新授权令牌或重新授权获取新的令牌
+
+
aop.invalid-app-auth-token
+
+
无效的应用授权令牌
+
+
请刷新应用授权令牌或重新授权获取新的令牌
+
+
aop.invalid-app-auth-token-no-api
+
+
商户未授权当前接口
+
+
请重新授权获取新的应用授权令牌
+
+
aop.app-auth-token-time-out
+
+
应用授权令牌已过期
+
+
请刷新应用授权令牌或重新授权获取新的令牌
+
+
aop.no-product-reg-by-partner
+
+
商户未签约任何产品
+
+
ISV代理调用的场景,请上线商户的服务窗
+
+
40001
+
+
缺少必选参数
+
+
isv.missing-method
+
+
缺少方法名参数
+
+
请求参数里面必须要有method参数
+
+
isv.missing-signature
+
+
缺少签名参数
+
+
检查请求参数,缺少sign参数
+
+
isv.missing-signature-type
+
+
缺少签名类型参数
+
+
检查请求参数,缺少sign_type参数
+
+
isv.missing-signature-key
+
+
缺少签名配置
+
+
未上传公钥配置
+
+
isv.missing-app-id
+
+
缺少appId参数
+
+
检查请求参数,缺少app_id参数
+
+
isv.missing-timestamp
+
+
缺少时间戳参数
+
+
检查请求参数,缺少timestamp参数
+
+
isv.missing-version
+
+
缺少版本参数
+
+
检查请求参数,缺少version参数
+
+
isv.decryption-error-missing-encrypt-type
+
+
解密出错, 未指定加密算法
+
+
检查参数,缺少encrypt_type参数
+
+
40002
+
+
非法的参数
+
+
isv.invalid-parameter
+
+
参数无效
+
+
检查参数,格式不对、非法值、越界等
+
+
isv.upload-fail
+
+
文件上传失败
+
+
文件写入失败,重试
+
+
isv.invalid-file-extension
+
+
文件扩展名无效
+
+
检查传入的文件扩展名称,目前支持格式:csv,txt,zip,rar,gz,doc,docx,xls,xlsx,pdf,bmp,gif,jpg,jpeg,png
+
+
isv.invalid-file-size
+
+
文件大小无效
+
+
检查文件大小,目前支持最大为:50MB 
+
+
isv.invalid-method
+
+
不存在的方法名
+
+
检查入参method是否正确
+
+
isv.invalid-format
+
+
无效的数据格式
+
+
检查入参format,目前只支持json和xml 2种格式
+
+
isv.invalid-signature-type
+
+
无效的签名类型
+
+
检查入参sign_type,目前只支持RSA,RSA2,HMAC_SHA1
+
+
isv.invalid-signature
+
+
无效签名
+
+
1.公私钥是否是一对 2.检查公钥上传是否与私钥匹配 3.存在中文需要做urlencode 4.签名算法是否无误 +
+
+
isv.invalid-encrypt-type
+
+
无效的加密类型
+
+
检查入参encrypt_type,目前只支持AES
+
+
isv.invalid-encrypt
+
+
解密异常
+
+
重试
+
+
isv.invalid-app-id
+
+
无效的appId参数
+
+
检查入参app_id,app_id不存在,或者未上线
+
+
isv.invalid-timestamp
+
+
非法的时间戳参数
+
+
时间戳参数timestamp非法,请检查格式需要为"yyyy-MM-dd HH:mm:ss"
+
+
isv.invalid-charset
+
+
字符集错误
+
+
请求参数charset错误,目前支持格式:GBK,UTF-8
+
+
isv.invalid-digest
+
+
摘要错误
+
+
检查请求参数,文件摘要参数必填
+
+
isv.decryption-error-not-valid-encrypt-type
+
+
解密出错,不支持的加密算法
+
+
检查入参encrypt_type,目前只支持AES
+
+
isv.decryption-error-not-valid-encrypt-key
+
+
解密出错, 未配置加密密钥或加密密钥格式错误
+
+
没有配置加密密钥
+
+
isv.decryption-error-unknown
+
+
解密出错,未知异常
+
+
重试
+
+
isv.missing-signature-config
+
+
验签出错, 未配置对应签名算法的公钥或者证书
+
+
没有配置应用公钥
+
+
isv.not-support-app-auth
+
+
本接口不支持第三方代理调用
+
+
本接口不支持第三方代理调用
+
+
isv.suspected-attack
+
+
可疑的攻击请求
+
+
+
40004
+
+
业务处理失败
+
+
对应业务错误码,明细错误码和解决方案请参见具体的API接口文档
+
+
40006
+
+
权限不足
+
+
isv.insufficient-isv-permissions
+
+
ISV权限不足
+
+
请检查配置的账户是否有当前接口权限
+
+
isv.insufficient-user-permissions
+
+
用户权限不足
+
+
代理的商户没有当前接口权限
+
+
isv.route-no-permissions
+
+
用户权限不足
+
+
没有当前接口权限
+
+
isv.access-forbidden
+
+
用户权限不足
+
+
无权访问(接口被禁用)
+
+
+
+
+ + + + + + + \ No newline at end of file diff --git a/sop-website/src/main/resources/public/pages/doc/doc.html b/sop-website/src/main/resources/public/pages/doc/doc.html new file mode 100644 index 00000000..8e110919 --- /dev/null +++ b/sop-website/src/main/resources/public/pages/doc/doc.html @@ -0,0 +1,369 @@ + + + + + 文档中心 + + + + + + + + + + + + + + + +
+
+ + +
+
+ + +
+
+
+ +
+
    + + +
+
+ +
+

() +

+
+
+ + +
+
+ 请求地址 +
+
+
+ + + + + + + + + + + + + +
环境请求地址
正式环境
+
+ +
+
+ 请求方法 +
+
+
+ +
+ + +
+
+ 公共参数 +
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填最大长度描述示例值
app_idString32平台分配给开发者的应用ID2014072300007148
methodString128接口名称alipay.trade.close
formatString40仅支持JSONjson
charsetString10请求使用的编码格式,如utf-8,gbk,gb2312等utf-8
sign_typeString10商户生成签名字符串所使用的签名算法类型,目前支持RSA2和RSA,推荐使用RSA2RSA2
signString344商户请求参数的签名串,详见签名详见示例
timestampString19发送请求的时间,格式"yyyy-MM-dd HH:mm:ss"2014-07-24 03:07:50
versionString3调用的接口版本,固定为:1.01.0
notify_urlString256平台服务器主动通知商户服务器里指定的页面http/https路径。http://open.xxx.com/atinterface/receive_notify.htm
app_auth_tokenString40详见应用授权概述
biz_contentString-请求参数的集合,最大长度不限,除公共参数外所有请求参数都必须放在这个参数中传递,具体参照各产品快速接入文档
+
+ +
+
+ 业务参数 +
+
+
+
+
+ +
+
+ 公共响应参数 +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数类型是否必填最大长度描述示例值
codeString-网关返回码,详见文档40004
msgString-网关返回码描述,详见文档Business Failed
sub_codeString-业务返回码,参见具体的API接口文档ACQ.TRADE_HAS_SUCCESS
sub_msgString-业务返回码描述,参见具体的API接口文档交易已被支付
+
+ + +
+
+ 业务响应参数 +
+
+
+
+
+ +
+
+ 响应示例 +
+
+
+
+
+
+ +
+
+ 异常示例 +
+
+
+
+
+
+ + +
+
+ + + + + + + + + + + \ No newline at end of file diff --git a/sop-website/src/main/resources/public/pages/doc/doc.js b/sop-website/src/main/resources/public/pages/doc/doc.js new file mode 100644 index 00000000..f7b0db2b --- /dev/null +++ b/sop-website/src/main/resources/public/pages/doc/doc.js @@ -0,0 +1,94 @@ +var docEvent = { + bind: function (fn) { + this.onSelectDocItem = fn; + }, + onSelectDocItem: function () {} +} +layui.config({ + base: '../../assets/lib/layuiext/module/' +}).extend({ + treetable: 'treetable-lay/treetable' +}).use(['element', 'form', 'treetable'], function(){ //加载code模块 + var form = layui.form; + var treetable = layui.treetable; + var $ = layui.jquery; + + // key:module + var docItemStore = {}; + + function initDocModules() { + $.getJSON(SopConfig.url + '/doc/getDocBaseInfo', function (baseInfo) { + var html = []; + var docInfoList = baseInfo.docInfoList; + for (var i = 0; i < docInfoList.length; i++) { + var docInfo = docInfoList[i]; + var selected = i === 0 ? 'selected="selected"' : ''; + var title = docInfo.title; + html.push(''); + } + $('#moduleList').html(html.join('')); + $('.url-prod').text(baseInfo.urlProd); + $('.url-sandbox').text(baseInfo.urlSandbox); + form.render('select'); + + if (docInfoList && docInfoList.length > 0) { + selectDocInfo(docInfoList[0].title); + } + }) + } + + function selectDocInfo(title) { + $.getJSON(SopConfig.url + '/doc/docinfo/' + title, function (docInfo) { + var moduleList = docInfo.docModuleList; + var html = []; + var firstItem; + for (var j = 0; j < moduleList.length; j++) { + var module = moduleList[j]; + var docItems = module.docItems; + html.push('
  • ' + module.module + '

  • '); + for (var i = 0; i < docItems.length; i++) { + var docItem = docItems[i]; + var first = j === 0 && i === 0; + if (first) { + firstItem = docItem; + } + docItemStore[docItem.nameVersion] = docItem; + /* +
  • + + 统一收单交易退款查询 + +
  • + */ + html.push('
  • '); + html.push('' + docItem['summary'] + '') + } + } + + $('#docItemTree').html(html.join('')); + if (firstItem) { + selectDocItem(firstItem.nameVersion); + } + }) + } + + function initEvent() { + form.on('select(moduleListFilter)', function (data) { + selectDocInfo(data.value); + }) + $('#docItemTree').on('click', 'li', function () { + var $li = $(this); + selectDocItem($li.attr('nameversion')); + }) + } + + function selectDocItem(nameVersion) { + var docItem = docItemStore[nameVersion]; + if (docItem) { + docEvent.onSelectDocItem(docItem, layui); + } + } + + initDocModules(); + initEvent(); +}); \ No newline at end of file diff --git a/sop-website/src/main/resources/public/pages/doc/docEvent.js b/sop-website/src/main/resources/public/pages/doc/docEvent.js new file mode 100644 index 00000000..5f58b327 --- /dev/null +++ b/sop-website/src/main/resources/public/pages/doc/docEvent.js @@ -0,0 +1,126 @@ + +docEvent.bind(function (docItem,layui) { + selectItem(docItem, layui); +}); + +var treetable; + +function selectItem(docItem, layui) { + var nameVersion = docItem.nameVersion; + treetable = treetable || layui.treetable; + $('.sop-name').text(docItem.name); + $('.sop-version').text(docItem.version); + $('.sop-summary').text(docItem['summary']); + $('.sop-description').text(docItem.description || docItem['summary']); + + createRequestParameter(docItem); + createResponseParameter(docItem); + createResponseCode(docItem); + + var $li = $('#docItemTree').find('li[nameversion="'+nameVersion+'"]'); + $li.addClass('layui-this').siblings().removeClass('layui-this'); + + $('#httpMethodList').text(docItem.httpMethodList.join(' / ').toUpperCase()); +} + +function createRequestParameter(docItem) { + var data = buildTreeData(docItem.requestParameters); + createTreeTable('treeTableReq', data); +} + +function createResponseParameter(docItem) { + var data = buildTreeData(docItem.responseParameters); + createTreeTable('treeTableResp', data); +} + +function buildTreeData(parameters, parentId) { + var data = []; + parentId = parentId || 0; + for (var i = 0; i < parameters.length; i++) { + var parameter = parameters[i]; + parameter.id = parentId * 100 + (i + 1); + parameter.parentId = parentId; + data.push(parameter); + var refs = parameter.refs; + if (refs && refs.length > 0) { + var childData = buildTreeData(refs, parameter.id); + data = data.concat(childData); + } + } + return data; +} + +function createTreeTable(id, data) { + var el = '#' + id; + treetable.render({ + elem: el, + treeColIndex: 0, + treeSpid: 0, + treeIdName: 'id', + treePidName: 'parentId', + treeDefaultClose: false, + treeLinkage: false, + data: data, + page: false, + cols: [[ + {field: 'name', title: '参数'} + ,{field: 'type', title: '类型', width: 80} + ,{field: 'required', title: '是否必填', width: 100, templet:function (row) { + return row.required ? '' : '否'; + }} + ,{field: 'maxLength', title: '最大长度', width: 100} + ,{field: 'description', title: '描述', width: 200} + ,{field: 'paramExample', title: '示例值', width: 200} + ]] + }); +} + +function createResponseCode(docItem) { + var method = docItem.name.replace(/\./g, '_'); + var responseParameters = docItem.responseParameters; + var bizResult = buildResult(responseParameters); + var json = '{\n' + + ' "'+method+'_response": {\n' + + ' "code": "10000",\n' + + ' "msg": "Success",\n' + + bizResult + + ' }' + + '}'; + json = formatJson(json); + $('#responseExampleJson').text(json); + + var errorJson = '{\n' + + ' "'+method+'_response": {\n' + + ' "code": "20000",\n' + + ' "msg": "Service is temporarily unavailable",\n' + + ' "sub_code": "isp.unknown-error",\n' + + ' "sub_msg": "服务暂不可用"\n' + + ' }' + + '}'; + errorJson = formatJson(errorJson); + $('#responseErrorJson').text(errorJson); +} + +function buildResult(parameters) { + var result = []; + for (var i = 0; i < parameters.length; i++) { + var parameter = parameters[i]; + result.push('\"'+parameter.name+'\": ' + buildExample(parameter)) + } + return result.join(","); +} + +function buildExample(parameter) { + var refs = parameter.refs; + if (refs) { + // {...} + var content = '{' + buildResult(refs) + '}'; + if (parameter.type == 'array') { + // [{...}] + content = '[' + content + ']'; + } + return content; + } else { + return '\"' + parameter.example + '\"'; + } +} diff --git a/sop-website/src/main/resources/public/pages/doc/sign.html b/sop-website/src/main/resources/public/pages/doc/sign.html new file mode 100644 index 00000000..1d14e57d --- /dev/null +++ b/sop-website/src/main/resources/public/pages/doc/sign.html @@ -0,0 +1,116 @@ + + + + + 签名 + + + + + + + + + + + + + + + +
    + +
    + + +
    +
    + +
    + +
    + +
    +

    如果未使用开放平台SDK,需要自行实现签名过程。

    + +
    + 如何签名 +
    +

    1.筛选并排序

    +

    + 获取所有请求参数,不包括字节类型参数,如文件、字节流,剔除sign字段,剔除值为空的参数,并按照第一个字符的键值ASCII码递增排序(字母升序排序),如果遇到相同字符则按照第二个字符的键值ASCII码递增排序,以此类推。

    +

    2.拼接

    +

    将排序后的参数与其对应值,组合成“参数=参数值”的格式,并且把这些参数用&字符连接起来,此时生成的字符串为待签名字符串。

    +

    例如下面的请求示例,参数值都是示例,开发者参考格式即可:

    +
    REQUEST URL: http://open-test.yourdomain.com/api
    +REQUEST METHOD: POST
    +CONTENT:
    +app_id=2014072300007148
    +method=alipay.mobile.public.menu.add
    +charset=GBK
    +sign_type=RSA2
    +timestamp=2014-07-24 03:07:50
    +biz_content={"button":[{"actionParam":"ZFB_HFCZ","actionType":"out","name":"话费充值"},{"name":"查询","subButton":[{"actionParam":"ZFB_YECX","actionType":"out","name":"余额查询"},{"actionParam":"ZFB_LLCX","actionType":"out","name":"流量查询"},{"actionParam":"ZFB_HFCX","actionType":"out","name":"话费查询"}]},{"actionParam":"http://m.alipay.com","actionType":"link","name":"最新优惠"}]}
    +sign=e9zEAe4TTQ4LPLQvETPoLGXTiURcxiAKfMVQ6Hrrsx2hmyIEGvSfAQzbLxHrhyZ48wOJXTsD4FPnt+YGdK57+fP1BCbf9rIVycfjhYCqlFhbTu9pFnZgT55W+xbAFb9y7vL0MyAxwXUXvZtQVqEwW7pURtKilbcBTEW7TAxzgro=
    +version=1.0
    +
    +

    则待签名字符串为:

    +
    app_id=2014072300007148&biz_content={"button":[{"actionParam":"ZFB_HFCZ","actionType":"out","name":"话费充值"},{"name":"查询","subButton":[{"actionParam":"ZFB_YECX","actionType":"out","name":"余额查询"},{"actionParam":"ZFB_LLCX","actionType":"out","name":"流量查询"},{"actionParam":"ZFB_HFCX","actionType":"out","name":"话费查询"}]},{"actionParam":"http://m.alipay.com","actionType":"link","name":"最新优惠"}]}&charset=GBK&method=alipay.mobile.public.menu.add&sign_type=RSA2&timestamp=2014-07-24 03:07:50&version=1.0
    +

    3.调用签名函数

    +

    + 使用各自语言对应的SHA256WithRSA(对应sign_type为RSA2)或SHA1WithRSA(对应sign_type为RSA)签名函数利用商户私钥对待签名字符串进行签名,并进行Base64编码。

    +

    4.把生成的签名赋值给sign参数,拼接到请求参数中。

    +
    /**
    +@param content 加签内容
    +@param privateKey 加签私钥
    +@param charset 加签字符集
    +@param charset 签名方法
    +**/
    +String AlipaySignature.rsaSign(String content, String privateKey, String charset,String signType)
    +
    +
    +
    +
    + + + + + + + \ No newline at end of file diff --git a/sop-website/src/main/resources/public/pages/sandbox/sandbox.html b/sop-website/src/main/resources/public/pages/sandbox/sandbox.html new file mode 100644 index 00000000..db969c7d --- /dev/null +++ b/sop-website/src/main/resources/public/pages/sandbox/sandbox.html @@ -0,0 +1,155 @@ + + + + + 文档中心 + + + + + + + + + + + + + + + +
    + +
    + + +
    +
    +
    + +
    +
      + + +
    +
    + +
    +

    () +

    +
    +
    + +
    +
    + 参数配置 +
    +
    +
    + + + + + + + + + +
    AppId
    PrivateKey
    +
    + +
    +
    + 请求参数 +
    +
    +
    +
    + +
    + +
    + +
    +
    + +
    + + + +
    +
    + + + + + + + + + + + + \ No newline at end of file diff --git a/sop-website/src/main/resources/public/pages/sandbox/sandbox.js b/sop-website/src/main/resources/public/pages/sandbox/sandbox.js new file mode 100644 index 00000000..851f0f56 --- /dev/null +++ b/sop-website/src/main/resources/public/pages/sandbox/sandbox.js @@ -0,0 +1,297 @@ + +docEvent.bind(function (docItem,layui) { + selectItem(docItem, layui); +}); + +layui.use('form', function(){ + var form = layui.form; + //监听提交 + form.on('submit(formSend)', function(data){ + doTest(); + return false; + }); +}); + +var $body = $('body'); +var treetable; +var currentItem; + +function selectItem(docItem, layui) { + var form = layui.form; + currentItem = docItem; + resetResultDiv(); + var nameVersion = docItem.nameVersion; + var multiple = docItem.multiple; + treetable = treetable || layui.treetable; + $('.sop-name').text(docItem.name); + $('.sop-version').text(docItem.version); + $('.sop-summary').text(docItem['summary']); + $('.sop-description').text(docItem.description || docItem['summary']); + + createRequestParameter(docItem); + + $('#multipleDiv').css('display', multiple ? 'block' : 'none'); + + $('#httpMethodList').html(buildHttpMethodOptions(docItem)); + + var $li = $('#docItemTree').find('li[nameversion="'+nameVersion+'"]'); + $li.addClass('layui-this').siblings().removeClass('layui-this'); + + form.render(); + InputCache.init(); +} + +function buildHttpMethodOptions(docItem) { + var methodList = docItem.httpMethodList; + var html = [] + for (var i = 0; i < methodList.length; i++) { + var method = methodList[i]; + html.push(''); + } + return html.join(''); +} + +function createRequestParameter(docItem) { + var data = buildTreeData(docItem.requestParameters); + createTreeTable('treeTableReq', data); +} + +function buildTreeData(parameters, parentId) { + var data = []; + parentId = parentId || 0; + for (var i = 0; i < parameters.length; i++) { + var parameter = parameters[i]; + parameter.id = parentId * 100 + (i + 1); + parameter.parentId = parentId; + data.push(parameter); + var refs = parameter.refs; + if (refs && refs.length > 0) { + var childData = buildTreeData(refs, parameter.id); + data = data.concat(childData); + } + } + return data; +} + +function createTreeTable(id, data) { + var el = '#' + id; + treetable.render({ + elem: el, + treeColIndex: 0, + treeSpid: 0, + treeIdName: 'id', + treePidName: 'parentId', + treeDefaultClose: false, + treeLinkage: false, + data: data, + page: false, + firstTemplet: function (row) { + var required = row.required ? '* ' : ''; + return required + row.name; + }, + cols: [[ + {field: 'name', title: '参数',width: 200} + ,{field: 'val', title: '值', width: 300, templet:function (row) { + var id = currentItem.nameVersion + '-' + row.name; + var requiredTxt = row.required ? 'required lay-verify="required"' : ''; + var module = row.module; + var type = row.type == 'file' ? 'file' : 'text'; + var attrs = [ + 'id="' + id + '"' + , 'name="'+row.name+'"' + , 'class="layui-input test-input"' + , 'type="' + type + '"' + , requiredTxt + , 'module="'+module+'"' + ]; + + return !row.refs ? '' : ''; + }} + ,{field: 'description', title: '描述'} + ]] + }); +} + +function doTest() { + var method = currentItem.name; + var version = currentItem.version; + var data = { + appId: $('#appId').val() + , privateKey: $('#privateKey').val() + , method: method + , version: version + , httpMethod: $('#httpMethodList').val() + }; + var uploadFileObjects = getUploadFileObjects(); + var $inputs = $body.find('.test-input'); + var bizContent = {}; + $inputs.each(function () { + var module = $(this).attr('module'); + if (module) { + if (!bizContent[module]) { + bizContent[module] = {}; + } + var moduleObj = bizContent[module]; + putVal(moduleObj, this); + } else { + putVal(bizContent, this); + } + }); + data.bizContent = JSON.stringify(bizContent); + if (isDownloadRequest(currentItem)) { + data.isDownloadRequest = true; + downloadFile(data); + // window.open() + return; + } + // 确定文件数量,并且知道参数名称 + if (uploadFileObjects.length > 0) { + var formData = new FormData(); + for (var i = 0; i < uploadFileObjects.length; i++) { + var fileInput = uploadFileObjects[i]; + formData.append(fileInput.name, fileInput.file); + } + postFile(data, formData); + } else { + postJson(data); + } +} + +function isDownloadRequest(currentItem) { + var produces = currentItem.produces; + if (!produces) { + return false; + } + for (var i = 0; i < produces.length; i++) { + var produce = produces[i]; + if (produce.indexOf('application/octet-stream') > -1) { + return true; + } + } + return false; +} + +function putVal(obj, input) { + if (input.type == 'text') { + obj[input.name] = input.value; + } +} + +function getUploadFileObjects() { + var fileObjects = []; + $body.find('input[type=file]') + .each(function () { + var $input = $(this); + var name = this.name; + var fileList = $input.prop('files'); + var multiple = $input.prop('multiple'); + if (multiple) { + for (var i = 0; i < fileList.length; i++) { + fileObjects.push({name: name + i, file: fileList[i]}); + } + } else { + fileObjects.push({name: name, file: fileList[0]}); + } + }); + return fileObjects; +} + +function postJson(data) { + $.ajax({ + url: SopConfig.url + '/sandbox/test' + , dataType: 'json' + , data: data + , method: 'post' + , success: successHandler + , error: errorHandler + }); +} + +function postFile(data, formData) { + for(var key in data) { + formData.append(key, data[key]); + } + $.ajax({ + url: SopConfig.url + '/sandbox/test' + , data: formData + // ajax2.0可以不用设置请求头,但是jq帮我们自动设置了,这样的话需要我们自己取消掉 + , contentType: false + // 取消帮我们格式化数据,是什么就是什么 + , processData: false + , method: 'post' + , success: successHandler + , error: errorHandler + }); +} + +function downloadFile(data) { + $('.dl-form').remove(); + var url = SopConfig.url + '/sandbox/test'; + var form = $('
    ') + .addClass('dl-form') + .attr("action", url) + .attr("method", "post"); + + for(var key in data) { + form.append($("") + .attr("type", "hidden") + .attr("name", key) + .attr("value", data[key])); + } + form.appendTo('body').submit(); +} + +function successHandler(resp) { + setReqInfo(resp); + showRespnfo(resp.apiResult); +} + +function errorHandler(xhr,status,error) { + // {"timestamp":"2019-06-19 15:57:36","status":500,"error":"Internal Server Error","message":"appId不能为空","path":"/sandbox/test"} + var errorData = xhr.responseJSON; + if (errorData) { + setReqInfo(''); + showRespnfo(errorData.message); + } +} + +function showRespnfo(info) { + var json = formatJson(info); + setRespInfo(json); + $('#resultDiv').show(); +} + +function setReqInfo(resp) { + var txt = ''; + if (resp) { + var html = []; + html.push('【请求参数】:' + resp.params); + html.push('【待签名内容】:' + resp.beforeSign); + html.push('【签名(sign)】:' + resp.sign); + txt = html.join('\r\n') + } + $('#req-info-result').val(txt); +} + +function setRespInfo(info) { + $('#resp-info-result').text(info); +} + +function resetResultDiv() { + setReqInfo({ + beforeSign: '', + params: '', + privateKey: '', + sign: '' + }); + setRespInfo(''); + $('.resp-info-content') + .addClass('layui-show') + .siblings().removeClass('layui-show'); + + $('.resp-info') + .addClass('layui-this') + .siblings().removeClass('layui-this'); + + $('#resultDiv').hide(); +} diff --git a/sop-website/src/test/java/com/gitee/sop/websiteserver/WebsiteServerApplicationTests.java b/sop-website/src/test/java/com/gitee/sop/websiteserver/WebsiteServerApplicationTests.java new file mode 100644 index 00000000..25ba9485 --- /dev/null +++ b/sop-website/src/test/java/com/gitee/sop/websiteserver/WebsiteServerApplicationTests.java @@ -0,0 +1,16 @@ +package com.gitee.sop.websiteserver; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; + +@RunWith(SpringRunner.class) +@SpringBootTest +public class WebsiteServerApplicationTests { + + @Test + public void contextLoads() { + } + +}