chatlab-cli 0.1.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-YAOFJ73U.mjs → chunk-3DIWXYMJ.mjs} +80 -129
- package/dist/chunk-3DIWXYMJ.mjs.map +1 -0
- package/dist/{chunk-JMRDNHIR.mjs → chunk-EIRLEPXP.mjs} +824 -280
- package/dist/chunk-EIRLEPXP.mjs.map +1 -0
- package/dist/{chunk-DL3BFEAH.mjs → chunk-EWCSGYVT.mjs} +2 -2
- package/dist/chunk-EWCSGYVT.mjs.map +1 -0
- package/dist/{chunk-PF4QFHC6.mjs → chunk-FBTHZU55.mjs} +849 -824
- package/dist/chunk-FBTHZU55.mjs.map +1 -0
- package/dist/{chunk-P4N5GEFF.mjs → chunk-NB4BIAYM.mjs} +9 -9
- package/dist/{chunk-OC73KSMV.mjs → chunk-XUHPCRVT.mjs} +2 -2
- package/dist/cli.mjs +2 -2
- package/dist/{http-PQEOFGJK.mjs → http-QVYJ5HER.mjs} +6 -6
- package/dist/{import-UR2IE2O7.mjs → import-AJKL6JPR.mjs} +6 -4
- package/dist/index.mjs +6 -6
- package/dist/{mcp-4XCDZ5PU.mjs → mcp-FRF3YAN5.mjs} +5 -6
- package/dist/mcp-FRF3YAN5.mjs.map +1 -0
- package/dist/{src-ZELOFE7P.mjs → src-KOIGBZJX.mjs} +14 -2
- package/dist/{stream-import-RP3XB6NM.mjs → stream-import-URGOCXUH.mjs} +5 -3
- package/dist-web/assets/{DebugToolsPanel.vue_vue_type_script_setup_true_lang-BuOhHrGp.js → DebugToolsPanel.vue_vue_type_script_setup_true_lang-DFN1Co1H.js} +19 -19
- package/dist-web/assets/{EChartWordcloud-DcC12j9S.js → EChartWordcloud-BYLFxPAX.js} +1 -1
- package/dist-web/assets/{MessageExportModal-CUS9nnwi.js → MessageExportModal-BAf68-wB.js} +1 -1
- package/dist-web/assets/electron-2m4Vdk2z.js +1 -0
- package/dist-web/assets/{fetch-DvfIZxuz.js → fetch-Ayp337Ng.js} +1 -1
- package/dist-web/assets/{fetch-CJ8Q4qM2.js → fetch-BWtpQwBZ.js} +1 -1
- package/dist-web/assets/fetch-o5NJ2uWE.js +3 -0
- package/dist-web/assets/{index-D3siJhmm.js → index-Bd5r2oFG.js} +4 -4
- package/dist-web/assets/index-BfZM-q0T.js +7 -0
- package/dist-web/assets/{index-CCE1zef2.js → index-CLYHD_f4.js} +2 -2
- package/dist-web/assets/{index-CUTe0Sc3.js → index-CaTRpNBK.js} +12 -12
- package/dist-web/assets/index-Ksa--o23.js +173 -0
- package/dist-web/assets/{vendor-echarts-BXkS9r5W.js → vendor-echarts-C13vDgZW.js} +5 -5
- package/dist-web/assets/{vendor-echarts-wordcloud-CmDVLUv0.js → vendor-echarts-wordcloud-uVdwYsYa.js} +1 -1
- package/dist-web/assets/{vendor-nuxt-ui-D1aReMtR.js → vendor-nuxt-ui-CYMNNdeD.js} +2 -2
- package/dist-web/assets/{vendor-zrender-B6SpLIkk.js → vendor-zrender-5DcYjSZk.js} +2 -2
- package/dist-web/assets/{web-DOZKbBMQ.js → web-C5yfcwjn.js} +1 -1
- package/dist-web/index.html +2 -2
- package/package.json +1 -2
- package/CHANGELOG.md +0 -51
- package/LICENSE +0 -661
- package/dist/chunk-DL3BFEAH.mjs.map +0 -1
- package/dist/chunk-JMRDNHIR.mjs.map +0 -1
- package/dist/chunk-PF4QFHC6.mjs.map +0 -1
- package/dist/chunk-YAOFJ73U.mjs.map +0 -1
- package/dist/mcp-4XCDZ5PU.mjs.map +0 -1
- package/dist-web/assets/electron-DvcSSc-D.js +0 -1
- package/dist-web/assets/fetch-DgQkWW73.js +0 -3
- package/dist-web/assets/index-68UnLyFT.js +0 -173
- package/dist-web/assets/index-n2XUUgti.js +0 -7
- /package/dist/{chunk-P4N5GEFF.mjs.map → chunk-NB4BIAYM.mjs.map} +0 -0
- /package/dist/{chunk-OC73KSMV.mjs.map → chunk-XUHPCRVT.mjs.map} +0 -0
- /package/dist/{http-PQEOFGJK.mjs.map → http-QVYJ5HER.mjs.map} +0 -0
- /package/dist/{import-UR2IE2O7.mjs.map → import-AJKL6JPR.mjs.map} +0 -0
- /package/dist/{src-ZELOFE7P.mjs.map → src-KOIGBZJX.mjs.map} +0 -0
- /package/dist/{stream-import-RP3XB6NM.mjs.map → stream-import-URGOCXUH.mjs.map} +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import{b as se,a as ae,g as le,i as st,o as Ue,d as je,p as nt,c as at}from"./vendor-nuxt-ui-CYMNNdeD.js";import{u as Z,a as ge,b as Le,T as rt,c as it,_ as De,s as pe,d as $e,e as oe,g as ze,f as Ee,h as Re,i as fe,I as Be,C as Oe,k as lt}from"./index-BfZM-q0T.js";import{p as J,d as ve,G as n,H as B,K as P,a5 as e,L as d,T as s,u as t,R as E,b as C,h as N,U as D,Q as O,P as c,Z as H,a3 as q,O as Te,w as xe,a9 as ct,au as ut,bA as dt,bH as ht}from"./vendor-reka-ui-CW2cIgMu.js";import{M as mt,_ as Me}from"./index-CaTRpNBK.js";import"./vendor-snapdom-XnBoh1gd.js";function gt(L){const o=!!L;return{shouldOpenLanguageModal:!o,shouldContinue:o}}const pt={class:"language-select-modal flex flex-col p-6"},ft={class:"mb-6 flex flex-col items-center text-center"},vt={class:"mb-4 flex h-14 w-14 items-center justify-center rounded-2xl bg-linear-to-br from-pink-100 to-rose-100 dark:from-pink-900/30 dark:to-rose-900/30"},xt={class:"text-xl font-bold text-gray-900 dark:text-white"},yt={class:"mt-1 text-sm text-gray-500 dark:text-gray-400"},_t={class:"mb-6 flex justify-center"},bt=J({__name:"LanguageSelectModal",emits:["done"],setup(L,{emit:o}){const i=o,{t:v}=Z(),r=ge(),x=C(!1),m=N(()=>it.map(f=>({label:f.nativeName,value:f.code}))),h=N({get:()=>r.locale,set:f=>r.setLocale(f)});ve(async()=>{try{const f=await Le().getLocale(),p=gt(f);x.value=p.shouldOpenLanguageModal,p.shouldContinue&&i("done")}catch{x.value=!0}});function w(){Le().saveLocale(r.locale).catch(()=>{}),x.value=!1,i("done")}return(f,p)=>{const _=se,F=ae,A=le;return n(),B(A,{open:x.value,"prevent-close":"",ui:{content:"sm:max-w-md",overlay:"backdrop-blur-sm"}},{content:P(()=>[e("div",pt,[e("div",ft,[e("div",vt,[d(_,{name:"i-heroicons-language",class:"h-7 w-7 text-pink-600 dark:text-pink-400"})]),e("h2",xt,s(t(v)("common.languageSelect.title")),1),e("p",yt,s(t(v)("common.languageSelect.subtitle")),1)]),e("div",_t,[d(rt,{modelValue:h.value,"onUpdate:modelValue":p[0]||(p[0]=z=>h.value=z),size:"md",items:m.value},null,8,["modelValue","items"])]),d(F,{block:"",color:"primary",size:"lg",class:"bg-pink-500 hover:bg-pink-600 dark:bg-pink-600 dark:hover:bg-pink-700",onClick:w},{default:P(()=>[E(s(t(v)("common.languageSelect.next")),1)]),_:1})])]),_:1},8,["open"])}}}),kt=De(bt,[["__scopeId","data-v-88304e66"]]),wt=`欢迎使用 ChatLab,它是一款**开源、本地化的聊天记录分析工具**。
|
|
2
|
+
|
|
3
|
+
我们相信,你有权理解自己的社交数据。但聊天记录不只属于你,它同时承载着你朋友、家人、同事的话语与信任。因此,在使用本工具之前,请认真阅读以下条款。
|
|
4
|
+
|
|
5
|
+
## 1. 核心功能与独立性
|
|
6
|
+
|
|
7
|
+
- **仅分析,不导出**:本工具仅用于对已导出的聊天记录进行分析。我们不提供任何解密、抓包或导出工具,从第三方聊天软件获取数据是你的个人行为。
|
|
8
|
+
- **第三方独立工具**:本项目为独立开源项目,**与任何聊天平台、公司或组织等无关联**。
|
|
9
|
+
|
|
10
|
+
## 2. 数据隐私与安全
|
|
11
|
+
|
|
12
|
+
- **纯本地分析**:默认情况下,聊天记录的存储与分析均在你的设备本地完成,**零上传**。
|
|
13
|
+
- **AI 功能例外**:若你主动启用 AI 功能,相关聊天数据将发送至你配置的第三方模型服务商(如 OpenAI、DeepSeek 或其他服务商)。请在使用前自行评估数据的敏感程度,**避免发送高度私密的内容**。该第三方服务商的隐私政策独立于本项目,请自行查阅。
|
|
14
|
+
- **功能性联网**:应用会通过网络获取更新提示、使用说明及配置信息。此过程不会上传任何本地数据。
|
|
15
|
+
- **匿名使用统计**:为了优化产品,软件会收集**非敏感**的数据(如版本号、操作系统类型等)。这些数据不含任何个人信息,你可以在设置中随时关闭此功能。
|
|
16
|
+
|
|
17
|
+
## 3. 数据授权与使用限制
|
|
18
|
+
|
|
19
|
+
聊天记录中不只有你的数据——它同样包含对话另一方的内容。请在使用时遵守以下原则:
|
|
20
|
+
|
|
21
|
+
- **合法授权原则**:你仅可处理你**本人参与**的聊天记录。聊天记录中涉及的其他参与者同样拥有隐私权,若分析内容涉及特定个人隐私(**私聊对象、群聊成员**),请务必确保已获得相关人员的知情同意。
|
|
22
|
+
- **禁止非法用途**:
|
|
23
|
+
- **严禁**用于窃取、监控或分析未经授权的他人隐私。
|
|
24
|
+
- **严禁**分析通过非法手段(如非法入侵、账号窃取、数据劫持等)获取的聊天记录。
|
|
25
|
+
- **严禁**将分析结果用于骚扰、诈骗、人肉搜索或任何侵犯他人权益的行为。
|
|
26
|
+
- **严禁**利用本软件生成的分析内容(含 AI 生成内容)编造、传播虚假信息或误导性信息。
|
|
27
|
+
|
|
28
|
+
## 4. 风险警告
|
|
29
|
+
|
|
30
|
+
- **官方渠道**:请仅通过 [chatlab.fun](https://chatlab.fun) 或 [GitHub Release](https://github.com/ChatLab/ChatLab/releases) 下载本软件。
|
|
31
|
+
- **供应链风险**:本项目代码完全开源,任何人均可二次打包。他人分享的非官方版本可能会植入恶意代码,导致你的 API Token、聊天记录或本地数据泄露,请务必保持警惕。
|
|
32
|
+
- **结果准确性**:软件和 AI 生成的分析结果可能存在错误或"幻觉",仅供参考,不应作为法律证据或正式决策依据。
|
|
33
|
+
|
|
34
|
+
## 5. 免责声明
|
|
35
|
+
|
|
36
|
+
- **软件用途**:本软件仅供技术研究、学习与交流目的使用。
|
|
37
|
+
- **平台合规性**:用户需自行承担获取聊天记录行为的合规性。若因分析行为违反了原始数据来源平台的服务条款而导致账号受限,作者不承担任何责任。
|
|
38
|
+
- **隐私责任**:若因你对本工具的使用方式侵犯了他人隐私权或其他合法权益,相关责任由你自行承担。
|
|
39
|
+
- **责任自负**:使用本软件产生的一切后果(包括但不限于数据丢失、隐私纠纷、法律责任)均由用户自行承担。
|
|
40
|
+
- **适用法律**:本声明适用你所在司法管辖区的相关法律。如本声明与当地强制性法律规定存在冲突,以当地法律为准。
|
|
41
|
+
- **接受声明**:下载、安装或使用本软件,即表示你已阅读、理解并同意本声明的所有条款。如不同意,请立即停止使用并删除相关程序。
|
|
42
|
+
|
|
43
|
+
修订日期:2026-03-14
|
|
44
|
+
`,Fe=`Welcome to ChatLab, an **open-source, local-first tool for analyzing chat records**.
|
|
45
|
+
|
|
46
|
+
We believe you should be able to understand your own social data. But chat histories do not belong to you alone; they also carry the words and trust of your friends, family, and colleagues. Please read the following terms carefully before using this tool.
|
|
47
|
+
|
|
48
|
+
## 1. Core Functionality & Independence
|
|
49
|
+
|
|
50
|
+
- **Analysis Only, No Exporting**: This tool is intended only for analyzing chat records that have already been exported. We do not provide any decryption, packet capture, or export tools. Obtaining data from third-party chat platforms is your own action and responsibility.
|
|
51
|
+
- **Independent Third-Party Tool**: This project is an independent open-source project and **is not affiliated with any chat platform, company, or organization**.
|
|
52
|
+
|
|
53
|
+
## 2. Data Privacy & Security
|
|
54
|
+
|
|
55
|
+
- **Purely Local Analysis**: By default, chat records are stored and analyzed entirely on your device with **zero uploads**.
|
|
56
|
+
- **AI Feature Exception**: If you choose to enable AI features, relevant chat data will be sent to the third-party model provider you configure (such as OpenAI, DeepSeek, or another provider). Before using this feature, assess how sensitive your data is and **avoid sending highly private content**. The privacy practices of that third-party provider are independent from this project, so please review their policies yourself.
|
|
57
|
+
- **Functional Networking**: The app connects to the internet to fetch update notices, usage instructions, and configuration data. No local data is uploaded in this process.
|
|
58
|
+
- **Anonymous Usage Statistics**: To improve the product, the app may collect **non-sensitive** data (such as version numbers and operating system type). This data does not include personal information, and you can disable this feature at any time in Settings.
|
|
59
|
+
|
|
60
|
+
## 3. Data Authorization & Usage Restrictions
|
|
61
|
+
|
|
62
|
+
Chat histories do not contain only your data. They also include what the other people in the conversation said. Please follow these principles when using this tool:
|
|
63
|
+
|
|
64
|
+
- **Lawful Authorization Principle**: You may only process chat records in which you **personally participated**. Other participants in those conversations also have privacy rights. If your analysis involves the privacy of identifiable individuals, especially **private chat contacts or group members**, you must ensure that you have obtained their informed consent.
|
|
65
|
+
- **Forbidden Uses**:
|
|
66
|
+
- It is **strictly prohibited** to use this tool to steal, monitor, or analyze another person's private information without authorization.
|
|
67
|
+
- It is **strictly prohibited** to analyze chat records obtained through illegal means, including unauthorized intrusion, account theft, or data hijacking.
|
|
68
|
+
- It is **strictly prohibited** to use analysis results for harassment, fraud, doxing, or any other conduct that infringes on the rights of others.
|
|
69
|
+
- It is **strictly prohibited** to use analysis content generated by this software, including AI-generated content, to fabricate or spread false or misleading information.
|
|
70
|
+
|
|
71
|
+
## 4. Risk Warning
|
|
72
|
+
|
|
73
|
+
- **Official Channels**: Please download this software only from [chatlab.fun](https://chatlab.fun) or [GitHub Releases](https://github.com/ChatLab/ChatLab/releases).
|
|
74
|
+
- **Supply Chain Risk**: This project is fully open-source, so anyone can repackage it. Unofficial versions shared by others may contain malicious code that could expose your API tokens, chat records, or local data. Please stay vigilant.
|
|
75
|
+
- **Accuracy of Results**: Analysis results generated by the software or AI may contain errors or hallucinations. They are for reference only and should not be used as legal evidence or as the basis for formal decisions.
|
|
76
|
+
|
|
77
|
+
## 5. Disclaimer
|
|
78
|
+
|
|
79
|
+
- **Software Purpose**: This software is provided for technical research, learning, and communication purposes only.
|
|
80
|
+
- **Platform Compliance**: You are solely responsible for ensuring that your acquisition and analysis of chat records complies with the terms of the original platform. The author assumes no liability if your account is restricted because your actions violate those terms.
|
|
81
|
+
- **Privacy Responsibility**: If the way you use this tool infringes another person's privacy or other lawful rights, you are solely responsible for the consequences.
|
|
82
|
+
- **Sole Responsibility**: All consequences arising from the use of this software, including but not limited to data loss, privacy disputes, and legal liability, are your sole responsibility.
|
|
83
|
+
- **Applicable Law**: This statement is governed by the laws applicable in your jurisdiction. If any part of this statement conflicts with mandatory local law, the local law shall prevail.
|
|
84
|
+
- **Acceptance of Statement**: By downloading, installing, or using this software, you acknowledge that you have read, understood, and agreed to all terms of this statement. If you do not agree, please stop using the software immediately and delete all related files.
|
|
85
|
+
|
|
86
|
+
Last Updated: March 14, 2026
|
|
87
|
+
`,St=`歡迎使用 ChatLab。這是一款**開源、以本機優先的聊天紀錄分析工具**。
|
|
88
|
+
|
|
89
|
+
我們相信,你有權理解自己的社交資料。但聊天紀錄不只屬於你,也承載著朋友、家人、同事的話語與信任。因此,在使用本工具前,請先仔細閱讀以下條款。
|
|
90
|
+
|
|
91
|
+
## 1. 核心功能與獨立性
|
|
92
|
+
|
|
93
|
+
- **僅分析,不提供匯出能力**:本工具僅用於分析你已自行匯出的聊天紀錄。我們不提供任何解密、抓包或匯出工具;從第三方聊天平台取得資料屬於你自己的行為與責任。
|
|
94
|
+
- **獨立第三方工具**:本專案為獨立開源專案,**與任何聊天平台、公司或組織皆無關聯**。
|
|
95
|
+
|
|
96
|
+
## 2. 資料隱私與安全
|
|
97
|
+
|
|
98
|
+
- **純本機分析**:預設情況下,聊天紀錄的儲存與分析都在你的裝置本機完成,**零上傳**。
|
|
99
|
+
- **AI 功能例外**:若你主動啟用 AI 功能,相關聊天資料會傳送至你設定的第三方模型服務商(如 OpenAI、DeepSeek 或其他服務商)。使用前請自行評估資料的敏感程度,**避免傳送高度私密的內容**。該第三方服務商的隱私政策獨立於本專案,請自行查閱。
|
|
100
|
+
- **功能性連網**:應用程式會透過網路取得更新通知、使用說明及設定資訊。此過程不會上傳任何本機資料。
|
|
101
|
+
- **匿名使用統計**:為了改善產品,軟體可能收集**非敏感**資料(如版本號、作業系統類型等)。這些資料不包含任何個人資訊,你也可以在設定中隨時關閉此功能。
|
|
102
|
+
|
|
103
|
+
## 3. 資料授權與使用限制
|
|
104
|
+
|
|
105
|
+
聊天紀錄中不只有你的資料,也包含對話另一方的內容。使用本工具時,請遵守以下原則:
|
|
106
|
+
|
|
107
|
+
- **合法授權原則**:你僅可處理你**本人參與**的聊天紀錄。聊天紀錄中的其他參與者同樣享有隱私權;若分析內容涉及特定個人的隱私,尤其是**私聊對象或群聊成員**,請務必先取得相關人士的知情同意。
|
|
108
|
+
- **禁止非法用途**:
|
|
109
|
+
- **嚴禁**用於竊取、監控或分析未經授權的他人隱私。
|
|
110
|
+
- **嚴禁**分析透過非法手段(如非法入侵、帳號竊取、資料劫持等)取得的聊天記錄。
|
|
111
|
+
- **嚴禁**將分析結果用於騷擾、詐騙、人肉搜尋或任何侵犯他人權益的行為。
|
|
112
|
+
- **嚴禁**利用本軟體產生的分析內容(含 AI 產生內容)編造、傳播虛假資訊或誤導性資訊。
|
|
113
|
+
|
|
114
|
+
## 4. 風險警告
|
|
115
|
+
|
|
116
|
+
- **官方下載管道**:請僅透過 [chatlab.fun](https://chatlab.fun) 或 [GitHub Releases](https://github.com/ChatLab/ChatLab/releases) 下載本軟體。
|
|
117
|
+
- **供應鏈風險**:本專案程式碼完全開源,任何人都可再次打包。非官方版本可能植入惡意程式碼,導致你的 API Token、聊天紀錄或本機資料外洩,請務必提高警覺。
|
|
118
|
+
- **結果準確性**:軟體與 AI 產生的分析結果可能有誤或出現「幻覺」,僅供參考,不應作為法律證據或正式決策依據。
|
|
119
|
+
|
|
120
|
+
## 5. 免責聲明
|
|
121
|
+
|
|
122
|
+
- **軟體用途**:本軟體僅供技術研究、學習與交流使用。
|
|
123
|
+
- **平台合規性**:取得聊天紀錄行為的合規性由使用者自行負責。若分析行為違反原始資料來源平台的服務條款,導致帳號受限或其他後果,作者不承擔任何責任。
|
|
124
|
+
- **隱私責任**:若你對本工具的使用方式侵犯了他人的隱私權或其他合法權益,相關責任由你自行承擔。
|
|
125
|
+
- **責任自負**:使用本軟體所產生的一切後果,包括但不限於資料遺失、隱私糾紛或法律責任,均由使用者自行承擔。
|
|
126
|
+
- **適用法律**:本聲明適用你所在司法管轄區的相關法律;若本聲明與當地強制性法律規定牴觸,應以當地法律為準。
|
|
127
|
+
- **接受聲明**:下載、安裝或使用本軟體,即表示你已閱讀、理解並同意本聲明全部內容;若不同意,請立即停止使用並刪除相關程式。
|
|
128
|
+
|
|
129
|
+
修訂日期:2026-03-14
|
|
130
|
+
`,$t=`ChatLab へようこそ。ChatLab は、**オープンソースかつローカル完結型のチャット履歴分析ツール**です。
|
|
131
|
+
|
|
132
|
+
私たちは、あなたが自分のソーシャルデータを理解する権利を尊重しています。ただし、チャット履歴はあなただけのものではなく、友人、家族、同僚の言葉や信頼も含んでいます。本ツールを利用する前に、以下の内容をよくお読みください。
|
|
133
|
+
|
|
134
|
+
## 1. コア機能と独立性
|
|
135
|
+
|
|
136
|
+
- **分析専用で、取得機能は提供しません**:本ツールは、すでにエクスポート済みのチャット履歴を分析するためのものです。復号、パケットキャプチャ、エクスポートツールは提供していません。第三者のチャットプラットフォームからデータを取得する行為は、利用者自身の判断と責任で行ってください。
|
|
137
|
+
- **独立した第三者ツールです**:本プロジェクトは独立したオープンソースプロジェクトであり、**いかなるチャットプラットフォーム、企業、団体とも関係ありません**。
|
|
138
|
+
|
|
139
|
+
## 2. データのプライバシーとセキュリティ
|
|
140
|
+
|
|
141
|
+
- **ローカル完結の分析**:初期設定では、チャット履歴の保存と分析はすべて端末内で行われ、**外部へアップロードされません**。
|
|
142
|
+
- **AI 機能利用時の例外**:AI 機能を有効にした場合、関連するチャットデータは、利用者が設定した外部モデル提供事業者(OpenAI、DeepSeek、その他の事業者など)に送信されます。利用前にデータの機微性を十分に確認し、**特に私的性の高い内容は送信しないでください**。当該事業者のプライバシーポリシーは本プロジェクトとは別に定められているため、各自で確認してください。
|
|
143
|
+
- **機能上必要な通信**:アプリは、更新案内、利用ガイド、設定情報を取得するために通信を行います。この過程でローカルデータが送信されることはありません。
|
|
144
|
+
- **匿名の利用統計**:製品改善のため、バージョン番号や OS 種別などの**非機微情報**を収集する場合があります。これらのデータには個人情報は含まれず、設定画面からいつでも無効にできます。
|
|
145
|
+
|
|
146
|
+
## 3. データ利用の範囲と制限
|
|
147
|
+
|
|
148
|
+
チャット履歴に含まれるのは、あなたのデータだけではありません。会話相手の発言や情報も含まれます。本ツールを利用する際は、以下の原則を守ってください。
|
|
149
|
+
|
|
150
|
+
- **正当な権限があるデータのみ扱ってください**:処理できるのは、**自分が参加した**チャット履歴に限られます。その履歴に含まれる他の参加者にもプライバシー権があります。分析対象が特定の個人のプライバシー、特に**個人チャットの相手やグループチャットの参加者**に及ぶ場合は、必ず事前に十分な説明と同意を得てください。
|
|
151
|
+
- **禁止される用途**:
|
|
152
|
+
- 他者の未承認のプライバシーを窃取、監視、または分析する目的での使用は**厳禁**です。
|
|
153
|
+
- 違法な手段(不正アクセス、アカウント窃取、データハイジャックなど)で取得したチャット記録の分析は**厳禁**です。
|
|
154
|
+
- 分析結果を嫌がらせ、詐欺、晒し行為(人肉検索)、または他者の権利を侵害するいかなる行為に使用することは**厳禁**です。
|
|
155
|
+
- 本ソフトウェアが生成した分析コンテンツ(AI 生成コンテンツを含む)を使用して、虚偽または誤解を招く情報を捏造または拡散することは**厳禁**です。
|
|
156
|
+
|
|
157
|
+
## 4. 注意事項
|
|
158
|
+
|
|
159
|
+
- **公式配布元のみ利用してください**:本ソフトウェアは [chatlab.fun](https://chatlab.fun) または [GitHub Releases](https://github.com/ChatLab/ChatLab/releases) からのみ入手してください。
|
|
160
|
+
- **サプライチェーンリスクに注意してください**:本プロジェクトは完全オープンソースのため、第三者が再配布版を作成できます。非公式版には悪意あるコードが含まれる可能性があり、API トークン、チャット履歴、ローカルデータの漏えいにつながるおそれがあります。
|
|
161
|
+
- **結果の正確性は保証されません**:ソフトウェアや AI が生成する分析結果には、誤りやハルシネーションが含まれる可能性があります。参考情報として扱い、法的証拠や正式な判断材料には使用しないでください。
|
|
162
|
+
|
|
163
|
+
## 5. 免責事項
|
|
164
|
+
|
|
165
|
+
- **利用目的**:本ソフトウェアは、技術研究、学習、交流を目的として提供されています。
|
|
166
|
+
- **各プラットフォームの規約遵守は利用者の責任です**:チャット履歴の取得や分析が、元のサービスの利用規約に抵触した結果としてアカウント制限などが発生しても、作者は責任を負いません。
|
|
167
|
+
- **プライバシー侵害に関する責任**:本ツールの利用方法によって他者のプライバシー権その他の適法な権利を侵害した場合、その責任は利用者自身が負います。
|
|
168
|
+
- **利用は自己責任です**:本ソフトウェアの利用によって生じたいかなる結果も、利用者自身の責任となります。これにはデータ損失、プライバシー上の争い、法的責任などが含まれます。
|
|
169
|
+
- **準拠法**:本声明には、利用者が所在する法域で適用される法令が適用されます。本声明の内容が現地の強行法規と抵触する場合は、当該法令が優先されます。
|
|
170
|
+
- **本声明への同意**:本ソフトウェアをダウンロード、インストール、または使用した時点で、本声明の内容を読み、理解し、同意したものとみなされます。同意できない場合は、直ちに使用を中止し、関連ファイルを削除してください。
|
|
171
|
+
|
|
172
|
+
改訂日:2026年3月14日
|
|
173
|
+
`,It={class:"agreement-modal flex max-h-[85vh] flex-col p-6"},Ct={class:"mb-4 flex items-center gap-3"},At={class:"flex h-12 w-12 items-center justify-center rounded-xl bg-linear-to-br from-pink-100 to-rose-100 dark:from-pink-900/30 dark:to-rose-900/30"},Lt={class:"text-xl font-bold text-gray-900 dark:text-white"},Tt={class:"text-sm text-gray-500 dark:text-gray-400"},Mt={class:"mb-6 flex-1 overflow-y-auto pr-4"},Ft=["innerHTML"],Pt={class:"flex items-center justify-end gap-3 border-t border-gray-200 pt-4 dark:border-gray-700"},ke="2.0",me="chatlab_agreement_version",Ut=J({__name:"AgreementModal",setup(L,{expose:o}){const{t:i}=Z(),v=ge(),{locale:r}=pe(v),x=C(!1),m=C(!1),h=new mt({html:!1,breaks:!0,linkify:!0,typographer:!0});h.renderer.rules.link_open=(S,g,T,b,$)=>(S[g].attrSet("target","_blank"),S[g].attrSet("rel","noopener noreferrer"),$.renderToken(S,g,T));const w={"zh-CN":wt,"zh-TW":St,"en-US":Fe,"ja-JP":$t},f=N(()=>w[r.value]??Fe),p=N(()=>h.render(f.value));function _(){localStorage.setItem(me,ke),x.value=!1}function F(){localStorage.removeItem(me),window.api?.send?.("window-close")}function A(){const S=localStorage.getItem(me);S&&S!==ke&&(m.value=!0),x.value=!0}function z(){return localStorage.getItem(me)!==ke}return o({open:A,needsAgreement:z}),(S,g)=>{const T=se,b=st,$=ae,y=le;return n(),B(y,{open:x.value,"prevent-close":"",ui:{content:"md:w-full max-w-2xl",overlay:"backdrop-blur-sm"}},{content:P(()=>[e("div",It,[e("div",Ct,[e("div",At,[d(T,{name:"i-heroicons-document-text",class:"h-6 w-6 text-pink-600 dark:text-pink-400"})]),e("div",null,[e("h2",Lt,s(t(i)("common.agreement.title")),1),e("p",Tt,s(t(i)("common.agreement.subtitle")),1)])]),m.value?(n(),B(b,{key:0,icon:"i-heroicons-exclamation-triangle",title:t(i)("common.agreement.updateNotice"),class:"mb-4 pt-2"},null,8,["title"])):D("",!0),e("div",Mt,[e("div",{class:"agreement-content",innerHTML:p.value},null,8,Ft)]),e("div",Pt,[d($,{variant:"ghost",color:"neutral",size:"lg",onClick:F},{default:P(()=>[E(s(t(i)("common.agreement.disagree")),1)]),_:1}),d($,{color:"primary",size:"lg",class:"bg-pink-500 hover:bg-pink-600 dark:bg-pink-600 dark:hover:bg-pink-700",onClick:_},{default:P(()=>[E(s(t(i)("common.agreement.agree")),1)]),_:1})])])]),_:1},8,["open"])}}}),jt=De(Ut,[["__scopeId","data-v-af4bfd14"]]),Dt={class:"p-6 text-center"},zt={class:"mb-2 text-lg font-semibold text-gray-900 dark:text-white"},Et={key:0,class:"mb-3 text-sm text-gray-500 dark:text-gray-400"},Rt={key:1,class:"mb-4 rounded-lg bg-gray-50 p-3 text-left dark:bg-gray-800"},Bt={class:"mb-2 text-xs font-medium text-gray-500 dark:text-gray-400"},Ot={class:"space-y-2"},Nt={class:"text-sm text-gray-700 dark:text-gray-300"},Vt={class:"text-xs text-gray-400 dark:text-gray-500"},Ht={key:2,class:"mb-4 rounded-lg bg-red-50 p-3 text-left text-sm text-red-600 dark:bg-red-900/20 dark:text-red-400"},Gt={class:"flex flex-col gap-2"},Wt={class:"flex items-start gap-2"},qt={class:"text-xs text-red-500 dark:text-red-400"},Zt={class:"flex gap-3"},Jt=J({__name:"MigrationModal",setup(L){const{t:o}=Z(),i=$e(),{migrationCount:v,pendingMigrations:r,isMigrating:x}=pe(i),m=C(!1),h=C(null),w=C(!1),f=N(()=>h.value!==null);async function p(){h.value=null,w.value=!1;const F=await i.runMigration();F.success?(m.value=!1,await i.loadSessions()):(h.value=F.error||o("home.migration.failed"),w.value=!0,await i.loadSessions())}function _(){f.value&&(m.value=!1)}return ve(async()=>{(await i.checkMigration()).needsMigration&&(m.value=!0)}),(F,A)=>{const z=se,S=ae,g=le;return n(),B(g,{open:m.value,ui:{content:"max-w-md"},"prevent-close":!f.value},{content:P(()=>[e("div",Dt,[e("div",{class:O(["mx-auto mb-4 flex h-14 w-14 items-center justify-center rounded-full",h.value?"bg-amber-100 dark:bg-amber-900/30":"bg-blue-100 dark:bg-blue-900/30"])},[d(z,{name:h.value?"i-heroicons-exclamation-triangle":"i-heroicons-arrow-up-circle",class:O(h.value?"h-7 w-7 text-amber-500":"h-7 w-7 text-blue-500")},null,8,["name","class"])],2),e("h3",zt,s(h.value?t(o)("home.migration.partialFailed"):t(o)("home.migration.title")),1),h.value?D("",!0):(n(),c("p",Et,[E(s(t(o)("home.migration.description",{count:t(v)}))+" ",1),A[0]||(A[0]=e("br",null,null,-1)),E(" "+s(t(o)("home.migration.note")),1)])),t(r).length>0&&!h.value?(n(),c("div",Rt,[e("p",Bt,s(t(o)("home.migration.upgradeContent")),1),e("ul",Ot,[(n(!0),c(H,null,q(t(r),T=>(n(),c("li",{key:T.version,class:"flex items-start gap-2"},[d(z,{name:"i-heroicons-check-circle",class:"mt-0.5 h-4 w-4 shrink-0 text-green-500"}),e("div",null,[e("p",Nt,s(T.userMessage),1),e("p",Vt,s(T.description),1)])]))),128))])])):D("",!0),h.value?(n(),c("div",Ht,[e("div",Gt,[e("div",Wt,[d(z,{name:"i-heroicons-exclamation-circle",class:"mt-0.5 h-4 w-4 shrink-0"}),e("span",null,s(h.value),1)]),e("p",qt,s(t(o)("home.migration.errorHint")),1)])])):D("",!0),e("div",Zt,[f.value?(n(),B(S,{key:0,color:"neutral",variant:"outline",size:"lg",class:"flex-1",onClick:_},{default:P(()=>[E(s(t(o)("home.migration.close")),1)]),_:1})):D("",!0),d(S,{color:"primary",size:"lg",loading:t(x),class:O(f.value?"flex-1":"w-full"),onClick:p},{default:P(()=>[E(s(t(x)?t(o)("home.migration.upgrading"):h.value?t(o)("home.migration.retry"):t(o)("home.migration.upgradeNow")),1)]),_:1},8,["loading","class"])])])]),_:1},8,["open","prevent-close"])}}}),Yt={class:"min-w-0 flex-1"},Kt={class:"truncate text-sm font-medium text-gray-900 dark:text-white"},Qt={key:0,class:"text-xs text-gray-500 dark:text-gray-400"},Xt={class:"text-xs text-gray-400"},we=J({__name:"FileListItem",props:{name:{},statusIcon:{},statusClass:{},progressText:{},index:{},total:{},highlight:{type:Boolean}},setup(L){return(o,i)=>{const v=se;return n(),c("div",{class:O(["flex items-center gap-3 rounded-lg px-3 py-2 transition-colors",{"bg-pink-50/50 dark:bg-pink-500/5":L.highlight}])},[d(v,{name:L.statusIcon,class:O(["h-5 w-5 shrink-0",L.statusClass])},null,8,["name","class"]),e("div",Yt,[e("p",Kt,s(L.name),1),L.progressText?(n(),c("p",Qt,s(L.progressText),1)):D("",!0),Te(o.$slots,"extra")]),e("span",Xt,s(L.index+1)+"/"+s(L.total),1),Te(o.$slots,"action")],2)}}}),eo={class:"min-h-[200px]"},to={key:0,class:"flex flex-col items-center justify-center py-12"},oo={class:"text-gray-500 dark:text-gray-400"},so={key:1,class:"flex flex-col items-center justify-center py-12"},no={class:"text-red-600 dark:text-red-400"},ao={key:2},ro={class:"mb-2 flex items-center justify-between"},io={class:"flex items-center gap-2"},lo={class:"text-xs text-gray-400"},co={key:0,class:"text-sm font-medium text-pink-600 dark:text-pink-400"},uo={class:"max-h-[420px] space-y-0.5 overflow-y-auto pr-1"},ho=["onClick"],mo={class:"min-w-0 flex-1"},go={class:"truncate text-sm font-medium text-gray-900 dark:text-white"},po={class:"text-xs text-gray-500 dark:text-gray-400"},fo={key:3,class:"flex flex-col items-center justify-center py-12"},vo={class:"text-gray-500 dark:text-gray-400"},xo={class:"flex w-full justify-end gap-2"},yo=J({__name:"ChatSelector",props:{open:{type:Boolean},filePath:{}},emits:["update:open","select"],setup(L,{emit:o}){const i=L,v=o,{t:r}=Z(),x=N({get:()=>i.open,set:$=>v("update:open",$)}),m=C([]),h=C(!1),w=C(null),f=C(new Set),p=N(()=>f.value.size),_=N(()=>m.value.length>0&&f.value.size===m.value.length);function F($){const y=$.toLowerCase();return y.includes("personal")||y.includes("private_chat")||y.includes("bot")||y.includes("saved")?"i-heroicons-user":y.includes("group")||y.includes("supergroup")||y.includes("channel")?"i-heroicons-user-group":"i-heroicons-chat-bubble-left-right"}function A($){return $.replace(/_/g," ").replace(/\b\w/g,y=>y.toUpperCase())}async function z(){h.value=!0,w.value=null,m.value=[],f.value=new Set;try{const $=await oe().scanMultiChatFile(i.filePath);$.length>0?m.value=$:w.value=r("home.chatSelector.scanFailed")}catch($){w.value=String($)}finally{h.value=!1}}xe(()=>i.open,$=>{$&&i.filePath&&z()});function S($){const y=new Set(f.value);y.has($)?y.delete($):y.add($),f.value=y}function g(){_.value?f.value=new Set:f.value=new Set(m.value.map($=>$.index))}function T(){const $=m.value.filter(y=>f.value.has(y.index));x.value=!1,v("select",$)}function b(){x.value=!1}return($,y)=>{const Y=se,V=ae,X=Ue,K=le;return n(),B(K,{open:x.value,"onUpdate:open":y[1]||(y[1]=k=>x.value=k),title:t(r)("home.chatSelector.title")},{body:P(()=>[e("div",eo,[h.value?(n(),c("div",to,[d(Y,{name:"i-heroicons-arrow-path",class:"mb-4 h-8 w-8 animate-spin text-pink-500"}),e("p",oo,s(t(r)("home.chatSelector.scanning")),1)])):w.value?(n(),c("div",so,[d(Y,{name:"i-heroicons-exclamation-circle",class:"mb-4 h-8 w-8 text-red-500"}),e("p",no,s(w.value),1),d(V,{class:"mt-4",size:"sm",variant:"soft",onClick:z},{default:P(()=>[E(s(t(r)("home.chatSelector.retry")),1)]),_:1})])):m.value.length>0?(n(),c("div",ao,[e("div",ro,[e("div",io,[d(X,{"model-value":_.value,label:t(r)("home.chatSelector.selectAll"),size:"sm","onUpdate:modelValue":g},null,8,["model-value","label"]),e("span",lo," ("+s(t(r)("home.chatSelector.chatCount",{count:m.value.length}))+") ",1)]),p.value>0?(n(),c("span",co,s(t(r)("home.chatSelector.selected",{count:p.value})),1)):D("",!0)]),e("div",uo,[(n(!0),c(H,null,q(m.value,k=>(n(),c("div",{key:k.index,class:O(["flex cursor-pointer items-center gap-2 rounded-lg px-2.5 py-1.5 transition-colors",f.value.has(k.index)?"bg-pink-50 dark:bg-pink-500/10":"hover:bg-gray-100 dark:hover:bg-gray-800"]),onClick:U=>S(k.index)},[d(X,{"model-value":f.value.has(k.index),size:"sm",onClick:y[0]||(y[0]=ct(()=>{},["stop"]))},null,8,["model-value"]),e("div",{class:O(["flex h-7 w-7 shrink-0 items-center justify-center rounded-md",f.value.has(k.index)?"bg-pink-100 dark:bg-pink-500/20":"bg-gray-100 dark:bg-gray-700"])},[d(Y,{name:F(k.type),class:O(["h-3.5 w-3.5",f.value.has(k.index)?"text-pink-600 dark:text-pink-400":"text-gray-500 dark:text-gray-400"])},null,8,["name","class"])],2),e("div",mo,[e("p",go,s(k.name||`Chat ${k.id}`),1),e("p",po,s(A(k.type))+" · "+s(t(r)("home.chatSelector.messageCount",{count:k.messageCount.toLocaleString()})),1)])],10,ho))),128))])])):(n(),c("div",fo,[d(Y,{name:"i-heroicons-chat-bubble-left-right",class:"mb-4 h-8 w-8 text-gray-400"}),e("p",vo,s(t(r)("home.chatSelector.noChats")),1)]))])]),footer:P(()=>[e("div",xo,[d(V,{variant:"ghost",color:"neutral",onClick:b},{default:P(()=>[E(s(t(r)("common.cancel")),1)]),_:1}),d(V,{disabled:p.value===0,onClick:T},{default:P(()=>[E(s(t(r)("home.chatSelector.import",{count:p.value})),1)]),_:1},8,["disabled"])])]),_:1},8,["open","title"])}}}),_o={class:"min-h-[200px]"},bo={class:"mb-3 text-sm text-gray-500 dark:text-gray-400"},ko={key:0,class:"flex items-center justify-center py-12"},wo={key:1,class:"max-h-[400px] space-y-3 overflow-y-auto pr-1"},So={class:"mb-1 flex items-center gap-1.5 px-1"},$o={class:"text-xs font-medium text-gray-400 uppercase"},Io={class:"space-y-0.5"},Co=["onClick"],Ao={class:"min-w-0 flex-1"},Lo={class:"text-sm font-medium text-gray-900 dark:text-white"},To={class:"text-xs text-gray-400"},Mo={class:"flex w-full justify-end gap-2"},Fo=J({__name:"FormatSelectorModal",props:{open:{type:Boolean},filePath:{}},emits:["update:open","select"],setup(L,{emit:o}){const i=L,v=o,{t:r}=Z(),x=N({get:()=>i.open,set:S=>v("update:open",S)}),m=C([]),h=C(!1),w=C(null),f=new Set(["whatsapp","line","unknown"]),p=N(()=>{const S=new Map;for(const g of m.value){if(!f.has(g.platform))continue;const T=S.get(g.platform)??[];T.push(g),S.set(g.platform,T)}return S});function _(S){const g=S.toLowerCase();return g.includes("whatsapp")?"i-simple-icons-whatsapp":g.includes("telegram")?"i-simple-icons-telegram":g.includes("line")?"i-simple-icons-line":g.includes("qq")?"i-simple-icons-tencentqq":g.includes("wechat")||g.includes("weixin")?"i-simple-icons-wechat":g.includes("discord")?"i-simple-icons-discord":g.includes("instagram")?"i-simple-icons-instagram":(g.includes("chatlab"),"i-heroicons-chat-bubble-left-right")}async function F(){h.value=!0;try{const S=await oe().getSupportedFormats();m.value=S}catch{m.value=[]}finally{h.value=!1}}xe(()=>i.open,S=>{S&&(w.value=null,F())});function A(){w.value&&(x.value=!1,v("select",w.value))}function z(){x.value=!1}return(S,g)=>{const T=se,b=ae,$=le;return n(),B($,{open:x.value,"onUpdate:open":g[0]||(g[0]=y=>x.value=y),title:t(r)("home.formatSelector.title")},{body:P(()=>[e("div",_o,[e("p",bo,s(t(r)("home.formatSelector.hint")),1),h.value?(n(),c("div",ko,[d(T,{name:"i-heroicons-arrow-path",class:"h-6 w-6 animate-spin text-pink-500"})])):(n(),c("div",wo,[(n(!0),c(H,null,q(p.value,([y,Y])=>(n(),c("div",{key:y},[e("div",So,[d(T,{name:_(y),class:"h-3.5 w-3.5 text-gray-400"},null,8,["name"]),e("span",$o,s(y),1)]),e("div",Io,[(n(!0),c(H,null,q(Y,V=>(n(),c("div",{key:V.id,class:O(["flex cursor-pointer items-center gap-2.5 rounded-lg px-2.5 py-2 transition-colors",w.value===V.id?"bg-pink-50 ring-1 ring-pink-200 dark:bg-pink-500/10 dark:ring-pink-500/30":"hover:bg-gray-100 dark:hover:bg-gray-800"]),onClick:X=>w.value=V.id},[e("div",{class:O(["flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 transition-colors",w.value===V.id?"border-pink-500 bg-pink-500":"border-gray-300 dark:border-gray-600"])},[w.value===V.id?(n(),B(T,{key:0,name:"i-heroicons-check-20-solid",class:"h-3 w-3 text-white"})):D("",!0)],2),e("div",Ao,[e("p",Lo,s(V.name),1),e("p",To,s(V.extensions.join(", ")),1)])],10,Co))),128))])]))),128))]))])]),footer:P(()=>[e("div",Mo,[d(b,{variant:"ghost",color:"neutral",onClick:z},{default:P(()=>[E(s(t(r)("common.cancel")),1)]),_:1}),d(b,{disabled:!w.value,onClick:A},{default:P(()=>[E(s(t(r)("home.formatSelector.confirm")),1)]),_:1},8,["disabled"])])]),_:1},8,["open","title"])}}}),Po={class:"flex flex-col items-center gap-2"},Uo={key:0,class:"text-xs text-red-500 dark:text-red-400"},jo=J({__name:"DemoImportButton",setup(L){const{t:o}=Z(),i=je(),v=$e(),r=ge(),x=C(!1),m=C("downloading"),h=C(null);async function w(_){const F=await Re().getSession(_);if(F){const A=F.type==="private"?"private-chat":"group-chat";i.push({name:A,params:{id:_}})}}async function f(){const _=fe(r.locale)||"en";return oe().importDemo(_,F=>{m.value=F.stage})}async function p(){x.value=!0,h.value=null,m.value="downloading";try{const _=await f();if(_.success&&_.groupSessionId){await v.loadSessions(),v.selectSession(_.groupSessionId);try{const F=ze(),A=Ee();await A.generate(_.groupSessionId,F),_.privateSessionId&&await A.generate(_.privateSessionId,F)}catch(F){console.error("自动生成会话索引失败:",F)}await w(_.groupSessionId)}else h.value=_.error||o("home.demo.failed")}catch(_){h.value=String(_)}finally{x.value=!1}}return(_,F)=>{const A=ae;return n(),c("div",Po,[d(A,{"trailing-icon":x.value?void 0:"i-heroicons-chevron-right-20-solid",loading:x.value,disabled:x.value,onClick:p},{default:P(()=>[E(s(x.value?m.value==="downloading"?t(o)("home.demo.downloading"):t(o)("home.demo.importing"):t(o)("home.demo.viewExample")),1)]),_:1},8,["trailing-icon","loading","disabled"]),h.value?(n(),c("p",Uo,s(h.value),1)):D("",!0)])}}}),Do={class:"flex flex-col items-center space-y-6"},zo={key:0,class:"w-full max-w-4xl rounded-3xl border border-gray-200/50 bg-gray-100/50 px-8 py-6 backdrop-blur-md dark:border-white/10 dark:bg-gray-800/40"},Eo={class:"mb-4 flex items-center justify-between"},Ro={class:"flex items-center gap-3"},Bo={class:"flex h-10 w-10 items-center justify-center rounded-xl bg-pink-50 dark:bg-pink-500/10"},Oo={class:"text-lg font-semibold text-gray-900 dark:text-white"},No={class:"text-sm text-gray-500 dark:text-gray-400"},Vo={class:"max-h-52 space-y-2 overflow-y-auto"},Ho={key:1,class:"w-full max-w-4xl rounded-3xl border border-gray-200/50 bg-gray-100/50 px-8 py-6 backdrop-blur-md dark:border-white/10 dark:bg-gray-800/40"},Go={class:"mb-4 flex items-center justify-between"},Wo={class:"flex items-center gap-3"},qo={class:"flex h-10 w-10 items-center justify-center rounded-xl bg-pink-50 dark:bg-pink-500/10"},Zo={class:"text-lg font-semibold text-gray-900 dark:text-white"},Jo={class:"text-sm text-gray-500 dark:text-gray-400"},Yo={class:"max-h-52 space-y-2 overflow-y-auto"},Ko={key:2,class:"w-full max-w-4xl rounded-3xl border border-gray-200/50 bg-gray-100/50 px-8 py-6 backdrop-blur-md dark:border-white/10 dark:bg-gray-800/40"},Qo={class:"flex items-center justify-between"},Xo={class:"flex items-center gap-3"},es={class:"flex h-10 w-10 items-center justify-center rounded-xl bg-green-50 dark:bg-green-500/10"},ts={class:"text-lg font-semibold text-gray-900 dark:text-white"},os={class:"text-sm text-gray-500 dark:text-gray-400"},ss={class:"flex items-center gap-2"},ns={key:3,class:"w-full max-w-4xl rounded-3xl border border-gray-200/50 bg-gray-100/50 px-8 py-6 backdrop-blur-md dark:border-white/10 dark:bg-gray-800/40"},as={class:"mb-4 flex items-center justify-between"},rs={class:"flex items-center gap-3"},is={class:"text-lg font-semibold text-gray-900 dark:text-white"},ls={class:"text-sm text-gray-500 dark:text-gray-400"},cs={class:"max-h-52 space-y-2 overflow-y-auto"},us={key:0,class:"text-xs text-red-500"},ds={key:1,class:"text-xs text-gray-500"},hs={class:"w-full min-w-80 text-center"},ms={class:"mb-4 text-lg font-semibold text-gray-900 dark:text-white"},gs={class:"mx-auto w-full max-w-md"},ps={class:"mt-3 text-sm text-gray-500 dark:text-gray-400"},fs={class:"text-lg font-semibold text-gray-900 dark:text-white"},vs={class:"mt-2 text-sm text-gray-500 dark:text-gray-400"},xs={key:5,class:"flex flex-wrap items-center justify-center gap-4"},ys={class:"flex items-center gap-2"},_s={class:"max-w-xs px-3 py-2 text-xs text-gray-600 dark:text-gray-300"},bs={key:6,class:"flex max-w-lg flex-col items-center gap-3 rounded-lg bg-red-50 px-4 py-4 dark:bg-red-900/20"},ks={class:"flex items-center gap-2 text-sm text-red-600 dark:text-red-400"},ws={key:0,class:"w-full rounded-md bg-gray-100 px-3 py-2 text-xs text-gray-700 dark:bg-gray-800 dark:text-gray-300"},Ss={class:"flex items-start gap-2"},$s={class:"space-y-1"},Is={key:0},Cs={key:1,class:"text-xs text-gray-500 dark:text-gray-400"},As={class:"flex gap-2"},Ls={class:"flex items-center gap-3"},Ts=J({__name:"ImportArea",setup(L){const{t:o}=Z(),i=$e(),{isImporting:v,importProgress:r,isBatchImporting:x,batchFiles:m,batchImportResult:h,isMergeImporting:w,mergeFiles:f,mergeStage:p,mergeError:_,mergeResult:F}=pe(i),A=C(!1),z=C(""),S=C(!1),g=C("");async function T(l){try{const u=ze();await Ee().generate(l,u)}catch(u){console.error("自动生成会话索引失败:",u)}}const b=C(null),$=C(!1),y=C(null),Y=je(),V=C(!1),X=N(()=>i.sessions.length===0),K=N(()=>v.value||x.value||w.value),k=N(()=>{if(!x.value||m.value.length===0)return null;const l=m.value.filter(a=>a.status==="success"||a.status==="failed"||a.status==="cancelled").length,u=m.value.findIndex(a=>a.status==="importing");return{completed:l,total:m.value.length,currentIndex:u}});function U(l){if(l.startsWith("error.")){const u=`home.import.errors.${l.slice(6)}`,a=o(u);return a!==u?a:l}return l}async function R(l){const u=await Re().getSession(l);if(u){const a=u.type==="private"?"private-chat":"group-chat";Y.push({name:a,params:{id:l}})}}const re=C(null),ce=C(!1);async function G(){if(b.value=null,$.value=!1,y.value=null,ce.value){Ne();return}re.value?.openFileDialog()}async function Q({files:l,paths:u}){b.value=null,$.value=!1,y.value=null,l.length>0?await ee(l):b.value=o("home.import.cannotReadPath")}async function ee(l){const u=oe();if(l.length===1){const a=l[0],M=await u.detectFormat(a);if(M?.multiChat){ie.value=a;const j=await u.scanMultiChatFile(a);if(j.length>0){de.value=j.map(W=>({index:W.index,name:W.name,type:W.type,id:W.id,messageCount:W.messageCount})),A.value=!0;return}}M||(he.value=a,g.value=a.name),await ue(a)}else for(const a of l)await ue(a)}const ie=C(null),de=C([]);async function ue(l,u){v.value=!0,r.value={stage:"detecting",progress:0,message:""};try{const a=await oe().importFile(l,u,M=>{M.stage!=="done"&&(r.value=M)});r.value&&(r.value.progress=100),await new Promise(M=>setTimeout(M,300)),a.success&&a.sessionId?(await i.loadSessions(),i.selectSession(a.sessionId),await R(a.sessionId)):b.value=U(a.error||"error.import_failed")}catch(a){b.value=String(a)}finally{v.value=!1,setTimeout(()=>{r.value=null},500)}}const Ie=C(null);async function Ne(){b.value=null,Ie.value?.openFileDialog()}async function Ve({files:l}){l.length!==0&&(b.value=null,await ye(l))}async function He({files:l,dirPath:u}){b.value=null,$.value=!1,y.value=null,u?await ye(u):l.length>0&&await ye(l)}async function ye(l){v.value=!0,r.value={stage:"detecting",progress:0,message:""};try{const u=await oe().importDirectory(l,void 0,a=>{a.stage!=="done"&&(r.value=a)});r.value&&(r.value.progress=100),await new Promise(a=>setTimeout(a,300)),u.success&&u.sessionId?(await i.loadSessions(),i.selectSession(u.sessionId),await R(u.sessionId)):b.value=U(u.error||"error.import_failed")}catch(u){b.value=String(u)}finally{v.value=!1,setTimeout(()=>{r.value=null},500)}}const he=C(null);async function Ge(l){if(he.value){const a=he.value;he.value=null,await ue(a,{formatId:l});return}const u=g.value;if(u){b.value=null,y.value=null,v.value=!0,r.value={stage:"detecting",progress:0,message:""};try{const a=await oe().importFile(u,{formatId:l},M=>{M.stage!=="done"&&(r.value=M)});r.value&&(r.value.progress=100),await new Promise(M=>setTimeout(M,300)),a.success&&a.sessionId?(await i.loadSessions(),i.selectSession(a.sessionId),await T(a.sessionId),await R(a.sessionId)):b.value=U(a.error||"error.import_failed")}catch(a){b.value=String(a)}finally{v.value=!1,setTimeout(()=>{r.value=null},500)}}}async function We(l){if(l.length===0)return;if(ie.value){const a=ie.value;if(ie.value=null,de.value=[],l.length===1)await ue(a,{chatIndex:l[0].index});else for(const M of l)await ue(a,{chatIndex:M.index});return}const u=z.value;if(l.length===1){v.value=!0,r.value={stage:"detecting",progress:0,message:""};try{const a=await oe().importFile(u,{chatIndex:l[0].index},M=>{M.stage!=="done"&&(r.value=M)});r.value&&(r.value.progress=100),await new Promise(M=>setTimeout(M,300)),a.success&&a.sessionId?(await i.loadSessions(),i.selectSession(a.sessionId),await T(a.sessionId),await R(a.sessionId)):b.value=U(a.error||"error.import_failed")}catch(a){b.value=String(a)}finally{v.value=!1,setTimeout(()=>{r.value=null},500)}}else{x.value=!0,m.value=l.map(j=>({path:`${u}#${j.index}`,name:j.name||`Chat ${j.id}`,status:"pending"}));let a=0,M=0;for(let j=0;j<l.length;j++){const W=l[j];m.value[j].status="importing";try{const te=await oe().importFile(u,{chatIndex:W.index},I=>{I.stage!=="done"&&(m.value[j].progress=I)});te.success&&te.sessionId?(m.value[j].status="success",m.value[j].sessionId=te.sessionId,a++,await T(te.sessionId)):(m.value[j].status="failed",m.value[j].error=te.error,M++)}catch(te){m.value[j].status="failed",m.value[j].error=String(te),M++}}await i.loadSessions(),x.value=!1,h.value={total:l.length,success:a,failed:M,cancelled:0,files:m.value.map(j=>({path:j.path,name:j.name,status:j.status,sessionId:j.sessionId,error:j.error}))}}}async function qe(){if(F.value?.sessionId){const l=F.value.sessionId;i.clearMergeImportResult(),await R(l)}}function Ce(){i.clearMergeImportResult()}function Ze(){i.cancelBatchImport()}function Je(){i.clearBatchImportResult()}async function Ye(l){i.clearBatchImportResult(),await R(l)}const Ke=N(()=>{const{locale:l}=Z(),u=fe(l.value);return`https://chatlab.fun${u?`/${u}`:""}/usage/how-to-export?utm_source=app`});async function Qe(){const l=await window.cacheApi.getLatestImportLog();l.success&&l.path?await window.cacheApi.showInFolder(l.path):await window.cacheApi.openDir("logs")}function Xe(){if(!r.value)return"";switch(r.value.stage){case"detecting":return o("home.import.progress.detecting");case"reading":return o("home.import.progress.reading");case"parsing":return o("home.import.progress.parsing");case"saving":return o("home.import.progress.saving");case"done":return o("home.import.progress.done");case"error":return o("home.import.progress.error");default:return""}}function et(){if(!r.value)return"";const{messagesProcessed:l,totalBytes:u,bytesRead:a}=r.value;if(l&&l>0)return o("home.import.processed",{count:l.toLocaleString()});if(u&&a){const M=Math.round(a/u*100),j=(a/1024/1024).toFixed(1),W=(u/1024/1024).toFixed(1);return`${j} MB / ${W} MB (${M}%)`}return r.value.message||""}const Ae={pending:{icon:"i-heroicons-clock",class:"text-gray-400"},importing:{icon:"i-heroicons-arrow-path",class:"text-pink-500 animate-spin"},parsing:{icon:"i-heroicons-arrow-path",class:"text-pink-500 animate-spin"},success:{icon:"i-heroicons-check-circle",class:"text-green-500"},done:{icon:"i-heroicons-check-circle",class:"text-green-500"},failed:{icon:"i-heroicons-x-circle",class:"text-red-500"},cancelled:{icon:"i-heroicons-minus-circle",class:"text-gray-400"}},_e=l=>Ae[l]?.icon??"i-heroicons-question-mark-circle",be=l=>Ae[l]?.class??"text-gray-400";function tt(l){if(l.status==="pending")return o("home.import.batch.waiting");if(l.status==="cancelled")return o("home.import.batch.skipped");if(l.status==="success")return o("home.import.batch.success");if(l.status==="failed")return U(l.error||"error.import_failed");if(l.progress){const{stage:u,messagesProcessed:a}=l.progress;return u==="parsing"&&a?o("home.import.processed",{count:a.toLocaleString()}):o(`home.import.progress.${u}`)}return""}const ot=l=>l.info?o("home.import.merge.messageCount",{count:l.info.messageCount.toLocaleString()}):"";return(l,u)=>{const a=se,M=ae,j=nt,W=Ue,te=at;return n(),c("div",Do,[t(x)&&t(m).length>0?(n(),c("div",zo,[e("div",Eo,[e("div",Ro,[e("div",Bo,[d(a,{name:"i-heroicons-arrow-path",class:"h-5 w-5 animate-spin text-pink-600 dark:text-pink-400"})]),e("div",null,[e("p",Oo,s(t(o)("home.import.batch.importing")),1),e("p",No,s(t(o)("home.import.batch.progressCount",{current:(k.value?.completed||0)+1,total:k.value?.total||0})),1)])]),d(M,{color:"error",variant:"soft",size:"sm",icon:"i-heroicons-stop-circle",onClick:Ze},{default:P(()=>[E(s(t(o)("home.import.batch.cancel")),1)]),_:1})]),e("div",Vo,[(n(!0),c(H,null,q(t(m),(I,ne)=>(n(),B(we,{key:I.path,name:I.name,"status-icon":_e(I.status),"status-class":be(I.status),"progress-text":tt(I),index:ne,total:t(m).length,highlight:I.status==="importing"},null,8,["name","status-icon","status-class","progress-text","index","total","highlight"]))),128))])])):t(w)&&t(p)!=="done"?(n(),c("div",Ho,[e("div",Go,[e("div",Wo,[e("div",qo,[t(p)!=="error"?(n(),B(a,{key:0,name:"i-heroicons-arrow-path",class:"h-5 w-5 animate-spin text-pink-600 dark:text-pink-400"})):(n(),B(a,{key:1,name:"i-heroicons-x-circle",class:"h-5 w-5 text-red-600 dark:text-red-400"}))]),e("div",null,[e("p",Zo,s(t(p)==="error"?t(o)("home.import.merge.failed"):t(o)("home.import.merge.importing")),1),e("p",Jo,s(t(p)==="parsing"?t(o)("home.import.merge.parsing"):"")+" "+s(t(p)==="merging"?t(o)("home.import.merge.merging"):"")+" "+s(t(p)==="error"?t(_):""),1)])]),t(p)==="error"?(n(),B(M,{key:0,color:"neutral",variant:"ghost",size:"sm",icon:"i-heroicons-x-mark",onClick:Ce})):D("",!0)]),e("div",Yo,[(n(!0),c(H,null,q(t(f),(I,ne)=>(n(),B(we,{key:I.path,name:I.name,"status-icon":_e(I.status),"status-class":be(I.status),"progress-text":ot(I),index:ne,total:t(f).length,highlight:I.status==="parsing"},null,8,["name","status-icon","status-class","progress-text","index","total","highlight"]))),128))])])):t(w)&&t(p)==="done"&&t(F)?(n(),c("div",Ko,[e("div",Qo,[e("div",Xo,[e("div",es,[d(a,{name:"i-heroicons-check-circle",class:"h-5 w-5 text-green-600 dark:text-green-400"})]),e("div",null,[e("p",ts,s(t(o)("home.import.merge.completed")),1),e("p",os,s(t(o)("home.import.merge.completedHint",{count:t(f).length})),1)])]),e("div",ss,[d(M,{color:"neutral",variant:"ghost",size:"sm",icon:"i-heroicons-x-mark",onClick:Ce}),d(M,{size:"sm",onClick:qe},{default:P(()=>[E(s(t(o)("home.import.batch.view")),1)]),_:1})])])])):t(h)?(n(),c("div",ns,[e("div",as,[e("div",rs,[e("div",{class:O(["flex h-10 w-10 items-center justify-center rounded-xl",t(h).failed===0?"bg-green-50 dark:bg-green-500/10":"bg-amber-50 dark:bg-amber-500/10"])},[d(a,{name:t(h).failed===0?"i-heroicons-check-circle":"i-heroicons-exclamation-triangle",class:O(["h-5 w-5",t(h).failed===0?"text-green-600 dark:text-green-400":"text-amber-600 dark:text-amber-400"])},null,8,["name","class"])],2),e("div",null,[e("p",is,s(t(o)("home.import.batch.completed")),1),e("p",ls,s(t(o)("home.import.batch.summary",{success:t(h).success,failed:t(h).failed,cancelled:t(h).cancelled})),1)])]),d(M,{color:"neutral",variant:"ghost",size:"sm",icon:"i-heroicons-x-mark",onClick:Je})]),e("div",cs,[(n(!0),c(H,null,q(t(h).files,(I,ne)=>(n(),B(we,{key:I.path,name:I.name,"status-icon":_e(I.status),"status-class":be(I.status),index:ne,total:t(h).files.length},ut({extra:P(()=>[I.status==="failed"?(n(),c("p",us,s(U(I.error||"error.import_failed")),1)):I.status==="cancelled"?(n(),c("p",ds,s(t(o)("home.import.batch.skipped")),1)):D("",!0)]),_:2},[I.status==="success"&&I.sessionId?{name:"action",fn:P(()=>[d(M,{size:"xs",variant:"soft",onClick:Ln=>Ye(I.sessionId)},{default:P(()=>[E(s(t(o)("home.import.batch.view")),1)]),_:1},8,["onClick"])]),key:"0"}:void 0]),1032,["name","status-icon","status-class","index","total"]))),128))])])):(n(),B(t(Me),{key:4,ref_key:"dropZoneRef",ref:re,accept:[".json",".jsonl",".txt"],disabled:K.value,multiple:!0,class:"w-full max-w-4xl",onFiles:Q,onDirectoryDrop:He},{default:P(({isDragOver:I})=>[e("div",{class:O(["group relative flex w-full cursor-pointer flex-col items-center justify-center rounded-3xl border border-gray-200/50 bg-gray-100/50 px-8 py-4 backdrop-blur-md transition-all duration-300 hover:border-pink-500/30 hover:bg-gray-100/80 hover:shadow-2xl hover:shadow-pink-500/10 focus:outline-none focus:ring-4 focus:ring-pink-500/20 sm:px-12 sm:py-6 dark:border-white/10 dark:bg-gray-800/40 dark:hover:border-pink-500/30 dark:hover:bg-gray-800/60",{"border-pink-500/50 bg-pink-50/50 dark:border-pink-400/50 dark:bg-pink-500/10":I&&!K.value,"cursor-not-allowed opacity-70":K.value}]),onClick:u[1]||(u[1]=ne=>!K.value&&G())},[e("div",{class:O(["mb-4 flex h-16 w-16 items-center justify-center rounded-2xl transition-transform duration-300 group-hover:scale-105",{"scale-105":I&&!K.value,"animate-pulse":t(v)}])},[t(v)?(n(),B(a,{key:1,name:"i-heroicons-arrow-path",class:"h-8 w-8 animate-spin text-pink-600 dark:text-pink-400"})):(n(),B(a,{key:0,name:"i-heroicons-arrow-up-tray",class:"h-8 w-8 text-pink-600 transition-transform duration-200 group-hover:-translate-y-1 dark:text-pink-400"}))],2),e("div",hs,[t(v)&&t(r)?(n(),c(H,{key:0},[e("p",ms,s(Xe()),1),e("div",gs,[d(j,{modelValue:t(r).progress,"onUpdate:modelValue":u[0]||(u[0]=ne=>t(r).progress=ne),size:"md"},null,8,["modelValue"])]),e("p",ps,s(et()),1)],64)):(n(),c(H,{key:1},[e("p",fs,s(I?t(o)("home.import.dropHint"):t(o)("home.import.clickHint")),1),e("p",vs,s(t(o)("home.import.multipleHint")),1)],64))])],2)]),_:1},8,["disabled"])),d(t(Me),{ref_key:"dirDropZoneRef",ref:Ie,directory:!0,class:"hidden",onFiles:Ve},null,512),!K.value&&!t(h)?(n(),c("div",xs,[d(W,{modelValue:ce.value,"onUpdate:modelValue":u[2]||(u[2]=I=>ce.value=I),label:t(o)("home.import.importFolder"),"input-class":"h-4 w-4",size:"sm","label-class":"text-sm font-medium text-gray-600 dark:text-gray-300"},null,8,["modelValue","label"]),e("div",ys,[d(W,{modelValue:V.value,"onUpdate:modelValue":u[3]||(u[3]=I=>V.value=I),label:t(o)("home.import.options.mergeImport"),"input-class":"h-4 w-4",size:"sm","label-class":"text-sm font-medium text-gray-600 dark:text-gray-300"},null,8,["modelValue","label"]),d(te,{mode:"hover"},{content:P(()=>[e("div",_s,s(t(o)("home.import.options.mergeImportHint")),1)]),default:P(()=>[d(a,{name:"i-heroicons-question-mark-circle",class:"h-4 w-4 text-gray-400 hover:text-gray-600 dark:text-gray-500 dark:hover:text-gray-300"})]),_:1})])])):D("",!0),b.value?(n(),c("div",bs,[e("div",ks,[d(a,{name:"i-heroicons-exclamation-circle",class:"h-5 w-5 shrink-0"}),e("span",null,s(b.value),1)]),y.value?(n(),c("div",ws,[e("div",Ss,[d(a,{name:"i-heroicons-chart-bar",class:"mt-0.5 h-4 w-4 shrink-0"}),e("div",$s,[y.value.detectedFormat?(n(),c("div",Is,s(t(o)("home.import.diagnostics.format"))+s(y.value.detectedFormat),1)):D("",!0),e("div",null,s(t(o)("home.import.diagnostics.received"))+s(y.value.messagesReceived)+" "+s(t(o)("home.import.diagnostics.written"))+s(y.value.messagesWritten)+" "+s(t(o)("home.import.diagnostics.skipped"))+s(y.value.messagesSkipped),1)])])])):D("",!0),g.value||$.value?(n(),c("p",Cs,s(t(o)("home.import.errors.actionHint")),1)):D("",!0),e("div",As,[g.value?(n(),B(M,{key:0,size:"xs",onClick:u[4]||(u[4]=I=>S.value=!0)},{default:P(()=>[E(s(t(o)("home.formatSelector.manualSelect")),1)]),_:1})):D("",!0),$.value?(n(),B(M,{key:1,size:"xs",variant:"soft",onClick:Qe},{default:P(()=>[E(s(t(o)("home.import.viewLog")),1)]),_:1})):D("",!0)])])):D("",!0),e("div",Ls,[X.value?(n(),B(jo,{key:0})):D("",!0),d(M,{to:Ke.value,target:"_blank","trailing-icon":"i-heroicons-chevron-right-20-solid"},{default:P(()=>[E(s(t(o)("home.import.tutorial")),1)]),_:1},8,["to"])]),d(yo,{open:A.value,"onUpdate:open":u[5]||(u[5]=I=>A.value=I),"file-path":z.value,onSelect:We},null,8,["open","file-path"]),d(Fo,{open:S.value,"onUpdate:open":u[6]||(u[6]=I=>S.value=I),"file-path":g.value,onSelect:Ge},null,8,["open","file-path"])])}}}),Ms=["BR","A","IMG"],Fs={A:["href","target","rel"],IMG:["src","alt","title","width","height"],BR:[]},Ps=["http:","https:"];function Us(L){return new Set((L&&L.length>0?L:Ms).map(o=>o.toUpperCase()))}function js(L){const o=L&&Object.keys(L).length>0?L:Fs,i={};for(const[v,r]of Object.entries(o))i[v.toUpperCase()]=new Set(r.map(x=>x.toLowerCase()));return i}function Pe(L,o){const i=L.trim();if(!i)return!1;const v=i.toLowerCase();if(v.startsWith("javascript:")||v.startsWith("vbscript:")||v.startsWith("data:"))return!1;try{const r=new URL(i,window.location.origin);return o.includes(r.protocol)}catch{return!1}}function Ds(L,o={}){const i=Us(o.allowedTags),v=js(o.allowedAttrs),r=o.allowedProtocols&&o.allowedProtocols.length>0?o.allowedProtocols:Ps,m=new DOMParser().parseFromString(L||"","text/html"),h=w=>{const f=Array.from(w.children);for(const p of f){const _=p.tagName;if(!i.has(_)){const A=p.parentNode;if(A){for(;p.firstChild;)A.insertBefore(p.firstChild,p);A.removeChild(p)}continue}const F=v[_]||new Set;for(const A of Array.from(p.attributes))F.has(A.name.toLowerCase())||p.removeAttribute(A.name);if(_==="A"){const A=p.getAttribute("href")?.trim()||"";Pe(A,r)||p.removeAttribute("href");const z=p.getAttribute("target");z&&z!=="_blank"&&p.setAttribute("target","_blank"),p.getAttribute("href")&&p.setAttribute("rel","noopener noreferrer")}if(_==="IMG"){const A=p.getAttribute("src")?.trim()||"";Pe(A,r)||p.removeAttribute("src")}h(p)}};return h(m.body),m.body.innerHTML}const zs={feat:{icon:"i-heroicons-sparkles",color:"text-green-500",bgColor:"bg-green-100 dark:bg-green-900/30"},fix:{icon:"i-heroicons-wrench-screwdriver",color:"text-amber-500",bgColor:"bg-amber-100 dark:bg-amber-900/30"},refactor:{icon:"i-heroicons-arrow-path-rounded-square",color:"text-indigo-500",bgColor:"bg-indigo-100 dark:bg-indigo-900/30"},docs:{icon:"i-heroicons-document-text",color:"text-cyan-600",bgColor:"bg-cyan-100 dark:bg-cyan-900/30"},chore:{icon:"i-heroicons-cog-6-tooth",color:"text-gray-500",bgColor:"bg-gray-100 dark:bg-gray-700/30"},style:{icon:"i-heroicons-paint-brush",color:"text-blue-500",bgColor:"bg-blue-100 dark:bg-blue-900/30"}};function Se(L){return zs[L]}const Es={class:"flex max-h-[80vh] flex-col"},Rs={class:"flex items-center justify-between border-b border-gray-200 px-6 py-4 dark:border-gray-700"},Bs={class:"flex items-center gap-3"},Os={class:"flex h-10 w-10 items-center justify-center rounded-xl bg-linear-to-br from-pink-500 to-pink-600"},Ns={class:"text-lg font-semibold text-gray-900 dark:text-white"},Vs={class:"text-sm text-gray-500 dark:text-gray-400"},Hs={class:"flex-1 overflow-y-auto px-6 py-4"},Gs={key:0,class:"flex items-center justify-center py-12"},Ws={key:1,class:"flex flex-col items-center justify-center py-12 text-center"},qs={class:"text-sm text-gray-500 dark:text-gray-400"},Zs={key:2,class:"space-y-6"},Js={key:0,class:"absolute left-[15px] top-10 h-[calc(100%-20px)] w-[2px] bg-gray-200 dark:bg-gray-700"},Ys={class:"flex items-start gap-4"},Ks={class:"flex-1 pt-0.5"},Qs=["onClick"],Xs={class:"flex items-center gap-3"},en={class:"text-base font-bold text-gray-900 dark:text-white"},tn={key:0,class:"rounded-full bg-pink-100 px-2 py-0.5 text-xs font-medium text-pink-600 dark:bg-pink-900/30 dark:text-pink-400"},on={key:1,class:"rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-600 dark:bg-green-900/30 dark:text-green-400"},sn={class:"mt-0.5 text-sm text-gray-500 dark:text-gray-400"},nn=["innerHTML"],an={class:"mt-3 space-y-3"},rn={class:"mb-2 flex items-center gap-2"},ln={class:"text-xs font-medium text-gray-600 dark:text-gray-400"},cn={class:"space-y-1.5 pl-7"},un={class:"border-t border-gray-200 px-6 py-4 dark:border-gray-700"},dn={class:"flex items-center justify-between"},hn={key:0,class:"text-sm text-gray-500 dark:text-gray-400"},mn={key:1},gn=J({__name:"ChangelogModal",setup(L,{expose:o}){const{t:i}=Z(),v=ge(),{locale:r}=pe(v),x=C(!1),m=C(!1),h=C(null),w=C(new Map),f=C(null),p={allowedTags:["br","a","img"],allowedAttrs:{a:["href","target","rel"],img:["src","alt","title","width","height"]}};function _(k,U){const R=A(k,U);w.value.set(k,!R)}function F(k){return k?k.trim().replace(/^v/i,""):null}function A(k,U){return w.value.has(k)?w.value.get(k):f.value?z(k):U===0}function z(k){const U=F(f.value);return U?F(k)===U:!1}const S=C([]);function g(k){const R=fe(k)||"en";return`${Oe}/changelogs/${R}.json`}async function T(){m.value=!0,h.value=null;try{const k=g(r.value);let U;if(!Be){const R=await fetch(k);if(!R.ok)throw new Error(`HTTP ${R.status}`);U=await R.json()}S.value=U}catch(k){console.error("Failed to fetch changelogs:",k),h.value=i("home.changelog.loadError")}finally{m.value=!1}}xe(r,()=>{x.value&&S.value.length>0&&T()});function b(k){return{feat:i("home.changelog.types.feat"),fix:i("home.changelog.types.fix"),refactor:i("home.changelog.types.refactor"),docs:i("home.changelog.types.docs"),chore:i("home.changelog.types.chore"),style:i("home.changelog.types.style")}[k]||k}function $(k){const U=new Date(k);return r.value==="zh-CN"?`${U.getFullYear()}年${U.getMonth()+1}月${U.getDate()}日`:U.toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"})}async function y(){}async function Y(){w.value.clear(),x.value=!0,S.value.length===0&&T()}function V(k,U){S.value=k,f.value=U||null,w.value.clear(),x.value=!0}function X(){x.value=!1}function K(){return S.value[0]?.version||null}return ve(()=>{y()}),o({open:Y,openWithData:V,close:X,fetchChangelogs:T,getLatestVersion:K}),(k,U)=>{const R=se,re=ae,ce=le;return n(),B(ce,{open:x.value,ui:{content:"max-w-2xl"},"onUpdate:open":U[0]||(U[0]=G=>x.value=G)},{content:P(()=>[e("div",Es,[e("div",Rs,[e("div",Bs,[e("div",Os,[d(R,{name:"i-heroicons-document-text",class:"h-5 w-5 text-white"})]),e("div",null,[e("h2",Ns,s(t(i)("home.changelog.title")),1),e("p",Vs,s(t(i)("home.changelog.subtitle")),1)])]),d(re,{color:"neutral",variant:"ghost",icon:"i-heroicons-x-mark",onClick:X})]),e("div",Hs,[m.value?(n(),c("div",Gs,[d(R,{name:"i-heroicons-arrow-path",class:"h-6 w-6 animate-spin text-gray-400"})])):h.value?(n(),c("div",Ws,[d(R,{name:"i-heroicons-exclamation-circle",class:"h-10 w-10 text-red-400 mb-3"}),e("p",qs,s(h.value),1),d(re,{color:"primary",variant:"soft",size:"sm",class:"mt-3",onClick:T},{default:P(()=>[E(s(t(i)("home.changelog.retry")),1)]),_:1})])):(n(),c("div",Zs,[(n(!0),c(H,null,q(S.value,(G,Q)=>(n(),c("div",{key:G.version,class:"relative"},[Q<S.value.length-1?(n(),c("div",Js)):D("",!0),e("div",Ys,[e("div",{class:O(["relative z-10 flex h-8 w-8 shrink-0 items-center justify-center rounded-full",Q===0?"bg-pink-500":"bg-gray-300 dark:bg-gray-600"])},[d(R,{name:Q===0?"i-heroicons-star":"i-heroicons-tag",class:O(["h-4 w-4",Q===0?"text-white":"text-gray-600 dark:text-gray-300"])},null,8,["name","class"])],2),e("div",Ks,[e("div",{class:"cursor-pointer select-none",onClick:ee=>_(G.version,Q)},[e("div",Xs,[e("h3",en,"v"+s(G.version),1),Q===0?(n(),c("span",tn,s(t(i)("home.changelog.latest")),1)):D("",!0),z(G.version)?(n(),c("span",on,s(t(i)("home.changelog.current")),1)):D("",!0),d(R,{name:"i-heroicons-chevron-down",class:O(["h-4 w-4 text-gray-400 transition-transform duration-200",{"rotate-180":A(G.version,Q)}])},null,8,["class"])]),e("p",sn,s($(G.date)),1),e("p",{class:"mt-2 text-sm font-medium text-gray-700 dark:text-gray-300",innerHTML:t(Ds)(G.summary,p)},null,8,nn)],8,Qs),dt(e("div",an,[(n(!0),c(H,null,q(G.changes,ee=>(n(),c("div",{key:ee.type,class:"rounded-lg border border-gray-100 bg-gray-50/50 p-3 dark:border-gray-700/50 dark:bg-gray-800/30"},[e("div",rn,[e("div",{class:O(["flex h-5 w-5 items-center justify-center rounded",t(Se)(ee.type)?.bgColor])},[d(R,{name:t(Se)(ee.type)?.icon,class:O(["h-3 w-3",t(Se)(ee.type)?.color])},null,8,["name","class"])],2),e("span",ln,s(b(ee.type)),1)]),e("ul",cn,[(n(!0),c(H,null,q(ee.items,(ie,de)=>(n(),c("li",{key:de,class:"relative text-sm text-gray-600 dark:text-gray-400"},[U[1]||(U[1]=e("span",{class:"absolute -left-4 top-2 h-1.5 w-1.5 rounded-full bg-gray-300 dark:bg-gray-600"},null,-1)),E(" "+s(ie),1)]))),128))])]))),128))],512),[[ht,A(G.version,Q)]])])])]))),128))]))]),e("div",un,[e("div",dn,[S.value.length>0?(n(),c("p",hn,s(t(i)("home.changelog.total",{count:S.value.length})),1)):(n(),c("span",mn)),d(re,{color:"primary",variant:"soft",onClick:X},{default:P(()=>[E(s(t(i)("home.changelog.close")),1)]),_:1})])])])]),_:1},8,["open"])}}}),pn={class:"absolute bottom-4 left-0 right-0"},fn={class:"flex items-center justify-center"},vn={key:0,class:"mx-2 text-gray-300 dark:text-gray-600"},xn=["onClick"],yn=J({__name:"HomeFooter",emits:["openChangelog","openTerms"],setup(L,{emit:o}){const i=o,{t:v,locale:r}=Z(),x=N(()=>{const g=fe(r.value),T=g?`/${g}`:"";return`${Oe}${T}/config.json`}),m=N(()=>`chatlab_app_config_${r.value}`);function h(){return[{id:"website",icon:"i-heroicons-globe-alt",title:v("home.footer.website"),url:`https://chatlab.fun${lt(r.value)}`},{id:"github",icon:"i-simple-icons-github",title:"Github",url:"https://github.com/ChatLab/ChatLab"},{id:"terms",icon:"i-heroicons-document-text",title:v("home.footer.terms"),action:"terms"},{id:"changelog",icon:"i-heroicons-document-text",title:v("home.changelog.title"),action:"changelog"}]}const w=C(h()),f=C(null),p=N(()=>!f.value?.show||!f.value.url?null:{title:f.value.name,url:f.value.url});function _(){try{const g=localStorage.getItem(m.value);if(g)return JSON.parse(g).homeFooterExtraLinks||null}catch(g){console.warn("[HomeFooter] 读取缓存额外链接失败,将使用默认链接。",g)}return null}function F(){try{const g=localStorage.getItem(m.value);if(g)return JSON.parse(g).socialData||null}catch(g){console.warn("[HomeFooter] 读取缓存社交配置失败,将使用默认配置。",g)}return null}async function A(){const g=_();g&&g.length>0&&(w.value=[...h(),...g]);const T=F();T&&(f.value=T);try{let b;if(!Be){const $=await fetch(x.value);if(!$.ok)return;b=await $.json()}localStorage.setItem(m.value,JSON.stringify(b)),localStorage.setItem("chatlab_app_config",JSON.stringify(b)),b.homeFooterExtraLinks&&Array.isArray(b.homeFooterExtraLinks)&&(w.value=[...h(),...b.homeFooterExtraLinks]),b.socialData&&(f.value=b.socialData)}catch(b){console.warn("[HomeFooter] 拉取远程配置失败,将继续使用本地配置。",b)}}function z(g){g.action==="changelog"?i("openChangelog"):g.action==="terms"?i("openTerms"):g.url&&window.open(g.url,"_blank")}function S(){p.value?.url&&window.open(p.value.url,"_blank")}return ve(()=>{A()}),xe(r,()=>{w.value=h(),A()}),(g,T)=>(n(),c("div",pn,[e("div",fn,[(n(!0),c(H,null,q(w.value,(b,$)=>(n(),c(H,{key:b.id},[$>0?(n(),c("span",vn,"·")):D("",!0),e("button",{class:"text-sm text-gray-500 hover:text-primary transition-colors dark:text-gray-400 dark:hover:text-primary",onClick:y=>z(b)},s(b.title),9,xn)],64))),128)),p.value?(n(),c(H,{key:0},[T[0]||(T[0]=e("span",{class:"mx-2 text-gray-300 dark:text-gray-600"},"·",-1)),e("button",{class:"text-sm text-gray-500 hover:text-primary transition-colors dark:text-gray-400 dark:hover:text-primary",onClick:S},s(p.value.title),1)],64)):D("",!0)])]))}}),_n={class:"relative flex h-full w-full overflow-hidden pt-4"},bn={class:"relative h-full w-full overflow-y-auto"},kn={class:"flex min-h-full w-full flex-col items-center justify-center px-4 py-12"},wn={class:"relative xl:mb-6 mb-4 w-full text-center"},Sn={class:"mb-4 select-none text-5xl sm:text-5xl lg:text-6xl font-black tracking-tight text-pink-500"},$n={class:"relative select-none inline-block mb-8"},In={class:"text-lg sm:text-5xl text-gray-700 dark:text-gray-400 font-medium"},Cn={class:"xl:mb-16 mb-12 flex flex-wrap items-center justify-center gap-x-8 gap-y-4 px-4"},An={class:"text-sm sm:text-base font-medium tracking-tight text-gray-600 dark:text-gray-300 transition-colors duration-300 group-hover:text-gray-900 dark:group-hover:text-white"},Dn=J({__name:"index",setup(L){const{t:o}=Z(),i=C(null),v=C(null);function r(){v.value?.needsAgreement()&&v.value.open()}async function x(){i.value?.open()}function m(){v.value?.open()}const h=N(()=>[{title:o("home.features.privacy.title"),color:"text-pink-500"},{title:o("home.features.analysis.title"),color:"text-pink-500"},{title:o("home.features.ai.title"),color:"text-pink-500"}]);return(w,f)=>{const p=se;return n(),c("div",_n,[f[0]||(f[0]=e("div",{class:"absolute left-0 right-0 top-0 z-10 h-[50px]",style:{"-webkit-app-region":"drag"}},null,-1)),e("div",bn,[e("div",kn,[e("div",wn,[e("h1",Sn,s(t(o)("home.title")),1),e("div",$n,[e("p",In,s(t(o)("home.subtitle")),1)])]),e("div",Cn,[(n(!0),c(H,null,q(h.value,_=>(n(),c("div",{key:_.title,class:"group flex items-center gap-2 cursor-default"},[d(p,{name:"i-heroicons-check-circle",class:O(["h-5 w-5 transition-all duration-500 group-hover:scale-110 group-hover:drop-shadow-md",_.color])},null,8,["class"]),e("span",An,s(_.title),1)]))),128))]),d(Ts)]),d(yn,{onOpenChangelog:x,onOpenTerms:m})]),d(kt,{onDone:r}),d(jt,{ref_key:"agreementModalRef",ref:v},null,512),d(Jt),d(gn,{ref_key:"changelogModalRef",ref:i},null,512)])}}});export{Dn as default};
|