diff --git a/app/build.gradle b/app/build.gradle index 037194e73..844f12227 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -2,7 +2,7 @@ apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-android-extensions' apply plugin: 'kotlin-kapt' -apply plugin: "de.timfreiheit.resourceplaceholders" +apply plugin: 'de.timfreiheit.resourceplaceholders' apply plugin: 'io.fabric' androidExtensions { @@ -19,6 +19,7 @@ def gitCommits = Integer.parseInt('git rev-list --count HEAD'.execute([], projec android { compileSdkVersion 29 + flavorDimensions ("version") signingConfigs { if (project.hasProperty("RELEASE_STORE_FILE")) { myConfig { @@ -73,7 +74,17 @@ android { } } } - + productFlavors { + app { + dimension "version" + manifestPlaceholders = [APP_CHANNEL_VALUE: "app"] + } + google { + dimension "version" + applicationId "io.legado.play" + manifestPlaceholders = [APP_CHANNEL_VALUE: "google"] + } + } compileOptions { // Flag to enable support for the new language APIs //coreLibraryDesugaringEnabled true @@ -99,27 +110,27 @@ kapt { dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) - testImplementation 'junit:junit:4.12' + testImplementation 'junit:junit:4.13' androidTestImplementation 'androidx.test:runner:1.2.0' androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0' //kotlin implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" //fireBase - implementation 'com.google.firebase:firebase-core:17.2.3' + implementation 'com.google.firebase:firebase-core:17.3.0' implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1' //androidX implementation 'androidx.core:core-ktx:1.2.0' implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.media:media:1.1.0' - implementation 'androidx.preference:preference:1.1.0' + implementation 'androidx.preference:preference:1.1.1' implementation 'androidx.constraintlayout:constraintlayout:1.1.3' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.0.0' implementation 'androidx.viewpager2:viewpager2:1.0.0' implementation 'com.google.android.material:material:1.1.0' implementation 'com.google.android:flexbox:1.1.0' - implementation 'com.google.code.gson:gson:2.8.5' + implementation 'com.google.code.gson:gson:2.8.6' //lifecycle def lifecycle_version = '2.2.0' @@ -127,12 +138,12 @@ dependencies { implementation "androidx.lifecycle:lifecycle-common-java8:$lifecycle_version" //room - def room_version = '2.2.4' + def room_version = '2.2.5' implementation "androidx.room:room-runtime:$room_version" kapt "androidx.room:room-compiler:$room_version" //paging - implementation 'androidx.paging:paging-runtime:2.1.1' + implementation 'androidx.paging:paging-runtime:2.1.2' //anko def anko_version = '0.10.8' @@ -148,19 +159,19 @@ dependencies { implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutines_version" //规则相关 - implementation 'org.jsoup:jsoup:1.12.1' + implementation 'org.jsoup:jsoup:1.13.1' implementation 'cn.wanghaomiao:JsoupXpath:2.3.2' implementation 'com.jayway.jsonpath:json-path:2.4.0' //JS rhino implementation 'com.github.gedoor:rhino-android:1.4' - //Retrofit - implementation 'com.squareup.okhttp3:logging-interceptor:4.1.0' - implementation 'com.squareup.retrofit2:retrofit:2.6.1' + //网络 + //noinspection GradleDependency + implementation 'com.squareup.retrofit2:retrofit:2.7.2' //Glide - implementation 'com.github.bumptech.glide:glide:4.9.0' + implementation 'com.github.bumptech.glide:glide:4.11.0' //webServer implementation 'org.nanohttpd:nanohttpd:2.3.1' @@ -173,14 +184,14 @@ dependencies { implementation 'com.jaredrummler:colorpicker:1.1.0' //apache - implementation 'org.apache.commons:commons-lang3:3.9' + implementation 'org.apache.commons:commons-lang3:3.10' implementation 'org.apache.commons:commons-text:1.8' //MarkDown - implementation 'ru.noties.markwon:core:3.0.2' + implementation 'ru.noties.markwon:core:3.1.0' //转换繁体 - implementation 'com.github.houbb:opencc4j:1.4.0' + implementation 'com.hankcs:hanlp:portable-1.7.7' } diff --git a/app/google-services.json b/app/google-services.json index fb88090cb..314a5ea7c 100644 --- a/app/google-services.json +++ b/app/google-services.json @@ -92,6 +92,35 @@ ] } } + }, + { + "client_info": { + "mobilesdk_app_id": "1:453392274790:android:b891abd2331577dff624a7", + "android_client_info": { + "package_name": "io.legado.play.release" + } + }, + "oauth_client": [ + { + "client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com", + "client_type": 3 + } + ], + "api_key": [ + { + "current_key": "AIzaSyD90mfNLhA7cAzzI9SonpSz5mrF5BnmyJA" + } + ], + "services": { + "appinvite_service": { + "other_platform_oauth_client": [ + { + "client_id": "453392274790-hnbpatpce9hbjiggj76hgo7queu86atq.apps.googleusercontent.com", + "client_type": 3 + } + ] + } + } } ], "configuration_version": "1" diff --git a/app/proguard-rules.pro b/app/proguard-rules.pro index 9af1203b9..1e8ab731b 100644 --- a/app/proguard-rules.pro +++ b/app/proguard-rules.pro @@ -160,7 +160,6 @@ -dontwarn rx.** -dontwarn okio.** --dontwarn retrofit2.** -dontwarn javax.annotation.** -dontwarn org.apache.log4j.lf5.viewer.** -dontnote org.apache.log4j.lf5.viewer.** @@ -172,7 +171,6 @@ -dontwarn com.jeremyliao.liveeventbus.** -keep class com.jeremyliao.liveeventbus.** { *; } --keep class retrofit2.**{*;} -keep class okhttp3.**{*;} -keep class okio.**{*;} -keep class com.hwangjr.rxbus.**{*;} diff --git a/app/src/debug/res/values/strings.xml b/app/src/debug/res/values/strings.xml index b91572ada..e4464c88d 100644 --- a/app/src/debug/res/values/strings.xml +++ b/app/src/debug/res/values/strings.xml @@ -1,4 +1,4 @@ - 阅读.debug - 阅读.debug·搜索 + 阅读·D + 阅读·D·搜索 \ No newline at end of file diff --git a/app/src/google/res/values-zh-rHK/strings.xml b/app/src/google/res/values-zh-rHK/strings.xml new file mode 100644 index 000000000..daa6a610a --- /dev/null +++ b/app/src/google/res/values-zh-rHK/strings.xml @@ -0,0 +1,6 @@ + + + + 閱讀Pro + + \ No newline at end of file diff --git a/app/src/google/res/values/strings.xml b/app/src/google/res/values/strings.xml new file mode 100644 index 000000000..ed2d735c4 --- /dev/null +++ b/app/src/google/res/values/strings.xml @@ -0,0 +1,6 @@ + + + + 阅读Pro + + \ No newline at end of file diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 67af4688e..b33892324 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -23,6 +23,7 @@ android:label="@string/app_name" android:networkSecurityConfig="@xml/network_security_config" android:supportsRtl="true" + android:requestLegacyExternalStorage="true" android:theme="@style/AppTheme.Light" tools:ignore="AllowBackup,GoogleAppIndexingWarning,UnusedAttribute"> @@ -78,6 +79,48 @@ android:resource="@xml/shortcuts" android:launchMode="singleTask" /> + + + + + + + + + + + + + + + + + + + + + + + + + android:launchMode="singleTop" /> + + + + @@ -177,14 +224,18 @@ android:scheme="yuedu" /> + + + + + + + + + + + @@ -228,6 +287,19 @@ + + + + + + + + + + + @@ -251,6 +323,10 @@ android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" /> + + \ No newline at end of file diff --git a/app/src/main/assets/help.md b/app/src/main/assets/help.md new file mode 100644 index 000000000..9f77645b6 --- /dev/null +++ b/app/src/main/assets/help.md @@ -0,0 +1,129 @@ +## 常见问题 + +1.为什么第一次安装好之后什么东西都没有? +* 因为阅读只是一个转码工具,不提供内容,第一次安装app,需要自己手动导入书源,可以从QQ群、公众号“开源阅读软件”、酷安评论里获取由书友制作分享的书源。 + +2.如何导入本地书源文件? +* 下载群文件里的书源文件(书源格式后缀有txt、json,其中json文件某些情况下无法导入,需要修改后缀为txt格式才可导入); +* 打开阅读软件; +* 我的 - 点击“书源管理”; +* 点击右上角选择“本地导入”; +* 左下角选择书源文件所在的路径; +* 点击书源文件导入; +* 导入后返回书源管理界面; +* 新版qq下载路径:Android/data/com.tencent.mobileqq/Tencent/QQfile_recv/ + +3.如何新建大佬发的单独书源? +* 复制书源代码; +* 打开阅读软件; +* 我的 - 点击“书源管理”; +* 右上角选择“新建书源”; +* 进入新建书源后点击右上角“粘贴源”; +* 粘贴书源完成后点击上方保存; +* 本次新建单独书源操作完成。 +* 注:如果书源有错误或者复制不全会显示格式错误,请重新复制。 + +4.为什么导入2.0书源后看不了书? +* 2.0部分书源并不适用3.0,建议导入后进行筛选。 + +5.阅读2.0数据如何导入阅读3.0? +* 先对阅读2.0的数据进行备份,然后进入阅读3.0,点击“我的”,选择“备份与恢复”,再点击“导入旧版本数据”。 + +6.如何给朋友分享我的书源? +* 打开阅读软件; +* 点击备份; +* 打开手机自带的文件管理; +* 手机自带内存根目录找到YueDu3.0文件夹; +* 找到myBookSource.json长按选择分享; +* 选择微信分享或者QQ分享; +* 选择你要分享的好友点击发送; +* 好友接收后在手机自带内存根目录找到myBookSource.json文件(QQ在tencent--QQfile_recv微信在Tencent--MicroMsg--Download); +* 复制该文件到手机自带内存根目录找到YueDu3.0文件夹(如已有该文件请先删除该文件或者备份到其他地方再复制到文件夹); +* 打开阅读软件点击恢复。 +* 注:备份路径如已修改过请在修改后的路径下查找书源文件。 + +7.目前阅读支持哪些格式的本地书籍? +* 目前支持TXT、EPUB格式(只支持显示EPUB里的文本内容,还不支持显示图片)。 + +8.如何刷新书架? +* 在书架界面下拉即可刷新。 + +9.书架界面书籍右上角的红色或者灰色背景小数字代表什么? +* 红色代表书籍有更新,灰色代表无更新,数字代表未读章节。 + +10.如何查看书籍详情? +* 长按书籍。 + +11.如何对书架上的书进行删除、切换书架的操作? +* 书籍详情页操作即可。 + +12.如何禁止或允许某本书更新? +* 书籍详情页,点击右上角 - “允许更新”。 + +13.如何更换小说封面、名字、作者或简介? +* 书籍详情页,点击右上角修改按钮。 + +14.怎么使用自定义字体? +* 阅读界面 - 字体-点击右上角选择字体文件路径。 + +15.目前支持哪些格式的字体文件? +* 目前支持ttf、otf格式。 + +16.书籍经常“正在加载中”怎么办? +* 在线书籍出现这个问题通常是由于源质量不好或不兼容引起的,可以换其它源多试试;本地书籍出现这个问题大概率是目录规则问题,手动切换规则可以解决。 + +17.书籍内容只有标题,正文内容是路径怎么办? +* 通常是缓存路径引起的,更换缓存路径即可。 + +18.效验书源显示失效就说明书源不能用了吗? +* 效验书源只是测试书源,可以做个参考,失效了不代表书源不能用了。 + +19.发现和正版书源能不能使用? +* 发现和正版书源只能用来找书,看排行榜,不能用来看书,如需看书请切换书源。 + +20.替换净化是什么? +* 替换净化可以去除书籍内容里的广告、错别字、屏蔽词等。 + +21.如何自己填写净化替换规则? +* 第一行:替换规则名称 - 根据自己需求对替换净化规则进行命名; +* 第二行:分组 - 净化规则的分组组别; +* 第三行:替换规则 - 填写需要被替换的内容; +* 第四行:替换为 - 填写想替换成的内容(如不填则默认表示删除第二行里填写的内容); +* 第五行:替换范围,选填书名或者源名 - 填写此替换净化规则需要对哪本书籍或者哪个书源生效(如不填则对所有书籍和书源生效)。 +* 注:如常规去除方法去除不掉,则需要勾选“使用正则表达式”,同时第二行里的替换规则也需要按照正则表达式来填写(正则表达式填写方法可自行百度学习)。 + +22.如何听书? +* 可以使用手机自带的朗读引擎,也可使用第三方如谷歌、小米等朗读引擎。 +* 【具体操作:安装-系统设置-其他高级设置-辅助功能-TTS输出-选择安装的朗读引擎(不同品牌手机的操作方法及步骤也不同,视情况而定)。】 + +23.如何设置屏幕方向、屏幕显示时长、显示/隐藏状态栏、显示/隐藏导航栏、音量键翻页、长按选择文本、点击总是翻下一页、自定义翻页案件? +* 阅读界面,设置(可上划,下面还有其他设置)。 + +24.搜索的时候感觉手机卡顿,如何解决? +* 我的 - 其他设置 - “更新和搜索线程数”调低。 + +25.更新前有什么注意事项? +* 要做好备份。 + +26.看书时如遇到“目录为空”、“加载失败”和长串英文等情况怎么办? +* 一般是书源问题,切换书源即可。 + +27.为什么书源这么多,发现里却只有一点点? +* 书源想要在发现界面里显示需要在书源里添加发现规则,并不是所有书源都有发现规则。 + +28.云备份在哪? +* 我的 - 备份与恢复 - WebDav设置。 + +29.如何操作进行云备份? +* 侧栏设置,WebDav设置; +* 正确填写WebDAV 服务器地址、WebDAV 账号、WebDAV 密码;(要获得这三项的信息,需要注册一个坚果云账号,如果直接在手机上注册,坚果云会让你下载app,过程比较麻烦,为了一步到位,最好是在电脑上打开这个注册链接:https://www.jianguoyun.com/d/signup;注册后,进入坚果云;点击右上角账户名处选择 “账户信息”,然后选择“安全选项”;在“安全选项” 中找到“第三方应用管理”,并选择“添加应用”,输入名称如“阅读”后,会生成密码,选择完成;其中https://dav.jianguoyun.com/dav/就是填入“WebDAV 服务器地址”的内容,“使用情况”后面的邮箱地址就是你的“WebDAV 账号”,点击显示密码后得到的密码就是你的“WebDAV 密码”。) +* 无需操作,APP默认每天自动云备份一次。 + +30.关于云备份的相关说明 +* 在正确设置好云备份的情况下,APP默认每天自动云备份一次,当日多次手动云备份会对当日的旧云备份文件进行覆盖,并不会覆盖之前及之后不同日期的备份文件,每天所自动云备份的文件会按照日期进行命名。 + +31.本地备份和云备份都能备份哪些东西? +* 书架、看书进度、搜索记录、书源、替换、APP设置等都会备份,基本涵盖所有内容。 + +32.出现某些未知bug怎么办? +* 清除软件数据试试看,不行再进行反馈。 \ No newline at end of file diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index fe74ee832..7acf6700f 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -1,6 +1,120 @@ ## 更新日志 * 旧版数据导入教程:先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】。 -* 请关注[开源阅读软件]()支持我,同时关注合作公众号[小说拾遗](),阅读公众号小编。 +* 请关注公众号[开源阅读]()支持我,同时关注合作公众号[小说拾遗](),阅读公众号小编。 +* 新公众号[开源阅读]()已启用,[开源阅读软件]()备用 + +**2020/04/20** +* 优化阅读界面信息显示 + +**2020/04/19** +* 添加阅读界面各种信息设置 + +**2020/04/18** +* feat: 中文简繁处理库换成 HanLP, 中文增加 zh-rHK 翻译, hingbong +* 修复更新时间不对的bug + +**2020/04/13** +* 去除rss朗读时的引号 + +**2020/04/13** +* 修复调用webView返回结果多了引号的bug + +**2020/04/12** +* 解决无法取消加粗的bug +* 修复换源自动加入书架的bug + +**2020/04/09** +* 修复书架刷新闪烁 + +**2020/04/08** +* 可以隐藏书架未分组 + +**2020/04/07** +* 书架添加未分组,有未分组书籍时自动显示 +* 其它一些优化 + +**2020/04/04** +* 优化备份逻辑 +* 修复订阅分类太多显示不全的bug +* 修复一些分类要手动刷新的问题 + +**2020/04/02** +* 书架书名和作者作为唯一值 +* 添加订阅分类,分类规则和发现一样,分类一::url1 && 分类2::url2 + +**2020/03/29** +* 添加退出软件后是否响应耳机按键的开关 +* 优化书源校验 + +**2020/03/26** +* 修复txt目录bug +* 最近工作比较忙,只有晚上有时间写软件,bug之类的不要催,白天不回消息 + +**2020/03/25** +* 修复7.1.1的网络问题,是retrofit2库最新版本的bug,暂时退回上版本 +* 去除下载路径的配置,减少错误 +* 添加隐藏状态栏是否扩展到刘海 + +**2020/03/24** +* txt文件第一章之前的文字不再放到简介里 +* 优化txt目录识别,章节超过3万字判断为目录识别错误重新识别 +* 修复文件关联 by wqfantexi + +**2020/03/22** +* 添加文件关联 by wqfantexi +* 手动排序可以了,在书架整理里面拖动排序 +* 删除分组时同时删除书籍里的分组信息,下次添加新分组时不会自动出现在分组内 +* 修复换源丢失分组信息的bug +* 修复部分朗读引擎不自动朗读下一章的bug + +**2020/03/21** +* 详情页点击书名搜索 + +**2020/03/20** +* 自动备份文件和手动备份文件分开 +* 修复一些rss收藏取消不了的bug +* 修复rss请求头无效bug + +**2020/03/19** +* 美化界面我的 by yangyxd +* 优化搜索 + +**2020/03/18** +* 尝试修复搜索时崩溃 +* 解决看过书籍的移到顶部需要向上滚动才能看到的bug +* 只有再书源被删除找不到书源时才会自动换源 +* 美化界面 by yangyxd +* 订阅后台播放 + +**2020/03/16** +* 修复滚动模式切换章节位置不归0的bug +* 修复文字选择更多菜单在部分手机上报错的bug +* 修复文字选择菜单问题 + +**2020/03/15** +* 加载正文无书源时自动换源 + +**2020/03/14** +* 修改导航栏图标 + +**2020/03/13** +* 更改书架控件,ViewPager2替换回2.0使用的ViewPager,解决下拉不流畅问题 +* 修复点击作者搜索后,打开的详情页还是原来的书籍的bug +* 修改朗读菜单 +* 优化rss朗读 + +**2020/03/12** +* 导入本地添加需要权限模式 + +**2020/03/11** +* 修复调节上边距时下边距一起动的bug +* 适配沚水的web阅读 by 六月 +* 分组管理页面调整 by yangyxd + +**2020/03/10** +* 优化文字选择菜单弹出位置 +* 添加屏幕方向控制 +* 添加点击作者搜索 **2020/03/09** * 底部文字对齐 @@ -216,14 +330,7 @@ - 调试正文页>>输入正文页URL,如:`--https://www.zhaishuyuan.com/chapter/30394/20940996` * 修改订阅中自动添加style的情景 - 订阅源的内容规则中存在` - ``` + 订阅源的内容规则中存在` - - - - - - -
-
-
-
-
-
-
-
-
-
-
-
- + +
+ + \ No newline at end of file diff --git a/app/src/main/assets/web/css/about.f23c15cb.css b/app/src/main/assets/web/css/about.f23c15cb.css new file mode 100644 index 000000000..1e35af10d --- /dev/null +++ b/app/src/main/assets/web/css/about.f23c15cb.css @@ -0,0 +1 @@ +@charset "UTF-8";@font-face{font-family:FZZCYSK;src:local("☺"),url(../fonts/shelffont.6c094b6d.ttf);font-style:normal;font-weight:400}.index-wrapper[data-v-5e92421e]{height:100%;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.index-wrapper .navigation-wrapper[data-v-5e92421e]{width:260px;min-width:260px;padding:48px 36px;background-color:#f7f7f7}.index-wrapper .navigation-wrapper .navigation-title[data-v-5e92421e]{font-size:24px;font-weight:500;font-family:FZZCYSK}.index-wrapper .navigation-wrapper .navigation-sub-title[data-v-5e92421e]{font-size:16px;font-weight:300;font-family:FZZCYSK;margin-top:16px;color:#b1b1b1}.index-wrapper .navigation-wrapper .search-wrapper .search-input[data-v-5e92421e]{border-radius:50%;margin-top:24px}.index-wrapper .navigation-wrapper .search-wrapper .search-input[data-v-5e92421e] .el-input__inner{border-radius:50px;border-color:#e3e3e3}.index-wrapper .navigation-wrapper .recent-wrapper[data-v-5e92421e]{margin-top:36px}.index-wrapper .navigation-wrapper .recent-wrapper .recent-title[data-v-5e92421e]{font-size:14px;color:#b1b1b1;font-family:FZZCYSK}.index-wrapper .navigation-wrapper .recent-wrapper .reading-recent[data-v-5e92421e]{margin:18px 0}.index-wrapper .navigation-wrapper .recent-wrapper .reading-recent .recent-book[data-v-5e92421e]{font-size:10px;cursor:pointer}.index-wrapper .navigation-wrapper .setting-wrapper[data-v-5e92421e]{margin-top:36px}.index-wrapper .navigation-wrapper .setting-wrapper .setting-title[data-v-5e92421e]{font-size:14px;color:#b1b1b1;font-family:FZZCYSK}.index-wrapper .navigation-wrapper .setting-wrapper .no-point[data-v-5e92421e]{pointer-events:none}.index-wrapper .navigation-wrapper .setting-wrapper .setting-connect[data-v-5e92421e]{font-size:8px;margin-top:16px;cursor:pointer}.index-wrapper .navigation-wrapper .bottom-icons[data-v-5e92421e]{position:fixed;bottom:0;height:120px;width:260px;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.index-wrapper .shelf-wrapper[data-v-5e92421e]{padding:48px 48px;width:100%}.index-wrapper .shelf-wrapper[data-v-5e92421e] .el-icon-loading{font-size:36px;color:#b5b5b5}.index-wrapper .shelf-wrapper[data-v-5e92421e] .el-loading-text{font-weight:500;color:#b5b5b5}.index-wrapper .shelf-wrapper .books-wrapper[data-v-5e92421e]{height:100%;overflow:scroll}.index-wrapper .shelf-wrapper .books-wrapper .wrapper[data-v-5e92421e]{display:grid;grid-template-columns:repeat(auto-fill,380px);-ms-flex-pack:distribute;justify-content:space-around;grid-gap:10px}.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book[data-v-5e92421e]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;display:-webkit-box;display:-ms-flexbox;display:flex;cursor:pointer;margin-bottom:18px;padding:24px 24px;width:360px;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-pack:distribute;justify-content:space-around}.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book .cover-img .cover[data-v-5e92421e],.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book .cover-img[data-v-5e92421e]{width:84px;height:112px}.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book .info[data-v-5e92421e]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-ms-flex-pack:distribute;justify-content:space-around;-webkit-box-align:left;-ms-flex-align:left;align-items:left;height:112px;margin-left:20px;-webkit-box-flex:1;-ms-flex:1;flex:1}.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book .info .name[data-v-5e92421e]{width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;font-size:16px;font-weight:700;color:#33373d}.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book .info .sub[data-v-5e92421e]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;font-size:12px;font-weight:600;color:#6b6b6b}.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book .info .sub .dot[data-v-5e92421e]{margin:0 7px}.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book .info .dur-chapter[data-v-5e92421e],.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book .info .intro[data-v-5e92421e],.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book .info .last-chapter[data-v-5e92421e]{color:#969ba3;font-size:13px;margin-top:3px;font-weight:500;word-wrap:break-word;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-align:left}.index-wrapper .shelf-wrapper .books-wrapper .wrapper .book[data-v-5e92421e]:hover{background:rgba(0,0,0,.1);-webkit-transition-duration:.5s;transition-duration:.5s}.index-wrapper .shelf-wrapper .books-wrapper .wrapper[data-v-5e92421e]:last-child{margin-right:auto}.index-wrapper .shelf-wrapper .books-wrapper[data-v-5e92421e]::-webkit-scrollbar{width:0!important} \ No newline at end of file diff --git a/app/src/main/assets/web/css/app.e1c0d2e4.css b/app/src/main/assets/web/css/app.e1c0d2e4.css new file mode 100644 index 000000000..275e8c3ec --- /dev/null +++ b/app/src/main/assets/web/css/app.e1c0d2e4.css @@ -0,0 +1 @@ +#app{font-family:Avenir,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;color:#2c3e50;margin:0;height:100%} \ No newline at end of file diff --git a/app/src/main/assets/web/css/chunk-vendors.ad4ff18f.css b/app/src/main/assets/web/css/chunk-vendors.ad4ff18f.css new file mode 100644 index 000000000..997434314 --- /dev/null +++ b/app/src/main/assets/web/css/chunk-vendors.ad4ff18f.css @@ -0,0 +1 @@ +.el-message__closeBtn:focus,.el-message__content:focus{outline-width:0}.el-message{min-width:380px;-webkit-box-sizing:border-box;box-sizing:border-box;border-radius:4px;border-width:1px;border-style:solid;border-color:#ebeef5;position:fixed;left:50%;top:20px;-webkit-transform:translateX(-50%);transform:translateX(-50%);background-color:#edf2fc;-webkit-transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,top .4s,-webkit-transform .4s;transition:opacity .3s,transform .4s,top .4s;transition:opacity .3s,transform .4s,top .4s,-webkit-transform .4s;overflow:hidden;padding:15px 15px 15px 20px;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-message.is-center{-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message.is-closable .el-message__content{padding-right:16px}.el-message p{margin:0}.el-message--info .el-message__content{color:#909399}.el-message--success{background-color:#f0f9eb;border-color:#e1f3d8}.el-message--success .el-message__content{color:#67c23a}.el-message--warning{background-color:#fdf6ec;border-color:#faecd8}.el-message--warning .el-message__content{color:#e6a23c}.el-message--error{background-color:#fef0f0;border-color:#fde2e2}.el-message--error .el-message__content{color:#f56c6c}.el-message__icon{margin-right:10px}.el-message__content{padding:0;font-size:14px;line-height:1}.el-message__closeBtn{position:absolute;top:50%;right:15px;-webkit-transform:translateY(-50%);transform:translateY(-50%);cursor:pointer;color:#c0c4cc;font-size:16px}.el-message__closeBtn:hover{color:#909399}.el-message .el-icon-success{color:#67c23a}.el-message .el-icon-error{color:#f56c6c}.el-message .el-icon-info{color:#909399}.el-message .el-icon-warning{color:#e6a23c}.el-message-fade-enter,.el-message-fade-leave-active{opacity:0;-webkit-transform:translate(-50%,-100%);transform:translate(-50%,-100%)}.el-fade-in-enter,.el-fade-in-leave-active,.el-fade-in-linear-enter,.el-fade-in-linear-leave,.el-fade-in-linear-leave-active,.fade-in-linear-enter,.fade-in-linear-leave,.fade-in-linear-leave-active{opacity:0}.el-fade-in-linear-enter-active,.el-fade-in-linear-leave-active,.fade-in-linear-enter-active,.fade-in-linear-leave-active{-webkit-transition:opacity .2s linear;transition:opacity .2s linear}.el-fade-in-enter-active,.el-fade-in-leave-active,.el-zoom-in-center-enter-active,.el-zoom-in-center-leave-active{-webkit-transition:all .3s cubic-bezier(.55,0,.1,1);transition:all .3s cubic-bezier(.55,0,.1,1)}.el-zoom-in-center-enter,.el-zoom-in-center-leave-active{opacity:0;-webkit-transform:scaleX(0);transform:scaleX(0)}.el-zoom-in-top-enter-active,.el-zoom-in-top-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center top;transform-origin:center top}.el-zoom-in-top-enter,.el-zoom-in-top-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-bottom-enter-active,.el-zoom-in-bottom-leave-active{opacity:1;-webkit-transform:scaleY(1);transform:scaleY(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:center bottom;transform-origin:center bottom}.el-zoom-in-bottom-enter,.el-zoom-in-bottom-leave-active{opacity:0;-webkit-transform:scaleY(0);transform:scaleY(0)}.el-zoom-in-left-enter-active,.el-zoom-in-left-leave-active{opacity:1;-webkit-transform:scale(1);transform:scale(1);-webkit-transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1);transition:transform .3s cubic-bezier(.23,1,.32,1),opacity .3s cubic-bezier(.23,1,.32,1),-webkit-transform .3s cubic-bezier(.23,1,.32,1);-webkit-transform-origin:top left;transform-origin:top left}.el-zoom-in-left-enter,.el-zoom-in-left-leave-active{opacity:0;-webkit-transform:scale(.45);transform:scale(.45)}.collapse-transition{-webkit-transition:height .3s ease-in-out,padding-top .3s ease-in-out,padding-bottom .3s ease-in-out;transition:height .3s ease-in-out,padding-top .3s ease-in-out,padding-bottom .3s ease-in-out}.horizontal-collapse-transition{-webkit-transition:width .3s ease-in-out,padding-left .3s ease-in-out,padding-right .3s ease-in-out;transition:width .3s ease-in-out,padding-left .3s ease-in-out,padding-right .3s ease-in-out}.el-list-enter-active,.el-list-leave-active{-webkit-transition:all 1s;transition:all 1s}.el-list-enter,.el-list-leave-active{opacity:0;-webkit-transform:translateY(-30px);transform:translateY(-30px)}.el-opacity-transition{-webkit-transition:opacity .3s cubic-bezier(.55,0,.1,1);transition:opacity .3s cubic-bezier(.55,0,.1,1)}@font-face{font-family:element-icons;src:url(../fonts/element-icons.535877f5.woff) format("woff"),url(../fonts/element-icons.732389de.ttf) format("truetype");font-weight:400;font-display:"auto";font-style:normal}[class*=" el-icon-"],[class^=el-icon-]{font-family:element-icons!important;speak:none;font-style:normal;font-weight:400;font-variant:normal;text-transform:none;line-height:1;vertical-align:baseline;display:inline-block;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.el-icon-ice-cream-round:before{content:"\e6a0"}.el-icon-ice-cream-square:before{content:"\e6a3"}.el-icon-lollipop:before{content:"\e6a4"}.el-icon-potato-strips:before{content:"\e6a5"}.el-icon-milk-tea:before{content:"\e6a6"}.el-icon-ice-drink:before{content:"\e6a7"}.el-icon-ice-tea:before{content:"\e6a9"}.el-icon-coffee:before{content:"\e6aa"}.el-icon-orange:before{content:"\e6ab"}.el-icon-pear:before{content:"\e6ac"}.el-icon-apple:before{content:"\e6ad"}.el-icon-cherry:before{content:"\e6ae"}.el-icon-watermelon:before{content:"\e6af"}.el-icon-grape:before{content:"\e6b0"}.el-icon-refrigerator:before{content:"\e6b1"}.el-icon-goblet-square-full:before{content:"\e6b2"}.el-icon-goblet-square:before{content:"\e6b3"}.el-icon-goblet-full:before{content:"\e6b4"}.el-icon-goblet:before{content:"\e6b5"}.el-icon-cold-drink:before{content:"\e6b6"}.el-icon-coffee-cup:before{content:"\e6b8"}.el-icon-water-cup:before{content:"\e6b9"}.el-icon-hot-water:before{content:"\e6ba"}.el-icon-ice-cream:before{content:"\e6bb"}.el-icon-dessert:before{content:"\e6bc"}.el-icon-sugar:before{content:"\e6bd"}.el-icon-tableware:before{content:"\e6be"}.el-icon-burger:before{content:"\e6bf"}.el-icon-knife-fork:before{content:"\e6c1"}.el-icon-fork-spoon:before{content:"\e6c2"}.el-icon-chicken:before{content:"\e6c3"}.el-icon-food:before{content:"\e6c4"}.el-icon-dish-1:before{content:"\e6c5"}.el-icon-dish:before{content:"\e6c6"}.el-icon-moon-night:before{content:"\e6ee"}.el-icon-moon:before{content:"\e6f0"}.el-icon-cloudy-and-sunny:before{content:"\e6f1"}.el-icon-partly-cloudy:before{content:"\e6f2"}.el-icon-cloudy:before{content:"\e6f3"}.el-icon-sunny:before{content:"\e6f6"}.el-icon-sunset:before{content:"\e6f7"}.el-icon-sunrise-1:before{content:"\e6f8"}.el-icon-sunrise:before{content:"\e6f9"}.el-icon-heavy-rain:before{content:"\e6fa"}.el-icon-lightning:before{content:"\e6fb"}.el-icon-light-rain:before{content:"\e6fc"}.el-icon-wind-power:before{content:"\e6fd"}.el-icon-baseball:before{content:"\e712"}.el-icon-soccer:before{content:"\e713"}.el-icon-football:before{content:"\e715"}.el-icon-basketball:before{content:"\e716"}.el-icon-ship:before{content:"\e73f"}.el-icon-truck:before{content:"\e740"}.el-icon-bicycle:before{content:"\e741"}.el-icon-mobile-phone:before{content:"\e6d3"}.el-icon-service:before{content:"\e6d4"}.el-icon-key:before{content:"\e6e2"}.el-icon-unlock:before{content:"\e6e4"}.el-icon-lock:before{content:"\e6e5"}.el-icon-watch:before{content:"\e6fe"}.el-icon-watch-1:before{content:"\e6ff"}.el-icon-timer:before{content:"\e702"}.el-icon-alarm-clock:before{content:"\e703"}.el-icon-map-location:before{content:"\e704"}.el-icon-delete-location:before{content:"\e705"}.el-icon-add-location:before{content:"\e706"}.el-icon-location-information:before{content:"\e707"}.el-icon-location-outline:before{content:"\e708"}.el-icon-location:before{content:"\e79e"}.el-icon-place:before{content:"\e709"}.el-icon-discover:before{content:"\e70a"}.el-icon-first-aid-kit:before{content:"\e70b"}.el-icon-trophy-1:before{content:"\e70c"}.el-icon-trophy:before{content:"\e70d"}.el-icon-medal:before{content:"\e70e"}.el-icon-medal-1:before{content:"\e70f"}.el-icon-stopwatch:before{content:"\e710"}.el-icon-mic:before{content:"\e711"}.el-icon-copy-document:before{content:"\e718"}.el-icon-full-screen:before{content:"\e719"}.el-icon-switch-button:before{content:"\e71b"}.el-icon-aim:before{content:"\e71c"}.el-icon-crop:before{content:"\e71d"}.el-icon-odometer:before{content:"\e71e"}.el-icon-time:before{content:"\e71f"}.el-icon-bangzhu:before{content:"\e724"}.el-icon-close-notification:before{content:"\e726"}.el-icon-microphone:before{content:"\e727"}.el-icon-turn-off-microphone:before{content:"\e728"}.el-icon-position:before{content:"\e729"}.el-icon-postcard:before{content:"\e72a"}.el-icon-message:before{content:"\e72b"}.el-icon-chat-line-square:before{content:"\e72d"}.el-icon-chat-dot-square:before{content:"\e72e"}.el-icon-chat-dot-round:before{content:"\e72f"}.el-icon-chat-square:before{content:"\e730"}.el-icon-chat-line-round:before{content:"\e731"}.el-icon-chat-round:before{content:"\e732"}.el-icon-set-up:before{content:"\e733"}.el-icon-turn-off:before{content:"\e734"}.el-icon-open:before{content:"\e735"}.el-icon-connection:before{content:"\e736"}.el-icon-link:before{content:"\e737"}.el-icon-cpu:before{content:"\e738"}.el-icon-thumb:before{content:"\e739"}.el-icon-female:before{content:"\e73a"}.el-icon-male:before{content:"\e73b"}.el-icon-guide:before{content:"\e73c"}.el-icon-news:before{content:"\e73e"}.el-icon-price-tag:before{content:"\e744"}.el-icon-discount:before{content:"\e745"}.el-icon-wallet:before{content:"\e747"}.el-icon-coin:before{content:"\e748"}.el-icon-money:before{content:"\e749"}.el-icon-bank-card:before{content:"\e74a"}.el-icon-box:before{content:"\e74b"}.el-icon-present:before{content:"\e74c"}.el-icon-sell:before{content:"\e6d5"}.el-icon-sold-out:before{content:"\e6d6"}.el-icon-shopping-bag-2:before{content:"\e74d"}.el-icon-shopping-bag-1:before{content:"\e74e"}.el-icon-shopping-cart-2:before{content:"\e74f"}.el-icon-shopping-cart-1:before{content:"\e750"}.el-icon-shopping-cart-full:before{content:"\e751"}.el-icon-smoking:before{content:"\e752"}.el-icon-no-smoking:before{content:"\e753"}.el-icon-house:before{content:"\e754"}.el-icon-table-lamp:before{content:"\e755"}.el-icon-school:before{content:"\e756"}.el-icon-office-building:before{content:"\e757"}.el-icon-toilet-paper:before{content:"\e758"}.el-icon-notebook-2:before{content:"\e759"}.el-icon-notebook-1:before{content:"\e75a"}.el-icon-files:before{content:"\e75b"}.el-icon-collection:before{content:"\e75c"}.el-icon-receiving:before{content:"\e75d"}.el-icon-suitcase-1:before{content:"\e760"}.el-icon-suitcase:before{content:"\e761"}.el-icon-film:before{content:"\e763"}.el-icon-collection-tag:before{content:"\e765"}.el-icon-data-analysis:before{content:"\e766"}.el-icon-pie-chart:before{content:"\e767"}.el-icon-data-board:before{content:"\e768"}.el-icon-data-line:before{content:"\e76d"}.el-icon-reading:before{content:"\e769"}.el-icon-magic-stick:before{content:"\e76a"}.el-icon-coordinate:before{content:"\e76b"}.el-icon-mouse:before{content:"\e76c"}.el-icon-brush:before{content:"\e76e"}.el-icon-headset:before{content:"\e76f"}.el-icon-umbrella:before{content:"\e770"}.el-icon-scissors:before{content:"\e771"}.el-icon-mobile:before{content:"\e773"}.el-icon-attract:before{content:"\e774"}.el-icon-monitor:before{content:"\e775"}.el-icon-search:before{content:"\e778"}.el-icon-takeaway-box:before{content:"\e77a"}.el-icon-paperclip:before{content:"\e77d"}.el-icon-printer:before{content:"\e77e"}.el-icon-document-add:before{content:"\e782"}.el-icon-document:before{content:"\e785"}.el-icon-document-checked:before{content:"\e786"}.el-icon-document-copy:before{content:"\e787"}.el-icon-document-delete:before{content:"\e788"}.el-icon-document-remove:before{content:"\e789"}.el-icon-tickets:before{content:"\e78b"}.el-icon-folder-checked:before{content:"\e77f"}.el-icon-folder-delete:before{content:"\e780"}.el-icon-folder-remove:before{content:"\e781"}.el-icon-folder-add:before{content:"\e783"}.el-icon-folder-opened:before{content:"\e784"}.el-icon-folder:before{content:"\e78a"}.el-icon-edit-outline:before{content:"\e764"}.el-icon-edit:before{content:"\e78c"}.el-icon-date:before{content:"\e78e"}.el-icon-c-scale-to-original:before{content:"\e7c6"}.el-icon-view:before{content:"\e6ce"}.el-icon-loading:before{content:"\e6cf"}.el-icon-rank:before{content:"\e6d1"}.el-icon-sort-down:before{content:"\e7c4"}.el-icon-sort-up:before{content:"\e7c5"}.el-icon-sort:before{content:"\e6d2"}.el-icon-finished:before{content:"\e6cd"}.el-icon-refresh-left:before{content:"\e6c7"}.el-icon-refresh-right:before{content:"\e6c8"}.el-icon-refresh:before{content:"\e6d0"}.el-icon-video-play:before{content:"\e7c0"}.el-icon-video-pause:before{content:"\e7c1"}.el-icon-d-arrow-right:before{content:"\e6dc"}.el-icon-d-arrow-left:before{content:"\e6dd"}.el-icon-arrow-up:before{content:"\e6e1"}.el-icon-arrow-down:before{content:"\e6df"}.el-icon-arrow-right:before{content:"\e6e0"}.el-icon-arrow-left:before{content:"\e6de"}.el-icon-top-right:before{content:"\e6e7"}.el-icon-top-left:before{content:"\e6e8"}.el-icon-top:before{content:"\e6e6"}.el-icon-bottom:before{content:"\e6eb"}.el-icon-right:before{content:"\e6e9"}.el-icon-back:before{content:"\e6ea"}.el-icon-bottom-right:before{content:"\e6ec"}.el-icon-bottom-left:before{content:"\e6ed"}.el-icon-caret-top:before{content:"\e78f"}.el-icon-caret-bottom:before{content:"\e790"}.el-icon-caret-right:before{content:"\e791"}.el-icon-caret-left:before{content:"\e792"}.el-icon-d-caret:before{content:"\e79a"}.el-icon-share:before{content:"\e793"}.el-icon-menu:before{content:"\e798"}.el-icon-s-grid:before{content:"\e7a6"}.el-icon-s-check:before{content:"\e7a7"}.el-icon-s-data:before{content:"\e7a8"}.el-icon-s-opportunity:before{content:"\e7aa"}.el-icon-s-custom:before{content:"\e7ab"}.el-icon-s-claim:before{content:"\e7ad"}.el-icon-s-finance:before{content:"\e7ae"}.el-icon-s-comment:before{content:"\e7af"}.el-icon-s-flag:before{content:"\e7b0"}.el-icon-s-marketing:before{content:"\e7b1"}.el-icon-s-shop:before{content:"\e7b4"}.el-icon-s-open:before{content:"\e7b5"}.el-icon-s-management:before{content:"\e7b6"}.el-icon-s-ticket:before{content:"\e7b7"}.el-icon-s-release:before{content:"\e7b8"}.el-icon-s-home:before{content:"\e7b9"}.el-icon-s-promotion:before{content:"\e7ba"}.el-icon-s-operation:before{content:"\e7bb"}.el-icon-s-unfold:before{content:"\e7bc"}.el-icon-s-fold:before{content:"\e7a9"}.el-icon-s-platform:before{content:"\e7bd"}.el-icon-s-order:before{content:"\e7be"}.el-icon-s-cooperation:before{content:"\e7bf"}.el-icon-bell:before{content:"\e725"}.el-icon-message-solid:before{content:"\e799"}.el-icon-video-camera:before{content:"\e772"}.el-icon-video-camera-solid:before{content:"\e796"}.el-icon-camera:before{content:"\e779"}.el-icon-camera-solid:before{content:"\e79b"}.el-icon-download:before{content:"\e77c"}.el-icon-upload2:before{content:"\e77b"}.el-icon-upload:before{content:"\e7c3"}.el-icon-picture-outline-round:before{content:"\e75f"}.el-icon-picture-outline:before{content:"\e75e"}.el-icon-picture:before{content:"\e79f"}.el-icon-close:before{content:"\e6db"}.el-icon-check:before{content:"\e6da"}.el-icon-plus:before{content:"\e6d9"}.el-icon-minus:before{content:"\e6d8"}.el-icon-help:before{content:"\e73d"}.el-icon-s-help:before{content:"\e7b3"}.el-icon-circle-close:before{content:"\e78d"}.el-icon-circle-check:before{content:"\e720"}.el-icon-circle-plus-outline:before{content:"\e723"}.el-icon-remove-outline:before{content:"\e722"}.el-icon-zoom-out:before{content:"\e776"}.el-icon-zoom-in:before{content:"\e777"}.el-icon-error:before{content:"\e79d"}.el-icon-success:before{content:"\e79c"}.el-icon-circle-plus:before{content:"\e7a0"}.el-icon-remove:before{content:"\e7a2"}.el-icon-info:before{content:"\e7a1"}.el-icon-question:before{content:"\e7a4"}.el-icon-warning-outline:before{content:"\e6c9"}.el-icon-warning:before{content:"\e7a3"}.el-icon-goods:before{content:"\e7c2"}.el-icon-s-goods:before{content:"\e7b2"}.el-icon-star-off:before{content:"\e717"}.el-icon-star-on:before{content:"\e797"}.el-icon-more-outline:before{content:"\e6cc"}.el-icon-more:before{content:"\e794"}.el-icon-phone-outline:before{content:"\e6cb"}.el-icon-phone:before{content:"\e795"}.el-icon-user:before{content:"\e6e3"}.el-icon-user-solid:before{content:"\e7a5"}.el-icon-setting:before{content:"\e6ca"}.el-icon-s-tools:before{content:"\e7ac"}.el-icon-delete:before{content:"\e6d7"}.el-icon-delete-solid:before{content:"\e7c9"}.el-icon-eleme:before{content:"\e7c7"}.el-icon-platform-eleme:before{content:"\e7ca"}.el-icon-loading{-webkit-animation:rotating 2s linear infinite;animation:rotating 2s linear infinite}.el-icon--right{margin-left:5px}.el-icon--left{margin-right:5px}@-webkit-keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes rotating{0%{-webkit-transform:rotate(0);transform:rotate(0)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.el-button,.el-input__inner{-webkit-appearance:none;outline:0}.el-message-box,.el-popup-parent--hidden{overflow:hidden}.v-modal-enter{-webkit-animation:v-modal-in .2s ease;animation:v-modal-in .2s ease}.v-modal-leave{-webkit-animation:v-modal-out .2s ease forwards;animation:v-modal-out .2s ease forwards}@-webkit-keyframes v-modal-in{0%{opacity:0}}@keyframes v-modal-in{0%{opacity:0}}@-webkit-keyframes v-modal-out{to{opacity:0}}@keyframes v-modal-out{to{opacity:0}}.v-modal{position:fixed;left:0;top:0;width:100%;height:100%;opacity:.5;background:#000}.el-message-box{display:inline-block;width:420px;padding-bottom:10px;vertical-align:middle;background-color:#fff;border-radius:4px;border:1px solid #ebeef5;font-size:18px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);text-align:left;-webkit-backface-visibility:hidden;backface-visibility:hidden}.el-message-box__wrapper{position:fixed;top:0;bottom:0;left:0;right:0;text-align:center}.el-message-box__wrapper:after{content:"";display:inline-block;height:100%;width:0;vertical-align:middle}.el-message-box__header{position:relative;padding:15px 15px 10px}.el-message-box__title{padding-left:0;margin-bottom:0;font-size:18px;line-height:1;color:#303133}.el-message-box__headerbtn{position:absolute;top:15px;right:15px;padding:0;border:none;outline:0;background:0 0;font-size:16px;cursor:pointer}.el-message-box__headerbtn .el-message-box__close{color:#909399}.el-message-box__headerbtn:focus .el-message-box__close,.el-message-box__headerbtn:hover .el-message-box__close{color:#409eff}.el-message-box__content{padding:10px 15px;color:#606266;font-size:14px}.el-message-box__container{position:relative}.el-message-box__input{padding-top:15px}.el-message-box__input input.invalid,.el-message-box__input input.invalid:focus{border-color:#f56c6c}.el-message-box__status{position:absolute;top:50%;-webkit-transform:translateY(-50%);transform:translateY(-50%);font-size:24px!important}.el-message-box__status:before{padding-left:1px}.el-message-box__status+.el-message-box__message{padding-left:36px;padding-right:12px}.el-message-box__status.el-icon-success{color:#67c23a}.el-message-box__status.el-icon-info{color:#909399}.el-message-box__status.el-icon-warning{color:#e6a23c}.el-message-box__status.el-icon-error{color:#f56c6c}.el-message-box__message{margin:0}.el-message-box__message p{margin:0;line-height:24px}.el-message-box__errormsg{color:#f56c6c;font-size:12px;min-height:18px;margin-top:2px}.el-message-box__btns{padding:5px 15px 0;text-align:right}.el-message-box__btns button:nth-child(2){margin-left:10px}.el-message-box__btns-reverse{-webkit-box-orient:horizontal;-webkit-box-direction:reverse;-ms-flex-direction:row-reverse;flex-direction:row-reverse}.el-message-box--center{padding-bottom:30px}.el-message-box--center .el-message-box__header{padding-top:30px}.el-message-box--center .el-message-box__title{position:relative;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.el-message-box--center .el-message-box__status{position:relative;top:auto;padding-right:5px;text-align:center;-webkit-transform:translateY(-1px);transform:translateY(-1px)}.el-message-box--center .el-message-box__message{margin-left:0}.el-message-box--center .el-message-box__btns,.el-message-box--center .el-message-box__content{text-align:center}.el-message-box--center .el-message-box__content{padding-left:27px;padding-right:27px}.msgbox-fade-enter-active{-webkit-animation:msgbox-fade-in .3s;animation:msgbox-fade-in .3s}.msgbox-fade-leave-active{-webkit-animation:msgbox-fade-out .3s;animation:msgbox-fade-out .3s}@-webkit-keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@keyframes msgbox-fade-in{0%{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}to{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}}@-webkit-keyframes msgbox-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}@keyframes msgbox-fade-out{0%{-webkit-transform:translateZ(0);transform:translateZ(0);opacity:1}to{-webkit-transform:translate3d(0,-20px,0);transform:translate3d(0,-20px,0);opacity:0}}.el-loading-parent--relative{position:relative!important}.el-loading-parent--hidden{overflow:hidden!important}.el-loading-mask{position:absolute;z-index:2000;background-color:hsla(0,0%,100%,.9);margin:0;top:0;right:0;bottom:0;left:0;-webkit-transition:opacity .3s;transition:opacity .3s}.el-loading-mask.is-fullscreen{position:fixed}.el-loading-mask.is-fullscreen .el-loading-spinner{margin-top:-25px}.el-loading-mask.is-fullscreen .el-loading-spinner .circular{height:50px;width:50px}.el-loading-spinner{top:50%;margin-top:-21px;width:100%;text-align:center;position:absolute}.el-loading-spinner .el-loading-text{color:#409eff;margin:3px 0;font-size:14px}.el-loading-spinner .circular{height:42px;width:42px;-webkit-animation:loading-rotate 2s linear infinite;animation:loading-rotate 2s linear infinite}.el-loading-spinner .path{-webkit-animation:loading-dash 1.5s ease-in-out infinite;animation:loading-dash 1.5s ease-in-out infinite;stroke-dasharray:90,150;stroke-dashoffset:0;stroke-width:2;stroke:#409eff;stroke-linecap:round}.el-loading-spinner i{color:#409eff}.el-loading-fade-enter,.el-loading-fade-leave-active{opacity:0}@-webkit-keyframes loading-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes loading-rotate{to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@-webkit-keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}@keyframes loading-dash{0%{stroke-dasharray:1,200;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-40px}to{stroke-dasharray:90,150;stroke-dashoffset:-120px}}.el-textarea{position:relative;display:inline-block;width:100%;vertical-align:bottom;font-size:14px}.el-textarea__inner{display:block;resize:vertical;padding:5px 15px;line-height:1.5;-webkit-box-sizing:border-box;box-sizing:border-box;width:100%;font-size:inherit;color:#606266;background-color:#fff;background-image:none;border:1px solid #dcdfe6;border-radius:4px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1)}.el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::-ms-input-placeholder{color:#c0c4cc}.el-textarea__inner::-moz-placeholder{color:#c0c4cc}.el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea__inner:hover{border-color:#c0c4cc}.el-textarea__inner:focus{outline:0;border-color:#409eff}.el-textarea .el-input__count{color:#909399;background:#fff;position:absolute;font-size:12px;bottom:5px;right:10px}.el-textarea.is-disabled .el-textarea__inner{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.el-textarea.is-disabled .el-textarea__inner::-webkit-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner:-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::-ms-input-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::-moz-placeholder{color:#c0c4cc}.el-textarea.is-disabled .el-textarea__inner::placeholder{color:#c0c4cc}.el-textarea.is-exceed .el-textarea__inner{border-color:#f56c6c}.el-textarea.is-exceed .el-input__count{color:#f56c6c}.el-input{position:relative;font-size:14px;display:inline-block;width:100%}.el-input::-webkit-scrollbar{z-index:11;width:6px}.el-input::-webkit-scrollbar:horizontal{height:6px}.el-input::-webkit-scrollbar-thumb{border-radius:5px;width:6px;background:#b4bccc}.el-input::-webkit-scrollbar-corner,.el-input::-webkit-scrollbar-track{background:#fff}.el-input::-webkit-scrollbar-track-piece{background:#fff;width:6px}.el-input .el-input__clear{color:#c0c4cc;font-size:14px;cursor:pointer;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1)}.el-input .el-input__clear:hover{color:#909399}.el-input .el-input__count{height:100%;display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-align:center;-ms-flex-align:center;align-items:center;color:#909399;font-size:12px}.el-input .el-input__count .el-input__count-inner{background:#fff;line-height:normal;display:inline-block;padding:0 5px}.el-input__inner{-webkit-appearance:none;background-color:#fff;background-image:none;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;color:#606266;display:inline-block;font-size:inherit;height:40px;line-height:40px;outline:0;padding:0 15px;-webkit-transition:border-color .2s cubic-bezier(.645,.045,.355,1);transition:border-color .2s cubic-bezier(.645,.045,.355,1);width:100%}.el-input__prefix,.el-input__suffix{position:absolute;top:0;-webkit-transition:all .3s;text-align:center;height:100%;color:#c0c4cc}.el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input__inner::-ms-input-placeholder{color:#c0c4cc}.el-input__inner::-moz-placeholder{color:#c0c4cc}.el-input__inner::placeholder{color:#c0c4cc}.el-input__inner:hover{border-color:#c0c4cc}.el-input.is-active .el-input__inner,.el-input__inner:focus{border-color:#409eff;outline:0}.el-input__suffix{right:5px;-webkit-transition:all .3s;transition:all .3s;pointer-events:none}.el-input__suffix-inner{pointer-events:all}.el-input__prefix{left:5px}.el-input__icon,.el-input__prefix{-webkit-transition:all .3s;transition:all .3s}.el-input__icon{height:100%;width:25px;text-align:center;line-height:40px}.el-input__icon:after{content:"";height:100%;width:0;display:inline-block;vertical-align:middle}.el-input__validateIcon{pointer-events:none}.el-input.is-disabled .el-input__inner{background-color:#f5f7fa;border-color:#e4e7ed;color:#c0c4cc;cursor:not-allowed}.el-input.is-disabled .el-input__inner::-webkit-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner:-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::-ms-input-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::-moz-placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__inner::placeholder{color:#c0c4cc}.el-input.is-disabled .el-input__icon{cursor:not-allowed}.el-input.is-exceed .el-input__inner{border-color:#f56c6c}.el-input.is-exceed .el-input__suffix .el-input__count{color:#f56c6c}.el-input--suffix .el-input__inner{padding-right:30px}.el-input--prefix .el-input__inner{padding-left:30px}.el-input--medium{font-size:14px}.el-input--medium .el-input__inner{height:36px;line-height:36px}.el-input--medium .el-input__icon{line-height:36px}.el-input--small{font-size:13px}.el-input--small .el-input__inner{height:32px;line-height:32px}.el-input--small .el-input__icon{line-height:32px}.el-input--mini{font-size:12px}.el-input--mini .el-input__inner{height:28px;line-height:28px}.el-input--mini .el-input__icon{line-height:28px}.el-input-group{line-height:normal;display:inline-table;width:100%;border-collapse:separate;border-spacing:0}.el-input-group>.el-input__inner{vertical-align:middle;display:table-cell}.el-input-group__append,.el-input-group__prepend{background-color:#f5f7fa;color:#909399;vertical-align:middle;display:table-cell;position:relative;border:1px solid #dcdfe6;border-radius:4px;padding:0 20px;width:1px;white-space:nowrap}.el-input-group--prepend .el-input__inner,.el-input-group__append{border-top-left-radius:0;border-bottom-left-radius:0}.el-input-group--append .el-input__inner,.el-input-group__prepend{border-top-right-radius:0;border-bottom-right-radius:0}.el-input-group__append:focus,.el-input-group__prepend:focus{outline:0}.el-input-group__append .el-button,.el-input-group__append .el-select,.el-input-group__prepend .el-button,.el-input-group__prepend .el-select{display:inline-block;margin:-10px -20px}.el-input-group__append button.el-button,.el-input-group__append div.el-select .el-input__inner,.el-input-group__append div.el-select:hover .el-input__inner,.el-input-group__prepend button.el-button,.el-input-group__prepend div.el-select .el-input__inner,.el-input-group__prepend div.el-select:hover .el-input__inner{border-color:transparent;background-color:transparent;color:inherit;border-top:0;border-bottom:0}.el-input-group__append .el-button,.el-input-group__append .el-input,.el-input-group__prepend .el-button,.el-input-group__prepend .el-input{font-size:inherit}.el-input-group__prepend{border-right:0}.el-input-group__append{border-left:0}.el-input-group--append .el-select .el-input.is-focus .el-input__inner,.el-input-group--prepend .el-select .el-input.is-focus .el-input__inner{border-color:transparent}.el-input__inner::-ms-clear{display:none;width:0;height:0}.el-popper .popper__arrow,.el-popper .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-popper .popper__arrow{border-width:6px;-webkit-filter:drop-shadow(0 2px 12px rgba(0,0,0,.03));filter:drop-shadow(0 2px 12px rgba(0,0,0,.03))}.el-popper .popper__arrow:after{content:" ";border-width:6px}.el-popper[x-placement^=top]{margin-bottom:12px}.el-popper[x-placement^=top] .popper__arrow{bottom:-6px;left:50%;margin-right:3px;border-top-color:#ebeef5;border-bottom-width:0}.el-popper[x-placement^=top] .popper__arrow:after{bottom:1px;margin-left:-6px;border-top-color:#fff;border-bottom-width:0}.el-popper[x-placement^=bottom]{margin-top:12px}.el-popper[x-placement^=bottom] .popper__arrow{top:-6px;left:50%;margin-right:3px;border-top-width:0;border-bottom-color:#ebeef5}.el-popper[x-placement^=bottom] .popper__arrow:after{top:1px;margin-left:-6px;border-top-width:0;border-bottom-color:#fff}.el-popper[x-placement^=right]{margin-left:12px}.el-popper[x-placement^=right] .popper__arrow{top:50%;left:-6px;margin-bottom:3px;border-right-color:#ebeef5;border-left-width:0}.el-popper[x-placement^=right] .popper__arrow:after{bottom:-6px;left:1px;border-right-color:#fff;border-left-width:0}.el-popper[x-placement^=left]{margin-right:12px}.el-popper[x-placement^=left] .popper__arrow{top:50%;right:-6px;margin-bottom:3px;border-right-width:0;border-left-color:#ebeef5}.el-popper[x-placement^=left] .popper__arrow:after{right:1px;bottom:-6px;margin-left:-6px;border-right-width:0;border-left-color:#fff}.el-popover{position:absolute;background:#fff;min-width:150px;border-radius:4px;border:1px solid #ebeef5;padding:12px;z-index:2000;color:#606266;line-height:1.4;text-align:justify;font-size:14px;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);word-break:break-all}.el-popover--plain{padding:18px 20px}.el-popover__title{color:#303133;font-size:16px;line-height:1;margin-bottom:12px}.el-popover:focus,.el-popover:focus:active,.el-popover__reference:focus:hover,.el-popover__reference:focus:not(.focusing){outline-width:0}.el-checkbox-button__inner,.el-tag{-webkit-box-sizing:border-box;white-space:nowrap}.el-checkbox-button__inner{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none}.el-table-column--selection .cell{padding-left:14px;padding-right:14px}.el-table-filter{border:1px solid #ebeef5;border-radius:2px;background-color:#fff;-webkit-box-shadow:0 2px 12px 0 rgba(0,0,0,.1);box-shadow:0 2px 12px 0 rgba(0,0,0,.1);-webkit-box-sizing:border-box;box-sizing:border-box;margin:2px 0}.el-table-filter__list{padding:5px 0;margin:0;list-style:none;min-width:100px}.el-table-filter__list-item{line-height:36px;padding:0 10px;cursor:pointer;font-size:14px}.el-table-filter__list-item:hover{background-color:#ecf5ff;color:#66b1ff}.el-table-filter__list-item.is-active{background-color:#409eff;color:#fff}.el-table-filter__content{min-width:100px}.el-table-filter__bottom{border-top:1px solid #ebeef5;padding:8px}.el-table-filter__bottom button{background:0 0;border:none;color:#606266;cursor:pointer;font-size:13px;padding:0 3px}.el-table-filter__bottom button:hover{color:#409eff}.el-table-filter__bottom button:focus{outline:0}.el-table-filter__bottom button.is-disabled{color:#c0c4cc;cursor:not-allowed}.el-table-filter__wrap{max-height:280px}.el-table-filter__checkbox-group{padding:10px}.el-table-filter__checkbox-group label.el-checkbox{display:block;margin-right:5px;margin-bottom:8px;margin-left:5px}.el-table-filter__checkbox-group .el-checkbox:last-child{margin-bottom:0}.el-checkbox,.el-checkbox__input{display:inline-block;position:relative;white-space:nowrap}.el-table,.el-table__append-wrapper{overflow:hidden}.el-table--hidden,.el-table td.is-hidden>*,.el-table th.is-hidden>*{visibility:hidden}.el-checkbox{color:#606266;font-weight:500;font-size:14px;cursor:pointer;user-select:none;margin-right:30px}.el-checkbox,.el-checkbox-button__inner,.el-table th{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none}.el-checkbox.is-bordered{padding:9px 20px 9px 10px;border-radius:4px;border:1px solid #dcdfe6;-webkit-box-sizing:border-box;box-sizing:border-box;line-height:normal;height:40px}.el-checkbox.is-bordered.is-checked{border-color:#409eff}.el-checkbox.is-bordered.is-disabled{border-color:#ebeef5;cursor:not-allowed}.el-checkbox.is-bordered+.el-checkbox.is-bordered{margin-left:10px}.el-checkbox.is-bordered.el-checkbox--medium{padding:7px 20px 7px 10px;border-radius:4px;height:36px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__label{line-height:17px;font-size:14px}.el-checkbox.is-bordered.el-checkbox--medium .el-checkbox__inner{height:14px;width:14px}.el-checkbox.is-bordered.el-checkbox--small{padding:5px 15px 5px 10px;border-radius:3px;height:32px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__label{line-height:15px;font-size:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--small .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox.is-bordered.el-checkbox--mini{padding:3px 15px 3px 10px;border-radius:3px;height:28px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__label{line-height:12px;font-size:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner{height:12px;width:12px}.el-checkbox.is-bordered.el-checkbox--mini .el-checkbox__inner:after{height:6px;width:2px}.el-checkbox__input{cursor:pointer;outline:0;line-height:1;vertical-align:middle}.el-checkbox__input.is-disabled .el-checkbox__inner{background-color:#edf2fc;border-color:#dcdfe6;cursor:not-allowed}.el-checkbox__input.is-disabled .el-checkbox__inner:after{cursor:not-allowed;border-color:#c0c4cc}.el-checkbox__input.is-disabled .el-checkbox__inner+.el-checkbox__label{cursor:not-allowed}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner{background-color:#f2f6fc;border-color:#dcdfe6}.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after{border-color:#c0c4cc}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner{background-color:#f2f6fc;border-color:#dcdfe6}.el-checkbox__input.is-disabled.is-indeterminate .el-checkbox__inner:before{background-color:#c0c4cc;border-color:#c0c4cc}.el-checkbox__input.is-checked .el-checkbox__inner,.el-checkbox__input.is-indeterminate .el-checkbox__inner{background-color:#409eff;border-color:#409eff}.el-checkbox__input.is-disabled+span.el-checkbox__label{color:#c0c4cc;cursor:not-allowed}.el-checkbox__input.is-checked .el-checkbox__inner:after{-webkit-transform:rotate(45deg) scaleY(1);transform:rotate(45deg) scaleY(1)}.el-checkbox__input.is-checked+.el-checkbox__label{color:#409eff}.el-checkbox__input.is-focus .el-checkbox__inner{border-color:#409eff}.el-checkbox__input.is-indeterminate .el-checkbox__inner:before{content:"";position:absolute;display:block;background-color:#fff;height:2px;-webkit-transform:scale(.5);transform:scale(.5);left:0;right:0;top:5px}.el-checkbox__input.is-indeterminate .el-checkbox__inner:after{display:none}.el-checkbox__inner{display:inline-block;position:relative;border:1px solid #dcdfe6;border-radius:2px;-webkit-box-sizing:border-box;box-sizing:border-box;width:14px;height:14px;background-color:#fff;z-index:1;-webkit-transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46);transition:border-color .25s cubic-bezier(.71,-.46,.29,1.46),background-color .25s cubic-bezier(.71,-.46,.29,1.46)}.el-checkbox__inner:hover{border-color:#409eff}.el-checkbox__inner:after{-webkit-box-sizing:content-box;box-sizing:content-box;content:"";border:1px solid #fff;border-left:0;border-top:0;height:7px;left:4px;position:absolute;top:1px;-webkit-transform:rotate(45deg) scaleY(0);transform:rotate(45deg) scaleY(0);width:3px;-webkit-transition:-webkit-transform .15s ease-in .05s;transition:-webkit-transform .15s ease-in .05s;transition:transform .15s ease-in .05s;transition:transform .15s ease-in .05s,-webkit-transform .15s ease-in .05s;-webkit-transform-origin:center;transform-origin:center}.el-checkbox__original{opacity:0;outline:0;position:absolute;margin:0;width:0;height:0;z-index:-1}.el-checkbox-button,.el-checkbox-button__inner{position:relative;display:inline-block}.el-checkbox__label{display:inline-block;padding-left:10px;line-height:19px;font-size:14px}.el-checkbox:last-of-type{margin-right:0}.el-checkbox-button__inner{line-height:1;font-weight:500;white-space:nowrap;vertical-align:middle;cursor:pointer;background:#fff;border:1px solid #dcdfe6;border-left:0;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;-webkit-transition:all .3s cubic-bezier(.645,.045,.355,1);transition:all .3s cubic-bezier(.645,.045,.355,1);padding:12px 20px;font-size:14px;border-radius:0}.el-checkbox-button__inner.is-round{padding:12px 20px}.el-checkbox-button__inner:hover{color:#409eff}.el-checkbox-button__inner [class*=el-icon-]{line-height:.9}.el-checkbox-button__inner [class*=el-icon-]+span{margin-left:5px}.el-checkbox-button__original{opacity:0;outline:0;position:absolute;margin:0;z-index:-1}.el-checkbox-button.is-checked .el-checkbox-button__inner{color:#fff;background-color:#409eff;border-color:#409eff;-webkit-box-shadow:-1px 0 0 0 #8cc5ff;box-shadow:-1px 0 0 0 #8cc5ff}.el-checkbox-button.is-checked:first-child .el-checkbox-button__inner{border-left-color:#409eff}.el-checkbox-button.is-disabled .el-checkbox-button__inner{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5;-webkit-box-shadow:none;box-shadow:none}.el-checkbox-button.is-disabled:first-child .el-checkbox-button__inner{border-left-color:#ebeef5}.el-checkbox-button:first-child .el-checkbox-button__inner{border-left:1px solid #dcdfe6;border-radius:4px 0 0 4px;-webkit-box-shadow:none!important;box-shadow:none!important}.el-checkbox-button.is-focus .el-checkbox-button__inner{border-color:#409eff}.el-checkbox-button:last-child .el-checkbox-button__inner{border-radius:0 4px 4px 0}.el-checkbox-button--medium .el-checkbox-button__inner{padding:10px 20px;font-size:14px;border-radius:0}.el-checkbox-button--medium .el-checkbox-button__inner.is-round{padding:10px 20px}.el-checkbox-button--small .el-checkbox-button__inner{padding:9px 15px;font-size:12px;border-radius:0}.el-checkbox-button--small .el-checkbox-button__inner.is-round{padding:9px 15px}.el-checkbox-button--mini .el-checkbox-button__inner{padding:7px 15px;font-size:12px;border-radius:0}.el-checkbox-button--mini .el-checkbox-button__inner.is-round{padding:7px 15px}.el-checkbox-group{font-size:0}.el-tag{background-color:#ecf5ff;border-color:#d9ecff;display:inline-block;height:32px;padding:0 10px;line-height:30px;font-size:12px;color:#409eff;border-width:1px;border-style:solid;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box;white-space:nowrap}.el-tag.is-hit{border-color:#409eff}.el-tag .el-tag__close{color:#409eff}.el-tag .el-tag__close:hover{color:#fff;background-color:#409eff}.el-tag.el-tag--info{background-color:#f4f4f5;border-color:#e9e9eb;color:#909399}.el-tag.el-tag--info.is-hit{border-color:#909399}.el-tag.el-tag--info .el-tag__close{color:#909399}.el-tag.el-tag--info .el-tag__close:hover{color:#fff;background-color:#909399}.el-tag.el-tag--success{background-color:#f0f9eb;border-color:#e1f3d8;color:#67c23a}.el-tag.el-tag--success.is-hit{border-color:#67c23a}.el-tag.el-tag--success .el-tag__close{color:#67c23a}.el-tag.el-tag--success .el-tag__close:hover{color:#fff;background-color:#67c23a}.el-tag.el-tag--warning{background-color:#fdf6ec;border-color:#faecd8;color:#e6a23c}.el-tag.el-tag--warning.is-hit{border-color:#e6a23c}.el-tag.el-tag--warning .el-tag__close{color:#e6a23c}.el-tag.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#e6a23c}.el-tag.el-tag--danger{background-color:#fef0f0;border-color:#fde2e2;color:#f56c6c}.el-tag.el-tag--danger.is-hit{border-color:#f56c6c}.el-tag.el-tag--danger .el-tag__close{color:#f56c6c}.el-tag.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#f56c6c}.el-tag .el-icon-close{border-radius:50%;text-align:center;position:relative;cursor:pointer;font-size:12px;height:16px;width:16px;line-height:16px;vertical-align:middle;top:-1px;right:-5px}.el-tag .el-icon-close:before{display:block}.el-tag--dark{background-color:#409eff;color:#fff}.el-tag--dark,.el-tag--dark.is-hit{border-color:#409eff}.el-tag--dark .el-tag__close{color:#fff}.el-tag--dark .el-tag__close:hover{color:#fff;background-color:#66b1ff}.el-tag--dark.el-tag--info{background-color:#909399;border-color:#909399;color:#fff}.el-tag--dark.el-tag--info.is-hit{border-color:#909399}.el-tag--dark.el-tag--info .el-tag__close{color:#fff}.el-tag--dark.el-tag--info .el-tag__close:hover{color:#fff;background-color:#a6a9ad}.el-tag--dark.el-tag--success{background-color:#67c23a;border-color:#67c23a;color:#fff}.el-tag--dark.el-tag--success.is-hit{border-color:#67c23a}.el-tag--dark.el-tag--success .el-tag__close{color:#fff}.el-tag--dark.el-tag--success .el-tag__close:hover{color:#fff;background-color:#85ce61}.el-tag--dark.el-tag--warning{background-color:#e6a23c;border-color:#e6a23c;color:#fff}.el-tag--dark.el-tag--warning.is-hit{border-color:#e6a23c}.el-tag--dark.el-tag--warning .el-tag__close{color:#fff}.el-tag--dark.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#ebb563}.el-tag--dark.el-tag--danger{background-color:#f56c6c;border-color:#f56c6c;color:#fff}.el-tag--dark.el-tag--danger.is-hit{border-color:#f56c6c}.el-tag--dark.el-tag--danger .el-tag__close{color:#fff}.el-tag--dark.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#f78989}.el-tag--plain{background-color:#fff;border-color:#b3d8ff;color:#409eff}.el-tag--plain.is-hit{border-color:#409eff}.el-tag--plain .el-tag__close{color:#409eff}.el-tag--plain .el-tag__close:hover{color:#fff;background-color:#409eff}.el-tag--plain.el-tag--info{background-color:#fff;border-color:#d3d4d6;color:#909399}.el-tag--plain.el-tag--info.is-hit{border-color:#909399}.el-tag--plain.el-tag--info .el-tag__close{color:#909399}.el-tag--plain.el-tag--info .el-tag__close:hover{color:#fff;background-color:#909399}.el-tag--plain.el-tag--success{background-color:#fff;border-color:#c2e7b0;color:#67c23a}.el-tag--plain.el-tag--success.is-hit{border-color:#67c23a}.el-tag--plain.el-tag--success .el-tag__close{color:#67c23a}.el-tag--plain.el-tag--success .el-tag__close:hover{color:#fff;background-color:#67c23a}.el-tag--plain.el-tag--warning{background-color:#fff;border-color:#f5dab1;color:#e6a23c}.el-tag--plain.el-tag--warning.is-hit{border-color:#e6a23c}.el-tag--plain.el-tag--warning .el-tag__close{color:#e6a23c}.el-tag--plain.el-tag--warning .el-tag__close:hover{color:#fff;background-color:#e6a23c}.el-tag--plain.el-tag--danger{background-color:#fff;border-color:#fbc4c4;color:#f56c6c}.el-tag--plain.el-tag--danger.is-hit{border-color:#f56c6c}.el-tag--plain.el-tag--danger .el-tag__close{color:#f56c6c}.el-tag--plain.el-tag--danger .el-tag__close:hover{color:#fff;background-color:#f56c6c}.el-tag--medium{height:28px;line-height:26px}.el-tag--medium .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--small{height:24px;padding:0 8px;line-height:22px}.el-tag--small .el-icon-close{-webkit-transform:scale(.8);transform:scale(.8)}.el-tag--mini{height:20px;padding:0 5px;line-height:19px}.el-tag--mini .el-icon-close{margin-left:-3px;-webkit-transform:scale(.7);transform:scale(.7)}.el-tooltip:focus:hover,.el-tooltip:focus:not(.focusing){outline-width:0}.el-tooltip__popper{position:absolute;border-radius:4px;padding:10px;z-index:2000;font-size:12px;line-height:1.2;min-width:10px;word-wrap:break-word}.el-tooltip__popper .popper__arrow,.el-tooltip__popper .popper__arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.el-tooltip__popper .popper__arrow{border-width:6px}.el-tooltip__popper .popper__arrow:after{content:" ";border-width:5px}.el-tooltip__popper[x-placement^=top]{margin-bottom:12px}.el-tooltip__popper[x-placement^=top] .popper__arrow{bottom:-6px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=top] .popper__arrow:after{bottom:1px;margin-left:-5px;border-top-color:#303133;border-bottom-width:0}.el-tooltip__popper[x-placement^=bottom]{margin-top:12px}.el-tooltip__popper[x-placement^=bottom] .popper__arrow{top:-6px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=bottom] .popper__arrow:after{top:1px;margin-left:-5px;border-top-width:0;border-bottom-color:#303133}.el-tooltip__popper[x-placement^=right]{margin-left:12px}.el-tooltip__popper[x-placement^=right] .popper__arrow{left:-6px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=right] .popper__arrow:after{bottom:-5px;left:1px;border-right-color:#303133;border-left-width:0}.el-tooltip__popper[x-placement^=left]{margin-right:12px}.el-tooltip__popper[x-placement^=left] .popper__arrow{right:-6px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper[x-placement^=left] .popper__arrow:after{right:1px;bottom:-5px;margin-left:-5px;border-right-width:0;border-left-color:#303133}.el-tooltip__popper.is-dark{background:#303133;color:#fff}.el-table,.el-table__expanded-cell{background-color:#fff}.el-tooltip__popper.is-light{background:#fff;border:1px solid #303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow{border-top-color:#303133}.el-tooltip__popper.is-light[x-placement^=top] .popper__arrow:after{border-top-color:#fff}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow{border-bottom-color:#303133}.el-tooltip__popper.is-light[x-placement^=bottom] .popper__arrow:after{border-bottom-color:#fff}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow{border-left-color:#303133}.el-tooltip__popper.is-light[x-placement^=left] .popper__arrow:after{border-left-color:#fff}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow{border-right-color:#303133}.el-tooltip__popper.is-light[x-placement^=right] .popper__arrow:after{border-right-color:#fff}.el-table{position:relative;-webkit-box-sizing:border-box;box-sizing:border-box;-webkit-box-flex:1;-ms-flex:1;flex:1;width:100%;max-width:100%;font-size:14px;color:#606266}.el-table--mini,.el-table--small,.el-table__expand-icon{font-size:12px}.el-table__empty-block{min-height:60px;text-align:center;width:100%;display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.el-table__empty-text{line-height:60px;width:50%;color:#909399}.el-table__expand-column .cell{padding:0;text-align:center}.el-table__expand-icon{position:relative;cursor:pointer;color:#666;-webkit-transition:-webkit-transform .2s ease-in-out;transition:-webkit-transform .2s ease-in-out;transition:transform .2s ease-in-out;transition:transform .2s ease-in-out,-webkit-transform .2s ease-in-out;height:20px}.el-table__expand-icon--expanded{-webkit-transform:rotate(90deg);transform:rotate(90deg)}.el-table__expand-icon>.el-icon{position:absolute;left:50%;top:50%;margin-left:-5px;margin-top:-5px}.el-table__expanded-cell[class*=cell]{padding:20px 50px}.el-table__expanded-cell:hover{background-color:transparent!important}.el-table__placeholder{display:inline-block;width:20px}.el-table--fit{border-right:0;border-bottom:0}.el-table--fit td.gutter,.el-table--fit th.gutter{border-right-width:1px}.el-table--scrollable-x .el-table__body-wrapper{overflow-x:auto}.el-table--scrollable-y .el-table__body-wrapper{overflow-y:auto}.el-table thead{color:#909399;font-weight:500}.el-table thead.is-group th{background:#f5f7fa}.el-table th,.el-table tr{background-color:#fff}.el-table td,.el-table th{padding:12px 0;min-width:0;-webkit-box-sizing:border-box;box-sizing:border-box;text-overflow:ellipsis;vertical-align:middle;position:relative;text-align:left}.el-table td.is-center,.el-table th.is-center{text-align:center}.el-table td.is-right,.el-table th.is-right{text-align:right}.el-table td.gutter,.el-table th.gutter{width:15px;border-right-width:0;border-bottom-width:0;padding:0}.el-table--medium td,.el-table--medium th{padding:10px 0}.el-table--small td,.el-table--small th{padding:8px 0}.el-table--mini td,.el-table--mini th{padding:6px 0}.el-table--border td:first-child .cell,.el-table--border th:first-child .cell,.el-table .cell{padding-left:10px}.el-table tr input[type=checkbox]{margin:0}.el-table td,.el-table th.is-leaf{border-bottom:1px solid #ebeef5}.el-table th.is-sortable{cursor:pointer}.el-table th{overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.el-table th>.cell{display:inline-block;-webkit-box-sizing:border-box;box-sizing:border-box;position:relative;vertical-align:middle;padding-left:10px;padding-right:10px;width:100%}.el-table th>.cell.highlight{color:#409eff}.el-table th.required>div:before{display:inline-block;content:"";width:8px;height:8px;border-radius:50%;background:#ff4d51;margin-right:5px;vertical-align:middle}.el-table td div{-webkit-box-sizing:border-box;box-sizing:border-box}.el-table td.gutter{width:0}.el-table .cell{-webkit-box-sizing:border-box;box-sizing:border-box;overflow:hidden;text-overflow:ellipsis;white-space:normal;word-break:break-all;line-height:23px;padding-right:10px}.el-table .cell.el-tooltip{white-space:nowrap;min-width:50px}.el-table--border,.el-table--group{border:1px solid #ebeef5}.el-table--border:after,.el-table--group:after,.el-table:before{content:"";position:absolute;background-color:#ebeef5;z-index:1}.el-table--border:after,.el-table--group:after{top:0;right:0;width:1px;height:100%}.el-table:before{left:0;bottom:0;width:100%;height:1px}.el-table--border{border-right:none;border-bottom:none}.el-table--border.el-loading-parent--relative{border-color:transparent}.el-table--border td,.el-table--border th,.el-table__body-wrapper .el-table--border.is-scrolling-left~.el-table__fixed{border-right:1px solid #ebeef5}.el-table--border th.gutter:last-of-type{border-bottom:1px solid #ebeef5;border-bottom-width:1px}.el-table--border th,.el-table__fixed-right-patch{border-bottom:1px solid #ebeef5}.el-table__fixed,.el-table__fixed-right{position:absolute;top:0;left:0;overflow-x:hidden;overflow-y:hidden;-webkit-box-shadow:0 0 10px rgba(0,0,0,.12);box-shadow:0 0 10px rgba(0,0,0,.12)}.el-table__fixed-right:before,.el-table__fixed:before{content:"";position:absolute;left:0;bottom:0;width:100%;height:1px;background-color:#ebeef5;z-index:4}.el-table__fixed-right-patch{position:absolute;top:-1px;right:0;background-color:#fff}.el-table__fixed-right{top:0;left:auto;right:0}.el-table__fixed-right .el-table__fixed-body-wrapper,.el-table__fixed-right .el-table__fixed-footer-wrapper,.el-table__fixed-right .el-table__fixed-header-wrapper{left:auto;right:0}.el-table__fixed-header-wrapper{position:absolute;left:0;top:0;z-index:3}.el-table__fixed-footer-wrapper{position:absolute;left:0;bottom:0;z-index:3}.el-table__fixed-footer-wrapper tbody td{border-top:1px solid #ebeef5;background-color:#f5f7fa;color:#606266}.el-table__fixed-body-wrapper{position:absolute;left:0;top:37px;overflow:hidden;z-index:3}.el-table__body-wrapper,.el-table__footer-wrapper,.el-table__header-wrapper{width:100%}.el-table__footer-wrapper{margin-top:-1px}.el-table__footer-wrapper td{border-top:1px solid #ebeef5}.el-table__body,.el-table__footer,.el-table__header{table-layout:fixed;border-collapse:separate}.el-table__footer-wrapper,.el-table__header-wrapper{overflow:hidden}.el-table__footer-wrapper tbody td,.el-table__header-wrapper tbody td{background-color:#f5f7fa;color:#606266}.el-table__body-wrapper{overflow:hidden;position:relative}.el-table__body-wrapper.is-scrolling-left~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed,.el-table__body-wrapper.is-scrolling-none~.el-table__fixed-right,.el-table__body-wrapper.is-scrolling-right~.el-table__fixed-right{-webkit-box-shadow:none;box-shadow:none}.el-table__body-wrapper .el-table--border.is-scrolling-right~.el-table__fixed-right{border-left:1px solid #ebeef5}.el-table .caret-wrapper{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center;height:34px;width:24px;vertical-align:middle;cursor:pointer;overflow:initial;position:relative}.el-table .sort-caret{width:0;height:0;border:5px solid transparent;position:absolute;left:7px}.el-table .sort-caret.ascending{border-bottom-color:#c0c4cc;top:5px}.el-table .sort-caret.descending{border-top-color:#c0c4cc;bottom:7px}.el-table .ascending .sort-caret.ascending{border-bottom-color:#409eff}.el-table .descending .sort-caret.descending{border-top-color:#409eff}.el-table .hidden-columns{visibility:hidden;position:absolute;z-index:-1}.el-table--striped .el-table__body tr.el-table__row--striped td{background:#fafafa}.el-table--striped .el-table__body tr.el-table__row--striped.current-row td{background-color:#ecf5ff}.el-table__body tr.hover-row.current-row>td,.el-table__body tr.hover-row.el-table__row--striped.current-row>td,.el-table__body tr.hover-row.el-table__row--striped>td,.el-table__body tr.hover-row>td{background-color:#f5f7fa}.el-table__body tr.current-row>td{background-color:#ecf5ff}.el-table__column-resize-proxy{position:absolute;left:200px;top:0;bottom:0;width:0;border-left:1px solid #ebeef5;z-index:10}.el-table__column-filter-trigger{display:inline-block;line-height:34px;cursor:pointer}.el-table__column-filter-trigger i{color:#909399;font-size:12px;-webkit-transform:scale(.75);transform:scale(.75)}.el-table--enable-row-transition .el-table__body td{-webkit-transition:background-color .25s ease;transition:background-color .25s ease}.el-table--enable-row-hover .el-table__body tr:hover>td{background-color:#f5f7fa}.el-table--fluid-height .el-table__fixed,.el-table--fluid-height .el-table__fixed-right{bottom:0;overflow:hidden}.el-table [class*=el-table__row--level] .el-table__expand-icon{display:inline-block;width:20px;line-height:20px;height:20px;text-align:center;margin-right:3px}.el-breadcrumb{font-size:14px;line-height:1}.el-breadcrumb:after,.el-breadcrumb:before{display:table;content:""}.el-breadcrumb:after{clear:both}.el-breadcrumb__separator{margin:0 9px;font-weight:700;color:#c0c4cc}.el-breadcrumb__separator[class*=icon]{margin:0 6px;font-weight:400}.el-breadcrumb__item{float:left}.el-breadcrumb__inner{color:#606266}.el-breadcrumb__inner.is-link,.el-breadcrumb__inner a{font-weight:700;text-decoration:none;-webkit-transition:color .2s cubic-bezier(.645,.045,.355,1);transition:color .2s cubic-bezier(.645,.045,.355,1);color:#303133}.el-breadcrumb__inner.is-link:hover,.el-breadcrumb__inner a:hover{color:#409eff;cursor:pointer}.el-breadcrumb__item:last-child .el-breadcrumb__inner,.el-breadcrumb__item:last-child .el-breadcrumb__inner:hover,.el-breadcrumb__item:last-child .el-breadcrumb__inner a,.el-breadcrumb__item:last-child .el-breadcrumb__inner a:hover{font-weight:400;color:#606266;cursor:text}.el-breadcrumb__item:last-child .el-breadcrumb__separator{display:none}.el-divider{background-color:#dcdfe6;position:relative}.el-divider--horizontal{display:block;height:1px;width:100%;margin:24px 0}.el-divider--vertical{display:inline-block;width:1px;height:1em;margin:0 8px;vertical-align:middle;position:relative}.el-divider__text{position:absolute;background-color:#fff;padding:0 20px;font-weight:500;color:#303133;font-size:14px}.el-divider__text.is-left{left:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-divider__text.is-center{left:50%;-webkit-transform:translateX(-50%) translateY(-50%);transform:translateX(-50%) translateY(-50%)}.el-divider__text.is-right{right:20px;-webkit-transform:translateY(-50%);transform:translateY(-50%)}.el-button-group>.el-button.is-active,.el-button-group>.el-button.is-disabled,.el-button-group>.el-button:active,.el-button-group>.el-button:focus,.el-button-group>.el-button:hover{z-index:1}.el-button{display:inline-block;line-height:1;white-space:nowrap;cursor:pointer;background:#fff;border:1px solid #dcdfe6;color:#606266;-webkit-appearance:none;text-align:center;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;margin:0;-webkit-transition:.1s;transition:.1s;font-weight:500;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;padding:12px 20px;font-size:14px;border-radius:4px}.el-button+.el-button{margin-left:10px}.el-button:focus,.el-button:hover{color:#409eff;border-color:#c6e2ff;background-color:#ecf5ff}.el-button:active{color:#3a8ee6;border-color:#3a8ee6;outline:0}.el-button::-moz-focus-inner{border:0}.el-button [class*=el-icon-]+span{margin-left:5px}.el-button.is-plain:focus,.el-button.is-plain:hover{background:#fff;border-color:#409eff;color:#409eff}.el-button.is-active,.el-button.is-plain:active{color:#3a8ee6;border-color:#3a8ee6}.el-button.is-plain:active{background:#fff;outline:0}.el-button.is-disabled,.el-button.is-disabled:focus,.el-button.is-disabled:hover{color:#c0c4cc;cursor:not-allowed;background-image:none;background-color:#fff;border-color:#ebeef5}.el-button.is-disabled.el-button--text{background-color:transparent}.el-button.is-disabled.is-plain,.el-button.is-disabled.is-plain:focus,.el-button.is-disabled.is-plain:hover{background-color:#fff;border-color:#ebeef5;color:#c0c4cc}.el-button.is-loading{position:relative;pointer-events:none}.el-button.is-loading:before{pointer-events:none;content:"";position:absolute;left:-1px;top:-1px;right:-1px;bottom:-1px;border-radius:inherit;background-color:hsla(0,0%,100%,.35)}.el-button.is-round{border-radius:20px;padding:12px 23px}.el-button.is-circle{border-radius:50%;padding:12px}.el-button--primary{color:#fff;background-color:#409eff;border-color:#409eff}.el-button--primary:focus,.el-button--primary:hover{background:#66b1ff;border-color:#66b1ff;color:#fff}.el-button--primary.is-active,.el-button--primary:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff}.el-button--primary:active{outline:0}.el-button--primary.is-disabled,.el-button--primary.is-disabled:active,.el-button--primary.is-disabled:focus,.el-button--primary.is-disabled:hover{color:#fff;background-color:#a0cfff;border-color:#a0cfff}.el-button--primary.is-plain{color:#409eff;background:#ecf5ff;border-color:#b3d8ff}.el-button--primary.is-plain:focus,.el-button--primary.is-plain:hover{background:#409eff;border-color:#409eff;color:#fff}.el-button--primary.is-plain:active{background:#3a8ee6;border-color:#3a8ee6;color:#fff;outline:0}.el-button--primary.is-plain.is-disabled,.el-button--primary.is-plain.is-disabled:active,.el-button--primary.is-plain.is-disabled:focus,.el-button--primary.is-plain.is-disabled:hover{color:#8cc5ff;background-color:#ecf5ff;border-color:#d9ecff}.el-button--success{color:#fff;background-color:#67c23a;border-color:#67c23a}.el-button--success:focus,.el-button--success:hover{background:#85ce61;border-color:#85ce61;color:#fff}.el-button--success.is-active,.el-button--success:active{background:#5daf34;border-color:#5daf34;color:#fff}.el-button--success:active{outline:0}.el-button--success.is-disabled,.el-button--success.is-disabled:active,.el-button--success.is-disabled:focus,.el-button--success.is-disabled:hover{color:#fff;background-color:#b3e19d;border-color:#b3e19d}.el-button--success.is-plain{color:#67c23a;background:#f0f9eb;border-color:#c2e7b0}.el-button--success.is-plain:focus,.el-button--success.is-plain:hover{background:#67c23a;border-color:#67c23a;color:#fff}.el-button--success.is-plain:active{background:#5daf34;border-color:#5daf34;color:#fff;outline:0}.el-button--success.is-plain.is-disabled,.el-button--success.is-plain.is-disabled:active,.el-button--success.is-plain.is-disabled:focus,.el-button--success.is-plain.is-disabled:hover{color:#a4da89;background-color:#f0f9eb;border-color:#e1f3d8}.el-button--warning{color:#fff;background-color:#e6a23c;border-color:#e6a23c}.el-button--warning:focus,.el-button--warning:hover{background:#ebb563;border-color:#ebb563;color:#fff}.el-button--warning.is-active,.el-button--warning:active{background:#cf9236;border-color:#cf9236;color:#fff}.el-button--warning:active{outline:0}.el-button--warning.is-disabled,.el-button--warning.is-disabled:active,.el-button--warning.is-disabled:focus,.el-button--warning.is-disabled:hover{color:#fff;background-color:#f3d19e;border-color:#f3d19e}.el-button--warning.is-plain{color:#e6a23c;background:#fdf6ec;border-color:#f5dab1}.el-button--warning.is-plain:focus,.el-button--warning.is-plain:hover{background:#e6a23c;border-color:#e6a23c;color:#fff}.el-button--warning.is-plain:active{background:#cf9236;border-color:#cf9236;color:#fff;outline:0}.el-button--warning.is-plain.is-disabled,.el-button--warning.is-plain.is-disabled:active,.el-button--warning.is-plain.is-disabled:focus,.el-button--warning.is-plain.is-disabled:hover{color:#f0c78a;background-color:#fdf6ec;border-color:#faecd8}.el-button--danger{color:#fff;background-color:#f56c6c;border-color:#f56c6c}.el-button--danger:focus,.el-button--danger:hover{background:#f78989;border-color:#f78989;color:#fff}.el-button--danger.is-active,.el-button--danger:active{background:#dd6161;border-color:#dd6161;color:#fff}.el-button--danger:active{outline:0}.el-button--danger.is-disabled,.el-button--danger.is-disabled:active,.el-button--danger.is-disabled:focus,.el-button--danger.is-disabled:hover{color:#fff;background-color:#fab6b6;border-color:#fab6b6}.el-button--danger.is-plain{color:#f56c6c;background:#fef0f0;border-color:#fbc4c4}.el-button--danger.is-plain:focus,.el-button--danger.is-plain:hover{background:#f56c6c;border-color:#f56c6c;color:#fff}.el-button--danger.is-plain:active{background:#dd6161;border-color:#dd6161;color:#fff;outline:0}.el-button--danger.is-plain.is-disabled,.el-button--danger.is-plain.is-disabled:active,.el-button--danger.is-plain.is-disabled:focus,.el-button--danger.is-plain.is-disabled:hover{color:#f9a7a7;background-color:#fef0f0;border-color:#fde2e2}.el-button--info{color:#fff;background-color:#909399;border-color:#909399}.el-button--info:focus,.el-button--info:hover{background:#a6a9ad;border-color:#a6a9ad;color:#fff}.el-button--info.is-active,.el-button--info:active{background:#82848a;border-color:#82848a;color:#fff}.el-button--info:active{outline:0}.el-button--info.is-disabled,.el-button--info.is-disabled:active,.el-button--info.is-disabled:focus,.el-button--info.is-disabled:hover{color:#fff;background-color:#c8c9cc;border-color:#c8c9cc}.el-button--info.is-plain{color:#909399;background:#f4f4f5;border-color:#d3d4d6}.el-button--info.is-plain:focus,.el-button--info.is-plain:hover{background:#909399;border-color:#909399;color:#fff}.el-button--info.is-plain:active{background:#82848a;border-color:#82848a;color:#fff;outline:0}.el-button--info.is-plain.is-disabled,.el-button--info.is-plain.is-disabled:active,.el-button--info.is-plain.is-disabled:focus,.el-button--info.is-plain.is-disabled:hover{color:#bcbec2;background-color:#f4f4f5;border-color:#e9e9eb}.el-button--text,.el-button--text.is-disabled,.el-button--text.is-disabled:focus,.el-button--text.is-disabled:hover,.el-button--text:active{border-color:transparent}.el-button--medium{padding:10px 20px;font-size:14px;border-radius:4px}.el-button--mini,.el-button--small{font-size:12px;border-radius:3px}.el-button--medium.is-round{padding:10px 20px}.el-button--medium.is-circle{padding:10px}.el-button--small,.el-button--small.is-round{padding:9px 15px}.el-button--small.is-circle{padding:9px}.el-button--mini,.el-button--mini.is-round{padding:7px 15px}.el-button--mini.is-circle{padding:7px}.el-button--text{color:#409eff;background:0 0;padding-left:0;padding-right:0}.el-button--text:focus,.el-button--text:hover{color:#66b1ff;border-color:transparent;background-color:transparent}.el-button--text:active{color:#3a8ee6;background-color:transparent}.el-button-group{display:inline-block;vertical-align:middle}.el-button-group:after,.el-button-group:before{display:table;content:""}.el-button-group:after{clear:both}.el-button-group>.el-button{float:left;position:relative}.el-button-group>.el-button+.el-button{margin-left:0}.el-button-group>.el-button:first-child{border-top-right-radius:0;border-bottom-right-radius:0}.el-button-group>.el-button:last-child{border-top-left-radius:0;border-bottom-left-radius:0}.el-button-group>.el-button:first-child:last-child{border-radius:4px}.el-button-group>.el-button:first-child:last-child.is-round{border-radius:20px}.el-button-group>.el-button:first-child:last-child.is-circle{border-radius:50%}.el-button-group>.el-button:not(:first-child):not(:last-child){border-radius:0}.el-button-group>.el-button:not(:last-child){margin-right:-1px}.el-button-group>.el-dropdown>.el-button{border-top-left-radius:0;border-bottom-left-radius:0;border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--primary:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--success:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--warning:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--danger:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:first-child{border-right-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:last-child{border-left-color:hsla(0,0%,100%,.5)}.el-button-group .el-button--info:not(:first-child):not(:last-child){border-left-color:hsla(0,0%,100%,.5);border-right-color:hsla(0,0%,100%,.5)} \ No newline at end of file diff --git a/app/src/main/assets/web/css/detail.42c41bd6.css b/app/src/main/assets/web/css/detail.42c41bd6.css new file mode 100644 index 000000000..693f789a8 --- /dev/null +++ b/app/src/main/assets/web/css/detail.42c41bd6.css @@ -0,0 +1 @@ +@charset "UTF-8";.detail-wrapper[data-v-6d476c76]{padding:2% 0}.detail-wrapper .detail .bar .el-breadcrumb[data-v-6d476c76]{font-size:24px;font-weight:500;line-height:48px}.detail-wrapper .detail .bar .el-breadcrumb .index[data-v-6d476c76]{color:#333}.detail-wrapper .detail .bar .el-breadcrumb .sub[data-v-6d476c76]{color:#676767}.detail-wrapper .detail .el-divider[data-v-6d476c76]{margin-top:2%}.detail-wrapper .detail .catalog[data-v-6d476c76]{margin-top:2%;display:grid;grid-template-columns:repeat(auto-fill,300px);-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.detail-wrapper .detail .catalog .note[data-v-6d476c76]{width:200px;font-weight:500;font-size:14px;line-height:40px;padding-left:12px;padding-right:12px;word-wrap:break-word;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1;text-align:left}@font-face{font-family:FZZCYSK;src:local("☺"),url(../fonts/popfont.f39ecc1a.ttf);font-style:normal;font-weight:400}.cata-wrapper[data-v-8c647fa4]{margin:-16px;padding:18px 0 24px 25px}.cata-wrapper .title[data-v-8c647fa4]{font-size:18px;font-weight:400;font-family:FZZCYSK;margin:0 0 20px 0;color:#ed4259;width:-webkit-fit-content;width:-moz-fit-content;width:fit-content;border-bottom:1px solid #ed4259}.cata-wrapper .data-wrapper[data-v-8c647fa4]{height:300px;overflow:auto}.cata-wrapper .data-wrapper .cata[data-v-8c647fa4]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-ms-flex-wrap:wrap;flex-wrap:wrap;-webkit-box-pack:justify;-ms-flex-pack:justify;justify-content:space-between}.cata-wrapper .data-wrapper .cata .selected[data-v-8c647fa4]{color:#eb4259}.cata-wrapper .data-wrapper .cata .log[data-v-8c647fa4]{width:50%;height:40px;cursor:pointer;float:left;font:16px/40px PingFangSC-Regular,HelveticaNeue-Light,Helvetica Neue Light,Microsoft YaHei,sans-serif}.cata-wrapper .data-wrapper .cata .log .log-text[data-v-8c647fa4]{margin-right:26px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.cata-wrapper .night[data-v-8c647fa4] .log{border-bottom:1px solid #666}.cata-wrapper .day[data-v-8c647fa4] .log{border-bottom:1px solid #f2f2f2}@font-face{font-family:iconfont;src:url(../fonts/iconfont.f9a3fb0e.woff) format("woff")}[data-v-3d7e2fe5] .iconfont,[data-v-3d7e2fe5] .moon-icon{font-family:iconfont;font-style:normal}.settings-wrapper[data-v-3d7e2fe5]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin:-13px;width:478px;height:300px;text-align:left;padding:40px 0 40px 24px;background:#ede7da url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAD1BMVEX48dr48Nf58tv379X17NJtIBxUAAACFUlEQVQ4y1XRUZakMAgF0Af2AiDWApDZgHZqAV1nZv9rGh7Rj7Y8McUFEg1wvcMESMNVD/neU8Xcaz7nYYkYlYO6Ti82PBI4BvIEg1aj3wKwRvIMgZsUy5LdhCawPFh1sZs4SrlyN9fQKpv8s5dgZ2eLyqqJiu+WkCmUEybXkm3INS01WAiv0PapJ0CZc0SJQUzcWnZYbOOY20iFD8Bk+/j2A3wNxH7GdShFYS5ff237kXh9I9zSkQmIAhOsOSVfJ6DIXTMDaPnzkRJ92S1BQQmXl5LdirgRLLDdcYqcGPwe3QN4xCBiGNbrqq9wpW1XCecChwaQdVOsRDpPCpeoolPdxeXp3WNB9PHVzWBHlygy4NJCCrFHREv6bDt0VGwJZASkpONmm1UseGeFKAQexgaAkrfYWl3AGxWOLL2AIMBNbCXpktmS3k3vHeYjGCPBa43wJTurO3ZFVpQSJdAZGLoHTyk1upkjxMEaIxum3iIARcCa5kSkFAW5fi1mUlL9eyOsaanFmOMruwvEdE3ZYzsRSzo5ewRLXyVPPEvknt8ij4DvCg2O7xOgBCUprEzV4z1WekSpUgI8DT2mrnSOXKRfQavwuKA1F+tFnMKdJSUpMA7wQAifWRkMgjUKKZE4lBl6MCM4B1pq1P4uIjDE6Pq6rL0FnW1nIFmta5vrSvq/Ch4tpqG/ZNyyWa5jZPktq81eYv8Bt5s4iFITOp4AAAAASUVORK5CYII=) repeat}.settings-wrapper .settings-title[data-v-3d7e2fe5]{font-size:18px;line-height:22px;margin-bottom:28px;font-family:FZZCYSK;font-weight:400}.settings-wrapper .setting-list ul[data-v-3d7e2fe5]{list-style:none outside none;margin:0;padding:0}.settings-wrapper .setting-list ul li[data-v-3d7e2fe5]{list-style:none outside none}.settings-wrapper .setting-list ul li i[data-v-3d7e2fe5]{font:12px/16px PingFangSC-Regular,-apple-system,Simsun;display:inline-block;min-width:48px;margin-right:16px;vertical-align:middle;color:#666}.settings-wrapper .setting-list ul li .theme-item[data-v-3d7e2fe5]{line-height:32px;width:34px;height:34px;margin-right:16px;border-radius:100%;display:inline-block;cursor:pointer;text-align:center;vertical-align:middle}.settings-wrapper .setting-list ul li .theme-item .iconfont[data-v-3d7e2fe5]{display:none}.settings-wrapper .setting-list ul li .selected[data-v-3d7e2fe5]{color:#ed4259}.settings-wrapper .setting-list ul li .selected .iconfont[data-v-3d7e2fe5]{display:inline}.settings-wrapper .setting-list ul .font-list[data-v-3d7e2fe5]{margin-top:28px}.settings-wrapper .setting-list ul .font-list .font-item[data-v-3d7e2fe5]{width:78px;height:34px;cursor:pointer;margin-right:16px;border-radius:2px;text-align:center;vertical-align:middle;display:inline-block;font:14px/34px PingFangSC-Regular,HelveticaNeue-Light,Helvetica Neue Light,Microsoft YaHei,sans-serif}.settings-wrapper .setting-list ul .font-list .font-item[data-v-3d7e2fe5]:hover,.settings-wrapper .setting-list ul .font-list .selected[data-v-3d7e2fe5]{color:#ed4259;border:1px solid #ed4259}.settings-wrapper .setting-list ul .font-size[data-v-3d7e2fe5],.settings-wrapper .setting-list ul .read-width[data-v-3d7e2fe5]{margin-top:28px}.settings-wrapper .setting-list ul .font-size .resize[data-v-3d7e2fe5],.settings-wrapper .setting-list ul .read-width .resize[data-v-3d7e2fe5]{display:inline-block;width:274px;height:34px;vertical-align:middle;border-radius:2px}.settings-wrapper .setting-list ul .font-size .resize span[data-v-3d7e2fe5],.settings-wrapper .setting-list ul .read-width .resize span[data-v-3d7e2fe5]{width:89px;height:34px;line-height:34px;display:inline-block;cursor:pointer;text-align:center;vertical-align:middle}.settings-wrapper .setting-list ul .font-size .resize span em[data-v-3d7e2fe5],.settings-wrapper .setting-list ul .read-width .resize span em[data-v-3d7e2fe5]{font-style:normal}.settings-wrapper .setting-list ul .font-size .resize .less[data-v-3d7e2fe5]:hover,.settings-wrapper .setting-list ul .font-size .resize .more[data-v-3d7e2fe5]:hover,.settings-wrapper .setting-list ul .read-width .resize .less[data-v-3d7e2fe5]:hover,.settings-wrapper .setting-list ul .read-width .resize .more[data-v-3d7e2fe5]:hover{color:#ed4259}.settings-wrapper .setting-list ul .font-size .resize .lang[data-v-3d7e2fe5],.settings-wrapper .setting-list ul .read-width .resize .lang[data-v-3d7e2fe5]{color:#a6a6a6;font-weight:400;font-family:FZZCYSK}.settings-wrapper .setting-list ul .font-size .resize b[data-v-3d7e2fe5],.settings-wrapper .setting-list ul .read-width .resize b[data-v-3d7e2fe5]{display:inline-block;height:20px;vertical-align:middle}.night[data-v-3d7e2fe5] .selected,.night[data-v-3d7e2fe5] .theme-item{border:1px solid #666}.night[data-v-3d7e2fe5] .moon-icon{color:#ed4259}.night[data-v-3d7e2fe5] .font-list .font-item,.night[data-v-3d7e2fe5] .resize{border:1px solid #666;background:rgba(45,45,45,.5)}.night[data-v-3d7e2fe5] .resize b{border-right:1px solid #666}.day[data-v-3d7e2fe5] .theme-item{border:1px solid #e5e5e5}.day[data-v-3d7e2fe5] .selected{border:1px solid #ed4259}.day[data-v-3d7e2fe5] .moon-icon{display:inline;color:hsla(0,0%,100%,.2)}.day[data-v-3d7e2fe5] .font-list .font-item{background:hsla(0,0%,100%,.5);border:1px solid rgba(0,0,0,.1)}.day[data-v-3d7e2fe5] .resize{border:1px solid #e5e5e5;background:hsla(0,0%,100%,.5)}.day[data-v-3d7e2fe5] .resize b{border-right:1px solid #e5e5e5}p[data-v-6ee085ae]{display:block;word-wrap:break-word;word-break:break-all}[data-v-08ce53b2] .pop-setting{margin-left:68px;top:0}[data-v-08ce53b2] .pop-cata{margin-left:10px}.chapter-wrapper[data-v-08ce53b2]{padding:0 4%;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;-webkit-box-align:center;-ms-flex-align:center;align-items:center}.chapter-wrapper[data-v-08ce53b2] .no-point{pointer-events:none}.chapter-wrapper .tool-bar[data-v-08ce53b2]{position:fixed;top:0;left:50%;z-index:100}.chapter-wrapper .tool-bar .tools[data-v-08ce53b2]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.chapter-wrapper .tool-bar .tools .tool-icon[data-v-08ce53b2]{font-size:18px;width:58px;height:48px;text-align:center;padding-top:12px;cursor:pointer;outline:none}.chapter-wrapper .tool-bar .tools .tool-icon .iconfont[data-v-08ce53b2]{font-family:iconfont;width:16px;height:16px;font-size:16px;margin:0 auto 6px}.chapter-wrapper .tool-bar .tools .tool-icon .icon-text[data-v-08ce53b2]{font-size:12px}.chapter-wrapper .read-bar[data-v-08ce53b2]{position:fixed;bottom:0;right:50%;z-index:100}.chapter-wrapper .read-bar .tools[data-v-08ce53b2]{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.chapter-wrapper .read-bar .tools .tool-icon[data-v-08ce53b2]{font-size:18px;width:42px;height:31px;padding-top:12px;text-align:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;cursor:pointer;outline:none;margin-top:-1px}.chapter-wrapper .read-bar .tools .tool-icon .iconfont[data-v-08ce53b2]{font-family:iconfont;width:16px;height:16px;font-size:16px;margin:0 auto 6px}.chapter-wrapper .chapter-bar .el-breadcrumb .item[data-v-08ce53b2]{font-size:14px;color:#606266}.chapter-wrapper .chapter[data-v-08ce53b2]{font-family:Microsoft YaHei,PingFangSC-Regular,HelveticaNeue-Light,Helvetica Neue Light,sans-serif;text-align:left;padding:0 65px;min-height:100vh;width:670px;margin:0 auto}.chapter-wrapper .chapter[data-v-08ce53b2] .el-icon-loading{font-size:36px;color:#b5b5b5}.chapter-wrapper .chapter[data-v-08ce53b2] .el-loading-text{font-weight:500;color:#b5b5b5}.chapter-wrapper .chapter .content[data-v-08ce53b2]{font-size:18px;line-height:1.8;overflow:hidden;font-family:Microsoft YaHei,PingFangSC-Regular,HelveticaNeue-Light,Helvetica Neue Light,sans-serif}.chapter-wrapper .chapter .content .title[data-v-08ce53b2]{margin-bottom:57px;font:24px/32px PingFangSC-Regular,HelveticaNeue-Light,Helvetica Neue Light,Microsoft YaHei,sans-serif}.chapter-wrapper .chapter .content .bottom-bar[data-v-08ce53b2],.chapter-wrapper .chapter .content .top-bar[data-v-08ce53b2]{height:64px}.day[data-v-08ce53b2] .popup{-webkit-box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04);box-shadow:0 2px 4px rgba(0,0,0,.12),0 0 6px rgba(0,0,0,.04)}.day[data-v-08ce53b2] .tool-icon{border:1px solid rgba(0,0,0,.1);margin-top:-1px;color:#000}.day[data-v-08ce53b2] .tool-icon .icon-text{color:rgba(0,0,0,.4)}.day[data-v-08ce53b2] .chapter{border:1px solid #d8d8d8;color:#262626}.night[data-v-08ce53b2] .popup{-webkit-box-shadow:0 2px 4px rgba(0,0,0,.48),0 0 6px rgba(0,0,0,.16);box-shadow:0 2px 4px rgba(0,0,0,.48),0 0 6px rgba(0,0,0,.16)}.night[data-v-08ce53b2] .tool-icon{border:1px solid #444;margin-top:-1px;color:#666}.night[data-v-08ce53b2] .tool-icon .icon-text{color:#666}.night[data-v-08ce53b2] .chapter{border:1px solid #444;color:#666}.night[data-v-08ce53b2] .popper__arrow{background:#666} \ No newline at end of file diff --git a/app/src/main/assets/web/fonts/element-icons.535877f5.woff b/app/src/main/assets/web/fonts/element-icons.535877f5.woff new file mode 100644 index 000000000..02b9a2539 Binary files /dev/null and b/app/src/main/assets/web/fonts/element-icons.535877f5.woff differ diff --git a/app/src/main/assets/web/fonts/element-icons.732389de.ttf b/app/src/main/assets/web/fonts/element-icons.732389de.ttf new file mode 100644 index 000000000..91b74de36 Binary files /dev/null and b/app/src/main/assets/web/fonts/element-icons.732389de.ttf differ diff --git a/app/src/main/assets/web/fonts/iconfont.f9a3fb0e.woff b/app/src/main/assets/web/fonts/iconfont.f9a3fb0e.woff new file mode 100644 index 000000000..4af734b10 Binary files /dev/null and b/app/src/main/assets/web/fonts/iconfont.f9a3fb0e.woff differ diff --git a/app/src/main/assets/web/fonts/popfont.f39ecc1a.ttf b/app/src/main/assets/web/fonts/popfont.f39ecc1a.ttf new file mode 100644 index 000000000..e620a106d Binary files /dev/null and b/app/src/main/assets/web/fonts/popfont.f39ecc1a.ttf differ diff --git a/app/src/main/assets/web/fonts/shelffont.6c094b6d.ttf b/app/src/main/assets/web/fonts/shelffont.6c094b6d.ttf new file mode 100644 index 000000000..476a2418d Binary files /dev/null and b/app/src/main/assets/web/fonts/shelffont.6c094b6d.ttf differ diff --git a/app/src/main/assets/web/img/icons/android-chrome-192x192.png b/app/src/main/assets/web/img/icons/android-chrome-192x192.png new file mode 100644 index 000000000..b02aa64d9 Binary files /dev/null and b/app/src/main/assets/web/img/icons/android-chrome-192x192.png differ diff --git a/app/src/main/assets/web/img/icons/android-chrome-512x512.png b/app/src/main/assets/web/img/icons/android-chrome-512x512.png new file mode 100644 index 000000000..06088b011 Binary files /dev/null and b/app/src/main/assets/web/img/icons/android-chrome-512x512.png differ diff --git a/app/src/main/assets/web/img/icons/apple-touch-icon-120x120.png b/app/src/main/assets/web/img/icons/apple-touch-icon-120x120.png new file mode 100644 index 000000000..1427cf627 Binary files /dev/null and b/app/src/main/assets/web/img/icons/apple-touch-icon-120x120.png differ diff --git a/app/src/main/assets/web/img/icons/apple-touch-icon-152x152.png b/app/src/main/assets/web/img/icons/apple-touch-icon-152x152.png new file mode 100644 index 000000000..f24d454a2 Binary files /dev/null and b/app/src/main/assets/web/img/icons/apple-touch-icon-152x152.png differ diff --git a/app/src/main/assets/web/img/icons/apple-touch-icon-180x180.png b/app/src/main/assets/web/img/icons/apple-touch-icon-180x180.png new file mode 100644 index 000000000..404e192a9 Binary files /dev/null and b/app/src/main/assets/web/img/icons/apple-touch-icon-180x180.png differ diff --git a/app/src/main/assets/web/img/icons/apple-touch-icon-60x60.png b/app/src/main/assets/web/img/icons/apple-touch-icon-60x60.png new file mode 100644 index 000000000..cf10a5602 Binary files /dev/null and b/app/src/main/assets/web/img/icons/apple-touch-icon-60x60.png differ diff --git a/app/src/main/assets/web/img/icons/apple-touch-icon-76x76.png b/app/src/main/assets/web/img/icons/apple-touch-icon-76x76.png new file mode 100644 index 000000000..c500769e3 Binary files /dev/null and b/app/src/main/assets/web/img/icons/apple-touch-icon-76x76.png differ diff --git a/app/src/main/assets/web/img/icons/apple-touch-icon.png b/app/src/main/assets/web/img/icons/apple-touch-icon.png new file mode 100644 index 000000000..03c0c5d5e Binary files /dev/null and b/app/src/main/assets/web/img/icons/apple-touch-icon.png differ diff --git a/app/src/main/assets/web/img/icons/favicon-16x16.png b/app/src/main/assets/web/img/icons/favicon-16x16.png new file mode 100644 index 000000000..42af00963 Binary files /dev/null and b/app/src/main/assets/web/img/icons/favicon-16x16.png differ diff --git a/app/src/main/assets/web/img/icons/favicon-32x32.png b/app/src/main/assets/web/img/icons/favicon-32x32.png new file mode 100644 index 000000000..46ca04dee Binary files /dev/null and b/app/src/main/assets/web/img/icons/favicon-32x32.png differ diff --git a/app/src/main/assets/web/img/icons/msapplication-icon-144x144.png b/app/src/main/assets/web/img/icons/msapplication-icon-144x144.png new file mode 100644 index 000000000..7808237a1 Binary files /dev/null and b/app/src/main/assets/web/img/icons/msapplication-icon-144x144.png differ diff --git a/app/src/main/assets/web/img/icons/mstile-150x150.png b/app/src/main/assets/web/img/icons/mstile-150x150.png new file mode 100644 index 000000000..3b37a43ae Binary files /dev/null and b/app/src/main/assets/web/img/icons/mstile-150x150.png differ diff --git a/app/src/main/assets/web/img/icons/safari-pinned-tab.svg b/app/src/main/assets/web/img/icons/safari-pinned-tab.svg new file mode 100644 index 000000000..732afd8eb --- /dev/null +++ b/app/src/main/assets/web/img/icons/safari-pinned-tab.svg @@ -0,0 +1,149 @@ + + + + +Created by potrace 1.11, written by Peter Selinger 2001-2013 + + + + + diff --git a/app/src/main/assets/web/img/noCover.b5c48bc1.jpeg b/app/src/main/assets/web/img/noCover.b5c48bc1.jpeg new file mode 100644 index 000000000..996bbd412 Binary files /dev/null and b/app/src/main/assets/web/img/noCover.b5c48bc1.jpeg differ diff --git a/app/src/main/assets/web/index.html b/app/src/main/assets/web/index.html index 29bebabe2..a0a00ef1c 100644 --- a/app/src/main/assets/web/index.html +++ b/app/src/main/assets/web/index.html @@ -359,7 +359,8 @@
(?i) 前缀表示忽略大小写 代码在线运行工具 - 阅读书架(测试) + 阅读书架(经典) + 阅读书架(新潮) diff --git a/app/src/main/assets/web/js/about.2589b5fe.js b/app/src/main/assets/web/js/about.2589b5fe.js new file mode 100644 index 000000000..9fe4335aa --- /dev/null +++ b/app/src/main/assets/web/js/about.2589b5fe.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["about"],{"4fed":function(t,e,s){"use strict";var a=s("708f"),i=s.n(a);i.a},"708f":function(t,e,s){},"7b5b":function(t,e,s){},"7e43":function(t,e,s){t.exports=s.p+"img/noCover.b5c48bc1.jpeg"},d504:function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"index-wrapper"},[a("div",{staticClass:"navigation-wrapper"},[a("div",{staticClass:"navigation-title"},[t._v(" 阅读 ")]),a("div",{staticClass:"navigation-sub-title"},[t._v(" 清风不识字,何故乱翻书 ")]),a("div",{staticClass:"search-wrapper"},[a("el-input",{staticClass:"search-input",attrs:{size:"mini",placeholder:"搜索书籍"},model:{value:t.search,callback:function(e){t.search=e},expression:"search"}},[a("i",{staticClass:"el-input__icon el-icon-search",attrs:{slot:"prefix"},slot:"prefix"})])],1),a("div",{staticClass:"recent-wrapper"},[a("div",{staticClass:"recent-title"},[t._v(" 最近阅读 ")]),a("div",{staticClass:"reading-recent"},[a("el-tag",{staticClass:"recent-book",class:{"no-point":""==t.readingRecent.url},attrs:{type:"warning"},on:{click:function(e){return t.toDetail(t.readingRecent.url,t.readingRecent.name)}}},[t._v(" "+t._s(t.readingRecent.name)+" ")])],1)]),a("div",{staticClass:"setting-wrapper"},[a("div",{staticClass:"setting-title"},[t._v(" 基本设定 ")]),a("div",{staticClass:"setting-item"},[a("el-tag",{staticClass:"setting-connect",class:{"no-point":t.newConnect},attrs:{type:t.connectType},on:{click:t.setIP}},[t._v(" "+t._s(t.connectStatus)+" ")])],1)]),a("div",{staticClass:"bottom-icons"},[a("a",{attrs:{href:"https://github.com/zsakvo/web-yuedu",target:"_blank"}},[a("div",{staticClass:"bottom-icon"},[a("img",{attrs:{src:s("fa39"),alt:""}})])])])]),a("div",{ref:"shelfWrapper",staticClass:"shelf-wrapper"},[a("div",{staticClass:"books-wrapper"},[a("div",{staticClass:"wrapper"},t._l(t.shelf,(function(e){return a("div",{key:e.noteUrl,staticClass:"book",on:{click:function(s){return t.toDetail(e.bookUrl,e.name)}}},[a("div",{staticClass:"cover-img"},[a("img",{staticClass:"cover",attrs:{src:e.coverUrl||s("7e43"),alt:""}})]),a("div",{staticClass:"info",on:{click:function(s){return t.toDetail(e.bookUrl,e.name)}}},[a("div",{staticClass:"name"},[t._v(t._s(e.name))]),a("div",{staticClass:"sub"},[a("div",{staticClass:"author"},[t._v(" "+t._s(e.author)+" ")]),a("div",{staticClass:"dot"},[t._v("•")]),a("div",{staticClass:"size"},[t._v("共"+t._s(e.totalChapterNum)+"章")])]),a("div",{staticClass:"dur-chapter"},[t._v("已读:"+t._s(e.durChapterTitle))]),a("div",{staticClass:"last-chapter"},[t._v("最新:"+t._s(e.latestChapterTitle))])])])})),0)])])])},i=[],n=(s("7b5b"),s("82ae")),r=s.n(n),c={data:function(){return{search:"",readingRecent:{name:"尚无阅读记录",url:""}}},mounted:function(){var t=localStorage.getItem("readingRecent");if(null!=t&&(this.readingRecent=JSON.parse(t)),0==this.shelf.length){this.loading=this.$loading({target:this.$refs.shelfWrapper,lock:!0,text:"正在获取书籍信息",spinner:"el-icon-loading",background:"rgb(247,247,247)"});var e=this;r.a.get("/getBookshelf",{timeout:3e3}).then((function(t){e.loading.close(),e.$store.commit("setConnectType","success"),e.$store.commit("increaseBookNum",t.data.data.length),e.$store.commit("addBooks",t.data.data),e.$store.commit("setConnectStatus","已连接 "),e.$store.commit("setNewConnect",!1)})).catch((function(t){throw e.loading.close(),e.$store.commit("setConnectType","danger"),e.$store.commit("setConnectStatus","连接失败"),e.$message.error("后端连接失败"),e.$store.commit("setNewConnect",!1),t}))}},methods:{setIP:function(){},toDetail:function(t,e){sessionStorage.setItem("bookUrl",t),sessionStorage.setItem("bookName",e),this.readingRecent={name:e,url:t},localStorage.setItem("readingRecent",JSON.stringify(this.readingRecent)),this.$router.push({path:"/chapter"})}},computed:{shelf:function(){return this.$store.state.shelf},connectStatus:function(){return this.$store.state.connectStatus},connectType:function(){return this.$store.state.connectType},newConnect:function(){return this.$store.state.newConnect}}},o=c,l=(s("4fed"),s("623f")),u=Object(l["a"])(o,a,i,!1,null,"5e92421e",null);e["default"]=u.exports},f820:function(t,e,s){"use strict";s.r(e);var a=function(){var t=this,e=t.$createElement;t._self._c;return t._m(0)},i=[function(){var t=this,e=t.$createElement,s=t._self._c||e;return s("div",{staticClass:"about"},[s("h1",[t._v("This is an about page")])])}],n=s("623f"),r={},c=Object(n["a"])(r,a,i,!1,null,null,null);e["default"]=c.exports},fa39:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAECUlEQVRYR7WXTYhcRRDHq3pY9yKrYBQ8KBsjgvHgwRhiQBTjYZm4Xe8NusawhwS/o9GLoKhgBGPAgJd1NdGIXwtZTbRf9Rqzl6gHTVyDeIkIgnEOghAM6oKHzTJd0sO8Zaa338zb7NjwmJn++Ndv+lVVVyOsoM3Ozl69sLBAiHiDc26NUuoKv9w5d14p9aeI/DI4OMgjIyN/lJXFMhOttQ8BgBaR0TLzEXEGAKzW+lCv+V0BmLmGiLtF5M5eQrFxRPxaRCaI6LOi9YUAzPwGADxxMYYjayaJ6MkoZKyTmU8AwF19Mp7LfElEW0LNZTvAzIcBYFufjedy00T0QLt2B4AxZo9S6qX/yXhT1jn3cpqme3IbSwDM/DgAvNlu3Dm3Uyl1HAA2IOJ2EdleEu5Io9H4EBHPVCqVLSISRsMuInrLazUBpqamhoaGhr4TkRsDgLVpmtbzPmPMLQBwOwD4vvzxw8P5IyJztVrtVL4my7L1iPhTx7Yj/jw/P79pfHx8vgmQZdkLiPhK+O8GBgauqVarv5f819FpxpjLlVJ/hYMi8mKSJHubAMz8KwBcF1EYI6IjqwRIlFImonGWiNZhlmVVRDxWYGTVAMx8HwB8EtMXka1orT0gIo9GJrxNRLH+FW8IMx8EgEeW5QDEgx5gTkQ2Bk7yr9b60hVb6rKAmc8BwJWBne+x4P3XiWhtPwGstV9FzpSzHuBvALgsMHaaiDp2ZbUwWZZNIuKuQOcfD7AAAJeEcaq1Xr9ao+3rmdknnscCzQse4LdWEukYazQaa2q12vl+QTDztwCwOdCr+zA8iYi3RQwREdl+ADDz9QDwIwB0OLaInPJRcEhEHoyEyAmt9d39ALDW2lg1hYjv+lfgC4WJgkTxcJIkPcuqbpC+qgKATwvm7PYAGwDgdBeRZ4notYvZCWPMDqXUe13W3to8C6y10yJyv//u6zj/2R6ziPiRiBwt6xPMrBExFZEdRcYR8WOt9bb8MNoKAJ+3Jvtwed05d4dSKtz+c4h4VGsdrRWttZMici8AXFVix+4homNLBUmWZQcQMc/9x4mommXZ84i4t11MKbV5dHR06bxvH5uZmbnZOfdN6O0RmMNE1CxulgCstdeKyBcAcFPrVTyltZ4wxiSVSuXplkhda72zh9P1rClFZFOSJHMdAP5Hq3rxR6eH+IGIvIOuqFlr94nIc10WdRzxy6riAMJnr2nn3JlcME3TppMWNWvtfhF5pmB8WX0RvZgEEEtaYUUbM2KtfUdE/FUubNHipvBmZIxZp5TaDwBprlQGIHLqzSHiPq01x4B7Xk6Z2d8TfDwPlwFozfd1f90598Hi4uKrY2NjFwrzQVkP81nNi/byAWOMv8gOp2n6fhnt/wDqJrRWLmhIrwAAAABJRU5ErkJggg=="}}]); \ No newline at end of file diff --git a/app/src/main/assets/web/js/about~detail.08c372e6.js b/app/src/main/assets/web/js/about~detail.08c372e6.js new file mode 100644 index 000000000..7d1080cea --- /dev/null +++ b/app/src/main/assets/web/js/about~detail.08c372e6.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["about~detail"],{"04a7":function(e,t,r){"use strict";var n=r("d844");e.exports=function(e,t,r){return n.forEach(r,(function(r){e=r(e,t)})),e}},"050d":function(e,t,r){"use strict";var n=r("d844");function o(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}e.exports=function(e,t,r){if(!t)return e;var i;if(r)i=r(t);else if(n.isURLSearchParams(t))i=t.toString();else{var s=[];n.forEach(t,(function(e,t){null!==e&&"undefined"!==typeof e&&(n.isArray(e)?t+="[]":e=[e],n.forEach(e,(function(e){n.isDate(e)?e=e.toISOString():n.isObject(e)&&(e=JSON.stringify(e)),s.push(o(t)+"="+o(e))})))})),i=s.join("&")}if(i){var a=e.indexOf("#");-1!==a&&(e=e.slice(0,a)),e+=(-1===e.indexOf("?")?"?":"&")+i}return e}},"068e":function(e,t,r){"use strict";function n(e){this.message=e}n.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},n.prototype.__CANCEL__=!0,e.exports=n},"0bbf":function(e,t,r){"use strict";var n=r("d844"),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"];e.exports=function(e){var t,r,i,s={};return e?(n.forEach(e.split("\n"),(function(e){if(i=e.indexOf(":"),t=n.trim(e.substr(0,i)).toLowerCase(),r=n.trim(e.substr(i+1)),t){if(s[t]&&o.indexOf(t)>=0)return;s[t]="set-cookie"===t?(s[t]?s[t]:[]).concat([r]):s[t]?s[t]+", "+r:r}})),s):s}},"11f4":function(e,t,r){"use strict";e.exports=function(e){return!(!e||!e.__CANCEL__)}},"155b":function(e,t,r){"use strict";var n=r("068e");function o(e){if("function"!==typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var r=this;e((function(e){r.reason||(r.reason=new n(e),t(r.reason))}))}o.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},o.source=function(){var e,t=new o((function(t){e=t}));return{token:t,cancel:e}},e.exports=o},"1eb2":function(e,t,r){"use strict";var n=r("c5b9");e.exports=function(e,t,r){var o=r.config.validateStatus;!o||o(r.status)?e(r):t(n("Request failed with status code "+r.status,r.config,null,r.request,r))}},"2ed0":function(e,t,r){"use strict";(function(t){var n=r("d844"),o=r("9d72"),i={"Content-Type":"application/x-www-form-urlencoded"};function s(e,t){!n.isUndefined(e)&&n.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}function a(){var e;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof t&&"[object process]"===Object.prototype.toString.call(t))&&(e=r("a169")),e}var u={adapter:a(),transformRequest:[function(e,t){return o(t,"Accept"),o(t,"Content-Type"),n.isFormData(e)||n.isArrayBuffer(e)||n.isBuffer(e)||n.isStream(e)||n.isFile(e)||n.isBlob(e)?e:n.isArrayBufferView(e)?e.buffer:n.isURLSearchParams(e)?(s(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):n.isObject(e)?(s(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"===typeof e)try{e=JSON.parse(e)}catch(t){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};n.forEach(["delete","get","head"],(function(e){u.headers[e]={}})),n.forEach(["post","put","patch"],(function(e){u.headers[e]=n.merge(i)})),e.exports=u}).call(this,r("eef6"))},"43d9":function(e,t,r){"use strict";var n=r("d844"),o=r("faf0"),i=r("4a67"),s=r("c9ba"),a=r("2ed0");function u(e){var t=new i(e),r=o(i.prototype.request,t);return n.extend(r,i.prototype,t),n.extend(r,t),r}var c=u(a);c.Axios=i,c.create=function(e){return u(s(c.defaults,e))},c.Cancel=r("068e"),c.CancelToken=r("155b"),c.isCancel=r("11f4"),c.all=function(e){return Promise.all(e)},c.spread=r("53f3"),e.exports=c,e.exports.default=c},"4a67":function(e,t,r){"use strict";var n=r("d844"),o=r("050d"),i=r("54b5"),s=r("c70f"),a=r("c9ba");function u(e){this.defaults=e,this.interceptors={request:new i,response:new i}}u.prototype.request=function(e){"string"===typeof e?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=a(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[s,void 0],r=Promise.resolve(e);this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));while(t.length)r=r.then(t.shift(),t.shift());return r},u.prototype.getUri=function(e){return e=a(this.defaults,e),o(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},n.forEach(["delete","get","head","options"],(function(e){u.prototype[e]=function(t,r){return this.request(n.merge(r||{},{method:e,url:t}))}})),n.forEach(["post","put","patch"],(function(e){u.prototype[e]=function(t,r,o){return this.request(n.merge(o||{},{method:e,url:t,data:r}))}})),e.exports=u},"4f37":function(e,t,r){"use strict";var n=r("ca19"),o=r("c4e8");e.exports=function(e,t){return e&&!n(t)?o(e,t):t}},"53f3":function(e,t,r){"use strict";e.exports=function(e){return function(t){return e.apply(null,t)}}},"54b5":function(e,t,r){"use strict";var n=r("d844");function o(){this.handlers=[]}o.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},o.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},o.prototype.forEach=function(e){n.forEach(this.handlers,(function(t){null!==t&&e(t)}))},e.exports=o},6266:function(e,t,r){(function(e){function r(e,t){for(var r=0,n=e.length-1;n>=0;n--){var o=e[n];"."===o?e.splice(n,1):".."===o?(e.splice(n,1),r++):r&&(e.splice(n,1),r--)}if(t)for(;r--;r)e.unshift("..");return e}function n(e){"string"!==typeof e&&(e+="");var t,r=0,n=-1,o=!0;for(t=e.length-1;t>=0;--t)if(47===e.charCodeAt(t)){if(!o){r=t+1;break}}else-1===n&&(o=!1,n=t+1);return-1===n?"":e.slice(r,n)}function o(e,t){if(e.filter)return e.filter(t);for(var r=[],n=0;n=-1&&!n;i--){var s=i>=0?arguments[i]:e.cwd();if("string"!==typeof s)throw new TypeError("Arguments to path.resolve must be strings");s&&(t=s+"/"+t,n="/"===s.charAt(0))}return t=r(o(t.split("/"),(function(e){return!!e})),!n).join("/"),(n?"/":"")+t||"."},t.normalize=function(e){var n=t.isAbsolute(e),s="/"===i(e,-1);return e=r(o(e.split("/"),(function(e){return!!e})),!n).join("/"),e||n||(e="."),e&&s&&(e+="/"),(n?"/":"")+e},t.isAbsolute=function(e){return"/"===e.charAt(0)},t.join=function(){var e=Array.prototype.slice.call(arguments,0);return t.normalize(o(e,(function(e,t){if("string"!==typeof e)throw new TypeError("Arguments to path.join must be strings");return e})).join("/"))},t.relative=function(e,r){function n(e){for(var t=0;t=0;r--)if(""!==e[r])break;return t>r?[]:e.slice(t,r-t+1)}e=t.resolve(e).substr(1),r=t.resolve(r).substr(1);for(var o=n(e.split("/")),i=n(r.split("/")),s=Math.min(o.length,i.length),a=s,u=0;u=1;--i)if(t=e.charCodeAt(i),47===t){if(!o){n=i;break}}else o=!1;return-1===n?r?"/":".":r&&1===n?"/":e.slice(0,n)},t.basename=function(e,t){var r=n(e);return t&&r.substr(-1*t.length)===t&&(r=r.substr(0,r.length-t.length)),r},t.extname=function(e){"string"!==typeof e&&(e+="");for(var t=-1,r=0,n=-1,o=!0,i=0,s=e.length-1;s>=0;--s){var a=e.charCodeAt(s);if(47!==a)-1===n&&(o=!1,n=s+1),46===a?-1===t?t=s:1!==i&&(i=1):-1!==t&&(i=-1);else if(!o){r=s+1;break}}return-1===t||-1===n||0===i||1===i&&t===n-1&&t===r+1?"":e.slice(t,n)};var i="b"==="ab".substr(-1)?function(e,t,r){return e.substr(t,r)}:function(e,t,r){return t<0&&(t=e.length+t),e.substr(t,r)}}).call(this,r("eef6"))},"82ae":function(e,t,r){e.exports=r("43d9")},"83fe":function(e,t,r){"use strict";var n=r("d844");e.exports=n.isStandardBrowserEnv()?function(){return{write:function(e,t,r,o,i,s){var a=[];a.push(e+"="+encodeURIComponent(t)),n.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),n.isString(o)&&a.push("path="+o),n.isString(i)&&a.push("domain="+i),!0===s&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"9d72":function(e,t,r){"use strict";var n=r("d844");e.exports=function(e,t){n.forEach(e,(function(r,n){n!==t&&n.toUpperCase()===t.toUpperCase()&&(e[t]=r,delete e[n])}))}},a169:function(e,t,r){"use strict";var n=r("d844"),o=r("1eb2"),i=r("050d"),s=r("4f37"),a=r("0bbf"),u=r("edb4"),c=r("c5b9");e.exports=function(e){return new Promise((function(t,f){var p=e.data,l=e.headers;n.isFormData(p)&&delete l["Content-Type"];var d=new XMLHttpRequest;if(e.auth){var h=e.auth.username||"",m=e.auth.password||"";l.Authorization="Basic "+btoa(h+":"+m)}var g=s(e.baseURL,e.url);if(d.open(e.method.toUpperCase(),i(g,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,d.onreadystatechange=function(){if(d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in d?a(d.getAllResponseHeaders()):null,n=e.responseType&&"text"!==e.responseType?d.response:d.responseText,i={data:n,status:d.status,statusText:d.statusText,headers:r,config:e,request:d};o(t,f,i),d=null}},d.onabort=function(){d&&(f(c("Request aborted",e,"ECONNABORTED",d)),d=null)},d.onerror=function(){f(c("Network Error",e,null,d)),d=null},d.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),f(c(t,e,"ECONNABORTED",d)),d=null},n.isStandardBrowserEnv()){var y=r("83fe"),v=(e.withCredentials||u(g))&&e.xsrfCookieName?y.read(e.xsrfCookieName):void 0;v&&(l[e.xsrfHeaderName]=v)}if("setRequestHeader"in d&&n.forEach(l,(function(e,t){"undefined"===typeof p&&"content-type"===t.toLowerCase()?delete l[t]:d.setRequestHeader(t,e)})),n.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),e.responseType)try{d.responseType=e.responseType}catch(b){if("json"!==e.responseType)throw b}"function"===typeof e.onDownloadProgress&&d.addEventListener("progress",e.onDownloadProgress),"function"===typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){d&&(d.abort(),f(e),d=null)})),void 0===p&&(p=null),d.send(p)}))}},bd2a:function(e,t,r){"use strict";e.exports=function(e,t,r,n,o){return e.config=t,r&&(e.code=r),e.request=n,e.response=o,e.isAxiosError=!0,e.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code}},e}},c4e8:function(e,t,r){"use strict";e.exports=function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}},c5b9:function(e,t,r){"use strict";var n=r("bd2a");e.exports=function(e,t,r,o,i){var s=new Error(e);return n(s,t,r,o,i)}},c70f:function(e,t,r){"use strict";var n=r("d844"),o=r("04a7"),i=r("11f4"),s=r("2ed0");function a(e){e.cancelToken&&e.cancelToken.throwIfRequested()}e.exports=function(e){a(e),e.headers=e.headers||{},e.data=o(e.data,e.headers,e.transformRequest),e.headers=n.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),n.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]}));var t=e.adapter||s.adapter;return t(e).then((function(t){return a(e),t.data=o(t.data,t.headers,e.transformResponse),t}),(function(t){return i(t)||(a(e),t&&t.response&&(t.response.data=o(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))}},c9ba:function(e,t,r){"use strict";var n=r("d844");e.exports=function(e,t){t=t||{};var r={},o=["url","method","params","data"],i=["headers","auth","proxy"],s=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];n.forEach(o,(function(e){"undefined"!==typeof t[e]&&(r[e]=t[e])})),n.forEach(i,(function(o){n.isObject(t[o])?r[o]=n.deepMerge(e[o],t[o]):"undefined"!==typeof t[o]?r[o]=t[o]:n.isObject(e[o])?r[o]=n.deepMerge(e[o]):"undefined"!==typeof e[o]&&(r[o]=e[o])})),n.forEach(s,(function(n){"undefined"!==typeof t[n]?r[n]=t[n]:"undefined"!==typeof e[n]&&(r[n]=e[n])}));var a=o.concat(i).concat(s),u=Object.keys(t).filter((function(e){return-1===a.indexOf(e)}));return n.forEach(u,(function(n){"undefined"!==typeof t[n]?r[n]=t[n]:"undefined"!==typeof e[n]&&(r[n]=e[n])})),r}},ca19:function(e,t,r){"use strict";e.exports=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}},d844:function(e,t,r){"use strict";var n=r("faf0"),o=Object.prototype.toString;function i(e){return"[object Array]"===o.call(e)}function s(e){return"undefined"===typeof e}function a(e){return null!==e&&!s(e)&&null!==e.constructor&&!s(e.constructor)&&"function"===typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function u(e){return"[object ArrayBuffer]"===o.call(e)}function c(e){return"undefined"!==typeof FormData&&e instanceof FormData}function f(e){var t;return t="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer,t}function p(e){return"string"===typeof e}function l(e){return"number"===typeof e}function d(e){return null!==e&&"object"===typeof e}function h(e){return"[object Date]"===o.call(e)}function m(e){return"[object File]"===o.call(e)}function g(e){return"[object Blob]"===o.call(e)}function y(e){return"[object Function]"===o.call(e)}function v(e){return d(e)&&y(e.pipe)}function b(e){return"undefined"!==typeof URLSearchParams&&e instanceof URLSearchParams}function w(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}function x(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function E(e,t){if(null!==e&&"undefined"!==typeof e)if("object"!==typeof e&&(e=[e]),i(e))for(var r=0,n=e.length;r>>32-t}function o(e,t){var n,o,r,a,u;return r=2147483648&e,a=2147483648&t,n=1073741824&e,o=1073741824&t,u=(1073741823&e)+(1073741823&t),n&o?2147483648^u^r^a:n|o?1073741824&u?3221225472^u^r^a:1073741824^u^r^a:u^r^a}function r(e,t,n){return e&t|~e&n}function a(e,t,n){return e&n|t&~n}function u(e,t,n){return e^t^n}function i(e,t,n){return t^(e|~n)}function l(e,t,a,u,i,l,c){return e=o(e,o(o(r(t,a,u),i),c)),o(n(e,l),t)}function c(e,t,r,u,i,l,c){return e=o(e,o(o(a(t,r,u),i),c)),o(n(e,l),t)}function f(e,t,r,a,i,l,c){return e=o(e,o(o(u(t,r,a),i),c)),o(n(e,l),t)}function d(e,t,r,a,u,l,c){return e=o(e,o(o(i(t,r,a),u),c)),o(n(e,l),t)}function s(e){var t,n=e.length,o=n+8,r=(o-o%64)/64,a=16*(r+1),u=Array(a-1),i=0,l=0;while(l>>29,u}function p(e){var t,n,o="",r="";for(n=0;n<=3;n++)t=e>>>8*n&255,r="0"+t.toString(16),o+=r.substr(r.length-2,2);return o}var b,h,g,m,v,y,w,C,S,P=Array(),O=7,j=12,k=17,T=22,_=5,x=9,E=14,A=20,L=4,$=11,B=16,N=23,V=6,M=10,D=15,q=21;for(P=s(t),y=1732584193,w=4023233417,C=2562383102,S=271733878,b=0;b=0&&Math.floor(t)===t&&isFinite(e)}function p(e){return o(e)&&"function"===typeof e.then&&"function"===typeof e.catch}function h(e){return null==e?"":Array.isArray(e)||c(e)&&e.toString===u?JSON.stringify(e,null,2):String(e)}function v(e){var t=parseFloat(e);return isNaN(t)?e:t}function m(e,t){for(var n=Object.create(null),r=e.split(","),o=0;o-1)return e.splice(n,1)}}var b=Object.prototype.hasOwnProperty;function _(e,t){return b.call(e,t)}function x(e){var t=Object.create(null);return function(n){var r=t[n];return r||(t[n]=e(n))}}var w=/-(\w)/g,C=x((function(e){return e.replace(w,(function(e,t){return t?t.toUpperCase():""}))})),S=x((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})),O=/\B([A-Z])/g,E=x((function(e){return e.replace(O,"-$1").toLowerCase()}));function k(e,t){function n(n){var r=arguments.length;return r?r>1?e.apply(t,arguments):e.call(t,n):e.call(t)}return n._length=e.length,n}function $(e,t){return e.bind(t)}var j=Function.prototype.bind?$:k;function A(e,t){t=t||0;var n=e.length-t,r=new Array(n);while(n--)r[n]=e[n+t];return r}function T(e,t){for(var n in t)e[n]=t[n];return e}function M(e){for(var t={},n=0;n0,ne=Q&&Q.indexOf("edge/")>0,re=(Q&&Q.indexOf("android"),Q&&/iphone|ipad|ipod|ios/.test(Q)||"ios"===Z),oe=(Q&&/chrome\/\d+/.test(Q),Q&&/phantomjs/.test(Q),Q&&Q.match(/firefox\/(\d+)/)),ie={}.watch,ae=!1;if(Y)try{var se={};Object.defineProperty(se,"passive",{get:function(){ae=!0}}),window.addEventListener("test-passive",null,se)}catch(Ca){}var le=function(){return void 0===G&&(G=!Y&&!J&&"undefined"!==typeof e&&(e["process"]&&"server"===e["process"].env.VUE_ENV)),G},ue=Y&&window.__VUE_DEVTOOLS_GLOBAL_HOOK__;function ce(e){return"function"===typeof e&&/native code/.test(e.toString())}var fe,de="undefined"!==typeof Symbol&&ce(Symbol)&&"undefined"!==typeof Reflect&&ce(Reflect.ownKeys);fe="undefined"!==typeof Set&&ce(Set)?Set:function(){function e(){this.set=Object.create(null)}return e.prototype.has=function(e){return!0===this.set[e]},e.prototype.add=function(e){this.set[e]=!0},e.prototype.clear=function(){this.set=Object.create(null)},e}();var pe=P,he=0,ve=function(){this.id=he++,this.subs=[]};ve.prototype.addSub=function(e){this.subs.push(e)},ve.prototype.removeSub=function(e){g(this.subs,e)},ve.prototype.depend=function(){ve.target&&ve.target.addDep(this)},ve.prototype.notify=function(){var e=this.subs.slice();for(var t=0,n=e.length;t-1)if(i&&!_(o,"default"))a=!1;else if(""===a||a===E(e)){var l=et(String,o.type);(l<0||s0&&(a=kt(a,(t||"")+"_"+n),Et(a[0])&&Et(u)&&(c[l]=we(u.text+a[0].text),a.shift()),c.push.apply(c,a)):s(a)?Et(u)?c[l]=we(u.text+a):""!==a&&c.push(we(a)):Et(a)&&Et(u)?c[l]=we(u.text+a.text):(i(e._isVList)&&o(a.tag)&&r(a.key)&&o(t)&&(a.key="__vlist"+t+"_"+n+"__"),c.push(a)));return c}function $t(e){var t=e.$options.provide;t&&(e._provided="function"===typeof t?t.call(e):t)}function jt(e){var t=At(e.$options.inject,e);t&&(je(!1),Object.keys(t).forEach((function(n){Le(e,n,t[n])})),je(!0))}function At(e,t){if(e){for(var n=Object.create(null),r=de?Reflect.ownKeys(e):Object.keys(e),o=0;o0,a=e?!!e.$stable:!i,s=e&&e.$key;if(e){if(e._normalized)return e._normalized;if(a&&r&&r!==n&&s===r.$key&&!i&&!r.$hasNormal)return r;for(var l in o={},e)e[l]&&"$"!==l[0]&&(o[l]=Lt(t,l,e[l]))}else o={};for(var u in t)u in o||(o[u]=Nt(t,u));return e&&Object.isExtensible(e)&&(e._normalized=o),U(o,"$stable",a),U(o,"$key",s),U(o,"$hasNormal",i),o}function Lt(e,t,n){var r=function(){var e=arguments.length?n.apply(null,arguments):n({});return e=e&&"object"===typeof e&&!Array.isArray(e)?[e]:Ot(e),e&&(0===e.length||1===e.length&&e[0].isComment)?void 0:e};return n.proxy&&Object.defineProperty(e,t,{get:r,enumerable:!0,configurable:!0}),r}function Nt(e,t){return function(){return e[t]}}function Rt(e,t){var n,r,i,a,s;if(Array.isArray(e)||"string"===typeof e)for(n=new Array(e.length),r=0,i=e.length;r1?A(n):n;for(var r=A(arguments,1),o='event handler for "'+e+'"',i=0,a=n.length;idocument.createEvent("Event").timeStamp&&(Gn=function(){return Xn.now()})}function Yn(){var e,t;for(Kn=Gn(),Vn=!0,zn.sort((function(e,t){return e.id-t.id})),Un=0;UnUn&&zn[n].id>e.id)n--;zn.splice(n+1,0,e)}else zn.push(e);Wn||(Wn=!0,ht(Yn))}}var tr=0,nr=function(e,t,n,r,o){this.vm=e,o&&(e._watcher=this),e._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=++tr,this.active=!0,this.dirty=this.lazy,this.deps=[],this.newDeps=[],this.depIds=new fe,this.newDepIds=new fe,this.expression="","function"===typeof t?this.getter=t:(this.getter=K(t),this.getter||(this.getter=P)),this.value=this.lazy?void 0:this.get()};nr.prototype.get=function(){var e;ye(this);var t=this.vm;try{e=this.getter.call(t,t)}catch(Ca){if(!this.user)throw Ca;tt(Ca,t,'getter for watcher "'+this.expression+'"')}finally{this.deep&&mt(e),ge(),this.cleanupDeps()}return e},nr.prototype.addDep=function(e){var t=e.id;this.newDepIds.has(t)||(this.newDepIds.add(t),this.newDeps.push(e),this.depIds.has(t)||e.addSub(this))},nr.prototype.cleanupDeps=function(){var e=this.deps.length;while(e--){var t=this.deps[e];this.newDepIds.has(t.id)||t.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():er(this)},nr.prototype.run=function(){if(this.active){var e=this.get();if(e!==this.value||l(e)||this.deep){var t=this.value;if(this.value=e,this.user)try{this.cb.call(this.vm,e,t)}catch(Ca){tt(Ca,this.vm,'callback for watcher "'+this.expression+'"')}else this.cb.call(this.vm,e,t)}}},nr.prototype.evaluate=function(){this.value=this.get(),this.dirty=!1},nr.prototype.depend=function(){var e=this.deps.length;while(e--)this.deps[e].depend()},nr.prototype.teardown=function(){if(this.active){this.vm._isBeingDestroyed||g(this.vm._watchers,this);var e=this.deps.length;while(e--)this.deps[e].removeSub(this);this.active=!1}};var rr={enumerable:!0,configurable:!0,get:P,set:P};function or(e,t,n){rr.get=function(){return this[t][n]},rr.set=function(e){this[t][n]=e},Object.defineProperty(e,n,rr)}function ir(e){e._watchers=[];var t=e.$options;t.props&&ar(e,t.props),t.methods&&hr(e,t.methods),t.data?sr(e):Pe(e._data={},!0),t.computed&&cr(e,t.computed),t.watch&&t.watch!==ie&&vr(e,t.watch)}function ar(e,t){var n=e.$options.propsData||{},r=e._props={},o=e.$options._propKeys=[],i=!e.$parent;i||je(!1);var a=function(i){o.push(i);var a=Ye(i,t,n,e);Le(r,i,a),i in e||or(e,"_props",i)};for(var s in t)a(s);je(!0)}function sr(e){var t=e.$options.data;t=e._data="function"===typeof t?lr(t,e):t||{},c(t)||(t={});var n=Object.keys(t),r=e.$options.props,o=(e.$options.methods,n.length);while(o--){var i=n[o];0,r&&_(r,i)||V(i)||or(e,"_data",i)}Pe(t,!0)}function lr(e,t){ye();try{return e.call(t,t)}catch(Ca){return tt(Ca,t,"data()"),{}}finally{ge()}}var ur={lazy:!0};function cr(e,t){var n=e._computedWatchers=Object.create(null),r=le();for(var o in t){var i=t[o],a="function"===typeof i?i:i.get;0,r||(n[o]=new nr(e,a||P,P,ur)),o in e||fr(e,o,i)}}function fr(e,t,n){var r=!le();"function"===typeof n?(rr.get=r?dr(t):pr(n),rr.set=P):(rr.get=n.get?r&&!1!==n.cache?dr(t):pr(n.get):P,rr.set=n.set||P),Object.defineProperty(e,t,rr)}function dr(e){return function(){var t=this._computedWatchers&&this._computedWatchers[e];if(t)return t.dirty&&t.evaluate(),ve.target&&t.depend(),t.value}}function pr(e){return function(){return e.call(this,this)}}function hr(e,t){e.$options.props;for(var n in t)e[n]="function"!==typeof t[n]?P:j(t[n],e)}function vr(e,t){for(var n in t){var r=t[n];if(Array.isArray(r))for(var o=0;o-1)return this;var n=A(arguments,1);return n.unshift(this),"function"===typeof e.install?e.install.apply(e,n):"function"===typeof e&&e.apply(null,n),t.push(e),this}}function Or(e){e.mixin=function(e){return this.options=Ge(this.options,e),this}}function Er(e){e.cid=0;var t=1;e.extend=function(e){e=e||{};var n=this,r=n.cid,o=e._Ctor||(e._Ctor={});if(o[r])return o[r];var i=e.name||n.options.name;var a=function(e){this._init(e)};return a.prototype=Object.create(n.prototype),a.prototype.constructor=a,a.cid=t++,a.options=Ge(n.options,e),a["super"]=n,a.options.props&&kr(a),a.options.computed&&$r(a),a.extend=n.extend,a.mixin=n.mixin,a.use=n.use,z.forEach((function(e){a[e]=n[e]})),i&&(a.options.components[i]=a),a.superOptions=n.options,a.extendOptions=e,a.sealedOptions=T({},a.options),o[r]=a,a}}function kr(e){var t=e.options.props;for(var n in t)or(e.prototype,"_props",n)}function $r(e){var t=e.options.computed;for(var n in t)fr(e.prototype,n,t[n])}function jr(e){z.forEach((function(t){e[t]=function(e,n){return n?("component"===t&&c(n)&&(n.name=n.name||e,n=this.options._base.extend(n)),"directive"===t&&"function"===typeof n&&(n={bind:n,update:n}),this.options[t+"s"][e]=n,n):this.options[t+"s"][e]}}))}function Ar(e){return e&&(e.Ctor.options.name||e.tag)}function Tr(e,t){return Array.isArray(e)?e.indexOf(t)>-1:"string"===typeof e?e.split(",").indexOf(t)>-1:!!f(e)&&e.test(t)}function Mr(e,t){var n=e.cache,r=e.keys,o=e._vnode;for(var i in n){var a=n[i];if(a){var s=Ar(a.componentOptions);s&&!t(s)&&Pr(n,i,r,o)}}}function Pr(e,t,n,r){var o=e[t];!o||r&&o.tag===r.tag||o.componentInstance.$destroy(),e[t]=null,g(n,t)}br(Cr),yr(Cr),jn(Cr),Pn(Cr),gn(Cr);var Lr=[String,RegExp,Array],Nr={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 e in this.cache)Pr(this.cache,e,this.keys)},mounted:function(){var e=this;this.$watch("include",(function(t){Mr(e,(function(e){return Tr(t,e)}))})),this.$watch("exclude",(function(t){Mr(e,(function(e){return!Tr(t,e)}))}))},render:function(){var e=this.$slots.default,t=Cn(e),n=t&&t.componentOptions;if(n){var r=Ar(n),o=this,i=o.include,a=o.exclude;if(i&&(!r||!Tr(i,r))||a&&r&&Tr(a,r))return t;var s=this,l=s.cache,u=s.keys,c=null==t.key?n.Ctor.cid+(n.tag?"::"+n.tag:""):t.key;l[c]?(t.componentInstance=l[c].componentInstance,g(u,c),u.push(c)):(l[c]=t,u.push(c),this.max&&u.length>parseInt(this.max)&&Pr(l,u[0],u,this._vnode)),t.data.keepAlive=!0}return t||e&&e[0]}},Rr={KeepAlive:Nr};function Ir(e){var t={get:function(){return B}};Object.defineProperty(e,"config",t),e.util={warn:pe,extend:T,mergeOptions:Ge,defineReactive:Le},e.set=Ne,e.delete=Re,e.nextTick=ht,e.observable=function(e){return Pe(e),e},e.options=Object.create(null),z.forEach((function(t){e.options[t+"s"]=Object.create(null)})),e.options._base=e,T(e.options.components,Rr),Sr(e),Or(e),Er(e),jr(e)}Ir(Cr),Object.defineProperty(Cr.prototype,"$isServer",{get:le}),Object.defineProperty(Cr.prototype,"$ssrContext",{get:function(){return this.$vnode&&this.$vnode.ssrContext}}),Object.defineProperty(Cr,"FunctionalRenderContext",{value:Jt}),Cr.version="2.6.11";var Fr=m("style,class"),Hr=m("input,textarea,option,select,progress"),zr=function(e,t,n){return"value"===n&&Hr(e)&&"button"!==t||"selected"===n&&"option"===e||"checked"===n&&"input"===e||"muted"===n&&"video"===e},Dr=m("contenteditable,draggable,spellcheck"),Br=m("events,caret,typing,plaintext-only"),Wr=function(e,t){return Gr(t)||"false"===t?"false":"contenteditable"===e&&Br(t)?t:"true"},Vr=m("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"),Ur="http://www.w3.org/1999/xlink",qr=function(e){return":"===e.charAt(5)&&"xlink"===e.slice(0,5)},Kr=function(e){return qr(e)?e.slice(6,e.length):""},Gr=function(e){return null==e||!1===e};function Xr(e){var t=e.data,n=e,r=e;while(o(r.componentInstance))r=r.componentInstance._vnode,r&&r.data&&(t=Yr(r.data,t));while(o(n=n.parent))n&&n.data&&(t=Yr(t,n.data));return Jr(t.staticClass,t.class)}function Yr(e,t){return{staticClass:Zr(e.staticClass,t.staticClass),class:o(e.class)?[e.class,t.class]:t.class}}function Jr(e,t){return o(e)||o(t)?Zr(e,Qr(t)):""}function Zr(e,t){return e?t?e+" "+t:e:t||""}function Qr(e){return Array.isArray(e)?eo(e):l(e)?to(e):"string"===typeof e?e:""}function eo(e){for(var t,n="",r=0,i=e.length;r-1?so[e]=t.constructor===window.HTMLUnknownElement||t.constructor===window.HTMLElement:so[e]=/HTMLUnknownElement/.test(t.toString())}var uo=m("text,number,password,search,email,tel,url");function co(e){if("string"===typeof e){var t=document.querySelector(e);return t||document.createElement("div")}return e}function fo(e,t){var n=document.createElement(e);return"select"!==e||t.data&&t.data.attrs&&void 0!==t.data.attrs.multiple&&n.setAttribute("multiple","multiple"),n}function po(e,t){return document.createElementNS(no[e],t)}function ho(e){return document.createTextNode(e)}function vo(e){return document.createComment(e)}function mo(e,t,n){e.insertBefore(t,n)}function yo(e,t){e.removeChild(t)}function go(e,t){e.appendChild(t)}function bo(e){return e.parentNode}function _o(e){return e.nextSibling}function xo(e){return e.tagName}function wo(e,t){e.textContent=t}function Co(e,t){e.setAttribute(t,"")}var So=Object.freeze({createElement:fo,createElementNS:po,createTextNode:ho,createComment:vo,insertBefore:mo,removeChild:yo,appendChild:go,parentNode:bo,nextSibling:_o,tagName:xo,setTextContent:wo,setStyleScope:Co}),Oo={create:function(e,t){Eo(t)},update:function(e,t){e.data.ref!==t.data.ref&&(Eo(e,!0),Eo(t))},destroy:function(e){Eo(e,!0)}};function Eo(e,t){var n=e.data.ref;if(o(n)){var r=e.context,i=e.componentInstance||e.elm,a=r.$refs;t?Array.isArray(a[n])?g(a[n],i):a[n]===i&&(a[n]=void 0):e.data.refInFor?Array.isArray(a[n])?a[n].indexOf(i)<0&&a[n].push(i):a[n]=[i]:a[n]=i}}var ko=new be("",{},[]),$o=["create","activate","update","remove","destroy"];function jo(e,t){return e.key===t.key&&(e.tag===t.tag&&e.isComment===t.isComment&&o(e.data)===o(t.data)&&Ao(e,t)||i(e.isAsyncPlaceholder)&&e.asyncFactory===t.asyncFactory&&r(t.asyncFactory.error))}function Ao(e,t){if("input"!==e.tag)return!0;var n,r=o(n=e.data)&&o(n=n.attrs)&&n.type,i=o(n=t.data)&&o(n=n.attrs)&&n.type;return r===i||uo(r)&&uo(i)}function To(e,t,n){var r,i,a={};for(r=t;r<=n;++r)i=e[r].key,o(i)&&(a[i]=r);return a}function Mo(e){var t,n,a={},l=e.modules,u=e.nodeOps;for(t=0;t<$o.length;++t)for(a[$o[t]]=[],n=0;nv?(f=r(n[g+1])?null:n[g+1].elm,C(e,f,n,h,g,i)):h>g&&O(t,d,v)}function $(e,t,n,r){for(var i=n;i-1?Wo(e,t,n):Vr(t)?Gr(n)?e.removeAttribute(t):(n="allowfullscreen"===t&&"EMBED"===e.tagName?"true":t,e.setAttribute(t,n)):Dr(t)?e.setAttribute(t,Wr(t,n)):qr(t)?Gr(n)?e.removeAttributeNS(Ur,Kr(t)):e.setAttributeNS(Ur,t,n):Wo(e,t,n)}function Wo(e,t,n){if(Gr(n))e.removeAttribute(t);else{if(ee&&!te&&"TEXTAREA"===e.tagName&&"placeholder"===t&&""!==n&&!e.__ieph){var r=function(t){t.stopImmediatePropagation(),e.removeEventListener("input",r)};e.addEventListener("input",r),e.__ieph=!0}e.setAttribute(t,n)}}var Vo={create:Do,update:Do};function Uo(e,t){var n=t.elm,i=t.data,a=e.data;if(!(r(i.staticClass)&&r(i.class)&&(r(a)||r(a.staticClass)&&r(a.class)))){var s=Xr(t),l=n._transitionClasses;o(l)&&(s=Zr(s,Qr(l))),s!==n._prevClass&&(n.setAttribute("class",s),n._prevClass=s)}}var qo,Ko={create:Uo,update:Uo},Go="__r",Xo="__c";function Yo(e){if(o(e[Go])){var t=ee?"change":"input";e[t]=[].concat(e[Go],e[t]||[]),delete e[Go]}o(e[Xo])&&(e.change=[].concat(e[Xo],e.change||[]),delete e[Xo])}function Jo(e,t,n){var r=qo;return function o(){var i=t.apply(null,arguments);null!==i&&ei(e,o,n,r)}}var Zo=at&&!(oe&&Number(oe[1])<=53);function Qo(e,t,n,r){if(Zo){var o=Kn,i=t;t=i._wrapper=function(e){if(e.target===e.currentTarget||e.timeStamp>=o||e.timeStamp<=0||e.target.ownerDocument!==document)return i.apply(this,arguments)}}qo.addEventListener(e,t,ae?{capture:n,passive:r}:n)}function ei(e,t,n,r){(r||qo).removeEventListener(e,t._wrapper||t,n)}function ti(e,t){if(!r(e.data.on)||!r(t.data.on)){var n=t.data.on||{},o=e.data.on||{};qo=t.elm,Yo(n),_t(n,o,Qo,ei,Jo,t.context),qo=void 0}}var ni,ri={create:ti,update:ti};function oi(e,t){if(!r(e.data.domProps)||!r(t.data.domProps)){var n,i,a=t.elm,s=e.data.domProps||{},l=t.data.domProps||{};for(n in o(l.__ob__)&&(l=t.data.domProps=T({},l)),s)n in l||(a[n]="");for(n in l){if(i=l[n],"textContent"===n||"innerHTML"===n){if(t.children&&(t.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 c=ni.firstChild;while(a.firstChild)a.removeChild(a.firstChild);while(c.firstChild)a.appendChild(c.firstChild)}else if(i!==s[n])try{a[n]=i}catch(Ca){}}}}function ii(e,t){return!e.composing&&("OPTION"===e.tagName||ai(e,t)||si(e,t))}function ai(e,t){var n=!0;try{n=document.activeElement!==e}catch(Ca){}return n&&e.value!==t}function si(e,t){var n=e.value,r=e._vModifiers;if(o(r)){if(r.number)return v(n)!==v(t);if(r.trim)return n.trim()!==t.trim()}return n!==t}var li={create:oi,update:oi},ui=x((function(e){var t={},n=/;(?![^(]*\))/g,r=/:(.+)/;return e.split(n).forEach((function(e){if(e){var n=e.split(r);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}));function ci(e){var t=fi(e.style);return e.staticStyle?T(e.staticStyle,t):t}function fi(e){return Array.isArray(e)?M(e):"string"===typeof e?ui(e):e}function di(e,t){var n,r={};if(t){var o=e;while(o.componentInstance)o=o.componentInstance._vnode,o&&o.data&&(n=ci(o.data))&&T(r,n)}(n=ci(e.data))&&T(r,n);var i=e;while(i=i.parent)i.data&&(n=ci(i.data))&&T(r,n);return r}var pi,hi=/^--/,vi=/\s*!important$/,mi=function(e,t,n){if(hi.test(t))e.style.setProperty(t,n);else if(vi.test(n))e.style.setProperty(E(t),n.replace(vi,""),"important");else{var r=gi(t);if(Array.isArray(n))for(var o=0,i=n.length;o-1?t.split(xi).forEach((function(t){return e.classList.add(t)})):e.classList.add(t);else{var n=" "+(e.getAttribute("class")||"")+" ";n.indexOf(" "+t+" ")<0&&e.setAttribute("class",(n+t).trim())}}function Ci(e,t){if(t&&(t=t.trim()))if(e.classList)t.indexOf(" ")>-1?t.split(xi).forEach((function(t){return e.classList.remove(t)})):e.classList.remove(t),e.classList.length||e.removeAttribute("class");else{var n=" "+(e.getAttribute("class")||"")+" ",r=" "+t+" ";while(n.indexOf(r)>=0)n=n.replace(r," ");n=n.trim(),n?e.setAttribute("class",n):e.removeAttribute("class")}}function Si(e){if(e){if("object"===typeof e){var t={};return!1!==e.css&&T(t,Oi(e.name||"v")),T(t,e),t}return"string"===typeof e?Oi(e):void 0}}var Oi=x((function(e){return{enterClass:e+"-enter",enterToClass:e+"-enter-to",enterActiveClass:e+"-enter-active",leaveClass:e+"-leave",leaveToClass:e+"-leave-to",leaveActiveClass:e+"-leave-active"}})),Ei=Y&&!te,ki="transition",$i="animation",ji="transition",Ai="transitionend",Ti="animation",Mi="animationend";Ei&&(void 0===window.ontransitionend&&void 0!==window.onwebkittransitionend&&(ji="WebkitTransition",Ai="webkitTransitionEnd"),void 0===window.onanimationend&&void 0!==window.onwebkitanimationend&&(Ti="WebkitAnimation",Mi="webkitAnimationEnd"));var Pi=Y?window.requestAnimationFrame?window.requestAnimationFrame.bind(window):setTimeout:function(e){return e()};function Li(e){Pi((function(){Pi(e)}))}function Ni(e,t){var n=e._transitionClasses||(e._transitionClasses=[]);n.indexOf(t)<0&&(n.push(t),wi(e,t))}function Ri(e,t){e._transitionClasses&&g(e._transitionClasses,t),Ci(e,t)}function Ii(e,t,n){var r=Hi(e,t),o=r.type,i=r.timeout,a=r.propCount;if(!o)return n();var s=o===ki?Ai:Mi,l=0,u=function(){e.removeEventListener(s,c),n()},c=function(t){t.target===e&&++l>=a&&u()};setTimeout((function(){l0&&(n=ki,c=a,f=i.length):t===$i?u>0&&(n=$i,c=u,f=l.length):(c=Math.max(a,u),n=c>0?a>u?ki:$i:null,f=n?n===ki?i.length:l.length:0);var d=n===ki&&Fi.test(r[ji+"Property"]);return{type:n,timeout:c,propCount:f,hasTransform:d}}function zi(e,t){while(e.length1}function qi(e,t){!0!==t.data.show&&Bi(t)}var Ki=Y?{create:qi,activate:qi,remove:function(e,t){!0!==e.data.show?Wi(e,t):t()}}:{},Gi=[Vo,Ko,ri,li,_i,Ki],Xi=Gi.concat(zo),Yi=Mo({nodeOps:So,modules:Xi});te&&document.addEventListener("selectionchange",(function(){var e=document.activeElement;e&&e.vmodel&&oa(e,"input")}));var Ji={inserted:function(e,t,n,r){"select"===n.tag?(r.elm&&!r.elm._vOptions?xt(n,"postpatch",(function(){Ji.componentUpdated(e,t,n)})):Zi(e,t,n.context),e._vOptions=[].map.call(e.options,ta)):("textarea"===n.tag||uo(e.type))&&(e._vModifiers=t.modifiers,t.modifiers.lazy||(e.addEventListener("compositionstart",na),e.addEventListener("compositionend",ra),e.addEventListener("change",ra),te&&(e.vmodel=!0)))},componentUpdated:function(e,t,n){if("select"===n.tag){Zi(e,t,n.context);var r=e._vOptions,o=e._vOptions=[].map.call(e.options,ta);if(o.some((function(e,t){return!R(e,r[t])}))){var i=e.multiple?t.value.some((function(e){return ea(e,o)})):t.value!==t.oldValue&&ea(t.value,o);i&&oa(e,"change")}}}};function Zi(e,t,n){Qi(e,t,n),(ee||ne)&&setTimeout((function(){Qi(e,t,n)}),0)}function Qi(e,t,n){var r=t.value,o=e.multiple;if(!o||Array.isArray(r)){for(var i,a,s=0,l=e.options.length;s-1,a.selected!==i&&(a.selected=i);else if(R(ta(a),r))return void(e.selectedIndex!==s&&(e.selectedIndex=s));o||(e.selectedIndex=-1)}}function ea(e,t){return t.every((function(t){return!R(t,e)}))}function ta(e){return"_value"in e?e._value:e.value}function na(e){e.target.composing=!0}function ra(e){e.target.composing&&(e.target.composing=!1,oa(e.target,"input"))}function oa(e,t){var n=document.createEvent("HTMLEvents");n.initEvent(t,!0,!0),e.dispatchEvent(n)}function ia(e){return!e.componentInstance||e.data&&e.data.transition?e:ia(e.componentInstance._vnode)}var aa={bind:function(e,t,n){var r=t.value;n=ia(n);var o=n.data&&n.data.transition,i=e.__vOriginalDisplay="none"===e.style.display?"":e.style.display;r&&o?(n.data.show=!0,Bi(n,(function(){e.style.display=i}))):e.style.display=r?i:"none"},update:function(e,t,n){var r=t.value,o=t.oldValue;if(!r!==!o){n=ia(n);var i=n.data&&n.data.transition;i?(n.data.show=!0,r?Bi(n,(function(){e.style.display=e.__vOriginalDisplay})):Wi(n,(function(){e.style.display="none"}))):e.style.display=r?e.__vOriginalDisplay:"none"}},unbind:function(e,t,n,r,o){o||(e.style.display=e.__vOriginalDisplay)}},sa={model:Ji,show:aa},la={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(e){var t=e&&e.componentOptions;return t&&t.Ctor.options.abstract?ua(Cn(t.children)):e}function ca(e){var t={},n=e.$options;for(var r in n.propsData)t[r]=e[r];var o=n._parentListeners;for(var i in o)t[C(i)]=o[i];return t}function fa(e,t){if(/\d-keep-alive$/.test(t.tag))return e("keep-alive",{props:t.componentOptions.propsData})}function da(e){while(e=e.parent)if(e.data.transition)return!0}function pa(e,t){return t.key===e.key&&t.tag===e.tag}var ha=function(e){return e.tag||wn(e)},va=function(e){return"show"===e.name},ma={name:"transition",props:la,abstract:!0,render:function(e){var t=this,n=this.$slots.default;if(n&&(n=n.filter(ha),n.length)){0;var r=this.mode;0;var o=n[0];if(da(this.$vnode))return o;var i=ua(o);if(!i)return o;if(this._leaving)return fa(e,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 l=(i.data||(i.data={})).transition=ca(this),u=this._vnode,c=ua(u);if(i.data.directives&&i.data.directives.some(va)&&(i.data.show=!0),c&&c.data&&!pa(i,c)&&!wn(c)&&(!c.componentInstance||!c.componentInstance._vnode.isComment)){var f=c.data.transition=T({},l);if("out-in"===r)return this._leaving=!0,xt(f,"afterLeave",(function(){t._leaving=!1,t.$forceUpdate()})),fa(e,o);if("in-out"===r){if(wn(i))return u;var d,p=function(){d()};xt(l,"afterEnter",p),xt(l,"enterCancelled",p),xt(f,"delayLeave",(function(e){d=e}))}}return o}}},ya=T({tag:String,moveClass:String},la);delete ya.mode;var ga={props:ya,beforeMount:function(){var e=this,t=this._update;this._update=function(n,r){var o=Tn(e);e.__patch__(e._vnode,e.kept,!1,!0),e._vnode=e.kept,o(),t.call(e,n,r)}},render:function(e){for(var t=this.tag||this.$vnode.data.tag||"span",n=Object.create(null),r=this.prevChildren=this.children,o=this.$slots.default||[],i=this.children=[],a=ca(this),s=0;sl)r(s,n=t[l++])&&(~i(u,n)||u.push(n));return u}},"032e":function(e,t,n){var r=n("d5dc"),o=n("d68d"),i=r.document,a=o(i)&&o(i.createElement);e.exports=function(e){return a?i.createElement(e):{}}},"0532":function(e,t,n){var r=n("57c4"),o=n("ed35"),i=r("iterator"),a=Array.prototype;e.exports=function(e){return void 0!==e&&(o.Array===e||a[i]===e)}},"0618":function(e,t,n){"use strict";var r=n("ac83");e.exports=function(){var e=r(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t}},"0655":function(e,t,n){"use strict";n.r(t),function(e){var n=function(){if("undefined"!==typeof Map)return Map;function e(e,t){var n=-1;return e.some((function(e,r){return e[0]===t&&(n=r,!0)})),n}return(function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n0},e.prototype.connect_=function(){r&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),c?(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)},e.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)},e.prototype.onTransitionEnd_=function(e){var t=e.propertyName,n=void 0===t?"":t,r=u.some((function(e){return!!~n.indexOf(e)}));r&&this.refresh()},e.getInstance=function(){return this.instance_||(this.instance_=new e),this.instance_},e.instance_=null,e}(),d=function(e,t){for(var n=0,r=Object.keys(t);n0},e}(),$="undefined"!==typeof WeakMap?new WeakMap:new n,j=function(){function e(t){if(!(this instanceof e))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=f.getInstance(),r=new k(t,n,this);$.set(this,r)}return e}();["observe","unobserve","disconnect"].forEach((function(e){j.prototype[e]=function(){var t;return(t=$.get(this))[e].apply(t,arguments)}}));var A=function(){return"undefined"!==typeof o.ResizeObserver?o.ResizeObserver:j}();t["default"]=A}.call(this,n("77e5"))},"0b29":function(e,t,n){var r=n("a9f2");e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},1072:function(e,t){t.f=Object.getOwnPropertySymbols},"12d9":function(e,t,n){var r=n("f30e"),o=/#|\.prototype\./,i=function(e,t){var n=s[a(e)];return n==u||n!=l&&("function"==typeof t?r(t):!!t)},a=i.normalize=function(e){return String(e).replace(o,".").toLowerCase()},s=i.data={},l=i.NATIVE="N",u=i.POLYFILL="P";e.exports=i},"143b":function(e,t,n){"use strict";var r,o,i,a=n("90a7"),s=n("2ba5"),l=n("f28d"),u=n("57c4"),c=n("e17a"),f=u("iterator"),d=!1,p=function(){return this};[].keys&&(i=[].keys(),"next"in i?(o=a(a(i)),o!==Object.prototype&&(r=o)):d=!0),void 0==r&&(r={}),c||l(r,f)||s(r,f,p),e.exports={IteratorPrototype:r,BUGGY_SAFARI_ITERATORS:d}},"16e5":function(e,t,n){var r=n("02d0"),o=n("6807");e.exports=Object.keys||function(e){return r(e,o)}},1932:function(e,t,n){"use strict";t.__esModule=!0;n("d41f");t.default={mounted:function(){},methods:{getMigratingConfig:function(){return{props:{},events:{}}}}}},"1bee":function(e,t,n){"use strict"; +/*! + * vue-router v3.1.6 + * (c) 2020 Evan You + * @license MIT + */function r(e,t){0}function o(e){return Object.prototype.toString.call(e).indexOf("Error")>-1}function i(e,t){return t instanceof e||t&&(t.name===e.name||t._name===e._name)}function a(e,t){for(var n in t)e[n]=t[n];return e}var s={name:"RouterView",functional:!0,props:{name:{type:String,default:"default"}},render:function(e,t){var n=t.props,r=t.children,o=t.parent,i=t.data;i.routerView=!0;var s=o.$createElement,u=n.name,c=o.$route,f=o._routerViewCache||(o._routerViewCache={}),d=0,p=!1;while(o&&o._routerRoot!==o){var h=o.$vnode?o.$vnode.data:{};h.routerView&&d++,h.keepAlive&&o._directInactive&&o._inactive&&(p=!0),o=o.$parent}if(i.routerViewDepth=d,p){var v=f[u],m=v&&v.component;return m?(v.configProps&&l(m,i,v.route,v.configProps),s(m,i,r)):s()}var y=c.matched[d],g=y&&y.components[u];if(!y||!g)return f[u]=null,s();f[u]={component:g},i.registerRouteInstance=function(e,t){var n=y.instances[u];(t&&n!==e||!t&&n===e)&&(y.instances[u]=t)},(i.hook||(i.hook={})).prepatch=function(e,t){y.instances[u]=t.componentInstance},i.hook.init=function(e){e.data.keepAlive&&e.componentInstance&&e.componentInstance!==y.instances[u]&&(y.instances[u]=e.componentInstance)};var b=y.props&&y.props[u];return b&&(a(f[u],{route:c,configProps:b}),l(g,i,c,b)),s(g,i,r)}};function l(e,t,n,r){var o=t.props=u(n,r);if(o){o=t.props=a({},o);var i=t.attrs=t.attrs||{};for(var s in o)e.props&&s in e.props||(i[s]=o[s],delete o[s])}}function u(e,t){switch(typeof t){case"undefined":return;case"object":return t;case"function":return t(e);case"boolean":return t?e.params:void 0;default:0}}var c=/[!'()*]/g,f=function(e){return"%"+e.charCodeAt(0).toString(16)},d=/%2C/g,p=function(e){return encodeURIComponent(e).replace(c,f).replace(d,",")},h=decodeURIComponent;function v(e,t,n){void 0===t&&(t={});var r,o=n||m;try{r=o(e||"")}catch(a){r={}}for(var i in t)r[i]=t[i];return r}function m(e){var t={};return e=e.trim().replace(/^(\?|#|&)/,""),e?(e.split("&").forEach((function(e){var n=e.replace(/\+/g," ").split("="),r=h(n.shift()),o=n.length>0?h(n.join("=")):null;void 0===t[r]?t[r]=o:Array.isArray(t[r])?t[r].push(o):t[r]=[t[r],o]})),t):t}function y(e){var t=e?Object.keys(e).map((function(t){var n=e[t];if(void 0===n)return"";if(null===n)return p(t);if(Array.isArray(n)){var r=[];return n.forEach((function(e){void 0!==e&&(null===e?r.push(p(t)):r.push(p(t)+"="+p(e)))})),r.join("&")}return p(t)+"="+p(n)})).filter((function(e){return e.length>0})).join("&"):null;return t?"?"+t:""}var g=/\/?$/;function b(e,t,n,r){var o=r&&r.options.stringifyQuery,i=t.query||{};try{i=_(i)}catch(s){}var a={name:t.name||e&&e.name,meta:e&&e.meta||{},path:t.path||"/",hash:t.hash||"",query:i,params:t.params||{},fullPath:C(t,o),matched:e?w(e):[]};return n&&(a.redirectedFrom=C(n,o)),Object.freeze(a)}function _(e){if(Array.isArray(e))return e.map(_);if(e&&"object"===typeof e){var t={};for(var n in e)t[n]=_(e[n]);return t}return e}var x=b(null,{path:"/"});function w(e){var t=[];while(e)t.unshift(e),e=e.parent;return t}function C(e,t){var n=e.path,r=e.query;void 0===r&&(r={});var o=e.hash;void 0===o&&(o="");var i=t||y;return(n||"/")+i(r)+o}function S(e,t){return t===x?e===t:!!t&&(e.path&&t.path?e.path.replace(g,"")===t.path.replace(g,"")&&e.hash===t.hash&&O(e.query,t.query):!(!e.name||!t.name)&&(e.name===t.name&&e.hash===t.hash&&O(e.query,t.query)&&O(e.params,t.params)))}function O(e,t){if(void 0===e&&(e={}),void 0===t&&(t={}),!e||!t)return e===t;var n=Object.keys(e),r=Object.keys(t);return n.length===r.length&&n.every((function(n){var r=e[n],o=t[n];return"object"===typeof r&&"object"===typeof o?O(r,o):String(r)===String(o)}))}function E(e,t){return 0===e.path.replace(g,"/").indexOf(t.path.replace(g,"/"))&&(!t.hash||e.hash===t.hash)&&k(e.query,t.query)}function k(e,t){for(var n in t)if(!(n in e))return!1;return!0}function $(e,t,n){var r=e.charAt(0);if("/"===r)return e;if("?"===r||"#"===r)return t+e;var o=t.split("/");n&&o[o.length-1]||o.pop();for(var i=e.replace(/^\//,"").split("/"),a=0;a=0&&(t=e.slice(r),e=e.slice(0,r));var o=e.indexOf("?");return o>=0&&(n=e.slice(o+1),e=e.slice(0,o)),{path:e,query:n,hash:t}}function A(e){return e.replace(/\/\//g,"/")}var T=Array.isArray||function(e){return"[object Array]"==Object.prototype.toString.call(e)},M=J,P=F,L=H,N=B,R=Y,I=new RegExp(["(\\\\.)","([\\/.])?(?:(?:\\:(\\w+)(?:\\(((?:\\\\.|[^\\\\()])+)\\))?|\\(((?:\\\\.|[^\\\\()])+)\\))([+*?])?|(\\*))"].join("|"),"g");function F(e,t){var n,r=[],o=0,i=0,a="",s=t&&t.delimiter||"/";while(null!=(n=I.exec(e))){var l=n[0],u=n[1],c=n.index;if(a+=e.slice(i,c),i=c+l.length,u)a+=u[1];else{var f=e[i],d=n[2],p=n[3],h=n[4],v=n[5],m=n[6],y=n[7];a&&(r.push(a),a="");var g=null!=d&&null!=f&&f!==d,b="+"===m||"*"===m,_="?"===m||"*"===m,x=n[2]||s,w=h||v;r.push({name:p||o++,prefix:d||"",delimiter:x,optional:_,repeat:b,partial:g,asterisk:!!y,pattern:w?V(w):y?".*":"[^"+W(x)+"]+?"})}}return i1||!x.length)return 0===x.length?e():e("span",{},x)}if("a"===this.tag)_.on=g,_.attrs={href:l};else{var w=se(this.$slots.default);if(w){w.isStatic=!1;var C=w.data=a({},w.data);for(var O in C.on=C.on||{},C.on){var k=C.on[O];O in g&&(C.on[O]=Array.isArray(k)?k:[k])}for(var $ in g)$ in C.on?C.on[$].push(g[$]):C.on[$]=y;var j=w.data.attrs=a({},w.data.attrs);j.href=l}else _.on=g}return e(this.tag,_,this.$slots.default)}};function ae(e){if(!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)&&!e.defaultPrevented&&(void 0===e.button||0===e.button)){if(e.currentTarget&&e.currentTarget.getAttribute){var t=e.currentTarget.getAttribute("target");if(/\b_blank\b/i.test(t))return}return e.preventDefault&&e.preventDefault(),!0}}function se(e){if(e)for(var t,n=0;n-1&&(s.params[d]=n.params[d]);return s.path=Q(u.path,s.params,'named route "'+l+'"'),c(u,s,a)}if(s.path){s.params={};for(var p=0;p=e.length?n():e[o]?t(e[o],(function(){r(o+1)})):r(o+1)};r(0)}function Fe(e){return function(t,n,r){var i=!1,a=0,s=null;He(e,(function(e,t,n,l){if("function"===typeof e&&void 0===e.cid){i=!0,a++;var u,c=We((function(t){Be(t)&&(t=t.default),e.resolved="function"===typeof t?t:te.extend(t),n.components[l]=t,a--,a<=0&&r()})),f=We((function(e){var t="Failed to resolve async component "+l+": "+e;s||(s=o(e)?e:new Error(t),r(s))}));try{u=e(c,f)}catch(p){f(p)}if(u)if("function"===typeof u.then)u.then(c,f);else{var d=u.component;d&&"function"===typeof d.then&&d.then(c,f)}}})),i||r()}}function He(e,t){return ze(e.map((function(e){return Object.keys(e.components).map((function(n){return t(e.components[n],e.instances[n],e,n)}))})))}function ze(e){return Array.prototype.concat.apply([],e)}var De="function"===typeof Symbol&&"symbol"===typeof Symbol.toStringTag;function Be(e){return e.__esModule||De&&"Module"===e[Symbol.toStringTag]}function We(e){var t=!1;return function(){var n=[],r=arguments.length;while(r--)n[r]=arguments[r];if(!t)return t=!0,e.apply(this,n)}}var Ve=function(e){function t(t){e.call(this),this.name=this._name="NavigationDuplicated",this.message='Navigating to current location ("'+t.fullPath+'") is not allowed',Object.defineProperty(this,"stack",{value:(new e).stack,writable:!0,configurable:!0})}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t}(Error);Ve._name="NavigationDuplicated";var Ue=function(e,t){this.router=e,this.base=qe(t),this.current=x,this.pending=null,this.ready=!1,this.readyCbs=[],this.readyErrorCbs=[],this.errorCbs=[]};function qe(e){if(!e)if(ue){var t=document.querySelector("base");e=t&&t.getAttribute("href")||"/",e=e.replace(/^https?:\/\/[^\/]+/,"")}else e="/";return"/"!==e.charAt(0)&&(e="/"+e),e.replace(/\/$/,"")}function Ke(e,t){var n,r=Math.max(e.length,t.length);for(n=0;n-1?decodeURI(e.slice(0,r))+e.slice(r):decodeURI(e)}else e=decodeURI(e.slice(0,n))+e.slice(n);return e}function lt(e){var t=window.location.href,n=t.indexOf("#"),r=n>=0?t.slice(0,n):t;return r+"#"+e}function ut(e){Le?Ne(lt(e)):window.location.hash=e}function ct(e){Le?Re(lt(e)):window.location.replace(lt(e))}var ft=function(e){function t(t,n){e.call(this,t,n),this.stack=[],this.index=-1}return e&&(t.__proto__=e),t.prototype=Object.create(e&&e.prototype),t.prototype.constructor=t,t.prototype.push=function(e,t,n){var r=this;this.transitionTo(e,(function(e){r.stack=r.stack.slice(0,r.index+1).concat(e),r.index++,t&&t(e)}),n)},t.prototype.replace=function(e,t,n){var r=this;this.transitionTo(e,(function(e){r.stack=r.stack.slice(0,r.index).concat(e),t&&t(e)}),n)},t.prototype.go=function(e){var t=this,n=this.index+e;if(!(n<0||n>=this.stack.length)){var r=this.stack[n];this.confirmTransition(r,(function(){t.index=n,t.updateRoute(r)}),(function(e){i(Ve,e)&&(t.index=n)}))}},t.prototype.getCurrentLocation=function(){var e=this.stack[this.stack.length-1];return e?e.fullPath:"/"},t.prototype.ensureURL=function(){},t}(Ue),dt=function(e){void 0===e&&(e={}),this.app=null,this.apps=[],this.options=e,this.beforeHooks=[],this.resolveHooks=[],this.afterHooks=[],this.matcher=he(e.routes||[],this);var t=e.mode||"hash";switch(this.fallback="history"===t&&!Le&&!1!==e.fallback,this.fallback&&(t="hash"),ue||(t="abstract"),this.mode=t,t){case"history":this.history=new nt(this,e.base);break;case"hash":this.history=new ot(this,e.base,this.fallback);break;case"abstract":this.history=new ft(this,e.base);break;default:0}},pt={currentRoute:{configurable:!0}};function ht(e,t){return e.push(t),function(){var n=e.indexOf(t);n>-1&&e.splice(n,1)}}function vt(e,t,n){var r="hash"===n?"#"+t:t;return e?A(e+"/"+r):r}dt.prototype.match=function(e,t,n){return this.matcher.match(e,t,n)},pt.currentRoute.get=function(){return this.history&&this.history.current},dt.prototype.init=function(e){var t=this;if(this.apps.push(e),e.$once("hook:destroyed",(function(){var n=t.apps.indexOf(e);n>-1&&t.apps.splice(n,1),t.app===e&&(t.app=t.apps[0]||null)})),!this.app){this.app=e;var n=this.history;if(n instanceof nt)n.transitionTo(n.getCurrentLocation());else if(n instanceof ot){var r=function(){n.setupListeners()};n.transitionTo(n.getCurrentLocation(),r,r)}n.listen((function(e){t.apps.forEach((function(t){t._route=e}))}))}},dt.prototype.beforeEach=function(e){return ht(this.beforeHooks,e)},dt.prototype.beforeResolve=function(e){return ht(this.resolveHooks,e)},dt.prototype.afterEach=function(e){return ht(this.afterHooks,e)},dt.prototype.onReady=function(e,t){this.history.onReady(e,t)},dt.prototype.onError=function(e){this.history.onError(e)},dt.prototype.push=function(e,t,n){var r=this;if(!t&&!n&&"undefined"!==typeof Promise)return new Promise((function(t,n){r.history.push(e,t,n)}));this.history.push(e,t,n)},dt.prototype.replace=function(e,t,n){var r=this;if(!t&&!n&&"undefined"!==typeof Promise)return new Promise((function(t,n){r.history.replace(e,t,n)}));this.history.replace(e,t,n)},dt.prototype.go=function(e){this.history.go(e)},dt.prototype.back=function(){this.go(-1)},dt.prototype.forward=function(){this.go(1)},dt.prototype.getMatchedComponents=function(e){var t=e?e.matched?e:this.resolve(e).route:this.currentRoute;return t?[].concat.apply([],t.matched.map((function(e){return Object.keys(e.components).map((function(t){return e.components[t]}))}))):[]},dt.prototype.resolve=function(e,t,n){t=t||this.history.current;var r=ee(e,t,n,this),o=this.match(r,t),i=o.redirectedFrom||o.fullPath,a=this.history.base,s=vt(a,i,this.mode);return{location:r,route:o,href:s,normalizedTo:r,resolved:o}},dt.prototype.addRoutes=function(e){this.matcher.addRoutes(e),this.history.current!==x&&this.history.transitionTo(this.history.getCurrentLocation())},Object.defineProperties(dt.prototype,pt),dt.install=le,dt.version="3.1.6",ue&&window.Vue&&window.Vue.use(dt),t["a"]=dt},"1ce0":function(e,t,n){},"1f4f":function(e,t,n){"use strict";t.__esModule=!0;var r=n("6406");t.default={methods:{t:function(){for(var e=arguments.length,t=Array(e),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(o),o;function s(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]||"")}))}},n.prototype._getPosition=function(e,t){var n=l(t);if(this._options.forceAbsolute)return"absolute";var r=c(t,n);return r?"fixed":"absolute"},n.prototype._getOffsets=function(e,t,n){n=n.split("-")[0];var o={};o.position=this.state.position;var i="fixed"===o.position,a=v(t,l(e),i),s=r(e);return-1!==["right","left"].indexOf(n)?(o.top=a.top+a.height/2-s.height/2,o.left="left"===n?a.left-s.width:a.right):(o.left=a.left+a.width/2-s.width/2,o.top="top"===n?a.top-s.height:a.bottom),o.width=s.width,o.height=s.height,{popper:o,reference:a}},n.prototype._setupEventListeners=function(){if(this.state.updateBound=this.update.bind(this),e.addEventListener("resize",this.state.updateBound),"window"!==this._options.boundariesElement){var t=u(this._reference);t!==e.document.body&&t!==e.document.documentElement||(t=e),t.addEventListener("scroll",this.state.updateBound),this.state.scrollTarget=t}},n.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},n.prototype._getBoundaries=function(t,n,r){var o,i,a={};if("window"===r){var s=e.document.body,c=e.document.documentElement;i=Math.max(s.scrollHeight,s.offsetHeight,c.clientHeight,c.scrollHeight,c.offsetHeight),o=Math.max(s.scrollWidth,s.offsetWidth,c.clientWidth,c.scrollWidth,c.offsetWidth),a={top:0,right:o,bottom:i,left:0}}else if("viewport"===r){var f=l(this._popper),d=u(this._popper),h=p(f),v=function(e){return e==document.body?Math.max(document.documentElement.scrollTop,document.body.scrollTop):e.scrollTop},m=function(e){return e==document.body?Math.max(document.documentElement.scrollLeft,document.body.scrollLeft):e.scrollLeft},y="fixed"===t.offsets.popper.position?0:v(d),g="fixed"===t.offsets.popper.position?0:m(d);a={top:0-(h.top-y),right:e.document.documentElement.clientWidth-(h.left-g),bottom:e.document.documentElement.clientHeight-(h.top-y),left:0-(h.left-g)}}else a=l(this._popper)===r?{top:0,left:0,right:r.clientWidth,bottom:r.clientHeight}:p(r);return a.left+=n,a.right-=n,a.top=a.top+n,a.bottom=a.bottom-n,a},n.prototype.runModifiers=function(e,t,n){var r=t.slice();return void 0!==n&&(r=this._options.modifiers.slice(0,a(this._options.modifiers,n))),r.forEach(function(t){d(t)&&(e=t.call(this,e))}.bind(this)),e},n.prototype.isModifierRequired=function(e,t){var n=a(this._options.modifiers,e);return!!this._options.modifiers.slice(0,n).filter((function(e){return e===t})).length},n.prototype.modifiers={},n.prototype.modifiers.applyStyle=function(e){var t,n={position:e.offsets.popper.position},r=Math.round(e.offsets.popper.left),o=Math.round(e.offsets.popper.top);return this._options.gpuAcceleration&&(t=m("transform"))?(n[t]="translate3d("+r+"px, "+o+"px, 0)",n.top=0,n.left=0):(n.left=r,n.top=o),Object.assign(n,e.styles),f(this._popper,n),this._popper.setAttribute("x-placement",e.placement),this.isModifierRequired(this.modifiers.applyStyle,this.modifiers.arrow)&&e.offsets.arrow&&f(e.arrowElement,e.offsets.arrow),e},n.prototype.modifiers.shift=function(e){var t=e.placement,n=t.split("-")[0],r=t.split("-")[1];if(r){var o=e.offsets.reference,a=i(e.offsets.popper),s={y:{start:{top:o.top},end:{top:o.top+o.height-a.height}},x:{start:{left:o.left},end:{left:o.left+o.width-a.width}}},l=-1!==["bottom","top"].indexOf(n)?"x":"y";e.offsets.popper=Object.assign(a,s[l][r])}return e},n.prototype.modifiers.preventOverflow=function(e){var t=this._options.preventOverflowOrder,n=i(e.offsets.popper),r={left:function(){var t=n.left;return n.lefte.boundaries.right&&(t=Math.min(n.left,e.boundaries.right-n.width)),{left:t}},top:function(){var t=n.top;return n.tope.boundaries.bottom&&(t=Math.min(n.top,e.boundaries.bottom-n.height)),{top:t}}};return t.forEach((function(t){e.offsets.popper=Object.assign(n,r[t]())})),e},n.prototype.modifiers.keepTogether=function(e){var t=i(e.offsets.popper),n=e.offsets.reference,r=Math.floor;return t.rightr(n.right)&&(e.offsets.popper.left=r(n.right)),t.bottomr(n.bottom)&&(e.offsets.popper.top=r(n.bottom)),e},n.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],n=o(t),r=e.placement.split("-")[1]||"",a=[];return a="flip"===this._options.flipBehavior?[t,n]:this._options.flipBehavior,a.forEach(function(s,l){if(t===s&&a.length!==l+1){t=e.placement.split("-")[0],n=o(t);var u=i(e.offsets.popper),c=-1!==["right","bottom"].indexOf(t);(c&&Math.floor(e.offsets.reference[t])>Math.floor(u[n])||!c&&Math.floor(e.offsets.reference[t])s[p]&&(e.offsets.popper[f]+=l[f]+h-s[p]);var v=l[f]+(n||l[c]/2-h/2),m=v-s[f];return m=Math.max(Math.min(s[c]-h-8,m),8),o[f]=m,o[d]="",e.offsets.arrow=o,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),n=1;nn},ie64:function(){return b.ie()&&d},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()||l},linux:function(){return g()||c},iphone:function(){return g()||p},mobile:function(){return g()||p||h||f||m},nativeApp:function(){return g()||v},android:function(){return g()||f},ipad:function(){return g()||h}};e.exports=b},"2ba5":function(e,t,n){var r=n("7a23"),o=n("c223"),i=n("aec8");e.exports=r?function(e,t,n){return o.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},"2bba":function(e,t,n){var r=n("ac83");e.exports=function(e,t,n,o){try{return o?t(r(n)[0],n[1]):t(n)}catch(a){var i=e["return"];throw void 0!==i&&r(i.call(e)),a}}},3109:function(e,t,n){var r=n("d5dc"),o=n("527d"),i=r.WeakMap;e.exports="function"===typeof i&&/native code/.test(o(i))},3193:function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},"354c":function(e,t,n){"use strict";var r={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!r.call({1:2},1);t.f=i?function(e){var t=o(this,e);return!!t&&t.enumerable}:r},"375c":function(e,t,n){},"3a20":function(e,t,n){var r=n("efd1"),o=n("3d8a"),i=n("3f8e");r||o(Object.prototype,"toString",i,{unsafe:!0})},"3c84":function(e,t,n){"use strict";t.__esModule=!0,t.isInContainer=t.getScrollContainer=t.isScroll=t.getStyle=t.once=t.off=t.on=void 0;var r="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=v,t.addClass=m,t.removeClass=y,t.setStyle=b;var o=n("0261"),i=a(o);function a(e){return e&&e.__esModule?e:{default:e}}var s=i.default.prototype.$isServer,l=/([\:\-\_]+(.))/g,u=/^moz([A-Z])/,c=s?0:Number(document.documentMode),f=function(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},d=function(e){return e.replace(l,(function(e,t,n,r){return r?n.toUpperCase():n})).replace(u,"Moz$1")},p=t.on=function(){return!s&&document.addEventListener?function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}:function(e,t,n){e&&t&&n&&e.attachEvent("on"+t,n)}}(),h=t.off=function(){return!s&&document.removeEventListener?function(e,t,n){e&&t&&e.removeEventListener(t,n,!1)}:function(e,t,n){e&&t&&e.detachEvent("on"+t,n)}}();t.once=function(e,t,n){var r=function r(){n&&n.apply(this,arguments),h(e,t,r)};p(e,t,r)};function v(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 m(e,t){if(e){for(var n=e.className,r=(t||"").split(" "),o=0,i=r.length;or.top&&n.right>r.left&&n.left2&&void 0!==arguments[2]?arguments[2]:300,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!t)throw new Error("instance & callback is required");var o=!1,i=function(){o||(o=!0,t&&t.apply(null,arguments))};r?e.$once("after-leave",i):e.$on("after-leave",i),setTimeout((function(){i()}),n+100)}},"3d8a":function(e,t,n){var r=n("d5dc"),o=n("2ba5"),i=n("f28d"),a=n("200e"),s=n("527d"),l=n("d0e2"),u=l.get,c=l.enforce,f=String(String).split("String");(e.exports=function(e,t,n,s){var l=!!s&&!!s.unsafe,u=!!s&&!!s.enumerable,d=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof t||i(n,"name")||o(n,"name",t),c(n).source=f.join("string"==typeof t?t:"")),e!==r?(l?!d&&e[t]&&(u=!0):delete e[t],u?e[t]=n:o(e,t,n)):u?e[t]=n:a(t,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||s(this)}))},"3f5d":function(e,t,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};e.exports=o},"3f8e":function(e,t,n){"use strict";var r=n("efd1"),o=n("9552");e.exports=r?{}.toString:function(){return"[object "+o(this)+"]"}},"40d4":function(e,t){e.exports=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e}},"417f":function(e,t,n){var r=n("3d8a");e.exports=function(e,t,n){for(var o in t)r(e,o,t[o],n);return e}},4301:function(e,t,n){var r=n("ac83"),o=n("d68d"),i=n("df22");e.exports=function(e,t){if(r(e),o(t)&&t.constructor===e)return t;var n=i.f(e),a=n.resolve;return a(t),n.promise}},4445:function(e,t,n){var r=n("4ccd");e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},4888:function(e,t){e.exports={}},"4aef":function(e,t,n){var r=n("7a23"),o=n("354c"),i=n("aec8"),a=n("8c47"),s=n("7dc7"),l=n("f28d"),u=n("88b4"),c=Object.getOwnPropertyDescriptor;t.f=r?c:function(e,t){if(e=a(e),t=s(t,!0),u)try{return c(e,t)}catch(n){}if(l(e,t))return i(!o.f.call(e,t),e[t])}},"4ccd":function(e,t,n){var r=n("f30e");e.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},"4ce0":function(e,t,n){var r=n("ac83"),o=n("da66");e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set,e.call(n,[]),t=n instanceof Array}catch(i){}return function(n,i){return r(n),o(i),t?e.call(n,i):n.__proto__=i,n}}():void 0)},"4d52":function(e,t,n){var r=n("f880"),o=n("9db6"),i=r("keys");e.exports=function(e){return i[e]||(i[e]=o(e))}},"4dbf":function(e,t,n){},"4eda":function(e,t,n){"use strict";t.__esModule=!0,t.PopupManager=void 0;var r=n("0261"),o=d(r),i=n("e93e"),a=d(i),s=n("7b6d"),l=d(s),u=n("e536"),c=d(u),f=n("3c84");function d(e){return e&&e.__esModule?e:{default:e}}var p=1,h=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,o.default.nextTick((function(){t.open()})))}else this.close()}},methods:{open:function(e){var t=this;this.rendered||(this.rendered=!0);var n=(0,a.default)({},this.$props||this,e);this._closeTimer&&(clearTimeout(this._closeTimer),this._closeTimer=null),clearTimeout(this._openTimer);var r=Number(n.openDelay);r>0?this._openTimer=setTimeout((function(){t._openTimer=null,t.doOpen(n)}),r):this.doOpen(n)},doOpen:function(e){if(!this.$isServer&&(!this.willOpen||this.willOpen())&&!this.opened){this._opening=!0;var t=this.$el,n=e.modal,r=e.zIndex;if(r&&(l.default.zIndex=r),n&&(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,f.hasClass)(document.body,"el-popup-parent--hidden"),this.withoutHiddenClass&&(this.bodyPaddingRight=document.body.style.paddingRight,this.computedBodyPaddingRight=parseInt((0,f.getStyle)(document.body,"paddingRight"),10)),h=(0,c.default)();var o=document.documentElement.clientHeight0&&(o||"scroll"===i)&&this.withoutHiddenClass&&(document.body.style.paddingRight=this.computedBodyPaddingRight+h+"px"),(0,f.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,f.removeClass)(document.body,"el-popup-parent--hidden")),this.withoutHiddenClass=!0}}},t.PopupManager=l.default},"4f91":function(e,t,n){"use strict";t.__esModule=!0;var r=r||{};r.Utils=r.Utils||{},r.Utils.focusFirstDescendant=function(e){for(var t=0;t=0;t--){var n=e.childNodes[t];if(r.Utils.attemptFocus(n)||r.Utils.focusLastDescendant(n))return!0}return!1},r.Utils.attemptFocus=function(e){if(!r.Utils.isFocusable(e))return!1;r.Utils.IgnoreUtilFocusChanges=!0;try{e.focus()}catch(t){}return r.Utils.IgnoreUtilFocusChanges=!1,document.activeElement===e},r.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}},r.Utils.triggerEvent=function(e,t){var n=void 0;n=/^mouse|click/.test(t)?"MouseEvents":/^key/.test(t)?"KeyboardEvent":"HTMLEvents";for(var r=document.createEvent(n),o=arguments.length,i=Array(o>2?o-2:0),a=2;al)o.f(e,n=r[l++],t[n]);return e}},5646:function(e,t,n){"use strict";var r=n("91fe"),o=n("ed51"),i=n("90a7"),a=n("4ce0"),s=n("94d7"),l=n("2ba5"),u=n("3d8a"),c=n("57c4"),f=n("e17a"),d=n("ed35"),p=n("143b"),h=p.IteratorPrototype,v=p.BUGGY_SAFARI_ITERATORS,m=c("iterator"),y="keys",g="values",b="entries",_=function(){return this};e.exports=function(e,t,n,c,p,x,w){o(n,t,c);var C,S,O,E=function(e){if(e===p&&T)return T;if(!v&&e in j)return j[e];switch(e){case y:return function(){return new n(this,e)};case g:return function(){return new n(this,e)};case b:return function(){return new n(this,e)}}return function(){return new n(this)}},k=t+" Iterator",$=!1,j=e.prototype,A=j[m]||j["@@iterator"]||p&&j[p],T=!v&&A||E(p),M="Array"==t&&j.entries||A;if(M&&(C=i(M.call(new e)),h!==Object.prototype&&C.next&&(f||i(C)===h||(a?a(C,h):"function"!=typeof C[m]&&l(C,m,_)),s(C,k,!0,!0),f&&(d[k]=_))),p==g&&A&&A.name!==g&&($=!0,T=function(){return A.call(this)}),f&&!w||j[m]===T||l(j,m,T),d[t]=T,p)if(S={values:E(g),keys:x?T:E(y),entries:E(b)},w)for(O in S)!v&&!$&&O in j||u(j,O,S[O]);else r({target:t,proto:!0,forced:v||$},S);return S}},5751:function(e,t,n){var r=n("57c4"),o=n("641d"),i=n("c223"),a=r("unscopables"),s=Array.prototype;void 0==s[a]&&i.f(s,a,{configurable:!0,value:o(null)}),e.exports=function(e){s[a][e]=!0}},"57c4":function(e,t,n){var r=n("d5dc"),o=n("f880"),i=n("f28d"),a=n("9db6"),s=n("4ccd"),l=n("4445"),u=o("wks"),c=r.Symbol,f=l?c:c&&c.withoutSetter||a;e.exports=function(e){return i(u,e)||(s&&i(c,e)?u[e]=c[e]:u[e]=f("Symbol."+e)),u[e]}},"5baf":function(e,t,n){"use strict";var r=function(e){return o(e)&&!i(e)};function o(e){return!!e&&"object"===typeof e}function i(e){var t=Object.prototype.toString.call(e);return"[object RegExp]"===t||"[object Date]"===t||l(e)}var a="function"===typeof Symbol&&Symbol.for,s=a?Symbol.for("react.element"):60103;function l(e){return e.$$typeof===s}function u(e){return Array.isArray(e)?[]:{}}function c(e,t){var n=t&&!0===t.clone;return n&&r(e)?p(u(e),e,t):e}function f(e,t,n){var o=e.slice();return t.forEach((function(t,i){"undefined"===typeof o[i]?o[i]=c(t,n):r(t)?o[i]=p(e[i],t,n):-1===e.indexOf(t)&&o.push(c(t,n))})),o}function d(e,t,n){var o={};return r(e)&&Object.keys(e).forEach((function(t){o[t]=c(e[t],n)})),Object.keys(t).forEach((function(i){r(t[i])&&e[i]?o[i]=p(e[i],t[i],n):o[i]=c(t[i],n)})),o}function p(e,t,n){var r=Array.isArray(t),o=Array.isArray(e),i=n||{arrayMerge:f},a=r===o;if(a){if(r){var s=i.arrayMerge||f;return s(e,t,n)}return d(e,t,n)}return c(t,n)}p.all=function(e,t){if(!Array.isArray(e)||e.length<2)throw new Error("first argument should be an array with at least two elements");return e.reduce((function(e,n){return p(e,n,t)}))};var h=p;e.exports=h},"5c90":function(e,t){e.exports=function(e){try{return{error:!1,value:e()}}catch(t){return{error:!0,value:t}}}},"60f8":function(e,t){e.exports=function(e,t,n,r){var o,i=0;function a(){var a=this,s=Number(new Date)-i,l=arguments;function u(){i=Number(new Date),n.apply(a,l)}function c(){o=void 0}r&&!o&&u(),o&&clearTimeout(o),void 0===r&&s>e?u():!0!==t&&(o=setTimeout(r?c:u,void 0===r?e-s:e))}return("boolean"!==typeof t&&(r=n,n=t,t=void 0),a)}},"618d":function(e,t,n){"use strict";var r=n("91fe"),o=n("e17a"),i=n("644f"),a=n("f30e"),s=n("df50"),l=n("fb8e"),u=n("4301"),c=n("3d8a"),f=!!i&&a((function(){i.prototype["finally"].call({then:function(){}},(function(){}))}));r({target:"Promise",proto:!0,real:!0,forced:f},{finally:function(e){var t=l(this,s("Promise")),n="function"==typeof e;return this.then(n?function(n){return u(t,e()).then((function(){return n}))}:e,n?function(n){return u(t,e()).then((function(){throw n}))}:e)}}),o||"function"!=typeof i||i.prototype["finally"]||c(i.prototype,"finally",s("Promise").prototype["finally"])},"623f":function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},"63ec":function(e,t,n){var r=n("60f8"),o=n("ca47");e.exports={throttle:r,debounce:o}},6406:function(e,t,n){"use strict";t.__esModule=!0,t.i18n=t.use=t.t=void 0;var r=n("83a6"),o=f(r),i=n("0261"),a=f(i),s=n("5baf"),l=f(s),u=n("88e7"),c=f(u);function f(e){return e&&e.__esModule?e:{default:e}}var d=(0,c.default)(a.default),p=o.default,h=!1,v=function(){var e=Object.getPrototypeOf(this||a.default).$t;if("function"===typeof e&&a.default.locale)return h||(h=!0,a.default.locale(a.default.config.lang,(0,l.default)(p,a.default.locale(a.default.config.lang)||{},{clone:!0}))),e.apply(this,arguments)},m=t.t=function(e,t){var n=v.apply(this,arguments);if(null!==n&&void 0!==n)return n;for(var r=e.split("."),o=p,i=0,a=r.length;i",d="<",p="prototype",h="script",v=c("IE_PROTO"),m=function(){},y=function(e){return d+h+f+e+d+"/"+h+f},g=function(e){e.write(y("")),e.close();var t=e.parentWindow.Object;return e=null,t},b=function(){var e,t=u("iframe"),n="java"+h+":";return t.style.display="none",l.appendChild(t),t.src=String(n),e=t.contentWindow.document,e.open(),e.write(y("document.F=Object")),e.close(),e.F},_=function(){try{r=document.domain&&new ActiveXObject("htmlfile")}catch(t){}_=r?g(r):b();var e=a.length;while(e--)delete _[p][a[e]];return _()};s[v]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(m[p]=o(e),n=new m,m[p]=null,n[v]=e):n=_(),void 0===t?n:i(n,t)}},"644f":function(e,t,n){var r=n("d5dc");e.exports=r.Promise},"64d6":function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=124)}({0:function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},124:function(e,t,n){"use strict";n.r(t);var r,o,i={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-1!==["dark","light","plain"].indexOf(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,n=this.tagSize,r=this.hit,o=this.effect,i=["el-tag",t?"el-tag--"+t:"",n?"el-tag--"+n:"",o?"el-tag--"+o:"",r&&"is-hit"],a=e("span",{class:i,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])}},a=i,s=n(0),l=Object(s["a"])(a,r,o,!1,null,null,null);l.options.__file="packages/tag/src/tag.vue";var u=l.exports;u.install=function(e){e.component(u.name,u)};t["default"]=u}})},"65af":function(e,t,n){var r=n("02d0"),o=n("6807"),i=o.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,i)}},"66b2":function(e,t,n){var r=n("ac83"),o=n("0532"),i=n("684e"),a=n("0b29"),s=n("e28b"),l=n("2bba"),u=function(e,t){this.stopped=e,this.result=t},c=e.exports=function(e,t,n,c,f){var d,p,h,v,m,y,g,b=a(t,n,c?2:1);if(f)d=e;else{if(p=s(e),"function"!=typeof p)throw TypeError("Target is not iterable");if(o(p)){for(h=0,v=i(e.length);v>h;h++)if(m=c?b(r(g=e[h])[0],g[1]):b(e[h]),m&&m instanceof u)return m;return new u(!1)}d=p.call(e)}y=d.next;while(!(g=y.call(d)).done)if(m=l(d,b,g.value,c),"object"==typeof m&&m&&m instanceof u)return m;return new u(!1)};c.stop=function(e){return new u(!0,e)}},"67ea":function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},6807:function(e,t){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"684e":function(e,t,n){var r=n("f240"),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},"6be9":function(e,t,n){var r=n("8c47"),o=n("684e"),i=n("0192"),a=function(e){return function(t,n,a){var s,l=r(t),u=o(l.length),c=i(a,u);if(e&&n!=n){while(u>c)if(s=l[c++],s!=s)return!0}else for(;u>c;c++)if((e||c in l)&&l[c]===n)return e||c||0;return!e&&-1}};e.exports={includes:a(!0),indexOf:a(!1)}},"6dcf":function(e,t,n){var r,o,i,a=n("d5dc"),s=n("f30e"),l=n("67ea"),u=n("0b29"),c=n("c49e"),f=n("032e"),d=n("c044"),p=a.location,h=a.setImmediate,v=a.clearImmediate,m=a.process,y=a.MessageChannel,g=a.Dispatch,b=0,_={},x="onreadystatechange",w=function(e){if(_.hasOwnProperty(e)){var t=_[e];delete _[e],t()}},C=function(e){return function(){w(e)}},S=function(e){w(e.data)},O=function(e){a.postMessage(e+"",p.protocol+"//"+p.host)};h&&v||(h=function(e){var t=[],n=1;while(arguments.length>n)t.push(arguments[n++]);return _[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},r(b),b},v=function(e){delete _[e]},"process"==l(m)?r=function(e){m.nextTick(C(e))}:g&&g.now?r=function(e){g.now(C(e))}:y&&!d?(o=new y,i=o.port2,o.port1.onmessage=S,r=u(i.postMessage,i,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||s(O)?r=x in f("script")?function(e){c.appendChild(f("script"))[x]=function(){c.removeChild(this),w(e)}}:function(e){setTimeout(C(e),0)}:(r=O,a.addEventListener("message",S,!1))),e.exports={set:h,clear:v}},"70d0":function(e,t,n){},7267:function(e,t,n){"use strict";var r=n("3d8a"),o=n("ac83"),i=n("f30e"),a=n("0618"),s="toString",l=RegExp.prototype,u=l[s],c=i((function(){return"/a/b"!=u.call({source:"a",flags:"b"})})),f=u.name!=s;(c||f)&&r(RegExp.prototype,s,(function(){var e=o(this),t=String(e.source),n=e.flags,r=String(void 0===n&&e instanceof RegExp&&!("flags"in l)?a.call(e):n);return"/"+t+"/"+r}),{unsafe:!0})},"76ab":function(e,t,n){"use strict";var r=n("2ae1"),o=n("2895"),i=10,a=40,s=800;function l(e){var t=0,n=0,r=0,o=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=t*i,o=n*i,"deltaY"in e&&(o=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||o)&&e.deltaMode&&(1==e.deltaMode?(r*=a,o*=a):(r*=s,o*=s)),r&&!t&&(t=r<1?-1:1),o&&!n&&(n=o<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:o}}l.getEventType=function(){return r.firefox()?"DOMMouseScroll":o("wheel")?"wheel":"mousewheel"},e.exports=l},"77e5":function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(r){"object"===typeof window&&(n=window)}e.exports=n},"785d":function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=75)}({0:function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},15:function(e,t){e.exports=n("4eda")},23:function(e,t){e.exports=n("bee9")},7:function(e,t){e.exports=n("0261")},75:function(e,t,n){"use strict";n.r(t);var r=n(7),o=n.n(r),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-message-fade"},on:{"after-leave":e.handleAfterLeave}},[n("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?n("i",{class:e.iconClass}):n("i",{class:e.typeClass}),e._t("default",[e.dangerouslyUseHTMLString?n("p",{staticClass:"el-message__content",domProps:{innerHTML:e._s(e.message)}}):n("p",{staticClass:"el-message__content"},[e._v(e._s(e.message))])]),e.showClose?n("i",{staticClass:"el-message__closeBtn el-icon-close",on:{click:e.close}}):e._e()],2)])},a=[];i._withStripped=!0;var s={success:"success",info:"info",warning:"warning",error:"error"},l={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-"+s[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)}},u=l,c=n(0),f=Object(c["a"])(u,i,a,!1,null,null,null);f.options.__file="packages/message/src/main.vue";var d=f.exports,p=n(15),h=n(23),v=o.a.extend(d),m=void 0,y=[],g=1,b=function e(t){if(!o.a.prototype.$isServer){t=t||{},"string"===typeof t&&(t={message:t});var n=t.onClose,r="message_"+g++;t.onClose=function(){e.close(r,n)},m=new v({data:t}),m.id=r,Object(h["isVNode"])(m.message)&&(m.$slots.default=[m.message],m.message=null),m.$mount(),document.body.appendChild(m.$el);var i=t.offset||20;return y.forEach((function(e){i+=e.$el.offsetHeight+16})),m.verticalOffset=i,m.visible=!0,m.$el.style.zIndex=p["PopupManager"].nextZIndex(),y.push(m),m}};["success","warning","info","error"].forEach((function(e){b[e]=function(t){return"string"===typeof t&&(t={message:t}),t.type=e,b(t)}})),b.close=function(e,t){for(var n=y.length,r=-1,o=void 0,i=0;iy.length-1))for(var a=r;a=0;e--)y[e].close()};var _=b;t["default"]=_}})},"7a23":function(e,t,n){var r=n("f30e");e.exports=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"7b6d":function(e,t,n){"use strict";t.__esModule=!0;var r=n("0261"),o=a(r),i=n("3c84");function a(e){return e&&e.__esModule?e:{default:e}}var s=!1,l=!1,u=void 0,c=function(){if(!o.default.prototype.$isServer){var e=d.modalDom;return e?s=!0:(s=!1,e=document.createElement("div"),d.modalDom=e,e.addEventListener("touchmove",(function(e){e.preventDefault(),e.stopPropagation()})),e.addEventListener("click",(function(){d.doOnModalClick&&d.doOnModalClick()}))),e}},f={},d={modalFade:!0,getInstance:function(e){return f[e]},register:function(e,t){e&&t&&(f[e]=t)},deregister:function(e){e&&(f[e]=null,delete f[e])},nextZIndex:function(){return d.zIndex++},modalStack:[],doOnModalClick:function(){var e=d.modalStack[d.modalStack.length-1];if(e){var t=d.getInstance(e.id);t&&t.closeOnClickModal&&t.close()}},openModal:function(e,t,n,r,a){if(!o.default.prototype.$isServer&&e&&void 0!==t){this.modalFade=a;for(var l=this.modalStack,u=0,f=l.length;u0){var r=t[t.length-1];if(r.id===e){if(r.modalClass){var o=r.modalClass.trim().split(/\s+/);o.forEach((function(e){return(0,i.removeClass)(n,e)}))}t.pop(),t.length>0&&(n.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,i.addClass)(n,"v-modal-leave"),setTimeout((function(){0===t.length&&(n.parentNode&&n.parentNode.removeChild(n),n.style.display="none",d.modalDom=void 0),(0,i.removeClass)(n,"v-modal-leave")}),200))}};Object.defineProperty(d,"zIndex",{configurable:!0,get:function(){return l||(u=u||(o.default.prototype.$ELEMENT||{}).zIndex||2e3,l=!0),u},set:function(e){u=e}});var p=function(){if(!o.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}};o.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},"7dc7":function(e,t,n){var r=n("d68d");e.exports=function(e,t){if(!r(e))return e;var n,o;if(t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!r(o=n.call(e)))return o;if(!t&&"function"==typeof(n=e.toString)&&!r(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}},"83a6":function(e,t,n){"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:"返回"},popconfirm:{confirmButtonText:"确定",cancelButtonText:"取消"}}}},8508:function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=83)}({0:function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},4:function(e,t){e.exports=n("b4e0")},83:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("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:{id:e.id}},[n("span",{staticClass:"el-checkbox__input",class:{"is-disabled":e.isDisabled,"is-checked":e.isChecked,"is-indeterminate":e.indeterminate,"is-focus":e.focus},attrs:{tabindex:!!e.indeterminate&&0,role:!!e.indeterminate&&"checkbox","aria-checked":!!e.indeterminate&&"mixed"}},[n("span",{staticClass:"el-checkbox__inner"}),e.trueLabel||e.falseLabel?n("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":e.indeterminate?"true":"false",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 n=e.model,r=t.target,o=r.checked?e.trueLabel:e.falseLabel;if(Array.isArray(n)){var i=null,a=e._i(n,i);r.checked?a<0&&(e.model=n.concat([i])):a>-1&&(e.model=n.slice(0,a).concat(n.slice(a+1)))}else e.model=o},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}}):n("input",{directives:[{name:"model",rawName:"v-model",value:e.model,expression:"model"}],staticClass:"el-checkbox__original",attrs:{type:"checkbox","aria-hidden":e.indeterminate?"true":"false",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 n=e.model,r=t.target,o=!!r.checked;if(Array.isArray(n)){var i=e.label,a=e._i(n,i);r.checked?a<0&&(e.model=n.concat([i])):a>-1&&(e.model=n.slice(0,a).concat(n.slice(a+1)))}else e.model=o},e.handleChange],focus:function(t){e.focus=!0},blur:function(t){e.focus=!1}}})]),e.$slots.default||e.label?n("span",{staticClass:"el-checkbox__label"},[e._t("default"),e.$slots.default?e._e():[e._v(e._s(e.label))]],2):e._e()])},o=[];r._withStripped=!0;var i=n(4),a=n.n(i),s={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,n=e.min;return!(!t&&!n)&&this.model.length>=t&&!this.isChecked||this.model.length<=n&&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 n=void 0;n=e.target.checked?void 0===this.trueLabel||this.trueLabel:void 0!==this.falseLabel&&this.falseLabel,this.$emit("change",n,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=s,u=n(0),c=Object(u["a"])(l,r,o,!1,null,null,null);c.options.__file="packages/checkbox/src/checkbox.vue";var f=c.exports;f.install=function(e){e.component(f.name,f)};t["default"]=f}})},8876:function(e,t,n){"use strict";(function(e){ +/** + * vuex v3.1.3 + * (c) 2020 Evan You + * @license MIT + */ +function n(e){var t=Number(e.version.split(".")[0]);if(t>=2)e.mixin({beforeCreate:r});else{var n=e.prototype._init;e.prototype._init=function(e){void 0===e&&(e={}),e.init=e.init?[r].concat(e.init):r,n.call(this,e)}}function r(){var e=this.$options;e.store?this.$store="function"===typeof e.store?e.store():e.store:e.parent&&e.parent.$store&&(this.$store=e.parent.$store)}}var r="undefined"!==typeof window?window:"undefined"!==typeof e?e:{},o=r.__VUE_DEVTOOLS_GLOBAL_HOOK__;function i(e){o&&(e._devtoolHook=o,o.emit("vuex:init",e),o.on("vuex:travel-to-state",(function(t){e.replaceState(t)})),e.subscribe((function(e,t){o.emit("vuex:mutation",e,t)})))}function a(e,t){Object.keys(e).forEach((function(n){return t(e[n],n)}))}function s(e){return null!==e&&"object"===typeof e}function l(e){return e&&"function"===typeof e.then}function u(e,t){return function(){return e(t)}}var c=function(e,t){this.runtime=t,this._children=Object.create(null),this._rawModule=e;var n=e.state;this.state=("function"===typeof n?n():n)||{}},f={namespaced:{configurable:!0}};f.namespaced.get=function(){return!!this._rawModule.namespaced},c.prototype.addChild=function(e,t){this._children[e]=t},c.prototype.removeChild=function(e){delete this._children[e]},c.prototype.getChild=function(e){return this._children[e]},c.prototype.update=function(e){this._rawModule.namespaced=e.namespaced,e.actions&&(this._rawModule.actions=e.actions),e.mutations&&(this._rawModule.mutations=e.mutations),e.getters&&(this._rawModule.getters=e.getters)},c.prototype.forEachChild=function(e){a(this._children,e)},c.prototype.forEachGetter=function(e){this._rawModule.getters&&a(this._rawModule.getters,e)},c.prototype.forEachAction=function(e){this._rawModule.actions&&a(this._rawModule.actions,e)},c.prototype.forEachMutation=function(e){this._rawModule.mutations&&a(this._rawModule.mutations,e)},Object.defineProperties(c.prototype,f);var d=function(e){this.register([],e,!1)};function p(e,t,n){if(t.update(n),n.modules)for(var r in n.modules){if(!t.getChild(r))return void 0;p(e.concat(r),t.getChild(r),n.modules[r])}}d.prototype.get=function(e){return e.reduce((function(e,t){return e.getChild(t)}),this.root)},d.prototype.getNamespace=function(e){var t=this.root;return e.reduce((function(e,n){return t=t.getChild(n),e+(t.namespaced?n+"/":"")}),"")},d.prototype.update=function(e){p([],this.root,e)},d.prototype.register=function(e,t,n){var r=this;void 0===n&&(n=!0);var o=new c(t,n);if(0===e.length)this.root=o;else{var i=this.get(e.slice(0,-1));i.addChild(e[e.length-1],o)}t.modules&&a(t.modules,(function(t,o){r.register(e.concat(o),t,n)}))},d.prototype.unregister=function(e){var t=this.get(e.slice(0,-1)),n=e[e.length-1];t.getChild(n).runtime&&t.removeChild(n)};var h;var v=function(e){var t=this;void 0===e&&(e={}),!h&&"undefined"!==typeof window&&window.Vue&&j(window.Vue);var n=e.plugins;void 0===n&&(n=[]);var r=e.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 d(e),this._modulesNamespaceMap=Object.create(null),this._subscribers=[],this._watcherVM=new h,this._makeLocalGettersCache=Object.create(null);var o=this,a=this,s=a.dispatch,l=a.commit;this.dispatch=function(e,t){return s.call(o,e,t)},this.commit=function(e,t,n){return l.call(o,e,t,n)},this.strict=r;var u=this._modules.root.state;_(this,u,[],this._modules.root),b(this,u),n.forEach((function(e){return e(t)}));var c=void 0!==e.devtools?e.devtools:h.config.devtools;c&&i(this)},m={state:{configurable:!0}};function y(e,t){return t.indexOf(e)<0&&t.push(e),function(){var n=t.indexOf(e);n>-1&&t.splice(n,1)}}function g(e,t){e._actions=Object.create(null),e._mutations=Object.create(null),e._wrappedGetters=Object.create(null),e._modulesNamespaceMap=Object.create(null);var n=e.state;_(e,n,[],e._modules.root,!0),b(e,n,t)}function b(e,t,n){var r=e._vm;e.getters={},e._makeLocalGettersCache=Object.create(null);var o=e._wrappedGetters,i={};a(o,(function(t,n){i[n]=u(t,e),Object.defineProperty(e.getters,n,{get:function(){return e._vm[n]},enumerable:!0})}));var s=h.config.silent;h.config.silent=!0,e._vm=new h({data:{$$state:t},computed:i}),h.config.silent=s,e.strict&&E(e),r&&(n&&e._withCommit((function(){r._data.$$state=null})),h.nextTick((function(){return r.$destroy()})))}function _(e,t,n,r,o){var i=!n.length,a=e._modules.getNamespace(n);if(r.namespaced&&(e._modulesNamespaceMap[a],e._modulesNamespaceMap[a]=r),!i&&!o){var s=k(t,n.slice(0,-1)),l=n[n.length-1];e._withCommit((function(){h.set(s,l,r.state)}))}var u=r.context=x(e,a,n);r.forEachMutation((function(t,n){var r=a+n;C(e,r,t,u)})),r.forEachAction((function(t,n){var r=t.root?n:a+n,o=t.handler||t;S(e,r,o,u)})),r.forEachGetter((function(t,n){var r=a+n;O(e,r,t,u)})),r.forEachChild((function(r,i){_(e,t,n.concat(i),r,o)}))}function x(e,t,n){var r=""===t,o={dispatch:r?e.dispatch:function(n,r,o){var i=$(n,r,o),a=i.payload,s=i.options,l=i.type;return s&&s.root||(l=t+l),e.dispatch(l,a)},commit:r?e.commit:function(n,r,o){var i=$(n,r,o),a=i.payload,s=i.options,l=i.type;s&&s.root||(l=t+l),e.commit(l,a,s)}};return Object.defineProperties(o,{getters:{get:r?function(){return e.getters}:function(){return w(e,t)}},state:{get:function(){return k(e.state,n)}}}),o}function w(e,t){if(!e._makeLocalGettersCache[t]){var n={},r=t.length;Object.keys(e.getters).forEach((function(o){if(o.slice(0,r)===t){var i=o.slice(r);Object.defineProperty(n,i,{get:function(){return e.getters[o]},enumerable:!0})}})),e._makeLocalGettersCache[t]=n}return e._makeLocalGettersCache[t]}function C(e,t,n,r){var o=e._mutations[t]||(e._mutations[t]=[]);o.push((function(t){n.call(e,r.state,t)}))}function S(e,t,n,r){var o=e._actions[t]||(e._actions[t]=[]);o.push((function(t){var o=n.call(e,{dispatch:r.dispatch,commit:r.commit,getters:r.getters,state:r.state,rootGetters:e.getters,rootState:e.state},t);return l(o)||(o=Promise.resolve(o)),e._devtoolHook?o.catch((function(t){throw e._devtoolHook.emit("vuex:error",t),t})):o}))}function O(e,t,n,r){e._wrappedGetters[t]||(e._wrappedGetters[t]=function(e){return n(r.state,r.getters,e.state,e.getters)})}function E(e){e._vm.$watch((function(){return this._data.$$state}),(function(){0}),{deep:!0,sync:!0})}function k(e,t){return t.reduce((function(e,t){return e[t]}),e)}function $(e,t,n){return s(e)&&e.type&&(n=t,t=e,e=e.type),{type:e,payload:t,options:n}}function j(e){h&&e===h||(h=e,n(h))}m.state.get=function(){return this._vm._data.$$state},m.state.set=function(e){0},v.prototype.commit=function(e,t,n){var r=this,o=$(e,t,n),i=o.type,a=o.payload,s=(o.options,{type:i,payload:a}),l=this._mutations[i];l&&(this._withCommit((function(){l.forEach((function(e){e(a)}))})),this._subscribers.slice().forEach((function(e){return e(s,r.state)})))},v.prototype.dispatch=function(e,t){var n=this,r=$(e,t),o=r.type,i=r.payload,a={type:o,payload:i},s=this._actions[o];if(s){try{this._actionSubscribers.slice().filter((function(e){return e.before})).forEach((function(e){return e.before(a,n.state)}))}catch(u){0}var l=s.length>1?Promise.all(s.map((function(e){return e(i)}))):s[0](i);return l.then((function(e){try{n._actionSubscribers.filter((function(e){return e.after})).forEach((function(e){return e.after(a,n.state)}))}catch(u){0}return e}))}},v.prototype.subscribe=function(e){return y(e,this._subscribers)},v.prototype.subscribeAction=function(e){var t="function"===typeof e?{before:e}:e;return y(t,this._actionSubscribers)},v.prototype.watch=function(e,t,n){var r=this;return this._watcherVM.$watch((function(){return e(r.state,r.getters)}),t,n)},v.prototype.replaceState=function(e){var t=this;this._withCommit((function(){t._vm._data.$$state=e}))},v.prototype.registerModule=function(e,t,n){void 0===n&&(n={}),"string"===typeof e&&(e=[e]),this._modules.register(e,t),_(this,this.state,e,this._modules.get(e),n.preserveState),b(this,this.state)},v.prototype.unregisterModule=function(e){var t=this;"string"===typeof e&&(e=[e]),this._modules.unregister(e),this._withCommit((function(){var n=k(t.state,e.slice(0,-1));h.delete(n,e[e.length-1])})),g(this)},v.prototype.hotUpdate=function(e){this._modules.update(e),g(this,!0)},v.prototype._withCommit=function(e){var t=this._committing;this._committing=!0,e(),this._committing=t},Object.defineProperties(v.prototype,m);var A=I((function(e,t){var n={};return N(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=this.$store.state,n=this.$store.getters;if(e){var r=F(this.$store,"mapState",e);if(!r)return;t=r.context.state,n=r.context.getters}return"function"===typeof o?o.call(this,t,n):t[o]},n[r].vuex=!0})),n})),T=I((function(e,t){var n={};return N(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var r=this.$store.commit;if(e){var i=F(this.$store,"mapMutations",e);if(!i)return;r=i.context.commit}return"function"===typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n})),M=I((function(e,t){var n={};return N(t).forEach((function(t){var r=t.key,o=t.val;o=e+o,n[r]=function(){if(!e||F(this.$store,"mapGetters",e))return this.$store.getters[o]},n[r].vuex=!0})),n})),P=I((function(e,t){var n={};return N(t).forEach((function(t){var r=t.key,o=t.val;n[r]=function(){var t=[],n=arguments.length;while(n--)t[n]=arguments[n];var r=this.$store.dispatch;if(e){var i=F(this.$store,"mapActions",e);if(!i)return;r=i.context.dispatch}return"function"===typeof o?o.apply(this,[r].concat(t)):r.apply(this.$store,[o].concat(t))}})),n})),L=function(e){return{mapState:A.bind(null,e),mapGetters:M.bind(null,e),mapMutations:T.bind(null,e),mapActions:P.bind(null,e)}};function N(e){return R(e)?Array.isArray(e)?e.map((function(e){return{key:e,val:e}})):Object.keys(e).map((function(t){return{key:t,val:e[t]}})):[]}function R(e){return Array.isArray(e)||s(e)}function I(e){return function(t,n){return"string"!==typeof t?(n=t,t=""):"/"!==t.charAt(t.length-1)&&(t+="/"),e(t,n)}}function F(e,t,n){var r=e._modulesNamespaceMap[n];return r}var H={Store:v,install:j,version:"3.1.3",mapState:A,mapMutations:T,mapGetters:M,mapActions:P,createNamespacedHelpers:L};t["a"]=H}).call(this,n("77e5"))},"88b4":function(e,t,n){var r=n("7a23"),o=n("f30e"),i=n("032e");e.exports=!r&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},"88e7":function(e,t,n){"use strict";t.__esModule=!0;var r="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.default=function(e){function t(e){for(var t=arguments.length,n=Array(t>1?t-1:0),a=1;a1&&void 0!==arguments[1]?arguments[1]:1,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;u||(u=document.createElement("textarea"),document.body.appendChild(u));var r=d(e),o=r.paddingSize,i=r.borderSize,a=r.boxSizing,s=r.contextStyle;u.setAttribute("style",s+";"+c),u.value=e.value||e.placeholder||"";var l=u.scrollHeight,f={};"border-box"===a?l+=i:"content-box"===a&&(l-=o),u.value="";var p=u.scrollHeight-o;if(null!==t){var h=p*t;"border-box"===a&&(h=h+o+i),l=Math.max(h,l),f.minHeight=h+"px"}if(null!==n){var v=p*n;"border-box"===a&&(v=v+o+i),l=Math.min(v,l)}return f.height=l+"px",u.parentNode&&u.parentNode.removeChild(u),u=null,f}var h=n(9),v=n.n(h),m=n(21),y={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 v()({},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 n=e.minRows,r=e.maxRows;this.textareaCalcStyle=p(this.$refs.textarea,n,r)}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},handleCompositionUpdate:function(e){var t=e.target.value,n=t[t.length-1]||"";this.isComposing=!Object(m["isKorean"])(n)},handleCompositionEnd:function(e){this.isComposing&&(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 n=null,r=0;r-1?"center "+n:n+" center"}},appendArrow:function(e){var t=void 0;if(!this.appended){for(var n in this.appended=!0,e.attributes)if(/^_v-/.test(e.attributes[n].name)){t=e.attributes[n].name;break}var r=document.createElement("div");t&&r.setAttribute(t,""),r.setAttribute("x-arrow",""),r.className="popper__arrow",e.appendChild(r)}}},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)}}},"9db6":function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++n+r).toString(36)}},"9fe6":function(e,t,n){"use strict";t.__esModule=!0,t.removeResizeListener=t.addResizeListener=void 0;var r=n("0655"),o=i(r);function i(e){return e&&e.__esModule?e:{default:e}}var a="undefined"===typeof window,s=function(e){var t=e,n=Array.isArray(t),r=0;for(t=n?t:t[Symbol.iterator]();;){var o;if(n){if(r>=t.length)break;o=t[r++]}else{if(r=t.next(),r.done)break;o=r.value}var i=o,a=i.target.__resizeListeners__||[];a.length&&a.forEach((function(e){e()}))}};t.addResizeListener=function(e,t){a||(e.__resizeListeners__||(e.__resizeListeners__=[],e.__ro__=new o.default(s),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())}},a406:function(e,t,n){var r=n("df50");e.exports=r("navigator","userAgent")||""},a464:function(e,t,n){},a7d9:function(e,t,n){var r=n("d5dc");e.exports=function(e,t){var n=r.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}},a867:function(e,t,n){"use strict";var r=n("df50"),o=n("c223"),i=n("57c4"),a=n("7a23"),s=i("species");e.exports=function(e){var t=r(e),n=o.f;a&&t&&!t[s]&&n(t,s,{configurable:!0,get:function(){return this}})}},a9f2:function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e}},ab77:function(e,t,n){},ac83:function(e,t,n){var r=n("d68d");e.exports=function(e){if(!r(e))throw TypeError(String(e)+" is not an object");return e}},aec8:function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},b3d4:function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=110)}({0:function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},110:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"el-breadcrumb",attrs:{"aria-label":"Breadcrumb",role:"navigation"}},[e._t("default")],2)},o=[];r._withStripped=!0;var i={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")}},a=i,s=n(0),l=Object(s["a"])(a,r,o,!1,null,null,null);l.options.__file="packages/breadcrumb/src/breadcrumb.vue";var u=l.exports;u.install=function(e){e.component(u.name,u)};t["default"]=u}})},b3d8:function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=56)}([function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},,function(e,t){e.exports=n("3c84")},function(e,t){e.exports=n("d41f")},,function(e,t){e.exports=n("9bb9")},function(e,t){e.exports=n("1f4f")},function(e,t){e.exports=n("0261")},function(e,t,n){"use strict";n.d(t,"b",(function(){return i})),n.d(t,"i",(function(){return s})),n.d(t,"d",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"c",(function(){return c})),n.d(t,"g",(function(){return f})),n.d(t,"f",(function(){return d})),n.d(t,"h",(function(){return h})),n.d(t,"l",(function(){return v})),n.d(t,"k",(function(){return m})),n.d(t,"j",(function(){return y})),n.d(t,"a",(function(){return g})),n.d(t,"m",(function(){return b})),n.d(t,"n",(function(){return _}));var r=n(3),o="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},i=function(e){var t=e.target;while(t&&"HTML"!==t.tagName.toUpperCase()){if("TD"===t.tagName.toUpperCase())return t;t=t.parentNode}return null},a=function(e){return null!==e&&"object"===("undefined"===typeof e?"undefined":o(e))},s=function(e,t,n,o,i){if(!t&&!o&&(!i||Array.isArray(i)&&!i.length))return e;n="string"===typeof n?"descending"===n?-1:1:n&&n<0?-1:1;var s=o?null:function(n,o){return i?(Array.isArray(i)||(i=[i]),i.map((function(t){return"string"===typeof t?Object(r["getValueByPath"])(n,t):t(n,o,e)}))):("$key"!==t&&a(n)&&"$value"in n&&(n=n.$value),[a(n)?Object(r["getValueByPath"])(n,t):n])},l=function(e,t){if(o)return o(e.value,t.value);for(var n=0,r=e.key.length;nt.key[n])return 1}return 0};return e.map((function(e,t){return{value:e,index:t,key:s?s(e,t):null}})).sort((function(e,t){var r=l(e,t);return r||(r=e.index-t.index),r*n})).map((function(e){return e.value}))},l=function(e,t){var n=null;return e.columns.forEach((function(e){e.id===t&&(n=e)})),n},u=function(e,t){for(var n=null,r=0;r2&&void 0!==arguments[2]?arguments[2]:"children",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hasChildren",o=function(e){return!(Array.isArray(e)&&e.length)};function i(e,a,s){t(e,a,s),a.forEach((function(e){if(e[r])t(e,null,s+1);else{var a=e[n];o(a)||i(e,a,s+1)}}))}e.forEach((function(e){if(e[r])t(e,null,0);else{var a=e[n];o(a)||i(e,a,0)}}))}},function(e,t){e.exports=n("e93e")},,function(e,t){e.exports=n("1932")},function(e,t){e.exports=n("b451")},,function(e,t){e.exports=n("8afa")},function(e,t){e.exports=n("4eda")},function(e,t){e.exports=n("9fe6")},function(e,t){e.exports=n("ca47")},function(e,t){e.exports=n("8508")},,,,,,,,,,,function(e,t){e.exports=n("df62")},,,,,,,,,,function(e,t){e.exports=n("e536")},function(e,t){e.exports=n("4fd9")},,,function(e,t){e.exports=n("63ec")},,,function(e,t){e.exports=n("546a")},,,,,,,,,,function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("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)}}},[n("div",{ref:"hiddenColumns",staticClass:"hidden-columns"},[e._t("default")],2),e.showHeader?n("div",{directives:[{name:"mousewheel",rawName:"v-mousewheel",value:e.handleHeaderFooterMousewheel,expression:"handleHeaderFooterMousewheel"}],ref:"headerWrapper",staticClass:"el-table__header-wrapper"},[n("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(),n("div",{ref:"bodyWrapper",staticClass:"el-table__body-wrapper",class:[e.layout.scrollX?"is-scrolling-"+e.scrollPosition:"is-scrolling-none"],style:[e.bodyHeight]},[n("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():n("div",{ref:"emptyBlock",staticClass:"el-table__empty-block",style:e.emptyBlockStyle},[n("span",{staticClass:"el-table__empty-text"},[e._t("empty",[e._v(e._s(e.emptyText||e.t("el.table.emptyText")))])],2)]),e.$slots.append?n("div",{ref:"appendWrapper",staticClass:"el-table__append-wrapper"},[e._t("append")],2):e._e()],1),e.showSummary?n("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"},[n("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?n("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?n("div",{ref:"fixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[n("table-header",{ref:"fixedTableHeader",style:{width:e.bodyWidth},attrs:{fixed:"left",border:e.border,store:e.store}})],1):e._e(),n("div",{ref:"fixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:e.layout.headerHeight+"px"},e.fixedBodyHeight]},[n("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?n("div",{staticClass:"el-table__append-gutter",style:{height:e.layout.appendHeight+"px"}}):e._e()],1),e.showSummary?n("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"},[n("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?n("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?n("div",{ref:"rightFixedHeaderWrapper",staticClass:"el-table__fixed-header-wrapper"},[n("table-header",{ref:"rightFixedTableHeader",style:{width:e.bodyWidth},attrs:{fixed:"right",border:e.border,store:e.store}})],1):e._e(),n("div",{ref:"rightFixedBodyWrapper",staticClass:"el-table__fixed-body-wrapper",style:[{top:e.layout.headerHeight+"px"},e.fixedBodyHeight]},[n("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}}),e.$slots.append?n("div",{staticClass:"el-table__append-gutter",style:{height:e.layout.appendHeight+"px"}}):e._e()],1),e.showSummary?n("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"},[n("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?n("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(),n("div",{directives:[{name:"show",rawName:"v-show",value:e.resizeProxyVisible,expression:"resizeProxyVisible"}],ref:"resizeProxy",staticClass:"el-table__column-resize-proxy"})])},o=[];r._withStripped=!0;var i=n(18),a=n.n(i),s=n(43),l=n(16),u=n(46),c=n.n(u),f="undefined"!==typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>-1,d=function(e,t){e&&e.addEventListener&&e.addEventListener(f?"DOMMouseScroll":"mousewheel",(function(e){var n=c()(e);t&&t.apply(this,[e,n])}))},p={bind:function(e,t){d(e,t.value)}},h=n(6),v=n.n(h),m=n(11),y=n.n(m),g=n(7),b=n.n(g),_=n(9),x=n.n(_),w=n(8),C={data:function(){return{states:{defaultExpandAll:!1,expandRows:[]}}},methods:{updateExpandRows:function(){var e=this.states,t=e.data,n=void 0===t?[]:t,r=e.rowKey,o=e.defaultExpandAll,i=e.expandRows;if(o)this.states.expandRows=n.slice();else if(r){var a=Object(w["f"])(i,r);this.states.expandRows=n.reduce((function(e,t){var n=Object(w["g"])(t,r),o=a[n];return o&&e.push(t),e}),[])}else this.states.expandRows=[]},toggleRowExpansion:function(e,t){var n=Object(w["m"])(this.states.expandRows,e,t);n&&(this.table.$emit("expand-change",e,this.states.expandRows.slice()),this.scheduleLayout())},setExpandRowKeys:function(e){this.assertRowKey();var t=this.states,n=t.data,r=t.rowKey,o=Object(w["f"])(n,r);this.states.expandRows=e.reduce((function(e,t){var n=o[t];return n&&e.push(n.row),e}),[])},isRowExpanded:function(e){var t=this.states,n=t.expandRows,r=void 0===n?[]:n,o=t.rowKey;if(o){var i=Object(w["f"])(r,o);return!!i[Object(w["g"])(e,o)]}return-1!==r.indexOf(e)}}},S=n(3),O={data:function(){return{states:{_currentRowKey:null,currentRow:null}}},methods:{setCurrentRowKey:function(e){this.assertRowKey(),this.states._currentRowKey=e,this.setCurrentRowByKey(e)},restoreCurrentRowKey:function(){this.states._currentRowKey=null},setCurrentRowByKey:function(e){var t=this.states,n=t.data,r=void 0===n?[]:n,o=t.rowKey,i=null;o&&(i=Object(S["arrayFind"])(r,(function(t){return Object(w["g"])(t,o)===e}))),t.currentRow=i},updateCurrentRow:function(e){var t=this.states,n=this.table,r=t.currentRow;if(e&&e!==r)return t.currentRow=e,void n.$emit("current-change",e,r);!e&&r&&(t.currentRow=null,n.$emit("current-change",null,r))},updateCurrentRowData:function(){var e=this.states,t=this.table,n=e.rowKey,r=e._currentRowKey,o=e.data||[],i=e.currentRow;if(-1===o.indexOf(i)&&i){if(n){var a=Object(w["g"])(i,n);this.setCurrentRowByKey(a)}else e.currentRow=null;null===e.currentRow&&t.$emit("current-change",null,i)}else r&&(this.setCurrentRowByKey(r),this.restoreCurrentRowKey())}}},E=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 n=t.filter((function(e){return!e.fixed}));e.originColumns=[].concat(e.fixedColumns).concat(n).concat(e.rightFixedColumns);var r=j(n),o=j(e.fixedColumns),i=j(e.rightFixedColumns);e.leafColumnsLength=r.length,e.fixedLeafColumnsLength=o.length,e.rightFixedLeafColumnsLength=i.length,e.columns=[].concat(o).concat(r).concat(i),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,n=void 0===t?[]:t;return n.indexOf(e)>-1},clearSelection:function(){var e=this.states;e.isAllSelected=!1;var t=e.selection;t.length&&(e.selection=[],this.table.$emit("selection-change",[]))},cleanSelection:function(){var e=this.states,t=e.data,n=e.rowKey,r=e.selection,o=void 0;if(n){o=[];var i=Object(w["f"])(r,n),a=Object(w["f"])(t,n);for(var s in i)i.hasOwnProperty(s)&&!a[s]&&o.push(i[s].row)}else o=r.filter((function(e){return-1===t.indexOf(e)}));if(o.length){var l=r.filter((function(e){return-1===o.indexOf(e)}));e.selection=l,this.table.$emit("selection-change",l.slice())}},toggleRowSelection:function(e,t){var n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=Object(w["m"])(this.states.selection,e,t);if(r){var o=(this.states.selection||[]).slice();n&&this.table.$emit("select",o,e),this.table.$emit("selection-change",o)}},_toggleAllSelection:function(){var e=this.states,t=e.data,n=void 0===t?[]:t,r=e.selection,o=e.selectOnIndeterminate?!e.isAllSelected:!(e.isAllSelected||r.length);e.isAllSelected=o;var i=!1;n.forEach((function(t,n){e.selectable?e.selectable.call(null,t,n)&&Object(w["m"])(r,t,o)&&(i=!0):Object(w["m"])(r,t,o)&&(i=!0)})),i&&this.table.$emit("selection-change",r?r.slice():[]),this.table.$emit("select-all",r)},updateSelectionByRowKey:function(){var e=this.states,t=e.selection,n=e.rowKey,r=e.data,o=Object(w["f"])(t,n);r.forEach((function(e){var r=Object(w["g"])(e,n),i=o[r];i&&(t[i.index]=e)}))},updateAllSelected:function(){var e=this.states,t=e.selection,n=e.rowKey,r=e.selectable,o=e.data||[];if(0!==o.length){var i=void 0;n&&(i=Object(w["f"])(t,n));for(var a=function(e){return i?!!i[Object(w["g"])(e,n)]:-1!==t.indexOf(e)},s=!0,l=0,u=0,c=o.length;u1?n-1:0),o=1;o1&&void 0!==arguments[1]?arguments[1]:{};if(!e)throw new Error("Table is required.");var n=new T;return n.table=e,n.toggleAllSelection=P()(10,n._toggleAllSelection),Object.keys(t).forEach((function(e){n.states[e]=t[e]})),n}function N(e){var t={};return Object.keys(e).forEach((function(n){var r=e[n],o=void 0;"string"===typeof r?o=function(){return this.store.states[r]}:"function"===typeof r?o=function(){return r.call(this,this.store.states)}:console.error("invalid value type"),o&&(t[n]=o)})),t}var R=n(39),I=n.n(R);function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var H=function(){function e(t){for(var n in F(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=I()(),t)t.hasOwnProperty(n)&&(this[n]=t[n]);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)return!1;var t=this.table.bodyWrapper;if(this.table.$el&&t){var n=t.querySelector(".el-table__body"),r=this.scrollY,o=n.offsetHeight>this.bodyHeight;return this.scrollY=o,r!==o}return!1},e.prototype.setHeight=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"height";if(!b.a.prototype.$isServer){var r=this.table.$el;if(e=Object(w["j"])(e),this.height=e,!r&&(e||0===e))return b.a.nextTick((function(){return t.setHeight(e,n)}));"number"===typeof e?(r.style[n]=e+"px",this.updateElsHeight()):"string"===typeof e&&(r.style[n]=e,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 b.a.nextTick((function(){return e.updateElsHeight()}));var t=this.table.$refs,n=t.headerWrapper,r=t.appendWrapper,o=t.footerWrapper;if(this.appendHeight=r?r.offsetHeight:0,!this.showHeader||n){var i=n?n.querySelector(".el-table__header tr"):null,a=this.headerDisplayNone(i),s=this.headerHeight=this.showHeader?n.offsetHeight:0;if(this.showHeader&&!a&&n.offsetWidth>0&&(this.table.columns||[]).length>0&&s<2)return b.a.nextTick((function(){return e.updateElsHeight()}));var l=this.tableHeight=this.table.$el.clientHeight,u=this.footerHeight=o?o.offsetHeight:0;null!==this.height&&(this.bodyHeight=l-s-u+(o?1:0)),this.fixedBodyHeight=this.scrollX?this.bodyHeight-this.gutterWidth:this.bodyHeight;var c=!(this.store.states.data&&this.store.states.data.length);this.viewportHeight=this.scrollX?l-(c?0:this.gutterWidth):l,this.updateScrollY(),this.notifyObservers("scrollable")}},e.prototype.headerDisplayNone=function(e){if(!e)return!0;var t=e;while("DIV"!==t.tagName){if("none"===getComputedStyle(t).display)return!0;t=t.parentElement}return!1},e.prototype.updateColumnsWidth=function(){if(!b.a.prototype.$isServer){var e=this.fit,t=this.table.$el.clientWidth,n=0,r=this.getFlattenColumns(),o=r.filter((function(e){return"number"!==typeof e.width}));if(r.forEach((function(e){"number"===typeof e.width&&e.realWidth&&(e.realWidth=null)})),o.length>0&&e){r.forEach((function(e){n+=e.width||e.minWidth||80}));var i=this.scrollY?this.gutterWidth:0;if(n<=t-i){this.scrollX=!1;var a=t-i-n;if(1===o.length)o[0].realWidth=(o[0].minWidth||80)+a;else{var s=o.reduce((function(e,t){return e+(t.minWidth||80)}),0),l=a/s,u=0;o.forEach((function(e,t){if(0!==t){var n=Math.floor((e.minWidth||80)*l);u+=n,e.realWidth=(e.minWidth||80)+n}})),o[0].realWidth=(o[0].minWidth||80)+a-u}}else this.scrollX=!0,o.forEach((function(e){e.realWidth=e.minWidth}));this.bodyWidth=Math.max(n,t),this.table.resizeState.width=this.bodyWidth}else r.forEach((function(e){e.width||e.minWidth?e.realWidth=e.width||e.minWidth:e.realWidth=80,n+=e.realWidth})),this.scrollX=n>t,this.bodyWidth=n;var c=this.store.states.fixedColumns;if(c.length>0){var f=0;c.forEach((function(e){f+=e.realWidth||e.width})),this.fixedWidth=f}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,n=this.observers;n.forEach((function(n){switch(e){case"columns":n.onColumnsChange(t);break;case"scrollable":n.onScrollableChange(t);break;default:throw new Error("Table Layout don't have event "+e+".")}}))},e}(),z=H,D=n(2),B=n(29),W=n.n(B),V={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(e){var t=this.$el.querySelectorAll("colgroup > col");if(t.length){var n=e.getFlattenColumns(),r={};n.forEach((function(e){r[e.id]=e}));for(var o=0,i=t.length;o col[name=gutter]"),n=0,r=t.length;n=this.leftFixedLeafCount:"right"===this.fixed?e=this.columnsCount-this.rightFixedLeafCount},getSpan:function(e,t,n,r){var o=1,i=1,a=this.table.spanMethod;if("function"===typeof a){var s=a({row:e,column:t,rowIndex:n,columnIndex:r});Array.isArray(s)?(o=s[0],i=s[1]):"object"===("undefined"===typeof s?"undefined":U(s))&&(o=s.rowspan,i=s.colspan)}return{rowspan:o,colspan:i}},getRowStyle:function(e,t){var n=this.table.rowStyle;return"function"===typeof n?n.call(null,{row:e,rowIndex:t}):n||null},getRowClass:function(e,t){var n=["el-table__row"];this.table.highlightCurrentRow&&e===this.store.states.currentRow&&n.push("current-row"),this.stripe&&t%2===1&&n.push("el-table__row--striped");var r=this.table.rowClassName;return"string"===typeof r?n.push(r):"function"===typeof r&&n.push(r.call(null,{row:e,rowIndex:t})),this.store.states.expandRows.indexOf(e)>-1&&n.push("expanded"),n},getCellStyle:function(e,t,n,r){var o=this.table.cellStyle;return"function"===typeof o?o.call(null,{rowIndex:e,columnIndex:t,row:n,column:r}):o},getCellClass:function(e,t,n,r){var o=[r.id,r.align,r.className];this.isColumnHidden(t)&&o.push("is-hidden");var i=this.table.cellClassName;return"string"===typeof i?o.push(i):"function"===typeof i&&o.push(i.call(null,{rowIndex:e,columnIndex:t,row:n,column:r})),o.join(" ")},getColspanRealWidth:function(e,t,n){if(t<1)return e[n].realWidth;var r=e.map((function(e){var t=e.realWidth;return t})).slice(n,n+t);return r.reduce((function(e,t){return e+t}),-1)},handleCellMouseEnter:function(e,t){var n=this.table,r=Object(w["b"])(e);if(r){var o=Object(w["c"])(n,r),i=n.hoverState={cell:r,column:o,row:t};n.$emit("cell-mouse-enter",i.row,i.column,i.cell,e)}var a=e.target.querySelector(".cell");if(Object(D["hasClass"])(a,"el-tooltip")&&a.childNodes.length){var s=document.createRange();s.setStart(a,0),s.setEnd(a,a.childNodes.length);var l=s.getBoundingClientRect().width,u=(parseInt(Object(D["getStyle"])(a,"paddingLeft"),10)||0)+(parseInt(Object(D["getStyle"])(a,"paddingRight"),10)||0);if((l+u>a.offsetWidth||a.scrollWidth>a.offsetWidth)&&this.$refs.tooltip){var c=this.$refs.tooltip;this.tooltipContent=r.innerText||r.textContent,c.referenceElm=r,c.$refs.popper&&(c.$refs.popper.style.display="none"),c.doDestroy(),c.setExpectedState(!0),this.activateTooltip(c)}}},handleCellMouseLeave:function(e){var t=this.$refs.tooltip;t&&(t.setExpectedState(!1),t.handleClosePopper());var n=Object(w["b"])(e);if(n){var r=this.table.hoverState||{};this.table.$emit("cell-mouse-leave",r.row,r.column,r.cell,e)}},handleMouseEnter:P()(30,(function(e){this.store.commit("setHoverRow",e)})),handleMouseLeave:P()(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,n){var r=this.table,o=Object(w["b"])(e),i=void 0;o&&(i=Object(w["c"])(r,o),i&&r.$emit("cell-"+n,t,i,o,e)),r.$emit("row-"+n,t,i,e)},rowRender:function(e,t,n){var r=this,o=this.$createElement,i=this.treeIndent,a=this.columns,s=this.firstDefaultColumnIndex,l=a.map((function(e,t){return r.isColumnHidden(t)})),u=this.getRowClass(e,t),c=!0;n&&(u.push("el-table__row--level-"+n.level),c=n.display);var f=c?null:{display:"none"};return o("tr",{style:[f,this.getRowStyle(e,t)],class:u,key:this.getKeyOfRow(e,t),on:{dblclick:function(t){return r.handleDoubleClick(t,e)},click:function(t){return r.handleClick(t,e)},contextmenu:function(t){return r.handleContextMenu(t,e)},mouseenter:function(e){return r.handleMouseEnter(t)},mouseleave:this.handleMouseLeave}},[a.map((function(u,c){var f=r.getSpan(e,u,t,c),d=f.rowspan,p=f.colspan;if(!d||!p)return null;var h=q({},u);h.realWidth=r.getColspanRealWidth(a,p,c);var v={store:r.store,_self:r.context||r.table.$vnode.context,column:h,row:e,$index:t};return c===s&&n&&(v.treeNode={indent:n.level*i,level:n.level},"boolean"===typeof n.expanded&&(v.treeNode.expanded=n.expanded,"loading"in n&&(v.treeNode.loading=n.loading),"noLazyChildren"in n&&(v.treeNode.noLazyChildren=n.noLazyChildren))),o("td",{style:r.getCellStyle(t,c,e,u),class:r.getCellClass(t,c,e,u),attrs:{rowspan:d,colspan:p},on:{mouseenter:function(t){return r.handleCellMouseEnter(t,e)},mouseleave:r.handleCellMouseLeave}},[u.renderCell.call(r._renderProxy,r.$createElement,v,l[c])])}))])},wrappedRowRender:function(e,t){var n=this,r=this.$createElement,o=this.store,i=o.isRowExpanded,a=o.assertRowKey,s=o.states,l=s.treeData,u=s.lazyTreeNodeMap,c=s.childrenColumnName,f=s.rowKey;if(this.hasExpandColumn&&i(e)){var d=this.table.renderExpanded,p=this.rowRender(e,t);return d?[[p,r("tr",{key:"expanded-row__"+p.key},[r("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 h=Object(w["g"])(e,f),v=l[h],m=null;v&&(m={expanded:v.expanded,level:v.level,display:!0},"boolean"===typeof v.lazy&&("boolean"===typeof v.loaded&&v.loaded&&(m.noLazyChildren=!(v.children&&v.children.length)),m.loading=v.loading));var y=[this.rowRender(e,t,m)];if(v){var g=0,b=function e(r,o){r&&r.length&&o&&r.forEach((function(r){var i={display:o.display&&o.expanded,level:o.level+1},a=Object(w["g"])(r,f);if(void 0===a||null===a)throw new Error("for nested data item, row-key is required.");if(v=q({},l[a]),v&&(i.expanded=v.expanded,v.level=v.level||i.level,v.display=!(!v.expanded||!i.display),"boolean"===typeof v.lazy&&("boolean"===typeof v.loaded&&v.loaded&&(i.noLazyChildren=!(v.children&&v.children.length)),i.loading=v.loading)),g++,y.push(n.rowRender(r,t+g,i)),v){var s=u[a]||r[c];e(s,v)}}))};v.display=!0;var _=u[h]||e[c];b(_,v)}return y}return this.rowRender(e,t)}}},G=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-zoom-in-top"}},[e.multiple?n("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"},[n("div",{staticClass:"el-table-filter__content"},[n("el-scrollbar",{attrs:{"wrap-class":"el-table-filter__wrap"}},[n("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 n("el-checkbox",{key:t.value,attrs:{label:t.value}},[e._v(e._s(t.text))])})),1)],1)],1),n("div",{staticClass:"el-table-filter__bottom"},[n("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")))]),n("button",{on:{click:e.handleReset}},[e._v(e._s(e.t("el.table.resetFilter")))])])]):n("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"},[n("ul",{staticClass:"el-table-filter__list"},[n("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 n("li",{key:t.value,staticClass:"el-table-filter__list-item",class:{"is-active":e.isActive(t)},attrs:{label:t.value},on:{click:function(n){e.handleSelect(t.value)}}},[e._v(e._s(t.text))])}))],2)])])},X=[];G._withStripped=!0;var Y=n(5),J=n.n(Y),Z=n(15),Q=n(12),ee=n.n(Q),te=[];!b.a.prototype.$isServer&&document.addEventListener("click",(function(e){te.forEach((function(t){var n=e.target;t&&t.$el&&(n===t.$el||t.$el.contains(n)||t.handleOutsideClick&&t.handleOutsideClick(e))}))}));var ne={open:function(e){e&&te.push(e)},close:function(e){var t=te.indexOf(e);-1!==t&&te.splice(e,1)}},re=n(40),oe=n.n(re),ie=n(14),ae=n.n(ie),se={name:"ElTableFilterPanel",mixins:[J.a,v.a],directives:{Clickoutside:ee.a},components:{ElCheckbox:a.a,ElCheckboxGroup:oe.a,ElScrollbar:ae.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?ne.open(e):ne.close(e)}))},watch:{showPopper:function(e){!0===e&&parseInt(this.popperJS._popper.style.zIndex,10)1;return o&&(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":o,"has-gutter":this.hasGutter}]},[this._l(r,(function(n,r){return e("tr",{style:t.getHeaderRowStyle(r),class:t.getHeaderRowClass(r)},[n.map((function(o,i){return e("th",{attrs:{colspan:o.colSpan,rowspan:o.rowSpan},on:{mousemove:function(e){return t.handleMouseMove(e,o)},mouseout:t.handleMouseOut,mousedown:function(e){return t.handleMouseDown(e,o)},click:function(e){return t.handleHeaderClick(e,o)},contextmenu:function(e){return t.handleHeaderContextMenu(e,o)}},style:t.getHeaderCellStyle(r,i,n,o),class:t.getHeaderCellClass(r,i,n,o),key:o.id},[e("div",{class:["cell",o.filteredValue&&o.filteredValue.length>0?"highlight":"",o.labelClassName]},[o.renderHeader?o.renderHeader.call(t._renderProxy,e,{column:o,$index:i,store:t.store,_self:t.$parent.$vnode.context}):o.label,o.sortable?e("span",{class:"caret-wrapper",on:{click:function(e){return t.handleSortClick(e,o)}}},[e("i",{class:"sort-caret ascending",on:{click:function(e){return t.handleSortClick(e,o,"ascending")}}}),e("i",{class:"sort-caret descending",on:{click:function(e){return t.handleSortClick(e,o,"descending")}}})]):"",o.filterable?e("span",{class:"el-table__column-filter-trigger",on:{click:function(e){return t.handleFilterClick(e,o)}}},[e("i",{class:["el-icon-arrow-down",o.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:a.a},computed:de({table:function(){return this.$parent},hasGutter:function(){return!this.fixed&&this.tableLayout.gutterWidth}},N({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;this.$nextTick((function(){var t=e.defaultSort,n=t.prop,r=t.order,o=!0;e.store.commit("sort",{prop:n,order:r,init:o})}))},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 n=0,r=0;r=this.leftFixedLeafCount:"right"===this.fixed?n=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=[],n=this.table.headerRowClassName;return"string"===typeof n?t.push(n):"function"===typeof n&&t.push(n.call(null,{rowIndex:e})),t.join(" ")},getHeaderCellStyle:function(e,t,n,r){var o=this.table.headerCellStyle;return"function"===typeof o?o.call(null,{rowIndex:e,columnIndex:t,row:n,column:r}):o},getHeaderCellClass:function(e,t,n,r){var o=[r.id,r.order,r.headerAlign,r.className,r.labelClassName];0===e&&this.isCellHidden(t,n)&&o.push("is-hidden"),r.children||o.push("is-leaf"),r.sortable&&o.push("is-sortable");var i=this.table.headerCellClassName;return"string"===typeof i?o.push(i):"function"===typeof i&&o.push(i.call(null,{rowIndex:e,columnIndex:t,row:n,column:r})),o.join(" ")},toggleAllSelection:function(e){e.stopPropagation(),this.store.commit("toggleAllSelection")},handleFilterClick:function(e,t){e.stopPropagation();var n=e.target,r="TH"===n.tagName?n:n.parentNode;if(!Object(D["hasClass"])(r,"noclick")){r=r.querySelector(".el-table__column-filter-trigger")||r;var o=this.$parent,i=this.filterPanels[t.id];i&&t.filterOpened?i.showPopper=!1:(i||(i=new b.a(fe),this.filterPanels[t.id]=i,t.filterPlacement&&(i.placement=t.filterPlacement),i.table=o,i.cell=r,i.column=t,!this.$isServer&&i.$mount(document.createElement("div"))),setTimeout((function(){i.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 n=this;if(!this.$isServer&&!(t.children&&t.children.length>0)&&this.draggingColumn&&this.border){this.dragging=!0,this.$parent.resizeProxyVisible=!0;var r=this.$parent,o=r.$el,i=o.getBoundingClientRect().left,a=this.$el.querySelector("th."+t.id),s=a.getBoundingClientRect(),l=s.left-i+30;Object(D["addClass"])(a,"noclick"),this.dragState={startMouseLeft:e.clientX,startLeft:s.right-i,startColumnLeft:s.left-i,tableLeft:i};var u=r.$refs.resizeProxy;u.style.left=this.dragState.startLeft+"px",document.onselectstart=function(){return!1},document.ondragstart=function(){return!1};var c=function(e){var t=e.clientX-n.dragState.startMouseLeft,r=n.dragState.startLeft+t;u.style.left=Math.max(l,r)+"px"},f=function o(){if(n.dragging){var i=n.dragState,s=i.startColumnLeft,l=i.startLeft,f=parseInt(u.style.left,10),d=f-s;t.width=t.realWidth=d,r.$emit("header-dragend",t.width,l-s,t,e),n.store.scheduleLayout(),document.body.style.cursor="",n.dragging=!1,n.draggingColumn=null,n.dragState={},r.resizeProxyVisible=!1}document.removeEventListener("mousemove",c),document.removeEventListener("mouseup",o),document.onselectstart=null,document.ondragstart=null,setTimeout((function(){Object(D["removeClass"])(a,"noclick")}),0)};document.addEventListener("mousemove",c),document.addEventListener("mouseup",f)}},handleMouseMove:function(e,t){if(!(t.children&&t.children.length>0)){var n=e.target;while(n&&"TH"!==n.tagName)n=n.parentNode;if(t&&t.resizable&&!this.dragging&&this.border){var r=n.getBoundingClientRect(),o=document.body.style;r.width>12&&r.right-e.pageX<8?(o.cursor="col-resize",Object(D["hasClass"])(n,"is-sortable")&&(n.style.cursor="col-resize"),this.draggingColumn=t):this.dragging||(o.cursor="",Object(D["hasClass"])(n,"is-sortable")&&(n.style.cursor="pointer"),this.draggingColumn=null)}}},handleMouseOut:function(){this.$isServer||(document.body.style.cursor="")},toggleOrder:function(e){var t=e.order,n=e.sortOrders;if(""===t)return n[0];var r=n.indexOf(t||null);return n[r>n.length-2?0:r+1]},handleSortClick:function(e,t,n){e.stopPropagation();var r=t.order===n?null:n||this.toggleOrder(t),o=e.target;while(o&&"TH"!==o.tagName)o=o.parentNode;if(o&&"TH"===o.tagName&&Object(D["hasClass"])(o,"noclick"))Object(D["removeClass"])(o,"noclick");else if(t.sortable){var i=this.store.states,a=i.sortProp,s=void 0,l=i.sortingColumn;(l!==t||l===t&&null===l.order)&&(l&&(l.order=null),i.sortingColumn=t,a=t.property),s=t.order=r||null,i.sortProp=a,i.sortOrder=s,this.store.commit("changeSortCondition")}}},data:function(){return{draggingColumn:null,dragging:!1,dragState:{}}}},me=Object.assign||function(e){for(var t=1;t=this.leftFixedLeafCount;if("right"===this.fixed){for(var r=0,o=0;o=this.columnsCount-this.rightFixedCount)},getRowClasses:function(e,t){var n=[e.id,e.align,e.labelClassName];return e.className&&n.push(e.className),this.isCellHidden(t,this.columns,e)&&n.push("is-hidden"),e.children||n.push("is-leaf"),n}}},ge=Object.assign||function(e){for(var t=1;t0){var r=n.scrollTop;t.pixelY<0&&0!==r&&e.preventDefault(),t.pixelY>0&&n.scrollHeight-n.clientHeight>r&&e.preventDefault(),n.scrollTop+=Math.ceil(t.pixelY/5)}else n.scrollLeft+=Math.ceil(t.pixelX/5)},handleHeaderFooterMousewheel:function(e,t){var n=t.pixelX,r=t.pixelY;Math.abs(n)>=Math.abs(r)&&(this.bodyWrapper.scrollLeft+=t.pixelX/5)},syncPostion:Object(s["throttle"])(20,(function(){var e=this.bodyWrapper,t=e.scrollLeft,n=e.scrollTop,r=e.offsetWidth,o=e.scrollWidth,i=this.$refs,a=i.headerWrapper,s=i.footerWrapper,l=i.fixedBodyWrapper,u=i.rightFixedBodyWrapper;a&&(a.scrollLeft=t),s&&(s.scrollLeft=t),l&&(l.scrollTop=n),u&&(u.scrollTop=n);var c=o-r-1;this.scrollPosition=t>=c?"right":0===t?"left":"middle"})),bindEvents:function(){this.bodyWrapper.addEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(l["addResizeListener"])(this.$el,this.resizeListener)},unbindEvents:function(){this.bodyWrapper.removeEventListener("scroll",this.syncPostion,{passive:!0}),this.fit&&Object(l["removeResizeListener"])(this.$el,this.resizeListener)},resizeListener:function(){if(this.$ready){var e=!1,t=this.$el,n=this.resizeState,r=n.width,o=n.height,i=t.offsetWidth;r!==i&&(e=!0);var a=t.offsetHeight;(this.height||this.shouldUpdateHeight)&&o!==a&&(e=!0),e&&(this.resizeState.width=i,this.resizeState.height=a,this.doLayout())}},doLayout:function(){this.shouldUpdateHeight&&this.layout.updateElsHeight(),this.layout.updateColumnsWidth()},sort:function(e,t){this.store.commit("sort",{prop:e,order:t})},toggleAllSelection:function(){this.store.commit("toggleAllSelection")}},computed:ge({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,n=e.scrollY,r=e.gutterWidth;return t?t-(n?r:0)+"px":""},bodyHeight:function(){var e=this.layout,t=e.headerHeight,n=void 0===t?0:t,r=e.bodyHeight,o=e.footerHeight,i=void 0===o?0:o;if(this.height)return{height:r?r+"px":""};if(this.maxHeight){var a=Object(w["j"])(this.maxHeight);if("number"===typeof a)return{"max-height":a-i-(this.showHeader?n:0)+"px"}}return{}},fixedBodyHeight:function(){if(this.height)return{height:this.layout.fixedBodyHeight?this.layout.fixedBodyHeight+"px":""};if(this.maxHeight){var e=Object(w["j"])(this.maxHeight);if("number"===typeof 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":""}},emptyBlockStyle:function(){if(this.data&&this.data.length)return null;var e="100%";return this.layout.appendHeight&&(e="calc(100% - "+this.layout.appendHeight+"px)"),{width:this.bodyWidth,height:e}}},N({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:{immediate:!0,handler:function(e){this.rowKey&&this.store.setCurrentRowKey(e)}},data:{immediate:!0,handler:function(e){this.store.commit("setData",e)}},expandRowKeys:{immediate:!0,handler:function(e){e&&this.store.setExpandRowKeysAdapter(e)}}},created:function(){var e=this;this.tableId="el-table_"+be++,this.debouncedUpdateLayout=Object(s["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,n=void 0===t?"hasChildren":t,r=e.children,o=void 0===r?"children":r;this.store=L(this,{rowKey:this.rowKey,defaultExpandAll:this.defaultExpandAll,selectOnIndeterminate:this.selectOnIndeterminate,indent:this.indent,lazy:this.lazy,lazyColumnIdentifier:n,childrenColumnName:o});var i=new z({store:this.store,table:this,fit:this.fit,showHeader:this.showHeader});return{layout:i,isHidden:!1,renderExpanded:null,resizeProxyVisible:!1,resizeState:{width:null,height:null},isGroup:!1,scrollPosition:"left"}}},xe=_e,we=Object(ue["a"])(xe,r,o,!1,null,null,null);we.options.__file="packages/table/src/table.vue";var Ce=we.exports;Ce.install=function(e){e.component(Ce.name,Ce)};t["default"]=Ce}])},b41f:function(e,t,n){var r,o,i,a,s,l,u,c,f=n("d5dc"),d=n("4aef").f,p=n("67ea"),h=n("6dcf").set,v=n("c044"),m=f.MutationObserver||f.WebKitMutationObserver,y=f.process,g=f.Promise,b="process"==p(y),_=d(f,"queueMicrotask"),x=_&&_.value;x||(r=function(){var e,t;b&&(e=y.domain)&&e.exit();while(o){t=o.fn,o=o.next;try{t()}catch(n){throw o?a():i=void 0,n}}i=void 0,e&&e.enter()},b?a=function(){y.nextTick(r)}:m&&!v?(s=!0,l=document.createTextNode(""),new m(r).observe(l,{characterData:!0}),a=function(){l.data=s=!s}):g&&g.resolve?(u=g.resolve(void 0),c=u.then,a=function(){c.call(u,r)}):a=function(){h.call(f,r)}),e.exports=x||function(e){var t={fn:e,next:void 0};i&&(i.next=t),o||(o=t,a()),i=t}},b451:function(e,t,n){"use strict";t.__esModule=!0;var r=n("0261"),o=a(r),i=n("3c84");function a(e){return e&&e.__esModule?e:{default:e}}var s=[],l="@@clickoutsideContext",u=void 0,c=0;function f(e,t,n){return function(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};!(n&&n.context&&r.target&&o.target)||e.contains(r.target)||e.contains(o.target)||e===r.target||n.context.popperElm&&(n.context.popperElm.contains(r.target)||n.context.popperElm.contains(o.target))||(t.expression&&e[l].methodName&&n.context[e[l].methodName]?n.context[e[l].methodName]():e[l].bindingFn&&e[l].bindingFn())}}!o.default.prototype.$isServer&&(0,i.on)(document,"mousedown",(function(e){return u=e})),!o.default.prototype.$isServer&&(0,i.on)(document,"mouseup",(function(e){s.forEach((function(t){return t[l].documentHandler(e,u)}))})),t.default={bind:function(e,t,n){s.push(e);var r=c++;e[l]={id:r,documentHandler:f(e,t,n),methodName:t.expression,bindingFn:t.value}},update:function(e,t,n){e[l].documentHandler=f(e,t,n),e[l].methodName=t.expression,e[l].bindingFn=t.value},unbind:function(e){for(var t=s.length,n=0;n=74)&&(r=a.match(/Chrome\/(\d+)/),r&&(o=r[1]))),e.exports=o&&+o},c044:function(e,t,n){var r=n("a406");e.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},c223:function(e,t,n){var r=n("7a23"),o=n("88b4"),i=n("ac83"),a=n("7dc7"),s=Object.defineProperty;t.f=r?s:function(e,t,n){if(i(e),t=a(t,!0),i(n),o)try{return s(e,t,n)}catch(r){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},c405:function(e,t,n){},c49e:function(e,t,n){var r=n("df50");e.exports=r("document","documentElement")},c77e:function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=74)}({0:function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},2:function(e,t){e.exports=n("3c84")},3:function(e,t){e.exports=n("d41f")},5:function(e,t){e.exports=n("9bb9")},7:function(e,t){e.exports=n("0261")},74:function(e,t,n){"use strict";n.r(t);var r=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("span",[n("transition",{attrs:{name:e.transition},on:{"after-enter":e.handleAfterEnter,"after-leave":e.handleAfterLeave}},[n("div",{directives:[{name:"show",rawName:"v-show",value:!e.disabled&&e.showPopper,expression:"!disabled && showPopper"}],ref:"popper",staticClass:"el-popover el-popper",class:[e.popperClass,e.content&&"el-popover--plain"],style:{width:e.width+"px"},attrs:{role:"tooltip",id:e.tooltipId,"aria-hidden":e.disabled||!e.showPopper?"true":"false"}},[e.title?n("div",{staticClass:"el-popover__title",domProps:{textContent:e._s(e.title)}}):e._e(),e._t("default",[e._v(e._s(e.content))])],2)]),e._t("reference")],2)},o=[];r._withStripped=!0;var i=n(5),a=n.n(i),s=n(2),l=n(3),u={name:"ElPopover",mixins:[a.a],props:{trigger:{type:String,default:"click",validator:function(e){return["click","focus","hover","manual"].indexOf(e)>-1}},openDelay:{type:Number,default:0},closeDelay:{type:Number,default:200},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(l["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,n=this.popper||this.$refs.popper;!t&&this.$slots.reference&&this.$slots.reference[0]&&(t=this.referenceElm=this.$slots.reference[0].elm),t&&(Object(s["addClass"])(t,"el-popover__reference"),t.setAttribute("aria-describedby",this.tooltipId),t.setAttribute("tabindex",this.tabindex),n.setAttribute("tabindex",0),"click"!==this.trigger&&(Object(s["on"])(t,"focusin",(function(){e.handleFocus();var n=t.__vue__;n&&"function"===typeof n.focus&&n.focus()})),Object(s["on"])(n,"focusin",this.handleFocus),Object(s["on"])(t,"focusout",this.handleBlur),Object(s["on"])(n,"focusout",this.handleBlur)),Object(s["on"])(t,"keydown",this.handleKeydown),Object(s["on"])(t,"click",this.handleClick)),"click"===this.trigger?(Object(s["on"])(t,"click",this.doToggle),Object(s["on"])(document,"click",this.handleDocumentClick)):"hover"===this.trigger?(Object(s["on"])(t,"mouseenter",this.handleMouseEnter),Object(s["on"])(n,"mouseenter",this.handleMouseEnter),Object(s["on"])(t,"mouseleave",this.handleMouseLeave),Object(s["on"])(n,"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(s["on"])(t,"focusin",this.doShow),Object(s["on"])(t,"focusout",this.doClose)):(Object(s["on"])(t,"mousedown",this.doShow),Object(s["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(s["addClass"])(this.referenceElm,"focusing"),"click"!==this.trigger&&"focus"!==this.trigger||(this.showPopper=!0)},handleClick:function(){Object(s["removeClass"])(this.referenceElm,"focusing")},handleBlur:function(){Object(s["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.closeDelay?this._timer=setTimeout((function(){e.showPopper=!1}),this.closeDelay):this.showPopper=!1},handleDocumentClick:function(e){var t=this.reference||this.$refs.reference,n=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)&&n&&!n.contains(e.target)&&(this.showPopper=!1)},handleAfterEnter:function(){this.$emit("after-enter")},handleAfterLeave:function(){this.$emit("after-leave"),this.doDestroy()},cleanup:function(){(this.openDelay||this.closeDelay)&&clearTimeout(this._timer)}},destroyed:function(){var e=this.reference;Object(s["off"])(e,"click",this.doToggle),Object(s["off"])(e,"mouseup",this.doClose),Object(s["off"])(e,"mousedown",this.doShow),Object(s["off"])(e,"focusin",this.doShow),Object(s["off"])(e,"focusout",this.doClose),Object(s["off"])(e,"mousedown",this.doShow),Object(s["off"])(e,"mouseup",this.doClose),Object(s["off"])(e,"mouseleave",this.handleMouseLeave),Object(s["off"])(e,"mouseenter",this.handleMouseEnter),Object(s["off"])(document,"click",this.handleDocumentClick)}},c=u,f=n(0),d=Object(f["a"])(c,r,o,!1,null,null,null);d.options.__file="packages/popover/src/main.vue";var p=d.exports,h=function(e,t,n){var r=t.expression?t.value:t.arg,o=n.context.$refs[r];o&&(Array.isArray(o)?o[0].$refs.reference=e:o.$refs.reference=e)},v={bind:function(e,t,n){h(e,t,n)},inserted:function(e,t,n){h(e,t,n)}},m=n(7),y=n.n(m);y.a.directive("popover",v),p.install=function(e){e.directive("popover",v),e.component(p.name,p)},p.directive=v;t["default"]=p}})},c85c:function(e,t,n){var r=n("d5dc"),o=n("200e"),i="__core-js_shared__",a=r[i]||o(i,{});e.exports=a},c9db:function(e,t,n){"use strict";var r,o,i,a,s=n("91fe"),l=n("e17a"),u=n("d5dc"),c=n("df50"),f=n("644f"),d=n("3d8a"),p=n("417f"),h=n("94d7"),v=n("a867"),m=n("d68d"),y=n("a9f2"),g=n("40d4"),b=n("67ea"),_=n("527d"),x=n("66b2"),w=n("e52f"),C=n("fb8e"),S=n("6dcf").set,O=n("b41f"),E=n("4301"),k=n("a7d9"),$=n("df22"),j=n("5c90"),A=n("d0e2"),T=n("12d9"),M=n("57c4"),P=n("bf98"),L=M("species"),N="Promise",R=A.get,I=A.set,F=A.getterFor(N),H=f,z=u.TypeError,D=u.document,B=u.process,W=c("fetch"),V=$.f,U=V,q="process"==b(B),K=!!(D&&D.createEvent&&u.dispatchEvent),G="unhandledrejection",X="rejectionhandled",Y=0,J=1,Z=2,Q=1,ee=2,te=T(N,(function(){var e=_(H)!==String(H);if(!e){if(66===P)return!0;if(!q&&"function"!=typeof PromiseRejectionEvent)return!0}if(l&&!H.prototype["finally"])return!0;if(P>=51&&/native code/.test(H))return!1;var t=H.resolve(1),n=function(e){e((function(){}),(function(){}))},r=t.constructor={};return r[L]=n,!(t.then((function(){}))instanceof n)})),ne=te||!w((function(e){H.all(e)["catch"]((function(){}))})),re=function(e){var t;return!(!m(e)||"function"!=typeof(t=e.then))&&t},oe=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;O((function(){var o=t.value,i=t.state==J,a=0;while(r.length>a){var s,l,u,c=r[a++],f=i?c.ok:c.fail,d=c.resolve,p=c.reject,h=c.domain;try{f?(i||(t.rejection===ee&&le(e,t),t.rejection=Q),!0===f?s=o:(h&&h.enter(),s=f(o),h&&(h.exit(),u=!0)),s===c.promise?p(z("Promise-chain cycle")):(l=re(s))?l.call(s,d,p):d(s)):p(o)}catch(v){h&&!u&&h.exit(),p(v)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&ae(e,t)}))}},ie=function(e,t,n){var r,o;K?(r=D.createEvent("Event"),r.promise=t,r.reason=n,r.initEvent(e,!1,!0),u.dispatchEvent(r)):r={promise:t,reason:n},(o=u["on"+e])?o(r):e===G&&k("Unhandled promise rejection",n)},ae=function(e,t){S.call(u,(function(){var n,r=t.value,o=se(t);if(o&&(n=j((function(){q?B.emit("unhandledRejection",r,e):ie(G,e,r)})),t.rejection=q||se(t)?ee:Q,n.error))throw n.value}))},se=function(e){return e.rejection!==Q&&!e.parent},le=function(e,t){S.call(u,(function(){q?B.emit("rejectionHandled",e):ie(X,e,t.value)}))},ue=function(e,t,n,r){return function(o){e(t,n,o,r)}},ce=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=Z,oe(e,t,!0))},fe=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw z("Promise can't be resolved itself");var o=re(n);o?O((function(){var r={done:!1};try{o.call(n,ue(fe,e,r,t),ue(ce,e,r,t))}catch(i){ce(e,r,i,t)}})):(t.value=n,t.state=J,oe(e,t,!1))}catch(i){ce(e,{done:!1},i,t)}}};te&&(H=function(e){g(this,H,N),y(e),r.call(this);var t=R(this);try{e(ue(fe,this,t),ue(ce,this,t))}catch(n){ce(this,t,n)}},r=function(e){I(this,{type:N,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:Y,value:void 0})},r.prototype=p(H.prototype,{then:function(e,t){var n=F(this),r=V(C(this,H));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=q?B.domain:void 0,n.parent=!0,n.reactions.push(r),n.state!=Y&&oe(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),o=function(){var e=new r,t=R(e);this.promise=e,this.resolve=ue(fe,e,t),this.reject=ue(ce,e,t)},$.f=V=function(e){return e===H||e===i?new o(e):U(e)},l||"function"!=typeof f||(a=f.prototype.then,d(f.prototype,"then",(function(e,t){var n=this;return new H((function(e,t){a.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof W&&s({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return E(H,W.apply(u,arguments))}}))),s({global:!0,wrap:!0,forced:te},{Promise:H}),h(H,N,!1,!0),v(N),i=c(N),s({target:N,stat:!0,forced:te},{reject:function(e){var t=V(this);return t.reject.call(void 0,e),t.promise}}),s({target:N,stat:!0,forced:l||te},{resolve:function(e){return E(l&&this===i?H:this,e)}}),s({target:N,stat:!0,forced:ne},{all:function(e){var t=this,n=V(t),r=n.resolve,o=n.reject,i=j((function(){var n=y(t.resolve),i=[],a=0,s=1;x(e,(function(e){var l=a++,u=!1;i.push(void 0),s++,n.call(t,e).then((function(e){u||(u=!0,i[l]=e,--s||r(i))}),o)})),--s||r(i)}));return i.error&&o(i.value),n.promise},race:function(e){var t=this,n=V(t),r=n.reject,o=j((function(){var o=y(t.resolve);x(e,(function(e){o.call(t,e).then(n.resolve,r)}))}));return o.error&&r(o.value),n.promise}})},ca47:function(e,t,n){var r=n("60f8");e.exports=function(e,t,n){return void 0===n?r(e,t,!1):r(e,n,!1!==t)}},d0e2:function(e,t,n){var r,o,i,a=n("3109"),s=n("d5dc"),l=n("d68d"),u=n("2ba5"),c=n("f28d"),f=n("4d52"),d=n("4888"),p=s.WeakMap,h=function(e){return i(e)?o(e):r(e,{})},v=function(e){return function(t){var n;if(!l(t)||(n=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}};if(a){var m=new p,y=m.get,g=m.has,b=m.set;r=function(e,t){return b.call(m,e,t),t},o=function(e){return y.call(m,e)||{}},i=function(e){return g.call(m,e)}}else{var _=f("state");d[_]=!0,r=function(e,t){return u(e,_,t),t},o=function(e){return c(e,_)?e[_]:{}},i=function(e){return c(e,_)}}e.exports={set:r,get:o,has:i,enforce:h,getterFor:v}},d41f:function(e,t,n){"use strict";t.__esModule=!0,t.isEmpty=t.isEqual=t.arrayEquals=t.looseEqual=t.capitalize=t.kebabCase=t.autoprefixer=t.isFirefox=t.isEdge=t.isIE=t.coerceTruthyValueToArray=t.arrayFind=t.arrayFindIndex=t.escapeRegexpString=t.valueEquals=t.generateId=t.getValueByPath=void 0;var r="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.noop=u,t.hasOwn=c,t.toObject=d,t.getPropByPath=p,t.rafThrottle=g,t.objToArray=b;var o=n("0261"),i=s(o),a=n("22c9");function s(e){return e&&e.__esModule?e:{default:e}}var l=Object.prototype.hasOwnProperty;function u(){}function c(e,t){return l.call(e,t)}function f(e,t){for(var n in t)e[n]=t[n];return e}function d(e){for(var t={},n=0;n0&&void 0!==arguments[0]?arguments[0]:"";return String(e).replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")};var h=t.arrayFindIndex=function(e,t){for(var n=0;n!==e.length;++n)if(t(e[n]))return n;return-1},v=(t.arrayFind=function(e,t){var n=h(e,t);return-1!==n?e[n]:void 0},t.coerceTruthyValueToArray=function(e){return Array.isArray(e)?e:e?[e]:[]},t.isIE=function(){return!i.default.prototype.$isServer&&!isNaN(Number(document.documentMode))},t.isEdge=function(){return!i.default.prototype.$isServer&&navigator.userAgent.indexOf("Edge")>-1},t.isFirefox=function(){return!i.default.prototype.$isServer&&!!window.navigator.userAgent.match(/firefox/i)},t.autoprefixer=function(e){if("object"!==("undefined"===typeof e?"undefined":r(e)))return e;var t=["transform","transition","animation"],n=["ms-","webkit-"];return t.forEach((function(t){var r=e[t];t&&r&&n.forEach((function(n){e[n+t]=r}))})),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 n=(0,a.isObject)(e),r=(0,a.isObject)(t);return n&&r?JSON.stringify(e)===JSON.stringify(t):!n&&!r&&String(e)===String(t)}),m=t.arrayEquals=function(e,t){if(e=e||[],t=t||[],e.length!==t.length)return!1;for(var n=0;n=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),i.Arguments=i.Array,o("keys"),o("values"),o("entries")},da43:function(e,t,n){},da65:function(e,t,n){},da66:function(e,t,n){var r=n("d68d");e.exports=function(e){if(!r(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}},daa7:function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=77)}({0:function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},10:function(e,t){e.exports=n("9504")},13:function(e,t){e.exports=n("ec2d")},15:function(e,t){e.exports=n("4eda")},19:function(e,t){e.exports=n("6406")},2:function(e,t){e.exports=n("3c84")},23:function(e,t){e.exports=n("bee9")},47:function(e,t){e.exports=n("f0f6")},6:function(e,t){e.exports=n("1f4f")},7:function(e,t){e.exports=n("0261")},77:function(e,t,n){"use strict";n.r(t);var r=n(7),o=n.n(r),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"msgbox-fade"}},[n("div",{directives:[{name:"show",rawName:"v-show",value:e.visible,expression:"visible"}],staticClass:"el-message-box__wrapper",attrs:{tabindex:"-1",role:"dialog","aria-modal":"true","aria-label":e.title||"dialog"},on:{click:function(t){return t.target!==t.currentTarget?null:e.handleWrapperClick(t)}}},[n("div",{staticClass:"el-message-box",class:[e.customClass,e.center&&"el-message-box--center"]},[null!==e.title?n("div",{staticClass:"el-message-box__header"},[n("div",{staticClass:"el-message-box__title"},[e.icon&&e.center?n("div",{class:["el-message-box__status",e.icon]}):e._e(),n("span",[e._v(e._s(e.title))])]),e.showClose?n("button",{staticClass:"el-message-box__headerbtn",attrs:{type:"button","aria-label":"Close"},on:{click:function(t){e.handleAction(e.distinguishCancelAndClose?"close":"cancel")},keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.handleAction(e.distinguishCancelAndClose?"close":"cancel")}}},[n("i",{staticClass:"el-message-box__close el-icon-close"})]):e._e()]):e._e(),n("div",{staticClass:"el-message-box__content"},[n("div",{staticClass:"el-message-box__container"},[e.icon&&!e.center&&""!==e.message?n("div",{class:["el-message-box__status",e.icon]}):e._e(),""!==e.message?n("div",{staticClass:"el-message-box__message"},[e._t("default",[e.dangerouslyUseHTMLString?n("p",{domProps:{innerHTML:e._s(e.message)}}):n("p",[e._v(e._s(e.message))])])],2):e._e()]),n("div",{directives:[{name:"show",rawName:"v-show",value:e.showInput,expression:"showInput"}],staticClass:"el-message-box__input"},[n("el-input",{ref:"input",attrs:{type:e.inputType,placeholder:e.inputPlaceholder},nativeOn:{keydown:function(t){return"button"in t||!e._k(t.keyCode,"enter",13,t.key,"Enter")?e.handleInputEnter(t):null}},model:{value:e.inputValue,callback:function(t){e.inputValue=t},expression:"inputValue"}}),n("div",{staticClass:"el-message-box__errormsg",style:{visibility:e.editorErrorMessage?"visible":"hidden"}},[e._v(e._s(e.editorErrorMessage))])],1)]),n("div",{staticClass:"el-message-box__btns"},[e.showCancelButton?n("el-button",{class:[e.cancelButtonClasses],attrs:{loading:e.cancelButtonLoading,round:e.roundButton,size:"small"},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.handleAction("cancel")}},nativeOn:{click:function(t){e.handleAction("cancel")}}},[e._v("\n "+e._s(e.cancelButtonText||e.t("el.messagebox.cancel"))+"\n ")]):e._e(),n("el-button",{directives:[{name:"show",rawName:"v-show",value:e.showConfirmButton,expression:"showConfirmButton"}],ref:"confirm",class:[e.confirmButtonClasses],attrs:{loading:e.confirmButtonLoading,round:e.roundButton,size:"small"},on:{keydown:function(t){if(!("button"in t)&&e._k(t.keyCode,"enter",13,t.key,"Enter"))return null;e.handleAction("confirm")}},nativeOn:{click:function(t){e.handleAction("confirm")}}},[e._v("\n "+e._s(e.confirmButtonText||e.t("el.messagebox.confirm"))+"\n ")])],1)])])])},a=[];i._withStripped=!0;var s=n(15),l=n.n(s),u=n(6),c=n.n(u),f=n(10),d=n.n(f),p=n(13),h=n.n(p),v=n(2),m=n(19),y=n(47),g=n.n(y),b=void 0,_={success:"success",info:"info",warning:"warning",error:"error"},x={mixins:[l.a,c.a],props:{modal:{default:!0},lockScroll:{default:!0},showClose:{type:Boolean,default:!0},closeOnClickModal:{default:!0},closeOnPressEscape:{default:!0},closeOnHashChange:{default:!0},center:{default:!1,type:Boolean},roundButton:{default:!1,type:Boolean}},components:{ElInput:d.a,ElButton:h.a},computed:{icon:function(){var e=this.type,t=this.iconClass;return t||(e&&_[e]?"el-icon-"+_[e]:"")},confirmButtonClasses:function(){return"el-button--primary "+this.confirmButtonClass},cancelButtonClasses:function(){return""+this.cancelButtonClass}},methods:{getSafeClose:function(){var e=this,t=this.uid;return function(){e.$nextTick((function(){t===e.uid&&e.doClose()}))}},doClose:function(){var e=this;this.visible&&(this.visible=!1,this._closing=!0,this.onClose&&this.onClose(),b.closeDialog(),this.lockScroll&&setTimeout(this.restoreBodyStyle,200),this.opened=!1,this.doAfterClose(),setTimeout((function(){e.action&&e.callback(e.action,e)})))},handleWrapperClick:function(){this.closeOnClickModal&&this.handleAction(this.distinguishCancelAndClose?"close":"cancel")},handleInputEnter:function(){if("textarea"!==this.inputType)return this.handleAction("confirm")},handleAction:function(e){("prompt"!==this.$type||"confirm"!==e||this.validate())&&(this.action=e,"function"===typeof this.beforeClose?(this.close=this.getSafeClose(),this.beforeClose(e,this,this.close)):this.doClose())},validate:function(){if("prompt"===this.$type){var e=this.inputPattern;if(e&&!e.test(this.inputValue||""))return this.editorErrorMessage=this.inputErrorMessage||Object(m["t"])("el.messagebox.error"),Object(v["addClass"])(this.getInputElement(),"invalid"),!1;var t=this.inputValidator;if("function"===typeof t){var n=t(this.inputValue);if(!1===n)return this.editorErrorMessage=this.inputErrorMessage||Object(m["t"])("el.messagebox.error"),Object(v["addClass"])(this.getInputElement(),"invalid"),!1;if("string"===typeof n)return this.editorErrorMessage=n,Object(v["addClass"])(this.getInputElement(),"invalid"),!1}}return this.editorErrorMessage="",Object(v["removeClass"])(this.getInputElement(),"invalid"),!0},getFirstFocus:function(){var e=this.$el.querySelector(".el-message-box__btns .el-button"),t=this.$el.querySelector(".el-message-box__btns .el-message-box__title");return e||t},getInputElement:function(){var e=this.$refs.input.$refs;return e.input||e.textarea},handleClose:function(){this.handleAction("close")}},watch:{inputValue:{immediate:!0,handler:function(e){var t=this;this.$nextTick((function(n){"prompt"===t.$type&&null!==e&&t.validate()}))}},visible:function(e){var t=this;e&&(this.uid++,"alert"!==this.$type&&"confirm"!==this.$type||this.$nextTick((function(){t.$refs.confirm.$el.focus()})),this.focusAfterClosed=document.activeElement,b=new g.a(this.$el,this.focusAfterClosed,this.getFirstFocus())),"prompt"===this.$type&&(e?setTimeout((function(){t.$refs.input&&t.$refs.input.$el&&t.getInputElement().focus()}),500):(this.editorErrorMessage="",Object(v["removeClass"])(this.getInputElement(),"invalid")))}},mounted:function(){var e=this;this.$nextTick((function(){e.closeOnHashChange&&window.addEventListener("hashchange",e.close)}))},beforeDestroy:function(){this.closeOnHashChange&&window.removeEventListener("hashchange",this.close),setTimeout((function(){b.closeDialog()}))},data:function(){return{uid:1,title:void 0,message:"",type:"",iconClass:"",customClass:"",showInput:!1,inputValue:null,inputPlaceholder:"",inputType:"text",inputPattern:null,inputValidator:null,inputErrorMessage:"",showConfirmButton:!0,showCancelButton:!1,action:"",confirmButtonText:"",cancelButtonText:"",confirmButtonLoading:!1,cancelButtonLoading:!1,confirmButtonClass:"",confirmButtonDisabled:!1,cancelButtonClass:"",editorErrorMessage:null,callback:null,dangerouslyUseHTMLString:!1,focusAfterClosed:null,isOnComposition:!1,distinguishCancelAndClose:!1}}},w=x,C=n(0),S=Object(C["a"])(w,i,a,!1,null,null,null);S.options.__file="packages/message-box/src/main.vue";var O=S.exports,E=n(9),k=n.n(E),$=n(23),j="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},A={title:null,message:"",type:"",iconClass:"",showInput:!1,showClose:!0,modalFade:!0,lockScroll:!0,closeOnClickModal:!0,closeOnPressEscape:!0,closeOnHashChange:!0,inputValue:null,inputPlaceholder:"",inputType:"text",inputPattern:null,inputValidator:null,inputErrorMessage:"",showConfirmButton:!0,showCancelButton:!1,confirmButtonPosition:"right",confirmButtonHighlight:!1,cancelButtonHighlight:!1,confirmButtonText:"",cancelButtonText:"",confirmButtonClass:"",cancelButtonClass:"",customClass:"",beforeClose:null,dangerouslyUseHTMLString:!1,center:!1,roundButton:!1,distinguishCancelAndClose:!1},T=o.a.extend(O),M=void 0,P=void 0,L=[],N=function(e){if(M){var t=M.callback;"function"===typeof t&&(P.showInput?t(P.inputValue,e):t(e)),M.resolve&&("confirm"===e?P.showInput?M.resolve({value:P.inputValue,action:e}):M.resolve(e):!M.reject||"cancel"!==e&&"close"!==e||M.reject(e))}},R=function(){P=new T({el:document.createElement("div")}),P.callback=N},I=function e(){if(P||R(),P.action="",(!P.visible||P.closeTimer)&&L.length>0){M=L.shift();var t=M.options;for(var n in t)t.hasOwnProperty(n)&&(P[n]=t[n]);void 0===t.callback&&(P.callback=N);var r=P.callback;P.callback=function(t,n){r(t,n),e()},Object($["isVNode"])(P.message)?(P.$slots.default=[P.message],P.message=null):delete P.$slots.default,["modal","showClose","closeOnClickModal","closeOnPressEscape","closeOnHashChange"].forEach((function(e){void 0===P[e]&&(P[e]=!0)})),document.body.appendChild(P.$el),o.a.nextTick((function(){P.visible=!0}))}},F=function e(t,n){if(!o.a.prototype.$isServer){if("string"===typeof t||Object($["isVNode"])(t)?(t={message:t},"string"===typeof arguments[1]&&(t.title=arguments[1])):t.callback&&!n&&(n=t.callback),"undefined"!==typeof Promise)return new Promise((function(r,o){L.push({options:k()({},A,e.defaults,t),callback:n,resolve:r,reject:o}),I()}));L.push({options:k()({},A,e.defaults,t),callback:n}),I()}};F.setDefaults=function(e){F.defaults=e},F.alert=function(e,t,n){return"object"===("undefined"===typeof t?"undefined":j(t))?(n=t,t=""):void 0===t&&(t=""),F(k()({title:t,message:e,$type:"alert",closeOnPressEscape:!1,closeOnClickModal:!1},n))},F.confirm=function(e,t,n){return"object"===("undefined"===typeof t?"undefined":j(t))?(n=t,t=""):void 0===t&&(t=""),F(k()({title:t,message:e,$type:"confirm",showCancelButton:!0},n))},F.prompt=function(e,t,n){return"object"===("undefined"===typeof t?"undefined":j(t))?(n=t,t=""):void 0===t&&(t=""),F(k()({title:t,message:e,showCancelButton:!0,showInput:!0,$type:"prompt"},n))},F.close=function(){P.doClose(),P.visible=!1,L=[],M=null};var H=F;t["default"]=H},9:function(e,t){e.exports=n("e93e")}})},de3e:function(e,t,n){var r=n("91fe"),o=n("e045");r({target:"Object",stat:!0,forced:Object.assign!==o},{assign:o})},df22:function(e,t,n){"use strict";var r=n("a9f2"),o=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=r(t),this.reject=r(n)};e.exports.f=function(e){return new o(e)}},df50:function(e,t,n){var r=n("2a2f"),o=n("d5dc"),i=function(e){return"function"==typeof e?e:void 0};e.exports=function(e,t){return arguments.length<2?i(r[e])||i(o[e]):r[e]&&r[e][t]||o[e]&&o[e][t]}},df62:function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=131)}({131:function(e,t,n){"use strict";n.r(t);var r=n(5),o=n.n(r),i=n(17),a=n.n(i),s=n(2),l=n(3),u=n(7),c=n.n(u),f={name:"ElTooltip",mixins:[o.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(l["generateId"])(),timeoutPending:null,focusing:!1}},beforeCreate:function(){var e=this;this.$isServer||(this.popperVM=new c.a({data:{node:""},render:function(e){return this.node}}).$mount(),this.debounceClose=a()(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 n=this.getFirstElement();if(!n)return null;var r=n.data=n.data||{};return r.staticClass=this.addTooltipClass(r.staticClass),n},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(s["on"])(this.referenceElm,"mouseenter",this.show),Object(s["on"])(this.referenceElm,"mouseleave",this.hide),Object(s["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(s["on"])(this.referenceElm,"blur",this.handleBlur),Object(s["on"])(this.referenceElm,"click",this.removeFocusing)),this.value&&this.popperVM&&this.popperVM.$nextTick((function(){e.value&&e.updatePopper()}))},watch:{focusing:function(e){e?Object(s["addClass"])(this.referenceElm,"focusing"):Object(s["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,n=0;nc){var p,h=u(arguments[c++]),v=f?i(h).concat(f(h)):i(h),m=v.length,y=0;while(m>y)p=v[y++],r&&!d.call(h,p)||(n[p]=h[p])}return n}:c},e17a:function(e,t){e.exports=!1},e28b:function(e,t,n){var r=n("9552"),o=n("ed35"),i=n("57c4"),a=i("iterator");e.exports=function(e){if(void 0!=e)return e[a]||e["@@iterator"]||o[r(e)]}},e3b4:function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=118)}({0:function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},118:function(e,t,n){"use strict";n.r(t);var r=function(e,t){var n=t._c;return n("div",t._g(t._b({class:[t.data.staticClass,"el-divider","el-divider--"+t.props.direction]},"div",t.data.attrs,!1),t.listeners),[t.slots().default&&"vertical"!==t.props.direction?n("div",{class:["el-divider__text","is-"+t.props.contentPosition]},[t._t("default")],2):t._e()])},o=[];r._withStripped=!0;var i={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)}}}},a=i,s=n(0),l=Object(s["a"])(a,r,o,!0,null,null,null);l.options.__file="packages/divider/src/main.vue";var u=l.exports;u.install=function(e){e.component(u.name,u)};t["default"]=u}})},e52f:function(e,t,n){var r=n("57c4"),o=r("iterator"),i=!1;try{var a=0,s={next:function(){return{done:!!a++}},return:function(){i=!0}};s[o]=function(){return this},Array.from(s,(function(){throw 2}))}catch(l){}e.exports=function(e,t){if(!t&&!i)return!1;var n=!1;try{var r={};r[o]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(l){}return n}},e536:function(e,t,n){"use strict";t.__esModule=!0,t.default=function(){if(o.default.prototype.$isServer)return 0;if(void 0!==a)return a;var e=document.createElement("div");e.className="el-scrollbar__wrap",e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);var t=e.offsetWidth;e.style.overflow="scroll";var n=document.createElement("div");n.style.width="100%",e.appendChild(n);var r=n.offsetWidth;return e.parentNode.removeChild(e),a=t-r,a};var r=n("0261"),o=i(r);function i(e){return e&&e.__esModule?e:{default:e}}var a=void 0},e628:function(e,t,n){var r=n("df50"),o=n("65af"),i=n("1072"),a=n("ac83");e.exports=r("Reflect","ownKeys")||function(e){var t=o.f(a(e)),n=i.f;return n?t.concat(n(e)):t}},e93b:function(e,t,n){e.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/dist/",n(n.s=68)}({0:function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){var l,u="function"===typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=n,u._compiled=!0),r&&(u.functional=!0),i&&(u._scopeId="data-v-"+i),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__),o&&o.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(a)},u._ssrRegister=l):o&&(l=s?function(){o.call(this,this.$root.$options.shadowRoot)}:o),l)if(u.functional){u._injectStyles=l;var c=u.render;u.render=function(e,t){return l.call(t),c(e,t)}}else{var f=u.beforeCreate;u.beforeCreate=f?[].concat(f,l):[l]}return{exports:e,options:u}}n.d(t,"a",(function(){return r}))},15:function(e,t){e.exports=n("4eda")},2:function(e,t){e.exports=n("3c84")},41:function(e,t){e.exports=n("3cb2")},68:function(e,t,n){"use strict";n.r(t);var r=n(7),o=n.n(r),i=function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("transition",{attrs:{name:"el-loading-fade"},on:{"after-leave":e.handleAfterLeave}},[n("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||""}},[n("div",{staticClass:"el-loading-spinner"},[e.spinner?n("i",{class:e.spinner}):n("svg",{staticClass:"circular",attrs:{viewBox:"25 25 50 50"}},[n("circle",{staticClass:"path",attrs:{cx:"50",cy:"50",r:"20",fill:"none"}})]),e.text?n("p",{staticClass:"el-loading-text"},[e._v(e._s(e.text))]):e._e()])])])},a=[];i._withStripped=!0;var s={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}}},l=s,u=n(0),c=Object(u["a"])(l,i,a,!1,null,null,null);c.options.__file="packages/loading/src/loading.vue";var f=c.exports,d=n(2),p=n(15),h=n(41),v=n.n(h),m=o.a.extend(f),y={install:function(e){if(!e.prototype.$isServer){var t=function(t,r){r.value?e.nextTick((function(){r.modifiers.fullscreen?(t.originalPosition=Object(d["getStyle"])(document.body,"position"),t.originalOverflow=Object(d["getStyle"])(document.body,"overflow"),t.maskStyle.zIndex=p["PopupManager"].nextZIndex(),Object(d["addClass"])(t.mask,"is-fullscreen"),n(document.body,t,r)):(Object(d["removeClass"])(t.mask,"is-fullscreen"),r.modifiers.body?(t.originalPosition=Object(d["getStyle"])(document.body,"position"),["top","left"].forEach((function(e){var n="top"===e?"scrollTop":"scrollLeft";t.maskStyle[e]=t.getBoundingClientRect()[e]+document.body[n]+document.documentElement[n]-parseInt(Object(d["getStyle"])(document.body,"margin-"+e),10)+"px"})),["height","width"].forEach((function(e){t.maskStyle[e]=t.getBoundingClientRect()[e]+"px"})),n(document.body,t,r)):(t.originalPosition=Object(d["getStyle"])(t,"position"),n(t,t,r)))})):(v()(t.instance,(function(e){if(t.instance.hiding){t.domVisible=!1;var n=r.modifiers.fullscreen||r.modifiers.body?document.body:t;Object(d["removeClass"])(n,"el-loading-parent--relative"),Object(d["removeClass"])(n,"el-loading-parent--hidden"),t.instance.hiding=!1}}),300,!0),t.instance.visible=!1,t.instance.hiding=!0)},n=function(t,n,r){n.domVisible||"none"===Object(d["getStyle"])(n,"display")||"hidden"===Object(d["getStyle"])(n,"visibility")?n.domVisible&&!0===n.instance.hiding&&(n.instance.visible=!0,n.instance.hiding=!1):(Object.keys(n.maskStyle).forEach((function(e){n.mask.style[e]=n.maskStyle[e]})),"absolute"!==n.originalPosition&&"fixed"!==n.originalPosition&&Object(d["addClass"])(t,"el-loading-parent--relative"),r.modifiers.fullscreen&&r.modifiers.lock&&Object(d["addClass"])(t,"el-loading-parent--hidden"),n.domVisible=!0,t.appendChild(n.mask),e.nextTick((function(){n.instance.hiding?n.instance.$emit("after-leave"):n.instance.visible=!0})),n.domInserted=!0)};e.directive("loading",{bind:function(e,n,r){var o=e.getAttribute("element-loading-text"),i=e.getAttribute("element-loading-spinner"),a=e.getAttribute("element-loading-background"),s=e.getAttribute("element-loading-custom-class"),l=r.context,u=new m({el:document.createElement("div"),data:{text:l&&l[o]||o,spinner:l&&l[i]||i,background:l&&l[a]||a,customClass:l&&l[s]||s,fullscreen:!!n.modifiers.fullscreen}});e.instance=u,e.mask=u.$el,e.maskStyle={},n.value&&t(e,n)},update:function(e,n){e.instance.setText(e.getAttribute("element-loading-text")),n.oldValue!==n.value&&t(e,n)},unbind:function(e,n){e.domInserted&&(e.mask&&e.mask.parentNode&&e.mask.parentNode.removeChild(e.mask),t(e,{value:!1,modifiers:n.modifiers})),e.instance&&e.instance.$destroy()}})}}},g=y,b=n(9),_=n.n(b),x=o.a.extend(f),w={text:null,fullscreen:!0,body:!1,lock:!1,customClass:""},C=void 0;x.prototype.originalPosition="",x.prototype.originalOverflow="",x.prototype.close=function(){var e=this;this.fullscreen&&(C=void 0),v()(this,(function(t){var n=e.fullscreen||e.body?document.body:e.target;Object(d["removeClass"])(n,"el-loading-parent--relative"),Object(d["removeClass"])(n,"el-loading-parent--hidden"),e.$el&&e.$el.parentNode&&e.$el.parentNode.removeChild(e.$el),e.$destroy()}),300),this.visible=!1};var S=function(e,t,n){var r={};e.fullscreen?(n.originalPosition=Object(d["getStyle"])(document.body,"position"),n.originalOverflow=Object(d["getStyle"])(document.body,"overflow"),r.zIndex=p["PopupManager"].nextZIndex()):e.body?(n.originalPosition=Object(d["getStyle"])(document.body,"position"),["top","left"].forEach((function(t){var n="top"===t?"scrollTop":"scrollLeft";r[t]=e.target.getBoundingClientRect()[t]+document.body[n]+document.documentElement[n]+"px"})),["height","width"].forEach((function(t){r[t]=e.target.getBoundingClientRect()[t]+"px"}))):n.originalPosition=Object(d["getStyle"])(t,"position"),Object.keys(r).forEach((function(e){n.$el.style[e]=r[e]}))},O=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!o.a.prototype.$isServer){if(e=_()({},w,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&&C)return C;var t=e.body?document.body:e.target,n=new x({el:document.createElement("div"),data:e});return S(e,t,n),"absolute"!==n.originalPosition&&"fixed"!==n.originalPosition&&Object(d["addClass"])(t,"el-loading-parent--relative"),e.fullscreen&&e.lock&&Object(d["addClass"])(t,"el-loading-parent--hidden"),t.appendChild(n.$el),o.a.nextTick((function(){n.visible=!0})),e.fullscreen&&(C=n),n}},E=O;t["default"]={install:function(e){e.use(g),e.prototype.$loading=E},directive:g,service:E}},7:function(e,t){e.exports=n("0261")},9:function(e,t){e.exports=n("e93e")}})},e93e:function(e,t,n){"use strict";t.__esModule=!0,t.default=function(e){for(var t=1,n=arguments.length;t0?r:n)(e)}},f28d:function(e,t){var n={}.hasOwnProperty;e.exports=function(e,t){return n.call(e,t)}},f30e:function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},f69c:function(e,t,n){var r=n("f28d"),o=n("e628"),i=n("4aef"),a=n("c223");e.exports=function(e,t){for(var n=o(t),s=a.f,l=i.f,u=0;u0&&!this.isAllSelected,value:this.isAllSelected},nativeOn:{click:this.toggleAllSelection}})},renderCell:function(e,t){var n=t.row,r=t.column,o=t.store,i=t.$index;return e("el-checkbox",{nativeOn:{click:function(e){return e.stopPropagation()}},attrs:{value:o.isSelected(n),disabled:!!r.selectable&&!r.selectable.call(null,n,i)},on:{input:function(){o.commit("rowSelectedChanged",n)}}})},sortable:!1,resizable:!1},index:{renderHeader:function(e,t){var n=t.column;return n.label||"#"},renderCell:function(e,t){var n=t.$index,r=t.column,o=n+1,i=r.index;return"number"===typeof i?o=n+i:"function"===typeof i&&(o=i(n)),e("div",[o])},sortable:!1},expand:{renderHeader:function(e,t){var n=t.column;return n.label||""},renderCell:function(e,t){var n=t.row,r=t.store,o=["el-table__expand-icon"];r.states.expandRows.indexOf(n)>-1&&o.push("el-table__expand-icon--expanded");var i=function(e){e.stopPropagation(),r.toggleRowExpansion(n)};return e("div",{class:o,on:{click:i}},[e("i",{class:"el-icon el-icon-arrow-right"})])},sortable:!1,resizable:!1,className:"el-table__expand-column"}};function a(e,t){var n=t.row,o=t.column,i=t.$index,a=o.property,s=a&&Object(r["getPropByPath"])(n,a).v;return o&&o.formatter?o.formatter(n,o,s,i):s}function s(e,t){var n=t.row,r=t.treeNode,o=t.store;if(!r)return null;var i=[],a=function(e){e.stopPropagation(),o.loadOrToggle(n)};if(r.indent&&i.push(e("span",{class:"el-table__indent",style:{"padding-left":r.indent+"px"}})),"boolean"!==typeof r.expanded||r.noLazyChildren)i.push(e("span",{class:"el-table__placeholder"}));else{var s=["el-table__expand-icon",r.expanded?"el-table__expand-icon--expanded":""],l=["el-icon-arrow-right"];r.loading&&(l=["el-icon-loading"]),i.push(e("div",{class:s,on:{click:a}},[e("i",{class:l})]))}return i}var l=n(8),u=n(18),c=n.n(u),f=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 Object(l["l"])(this.width)},realMinWidth:function(){return Object(l["k"])(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,n=Array(t),r=0;rt.key[n])return 1}return 0};return e.map((function(e,t){return{value:e,index:t,key:s?s(e,t):null}})).sort((function(e,t){var r=l(e,t);return r||(r=e.index-t.index),r*n})).map((function(e){return e.value}))},l=function(e,t){var n=null;return e.columns.forEach((function(e){e.id===t&&(n=e)})),n},u=function(e,t){for(var n=null,r=0;r2&&void 0!==arguments[2]?arguments[2]:"children",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"hasChildren",o=function(e){return!(Array.isArray(e)&&e.length)};function i(e,a,s){t(e,a,s),a.forEach((function(e){if(e[r])t(e,null,s+1);else{var a=e[n];o(a)||i(e,a,s+1)}}))}e.forEach((function(e){if(e[r])t(e,null,0);else{var a=e[n];o(a)||i(e,a,0)}}))}}})},fb8e:function(e,t,n){var r=n("ac83"),o=n("a9f2"),i=n("57c4"),a=i("species");e.exports=function(e,t){var n,i=r(e).constructor;return void 0===i||void 0==(n=r(i)[a])?t:o(n)}},fee7:function(e,t,n){var r=n("f30e"),o=n("67ea"),i="".split;e.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==o(e)?i.call(e,""):Object(e)}:Object}}]); \ No newline at end of file diff --git a/app/src/main/assets/web/js/detail.043d6e39.js b/app/src/main/assets/web/js/detail.043d6e39.js new file mode 100644 index 000000000..ad7b9cbb3 --- /dev/null +++ b/app/src/main/assets/web/js/detail.043d6e39.js @@ -0,0 +1 @@ +(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["detail"],{"05b3":function(t,e,n){},"0827":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEUWGBkYGhsdHyAfISI1t/v6AAAB5ElEQVQozxXQsYoTURSA4f/EeycZsDgDdySDjihk38Hy3GWi2J2BCaziQhaiaB+tt9AFu1kwvYUPsIXNPoB9BAUfwAfwEUzKv/v4odGrroyp9/rUaC6rZ5skv5F8qPsfYYP+yKUMymmAEEeW55oUR4o8jr05KNzJ07yvB7w0KKfLwcQUSjfmMU0PJfPHFoEVU+ohNrcKMEzMQ23FDnVSI2dqtYWI7KlLu6vE4UnyvKc3SJuL7lBbeEEl42ItpGLjzIT8PRJCmkRjVpVpsbJFVN0687okJNZiHAr5Z7MV0BnGIDc+THM1zlbieBc1Fq+tH5BH+OpnbWkj40hSqC8Lw2TvFuF0SUFJCk2IytXbjeqcRAt6NHpnrUkUU4KRzZs8RCK8N/Akn2W04LwxMU/V7XK0bDyN2RxfDyx7I4h5vjZby72V8UnOWumZL3qtYc+8DTE0siSBMXGhywx2dMYPnQHbxdFZ7deiNGxCCtD/QWnbwDoGhRYPDzUdUA3krjpnkvdAgDN4ddLkEQSov9qjd42HaDjI34gEqS9TUueAk+sc4qg5ws407KQYKs8G1jv4xBlqBVk6cb4dISZIwVi1Jzu4+HLk6lyfUxkXvwy+1Q+4WVdHIhwfybZ6CWVhxMEhShOgsP/HOW0MvZJeFwAAAABJRU5ErkJggg=="},1240:function(t,e,n){},1544:function(t,e,n){var i=n("8c47"),o=n("65af").f,r={}.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]"==r.call(t)?s(t):o(i(t))}},1632:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEXh7vLf7PDj8PTm8/ecW+lZAAACZElEQVQozw2RsU8TUQCHfz3fw7MS87jeI7DdmSMpDEoHE+P0HqGkvRR8vb5XC4NpN2RQZqcK9xJkwtriekcggerC4OZADDiT+A+goxv/gfwB3zd8H/T6vYF/pTZkCSmDNd3CBEtmZJP4N+CvvhecDvmntKsvwB17rpbIRTLOEoYkj9KZzRUuJsuBQFwgptyJ3Y7EL4V+ud5LO1UnMeQSSObqisiISZkbQBlliP3qWSk3GPQXjxv6VF2BTDO4ySx1zhuJXbA2wBNJF4t5vH9keg6wu5NvUpLtXrZ3OHC9ZsgVcZdOl38PM1y/L6m8GRiErj4AqezUjHGatGGIgs5NJDHh8Ua1IuB4035haVT6SaYWMoQ0eJ3rB/Gpnr3fB49YAy1Wa21YKqAHOmAveVw6CCMGMZh5bGtVI7jnZaiQNbta1Z+285oSoKoRbta1KZ/1bBdKH/RIxv2pRVpkoCmvpr097RWoo0CpMlTWllIenSjECU8mV43mHx2fIRfH/pncrJm3+58BWdbSqCS07/yiQnvHiCG4ZPGRFeAtfreoOubyctzHvLNHhjNvIhukxQzjU5O6QdOEzUp1Ef4d98Pxz+IPYX0bcpnT52dbedfz8y7C4R89RV+MjJkuCCx7mWDt4eyK/62lQB55xXGJK7p8u6bgRv4hVHylelYGGFs64W94tng8sAIVqSRJBpqRA9rFvAysS+9ak8s7557pz5HR4qhCRmWgplpTRJ+bhYfSAMO8/YBucWPuSdmFFtOnuWqvV2NbF6CJnbhNDzEZ/T0XSDrUydzkZCG1z/oIEyUFYxW/KPXNfwopuHDcO04UAAAAAElFTkSuQmCC"},"1a8c":function(t,e,n){"use strict";var i=n("91fe"),o=n("407d").map,r=n("b1a1"),a=n("6885"),s=r("map"),c=a("map");i({target:"Array",proto:!0,forced:!s||!c},{map:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},"1e75":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEXM2t7O3ODQ3uLR4OTDp25yAAACdUlEQVQozw3P70sTcQDH8c/3/M7NG+j35mnHwjwh4hRy/QFK3zvPNbeIG1koPZmxfj2IDAwihL53zj0JYisfmEHcZJZOiBUG60lZiI8T/ANusuftgQ+kCPIPeMP7hS5mUrV9c1g6MQCAEZ8tDLHwofImAGRlX+SZK3Vu9rRRPuO4PK6/9nA4GIATsxlODS+rdCMhkAZivpYV0LWoQHSLSA4NfUg+6mY+7BKL2++F9LvnrBDYm6JO9i/YO3i/HJTGQ4pdIV82TbEDFG6vGYCd4wZchgK5J2CrKTLE+Tx0v+YGlIbdWJFcQl4ptBN8fUJQN1MCJLcZLYwUVVo+famGGty8EXJF5ofOEDzcodT3/Fb0I5sHmc1ZG7CcSl8COgxlXx09jT05OafjCZLIHJhGIaU6wDZHsuMQ41wbdjmQXbhKnMq1zlXSYrjCnyZblqexA7fC8RxS74tq2P3OxSQwTuJSApH8OZLzBBp1pOe0i3rdyDUA47GySZ31YmC4EQYSXvFSvieORGBxXF9aeVtUWKGS9WMC4Z9Y2uXnJ2nCUXVMbPOYqNYNmGWWQ7Evr+BWC+a0JAMTImcq/S4Z5INdQMeuOqDIMa9beilxfA60iC6sP1INcPDpmHBW8drZHNmqwyddJtVje9q8WGUgWAOzmbU4FCQBFi8B2Wk6pickBnYhJMenmJGuRmtt2IoKq9NuFGbNFR99sHnvrnLsLysKANDIsxbp6RNMAsoDSKuRpMwZbAAzI68QatIjmZ0aImyM3O8/4e2MNlOHZomFsa/fLDsysliHS+nlYLQJMnynxrH8QO4PaAV2Li8B/+52UgeGIVNFYf8B1XG/kFSmLcUAAAAASUVORK5CYII="},"21d4":function(t,e,n){"use strict";var i=n("0618"),o=n("dcb6"),r=RegExp.prototype.exec,a=String.prototype.replace,s=r,c=function(){var t=/a/,e=/b*/g;return r.call(t,"a"),r.call(e,"a"),0!==t.lastIndex||0!==e.lastIndex}(),l=o.UNSUPPORTED_Y||o.BROKEN_CARET,u=void 0!==/()??/.exec("")[1],A=c||u||l;A&&(s=function(t){var e,n,o,s,A=this,f=l&&A.sticky,g=i.call(A),d=A.source,h=0,p=t;return f&&(g=g.replace("y",""),-1===g.indexOf("g")&&(g+="g"),p=String(t).slice(A.lastIndex),A.lastIndex>0&&(!A.multiline||A.multiline&&"\n"!==t[A.lastIndex-1])&&(d="(?: "+d+")",p=" "+p,h++),n=new RegExp("^(?:"+d+")",g)),u&&(n=new RegExp("^"+d+"$(?!\\s)",g)),c&&(e=A.lastIndex),o=r.call(f?n:A,p),f?o?(o.input=o.input.slice(h),o[0]=o[0].slice(h),o.index=A.lastIndex,A.lastIndex+=o[0].length):A.lastIndex=0:c&&o&&(A.lastIndex=A.global?o.index+o[0].length:e),u&&o&&o.length>1&&a.call(o[0],n,(function(){for(s=1;s=l?t?"":void 0:(r=s.charCodeAt(c),r<55296||r>56319||c+1===l||(a=s.charCodeAt(c+1))<56320||a>57343?t?s.charAt(c):r:t?s.slice(c,c+2):a-56320+(r-55296<<10)+65536)}};t.exports={codeAt:r(!1),charAt:r(!0)}},"356c":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEXPz8/R0dHT09PU1NToNyAhAAACdElEQVQozw3NP0xTQQDH8d9d7sFrG+QeKVgQ4aoFCwFkYERyLY//0UB8GNGg1WAC0RBGJrzW4mCXQmpgvCYOwEAYiulSpYtza2KiW7s5FgNJFSV2/CzfL7RwpoJ20iadmgA8owOyaxmusKE44scBeb4vIv00dqYgmf6jzWcr7W6INbDQeZbQL9ytXeYgtFfzmW1Fek5msxJlwhyt6qDDxOLQzpVPompYrMPnEnhvLm7M5BxY5nowAj3zkydAkpC0FIG6g7AK+Ub25ybyNWVYwtpseP2rfrQwiGRpfqrnMuPeuvr2dA0p2YsHF2XghkrXKtZ8tLBjR7S2qIaYbKmyLd/QP+EogLjqqwNw5Lq1pDlMLkM5+gNoSvdq+Pxmz9/61EFq6GYM6GqaGvlN95zy3gsmEWI8K3k8OP9OmRLEPO6DP3Wv3g42COinJTZ33dcIvs4ESp6opMTjDs6mcYTEbFeUifuxh989yZrIx4lkpuixxz0nHLCekKbE17suKhYkMGhoYhTZtVBvg4bfq/1L1Im0AGMVpBFwumM0zwyuKiCMi5dqR4Flx47AGyF2xTbxqUdTwCH94BT3DozpLV5WuAL/N8rGtHKjotBOOuOtCJ9E21uqsyBoLOzaXbHPrK5PQBP+fBfeidvJAeMIAmzVt5IkJJ9DBWaZDAepYUhlQqHt0h72SJ3j8TZHom64f516xx9T5evgMPgwG82jZdJaJIDyWp6LAjOCclVyzNA3iTKzIULlBQEPaTXlPHok5gISclmyaWZlqY2aTHdRHpJOwTdDEQ3ZfKtbpclcNhyVClagmY+fIfyKukntPqBgnx5QvZHk/D/MK8JMClrSigAAAABJRU5ErkJggg=="},3874:function(t,e,n){},"3e5e":function(t,e,n){"use strict";var i=n("deaa"),o=n("e1dd"),r=n("ac83"),a=n("3193"),s=n("fb8e"),c=n("536c"),l=n("684e"),u=n("81a0"),A=n("21d4"),f=n("f30e"),g=[].push,d=Math.min,h=4294967295,p=!f((function(){return!RegExp(h,"y")}));i("split",2,(function(t,e,n){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var i=String(a(this)),r=void 0===n?h:n>>>0;if(0===r)return[];if(void 0===t)return[i];if(!o(t))return e.call(i,t,r);var s,c,l,u=[],f=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),d=0,p=new RegExp(t.source,f+"g");while(s=A.call(p,i)){if(c=p.lastIndex,c>d&&(u.push(i.slice(d,s.index)),s.length>1&&s.index=r))break;p.lastIndex===s.index&&p.lastIndex++}return d===i.length?!l&&p.test("")||u.push(""):u.push(i.slice(d)),u.length>r?u.slice(0,r):u}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var o=a(this),r=void 0==e?void 0:e[t];return void 0!==r?r.call(e,o,n):i.call(String(o),e,n)},function(t,o){var a=n(i,t,this,o,i!==e);if(a.done)return a.value;var A=r(t),f=String(this),g=s(A,RegExp),m=A.unicode,v=(A.ignoreCase?"i":"")+(A.multiline?"m":"")+(A.unicode?"u":"")+(p?"y":"g"),C=new g(p?A:"^(?:"+A.source+")",v),b=void 0===o?h:o>>>0;if(0===b)return[];if(0===f.length)return null===u(C,f)?[f]:[];var S=0,y=0,x=[];while(y1?arguments[1]:void 0)}})},"407d":function(t,e,n){var i=n("0b29"),o=n("fee7"),r=n("ee6f"),a=n("684e"),s=n("3132"),c=[].push,l=function(t){var e=1==t,n=2==t,l=3==t,u=4==t,A=6==t,f=5==t||A;return function(g,d,h,p){for(var m,v,C=r(g),b=o(C),S=i(d,h,3),y=a(b.length),x=0,B=p||s,I=e?B(g,y):n?B(g,0):void 0;y>x;x++)if((f||x in b)&&(m=b[x],v=S(m,x,C),t))if(e)I[x]=v;else if(v)switch(t){case 3:return!0;case 5:return m;case 6:return x;case 2:c.call(I,m)}else if(u)return!1;return A?-1:l||u?u:I}};t.exports={forEach:l(0),map:l(1),filter:l(2),some:l(3),every:l(4),find:l(5),findIndex:l(6)}},4178:function(t,e,n){"use strict";var i=n("91fe"),o=n("d5dc"),r=n("df50"),a=n("e17a"),s=n("7a23"),c=n("4ccd"),l=n("4445"),u=n("f30e"),A=n("f28d"),f=n("a8c9"),g=n("d68d"),d=n("ac83"),h=n("ee6f"),p=n("8c47"),m=n("7dc7"),v=n("aec8"),C=n("641d"),b=n("16e5"),S=n("65af"),y=n("1544"),x=n("1072"),B=n("4aef"),I=n("c223"),E=n("354c"),k=n("2ba5"),w=n("3d8a"),O=n("f880"),U=n("4d52"),D=n("4888"),Q=n("9db6"),V=n("57c4"),R=n("7287"),P=n("c0aa"),M=n("94d7"),F=n("d0e2"),N=n("407d").forEach,L=U("hidden"),K="Symbol",T="prototype",H=V("toPrimitive"),J=F.set,z=F.getterFor(K),W=Object[T],G=o.Symbol,q=r("JSON","stringify"),Y=B.f,Z=I.f,j=y.f,X=E.f,$=O("symbols"),_=O("op-symbols"),tt=O("string-to-symbol-registry"),et=O("symbol-to-string-registry"),nt=O("wks"),it=o.QObject,ot=!it||!it[T]||!it[T].findChild,rt=s&&u((function(){return 7!=C(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a}))?function(t,e,n){var i=Y(W,e);i&&delete W[e],Z(t,e,n),i&&t!==W&&Z(W,e,i)}:Z,at=function(t,e){var n=$[t]=C(G[T]);return J(n,{type:K,tag:t,description:e}),s||(n.description=e),n},st=l?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof G},ct=function(t,e,n){t===W&&ct(_,e,n),d(t);var i=m(e,!0);return d(n),A($,i)?(n.enumerable?(A(t,L)&&t[L][i]&&(t[L][i]=!1),n=C(n,{enumerable:v(0,!1)})):(A(t,L)||Z(t,L,v(1,{})),t[L][i]=!0),rt(t,i,n)):Z(t,i,n)},lt=function(t,e){d(t);var n=p(e),i=b(n).concat(dt(n));return N(i,(function(e){s&&!At.call(n,e)||ct(t,e,n[e])})),t},ut=function(t,e){return void 0===e?C(t):lt(C(t),e)},At=function(t){var e=m(t,!0),n=X.call(this,e);return!(this===W&&A($,e)&&!A(_,e))&&(!(n||!A(this,e)||!A($,e)||A(this,L)&&this[L][e])||n)},ft=function(t,e){var n=p(t),i=m(e,!0);if(n!==W||!A($,i)||A(_,i)){var o=Y(n,i);return!o||!A($,i)||A(n,L)&&n[L][i]||(o.enumerable=!0),o}},gt=function(t){var e=j(p(t)),n=[];return N(e,(function(t){A($,t)||A(D,t)||n.push(t)})),n},dt=function(t){var e=t===W,n=j(e?_:p(t)),i=[];return N(n,(function(t){!A($,t)||e&&!A(W,t)||i.push($[t])})),i};if(c||(G=function(){if(this instanceof G)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=Q(t),n=function(t){this===W&&n.call(_,t),A(this,L)&&A(this[L],e)&&(this[L][e]=!1),rt(this,e,v(1,t))};return s&&ot&&rt(W,e,{configurable:!0,set:n}),at(e,t)},w(G[T],"toString",(function(){return z(this).tag})),w(G,"withoutSetter",(function(t){return at(Q(t),t)})),E.f=At,I.f=ct,B.f=ft,S.f=y.f=gt,x.f=dt,R.f=function(t){return at(V(t),t)},s&&(Z(G[T],"description",{configurable:!0,get:function(){return z(this).description}}),a||w(W,"propertyIsEnumerable",At,{unsafe:!0}))),i({global:!0,wrap:!0,forced:!c,sham:!c},{Symbol:G}),N(b(nt),(function(t){P(t)})),i({target:K,stat:!0,forced:!c},{for:function(t){var e=String(t);if(A(tt,e))return tt[e];var n=G(e);return tt[e]=n,et[n]=e,n},keyFor:function(t){if(!st(t))throw TypeError(t+" is not a symbol");if(A(et,t))return et[t]},useSetter:function(){ot=!0},useSimple:function(){ot=!1}}),i({target:"Object",stat:!0,forced:!c,sham:!s},{create:ut,defineProperty:ct,defineProperties:lt,getOwnPropertyDescriptor:ft}),i({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:gt,getOwnPropertySymbols:dt}),i({target:"Object",stat:!0,forced:u((function(){x.f(1)}))},{getOwnPropertySymbols:function(t){return x.f(h(t))}}),q){var ht=!c||u((function(){var t=G();return"[null]"!=q([t])||"{}"!=q({a:t})||"{}"!=q(Object(t))}));i({target:"JSON",stat:!0,forced:ht},{stringify:function(t,e,n){var i,o=[t],r=1;while(arguments.length>r)o.push(arguments[r++]);if(i=e,(g(e)||void 0!==t)&&!st(t))return f(e)||(e=function(t,e){if("function"==typeof i&&(e=i.call(this,t,e)),!st(e))return e}),o[1]=e,q.apply(null,o)}})}G[T][H]||k(G[T],H,G[T].valueOf),M(G,K),D[L]=!0},"41f6":function(t,e){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},4400:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAElBMVEUQERMODxESFBYWGBkaHB0eICLm6ozJAAACkUlEQVQ4yyWTUdLbMAiEASfvoOkBkBy/O5keIE0v8E/uf5h+68qZWALELgu2MG9PP9qyvCzTVhrrsPGOCjvTfXQZvtp/W3Gy6LCITqs4q/DZ+KYl76zKzHVYpY2wNY27nqN1sbLGcrLH3/ENH4oWlGctsDu8AO+HzTLlsYdh8MzP1m6YDMz0ACfcimvakBj+mwO/+5Uta5teOD379sxK1fUxmUhv8MU3jUT5gs26PMephFznkLcpQZ6/dPL9C/GWHcCxDN6oZhD5xBm5qoYBPA+PFE/H1tXDWcWl8TW7rS+4dUzAVy0BIrvC4/HcqW2TkG1HO8q9dC23INAg7NA4AFRFkDTM2lfELPyFzi1VddcpX2z0KjHBUDmdLNJ6dDps4ytrX+FPsZwE31wSL+6OWfHOAJ3+Y0Rk/MiKfmWNPg7oVP/U3Ck9FoCkC2gBpALOiqbMNTkOe8P4FWkTD2Y9Q3+5VmV0uLUJBl68U5uAK2Kl6QDXvLxbwweOL2sixW78uU8p0ysfc7cWrF1j6B1sPJ4WgclYSnJN1bzozrhEcFHmRzBkbJWqqdG+EYJXRFmT5jnLXPUNF6WBdoFbTxYsmDXVLU/WA7MExNc93sJS5hIXDeLxzMScHzdhKvEkibr6cQXYPrmtmTA7JcInISrTzRDvShTdka0uVGrsJAAR6tSn1sKziZtfKVjAxPrJsYgZO0bye+vKTZ/DgoAoLGNO6jYHimZYTL/3pLJHawquJukjBpfz8WOGVSVIWx9ywUfS5iENutidRM4NzkAmxgUSQ68xgNOU+ZLalr4TS2V+D2xqukZig+Z9DilR7Nouzwp1cp/3E5q6Rdlf08obKvAM4qZ6pMr+w3PmQALSSBfjyZn5DwrNRVbywBQiAAAAAElFTkSuQmCC"},"477e":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAACVBMVEX28ef48+n69esoK7jYAAAB4UlEQVQozw2OsW4bQQxEhwLXkDrysGdEqRRgVShfQQq8wOr2jD0jSpXCLvwXbtKfADlFqgSwC/9ljqweZgYzQFnb/QGepYhA9jzmTc1WaSEtQpbFgjWATI00ZZtIckXx8q2Oe5yEByBy+RHOTcM+VVTadULsvxvRC/q8WTwgcWGD+Mnaqa0oy2gw2pKFzK+PzEsus5hP9AHojKslVynLlioVTBEN8cjDNnZoR1uMGTiZAAN47HxMtEkGUE9b8HWzkqNX5Lpk0yVziAJOs46rK1pG/xNuXLjz95fSDoJE5IqG23MAYPtWoeWPvfVtIV/Ng9oH3W0gGMPIOqd4MK4QZ55dV61gOb8Zxp7I9qayaGxp6Q91cmC0ZRdBwEQVHWzSAanlZwVWc9yljeTCeaHjBVvlPSLeyeBUT2rPdJegQI103jVS3uYkyIx1il6mslMDedZuOkwzolsagvPuQAfp7cYg7k9V1NOxfq64PNSvMdwONV4VYEmqlbpZy5OAakRKkjPnL4CBv5/OZRgoWHBmNbxB0LgB1I4vXFj93UoF2/0TPEsWwV9EhbIiTPqYoTHYoMn3enTDjmrFeDTIzaL1bUC/PBIMuF+vSSYSaxoVt90EO3Gu1zrMuMRGUk7Ffv3L+A931Gsb/yBoIgAAAABJRU5ErkJggg=="},"536c":function(t,e,n){"use strict";var i=n("3303").charAt;t.exports=function(t,e,n){return e+(n?i(t,e).length:1)}},"537b":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"chapter-wrapper",class:{night:t.isNight,day:!t.isNight},style:t.bodyTheme},[n("div",{staticClass:"tool-bar",style:t.leftBarTheme},[n("div",{staticClass:"tools"},[n("el-popover",{attrs:{placement:"right",width:t.cataWidth,trigger:"click","visible-arrow":!1,"popper-class":"pop-cata"},model:{value:t.popCataVisible,callback:function(e){t.popCataVisible=e},expression:"popCataVisible"}},[n("PopCata",{ref:"popCata",staticClass:"popup",on:{getContent:t.getContent}}),n("div",{staticClass:"tool-icon",class:{"no-point":t.noPoint},attrs:{slot:"reference"},slot:"reference"},[n("div",{staticClass:"iconfont"},[t._v("  ")]),n("div",{staticClass:"icon-text"},[t._v("目录")])])],1),n("el-popover",{attrs:{placement:"bottom-right",width:"470",trigger:"click","visible-arrow":!1,"popper-class":"pop-setting"},model:{value:t.readSettingsVisible,callback:function(e){t.readSettingsVisible=e},expression:"readSettingsVisible"}},[n("ReadSettings",{staticClass:"popup"}),n("div",{staticClass:"tool-icon",class:{"no-point":t.noPoint},attrs:{slot:"reference"},slot:"reference"},[n("div",{staticClass:"iconfont"},[t._v("  ")]),n("div",{staticClass:"icon-text"},[t._v("设置")])])],1),n("div",{staticClass:"tool-icon",on:{click:t.toShelf}},[n("div",{staticClass:"iconfont"},[t._v("  ")]),n("div",{staticClass:"icon-text"},[t._v("书架")])]),n("div",{staticClass:"tool-icon",class:{"no-point":t.noPoint},on:{click:t.toTop}},[n("div",{staticClass:"iconfont"},[t._v("  ")]),n("div",{staticClass:"icon-text"},[t._v("顶部")])]),n("div",{staticClass:"tool-icon",class:{"no-point":t.noPoint},on:{click:t.toBottom}},[n("div",{staticClass:"iconfont"},[t._v("  ")]),n("div",{staticClass:"icon-text"},[t._v("底部")])])],1)]),n("div",{staticClass:"read-bar",style:t.rightBarTheme},[n("div",{staticClass:"tools"},[n("div",{staticClass:"tool-icon",class:{"no-point":t.noPoint},on:{click:t.toLastChapter}},[n("div",{staticClass:"iconfont"},[t._v("  ")])]),n("div",{staticClass:"tool-icon",class:{"no-point":t.noPoint},on:{click:t.toNextChapter}},[n("div",{staticClass:"iconfont"},[t._v("  ")])])])]),n("div",{staticClass:"chapter-bar"}),n("div",{ref:"content",staticClass:"chapter",style:t.chapterTheme},[n("div",{staticClass:"content"},[n("div",{ref:"top",staticClass:"top-bar"}),t.show?n("div",{ref:"title",staticClass:"title"},[t._v(t._s(t.title))]):t._e(),n("Pcontent",{attrs:{carray:t.content}}),n("div",{ref:"bottom",staticClass:"bottom-bar"})],1)])])},o=[],r=(n("b3f9"),n("3e5e"),function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"cata-wrapper",style:t.popupTheme},[n("div",{staticClass:"title"},[t._v(" 目录 ")]),n("div",{ref:"cataData",staticClass:"data-wrapper",class:{night:t.isNight,day:!t.isNight}},[n("div",{staticClass:"cata"},t._l(t.catalog,(function(e,i){return n("div",{key:e.durChapterIndex,ref:"cata",refInFor:!0,staticClass:"log",class:{selected:t.isSelected(i)},on:{click:function(n){return t.gotoChapter(e)}}},[n("div",{staticClass:"log-text"},[t._v(" "+t._s(e.title)+" ")])])})),0)])])}),a=[];n("4045"),n("4178"),n("fc88"),n("e350"),n("d9a3"),n("3a20"),n("ef8e"),n("252a");function s(t){return s="function"===typeof Symbol&&"symbol"===typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"===typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},s(t)}var c,l,u=function(t,e,n,i){return t/=i/2,t<1?n/2*t*t+e:(t--,-n/2*(t*(t-2)-1)+e)},A=function(){var t,e,n,i,o,r,a,c,l,A,f,g,d;function h(){var e=t.scrollTop||t.scrollY||t.pageYOffset;return e="undefined"===typeof e?0:e,e}function p(e){var i=e.getBoundingClientRect().top,o=t.getBoundingClientRect?t.getBoundingClientRect().top:0;return i-o+n}function m(e){t.scrollTo?t.scrollTo(0,e):t.scrollTop=e}function v(t){A||(A=t),f=t-A,g=r(f,n,c,l),m(g),f1&&void 0!==arguments[1]?arguments[1]:{};switch(l=f.duration||1e3,o=f.offset||0,d=f.callback,r=f.easing||u,a=f.a11y||!1,s(f.container)){case"object":t=f.container;break;case"string":t=document.querySelector(f.container);break;default:t=window}switch(n=h(),s(A)){case"number":e=void 0,a=!1,i=n+A;break;case"object":e=A,i=p(e);break;case"string":e=document.querySelector(A),i=p(e);break}switch(c=i-n+o,s(f.duration)){case"number":l=f.duration;break;case"function":l=f.duration(c);break}requestAnimationFrame(v)}return b},f=A(),g=f,d=n("7286"),h=n.n(d),p=n("477e"),m=n.n(p),v=n("e160"),C=n.n(v),b=n("df5e"),S=n.n(b),y=n("ec0f"),x=n.n(y),B=n("b671"),I=n.n(B),E=n("5629"),k=n.n(E),w=n("d0e3"),O=n.n(w),U=n("4039"),D=n.n(U),Q=n("1e75"),V=n.n(Q),R=n("1632"),P=n.n(R),M=n("7abd"),F=n.n(M),N=n("356c"),L=n.n(N),K=n("b165"),T=n.n(K),H=n("cf68"),J=n.n(H),z=n("4400"),W=n.n(z),G=n("802e"),q=n.n(G),Y=n("0827"),Z=n.n(Y),j={themes:[{body:"#ede7da url("+h.a+") repeat",content:"#ede7da url("+m.a+") repeat",popup:"#ede7da url("+C.a+") repeat"},{body:"#ede7da url("+S.a+") repeat",content:"#ede7da url("+x.a+") repeat",popup:"#ede7da url("+I.a+") repeat"},{body:"#ede7da url("+k.a+") repeat",content:"#ede7da url("+O.a+") repeat",popup:"#ede7da url("+D.a+") repeat"},{body:"#ede7da url("+V.a+") repeat",content:"#ede7da url("+P.a+") repeat",popup:"#ede7da url("+F.a+") repeat"},{body:"#ebcece repeat",content:"#f5e4e4 repeat",popup:"#faeceb repeat"},{body:"#ede7da url("+L.a+") repeat",content:"#ede7da url("+T.a+") repeat",popup:"#ede7da url("+J.a+") repeat"},{body:"#ede7da url("+W.a+") repeat",content:"#ede7da url("+q.a+") repeat",popup:"#ede7da url("+Z.a+") repeat"}],fonts:[{fontFamily:"Microsoft YaHei, PingFangSC-Regular, HelveticaNeue-Light, Helvetica Neue Light, sans-serif"},{fontFamily:"PingFangSC-Regular, -apple-system, Simsun"},{fontFamily:"Kaiti"}]},X=j,$=(n("05b3"),{name:"PopCata",data:function(){return{isNight:6==this.$store.state.config.theme,index:this.$store.state.readingBook.index}},computed:{catalog:function(){return this.$store.state.readingBook.catalog},popCataVisible:function(){return this.$store.state.popCataVisible},theme:function(){return this.$store.state.config.theme},popupTheme:function(){return{background:X.themes[this.theme].popup}}},mounted:function(){},watch:{theme:function(t){this.isNight=6==t},popCataVisible:function(){this.$nextTick((function(){var t=this.$store.state.readingBook.index,e=this.$refs.cataData;g(this.$refs.cata[t],{container:e,duration:0})}))}},methods:{isSelected:function(t){return t==this.$store.state.readingBook.index},gotoChapter:function(t){this.index=this.catalog.indexOf(t),this.$store.commit("setPopCataVisible",!1),this.$store.commit("setContentLoading",!0),this.$emit("getContent",this.index)}}}),_=$,tt=(n("7f9c"),n("623f")),et=Object(tt["a"])(_,r,a,!1,null,"8c647fa4",null),nt=et.exports,it=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"settings-wrapper",class:{night:t.isNight,day:!t.isNight},style:t.popupTheme},[n("div",{staticClass:"settings-title"},[t._v("设置")]),n("div",{staticClass:"setting-list"},[n("ul",[n("li",{staticClass:"theme-list"},[n("i",[t._v("阅读主题")]),t._l(t.themeColors,(function(e,i){return n("span",{key:i,ref:"themes",refInFor:!0,staticClass:"theme-item",class:{selected:t.selectedTheme==i},style:e,on:{click:function(e){return t.setTheme(i)}}},[i<6?n("em",{staticClass:"iconfont"},[t._v("")]):n("em",{staticClass:"moon-icon"},[t._v(t._s(t.moonIcon))])])}))],2),n("li",{staticClass:"font-list"},[n("i",[t._v("正文字体")]),t._l(t.fonts,(function(e,i){return n("span",{key:i,staticClass:"font-item",class:{selected:t.selectedFont==i},on:{click:function(e){return t.setFont(i)}}},[t._v(t._s(e))])}))],2),n("li",{staticClass:"font-size"},[n("i",[t._v("字体大小")]),n("div",{staticClass:"resize"},[n("span",{staticClass:"less",on:{click:t.lessFontSize}},[n("em",{staticClass:"iconfont"},[t._v("")])]),n("b"),t._v(" "),n("span",{staticClass:"lang"},[t._v(t._s(t.fontSize))]),n("b"),n("span",{staticClass:"more",on:{click:t.moreFontSize}},[n("em",{staticClass:"iconfont"},[t._v("")])])])]),n("li",{staticClass:"read-width"},[n("i",[t._v("页面宽度")]),n("div",{staticClass:"resize"},[n("span",{staticClass:"less",on:{click:t.lessReadWidth}},[n("em",{staticClass:"iconfont"},[t._v("")])]),n("b"),t._v(" "),n("span",{staticClass:"lang"},[t._v(t._s(t.readWidth))]),n("b"),n("span",{staticClass:"more",on:{click:t.moreReadWidth}},[n("em",{staticClass:"iconfont"},[t._v("")])])])])])])])},ot=[],rt=(n("82da"),{name:"ReadSettings",data:function(){return{theme:0,isNight:6==this.$store.state.config.theme,moonIcon:"",themeColors:[{background:"rgba(250, 245, 235, 0.8)"},{background:"rgba(245, 234, 204, 0.8)"},{background:"rgba(230, 242, 230, 0.8)"},{background:"rgba(228, 241, 245, 0.8)"},{background:"rgba(245, 228, 228, 0.8)"},{background:"rgba(224, 224, 224, 0.8)"},{background:"rgba(0, 0, 0, 0.5)"}],moonIconStyle:{display:"inline",color:"rgba(255,255,255,0.2)"},fonts:["雅黑","宋体","楷书"]}},mounted:function(){var t=this.$store.state.config;this.theme=t.theme,6==this.theme?this.moonIcon="":this.moonIcon=""},computed:{config:function(){return this.$store.state.config},popupTheme:function(){return{background:X.themes[this.config.theme].popup}},selectedTheme:function(){return this.$store.state.config.theme},selectedFont:function(){return this.$store.state.config.font},fontSize:function(){return this.$store.state.config.fontSize},readWidth:function(){return this.$store.state.config.readWidth}},methods:{setTheme:function(t){6==t?(this.isNight=!0,this.moonIcon="",this.moonIconStyle.color="#ed4259"):(this.isNight=!1,this.moonIcon="",this.moonIconStyle.color="rgba(255,255,255,0.2)");var e=this.config;e.theme=t,this.$store.commit("setConfig",e)},setFont:function(t){var e=this.config;e.font=t,this.$store.commit("setConfig",e)},moreFontSize:function(){var t=this.config;t.fontSize<48&&(t.fontSize+=2),this.$store.commit("setConfig",t)},lessFontSize:function(){var t=this.config;t.fontSize>12&&(t.fontSize-=2),this.$store.commit("setConfig",t)},moreReadWidth:function(){var t=this.config;t.readWidth<960&&(t.readWidth+=160),this.$store.commit("setConfig",t)},lessReadWidth:function(){var t=this.config;t.readWidth>640&&(t.readWidth-=160),this.$store.commit("setConfig",t)}}}),at=rt,st=(n("8157"),Object(tt["a"])(at,it,ot,!1,null,"3d7e2fe5",null)),ct=st.exports,lt=(n("1a8c"),{name:"pcontent",data:function(){return{}},props:["carray"],render:function(){var t=arguments[0],e=this.fontFamily,n=this.fontSize,i=e;return i.fontSize=n,this.show?t("div",[this.carray.map((function(e){return t("p",{style:i},[e])}))]):t("div")},computed:{show:function(){return this.$store.state.showContent},fontFamily:function(){return X.fonts[this.$store.state.config.font]},fontSize:function(){return this.$store.state.config.fontSize+"px"}},watch:{fontSize:function(){var t=this;t.$store.commit("setShowContent",!1),this.$nextTick((function(){t.$store.commit("setShowContent",!0)}))}}}),ut=lt,At=(n("a9ea"),Object(tt["a"])(ut,c,l,!1,null,"6ee085ae",null)),ft=At.exports,gt=n("82ae"),dt=n.n(gt),ht={components:{PopCata:nt,Pcontent:ft,ReadSettings:ct},created:function(){var t=JSON.parse(localStorage.getItem("config"));null!=t&&this.$store.commit("setConfig",t)},beforeCreate:function(){var t=JSON.parse(localStorage.getItem("config"));null!=t&&this.$store.commit("setConfig",t)},mounted:function(){var t=this;this.loading=this.$loading({target:this.$refs.content,lock:!0,text:"正在获取内容",spinner:"el-icon-loading",background:"rgba(0,0,0,0)"});var e=this,n=sessionStorage.getItem("bookUrl"),i=sessionStorage.getItem("bookName"),o=JSON.parse(localStorage.getItem(n));null==o&&(o={bookName:i,bookUrl:n,index:0},localStorage.setItem(n,JSON.stringify(o))),this.getCatalog(n).then((function(n){var i=n.data.data;o.catalog=i,e.$store.commit("setReadingBook",o);var r=e.$store.state.readingBook.index||0;t.getContent(r)}),(function(t){throw e.loading.close(),e.$message.error("获取书籍目录失败"),t}))},watch:{chapterName:function(t){this.title=t},content:function(){this.$store.commit("setContentLoading",!1)},theme:function(t){this.isNight=6==t},bodyColor:function(t){this.bodyTheme.background=t},chapterColor:function(t){this.chapterTheme.background=t},readWidth:function(t){this.chapterTheme.width=t;var e=-((parseInt(t)+130)/2+68)+"px",n=-((parseInt(t)+130)/2+52)+"px";this.leftBarTheme.marginLeft=e,this.rightBarTheme.marginRight=n},popupColor:function(t){this.leftBarTheme.background=t,this.rightBarTheme.background=t},readSettingsVisible:function(t){if(!t){var e=JSON.stringify(this.$store.state.config);localStorage.setItem("config",e)}}},data:function(){return{title:"",content:[],noPoint:!0,isNight:6==this.$store.state.config.theme,bodyTheme:{background:X.themes[this.$store.state.config.theme].body},chapterTheme:{background:X.themes[this.$store.state.config.theme].content,width:this.$store.state.config.readWidth-130+"px"},leftBarTheme:{background:X.themes[this.$store.state.config.theme].popup,marginLeft:-(this.$store.state.config.readWidth/2+68)+"px"},rightBarTheme:{background:X.themes[this.$store.state.config.theme].popup,marginRight:-(this.$store.state.config.readWidth/2+52)+"px"}}},computed:{catalog:function(){return this.$store.state.catalog},windowHeight:function(){return window.innerHeight},contentHeight:function(){return this.$refs.content.offsetHeight},popCataVisible:{get:function(){return this.$store.state.popCataVisible},set:function(t){this.$store.commit("setPopCataVisible",t)}},readSettingsVisible:{get:function(){return this.$store.state.readSettingsVisible},set:function(t){this.$store.commit("setReadSettingsVisible",t)}},config:function(){return this.$store.state.config},theme:function(){return this.config.theme},bodyColor:function(){return X.themes[this.config.theme].body},chapterColor:function(){return X.themes[this.config.theme].content},popupColor:function(){return X.themes[this.config.theme].popup},readWidth:function(){return this.$store.state.config.readWidth-130+"px"},cataWidth:function(){return this.$store.state.config.readWidth-33},show:function(){return this.$store.state.showContent}},methods:{getCatalog:function(t){return dt.a.get("/getChapterList?url="+encodeURIComponent(t))},getContent:function(t){var e=this;this.$store.commit("setShowContent",!1),this.loading.visible||(this.loading=this.$loading({target:this.$refs.content,lock:!0,text:"正在获取内容",spinner:"el-icon-loading",background:"rgba(0,0,0,0)"}));var n=sessionStorage.getItem("bookUrl"),i=JSON.parse(localStorage.getItem(n));i.index=t,localStorage.setItem(n,JSON.stringify(i)),this.$store.state.readingBook.index=t;var o=this.$store.state.readingBook.catalog[t].title,r=this.$store.state.readingBook.catalog[t].index;this.title=o,g(this.$refs.top,{duration:0});var a=this;dt.a.get("/getBookContent?url="+encodeURIComponent(n)+"&index="+r).then((function(t){var n=t.data.data,i=n.split("\n\n"),o="";o=i.length>1?i[1].split("\n"):i[0].split("\n"),a.content=o,e.$store.commit("setContentLoading",!0),a.loading.close(),a.noPoint=!1,a.$store.commit("setShowContent",!0)}),(function(t){throw a.$message.error("获取章节内容失败"),a.content="  获取章节内容失败!",t}))},toTop:function(){g(this.$refs.top)},toBottom:function(){g(this.$refs.bottom)},toNextChapter:function(){this.$store.commit("setContentLoading",!0);var t=this.$store.state.readingBook.index;t++,this.getContent(t)},toLastChapter:function(){this.$store.commit("setContentLoading",!0);var t=this.$store.state.readingBook.index;t--,this.getContent(t)},toShelf:function(){this.$router.push("/")}}},pt=ht,mt=(n("88a3"),Object(tt["a"])(pt,i,o,!1,null,"08ce53b2",null));e["default"]=mt.exports},5629:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEXN383Q4tDP4c/R5NEInCCXAAACVElEQVQozw3Hv2sTYRwH4M/79pJ7bZL2bXqtERJ97zjUpbZDhg6pfC8qibi8hLR0EaJ0EFxaCSWDxjfpj1zrYBcRBKE6SAfBJWsx9i8IQfdQxDlKtA6t2OnhQfN3lbG7ytYRywF8rVoPCNO0X2sQOKDpAnSDK2VwkHgmh5yLGT8qASt+2KofnNt2Xg1gf1UF8AoM6052cRMNaloLZb7RKQGrKKji2OefsZF+VqIvos5ZLVIZCX61JcwUdk56wASVkgQvzPfvmT2twTSwyYaC/Pl/UhAHorFhBgZtL6XdAZRp1tkPwC1NLa9CWs5prLhI85NBQsLdXvjDymG3/EbYfQhVNYqc3TtktQhWLY3ko0QsdMbSEp+64v0NfxyqLbIGdh6M2xHHlLBGqKTyQo4E/nebBgBfe1GpdeywYXc8CT7D3cKXuMXkBy4xN6o5OuKamYp3DVI6uccO9lxgd2CAlJgI2BGgaAgIJV/TYwKqu3WFccjbMuA+bVkWgS2bfnlRbD1Eb1sDyWMmjKYIBgGAWbqKRicfvzBkBIz3V5AKnguWdglQEysQsSuVzOg6ALy1pitA5ykGCsc857BRYcgCSZyFOdvoOigSGoPc5Ta73mgxshIcQE5sHMHd9D7yqITw7JO+GHVMxjhzYLcKPSEgmz3fU+BRy3iYNtiXLaBssCW8KguReqkQOTb3MStV0Ugt4U1eIs1RZWRII6Ww8xeNNItyGGQI4ZMlpg/3lQtkl2JFnBp1imRyFe0kK2Id3PCslMgiQNMS77gvFeDhG3cSkYvheeg/e7ClIh5oh+IAAAAASUVORK5CYII="},6885:function(t,e,n){var i=n("7a23"),o=n("f30e"),r=n("f28d"),a=Object.defineProperty,s={},c=function(t){throw t};t.exports=function(t,e){if(r(s,t))return s[t];e||(e={});var n=[][t],l=!!r(e,"ACCESSORS")&&e.ACCESSORS,u=r(e,0)?e[0]:c,A=r(e,1)?e[1]:void 0;return s[t]=!!n&&!o((function(){if(l&&!i)return!0;var t={length:-1};l?a(t,1,{enumerable:!0,get:c}):t[1]=1,n.call(t,u,A)}))}},7286:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEXr5djn4dTp49bt59rT6LKxAAACnElEQVQozw3NUUwScRzA8d8R6MF8YMIx8uk47hDSJbj14IPzOGc7jPLvwTGg5uAYDbe2tt56cLtznvEnS6yDqCcEaWi91DvrbLJZz7b1aFtz1aO+2OZWvn+/+4CHeB6BMYaqBLfjPNRY6RFT2JJYby+uAk4WUTrtlmJ4hgPYb2q1XGDQjaK8pgJHvqNaAX+KyuIkDXpgQinb46nOulnn4b5laUHTxLfseeArAoNOeJlOIjdoal0n1FA7tKFv5roK+YaHOqP3P0XyKHPHY+MhTRe5uCZnKhtJKw2eSrSoBDPLtpZuNcFNJcFyiCMxOaaHIfXz1e8HQbWLySrBQ4x0x1qlhnHlnz2HQEC6TNb0gTHXa7IKhcaHqkE015hk9whA0YeWiLIXf7Fa2CZo3DjqjB4tTuF8jIcbfcEx5z/w4sXpQhXW+ju0cqh7icTFmRMaG+v6CIvTjcSpHcH8JEsF3EPh3fRthYdVLLgI2fWXm85/pGFE4l046s70L+yKCcirGFR+jbpy3kMmiCGHrSezVONsn1RBixncyk2PcVWk7DlgxHo8iZwDyq5uAUD854dZhdIFYzKoQig2haUKi1lVufz2RZUZPZ41n/hrOQB6h0Hhg8I367FNoEHgeM/KY7szSeQwD8q2WE3HM35ZLl0K1MJiOtHIkBclRQUwZnyOWcNsRQQgVLj1PSqkjF9DsoOSaSg3iinKzvfmgsNFFfpP/2T3GLGvL4fHEfwIX1sVvXcPqLztehWGcfn9nI2U9nTfCgJPe/jFPLZwgVEzimBgAm0VIyK2tt1cE/AzQdLK+SxLSQ4aDCZnnId94OG2S1XwvnTbNk/ZnhyRCQT+sZM6z9g6LXL1BOBe+zJySiFkHAINCtnQokbCJ/apCv0foqPiZVfhpywAAAAASUVORK5CYII="},7287:function(t,e,n){var i=n("57c4");e.f=i},"7abd":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEXm9PXq+Pno9vfs+vttWKBGAAACPElEQVQozw3RQWrbQACF4TfCMjPqZgIj4RRaxsZKE0PuMBZ2cLKaCI9RDAXFmJJknUWWI1O1UlamOMHJSjGkuFn3AD2Cr9CepDrAg+/xIxK4QwIqHHQkUhQ/WuphInVIFBojl8QXc012Tgq4RTtVHWVLZVFh1tEoI91uiN4joCqde8Ukn/zGM1B2W4ari2PtTwyw55Ld+Wways54qhGPyS6FzbIT3lIY8WwWdCq56Yolx6KmSKzoqrsCB5heAp4TGNQWJ1Pc6XlE5jQD5OlIX9I47A9uiUQcPQxcury/ToyxWJG/za6ki88crxKPocKS59Sl3EtBG7C89fCGflpfqoSzCeC4crioJA7F0V5+8MaSIk4qSCdwzpogmbqzEirVpGiS2dOVJvUuuqFEmhHao06KEpq+8lvHI14NJk3Qrmi9vBuRLwAz0qZB4hsDXQFXgtnlpDX3C6ug9BquSw/CYtwAzuTz5vuQNdr/YibhR68378ehZH30FSpjh71LpQkrsj+Q062h5WwZ5wlRoD6uQJy1DqvSYuCUapMBqT5YA4ZFw4KlWapxoUGlKWrx0eDQvmigu4WMYt97ruru98fYL8/0lG6CTOFcFWBhFK5gKw19h2JN808nh7xhkU6sWKLXdtkqBL6h+lULK5k19wFB/FldnGYf3LDeuf6IC2/MzJOSOP0qPxLqzaGIqtBcFIItrstkazONOkrc1D1czjuwEGESB4JJnjgSMN7PXAu7fZQpl1C236C+9mM4Af8P98Ch4R2TRl8AAAAASUVORK5CYII="},"7f9c":function(t,e,n){"use strict";var i=n("3874"),o=n.n(i);o.a},"802e":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEUWGBkYGhsdHyAfISI1t/v6AAAB5ElEQVQozxXQsYoTURSA4f/EeycZsDgDdySDjihk38Hy3GWi2J2BCaziQhaiaB+tt9AFu1kwvYUPsIXNPoB9BAUfwAfwEUzKv/v4odGrroyp9/rUaC6rZ5skv5F8qPsfYYP+yKUMymmAEEeW55oUR4o8jr05KNzJ07yvB7w0KKfLwcQUSjfmMU0PJfPHFoEVU+ohNrcKMEzMQ23FDnVSI2dqtYWI7KlLu6vE4UnyvKc3SJuL7lBbeEEl42ItpGLjzIT8PRJCmkRjVpVpsbJFVN0687okJNZiHAr5Z7MV0BnGIDc+THM1zlbieBc1Fq+tH5BH+OpnbWkj40hSqC8Lw2TvFuF0SUFJCk2IytXbjeqcRAt6NHpnrUkUU4KRzZs8RCK8N/Akn2W04LwxMU/V7XK0bDyN2RxfDyx7I4h5vjZby72V8UnOWumZL3qtYc+8DTE0siSBMXGhywx2dMYPnQHbxdFZ7deiNGxCCtD/QWnbwDoGhRYPDzUdUA3krjpnkvdAgDN4ddLkEQSov9qjd42HaDjI34gEqS9TUueAk+sc4qg5ws407KQYKs8G1jv4xBlqBVk6cb4dISZIwVi1Jzu4+HLk6lyfUxkXvwy+1Q+4WVdHIhwfybZ6CWVhxMEhShOgsP/HOW0MvZJeFwAAAABJRU5ErkJggg=="},8157:function(t,e,n){"use strict";var i=n("d2ee"),o=n.n(i);o.a},"81a0":function(t,e,n){var i=n("67ea"),o=n("21d4");t.exports=function(t,e){var n=t.exec;if("function"===typeof n){var r=n.call(t,e);if("object"!==typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==i(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,e)}},"82da":function(t,e,n){},"88a3":function(t,e,n){"use strict";var i=n("2625"),o=n.n(i);o.a},a8c9:function(t,e,n){var i=n("67ea");t.exports=Array.isArray||function(t){return"Array"==i(t)}},a9ea:function(t,e,n){"use strict";var i=n("2485"),o=n.n(i);o.a},b165:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEXe3t7a2trc3Nzg4OCXP9lCAAACoklEQVQozwXBzU/TYBwA4N+QEr4CNbSFwcFuowSqMRvEAwShHWAYNsu7dS0dLnGUSWT4kZB4lGzE4VtcwgIDJqcOWLJxcv4BOoQZuCPxSNSD4WSWLJGL8XmAIiyo2RgJ4A1pxQQlOxRAszLTdnPu2oQGb05RC5slJld7ZAIfo4O44Bn1ud59F0BcjnYOa17Jhwc6EdiKettncsXjT1f8KUBZUW41pK0Jc1Az4dEV3rkkPBtDSZ83Blyt0kSf2PRjzIykoBwINisPbPPtljdVE9iAXRfUPkXLVIgYrCccp5g687NdZbcJ+xa5VE/HhTtT23IKsN5jj/pcUd0dTZNAqCVw72n4gOwnTOC0vvHfaauT8d9zAoRRfPpISZRVyUiw8ELzOG1b2DZpFzkSrHLhq52twDEdyZHwvp2j4uv/bjvOf23/AcEtTuJbY5Cp4YcAer1IGkUzOo2rn8LQOKjFJw3NTw24nprQXY5aF4wxcqcSdbFQ00H4xFl8Drx4X4CikvAM1tuR8bKIBCBoLnKN10KJG4zKAsc7c9WEB9gnCi6BhVjqoco6t20ILAJuVctvaEZK732cRHDRmGfuihOam0o2CHByUZ/epCcVlRs2wmCnMqsd6aSim3ibBJtm1LGyXW3Bb7tJCPlFtUG+SvPdeEUAB60lNdo+VQbLcwRNVtT68FsLcr1+NotgNihlpExS1V2SFgNbeC8bEhgm8sM17wSi6Us2gxVWJU/5GKBpandvfyYbU1yHCLpCgWGbbPXn40rehEsUXKIJr9DMKgICfjc4bl1YfvUhE/YIECGRqjCxSM9hrybAIkND5OeWfFZsXkxB+qDzb7pUQ3EfQ3Ml6EChEt3D+iS01VqC7EQ/Z/DuPQcz4yChoFQJce2Qr+NNAv0HxofmpXGqgHkAAAAASUVORK5CYII="},b1a1:function(t,e,n){var i=n("f30e"),o=n("57c4"),r=n("bf98"),a=o("species");t.exports=function(t){return r>=51||!i((function(){var e=[],n=e.constructor={};return n[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},b3f9:function(t,e,n){"use strict";var i=n("91fe"),o=n("21d4");i({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},b671:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAD1BMVEX48dr48Nf58tv379X17NJtIBxUAAACFUlEQVQ4y1XRUZakMAgF0Af2AiDWApDZgHZqAV1nZv9rGh7Rj7Y8McUFEg1wvcMESMNVD/neU8Xcaz7nYYkYlYO6Ti82PBI4BvIEg1aj3wKwRvIMgZsUy5LdhCawPFh1sZs4SrlyN9fQKpv8s5dgZ2eLyqqJiu+WkCmUEybXkm3INS01WAiv0PapJ0CZc0SJQUzcWnZYbOOY20iFD8Bk+/j2A3wNxH7GdShFYS5ff237kXh9I9zSkQmIAhOsOSVfJ6DIXTMDaPnzkRJ92S1BQQmXl5LdirgRLLDdcYqcGPwe3QN4xCBiGNbrqq9wpW1XCecChwaQdVOsRDpPCpeoolPdxeXp3WNB9PHVzWBHlygy4NJCCrFHREv6bDt0VGwJZASkpONmm1UseGeFKAQexgaAkrfYWl3AGxWOLL2AIMBNbCXpktmS3k3vHeYjGCPBa43wJTurO3ZFVpQSJdAZGLoHTyk1upkjxMEaIxum3iIARcCa5kSkFAW5fi1mUlL9eyOsaanFmOMruwvEdE3ZYzsRSzo5ewRLXyVPPEvknt8ij4DvCg2O7xOgBCUprEzV4z1WekSpUgI8DT2mrnSOXKRfQavwuKA1F+tFnMKdJSUpMA7wQAifWRkMgjUKKZE4lBl6MCM4B1pq1P4uIjDE6Pq6rL0FnW1nIFmta5vrSvq/Ch4tpqG/ZNyyWa5jZPktq81eYv8Bt5s4iFITOp4AAAAASUVORK5CYII="},c0aa:function(t,e,n){var i=n("2a2f"),o=n("f28d"),r=n("7287"),a=n("c223").f;t.exports=function(t){var e=i.Symbol||(i.Symbol={});o(e,t)||a(e,t,{value:r.f(t)})}},c27e:function(t,e,n){"use strict";var i=n("1240"),o=n.n(i);o.a},c84b:function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"detail-wrapper"},[n("div",{staticClass:"detail"},[n("div",{staticClass:"bar"},[n("el-breadcrumb",{attrs:{separator:"/"}},[n("el-breadcrumb-item",{staticClass:"index",attrs:{to:{path:"/"}}},[t._v("书架")]),n("el-breadcrumb-item",{staticClass:"sub"},[t._v("目录")])],1)],1),n("el-divider"),n("div",{staticClass:"catalog"},t._l(this.$store.state.catalog,(function(e){return n("div",{key:e.index,staticClass:"note",on:{click:function(n){return t.toChapter(e.url,e.title,e.index)}}},[t._v(" "+t._s(e.title)+" ")])})),0)],1)])},o=[],r=n("82ae"),a=n.n(r),s={data:function(){return{key:"value"}},mounted:function(){var t=this;a.a.get("/getChapterList?url="+encodeURIComponent(sessionStorage.getItem("bookUrl"))).then((function(e){t.$store.commit("setCatalog",e.data.data),sessionStorage.setItem("catalog",JSON.stringify(e.data.data))}),(function(t){throw t}))},methods:{toChapter:function(t,e,n){sessionStorage.setItem("chapterID",n),this.$router.push({path:"/chapter"})}}},c=s,l=(n("c27e"),n("623f")),u=Object(l["a"])(c,i,o,!1,null,"6d476c76",null);e["default"]=u.exports},cf68:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAAD1BMVEXm5ubo6Ojp6enr6+vt7e1FnZagAAACrklEQVQ4yx1SixUbMQgT3AKAFwDcAfzpBN1/qMrJS5w7bCQhC6IGSUGYQJd6Ox9ZPXi1AGJBavhUTT0JjYPGAab9WcDYIxsmlnxkayX8mhxCmKHA75az5cfRbWybEExiu08xDSgGym0mwuf3j4SvHeQxDJJzh2zp4iOlrD8iOb4SXyC1wiOLRTcnrje+nGamFeXVKWkmzbFIPChkmJ6Fg7mBpV8n+JGOVCd4jv1thThkjeQGNeafpeV3rsEWLfyWc8tC9jOv6FQ8rRzHOOVB+jCYEUAJpDvh8xHNFm/Tm5p5lw94Pp3NhtKEfQsGvnXhowdZE73hPwxKvjDd4i4PCdd0fe3W5fO8ktAsUAacLgstpUw60JCiPLg2XpkgiqPIYYXJd9ksGIT3q+LlevypzItvO+s0F1dBzVr2QDMUkYmuyGcrIS44mVJ7JVKwQXjYuBYp0Uetecbswzsikzu3gUR8bJC/C8Gd/NAzI/xdUGOYQQHDZ8X2d5XuzGRUiXAi9si5CRgoiToRZPtzLJkd0FUHRHZwJf0BHT1sE7gcnh0jmKKlSSF4/GBirGk5+K9NKlGDCfc9JtPhg78JdabH0YQRKNZnJ8tFnPfXHJb4xum1TTCeEmyEdbyEJLjznMLHuFD2Y9NEkSleIBs7SiCbblhgctVi9ch++kDYnn1C9DA5TvdPsToXM55wI6k+8eKT1blwPTqWb5CFJ+7dTBmab+KHy+xwNtItXhZNSpHD2fxnynrxG3ZBKRe8KBpXk11AnadlccEhr9w1nBBvBylNkv7A8eqpGBCDqhitmWQXBjjdS6idr/QjXWLDeMzMbVDoJuM8zN7WenMZWXgZ2vX3F01J3jHZbwk1LRP+DWEvDJtOUoh/AIaBUz5VpWyhuyx4QtgL/NmgC6kM/JvNe+R/C/5aL7BKIbYAAAAASUVORK5CYII="},d0e3:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEXh7eHl8eXj7+Pn8+eTbH1KAAACPElEQVQozxWPQWrbQABF/0xn3JFKQRTZOIuUsbCCbOgdRoYEOauxkYPcTRyTlPQWIxEltrsRwQ6hK9nEQek6F+gNTE/Q3qLLusv34cN7SH3mFicdYW4gNIhJWXPBRVXzjcFD0IqeU4o4PRbAIVjyico0vJpIifqPfL80QN9DAQY5ucRHE/hpHxBldXe9GilaHKcKMlj6pho2zXgkNdBl0oJ8kiF1DSiJF1ZHBJkQr0Dbux/5I42Zp4cFahJDFGeW6/QjBwmFY/Q7vZ2SnoOdW2parv/Cnm81+m0xrEfiVXQ3W4nOXIqVYi3l6AAQBwMFkViVBANMto4enXHPNTkHBB0oVj4r5vHzCWayrgBvxtygDlDB2CNDjd80ZInY69aKVYZcfJ8DW+fWuc+syEODALx+ojqoafHsthTI+ZW27PGpIeo/cR6YKcbqIuIFhHmBrzAovzIOOJk1ucvcDzrMRYGVBH2yvcAOf0KiKwfRovBI3tm/kW1eemtfNWwIIXE2mJNhvoszfmMBfRCv0OPwd2321uDW3nx2q/BDxFVeoN1g7a6Im8yRnoawa8kbdXnU0cHeTMxKfZGlJgvLb3sKsxgglQnDdAfvj9LUnqWRDo0GiUmPwyU7TAsD7wHeIW3Nfy1qVGKoE9NgJCdYCAexNRob9yCn4DAQmXtQuUtera6bEmTTXhZy6h856xi4mnEl6BI9mfISkLbtJyZIMJIAUd5ZOBEu88KRAk71yxfItj/hpIB0Errv4gO1os4/UICf+o3kkqwAAAAASUVORK5CYII="},d2ee:function(t,e,n){},dcb6:function(t,e,n){"use strict";var i=n("f30e");function o(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=i((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),e.BROKEN_CARET=i((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},deaa:function(t,e,n){"use strict";n("b3f9");var i=n("3d8a"),o=n("f30e"),r=n("57c4"),a=n("21d4"),s=n("2ba5"),c=r("species"),l=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")})),u=function(){return"$0"==="a".replace(/./,"$0")}(),A=r("replace"),f=function(){return!!/./[A]&&""===/./[A]("a","$0")}(),g=!o((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,A){var d=r(t),h=!o((function(){var e={};return e[d]=function(){return 7},7!=""[t](e)})),p=h&&!o((function(){var e=!1,n=/a/;return"split"===t&&(n={},n.constructor={},n.constructor[c]=function(){return n},n.flags="",n[d]=/./[d]),n.exec=function(){return e=!0,null},n[d](""),!e}));if(!h||!p||"replace"===t&&(!l||!u||f)||"split"===t&&!g){var m=/./[d],v=n(d,""[t],(function(t,e,n,i,o){return e.exec===a?h&&!o?{done:!0,value:m.call(e,n,i)}:{done:!0,value:t.call(n,e,i)}:{done:!1}}),{REPLACE_KEEPS_$0:u,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:f}),C=v[0],b=v[1];i(String.prototype,t,C),i(RegExp.prototype,d,2==e?function(t,e){return b.call(t,this,e)}:function(t){return b.call(t,this)})}A&&s(RegExp.prototype[d],"sham",!0)}},df5e:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAMAAAAp4XiDAAAATlBMVEXdzaHh0KPgz6LdzKDezqLczJ7ezZ/fz6Dcy5zi0aXdzZ3fz6Tfz57h0KDg0aLcyZrg0KXi0qPfzZ3j06bh0qbdyJbfzJrhz5/cxpLZwo0vDconAAAFn0lEQVRIxxyPW5LjMAwDAT5FybLl2JnM3P+i6+wXWVC1GoQGaD0h4XM3Q5o4T0HgABHBi6pZ4CDXXcUOFd6VhqC3Kch4EI8w9oMXwvU6m5LOOvcxKMOhuu8i5+5cMjcgb0t4F2uvOoeI3/MlT4IqsbtM9UG2AGSXUOsxzPevnXzK1CSHytZLvx7VdQmUcJsJCxJh2nmHW12Qod1qPjt8pih47uQ9aGpoNWF+yElCt60oH7vdIU/MnlRPSBLC/VwqxcKR8PFqnADN9ih5ufqnTlG9KwCofvs7kKYqOPHTNMQ93j9qNImFw9vjHPZ0F1m8hUUVB/Q/TrRYDMXr9++APMFARAt6sPh6wVAXzxUGhZsFUwCNfPZ8/72TAHebAhvuOuT3gO1Vn5d9Jd5sBRkg0p2seL9B7ulkjFJFIt9HPpLzdSzzMP3UcodAfMqC6pBuET2heHK1itZf1GZ1bi0BwOSxiCS8f/JBHMPMM4XCu3Mt1uz9lJbDJRqsKDZuikzkvskQEz6hanfDfO494azY5JpqPqOF1RhxD9XYEdaNxiqWqakKgmPfmrsta8KAiwF4HBxGVUJAgeSqQaiRRZJ7D2jedhw5t1CIAKxag0CBA60BpoBE6DcUi8O5AuM4pLfN0kHLmeu2B4e6HofqbgxsTWUw3PAODqa1oDtyzgXBlusi1KFdclMPE8O3jvLJ8RNi5/RxDQVzVmXA233XQ4KummunfxvLOZo+iH37964YjP06995CTdu9hsvErqJNzmf4wTrZ5DL7+qW9EoLnadrx67b8dUtrJnBXaT1N1uvPaYRKpWkq52xNsMN7vv4Sdryt/f4MhQoMCKnvVxikai1CQ6ZsnwJDc8+3Y/z8HcfvYQNq66pnAu1Hwa+3KNSwbNu8h3nDPqTl9fl7tx8fBhFfdS0o0F3JUKEZtZG9b/LZEM95lzaR30OnWPzroMxyZYdBIMoMnpN0J+m7/40+/P4soFSUjgzE7yY5zrMJuoZv0CmpVguYx1pprfb5HOviRVhHUVi/352shxCYrYBZxGtVaxiAz/MsaGSIsB7R1t4zJXH//n7RTTQQwxqcGEqEvklFHUgiO2GvJV+jAIPR+N29usWDoiSOVrN3XuqT1egQJAAU9EwslVJC8u0rGcy+WPqktJhjfMpatIG6CDAb0v5H34MGKqiVRue7GGLZ9Otxtt4JIrAhxBDwDuqI9JavcO0A7GlqFt219tH/bln9jBXzaKWAEqJV0CBxs5TwM8EvUPHaa8S86vN303MVWOsl3goDBHPWSoQ9c0kQmCKljfsKNH1+ofEOHW8a9a7glZGS8fPieL/SRSs0LAhI4FDTnXs1QYtubv2+IXPZpHB4bhivRexBkYKsSrYXNjvMUbVXpVJ+N6haV72c1k2zrnv5IYBMJBYTSZx0KTkoM3vY93rU/qs7zHplc/3d2ACadhFWByrn9LUk2IWb5JywvawTQc3F0iz+lgsBmInAIemBJtft2plKIlAFOgcroigrG2XlDsAzywQECNyaI8yr2ogoh7D4qJOYmZBzQgoZAM1PAcB8sDrr1uE5CDMR+nWSSVUGUCHAs8Vd21HOE0FzNj37pX0sLp9p3K8k++xxpkmzDxK64rmTSJnDUuIgTeslui6lg92jonZXI4jqNiUuzN4IagcKMjCniMGCODoo8T4tGDprn2hRww+NrnYiCwokd9iiWrkmbRfXYGLAoZrjO1lVQKExjUy5fIkgJURmz2uGFdASwwlWx5gDVTMK7hP6ISRVsFbYNmqtZL9MQtio285PaekyzDhZmtdexCYB0SZcTmBdhvdbmAEonk8hwcHQuZN1kVqrhyKoHHsnQhQAjF7SG533Da2S4LGjx1LoZqp7XeKQLDUBmYmydG0NQHpMeR5lRIRQc1PQ2ASMQflF4YBDMt0/GFlEHeRwCcEAAAAASUVORK5CYII="},e160:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyAgMAAABjUWAiAAAADFBMVEX6+fP8+/X+/ff///kbczPAAAACeElEQVQozxXHQUgUUQAG4P8936yzs6VvZNZmN9QxVxiF9OLBoOjtOC6rQq6ygXjI2fCQBdXBg4egtzFGdqkoI+zgBFbqkm3hQSxhFYLotOcubeKhOnVYoqQy+m4f5g5TvpX0xHLbLY9j8SMhJp+Jk4LfAUS2kVRIjILmnwGBTX42PhCVlDJQkIiy2nWAvaJ1h+oFIpJ0hMSYVbyyrgDWshcMpMyL1brPDQKWmduO+KTJ6XeXAMK9Yc3FpD7atyNwg6kt5XgFpLPhjUTFSYVn2abDiugGShwD8JTVRJVo/2ecuKtRb/qc4BK+9TboFfokog4T2Fn6Oqdnsjk90NMS76Rji6E0NmwkPBAZ4Xbkw8KoDAkAbEhkc78e9omxxgxg6qa5HvMv+UZbCV0qmHnSHKl5TxeA2XTCGWekR581mwC5crBH81PznASqB9va3TbkYAjJPLfg5uBfXaJgIgIBv9eessRIhxe7PA7kj6uUMeMaQ/OEQOYRaaHlqH2Gxwsl6E/pwVY5FH7uCypBZPKvDQyVziYBrAkMURe2MOOOxG/eQpp5PF+bFzUV5HtPj9GeiVSNZDELleifYTp9NAjsoiXg4cW+4ZORkdSMB/B74aAdjhsVakhgkugsbmqcDSLEoWp8zRjrux3tli6Q5uM3E+maT99Wy0RiP7tboiuRZle2c6CYeL2kcUc1KvPtQKucogMadKVTQOJYCeyCYlhQQ/Q7Etfd/vBygy9iqy+LyHeF46saCYvW6ingsbA9RBWtdi8GgUXW+oQx9/wP6bAAX1TWeV+CbShZDlQ9xT6SoSxZmKRAkmXb60kzEzkRF+Ccb94BGspGJoN/UzmyR4wjXHAAAAAASUVORK5CYII="},e1dd:function(t,e,n){var i=n("d68d"),o=n("67ea"),r=n("57c4"),a=r("match");t.exports=function(t){var e;return i(t)&&(void 0!==(e=t[a])?!!e:"RegExp"==o(t))}},e350:function(t,e,n){var i=n("c0aa");i("iterator")},ec0f:function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyBAMAAADsEZWCAAAALVBMVEXx58b168ny6Mjz6sn06sf27Mvw5sTz6cbw5cLy58T37svv47/168v37s7t4Ltrv0//AAAEjUlEQVQ4yw2Ty2sTURxGf3dmOqmPxb0zmaStCnfmZpL6gpmbxIpUSMZGrSJkxsZiVZimNVaqMklrUnWTRq2KIDFWWx+IFrIRFxXEB4KIgqu6EBdu7M6FIPg32PW3+DhwDmBaYrK56KP4HGIsvg/uvOV0wK+qgBMlO9BujuH4DSJlOseqV5a/BEF97gt0ChyIPqBhXI9BtqtIB8vJB/LdCQ3OVjaLNX0g7+OmoI4e7nkemAqX6o8vg0yyQAyQS7IfgvFbI+6QyI3R4KELxw7kwM2ooQfyQigYnwY5MZbMlHI1DvnQVCoVcrt+R+bO7vPDif3ybNajwqAAe443dpfDsPt379VMWZzGRuqM79mQF+DUz9nt74bQ8J/O80MtVR51U02JKKmTCvTzLVf+vuxP/aHnPo9+2bW+zVsJ0Y630/CrfzX+b+UL+7O68Rczv+7lrMh5etfKXvhc2rk6KforxuoO2xB2tcxKfeXHt18rHOiHI/0RRjW/YGRDkHiwo3nzqL60o58C/bgRuaj7vk+QOwOhpnFNdjuWpKMCGP8Yapu9Ty5FTHKQLGSEFikjd9ADwP9ciaNNjc5qMH6w50AF/LKOsOYqsOG9GjKgc7ZXolqntm6fysJ6Ma6ll2CiqmOgE6O7x1wXExklbeqMYcwsmJmOoigt8SBg2WfilDSsAZJcBxDcrqtBXzFQJqZNHfscyIhoZlygAtyYAceah+elrFbI+46gEHDGiW878Kj7JpWyfhg6iyRMymV1MKBSeVpfgLHIohyTojI6sRyK1VpcqzVZeEBLOnA9unhGKUXPJDYtV9Dxuz4iA5xSkSWhCJdAiJR9PHlvfvbntbrR14FDqUNRAYDJmSnv3oKxuz5+7fiblgVJyYLTbgUM05P7LESkoXvyWNfb0aUU6FZizgQIa25VqKQZqFrk6v6BsqqIHlQmkQ9KrBhkC20/DrFsAFEEYLjM+lj2wYHXCwnNvZQR42XJ2iVK+UBXnI+OBE6oXpUUHiQ1yg0MhA03iwGbnOdQYc1CMiPIPQrCQJFH4L4BMFktAtKd9PN5gnU2Gra4KuK+V+mjtBRpAGIqDVe4wnSnajiFGO5d7smvhVQEMEYwqshrENIEaY7YeblJYtsb3QhAHWZCEKK67swwPMKw0If1Ta+6DgHmlgPzcUTSbi3rrv1Y64/BYEMPQ5SDHUOR022B4QRF6xLUPAaPX/V4IDI5N2BMwx4LqO1uO4j6uW7NvM7lATqGAxY/ZHVgoGZbu7SvkNR75x6qGSB23FdouENVwN7sCbewTdsXGrrnQ5ZZKOCOFtMTIzxlPu6eYmtL+nMFmoK7OeXajn86r9sqWbfmvHC4IagE5qfCPGZvLSq5F55hHIxJFa4/vRxHBlz0og4TojU1l/MOHJX17lybdF0mQhFO44JYUNt3UA473IXw/iPfDWtKG5oFSXIF5iU/VnyDSjxxeDk3jAXRyVyGTNB9FxH9qcFDNJpVbt2y9LytUXkK7Py6+z1RezHQqnoY8XcLimmd8dCnBhQCuaGpJCq3SoIlmYvLz8UkWhJw7T8k+Db/DYEKwgAAAABJRU5ErkJggg=="},ef8e:function(t,e,n){"use strict";var i=n("3303").charAt,o=n("d0e2"),r=n("5646"),a="String Iterator",s=o.set,c=o.getterFor(a);r(String,"String",(function(t){s(this,{type:a,string:String(t),index:0})}),(function(){var t,e=c(this),n=e.string,o=e.index;return o>=n.length?{value:void 0,done:!0}:(t=i(n,o),e.index+=t.length,{value:t,done:!1})}))},fb11:function(t,e,n){"use strict";var i=n("f30e");t.exports=function(t,e){var n=[][t];return!!n&&i((function(){n.call(null,e||function(){throw 1},1)}))}},fc88:function(t,e,n){"use strict";var i=n("91fe"),o=n("7a23"),r=n("d5dc"),a=n("f28d"),s=n("d68d"),c=n("c223").f,l=n("f69c"),u=r.Symbol;if(o&&"function"==typeof u&&(!("description"in u.prototype)||void 0!==u().description)){var A={},f=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof f?new u(t):void 0===t?u():u(t);return""===t&&(A[e]=!0),e};l(f,u);var g=f.prototype=u.prototype;g.constructor=f;var d=g.toString,h="Symbol(test)"==String(u("test")),p=/^Symbol\((.*)\)[^)]+$/;c(g,"description",{configurable:!0,get:function(){var t=s(this)?this.valueOf():this,e=d.call(t);if(a(A,t))return"";var n=h?e.slice(7,-1):e.replace(p,"$1");return""===n?void 0:n}}),i({global:!0,forced:!0},{Symbol:f})}}}]); \ No newline at end of file diff --git a/app/src/main/assets/web/manifest.json b/app/src/main/assets/web/manifest.json new file mode 100644 index 000000000..0e2f5f966 --- /dev/null +++ b/app/src/main/assets/web/manifest.json @@ -0,0 +1 @@ +{"name":"yd-web-tool","short_name":"yd-web-tool","theme_color":"#4DBA87","icons":[{"src":"./img/icons/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"./img/icons/android-chrome-512x512.png","sizes":"512x512","type":"image/png"},{"src":"./img/icons/android-chrome-maskable-192x192.png","sizes":"192x192","type":"image/png","purpose":"maskable"},{"src":"./img/icons/android-chrome-maskable-512x512.png","sizes":"512x512","type":"image/png","purpose":"maskable"}],"start_url":".","display":"standalone","background_color":"#000000"} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/App.kt b/app/src/main/java/io/legado/app/App.kt index 7cb9eff1f..5c4c02964 100644 --- a/app/src/main/java/io/legado/app/App.kt +++ b/app/src/main/java/io/legado/app/App.kt @@ -73,7 +73,7 @@ class App : Application() { .primaryColor( getPrefInt("colorPrimaryNight", getCompatColor(R.color.md_blue_grey_600)) ).accentColor( - getPrefInt("colorAccentNight", getCompatColor(R.color.md_brown_800)) + getPrefInt("colorAccentNight", getCompatColor(R.color.md_deep_orange_800)) ).backgroundColor( getPrefInt("colorBackgroundNight", getCompatColor(R.color.shine_color)) ).bottomBackground( diff --git a/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt b/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt index f864aa4e8..6a72c911f 100644 --- a/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt +++ b/app/src/main/java/io/legado/app/base/adapter/CommonRecyclerAdapter.kt @@ -290,12 +290,11 @@ abstract class CommonRecyclerAdapter(protected val context: Context) : return footerItems?.size() ?: 0 } - fun getItem(position: Int): ITEM? = - if (position in 0 until items.size) items[position] else null + fun getItem(position: Int): ITEM? = items.getOrNull(position) fun getItemByLayoutPosition(position: Int): ITEM? { val pos = position - getHeaderCount() - return if (pos in 0 until items.size) items[pos] else null + return items.getOrNull(pos) } fun getItems(): List = items diff --git a/app/src/main/java/io/legado/app/constant/AppConst.kt b/app/src/main/java/io/legado/app/constant/AppConst.kt index 810e6deb2..57724c62f 100644 --- a/app/src/main/java/io/legado/app/constant/AppConst.kt +++ b/app/src/main/java/io/legado/app/constant/AppConst.kt @@ -49,6 +49,7 @@ object AppConst { val bookGroupAll = BookGroup(-1, App.INSTANCE.getString(R.string.all)) val bookGroupLocal = BookGroup(-2, App.INSTANCE.getString(R.string.local)) val bookGroupAudio = BookGroup(-3, App.INSTANCE.getString(R.string.audio)) + val bookGroupNone = BookGroup(-4, App.INSTANCE.getString(R.string.no_group)) const val notificationIdRead = 1144771 const val notificationIdAudio = 1144772 diff --git a/app/src/main/java/io/legado/app/constant/EventBus.kt b/app/src/main/java/io/legado/app/constant/EventBus.kt index 88031b4fc..e24ba8000 100644 --- a/app/src/main/java/io/legado/app/constant/EventBus.kt +++ b/app/src/main/java/io/legado/app/constant/EventBus.kt @@ -11,7 +11,6 @@ object EventBus { const val TIME_CHANGED = "timeChanged" const val UP_CONFIG = "upConfig" const val OPEN_CHAPTER = "openChapter" - const val REPLACE = "replace" const val AUDIO_SUB_TITLE = "audioSubTitle" const val AUDIO_STATE = "audioState" const val AUDIO_PROGRESS = "audioProgress" diff --git a/app/src/main/java/io/legado/app/constant/PreferKey.kt b/app/src/main/java/io/legado/app/constant/PreferKey.kt index 1ba9ba6cf..8913956d3 100644 --- a/app/src/main/java/io/legado/app/constant/PreferKey.kt +++ b/app/src/main/java/io/legado/app/constant/PreferKey.kt @@ -3,7 +3,6 @@ package io.legado.app.constant object PreferKey { const val versionCode = "versionCode" const val themeMode = "themeMode" - const val downloadPath = "downloadPath" const val hideStatusBar = "hideStatusBar" const val clickTurnPage = "clickTurnPage" const val clickAllNext = "clickAllNext" @@ -43,4 +42,5 @@ object PreferKey { const val shareLayout = "shareLayout" const val readStyleSelect = "readStyleSelect" const val systemTypefaces = "system_typefaces" + const val readBodyToLh = "readBodyToLh" } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/AppDatabase.kt b/app/src/main/java/io/legado/app/data/AppDatabase.kt index f32d6a199..f7eabc4b9 100644 --- a/app/src/main/java/io/legado/app/data/AppDatabase.kt +++ b/app/src/main/java/io/legado/app/data/AppDatabase.kt @@ -18,7 +18,7 @@ import kotlinx.coroutines.launch ReplaceRule::class, SearchBook::class, SearchKeyword::class, Cookie::class, RssSource::class, Bookmark::class, RssArticle::class, RssReadRecord::class, RssStar::class, TxtTocRule::class], - version = 8, + version = 10, exportSchema = true ) abstract class AppDatabase : RoomDatabase() { diff --git a/app/src/main/java/io/legado/app/data/dao/BookChapterDao.kt b/app/src/main/java/io/legado/app/data/dao/BookChapterDao.kt index 38cc452f2..d0588bec8 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookChapterDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookChapterDao.kt @@ -10,16 +10,16 @@ import io.legado.app.data.entities.BookChapter @Dao interface BookChapterDao { - @Query("select * from chapters where bookUrl = :bookUrl") + @Query("select * from chapters where bookUrl = :bookUrl order by `index`") fun observeByBook(bookUrl: String): LiveData> - @Query("SELECT * FROM chapters where bookUrl = :bookUrl and title like '%'||:key||'%'") + @Query("SELECT * FROM chapters where bookUrl = :bookUrl and title like '%'||:key||'%' order by `index`") fun liveDataSearch(bookUrl: String, key: String): LiveData> - @Query("select * from chapters where bookUrl = :bookUrl") + @Query("select * from chapters where bookUrl = :bookUrl order by `index`") fun getChapterList(bookUrl: String): List - @Query("select * from chapters where bookUrl = :bookUrl and `index` >= :start and `index` <= :end") + @Query("select * from chapters where bookUrl = :bookUrl and `index` >= :start and `index` <= :end order by `index`") fun getChapterList(bookUrl: String, start: Int, end: Int): List @Query("select * from chapters where bookUrl = :bookUrl and `index` = :index") diff --git a/app/src/main/java/io/legado/app/data/dao/BookDao.kt b/app/src/main/java/io/legado/app/data/dao/BookDao.kt index b323a2711..c91e01648 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookDao.kt @@ -12,16 +12,16 @@ interface BookDao { @Query("SELECT * FROM books order by durChapterTime desc") fun observeAll(): LiveData> - @Query("SELECT * FROM books WHERE type = ${BookType.audio} order by durChapterTime desc") + @Query("SELECT * FROM books WHERE type = ${BookType.audio}") fun observeAudio(): LiveData> - @Query("SELECT * FROM books WHERE origin = '${BookType.local}' order by durChapterTime desc") + @Query("SELECT * FROM books WHERE origin = '${BookType.local}'") fun observeLocal(): LiveData> - @Query("SELECT bookUrl FROM books WHERE origin = '${BookType.local}' order by durChapterTime desc") + @Query("SELECT bookUrl FROM books WHERE origin = '${BookType.local}'") fun observeLocalUri(): LiveData> - @Query("SELECT * FROM books WHERE origin <> '${BookType.local}' and type = 0 order by durChapterTime desc") + @Query("SELECT * FROM books WHERE origin <> '${BookType.local}' and type = 0") fun observeDownload(): LiveData> @Query("SELECT * FROM books WHERE (`group` & :group) > 0") @@ -30,15 +30,27 @@ interface BookDao { @Query("select * from books where (SELECT sum(groupId) FROM book_groups) & `group` = 0") fun observeNoGroup(): LiveData> + @Query("select count(bookUrl) from books where (SELECT sum(groupId) FROM book_groups) & `group` = 0") + fun observeNoGroupSize(): LiveData + @Query("SELECT * FROM books WHERE name like '%'||:key||'%' or author like '%'||:key||'%'") fun liveDataSearch(key: String): LiveData> + @Query("SELECT * FROM books WHERE (`group` & :group) > 0") + fun getBooksByGroup(group: Int): List + @Query("SELECT * FROM books WHERE `name` in (:names)") fun findByName(vararg names: String): List @Query("SELECT * FROM books WHERE bookUrl = :bookUrl") fun getBook(bookUrl: String): Book? + @Query("SELECT * FROM books WHERE name = :name and author = :author") + fun getBook(name: String, author: String): Book? + + @get:Query("select count(bookUrl) from books where (SELECT sum(groupId) FROM book_groups) & `group` = 0") + val noGroupSize: Int + @get:Query("SELECT * FROM books where origin <> '${BookType.local}' and type = 0") val webBooks: List @@ -57,6 +69,9 @@ interface BookDao { @get:Query("SELECT COUNT(*) FROM books") val allBookCount: Int + @get:Query("select max(`order`) from books") + val maxOrder: Int + @Insert(onConflict = OnConflictStrategy.REPLACE) fun insert(vararg book: Book) diff --git a/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt b/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt index 9ce5c65be..55d5ada4c 100644 --- a/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/BookSourceDao.kt @@ -50,9 +50,12 @@ interface BookSourceDao { @get:Query("select * from book_sources order by customOrder asc") val all: List - @get:Query("select * from book_sources where enabled = 1 order by customOrder asc") + @get:Query("select * from book_sources where enabled = 1 order by customOrder") val allEnabled: List + @get:Query("select * from book_sources where enabled = 1 and bookSourceType = 0 order by customOrder") + val allTextEnabled: List + @Query("select * from book_sources where bookSourceUrl = :key") fun getBookSource(key: String): BookSource? diff --git a/app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt b/app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt index fbf3c3611..10bf63933 100644 --- a/app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt +++ b/app/src/main/java/io/legado/app/data/dao/RssArticleDao.kt @@ -12,17 +12,18 @@ interface RssArticleDao { fun get(origin: String, link: String): RssArticle? @Query( - """select t1.link, t1.origin, t1.`order`, t1.title, t1.content, t1.description, t1.image, t1.pubDate, ifNull(t2.read, 0) as read + """select t1.link, t1.sort, t1.origin, t1.`order`, t1.title, t1.content, t1.description, t1.image, t1.pubDate, ifNull(t2.read, 0) as read from rssArticles as t1 left join rssReadRecords as t2 - on t1.link = t2.record where origin = :origin order by `order` desc""" + on t1.link = t2.record where origin = :origin and sort = :sort + order by `order` desc""" ) - fun liveByOrigin(origin: String): LiveData> + fun liveByOriginSort(origin: String, sort: String): LiveData> @Insert(onConflict = OnConflictStrategy.REPLACE) fun insert(vararg rssArticle: RssArticle) - @Query("delete from rssArticles where origin = :origin and `order` < :order") - fun clearOld(origin: String, order: Long) + @Query("delete from rssArticles where origin = :origin and sort = :sort and `order` < :order") + fun clearOld(origin: String, sort: String, order: Long) @Update fun update(vararg rssArticle: RssArticle) diff --git a/app/src/main/java/io/legado/app/data/entities/Book.kt b/app/src/main/java/io/legado/app/data/entities/Book.kt index 833561f1b..fd96d137b 100644 --- a/app/src/main/java/io/legado/app/data/entities/Book.kt +++ b/app/src/main/java/io/legado/app/data/entities/Book.kt @@ -4,7 +4,6 @@ import android.os.Parcelable import androidx.room.Entity import androidx.room.Ignore import androidx.room.Index -import androidx.room.PrimaryKey import io.legado.app.constant.AppPattern import io.legado.app.constant.BookType import io.legado.app.utils.GSON @@ -15,9 +14,12 @@ import java.nio.charset.Charset import kotlin.math.max @Parcelize -@Entity(tableName = "books", indices = [(Index(value = ["bookUrl"], unique = true))]) +@Entity( + tableName = "books", + primaryKeys = ["name", "author"], + indices = [(Index(value = ["bookUrl"], unique = true))] +) data class Book( - @PrimaryKey override var bookUrl: String = "", // 详情页Url(本地书源存储完整文件路径) var tocUrl: String = "", // 目录页Url (toc=table of Contents) var origin: String = BookType.local, // 书源URL(默认BookType.local) @@ -31,7 +33,7 @@ data class Book( var intro: String? = null, // 简介内容(书源获取) var customIntro: String? = null, // 简介内容(用户修改) var charset: String? = null, // 自定义字符集名称(仅适用于本地书籍) - var type: Int = 0, // @BookType + var type: Int = 0, // 0:text 1:audio var group: Int = 0, // 自定义分组索引号 var latestChapterTitle: String? = null, // 最新章节标题 var latestChapterTime: Long = System.currentTimeMillis(), // 最新章节标题更新时间 diff --git a/app/src/main/java/io/legado/app/data/entities/BookSource.kt b/app/src/main/java/io/legado/app/data/entities/BookSource.kt index 78852a4ec..ad16bf99f 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookSource.kt @@ -169,7 +169,7 @@ data class BookSource( } } val b = a.split("(&&|\n)+".toRegex()) - b.map { c -> + b.forEach { c -> val d = c.split("::") if (d.size > 1) exploreKinds.add(ExploreKind(d[0], d[1])) diff --git a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt index c74597e74..15dafa3ab 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssArticle.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssArticle.kt @@ -9,6 +9,7 @@ import androidx.room.Entity ) data class RssArticle( var origin: String = "", + var sort: String = "", var title: String = "", var order: Long = 0, var link: String = "", @@ -36,6 +37,7 @@ data class RssArticle( fun toStar(): RssStar { return RssStar( origin = origin, + sort = sort, title = title, starTime = System.currentTimeMillis(), link = link, diff --git a/app/src/main/java/io/legado/app/data/entities/RssSource.kt b/app/src/main/java/io/legado/app/data/entities/RssSource.kt index 999b12523..e9a58ee98 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssSource.kt @@ -23,6 +23,7 @@ data class RssSource( var sourceIcon: String = "", var sourceGroup: String? = null, var enabled: Boolean = true, + var sortUrl: String? = null, //列表规则 var ruleArticles: String? = null, var ruleNextPage: String? = null, @@ -99,4 +100,16 @@ data class RssSource( return a == b || (a.isNullOrEmpty() && b.isNullOrEmpty()) } + fun sortUrls(): LinkedHashMap { + val sortMap = linkedMapOf() + sortUrl?.split("(&&|\n)+".toRegex())?.forEach { c -> + val d = c.split("::") + if (d.size > 1) + sortMap[d[0]] = d[1] + } + if (sortMap.isEmpty()) { + sortMap[""] = sourceUrl + } + return sortMap + } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/data/entities/RssStar.kt b/app/src/main/java/io/legado/app/data/entities/RssStar.kt index 5199b586d..94196416b 100644 --- a/app/src/main/java/io/legado/app/data/entities/RssStar.kt +++ b/app/src/main/java/io/legado/app/data/entities/RssStar.kt @@ -9,6 +9,7 @@ import androidx.room.Entity ) data class RssStar( var origin: String = "", + var sort: String = "", var title: String = "", var starTime: Long = 0, var link: String = "", @@ -16,4 +17,17 @@ data class RssStar( var description: String? = null, var content: String? = null, var image: String? = null -) \ No newline at end of file +) { + fun toRssArticle(): RssArticle { + return RssArticle( + origin = origin, + sort = sort, + title = title, + link = link, + pubDate = pubDate, + description = description, + content = content, + image = image + ) + } +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/help/AppConfig.kt b/app/src/main/java/io/legado/app/help/AppConfig.kt index 7e9c05834..9d2a3f679 100644 --- a/app/src/main/java/io/legado/app/help/AppConfig.kt +++ b/app/src/main/java/io/legado/app/help/AppConfig.kt @@ -1,6 +1,7 @@ package io.legado.app.help import android.content.Context +import android.content.pm.PackageManager import io.legado.app.App import io.legado.app.R import io.legado.app.constant.PreferKey @@ -32,6 +33,9 @@ object AppConfig { App.INSTANCE.putPrefBoolean("transparentStatusBar", value) } + val requestedDirection: String? + get() = App.INSTANCE.getPrefString(R.string.pk_requested_direction) + var backupPath: String? get() = App.INSTANCE.getPrefString(PreferKey.backupPath) set(value) { @@ -49,7 +53,7 @@ object AppConfig { } val autoRefreshBook: Boolean - get() = App.INSTANCE.getPrefBoolean(App.INSTANCE.getString(R.string.pk_auto_refresh)) + get() = App.INSTANCE.getPrefBoolean(R.string.pk_auto_refresh) var threadCount: Int get() = App.INSTANCE.getPrefInt(PreferKey.threadCount, 16) @@ -111,9 +115,32 @@ object AppConfig { App.INSTANCE.putPrefBoolean("bookGroupAudio", value) } + var bookGroupNoneShow: Boolean + get() = App.INSTANCE.getPrefBoolean("bookGroupNone", false) + set(value) { + App.INSTANCE.putPrefBoolean("bookGroupNone", value) + } + var elevation: Int get() = App.INSTANCE.getPrefInt("elevation", -1) set(value) { App.INSTANCE.putPrefInt("elevation", value) } + + val readBodyToLh: Boolean get() = App.INSTANCE.getPrefBoolean(PreferKey.readBodyToLh, true) + + val isGooglePlay: Boolean get() = App.INSTANCE.channel == "google" } + +val Context.channel: String + get() { + try { + val pm = packageManager + val appInfo = pm.getApplicationInfo(packageName, PackageManager.GET_META_DATA); + return appInfo.metaData.getString("channel") ?: "" + } catch (e: Exception) { + e.printStackTrace(); + } + return "" + } + diff --git a/app/src/main/java/io/legado/app/help/BookHelp.kt b/app/src/main/java/io/legado/app/help/BookHelp.kt index b7b45baea..514c5327c 100644 --- a/app/src/main/java/io/legado/app/help/BookHelp.kt +++ b/app/src/main/java/io/legado/app/help/BookHelp.kt @@ -1,16 +1,16 @@ package io.legado.app.help -import android.net.Uri -import androidx.documentfile.provider.DocumentFile -import com.github.houbb.opencc4j.core.impl.ZhConvertBootstrap +import com.hankcs.hanlp.HanLP import io.legado.app.App import io.legado.app.constant.EventBus -import io.legado.app.constant.PreferKey import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookChapter import io.legado.app.data.entities.ReplaceRule import io.legado.app.model.localBook.AnalyzeTxtFile -import io.legado.app.utils.* +import io.legado.app.utils.FileUtils +import io.legado.app.utils.MD5Utils +import io.legado.app.utils.postEvent +import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main import kotlinx.coroutines.withContext import org.apache.commons.text.similarity.JaccardSimilarity @@ -20,12 +20,9 @@ import kotlin.math.min object BookHelp { private const val cacheFolderName = "book_cache" - val downloadPath: String - get() = App.INSTANCE.getPrefString(PreferKey.downloadPath) - ?: App.INSTANCE.getExternalFilesDir(null)?.absolutePath - ?: App.INSTANCE.cacheDir.absolutePath - - private val downloadUri get() = Uri.parse(downloadPath) + private val downloadDir: File = + App.INSTANCE.getExternalFilesDir(null) + ?: App.INSTANCE.cacheDir private fun bookFolderName(book: Book): String { return formatFolderName(book.name) + MD5Utils.md5Encode16(book.bookUrl) @@ -40,137 +37,73 @@ object BookHelp { } fun clearCache() { - if (downloadPath.isContentPath()) { - DocumentFile.fromTreeUri(App.INSTANCE, downloadUri) - ?.findFile(cacheFolderName) - ?.delete() - } else { - FileUtils.deleteFile( - FileUtils.getPath( - File(downloadPath), - subDirs = *arrayOf(cacheFolderName) - ) + FileUtils.deleteFile( + FileUtils.getPath( + downloadDir, + subDirs = *arrayOf(cacheFolderName) ) - } + ) } @Synchronized fun saveContent(book: Book, bookChapter: BookChapter, content: String) { if (content.isEmpty()) return - if (downloadPath.isContentPath()) { - DocumentFile.fromTreeUri(App.INSTANCE, downloadUri)?.let { root -> - DocumentUtils.createFileIfNotExist( - root, - formatChapterName(bookChapter), - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - )?.uri?.writeText(App.INSTANCE, content) - } - } else { - FileUtils.createFileIfNotExist( - File(downloadPath), - formatChapterName(bookChapter), - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - ).writeText(content) - } + FileUtils.createFileIfNotExist( + downloadDir, + formatChapterName(bookChapter), + subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) + ).writeText(content) postEvent(EventBus.SAVE_CONTENT, bookChapter) } fun getChapterFiles(book: Book): List { val fileNameList = arrayListOf() - if (downloadPath.isContentPath()) { - DocumentFile.fromTreeUri(App.INSTANCE, downloadUri)?.let { root -> - DocumentUtils.createFolderIfNotExist( - root, - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - )?.let { bookDoc -> - DocumentUtils.listFiles(App.INSTANCE, bookDoc.uri).forEach { - fileNameList.add(it.name) - } - } - } - } else { - FileUtils.createFolderIfNotExist( - File(downloadPath), - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - ).list()?.let { - fileNameList.addAll(it) - } + FileUtils.createFolderIfNotExist( + downloadDir, + subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) + ).list()?.let { + fileNameList.addAll(it) } return fileNameList } fun hasContent(book: Book, bookChapter: BookChapter): Boolean { - when { - book.isLocalBook() -> { - return true - } - downloadPath.isContentPath() -> { - DocumentFile.fromTreeUri(App.INSTANCE, downloadUri)?.let { root -> - return DocumentUtils.exists( - root, - formatChapterName(bookChapter), - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - ) - } - } - else -> { - return FileUtils.exists( - File(downloadPath), - formatChapterName(bookChapter), - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - ) - } + return if (book.isLocalBook()) { + true + } else { + FileUtils.exists( + downloadDir, + formatChapterName(bookChapter), + subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) + ) } - return false } fun getContent(book: Book, bookChapter: BookChapter): String? { - when { - book.isLocalBook() -> { - return AnalyzeTxtFile.getContent(book, bookChapter) - } - downloadPath.isContentPath() -> { - DocumentFile.fromTreeUri(App.INSTANCE, downloadUri)?.let { root -> - return DocumentUtils.getDirDocument( - root, - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - )?.findFile(formatChapterName(bookChapter)) - ?.uri?.readText(App.INSTANCE) - } - } - else -> { - val file = FileUtils.getFile( - File(downloadPath), - formatChapterName(bookChapter), - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - ) - if (file.exists()) { - return file.readText() - } + if (book.isLocalBook()) { + return AnalyzeTxtFile.getContent(book, bookChapter) + } else { + val file = FileUtils.getFile( + downloadDir, + formatChapterName(bookChapter), + subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) + ) + if (file.exists()) { + return file.readText() } } return null } fun delContent(book: Book, bookChapter: BookChapter) { - when { - book.isLocalBook() -> return - downloadPath.isContentPath() -> { - DocumentFile.fromTreeUri(App.INSTANCE, downloadUri)?.let { root -> - DocumentUtils.getDirDocument( - root, - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - )?.findFile(formatChapterName(bookChapter)) - ?.delete() - } - } - else -> { - FileUtils.createFileIfNotExist( - File(downloadPath), - formatChapterName(bookChapter), - subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) - ).delete() - } + if (book.isLocalBook()) { + return + } else { + FileUtils.createFileIfNotExist( + downloadDir, + formatChapterName(bookChapter), + subDirs = *arrayOf(cacheFolderName, bookFolderName(book)) + ).delete() } } @@ -242,24 +175,16 @@ object BookHelp { private var replaceRules: List = arrayListOf() @Synchronized - fun upReplaceRules(name: String? = null, origin: String? = null) { - if (name != null) { - if (bookName != name || bookOrigin != origin) { - replaceRules = if (origin.isNullOrEmpty()) { - App.db.replaceRuleDao().findEnabledByScope(name) - } else { - App.db.replaceRuleDao().findEnabledByScope(name, origin) - } - bookName = name - bookOrigin = origin - } - } else { - val o = bookOrigin - bookName?.let { - replaceRules = if (o.isNullOrEmpty()) { - App.db.replaceRuleDao().findEnabledByScope(it) - } else { - App.db.replaceRuleDao().findEnabledByScope(it, o) + suspend fun upReplaceRules() { + withContext(IO) { + synchronized(this) { + val o = bookOrigin + bookName?.let { + replaceRules = if (o.isNullOrEmpty()) { + App.db.replaceRuleDao().findEnabledByScope(it) + } else { + App.db.replaceRuleDao().findEnabledByScope(it, o) + } } } } @@ -274,7 +199,17 @@ object BookHelp { ): String { var c = content if (enableReplace) { - upReplaceRules(name, origin) + synchronized(this) { + if (bookName != name || bookOrigin != origin) { + bookName = name + bookOrigin = origin + replaceRules = if (origin.isNullOrEmpty()) { + App.db.replaceRuleDao().findEnabledByScope(name) + } else { + App.db.replaceRuleDao().findEnabledByScope(name, origin) + } + } + } replaceRules.forEach { item -> item.pattern.let { if (it.isNotEmpty()) { @@ -296,12 +231,17 @@ object BookHelp { if (!c.substringBefore("\n").contains(title)) { c = "$title\n$c" } - when (AppConfig.chineseConverterType) { - 1 -> c = ZhConvertBootstrap.newInstance().toSimple(c) - 2 -> c = ZhConvertBootstrap.newInstance().toTraditional(c) + try { + when (AppConfig.chineseConverterType) { + 1 -> c = HanLP.convertToSimplifiedChinese(c) + 2 -> c = HanLP.convertToTraditionalChinese(c) + } + } catch (e: Exception) { + withContext(Main) { + App.INSTANCE.toast("简繁转换出错") + } } return c .replace("\\s*\\n+\\s*".toRegex(), "\n${ReadBookConfig.bodyIndent}") - .replace("[\\n\\s]+$".toRegex(), "") //移除尾部空行 } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/help/ItemTouchCallback.kt b/app/src/main/java/io/legado/app/help/ItemTouchCallback.kt index 99ba74ef1..9c1a0bbf2 100644 --- a/app/src/main/java/io/legado/app/help/ItemTouchCallback.kt +++ b/app/src/main/java/io/legado/app/help/ItemTouchCallback.kt @@ -106,7 +106,7 @@ class ItemTouchCallback : ItemTouchHelper.Callback() { override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { super.clearView(recyclerView, viewHolder) - onItemTouchCallbackListener?.clearView(recyclerView, viewHolder) + onItemTouchCallbackListener?.onClearView(recyclerView, viewHolder) } interface OnItemTouchCallbackListener { @@ -131,7 +131,10 @@ class ItemTouchCallback : ItemTouchHelper.Callback() { return true } - fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { + /** + * 手指松开 + */ + fun onClearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { } diff --git a/app/src/main/java/io/legado/app/help/LauncherIconHelp.kt b/app/src/main/java/io/legado/app/help/LauncherIconHelp.kt index 76bcd6116..b859336e4 100644 --- a/app/src/main/java/io/legado/app/help/LauncherIconHelp.kt +++ b/app/src/main/java/io/legado/app/help/LauncherIconHelp.kt @@ -5,10 +5,7 @@ import android.content.pm.PackageManager import android.os.Build import io.legado.app.App import io.legado.app.R -import io.legado.app.ui.welcome.Launcher1 -import io.legado.app.ui.welcome.Launcher2 -import io.legado.app.ui.welcome.Launcher3 -import io.legado.app.ui.welcome.WelcomeActivity +import io.legado.app.ui.welcome.* import org.jetbrains.anko.toast /** @@ -20,7 +17,10 @@ object LauncherIconHelp { private val componentNames = arrayListOf( ComponentName(App.INSTANCE, Launcher1::class.java.name), ComponentName(App.INSTANCE, Launcher2::class.java.name), - ComponentName(App.INSTANCE, Launcher3::class.java.name) + ComponentName(App.INSTANCE, Launcher3::class.java.name), + ComponentName(App.INSTANCE, Launcher4::class.java.name), + ComponentName(App.INSTANCE, Launcher5::class.java.name), + ComponentName(App.INSTANCE, Launcher6::class.java.name) ) fun changeIcon(icon: String?) { diff --git a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt index d0e67e901..ff4180081 100644 --- a/app/src/main/java/io/legado/app/help/ReadBookConfig.kt +++ b/app/src/main/java/io/legado/app/help/ReadBookConfig.kt @@ -27,7 +27,6 @@ object ReadBookConfig { GSON.fromJsonArray(json)!! } val durConfig get() = getConfig(styleSelect) - private val shareConfig get() = getConfig(5) var bg: Drawable? = null var bgMeanColor: Int = 0 @@ -139,129 +138,145 @@ object ReadBookConfig { var bodyIndent = " ".repeat(bodyIndentCount) var hideStatusBar = App.INSTANCE.getPrefBoolean(PreferKey.hideStatusBar) var hideNavigationBar = App.INSTANCE.getPrefBoolean(PreferKey.hideNavigationBar) + + private val config get() = if (shareLayout) getConfig(5) else durConfig + var textBold: Boolean - get() = if (shareLayout) shareConfig.textBold else durConfig.textBold - set(value) = if (shareLayout) shareConfig.textBold = value else durConfig.textBold = value + get() = config.textBold + set(value) { + config.textBold = value + } var textSize: Int - get() = if (shareLayout) shareConfig.textSize else durConfig.textSize - set(value) = if (shareLayout) shareConfig.textSize = value else durConfig.textSize = value + get() = config.textSize + set(value) { + config.textSize = value + } var letterSpacing: Float - get() = if (shareLayout) shareConfig.letterSpacing else durConfig.letterSpacing - set(value) = - if (shareLayout) shareConfig.letterSpacing = value else durConfig.letterSpacing = value + get() = config.letterSpacing + set(value) { + config.letterSpacing = value + } var lineSpacingExtra: Int - get() = if (shareLayout) shareConfig.lineSpacingExtra else durConfig.lineSpacingExtra - set(value) = - if (shareLayout) shareConfig.lineSpacingExtra = value - else durConfig.lineSpacingExtra = value + get() = config.lineSpacingExtra + set(value) { + config.lineSpacingExtra = value + } var paragraphSpacing: Int - get() = if (shareLayout) shareConfig.paragraphSpacing else durConfig.paragraphSpacing - set(value) = - if (shareLayout) shareConfig.paragraphSpacing = value - else durConfig.paragraphSpacing = value + get() = config.paragraphSpacing + set(value) { + config.paragraphSpacing = value + } var titleMode: Int - get() = if (shareLayout) shareConfig.titleMode else durConfig.titleMode - set(value) = - if (shareLayout) shareConfig.titleMode = value else durConfig.titleMode = value + get() = config.titleMode + set(value) { + config.titleMode = value + } var titleSize: Int - get() = if (shareLayout) shareConfig.titleSize else durConfig.titleSize - set(value) = - if (shareLayout) shareConfig.titleSize = value else durConfig.titleSize = value + get() = config.titleSize + set(value) { + config.titleSize = value + } + var titleTopSpacing: Int - get() = if (shareLayout) shareConfig.titleTopSpacing else durConfig.titleTopSpacing - set(value) = - if (shareLayout) shareConfig.titleTopSpacing = value - else durConfig.titleTopSpacing = value + get() = config.titleTopSpacing + set(value) { + config.titleTopSpacing = value + } + var titleBottomSpacing: Int - get() = if (shareLayout) shareConfig.titleBottomSpacing else durConfig.titleBottomSpacing - set(value) = - if (shareLayout) shareConfig.titleBottomSpacing = value - else durConfig.titleBottomSpacing = value + get() = config.titleBottomSpacing + set(value) { + config.titleBottomSpacing = value + } var paddingBottom: Int - get() = if (shareLayout) shareConfig.paddingBottom else durConfig.paddingBottom - set(value) = - if (shareLayout) shareConfig.paddingBottom = value else durConfig.paddingBottom = value + get() = config.paddingBottom + set(value) { + config.paddingBottom = value + } var paddingLeft: Int - get() = if (shareLayout) shareConfig.paddingLeft else durConfig.paddingLeft - set(value) = - if (shareLayout) shareConfig.paddingLeft = value else durConfig.paddingLeft = value + get() = config.paddingLeft + set(value) { + config.paddingLeft = value + } var paddingRight: Int - get() = if (shareLayout) shareConfig.paddingRight else durConfig.paddingRight - set(value) = - if (shareLayout) shareConfig.paddingRight = value else durConfig.paddingRight = value + get() = config.paddingRight + set(value) { + config.paddingRight = value + } var paddingTop: Int - get() = if (shareLayout) shareConfig.paddingTop else durConfig.paddingTop - set(value) = - if (shareLayout) shareConfig.paddingTop = value else durConfig.paddingTop = value + get() = config.paddingTop + set(value) { + config.paddingTop = value + } var headerPaddingBottom: Int - get() = if (shareLayout) shareConfig.headerPaddingBottom else durConfig.headerPaddingBottom - set(value) = - if (shareLayout) shareConfig.headerPaddingBottom = value - else durConfig.headerPaddingBottom = value + get() = config.headerPaddingBottom + set(value) { + config.headerPaddingBottom = value + } var headerPaddingLeft: Int - get() = if (shareLayout) shareConfig.headerPaddingLeft else durConfig.headerPaddingLeft - set(value) = - if (shareLayout) shareConfig.headerPaddingLeft = value - else durConfig.headerPaddingLeft = value + get() = config.headerPaddingLeft + set(value) { + config.headerPaddingLeft = value + } var headerPaddingRight: Int - get() = if (shareLayout) shareConfig.headerPaddingRight else durConfig.headerPaddingRight - set(value) = - if (shareLayout) shareConfig.headerPaddingRight = value - else durConfig.headerPaddingRight = value + get() = config.headerPaddingRight + set(value) { + config.headerPaddingRight = value + } var headerPaddingTop: Int - get() = if (shareLayout) shareConfig.headerPaddingTop else durConfig.headerPaddingTop - set(value) = - if (shareLayout) shareConfig.headerPaddingTop = value - else durConfig.headerPaddingTop = value + get() = config.headerPaddingTop + set(value) { + config.headerPaddingTop = value + } var footerPaddingBottom: Int - get() = if (shareLayout) shareConfig.footerPaddingBottom else durConfig.footerPaddingBottom - set(value) = - if (shareLayout) shareConfig.footerPaddingBottom = value - else durConfig.footerPaddingBottom = value + get() = config.footerPaddingBottom + set(value) { + config.footerPaddingBottom = value + } var footerPaddingLeft: Int - get() = if (shareLayout) shareConfig.footerPaddingLeft else durConfig.footerPaddingLeft - set(value) = - if (shareLayout) shareConfig.footerPaddingLeft = value - else durConfig.footerPaddingLeft = value + get() = config.footerPaddingLeft + set(value) { + config.footerPaddingLeft = value + } var footerPaddingRight: Int - get() = if (shareLayout) shareConfig.footerPaddingRight else durConfig.footerPaddingRight - set(value) = - if (shareLayout) shareConfig.footerPaddingRight = value - else durConfig.footerPaddingRight = value + get() = config.footerPaddingRight + set(value) { + config.footerPaddingRight = value + } var footerPaddingTop: Int - get() = if (shareLayout) shareConfig.footerPaddingTop else durConfig.footerPaddingTop - set(value) = - if (shareLayout) shareConfig.footerPaddingTop = value - else durConfig.footerPaddingTop = value + get() = config.footerPaddingTop + set(value) { + config.footerPaddingTop = value + } var showHeaderLine: Boolean - get() = if (shareLayout) shareConfig.showHeaderLine else durConfig.showHeaderLine - set(value) = - if (shareLayout) shareConfig.showHeaderLine = value - else durConfig.showHeaderLine = value + get() = config.showHeaderLine + set(value) { + config.showHeaderLine = value + } var showFooterLine: Boolean - get() = if (shareLayout) shareConfig.showFooterLine else durConfig.showFooterLine - set(value) = - if (shareLayout) shareConfig.showFooterLine = value - else durConfig.showFooterLine = value + get() = config.showFooterLine + set(value) { + config.showFooterLine = value + } @Keep class Config( diff --git a/app/src/main/java/io/legado/app/help/ReadTipConfig.kt b/app/src/main/java/io/legado/app/help/ReadTipConfig.kt new file mode 100644 index 000000000..9d6452b38 --- /dev/null +++ b/app/src/main/java/io/legado/app/help/ReadTipConfig.kt @@ -0,0 +1,74 @@ +package io.legado.app.help + +import io.legado.app.App +import io.legado.app.R +import io.legado.app.utils.getPrefBoolean +import io.legado.app.utils.getPrefInt +import io.legado.app.utils.putPrefBoolean +import io.legado.app.utils.putPrefInt + +object ReadTipConfig { + val tipArray: Array = App.INSTANCE.resources.getStringArray(R.array.read_tip) + const val none = 0 + const val chapterTitle = 1 + const val time = 2 + const val battery = 3 + const val page = 4 + const val totalProgress = 5 + const val pageAndTotal = 6 + + val tipHeaderLeftStr: String get() = tipArray.getOrElse(tipHeaderLeft) { tipArray[none] } + val tipHeaderMiddleStr: String get() = tipArray.getOrElse(tipHeaderMiddle) { tipArray[none] } + val tipHeaderRightStr: String get() = tipArray.getOrElse(tipHeaderRight) { tipArray[none] } + val tipFooterLeftStr: String get() = tipArray.getOrElse(tipFooterLeft) { tipArray[none] } + val tipFooterMiddleStr: String get() = tipArray.getOrElse(tipFooterMiddle) { tipArray[none] } + val tipFooterRightStr: String get() = tipArray.getOrElse(tipFooterRight) { tipArray[none] } + + var tipHeaderLeft: Int + get() = App.INSTANCE.getPrefInt("tipHeaderLeft", time) + set(value) { + App.INSTANCE.putPrefInt("tipHeaderLeft", value) + } + + var tipHeaderMiddle: Int + get() = App.INSTANCE.getPrefInt("tipHeaderMiddle", none) + set(value) { + App.INSTANCE.putPrefInt("tipHeaderMiddle", value) + } + + var tipHeaderRight: Int + get() = App.INSTANCE.getPrefInt("tipHeaderRight", battery) + set(value) { + App.INSTANCE.putPrefInt("tipHeaderRight", value) + } + + var tipFooterLeft: Int + get() = App.INSTANCE.getPrefInt("tipFooterLeft", chapterTitle) + set(value) { + App.INSTANCE.putPrefInt("tipFooterLeft", value) + } + + var tipFooterMiddle: Int + get() = App.INSTANCE.getPrefInt("tipFooterMiddle", none) + set(value) { + App.INSTANCE.putPrefInt("tipFooterMiddle", value) + } + + var tipFooterRight: Int + get() = App.INSTANCE.getPrefInt("tipFooterRight", pageAndTotal) + set(value) { + App.INSTANCE.putPrefInt("tipFooterRight", value) + } + + var hideHeader: Boolean + get() = App.INSTANCE.getPrefBoolean("hideHeader", true) + set(value) { + App.INSTANCE.putPrefBoolean("hideHeader", value) + } + + var hideFooter: Boolean + get() = App.INSTANCE.getPrefBoolean("hideFooter", false) + set(value) { + App.INSTANCE.putPrefBoolean("hideFooter", value) + } +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt b/app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt index e9fd0df86..0811eee10 100644 --- a/app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt +++ b/app/src/main/java/io/legado/app/help/coroutine/Coroutine.kt @@ -6,7 +6,7 @@ import kotlin.coroutines.CoroutineContext class Coroutine( - scope: CoroutineScope, + val scope: CoroutineScope, context: CoroutineContext = Dispatchers.IO, block: suspend CoroutineScope.() -> T ) { @@ -28,9 +28,10 @@ class Coroutine( private val job: Job private var start: VoidCallback? = null - private var success: Callback? = null + private var success: Callback? = null private var error: Callback? = null private var finally: VoidCallback? = null + private var cancel: VoidCallback? = null private var timeMillis: Long? = null private var errorReturn: Result? = null @@ -45,7 +46,7 @@ class Coroutine( get() = job.isCompleted init { - this.job = executeInternal(scope, context, block) + this.job = executeInternal(context, block) } fun timeout(timeMillis: () -> Long): Coroutine { @@ -78,7 +79,7 @@ class Coroutine( fun onSuccess( context: CoroutineContext? = null, - block: suspend CoroutineScope.(T?) -> Unit + block: suspend CoroutineScope.(T) -> Unit ): Coroutine { this.success = Callback(context, block) return this@Coroutine @@ -100,9 +101,28 @@ class Coroutine( return this@Coroutine } + fun onCancel( + context: CoroutineContext? = null, + block: suspend CoroutineScope.() -> Unit + ): Coroutine { + this.cancel = VoidCallback(context, block) + return this@Coroutine + } + //取消当前任务 fun cancel(cause: CancellationException? = null) { job.cancel(cause) + cancel?.let { + MainScope().launch { + if (null == it.context) { + it.block.invoke(scope) + } else { + withContext(scope.coroutineContext.plus(it.context)) { + it.block.invoke(this) + } + } + } + } } fun invokeOnCompletion(handler: CompletionHandler): DisposableHandle { @@ -110,7 +130,6 @@ class Coroutine( } private fun executeInternal( - scope: CoroutineScope, context: CoroutineContext, block: suspend CoroutineScope.() -> T ): Job { @@ -118,21 +137,27 @@ class Coroutine( try { start?.let { dispatchVoidCallback(this, it) } val value = executeBlock(scope, context, timeMillis ?: 0L, block) - success?.let { dispatchCallback(this, value, it) } + if (isActive) { + success?.let { dispatchCallback(this, value, it) } + } } catch (e: Throwable) { if (BuildConfig.DEBUG) { e.printStackTrace() } val consume: Boolean = errorReturn?.value?.let { value -> - success?.let { dispatchCallback(this, value, it) } + if (isActive) { + success?.let { dispatchCallback(this, value, it) } + } true } ?: false - if (!consume) { + if (!consume && isActive) { error?.let { dispatchCallback(this, e, it) } } } finally { - finally?.let { dispatchVoidCallback(this, it) } + if (isActive) { + finally?.let { dispatchVoidCallback(this, it) } + } } } } @@ -152,6 +177,7 @@ class Coroutine( value: R, callback: Callback ) { + if (!scope.isActive) return if (null == callback.context) { callback.block.invoke(scope, value) } else { @@ -166,7 +192,7 @@ class Coroutine( context: CoroutineContext, timeMillis: Long, noinline block: suspend CoroutineScope.() -> T - ): T? { + ): T { return withContext(scope.coroutineContext.plus(context)) { if (timeMillis > 0L) withTimeout(timeMillis) { block() diff --git a/app/src/main/java/io/legado/app/help/http/AjaxWebView.kt b/app/src/main/java/io/legado/app/help/http/AjaxWebView.kt index f501fcb71..4f5cbda46 100644 --- a/app/src/main/java/io/legado/app/help/http/AjaxWebView.kt +++ b/app/src/main/java/io/legado/app/help/http/AjaxWebView.kt @@ -180,6 +180,7 @@ class AjaxWebView { mWebView.get()?.evaluateJavascript(mJavaScript) { if (it.isNotEmpty() && it != "null") { val content = StringEscapeUtils.unescapeJson(it) + .replace("^\"|\"$".toRegex(), "") handler.obtainMessage(MSG_SUCCESS, Res(url, content)) .sendToTarget() handler.removeCallbacks(this) diff --git a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt index df417e2f9..31064e268 100644 --- a/app/src/main/java/io/legado/app/help/http/HttpHelper.kt +++ b/app/src/main/java/io/legado/app/help/http/HttpHelper.kt @@ -3,9 +3,11 @@ package io.legado.app.help.http import io.legado.app.help.http.api.HttpGetApi import io.legado.app.utils.NetworkUtils import kotlinx.coroutines.suspendCancellableCoroutine -import okhttp3.* +import okhttp3.ConnectionSpec +import okhttp3.Interceptor +import okhttp3.OkHttpClient +import okhttp3.Protocol import retrofit2.Retrofit -import java.util.* import java.util.concurrent.TimeUnit import kotlin.coroutines.resume @@ -13,14 +15,12 @@ import kotlin.coroutines.resume object HttpHelper { val client: OkHttpClient by lazy { - val default = ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) - .tlsVersions(TlsVersion.TLS_1_2) - .build() - val specs = ArrayList() - specs.add(default) - specs.add(ConnectionSpec.COMPATIBLE_TLS) - specs.add(ConnectionSpec.CLEARTEXT) + val specs = arrayListOf( + ConnectionSpec.MODERN_TLS, + ConnectionSpec.COMPATIBLE_TLS, + ConnectionSpec.CLEARTEXT + ) val builder = OkHttpClient.Builder() .connectTimeout(15, TimeUnit.SECONDS) diff --git a/app/src/main/java/io/legado/app/help/permission/PermissionsCompat.kt b/app/src/main/java/io/legado/app/help/permission/PermissionsCompat.kt index a5ccdb266..4bbed5991 100644 --- a/app/src/main/java/io/legado/app/help/permission/PermissionsCompat.kt +++ b/app/src/main/java/io/legado/app/help/permission/PermissionsCompat.kt @@ -1,8 +1,11 @@ package io.legado.app.help.permission +import android.os.Build import androidx.annotation.StringRes import androidx.appcompat.app.AppCompatActivity import androidx.fragment.app.Fragment +import org.jetbrains.anko.startActivity +import java.util.ArrayList class PermissionsCompat private constructor() { @@ -12,6 +15,17 @@ class PermissionsCompat private constructor() { RequestManager.pushRequest(request) } + companion object { + // 检查权限, 如果已经拥有返回 true + fun check(activity: AppCompatActivity, vararg permissions: String): Boolean { + var request: Request = Request(activity) + var pers = ArrayList() + pers.addAll(listOf(*permissions)) + var data = request.getDeniedPermissions(pers.toTypedArray()) + return data == null; + } + } + class Builder { private val request: Request diff --git a/app/src/main/java/io/legado/app/help/permission/Request.kt b/app/src/main/java/io/legado/app/help/permission/Request.kt index 600cbe93c..f7ed0293a 100644 --- a/app/src/main/java/io/legado/app/help/permission/Request.kt +++ b/app/src/main/java/io/legado/app/help/permission/Request.kt @@ -102,7 +102,7 @@ internal class Request : OnRequestPermissionsResultCallback { deniedCallback = null } - private fun getDeniedPermissions(permissions: Array?): Array? { + fun getDeniedPermissions(permissions: Array?): Array? { if (permissions != null) { val deniedPermissionList = ArrayList() for (permission in permissions) { diff --git a/app/src/main/java/io/legado/app/help/storage/Backup.kt b/app/src/main/java/io/legado/app/help/storage/Backup.kt index 8c4fa8fc2..5b1e88186 100644 --- a/app/src/main/java/io/legado/app/help/storage/Backup.kt +++ b/app/src/main/java/io/legado/app/help/storage/Backup.kt @@ -21,14 +21,6 @@ object Backup { FileUtils.getDirFile(App.INSTANCE.filesDir, "backup").absolutePath } - val legadoPath by lazy { - FileUtils.getSdCardPath() + File.separator + "YueDu3.0" - } - - val exportPath by lazy { - legadoPath + File.separator + "Export" - } - val backupFileNames by lazy { arrayOf( "bookshelf.json", "bookGroup.json", "bookSource.json", "rssSource.json", @@ -39,50 +31,50 @@ object Backup { fun autoBack(context: Context) { val lastBackup = context.getPrefLong(PreferKey.lastBackup) if (lastBackup + TimeUnit.DAYS.toMillis(1) < System.currentTimeMillis()) { - return - } - Coroutine.async { - val backupPath = context.getPrefString(PreferKey.backupPath) - if (backupPath.isNullOrEmpty()) { - backup(context) - } else { - backup(context, backupPath) + Coroutine.async { + backup(context, context.getPrefString(PreferKey.backupPath) ?: "", true) } } } - suspend fun backup(context: Context, path: String = legadoPath) { + suspend fun backup(context: Context, path: String, isAuto: Boolean = false) { context.putPrefLong(PreferKey.lastBackup, System.currentTimeMillis()) withContext(IO) { - writeListToJson(App.db.bookDao().all, "bookshelf.json", backupPath) - writeListToJson(App.db.bookGroupDao().all, "bookGroup.json", backupPath) - writeListToJson(App.db.bookSourceDao().all, "bookSource.json", backupPath) - writeListToJson(App.db.rssSourceDao().all, "rssSource.json", backupPath) - writeListToJson(App.db.rssStarDao().all, "rssStar.json", backupPath) - writeListToJson(App.db.replaceRuleDao().all, "replaceRule.json", backupPath) - GSON.toJson(ReadBookConfig.configList)?.let { - FileUtils.createFileIfNotExist(backupPath + File.separator + ReadBookConfig.readConfigFileName) - .writeText(it) - } - Preferences.getSharedPreferences(App.INSTANCE, backupPath, "config")?.let { sp -> - val edit = sp.edit() - App.INSTANCE.defaultSharedPreferences.all.map { - when (val value = it.value) { - is Int -> edit.putInt(it.key, value) - is Boolean -> edit.putBoolean(it.key, value) - is Long -> edit.putLong(it.key, value) - is Float -> edit.putFloat(it.key, value) - is String -> edit.putString(it.key, value) - else -> Unit + synchronized(this@Backup) { + writeListToJson(App.db.bookDao().all, "bookshelf.json", backupPath) + writeListToJson(App.db.bookGroupDao().all, "bookGroup.json", backupPath) + writeListToJson(App.db.bookSourceDao().all, "bookSource.json", backupPath) + writeListToJson(App.db.rssSourceDao().all, "rssSource.json", backupPath) + writeListToJson(App.db.rssStarDao().all, "rssStar.json", backupPath) + writeListToJson(App.db.replaceRuleDao().all, "replaceRule.json", backupPath) + GSON.toJson(ReadBookConfig.configList)?.let { + FileUtils.createFileIfNotExist(backupPath + File.separator + ReadBookConfig.readConfigFileName) + .writeText(it) + } + Preferences.getSharedPreferences(App.INSTANCE, backupPath, "config")?.let { sp -> + val edit = sp.edit() + App.INSTANCE.defaultSharedPreferences.all.map { + when (val value = it.value) { + is Int -> edit.putInt(it.key, value) + is Boolean -> edit.putBoolean(it.key, value) + is Long -> edit.putLong(it.key, value) + is Float -> edit.putFloat(it.key, value) + is String -> edit.putString(it.key, value) + else -> Unit + } + } + edit.commit() + } + WebDavHelp.backUpWebDav(backupPath) + if (path.isContentPath()) { + copyBackup(context, Uri.parse(path), isAuto) + } else { + if (path.isEmpty()) { + copyBackup(context.getExternalFilesDir(null)!!, false) + } else { + copyBackup(File(path), isAuto) } } - edit.commit() - } - WebDavHelp.backUpWebDav(backupPath) - if (path.isContentPath()) { - copyBackup(context, Uri.parse(path)) - } else { - copyBackup(File(path)) } } } @@ -95,27 +87,39 @@ object Backup { } @Throws(java.lang.Exception::class) - private fun copyBackup(context: Context, uri: Uri) { + private fun copyBackup(context: Context, uri: Uri, isAuto: Boolean) { DocumentFile.fromTreeUri(context, uri)?.let { treeDoc -> for (fileName in backupFileNames) { val file = File(backupPath + File.separator + fileName) if (file.exists()) { - treeDoc.findFile(fileName)?.delete() - treeDoc.createFile("", fileName) - ?.writeBytes(context, file.readBytes()) + if (isAuto) { + treeDoc.findFile("auto")?.findFile(fileName)?.delete() + DocumentUtils.createFileIfNotExist( + treeDoc, + fileName, + subDirs = *arrayOf("auto") + )?.writeBytes(context, file.readBytes()) + } else { + treeDoc.findFile(fileName)?.delete() + treeDoc.createFile("", fileName) + ?.writeBytes(context, file.readBytes()) + } } } } } @Throws(java.lang.Exception::class) - private fun copyBackup(rootFile: File) { + private fun copyBackup(rootFile: File, isAuto: Boolean) { for (fileName in backupFileNames) { val file = File(backupPath + File.separator + fileName) if (file.exists()) { file.copyTo( - FileUtils.createFileIfNotExist(rootFile, fileName), - true + if (isAuto) { + FileUtils.createFileIfNotExist(rootFile, fileName, "auto") + } else { + FileUtils.createFileIfNotExist(rootFile, fileName) + }, true ) } } diff --git a/app/src/main/java/io/legado/app/help/storage/OldBook.kt b/app/src/main/java/io/legado/app/help/storage/OldBook.kt index f8321973c..a782cf5f5 100644 --- a/app/src/main/java/io/legado/app/help/storage/OldBook.kt +++ b/app/src/main/java/io/legado/app/help/storage/OldBook.kt @@ -40,7 +40,6 @@ object OldBook { book.durChapterTitle = jsonItem.readString("$.durChapterName") book.durChapterPos = jsonItem.readInt("$.durChapterPage") ?: 0 book.durChapterTime = jsonItem.readLong("$.finalDate") ?: 0 - book.group = jsonItem.readInt("$.group") ?: 0 book.intro = jsonItem.readString("$.bookInfoBean.introduce") book.latestChapterTitle = jsonItem.readString("$.lastChapterName") book.lastCheckCount = jsonItem.readInt("$.newChapters") ?: 0 diff --git a/app/src/main/java/io/legado/app/help/storage/OldRule.kt b/app/src/main/java/io/legado/app/help/storage/OldRule.kt index 7696bb383..d605b02fe 100644 --- a/app/src/main/java/io/legado/app/help/storage/OldRule.kt +++ b/app/src/main/java/io/legado/app/help/storage/OldRule.kt @@ -19,7 +19,7 @@ object OldRule { source = GSON.fromJsonObject(json.trim()) } runCatching { - if (source == null || source?.searchUrl.isNullOrBlank()) { + if (source == null || source?.ruleToc.isNullOrBlank()) { source = BookSource().apply { val jsonItem = jsonPath.parse(json.trim()) bookSourceUrl = jsonItem.readString("bookSourceUrl") ?: "" diff --git a/app/src/main/java/io/legado/app/help/storage/Restore.kt b/app/src/main/java/io/legado/app/help/storage/Restore.kt index 5393249c3..f174a6f5e 100644 --- a/app/src/main/java/io/legado/app/help/storage/Restore.kt +++ b/app/src/main/java/io/legado/app/help/storage/Restore.kt @@ -128,7 +128,7 @@ object Restore { bodyIndentCount = App.INSTANCE.getPrefInt(PreferKey.bodyIndent, 2) } ChapterProvider.upStyle() - ReadBook.loadContent() + ReadBook.loadContent(resetPageOffset = false) } withContext(Main) { if (AppConfig.isNightTheme && AppCompatDelegate.getDefaultNightMode() != AppCompatDelegate.MODE_NIGHT_YES) { diff --git a/app/src/main/java/io/legado/app/lib/theme/ATH.kt b/app/src/main/java/io/legado/app/lib/theme/ATH.kt index 0bcbb114b..19304862c 100644 --- a/app/src/main/java/io/legado/app/lib/theme/ATH.kt +++ b/app/src/main/java/io/legado/app/lib/theme/ATH.kt @@ -199,13 +199,12 @@ object ATH { fun applyBottomNavigationColor(bottomBar: BottomNavigationView?) { bottomBar?.apply { - setBackgroundColor(ThemeStore.backgroundColor(context)) + setBackgroundColor(ThemeStore.bottomBackground(context)) val colorStateList = Selector.colorBuild() .setDefaultColor(context.getCompatColor(R.color.btn_bg_press_tp)) .setSelectedColor(ThemeStore.accentColor(bottom_navigation_view.context)).create() itemIconTintList = colorStateList itemTextColor = colorStateList - setBackgroundColor(ThemeStore.bottomBackground(context)) } } diff --git a/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt b/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt index 47aa59344..d1648c7b7 100644 --- a/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt +++ b/app/src/main/java/io/legado/app/lib/webdav/WebDav.kt @@ -3,12 +3,7 @@ package io.legado.app.lib.webdav import io.legado.app.help.http.HttpHelper import io.legado.app.lib.webdav.http.Handler import io.legado.app.lib.webdav.http.HttpAuth -import okhttp3.Credentials -import okhttp3.MediaType.Companion.toMediaTypeOrNull -import okhttp3.Request -import okhttp3.RequestBody.Companion.asRequestBody -import okhttp3.RequestBody.Companion.toRequestBody -import okhttp3.Response +import okhttp3.* import org.jsoup.Jsoup import java.io.File import java.io.IOException @@ -82,7 +77,7 @@ constructor(urlStr: String) { this.exists = false return false } - response.body?.let { + response.body()?.let { if (it.string().isNotEmpty()) { return true } @@ -102,7 +97,7 @@ constructor(urlStr: String) { fun listFiles(propsList: ArrayList = ArrayList()): List { propFindResponse(propsList)?.let { response -> if (response.isSuccessful) { - response.body?.let { body -> + response.body()?.let { body -> return parseDir(body.string()) } } @@ -127,7 +122,10 @@ constructor(urlStr: String) { .url(url) // 添加RequestBody对象,可以只返回的属性。如果设为null,则会返回全部属性 // 注意:尽量手动指定需要返回的属性。若返回全部属性,可能后由于Prop.java里没有该属性名,而崩溃。 - .method("PROPFIND", requestPropsStr.toRequestBody("text/plain".toMediaTypeOrNull())) + .method( + "PROPFIND", + RequestBody.create(MediaType.parse("text/plain"), requestPropsStr) + ) HttpAuth.auth?.let { request.header( @@ -205,9 +203,9 @@ constructor(urlStr: String) { fun upload(localPath: String, contentType: String? = null): Boolean { val file = File(localPath) if (!file.exists()) return false - val mediaType = contentType?.toMediaTypeOrNull() + val mediaType = contentType?.let { MediaType.parse(it) } // 务必注意RequestBody不要嵌套,不然上传时内容可能会被追加多余的文件信息 - val fileBody = file.asRequestBody(mediaType) + val fileBody = RequestBody.create(mediaType, file) httpUrl?.let { val request = Request.Builder() .url(it) @@ -241,7 +239,7 @@ constructor(urlStr: String) { request.header("Authorization", Credentials.basic(it.user, it.pass)) } try { - return HttpHelper.client.newCall(request.build()).execute().body?.byteStream() + return HttpHelper.client.newCall(request.build()).execute().body()?.byteStream() } catch (e: IOException) { e.printStackTrace() } catch (e: IllegalArgumentException) { diff --git a/app/src/main/java/io/legado/app/model/Debug.kt b/app/src/main/java/io/legado/app/model/Debug.kt index 7d7ec3627..58944e05b 100644 --- a/app/src/main/java/io/legado/app/model/Debug.kt +++ b/app/src/main/java/io/legado/app/model/Debug.kt @@ -54,11 +54,10 @@ object Debug { cancelDebug() debugSource = rssSource.sourceUrl log(debugSource, "︾开始解析") - Rss.getArticles(rssSource, null) + val sort = rssSource.sortUrls().entries.first() + Rss.getArticles(sort.key, sort.value, rssSource, null) .onSuccess { - if (it == null) { - log(debugSource, "︽解析失败", state = -1) - } else if(it.articles.isEmpty()) { + if (it.articles.isEmpty()) { log(debugSource, "⇒列表页解析成功,为空") log(debugSource, "︽解析完成", state = 1000) } else { @@ -69,7 +68,7 @@ object Debug { if (ruleContent.isNullOrEmpty()) { log(debugSource, "⇒内容规则为空,默认获取整个网页", state = 1000) } else { - rssContentDebug(it.articles[0], ruleContent) + rssContentDebug(it.articles[0], ruleContent, rssSource) } } else { log(debugSource, "⇒存在描述规则,不解析内容页") @@ -82,9 +81,9 @@ object Debug { } } - private fun rssContentDebug(rssArticle: RssArticle, ruleContent: String) { + private fun rssContentDebug(rssArticle: RssArticle, ruleContent: String, rssSource: RssSource) { log(debugSource, "︾开始解析内容页") - Rss.getContent(rssArticle, ruleContent) + Rss.getContent(rssArticle, ruleContent, rssSource) .onSuccess { log(debugSource, it) log(debugSource, "︽内容页解析完成", state = 1000) @@ -140,14 +139,12 @@ object Debug { log(debugSource, "︾开始解析发现页") val explore = webBook.exploreBook(url, 1) .onSuccess { exploreBooks -> - exploreBooks?.let { - if (exploreBooks.isNotEmpty()) { - log(debugSource, "︽发现页解析完成") - log(debugSource, showTime = false) - infoDebug(webBook, exploreBooks[0].toBook()) - } else { - log(debugSource, "︽未获取到书籍", state = -1) - } + if (exploreBooks.isNotEmpty()) { + log(debugSource, "︽发现页解析完成") + log(debugSource, showTime = false) + infoDebug(webBook, exploreBooks[0].toBook()) + } else { + log(debugSource, "︽未获取到书籍", state = -1) } } .onError { @@ -164,14 +161,12 @@ object Debug { log(debugSource, "︾开始解析搜索页") val search = webBook.searchBook(key, 1) .onSuccess { searchBooks -> - searchBooks?.let { - if (searchBooks.isNotEmpty()) { - log(debugSource, "︽搜索页解析完成") - log(debugSource, showTime = false) - infoDebug(webBook, searchBooks[0].toBook()) - } else { - log(debugSource, "︽未获取到书籍", state = -1) - } + if (searchBooks.isNotEmpty()) { + log(debugSource, "︽搜索页解析完成") + log(debugSource, showTime = false) + infoDebug(webBook, searchBooks[0].toBook()) + } else { + log(debugSource, "︽未获取到书籍", state = -1) } } .onError { @@ -197,16 +192,14 @@ object Debug { private fun tocDebug(webBook: WebBook, book: Book) { log(debugSource, "︾开始解析目录页") val chapterList = webBook.getChapterList(book) - .onSuccess { chapterList -> - chapterList?.let { - if (it.isNotEmpty()) { - log(debugSource, "︽目录页解析完成") - log(debugSource, showTime = false) - val nextChapterUrl = if (it.size > 1) it[1].url else null - contentDebug(webBook, book, it[0], nextChapterUrl) - } else { - log(debugSource, "︽目录列表为空", state = -1) - } + .onSuccess { + if (it.isNotEmpty()) { + log(debugSource, "︽目录页解析完成") + log(debugSource, showTime = false) + val nextChapterUrl = if (it.size > 1) it[1].url else null + contentDebug(webBook, book, it[0], nextChapterUrl) + } else { + log(debugSource, "︽目录列表为空", state = -1) } } .onError { diff --git a/app/src/main/java/io/legado/app/model/Rss.kt b/app/src/main/java/io/legado/app/model/Rss.kt index b3622b40b..8b29913d9 100644 --- a/app/src/main/java/io/legado/app/model/Rss.kt +++ b/app/src/main/java/io/legado/app/model/Rss.kt @@ -15,27 +15,35 @@ import kotlin.coroutines.CoroutineContext object Rss { fun getArticles( + sortName: String, + sortUrl: String, rssSource: RssSource, pageUrl: String? = null, scope: CoroutineScope = Coroutine.DEFAULT, context: CoroutineContext = Dispatchers.IO ): Coroutine { return Coroutine.async(scope, context) { - val analyzeUrl = AnalyzeUrl(pageUrl ?: rssSource.sourceUrl) + val analyzeUrl = AnalyzeUrl( + pageUrl ?: sortUrl, + headerMapF = rssSource.getHeaderMap() + ) val body = analyzeUrl.getResponseAwait(rssSource.sourceUrl).body - RssParserByRule.parseXML(body, rssSource) + RssParserByRule.parseXML(sortName, sortUrl, body, rssSource) } } fun getContent( rssArticle: RssArticle, ruleContent: String, + rssSource: RssSource?, scope: CoroutineScope = Coroutine.DEFAULT, context: CoroutineContext = Dispatchers.IO ): Coroutine { return Coroutine.async(scope, context) { - val body = AnalyzeUrl(rssArticle.link, baseUrl = rssArticle.origin) - .getResponseAwait(rssArticle.origin) + val body = AnalyzeUrl( + rssArticle.link, baseUrl = rssArticle.origin, + headerMapF = rssSource?.getHeaderMap() + ).getResponseAwait(rssArticle.origin) .body val analyzeRule = AnalyzeRule() analyzeRule.setContent( diff --git a/app/src/main/java/io/legado/app/model/SearchBookModel.kt b/app/src/main/java/io/legado/app/model/SearchBookModel.kt new file mode 100644 index 000000000..1f6cac065 --- /dev/null +++ b/app/src/main/java/io/legado/app/model/SearchBookModel.kt @@ -0,0 +1,93 @@ +package io.legado.app.model + +import io.legado.app.App +import io.legado.app.data.entities.SearchBook +import io.legado.app.help.AppConfig +import io.legado.app.help.coroutine.Coroutine +import io.legado.app.utils.getPrefString +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers.IO +import kotlinx.coroutines.asCoroutineDispatcher +import java.util.concurrent.Executors + +class SearchBookModel(private val scope: CoroutineScope, private val callBack: CallBack) { + private var searchPool = + Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher() + private var mSearchId = System.currentTimeMillis() + private var searchPage = 1 + private var searchKey: String = "" + private var task: Coroutine<*>? = null + + private fun initSearchPool() { + searchPool = + Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher() + } + + fun search(searchId: Long, key: String) { + if (searchId != mSearchId) { + task?.cancel() + searchPool.close() + initSearchPool() + mSearchId = searchId + searchPage = 1 + if (key.isEmpty()) { + return + } else { + this.searchKey = key + } + } else { + searchPage++ + } + task = Coroutine.async(scope, searchPool) { + val searchGroup = App.INSTANCE.getPrefString("searchGroup") ?: "" + val bookSourceList = if (searchGroup.isBlank()) { + App.db.bookSourceDao().allEnabled + } else { + App.db.bookSourceDao().getEnabledByGroup(searchGroup) + } + for (item in bookSourceList) { + //task取消时自动取消 by (scope = this@execute) + WebBook(item).searchBook( + searchKey, + searchPage, + scope = this, + context = searchPool + ) + .timeout(30000L) + .onSuccess(IO) { + if (searchId == mSearchId) { + callBack.onSearchSuccess(it) + } + } + } + }.onStart { + callBack.onSearchStart() + } + + task?.invokeOnCompletion { + if (searchId == mSearchId) { + callBack.onSearchFinish() + } + } + } + + fun cancelSearch() { + task?.cancel() + mSearchId = 0 + callBack.onSearchCancel() + } + + fun close() { + task?.cancel() + mSearchId = 0 + searchPool.close() + } + + interface CallBack { + fun onSearchStart() + fun onSearchSuccess(searchBooks: ArrayList) + fun onSearchFinish() + fun onSearchCancel() + } + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/model/WebBook.kt b/app/src/main/java/io/legado/app/model/WebBook.kt index 69dfb943c..cb1742132 100644 --- a/app/src/main/java/io/legado/app/model/WebBook.kt +++ b/app/src/main/java/io/legado/app/model/WebBook.kt @@ -27,26 +27,36 @@ class WebBook(val bookSource: BookSource) { page: Int? = 1, scope: CoroutineScope = Coroutine.DEFAULT, context: CoroutineContext = Dispatchers.IO - ): Coroutine> { + ): Coroutine> { return Coroutine.async(scope, context) { - bookSource.searchUrl?.let { searchUrl -> - val analyzeUrl = AnalyzeUrl( - ruleUrl = searchUrl, - key = key, - page = page, - baseUrl = sourceUrl, - headerMapF = bookSource.getHeaderMap() - ) - val res = analyzeUrl.getResponseAwait(bookSource.bookSourceUrl) - BookList.analyzeBookList( - res.body, - bookSource, - analyzeUrl, - res.url, - true - ) - } ?: arrayListOf() + searchBookSuspend(scope, key, page) + } + } + + suspend fun searchBookSuspend( + scope: CoroutineScope, + key: String, + page: Int? = 1 + ): ArrayList { + bookSource.searchUrl?.let { searchUrl -> + val analyzeUrl = AnalyzeUrl( + ruleUrl = searchUrl, + key = key, + page = page, + baseUrl = sourceUrl, + headerMapF = bookSource.getHeaderMap() + ) + val res = analyzeUrl.getResponseAwait(bookSource.bookSourceUrl) + return BookList.analyzeBookList( + scope, + res.body, + bookSource, + analyzeUrl, + res.url, + true + ) } + return arrayListOf() } /** @@ -67,6 +77,7 @@ class WebBook(val bookSource: BookSource) { ) val res = analyzeUrl.getResponseAwait(bookSource.bookSourceUrl) BookList.analyzeBookList( + scope, res.body, bookSource, analyzeUrl, diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt index 7b1488c96..ad96e781c 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeUrl.kt @@ -13,9 +13,8 @@ import io.legado.app.help.http.api.HttpGetApi import io.legado.app.help.http.api.HttpPostApi import io.legado.app.utils.* import okhttp3.FormBody -import okhttp3.MediaType.Companion.toMediaTypeOrNull +import okhttp3.MediaType import okhttp3.RequestBody -import okhttp3.RequestBody.Companion.toRequestBody import retrofit2.Call import java.net.URLEncoder import java.util.* @@ -40,7 +39,7 @@ class AnalyzeUrl( ) : JsExtensions { companion object { private val pagePattern = Pattern.compile("<(.*?)>") - private val jsonType = "application/json; charset=utf-8".toMediaTypeOrNull() + private val jsonType = MediaType.parse("application/json; charset=utf-8") } private var baseUrl: String = "" @@ -182,7 +181,7 @@ class AnalyzeUrl( RequestMethod.POST -> { bodyTxt?.let { if (it.isJson()) { - body = it.toRequestBody(jsonType) + body = RequestBody.create(jsonType, it) } else { analyzeFields(it) } diff --git a/app/src/main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt b/app/src/main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt index 16426a036..494437d92 100644 --- a/app/src/main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt +++ b/app/src/main/java/io/legado/app/model/localBook/AnalyzeTxtFile.kt @@ -13,32 +13,45 @@ import java.nio.charset.Charset import java.util.regex.Matcher import java.util.regex.Pattern -object AnalyzeTxtFile { - private const val folderName = "bookTxt" - private const val BLANK: Byte = 0x0a - //默认从文件中获取数据的长度 - private const val BUFFER_SIZE = 512 * 1024 - //没有标题的时候,每个章节的最大长度 - private const val MAX_LENGTH_WITH_NO_CHAPTER = 10 * 1024 - val cacheFolder: File by lazy { - val rootFile = App.INSTANCE.getExternalFilesDir(null) - ?: App.INSTANCE.externalCacheDir - ?: App.INSTANCE.cacheDir - FileUtils.createFolderIfNotExist(rootFile, subDirs = *arrayOf(folderName)) - } +class AnalyzeTxtFile { + + private val tocRules = arrayListOf() + private lateinit var charset: Charset + @Throws(Exception::class) fun analyze(context: Context, book: Book): ArrayList { val bookFile = getBookFile(context, book) book.charset = EncodingDetect.getEncode(bookFile) - val charset = book.fileCharset() - val toc = arrayListOf() + charset = book.fileCharset() + val rulePattern = if (book.tocUrl.isNotEmpty()) { + Pattern.compile(book.tocUrl, Pattern.MULTILINE) + } else { + tocRules.addAll(getTocRules()) + null + } //获取文件流 val bookStream = RandomAccessFile(bookFile, "r") - val rulePattern = getTocRule(book, bookStream, charset) + return analyze(bookStream, book, rulePattern) + } + @Throws(Exception::class) + private fun analyze( + bookStream: RandomAccessFile, + book: Book, + pattern: Pattern? + ): ArrayList { + val toc = arrayListOf() + var tocRule: TxtTocRule? = null + val rulePattern = pattern ?: let { + tocRule = getTocRule(bookStream) + tocRule?.let { + Pattern.compile(it.rule, Pattern.MULTILINE) + } + } //加载章节 val buffer = ByteArray(BUFFER_SIZE) //获取到的块起始点,在文件中的位置 + bookStream.seek(0) var curOffset: Long = 0 //block的个数 var blockPos = 0 @@ -47,13 +60,14 @@ object AnalyzeTxtFile { var allLength = 0 //获取文件中的数据到buffer,直到没有数据为止 - while (bookStream.read(buffer, 0, buffer.size).also { length = it } > 0) { - ++blockPos + while (bookStream.read(buffer).also { length = it } > 0) { + blockPos++ //如果存在Chapter - if (rulePattern != null) { //将数据转换成String + if (rulePattern != null) { + //将数据转换成String, 不能超过length var blockContent = String(buffer, 0, length, charset) val lastN = blockContent.lastIndexOf("\n") - if (lastN != 0) { + if (lastN > 0) { blockContent = blockContent.substring(0, lastN) length = blockContent.toByteArray(charset).size allLength += length @@ -66,40 +80,49 @@ object AnalyzeTxtFile { //如果存在相应章节 while (matcher.find()) { //获取匹配到的字符在字符串中的起始位置 val chapterStart = matcher.start() + //获取章节内容 + val chapterContent = blockContent.substring(seekPos, chapterStart) + val chapterLength = chapterContent.toByteArray(charset).size + if (chapterLength > 30000 && pattern == null) { + //移除不匹配的规则 + tocRules.remove(tocRule) + return analyze(bookStream, book, null) + } //如果 seekPos == 0 && nextChapterPos != 0 表示当前block处前面有一段内容 - //第一种情况一定是序章 第二种情况可能是上一个章节的内容 + //第一种情况一定是序章 第二种情况是上一个章节的内容 if (seekPos == 0 && chapterStart != 0) { //获取当前章节的内容 - val chapterContent = blockContent.substring(seekPos, chapterStart) - //设置指针偏移 - seekPos += chapterContent.length - if (toc.size == 0) { //如果当前没有章节,那么就是序章 + if (toc.isEmpty()) { //如果当前没有章节,那么就是序章 //加入简介 - book.intro = chapterContent + if (StringUtils.trim(chapterContent).isNotEmpty()) { + val qyChapter = BookChapter() + qyChapter.title = "前言" + qyChapter.start = 0 + qyChapter.end = chapterLength.toLong() + toc.add(qyChapter) + } //创建当前章节 val curChapter = BookChapter() curChapter.title = matcher.group() - curChapter.start = chapterContent.toByteArray(charset).size.toLong() + curChapter.start = chapterLength.toLong() toc.add(curChapter) } else { //否则就block分割之后,上一个章节的剩余内容 //获取上一章节 val lastChapter = toc.last() //将当前段落添加上一章去 lastChapter.end = - lastChapter.end!! + chapterContent.toByteArray(charset).size + lastChapter.end!! + chapterLength.toLong() //创建当前章节 val curChapter = BookChapter() curChapter.title = matcher.group() curChapter.start = lastChapter.end toc.add(curChapter) } - } else { //是否存在章节 - if (toc.size != 0) { //获取章节内容 - val chapterContent = blockContent.substring(seekPos, matcher.start()) - seekPos += chapterContent.length + } else { + if (toc.isNotEmpty()) { //获取章节内容 //获取上一章节 val lastChapter = toc.last() lastChapter.end = - lastChapter.start!! + chapterContent.toByteArray(charset).size + lastChapter.start!! + chapterContent.toByteArray(charset).size.toLong() //创建当前章节 val curChapter = BookChapter() curChapter.title = matcher.group() @@ -108,11 +131,13 @@ object AnalyzeTxtFile { } else { //如果章节不存在则创建章节 val curChapter = BookChapter() curChapter.title = matcher.group() - curChapter.start = 0L - curChapter.end = 0L + curChapter.start = 0 + curChapter.end = 0 toc.add(curChapter) } } + //设置指针偏移 + seekPos += chapterContent.length } } else { //进行本地虚拟分章 //章节在buffer的偏移量 @@ -156,7 +181,8 @@ object AnalyzeTxtFile { //block的偏移点 curOffset += length.toLong() - if (rulePattern != null) { //设置上一章的结尾 + if (rulePattern != null) { + //设置上一章的结尾 val lastChapter = toc.last() lastChapter.end = curOffset } @@ -175,41 +201,18 @@ object AnalyzeTxtFile { bean.url = (MD5Utils.md5Encode16(book.originName + i + bean.title) ?: "") } book.latestChapterTitle = toc.last().title + book.totalChapterNum = toc.size System.gc() System.runFinalization() - return toc - } - - fun getContent(book: Book, bookChapter: BookChapter): String { - val bookFile = getBookFile(App.INSTANCE, book) - //获取文件流 - val bookStream = RandomAccessFile(bookFile, "r") - bookStream.seek(bookChapter.start ?: 0) - val extent = (bookChapter.end!! - bookChapter.start!!).toInt() - val content = ByteArray(extent) - bookStream.read(content, 0, extent) - return String(content, book.fileCharset()) - } - - private fun getBookFile(context: Context, book: Book): File { - val uri = Uri.parse(book.bookUrl) - val bookFile = FileUtils.getFile(cacheFolder, book.originName, subDirs = *arrayOf()) - if (!bookFile.exists()) { - bookFile.createNewFile() - DocumentUtils.readBytes(context, uri)?.let { - bookFile.writeBytes(it) - } + tocRule?.let { + book.tocUrl = it.rule } - return bookFile + return toc } - private fun getTocRule(book: Book, bookStream: RandomAccessFile, charset: Charset): Pattern? { - if (book.tocUrl.isNotEmpty()) { - return Pattern.compile(book.tocUrl, Pattern.MULTILINE) - } - val tocRules = getTocRules() - var rulePattern: Pattern? = null + private fun getTocRule(bookStream: RandomAccessFile): TxtTocRule? { + var txtTocRule: TxtTocRule? = null //首先获取128k的数据 val buffer = ByteArray(BUFFER_SIZE / 4) val length = bookStream.read(buffer, 0, buffer.size) @@ -218,30 +221,72 @@ object AnalyzeTxtFile { val pattern = Pattern.compile(tocRule.rule, Pattern.MULTILINE) val matcher = pattern.matcher(content) if (matcher.find()) { - book.tocUrl = tocRule.rule - rulePattern = pattern + txtTocRule = tocRule break } } - bookStream.seek(0) - return rulePattern + + return txtTocRule } - private fun getTocRules(): List { - val rules = App.db.txtTocRule().all - if (rules.isEmpty()) { - return getDefaultRules() + companion object { + private const val folderName = "bookTxt" + private const val BLANK: Byte = 0x0a + + //默认从文件中获取数据的长度 + private const val BUFFER_SIZE = 512 * 1024 + + //没有标题的时候,每个章节的最大长度 + private const val MAX_LENGTH_WITH_NO_CHAPTER = 10 * 1024 + val cacheFolder: File by lazy { + val rootFile = App.INSTANCE.getExternalFilesDir(null) + ?: App.INSTANCE.externalCacheDir + ?: App.INSTANCE.cacheDir + FileUtils.createFolderIfNotExist(rootFile, subDirs = *arrayOf(folderName)) } - return rules - } - fun getDefaultRules(): List { - App.INSTANCE.assets.open("txtTocRule.json").readBytes().let { byteArray -> - GSON.fromJsonArray(String(byteArray))?.let { - App.db.txtTocRule().insert(*it.toTypedArray()) - return it + fun getContent(book: Book, bookChapter: BookChapter): String { + val bookFile = getBookFile(App.INSTANCE, book) + //获取文件流 + val bookStream = RandomAccessFile(bookFile, "r") + val content = ByteArray((bookChapter.end!! - bookChapter.start!!).toInt()) + bookStream.seek(bookChapter.start!!) + bookStream.read(content) + return String(content, book.fileCharset()) + } + + private fun getBookFile(context: Context, book: Book): File { + if (book.bookUrl.isContentPath()) { + val uri = Uri.parse(book.bookUrl) + val bookFile = FileUtils.getFile(cacheFolder, book.originName, subDirs = *arrayOf()) + if (!bookFile.exists()) { + bookFile.createNewFile() + DocumentUtils.readBytes(context, uri)?.let { + bookFile.writeBytes(it) + } + } + return bookFile } + return File(book.bookUrl) + } + + private fun getTocRules(): List { + val rules = App.db.txtTocRule().all + if (rules.isEmpty()) { + return getDefaultRules() + } + return rules + } + + fun getDefaultRules(): List { + App.INSTANCE.assets.open("txtTocRule.json").readBytes().let { byteArray -> + GSON.fromJsonArray(String(byteArray))?.let { + App.db.txtTocRule().insert(*it.toTypedArray()) + return it + } + } + return emptyList() } - return emptyList() } + } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt b/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt index 9a893b8a3..c5e7ffab5 100644 --- a/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt +++ b/app/src/main/java/io/legado/app/model/localBook/LocalBook.kt @@ -4,29 +4,45 @@ import android.net.Uri import androidx.documentfile.provider.DocumentFile import io.legado.app.App import io.legado.app.data.entities.Book +import io.legado.app.help.BookHelp import io.legado.app.utils.FileUtils +import io.legado.app.utils.isContentPath +import java.io.File object LocalBook { - fun importFile(doc: DocumentFile) { - doc.name?.let { fileName -> - val str = fileName.substringBeforeLast(".") - var name = str.substringBefore("作者") - val author = str.substringAfter("作者", "") - val smhStart = name.indexOf("《") - val smhEnd = name.indexOf("》") - if (smhStart != -1 && smhEnd != -1) { - name = (name.substring(smhStart + 1, smhEnd)) - } - val book = Book( - bookUrl = doc.uri.toString(), - name = name, - author = author, - originName = fileName - ) - App.db.bookDao().insert(book) + fun importFile(path: String) { + val fileName = if (path.isContentPath()) { + val doc = DocumentFile.fromSingleUri(App.INSTANCE, Uri.parse(path)) + doc?.name ?: "" + } else { + File(path).name + } + val str = fileName.substringBeforeLast(".") + val authorIndex = str.indexOf("作者") + var name: String + var author: String + if (authorIndex == -1) { + name = str + author = "" + } else { + name = str.substring(0, authorIndex) + author = str.substring(authorIndex) + author = BookHelp.formatAuthor(author) + } + val smhStart = name.indexOf("《") + val smhEnd = name.indexOf("》") + if (smhStart != -1 && smhEnd != -1) { + name = (name.substring(smhStart + 1, smhEnd)) } + val book = Book( + bookUrl = path, + name = name, + author = author, + originName = fileName + ) + App.db.bookDao().insert(book) } fun deleteBook(book: Book, deleteOriginal: Boolean) { @@ -37,8 +53,12 @@ object LocalBook { } if (deleteOriginal) { - val uri = Uri.parse(book.bookUrl) - DocumentFile.fromSingleUri(App.INSTANCE, uri)?.delete() + if (book.bookUrl.isContentPath()) { + val uri = Uri.parse(book.bookUrl) + DocumentFile.fromSingleUri(App.INSTANCE, uri)?.delete() + } else { + FileUtils.deleteFile(book.bookUrl) + } } } } diff --git a/app/src/main/java/io/legado/app/model/rss/RssParser.kt b/app/src/main/java/io/legado/app/model/rss/RssParser.kt index 7bda16e6d..09cd756bb 100644 --- a/app/src/main/java/io/legado/app/model/rss/RssParser.kt +++ b/app/src/main/java/io/legado/app/model/rss/RssParser.kt @@ -11,7 +11,7 @@ import java.io.StringReader object RssParser { @Throws(XmlPullParserException::class, IOException::class) - fun parseXML(xml: String, sourceUrl: String): Result { + fun parseXML(sortName: String, xml: String, sourceUrl: String): Result { val articleList = mutableListOf() var currentArticle = RssArticle() @@ -87,6 +87,7 @@ object RssParser { // The item is correctly parsed insideItem = false currentArticle.origin = sourceUrl + currentArticle.sort = sortName articleList.add(currentArticle) currentArticle = RssArticle() } diff --git a/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt b/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt index b06950031..cd90b6b1d 100644 --- a/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt +++ b/app/src/main/java/io/legado/app/model/rss/RssParserByRule.kt @@ -13,7 +13,7 @@ import io.legado.app.utils.NetworkUtils object RssParserByRule { @Throws(Exception::class) - fun parseXML(body: String?, rssSource: RssSource): Result { + fun parseXML(sortName: String, sortUrl: String, body: String?, rssSource: RssSource): Result { val sourceUrl = rssSource.sourceUrl var nextUrl: String? = null if (body.isNullOrBlank()) { @@ -28,11 +28,11 @@ object RssParserByRule { var ruleArticles = rssSource.ruleArticles if (ruleArticles.isNullOrBlank()) { Debug.log(sourceUrl, "⇒列表规则为空, 使用默认规则解析") - return RssParser.parseXML(body, sourceUrl) + return RssParser.parseXML(sortName, body, sourceUrl) } else { val articleList = mutableListOf() val analyzeRule = AnalyzeRule() - analyzeRule.setContent(body, rssSource.sourceUrl) + analyzeRule.setContent(body, sortUrl) var reverse = false if (ruleArticles.startsWith("-")) { reverse = true @@ -45,7 +45,7 @@ object RssParserByRule { Debug.log(sourceUrl, "┌获取下一页链接") nextUrl = analyzeRule.getString(rssSource.ruleNextPage) if (nextUrl.isNotEmpty()) { - nextUrl = NetworkUtils.getAbsoluteURL(sourceUrl, nextUrl) + nextUrl = NetworkUtils.getAbsoluteURL(sortUrl, nextUrl) } Debug.log(sourceUrl, "└$nextUrl") } @@ -59,7 +59,8 @@ object RssParserByRule { sourceUrl, item, analyzeRule, index == 0, ruleTitle, rulePubDate, ruleDescription, ruleImage, ruleLink )?.let { - it.origin = rssSource.sourceUrl + it.sort = sortName + it.origin = sourceUrl articleList.add(it) } } diff --git a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt index 8559351f4..78a139345 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt @@ -193,6 +193,7 @@ object BookChapterList { list.getOrNull(book.durChapterIndex)?.title ?: book.latestChapterTitle if (book.totalChapterNum < list.size) { book.lastCheckCount = list.size - book.totalChapterNum + book.latestChapterTime = System.currentTimeMillis() } book.totalChapterNum = list.size return list diff --git a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt index 568615aa1..d83ffb832 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookContent.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookContent.kt @@ -2,6 +2,7 @@ package io.legado.app.model.webBook import io.legado.app.App import io.legado.app.R +import io.legado.app.constant.BookType import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookChapter import io.legado.app.data.entities.BookSource @@ -39,7 +40,12 @@ object BookContent { var contentData = analyzeContent( book, baseUrl, body, contentRule, bookChapter, bookSource ) - content.append(contentData.content.replace(bookChapter.title, "")).append("\n") + if (bookSource.bookSourceType == BookType.default) { + content.append(contentData.content.replace(bookChapter.title, "")).append("\n") + } else { + content.append(contentData.content).append("\n") + } + if (contentData.nextUrl.size == 1) { var nextUrl = contentData.nextUrl[0] val nextChapterUrl = if (!nextChapterUrlF.isNullOrEmpty()) @@ -95,6 +101,7 @@ object BookContent { } } + content.deleteCharAt(content.length - 1) Debug.log(bookSource.bookSourceUrl, "┌获取章节名称") Debug.log(bookSource.bookSourceUrl, "└${bookChapter.title}") Debug.log(bookSource.bookSourceUrl, "┌获取正文内容") diff --git a/app/src/main/java/io/legado/app/model/webBook/BookList.kt b/app/src/main/java/io/legado/app/model/webBook/BookList.kt index a205c950a..372a4eec6 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookList.kt @@ -9,11 +9,15 @@ import io.legado.app.model.Debug import io.legado.app.model.analyzeRule.AnalyzeRule import io.legado.app.model.analyzeRule.AnalyzeUrl import io.legado.app.utils.NetworkUtils +import kotlinx.coroutines.CancellationException +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.isActive object BookList { @Throws(Exception::class) fun analyzeBookList( + scope: CoroutineScope, body: String?, bookSource: BookSource, analyzeUrl: AnalyzeUrl, @@ -28,12 +32,13 @@ object BookList { ) ) Debug.log(bookSource.bookSourceUrl, "≡获取成功:${analyzeUrl.ruleUrl}") + if (!scope.isActive) throw CancellationException() val analyzeRule = AnalyzeRule(null) analyzeRule.setContent(body, baseUrl) bookSource.bookUrlPattern?.let { if (baseUrl.matches(it.toRegex())) { Debug.log(bookSource.bookSourceUrl, "≡链接为详情页") - getInfoItem(analyzeRule, bookSource, baseUrl)?.let { searchBook -> + getInfoItem(scope, analyzeRule, bookSource, baseUrl)?.let { searchBook -> searchBook.infoHtml = body bookList.add(searchBook) } @@ -59,7 +64,7 @@ object BookList { collections = analyzeRule.getElements(ruleList) if (collections.isEmpty() && bookSource.bookUrlPattern.isNullOrEmpty()) { Debug.log(bookSource.bookSourceUrl, "└列表为空,按详情页解析") - getInfoItem(analyzeRule, bookSource, baseUrl)?.let { searchBook -> + getInfoItem(scope, analyzeRule, bookSource, baseUrl)?.let { searchBook -> searchBook.infoHtml = body bookList.add(searchBook) } @@ -74,8 +79,9 @@ object BookList { val ruleWordCount = analyzeRule.splitSourceRule(bookListRule.wordCount) Debug.log(bookSource.bookSourceUrl, "└列表大小:${collections.size}") for ((index, item) in collections.withIndex()) { + if (!scope.isActive) throw CancellationException() getSearchItem( - item, analyzeRule, bookSource, baseUrl, index == 0, + scope, item, analyzeRule, bookSource, baseUrl, index == 0, ruleName = ruleName, ruleBookUrl = ruleBookUrl, ruleAuthor = ruleAuthor, ruleCoverUrl = ruleCoverUrl, ruleIntro = ruleIntro, ruleKind = ruleKind, ruleLastChapter = ruleLastChapter, ruleWordCount = ruleWordCount @@ -93,7 +99,9 @@ object BookList { return bookList } + @Throws(Exception::class) private fun getInfoItem( + scope: CoroutineScope, analyzeRule: AnalyzeRule, bookSource: BookSource, baseUrl: String @@ -108,29 +116,37 @@ object BookList { with(bookSource.getBookInfoRule()) { init?.let { if (it.isNotEmpty()) { + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "≡执行详情页初始化规则") analyzeRule.setContent(analyzeRule.getElement(it)) } } + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取书名") searchBook.name = analyzeRule.getString(name) Debug.log(bookSource.bookSourceUrl, "└${searchBook.name}") if (searchBook.name.isNotEmpty()) { + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取作者") searchBook.author = BookHelp.formatAuthor(analyzeRule.getString(author)) Debug.log(bookSource.bookSourceUrl, "└${searchBook.author}") + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取分类") searchBook.kind = analyzeRule.getStringList(kind)?.joinToString(",") Debug.log(bookSource.bookSourceUrl, "└${searchBook.kind}") + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取字数") searchBook.wordCount = analyzeRule.getString(wordCount) Debug.log(bookSource.bookSourceUrl, "└${searchBook.wordCount}") + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取最新章节") searchBook.latestChapterTitle = analyzeRule.getString(lastChapter) Debug.log(bookSource.bookSourceUrl, "└${searchBook.latestChapterTitle}") + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取简介") searchBook.intro = analyzeRule.getString(intro) Debug.log(bookSource.bookSourceUrl, "└${searchBook.intro}", true) + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取封面链接") searchBook.coverUrl = analyzeRule.getString(coverUrl, true) Debug.log(bookSource.bookSourceUrl, "└${searchBook.coverUrl}") @@ -140,7 +156,9 @@ object BookList { return null } + @Throws(Exception::class) private fun getSearchItem( + scope: CoroutineScope, item: Any, analyzeRule: AnalyzeRule, bookSource: BookSource, @@ -162,30 +180,38 @@ object BookList { searchBook.originOrder = bookSource.customOrder analyzeRule.book = searchBook analyzeRule.setContent(item) + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取书名", log) searchBook.name = analyzeRule.getString(ruleName) Debug.log(bookSource.bookSourceUrl, "└${searchBook.name}", log) if (searchBook.name.isNotEmpty()) { + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取作者", log) searchBook.author = BookHelp.formatAuthor(analyzeRule.getString(ruleAuthor)) Debug.log(bookSource.bookSourceUrl, "└${searchBook.author}", log) + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取分类", log) searchBook.kind = analyzeRule.getStringList(ruleKind)?.joinToString(",") Debug.log(bookSource.bookSourceUrl, "└${searchBook.kind}", log) + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取字数", log) searchBook.wordCount = analyzeRule.getString(ruleWordCount) Debug.log(bookSource.bookSourceUrl, "└${searchBook.wordCount}", log) + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取最新章节", log) searchBook.latestChapterTitle = analyzeRule.getString(ruleLastChapter) Debug.log(bookSource.bookSourceUrl, "└${searchBook.latestChapterTitle}", log) + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取简介", log) searchBook.intro = analyzeRule.getString(ruleIntro) Debug.log(bookSource.bookSourceUrl, "└${searchBook.intro}", log, true) + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取封面链接", log) analyzeRule.getString(ruleCoverUrl).let { if (it.isNotEmpty()) searchBook.coverUrl = NetworkUtils.getAbsoluteURL(baseUrl, it) } Debug.log(bookSource.bookSourceUrl, "└${searchBook.coverUrl}", log) + if (!scope.isActive) throw CancellationException() Debug.log(bookSource.bookSourceUrl, "┌获取详情页链接", log) searchBook.bookUrl = analyzeRule.getString(ruleBookUrl, true) if (searchBook.bookUrl.isEmpty()) { diff --git a/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt b/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt index 00c9d0522..fb1f5df59 100644 --- a/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt +++ b/app/src/main/java/io/legado/app/receiver/MediaButtonReceiver.kt @@ -8,9 +8,14 @@ import io.legado.app.App import io.legado.app.constant.EventBus import io.legado.app.data.entities.Book import io.legado.app.help.ActivityHelp +import io.legado.app.service.AudioPlayService +import io.legado.app.service.BaseReadAloudService +import io.legado.app.service.help.AudioPlay +import io.legado.app.service.help.ReadAloud import io.legado.app.ui.audio.AudioPlayActivity import io.legado.app.ui.book.read.ReadBookActivity import io.legado.app.ui.main.MainActivity +import io.legado.app.utils.getPrefBoolean import io.legado.app.utils.postEvent import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main @@ -50,11 +55,23 @@ class MediaButtonReceiver : BroadcastReceiver() { private fun readAloud(context: Context) { when { + BaseReadAloudService.isRun -> if (BaseReadAloudService.isPlay()) { + ReadAloud.pause(context) + AudioPlay.pause(context) + } else { + ReadAloud.resume(context) + AudioPlay.resume(context) + } + AudioPlayService.isRun -> if (AudioPlayService.pause) { + AudioPlay.resume(context) + } else { + AudioPlay.pause(context) + } ActivityHelp.isExist(AudioPlayActivity::class.java) -> postEvent(EventBus.MEDIA_BUTTON, true) ActivityHelp.isExist(ReadBookActivity::class.java) -> postEvent(EventBus.MEDIA_BUTTON, true) - else -> { + else -> if (context.getPrefBoolean("mediaButtonOnExit", true)) { GlobalScope.launch(Main) { val lastBook: Book? = withContext(IO) { App.db.bookDao().lastReadBook diff --git a/app/src/main/java/io/legado/app/service/AudioPlayService.kt b/app/src/main/java/io/legado/app/service/AudioPlayService.kt index c165f3142..986e7c4ed 100644 --- a/app/src/main/java/io/legado/app/service/AudioPlayService.kt +++ b/app/src/main/java/io/legado/app/service/AudioPlayService.kt @@ -18,9 +18,9 @@ import androidx.core.app.NotificationCompat import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseService -import io.legado.app.constant.IntentAction import io.legado.app.constant.AppConst import io.legado.app.constant.EventBus +import io.legado.app.constant.IntentAction import io.legado.app.constant.Status import io.legado.app.data.entities.BookChapter import io.legado.app.help.BookHelp @@ -275,7 +275,7 @@ class AudioPlayService : BaseService(), AudioPlay.book?.let { book -> AudioPlay.webBook?.getContent(book, chapter, scope = this) ?.onSuccess(IO) { content -> - if (content.isNullOrEmpty()) { + if (content.isEmpty()) { withContext(Main) { toast("未获取到资源链接") } diff --git a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt index 3ad351ca7..1a4de9e6f 100644 --- a/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/BaseReadAloudService.kt @@ -111,11 +111,17 @@ abstract class BaseReadAloudService : BaseService(), if (getPrefBoolean(PreferKey.readAloudByPage)) { for (index in pageIndex..textChapter.lastIndex()) { textChapter.page(index)?.text?.split("\n")?.let { - contentList.addAll(it) + if (it.isNotEmpty()) { + contentList.addAll(it) + } } } } else { - contentList.addAll(textChapter.getUnRead(pageIndex).split("\n")) + textChapter.getUnRead(pageIndex).split("\n").forEach { + if (it.isNotEmpty()) { + contentList.add(it) + } + } } if (play) play() } ?: stopSelf() diff --git a/app/src/main/java/io/legado/app/service/CheckSourceService.kt b/app/src/main/java/io/legado/app/service/CheckSourceService.kt index 336dfb18d..8cbd80afd 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -7,20 +7,22 @@ import io.legado.app.R import io.legado.app.base.BaseService import io.legado.app.constant.AppConst import io.legado.app.constant.IntentAction +import io.legado.app.data.entities.BookSource import io.legado.app.help.AppConfig import io.legado.app.help.IntentHelp -import io.legado.app.help.coroutine.Coroutine +import io.legado.app.help.coroutine.CompositeCoroutine import io.legado.app.model.WebBook import io.legado.app.ui.book.source.manage.BookSourceActivity import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.asCoroutineDispatcher import org.jetbrains.anko.toast import java.util.concurrent.Executors +import kotlin.math.min class CheckSourceService : BaseService() { private val threadCount = AppConfig.threadCount private var searchPool = Executors.newFixedThreadPool(threadCount).asCoroutineDispatcher() - private var task: Coroutine<*>? = null + private var tasks = CompositeCoroutine() private val allIds = ArrayList() private val checkedIds = ArrayList() private var processIndex = 0 @@ -42,23 +44,23 @@ class CheckSourceService : BaseService() { override fun onDestroy() { super.onDestroy() - task?.cancel() + tasks.clear() searchPool.close() } private fun check(ids: List) { - task?.cancel() + if (allIds.isNotEmpty()) { + toast("已有书源在校验,等完成后再试") + return + } + tasks.clear() allIds.clear() checkedIds.clear() allIds.addAll(ids) processIndex = 0 updateNotification(0, getString(R.string.progress_show, 0, allIds.size)) - task = execute { - for (i in 0 until threadCount) { - check() - } - }.onError { - toast("校验书源出错:${it.localizedMessage}") + for (i in 0 until min(threadCount, allIds.size)) { + check() } } @@ -67,27 +69,41 @@ class CheckSourceService : BaseService() { synchronized(this) { processIndex++ } - if (processIndex < allIds.size) { - val sourceUrl = allIds[processIndex] - App.db.bookSourceDao().getBookSource(sourceUrl)?.let { source -> - val webBook = WebBook(source) - webBook.searchBook("我的", scope = this, context = searchPool) - .onError(IO) { - source.addGroup("失效") - App.db.bookSourceDao().update(source) - }.onFinally(IO) { - check() - checkedIds.add(sourceUrl) - updateNotification( - checkedIds.size, - getString(R.string.progress_show, checkedIds.size, allIds.size) - ) - synchronized(this) { - if (processIndex >= allIds.size + threadCount - 1) { - stopSelf() - } - } + execute { + if (processIndex < allIds.size) { + val sourceUrl = allIds[processIndex] + App.db.bookSourceDao().getBookSource(sourceUrl)?.let { source -> + if (source.searchUrl.isNullOrEmpty()) { + onNext(sourceUrl) + } else { + check(source) } + } ?: onNext(sourceUrl) + } + } + } + + private fun check(source: BookSource) { + val webBook = WebBook(source) + tasks.add(webBook.searchBook("我的", scope = this, context = searchPool) + .onError(IO) { + source.addGroup("失效") + App.db.bookSourceDao().update(source) + }.onFinally(IO) { + onNext(source.bookSourceUrl) + }) + } + + private fun onNext(sourceUrl: String) { + synchronized(this) { + check() + checkedIds.add(sourceUrl) + updateNotification( + checkedIds.size, + getString(R.string.progress_show, checkedIds.size, allIds.size) + ) + if (processIndex >= allIds.size + min(threadCount, allIds.size) - 1) { + stopSelf() } } } diff --git a/app/src/main/java/io/legado/app/service/DownloadService.kt b/app/src/main/java/io/legado/app/service/DownloadService.kt index 732506449..1cbfe44f4 100644 --- a/app/src/main/java/io/legado/app/service/DownloadService.kt +++ b/app/src/main/java/io/legado/app/service/DownloadService.kt @@ -13,6 +13,7 @@ import io.legado.app.data.entities.BookChapter import io.legado.app.help.AppConfig import io.legado.app.help.BookHelp import io.legado.app.help.IntentHelp +import io.legado.app.help.coroutine.CompositeCoroutine import io.legado.app.help.coroutine.Coroutine import io.legado.app.model.WebBook import io.legado.app.utils.postEvent @@ -25,7 +26,7 @@ import java.util.concurrent.Executors class DownloadService : BaseService() { private var searchPool = Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher() - private var tasks: ArrayList> = arrayListOf() + private var tasks = CompositeCoroutine() private val handler = Handler() private var runnable: Runnable = Runnable { upDownload() } private val downloadMap = hashMapOf>() @@ -125,15 +126,9 @@ class DownloadService : BaseService() { chapter, scope = this, context = searchPool - ) - //.onStart { - // notificationContent = "启动:" + chapter.title - //} - .onSuccess(IO) { content -> - content?.let { - downloadCount[entry.key]?.increaseSuccess() - BookHelp.saveContent(book, chapter, content) - } + ).onSuccess(IO) { content -> + downloadCount[entry.key]?.increaseSuccess() + BookHelp.saveContent(book, chapter, content) } .onFinally(IO) { synchronized(this@DownloadService) { @@ -167,7 +162,7 @@ class DownloadService : BaseService() { tasks.add(task) task.invokeOnCompletion { tasks.remove(task) - if (tasks.isEmpty()) { + if (tasks.isEmpty) { stopSelf() } } @@ -194,17 +189,21 @@ class DownloadService : BaseService() { val notification = builder.build() startForeground(AppConst.notificationIdDownload, notification) } -} -class DownloadCount{ - @Volatile public var downloadFinishedCount = 0 // 下载完成的条目数量 - @Volatile public var successCount = 0 //下载成功的条目数量 - fun increaseSuccess(){ - ++successCount; - } + class DownloadCount { + @Volatile + var downloadFinishedCount = 0 // 下载完成的条目数量 + + @Volatile + var successCount = 0 //下载成功的条目数量 - fun increaseFinished(){ - ++downloadFinishedCount; + fun increaseSuccess() { + ++successCount; + } + + fun increaseFinished() { + ++downloadFinishedCount; + } } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt b/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt index e54900db7..1f63dac89 100644 --- a/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/TTSReadAloudService.kt @@ -29,7 +29,7 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener } } - private var ttsIsSuccess: Boolean = false + private var ttsInitFinish = false override fun onCreate() { super.onCreate() @@ -42,22 +42,23 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener clearTTS() } + @Synchronized override fun onInit(status: Int) { - launch { - if (status == TextToSpeech.SUCCESS) { - textToSpeech?.language = Locale.CHINA - textToSpeech?.setOnUtteranceProgressListener(TTSUtteranceListener()) - ttsIsSuccess = true - play() - } else { + if (status == TextToSpeech.SUCCESS) { + textToSpeech?.language = Locale.CHINA + textToSpeech?.setOnUtteranceProgressListener(TTSUtteranceListener()) + ttsInitFinish = true + play() + } else { + launch { toast(R.string.tts_init_failed) } } } - @Suppress("DEPRECATION") + @Synchronized override fun play() { - if (contentList.isEmpty() || !ttsIsSuccess) { + if (contentList.isEmpty() || !ttsInitFinish) { return } if (requestFocus()) { @@ -175,7 +176,7 @@ class TTSReadAloudService : BaseReadAloudService(), TextToSpeech.OnInitListener } override fun onError(s: String) { - pauseReadAloud(true) + //nothing } } diff --git a/app/src/main/java/io/legado/app/service/help/ReadBook.kt b/app/src/main/java/io/legado/app/service/help/ReadBook.kt index 85f2fff45..89f730ae5 100644 --- a/app/src/main/java/io/legado/app/service/help/ReadBook.kt +++ b/app/src/main/java/io/legado/app/service/help/ReadBook.kt @@ -21,7 +21,6 @@ import org.jetbrains.anko.toast object ReadBook { - var titleDate = MutableLiveData() var book: Book? = null var inBookshelf = false @@ -34,9 +33,10 @@ object ReadBook { var curTextChapter: TextChapter? = null var nextTextChapter: TextChapter? = null var webBook: WebBook? = null + var msg: String? = null private val loadingChapters = arrayListOf() - fun resetData(book: Book) { + fun resetData(book: Book, noSource: (name: String, author: String) -> Unit) { this.book = book titleDate.postValue(book.name) durChapterIndex = book.durChapterIndex @@ -46,12 +46,27 @@ object ReadBook { prevTextChapter = null curTextChapter = null nextTextChapter = null - upWebBook(book.origin) + upWebBook(book, noSource) } - fun upWebBook(origin: String) { - val bookSource = App.db.bookSourceDao().getBookSource(origin) - webBook = if (bookSource != null) WebBook(bookSource) else null + fun upWebBook(book: Book?, noSource: (name: String, author: String) -> Unit) { + book ?: return + if (book.origin == BookType.local) { + webBook = null + } else { + val bookSource = App.db.bookSourceDao().getBookSource(book.origin) + if (bookSource != null) { + webBook = WebBook(bookSource) + } else { + webBook = null + noSource.invoke(book.name, book.author) + } + } + } + + fun upMsg(msg: String?) { + this.msg = msg + callBack?.upContent() } fun moveToNextPage() { @@ -69,11 +84,11 @@ object ReadBook { nextTextChapter = null book?.let { if (curTextChapter == null) { - loadContent(durChapterIndex, upContent) + loadContent(durChapterIndex, upContent, false) } else if (upContent) { callBack?.upContent() } - loadContent(durChapterIndex.plus(1), upContent) + loadContent(durChapterIndex.plus(1), upContent, false) GlobalScope.launch(Dispatchers.IO) { for (i in 2..10) { delay(100) @@ -99,11 +114,11 @@ object ReadBook { prevTextChapter = null book?.let { if (curTextChapter == null) { - loadContent(durChapterIndex, upContent) + loadContent(durChapterIndex, upContent, false) } else if (upContent) { callBack?.upContent() } - loadContent(durChapterIndex.minus(1), upContent) + loadContent(durChapterIndex.minus(1), upContent, false) GlobalScope.launch(Dispatchers.IO) { for (i in -5..-2) { delay(100) @@ -184,21 +199,21 @@ object ReadBook { /** * 加载章节内容 */ - fun loadContent() { - loadContent(durChapterIndex) - loadContent(durChapterIndex + 1) - loadContent(durChapterIndex - 1) + fun loadContent(resetPageOffset: Boolean) { + loadContent(durChapterIndex, resetPageOffset = resetPageOffset) + loadContent(durChapterIndex + 1, resetPageOffset = resetPageOffset) + loadContent(durChapterIndex - 1, resetPageOffset = resetPageOffset) } - fun loadContent(index: Int, upContent: Boolean = true) { + fun loadContent(index: Int, upContent: Boolean = true, resetPageOffset: Boolean) { book?.let { book -> if (addLoading(index)) { Coroutine.async { App.db.bookChapterDao().getChapter(book.bookUrl, index)?.let { chapter -> BookHelp.getContent(book, chapter)?.let { - contentLoadFinish(chapter, it, upContent) + contentLoadFinish(chapter, it, upContent, resetPageOffset) removeLoading(chapter.index) - } ?: download(chapter) + } ?: download(chapter, resetPageOffset = resetPageOffset) } ?: removeLoading(index) }.onError { removeLoading(index) @@ -216,7 +231,7 @@ object ReadBook { if (BookHelp.hasContent(book, chapter)) { removeLoading(chapter.index) } else { - download(chapter) + download(chapter, false) } } ?: removeLoading(index) }.onError { @@ -226,20 +241,28 @@ object ReadBook { } } - private fun download(chapter: BookChapter) { + private fun download(chapter: BookChapter, resetPageOffset: Boolean) { book?.let { book -> webBook?.getContent(book, chapter) ?.onSuccess(Dispatchers.IO) { content -> - if (content.isNullOrEmpty()) { - contentLoadFinish(chapter, App.INSTANCE.getString(R.string.content_empty)) + if (content.isEmpty()) { + contentLoadFinish( + chapter, + App.INSTANCE.getString(R.string.content_empty), + resetPageOffset = resetPageOffset + ) removeLoading(chapter.index) } else { BookHelp.saveContent(book, chapter, content) - contentLoadFinish(chapter, content) + contentLoadFinish(chapter, content, resetPageOffset = resetPageOffset) removeLoading(chapter.index) } }?.onError { - contentLoadFinish(chapter, it.localizedMessage ?: "未知错误") + contentLoadFinish( + chapter, + it.localizedMessage ?: "未知错误", + resetPageOffset = resetPageOffset + ) removeLoading(chapter.index) } } @@ -265,7 +288,8 @@ object ReadBook { private fun contentLoadFinish( chapter: BookChapter, content: String, - upContent: Boolean = true + upContent: Boolean = true, + resetPageOffset: Boolean ) { Coroutine.async { if (chapter.index in durChapterIndex - 1..durChapterIndex + 1) { @@ -279,18 +303,18 @@ object ReadBook { when (chapter.index) { durChapterIndex -> { curTextChapter = ChapterProvider.getTextChapter(chapter, c, chapterSize) - if (upContent) callBack?.upContent() + if (upContent) callBack?.upContent(resetPageOffset = resetPageOffset) callBack?.upView() curPageChanged() callBack?.contentLoadFinish() } durChapterIndex - 1 -> { prevTextChapter = ChapterProvider.getTextChapter(chapter, c, chapterSize) - if (upContent) callBack?.upContent(-1) + if (upContent) callBack?.upContent(-1, resetPageOffset) } durChapterIndex + 1 -> { nextTextChapter = ChapterProvider.getTextChapter(chapter, c, chapterSize) - if (upContent) callBack?.upContent(1) + if (upContent) callBack?.upContent(1, resetPageOffset) } } } @@ -307,7 +331,7 @@ object ReadBook { book.durChapterTime = System.currentTimeMillis() book.durChapterIndex = durChapterIndex book.durChapterPos = durPageIndex - curTextChapter?.let { + App.db.bookChapterDao().getChapter(book.bookUrl, durChapterIndex)?.let { book.durChapterTitle = it.title } App.db.bookDao().update(book) @@ -316,7 +340,7 @@ object ReadBook { } interface CallBack { - fun upContent(relativePosition: Int = 0) + fun upContent(relativePosition: Int = 0, resetPageOffset: Boolean = true) fun upView() fun upPageProgress() fun contentLoadFinish() diff --git a/app/src/main/java/io/legado/app/ui/README.md b/app/src/main/java/io/legado/app/ui/README.md index b408eb6b9..ef44bed69 100644 --- a/app/src/main/java/io/legado/app/ui/README.md +++ b/app/src/main/java/io/legado/app/ui/README.md @@ -6,7 +6,7 @@ * book\info 书籍信息查看 * book\read 书籍阅读界面 * book\search 搜索书籍界面 -* book\source 搜索书源界面 +* book\source 书源界面 * book\changeCover 封面换源界面 * book\changeSource 换源界面 * book\chapterList 目录界面 diff --git a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt index 365381fbd..3b56737cf 100644 --- a/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt +++ b/app/src/main/java/io/legado/app/ui/about/AboutFragment.kt @@ -22,6 +22,7 @@ class AboutFragment : PreferenceFragmentCompat() { private val qqGroups = linkedMapOf( Pair("(QQ群VIP1)701903217", "-iolizL4cbJSutKRpeImHlXlpLDZnzeF"), Pair("(QQ群VIP2)263949160", "xwfh7_csb2Gf3Aw2qexEcEtviLfLfd4L"), + Pair("(QQ群VIP3)680280282", "_N0i7yZObjKSeZQvzoe2ej7j02kLnOOK"), Pair("(QQ群1)805192012", "6GlFKjLeIk5RhQnR3PNVDaKB6j10royo"), Pair("(QQ群2)773736122", "5Bm5w6OgLupXnICbYvbgzpPUgf0UlsJF"), Pair("(QQ群3)981838750", "g_Sgmp2nQPKqcZQ5qPcKLHziwX_mpps9"), diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt index bece64c93..3c960093b 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayActivity.kt @@ -46,9 +46,8 @@ class AudioPlayActivity : private var adjustProgress = false override fun onActivityCreated(savedInstanceState: Bundle?) { - setSupportActionBar(toolbar) - supportActionBar?.setDisplayHomeAsUpEnabled(true) - AudioPlay.titleData.observe(this, Observer { toolbar.title = it }) + title_bar.transparent() + AudioPlay.titleData.observe(this, Observer { title_bar.title = it }) AudioPlay.coverData.observe(this, Observer { upCover(it) }) viewModel.initData(intent) initView() diff --git a/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt b/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt index b5dd5bfba..124fd710f 100644 --- a/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/audio/AudioPlayViewModel.kt @@ -11,7 +11,6 @@ import io.legado.app.help.BookHelp import io.legado.app.model.WebBook import io.legado.app.service.help.AudioPlay import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.withContext class AudioPlayViewModel(application: Application) : BaseViewModel(application) { @@ -72,7 +71,7 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application) execute { AudioPlay.webBook?.getChapterList(book, this) ?.onSuccess(Dispatchers.IO) { cList -> - if (!cList.isNullOrEmpty()) { + if (cList.isNotEmpty()) { if (changeDruChapterIndex == null) { App.db.bookChapterDao().insert(*cList.toTypedArray()) AudioPlay.chapterSize = cList.size @@ -91,10 +90,8 @@ class AudioPlayViewModel(application: Application) : BaseViewModel(application) fun changeTo(book1: Book) { execute { AudioPlay.book?.let { + book1.order = it.order App.db.bookDao().delete(it) - } - withContext(Dispatchers.Main) { - } App.db.bookDao().insert(book1) AudioPlay.book = book1 diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt index f3b0d5ee5..491922cb1 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt @@ -6,12 +6,16 @@ import android.view.MenuItem import androidx.appcompat.widget.PopupMenu import androidx.lifecycle.LiveData import androidx.lifecycle.Observer +import androidx.recyclerview.widget.ItemTouchHelper import androidx.recyclerview.widget.LinearLayoutManager import io.legado.app.App import io.legado.app.R import io.legado.app.base.VMBaseActivity +import io.legado.app.constant.AppConst +import io.legado.app.constant.PreferKey import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookGroup +import io.legado.app.help.ItemTouchCallback import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.okButton @@ -21,6 +25,7 @@ import io.legado.app.ui.book.group.GroupSelectDialog import io.legado.app.ui.widget.SelectActionBar import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.applyTint +import io.legado.app.utils.getPrefInt import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.activity_arrange_book.* @@ -64,6 +69,10 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi recycler_view.addItemDecoration(VerticalDivider(this)) adapter = ArrangeBookAdapter(this, this) recycler_view.adapter = adapter + val itemTouchCallback = ItemTouchCallback() + itemTouchCallback.onItemTouchCallbackListener = adapter + itemTouchCallback.isCanDrag = getPrefInt(PreferKey.bookshelfSort) == 3 + ItemTouchHelper(itemTouchCallback).attachToRecyclerView(recycler_view) select_action_bar.setMainActionText(R.string.move_to_group) select_action_bar.inflateMenu(R.menu.arrange_book_sel) select_action_bar.setOnMenuItemClickListener(this) @@ -97,14 +106,20 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi booksLiveData?.removeObservers(this) booksLiveData = when (groupId) { - -1 -> App.db.bookDao().observeAll() - -2 -> App.db.bookDao().observeLocal() - -3 -> App.db.bookDao().observeAudio() - -11 -> App.db.bookDao().observeNoGroup() + AppConst.bookGroupAll.groupId -> App.db.bookDao().observeAll() + AppConst.bookGroupLocal.groupId -> App.db.bookDao().observeLocal() + AppConst.bookGroupAudio.groupId -> App.db.bookDao().observeAudio() + AppConst.bookGroupNone.groupId -> App.db.bookDao().observeNoGroup() else -> App.db.bookDao().observeByGroup(groupId) } - booksLiveData?.observe(this, Observer { - adapter.setItems(it) + booksLiveData?.observe(this, Observer { list -> + val books = when (getPrefInt(PreferKey.bookshelfSort)) { + 1 -> list.sortedByDescending { it.latestChapterTime } + 2 -> list.sortedBy { it.name } + 3 -> list.sortedBy { it.order } + else -> list.sortedByDescending { it.durChapterTime } + } + adapter.setItems(books) upSelectCount() }) } @@ -115,22 +130,22 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi .show(supportFragmentManager, "groupManage") R.id.menu_no_group -> { title_bar.subtitle = getString(R.string.no_group) - groupId = -11 + groupId = AppConst.bookGroupNone.groupId initBookData() } R.id.menu_all -> { title_bar.subtitle = item.title - groupId = -1 + groupId = AppConst.bookGroupAll.groupId initBookData() } R.id.menu_local -> { title_bar.subtitle = item.title - groupId = -2 + groupId = AppConst.bookGroupLocal.groupId initBookData() } R.id.menu_audio -> { title_bar.subtitle = item.title - groupId = -3 + groupId = AppConst.bookGroupAudio.groupId initBookData() } else -> if (item.groupId == R.id.menu_group) { @@ -199,6 +214,10 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi select_action_bar.upCountView(adapter.selectedBooks().size, adapter.getItems().size) } + override fun updateBook(vararg book: Book) { + viewModel.updateBook(*book) + } + override fun deleteBook(book: Book) { alert(titleResource = R.string.draw, messageResource = R.string.sure_del) { okButton { diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt index 96fe1344e..4917ea6cb 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt @@ -1,17 +1,23 @@ package io.legado.app.ui.book.arrange import android.content.Context +import android.view.View +import androidx.recyclerview.widget.RecyclerView import io.legado.app.R import io.legado.app.base.adapter.ItemViewHolder import io.legado.app.base.adapter.SimpleRecyclerAdapter import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookGroup +import io.legado.app.help.ItemTouchCallback +import io.legado.app.lib.theme.backgroundColor import kotlinx.android.synthetic.main.item_arrange_book.view.* +import org.jetbrains.anko.backgroundColor import org.jetbrains.anko.sdk27.listeners.onClick - +import java.util.* class ArrangeBookAdapter(context: Context, val callBack: CallBack) : - SimpleRecyclerAdapter(context, R.layout.item_arrange_book) { + SimpleRecyclerAdapter(context, R.layout.item_arrange_book), + ItemTouchCallback.OnItemTouchCallbackListener { val groupRequestCode = 12 private val selectedBooks: HashSet = hashSetOf() var actionItem: Book? = null @@ -52,12 +58,11 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) : override fun convert(holder: ItemViewHolder, item: Book, payloads: MutableList) { with(holder.itemView) { - tv_name.text = if (item.author.isEmpty()) { - item.name - } else { - "${item.name}(${item.author})" - } - tv_author.text = getGroupName(item.group) + backgroundColor = context.backgroundColor + tv_name.text = item.name + tv_author.text = item.author + tv_author.visibility = if (item.author.isEmpty()) View.GONE else View.VISIBLE + tv_group_s.text = getGroupName(item.group) checkbox.isChecked = selectedBooks.contains(item) } } @@ -102,22 +107,57 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) : } } - private fun getGroupName(groupId: Int): String { + private fun getGroupList(groupId: Int): List { val groupNames = arrayListOf() callBack.groupList.forEach { if (it.groupId and groupId > 0) { groupNames.add(it.groupName) } } + return groupNames + } + + private fun getGroupName(groupId: Int): String { + val groupNames = getGroupList(groupId) if (groupNames.isEmpty()) { - return context.getString(R.string.no_group) + return "" } return groupNames.joinToString(",") } + private var isMoved = false + + override fun onMove(srcPosition: Int, targetPosition: Int): Boolean { + val srcItem = getItem(srcPosition) + val targetItem = getItem(targetPosition) + Collections.swap(getItems(), srcPosition, targetPosition) + notifyItemMoved(srcPosition, targetPosition) + if (srcItem != null && targetItem != null) { + if (srcItem.order == targetItem.order) { + for ((index, item) in getItems().withIndex()) { + item.order = index + 1 + } + } else { + val pos = srcItem.order + srcItem.order = targetItem.order + targetItem.order = pos + } + } + isMoved = true + return true + } + + override fun onClearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { + if (isMoved) { + callBack.updateBook(*getItems().toTypedArray()) + } + isMoved = false + } + interface CallBack { val groupList: List fun upSelectCount() + fun updateBook(vararg book: Book) fun deleteBook(book: Book) fun selectGroup(groupId: Int, requestCode: Int) } diff --git a/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverViewModel.kt b/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverViewModel.kt index 627bacc09..0c91fe0f9 100644 --- a/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/changecover/ChangeCoverViewModel.kt @@ -51,14 +51,13 @@ class ChangeCoverViewModel(application: Application) : BaseViewModel(application fun search() { task = execute { - searchStateData.postValue(true) val bookSourceList = App.db.bookSourceDao().allEnabled for (item in bookSourceList) { //task取消时自动取消 by (scope = this@execute) WebBook(item).searchBook(name, scope = this@execute, context = searchPool) .timeout(30000L) .onSuccess(Dispatchers.IO) { - if (it != null && it.isNotEmpty()) { + if (it.isNotEmpty()) { val searchBook = it[0] if (searchBook.name == name && searchBook.author == author && !searchBook.coverUrl.isNullOrEmpty() @@ -72,6 +71,10 @@ class ChangeCoverViewModel(application: Application) : BaseViewModel(application } } } + }.onStart { + searchStateData.postValue(true) + }.onCancel { + searchStateData.postValue(false) } task?.invokeOnCompletion { diff --git a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt index e0800c0a1..b375aed11 100644 --- a/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt @@ -72,14 +72,13 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio fun search() { task = execute { - searchStateData.postValue(true) val bookSourceList = App.db.bookSourceDao().allEnabled for (item in bookSourceList) { //task取消时自动取消 by (scope = this@execute) WebBook(item).searchBook(name, scope = this@execute, context = searchPool) .timeout(30000L) .onSuccess(IO) { - it?.forEach { searchBook -> + it.forEach { searchBook -> if (searchBook.name == name && searchBook.author == author) { if (context.getPrefBoolean(PreferKey.changeSourceLoadToc)) { if (searchBook.tocUrl.isEmpty()) { @@ -95,6 +94,10 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio } } } + }.onStart { + searchStateData.postValue(true) + }.onCancel { + searchStateData.postValue(false) } task?.invokeOnCompletion { @@ -107,7 +110,7 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio App.db.bookSourceDao().getBookSource(book.origin)?.let { bookSource -> WebBook(bookSource).getBookInfo(book, this) .onSuccess { - it?.let { loadChapter(it) } + loadChapter(it) }.onError { debug { context.getString(R.string.error_get_book_info) } } @@ -119,13 +122,11 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio execute { App.db.bookSourceDao().getBookSource(book.origin)?.let { bookSource -> WebBook(bookSource).getChapterList(book, this) - .onSuccess(IO) { - it?.let { chapters -> - if (chapters.isNotEmpty()) { - book.latestChapterTitle = chapters.last().title - val searchBook: SearchBook = book.toSearchBook() - searchFinish(searchBook) - } + .onSuccess(IO) { chapters -> + if (chapters.isNotEmpty()) { + book.latestChapterTitle = chapters.last().title + val searchBook: SearchBook = book.toSearchBook() + searchFinish(searchBook) } }.onError { debug { context.getString(R.string.error_get_chapter_list) } diff --git a/app/src/main/java/io/legado/app/ui/book/chapterlist/ChapterListFragment.kt b/app/src/main/java/io/legado/app/ui/book/chapterlist/ChapterListFragment.kt index 9e9b5c813..104f78e23 100644 --- a/app/src/main/java/io/legado/app/ui/book/chapterlist/ChapterListFragment.kt +++ b/app/src/main/java/io/legado/app/ui/book/chapterlist/ChapterListFragment.kt @@ -1,5 +1,6 @@ package io.legado.app.ui.book.chapterlist +import android.annotation.SuppressLint import android.app.Activity.RESULT_OK import android.content.Intent import android.os.Bundle @@ -13,7 +14,7 @@ import io.legado.app.constant.EventBus import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookChapter import io.legado.app.help.BookHelp -import io.legado.app.lib.theme.backgroundColor +import io.legado.app.lib.theme.bottomBackground import io.legado.app.ui.widget.recycler.UpLinearLayoutManager import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.getViewModelOfActivity @@ -36,6 +37,7 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragme private var durChapterIndex = 0 private lateinit var mLayoutManager: UpLinearLayoutManager private var tocLiveData: LiveData>? = null + private var scrollToDurChapter = false override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { viewModel.chapterCallBack = this @@ -53,7 +55,7 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragme } private fun initView() { - ll_chapter_base_info.setBackgroundColor(backgroundColor) + ll_chapter_base_info.setBackgroundColor(bottomBackground) iv_chapter_top.onClick { mLayoutManager.scrollToPositionWithOffset(0, 0) } iv_chapter_bottom.onClick { if (adapter.itemCount > 0) { @@ -65,6 +67,7 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragme } } + @SuppressLint("SetTextI18n") private fun initBook() { launch { withContext(IO) { @@ -73,8 +76,8 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragme initDoc() book?.let { durChapterIndex = it.durChapterIndex - tv_current_chapter_info.text = it.durChapterTitle - mLayoutManager.scrollToPositionWithOffset(durChapterIndex, 0) + tv_current_chapter_info.text = + "${it.durChapterTitle}(${it.durChapterIndex + 1}/${it.totalChapterNum})" initCacheFileNames(it) } } @@ -85,7 +88,10 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragme tocLiveData = App.db.bookChapterDao().observeByBook(viewModel.bookUrl) tocLiveData?.observe(viewLifecycleOwner, Observer { adapter.setItems(it) - mLayoutManager.scrollToPositionWithOffset(durChapterIndex, 0) + if (!scrollToDurChapter) { + mLayoutManager.scrollToPositionWithOffset(durChapterIndex, 0) + scrollToDurChapter = true + } }) } @@ -103,7 +109,7 @@ class ChapterListFragment : VMBaseFragment(R.layout.fragme book?.bookUrl?.let { bookUrl -> if (chapter.bookUrl == bookUrl) { adapter.cacheFileNames.add(BookHelp.formatChapterName(chapter)) - adapter.notifyItemRangeChanged(0, adapter.getActualItemCount(), true) + adapter.notifyItemChanged(chapter.index, true) } } } diff --git a/app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt b/app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt index fec1ed537..b0f860527 100644 --- a/app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/download/DownloadActivity.kt @@ -13,6 +13,7 @@ import io.legado.app.App import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.constant.EventBus +import io.legado.app.constant.PreferKey import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookChapter import io.legado.app.help.BookHelp @@ -81,9 +82,15 @@ class DownloadActivity : VMBaseActivity(R.layout.activity_dow private fun initLiveData() { bookshelfLiveData?.removeObservers(this) bookshelfLiveData = App.db.bookDao().observeDownload() - bookshelfLiveData?.observe(this, Observer { - adapter.setItems(it) - initCacheSize(it) + bookshelfLiveData?.observe(this, Observer { list -> + val books = when (getPrefInt(PreferKey.bookshelfSort)) { + 1 -> list.sortedByDescending { it.latestChapterTime } + 2 -> list.sortedBy { it.name } + 3 -> list.sortedBy { it.order } + else -> list.sortedByDescending { it.durChapterTime } + } + adapter.setItems(books) + initCacheSize(books) }) } diff --git a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowViewModel.kt b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowViewModel.kt index d34e21916..bd22b3968 100644 --- a/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/explore/ExploreShowViewModel.kt @@ -35,11 +35,9 @@ class ExploreShowViewModel(application: Application) : BaseViewModel(application WebBook(source).exploreBook(url, page, this) .timeout(30000L) .onSuccess(IO) { searchBooks -> - searchBooks?.let { - booksData.postValue(searchBooks) - App.db.searchBookDao().insert(*searchBooks.toTypedArray()) - page++ - } + booksData.postValue(searchBooks) + App.db.searchBookDao().insert(*searchBooks.toTypedArray()) + page++ } } } diff --git a/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt index ea4d2b61e..a5d719b57 100644 --- a/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupManageDialog.kt @@ -28,10 +28,12 @@ import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.customView import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.yesButton +import io.legado.app.lib.theme.accentColor import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.applyTint import io.legado.app.utils.getViewModel import io.legado.app.utils.requestInputMethod +import io.legado.app.utils.visible import kotlinx.android.synthetic.main.dialog_edit_text.view.* import kotlinx.android.synthetic.main.dialog_recycler_view.* import kotlinx.android.synthetic.main.item_group_manage.view.* @@ -72,6 +74,9 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { recycler_view.layoutManager = LinearLayoutManager(requireContext()) recycler_view.addItemDecoration(VerticalDivider(requireContext())) recycler_view.adapter = adapter + tv_ok.setTextColor(requireContext().accentColor) + tv_ok.visible() + tv_ok.onClick { dismiss() } App.db.bookGroupDao().liveDataAll().observe(viewLifecycleOwner, Observer { val diffResult = DiffUtil.calculateDiff(GroupDiffCallBack(ArrayList(adapter.getItems()), it)) @@ -94,6 +99,8 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { .isChecked = AppConfig.bookGroupLocalShow it.findItem(R.id.menu_group_audio) .isChecked = AppConfig.bookGroupAudioShow + it.findItem(R.id.menu_group_none) + .isChecked = AppConfig.bookGroupNoneShow } } @@ -115,6 +122,10 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { AppConfig.bookGroupAudioShow = item.isChecked callBack?.upGroup() } + R.id.menu_group_none -> { + item.isChecked = !item.isChecked + AppConfig.bookGroupNoneShow = item.isChecked + } } return true } @@ -212,7 +223,7 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { return true } - override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { + override fun onClearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { if (isMoved) { for ((index, item) in getItems().withIndex()) { item.order = index + 1 diff --git a/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt index b290bc5df..9440a7c46 100644 --- a/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupSelectDialog.kt @@ -94,8 +94,7 @@ class GroupSelectDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { tool_bar.inflateMenu(R.menu.book_group_manage) tool_bar.menu.applyTint(requireContext(), Theme.getTheme()) tool_bar.setOnMenuItemClickListener(this) - tool_bar.menu.findItem(R.id.menu_group_local).isVisible = false - tool_bar.menu.findItem(R.id.menu_group_audio).isVisible = false + tool_bar.menu.setGroupVisible(R.id.menu_groups, false) adapter = GroupAdapter(requireContext()) recycler_view.layoutManager = LinearLayoutManager(requireContext()) recycler_view.addItemDecoration(VerticalDivider(requireContext())) @@ -203,7 +202,7 @@ class GroupSelectDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { return true } - override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { + override fun onClearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { if (isMoved) { for ((index, item) in getItems().withIndex()) { item.order = index + 1 diff --git a/app/src/main/java/io/legado/app/ui/book/group/GroupViewModel.kt b/app/src/main/java/io/legado/app/ui/book/group/GroupViewModel.kt index eb811766e..23555015f 100644 --- a/app/src/main/java/io/legado/app/ui/book/group/GroupViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/group/GroupViewModel.kt @@ -32,6 +32,13 @@ class GroupViewModel(application: Application) : BaseViewModel(application) { fun delGroup(vararg bookGroup: BookGroup) { execute { App.db.bookGroupDao().delete(*bookGroup) + bookGroup.forEach { group -> + val books = App.db.bookDao().getBooksByGroup(group.groupId) + books.forEach { + it.group = it.group - group.groupId + } + App.db.bookDao().update(*books.toTypedArray()) + } } } diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 42e56f206..e0b6f275a 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -1,11 +1,14 @@ package io.legado.app.ui.book.info +import android.annotation.SuppressLint import android.app.Activity import android.content.Intent import android.graphics.drawable.Drawable import android.os.Bundle import android.view.Menu import android.view.MenuItem +import android.widget.CheckBox +import android.widget.LinearLayout import androidx.lifecycle.Observer import com.bumptech.glide.RequestBuilder import com.bumptech.glide.load.resource.drawable.DrawableTransitionOptions @@ -27,7 +30,9 @@ import io.legado.app.ui.book.chapterlist.ChapterListActivity import io.legado.app.ui.book.group.GroupSelectDialog import io.legado.app.ui.book.info.edit.BookInfoEditActivity import io.legado.app.ui.book.read.ReadBookActivity +import io.legado.app.ui.book.search.SearchActivity import io.legado.app.ui.book.source.edit.BookSourceEditActivity +import io.legado.app.utils.dp import io.legado.app.utils.getViewModel import io.legado.app.utils.gone import io.legado.app.utils.visible @@ -52,8 +57,7 @@ class BookInfoActivity : get() = getViewModel(BookInfoViewModel::class.java) override fun onActivityCreated(savedInstanceState: Bundle?) { - setSupportActionBar(toolbar) - supportActionBar?.setDisplayHomeAsUpEnabled(true) + title_bar.transparent() viewModel.bookData.observe(this, Observer { showBook(it) }) viewModel.chapterListData.observe(this, Observer { upLoading(false, it) }) viewModel.initData(intent) @@ -223,25 +227,36 @@ class BookInfoActivity : GroupSelectDialog.show(supportFragmentManager, it.group) } } + tv_author.onClick { + startActivity(Pair("key", viewModel.bookData.value?.author)) + } + tv_name.onClick { + startActivity(Pair("key", viewModel.bookData.value?.name)) + } } + @SuppressLint("InflateParams") private fun deleteBook() { viewModel.bookData.value?.let { if (it.isLocalBook()) { alert( titleResource = R.string.sure, - messageResource = R.string.sure_delete_book_file + messageResource = R.string.sure_del ) { - positiveButton(R.string.yes) { - viewModel.delBook(true) { - finish() - } + val checkBox = CheckBox(this@BookInfoActivity).apply { + setText(R.string.delete_book_file) + } + val view = LinearLayout(this@BookInfoActivity).apply { + setPadding(16.dp, 0, 16.dp, 0) + addView(checkBox) } - negativeButton(R.string.no) { - viewModel.delBook(false) { + customView = view + positiveButton(R.string.yes) { + viewModel.delBook(checkBox.isChecked) { finish() } } + negativeButton(R.string.no) }.show() } else { viewModel.delBook { diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt index 485d704ce..47dc6c33f 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt @@ -59,13 +59,11 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { App.db.bookSourceDao().getBookSource(book.origin)?.let { bookSource -> WebBook(bookSource).getBookInfo(book, this) .onSuccess(IO) { - it?.let { - bookData.postValue(book) - if (inBookshelf) { - App.db.bookDao().update(book) - } - loadChapter(it, changeDruChapterIndex) + bookData.postValue(book) + if (inBookshelf) { + App.db.bookDao().update(book) } + loadChapter(it, changeDruChapterIndex) }.onError { toast(R.string.error_get_book_info) } @@ -83,7 +81,7 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { ) { execute { if (book.isLocalBook()) { - AnalyzeTxtFile.analyze(context, book).let { + AnalyzeTxtFile().analyze(context, book).let { App.db.bookDao().update(book) App.db.bookChapterDao().insert(*it.toTypedArray()) chapterListData.postValue(it) @@ -92,20 +90,18 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { App.db.bookSourceDao().getBookSource(book.origin)?.let { bookSource -> WebBook(bookSource).getChapterList(book, this) .onSuccess(IO) { - it?.let { - if (it.isNotEmpty()) { - if (inBookshelf) { - App.db.bookDao().update(book) - App.db.bookChapterDao().insert(*it.toTypedArray()) - } - if (changeDruChapterIndex == null) { - chapterListData.postValue(it) - } else { - changeDruChapterIndex(it) - } + if (it.isNotEmpty()) { + if (inBookshelf) { + App.db.bookDao().update(book) + App.db.bookChapterDao().insert(*it.toTypedArray()) + } + if (changeDruChapterIndex == null) { + chapterListData.postValue(it) } else { - toast(R.string.chapter_list_empty) + changeDruChapterIndex(it) } + } else { + toast(R.string.chapter_list_empty) } }.onError { chapterListData.postValue(null) @@ -116,6 +112,8 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { toast(R.string.error_no_source) } } + }.onError { + toast("LoadTocError:${it.localizedMessage}") } } @@ -137,6 +135,8 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { execute { if (inBookshelf) { bookData.value?.let { + book.group = it.group + book.order = it.order App.db.bookDao().delete(it) } App.db.bookDao().insert(book) @@ -158,8 +158,10 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { chapters ) book.durChapterTitle = chapters[book.durChapterIndex].title - App.db.bookDao().insert(book) - App.db.bookChapterDao().insert(*chapters.toTypedArray()) + if (inBookshelf) { + App.db.bookDao().insert(book) + App.db.bookChapterDao().insert(*chapters.toTypedArray()) + } bookData.postValue(book) chapterListData.postValue(chapters) } @@ -168,6 +170,13 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { fun saveBook(success: (() -> Unit)? = null) { execute { bookData.value?.let { book -> + if (book.order == 0) { + book.order = App.db.bookDao().maxOrder + 1 + } + App.db.bookDao().getBook(book.name, book.author)?.let { + book.durChapterPos = it.durChapterPos + book.durChapterTitle = it.durChapterTitle + } App.db.bookDao().insert(book) } }.onSuccess { @@ -188,6 +197,13 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { fun addToBookshelf(success: (() -> Unit)?) { execute { bookData.value?.let { book -> + if (book.order == 0) { + book.order = App.db.bookDao().maxOrder + 1 + } + App.db.bookDao().getBook(book.name, book.author)?.let { + book.durChapterPos = it.durChapterPos + book.durChapterTitle = it.durChapterTitle + } App.db.bookDao().insert(book) } chapterListData.value?.let { diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt index ed6bd4c74..3ce47ee99 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookActivity.kt @@ -5,8 +5,10 @@ import android.app.Activity import android.content.Intent import android.net.Uri import android.os.Bundle +import android.provider.DocumentsContract import android.view.Menu import android.view.MenuItem +import android.view.View import androidx.appcompat.widget.PopupMenu import androidx.documentfile.provider.DocumentFile import androidx.lifecycle.LiveData @@ -16,10 +18,12 @@ import io.legado.app.App import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.help.AppConfig -import io.legado.app.lib.theme.accentColor +import io.legado.app.help.permission.Permissions +import io.legado.app.help.permission.PermissionsCompat +import io.legado.app.ui.filechooser.FileChooserDialog +import io.legado.app.ui.filechooser.FilePicker import io.legado.app.ui.widget.SelectActionBar -import io.legado.app.utils.DocumentUtils -import io.legado.app.utils.getViewModel +import io.legado.app.utils.* import kotlinx.android.synthetic.main.activity_import_book.* import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.Dispatchers.Main @@ -27,9 +31,11 @@ import kotlinx.coroutines.launch import kotlinx.coroutines.withContext import org.jetbrains.anko.sdk27.listeners.onClick import java.io.File +import java.util.* class ImportBookActivity : VMBaseActivity(R.layout.activity_import_book), + FileChooserDialog.CallBack, PopupMenu.OnMenuItemClickListener, ImportBookAdapter.CallBack { private val requestCodeSelectFolder = 342 @@ -37,6 +43,8 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity private val subDocs = arrayListOf() private lateinit var adapter: ImportBookAdapter private var localUriLiveData: LiveData>? = null + private var sdPath = FileUtils.getSdCardPath() + private var path = sdPath override val viewModel: ImportBookViewModel get() = getViewModel(ImportBookViewModel::class.java) @@ -57,7 +65,6 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity recycler_view.layoutManager = LinearLayoutManager(this) adapter = ImportBookAdapter(this, this) recycler_view.adapter = adapter - rotate_loading.loadingColor = accentColor select_action_bar.setMainActionText(R.string.add_to_shelf) select_action_bar.inflateMenu(R.menu.import_book_sel) select_action_bar.setOnMenuItemClickListener(this) @@ -76,6 +83,7 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity } } }) + } private fun initEvent() { @@ -86,7 +94,7 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { - R.id.menu_select_folder -> selectImportFolder() + R.id.menu_select_folder -> FilePicker.selectFolder(this, requestCodeSelectFolder) } return super.onCompatOptionsItemSelected(item) } @@ -95,8 +103,8 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity when (item?.itemId) { R.id.menu_del_selection -> viewModel.deleteDoc(adapter.selectedUris) { - upPath() - } + upPath() + } } return false } @@ -111,11 +119,35 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity private fun upRootDoc() { AppConfig.importBookPath?.let { - val rootUri = Uri.parse(it) - rootDoc = DocumentFile.fromTreeUri(this, rootUri) - subDocs.clear() - upPath() + if (it.isContentPath()) { + val rootUri = Uri.parse(it) + rootDoc = DocumentFile.fromTreeUri(this, rootUri) + subDocs.clear() + } else { + rootDoc = null + subDocs.clear() + path = it + } + } ?: let { + // 没有权限就显示一个授权提示和按钮 + if (PermissionsCompat.check(this, *Permissions.Group.STORAGE)) { + hint_per.visibility = View.GONE + } else { + hint_per.visibility = View.VISIBLE + tv_request_per.onClick { + PermissionsCompat.Builder(this) + .addPermissions(*Permissions.Group.STORAGE) + .rationale(R.string.tip_perm_request_storage) + .onGranted { + hint_per.visibility = View.GONE + initData() + upRootDoc() + } + .request() + } + } } + upPath() } @SuppressLint("SetTextI18n") @@ -131,7 +163,6 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity tv_path.text = path adapter.selectedUris.clear() adapter.clearItems() - rotate_loading.show() launch(IO) { val docList = DocumentUtils.listFiles( this@ImportBookActivity, @@ -147,20 +178,47 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity } docList.sortWith(compareBy({ !it.isDir }, { it.name })) withContext(Main) { - rotate_loading.hide() adapter.setData(docList) } } + } ?: let { + tv_path.text = path.replace(sdPath, "SD") + val docList = arrayListOf() + File(path).listFiles()?.forEach { + if (it.isDirectory) { + if (!it.name.startsWith(".")) + docList.add( + DocItem( + it.name, + DocumentsContract.Document.MIME_TYPE_DIR, + it.length(), + Date(it.lastModified()), + Uri.parse(it.absolutePath) + ) + ) + } else if (it.name.endsWith(".txt", true)) { + docList.add( + DocItem( + it.name, + it.extension, + it.length(), + Date(it.lastModified()), + Uri.parse(it.absolutePath) + ) + ) + } + } + docList.sortWith(compareBy({ !it.isDir }, { it.name })) + adapter.setData(docList) } } - private fun selectImportFolder() { - try { - val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE) - intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) - startActivityForResult(intent, requestCodeSelectFolder) - } catch (e: Exception) { - e.printStackTrace() + override fun onFilePicked(requestCode: Int, currentPath: String) { + when (requestCode) { + requestCodeSelectFolder -> { + AppConfig.importBookPath = currentPath + upRootDoc() + } } } @@ -181,13 +239,27 @@ class ImportBookActivity : VMBaseActivity(R.layout.activity } @Synchronized - override fun nextDoc(doc: DocumentFile) { - subDocs.add(doc) + override fun nextDoc(uri: Uri) { + if (uri.toString().isContentPath()) { + subDocs.add(DocumentFile.fromSingleUri(this, uri)!!) + } else { + path = uri.toString() + } upPath() } @Synchronized private fun goBackDir(): Boolean { + if (rootDoc == null) { + if (path != sdPath) { + File(path).parent?.let { + path = it + upPath() + return true + } + } + return false + } return if (subDocs.isNotEmpty()) { subDocs.removeAt(subDocs.lastIndex) upPath() diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt index 153356754..3e7ab7097 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookAdapter.kt @@ -1,7 +1,7 @@ package io.legado.app.ui.book.local import android.content.Context -import androidx.documentfile.provider.DocumentFile +import android.net.Uri import io.legado.app.R import io.legado.app.base.adapter.ItemViewHolder import io.legado.app.base.adapter.SimpleRecyclerAdapter @@ -101,7 +101,7 @@ class ImportBookAdapter(context: Context, val callBack: CallBack) : holder.itemView.onClick { getItem(holder.layoutPosition)?.let { if (it.isDir) { - callBack.nextDoc(DocumentFile.fromSingleUri(context, it.uri)!!) + callBack.nextDoc(it.uri) } else if (!bookshelf.contains(it.uri.toString())) { if (!selectedUris.contains(it.uri.toString())) { selectedUris.add(it.uri.toString()) @@ -116,7 +116,7 @@ class ImportBookAdapter(context: Context, val callBack: CallBack) : } interface CallBack { - fun nextDoc(doc: DocumentFile) + fun nextDoc(uri: Uri) fun upCountView() } diff --git a/app/src/main/java/io/legado/app/ui/book/local/ImportBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/local/ImportBookViewModel.kt index 847a692bd..d3be59c5c 100644 --- a/app/src/main/java/io/legado/app/ui/book/local/ImportBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/local/ImportBookViewModel.kt @@ -11,10 +11,8 @@ class ImportBookViewModel(application: Application) : BaseViewModel(application) fun addToBookshelf(uriList: HashSet, finally: () -> Unit) { execute { - uriList.forEach { uriStr -> - DocumentFile.fromSingleUri(context, Uri.parse(uriStr))?.let { doc -> - LocalBook.importFile(doc) - } + uriList.forEach { + LocalBook.importFile(it) } }.onFinally { finally.invoke() diff --git a/app/src/main/java/io/legado/app/ui/book/read/Help.kt b/app/src/main/java/io/legado/app/ui/book/read/Help.kt index 549b7b987..8d87e89ed 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/Help.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/Help.kt @@ -3,6 +3,7 @@ package io.legado.app.ui.book.read import android.annotation.SuppressLint import android.app.Activity import android.content.Context +import android.content.pm.ActivityInfo import android.os.AsyncTask import android.os.Build import android.view.* @@ -62,6 +63,18 @@ object Help { } } + + @SuppressLint("SourceLockedOrientationActivity") + fun setOrientation(activity: Activity) = activity.apply { + when (AppConfig.requestedDirection) { + "0" -> requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED + "1" -> requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_PORTRAIT + "2" -> requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE + "3" -> requestedOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR + } + } + + /** * 返回NavigationBar是否存在 * 该方法需要在View完全被绘制出来之后调用,否则判断不了 @@ -99,7 +112,7 @@ object Help { * 适配刘海 */ fun upLayoutInDisplayCutoutMode(window: Window) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && AppConfig.readBodyToLh) { window.attributes = window.attributes.apply { layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 2ca4555a3..43d03c332 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -3,6 +3,7 @@ package io.legado.app.ui.book.read import android.annotation.SuppressLint import android.app.Activity import android.content.Intent +import android.content.res.Configuration import android.net.Uri import android.os.Bundle import android.os.Handler @@ -13,6 +14,7 @@ import androidx.core.view.isVisible import androidx.core.view.size import androidx.lifecycle.Observer import com.jaredrummler.android.colorpicker.ColorPickerDialogListener +import io.legado.app.BuildConfig import io.legado.app.R import io.legado.app.base.VMBaseActivity import io.legado.app.constant.EventBus @@ -23,6 +25,7 @@ import io.legado.app.data.entities.BookChapter import io.legado.app.help.BookHelp import io.legado.app.help.ReadBookConfig import io.legado.app.help.coroutine.Coroutine +import io.legado.app.help.storage.Backup import io.legado.app.help.storage.SyncBookProgress import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.noButton @@ -88,6 +91,12 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo override val pageFactory: TextPageFactory get() = page_view.pageFactory override val headerHeight: Int get() = page_view.curPage.headerHeight + override fun onCreate(savedInstanceState: Bundle?) { + ReadBook.msg = null + Help.setOrientation(this) + super.onCreate(savedInstanceState) + } + override fun onActivityCreated(savedInstanceState: Bundle?) { Help.upLayoutInDisplayCutoutMode(window) initView() @@ -106,6 +115,11 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo upSystemUiVisibility() } + override fun onConfigurationChanged(newConfig: Configuration) { + super.onConfigurationChanged(newConfig) + ReadBook.loadContent(resetPageOffset = false) + } + override fun onResume() { super.onResume() upSystemUiVisibility() @@ -120,6 +134,10 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo timeBatteryReceiver = null } upSystemUiVisibility() + if (!BuildConfig.DEBUG) { + SyncBookProgress.uploadBookProgress() + Backup.autoBack(this) + } } /** @@ -211,6 +229,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo R.id.menu_copy_text -> TextDialog.show(supportFragmentManager, ReadBook.curTextChapter?.getContent()) R.id.menu_update_toc -> ReadBook.book?.let { + ReadBook.upMsg(getString(R.string.toc_updateing)) viewModel.loadChapterList(it) } R.id.menu_enable_replace -> ReadBook.book?.let { @@ -338,7 +357,8 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo @SuppressLint("ClickableViewAccessibility") override fun onTouch(v: View, event: MotionEvent): Boolean { when (event.action) { - MotionEvent.ACTION_MOVE, MotionEvent.ACTION_UP -> { + MotionEvent.ACTION_DOWN -> textActionMenu?.dismiss() + MotionEvent.ACTION_MOVE -> { when (v.id) { R.id.cursor_left -> page_view.curPage.selectStartMove( event.rawX + cursor_left.width, @@ -350,6 +370,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo ) } } + MotionEvent.ACTION_UP -> showTextActionMenu() } return true } @@ -357,11 +378,12 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo /** * 更新文字选择开始位置 */ - override fun upSelectedStart(x: Float, y: Float) { + override fun upSelectedStart(x: Float, y: Float, top: Float) { cursor_left.x = x - cursor_left.width cursor_left.y = y cursor_left.visible(true) - showTextActionMenu() + text_menu_position.x = x + text_menu_position.y = top } /** @@ -371,7 +393,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo cursor_right.x = x cursor_right.y = y cursor_right.visible(true) - showTextActionMenu() } /** @@ -386,19 +407,23 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo /** * 显示文本操作菜单 */ - private fun showTextActionMenu() { + override fun showTextActionMenu() { textActionMenu ?: let { textActionMenu = TextActionMenu(this, this) } - val x = cursor_left.x.toInt() + cursor_left.width - val y = if (cursor_left.y - statusBarHeight > ReadBookConfig.textSize.dp * 1.5 + 20.dp) { - (page_view.height - cursor_left.y + ReadBookConfig.textSize.dp * 1.5).toInt() - } else { - (page_view.height - cursor_left.y - cursor_left.height - 40.dp).toInt() - } textActionMenu?.let { popup -> + popup.contentView.measure(View.MeasureSpec.UNSPECIFIED, View.MeasureSpec.UNSPECIFIED) + val popupHeight = popup.contentView.measuredHeight + val x = text_menu_position.x.toInt() + var y = text_menu_position.y.toInt() - popupHeight + if (y < statusBarHeight) { + y = (cursor_left.y + cursor_left.height).toInt() + } + if (cursor_right.y > y && cursor_right.y < y + popupHeight) { + y = (cursor_right.y + cursor_right.height).toInt() + } if (!popup.isShowing) { - popup.showAtLocation(cursor_left, Gravity.BOTTOM or Gravity.START, x, y) + popup.showAtLocation(text_menu_position, Gravity.TOP or Gravity.START, x, y) } else { popup.update(x, y, WRAP_CONTENT, WRAP_CONTENT) } @@ -462,9 +487,9 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo /** * 更新内容 */ - override fun upContent(relativePosition: Int) { + override fun upContent(relativePosition: Int, resetPageOffset: Boolean) { launch { - page_view.upContent(relativePosition) + page_view.upContent(relativePosition, resetPageOffset) } } @@ -560,7 +585,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo override fun onReplaceRuleSave() { Coroutine.async { BookHelp.upReplaceRules() - ReadBook.loadContent() + ReadBook.loadContent(resetPageOffset = false) } } @@ -589,9 +614,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo * 朗读按钮 */ override fun onClickReadAloud() { - if (!BaseReadAloudService.isRun) { - SystemUtils.ignoreBatteryOptimization(this) - } when { !BaseReadAloudService.isRun -> ReadBook.readAloud() BaseReadAloudService.pause -> ReadAloud.resume(this) @@ -663,7 +685,11 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo mHandler.removeCallbacks(keepScreenRunnable) textActionMenu?.dismiss() page_view.onDestroy() - SyncBookProgress.uploadBookProgress() + ReadBook.msg = null + if (!BuildConfig.DEBUG) { + SyncBookProgress.uploadBookProgress() + Backup.autoBack(this) + } } override fun observeLiveBus() { @@ -684,11 +710,12 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo observeEvent(EventBus.UP_CONFIG) { upSystemUiVisibility() page_view.upBg() + page_view.upTipStyle() page_view.upStyle() if (it) { - ReadBook.loadContent() + ReadBook.loadContent(resetPageOffset = false) } else { - page_view.upContent() + page_view.upContent(resetPageOffset = false) } } observeEvent(EventBus.ALOUD_STATE) { @@ -697,7 +724,7 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo val page = textChapter.page(ReadBook.durPageIndex) if (page != null) { page.removePageAloudSpan() - page_view.upContent() + page_view.upContent(resetPageOffset = false) } } } @@ -714,9 +741,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo } } } - observeEvent(EventBus.REPLACE) { - ReplaceEditDialog().show(supportFragmentManager, "replaceEditDialog") - } observeEvent(PreferKey.keepLight) { upScreenTimeOut() } diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index 2ebab7875..cc129056a 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -39,7 +39,9 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { private fun initBook(book: Book) { if (ReadBook.book?.bookUrl != book.bookUrl) { - ReadBook.resetData(book) + ReadBook.resetData(book) { name, author -> + autoChangeSource(name, author) + } isInitFinish = true ReadBook.chapterSize = App.db.bookChapterDao().getChapterCount(book.bookUrl) if (ReadBook.chapterSize == 0) { @@ -52,7 +54,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { if (ReadBook.durChapterIndex > ReadBook.chapterSize - 1) { ReadBook.durChapterIndex = ReadBook.chapterSize - 1 } - ReadBook.loadContent() + ReadBook.loadContent(resetPageOffset = true) } if (ReadBook.inBookshelf) { ReadBook.saveRead() @@ -60,7 +62,9 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } else { isInitFinish = true ReadBook.titleDate.postValue(book.name) - ReadBook.upWebBook(book.origin) + ReadBook.upWebBook(book) { name, author -> + autoChangeSource(name, author) + } ReadBook.chapterSize = App.db.bookChapterDao().getChapterCount(book.bookUrl) if (ReadBook.chapterSize == 0) { if (book.tocUrl.isEmpty()) { @@ -70,7 +74,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } } else { if (ReadBook.curTextChapter != null) { - ReadBook.callBack?.upContent() + ReadBook.callBack?.upContent(resetPageOffset = false) } } } @@ -98,38 +102,45 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { ) { execute { if (book.isLocalBook()) { - AnalyzeTxtFile.analyze(context, book).let { + AnalyzeTxtFile().analyze(context, book).let { App.db.bookChapterDao().delByBook(book.bookUrl) App.db.bookChapterDao().insert(*it.toTypedArray()) App.db.bookDao().update(book) ReadBook.chapterSize = it.size - ReadBook.loadContent() + ReadBook.upMsg(null) + ReadBook.loadContent(resetPageOffset = true) } } else { ReadBook.webBook?.getChapterList(book, this) ?.onSuccess(IO) { cList -> - if (!cList.isNullOrEmpty()) { + if (cList.isNotEmpty()) { if (changeDruChapterIndex == null) { App.db.bookChapterDao().insert(*cList.toTypedArray()) App.db.bookDao().update(book) ReadBook.chapterSize = cList.size - ReadBook.loadContent() + ReadBook.upMsg(null) + ReadBook.loadContent(resetPageOffset = true) } else { changeDruChapterIndex(cList) } } else { - toast(R.string.error_load_toc) + ReadBook.upMsg(context.getString(R.string.error_load_toc)) } }?.onError { - toast(R.string.error_load_toc) - } ?: autoChangeSource() + ReadBook.upMsg(context.getString(R.string.error_load_toc)) + } } + }.onError { + ReadBook.upMsg("LoadTocError:${it.localizedMessage}") } } fun changeTo(book1: Book) { execute { + ReadBook.upMsg(null) ReadBook.book?.let { + book1.group = it.group + book1.order = it.order App.db.bookDao().delete(it) } ReadBook.prevTextChapter = null @@ -151,8 +162,26 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { } } - private fun autoChangeSource() { - + private fun autoChangeSource(name: String, author: String) { + execute { + App.db.bookSourceDao().allTextEnabled.forEach { source -> + try { + val searchBooks = WebBook(source).searchBookSuspend(this, name) + searchBooks.getOrNull(0)?.let { + if (it.name == name && (it.author == author || author == "")) { + changeTo(it.toBook()) + return@forEach + } + } + } catch (e: Exception) { + //nothing + } + } + }.onStart { + ReadBook.upMsg(context.getString(R.string.source_auto_changing)) + }.onFinally { + ReadBook.upMsg(null) + } } private fun upChangeDurChapterIndex(book: Book, chapters: List) { @@ -167,7 +196,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { App.db.bookDao().update(book) App.db.bookChapterDao().insert(*chapters.toTypedArray()) ReadBook.chapterSize = chapters.size - ReadBook.loadContent() + ReadBook.loadContent(resetPageOffset = true) } } @@ -181,7 +210,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { ReadBook.durPageIndex = pageIndex } ReadBook.saveRead() - ReadBook.loadContent() + ReadBook.loadContent(resetPageOffset = true) } fun removeFromBookshelf(success: (() -> Unit)?) { @@ -208,9 +237,9 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { execute { App.db.bookChapterDao().getChapter(book.bookUrl, ReadBook.durChapterIndex) ?.let { chapter -> - BookHelp.delContent(book, chapter) - ReadBook.loadContent(ReadBook.durChapterIndex) - } + BookHelp.delContent(book, chapter) + ReadBook.loadContent(ReadBook.durChapterIndex, resetPageOffset = false) + } } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt b/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt index 7e90c7ad1..5c8d1d214 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/TextActionMenu.kt @@ -7,6 +7,7 @@ import android.content.Intent import android.content.pm.ResolveInfo import android.net.Uri import android.os.Build +import android.speech.tts.TextToSpeech import android.view.LayoutInflater import android.view.Menu import android.view.ViewGroup @@ -15,13 +16,12 @@ import androidx.annotation.RequiresApi import androidx.appcompat.view.SupportMenuInflater import androidx.appcompat.view.menu.MenuBuilder import androidx.appcompat.view.menu.MenuItemImpl -import androidx.appcompat.widget.PopupMenu -import androidx.core.view.size -import androidx.recyclerview.widget.LinearLayoutManager -import androidx.recyclerview.widget.RecyclerView +import androidx.core.view.isVisible import io.legado.app.R import io.legado.app.base.adapter.ItemViewHolder import io.legado.app.base.adapter.SimpleRecyclerAdapter +import io.legado.app.service.BaseReadAloudService +import io.legado.app.utils.gone import io.legado.app.utils.isAbsUrl import io.legado.app.utils.sendToClip import io.legado.app.utils.visible @@ -30,10 +30,16 @@ import kotlinx.android.synthetic.main.popup_action_menu.view.* import org.jetbrains.anko.sdk27.listeners.onClick import org.jetbrains.anko.share import org.jetbrains.anko.toast +import java.util.* @SuppressLint("RestrictedApi") class TextActionMenu(private val context: Context, private val callBack: CallBack) : - PopupWindow(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT) { + PopupWindow(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT), + TextToSpeech.OnInitListener { + + private val adapter = Adapter(context) + private val menu = MenuBuilder(context) + private val moreMenu = MenuBuilder(context) init { @SuppressLint("InflateParams") @@ -44,33 +50,38 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac isFocusable = false initRecyclerView() + setOnDismissListener { + contentView.apply { + iv_menu_more.setImageResource(R.drawable.ic_more_vert) + recycler_view_more.gone() + adapter.setItems(menu.visibleItems) + recycler_view.visible() + } + } } private fun initRecyclerView() = with(contentView) { - val adapter = Adapter(context) - recycler_view.layoutManager = LinearLayoutManager(context, RecyclerView.HORIZONTAL, false) recycler_view.adapter = adapter - val menu = MenuBuilder(context) + recycler_view_more.adapter = adapter SupportMenuInflater(context).inflate(R.menu.content_select_action, menu) adapter.setItems(menu.visibleItems) if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - val popupMenu = PopupMenu(context, iv_menu_more) - onInitializeMenu(popupMenu.menu) - if (popupMenu.menu.size > 0) { - iv_menu_more.visible() - popupMenu.setOnMenuItemClickListener { item -> - item.intent?.let { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { - it.putExtra(Intent.EXTRA_PROCESS_TEXT, callBack.selectedText) - context.startActivity(it) - } - } - this@TextActionMenu.dismiss() - true - } - } - iv_menu_more.onClick { - popupMenu.show() + onInitializeMenu(moreMenu) + } + if (moreMenu.size() > 0) { + iv_menu_more.visible() + } + iv_menu_more.onClick { + if (recycler_view.isVisible) { + iv_menu_more.setImageResource(R.drawable.ic_arrow_back) + adapter.setItems(moreMenu.visibleItems) + recycler_view.gone() + recycler_view_more.visible() + } else { + iv_menu_more.setImageResource(R.drawable.ic_more_vert) + recycler_view_more.gone() + adapter.setItems(menu.visibleItems) + recycler_view.visible() } } } @@ -104,6 +115,13 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac when (item.itemId) { R.id.menu_copy -> context.sendToClip(callBack.selectedText) R.id.menu_share_str -> context.share(callBack.selectedText) + R.id.menu_aloud -> { + if (BaseReadAloudService.isRun) { + context.toast(R.string.alouding_disable) + return + } + readAloud(callBack.selectedText) + } R.id.menu_browser -> { try { val intent = if (callBack.selectedText.isAbsUrl()) { @@ -121,7 +139,39 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac context.toast(e.localizedMessage ?: "ERROR") } } + else -> item.intent?.let { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { + it.putExtra(Intent.EXTRA_PROCESS_TEXT, callBack.selectedText) + context.startActivity(it) + } + } + } + } + + private var textToSpeech: TextToSpeech? = null + private var ttsInitFinish = false + private var lastText: String = "" + + @SuppressLint("SetJavaScriptEnabled") + private fun readAloud(text: String) { + lastText = text + if (textToSpeech == null) { + textToSpeech = TextToSpeech(context, this) + return } + if (!ttsInitFinish) return + if (text == "") return + if (textToSpeech?.isSpeaking == true) + textToSpeech?.stop() + textToSpeech?.speak(text, TextToSpeech.QUEUE_ADD, null, "select_text") + lastText = "" + } + + @Synchronized + override fun onInit(status: Int) { + textToSpeech?.language = Locale.CHINA + ttsInitFinish = true + readAloud(lastText) } @RequiresApi(Build.VERSION_CODES.M) @@ -151,15 +201,16 @@ class TextActionMenu(private val context: Context, private val callBack: CallBac */ @RequiresApi(Build.VERSION_CODES.M) private fun onInitializeMenu(menu: Menu) { - // Start with a menu Item order value that is high enough - // so that your "PROCESS_TEXT" menu items appear after the - // standard selection menu items like Cut, Copy, Paste. - var menuItemOrder = 100 - for (resolveInfo in getSupportedActivities()) { - menu.add( - Menu.NONE, Menu.NONE, - menuItemOrder++, resolveInfo.loadLabel(context.packageManager) - ).intent = createProcessTextIntentForResolveInfo(resolveInfo) + try { + var menuItemOrder = 100 + for (resolveInfo in getSupportedActivities()) { + menu.add( + Menu.NONE, Menu.NONE, + menuItemOrder++, resolveInfo.loadLabel(context.packageManager) + ).intent = createProcessTextIntentForResolveInfo(resolveInfo) + } + } catch (e: Exception) { + context.toast("获取文字操作菜单出错:${e.localizedMessage}") } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt index 6f472f270..8672d04bb 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/MoreConfigDialog.kt @@ -94,6 +94,7 @@ class MoreConfigDialog : DialogFragment() { key: String? ) { when (key) { + PreferKey.readBodyToLh -> activity?.recreate() PreferKey.hideStatusBar -> { ReadBookConfig.hideStatusBar = getPrefBoolean(PreferKey.hideStatusBar) postEvent(EventBus.UP_CONFIG, true) @@ -104,6 +105,11 @@ class MoreConfigDialog : DialogFragment() { } PreferKey.keepLight -> postEvent(key, true) PreferKey.textSelectAble -> postEvent(key, getPrefBoolean(key)) + getString(R.string.pk_requested_direction) -> { + activity?.let { + Help.setOrientation(it) + } + } } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt index ed1c296de..4534898e4 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/PaddingConfigDialog.kt @@ -11,10 +11,7 @@ import io.legado.app.R import io.legado.app.constant.EventBus import io.legado.app.help.ReadBookConfig import io.legado.app.ui.book.read.Help -import io.legado.app.utils.dp -import io.legado.app.utils.gone import io.legado.app.utils.postEvent -import io.legado.app.utils.visible import kotlinx.android.synthetic.main.dialog_read_padding.* class PaddingConfigDialog : DialogFragment() { @@ -54,13 +51,6 @@ class PaddingConfigDialog : DialogFragment() { } private fun initData() = ReadBookConfig.apply { - if (hideStatusBar) { - ll_header_padding.visible() - tv_body_padding.setPadding(0, 10.dp, 0, 10.dp) - } else { - ll_header_padding.gone() - tv_body_padding.setPadding(0, 0.dp, 0, 10.dp) - } //正文 dsb_padding_top.progress = paddingTop dsb_padding_bottom.progress = paddingBottom diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt index 5540d0386..9c118c068 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ReadAloudDialog.kt @@ -21,7 +21,6 @@ import io.legado.app.utils.observeEvent import io.legado.app.utils.putPrefBoolean import kotlinx.android.synthetic.main.dialog_read_aloud.* import org.jetbrains.anko.sdk27.listeners.onClick -import org.jetbrains.anko.sdk27.listeners.onLongClick class ReadAloudDialog : BaseDialogFragment() { var callBack: CallBack? = null @@ -34,7 +33,7 @@ class ReadAloudDialog : BaseDialogFragment() { it.windowManager?.defaultDisplay?.getMetrics(dm) } dialog?.window?.let { - it.setBackgroundDrawableResource(R.color.transparent) + it.setBackgroundDrawableResource(R.color.background) it.decorView.setPadding(0, 0, 0, 0) val attr = it.attributes attr.dimAmount = 0.0f @@ -54,10 +53,10 @@ class ReadAloudDialog : BaseDialogFragment() { } override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { - ll_bottom_bg.setBackgroundColor(requireContext().bottomBackground) + root_view.setBackgroundColor(requireContext().bottomBackground) initOnChange() initData() - initOnClick() + initEvent() } private fun initData() { @@ -101,22 +100,19 @@ class ReadAloudDialog : BaseDialogFragment() { }) } - private fun initOnClick() { - iv_menu.onClick { callBack?.showMenuBar(); dismiss() } - iv_other_config.onClick { + private fun initEvent() { + ll_main_menu.onClick { callBack?.showMenuBar(); dismiss() } + ll_setting.onClick { ReadAloudConfigDialog().show(childFragmentManager, "readAloudConfigDialog") } + tv_pre.onClick { ReadBook.moveToPrevChapter(upContent = true, toLast = false) } + tv_next.onClick { ReadBook.moveToNextChapter(true) } iv_stop.onClick { ReadAloud.stop(requireContext()); dismiss() } iv_play_pause.onClick { callBack?.onClickReadAloud() } iv_play_prev.onClick { ReadAloud.prevParagraph(requireContext()) } - iv_play_prev.onLongClick { - ReadBook.moveToPrevChapter(upContent = true, toLast = false) - true - } iv_play_next.onClick { ReadAloud.nextParagraph(requireContext()) } - iv_play_next.onLongClick { ReadBook.moveToNextChapter(true); true } - fabToc.onClick { callBack?.openChapterList() } - fabBack.onClick { callBack?.finish() } + ll_catalog.onClick { callBack?.openChapterList() } + ll_to_backstage.onClick { callBack?.finish() } } private fun upPlayState() { diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt index f29c4ddba..19cad6738 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/ReadStyleDialog.kt @@ -104,10 +104,8 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { showTitleConfig() } tv_text_bold.onClick { - ReadBookConfig.apply { - textBold = !textBold - tv_text_bold.isSelected = textBold - } + ReadBookConfig.textBold = !ReadBookConfig.textBold + tv_text_bold.isSelected = ReadBookConfig.textBold postEvent(EventBus.UP_CONFIG, true) } tv_text_font.onClick { @@ -126,6 +124,9 @@ class ReadStyleDialog : DialogFragment(), FontSelectDialog.CallBack { dismiss() callBack?.showPaddingConfig() } + tv_tip.onClick { + TipConfigDialog().show(childFragmentManager, "tipConfigDialog") + } rg_page_anim.onCheckedChange { _, checkedId -> ReadBookConfig.pageAnim = rg_page_anim.getIndexById(checkedId) callBack?.page_view?.upPageAnim() diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt new file mode 100644 index 000000000..cb9cfa594 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/book/read/config/TipConfigDialog.kt @@ -0,0 +1,117 @@ +package io.legado.app.ui.book.read.config + +import android.os.Bundle +import android.util.DisplayMetrics +import android.view.LayoutInflater +import android.view.View +import android.view.ViewGroup +import io.legado.app.R +import io.legado.app.base.BaseDialogFragment +import io.legado.app.constant.EventBus +import io.legado.app.help.ReadTipConfig +import io.legado.app.lib.dialogs.selector +import io.legado.app.ui.book.read.Help +import io.legado.app.utils.postEvent +import kotlinx.android.synthetic.main.dialog_tip_config.* +import org.jetbrains.anko.sdk27.listeners.onCheckedChange +import org.jetbrains.anko.sdk27.listeners.onClick + +class TipConfigDialog : BaseDialogFragment() { + + override fun onStart() { + super.onStart() + val dm = DisplayMetrics() + activity?.let { + Help.upSystemUiVisibility(it) + it.windowManager?.defaultDisplay?.getMetrics(dm) + } + dialog?.window?.let { + val attr = it.attributes + attr.dimAmount = 0.0f + it.attributes = attr + it.setLayout((dm.widthPixels * 0.9).toInt(), ViewGroup.LayoutParams.WRAP_CONTENT) + } + } + + override fun onCreateView( + inflater: LayoutInflater, + container: ViewGroup?, + savedInstanceState: Bundle? + ): View? { + return inflater.inflate(R.layout.dialog_tip_config, container) + } + + override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { + initView() + initEvent() + } + + private fun initView() { + tv_header_left.text = ReadTipConfig.tipHeaderLeftStr + tv_header_middle.text = ReadTipConfig.tipHeaderMiddleStr + tv_header_right.text = ReadTipConfig.tipHeaderRightStr + tv_footer_left.text = ReadTipConfig.tipFooterLeftStr + tv_footer_middle.text = ReadTipConfig.tipFooterMiddleStr + tv_footer_right.text = ReadTipConfig.tipFooterRightStr + sw_hide_header.isChecked = ReadTipConfig.hideHeader + sw_hide_footer.isChecked = ReadTipConfig.hideFooter + } + + private fun initEvent() { + tv_header_left.onClick { + selector(items = ReadTipConfig.tipArray.toList()) { _, i -> + ReadTipConfig.tipHeaderLeft = i + tv_header_left.text = ReadTipConfig.tipArray[i] + postEvent(EventBus.UP_CONFIG, true) + } + } + tv_header_middle.onClick { + selector(items = ReadTipConfig.tipArray.toList()) { _, i -> + ReadTipConfig.tipHeaderMiddle = i + tv_header_middle.text = ReadTipConfig.tipArray[i] + postEvent(EventBus.UP_CONFIG, true) + } + } + tv_header_right.onClick { + selector(items = ReadTipConfig.tipArray.toList()) { _, i -> + ReadTipConfig.tipHeaderRight = i + tv_header_right.text = ReadTipConfig.tipArray[i] + postEvent(EventBus.UP_CONFIG, true) + } + } + tv_footer_left.onClick { + selector(items = ReadTipConfig.tipArray.toList()) { _, i -> + ReadTipConfig.tipFooterLeft = i + tv_footer_left.text = ReadTipConfig.tipArray[i] + postEvent(EventBus.UP_CONFIG, true) + } + } + tv_footer_middle.onClick { + selector(items = ReadTipConfig.tipArray.toList()) { _, i -> + ReadTipConfig.tipFooterMiddle = i + tv_footer_middle.text = ReadTipConfig.tipArray[i] + postEvent(EventBus.UP_CONFIG, true) + } + } + tv_footer_right.onClick { + selector(items = ReadTipConfig.tipArray.toList()) { _, i -> + ReadTipConfig.tipFooterRight = i + tv_footer_right.text = ReadTipConfig.tipArray[i] + postEvent(EventBus.UP_CONFIG, true) + } + } + sw_hide_header.onCheckedChange { buttonView, isChecked -> + if (buttonView?.isPressed == true) { + ReadTipConfig.hideHeader = isChecked + postEvent(EventBus.UP_CONFIG, true) + } + } + sw_hide_footer.onCheckedChange { buttonView, isChecked -> + if (buttonView?.isPressed == true) { + ReadTipConfig.hideFooter = isChecked + postEvent(EventBus.UP_CONFIG, true) + } + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt index aa816f93f..d4a6711bc 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/config/TocRegexDialog.kt @@ -252,8 +252,8 @@ class TocRegexDialog : BaseDialogFragment(), Toolbar.OnMenuItemClickListener { return super.onMove(srcPosition, targetPosition) } - override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { - super.clearView(recyclerView, viewHolder) + override fun onClearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { + super.onClearView(recyclerView, viewHolder) if (isMoved) { for ((index, item) in getItems().withIndex()) { item.serialNumber = index + 1 diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt index b7cf7182e..ea0a1bd37 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ChapterProvider.kt @@ -1,6 +1,7 @@ package io.legado.app.ui.book.read.page import android.graphics.Typeface +import android.os.Build import android.text.Layout import android.text.StaticLayout import android.text.TextPaint @@ -31,8 +32,8 @@ object ChapterProvider { private var titleTopSpacing = 0 private var titleBottomSpacing = 0 var typeface: Typeface = Typeface.SANS_SERIF - var titlePaint = TextPaint() - var contentPaint = TextPaint() + lateinit var titlePaint: TextPaint + lateinit var contentPaint: TextPaint init { upStyle() @@ -75,7 +76,7 @@ object ChapterProvider { item.chapterIndex = bookChapter.index item.chapterSize = chapterSize item.title = bookChapter.title - item.upLinesPosition(visibleHeight) + item.upLinesPosition() } return TextChapter( bookChapter.index, @@ -262,30 +263,36 @@ object ChapterProvider { Typeface.SANS_SERIF } //标题 - titlePaint.isAntiAlias = true + titlePaint = TextPaint() titlePaint.color = ReadBookConfig.durConfig.textColor() titlePaint.letterSpacing = ReadBookConfig.letterSpacing - titlePaint.typeface = Typeface.create(typeface, Typeface.BOLD) + titlePaint.typeface = if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.P) { + Typeface.create(typeface, if (ReadBookConfig.textBold) 900 else 700, false) + } else { + Typeface.create(typeface, Typeface.BOLD) + } titlePaint.textSize = with(ReadBookConfig) { textSize + titleSize }.sp.toFloat() + titlePaint.isAntiAlias = true //正文 - contentPaint.isAntiAlias = true + contentPaint = TextPaint() contentPaint.color = ReadBookConfig.durConfig.textColor() contentPaint.letterSpacing = ReadBookConfig.letterSpacing val style = if (ReadBookConfig.textBold) Typeface.BOLD else Typeface.NORMAL contentPaint.typeface = Typeface.create(typeface, style) contentPaint.textSize = ReadBookConfig.textSize.sp.toFloat() + contentPaint.isAntiAlias = true //间距 lineSpacingExtra = ReadBookConfig.lineSpacingExtra paragraphSpacing = ReadBookConfig.paragraphSpacing titleTopSpacing = ReadBookConfig.titleTopSpacing.dp titleBottomSpacing = ReadBookConfig.titleBottomSpacing.dp - upSize() + upViewSize() } /** * 更新View尺寸 */ - fun upSize() { + fun upViewSize() { paddingLeft = ReadBookConfig.paddingLeft.dp paddingTop = ReadBookConfig.paddingTop.dp visibleWidth = viewWidth - paddingLeft - ReadBookConfig.paddingRight.dp diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt index 44baa68f6..62f240303 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentTextView.kt @@ -31,6 +31,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at private val selectStart = arrayOf(0, 0, 0) private val selectEnd = arrayOf(0, 0, 0) private var textPage: TextPage = TextPage() + //滚动参数 private val pageFactory: TextPageFactory get() = callBack.pageFactory private val maxScrollOffset = 100f @@ -60,7 +61,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at super.onSizeChanged(w, h, oldw, oldh) ChapterProvider.viewWidth = w ChapterProvider.viewHeight = h - ChapterProvider.upSize() + ChapterProvider.upViewSize() upVisibleRect() textPage.format() } @@ -210,7 +211,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at selectEnd[0] = 0 selectEnd[1] = lineIndex selectEnd[2] = charIndex - upSelectedStart(textChar.start, textLine.lineBottom + relativeOffset) + upSelectedStart( + textChar.start, + textLine.lineBottom + relativeOffset, + textLine.lineTop + relativeOffset + ) upSelectedEnd(textChar.end, textLine.lineBottom + relativeOffset) select(0, lineIndex, charIndex) return @@ -236,7 +241,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at selectEnd[0] = 1 selectEnd[1] = lineIndex selectEnd[2] = charIndex - upSelectedStart(textChar.start, textLine.lineBottom + relativeOffset) + upSelectedStart( + textChar.start, + textLine.lineBottom + relativeOffset, + textLine.lineTop + relativeOffset + ) upSelectedEnd(textChar.end, textLine.lineBottom + relativeOffset) select(1, lineIndex, charIndex) return @@ -259,7 +268,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at selectEnd[0] = 2 selectEnd[1] = lineIndex selectEnd[2] = charIndex - upSelectedStart(textChar.start, textLine.lineBottom + relativeOffset) + upSelectedStart( + textChar.start, + textLine.lineBottom + relativeOffset, + textLine.lineTop + relativeOffset + ) upSelectedEnd(textChar.end, textLine.lineBottom + relativeOffset) select(2, lineIndex, charIndex) return @@ -287,7 +300,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at selectStart[0] = 0 selectStart[1] = lineIndex selectStart[2] = charIndex - upSelectedStart(textChar.start, textLine.lineBottom + relativeOffset) + upSelectedStart( + textChar.start, + textLine.lineBottom + relativeOffset, + textLine.lineTop + relativeOffset + ) upSelectChars() } return @@ -311,7 +328,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at selectStart[0] = 1 selectStart[1] = lineIndex selectStart[2] = charIndex - upSelectedStart(textChar.start, textLine.lineBottom + relativeOffset) + upSelectedStart( + textChar.start, + textLine.lineBottom + relativeOffset, + textLine.lineTop + relativeOffset + ) upSelectChars() } return @@ -333,7 +354,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at selectStart[0] = 2 selectStart[1] = lineIndex selectStart[2] = charIndex - upSelectedStart(textChar.start, textLine.lineBottom + relativeOffset) + upSelectedStart( + textChar.start, + textLine.lineBottom + relativeOffset, + textLine.lineTop + relativeOffset + ) upSelectChars() } return @@ -427,7 +452,11 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at selectStart[2] = charIndex val textLine = relativePage(relativePage).textLines[lineIndex] val textChar = textLine.textChars[charIndex] - upSelectedStart(textChar.start, textLine.lineBottom + relativeOffset(relativePage)) + upSelectedStart( + textChar.start, + textLine.lineBottom + relativeOffset(relativePage), + textLine.lineTop + ) upSelectChars() } @@ -475,12 +504,12 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at invalidate() } - private fun upSelectedStart(x: Float, y: Float) { - callBack.upSelectedStart(x, y + callBack.headerHeight) + private fun upSelectedStart(x: Float, y: Float, top: Float) = callBack.apply { + upSelectedStart(x, y + headerHeight, top + headerHeight) } - private fun upSelectedEnd(x: Float, y: Float) { - callBack.upSelectedEnd(x, y + callBack.headerHeight) + private fun upSelectedEnd(x: Float, y: Float) = callBack.apply { + upSelectedEnd(x, y + headerHeight) } fun cancelSelect() { @@ -580,7 +609,7 @@ class ContentTextView(context: Context, attrs: AttributeSet?) : View(context, at } interface CallBack { - fun upSelectedStart(x: Float, y: Float) + fun upSelectedStart(x: Float, y: Float, top: Float) fun upSelectedEnd(x: Float, y: Float) fun onCancelSelect() val headerHeight: Int diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt index 4e820008e..67e40bf0e 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/ContentView.kt @@ -5,13 +5,20 @@ import android.content.Context import android.graphics.drawable.Drawable import android.view.MotionEvent import android.widget.FrameLayout -import com.github.houbb.opencc4j.core.impl.ZhConvertBootstrap +import androidx.core.view.isGone +import androidx.core.view.isInvisible +import com.hankcs.hanlp.HanLP import io.legado.app.R import io.legado.app.constant.AppConst.timeFormat import io.legado.app.help.AppConfig import io.legado.app.help.ReadBookConfig +import io.legado.app.help.ReadTipConfig import io.legado.app.ui.book.read.page.entities.TextPage -import io.legado.app.utils.* +import io.legado.app.ui.widget.BatteryView +import io.legado.app.utils.dp +import io.legado.app.utils.getCompatColor +import io.legado.app.utils.statusBarHeight +import io.legado.app.utils.visible import kotlinx.android.synthetic.main.view_book_page.view.* import java.util.* @@ -19,14 +26,22 @@ import java.util.* class ContentView(context: Context) : FrameLayout(context) { private var battery = 100 + private var tvTitle: BatteryView? = null + private var tvTime: BatteryView? = null + private var tvBattery: BatteryView? = null + private var tvPage: BatteryView? = null + private var tvTotalProgress: BatteryView? = null + private var tvPageAndTotal: BatteryView? = null + + val headerHeight: Int + get() = if (ReadBookConfig.hideStatusBar) ll_header.height else context.statusBarHeight init { //设置背景防止切换背景时文字重叠 setBackgroundColor(context.getCompatColor(R.color.background)) inflate(context, R.layout.view_book_page, this) - + upTipStyle() upStyle() - upTime() content_text_view.upView = { setProgress(it) } @@ -34,27 +49,27 @@ class ContentView(context: Context) : FrameLayout(context) { fun upStyle() { ReadBookConfig.apply { - tv_top_left.typeface = ChapterProvider.typeface - tv_top_right.typeface = ChapterProvider.typeface - tv_bottom_left.typeface = ChapterProvider.typeface - tv_bottom_right.typeface = ChapterProvider.typeface + tv_header_left.typeface = ChapterProvider.typeface + tv_header_middle.typeface = ChapterProvider.typeface + tv_header_right.typeface = ChapterProvider.typeface + tv_footer_left.typeface = ChapterProvider.typeface + tv_footer_middle.typeface = ChapterProvider.typeface + tv_footer_right.typeface = ChapterProvider.typeface + tv_header_left.setColor(durConfig.textColor()) + tv_header_middle.setColor(durConfig.textColor()) + tv_header_right.setColor(durConfig.textColor()) + tv_footer_left.setColor(durConfig.textColor()) + tv_footer_middle.setColor(durConfig.textColor()) + tv_footer_right.setColor(durConfig.textColor()) //显示状态栏时隐藏header - if (hideStatusBar) { - ll_header.layoutParams = ll_header.layoutParams.apply { - height = context.statusBarHeight + headerPaddingTop.dp + headerPaddingBottom.dp - } - ll_header.setPadding( - headerPaddingLeft.dp, - headerPaddingTop.dp, - headerPaddingRight.dp, - headerPaddingBottom.dp - ) - ll_header.visible() - page_panel.setPadding(0, 0, 0, 0) - } else { - ll_header.gone() - page_panel.setPadding(0, context.statusBarHeight, 0, 0) - } + vw_status_bar.setPadding(0, context.statusBarHeight, 0, 0) + vw_status_bar.isGone = hideStatusBar + ll_header.setPadding( + headerPaddingLeft.dp, + headerPaddingTop.dp, + headerPaddingRight.dp, + headerPaddingBottom.dp + ) ll_footer.setPadding( footerPaddingLeft.dp, footerPaddingTop.dp, @@ -64,51 +79,125 @@ class ContentView(context: Context) : FrameLayout(context) { vw_top_divider.visible(showHeaderLine) vw_bottom_divider.visible(showFooterLine) content_text_view.upVisibleRect() - durConfig.textColor().let { - tv_top_left.setTextColor(it) - tv_top_right.setTextColor(it) - tv_bottom_left.setTextColor(it) - tv_bottom_right.setTextColor(it) - battery_view.setColor(it) - } - if (hideStatusBar) { - tv_bottom_left.text = timeFormat.format(Date(System.currentTimeMillis())) - battery_view.visible() - battery_view.setBattery(battery) - } else { - battery_view.gone() - } } + upTime() + upBattery(battery) } - val headerHeight: Int - get() { - return if (ReadBookConfig.hideStatusBar) { - ll_header.height - } else { - context.statusBarHeight - } + fun upTipStyle() { + ReadTipConfig.apply { + val tipHeaderLeftNone = tipHeaderLeft == none + val tipHeaderRightNone = tipHeaderRight == none + val tipHeaderMiddleNone = tipHeaderMiddle == none + val tipFooterLeftNone = tipFooterLeft == none + val tipFooterRightNone = tipFooterRight == none + val tipFooterMiddleNone = tipFooterMiddle == none + tv_header_left.isInvisible = tipHeaderLeftNone + tv_header_right.isGone = tipHeaderRightNone + tv_header_middle.isGone = tipHeaderMiddleNone + tv_footer_left.isInvisible = tipFooterLeftNone + tv_footer_right.isGone = tipFooterRightNone + tv_footer_middle.isGone = tipFooterMiddleNone + ll_header.isGone = hideHeader + ll_footer.isGone = hideFooter + } + tvTitle = when (ReadTipConfig.chapterTitle) { + ReadTipConfig.tipHeaderLeft -> tv_header_left + ReadTipConfig.tipHeaderMiddle -> tv_header_middle + ReadTipConfig.tipHeaderRight -> tv_header_right + ReadTipConfig.tipFooterLeft -> tv_footer_left + ReadTipConfig.tipFooterMiddle -> tv_footer_middle + ReadTipConfig.tipFooterRight -> tv_footer_right + else -> null + } + tvTitle?.apply { + isBattery = false + textSize = 12f + } + tvTime = when (ReadTipConfig.time) { + ReadTipConfig.tipHeaderLeft -> tv_header_left + ReadTipConfig.tipHeaderMiddle -> tv_header_middle + ReadTipConfig.tipHeaderRight -> tv_header_right + ReadTipConfig.tipFooterLeft -> tv_footer_left + ReadTipConfig.tipFooterMiddle -> tv_footer_middle + ReadTipConfig.tipFooterRight -> tv_footer_right + else -> null + } + tvTime?.apply { + isBattery = false + textSize = 12f + } + tvBattery = when (ReadTipConfig.battery) { + ReadTipConfig.tipHeaderLeft -> tv_header_left + ReadTipConfig.tipHeaderMiddle -> tv_header_middle + ReadTipConfig.tipHeaderRight -> tv_header_right + ReadTipConfig.tipFooterLeft -> tv_footer_left + ReadTipConfig.tipFooterMiddle -> tv_footer_middle + ReadTipConfig.tipFooterRight -> tv_footer_right + else -> null } + tvBattery?.apply { + isBattery = true + textSize = 10f + } + tvPage = when (ReadTipConfig.page) { + ReadTipConfig.tipHeaderLeft -> tv_header_left + ReadTipConfig.tipHeaderMiddle -> tv_header_middle + ReadTipConfig.tipHeaderRight -> tv_header_right + ReadTipConfig.tipFooterLeft -> tv_footer_left + ReadTipConfig.tipFooterMiddle -> tv_footer_middle + ReadTipConfig.tipFooterRight -> tv_footer_right + else -> null + } + tvPage?.apply { + isBattery = false + textSize = 12f + } + tvTotalProgress = when (ReadTipConfig.totalProgress) { + ReadTipConfig.tipHeaderLeft -> tv_header_left + ReadTipConfig.tipHeaderMiddle -> tv_header_middle + ReadTipConfig.tipHeaderRight -> tv_header_right + ReadTipConfig.tipFooterLeft -> tv_footer_left + ReadTipConfig.tipFooterMiddle -> tv_footer_middle + ReadTipConfig.tipFooterRight -> tv_footer_right + else -> null + } + tvTotalProgress?.apply { + isBattery = false + textSize = 12f + } + tvPageAndTotal = when (ReadTipConfig.pageAndTotal) { + ReadTipConfig.tipHeaderLeft -> tv_header_left + ReadTipConfig.tipHeaderMiddle -> tv_header_middle + ReadTipConfig.tipHeaderRight -> tv_header_right + ReadTipConfig.tipFooterLeft -> tv_footer_left + ReadTipConfig.tipFooterMiddle -> tv_footer_middle + ReadTipConfig.tipFooterRight -> tv_footer_right + else -> null + } + tvPageAndTotal?.apply { + isBattery = false + textSize = 12f + } + } fun setBg(bg: Drawable?) { page_panel.background = bg } fun upTime() { - if (ReadBookConfig.hideStatusBar) { - tv_bottom_right.text = timeFormat.format(Date(System.currentTimeMillis())) - } + tvTime?.text = timeFormat.format(Date(System.currentTimeMillis())) } fun upBattery(battery: Int) { this.battery = battery - if (ReadBookConfig.hideStatusBar) { - battery_view.setBattery(battery) - } + tvBattery?.setBattery(battery) } - fun setContent(textPage: TextPage) { + fun setContent(textPage: TextPage, resetPageOffset: Boolean = true) { setProgress(textPage) + if (resetPageOffset) + resetPageOffset() content_text_view.setContent(textPage) } @@ -119,18 +208,14 @@ class ContentView(context: Context) : FrameLayout(context) { @SuppressLint("SetTextI18n") fun setProgress(textPage: TextPage) = textPage.apply { val title = when (AppConfig.chineseConverterType) { - 1 -> ZhConvertBootstrap.newInstance().toSimple(textPage.title) - 2 -> ZhConvertBootstrap.newInstance().toTraditional(textPage.title) + 1 -> HanLP.convertToSimplifiedChinese(textPage.title) + 2 -> HanLP.convertToTraditionalChinese(textPage.title) else -> textPage.title } - if (ReadBookConfig.hideStatusBar) { - tv_top_left.text = title - tv_top_right.text = readProgress - tv_bottom_left.text = "${index.plus(1)}/$pageSize" - } else { - tv_bottom_left.text = title - tv_bottom_right.text = "${index.plus(1)}/$pageSize $readProgress" - } + tvTitle?.text = title + tvPage?.text = "${index.plus(1)}/$pageSize" + tvTotalProgress?.text = readProgress + tvPageAndTotal?.text = "${index.plus(1)}/$pageSize $readProgress" } fun onScroll(offset: Float) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/DataSource.kt b/app/src/main/java/io/legado/app/ui/book/read/page/DataSource.kt index 4f7afa04f..3a128f969 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/DataSource.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/DataSource.kt @@ -17,5 +17,5 @@ interface DataSource { fun hasPrevChapter(): Boolean - fun upContent(relativePosition: Int = 0) + fun upContent(relativePosition: Int = 0, resetPageOffset: Boolean = true) } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt index dbde99c7e..3a996bfe9 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/PageView.kt @@ -16,25 +16,20 @@ class PageView(context: Context, attrs: AttributeSet) : FrameLayout(context, attrs), DataSource { - var callBack: CallBack - var pageFactory: TextPageFactory + val callBack: CallBack get() = activity as CallBack + var pageFactory: TextPageFactory = TextPageFactory(this) var pageDelegate: PageDelegate? = null - var prevPage: ContentView - var curPage: ContentView - var nextPage: ContentView + var prevPage: ContentView = ContentView(context) + var curPage: ContentView = ContentView(context) + var nextPage: ContentView = ContentView(context) init { - callBack = activity as CallBack - nextPage = ContentView(context) addView(nextPage) - curPage = ContentView(context) addView(curPage) - prevPage = ContentView(context) addView(prevPage) upBg() setWillNotDraw(false) - pageFactory = TextPageFactory(this) upPageAnim() } @@ -43,7 +38,7 @@ class PageView(context: Context, attrs: AttributeSet) : prevPage.x = -w.toFloat() pageDelegate?.setViewSize(w, h) if (oldw != 0 && oldh != 0) { - ReadBook.loadContent() + ReadBook.loadContent(resetPageOffset = false) } } @@ -98,9 +93,9 @@ class PageView(context: Context, attrs: AttributeSet) : upContent() } - override fun upContent(relativePosition: Int) { + override fun upContent(relativePosition: Int, resetPageOffset: Boolean) { if (ReadBookConfig.isScroll) { - curPage.setContent(pageFactory.currentPage) + curPage.setContent(pageFactory.currentPage, resetPageOffset) } else { when (relativePosition) { -1 -> prevPage.setContent(pageFactory.prevPage) @@ -115,6 +110,12 @@ class PageView(context: Context, attrs: AttributeSet) : callBack.screenOffTimerStart() } + fun upTipStyle() { + curPage.upTipStyle() + prevPage.upTipStyle() + nextPage.upTipStyle() + } + fun upStyle() { ChapterProvider.upStyle() curPage.upStyle() @@ -170,5 +171,6 @@ class PageView(context: Context, attrs: AttributeSet) : val isInitFinish: Boolean fun clickCenter() fun screenOffTimerStart() + fun showTextActionMenu() } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/TextPageFactory.kt b/app/src/main/java/io/legado/app/ui/book/read/page/TextPageFactory.kt index a867daf3d..a38ed6e51 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/TextPageFactory.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/TextPageFactory.kt @@ -38,7 +38,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory(dataSource } else { ReadBook.setPageIndex(pageIndex.plus(1)) } - if (upContent) upContent() + if (upContent) upContent(resetPageOffset = false) true } else false @@ -51,7 +51,7 @@ class TextPageFactory(dataSource: DataSource) : PageFactory(dataSource } else { ReadBook.setPageIndex(pageIndex.minus(1)) } - if (upContent) upContent() + if (upContent) upContent(resetPageOffset = false) true } else false @@ -59,6 +59,9 @@ class TextPageFactory(dataSource: DataSource) : PageFactory(dataSource override val currentPage: TextPage get() = with(dataSource) { + ReadBook.msg?.let { + return@with TextPage(text = it).format() + } currentChapter?.let { return@with it.page(pageIndex) ?: TextPage(title = it.title).format() @@ -68,6 +71,9 @@ class TextPageFactory(dataSource: DataSource) : PageFactory(dataSource override val nextPage: TextPage get() = with(dataSource) { + ReadBook.msg?.let { + return@with TextPage(text = it).format() + } currentChapter?.let { if (pageIndex < it.pageSize() - 1) { return@with it.page(pageIndex + 1)?.removePageAloudSpan() @@ -86,6 +92,9 @@ class TextPageFactory(dataSource: DataSource) : PageFactory(dataSource override val prevPage: TextPage get() = with(dataSource) { + ReadBook.msg?.let { + return@with TextPage(text = it).format() + } if (pageIndex > 0) { currentChapter?.let { return@with it.page(pageIndex - 1)?.removePageAloudSpan() diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt index 8fe4fb699..f8f9bec74 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/HorizontalPageDelegate.kt @@ -37,7 +37,10 @@ abstract class HorizontalPageDelegate(pageView: PageView) : PageDelegate(pageVie override fun onTouch(event: MotionEvent) { when (event.action) { MotionEvent.ACTION_DOWN -> { - abort() + if (abort()) { + onAnimStop() + stopScroll() + } } MotionEvent.ACTION_MOVE -> { if (isTextSelected) { diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt index 4173ffb09..cd455b641 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/delegate/PageDelegate.kt @@ -154,10 +154,12 @@ abstract class PageDelegate(protected val pageView: PageView) : } } - fun abort() { + fun abort(): Boolean { if (!scroller.isFinished) { scroller.abortAnimation() + return true } + return false } open fun onAnimStart() {}//scroller start @@ -200,11 +202,16 @@ abstract class PageDelegate(protected val pageView: PageView) : //GestureDetector.onFling小幅移动不会触发,所以要自己判断 when (event.action) { MotionEvent.ACTION_UP, - MotionEvent.ACTION_CANCEL -> if (isMoved) { - if (selectedOnDown) { - selectedOnDown = false + MotionEvent.ACTION_CANCEL -> { + if (isTextSelected) { + pageView.callBack.showTextActionMenu() + } + if (isMoved) { + if (selectedOnDown) { + selectedOnDown = false + } + if (!noNext) onAnimStart() } - if (!noNext) onAnimStart() } } } diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt index e2cbaafde..e05b7746b 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextChapter.kt @@ -12,10 +12,7 @@ data class TextChapter( val chaptersSize: Int ) { fun page(index: Int): TextPage? { - if (index >= 0 && index < pages.size) { - return pages[index] - } - return null + return pages.getOrNull(index) } fun lastPage(): TextPage? { @@ -25,20 +22,6 @@ data class TextChapter( return null } - fun scrollPage(): TextPage? { - if (pages.isNotEmpty()) { - val stringBuilder = StringBuilder() - pages.forEach { - stringBuilder.append(it.text) - } - return TextPage( - index = 0, text = stringBuilder.toString(), title = title, - pageSize = pages.size, chapterSize = chaptersSize, chapterIndex = position - ) - } - return null - } - fun lastIndex(): Int { return pages.size - 1 } @@ -70,28 +53,6 @@ data class TextChapter( return stringBuilder.toString() } - fun getStartLine(pageIndex: Int): Int { - if (pageLines.size > pageIndex) { - var lines = 0 - for (index: Int in 0 until pageIndex) { - lines += pageLines[index] + 1 - } - return lines - } - return 0 - } - - fun getPageIndex(line: Int): Int { - var lines = 0 - for (pageIndex in pageLines.indices) { - lines += pageLines[pageIndex] + 1 - if (line < lines) { - return pageIndex - } - } - return 0 - } - fun getContent(): String { val stringBuilder = StringBuilder() pages.forEach { diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt index 6c4e27073..e81af6986 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/entities/TextPage.kt @@ -18,11 +18,11 @@ data class TextPage( var height: Float = 0f ) { - fun upLinesPosition(visibleHeight: Int) { - if (textLines.size <= 1) return - if (visibleHeight - height > with(textLines.last()) { lineBottom - lineTop }) return - val surplus = (visibleHeight - textLines.last().lineBottom) - if (surplus == 0f) return + fun upLinesPosition() = ChapterProvider.apply { + if (textLines.size <= 1) return@apply + if (visibleHeight - height >= with(textLines.last()) { lineBottom - lineTop }) return@apply + val surplus = (visibleBottom - textLines.last().lineBottom) + if (surplus == 0f) return@apply height += surplus val tj = surplus / (textLines.size - 1) for (i in 1 until textLines.size) { @@ -44,12 +44,11 @@ data class TextPage( if (y < 0) y = 0f for (lineIndex in 0 until layout.lineCount) { val textLine = TextLine() - textLine.lineTop = (ChapterProvider.paddingTop + y - - (layout.getLineBottom(lineIndex) - layout.getLineTop(lineIndex))) - textLine.lineBase = (ChapterProvider.paddingTop + y - - (layout.getLineBottom(lineIndex) - layout.getLineBaseline(lineIndex))) + textLine.lineTop = ChapterProvider.paddingTop + y + layout.getLineTop(lineIndex) + textLine.lineBase = + ChapterProvider.paddingTop + y + layout.getLineBaseline(lineIndex) textLine.lineBottom = - textLine.lineBase + ChapterProvider.contentPaint.fontMetrics.descent + ChapterProvider.paddingTop + y + layout.getLineBottom(lineIndex) var x = ChapterProvider.paddingLeft + (ChapterProvider.visibleWidth - layout.getLineMax(lineIndex)) / 2 textLine.text = diff --git a/app/src/main/java/io/legado/app/ui/book/search/DiffCallBack.kt b/app/src/main/java/io/legado/app/ui/book/search/DiffCallBack.kt index 07a3b16c5..b03e54fb7 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/DiffCallBack.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/DiffCallBack.kt @@ -49,9 +49,9 @@ class DiffCallBack(private val oldItems: List, private val newItems: } override fun getChangePayload(oldItemPosition: Int, newItemPosition: Int): Any? { - val oldItem = oldItems[oldItemPosition] - val newItem = newItems[newItemPosition] val payload = Bundle() + val newItem = newItems[newItemPosition] + val oldItem = oldItems[oldItemPosition] if (oldItem.name != newItem.name) { payload.putString("name", newItem.name) } @@ -73,6 +73,9 @@ class DiffCallBack(private val oldItems: List, private val newItems: if (oldItem.intro != newItem.intro) { payload.putString("intro", newItem.intro) } + if (payload.isEmpty) { + return null + } return payload } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt index 2d1054859..e81545adc 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchActivity.kt @@ -112,6 +112,7 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se viewModel.saveSearchKey(query) viewModel.search(it) } + openOrCloseHistory(false) return true } @@ -128,6 +129,7 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se openOrCloseHistory(hasFocus) } } + openOrCloseHistory(true) } private fun initRecyclerView() { @@ -283,10 +285,12 @@ class SearchActivity : VMBaseActivity(R.layout.activity_book_se */ @Synchronized private fun upSearchItems(items: List, isMandatoryUpdate: Boolean) { + val searchItems = ArrayList(items) if (isMandatoryUpdate || System.currentTimeMillis() - refreshTime > 500) { refreshTime = System.currentTimeMillis() - val diffResult = DiffUtil.calculateDiff(DiffCallBack(adapter.getItems(), items)) - adapter.setItems(items, diffResult) + val diffResult = + DiffUtil.calculateDiff(DiffCallBack(adapter.getItems(), searchItems)) + adapter.setItems(searchItems, diffResult) } } diff --git a/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt b/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt index 47671626d..ccfc5dd15 100644 --- a/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt @@ -7,82 +7,62 @@ import io.legado.app.base.BaseViewModel import io.legado.app.constant.PreferKey import io.legado.app.data.entities.SearchBook import io.legado.app.data.entities.SearchKeyword -import io.legado.app.help.AppConfig -import io.legado.app.help.coroutine.Coroutine -import io.legado.app.model.WebBook +import io.legado.app.model.SearchBookModel import io.legado.app.utils.getPrefBoolean -import io.legado.app.utils.getPrefString -import kotlinx.coroutines.Dispatchers.IO -import kotlinx.coroutines.asCoroutineDispatcher -import java.util.concurrent.Executors +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.isActive -class SearchViewModel(application: Application) : BaseViewModel(application) { - private var searchPool = - Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher() - private var task: Coroutine<*>? = null +class SearchViewModel(application: Application) : BaseViewModel(application) + , SearchBookModel.CallBack { + private val searchBookModel = SearchBookModel(this, this) var isSearchLiveData = MutableLiveData() var searchBookLiveData = MutableLiveData>() var searchKey: String = "" - var searchPage = 1 var isLoading = false var searchBooks = arrayListOf() + private var searchID = 0L /** * 开始搜索 */ fun search(key: String) { - task?.cancel() - if (key.isEmpty() && searchKey.isEmpty()) { - return - } else if (key.isEmpty()) { - isLoading = true - searchPage++ - } else if (key.isNotEmpty()) { - isLoading = true - searchPage = 1 - searchKey = key + if (searchKey != key && key.isNotEmpty()) { + searchBookModel.cancelSearch() searchBooks.clear() + searchBookLiveData.postValue(searchBooks) + searchID = System.currentTimeMillis() + searchKey = key } + searchBookModel.search(searchID, searchKey) + } + + override fun onSearchStart() { isSearchLiveData.postValue(true) - task = execute { - val searchGroup = context.getPrefString("searchGroup") ?: "" - val bookSourceList = if (searchGroup.isBlank()) { - App.db.bookSourceDao().allEnabled - } else { - App.db.bookSourceDao().getEnabledByGroup(searchGroup) - } - for (item in bookSourceList) { - //task取消时自动取消 by (scope = this@execute) - WebBook(item).searchBook( - searchKey, - searchPage, - scope = this@execute, - context = searchPool - ) - .timeout(30000L) - .onSuccess(IO) { - it?.let { list -> - if (context.getPrefBoolean(PreferKey.precisionSearch)) { - precisionSearch(list) - } else { - App.db.searchBookDao().insert(*list.toTypedArray()) - mergeItems(list) - } - } - } - } - } + } - task?.invokeOnCompletion { - isSearchLiveData.postValue(false) - isLoading = false + override fun onSearchSuccess(searchBooks: ArrayList) { + if (context.getPrefBoolean(PreferKey.precisionSearch)) { + precisionSearch(this, searchBooks) + } else { + App.db.searchBookDao().insert(*searchBooks.toTypedArray()) + mergeItems(this, searchBooks) } } + override fun onSearchFinish() { + isSearchLiveData.postValue(false) + isLoading = false + } + + override fun onSearchCancel() { + isSearchLiveData.postValue(false) + isLoading = false + } + /** * 精确搜索处理 */ - private fun precisionSearch(searchBooks: List) { + private fun precisionSearch(scope: CoroutineScope, searchBooks: List) { val books = arrayListOf() searchBooks.forEach { searchBook -> if (searchBook.name.contains(searchKey, true) @@ -90,14 +70,16 @@ class SearchViewModel(application: Application) : BaseViewModel(application) { ) books.add(searchBook) } App.db.searchBookDao().insert(*books.toTypedArray()) - mergeItems(books) + if (scope.isActive) { + mergeItems(scope, books) + } } /** * 合并搜索结果并排序 */ @Synchronized - private fun mergeItems(newDataS: List) { + private fun mergeItems(scope: CoroutineScope, newDataS: List) { if (newDataS.isNotEmpty()) { val copyDataS = ArrayList(searchBooks) val searchBooksAdd = ArrayList() @@ -141,6 +123,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application) { } } } + if (!scope.isActive) return searchBooks.sortWith(Comparator { o1, o2 -> if (o1.name == searchKey && o2.name != searchKey) { 1 @@ -166,6 +149,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application) { 0 } }) + if (!scope.isActive) return searchBooks = copyDataS searchBookLiveData.postValue(copyDataS) } @@ -175,7 +159,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application) { * 停止搜索 */ fun stop() { - task?.cancel() + searchBookModel.cancelSearch() } /** @@ -211,7 +195,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application) { override fun onCleared() { super.onCleared() - searchPool.close() + searchBookModel.close() } } diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 385088640..d3cb63af3 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -104,8 +104,14 @@ class BookSourceActivity : VMBaseActivity(R.layout.activity when (it.path) { "/importonline" -> it.getQueryParameter("src")?.let { url -> Snackbar.make(title_bar, R.string.importing, Snackbar.LENGTH_INDEFINITE).show() - viewModel.importSource(url) { msg -> - title_bar.snackbar(msg) + if (url.startsWith("http", false)){ + viewModel.importSource(url) { msg -> + title_bar.snackbar(msg) + } + } + else{ + viewModel.importSourceFromFilePath(url){msg -> + title_bar.snackbar(msg)} } } else -> { diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt index 5d5872638..eb37cb868 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceAdapter.kt @@ -185,7 +185,7 @@ class BookSourceAdapter(context: Context, val callBack: CallBack) : private val movedItems = hashSetOf() - override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { + override fun onClearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { if (movedItems.isNotEmpty()) { callBack.update(*movedItems.toTypedArray()) movedItems.clear() diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt index 85e3239bc..5857fe8ef 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceViewModel.kt @@ -1,6 +1,7 @@ package io.legado.app.ui.book.source.manage import android.app.Application +import android.net.Uri import android.text.TextUtils import androidx.documentfile.provider.DocumentFile import com.jayway.jsonpath.JsonPath @@ -8,7 +9,6 @@ import io.legado.app.App import io.legado.app.base.BaseViewModel import io.legado.app.data.entities.BookSource import io.legado.app.help.http.HttpHelper -import io.legado.app.help.storage.Backup import io.legado.app.help.storage.OldRule import io.legado.app.help.storage.Restore.jsonPath import io.legado.app.utils.* @@ -96,7 +96,7 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) FileUtils.createFileIfNotExist(file, "exportBookSource.json") .writeText(json) }.onSuccess { - context.toast("成功导出至\n${Backup.exportPath}") + context.toast("成功导出至\n${file.absolutePath}") }.onError { context.toast("导出失败\n${it.localizedMessage}") } @@ -109,7 +109,7 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) doc.createFile("", "exportBookSource.json") ?.writeText(context, json) }.onSuccess { - context.toast("成功导出至\n${Backup.exportPath}") + context.toast("成功导出至\n${doc.uri.path}") }.onError { context.toast("导出失败\n${it.localizedMessage}") } @@ -157,9 +157,20 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) fun importSourceFromFilePath(path: String, finally: (msg: String) -> Unit) { execute { - val file = File(path) - if (file.exists()) { - importSource(file.readText(), finally) + val content = if (path.isContentPath()) { + //在前面被解码了,如果不进行编码,中文会无法识别 + val newPath = Uri.encode(path, ":/.") + DocumentFile.fromSingleUri(context, Uri.parse(newPath))?.readText(context) + } else { + val file = File(path) + if (file.exists()) { + file.readText() + } else { + null + } + } + if (content != null) { + importSource(content, finally) } else { withContext(Dispatchers.Main) { finally("打开文件出错") @@ -211,12 +222,12 @@ class BookSourceViewModel(application: Application) : BaseViewModel(application) }.onError { finally(it.localizedMessage ?: "") }.onSuccess { - finally(it ?: "导入完成") + finally(it) } } private fun importSourceUrl(url: String): Int { - HttpHelper.simpleGet(url)?.let { body -> + HttpHelper.simpleGet(url, "UTF-8")?.let { body -> val bookSources = mutableListOf() val items: List> = jsonPath.parse(body).read("$") for (item in items) { diff --git a/app/src/main/java/io/legado/app/ui/config/BackupRestoreUi.kt b/app/src/main/java/io/legado/app/ui/config/BackupRestoreUi.kt index 913f78971..c849ae1de 100644 --- a/app/src/main/java/io/legado/app/ui/config/BackupRestoreUi.kt +++ b/app/src/main/java/io/legado/app/ui/config/BackupRestoreUi.kt @@ -48,30 +48,24 @@ object BackupRestoreUi { selectBackupFolder(fragment, backupSelectRequestCode) } } else { - backupUsePermission(fragment, requestCode = backupSelectRequestCode) + backupUsePermission(fragment, backupPath) } } } private fun backupUsePermission( fragment: Fragment, - path: String = Backup.legadoPath, - requestCode: Int = selectFolderRequestCode + path: String ) { PermissionsCompat.Builder(fragment) .addPermissions(*Permissions.Group.STORAGE) .rationale(R.string.tip_perm_request_storage) .onGranted { - when (requestCode) { - selectFolderRequestCode -> AppConfig.backupPath = Backup.legadoPath - else -> { - Coroutine.async { - AppConfig.backupPath = Backup.legadoPath - Backup.backup(fragment.requireContext(), path) - }.onSuccess { - fragment.toast(R.string.backup_success) - } - } + Coroutine.async { + AppConfig.backupPath = path + Backup.backup(fragment.requireContext(), path) + }.onSuccess { + fragment.toast(R.string.backup_success) } } .request() @@ -107,7 +101,7 @@ object BackupRestoreUi { } } - private fun restoreUsePermission(fragment: Fragment, path: String = Backup.legadoPath) { + private fun restoreUsePermission(fragment: Fragment, path: String) { PermissionsCompat.Builder(fragment) .addPermissions(*Permissions.Group.STORAGE) .rationale(R.string.tip_perm_request_storage) diff --git a/app/src/main/java/io/legado/app/ui/config/FileAssociationActivity.kt b/app/src/main/java/io/legado/app/ui/config/FileAssociationActivity.kt new file mode 100644 index 000000000..80390c639 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/config/FileAssociationActivity.kt @@ -0,0 +1,39 @@ +package io.legado.app.ui.config + +import android.content.Intent +import android.os.Bundle +import io.legado.app.R +import io.legado.app.base.VMBaseActivity +import io.legado.app.ui.main.MainActivity +import io.legado.app.utils.getViewModel + + +class FileAssociationActivity : + VMBaseActivity(R.layout.activity_file_association) { + override val viewModel: FileAssociationViewModel + get() = getViewModel(FileAssociationViewModel::class.java) + + override fun onActivityCreated(savedInstanceState: Bundle?) { + intent.data?.let { data -> + val newIntent = viewModel.dispatchIndent(data) + if (newIntent != null) { + this.startActivityForResult(newIntent, 100) + } else { + gotoMainActivity() + } + } + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + + //返回后直接跳转到主页面 + gotoMainActivity() + } + + private fun gotoMainActivity() { + val mIntent = Intent() + mIntent.setClass(this, MainActivity::class.java) + startActivity(mIntent) + } +} diff --git a/app/src/main/java/io/legado/app/ui/config/FileAssociationViewModel.kt b/app/src/main/java/io/legado/app/ui/config/FileAssociationViewModel.kt new file mode 100644 index 000000000..02aab3668 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/config/FileAssociationViewModel.kt @@ -0,0 +1,78 @@ +package io.legado.app.ui.config + +import android.app.Application +import android.content.Intent +import android.net.Uri +import android.text.TextUtils +import androidx.documentfile.provider.DocumentFile +import io.legado.app.base.BaseViewModel +import io.legado.app.model.localBook.LocalBook +import io.legado.app.utils.isJsonArray +import io.legado.app.utils.isJsonObject +import io.legado.app.utils.readText +import java.io.File + +class FileAssociationViewModel(application: Application) : BaseViewModel(application) { + fun dispatchIndent(uri: Uri): Intent? { + val url: String + //如果是普通的url,需要根据返回的内容判断是什么 + if (uri.scheme == "file" || uri.scheme == "content") { + val content = if (uri.scheme == "file") { + val file = File(uri.path.toString()) + if (file.exists()) { + file.readText() + } else { + null + } + } else { + DocumentFile.fromSingleUri(context, uri)?.readText(context) + } + var scheme = "" + if (content != null) { + if (content.isJsonObject() || content.isJsonArray()) { + //暂时根据文件内容判断属于什么 + when { + content.contains("bookSourceUrl") -> { + scheme = "booksource" + } + content.contains("sourceUrl") -> { + scheme = "rsssource" + } + content.contains("pattern") -> { + scheme = "replace" + } + } + } + if (TextUtils.isEmpty(scheme)) { + execute { + if (uri.scheme == "content"){ + LocalBook.importFile(uri.toString()) + }else{ + LocalBook.importFile(uri.path.toString()) + } + toast("添加本地文件成功${uri.path}") + } + return null + } + } else { + toast("文件不存在") + return null + } + // content模式下,需要传递完整的路径,方便后续解析 + url = if (uri.scheme == "content"){ + "yuedu://${scheme}/importonline?src=$uri" + }else{ + "yuedu://${scheme}/importonline?src=${uri.path}" + } + + } else if (uri.scheme == "yuedu") { + url = uri.toString() + } else { + url = "yuedu://booksource/importonline?src=${uri.path}" + } + val data = Uri.parse(url) + val newIndent = Intent(Intent.ACTION_VIEW) + newIndent.data = data + return newIndent + } +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt index 58caa351d..f23fee053 100644 --- a/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/OtherConfigFragment.kt @@ -1,8 +1,6 @@ package io.legado.app.ui.config -import android.app.Activity.RESULT_OK import android.content.ComponentName -import android.content.Intent import android.content.SharedPreferences import android.content.pm.PackageManager import android.os.Bundle @@ -19,17 +17,13 @@ import io.legado.app.help.BookHelp import io.legado.app.lib.theme.ATH import io.legado.app.receiver.SharedReceiverActivity import io.legado.app.service.WebService -import io.legado.app.ui.filechooser.FileChooserDialog -import io.legado.app.ui.filechooser.FilePicker import io.legado.app.ui.widget.number.NumberPickerDialog import io.legado.app.utils.* class OtherConfigFragment : PreferenceFragmentCompat(), - FileChooserDialog.CallBack, SharedPreferences.OnSharedPreferenceChangeListener { - private val requestCodeDownloadPath = 25324 private val packageManager = App.INSTANCE.packageManager private val componentName = ComponentName( App.INSTANCE, @@ -40,7 +34,6 @@ class OtherConfigFragment : PreferenceFragmentCompat(), override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { putPrefBoolean(PreferKey.processText, isProcessTextEnabled()) addPreferencesFromResource(R.xml.pref_config_other) - upPreferenceSummary(PreferKey.downloadPath, BookHelp.downloadPath) upPreferenceSummary(PreferKey.threadCount, AppConfig.threadCount.toString()) upPreferenceSummary(PreferKey.webPort, webPort.toString()) } @@ -74,7 +67,6 @@ class OtherConfigFragment : PreferenceFragmentCompat(), .show { putPrefInt(PreferKey.webPort, it) } - PreferKey.downloadPath -> selectDownloadPath() PreferKey.cleanCache -> { BookHelp.clearCache() toast(R.string.clear_cache_success) @@ -85,9 +77,6 @@ class OtherConfigFragment : PreferenceFragmentCompat(), override fun onSharedPreferenceChanged(sharedPreferences: SharedPreferences?, key: String?) { when (key) { - PreferKey.downloadPath -> { - upPreferenceSummary(key, BookHelp.downloadPath) - } PreferKey.threadCount -> upPreferenceSummary( key, AppConfig.threadCount.toString() ) @@ -139,30 +128,4 @@ class OtherConfigFragment : PreferenceFragmentCompat(), } } - private fun selectDownloadPath() { - FilePicker.selectFolder(this, requestCodeDownloadPath) { - removePref(PreferKey.downloadPath) - } - } - - override fun onFilePicked(requestCode: Int, currentPath: String) { - if (requestCode == requestCodeDownloadPath) { - putPrefString(PreferKey.downloadPath, currentPath) - } - } - - override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { - super.onActivityResult(requestCode, resultCode, data) - when (requestCode) { - requestCodeDownloadPath -> if (resultCode == RESULT_OK) { - data?.data?.let { uri -> - requireContext().contentResolver.takePersistableUriPermission( - uri, - Intent.FLAG_GRANT_READ_URI_PERMISSION or Intent.FLAG_GRANT_WRITE_URI_PERMISSION - ) - putPrefString(PreferKey.downloadPath, uri.toString()) - } - } - } - } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt index 17a3bcfe1..da2672841 100644 --- a/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt +++ b/app/src/main/java/io/legado/app/ui/config/ThemeConfigFragment.kt @@ -1,6 +1,7 @@ package io.legado.app.ui.config import android.content.SharedPreferences +import android.os.Build import android.os.Bundle import android.view.View import androidx.preference.Preference @@ -16,8 +17,8 @@ import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.yesButton import io.legado.app.lib.theme.ATH import io.legado.app.lib.theme.ColorUtils -import io.legado.app.lib.theme.elevation import io.legado.app.ui.widget.number.NumberPickerDialog +import io.legado.app.ui.widget.prefs.IconListPreference import io.legado.app.utils.* @@ -27,6 +28,11 @@ class ThemeConfigFragment : PreferenceFragmentCompat(), SharedPreferences.OnShar override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { addPreferencesFromResource(R.xml.pref_config_theme) + if (Build.VERSION.SDK_INT < 26) { + findPreference(PreferKey.launcherIcon)?.let { + preferenceScreen.removePreference(it) + } + } upPreferenceSummary("barElevation", AppConfig.elevation.toString()) } diff --git a/app/src/main/java/io/legado/app/ui/filechooser/FilePicker.kt b/app/src/main/java/io/legado/app/ui/filechooser/FilePicker.kt index 8f5549709..717ad8f11 100644 --- a/app/src/main/java/io/legado/app/ui/filechooser/FilePicker.kt +++ b/app/src/main/java/io/legado/app/ui/filechooser/FilePicker.kt @@ -31,7 +31,7 @@ object FilePicker { 0 -> default?.invoke() 1 -> { try { - val intent = getSelectDirIntent() + val intent = createSelectDirIntent() activity.startActivityForResult(intent, requestCode) } catch (e: java.lang.Exception) { e.printStackTrace() @@ -68,7 +68,7 @@ object FilePicker { 0 -> default?.invoke() 1 -> { try { - val intent = getSelectDirIntent() + val intent = createSelectDirIntent() fragment.startActivityForResult(intent, requestCode) } catch (e: java.lang.Exception) { e.printStackTrace() @@ -106,7 +106,7 @@ object FilePicker { 0 -> default?.invoke() 1 -> { try { - val intent = getSelectFileIntent() + val intent = createSelectFileIntent() intent.type = type//设置类型 activity.startActivityForResult(intent, requestCode) } catch (e: java.lang.Exception) { @@ -147,7 +147,7 @@ object FilePicker { 0 -> default?.invoke() 1 -> { try { - val intent = getSelectFileIntent() + val intent = createSelectFileIntent() intent.type = type//设置类型 fragment.startActivityForResult(intent, requestCode) } catch (e: java.lang.Exception) { @@ -168,14 +168,14 @@ object FilePicker { }.show() } - private fun getSelectFileIntent(): Intent { + private fun createSelectFileIntent(): Intent { val intent = Intent(Intent.ACTION_GET_CONTENT) intent.addCategory(Intent.CATEGORY_OPENABLE) intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) return intent } - private fun getSelectDirIntent(): Intent { + private fun createSelectDirIntent(): Intent { val intent = Intent(Intent.ACTION_OPEN_DOCUMENT_TREE) intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION) return intent diff --git a/app/src/main/java/io/legado/app/ui/filechooser/utils/ConvertUtils.kt b/app/src/main/java/io/legado/app/ui/filechooser/utils/ConvertUtils.kt index 25ad9d56b..f07371518 100644 --- a/app/src/main/java/io/legado/app/ui/filechooser/utils/ConvertUtils.kt +++ b/app/src/main/java/io/legado/app/ui/filechooser/utils/ConvertUtils.kt @@ -5,7 +5,6 @@ import android.graphics.Bitmap import android.graphics.BitmapFactory import android.graphics.drawable.BitmapDrawable import android.graphics.drawable.Drawable -import okhttp3.internal.and import java.io.BufferedReader import java.io.IOException import java.io.InputStream @@ -36,7 +35,7 @@ object ConvertUtils { var abyte: Byte for (i in bytes.indices) { abyte = bytes[i] - result += abyte and 0xFF shl 8 * i + result += (abyte.toInt() and 0xFF).shl(8 * i) } return result } diff --git a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt index 0d43b28c2..181ec0330 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainActivity.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainActivity.kt @@ -78,7 +78,7 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), putPrefInt(PreferKey.versionCode, App.INSTANCE.versionCode) if (!BuildConfig.DEBUG) { val log = String(assets.open("updateLog.md").readBytes()) - TextDialog.show(supportFragmentManager, log, TextDialog.MD) + TextDialog.show(supportFragmentManager, log, TextDialog.MD, 5000, true) } } } @@ -114,11 +114,11 @@ class MainActivity : VMBaseActivity(R.layout.activity_main), return super.onKeyUp(keyCode, event) } - override fun finish() { + override fun onPause() { + super.onPause() if (!BuildConfig.DEBUG) { Backup.autoBack(this) } - super.finish() } override fun onDestroy() { diff --git a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt index 4fe57d758..61c951ae5 100644 --- a/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/MainViewModel.kt @@ -33,11 +33,9 @@ class MainViewModel(application: Application) : BaseViewModel(application) { updateList.remove(book.bookUrl) postEvent(EventBus.UP_BOOK, book.bookUrl) } - it?.let { - App.db.bookDao().update(book) - App.db.bookChapterDao().delByBook(book.bookUrl) - App.db.bookChapterDao().insert(*it.toTypedArray()) - } + App.db.bookDao().update(book) + App.db.bookChapterDao().delByBook(book.bookUrl) + App.db.bookChapterDao().insert(*it.toTypedArray()) } .onError { synchronized(this) { diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt deleted file mode 100644 index 55115ad94..000000000 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt +++ /dev/null @@ -1,36 +0,0 @@ -package io.legado.app.ui.main.bookshelf - -import androidx.fragment.app.Fragment -import androidx.viewpager2.adapter.FragmentStateAdapter -import io.legado.app.data.entities.BookGroup -import io.legado.app.ui.main.bookshelf.books.BooksFragment - - -class BookshelfAdapter(fragment: Fragment, val callBack: CallBack) : - FragmentStateAdapter(fragment) { - - private val ids = hashSetOf() - - override fun getItemCount(): Int { - return callBack.groupSize - } - - override fun getItemId(position: Int): Long { - return callBack.getGroup(position).groupId.toLong() - } - - override fun containsItem(itemId: Long): Boolean { - return ids.contains(itemId) - } - - override fun createFragment(position: Int): Fragment { - val groupId = callBack.getGroup(position).groupId - ids.add(groupId.toLong()) - return BooksFragment.newInstance(position, groupId) - } - - interface CallBack { - val groupSize: Int - fun getGroup(position: Int): BookGroup - } -} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index 3608a79ed..f51bdc0a6 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -7,10 +7,12 @@ import android.view.Menu import android.view.MenuItem import android.view.View import androidx.appcompat.widget.SearchView +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentStatePagerAdapter import androidx.lifecycle.LiveData import androidx.lifecycle.Observer import com.google.android.material.tabs.TabLayout -import com.google.android.material.tabs.TabLayoutMediator import io.legado.app.App import io.legado.app.R import io.legado.app.base.VMBaseFragment @@ -29,6 +31,7 @@ import io.legado.app.ui.book.download.DownloadActivity import io.legado.app.ui.book.group.GroupManageDialog import io.legado.app.ui.book.local.ImportBookActivity import io.legado.app.ui.book.search.SearchActivity +import io.legado.app.ui.main.bookshelf.books.BooksFragment import io.legado.app.ui.widget.text.AutoCompleteTextView import io.legado.app.utils.* import kotlinx.android.synthetic.main.dialog_bookshelf_config.view.* @@ -36,21 +39,25 @@ import kotlinx.android.synthetic.main.dialog_edit_text.view.* import kotlinx.android.synthetic.main.fragment_bookshelf.* import kotlinx.android.synthetic.main.view_tab_layout.* import kotlinx.android.synthetic.main.view_title_bar.* +import kotlinx.coroutines.Dispatchers.IO +import kotlinx.coroutines.launch +import kotlinx.coroutines.withContext import org.jetbrains.anko.startActivity class BookshelfFragment : VMBaseFragment(R.layout.fragment_bookshelf), TabLayout.OnTabSelectedListener, SearchView.OnQueryTextListener, - GroupManageDialog.CallBack, - BookshelfAdapter.CallBack { + GroupManageDialog.CallBack { override val viewModel: BookshelfViewModel get() = getViewModel(BookshelfViewModel::class.java) - private lateinit var bookshelfAdapter: BookshelfAdapter private var bookGroupLiveData: LiveData>? = null + private var noGroupLiveData: LiveData? = null private val bookGroups = mutableListOf() + private val fragmentMap = hashMapOf() + private var showGroupNone = false override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { setSupportToolbar(toolbar) @@ -79,26 +86,17 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b } } - override val groupSize: Int - get() = bookGroups.size - - override fun getGroup(position: Int): BookGroup { - return bookGroups[position] - } - private val selectedGroup: BookGroup get() = bookGroups[view_pager_bookshelf.currentItem] private fun initView() { + ATH.applyEdgeEffectColor(view_pager_bookshelf) tab_layout.isTabIndicatorFullWidth = false tab_layout.tabMode = TabLayout.MODE_SCROLLABLE tab_layout.setSelectedTabIndicatorColor(requireContext().accentColor) - ATH.applyEdgeEffectColor(view_pager_bookshelf) - bookshelfAdapter = BookshelfAdapter(this, this) - view_pager_bookshelf.adapter = bookshelfAdapter - TabLayoutMediator(tab_layout, view_pager_bookshelf) { tab, position -> - tab.text = bookGroups[position].groupName - }.attach() + tab_layout.setupWithViewPager(view_pager_bookshelf) + view_pager_bookshelf.offscreenPageLimit = 1 + view_pager_bookshelf.adapter = TabFragmentPageAdapter(childFragmentManager) } private fun initBookGroupData() { @@ -106,22 +104,49 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b bookGroupLiveData = App.db.bookGroupDao().liveDataAll() bookGroupLiveData?.observe(viewLifecycleOwner, Observer { viewModel.checkGroup(it) - synchronized(this) { - tab_layout.removeOnTabSelectedListener(this) - bookGroups.clear() - if (AppConfig.bookGroupAllShow) { - bookGroups.add(AppConst.bookGroupAll) + launch { + synchronized(this) { + tab_layout.removeOnTabSelectedListener(this@BookshelfFragment) } - if (AppConfig.bookGroupLocalShow) { - bookGroups.add(AppConst.bookGroupLocal) + var noGroupSize = 0 + withContext(IO) { + if (AppConfig.bookGroupNoneShow) { + noGroupSize = App.db.bookDao().noGroupSize + } } - if (AppConfig.bookGroupAudioShow) { - bookGroups.add(AppConst.bookGroupAudio) + synchronized(this@BookshelfFragment) { + bookGroups.clear() + if (AppConfig.bookGroupAllShow) { + bookGroups.add(AppConst.bookGroupAll) + } + if (AppConfig.bookGroupLocalShow) { + bookGroups.add(AppConst.bookGroupLocal) + } + if (AppConfig.bookGroupAudioShow) { + bookGroups.add(AppConst.bookGroupAudio) + } + showGroupNone = if (noGroupSize > 0 && it.isNotEmpty()) { + bookGroups.add(AppConst.bookGroupNone) + true + } else { + false + } + bookGroups.addAll(it) + view_pager_bookshelf.adapter?.notifyDataSetChanged() + tab_layout.getTabAt(getPrefInt(PreferKey.saveTabPosition, 0))?.select() + tab_layout.addOnTabSelectedListener(this@BookshelfFragment) } - bookGroups.addAll(it) - bookshelfAdapter.notifyDataSetChanged() - tab_layout.getTabAt(getPrefInt(PreferKey.saveTabPosition, 0))?.select() - tab_layout.addOnTabSelectedListener(this) + } + }) + noGroupLiveData?.removeObservers(viewLifecycleOwner) + noGroupLiveData = App.db.bookDao().observeNoGroupSize() + noGroupLiveData?.observe(viewLifecycleOwner, Observer { + if (it > 0 && !showGroupNone && AppConfig.bookGroupNoneShow) { + showGroupNone = true + upGroup() + } else if (it == 0 && showGroupNone) { + showGroupNone = false + upGroup() } }) } @@ -136,20 +161,36 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b } override fun upGroup() { - synchronized(this) { - bookGroups.remove(AppConst.bookGroupAll) - bookGroups.remove(AppConst.bookGroupLocal) - bookGroups.remove(AppConst.bookGroupAudio) - if (AppConfig.bookGroupAudioShow) { - bookGroups.add(0, AppConst.bookGroupAudio) - } - if (AppConfig.bookGroupLocalShow) { - bookGroups.add(0, AppConst.bookGroupLocal) + launch { + var noGroupSize = 0 + withContext(IO) { + if (AppConfig.bookGroupNoneShow) { + noGroupSize = App.db.bookDao().noGroupSize + } } - if (AppConfig.bookGroupAllShow) { - bookGroups.add(0, AppConst.bookGroupAll) + synchronized(this@BookshelfFragment) { + bookGroups.remove(AppConst.bookGroupAll) + bookGroups.remove(AppConst.bookGroupLocal) + bookGroups.remove(AppConst.bookGroupAudio) + bookGroups.remove(AppConst.bookGroupNone) + showGroupNone = + if (noGroupSize > 0 && bookGroups.isNotEmpty()) { + bookGroups.add(0, AppConst.bookGroupNone) + true + } else { + false + } + if (AppConfig.bookGroupAudioShow) { + bookGroups.add(0, AppConst.bookGroupAudio) + } + if (AppConfig.bookGroupLocalShow) { + bookGroups.add(0, AppConst.bookGroupLocal) + } + if (AppConfig.bookGroupAllShow) { + bookGroups.add(0, AppConst.bookGroupAll) + } + view_pager_bookshelf.adapter?.notifyDataSetChanged() } - bookshelfAdapter.notifyDataSetChanged() } } @@ -212,4 +253,31 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b putPrefInt(PreferKey.saveTabPosition, it) } } + + private inner class TabFragmentPageAdapter internal constructor(fm: FragmentManager) : + FragmentStatePagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { + + override fun getPageTitle(position: Int): CharSequence? { + return bookGroups[position].groupName + } + + override fun getItemPosition(`object`: Any): Int { + return POSITION_NONE + } + + override fun getItem(position: Int): Fragment { + val group = bookGroups[position] + var fragment = fragmentMap[group.groupId] + if (fragment == null) { + fragment = BooksFragment.newInstance(position, group.groupId) + fragmentMap[group.groupId] = fragment + } + return fragment + } + + override fun getCount(): Int { + return bookGroups.size + } + + } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt index 87d2b3e06..dda342015 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfViewModel.kt @@ -43,10 +43,9 @@ class BookshelfViewModel(application: Application) : BaseViewModel(application) ) WebBook(bookSource).getBookInfo(book, this) .onSuccess(IO) { - it?.let { book -> - App.db.bookDao().insert(book) - successCount++ - } + it.order = App.db.bookDao().maxOrder + 1 + App.db.bookDao().insert(it) + successCount++ }.onError { throw Exception(it.localizedMessage) } diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksAdapterGrid.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksAdapterGrid.kt index d647afd3b..1438c4507 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksAdapterGrid.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksAdapterGrid.kt @@ -21,7 +21,6 @@ class BooksAdapterGrid(context: Context, private val callBack: CallBack) : if (bundle == null) { ATH.applyBackgroundTint(this) tv_name.text = item.name - bv_author.text = item.author iv_cover.load(item.getDisplayCover(), item.name, item.author) if (item.origin != BookType.local && callBack.isUpdate(item.bookUrl)) { bv_unread.invisible() @@ -35,7 +34,6 @@ class BooksAdapterGrid(context: Context, private val callBack: CallBack) : bundle.keySet().map { when (it) { "name" -> tv_name.text = item.name - "author" -> bv_author.text = item.author "cover" -> iv_cover.load(item.getDisplayCover(), item.name, item.author) "refresh" -> if (item.origin != BookType.local && callBack.isUpdate(item.bookUrl)) { bv_unread.invisible() diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt index 43375288e..ab8984752 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt @@ -7,9 +7,11 @@ import androidx.lifecycle.Observer import androidx.recyclerview.widget.DiffUtil import androidx.recyclerview.widget.GridLayoutManager import androidx.recyclerview.widget.LinearLayoutManager +import androidx.recyclerview.widget.RecyclerView import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseFragment +import io.legado.app.constant.AppConst import io.legado.app.constant.BookType import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey @@ -26,6 +28,7 @@ import io.legado.app.utils.getViewModelOfActivity import io.legado.app.utils.observeEvent import kotlinx.android.synthetic.main.fragment_books.* import org.jetbrains.anko.startActivity +import kotlin.math.max class BooksFragment : BaseFragment(R.layout.fragment_books), @@ -71,17 +74,35 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), booksAdapter = BooksAdapterList(requireContext(), this) } else { rv_bookshelf.layoutManager = GridLayoutManager(context, bookshelfLayout + 2) - booksAdapter = BooksAdapterGrid(requireContext(),this) + booksAdapter = BooksAdapterGrid(requireContext(), this) } rv_bookshelf.adapter = booksAdapter + booksAdapter.registerAdapterDataObserver(object : RecyclerView.AdapterDataObserver() { + override fun onItemRangeInserted(positionStart: Int, itemCount: Int) { + val layoutManager = rv_bookshelf.layoutManager + if (positionStart == 0 && layoutManager is LinearLayoutManager) { + val scrollTo = layoutManager.findFirstVisibleItemPosition() - itemCount + rv_bookshelf.scrollToPosition(max(0, scrollTo)) + } + } + + override fun onItemRangeMoved(fromPosition: Int, toPosition: Int, itemCount: Int) { + val layoutManager = rv_bookshelf.layoutManager + if (toPosition == 0 && layoutManager is LinearLayoutManager) { + val scrollTo = layoutManager.findFirstVisibleItemPosition() - itemCount + rv_bookshelf.scrollToPosition(max(0, scrollTo)) + } + } + }) } private fun upRecyclerData() { bookshelfLiveData?.removeObservers(this) bookshelfLiveData = when (groupId) { - -1 -> App.db.bookDao().observeAll() - -2 -> App.db.bookDao().observeLocal() - -3 -> App.db.bookDao().observeAudio() + AppConst.bookGroupAll.groupId -> App.db.bookDao().observeAll() + AppConst.bookGroupLocal.groupId -> App.db.bookDao().observeLocal() + AppConst.bookGroupAudio.groupId -> App.db.bookDao().observeAudio() + AppConst.bookGroupNone.groupId -> App.db.bookDao().observeNoGroup() else -> App.db.bookDao().observeByGroup(groupId) } bookshelfLiveData?.observe(this, Observer { list -> diff --git a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt index 3ceeca8b6..ccfa5bf82 100644 --- a/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/explore/ExploreAdapter.kt @@ -12,6 +12,7 @@ import io.legado.app.data.entities.BookSource import io.legado.app.help.coroutine.Coroutine import io.legado.app.lib.theme.accentColor import io.legado.app.utils.ACache +import io.legado.app.utils.dp import io.legado.app.utils.gone import io.legado.app.utils.visible import kotlinx.android.synthetic.main.item_fillet_text.view.* @@ -23,16 +24,21 @@ import org.jetbrains.anko.sdk27.listeners.onLongClick class ExploreAdapter(context: Context, private val scope: CoroutineScope, val callBack: CallBack) : SimpleRecyclerAdapter(context, R.layout.item_find_book) { - private var exIndex = 0 + private var exIndex = -1 private var scrollTo = -1 override fun convert(holder: ItemViewHolder, item: BookSource, payloads: MutableList) { with(holder.itemView) { + if (holder.layoutPosition == getActualItemCount() - 1) { + setPadding(16.dp, 12.dp, 16.dp, 12.dp) + } else { + setPadding(16.dp, 12.dp, 16.dp, 0) + } if (payloads.isEmpty()) { tv_name.text = item.bookSourceName } if (exIndex == holder.layoutPosition) { - iv_status.setImageResource(R.drawable.ic_remove) + iv_status.setImageResource(R.drawable.ic_arrow_down) rotate_loading.loadingColor = context.accentColor rotate_loading.show() if (scrollTo >= 0) { @@ -68,7 +74,7 @@ class ExploreAdapter(context: Context, private val scope: CoroutineScope, val ca } } } else { - iv_status.setImageResource(R.drawable.ic_add) + iv_status.setImageResource(R.drawable.ic_arrow_right) rotate_loading.hide() gl_child.gone() } diff --git a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt index ddb045c9e..88bb95afe 100644 --- a/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/my/MyFragment.kt @@ -13,6 +13,7 @@ import io.legado.app.R import io.legado.app.base.BaseFragment import io.legado.app.constant.EventBus import io.legado.app.constant.PreferKey +import io.legado.app.help.AppConfig import io.legado.app.lib.theme.ATH import io.legado.app.service.WebService import io.legado.app.ui.about.AboutActivity @@ -23,7 +24,9 @@ import io.legado.app.ui.config.ConfigActivity import io.legado.app.ui.config.ConfigViewModel import io.legado.app.ui.filechooser.FileChooserDialog import io.legado.app.ui.replacerule.ReplaceRuleActivity +import io.legado.app.ui.widget.dialog.TextDialog import io.legado.app.ui.widget.prefs.NameListPreference +import io.legado.app.ui.widget.prefs.PreferenceCategory import io.legado.app.ui.widget.prefs.SwitchPreference import io.legado.app.utils.* import kotlinx.android.synthetic.main.view_title_bar.* @@ -46,9 +49,10 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog. override fun onCompatOptionsItemSelected(item: MenuItem) { when (item.itemId) { - R.id.menu_help -> startActivity() - R.id.menu_backup -> BackupRestoreUi.backup(this) - R.id.menu_restore -> BackupRestoreUi.restore(this) + R.id.menu_help -> { + val text = String(requireContext().assets.open("help.md").readBytes()) + TextDialog.show(childFragmentManager, text, TextDialog.MD) + } } } @@ -81,6 +85,10 @@ class MyFragment : BaseFragment(R.layout.fragment_my_config), FileChooserDialog. true } } + if (AppConfig.isGooglePlay) { + findPreference("aboutCategory") + ?.removePreference(findPreference("donate")) + } } override fun onViewCreated(view: View, savedInstanceState: Bundle?) { diff --git a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt index b960041d8..5bb42f081 100644 --- a/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/rss/RssFragment.kt @@ -12,7 +12,7 @@ import io.legado.app.base.BaseFragment import io.legado.app.data.entities.RssSource import io.legado.app.lib.theme.ATH import io.legado.app.ui.main.MainViewModel -import io.legado.app.ui.rss.article.RssArticlesActivity +import io.legado.app.ui.rss.article.RssSortActivity import io.legado.app.ui.rss.favorites.RssFavoritesActivity import io.legado.app.ui.rss.source.manage.RssSourceActivity import io.legado.app.utils.getViewModelOfActivity @@ -60,6 +60,6 @@ class RssFragment : BaseFragment(R.layout.fragment_rss), } override fun openRss(rssSource: RssSource) { - startActivity(Pair("url", rssSource.sourceUrl)) + startActivity(Pair("url", rssSource.sourceUrl)) } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt index fd0a591b6..1f9057e35 100644 --- a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt +++ b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleActivity.kt @@ -81,8 +81,15 @@ class ReplaceRuleActivity : VMBaseActivity(R.layout.activi when (it.path) { "/importonline" -> it.getQueryParameter("src")?.let { url -> Snackbar.make(title_bar, R.string.importing, Snackbar.LENGTH_INDEFINITE).show() - viewModel.importSource(url) { msg -> - title_bar.snackbar(msg) + if (url.startsWith("http", false)){ + viewModel.importSource(url) { msg -> + title_bar.snackbar(msg) + } + } + else{ + viewModel.importSourceFromFilePath(url) { msg -> + title_bar.snackbar(msg) + } } } else -> { diff --git a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleAdapter.kt b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleAdapter.kt index dd51d31d0..4dd09980c 100644 --- a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleAdapter.kt @@ -148,7 +148,7 @@ class ReplaceRuleAdapter(context: Context, var callBack: CallBack) : private val movedItems = linkedSetOf() - override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { + override fun onClearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { if (movedItems.isNotEmpty()) { callBack.update(*movedItems.toTypedArray()) movedItems.clear() diff --git a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleViewModel.kt b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleViewModel.kt index a63d7ea38..d11d04d4a 100644 --- a/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/replacerule/ReplaceRuleViewModel.kt @@ -1,6 +1,7 @@ package io.legado.app.ui.replacerule import android.app.Application +import android.net.Uri import android.text.TextUtils import androidx.documentfile.provider.DocumentFile import io.legado.app.App @@ -8,14 +9,39 @@ import io.legado.app.R import io.legado.app.base.BaseViewModel import io.legado.app.data.entities.ReplaceRule import io.legado.app.help.http.HttpHelper -import io.legado.app.help.storage.Backup import io.legado.app.help.storage.ImportOldData import io.legado.app.utils.* +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.withContext import org.jetbrains.anko.toast import java.io.File class ReplaceRuleViewModel(application: Application) : BaseViewModel(application) { - + fun importSourceFromFilePath(path: String, finally: (msg: String) -> Unit) { + execute { + val content = if (path.isContentPath()) { + //在前面被解码了,如果不进行编码,中文会无法识别 + val newPath = Uri.encode(path, ":/.") + DocumentFile.fromSingleUri(context, Uri.parse(newPath))?.readText(context) + } else { + val file = File(path) + if (file.exists()) { + file.readText() + } else { + null + } + } + if (content != null) { + importSource(content, finally) + } else { + withContext(Dispatchers.Main) { + finally("打开文件出错") + } + } + }.onError { + finally(it.localizedMessage ?: "打开文件出错") + } + } fun importSource(text: String, showMsg: (msg: String) -> Unit) { execute { if (text.isAbsUrl()) { @@ -93,7 +119,7 @@ class ReplaceRuleViewModel(application: Application) : BaseViewModel(application FileUtils.createFileIfNotExist(file, "exportReplaceRule.json") .writeText(json) }.onSuccess { - context.toast("成功导出至\n${Backup.exportPath}") + context.toast("成功导出至\n${file.absolutePath}") }.onError { context.toast("导出失败\n${it.localizedMessage}") } @@ -106,7 +132,7 @@ class ReplaceRuleViewModel(application: Application) : BaseViewModel(application doc.createFile("", "exportReplaceRule.json") ?.writeText(context, json) }.onSuccess { - context.toast("成功导出至\n${Backup.exportPath}") + context.toast("成功导出至\n${doc.uri.path}") }.onError { context.toast("导出失败\n${it.localizedMessage}") } diff --git a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesFragment.kt similarity index 51% rename from app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt rename to app/src/main/java/io/legado/app/ui/rss/article/RssArticlesFragment.kt index 31ac9cdda..f7a1b6bb6 100644 --- a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesFragment.kt @@ -1,83 +1,67 @@ package io.legado.app.ui.rss.article import android.os.Bundle -import android.view.Menu -import android.view.MenuItem +import android.view.View import androidx.lifecycle.LiveData import androidx.lifecycle.Observer import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.RecyclerView import io.legado.app.App import io.legado.app.R -import io.legado.app.base.VMBaseActivity +import io.legado.app.base.VMBaseFragment import io.legado.app.data.entities.RssArticle import io.legado.app.lib.theme.ATH import io.legado.app.ui.rss.read.ReadRssActivity -import io.legado.app.ui.rss.source.edit.RssSourceEditActivity import io.legado.app.ui.widget.recycler.LoadMoreView import io.legado.app.ui.widget.recycler.VerticalDivider import io.legado.app.utils.getViewModel -import kotlinx.android.synthetic.main.activity_rss_artivles.* +import io.legado.app.utils.getViewModelOfActivity +import io.legado.app.utils.startActivity +import kotlinx.android.synthetic.main.fragment_rss_articles.* import kotlinx.android.synthetic.main.view_load_more.view.* import kotlinx.android.synthetic.main.view_refresh_recycler.* -import org.jetbrains.anko.startActivity -import org.jetbrains.anko.startActivityForResult -class RssArticlesActivity : VMBaseActivity(R.layout.activity_rss_artivles), - RssArticlesViewModel.CallBack, +class RssArticlesFragment : VMBaseFragment(R.layout.fragment_rss_articles), RssArticlesAdapter.CallBack { + companion object { + fun create(sortName: String, sortUrl: String): RssArticlesFragment { + return RssArticlesFragment().apply { + val bundle = Bundle() + bundle.putString("sortName", sortName) + bundle.putString("sortUrl", sortUrl) + arguments = bundle + } + } + } + + private val activityViewModel: RssSortViewModel + get() = getViewModelOfActivity(RssSortViewModel::class.java) override val viewModel: RssArticlesViewModel get() = getViewModel(RssArticlesViewModel::class.java) - - override lateinit var adapter: RssArticlesAdapter - private val editSource = 12319 + lateinit var adapter: RssArticlesAdapter private lateinit var loadMoreView: LoadMoreView private var rssArticlesData: LiveData>? = null - override fun onActivityCreated(savedInstanceState: Bundle?) { - viewModel.callBack = this - viewModel.titleLiveData.observe(this, Observer { - title_bar.title = it - }) + override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { + viewModel.init(arguments) initView() - viewModel.initData(intent) { - initData() - refresh_recycler_view.startLoading() - } - } - - override fun onCompatCreateOptionsMenu(menu: Menu): Boolean { - menuInflater.inflate(R.menu.rss_articles, menu) - return super.onCompatCreateOptionsMenu(menu) - } - - override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { - when (item.itemId) { - R.id.menu_edit_source -> viewModel.rssSource?.sourceUrl?.let { - startActivityForResult(editSource, Pair("data", it)) - } - R.id.menu_clear -> { - viewModel.url?.let { - refresh_progress_bar.isAutoLoading = true - viewModel.clearArticles() - } - } - } - return super.onCompatOptionsItemSelected(item) + refresh_recycler_view.startLoading() + initView() + initData() } private fun initView() { ATH.applyEdgeEffectColor(recycler_view) - recycler_view.layoutManager = LinearLayoutManager(this) - recycler_view.addItemDecoration(VerticalDivider(this)) - adapter = RssArticlesAdapter(this, this) + recycler_view.layoutManager = LinearLayoutManager(requireContext()) + recycler_view.addItemDecoration(VerticalDivider(requireContext())) + adapter = RssArticlesAdapter(requireContext(), this) recycler_view.adapter = adapter - loadMoreView = LoadMoreView(this) + loadMoreView = LoadMoreView(requireContext()) adapter.addFooterView(loadMoreView) refresh_recycler_view.onRefreshStart = { - viewModel.url?.let { - viewModel.loadContent() + activityViewModel.rssSource?.let { + viewModel.loadContent(it) } } recycler_view.addOnScrollListener(object : RecyclerView.OnScrollListener() { @@ -91,10 +75,10 @@ class RssArticlesActivity : VMBaseActivity(R.layout.activi } private fun initData() { - viewModel.url?.let { + activityViewModel.url?.let { rssArticlesData?.removeObservers(this) - rssArticlesData = App.db.rssArticleDao().liveByOrigin(it) - rssArticlesData?.observe(this, Observer { list -> + rssArticlesData = App.db.rssArticleDao().liveByOriginSort(it, viewModel.sortName) + rssArticlesData?.observe(viewLifecycleOwner, Observer { list -> adapter.setItems(list) }) } @@ -104,21 +88,25 @@ class RssArticlesActivity : VMBaseActivity(R.layout.activi if (viewModel.isLoading) return if (loadMoreView.hasMore && adapter.getActualItemCount() > 0) { loadMoreView.rotate_loading.show() - viewModel.loadMore() + activityViewModel.rssSource?.let { + viewModel.loadMore(it) + } } } - override fun loadFinally(hasMore: Boolean) { - refresh_recycler_view.stopLoading() - if (hasMore) { - loadMoreView.startLoad() - } else { - loadMoreView.noMore() - } + override fun observeLiveBus() { + viewModel.loadFinally.observe(viewLifecycleOwner, Observer { + refresh_recycler_view.stopLoading() + if (it) { + loadMoreView.startLoad() + } else { + loadMoreView.noMore() + } + }) } override fun readRss(rssArticle: RssArticle) { - viewModel.read(rssArticle) + activityViewModel.read(rssArticle) startActivity( Pair("title", rssArticle.title), Pair("origin", rssArticle.origin), diff --git a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesViewModel.kt index ccfff44df..3bcfc00ab 100644 --- a/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/article/RssArticlesViewModel.kt @@ -1,124 +1,85 @@ package io.legado.app.ui.rss.article import android.app.Application -import android.content.Intent +import android.os.Bundle import androidx.lifecycle.MutableLiveData import io.legado.app.App import io.legado.app.base.BaseViewModel import io.legado.app.data.entities.RssArticle -import io.legado.app.data.entities.RssReadRecord import io.legado.app.data.entities.RssSource import io.legado.app.model.Rss -import kotlinx.coroutines.Dispatchers.IO -import kotlinx.coroutines.Dispatchers.Main +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext - class RssArticlesViewModel(application: Application) : BaseViewModel(application) { - var callBack: CallBack? = null - var url: String? = null - var rssSource: RssSource? = null - val titleLiveData = MutableLiveData() + val loadFinally = MutableLiveData() var isLoading = true var order = System.currentTimeMillis() private var nextPageUrl: String? = null + private val articles = arrayListOf() + var sortName: String = "" + var sortUrl: String = "" - fun initData(intent: Intent, finally: () -> Unit) { - execute { - url = intent.getStringExtra("url") - url?.let { url -> - rssSource = App.db.rssSourceDao().getByKey(url) - rssSource?.let { - titleLiveData.postValue(it.sourceName) - } ?: let { - rssSource = RssSource(sourceUrl = url) - } - } - }.onFinally { - finally() + fun init(bundle: Bundle?) { + bundle?.let { + sortName = it.getString("sortName") ?: "" + sortUrl = it.getString("sortUrl") ?: "" } } - fun loadContent() { + + fun loadContent(rssSource: RssSource) { isLoading = true - rssSource?.let { rssSource -> - Rss.getArticles(rssSource, null) - .onSuccess(IO) { - nextPageUrl = it?.nextPageUrl - it?.articles?.let { list -> - list.forEach { rssArticle -> - rssArticle.order = order-- - } - App.db.rssArticleDao().insert(*list.toTypedArray()) - if (!rssSource.ruleNextPage.isNullOrEmpty()) { - App.db.rssArticleDao().clearOld(url!!, order) - withContext(Main) { - callBack?.loadFinally(true) - } - } else { - withContext(Main) { - callBack?.loadFinally(false) - } + Rss.getArticles(sortName, sortUrl, rssSource, null) + .onSuccess(Dispatchers.IO) { + nextPageUrl = it.nextPageUrl + it.articles.let { list -> + list.forEach { rssArticle -> + rssArticle.order = order-- + } + App.db.rssArticleDao().insert(*list.toTypedArray()) + if (!rssSource.ruleNextPage.isNullOrEmpty()) { + App.db.rssArticleDao().clearOld(rssSource.sourceUrl, sortName, order) + loadFinally.postValue(true) + } else { + withContext(Dispatchers.Main) { + loadFinally.postValue(false) } - isLoading = false - } - }.onError { - toast(it.localizedMessage) + isLoading = false } - } + }.onError { + toast(it.localizedMessage) + } } - fun loadMore() { + fun loadMore(rssSource: RssSource) { isLoading = true - val source = rssSource val pageUrl = nextPageUrl - if (source != null && !pageUrl.isNullOrEmpty()) { - Rss.getArticles(source, pageUrl) - .onSuccess(IO) { - nextPageUrl = it?.nextPageUrl - it?.articles?.let { list -> + if (!pageUrl.isNullOrEmpty()) { + Rss.getArticles(sortName, pageUrl, rssSource, pageUrl) + .onSuccess(Dispatchers.IO) { + nextPageUrl = it.nextPageUrl + it.articles.let { list -> if (list.isEmpty()) { - callBack?.loadFinally(false) + loadFinally.postValue(true) return@let } - callBack?.adapter?.getItems()?.let { adapterItems -> - if (adapterItems.contains(list.first())) { - callBack?.loadFinally(false) - } else { - list.forEach { rssArticle -> - rssArticle.order = order-- - } - App.db.rssArticleDao().insert(*list.toTypedArray()) + if (articles.contains(list.first())) { + loadFinally.postValue(false) + } else { + list.forEach { rssArticle -> + rssArticle.order = order-- } + App.db.rssArticleDao().insert(*list.toTypedArray()) } } isLoading = false } } else { - callBack?.loadFinally(false) - } - } - - fun read(rssArticle: RssArticle) { - execute { - App.db.rssArticleDao().insertRecord(RssReadRecord(rssArticle.link)) + loadFinally.postValue(false) } } - fun clearArticles() { - execute { - url?.let { - App.db.rssArticleDao().delete(it) - } - order = System.currentTimeMillis() - }.onSuccess { - loadContent() - } - } - interface CallBack { - var adapter: RssArticlesAdapter - fun loadFinally(hasMore: Boolean) - } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/rss/article/RssSortActivity.kt b/app/src/main/java/io/legado/app/ui/rss/article/RssSortActivity.kt new file mode 100644 index 000000000..2d45bcd70 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/rss/article/RssSortActivity.kt @@ -0,0 +1,100 @@ +package io.legado.app.ui.rss.article + +import android.app.Activity +import android.content.Intent +import android.os.Bundle +import android.view.Menu +import android.view.MenuItem +import androidx.fragment.app.Fragment +import androidx.fragment.app.FragmentManager +import androidx.fragment.app.FragmentStatePagerAdapter +import androidx.lifecycle.Observer +import io.legado.app.R +import io.legado.app.base.VMBaseActivity +import io.legado.app.ui.rss.source.edit.RssSourceEditActivity +import io.legado.app.utils.getViewModel +import io.legado.app.utils.gone +import io.legado.app.utils.visible +import kotlinx.android.synthetic.main.activity_rss_artivles.* +import org.jetbrains.anko.startActivityForResult + +class RssSortActivity : VMBaseActivity(R.layout.activity_rss_artivles) { + + override val viewModel: RssSortViewModel + get() = getViewModel(RssSortViewModel::class.java) + private val editSource = 12319 + private val fragments = linkedMapOf() + private lateinit var adapter: TabFragmentPageAdapter + + override fun onActivityCreated(savedInstanceState: Bundle?) { + adapter = TabFragmentPageAdapter(supportFragmentManager) + tab_layout.setupWithViewPager(view_pager) + view_pager.adapter = adapter + viewModel.titleLiveData.observe(this, Observer { + title_bar.title = it + }) + viewModel.initData(intent) { + upFragments() + } + } + + override fun onCompatCreateOptionsMenu(menu: Menu): Boolean { + menuInflater.inflate(R.menu.rss_articles, menu) + return super.onCompatCreateOptionsMenu(menu) + } + + override fun onCompatOptionsItemSelected(item: MenuItem): Boolean { + when (item.itemId) { + R.id.menu_edit_source -> viewModel.rssSource?.sourceUrl?.let { + startActivityForResult(editSource, Pair("data", it)) + } + R.id.menu_clear -> { + viewModel.url?.let { + viewModel.clearArticles() + } + } + } + return super.onCompatOptionsItemSelected(item) + } + + private fun upFragments() { + fragments.clear() + viewModel.rssSource?.sortUrls()?.forEach { + fragments[it.key] = RssArticlesFragment.create(it.key, it.value) + } + if (fragments.size == 1) { + tab_layout.gone() + } else { + tab_layout.visible() + } + adapter.notifyDataSetChanged() + } + + override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) { + super.onActivityResult(requestCode, resultCode, data) + when (requestCode) { + editSource -> if (resultCode == Activity.RESULT_OK) { + viewModel.initData(intent) { + upFragments() + } + } + } + } + + private inner class TabFragmentPageAdapter internal constructor(fm: FragmentManager) : + FragmentStatePagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) { + + override fun getPageTitle(position: Int): CharSequence? { + return fragments.keys.elementAt(position) + } + + override fun getItem(position: Int): Fragment { + return fragments.values.elementAt(position) + } + + override fun getCount(): Int { + return fragments.size + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/rss/article/RssSortViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/article/RssSortViewModel.kt new file mode 100644 index 000000000..4b1149f2e --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/rss/article/RssSortViewModel.kt @@ -0,0 +1,52 @@ +package io.legado.app.ui.rss.article + +import android.app.Application +import android.content.Intent +import androidx.lifecycle.MutableLiveData +import io.legado.app.App +import io.legado.app.base.BaseViewModel +import io.legado.app.data.entities.RssArticle +import io.legado.app.data.entities.RssReadRecord +import io.legado.app.data.entities.RssSource + + +class RssSortViewModel(application: Application) : BaseViewModel(application) { + var url: String? = null + var rssSource: RssSource? = null + val titleLiveData = MutableLiveData() + var order = System.currentTimeMillis() + + fun initData(intent: Intent, finally: () -> Unit) { + execute { + url = intent.getStringExtra("url") + url?.let { url -> + rssSource = App.db.rssSourceDao().getByKey(url) + rssSource?.let { + titleLiveData.postValue(it.sourceName) + } ?: let { + rssSource = RssSource(sourceUrl = url) + } + } + }.onFinally { + finally() + } + } + + fun read(rssArticle: RssArticle) { + execute { + App.db.rssArticleDao().insertRecord(RssReadRecord(rssArticle.link)) + } + } + + fun clearArticles() { + execute { + url?.let { + App.db.rssArticleDao().delete(it) + } + order = System.currentTimeMillis() + }.onSuccess { + + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt index 79ea599d1..e11293cc4 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssActivity.kt @@ -22,10 +22,9 @@ import org.apache.commons.text.StringEscapeUtils import org.jetbrains.anko.share import org.jetbrains.anko.toast import org.jsoup.Jsoup -import org.jsoup.safety.Whitelist -class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_read), +class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_read, false), FileChooserDialog.CallBack, ReadRssViewModel.CallBack { @@ -194,7 +193,7 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r } override fun upStarMenu() { - if (viewModel.star) { + if (viewModel.rssStar != null) { starMenuItem?.setIcon(R.drawable.ic_star) starMenuItem?.setTitle(R.string.in_favorites) } else { @@ -246,18 +245,16 @@ class ReadRssActivity : VMBaseActivity(R.layout.activity_rss_r @SuppressLint("SetJavaScriptEnabled") private fun readAloud() { - if (viewModel.textToSpeech.isSpeaking) { - viewModel.textToSpeech.stop() + if (viewModel.textToSpeech?.isSpeaking == true) { + viewModel.textToSpeech?.stop() upTtsMenu(false) } else { web_view.settings.javaScriptEnabled = true web_view.evaluateJavascript("document.documentElement.outerHTML") { val html = StringEscapeUtils.unescapeJson(it) - val text = Jsoup.clean(html, Whitelist.none()) - .replace(Regex("""&\w+;"""), "") - .trim()//朗读过程中总是听到一些杂音,清理一下 - //longToast(需读内容)调试一下 - viewModel.readAloud(text) + .replace("^\"|\"$".toRegex(), "") + Jsoup.parse(html).text() + viewModel.readAloud(Jsoup.parse(html).textArray()) } } } diff --git a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt index 6d90fd181..f5b84642f 100644 --- a/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/read/ReadRssViewModel.kt @@ -15,6 +15,7 @@ import io.legado.app.base.BaseViewModel import io.legado.app.constant.AppConst import io.legado.app.data.entities.RssArticle import io.legado.app.data.entities.RssSource +import io.legado.app.data.entities.RssStar import io.legado.app.help.http.HttpHelper import io.legado.app.model.Rss import io.legado.app.model.analyzeRule.AnalyzeUrl @@ -22,6 +23,7 @@ import io.legado.app.utils.DocumentUtils import io.legado.app.utils.FileUtils import io.legado.app.utils.isContentPath import io.legado.app.utils.writeBytes +import kotlinx.coroutines.Dispatchers.IO import kotlinx.coroutines.launch import java.io.File import java.util.* @@ -34,8 +36,10 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application), var rssArticle: RssArticle? = null val contentLiveData = MutableLiveData() val urlLiveData = MutableLiveData() - var star = false - var textToSpeech: TextToSpeech = TextToSpeech(context, this) + var rssStar: RssStar? = null + var textToSpeech: TextToSpeech? = null + private var ttsInitFinish = false + private var ttsTextList = arrayListOf() fun initData(intent: Intent) { execute { @@ -43,8 +47,8 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application), val link = intent.getStringExtra("link") if (origin != null && link != null) { rssSource = App.db.rssSourceDao().getByKey(origin) - star = App.db.rssStarDao().get(origin, link) != null - rssArticle = App.db.rssArticleDao().get(origin, link) + rssStar = App.db.rssStarDao().get(origin, link) + rssArticle = rssStar?.toRssArticle() ?: App.db.rssArticleDao().get(origin, link) rssArticle?.let { rssArticle -> if (!rssArticle.description.isNullOrBlank()) { contentLiveData.postValue(rssArticle.description) @@ -76,21 +80,26 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application), } private fun loadContent(rssArticle: RssArticle, ruleContent: String) { - Rss.getContent(rssArticle, ruleContent, this) - .onSuccess { - contentLiveData.postValue(it) + Rss.getContent(rssArticle, ruleContent, rssSource, this) + .onSuccess(IO) { body -> + rssArticle.description = body + App.db.rssArticleDao().insert(rssArticle) + rssStar?.let { + it.description = body + App.db.rssStarDao().insert(it) + } + contentLiveData.postValue(body) } } fun favorite() { execute { - rssArticle?.let { - if (star) { - App.db.rssStarDao().delete(it.origin, it.link) - } else { - App.db.rssStarDao().insert(it.toStar()) - } - star = !star + rssStar?.let { + App.db.rssStarDao().delete(it.origin, it.link) + rssStar = null + } ?: rssArticle?.toStar()?.let { + App.db.rssStarDao().insert(it) + rssStar = it } }.onSuccess { callBack?.upStarMenu() @@ -143,28 +152,43 @@ class ReadRssViewModel(application: Application) : BaseViewModel(application), } } + @Synchronized override fun onInit(status: Int) { - launch { - if (status == TextToSpeech.SUCCESS) { - textToSpeech.language = Locale.CHINA - textToSpeech.setOnUtteranceProgressListener(TTSUtteranceListener()) - } else { + if (status == TextToSpeech.SUCCESS) { + textToSpeech?.language = Locale.CHINA + textToSpeech?.setOnUtteranceProgressListener(TTSUtteranceListener()) + ttsInitFinish = true + play() + } else { + launch { toast(R.string.tts_init_failed) } } } - fun readAloud(text: String) { - textToSpeech.stop() - text.split("\n", " ", "  ").forEach { - textToSpeech.speak(it, TextToSpeech.QUEUE_ADD, null, "rss") + @Synchronized + private fun play() { + if (!ttsInitFinish) return + textToSpeech?.stop() + ttsTextList.forEach { + textToSpeech?.speak(it, TextToSpeech.QUEUE_ADD, null, "rss") + } + } + + fun readAloud(textArray: Array) { + ttsTextList.clear() + ttsTextList.addAll(textArray) + textToSpeech?.let { + play() + } ?: let { + textToSpeech = TextToSpeech(context, this) } } override fun onCleared() { super.onCleared() - textToSpeech.stop() - textToSpeech.shutdown() + textToSpeech?.stop() + textToSpeech?.shutdown() } /** diff --git a/app/src/main/java/io/legado/app/ui/rss/read/VisibleWebView.kt b/app/src/main/java/io/legado/app/ui/rss/read/VisibleWebView.kt new file mode 100644 index 000000000..0e6e1b40b --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/rss/read/VisibleWebView.kt @@ -0,0 +1,17 @@ +package io.legado.app.ui.rss.read + +import android.content.Context +import android.util.AttributeSet +import android.view.View +import android.webkit.WebView + +class VisibleWebView( + context: Context, + attrs: AttributeSet? = null +) : WebView(context, attrs) { + + override fun onWindowVisibilityChanged(visibility: Int) { + super.onWindowVisibilityChanged(View.VISIBLE) + } + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt index 944135b45..88059b955 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/edit/RssSourceEditActivity.kt @@ -135,6 +135,7 @@ class RssSourceEditActivity : add(EditEntity("sourceUrl", rssSource?.sourceUrl, R.string.source_url)) add(EditEntity("sourceIcon", rssSource?.sourceIcon, R.string.source_icon)) add(EditEntity("sourceGroup", rssSource?.sourceGroup, R.string.source_group)) + add(EditEntity("sortUrl", rssSource?.sortUrl, R.string.sort_url)) add(EditEntity("ruleArticles", rssSource?.ruleArticles, R.string.r_articles)) add(EditEntity("ruleNextPage", rssSource?.ruleNextPage, R.string.r_next)) add(EditEntity("ruleTitle", rssSource?.ruleTitle, R.string.r_title)) @@ -159,6 +160,7 @@ class RssSourceEditActivity : "sourceUrl" -> source.sourceUrl = it.value ?: "" "sourceIcon" -> source.sourceIcon = it.value ?: "" "sourceGroup" -> source.sourceGroup = it.value + "sortUrl" -> source.sortUrl = it.value "ruleArticles" -> source.ruleArticles = it.value "ruleNextPage" -> source.ruleNextPage = it.value "ruleTitle" -> source.ruleTitle = it.value diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt index 391281a4e..ce2313f5a 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/GroupManageDialog.kt @@ -22,11 +22,9 @@ import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.customView import io.legado.app.lib.dialogs.noButton import io.legado.app.lib.dialogs.yesButton +import io.legado.app.lib.theme.accentColor import io.legado.app.ui.widget.recycler.VerticalDivider -import io.legado.app.utils.applyTint -import io.legado.app.utils.getViewModelOfActivity -import io.legado.app.utils.requestInputMethod -import io.legado.app.utils.splitNotBlank +import io.legado.app.utils.* import kotlinx.android.synthetic.main.dialog_edit_text.view.* import kotlinx.android.synthetic.main.dialog_recycler_view.* import kotlinx.android.synthetic.main.item_group_manage.view.* @@ -66,6 +64,9 @@ class GroupManageDialog : DialogFragment(), Toolbar.OnMenuItemClickListener { recycler_view.layoutManager = LinearLayoutManager(requireContext()) recycler_view.addItemDecoration(VerticalDivider(requireContext())) recycler_view.adapter = adapter + tv_ok.setTextColor(requireContext().accentColor) + tv_ok.visible() + tv_ok.onClick { dismiss() } App.db.rssSourceDao().liveGroup().observe(viewLifecycleOwner, Observer { val groups = linkedSetOf() it.map { group -> diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt index fb54d0cae..1f7503e47 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceActivity.kt @@ -117,8 +117,15 @@ class RssSourceActivity : VMBaseActivity(R.layout.activity_r when (it.path) { "/importonline" -> it.getQueryParameter("src")?.let { url -> Snackbar.make(title_bar, R.string.importing, Snackbar.LENGTH_INDEFINITE).show() - viewModel.importSource(url) { msg -> - title_bar.snackbar(msg) + if (url.startsWith("http", false)){ + viewModel.importSource(url) { msg -> + title_bar.snackbar(msg) + } + } + else{ + viewModel.importSourceFromFilePath(url) { msg -> + title_bar.snackbar(msg) + } } } else -> { diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceAdapter.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceAdapter.kt index 165d9bd0c..72de1e250 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceAdapter.kt @@ -139,7 +139,7 @@ class RssSourceAdapter(context: Context, val callBack: CallBack) : private val movedItems = hashSetOf() - override fun clearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { + override fun onClearView(recyclerView: RecyclerView, viewHolder: RecyclerView.ViewHolder) { if (movedItems.isNotEmpty()) { callBack.update(*movedItems.toTypedArray()) movedItems.clear() diff --git a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceViewModel.kt b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceViewModel.kt index 9160155b3..42b354709 100644 --- a/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/rss/source/manage/RssSourceViewModel.kt @@ -1,6 +1,7 @@ package io.legado.app.ui.rss.source.manage import android.app.Application +import android.net.Uri import android.text.TextUtils import androidx.documentfile.provider.DocumentFile import com.jayway.jsonpath.JsonPath @@ -9,7 +10,6 @@ import io.legado.app.R import io.legado.app.base.BaseViewModel import io.legado.app.data.entities.RssSource import io.legado.app.help.http.HttpHelper -import io.legado.app.help.storage.Backup import io.legado.app.help.storage.Restore.jsonPath import io.legado.app.utils.* import org.jetbrains.anko.toast @@ -74,7 +74,7 @@ class RssSourceViewModel(application: Application) : BaseViewModel(application) FileUtils.createFileIfNotExist(file, "exportRssSource.json") .writeText(json) }.onSuccess { - context.toast("成功导出至\n${Backup.exportPath}") + context.toast("成功导出至\n${file.absolutePath}") }.onError { context.toast("导出失败\n${it.localizedMessage}") } @@ -87,7 +87,7 @@ class RssSourceViewModel(application: Application) : BaseViewModel(application) doc.createFile("", "exportRssSource.json") ?.writeText(context, json) }.onSuccess { - context.toast("成功导出至\n${Backup.exportPath}") + context.toast("成功导出至\n${doc.uri.path}") }.onError { context.toast("导出失败\n${it.localizedMessage}") } @@ -135,9 +135,21 @@ class RssSourceViewModel(application: Application) : BaseViewModel(application) fun importSourceFromFilePath(path: String, finally: (msg: String) -> Unit) { execute { - val file = File(path) - if (file.exists()) { - GSON.fromJsonArray(file.readText())?.let { + val content = if (path.isContentPath()) { + //在前面被解码了,如果不进行编码,中文会无法识别 + val newPath = Uri.encode(path, ":/.") + DocumentFile.fromSingleUri(context, Uri.parse(newPath))?.readText(context) + } else { + val file = File(path) + if (file.exists()) { + file.readText() + } else { + null + } + } + + if (null != content) { + GSON.fromJsonArray(content)?.let { App.db.rssSourceDao().insert(*it.toTypedArray()) } } @@ -187,12 +199,12 @@ class RssSourceViewModel(application: Application) : BaseViewModel(application) }.onError { finally(it.localizedMessage ?: "") }.onSuccess { - finally(it ?: "导入完成") + finally(it) } } private fun importSourceUrl(url: String): Int { - HttpHelper.simpleGet(url)?.let { body -> + HttpHelper.simpleGet(url, "UTF-8")?.let { body -> val sources = mutableListOf() val items: List> = jsonPath.parse(body).read("$") for (item in items) { diff --git a/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt b/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt index 5c84aa679..63455fc9a 100644 --- a/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt +++ b/app/src/main/java/io/legado/app/ui/welcome/WelcomeActivity.kt @@ -2,7 +2,7 @@ package io.legado.app.ui.welcome import android.content.Intent import android.os.Bundle -import com.github.houbb.opencc4j.util.ZhConverterUtil +import com.hankcs.hanlp.HanLP import io.legado.app.App import io.legado.app.R import io.legado.app.base.BaseActivity @@ -37,8 +37,8 @@ open class WelcomeActivity : BaseActivity(R.layout.activity_welcome) { .clearExpired(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(1)) //初始化简繁转换引擎 when (AppConfig.chineseConverterType) { - 1 -> ZhConverterUtil.toSimple("初始化") - 2 -> ZhConverterUtil.toTraditional("初始化") + 1 -> HanLP.convertToSimplifiedChinese("初始化") + 2 -> HanLP.convertToTraditionalChinese("初始化") else -> null } } @@ -48,7 +48,7 @@ open class WelcomeActivity : BaseActivity(R.layout.activity_welcome) { private fun startMainActivity() { startActivity() - if (getPrefBoolean(getString(R.string.pk_default_read))) { + if (getPrefBoolean(R.string.pk_default_read)) { startActivity() } finish() @@ -58,4 +58,7 @@ open class WelcomeActivity : BaseActivity(R.layout.activity_welcome) { class Launcher1 : WelcomeActivity() class Launcher2 : WelcomeActivity() -class Launcher3 : WelcomeActivity() \ No newline at end of file +class Launcher3 : WelcomeActivity() +class Launcher4 : WelcomeActivity() +class Launcher5 : WelcomeActivity() +class Launcher6 : WelcomeActivity() \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt b/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt index f11db64e8..eabfad602 100644 --- a/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt +++ b/app/src/main/java/io/legado/app/ui/widget/BatteryView.kt @@ -14,6 +14,7 @@ class BatteryView(context: Context, attrs: AttributeSet?) : AppCompatTextView(co private val batteryPaint = Paint() private val outFrame = Rect() private val polar = Rect() + var isBattery = false init { setPadding(4.dp, 0, 6.dp, 0) @@ -35,6 +36,7 @@ class BatteryView(context: Context, attrs: AttributeSet?) : AppCompatTextView(co override fun onDraw(canvas: Canvas) { super.onDraw(canvas) + if (!isBattery) return outFrame.set( 1.dp, layout.getLineTop(0) + 2.dp, diff --git a/app/src/main/java/io/legado/app/ui/widget/SearchView.kt b/app/src/main/java/io/legado/app/ui/widget/SearchView.kt new file mode 100644 index 000000000..765a0a580 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/widget/SearchView.kt @@ -0,0 +1,110 @@ +package io.legado.app.ui.widget + +import android.app.SearchableInfo +import android.content.Context +import android.graphics.Canvas +import android.graphics.Paint +import android.graphics.drawable.Drawable +import android.text.Spannable +import android.text.SpannableStringBuilder +import android.text.style.ImageSpan +import android.util.AttributeSet +import android.util.TypedValue +import android.view.Gravity +import android.widget.TextView +import androidx.appcompat.widget.SearchView +import io.legado.app.R + +class SearchView : SearchView { + private var mSearchHintIcon: Drawable? = null + private var textView: TextView? = null + + constructor( + context: Context?, + attrs: AttributeSet? = null + ) : super(context, attrs) + + constructor( + context: Context?, + attrs: AttributeSet?, + defStyleAttr: Int + ) : super(context, attrs, defStyleAttr) + + override fun onLayout( + changed: Boolean, + left: Int, + top: Int, + right: Int, + bottom: Int + ) { + super.onLayout(changed, left, top, right, bottom) + try { + if (textView == null) { + textView = findViewById(androidx.appcompat.R.id.search_src_text) + mSearchHintIcon = this.context.getDrawable(R.drawable.ic_search_hint) + updateQueryHint() + } + // 改变字体 + textView!!.setTextSize(TypedValue.COMPLEX_UNIT_SP, 14f) + textView!!.gravity = Gravity.CENTER_VERTICAL + } catch (e: Exception) { + e.printStackTrace() + } + } + + private fun getDecoratedHint(hintText: CharSequence): CharSequence { + // If the field is always expanded or we don't have a search hint icon, + // then don't add the search icon to the hint. + if (mSearchHintIcon == null) { + return hintText + } + val textSize = (textView!!.textSize * 0.8).toInt() + mSearchHintIcon!!.setBounds(0, 0, textSize, textSize) + val ssb = SpannableStringBuilder(" ") + ssb.setSpan(CenteredImageSpan(mSearchHintIcon), 1, 2, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE) + ssb.append(hintText) + return ssb + } + + private fun updateQueryHint() { + textView?.let { + it.hint = getDecoratedHint(queryHint ?: "") + } + } + + override fun setIconifiedByDefault(iconified: Boolean) { + super.setIconifiedByDefault(iconified) + updateQueryHint() + } + + override fun setSearchableInfo(searchable: SearchableInfo?) { + super.setSearchableInfo(searchable) + searchable?.let { + updateQueryHint() + } + } + + override fun setQueryHint(hint: CharSequence?) { + super.setQueryHint(hint) + updateQueryHint() + } + + internal class CenteredImageSpan(drawable: Drawable?) : ImageSpan(drawable!!) { + override fun draw( + canvas: Canvas, text: CharSequence, + start: Int, end: Int, x: Float, + top: Int, y: Int, bottom: Int, paint: Paint + ) { + // image to draw + val b = drawable + // font metrics of text to be replaced + val fm = paint.fontMetricsInt + val transY = ((y + fm.descent + y + fm.ascent) / 2 + - b.bounds.bottom / 2) + canvas.save() + canvas.translate(x, transY.toFloat()) + b.draw(canvas) + canvas.restore() + } + } +} diff --git a/app/src/main/java/io/legado/app/ui/widget/ShadowLayout.kt b/app/src/main/java/io/legado/app/ui/widget/ShadowLayout.kt new file mode 100644 index 000000000..0f6ad3200 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/widget/ShadowLayout.kt @@ -0,0 +1,185 @@ +package io.legado.app.ui.widget + +import android.content.Context +import android.graphics.Canvas +import android.graphics.Color +import android.graphics.Paint +import android.graphics.RectF +import android.util.AttributeSet +import android.view.View +import android.widget.RelativeLayout +import io.legado.app.R +import io.legado.app.utils.getCompatColor + +/** + * ShadowLayout.java + * + * + * Created by lijiankun on 17/8/11. + */ +class ShadowLayout( + context: Context, + attrs: AttributeSet? = null +) : RelativeLayout(context, attrs) { + private val mPaint = + Paint(Paint.ANTI_ALIAS_FLAG) + private val mRectF = RectF() + + /** + * 阴影的颜色 + */ + private var mShadowColor = Color.TRANSPARENT + + /** + * 阴影的大小范围 + */ + private var mShadowRadius = 0f + + /** + * 阴影 x 轴的偏移量 + */ + private var mShadowDx = 0f + + /** + * 阴影 y 轴的偏移量 + */ + private var mShadowDy = 0f + + /** + * 阴影显示的边界 + */ + private var mShadowSide = ALL + + /** + * 阴影的形状,圆形/矩形 + */ + private var mShadowShape = SHAPE_RECTANGLE + + + init { + setLayerType(View.LAYER_TYPE_SOFTWARE, null) // 关闭硬件加速 + setWillNotDraw(false) // 调用此方法后,才会执行 onDraw(Canvas) 方法 + val typedArray = + context.obtainStyledAttributes(attrs, R.styleable.ShadowLayout) + mShadowColor = typedArray.getColor( + R.styleable.ShadowLayout_shadowColor, + context.getCompatColor(android.R.color.black) + ) + mShadowRadius = + typedArray.getDimension(R.styleable.ShadowLayout_shadowRadius, dip2px(0f)) + mShadowDx = typedArray.getDimension(R.styleable.ShadowLayout_shadowDx, dip2px(0f)) + mShadowDy = typedArray.getDimension(R.styleable.ShadowLayout_shadowDy, dip2px(0f)) + mShadowSide = + typedArray.getInt(R.styleable.ShadowLayout_shadowSide, ALL) + mShadowShape = typedArray.getInt( + R.styleable.ShadowLayout_shadowShape, + SHAPE_RECTANGLE + ) + typedArray.recycle() + + setUpShadowPaint() + } + + override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { + super.onMeasure(widthMeasureSpec, heightMeasureSpec) + val effect = mShadowRadius + dip2px(5f) + var rectLeft = 0f + var rectTop = 0f + var rectRight = this.measuredWidth.toFloat() + var rectBottom = this.measuredHeight.toFloat() + var paddingLeft = 0 + var paddingTop = 0 + var paddingRight = 0 + var paddingBottom = 0 + this.width + if (mShadowSide and LEFT == LEFT) { + rectLeft = effect + paddingLeft = effect.toInt() + } + if (mShadowSide and TOP == TOP) { + rectTop = effect + paddingTop = effect.toInt() + } + if (mShadowSide and RIGHT == RIGHT) { + rectRight = this.measuredWidth - effect + paddingRight = effect.toInt() + } + if (mShadowSide and BOTTOM == BOTTOM) { + rectBottom = this.measuredHeight - effect + paddingBottom = effect.toInt() + } + if (mShadowDy != 0.0f) { + rectBottom -= mShadowDy + paddingBottom += mShadowDy.toInt() + } + if (mShadowDx != 0.0f) { + rectRight -= mShadowDx + paddingRight += mShadowDx.toInt() + } + mRectF.left = rectLeft + mRectF.top = rectTop + mRectF.right = rectRight + mRectF.bottom = rectBottom + setPadding(paddingLeft, paddingTop, paddingRight, paddingBottom) + } + + /** + * 真正绘制阴影的方法 + */ + override fun onDraw(canvas: Canvas) { + super.onDraw(canvas) + setUpShadowPaint() + if (mShadowShape == SHAPE_RECTANGLE) { + canvas.drawRect(mRectF, mPaint) + } else if (mShadowShape == SHAPE_OVAL) { + canvas.drawCircle( + mRectF.centerX(), + mRectF.centerY(), + mRectF.width().coerceAtMost(mRectF.height()) / 2, + mPaint + ) + } + } + + fun setShadowColor(shadowColor: Int) { + mShadowColor = shadowColor + requestLayout() + postInvalidate() + } + + fun setShadowRadius(shadowRadius: Float) { + mShadowRadius = shadowRadius + requestLayout() + postInvalidate() + } + + private fun setUpShadowPaint() { + mPaint.reset() + mPaint.isAntiAlias = true + mPaint.color = Color.TRANSPARENT + mPaint.setShadowLayer(mShadowRadius, mShadowDx, mShadowDy, mShadowColor) + } + + /** + * dip2px dp 值转 px 值 + * + * @param dpValue dp 值 + * @return px 值 + */ + private fun dip2px(dpValue: Float): Float { + val dm = context.resources.displayMetrics + val scale = dm.density + return dpValue * scale + 0.5f + } + + companion object { + const val ALL = 0x1111 + const val LEFT = 0x0001 + const val TOP = 0x0010 + const val RIGHT = 0x0100 + const val BOTTOM = 0x1000 + const val SHAPE_RECTANGLE = 0x0001 + const val SHAPE_OVAL = 0x0010 + } + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt b/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt index 10cd4191f..94d3b7be6 100644 --- a/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt +++ b/app/src/main/java/io/legado/app/ui/widget/TitleBar.kt @@ -2,6 +2,7 @@ package io.legado.app.ui.widget import android.content.Context import android.content.res.ColorStateList +import android.graphics.Color import android.util.AttributeSet import android.view.Menu import android.view.View @@ -142,7 +143,7 @@ class TitleBar(context: Context, attrs: AttributeSet?) : AppBarLayout(context, a } backgroundColor = context.primaryColor - // targetElevation = context.elevation + stateListAnimator = null elevation = if (AppConfig.elevation < 0) { context.elevation @@ -186,6 +187,11 @@ class TitleBar(context: Context, attrs: AttributeSet?) : AppBarLayout(context, a toolbar.setSubtitleTextAppearance(context, resId) } + fun transparent() { + elevation = 0f + backgroundColor = Color.TRANSPARENT + } + private fun attachToActivity() { if (attachToActivity) { activity?.let { diff --git a/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt b/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt index 01a55f2da..dc6ba868b 100644 --- a/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt +++ b/app/src/main/java/io/legado/app/ui/widget/dialog/TextDialog.kt @@ -5,29 +5,44 @@ import android.util.DisplayMetrics import android.view.LayoutInflater import android.view.View import android.view.ViewGroup -import androidx.fragment.app.DialogFragment import androidx.fragment.app.FragmentManager import io.legado.app.R +import io.legado.app.base.BaseDialogFragment import kotlinx.android.synthetic.main.dialog_text_view.* +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch import ru.noties.markwon.Markwon -class TextDialog : DialogFragment() { +class TextDialog : BaseDialogFragment() { companion object { const val MD = 1 - fun show(fragmentManager: FragmentManager, content: String?, mode: Int = 0) { + fun show( + fragmentManager: FragmentManager, + content: String?, + mode: Int = 0, + time: Long = 0, + autoClose: Boolean = false + ) { TextDialog().apply { val bundle = Bundle() bundle.putString("content", content) bundle.putInt("mode", mode) + bundle.putLong("time", time) arguments = bundle + isCancelable = false + this.autoClose = autoClose }.show(fragmentManager, "textDialog") } } + private var time = 0L + + private var autoClose: Boolean = false + override fun onStart() { super.onStart() val dm = DisplayMetrics() @@ -43,8 +58,7 @@ class TextDialog : DialogFragment() { return inflater.inflate(R.layout.dialog_text_view, container) } - override fun onViewCreated(view: View, savedInstanceState: Bundle?) { - super.onViewCreated(view, savedInstanceState) + override fun onFragmentCreated(view: View, savedInstanceState: Bundle?) { arguments?.let { val content = it.getString("content") ?: "" when (it.getInt("mode")) { @@ -57,8 +71,29 @@ class TextDialog : DialogFragment() { } else -> text_view.text = content } + time = it.getLong("time", 0L) + } + if (time > 0) { + badge_view.setBadgeCount((time / 1000).toInt()) + launch { + while (time > 0) { + delay(1000) + time -= 1000 + badge_view.setBadgeCount((time / 1000).toInt()) + if (time <= 0) { + view.post { + dialog?.setCancelable(true) + if (autoClose) dialog?.cancel() + } + } + } + } + } else { + view.post { + dialog?.setCancelable(true) + if (autoClose) dialog?.cancel() + } } - } } diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt index 6bea75a51..101b6678a 100644 --- a/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/ColorPreference.kt @@ -37,6 +37,8 @@ class ColorPreference(context: Context, attrs: AttributeSet) : Preference(contex init { isPersistent = true + layoutResource = io.legado.app.R.layout.view_preference + val a = context.obtainStyledAttributes(attrs, R.styleable.ColorPreference) showDialog = a.getBoolean(R.styleable.ColorPreference_cpv_showDialog, true) @@ -109,9 +111,12 @@ class ColorPreference(context: Context, attrs: AttributeSet) : Preference(contex } override fun onBindViewHolder(holder: PreferenceViewHolder) { + val v = io.legado.app.ui.widget.prefs.Preference.bindView(context, holder, icon, title, summary, widgetLayoutResource, + io.legado.app.R.id.cpv_preference_preview_color_panel, 30, 30) + if (v is ColorPanelView) { + v.color = color + } super.onBindViewHolder(holder) - val preview = holder.itemView.findViewById(R.id.cpv_preference_preview_color_panel) as ColorPanelView - preview.color = color } override fun onSetInitialValue(defaultValue: Any?) { diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/EditTextPreference.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/EditTextPreference.kt new file mode 100644 index 000000000..8c0e39da3 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/EditTextPreference.kt @@ -0,0 +1,21 @@ +package io.legado.app.ui.widget.prefs + +import android.content.Context +import android.util.AttributeSet +import android.widget.TextView +import androidx.preference.PreferenceViewHolder +import io.legado.app.R + +class EditTextPreference(context: Context, attrs: AttributeSet) : androidx.preference.EditTextPreference(context, attrs) { + + init { + // isPersistent = true + layoutResource = R.layout.view_preference + } + + override fun onBindViewHolder(holder: PreferenceViewHolder?) { + Preference.bindView(context, holder, icon, title, summary, null, null) + super.onBindViewHolder(holder) + } + +} diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt index b295e5ad3..fa8b4eeb7 100644 --- a/app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/IconListPreference.kt @@ -29,6 +29,7 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference private val mEntryDrawables = arrayListOf() init { + layoutResource = R.layout.view_preference widgetLayoutResource = R.layout.view_icon val a = context.theme.obtainStyledAttributes(attrs, R.styleable.IconListPreference, 0, 0) @@ -52,11 +53,12 @@ class IconListPreference(context: Context, attrs: AttributeSet) : ListPreference override fun onBindViewHolder(holder: PreferenceViewHolder?) { super.onBindViewHolder(holder) - holder?.itemView?.findViewById(R.id.preview)?.let { + val v = Preference.bindView(context, holder, icon, title, summary, widgetLayoutResource, R.id.preview, 50, 50) + if (v is ImageView) { val selectedIndex = findIndexOfValue(value) if (selectedIndex >= 0) { val drawable = mEntryDrawables[selectedIndex] - it.setImageDrawable(drawable) + v.setImageDrawable(drawable) } } } diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/NameListPreference.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/NameListPreference.kt index d8b51e90f..0763c8474 100644 --- a/app/src/main/java/io/legado/app/ui/widget/prefs/NameListPreference.kt +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/NameListPreference.kt @@ -11,12 +11,15 @@ import io.legado.app.R class NameListPreference(context: Context, attrs: AttributeSet) : ListPreference(context, attrs) { init { + layoutResource = R.layout.view_preference widgetLayoutResource = R.layout.item_fillet_text } override fun onBindViewHolder(holder: PreferenceViewHolder?) { + val v = Preference.bindView(context, holder, icon, title, summary, widgetLayoutResource, R.id.text_view) + if (v is TextView) { + v.text = entry + } super.onBindViewHolder(holder) - val textView = holder?.itemView?.findViewById(R.id.text_view) - textView?.text = entry } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/Preference.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/Preference.kt new file mode 100644 index 000000000..2ebb11344 --- /dev/null +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/Preference.kt @@ -0,0 +1,97 @@ +package io.legado.app.ui.widget.prefs + +import android.content.Context +import android.graphics.drawable.Drawable +import android.util.AttributeSet +import android.view.LayoutInflater +import android.view.View +import android.widget.FrameLayout +import android.widget.ImageView +import android.widget.TextView +import androidx.core.view.isVisible +import androidx.preference.PreferenceViewHolder +import io.legado.app.R +import io.legado.app.lib.theme.accentColor +import org.jetbrains.anko.layoutInflater +import kotlin.math.roundToInt + +class Preference(context: Context, attrs: AttributeSet) : + androidx.preference.Preference(context, attrs) { + + init { + // isPersistent = true + layoutResource = R.layout.view_preference + } + + companion object { + + fun bindView( + context: Context, + it: PreferenceViewHolder?, + icon: Drawable?, + title: CharSequence?, + summary: CharSequence?, + weightLayoutRes: Int?, + viewId: Int?, + weightWidth: Int = 0, + weightHeight: Int = 0 + ): T? { + if (it == null) return null + val view = it.findViewById(R.id.preference_title) + if (view is TextView) { + view.text = title + view.isVisible = title != null && title.isNotEmpty() + + val tvSummary = it.findViewById(R.id.preference_desc) + if (tvSummary is TextView) { + tvSummary.text = summary + tvSummary.isVisible = summary != null && summary.isNotEmpty() + } + + val iconView = it.findViewById(R.id.preference_icon) + if (iconView is ImageView) { + iconView.isVisible = icon != null && icon.isVisible + iconView.setImageDrawable(icon) + iconView.setColorFilter(context.accentColor) + } + } + + if (weightLayoutRes != null && weightLayoutRes != 0 && viewId != null && viewId != 0) { + val lay = it.findViewById(R.id.preference_widget) + if (lay is FrameLayout) { + var v = it.itemView.findViewById(viewId) + if (v == null) { + val inflater: LayoutInflater = context.layoutInflater + val childView = inflater.inflate(weightLayoutRes, null) + lay.removeAllViews() + lay.addView(childView) + lay.isVisible = true + v = lay.findViewById(viewId) + } + + if (weightWidth > 0 || weightHeight > 0) { + val lp = lay.layoutParams + if (weightHeight > 0) + lp.height = + (context.resources.displayMetrics.density * weightHeight).roundToInt() + if (weightWidth > 0) + lp.width = + (context.resources.displayMetrics.density * weightWidth).roundToInt() + lay.layoutParams = lp + } + + return v + } + } + + return null + } + + } + + override fun onBindViewHolder(holder: PreferenceViewHolder?) { + bindView(context, holder, icon, title, summary, null, null) + super.onBindViewHolder(holder) + } + +} diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/PreferenceCategory.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/PreferenceCategory.kt index e1458b76e..9cf6c2bfd 100644 --- a/app/src/main/java/io/legado/app/ui/widget/prefs/PreferenceCategory.kt +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/PreferenceCategory.kt @@ -2,21 +2,55 @@ package io.legado.app.ui.widget.prefs import android.content.Context import android.util.AttributeSet +import android.view.View import android.widget.TextView +import androidx.core.view.isVisible import androidx.preference.PreferenceCategory import androidx.preference.PreferenceViewHolder +import io.legado.app.R +import io.legado.app.help.AppConfig +import io.legado.app.lib.theme.ColorUtils import io.legado.app.lib.theme.accentColor +import io.legado.app.lib.theme.backgroundColor +import io.legado.app.utils.getCompatColor -class PreferenceCategory(context: Context, attrs: AttributeSet) : - PreferenceCategory(context, attrs) { +class PreferenceCategory(context: Context, attrs: AttributeSet) : PreferenceCategory(context, attrs) { + + init { + isPersistent = true + layoutResource = R.layout.view_preference_category + } override fun onBindViewHolder(holder: PreferenceViewHolder?) { super.onBindViewHolder(holder) holder?.let { - val view = it.findViewById(android.R.id.title) - if (view is TextView && !view.isInEditMode) { - view.setTextColor(context.accentColor)//设置title文本的颜色 + val view = it.findViewById(R.id.preference_title) + if (view is TextView) { // && !view.isInEditMode + view.text = title + if (view.isInEditMode) { + view.setTextColor(context.getCompatColor(R.color.colorAccent)) + } else { + view.setBackgroundColor(context.backgroundColor) + view.setTextColor(context.accentColor) + } + view.isVisible = title != null && title.isNotEmpty() + + val da = it.findViewById(R.id.preference_divider_above) + val dividerColor = if (AppConfig.isNightTheme) { + ColorUtils.shiftColor(context.backgroundColor, 1.05f) + } else { + ColorUtils.shiftColor(context.backgroundColor, 0.95f) + } + if (da is View) { + da.setBackgroundColor(dividerColor) + da.isVisible = it.isDividerAllowedAbove + } + val db = it.findViewById(R.id.preference_divider_below) + if (db is View) { + db.setBackgroundColor(dividerColor) + db.isVisible = it.isDividerAllowedBelow + } } } } diff --git a/app/src/main/java/io/legado/app/ui/widget/prefs/SwitchPreference.kt b/app/src/main/java/io/legado/app/ui/widget/prefs/SwitchPreference.kt index 4fe66af7b..2f6becfc2 100644 --- a/app/src/main/java/io/legado/app/ui/widget/prefs/SwitchPreference.kt +++ b/app/src/main/java/io/legado/app/ui/widget/prefs/SwitchPreference.kt @@ -12,14 +12,24 @@ import io.legado.app.lib.theme.accentColor class SwitchPreference(context: Context, attrs: AttributeSet) : SwitchPreferenceCompat(context, attrs) { + init { + layoutResource = R.layout.view_preference + } + override fun onBindViewHolder(holder: PreferenceViewHolder?) { - super.onBindViewHolder(holder) - holder?.let { - val view = it.findViewById(R.id.switchWidget) - if (view is SwitchCompat) { - ATH.setTint(view, context.accentColor) - } + val v = Preference.bindView( + context, + holder, + icon, + title, + summary, + widgetLayoutResource, + R.id.switchWidget + ) + if (v is SwitchCompat) { + ATH.setTint(v, context.accentColor) } + super.onBindViewHolder(holder) } } diff --git a/app/src/main/java/io/legado/app/utils/ConstraintUtil.kt b/app/src/main/java/io/legado/app/utils/ConstraintUtil.kt new file mode 100644 index 000000000..154cce984 --- /dev/null +++ b/app/src/main/java/io/legado/app/utils/ConstraintUtil.kt @@ -0,0 +1,266 @@ +package io.legado.app.utils + +import androidx.annotation.IdRes +import androidx.constraintlayout.widget.ConstraintLayout +import androidx.constraintlayout.widget.ConstraintSet +import androidx.transition.TransitionManager + + +class ConstraintUtil(val constraintLayout: ConstraintLayout) { + + private var begin: ConstraintBegin? = null + private val applyConstraintSet = ConstraintSet() + private val resetConstraintSet = ConstraintSet() + + init { + resetConstraintSet.clone(constraintLayout) + } + + /** + * 开始修改 + */ + fun begin(): ConstraintBegin? { + synchronized(ConstraintBegin::class.java) { + if (begin == null) { + begin = ConstraintBegin() + } + } + applyConstraintSet.clone(constraintLayout) + return begin + } + + /** + * 带动画的修改 + * @return + */ + fun beginWithAnim(): ConstraintBegin? { + TransitionManager.beginDelayedTransition(constraintLayout) + return begin() + } + + /** + * 重置 + */ + fun reSet() { + resetConstraintSet.applyTo(constraintLayout) + } + + /** + * 带动画的重置 + */ + fun reSetWidthAnim() { + TransitionManager.beginDelayedTransition(constraintLayout) + resetConstraintSet.applyTo(constraintLayout) + } + + inner class ConstraintBegin { + /** + * 清除关系

+ * 注意:这里不仅仅会清除关系,还会清除对应控件的宽高为 w:0,h:0 + * @param viewIds + * @return + */ + fun clear(@IdRes vararg viewIds: Int): ConstraintBegin { + for (viewId in viewIds) { + applyConstraintSet.clear(viewId) + } + return this + } + + /** + * 清除某个控件的,某个关系 + * @param viewId + * @param anchor + * @return + */ + fun clear(viewId: Int, anchor: Int): ConstraintBegin { + applyConstraintSet.clear(viewId, anchor) + return this + } + + /** + * 为某个控件设置 margin + * @param viewId 某个控件ID + * @param left marginLeft + * @param top marginTop + * @param right marginRight + * @param bottom marginBottom + * @return + */ + fun setMargin( + @IdRes viewId: Int, + left: Int, + top: Int, + right: Int, + bottom: Int + ): ConstraintBegin { + setMarginLeft(viewId, left) + setMarginTop(viewId, top) + setMarginRight(viewId, right) + setMarginBottom(viewId, bottom) + return this + } + + /** + * 为某个控件设置 marginLeft + * @param viewId 某个控件ID + * @param left marginLeft + * @return + */ + fun setMarginLeft(@IdRes viewId: Int, left: Int): ConstraintBegin { + applyConstraintSet.setMargin(viewId, ConstraintSet.LEFT, left) + return this + } + + /** + * 为某个控件设置 marginRight + * @param viewId 某个控件ID + * @param right marginRight + * @return + */ + fun setMarginRight(@IdRes viewId: Int, right: Int): ConstraintBegin { + applyConstraintSet.setMargin(viewId, ConstraintSet.RIGHT, right) + return this + } + + /** + * 为某个控件设置 marginTop + * @param viewId 某个控件ID + * @param top marginTop + * @return + */ + fun setMarginTop(@IdRes viewId: Int, top: Int): ConstraintBegin { + applyConstraintSet.setMargin(viewId, ConstraintSet.TOP, top) + return this + } + + /** + * 为某个控件设置marginBottom + * @param viewId 某个控件ID + * @param bottom marginBottom + * @return + */ + fun setMarginBottom(@IdRes viewId: Int, bottom: Int): ConstraintBegin { + applyConstraintSet.setMargin(viewId, ConstraintSet.BOTTOM, bottom) + return this + } + + /** + * 为某个控件设置关联关系 left_to_left_of + * @param startId + * @param endId + * @return + */ + fun Left_toLeftOf(@IdRes startId: Int, @IdRes endId: Int): ConstraintBegin { + applyConstraintSet.connect(startId, ConstraintSet.LEFT, endId, ConstraintSet.LEFT) + return this + } + + /** + * 为某个控件设置关联关系 left_to_right_of + * @param startId + * @param endId + * @return + */ + fun Left_toRightOf(@IdRes startId: Int, @IdRes endId: Int): ConstraintBegin { + applyConstraintSet.connect(startId, ConstraintSet.LEFT, endId, ConstraintSet.RIGHT) + return this + } + + /** + * 为某个控件设置关联关系 top_to_top_of + * @param startId + * @param endId + * @return + */ + fun Top_toTopOf(@IdRes startId: Int, @IdRes endId: Int): ConstraintBegin { + applyConstraintSet.connect(startId, ConstraintSet.TOP, endId, ConstraintSet.TOP) + return this + } + + /** + * 为某个控件设置关联关系 top_to_bottom_of + * @param startId + * @param endId + * @return + */ + fun Top_toBottomOf(@IdRes startId: Int, @IdRes endId: Int): ConstraintBegin { + applyConstraintSet.connect(startId, ConstraintSet.TOP, endId, ConstraintSet.BOTTOM) + return this + } + + /** + * 为某个控件设置关联关系 right_to_left_of + * @param startId + * @param endId + * @return + */ + fun Right_toLeftOf(@IdRes startId: Int, @IdRes endId: Int): ConstraintBegin { + applyConstraintSet.connect(startId, ConstraintSet.RIGHT, endId, ConstraintSet.LEFT) + return this + } + + /** + * 为某个控件设置关联关系 right_to_right_of + * @param startId + * @param endId + * @return + */ + fun Right_toRightOf(@IdRes startId: Int, @IdRes endId: Int): ConstraintBegin { + applyConstraintSet.connect(startId, ConstraintSet.RIGHT, endId, ConstraintSet.RIGHT) + return this + } + + /** + * 为某个控件设置关联关系 bottom_to_bottom_of + * @param startId + * @param endId + * @return + */ + fun Bottom_toBottomOf(@IdRes startId: Int, @IdRes endId: Int): ConstraintBegin { + applyConstraintSet.connect(startId, ConstraintSet.BOTTOM, endId, ConstraintSet.BOTTOM) + return this + } + + /** + * 为某个控件设置关联关系 bottom_to_top_of + * @param startId + * @param endId + * @return + */ + fun Bottom_toTopOf(@IdRes startId: Int, @IdRes endId: Int): ConstraintBegin { + applyConstraintSet.connect(startId, ConstraintSet.BOTTOM, endId, ConstraintSet.TOP) + return this + } + + /** + * 为某个控件设置宽度 + * @param viewId + * @param width + * @return + */ + fun setWidth(@IdRes viewId: Int, width: Int): ConstraintBegin { + applyConstraintSet.constrainWidth(viewId, width) + return this + } + + /** + * 某个控件设置高度 + * @param viewId + * @param height + * @return + */ + fun setHeight(@IdRes viewId: Int, height: Int): ConstraintBegin { + applyConstraintSet.constrainHeight(viewId, height) + return this + } + + /** + * 提交应用生效 + */ + fun commit() { + applyConstraintSet.applyTo(constraintLayout) + } + } + +} \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt index 3436c9d94..bc3f6f9fa 100644 --- a/app/src/main/java/io/legado/app/utils/ContextExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/ContextExtensions.kt @@ -12,6 +12,7 @@ import android.os.BatteryManager import android.provider.Settings import androidx.annotation.ColorRes import androidx.annotation.DrawableRes +import androidx.annotation.StringRes import androidx.core.content.ContextCompat import androidx.core.content.FileProvider import androidx.core.content.edit @@ -28,6 +29,9 @@ import java.io.FileOutputStream fun Context.getPrefBoolean(key: String, defValue: Boolean = false) = defaultSharedPreferences.getBoolean(key, defValue) +fun Context.getPrefBoolean(@StringRes keyId: Int, defValue: Boolean = false) = + defaultSharedPreferences.getBoolean(getString(keyId), defValue) + fun Context.putPrefBoolean(key: String, value: Boolean = false) = defaultSharedPreferences.edit { putBoolean(key, value) } @@ -46,6 +50,9 @@ fun Context.putPrefLong(key: String, value: Long) = fun Context.getPrefString(key: String, defValue: String? = null) = defaultSharedPreferences.getString(key, defValue) +fun Context.getPrefString(@StringRes keyId: Int, defValue: String? = null) = + defaultSharedPreferences.getString(getString(keyId), defValue) + fun Context.putPrefString(key: String, value: String) = defaultSharedPreferences.edit { putString(key, value) } diff --git a/app/src/main/java/io/legado/app/utils/DocumentUtils.kt b/app/src/main/java/io/legado/app/utils/DocumentUtils.kt index f4fd0e8eb..b53cebb14 100644 --- a/app/src/main/java/io/legado/app/utils/DocumentUtils.kt +++ b/app/src/main/java/io/legado/app/utils/DocumentUtils.kt @@ -98,7 +98,7 @@ object DocumentUtils { DocumentsContract.Document.COLUMN_LAST_MODIFIED, DocumentsContract.Document.COLUMN_SIZE, DocumentsContract.Document.COLUMN_MIME_TYPE - ), null, null, null + ), null, null, DocumentsContract.Document.COLUMN_DISPLAY_NAME ) c?.let { val ici = c.getColumnIndex(DocumentsContract.Document.COLUMN_DOCUMENT_ID) diff --git a/app/src/main/java/io/legado/app/utils/EncodingDetect.java b/app/src/main/java/io/legado/app/utils/EncodingDetect.java index 29174b88e..b5bd4cf66 100644 --- a/app/src/main/java/io/legado/app/utils/EncodingDetect.java +++ b/app/src/main/java/io/legado/app/utils/EncodingDetect.java @@ -66,7 +66,7 @@ public class EncodingDetect { } public static String getEncode(@NonNull byte[] bytes) { - int len = bytes.length > 2000 ? 2000 : bytes.length; + int len = Math.min(bytes.length, 2000); byte[] cBytes = new byte[len]; System.arraycopy(bytes, 0, cBytes, 0, len); BytesEncodingDetect bytesEncodingDetect = new BytesEncodingDetect(); @@ -1010,14 +1010,8 @@ class BytesEncodingDetect extends Encoding { column = rawtext[i + 1] + 256; if (column < 0x9f) { adjust = 1; - if (column > 0x7f) { - column -= 0x20; - } else { - column -= 0x19; - } } else { adjust = 0; - column -= 0x7e; } if (row < 0xa0) { row = ((row - 0x70) << 1) - adjust; diff --git a/app/src/main/java/io/legado/app/utils/GsonExtensions.kt b/app/src/main/java/io/legado/app/utils/GsonExtensions.kt index 13b105618..3f736abc5 100644 --- a/app/src/main/java/io/legado/app/utils/GsonExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/GsonExtensions.kt @@ -15,8 +15,7 @@ val GSON: Gson by lazy { .create() } -inline fun genericType() = object : TypeToken() {}.type - +inline fun genericType(): Type = object : TypeToken() {}.type @Throws(JsonSyntaxException::class) inline fun Gson.fromJsonObject(json: String?): T? {//可转成任意类型 diff --git a/app/src/main/java/io/legado/app/utils/JsoupExtensions.kt b/app/src/main/java/io/legado/app/utils/JsoupExtensions.kt new file mode 100644 index 000000000..3f347e4a1 --- /dev/null +++ b/app/src/main/java/io/legado/app/utils/JsoupExtensions.kt @@ -0,0 +1,66 @@ +package io.legado.app.utils + +import org.jsoup.internal.StringUtil +import org.jsoup.nodes.CDataNode +import org.jsoup.nodes.Element +import org.jsoup.nodes.Node +import org.jsoup.nodes.TextNode +import org.jsoup.select.NodeTraversor +import org.jsoup.select.NodeVisitor + + +fun Element.textArray(): Array { + val accum = StringUtil.borrowBuilder() + NodeTraversor.traverse(object : NodeVisitor { + override fun head(node: Node, depth: Int) { + if (node is TextNode) { + appendNormalisedText(accum, node) + } else if (node is Element) { + if (accum.isNotEmpty() && + (node.isBlock || node.tag().name == "br") && + !lastCharIsWhitespace(accum) + ) accum.append("\n") + } + } + + override fun tail(node: Node, depth: Int) { + if (node is Element) { + if (node.isBlock && node.nextSibling() is TextNode && !lastCharIsWhitespace( + accum + ) + ) accum.append("\n") + } + } + }, this) + val text = StringUtil.releaseBuilder(accum).trim { it <= ' ' } + return text.splitNotBlank("\n") +} + +private fun appendNormalisedText(accum: StringBuilder, textNode: TextNode) { + val text = textNode.wholeText + if (preserveWhitespace(textNode.parentNode()) || textNode is CDataNode) + accum.append(text) + else StringUtil.appendNormalisedWhitespace( + accum, + text, + lastCharIsWhitespace(accum) + ) +} + +private fun preserveWhitespace(node: Node?): Boolean { + if (node is Element) { + var el = node as Element? + var i = 0 + do { + if (el!!.tag().preserveWhitespace()) return true + el = el.parent() + i++ + } while (i < 6 && el != null) + } + return false +} + +private fun lastCharIsWhitespace(sb: java.lang.StringBuilder): Boolean { + return sb.isNotEmpty() && sb[sb.length - 1] == ' ' +} + diff --git a/app/src/main/java/io/legado/app/utils/NetworkUtils.kt b/app/src/main/java/io/legado/app/utils/NetworkUtils.kt index 0c59f05a3..b706a8d5e 100644 --- a/app/src/main/java/io/legado/app/utils/NetworkUtils.kt +++ b/app/src/main/java/io/legado/app/utils/NetworkUtils.kt @@ -11,9 +11,9 @@ import java.util.regex.Pattern @Suppress("unused") object NetworkUtils { fun getUrl(response: Response<*>): String { - val networkResponse = response.raw().networkResponse - return networkResponse?.request?.url?.toString() - ?: response.raw().request.url.toString() + val networkResponse = response.raw().networkResponse() + return networkResponse?.request()?.url()?.toString() + ?: response.raw().request().url().toString() } private val notNeedEncoding: BitSet by lazy { diff --git a/app/src/main/java/io/legado/app/utils/ViewExtensions.kt b/app/src/main/java/io/legado/app/utils/ViewExtensions.kt index f0334504e..e37539851 100644 --- a/app/src/main/java/io/legado/app/utils/ViewExtensions.kt +++ b/app/src/main/java/io/legado/app/utils/ViewExtensions.kt @@ -6,6 +6,7 @@ import android.graphics.Canvas import android.os.Build import android.view.View import android.view.View.* +import android.view.ViewGroup import android.view.inputmethod.InputMethodManager import android.widget.RadioGroup import android.widget.SeekBar @@ -75,6 +76,13 @@ fun View.screenshot(): Bitmap? { }.getOrNull() } +fun View.setMargin(left: Int, top: Int, right: Int, bottom: Int) { + if (layoutParams is ViewGroup.MarginLayoutParams) { + (layoutParams as ViewGroup.MarginLayoutParams).setMargins(left, top, right, bottom) + requestLayout() + } +} + fun SeekBar.progressAdd(int: Int) { progress += int } diff --git a/app/src/main/res/drawable-v24/ic_launcher_2.xml b/app/src/main/res/drawable-v24/ic_launcher_2.xml deleted file mode 100644 index b4343492c..000000000 --- a/app/src/main/res/drawable-v24/ic_launcher_2.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - diff --git a/app/src/main/res/drawable-v24/ic_launcher_2b.xml b/app/src/main/res/drawable-v24/ic_launcher_2b.xml deleted file mode 100644 index be66fb2a7..000000000 --- a/app/src/main/res/drawable-v24/ic_launcher_2b.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/app/src/main/res/drawable/bg_find_book_group.xml b/app/src/main/res/drawable/bg_find_book_group.xml new file mode 100644 index 000000000..b00a89b22 --- /dev/null +++ b/app/src/main/res/drawable/bg_find_book_group.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_prefs_color.xml b/app/src/main/res/drawable/bg_prefs_color.xml new file mode 100644 index 000000000..beb057eab --- /dev/null +++ b/app/src/main/res/drawable/bg_prefs_color.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/bg_searchview.xml b/app/src/main/res/drawable/bg_searchview.xml new file mode 100644 index 000000000..beee4af1e --- /dev/null +++ b/app/src/main/res/drawable/bg_searchview.xml @@ -0,0 +1,11 @@ + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_arrow_down.xml b/app/src/main/res/drawable/ic_arrow_down.xml new file mode 100644 index 000000000..19a41e8db --- /dev/null +++ b/app/src/main/res/drawable/ic_arrow_down.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_arrow_right.xml b/app/src/main/res/drawable/ic_arrow_right.xml new file mode 100644 index 000000000..72bcbdb79 --- /dev/null +++ b/app/src/main/res/drawable/ic_arrow_right.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_bottom_books.xml b/app/src/main/res/drawable/ic_bottom_books.xml new file mode 100644 index 000000000..807aaaf30 --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_books.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_bottom_books_e.xml b/app/src/main/res/drawable/ic_bottom_books_e.xml new file mode 100644 index 000000000..04d36c375 --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_books_e.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_bottom_books_s.xml b/app/src/main/res/drawable/ic_bottom_books_s.xml new file mode 100644 index 000000000..8f5f72542 --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_books_s.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_bottom_explore.xml b/app/src/main/res/drawable/ic_bottom_explore.xml new file mode 100644 index 000000000..439f69ba9 --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_explore.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_bottom_explore_e.xml b/app/src/main/res/drawable/ic_bottom_explore_e.xml new file mode 100644 index 000000000..47e4bde9d --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_explore_e.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_bottom_explore_s.xml b/app/src/main/res/drawable/ic_bottom_explore_s.xml new file mode 100644 index 000000000..6dc6e4322 --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_explore_s.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_bottom_person.xml b/app/src/main/res/drawable/ic_bottom_person.xml new file mode 100644 index 000000000..50053997a --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_person.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_bottom_person_e.xml b/app/src/main/res/drawable/ic_bottom_person_e.xml new file mode 100644 index 000000000..d01128391 --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_person_e.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_bottom_person_s.xml b/app/src/main/res/drawable/ic_bottom_person_s.xml new file mode 100644 index 000000000..3ff7fc8c4 --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_person_s.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_bottom_rss_feed.xml b/app/src/main/res/drawable/ic_bottom_rss_feed.xml new file mode 100644 index 000000000..4cd080b7f --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_rss_feed.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_bottom_rss_feed_e.xml b/app/src/main/res/drawable/ic_bottom_rss_feed_e.xml new file mode 100644 index 000000000..c1c4ba0e3 --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_rss_feed_e.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_bottom_rss_feed_s.xml b/app/src/main/res/drawable/ic_bottom_rss_feed_s.xml new file mode 100644 index 000000000..a73c01430 --- /dev/null +++ b/app/src/main/res/drawable/ic_bottom_rss_feed_s.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_cfg_about.xml b/app/src/main/res/drawable/ic_cfg_about.xml new file mode 100644 index 000000000..42e3d30d3 --- /dev/null +++ b/app/src/main/res/drawable/ic_cfg_about.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/app/src/main/res/drawable/ic_cfg_backup.xml b/app/src/main/res/drawable/ic_cfg_backup.xml new file mode 100644 index 000000000..9c647c009 --- /dev/null +++ b/app/src/main/res/drawable/ic_cfg_backup.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_cfg_e_lnk.xml b/app/src/main/res/drawable/ic_cfg_e_lnk.xml new file mode 100644 index 000000000..b94a8eb4d --- /dev/null +++ b/app/src/main/res/drawable/ic_cfg_e_lnk.xml @@ -0,0 +1,5 @@ + + + + diff --git a/app/src/main/res/drawable/ic_cfg_jz.xml b/app/src/main/res/drawable/ic_cfg_jz.xml new file mode 100644 index 000000000..710bae7fd --- /dev/null +++ b/app/src/main/res/drawable/ic_cfg_jz.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_cfg_other.xml b/app/src/main/res/drawable/ic_cfg_other.xml new file mode 100644 index 000000000..a3d26b642 --- /dev/null +++ b/app/src/main/res/drawable/ic_cfg_other.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_cfg_replace.xml b/app/src/main/res/drawable/ic_cfg_replace.xml new file mode 100644 index 000000000..53c9d1d04 --- /dev/null +++ b/app/src/main/res/drawable/ic_cfg_replace.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_cfg_source.xml b/app/src/main/res/drawable/ic_cfg_source.xml new file mode 100644 index 000000000..e71bb109d --- /dev/null +++ b/app/src/main/res/drawable/ic_cfg_source.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_cfg_theme.xml b/app/src/main/res/drawable/ic_cfg_theme.xml new file mode 100644 index 000000000..2fe949d19 --- /dev/null +++ b/app/src/main/res/drawable/ic_cfg_theme.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_cfg_web.xml b/app/src/main/res/drawable/ic_cfg_web.xml new file mode 100644 index 000000000..7a34ae004 --- /dev/null +++ b/app/src/main/res/drawable/ic_cfg_web.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_explore_black_24dp.xml b/app/src/main/res/drawable/ic_explore_black_24dp.xml deleted file mode 100644 index d841826b0..000000000 --- a/app/src/main/res/drawable/ic_explore_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_help.xml b/app/src/main/res/drawable/ic_help.xml new file mode 100644 index 000000000..32838437b --- /dev/null +++ b/app/src/main/res/drawable/ic_help.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_launch.xml b/app/src/main/res/drawable/ic_launch.xml deleted file mode 100644 index 6b423cdc7..000000000 --- a/app/src/main/res/drawable/ic_launch.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/app/src/main/res/drawable/ic_launcher1.xml b/app/src/main/res/drawable/ic_launcher1.xml new file mode 100644 index 000000000..18c829634 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher1.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher1_b.xml b/app/src/main/res/drawable/ic_launcher1_b.xml new file mode 100644 index 000000000..c5b40eb91 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher1_b.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable-v24/ic_launcher_1.xml b/app/src/main/res/drawable/ic_launcher2.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_launcher_1.xml rename to app/src/main/res/drawable/ic_launcher2.xml diff --git a/app/src/main/res/drawable-v24/ic_launcher_3.xml b/app/src/main/res/drawable/ic_launcher3.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_launcher_3.xml rename to app/src/main/res/drawable/ic_launcher3.xml diff --git a/app/src/main/res/drawable-v24/ic_launcher_0.xml b/app/src/main/res/drawable/ic_launcher4.xml similarity index 100% rename from app/src/main/res/drawable-v24/ic_launcher_0.xml rename to app/src/main/res/drawable/ic_launcher4.xml diff --git a/app/src/main/res/drawable/ic_launcher5.xml b/app/src/main/res/drawable/ic_launcher5.xml new file mode 100644 index 000000000..29435836b --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher5.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher5_b.xml b/app/src/main/res/drawable/ic_launcher5_b.xml new file mode 100644 index 000000000..9a5153369 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher5_b.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_launcher6.xml b/app/src/main/res/drawable/ic_launcher6.xml new file mode 100644 index 000000000..1bb711f8f --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher6.xml @@ -0,0 +1,18 @@ + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher7.xml b/app/src/main/res/drawable/ic_launcher7.xml new file mode 100644 index 000000000..983784aef --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher7.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/drawable/ic_launcher7_b.xml b/app/src/main/res/drawable/ic_launcher7_b.xml new file mode 100644 index 000000000..76214f1e4 --- /dev/null +++ b/app/src/main/res/drawable/ic_launcher7_b.xml @@ -0,0 +1,12 @@ + + + + diff --git a/app/src/main/res/drawable/ic_library_books_black_24dp.xml b/app/src/main/res/drawable/ic_library_books_black_24dp.xml deleted file mode 100644 index 06deda209..000000000 --- a/app/src/main/res/drawable/ic_library_books_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_live_help_black_24dp.xml b/app/src/main/res/drawable/ic_live_help_black_24dp.xml deleted file mode 100644 index 8b9c1ac46..000000000 --- a/app/src/main/res/drawable/ic_live_help_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_person_black_24dp.xml b/app/src/main/res/drawable/ic_person_black_24dp.xml deleted file mode 100644 index 9f1acc792..000000000 --- a/app/src/main/res/drawable/ic_person_black_24dp.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - diff --git a/app/src/main/res/drawable/ic_rss_feed.xml b/app/src/main/res/drawable/ic_rss_feed.xml deleted file mode 100644 index ed6228cc2..000000000 --- a/app/src/main/res/drawable/ic_rss_feed.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - diff --git a/app/src/main/res/drawable/ic_search_hint.xml b/app/src/main/res/drawable/ic_search_hint.xml new file mode 100644 index 000000000..42de64c26 --- /dev/null +++ b/app/src/main/res/drawable/ic_search_hint.xml @@ -0,0 +1,8 @@ + + + + diff --git a/app/src/main/res/drawable/shape_fillet_btn.xml b/app/src/main/res/drawable/shape_fillet_btn.xml index 10dac7541..83ccf2776 100644 --- a/app/src/main/res/drawable/shape_fillet_btn.xml +++ b/app/src/main/res/drawable/shape_fillet_btn.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/app/src/main/res/drawable/shape_fillet_btn_press.xml b/app/src/main/res/drawable/shape_fillet_btn_press.xml index b569081a4..b0c46f6f5 100644 --- a/app/src/main/res/drawable/shape_fillet_btn_press.xml +++ b/app/src/main/res/drawable/shape_fillet_btn_press.xml @@ -1,6 +1,6 @@ - + \ No newline at end of file diff --git a/app/src/main/res/layout-land/activity_book_info.xml b/app/src/main/res/layout-land/activity_book_info.xml index 27e0bec0d..518501721 100644 --- a/app/src/main/res/layout-land/activity_book_info.xml +++ b/app/src/main/res/layout-land/activity_book_info.xml @@ -14,13 +14,10 @@ android:contentDescription="@string/bg_image" app:layout_constraintTop_toTopOf="parent" /> - @@ -81,7 +78,8 @@ android:paddingLeft="10dp" android:paddingTop="8dp" android:paddingRight="16dp" - android:paddingBottom="3dp"> + android:paddingBottom="3dp" + tools:ignore="RtlHardcoded"> + android:scrollbars="vertical" + tools:ignore="NestedWeights"> + tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" /> + tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" /> @@ -290,7 +288,7 @@ android:text="@string/group_s" android:textColor="@color/tv_text_summary" android:textSize="13sp" - tools:ignore="NestedWeights" /> + tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" /> + tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" /> + android:visibility="visible" + tools:ignore="RtlHardcoded,RtlSymmetry" /> @@ -373,7 +372,7 @@ android:layout_marginBottom="1px" android:layout_width="match_parent" android:layout_height="8dp" - android:background="@color/background">
+ android:background="@color/background" /> - + app:layout_constraintTop_toBottomOf="@+id/title_bar" /> - @@ -158,7 +155,7 @@ android:text="@string/author" android:textColor="@color/tv_text_summary" android:textSize="13sp" - tools:ignore="NestedWeights" /> + tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" /> @@ -192,7 +189,7 @@ android:text="@string/origin_format" android:textColor="@color/tv_text_summary" android:textSize="13sp" - tools:ignore="NestedWeights" /> + tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" /> + tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" /> @@ -270,7 +267,7 @@ android:text="@string/group_s" android:textColor="@color/tv_text_summary" android:textSize="13sp" - tools:ignore="NestedWeights" /> + tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" /> + tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" /> + android:visibility="visible" + tools:ignore="RtlHardcoded,RtlSymmetry" /> @@ -352,7 +350,7 @@ + android:background="@color/background" /> + + + + + diff --git a/app/src/main/res/layout/activity_import_book.xml b/app/src/main/res/layout/activity_import_book.xml index 092290eb2..38d0b4f55 100644 --- a/app/src/main/res/layout/activity_import_book.xml +++ b/app/src/main/res/layout/activity_import_book.xml @@ -1,20 +1,23 @@ - - + android:layout_weight="1" /> - + + + + + android:layout_height="wrap_content"> + - + - + - - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 9f2d2044e..701dea9b5 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -7,10 +7,10 @@ diff --git a/app/src/main/res/layout/activity_rss_artivles.xml b/app/src/main/res/layout/activity_rss_artivles.xml index 39678114e..50e503a9e 100644 --- a/app/src/main/res/layout/activity_rss_artivles.xml +++ b/app/src/main/res/layout/activity_rss_artivles.xml @@ -1,28 +1,24 @@ - + android:layout_height="wrap_content" /> - - - + android:layout_height="wrap_content" + app:tabMode="scrollable" /> - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/activity_rss_read.xml b/app/src/main/res/layout/activity_rss_read.xml index 76f630002..6eb28b4f8 100644 --- a/app/src/main/res/layout/activity_rss_read.xml +++ b/app/src/main/res/layout/activity_rss_read.xml @@ -2,6 +2,7 @@ + android:layout_height="wrap_content" + app:fitStatusBar="false" /> - diff --git a/app/src/main/res/layout/dialog_read_aloud.xml b/app/src/main/res/layout/dialog_read_aloud.xml index 627bd9414..504865171 100644 --- a/app/src/main/res/layout/dialog_read_aloud.xml +++ b/app/src/main/res/layout/dialog_read_aloud.xml @@ -1,245 +1,337 @@ + android:layout_height="wrap_content" + android:gravity="center" + android:orientation="horizontal"> - + + - - + + + + + + - + + + + + + - + android:layout_weight="1" + android:max="60" /> - + - + - - + android:layout_gravity="center_vertical" + android:orientation="horizontal" + android:padding="8dp"> - - - - - - - - - - - - - + android:layout_height="wrap_content" + android:layout_gravity="center" + android:layout_weight="1" + android:text="@string/read_aloud_speed" + android:textColor="@color/tv_text_default" + android:textSize="14sp" /> + + - + android:layout_marginStart="15dp" + android:layout_marginEnd="15dp" + android:max="45" /> + + + + + + + - - + android:contentDescription="@string/chapter_list" + android:src="@drawable/ic_toc" + app:tint="@color/tv_text_default" + tools:ignore="NestedWeights" /> - + android:layout_gravity="center_horizontal" + android:layout_marginTop="3dp" + android:text="@string/chapter_list" + android:maxLines="1" + android:textColor="@color/tv_text_default" + android:textSize="12sp" /> + android:layout_width="0dp" + android:layout_height="match_parent" + android:layout_weight="2" /> + + + + + + + + + + android:id="@+id/ll_to_backstage" + android:layout_width="50dp" + android:layout_height="50dp" + android:background="?android:attr/selectableItemBackgroundBorderless" + android:clickable="true" + android:contentDescription="@string/interface_setting" + android:focusable="true" + android:orientation="vertical" + android:paddingBottom="7dp"> - + + - - - - - - - - + + + + + + + + android:layout_height="0dp" + android:layout_weight="1" + android:contentDescription="@string/aloud_config" + android:src="@drawable/ic_settings" + app:tint="@color/tv_text_default" + tools:ignore="NestedWeights" /> + diff --git a/app/src/main/res/layout/dialog_read_book_style.xml b/app/src/main/res/layout/dialog_read_book_style.xml index 4adff8b72..9436e0f0a 100644 --- a/app/src/main/res/layout/dialog_read_book_style.xml +++ b/app/src/main/res/layout/dialog_read_book_style.xml @@ -121,6 +121,24 @@ android:textSize="14sp" app:radius="3dp" /> + + + + @@ -14,6 +15,27 @@ android:id="@+id/recycler_view" android:background="@color/background_card" android:layout_width="match_parent" - android:layout_height="match_parent" /> + android:layout_height="0dp" + android:layout_weight="1" /> + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_text_view.xml b/app/src/main/res/layout/dialog_text_view.xml index 3a2b347c3..c1a1a70a6 100644 --- a/app/src/main/res/layout/dialog_text_view.xml +++ b/app/src/main/res/layout/dialog_text_view.xml @@ -1,7 +1,25 @@ - + xmlns:app="http://schemas.android.com/apk/res-auto"> + + + + + + + + diff --git a/app/src/main/res/layout/dialog_tip_config.xml b/app/src/main/res/layout/dialog_tip_config.xml new file mode 100644 index 000000000..9ef889a05 --- /dev/null +++ b/app/src/main/res/layout/dialog_tip_config.xml @@ -0,0 +1,125 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_bookshelf.xml b/app/src/main/res/layout/fragment_bookshelf.xml index 2eb390c9a..ea0a9ab40 100644 --- a/app/src/main/res/layout/fragment_bookshelf.xml +++ b/app/src/main/res/layout/fragment_bookshelf.xml @@ -14,7 +14,7 @@ app:contentLayout="@layout/view_tab_layout_min" app:layout_constraintTop_toTopOf="parent" /> - + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_arrange_book.xml b/app/src/main/res/layout/item_arrange_book.xml index 0ce5072d6..4fdd7a19c 100644 --- a/app/src/main/res/layout/item_arrange_book.xml +++ b/app/src/main/res/layout/item_arrange_book.xml @@ -19,26 +19,43 @@ + app:layout_constraintBottom_toTopOf="@id/tv_group_s" + app:layout_constraintLeft_toRightOf="@id/checkbox" /> + + @@ -49,7 +66,7 @@ android:background="?attr/selectableItemBackgroundBorderless" android:padding="10dp" android:text="@string/group" - app:layout_constraintTop_toTopOf="parent" + app:layout_constraintTop_toBottomOf="@id/tv_author" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toLeftOf="@+id/tv_delete" /> @@ -60,7 +77,7 @@ android:background="?attr/selectableItemBackgroundBorderless" android:padding="10dp" android:text="@string/delete" - app:layout_constraintTop_toTopOf="parent" + app:layout_constraintTop_toBottomOf="@id/tv_author" app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintRight_toRightOf="parent" /> diff --git a/app/src/main/res/layout/item_bookshelf_grid.xml b/app/src/main/res/layout/item_bookshelf_grid.xml index 666d67098..50bb20d12 100644 --- a/app/src/main/res/layout/item_bookshelf_grid.xml +++ b/app/src/main/res/layout/item_bookshelf_grid.xml @@ -4,77 +4,76 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:padding="16dp" - android:clickable="true" - android:focusable="true" - tools:ignore="UnusedAttribute"> + android:paddingTop="2dp" + android:paddingRight="10dp" + android:paddingLeft="10dp"> - + app:shadowColor="#16000000" + app:shadowShape="rectangle" + app:shadowDx="1dp" + app:shadowDy="3dp" + app:shadowRadius="4dp" + app:shadowSide="all"> - - - + android:scaleType="centerCrop" + android:src="@drawable/image_cover_default" + android:transitionName="img_cover" + tools:ignore="UnusedAttribute" /> - - + + + \ No newline at end of file diff --git a/app/src/main/res/layout/item_fillet_text.xml b/app/src/main/res/layout/item_fillet_text.xml index 331bd8a2c..dcdf75935 100644 --- a/app/src/main/res/layout/item_fillet_text.xml +++ b/app/src/main/res/layout/item_fillet_text.xml @@ -8,7 +8,10 @@ android:background="@drawable/selector_fillet_btn_bg" android:ellipsize="end" android:gravity="center" - android:padding="5dp" + android:paddingTop="4dp" + android:paddingBottom="4dp" + android:paddingLeft="12dp" + android:paddingRight="12dp" android:maxLines="1" android:textColor="@color/tv_text_default" android:textSize="14sp" diff --git a/app/src/main/res/layout/item_find_book.xml b/app/src/main/res/layout/item_find_book.xml index 8a95ed1e2..d689630d2 100644 --- a/app/src/main/res/layout/item_find_book.xml +++ b/app/src/main/res/layout/item_find_book.xml @@ -4,8 +4,6 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="wrap_content" - android:paddingLeft="10dp" - android:paddingRight="10dp" android:gravity="center" android:orientation="vertical"> @@ -17,8 +15,7 @@ android:paddingRight="10dp" android:paddingTop="6dp" android:paddingBottom="6dp" - android:layout_margin="4dp" - android:background="@color/btn_bg_press" + android:background="@drawable/bg_find_book_group" android:orientation="horizontal" android:gravity="center_vertical"> @@ -28,11 +25,22 @@ android:layout_height="wrap_content" android:layout_weight="1" /> + + @@ -41,6 +49,8 @@ - - \ No newline at end of file diff --git a/app/src/main/res/layout/item_text.xml b/app/src/main/res/layout/item_text.xml index e37188e47..357efdde3 100644 --- a/app/src/main/res/layout/item_text.xml +++ b/app/src/main/res/layout/item_text.xml @@ -9,6 +9,7 @@ android:gravity="center" android:padding="5dp" android:maxLines="1" + android:scrollbars="none" android:textColor="@color/tv_text_default" android:textSize="14sp" tools:ignore="UnusedAttribute" /> diff --git a/app/src/main/res/layout/popup_action_menu.xml b/app/src/main/res/layout/popup_action_menu.xml index c6b9067d7..0f6b6e0e5 100644 --- a/app/src/main/res/layout/popup_action_menu.xml +++ b/app/src/main/res/layout/popup_action_menu.xml @@ -1,27 +1,46 @@ - + android:orientation="vertical"> - + android:orientation="horizontal" + android:gravity="center_vertical"> + + + + + + - + android:orientation="vertical" + app:layoutManager="androidx.recyclerview.widget.LinearLayoutManager" /> - + diff --git a/app/src/main/res/layout/view_book_page.xml b/app/src/main/res/layout/view_book_page.xml index 922819b1e..ec591bc6f 100644 --- a/app/src/main/res/layout/view_book_page.xml +++ b/app/src/main/res/layout/view_book_page.xml @@ -1,34 +1,61 @@ - - + + + android:gravity="center_vertical"> - + + + android:maxLines="1" + android:ellipsize="end" + android:textSize="12sp" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - - + - + android:gravity="center_vertical"> - + android:maxLines="1" + android:ellipsize="end" + android:textSize="12sp" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - + android:maxLines="1" + android:ellipsize="end" + android:visibility="gone" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintLeft_toLeftOf="parent" + app:layout_constraintRight_toRightOf="parent" + app:layout_constraintTop_toTopOf="parent" /> - + - \ No newline at end of file + \ No newline at end of file diff --git a/app/src/main/res/layout/view_preference.xml b/app/src/main/res/layout/view_preference.xml new file mode 100644 index 000000000..87b10ef5b --- /dev/null +++ b/app/src/main/res/layout/view_preference.xml @@ -0,0 +1,65 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/view_preference_category.xml b/app/src/main/res/layout/view_preference_category.xml new file mode 100644 index 000000000..72cf9b5ca --- /dev/null +++ b/app/src/main/res/layout/view_preference_category.xml @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/view_read_menu.xml b/app/src/main/res/layout/view_read_menu.xml index 135f5b5d9..3754c0914 100644 --- a/app/src/main/res/layout/view_read_menu.xml +++ b/app/src/main/res/layout/view_read_menu.xml @@ -210,7 +210,7 @@ diff --git a/app/src/main/res/layout/view_search.xml b/app/src/main/res/layout/view_search.xml index 5fd67be63..96ff311da 100644 --- a/app/src/main/res/layout/view_search.xml +++ b/app/src/main/res/layout/view_search.xml @@ -1,10 +1,17 @@ - \ No newline at end of file diff --git a/app/src/main/res/layout/view_select_action_bar.xml b/app/src/main/res/layout/view_select_action_bar.xml index e725a57b7..2e8d733ab 100644 --- a/app/src/main/res/layout/view_select_action_bar.xml +++ b/app/src/main/res/layout/view_select_action_bar.xml @@ -5,11 +5,11 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:paddingLeft="16dp" - android:paddingRight="16dp" + android:paddingRight="8dp" android:paddingTop="6dp" android:paddingBottom="6dp" android:gravity="center_vertical" - android:elevation="2dp"> + android:elevation="2dp" > - + - + - + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/menu/change_cover.xml b/app/src/main/res/menu/change_cover.xml index cce382d12..bf7d0d51b 100644 --- a/app/src/main/res/menu/change_cover.xml +++ b/app/src/main/res/menu/change_cover.xml @@ -6,7 +6,7 @@ diff --git a/app/src/main/res/menu/change_source.xml b/app/src/main/res/menu/change_source.xml index 36f9bee6e..ab2bfee4c 100644 --- a/app/src/main/res/menu/change_source.xml +++ b/app/src/main/res/menu/change_source.xml @@ -14,7 +14,7 @@ diff --git a/app/src/main/res/menu/content_select_action.xml b/app/src/main/res/menu/content_select_action.xml index d11ee6154..ff83efd96 100644 --- a/app/src/main/res/menu/content_select_action.xml +++ b/app/src/main/res/menu/content_select_action.xml @@ -9,6 +9,10 @@ android:id="@+id/menu_copy" android:title="@android:string/copy" /> + + diff --git a/app/src/main/res/menu/main_bnv.xml b/app/src/main/res/menu/main_bnv.xml index fb34daff3..9197bec7b 100644 --- a/app/src/main/res/menu/main_bnv.xml +++ b/app/src/main/res/menu/main_bnv.xml @@ -4,20 +4,20 @@ tools:showIn="bottom_navigation_view"> + android:id="@+id/menu_bookshelf" + android:icon="@drawable/ic_bottom_books" + android:title="@string/bookshelf" /> + android:id="@+id/menu_find_book" + android:icon="@drawable/ic_bottom_explore" + android:title="@string/find" /> + android:id="@+id/menu_my_config" + android:icon="@drawable/ic_bottom_person" + android:title="@string/my" /> diff --git a/app/src/main/res/menu/main_my.xml b/app/src/main/res/menu/main_my.xml index db1161c28..02b6acbd0 100644 --- a/app/src/main/res/menu/main_my.xml +++ b/app/src/main/res/menu/main_my.xml @@ -6,20 +6,8 @@ - - - - diff --git a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml index e8409cf31..7a68d4392 100644 --- a/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml +++ b/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher1.xml b/app/src/main/res/mipmap-anydpi-v26/launcher1.xml index 57e845ad3..b3aa68018 100644 --- a/app/src/main/res/mipmap-anydpi-v26/launcher1.xml +++ b/app/src/main/res/mipmap-anydpi-v26/launcher1.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher2.xml b/app/src/main/res/mipmap-anydpi-v26/launcher2.xml index 409e0d965..5de236bd2 100644 --- a/app/src/main/res/mipmap-anydpi-v26/launcher2.xml +++ b/app/src/main/res/mipmap-anydpi-v26/launcher2.xml @@ -1,5 +1,5 @@ - - + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher3.xml b/app/src/main/res/mipmap-anydpi-v26/launcher3.xml index 24428243f..9e7ef6711 100644 --- a/app/src/main/res/mipmap-anydpi-v26/launcher3.xml +++ b/app/src/main/res/mipmap-anydpi-v26/launcher3.xml @@ -1,5 +1,5 @@ - + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher4.xml b/app/src/main/res/mipmap-anydpi-v26/launcher4.xml new file mode 100644 index 000000000..63e51b918 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/launcher4.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher5.xml b/app/src/main/res/mipmap-anydpi-v26/launcher5.xml new file mode 100644 index 000000000..7a23c7c66 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/launcher5.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-anydpi-v26/launcher6.xml b/app/src/main/res/mipmap-anydpi-v26/launcher6.xml new file mode 100644 index 000000000..4ba689a93 --- /dev/null +++ b/app/src/main/res/mipmap-anydpi-v26/launcher6.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/app/src/main/res/mipmap-hdpi/ic_launcher.png b/app/src/main/res/mipmap-hdpi/ic_launcher.png index a7e087bc8..d2c418293 100644 Binary files a/app/src/main/res/mipmap-hdpi/ic_launcher.png and b/app/src/main/res/mipmap-hdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-mdpi/ic_launcher.png b/app/src/main/res/mipmap-mdpi/ic_launcher.png index f0e9ad532..2d18ac346 100644 Binary files a/app/src/main/res/mipmap-mdpi/ic_launcher.png and b/app/src/main/res/mipmap-mdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/app/src/main/res/mipmap-xhdpi/ic_launcher.png index 371e045cd..4b44e0bba 100644 Binary files a/app/src/main/res/mipmap-xhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png index feff4e965..df9bfebb8 100644 Binary files a/app/src/main/res/mipmap-xxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png index 63cb54502..6d101d806 100644 Binary files a/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png and b/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png differ diff --git a/app/src/main/res/values-night/colors.xml b/app/src/main/res/values-night/colors.xml index 18ab012e0..c7eb91ae9 100644 --- a/app/src/main/res/values-night/colors.xml +++ b/app/src/main/res/values-night/colors.xml @@ -7,9 +7,11 @@ @color/md_grey_900 @color/md_grey_850 @color/md_grey_800 + #AA111111 #69000000 + #10ffffff #30ffffff #363636 diff --git a/app/src/main/res/values-zh-rHK/arrays.xml b/app/src/main/res/values-zh-rHK/arrays.xml new file mode 100644 index 000000000..ebe6c25dd --- /dev/null +++ b/app/src/main/res/values-zh-rHK/arrays.xml @@ -0,0 +1,52 @@ + + + + + 度小美 + 度小宇 + 度逍遙 + 度丫丫 + 度小嬌 + 度米朵 + 度博文 + 度小童 + 度小萌 + 百度騷男 + 百度評書 + 百度主持 + + + + 跟隨系統 + 亮色主題 + 暗色主題 + + + + 自動 + 黑色 + 白色 + 跟隨背景 + + + + 默認 + 1分鐘 + 2分鐘 + 3分鐘 + 常亮 + + + + 關閉 + 繁體轉簡體 + 簡體轉繁體 + + + + 系統默認字體 + 系統襯線字體 + 系統等寬字體 + + + \ No newline at end of file diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml new file mode 100644 index 000000000..7f07c94e0 --- /dev/null +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -0,0 +1,688 @@ + + + 閲讀 + 閲讀·搜尋 + 閲讀需要訪問存儲卡權限,請前往「設定」—「應用程式權限」—開啟所需要的權限 + + + Home + 還原 + 導入閲讀數據 + 創建子文件夾 + 創建 legado 文件夾作爲備份路徑 + 備份路徑 + 導入舊版數據 + 導入 Github 數據 + 淨化替換 + Send + + 提示 + 取消 + 確認 + 去設定 + 無法轉跳至設定介面 + + 點擊重試 + 正在加載 + 提醒 + 編輯 + 刪除 + 替換 + 替換淨化 + 配置替換淨化規則 + 暫無 + 啟用 + 替換淨化-搜尋 + 書架 + 收藏夾 + 收藏 + 已收藏 + 未收藏 + 訂閲 + 全部 + 最近閲讀 + 最後閲讀 + 更新日誌 + 書架還空着,快去添加吧! + 搜尋 + 下載 + 列表 + 網格三列 + 網格四列 + 網格五列 + 網格六列 + 書架佈局 + 視圖 + 書城 + 添加本地 + 書源 + 書源管理 + 新建/導入/編輯/管理書源 + 設定 + 主題設定 + 同主題/顏色相關的一些設定 + 其它設定 + 與功能相關的一些設定 + 關於 + 捐贈 + 退出 + 尚未保存,是否繼續編輯 + 閲讀樣式設定 + 版本 + 本地 + 搜尋 + 來源: %s + 最近: %s + 書名 + 最新: %s + 是否將《%s》放入書架? + 共 %s 個 Text 文件 + 載入中… + 重試 + Web 服務 + 啟用 Web 服務 + web 編輯書源 + http://%1$s:%2$d + 離線下載 + 離線下載 + 下載已選擇的章節到本地 + 換源 + + \u3000\u3000這是一款使用 Kotlin 全新開發的開源的閲讀應用程式,歡迎你的加入。關注公眾號[开源阅读软件]! + + + 閲讀3.0下載地址:\nhttps://play.google.com/store/apps/details?id=io.legado.app + + Version %s + 自動刷新 + 打開程式時自動更新書輯 + 自動下載最新章節 + 更新書輯時自動下載最新章節 + 備份與還原 + WebDav 設定 + WebDav 設定/還原舊版本數據 + 備份 + 還原 + 備份請給予存儲權限 + 還原請給予存儲權限 + 確認 + 取消 + 確認備份嗎? + 新備份會覆蓋原有備份。\n備份路徑YueDu + 確認還原嗎? + 還原成功會覆蓋原有書架。 + 備份成功 + 備份失敗 + 正在還原 + 還原成功 + 還原失敗 + 屏幕方向 + 跟隨傳感器 + 橫向 + 豎向 + 跟隨系統 + 免責聲明 + 共%d章 + 介面 + 亮度 + 目錄 + 下一章 + 上一章 + 隱藏狀態欄 + 閲讀介面隱藏狀態欄 + 朗讀 + 正在朗讀 + 點擊打開閲讀介面 + 播放 + 正在播放 + 點擊打開播放介面 + 播放暫停 + 返回 + 刷新 + 開始 + 停止 + 暫停 + 繼續 + 定時 + 朗讀暫停 + 正在朗讀(剩餘 %d 分鐘) + 閲讀介面隱藏導航欄 + 隱藏導航欄 + 導航欄顏色 + GitHub + 評分 + 發送電子郵件 + 無法打開 + 分享失敗 + 無章節 + 添加網址 + 添加書輯網址 + 背景 + 作者 + 作者: %s + 朗讀停止 + 清除緩存 + 成功清除緩存 + 保存 + 編輯源 + 編輯書源 + 禁用書源 + 新建書源 + 新建訂閲源 + 添加書輯 + 掃描 + 拷貝源 + 粘帖源 + 源規則説明 + 檢查更新 + 掃描 QR Code + 掃描本地圖片 + 規則説明 + 分享 + 應用程式分享 + 跟隨系統 + 添加 + 導入書源 + 本地導入 + 網絡導入 + 替換淨化 + 替換規則編輯 + 替換規則 + 替換為 + 封面 + + 音量鍵翻頁 + 點擊翻頁 + 點擊總是翻下一頁 + 翻頁動畫 + 屏幕超時 + 返回 + 菜單 + 調節 + 滾動條 + 清除緩存會刪除所有已保存的章節,確認是否清除? + 書源共享 + 規則替換名稱 + 替換規則為空或不滿足正則表達式要求 + 選擇操作 + 全選 + 全選 (%1$d/%2$d) + 取消 (%1$d/%2$d) + 深色模式 + 啟動頁 + 開始下載 + 取消下載 + 暫無任務 + 已下載 %1$d/%2$d + 導入選擇書輯 + 更新/搜尋線程數,太多會卡頓 + 切換圖標 + 刪除書輯 + 開始閲讀 + 數據載入中… + 載入失敗,點擊重試 + 內容簡介 + 簡介: %s + 打開外部書籍 + 來源: %s + 本地導入 + 導入在線規則 + 檢查更新間隔 + 按閲讀時間 + 按更新時間 + 按書名 + 手動排序 + 閲讀方式 + 排版 + 刪除所選 + 是否確認刪除? + 默認字體 + 發現 + 發現管理 + 沒有內容,去書源裏自定義吧! + 刪除所有 + 搜索歷史 + 清除 + 正文顯示標題 + 書源同步 + 無最新章節信息 + 顯示時間和電量 + 顯示分隔線 + 深色狀態欄圖標 + 內容 + 拷貝內容 + 一鍵緩存 + 這是一段測試文字\n\u3000\u3000只是讓你看看效果的 + 文字顏色和背景(長按自定義) + 沉浸式狀態欄 + 還剩 %d 章未下載 + 沒有選擇 + 長按輸入顏色值 + 加載中… + 追更區 + 養肥區 + 書籤 + 添加書籤 + 刪除 + 加載超時 + 關注: %s + 已拷貝 + 整理書架 + 這將會刪除所有書籍,請謹慎操作。 + 搜索書源 + 搜索訂閲源 + 搜索(共 %d 個書源) + 目錄(%d) + 加粗 + 字體 + 文字 + 軟件主頁 + + + + + 邊距 + 上邊距 + 下邊距 + 左邊距 + 右邊距 + 校驗書源 + 校驗所選 + 進度 %1$d/%2$d + 請安裝並選擇中文 TTS! + TTS 初始化失敗! + 簡繁轉換 + 關閉 + 簡轉繁 + 繁轉簡 + 翻頁模式 + %1$d 項 + 存儲卡: + 加入書架 + 加入書架 (%1$d) + 成功添加 %1$d 本書 + 請將字體文件放到 SD 根目錄 Fonts 文件夾下重新選擇 + 默認字體 + 選擇字體 + 字號 + 行距 + 段距 + 置頂 + 自動展開發現 + 默認展開第一組發現 + 當前線程數 %s + 朗讀語速 + 自動翻頁 + 停止自動翻頁 + 自動翻頁間隔 + 書籍信息 + 書籍信息編輯 + 默認打開書架 + 自動跳轉最近閲讀 + 替換範圍,選填書名或者源名 + 分組 + 內容緩存路徑 + 清理緩存 + 系統文件選擇器 + 新版本 + 下載更新 + 朗讀時音量鍵翻頁 + Tip 邊距跟隨邊距調整 + 允許更新 + 禁止更新 + 反選 + 搜索書名、作者 + 書名、作者、URL + 常見問題 + 顯示所有發現 + 關閉則只顯示勾選源的發現 + 更新目錄 + Txt目錄正則 + 設置編碼 + 倒序-順序 + 排序 + 智能排序 + 手動排序 + 拼音排序 + 滾動到頂部 + 滾動到底部 + 已讀: %s + 追更 + 養肥 + 完結 + 所有書籍 + 追更書籍 + 養肥書籍 + 完結書籍 + 本地書籍 + 狀態欄顏色透明 + 導航欄變色 + 導航欄根據夜間模式變化 + 放入書架 + 繼續閲讀 + 封面地址 + 覆蓋 + 滑動 + 仿真 + 滾動 + 無動畫 + 此書源使用了高級功能,請到捐贈裏點擊支付寶紅包搜索碼領取紅包開啟。 + 後台更新換源最新章節 + 開啟則會在軟件打開 1 分鐘後開始更新 + 書架 ToolBar 自動隱藏 + 滾動書架時 ToolBar 自動隱藏與顯示 + 登錄 + 登錄 %s + 成功 + 當前源沒有配置登陸地址 + + + 源名稱 (sourceName) + 源URL (sourceUrl) + 源分組 (sourceGroup) + 分類 Url + 登錄 URL(loginUrl) + 搜索地址 (url) + 發現地址規則 (url) + 書籍列表規則 (bookList) + 書名規則 (name) + 詳情頁 url 規則 (bookUrl) + 作者規則 (author) + 分類規則 (kind) + 簡介規則 (intro) + 封面規則 (coverUrl) + 最新章節規則 (lastChapter) + 字數規則 (wordCount) + 書籍 URL 正則 (bookUrlPattern) + 預處理規則 (bookInfoInit) + 目錄 URL 規則 (tocUrl) + 目錄下一頁規則 (nextTocUrl) + 目錄列表規則 (chapterList) + 章節名稱規則 (ChapterName) + 章節 URL 規則 (chapterUrl) + VIP 標識 (isVip) + 章節信息 (ChapterInfo) + 正文規則 (content) + 正文下一頁 URL 規則 (nextContentUrl) + webJs + 資源正則 (sourceRegex) + + 圖標 (sourceIcon) + 列表規則 (ruleArticles) + 列表下一頁規則 (ruleArticles) + 標題規則 (ruleTitle) + guid 規則 (ruleGuid) + 時間規則 (rulePubDate) + 類別規則 (ruleCategories) + 描述規則 (ruleDescription) + 圖片 url 規則 (ruleImage) + 內容規則 (ruleContent) + 鏈接規則 (ruleLink) + + + + 沒有書源 + 書籍信息獲取失敗 + 內容獲取失敗 + 目錄獲取失敗 + 訪問網站失敗: %s + 文件讀取失敗 + 加載目錄失敗 + 獲取數據失敗! + 加載失敗\n%s + 沒有網絡 + 網絡連接超時 + 數據解析失敗 + + + 請求頭 (header) + 調試源 + 二維碼導入 + 掃描二維碼 + 選中時點擊可彈出菜單 + 主題 + 主題模式 + 選擇主題模式 + 默認主題 + 恢復主題為默認配色 + 加入QQ羣 + 獲取背景圖片需存儲權限 + 輸入書源網址 + 刪除文件 + 刪除文件成功 + 確定刪除文件嗎? + 手機目錄 + 智能導入 + 發現 + 切換顯示樣式 + 導入本地書籍需存儲權限 + 夜間模式 + E-Ink 模式 + 電子墨水屏模式 + 本軟件需要存儲權限來存儲備份書籍信息 + 再按一次退出程式 + 導入本地書籍需存儲權限 + 網絡連接不可用 + + + 確認 + 是否確認刪除? + 是否刪除全部書籍? + 是否同時刪除已下載的書籍目錄? + 掃描二維碼需相機權限 + 朗讀正在運行,不能自動翻頁 + 輸入編碼 + TXT 目錄規則 + 打開外部書籍需獲取存儲權限 + 未獲取到書名 + 輸入替換規則網址 + 搜索列表獲取成功%d + 書源名稱和 URL 不能為空 + 圖庫 + 領支付寶紅包 + 沒有獲取到更新地址 + 正在打開首頁,成功自動返回主界面 + 登錄成功後請點擊右上角圖標進行首頁訪問測試 + + + 使用正則表達式 + 縮進 + 無縮進 + 一字符縮進 + 二字符縮進 + 三字符縮進 + 四字符縮進 + 選擇文件夾 + 選擇文件 + 沒有發現,可以在書源裏添加。 + 恢復默認 + 自定義緩存路徑需要存儲權限 + 黑色 + 文章內容為空 + 正在換源請等待… + 目錄列表為空 + 字距 + + 基本 + 搜索 + 發現 + 詳情 + 目錄 + 正文 + + E-Ink 模式 + 去除動畫,優化電紙書使用體驗 + Web 服務 + web 端口 + 當前端口 %s + 二維碼分享 + 字符串分享 + wifi 分享 + 請給於存儲權限 + 減速 + 加速 + 上一個 + 下一個 + 音樂 + 音頻 + 啟用 + 啟用 JS + 加載 BaseUrl + 全部書源 + 輸入不能為空 + 清空發現緩存 + 編輯發現 + 切換軟件顯示在桌面的圖標 + 幫助 + 我的 + 閲讀 + %d%% + %d 分鐘 + 自動亮度 %s + 按頁朗讀 + 在線朗讀 + 背景圖片 + 背景顏色 + 文字顏色 + 選擇圖片 + 分組管理 + 分組選擇 + 編輯分組 + 移入分組 + 添加分組 + 新建替換 + 分組 + 分組: %s + 目錄: %s + 啟用發現 + 禁用發現 + 啟用所選 + 禁用所選 + 導出所選 + 導出 + 加載目錄 + TTS + WebDav 密碼 + 輸入你的 WebDav 授權密碼 + 輸入你的服務器地址 + WebDav 服務器地址 + WebDav 賬號 + 輸入你的 WebDav 賬號 + 訂閲源 + 編輯訂閲源 + 篩選 + 篩選發現 + 當前位置: + 精準搜索 + 正在啟動服務 + + 文件選擇 + 文件夾選擇 + 我是有底線的 + Uri 轉 Path 失敗 + 刷新封面 + 封面換源 + 選擇本地圖片 + 類型: + 文本 + 音頻 + 後台 + 正在導入 + 正在導出 + 自定義翻頁按鍵 + 上一頁按鍵 + 下一頁按鍵 + 先將書籍加入書架 + 未分組 + 上一句 + 下一句 + 其它目錄 + 文字太多,生成二維碼失敗 + 分享RSS源 + 分享書源 + 自動切換夜間模式 + 夜間模式跟隨系統 + 上級 + 在線朗讀音色 + (%1$d/%2$d) + 顯示訂閲 + 服務已停止 + 正在啟動服務\n具體信息查看通知欄 + 默認路徑 + 系統文件夾選擇器 + 自帶選擇器\n(Android10 以上因權限限制可能無法使用) + Android10 以上因權限限制可能無法讀寫文件 + 長按文字在操作菜單中顯示閲讀·搜索 + 文字操作顯示搜索 + 記錄日誌 + 中文簡繁體轉換 + 圖標為矢量圖標,Android8.0 以前不支持 + 朗讀設置 + 主界面 + 長按選擇文本 + 頁眉 + 正文 + 頁腳 + 文本選擇結束位置 + 文本選擇開始位置 + 共用佈局 + 瀏覽器 + 導入默認規則 + 名稱 + 正則 + 更多菜單 + + + 系統內置字體樣式 + 刪除源文件 + 預設一 + 預設二 + 預設三 + 標題 + 靠左 + 居中 + 隱藏 + 加入分組 + 保存圖片 + 沒有默認路徑 + 設置分組 + 查看目錄 + 導航欄陰影 + 當前陰影大小 (elevation): %s + 默認 + 主菜單 + 點擊授予權限 + 閲讀需要訪問存儲卡權限,請點擊下方的"授予權限"按鈕,或前往「設定」—「應用程式權限」—打開所需權限。如果授予權限後仍然不正常,請點擊右上角的「選擇文件夾」,使用系統文件夾選擇器。 + 全文朗讀中不能朗讀選中文字 + 擴展到劉海 + 更新目錄中 + 全程響應耳機按鍵 + 即使退出軟件也響應耳機按鍵 + 開發人員 + 聯繫我們 + 開源許可 + 關注公衆號 + WeChat + 你的支持是我更新的動力 + 公众号[开源阅读软件] + 正在自動換源 + 點擊加入 + + 信息 + + + 主色調 + 強調色 + 背景色 + 導航欄顏色 + 白天 + 白天,主色調 + 白天,強調色 + 白天,背景色 + 白天,導航欄顏色 + 夜間 + 夜間,主色調 + 夜間,強調色 + 夜間,背景色 + 夜間,導航欄顏色 + diff --git a/app/src/main/res/values/array_values.xml b/app/src/main/res/values/array_values.xml index 2aa918837..40bc6684e 100644 --- a/app/src/main/res/values/array_values.xml +++ b/app/src/main/res/values/array_values.xml @@ -6,9 +6,11 @@ launcher1 launcher2 launcher3 + launcher4 + launcher5 + launcher6 - 0 60 @@ -38,5 +40,11 @@ 9 + + 0 + 1 + 2 + 3 + \ No newline at end of file diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index 104febad6..b1046096f 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -67,7 +67,7 @@ @string/app_folder_picker - + @string/screen_unspecified @string/screen_portrait @string/screen_landscape @@ -79,6 +79,9 @@ icon1 icon2 icon3 + icon4 + icon5 + icon6 @@ -93,4 +96,14 @@ 系统等宽字体 + + + 标题 + 时间 + 电量 + 页数 + 进度 + 页数及进度 + + \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index d5a4d11e1..9e920088b 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -173,4 +173,17 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/values/colors.xml b/app/src/main/res/values/colors.xml index d6999a7ae..8d6199035 100644 --- a/app/src/main/res/values/colors.xml +++ b/app/src/main/res/values/colors.xml @@ -16,8 +16,10 @@ @color/md_grey_50 @color/md_grey_100 @color/md_grey_200 + #AAFFFFFF #00000000 + #10000000 #30000000 #d3321b diff --git a/app/src/main/res/values/dimens.xml b/app/src/main/res/values/dimens.xml index 9f8946337..f7ecf2030 100644 --- a/app/src/main/res/values/dimens.xml +++ b/app/src/main/res/values/dimens.xml @@ -6,7 +6,6 @@ 176dp 16dp - 14sp 16sp 18sp @@ -35,4 +34,6 @@ 8dp 8dp 8dp + + 8dp \ No newline at end of file diff --git a/app/src/main/res/values/pref_key_value.xml b/app/src/main/res/values/pref_key_value.xml index 7bcded4da..e9aef95f4 100644 --- a/app/src/main/res/values/pref_key_value.xml +++ b/app/src/main/res/values/pref_key_value.xml @@ -1,7 +1,7 @@ auto_refresh - list_screen_direction + list_screen_direction full_screen threads_num user_agent @@ -10,7 +10,6 @@ expandGroupFind defaultToRead autoDownload - downloadPath checkUpdate https://gitee.com/alanskycn/yuedu/blob/master/Rule/README.md diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 84e6e6bb2..edf2698e6 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -1,15 +1,17 @@ + 阅读 - Open navigation drawer - Close navigation drawer - Android Studio - android.studio@android.com - Navigation header - Settings + 阅读·搜索 + 阅读需要访问存储卡权限,请前往“设置”—“应用权限”—打开所需权限 + Home 恢复 导入阅读数据 + 创建子文件夹 + 创建legado文件夹作为备份文件夹 + 备份路径 + 导入旧版数据 导入Github数据 净化替换 Send @@ -18,9 +20,7 @@ 取消 确定 去设置 - 无法跳转至设置界面 - 阅读需要访问存储卡权限,请前往“设置”—“应用权限”—打开所需权限 点击重试 正在加载 @@ -29,6 +29,7 @@ 删除 替换 替换净化 + 配置替换净化规则 暂无 启用 替换净化-搜索 @@ -41,9 +42,7 @@ 全部 最近阅读 最后阅读 - 让阅读成为一种习惯。 更新日志 - 阅读·搜索 书架还空着,先去添加吧! 搜索 下载 @@ -58,6 +57,7 @@ 添加本地 书源 书源管理 + 新建/导入/编辑/管理书源 设置 主题设置 与界面/颜色相关的一些设置 @@ -80,8 +80,9 @@ 加载中… 重试 Web 服务 + 启用Web服务 web编辑书源 - http://%s:%d + http://%1$s:%2$d 离线下载 离线下载 下载选择的章节到本地 @@ -129,8 +130,6 @@ 上一章 隐藏状态栏 阅读界面隐藏状态栏 - 阅读行数调整 - 阅读行数减一行,如阅读界面显示不全可启用 朗读 正在朗读 点击打开阅读界面 @@ -207,14 +206,14 @@ 替换规则为空或者不满足正则表达式要求 选择操作 全选 - 全选(%d/%d) - 取消(%d/%d) + 全选(%1$d/%2$d) + 取消(%1$d/%2$d) 深色模式 启动页 开始下载 取消下载 暂无任务 - 已下载 %d/%d + 已下载 %1$d/%2$d 导入选择书籍 更新和搜索线程数,太多会卡顿 切换图标 @@ -225,7 +224,7 @@ 内容简介 简介:%s 打开外部书籍 - 来源:%s + 来源: %s 本地导入 导入在线规则 检查更新间隔 @@ -289,7 +288,7 @@ 右边距 校验书源 校验所选 - 进度 %d/%d + 进度 %1$d/%2$d 请安装并选择中文TTS! TTS初始化失败! 简繁转换 @@ -381,6 +380,7 @@ 源名称(sourceName) 源URL(sourceUrl) 源分组(sourceGroup) + 分类Url 登录URL(loginUrl) 搜索地址(url) 发现地址规则(url) @@ -442,6 +442,7 @@ 选中时点击可弹出菜单 主题 主题模式 + 选择主题模式 默认主题 恢复主题为默认配色 加入QQ群 @@ -457,6 +458,7 @@ 导入本地书籍需存储权限 夜间模式 E-Ink 模式 + 电子墨水屏模式 本软件需要存储权限来存储备份书籍信息 再按一次退出程序 导入本地书籍需存储权限 @@ -560,8 +562,11 @@ 导出 加载目录 TTS + WebDav 密码 输入你的WebDav授权密码 输入你的服务器地址 + WebDav 服务器地址 + WebDav 账号 输入你的WebDav账号 订阅源 编辑订阅源 @@ -581,7 +586,7 @@ 类型: 文本 音频 - 转到后台 + 后台 正在导入 正在导出 自定义翻页按键 @@ -599,7 +604,7 @@ 夜间模式跟随系统 上级 在线朗读音色 - (%d/%d) + (%1$d/%2$d) 显示订阅 服务已停止 正在启动服务\n具体信息查看通知栏 @@ -628,9 +633,8 @@ 更多菜单 - 其它朗读设置 系统内置字体样式 - 是否删除源文件 + 删除源文件 预设一 预设二 预设三 @@ -646,5 +650,44 @@ 导航栏阴影 当前阴影大小(elevation): %s 默认 + 主菜单 + 点击授予权限 + 阅读需要访问存储卡权限,请点击下方的"授予权限"按钮,或前往“设置”—“应用权限”—打开所需权限。如果授予权限后仍然不正常,请点击右上角的“选择文件夹”,使用系统文件夹选择器。 + 全文朗读中不能朗读选中文字 + 扩展到刘海 + 更新目录中 + 全程响应耳机按键 + 即使退出软件也响应耳机按键 + 开发人员 + 联系我们 + 开源许可 + 其它 + 开源阅读软件 + 关注公众号 + 微信 + 您的支持是我更新的动力 + 公众号[开源阅读软件] + 正在自动换源 + 点击加入 + + 信息 + 隐藏页眉 + 隐藏页脚 + + + 主色调 + 强调色 + 背景色 + 底部操作栏颜色 + 白天 + 白天,主色调 + 白天,强调色 + 白天,背景色 + 白天,底栏色 + 夜间 + 夜间,主色调 + 夜间,强调色 + 夜间,背景色 + 夜间,底栏色 diff --git a/app/src/main/res/xml/about.xml b/app/src/main/res/xml/about.xml index 130e16e60..3c607cd9d 100644 --- a/app/src/main/res/xml/about.xml +++ b/app/src/main/res/xml/about.xml @@ -2,68 +2,78 @@ - - - - + - + android:summary="@string/click_to_apply" + app:iconSpaceReserved="false" /> - - - - + - diff --git a/app/src/main/res/xml/donate.xml b/app/src/main/res/xml/donate.xml index 13d448544..7c86c54b7 100644 --- a/app/src/main/res/xml/donate.xml +++ b/app/src/main/res/xml/donate.xml @@ -3,52 +3,65 @@ xmlns:app="http://schemas.android.com/apk/res-auto"> - - - - - - - - - + android:key="webDavCreateDir" + android:defaultValue="true" + android:title="@string/mkdirs" + android:summary="@string/mkdirs_description" + app:allowDividerAbove="false" + app:allowDividerBelow="false" + app:iconSpaceReserved="false" /> - + - + - + - + - + diff --git a/app/src/main/res/xml/pref_config_other.xml b/app/src/main/res/xml/pref_config_other.xml index b049bcf22..66f5bfd9f 100644 --- a/app/src/main/res/xml/pref_config_other.xml +++ b/app/src/main/res/xml/pref_config_other.xml @@ -4,6 +4,9 @@ - - - - diff --git a/app/src/main/res/xml/pref_config_read.xml b/app/src/main/res/xml/pref_config_read.xml index a19a8ba4c..6b55f0fcc 100644 --- a/app/src/main/res/xml/pref_config_read.xml +++ b/app/src/main/res/xml/pref_config_read.xml @@ -2,6 +2,14 @@ + + + + - diff --git a/app/src/main/res/xml/pref_config_theme.xml b/app/src/main/res/xml/pref_config_theme.xml index 2f34e86ec..94bef734c 100644 --- a/app/src/main/res/xml/pref_config_theme.xml +++ b/app/src/main/res/xml/pref_config_theme.xml @@ -26,92 +26,102 @@ android:title="@string/navigation_bar_color_change" app:iconSpaceReserved="false" /> - - + android:defaultValue="@color/md_light_blue_600" + android:key="colorPrimary" + android:summary="@string/day_color_primary" + android:title="@string/primary" + app:cpv_dialogType="preset" + app:iconSpaceReserved="false" /> + android:defaultValue="@color/md_pink_800" + android:key="colorAccent" + android:summary="@string/day_color_accent" + android:title="@string/accent" + app:cpv_dialogType="preset" + app:iconSpaceReserved="false" /> + android:defaultValue="@color/md_grey_100" + android:key="colorBackground" + android:summary="@string/day_background_color" + android:title="@string/background_color" + app:cpv_dialogType="preset" + app:iconSpaceReserved="false" /> + android:defaultValue="@color/md_grey_200" + android:key="colorBottomBackground" + android:summary="@string/day_navbar_color" + android:title="@string/navbar_color" + app:cpv_dialogType="preset" + app:allowDividerAbove="false" + app:allowDividerBelow="false" + app:iconSpaceReserved="false" /> + android:defaultValue="@color/md_grey_900" + android:key="colorPrimaryNight" + android:summary="@string/night_primary" + android:title="@string/primary" + app:cpv_dialogType="preset" + app:iconSpaceReserved="false" /> + android:defaultValue="@color/md_deep_orange_800" + android:key="colorAccentNight" + android:summary="@string/night_accent" + android:title="@string/accent" + app:cpv_dialogType="preset" + app:iconSpaceReserved="false" /> + android:defaultValue="@color/md_black_1000" + android:key="colorBackgroundNight" + android:summary="@string/night_background_color" + android:title="@string/background_color" + app:cpv_dialogType="preset" + app:iconSpaceReserved="false" /> + android:defaultValue="@color/md_grey_800" + android:key="colorBottomBackgroundNight" + android:summary="@string/night_navbar_color" + android:title="@string/navbar_color" + app:cpv_dialogType="preset" + app:iconSpaceReserved="false" /> diff --git a/app/src/main/res/xml/pref_main.xml b/app/src/main/res/xml/pref_main.xml index c95b66d9e..7c63c98fe 100644 --- a/app/src/main/res/xml/pref_main.xml +++ b/app/src/main/res/xml/pref_main.xml @@ -1,15 +1,23 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + android:divider="@color/transparent" + app:allowDividerBelow="false" + app:allowDividerAbove="false" + > - - - + + app:iconSpaceReserved="false" + app:allowDividerAbove="true" + app:allowDividerBelow="false" > - - - - + - - diff --git a/build.gradle b/build.gradle index 5eb9c16b8..21c80e3a6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,16 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.3.61' + ext.kotlin_version = '1.3.72' repositories { google() - jcenter() + //jcenter() + maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url 'https://maven.fabric.io/public' } maven { url 'https://plugins.gradle.org/m2/' } } dependencies { - classpath 'com.android.tools.build:gradle:3.6.1' + classpath 'com.android.tools.build:gradle:3.6.3' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath 'de.timfreiheit.resourceplaceholders:placeholders:0.3' classpath 'com.google.gms:google-services:4.3.3' @@ -20,7 +21,8 @@ buildscript { allprojects { repositories { google() - jcenter() + //jcenter() + maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' } maven { url "https://jitpack.io" } maven { url 'https://maven.google.com/' } maven { url 'https://github.com/psiegman/mvn-repo/raw/master/releases' } @@ -29,4 +31,4 @@ allprojects { task clean(type: Delete) { delete rootProject.buildDir -} +} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 23339e0df..667087ef0 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,7 +6,7 @@ # http://www.gradle.org/docs/current/userguide/build_environment.html # Specifies the JVM arguments used for the daemon process. # The setting is particularly useful for tweaking memory settings. -org.gradle.jvmargs=-Xmx1536m +org.gradle.jvmargs=-Xmx2048m # When configured, Gradle will run in incubating parallel mode. # This option should only be used with decoupled projects. More details, visit # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects