hanbiro-react16-sdk 1.0.28 → 1.0.29

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.
Files changed (43) hide show
  1. package/README.md +58 -5
  2. package/dist/components/ChatAIDraft/ChatInput.js +3 -1
  3. package/dist/components/ChatAIDraft/ChatList/MessageItem.js +3 -1
  4. package/dist/components/ChatAIDraft/CreatePanel/EmptyState.js +15 -15
  5. package/dist/components/ChatAIDraft/CreatePanel/index.js +3 -3
  6. package/dist/components/ChatAIDraft/ReplyPanel/ContextPreviewModal.js +3 -1
  7. package/dist/components/ChatAIDraft/ReplyPanel/EmptyState.js +10 -10
  8. package/dist/components/ChatAIDraft/ReplyPanel/Header/index.js +8 -4
  9. package/dist/components/ChatAIDraft/ReplyPanel/MailListSelect.js +12 -9
  10. package/dist/components/ChatAIDraft/ReplyPanel/index.js +7 -5
  11. package/dist/components/ChatAIDraft/SettingPopper/index.js +8 -6
  12. package/dist/components/ChatAIDraft/constants.d.ts +2 -2
  13. package/dist/components/ChatAIDraft/constants.js +16 -14
  14. package/dist/components/ChatAIDraft/index.d.ts +1 -0
  15. package/dist/components/ChatAIDraft/index.js +7 -1
  16. package/dist/components/Pagination/index.js +4 -2
  17. package/dist/components/SummaryAIEmails/FilterTabs.js +4 -2
  18. package/dist/components/SummaryAIEmails/SummaryItem.js +3 -1
  19. package/dist/components/SummaryAIEmails/index.d.ts +1 -0
  20. package/dist/components/SummaryAIEmails/index.js +11 -2
  21. package/dist/components/SummaryAIEmails/utils.d.ts +2 -1
  22. package/dist/components/SummaryAIEmails/utils.js +5 -4
  23. package/dist/hanbiro-react16-sdk.style.css +1 -1
  24. package/dist/hanbiro-react16-sdk.umd.js +241 -98
  25. package/dist/index.js +4 -3
  26. package/dist/lang/en.d.ts +3 -0
  27. package/dist/lang/en.js +66 -0
  28. package/dist/lang/index.d.ts +4 -0
  29. package/dist/lang/index.js +18 -0
  30. package/dist/lang/keyLang.d.ts +62 -0
  31. package/dist/lang/keyLang.js +66 -0
  32. package/dist/lang/ko.d.ts +3 -0
  33. package/dist/lang/ko.js +66 -0
  34. package/dist/lang/vi.d.ts +3 -0
  35. package/dist/lang/vi.js +66 -0
  36. package/dist/utils/index.d.ts +1 -1
  37. package/dist/utils/lang.d.ts +1 -0
  38. package/dist/utils/lang.js +30 -0
  39. package/dist/utils/storage.d.ts +8 -0
  40. package/dist/utils/storage.js +19 -0
  41. package/dist/utils/url.d.ts +2 -0
  42. package/dist/utils/url.js +8 -2
  43. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * hanbiro-react16-sdk v1.0.28
2
+ * hanbiro-react16-sdk v1.0.29
3
3
  * Build Date: 2026-05-22
4
4
  */
5
5
  function _toArray(r) { return _arrayWithHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableRest(); }
@@ -36,7 +36,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
36
36
  })(this, function (exports2, React, ReactDOM) {
37
37
  "use strict";
38
38
 
39
- var _this9 = this;
39
+ var _this9 = this,
40
+ _en,
41
+ _vi,
42
+ _ko;
40
43
  var __defProp = Object.defineProperty;
41
44
  var __defProps = Object.defineProperties;
42
45
  var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
@@ -175,9 +178,43 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
175
178
  rnds[8] = rnds[8] & 63 | 128;
176
179
  return unsafeStringify(rnds);
177
180
  }
181
+ var LOCAL_STORAGE_KEY = /* @__PURE__ */function (LOCAL_STORAGE_KEY2) {
182
+ LOCAL_STORAGE_KEY2["LANG_CODE"] = "lang.code";
183
+ return LOCAL_STORAGE_KEY2;
184
+ }(LOCAL_STORAGE_KEY || {});
185
+ var localStorageService = {
186
+ get: function get(key) {
187
+ return localStorage.getItem(key);
188
+ },
189
+ set: function set(key, value) {
190
+ localStorage.setItem(key, value);
191
+ },
192
+ remove: function remove(key) {
193
+ localStorage.removeItem(key);
194
+ }
195
+ };
196
+ function getBrowserLang() {
197
+ var shortCode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
198
+ var language = navigator.language;
199
+ if (language.indexOf("-") !== -1 && shortCode) {
200
+ language = language.substring(0, 2);
201
+ }
202
+ if (language === "ja") {
203
+ language = "jp";
204
+ }
205
+ var supportLanguage = ["ko", "en", "jp", "ch", "zh", "id", "vi", "es"];
206
+ if (!(supportLanguage.indexOf(language) > -1)) {
207
+ language = "en";
208
+ }
209
+ return language || "en";
210
+ }
211
+ var getCurrentLang = function getCurrentLang() {
212
+ return localStorageService.get(LOCAL_STORAGE_KEY.LANG_CODE) || getBrowserLang(true);
213
+ };
178
214
  var SDKConfig = {
179
215
  baseUrl: "V3",
180
- signer: null
216
+ signer: null,
217
+ lang: getCurrentLang()
181
218
  };
182
219
  var initHanbiroReactSDK = function initHanbiroReactSDK(_ref2) {
183
220
  var baseUrl = _ref2.baseUrl,
@@ -185,6 +222,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
185
222
  SDKConfig.baseUrl = baseUrl;
186
223
  SDKConfig.signer = signer;
187
224
  };
225
+ var setLibLang = function setLibLang(lang) {
226
+ if (lang) SDKConfig.lang = lang;
227
+ };
188
228
  var checkDevelopment = function checkDevelopment() {
189
229
  var locationInfo = window.location;
190
230
  var hostname = locationInfo.hostname;
@@ -3091,8 +3131,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3091
3131
  }
3092
3132
  raw = cap[0];
3093
3133
  src = src.substring(raw.length);
3094
- var line = cap[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, function (t) {
3095
- return " ".repeat(3 * t.length);
3134
+ var line = cap[2].split("\n", 1)[0].replace(this.rules.other.listReplaceTabs, function (t2) {
3135
+ return " ".repeat(3 * t2.length);
3096
3136
  });
3097
3137
  var nextLine = src.split("\n", 1)[0];
3098
3138
  var blankLine = !line.trim();
@@ -3211,11 +3251,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
3211
3251
  this.lexer.state.top = false;
3212
3252
  list2.items[_i3].tokens = this.lexer.blockTokens(list2.items[_i3].text, []);
3213
3253
  if (!list2.loose) {
3214
- var spacers = list2.items[_i3].tokens.filter(function (t) {
3215
- return t.type === "space";
3254
+ var spacers = list2.items[_i3].tokens.filter(function (t2) {
3255
+ return t2.type === "space";
3216
3256
  });
3217
- var hasMultipleLineBreaks = spacers.length > 0 && spacers.some(function (t) {
3218
- return _this2.rules.other.anyLine.test(t.raw);
3257
+ var hasMultipleLineBreaks = spacers.length > 0 && spacers.some(function (t2) {
3258
+ return _this2.rules.other.anyLine.test(t2.raw);
3219
3259
  });
3220
3260
  list2.loose = hasMultipleLineBreaks;
3221
3261
  }
@@ -5130,6 +5170,83 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5130
5170
  }, _callee2);
5131
5171
  }));
5132
5172
  };
5173
+ var LangKey = /* @__PURE__ */function (LangKey2) {
5174
+ LangKey2["SUMMARY_WARNING"] = "SUMMARY_WARNING";
5175
+ LangKey2["NO_DATA"] = "NO_DATA";
5176
+ LangKey2["SENT"] = "SENT";
5177
+ LangKey2["RECEIVED"] = "RECEIVED";
5178
+ LangKey2["ALL"] = "ALL";
5179
+ LangKey2["CREATE_EMPTY_TITLE"] = "CREATE_EMPTY_TITLE";
5180
+ LangKey2["CREATE_EMPTY_SUBTITLE"] = "CREATE_EMPTY_SUBTITLE";
5181
+ LangKey2["CREATE_EMPTY_GUIDE"] = "CREATE_EMPTY_GUIDE";
5182
+ LangKey2["CREATE_FEATURE_1_TITLE"] = "CREATE_FEATURE_1_TITLE";
5183
+ LangKey2["CREATE_FEATURE_1_DESC"] = "CREATE_FEATURE_1_DESC";
5184
+ LangKey2["CREATE_FEATURE_2_TITLE"] = "CREATE_FEATURE_2_TITLE";
5185
+ LangKey2["CREATE_FEATURE_2_DESC"] = "CREATE_FEATURE_2_DESC";
5186
+ LangKey2["CREATE_FEATURE_3_TITLE"] = "CREATE_FEATURE_3_TITLE";
5187
+ LangKey2["CREATE_FEATURE_3_DESC"] = "CREATE_FEATURE_3_DESC";
5188
+ LangKey2["CREATE_PROMPT_HINT"] = "CREATE_PROMPT_HINT";
5189
+ LangKey2["CREATE_SUGGESTION_1"] = "CREATE_SUGGESTION_1";
5190
+ LangKey2["CREATE_SUGGESTION_2"] = "CREATE_SUGGESTION_2";
5191
+ LangKey2["CREATE_SUGGESTION_3"] = "CREATE_SUGGESTION_3";
5192
+ LangKey2["REPLY_EMPTY_TITLE"] = "REPLY_EMPTY_TITLE";
5193
+ LangKey2["REPLY_EMPTY_GUIDE"] = "REPLY_EMPTY_GUIDE";
5194
+ LangKey2["REPLY_FEATURE_1_TITLE"] = "REPLY_FEATURE_1_TITLE";
5195
+ LangKey2["REPLY_FEATURE_1_DESC"] = "REPLY_FEATURE_1_DESC";
5196
+ LangKey2["REPLY_FEATURE_2_TITLE"] = "REPLY_FEATURE_2_TITLE";
5197
+ LangKey2["REPLY_FEATURE_2_DESC"] = "REPLY_FEATURE_2_DESC";
5198
+ LangKey2["REPLY_FEATURE_3_TITLE"] = "REPLY_FEATURE_3_TITLE";
5199
+ LangKey2["REPLY_FEATURE_3_DESC"] = "REPLY_FEATURE_3_DESC";
5200
+ LangKey2["CHAT_INPUT_PLACEHOLDER"] = "CHAT_INPUT_PLACEHOLDER";
5201
+ LangKey2["CHAT_INPUT_PLACEHOLDER_REPLY"] = "CHAT_INPUT_PLACEHOLDER_REPLY";
5202
+ LangKey2["APPLY_CONTENT"] = "APPLY_CONTENT";
5203
+ LangKey2["SETTING_LANGUAGE"] = "SETTING_LANGUAGE";
5204
+ LangKey2["SETTING_TONE"] = "SETTING_TONE";
5205
+ LangKey2["SETTING_LENGTH"] = "SETTING_LENGTH";
5206
+ LangKey2["TONE_FORMAL"] = "TONE_FORMAL";
5207
+ LangKey2["TONE_POLITE"] = "TONE_POLITE";
5208
+ LangKey2["TONE_NEUTRAL"] = "TONE_NEUTRAL";
5209
+ LangKey2["TONE_FRIENDLY"] = "TONE_FRIENDLY";
5210
+ LangKey2["TONE_FIRM"] = "TONE_FIRM";
5211
+ LangKey2["TONE_APOLOGY"] = "TONE_APOLOGY";
5212
+ LangKey2["LENGTH_SHORT"] = "LENGTH_SHORT";
5213
+ LangKey2["LENGTH_MEDIUM"] = "LENGTH_MEDIUM";
5214
+ LangKey2["LENGTH_LONG"] = "LENGTH_LONG";
5215
+ LangKey2["LENGTH_ONE_LINER"] = "LENGTH_ONE_LINER";
5216
+ LangKey2["PAGINATION_TOTAL"] = "PAGINATION_TOTAL";
5217
+ LangKey2["PAGINATION_PAGE"] = "PAGINATION_PAGE";
5218
+ LangKey2["PAGINATION_PAGE_OF"] = "PAGINATION_PAGE_OF";
5219
+ LangKey2["REPLY_LOADING_CONTEXT"] = "REPLY_LOADING_CONTEXT";
5220
+ LangKey2["SOURCE_CONTEXT"] = "SOURCE_CONTEXT";
5221
+ LangKey2["AUTO"] = "AUTO";
5222
+ LangKey2["SELECTED_CONTEXT"] = "SELECTED_CONTEXT";
5223
+ LangKey2["ADD"] = "ADD";
5224
+ LangKey2["BACK"] = "BACK";
5225
+ LangKey2["ADD_CONTEXT_TITLE"] = "ADD_CONTEXT_TITLE";
5226
+ LangKey2["ADD_CONTEXT_DESC"] = "ADD_CONTEXT_DESC";
5227
+ LangKey2["SELECTED_UP_TO"] = "SELECTED_UP_TO";
5228
+ LangKey2["CLEAR_ALL"] = "CLEAR_ALL";
5229
+ LangKey2["SORT_LATEST"] = "SORT_LATEST";
5230
+ LangKey2["NO_EMAILS_FOUND"] = "NO_EMAILS_FOUND";
5231
+ LangKey2["CANCEL"] = "CANCEL";
5232
+ LangKey2["ADD_AS_CONTEXT"] = "ADD_AS_CONTEXT";
5233
+ LangKey2["NO_SUBJECT"] = "NO_SUBJECT";
5234
+ return LangKey2;
5235
+ }(LangKey || {});
5236
+ var en = (_en = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.SUMMARY_WARNING, "This is a summary compiled by AI · May contain some inaccuracies"), LangKey.NO_DATA, "No data"), LangKey.SENT, "Sent"), LangKey.RECEIVED, "Received"), LangKey.ALL, "All"), LangKey.CREATE_EMPTY_TITLE, "Let's draft a new email together from scratch."), LangKey.CREATE_EMPTY_SUBTITLE, "Tell me what kind of email you'd like to write."), LangKey.CREATE_EMPTY_GUIDE, "Give me the recipient, purpose, and key points\nand AI will generate a polished draft."), LangKey.CREATE_FEATURE_1_TITLE, "Request via message"), LangKey.CREATE_FEATURE_1_DESC, 'e.g., "Draft an email to Director Hong proposing a Q3 collaboration meeting (May 20, 3 PM)"'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.CREATE_FEATURE_2_TITLE, "AI generates a draft"), LangKey.CREATE_FEATURE_2_DESC, "Refine the draft freely with follow-ups like 'more polite' or 'add a deadline'."), LangKey.CREATE_FEATURE_3_TITLE, "Apply to body"), LangKey.CREATE_FEATURE_3_DESC, "Insert the response you like into the email body and send."), LangKey.CREATE_PROMPT_HINT, "💡 Try these prompts to get a draft right away"), LangKey.CREATE_SUGGESTION_1, "Propose a Q3 meeting to Director Hong (May 20, 3 PM)"), LangKey.CREATE_SUGGESTION_2, "Notify client of payment schedule (Due May 30)"), LangKey.CREATE_SUGGESTION_3, "Welcome message to new employee (Joining May 22)"), LangKey.REPLY_EMPTY_TITLE, "We'll draft a reply based on the received email.\nAdd send history if you want to match the tone."), LangKey.REPLY_EMPTY_GUIDE, "The source is auto-included. Adjust tone and length through conversation."), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.REPLY_FEATURE_1_TITLE, "Auto-include source"), LangKey.REPLY_FEATURE_1_DESC, "The email you are replying to is automatically added as context."), LangKey.REPLY_FEATURE_2_TITLE, "Add send history (optional)"), LangKey.REPLY_FEATURE_2_DESC, "Use '+ Add' to pick past emails and reference their tone."), LangKey.REPLY_FEATURE_3_TITLE, "Refine with conversation"), LangKey.REPLY_FEATURE_3_DESC, "Get an AI draft, then adjust freely with chips or messages."), LangKey.CHAT_INPUT_PLACEHOLDER, "Describe your email..."), LangKey.CHAT_INPUT_PLACEHOLDER_REPLY, "Type a message..."), LangKey.APPLY_CONTENT, "Apply content"), LangKey.SETTING_LANGUAGE, "Language"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.SETTING_TONE, "Tone"), LangKey.SETTING_LENGTH, "Length"), LangKey.TONE_FORMAL, "Formal"), LangKey.TONE_POLITE, "Polite"), LangKey.TONE_NEUTRAL, "Neutral"), LangKey.TONE_FRIENDLY, "Friendly"), LangKey.TONE_FIRM, "Firm"), LangKey.TONE_APOLOGY, "Apology"), LangKey.LENGTH_SHORT, "Short"), LangKey.LENGTH_MEDIUM, "Medium"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.LENGTH_LONG, "Long"), LangKey.LENGTH_ONE_LINER, "1-liner"), LangKey.PAGINATION_TOTAL, "Total"), LangKey.PAGINATION_PAGE, "Page"), LangKey.PAGINATION_PAGE_OF, "Page"), LangKey.REPLY_LOADING_CONTEXT, "Loading context..."), LangKey.SOURCE_CONTEXT, "Source context"), LangKey.AUTO, "Auto"), LangKey.SELECTED_CONTEXT, "Selected context"), LangKey.ADD, "Add"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_en, LangKey.BACK, "Back"), LangKey.ADD_CONTEXT_TITLE, "Add context from receive history"), LangKey.ADD_CONTEXT_DESC, "Select related emails to provide AI context."), LangKey.SELECTED_UP_TO, "selected · up to"), LangKey.CLEAR_ALL, "Clear all"), LangKey.SORT_LATEST, "Sort: latest"), LangKey.NO_EMAILS_FOUND, "No emails found."), LangKey.CANCEL, "Cancel"), LangKey.ADD_AS_CONTEXT, "as context →"), LangKey.NO_SUBJECT, "(no subject)"));
5237
+ var vi = (_vi = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.SUMMARY_WARNING, "Đây là bản tóm tắt do AI tổng hợp · Có thể chứa một số điểm không chính xác"), LangKey.NO_DATA, "Không có dữ liệu"), LangKey.SENT, "Đã gửi"), LangKey.RECEIVED, "Đã nhận"), LangKey.ALL, "Tất cả"), LangKey.CREATE_EMPTY_TITLE, "Hãy cùng nhau soạn thảo một email mới từ đầu."), LangKey.CREATE_EMPTY_SUBTITLE, "Hãy cho tôi biết bạn muốn viết loại email nào."), LangKey.CREATE_EMPTY_GUIDE, "Cho tôi người nhận, mục đích và những điểm chính\nvà AI sẽ tạo ra một bản nháp hoàn chỉnh."), LangKey.CREATE_FEATURE_1_TITLE, "Yêu cầu qua tin nhắn"), LangKey.CREATE_FEATURE_1_DESC, 'VD: "Soạn email gửi Giám đốc Hong đề xuất cuộc họp hợp tác quý 3 (20/5, 3 giờ chiều)"'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.CREATE_FEATURE_2_TITLE, "AI tạo bản nháp"), LangKey.CREATE_FEATURE_2_DESC, "Tinh chỉnh bản nháp thoải mái với các yêu cầu tiếp theo như 'lịch sự hơn' hoặc 'thêm thời hạn'."), LangKey.CREATE_FEATURE_3_TITLE, "Áp dụng vào nội dung"), LangKey.CREATE_FEATURE_3_DESC, "Chèn phản hồi bạn thích vào nội dung email và gửi."), LangKey.CREATE_PROMPT_HINT, "💡 Thử các câu lệnh này để nhận bản nháp ngay lập tức"), LangKey.CREATE_SUGGESTION_1, "Đề xuất cuộc họp quý 3 với Giám đốc Hong (20/5, 3 giờ chiều)"), LangKey.CREATE_SUGGESTION_2, "Thông báo lịch thanh toán cho khách hàng (Hạn chót 30/5)"), LangKey.CREATE_SUGGESTION_3, "Tin nhắn chào mừng nhân viên mới (Gia nhập 22/5)"), LangKey.REPLY_EMPTY_TITLE, "Chúng tôi sẽ soạn thảo thư trả lời dựa trên email đã nhận.\nThêm lịch sử gửi nếu bạn muốn khớp với giọng điệu."), LangKey.REPLY_EMPTY_GUIDE, "Nguồn được tự động bao gồm. Điều chỉnh giọng điệu và độ dài thông qua cuộc trò chuyện."), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.REPLY_FEATURE_1_TITLE, "Tự động bao gồm nguồn"), LangKey.REPLY_FEATURE_1_DESC, "Email bạn đang trả lời tự động được thêm làm ngữ cảnh."), LangKey.REPLY_FEATURE_2_TITLE, "Thêm lịch sử gửi (tùy chọn)"), LangKey.REPLY_FEATURE_2_DESC, "Sử dụng '+ Thêm' để chọn các email trước đây và tham khảo giọng điệu của chúng."), LangKey.REPLY_FEATURE_3_TITLE, "Tinh chỉnh thông qua trò chuyện"), LangKey.REPLY_FEATURE_3_DESC, "Nhận bản nháp AI, sau đó điều chỉnh thoải mái bằng thẻ hoặc tin nhắn."), LangKey.CHAT_INPUT_PLACEHOLDER, "Mô tả email của bạn..."), LangKey.CHAT_INPUT_PLACEHOLDER_REPLY, "Nhập tin nhắn..."), LangKey.APPLY_CONTENT, "Áp dụng nội dung"), LangKey.SETTING_LANGUAGE, "Ngôn ngữ"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.SETTING_TONE, "Giọng điệu"), LangKey.SETTING_LENGTH, "Độ dài"), LangKey.TONE_FORMAL, "Trang trọng"), LangKey.TONE_POLITE, "Lịch sự"), LangKey.TONE_NEUTRAL, "Trung lập"), LangKey.TONE_FRIENDLY, "Thân thiện"), LangKey.TONE_FIRM, "Cứng rắn"), LangKey.TONE_APOLOGY, "Xin lỗi"), LangKey.LENGTH_SHORT, "Ngắn"), LangKey.LENGTH_MEDIUM, "Trung bình"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.LENGTH_LONG, "Dài"), LangKey.LENGTH_ONE_LINER, "1 dòng"), LangKey.PAGINATION_TOTAL, "Tổng"), LangKey.PAGINATION_PAGE, "Trang"), LangKey.PAGINATION_PAGE_OF, "Trang"), LangKey.REPLY_LOADING_CONTEXT, "Đang tải ngữ cảnh..."), LangKey.SOURCE_CONTEXT, "Ngữ cảnh nguồn"), LangKey.AUTO, "Tự động"), LangKey.SELECTED_CONTEXT, "Ngữ cảnh đã chọn"), LangKey.ADD, "Thêm"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_vi, LangKey.BACK, "Trở lại"), LangKey.ADD_CONTEXT_TITLE, "Thêm ngữ cảnh từ lịch sử nhận"), LangKey.ADD_CONTEXT_DESC, "Chọn các email liên quan để cung cấp ngữ cảnh cho AI."), LangKey.SELECTED_UP_TO, "đã chọn · tối đa"), LangKey.CLEAR_ALL, "Xóa tất cả"), LangKey.SORT_LATEST, "Sắp xếp: mới nhất"), LangKey.NO_EMAILS_FOUND, "Không tìm thấy email nào."), LangKey.CANCEL, "Hủy bỏ"), LangKey.ADD_AS_CONTEXT, "làm ngữ cảnh →"), LangKey.NO_SUBJECT, "(không có chủ đề)"));
5238
+ var ko = (_ko = {}, _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.SUMMARY_WARNING, "이것은 AI가 작성한 요약입니다 · 일부 부정확한 내용이 포함될 수 있습니다"), LangKey.NO_DATA, "데이터 없음"), LangKey.SENT, "보낸 편지"), LangKey.RECEIVED, "받은 편지"), LangKey.ALL, "전체"), LangKey.CREATE_EMPTY_TITLE, "처음부터 새로운 이메일 초안을 함께 작성해 봅시다."), LangKey.CREATE_EMPTY_SUBTITLE, "어떤 종류의 이메일을 작성하고 싶으신가요?"), LangKey.CREATE_EMPTY_GUIDE, "수신자, 목적 및 주요 내용을 알려주시면\nAI가 완성도 높은 초안을 생성해 드립니다."), LangKey.CREATE_FEATURE_1_TITLE, "메시지로 요청"), LangKey.CREATE_FEATURE_1_DESC, '예: "홍길동 이사님께 3분기 협력 회의 제안 이메일 작성 (5월 20일 오후 3시)"'), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.CREATE_FEATURE_2_TITLE, "AI 초안 생성"), LangKey.CREATE_FEATURE_2_DESC, "'더 정중하게' 또는 '마감일 추가'와 같은 후속 요청으로 초안을 자유롭게 수정하세요."), LangKey.CREATE_FEATURE_3_TITLE, "본문에 적용"), LangKey.CREATE_FEATURE_3_DESC, "마음에 드는 답변을 이메일 본문에 삽입하고 전송하세요."), LangKey.CREATE_PROMPT_HINT, "💡 바로 초안을 받으려면 다음 프롬프트를 시도해 보세요"), LangKey.CREATE_SUGGESTION_1, "홍길동 이사님께 3분기 회의 제안 (5월 20일 오후 3시)"), LangKey.CREATE_SUGGESTION_2, "고객에게 결제 일정 안내 (마감일 5월 30일)"), LangKey.CREATE_SUGGESTION_3, "신입 사원 환영 메시지 (5월 22일 입사)"), LangKey.REPLY_EMPTY_TITLE, "받은 이메일을 바탕으로 답장 초안을 작성합니다.\n어조를 맞추고 싶다면 보낸 내역을 추가하세요."), LangKey.REPLY_EMPTY_GUIDE, "원본 메일은 자동으로 포함됩니다. 대화를 통해 어조와 길이를 조정하세요."), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.REPLY_FEATURE_1_TITLE, "원본 자동 포함"), LangKey.REPLY_FEATURE_1_DESC, "답장하려는 이메일이 자동으로 컨텍스트로 추가됩니다."), LangKey.REPLY_FEATURE_2_TITLE, "발송 내역 추가 (선택사항)"), LangKey.REPLY_FEATURE_2_DESC, "'+ 추가'를 사용하여 과거 이메일을 선택하고 어조를 참조하세요."), LangKey.REPLY_FEATURE_3_TITLE, "대화로 수정"), LangKey.REPLY_FEATURE_3_DESC, "AI 초안을 받은 후 칩이나 메시지를 사용하여 자유롭게 조정하세요."), LangKey.CHAT_INPUT_PLACEHOLDER, "이메일을 설명해주세요..."), LangKey.CHAT_INPUT_PLACEHOLDER_REPLY, "메시지 입력..."), LangKey.APPLY_CONTENT, "내용 적용"), LangKey.SETTING_LANGUAGE, "언어"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.SETTING_TONE, "어조"), LangKey.SETTING_LENGTH, "길이"), LangKey.TONE_FORMAL, "격식"), LangKey.TONE_POLITE, "정중"), LangKey.TONE_NEUTRAL, "중립"), LangKey.TONE_FRIENDLY, "친근"), LangKey.TONE_FIRM, "단호"), LangKey.TONE_APOLOGY, "사과"), LangKey.LENGTH_SHORT, "짧게"), LangKey.LENGTH_MEDIUM, "보통"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.LENGTH_LONG, "길게"), LangKey.LENGTH_ONE_LINER, "한 줄"), LangKey.PAGINATION_TOTAL, "전체"), LangKey.PAGINATION_PAGE, "페이지"), LangKey.PAGINATION_PAGE_OF, "페이지"), LangKey.REPLY_LOADING_CONTEXT, "컨텍스트 로딩 중..."), LangKey.SOURCE_CONTEXT, "원본 컨텍스트"), LangKey.AUTO, "자동"), LangKey.SELECTED_CONTEXT, "선택한 컨텍스트"), LangKey.ADD, "추가"), _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_ko, LangKey.BACK, "뒤로"), LangKey.ADD_CONTEXT_TITLE, "수신 내역에서 컨텍스트 추가"), LangKey.ADD_CONTEXT_DESC, "관련 이메일을 선택하여 AI에 컨텍스트를 제공하세요."), LangKey.SELECTED_UP_TO, "개 선택됨 · 최대"), LangKey.CLEAR_ALL, "모두 지우기"), LangKey.SORT_LATEST, "정렬: 최신순"), LangKey.NO_EMAILS_FOUND, "이메일을 찾을 수 없습니다."), LangKey.CANCEL, "취소"), LangKey.ADD_AS_CONTEXT, "컨텍스트로 추가 →"), LangKey.NO_SUBJECT, "(제목 없음)"));
5239
+ var dicts = {
5240
+ en: en,
5241
+ vi: vi,
5242
+ ko: ko
5243
+ };
5244
+ var t = function t(key) {
5245
+ var lang = SDKConfig.lang || "en";
5246
+ var prefix = lang.split("-")[0];
5247
+ var dict = dicts[lang] || dicts[prefix] || dicts.en;
5248
+ return dict[key] || en[key] || key;
5249
+ };
5133
5250
  var MessageItem = function MessageItem(_ref25) {
5134
5251
  var item = _ref25.item,
5135
5252
  onApply = _ref25.onApply,
@@ -5213,7 +5330,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
5213
5330
  marginTop: 4
5214
5331
  }
5215
5332
  }, /* @__PURE__ */React__namespace.createElement(Tooltip, {
5216
- title: "Apply content"
5333
+ title: t(LangKey.APPLY_CONTENT)
5217
5334
  }, /* @__PURE__ */React__namespace.createElement("button", {
5218
5335
  type: "button",
5219
5336
  onClick: handleApply,
@@ -6916,38 +7033,42 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
6916
7033
  }, _callee4);
6917
7034
  }));
6918
7035
  };
6919
- var TONE_OPTIONS = [{
6920
- label: "Formal",
6921
- value: "formal"
6922
- }, {
6923
- label: "Polite",
6924
- value: "polite"
6925
- }, {
6926
- label: "Neutral",
6927
- value: "neutral"
6928
- }, {
6929
- label: "Friendly",
6930
- value: "friendly"
6931
- }, {
6932
- label: "Firm",
6933
- value: "firm"
6934
- }, {
6935
- label: "Apology",
6936
- value: "apologetic"
6937
- }];
6938
- var LENGTH_OPTIONS = [{
6939
- label: "Short",
6940
- value: "short"
6941
- }, {
6942
- label: "Medium",
6943
- value: "medium"
6944
- }, {
6945
- label: "Long",
6946
- value: "long"
6947
- }, {
6948
- label: "1-liner",
6949
- value: "one_liner"
6950
- }];
7036
+ var getToneOptions = function getToneOptions() {
7037
+ return [{
7038
+ label: t(LangKey.TONE_FORMAL),
7039
+ value: "formal"
7040
+ }, {
7041
+ label: t(LangKey.TONE_POLITE),
7042
+ value: "polite"
7043
+ }, {
7044
+ label: t(LangKey.TONE_NEUTRAL),
7045
+ value: "neutral"
7046
+ }, {
7047
+ label: t(LangKey.TONE_FRIENDLY),
7048
+ value: "friendly"
7049
+ }, {
7050
+ label: t(LangKey.TONE_FIRM),
7051
+ value: "firm"
7052
+ }, {
7053
+ label: t(LangKey.TONE_APOLOGY),
7054
+ value: "apologetic"
7055
+ }];
7056
+ };
7057
+ var getLengthOptions = function getLengthOptions() {
7058
+ return [{
7059
+ label: t(LangKey.LENGTH_SHORT),
7060
+ value: "short"
7061
+ }, {
7062
+ label: t(LangKey.LENGTH_MEDIUM),
7063
+ value: "medium"
7064
+ }, {
7065
+ label: t(LangKey.LENGTH_LONG),
7066
+ value: "long"
7067
+ }, {
7068
+ label: t(LangKey.LENGTH_ONE_LINER),
7069
+ value: "one_liner"
7070
+ }];
7071
+ };
6951
7072
  var getFlagCode$1 = function getFlagCode$1(value) {
6952
7073
  var _a2;
6953
7074
  return (_a2 = AI_LANG_FLAGS.find(function (l) {
@@ -7328,7 +7449,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7328
7449
  fontSize: 12,
7329
7450
  fontWeight: 600
7330
7451
  }
7331
- }, "Language"), /* @__PURE__ */React__namespace.createElement(LanguageSelect, {
7452
+ }, t(LangKey.SETTING_LANGUAGE)), /* @__PURE__ */React__namespace.createElement(LanguageSelect, {
7332
7453
  value: lang,
7333
7454
  options: languageOptions,
7334
7455
  onChange: function onChange(opt) {
@@ -7345,8 +7466,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7345
7466
  fontSize: 12,
7346
7467
  fontWeight: 600
7347
7468
  }
7348
- }, "Tone"), /* @__PURE__ */React__namespace.createElement(ChipGroup, {
7349
- options: TONE_OPTIONS,
7469
+ }, t(LangKey.SETTING_TONE)), /* @__PURE__ */React__namespace.createElement(ChipGroup, {
7470
+ options: getToneOptions(),
7350
7471
  selected: tone,
7351
7472
  onSelect: function onSelect(opt) {
7352
7473
  return setTone(opt);
@@ -7363,8 +7484,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7363
7484
  fontSize: 12,
7364
7485
  fontWeight: 600
7365
7486
  }
7366
- }, "Length"), /* @__PURE__ */React__namespace.createElement(ChipGroup, {
7367
- options: LENGTH_OPTIONS,
7487
+ }, t(LangKey.SETTING_LENGTH)), /* @__PURE__ */React__namespace.createElement(ChipGroup, {
7488
+ options: getLengthOptions(),
7368
7489
  selected: length,
7369
7490
  onSelect: function onSelect(opt) {
7370
7491
  return setLength(opt);
@@ -7446,7 +7567,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7446
7567
  ref: this.textareaRef,
7447
7568
  value: message,
7448
7569
  onChange: this.handleChange,
7449
- placeholder: placeholder || "Describe your email...",
7570
+ placeholder: placeholder || t(LangKey.CHAT_INPUT_PLACEHOLDER),
7450
7571
  name: "ai-content",
7451
7572
  onKeyDown: this.handleKeyDown,
7452
7573
  disabled: isSending,
@@ -7601,23 +7722,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7601
7722
  icon: /* @__PURE__ */React__namespace.createElement(MessageCircle, {
7602
7723
  size: 16
7603
7724
  }),
7604
- title: "Request via message",
7605
- desc: 'e.g., "Draft an email to Director Hong proposing a Q3 collaboration meeting (May 20, 3 PM)"'
7725
+ title: t(LangKey.CREATE_FEATURE_1_TITLE),
7726
+ desc: t(LangKey.CREATE_FEATURE_1_DESC)
7606
7727
  }, {
7607
7728
  icon: /* @__PURE__ */React__namespace.createElement(CustomAiIcon, {
7608
7729
  size: 16,
7609
7730
  stroke: 2
7610
7731
  }),
7611
- title: "AI generates a draft",
7612
- desc: "Refine the draft freely with follow-ups like 'more polite' or 'add a deadline'."
7732
+ title: t(LangKey.CREATE_FEATURE_2_TITLE),
7733
+ desc: t(LangKey.CREATE_FEATURE_2_DESC)
7613
7734
  }, {
7614
7735
  icon: /* @__PURE__ */React__namespace.createElement(Check, {
7615
7736
  size: 16
7616
7737
  }),
7617
- title: "Apply to body",
7618
- desc: "Insert the response you like into the email body and send."
7738
+ title: t(LangKey.CREATE_FEATURE_3_TITLE),
7739
+ desc: t(LangKey.CREATE_FEATURE_3_DESC)
7619
7740
  }];
7620
- var SUGGESTIONS = ["Propose a Q3 meeting to Director Hong (May 20, 3 PM)", "Notify client of payment schedule (Due May 30)", "Welcome message to new employee (Joining May 22)"];
7741
+ var SUGGESTIONS = [t(LangKey.CREATE_SUGGESTION_1), t(LangKey.CREATE_SUGGESTION_2), t(LangKey.CREATE_SUGGESTION_3)];
7621
7742
  var EmptyState$1 = function EmptyState$1(_ref29) {
7622
7743
  var onSelectPrompt = _ref29.onSelectPrompt;
7623
7744
  return /* @__PURE__ */React__namespace.createElement("div", {
@@ -7643,13 +7764,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7643
7764
  color: "var(--text-primary)",
7644
7765
  lineHeight: 1.5
7645
7766
  }
7646
- }, "Let's draft a new email together from scratch."), /* @__PURE__ */React__namespace.createElement("div", {
7767
+ }, t(LangKey.CREATE_EMPTY_TITLE)), /* @__PURE__ */React__namespace.createElement("div", {
7647
7768
  style: {
7648
7769
  fontSize: 13,
7649
7770
  color: "var(--text-secondary)",
7650
7771
  marginTop: 4
7651
7772
  }
7652
- }, "Tell me what kind of email you'd like to write.")), /* @__PURE__ */React__namespace.createElement("div", {
7773
+ }, t(LangKey.CREATE_EMPTY_SUBTITLE))), /* @__PURE__ */React__namespace.createElement("div", {
7653
7774
  style: {
7654
7775
  alignSelf: "center",
7655
7776
  width: 100,
@@ -7676,7 +7797,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7676
7797
  color: "var(--text-secondary)",
7677
7798
  lineHeight: 1.6
7678
7799
  }
7679
- }, "Give me the recipient, purpose, and key points", /* @__PURE__ */React__namespace.createElement("br", null), "and AI will generate a polished draft.")), /* @__PURE__ */React__namespace.createElement("div", {
7800
+ }, t(LangKey.CREATE_EMPTY_GUIDE).split("\n").map(function (line, idx) {
7801
+ return /* @__PURE__ */React__namespace.createElement(React__namespace.Fragment, {
7802
+ key: idx
7803
+ }, line, /* @__PURE__ */React__namespace.createElement("br", null));
7804
+ }))), /* @__PURE__ */React__namespace.createElement("div", {
7680
7805
  style: {
7681
7806
  borderTop: "1px solid var(--border-light)",
7682
7807
  marginTop: 20,
@@ -7737,7 +7862,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7737
7862
  color: "var(--text-secondary)",
7738
7863
  marginBottom: 8
7739
7864
  }
7740
- }, "💡 Try these prompts to get a draft right away"), /* @__PURE__ */React__namespace.createElement("div", {
7865
+ }, t(LangKey.CREATE_PROMPT_HINT)), /* @__PURE__ */React__namespace.createElement("div", {
7741
7866
  style: {
7742
7867
  display: "flex",
7743
7868
  flexDirection: "column",
@@ -7891,8 +8016,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7891
8016
  messages: [],
7892
8017
  isSending: false,
7893
8018
  lang: lang,
7894
- tone: TONE_OPTIONS[2],
7895
- length: LENGTH_OPTIONS[2],
8019
+ tone: getToneOptions()[2],
8020
+ length: getLengthOptions()[2],
7896
8021
  conversationId: ""
7897
8022
  };
7898
8023
  return _this12;
@@ -7953,21 +8078,21 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7953
8078
  icon: /* @__PURE__ */React__namespace.createElement(Mail, {
7954
8079
  size: 16
7955
8080
  }),
7956
- title: "Auto-include source",
7957
- desc: "The email you are replying to is automatically added as context."
8081
+ title: t(LangKey.REPLY_FEATURE_1_TITLE),
8082
+ desc: t(LangKey.REPLY_FEATURE_1_DESC)
7958
8083
  }, {
7959
8084
  icon: /* @__PURE__ */React__namespace.createElement(CustomAiIcon, {
7960
8085
  size: 16,
7961
8086
  stroke: 2
7962
8087
  }),
7963
- title: "Add send history (optional)",
7964
- desc: "Use '+ Add' to pick past emails and reference their tone."
8088
+ title: t(LangKey.REPLY_FEATURE_2_TITLE),
8089
+ desc: t(LangKey.REPLY_FEATURE_2_DESC)
7965
8090
  }, {
7966
8091
  icon: /* @__PURE__ */React__namespace.createElement(MessageCircle, {
7967
8092
  size: 16
7968
8093
  }),
7969
- title: "Refine with conversation",
7970
- desc: "Get an AI draft, then adjust freely with chips or messages."
8094
+ title: t(LangKey.REPLY_FEATURE_3_TITLE),
8095
+ desc: t(LangKey.REPLY_FEATURE_3_DESC)
7971
8096
  }];
7972
8097
  var EmptyState = function EmptyState() {
7973
8098
  return /* @__PURE__ */React__namespace.createElement("div", {
@@ -7993,7 +8118,11 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
7993
8118
  color: "var(--text-secondary)",
7994
8119
  lineHeight: 1.6
7995
8120
  }
7996
- }, "We'll draft a reply based on the received email.", /* @__PURE__ */React__namespace.createElement("br", null), "Add send history if you want to match the tone.")), /* @__PURE__ */React__namespace.createElement("div", {
8121
+ }, t(LangKey.REPLY_EMPTY_TITLE).split("\n").map(function (line, idx) {
8122
+ return /* @__PURE__ */React__namespace.createElement(React__namespace.Fragment, {
8123
+ key: idx
8124
+ }, line, /* @__PURE__ */React__namespace.createElement("br", null));
8125
+ }))), /* @__PURE__ */React__namespace.createElement("div", {
7997
8126
  style: {
7998
8127
  alignSelf: "center",
7999
8128
  width: 100,
@@ -8020,7 +8149,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8020
8149
  color: "var(--text-secondary)",
8021
8150
  lineHeight: 1.6
8022
8151
  }
8023
- }, "The source is auto-included. Adjust tone and length through conversation.")), /* @__PURE__ */React__namespace.createElement("div", {
8152
+ }, t(LangKey.REPLY_EMPTY_GUIDE))), /* @__PURE__ */React__namespace.createElement("div", {
8024
8153
  style: {
8025
8154
  borderTop: "1px solid var(--border-light)",
8026
8155
  marginTop: 8,
@@ -8201,7 +8330,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8201
8330
  color: "var(--text-primary)",
8202
8331
  fontWeight: 600
8203
8332
  }
8204
- }, /* @__PURE__ */React__namespace.createElement("span", null, "Source context"), /* @__PURE__ */React__namespace.createElement("span", {
8333
+ }, /* @__PURE__ */React__namespace.createElement("span", null, t(LangKey.SOURCE_CONTEXT)), /* @__PURE__ */React__namespace.createElement("span", {
8205
8334
  style: {
8206
8335
  background: "var(--primary-main)",
8207
8336
  color: "var(--primary-contrasttext)",
@@ -8221,7 +8350,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8221
8350
  }
8222
8351
  }, /* @__PURE__ */React__namespace.createElement(Lock, {
8223
8352
  size: 11
8224
- }), " Auto")), /* @__PURE__ */React__namespace.createElement(SourceCard, {
8353
+ }), " ", t(LangKey.AUTO))), /* @__PURE__ */React__namespace.createElement(SourceCard, {
8225
8354
  mail: sourceMail,
8226
8355
  onClick: function onClick() {
8227
8356
  return onSourceClick(sourceMail);
@@ -8247,7 +8376,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8247
8376
  color: "var(--text-primary)",
8248
8377
  fontWeight: 600
8249
8378
  }
8250
- }, /* @__PURE__ */React__namespace.createElement("span", null, "Selected context"), /* @__PURE__ */React__namespace.createElement("span", {
8379
+ }, /* @__PURE__ */React__namespace.createElement("span", null, t(LangKey.SELECTED_CONTEXT)), /* @__PURE__ */React__namespace.createElement("span", {
8251
8380
  style: {
8252
8381
  background: "var(--background-softGrey)",
8253
8382
  color: "var(--text-primary)",
@@ -8262,7 +8391,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8262
8391
  className: "text-button primary"
8263
8392
  }, /* @__PURE__ */React__namespace.createElement(Plus, {
8264
8393
  size: 12
8265
- }), " Add")), selectedMails.length > 0 && /* @__PURE__ */React__namespace.createElement("div", {
8394
+ }), " ", t(LangKey.ADD))), selectedMails.length > 0 && /* @__PURE__ */React__namespace.createElement("div", {
8266
8395
  style: {
8267
8396
  display: "flex",
8268
8397
  flexWrap: "wrap",
@@ -8410,7 +8539,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8410
8539
  fontSize: 12,
8411
8540
  color: "var(--text-secondary)"
8412
8541
  }
8413
- }, "Total ", total, " | Page ", page, " / ", totalPages), /* @__PURE__ */React__namespace.createElement("div", {
8542
+ }, t(LangKey.PAGINATION_TOTAL), " ", total, " | ", t(LangKey.PAGINATION_PAGE_OF), " ", page, " / ", totalPages), /* @__PURE__ */React__namespace.createElement("div", {
8414
8543
  style: {
8415
8544
  display: "inline-flex",
8416
8545
  alignItems: "center",
@@ -8440,7 +8569,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8440
8569
  color: "var(--text-secondary)",
8441
8570
  marginLeft: 4
8442
8571
  }
8443
- }, "Page"), /* @__PURE__ */React__namespace.createElement("input", {
8572
+ }, t(LangKey.PAGINATION_PAGE)), /* @__PURE__ */React__namespace.createElement("input", {
8444
8573
  type: "number",
8445
8574
  min: 1,
8446
8575
  max: Math.max(1, totalPages),
@@ -8754,7 +8883,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8754
8883
  }
8755
8884
  }, /* @__PURE__ */React__namespace.createElement(ArrowLeft, {
8756
8885
  size: 14
8757
- }), " Back"), /* @__PURE__ */React__namespace.createElement("div", {
8886
+ }), " ", t(LangKey.BACK)), /* @__PURE__ */React__namespace.createElement("div", {
8758
8887
  style: {
8759
8888
  marginTop: 8
8760
8889
  }
@@ -8764,13 +8893,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8764
8893
  fontWeight: 600,
8765
8894
  color: "var(--text-primary)"
8766
8895
  }
8767
- }, "Add context from receive history"), /* @__PURE__ */React__namespace.createElement("div", {
8896
+ }, t(LangKey.ADD_CONTEXT_TITLE)), /* @__PURE__ */React__namespace.createElement("div", {
8768
8897
  style: {
8769
8898
  fontSize: 12,
8770
8899
  color: "var(--text-secondary)",
8771
8900
  marginTop: 2
8772
8901
  }
8773
- }, "Select related emails to provide AI context.")), /* @__PURE__ */React__namespace.createElement("div", {
8902
+ }, t(LangKey.ADD_CONTEXT_DESC))), /* @__PURE__ */React__namespace.createElement("div", {
8774
8903
  style: {
8775
8904
  display: "flex",
8776
8905
  alignItems: "center",
@@ -8800,19 +8929,19 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8800
8929
  borderRadius: 999,
8801
8930
  fontWeight: 600
8802
8931
  }
8803
- }, selectedMids.length, "/", MAX_SELECTED), /* @__PURE__ */React__namespace.createElement("span", null, "selected · up to ", MAX_SELECTED), selectedMids.length > 0 && /* @__PURE__ */React__namespace.createElement("button", {
8932
+ }, selectedMids.length, "/", MAX_SELECTED), /* @__PURE__ */React__namespace.createElement("span", null, t(LangKey.SELECTED_UP_TO), " ", MAX_SELECTED), selectedMids.length > 0 && /* @__PURE__ */React__namespace.createElement("button", {
8804
8933
  type: "button",
8805
8934
  onClick: function onClick(e) {
8806
8935
  e.preventDefault();
8807
8936
  _this17.clearAll();
8808
8937
  },
8809
8938
  className: "text-button primary"
8810
- }, "Clear all")), /* @__PURE__ */React__namespace.createElement("span", {
8939
+ }, t(LangKey.CLEAR_ALL))), /* @__PURE__ */React__namespace.createElement("span", {
8811
8940
  style: {
8812
8941
  fontSize: 11,
8813
8942
  color: "var(--text-secondary)"
8814
8943
  }
8815
- }, "Sort: latest")), /* @__PURE__ */React__namespace.createElement("div", {
8944
+ }, t(LangKey.SORT_LATEST))), /* @__PURE__ */React__namespace.createElement("div", {
8816
8945
  style: {
8817
8946
  flex: 1,
8818
8947
  minHeight: 0,
@@ -8830,7 +8959,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8830
8959
  color: "var(--text-secondary)",
8831
8960
  fontSize: 12
8832
8961
  }
8833
- }, "No emails found.") : items.map(function (it) {
8962
+ }, t(LangKey.NO_EMAILS_FOUND)) : items.map(function (it) {
8834
8963
  var isChecked = selectedMids.includes(it.mid);
8835
8964
  var disabled = !isChecked && selectedMids.length >= MAX_SELECTED;
8836
8965
  return /* @__PURE__ */React__namespace.createElement("label", {
@@ -8928,7 +9057,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8928
9057
  fontSize: 13,
8929
9058
  fontFamily: "inherit"
8930
9059
  }
8931
- }, "Cancel"), /* @__PURE__ */React__namespace.createElement("button", {
9060
+ }, t(LangKey.CANCEL)), /* @__PURE__ */React__namespace.createElement("button", {
8932
9061
  type: "button",
8933
9062
  disabled: selectedMids.length === 0 || isConfirming,
8934
9063
  onClick: function onClick() {
@@ -8953,7 +9082,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
8953
9082
  }, isConfirming && /* @__PURE__ */React__namespace.createElement(LoadingCircular, {
8954
9083
  size: 16,
8955
9084
  color: "var(--primary-contrasttext)"
8956
- }), /* @__PURE__ */React__namespace.createElement("span", null, "Add ", selectedMids.length > 0 ? "".concat(selectedMids.length, " ") : "", "as context →"))));
9085
+ }), /* @__PURE__ */React__namespace.createElement("span", null, t(LangKey.ADD), " ", selectedMids.length > 0 ? "".concat(selectedMids.length, " ") : "", t(LangKey.ADD_AS_CONTEXT)))));
8957
9086
  }
8958
9087
  }]);
8959
9088
  }(React__namespace.Component);
@@ -9070,7 +9199,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9070
9199
  overflow: "hidden",
9071
9200
  textOverflow: "ellipsis"
9072
9201
  }
9073
- }, mail.subject || "(no subject)"), /* @__PURE__ */React__namespace.createElement("div", {
9202
+ }, mail.subject || t(LangKey.NO_SUBJECT)), /* @__PURE__ */React__namespace.createElement("div", {
9074
9203
  style: {
9075
9204
  fontSize: 12,
9076
9205
  color: "var(--text-secondary)",
@@ -9342,8 +9471,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9342
9471
  messages: [],
9343
9472
  isSending: false,
9344
9473
  lang: lang,
9345
- tone: TONE_OPTIONS[2],
9346
- length: LENGTH_OPTIONS[2],
9474
+ tone: getToneOptions()[2],
9475
+ length: getLengthOptions()[2],
9347
9476
  conversationId: ""
9348
9477
  };
9349
9478
  return _this19;
@@ -9413,7 +9542,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9413
9542
  padding: 8,
9414
9543
  textAlign: "center"
9415
9544
  }
9416
- }, "Loading context..."), /* @__PURE__ */React__namespace.createElement(ChatInput, {
9545
+ }, t(LangKey.REPLY_LOADING_CONTEXT)), /* @__PURE__ */React__namespace.createElement(ChatInput, {
9417
9546
  message: message,
9418
9547
  onMessageChange: this.handleMessageChange,
9419
9548
  onSubmit: this.handleSubmit,
@@ -9425,7 +9554,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9425
9554
  length: length,
9426
9555
  setLength: this.setLength,
9427
9556
  parentRef: this.rootRef,
9428
- placeholder: "Type a message..."
9557
+ placeholder: t(LangKey.CHAT_INPUT_PLACEHOLDER_REPLY)
9429
9558
  }), /* @__PURE__ */React__namespace.createElement(ContextPreviewModal, {
9430
9559
  preview: preview,
9431
9560
  onClose: this.handlePreviewClose
@@ -9438,7 +9567,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9438
9567
  _a2$type = _a2.type,
9439
9568
  type = _a2$type === void 0 ? "new" : _a2$type,
9440
9569
  sourceMid = _a2.sourceMid,
9441
- rest = __objRest(_a2, ["type", "sourceMid"]);
9570
+ userLang = _a2.userLang,
9571
+ rest = __objRest(_a2, ["type", "sourceMid", "userLang"]);
9572
+ React__namespace.useEffect(function () {
9573
+ if (userLang) {
9574
+ SDKConfig.lang = userLang;
9575
+ }
9576
+ }, [userLang]);
9442
9577
  if ((type === "reply" || type === "forward") && sourceMid) {
9443
9578
  return /* @__PURE__ */React__namespace.createElement(ReplyPanel, __spreadValues({
9444
9579
  type: type,
@@ -9512,13 +9647,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9512
9647
  var PAGE_SIZE = 5;
9513
9648
  var FILTERS = [{
9514
9649
  value: "all",
9515
- label: "All"
9650
+ label: LangKey.ALL
9516
9651
  }, {
9517
9652
  value: "receive",
9518
- label: "Received"
9653
+ label: LangKey.RECEIVED
9519
9654
  }, {
9520
9655
  value: "sent",
9521
- label: "Sent"
9656
+ label: LangKey.SENT
9522
9657
  }];
9523
9658
  var formatDate = function formatDate(raw) {
9524
9659
  if (!raw) return "";
@@ -9549,7 +9684,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9549
9684
  date: date,
9550
9685
  sig: sig,
9551
9686
  direction: direction,
9552
- direction_label: direction === "sent" ? "Sent" : "Received",
9687
+ direction_label: direction === "sent" ? LangKey.SENT : LangKey.RECEIVED,
9553
9688
  subject: subject,
9554
9689
  messages: messages
9555
9690
  };
@@ -9577,7 +9712,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9577
9712
  fontSize: 13,
9578
9713
  color: "var(--text-secondary)"
9579
9714
  }
9580
- }, "This is a summary compiled by AI · May contain some inaccuracies"), /* @__PURE__ */React__namespace.createElement("div", {
9715
+ }, t(LangKey.SUMMARY_WARNING)), /* @__PURE__ */React__namespace.createElement("div", {
9581
9716
  style: {
9582
9717
  display: "inline-flex",
9583
9718
  background: "var(--background-softGrey)",
@@ -9605,7 +9740,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9605
9740
  fontFamily: "inherit",
9606
9741
  transition: "background 0.15s ease-in-out"
9607
9742
  }
9608
- }, f.label);
9743
+ }, t(f.label));
9609
9744
  })));
9610
9745
  };
9611
9746
  var SummaryItem = function SummaryItem(_ref39) {
@@ -9646,7 +9781,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9646
9781
  size: 11
9647
9782
  }) : /* @__PURE__ */React__namespace.createElement(ArrowDown, {
9648
9783
  size: 11
9649
- }), isSent ? "Sent" : "Received")), /* @__PURE__ */React__namespace.createElement("div", {
9784
+ }), t(isSent ? LangKey.SENT : LangKey.RECEIVED))), /* @__PURE__ */React__namespace.createElement("div", {
9650
9785
  style: {
9651
9786
  fontSize: 14,
9652
9787
  fontWeight: 600,
@@ -9895,6 +10030,9 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9895
10030
  isLoading: false,
9896
10031
  langAnchor: null
9897
10032
  };
10033
+ if (props.userLang) {
10034
+ SDKConfig.lang = props.userLang;
10035
+ }
9898
10036
  return _this22;
9899
10037
  }
9900
10038
  _inherits(SummaryAIEmails, _React__namespace$Com1);
@@ -9906,6 +10044,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9906
10044
  }, {
9907
10045
  key: "componentDidUpdate",
9908
10046
  value: function componentDidUpdate(prevProps, prevState) {
10047
+ if (this.props.userLang !== prevProps.userLang && this.props.userLang) {
10048
+ SDKConfig.lang = this.props.userLang;
10049
+ this.forceUpdate();
10050
+ }
9909
10051
  var targetChanged = prevProps.targetEmail !== this.props.targetEmail;
9910
10052
  var filterChanged = prevState.lang !== this.state.lang || prevState.mailtype !== this.state.mailtype || prevState.page !== this.state.page;
9911
10053
  if (targetChanged || filterChanged) {
@@ -9977,7 +10119,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
9977
10119
  color: "var(--text-secondary)",
9978
10120
  fontSize: 13
9979
10121
  }
9980
- }, "No data"), items.map(function (item, idx) {
10122
+ }, t(LangKey.NO_DATA)), items.map(function (item, idx) {
9981
10123
  return /* @__PURE__ */React__namespace.createElement(SummaryItem, {
9982
10124
  key: idx,
9983
10125
  item: item
@@ -10004,6 +10146,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" ==
10004
10146
  exports2.Pagination = Pagination;
10005
10147
  exports2.SummaryAIEmails = SummaryAIEmails;
10006
10148
  exports2.initHanbiroReactSDK = initHanbiroReactSDK;
10149
+ exports2.setLibLang = setLibLang;
10007
10150
  Object.defineProperty(exports2, Symbol.toStringTag, {
10008
10151
  value: "Module"
10009
10152
  });