ConverterWordDialogViewModel.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. using ComDocumentAIKit;
  2. using ComPDFKit_Conversion.Converter;
  3. using ComPDFKit_Conversion.Options;
  4. using ComPDFKitViewer.PdfViewer;
  5. using ImageMagick;
  6. using PDF_Master.CustomControl;
  7. using PDF_Master.EventAggregators;
  8. using PDF_Master.Helper;
  9. using PDF_Master.Model;
  10. using PDF_Master.Model.Dialog.ConverterDialogs;
  11. using PDF_Master.Model.Dialog.HomePageToolsDialogs.HomePageBatchProcessing;
  12. using PDF_Master.Properties;
  13. using Prism.Commands;
  14. using Prism.Mvvm;
  15. using Prism.Services.Dialogs;
  16. using System;
  17. using System.Collections.Generic;
  18. using System.Diagnostics;
  19. using System.IO;
  20. using System.Linq;
  21. using System.Windows;
  22. using System.Windows.Controls;
  23. using System.Windows.Forms;
  24. using DialogResult = Prism.Services.Dialogs.DialogResult;
  25. namespace PDF_Master.ViewModels.Dialog.ConverterDialogs
  26. {
  27. public class ConverterWordDialogViewModel : BindableBase, IDialogAware
  28. {
  29. #region 文案
  30. private string T_title;
  31. public string T_Title
  32. {
  33. get { return T_title; }
  34. set
  35. {
  36. SetProperty(ref T_title, value);
  37. }
  38. }
  39. private string T_yes;
  40. public string T_YES
  41. {
  42. get { return T_yes; }
  43. set
  44. {
  45. SetProperty(ref T_yes, value);
  46. }
  47. }
  48. private string T_no;
  49. public string T_No
  50. {
  51. get { return T_no; }
  52. set
  53. {
  54. SetProperty(ref T_no, value);
  55. }
  56. }
  57. private string T_pageRange;
  58. public string T_PageRange
  59. {
  60. get { return T_pageRange; }
  61. set
  62. {
  63. SetProperty(ref T_pageRange, value);
  64. }
  65. }
  66. private string _TextUpgrade;
  67. public string TextUpgrade
  68. {
  69. get { return _TextUpgrade; }
  70. set { _TextUpgrade = value; }
  71. }
  72. private void IntString()
  73. {
  74. TextUpgrade = App.ServiceLoader.GetString("TextUpgrade");
  75. T_Title = App.MainPageLoader.GetString("Convert_PDFToWordTitle");
  76. T_YES = App.MainPageLoader.GetString("Convert_Yes");
  77. T_No = App.MainPageLoader.GetString("Convert_No");
  78. T_PageRange = App.MainPageLoader.GetString("Convert_PDFPageRange");
  79. }
  80. #endregion
  81. public string Title => "";
  82. public event Action<IDialogResult> RequestClose;
  83. #region 参数和属性
  84. public ConverterWordDialogModel ConverterWordModel = new ConverterWordDialogModel();
  85. public CPDFViewer currentViewer;
  86. public IDialogService dialogs;
  87. public string CurrentPageIndex = "1";
  88. public bool IsCurrentPageIndex = true;
  89. public string PageRangeText { set; get; } = "0";
  90. public string PageRangeSelectIndex { set; get; } = "0";
  91. private int maxPageRange = 0;
  92. public int MaxPageRange
  93. {
  94. get { return maxPageRange; }
  95. set
  96. {
  97. SetProperty(ref maxPageRange, value);
  98. }
  99. }
  100. private bool oCRCheckBoxIsCheckBox = false;
  101. public bool OCRCheckBoxIsCheckBox
  102. {
  103. get { return oCRCheckBoxIsCheckBox; }
  104. set
  105. {
  106. SetProperty(ref oCRCheckBoxIsCheckBox, value);
  107. ConverterWordModel.Options.IsAllowOCR = oCRCheckBoxIsCheckBox;
  108. }
  109. }
  110. private int languageSelectedIndex = 2;
  111. public int LanguageSelectedIndex
  112. {
  113. get { return languageSelectedIndex; }
  114. set
  115. {
  116. SetProperty(ref languageSelectedIndex, value);
  117. SelectLanguage(languageSelectedIndex);
  118. }
  119. }
  120. private Visibility limitationsConvertVisible = Visibility.Hidden;
  121. public Visibility LimitationsConvertVisible
  122. {
  123. get { return limitationsConvertVisible; }
  124. set
  125. {
  126. SetProperty(ref limitationsConvertVisible, value);
  127. }
  128. }
  129. private Dictionary<string, string> CheckPageSelect = new Dictionary<string, string>();
  130. private void InitCheckPageSelect()
  131. {
  132. CheckPageSelect.Clear();
  133. if (!IsCurrentPageIndex)
  134. {
  135. CheckPageSelect.Add("0", "0");
  136. CheckPageSelect.Add("1", "1");
  137. CheckPageSelect.Add("2", "2");
  138. CheckPageSelect.Add("3", "3");
  139. CheckPageSelect.Add("4", "4");
  140. }
  141. else
  142. {
  143. CheckPageSelect.Add("0", "0");
  144. CheckPageSelect.Add("1", "-2");
  145. CheckPageSelect.Add("2", "1");
  146. CheckPageSelect.Add("3", "2");
  147. CheckPageSelect.Add("4", "3");
  148. }
  149. }
  150. #endregion
  151. #region 委托声明
  152. public DelegateCommand<string> RadioButtonCommand { get; set; }
  153. public DelegateCommand CancelCommand { get; set; }
  154. public DelegateCommand ConverterCommnad { get; set; }
  155. public DelegateCommand<object> CmbPageSelectionChanged { get; set; }
  156. public DelegateCommand<object> CmbPageTextChanged { get; set; }
  157. public DelegateCommand BatchConverterCommand { get; set; }
  158. public DelegateCommand<object> PreviewCancelDownCommand { get; set; }
  159. public DelegateCommand SetCustomPageRangeCommand { get; set; }
  160. public DelegateCommand UnlockMouseDownCommand { get; set; }
  161. public DelegateCommand OpenOCRCommand { get; set; }
  162. #endregion
  163. public ConverterWordDialogViewModel(IDialogService dialogService)
  164. {
  165. CancelCommand = new DelegateCommand(cancel);
  166. ConverterCommnad = new DelegateCommand(converter);
  167. RadioButtonCommand = new DelegateCommand<string>(radiobutton);
  168. CmbPageSelectionChanged = new DelegateCommand<object>(CmbPageSelectionChangedEvent);
  169. CmbPageTextChanged = new DelegateCommand<object>(CmbPageTextChangedEvent);
  170. SetCustomPageRangeCommand = new DelegateCommand(SetCustomPageRange);
  171. BatchConverterCommand = new DelegateCommand(BatchConverter);
  172. PreviewCancelDownCommand = new DelegateCommand<object>(PreviewCancelDown);
  173. UnlockMouseDownCommand = new DelegateCommand(UnlockMouseDown);
  174. OpenOCRCommand = new DelegateCommand(openOCR);
  175. dialogs = dialogService;
  176. IntString();
  177. }
  178. #region 逻辑函数
  179. private void openOCR()
  180. {
  181. if (OCRCheckBoxIsCheckBox == true)
  182. {
  183. bool folderMD5 = FileComparisonHelper.OCRModelItExist();
  184. if (folderMD5)
  185. {
  186. string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
  187. CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
  188. CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
  189. }
  190. else
  191. {
  192. AlertsMessage alertsMessage = new AlertsMessage();
  193. alertsMessage.ShowDialog("想用OCR,就去下载吧!", "", "取消", "确定");
  194. if (alertsMessage.result == ContentResult.Ok)
  195. {
  196. FileComparisonHelper.RemoveOCRModel();
  197. DialogParameters oCRDownloadProgress = new DialogParameters();
  198. dialogs.ShowDialog(DialogNames.OCRDownloadProgress, oCRDownloadProgress, e =>
  199. {
  200. if (e.Result == Prism.Services.Dialogs.ButtonResult.OK)
  201. {
  202. string folderPath = System.IO.Path.Combine(App.CurrentPath, "OCREngine");
  203. CPDFConverter.InitOcrLibrary(Path.Combine(folderPath, "x64"));
  204. CPDFConverter.SetOCRModelPath(Path.Combine(folderPath, "source", "models"));
  205. }
  206. else
  207. {
  208. OCRCheckBoxIsCheckBox = false;
  209. }
  210. });
  211. }
  212. else
  213. {
  214. OCRCheckBoxIsCheckBox = false;
  215. }
  216. }
  217. }
  218. }
  219. public void SetCustomPageRange()
  220. {
  221. if (PageRangeSelectIndex == CheckPageSelect["4"])
  222. {
  223. List<int> PageIndexLists = new List<int>();
  224. if (!CommonHelper.GetPagesInRange(ref PageIndexLists, PageRangeText, currentViewer.Document.PageCount, new char[] { ',' }, new char[] { '-' }))
  225. { //TODO
  226. //AlertsMessage alertsMessage = new AlertsMessage();
  227. //alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  228. //if (alertsMessage.result == ContentResult.Ok)
  229. //{
  230. // return;
  231. //}
  232. //else
  233. //{
  234. // //this.eventAggregator.GetEvent<DeleteWatermarkEvent>().Publish(new EnumDeleteUnicode
  235. // //{
  236. // // Unicode = Unicode,
  237. // // Status = EnumDelete.StatusCreate
  238. // //});
  239. // return;
  240. //}
  241. }
  242. }
  243. }
  244. private void cancel()
  245. {
  246. RequestClose.Invoke(new DialogResult(ButtonResult.Cancel));
  247. }
  248. private void PreviewCancelDown(object e)
  249. {
  250. var PageRangeComboBox = e as WritableComboBox;
  251. if (PageRangeComboBox != null)
  252. {
  253. PageRangeComboBox.IsloseFocus = false;
  254. }
  255. }
  256. private void UnlockMouseDown()
  257. {
  258. ConverterHelper.convertUnlock();
  259. }
  260. private void converter()
  261. {
  262. if (PageRangeSelectIndex == CheckPageSelect["4"])
  263. {
  264. List<int> PageIndexLists = new List<int>();
  265. if (!CommonHelper.GetPagesInRange(ref PageIndexLists, PageRangeText, currentViewer.Document.PageCount, new char[] { ',' }, new char[] { '-' }))
  266. { //TODO
  267. AlertsMessage alertsMessage = new AlertsMessage();
  268. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  269. if (alertsMessage.result == ContentResult.Ok)
  270. {
  271. return;
  272. }
  273. else
  274. {
  275. //this.eventAggregator.GetEvent<DeleteWatermarkEvent>().Publish(new EnumDeleteUnicode
  276. //{
  277. // Unicode = Unicode,
  278. // Status = EnumDelete.StatusCreate
  279. //});
  280. return;
  281. }
  282. }
  283. }
  284. System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
  285. /*
  286. *设置这个对话框的起始保存路径
  287. */
  288. sfd.InitialDirectory = currentViewer.Document.FilePath;
  289. /*
  290. *设置保存的文件的类型,注意过滤器的语法 例子:“文件类型|*.后缀名;*.后缀名;”
  291. */
  292. sfd.Filter = "Word|*.docx;";
  293. /*
  294. *调用ShowDialog()方法显示该对话框,该方法的返回值代表用户是否点击了确定按钮
  295. */
  296. sfd.FileName = currentViewer.Document.FileName + ".docx";
  297. /*
  298. * 做一些工作
  299. */
  300. if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
  301. {
  302. ConverterWordModel.OutputPath = sfd.FileName;
  303. try { if (File.Exists(ConverterWordModel.OutputPath)) File.Delete(ConverterWordModel.OutputPath); }
  304. catch
  305. {
  306. AlertsMessage alertsMessage = new AlertsMessage();
  307. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("FileNotExistWarning"), App.ServiceLoader.GetString("Text_ok"));
  308. return;
  309. }
  310. }
  311. else
  312. {
  313. return;
  314. }
  315. HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref ConverterWordModel.PageRange, PageRangeText, !IsCurrentPageIndex, CurrentPageIndex);
  316. if (ConverterWordModel.PageRange == "")
  317. {
  318. Trace.WriteLine("输入不对");
  319. AlertsMessage alertsMessage = new AlertsMessage();
  320. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  321. return;
  322. }
  323. char[] enumerationSeparator = new char[] { ',' };
  324. char[] rangeSeparator = new char[] { '-' };
  325. if (!CommonHelper.GetPagesInRange(ref ConverterWordModel.PageIndexLists, ConverterWordModel.PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  326. { //TODO
  327. Trace.WriteLine("输入不对");
  328. AlertsMessage alertsMessage = new AlertsMessage();
  329. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  330. return;
  331. }
  332. ConverterWordModel.wordOptions = ConverterWordModel.WordOptions();
  333. //DialogParameters value = new DialogParameters();
  334. //value.Add(ParameterNames.ConverterType, "Word");
  335. //value.Add(ParameterNames.ConverterTypeModel, ConverterWordModel);
  336. var dialogresult = new DialogResult(ButtonResult.OK);
  337. dialogresult.Parameters.Add(ParameterNames.ConverterType, "Word");
  338. dialogresult.Parameters.Add(ParameterNames.ConverterTypeModel, ConverterWordModel);
  339. RequestClose.Invoke(dialogresult);
  340. //RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
  341. //dialogs.ShowDialog(DialogNames.ConverterProgressBarDialog, value, e =>
  342. //{
  343. //});
  344. }
  345. private void CmbPageSelectionChangedEvent(object e)
  346. {
  347. ///这里采用的是将预览UI控件传递过来的方式,为下下策
  348. ///正确的方式应该是 通过声明一些属性,再通过绑定来更新预览控件对应值的形式
  349. ///但是目前发现自定义控件的依赖属性绑定有些问题,因此先用此方法,将业务逻辑代码先调整到VM里
  350. var ConverterPreview = e as PageTurningPreview;
  351. if (ConverterPreview != null)
  352. {
  353. string PageRangeSelectIndex = this.PageRangeSelectIndex;
  354. var currentViewer = this.currentViewer;
  355. string PageRange = "";
  356. var PageRangeText = this.PageRangeText;
  357. if (PageRangeSelectIndex == CheckPageSelect["0"] || PageRangeSelectIndex == CheckPageSelect["2"] || PageRangeSelectIndex == CheckPageSelect["3"] || PageRangeSelectIndex == CheckPageSelect["4"])
  358. {
  359. if (PageRangeSelectIndex == CheckPageSelect["4"]) { HomePageEditHelper.GetPagerange("0", currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex); } else { HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex); }
  360. char[] enumerationSeparator = new char[] { ',' };
  361. char[] rangeSeparator = new char[] { '-' };
  362. if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  363. { //TODO
  364. ConverterPreview.PageIndexLists.Add(0);
  365. Trace.WriteLine("输入不对");
  366. AlertsMessage alertsMessage = new AlertsMessage();
  367. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  368. return;
  369. }
  370. }
  371. if (PageRangeSelectIndex == CheckPageSelect["1"])
  372. {
  373. char[] enumerationSeparator = new char[] { ',' };
  374. char[] rangeSeparator = new char[] { '-' };
  375. if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, (currentViewer.CurrentIndex + 1).ToString()
  376. , currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  377. { //TODO
  378. Trace.WriteLine("输入不对");
  379. AlertsMessage alertsMessage = new AlertsMessage();
  380. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  381. return;
  382. }
  383. this.CurrentPageIndex = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
  384. }
  385. // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
  386. ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
  387. ConverterPreview.CurrentIndex = 0;
  388. }
  389. }
  390. private void CmbPageTextChangedEvent(object e)
  391. {
  392. var ConverterPreview = e as PageTurningPreview;
  393. if (ConverterPreview != null)
  394. {
  395. if (ConverterPreview != null)
  396. {
  397. string PageRangeSelectIndex = this.PageRangeSelectIndex;
  398. var currentViewer = this.currentViewer;
  399. string PageRange = "";
  400. var PageRangeText = this.PageRangeText;
  401. HomePageEditHelper.GetPagerange(PageRangeSelectIndex, currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
  402. char[] enumerationSeparator = new char[] { ',' };
  403. char[] rangeSeparator = new char[] { '-' };
  404. if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  405. { //TODO
  406. HomePageEditHelper.GetPagerange("0", currentViewer, ref PageRange, PageRangeText, !IsCurrentPageIndex);
  407. if (!CommonHelper.GetPagesInRange(ref ConverterPreview.PageIndexLists, PageRange, currentViewer.Document.PageCount, enumerationSeparator, rangeSeparator))
  408. { //TODO
  409. ConverterPreview.PageIndexLists.Add(0);
  410. Trace.WriteLine("输入不对");
  411. AlertsMessage alertsMessage = new AlertsMessage();
  412. alertsMessage.ShowDialog("", App.MainPageLoader.GetString("PageRangeWarning"), App.ServiceLoader.GetString("Text_ok"));
  413. return;
  414. }
  415. ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
  416. ConverterPreview.CurrentIndex = 0;
  417. return;
  418. }
  419. else
  420. {
  421. // ConverterPreview.PageIndex.Text = (ConverterPreview.PageIndexLists.Last<int>() + 1).ToString();
  422. ConverterPreview.PageIndex.Text = ConverterPreview.PageIndexLists.Count.ToString();
  423. ConverterPreview.CurrentIndex = 0;
  424. }
  425. }
  426. }
  427. }
  428. private void BatchConverter()
  429. {
  430. DialogParameters convertpdftoword = new DialogParameters();
  431. convertpdftoword.Add(ParameterNames.BatchProcessing_Name, "0");
  432. convertpdftoword.Add("ConverterTypeIndex", 0);
  433. HomePageBatchProcessingDialogModel.FilePaths = new List<string> { currentViewer.Document.FilePath.ToString() };
  434. HomePageBatchProcessingDialogModel.BatchProcessingIndex = 1;
  435. convertpdftoword.Add(ParameterNames.FilePath, new string[] { currentViewer.Document.FilePath.ToString() });
  436. dialogs.ShowDialog(DialogNames.HomePageBatchProcessingDialog, convertpdftoword, e => { });
  437. }
  438. private void radiobutton(string e)
  439. {
  440. string radioButton = e;
  441. if (radioButton != null)
  442. {
  443. switch (radioButton)
  444. {
  445. case "FlowingTextRadioBtn":
  446. ConverterWordModel.Options.LayoutOpts = LayoutOptions.RetainFlowingText;
  447. break;
  448. case "PageLayoutRadioBtn":
  449. ConverterWordModel.Options.LayoutOpts = LayoutOptions.RetainFlowingText;
  450. break;
  451. default:
  452. break;
  453. }
  454. }
  455. }
  456. private void SelectLanguage(int SelectedIndex)
  457. {
  458. switch (SelectedIndex)
  459. {
  460. case 0:
  461. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageChinese;
  462. break;
  463. case 1:
  464. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageChineseTraditional;
  465. break;
  466. case 2:
  467. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageEnglish;
  468. break;
  469. case 3:
  470. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageJapanese;
  471. break;
  472. case 4:
  473. ConverterWordModel.Options.OCRLanguage = COCRLanguage.COCRLanguageKorean;
  474. break;
  475. default:
  476. break;
  477. }
  478. }
  479. #endregion
  480. #region 构架行为
  481. public bool CanCloseDialog()
  482. {
  483. return true;
  484. }
  485. public void OnDialogClosed()
  486. {
  487. }
  488. public void OnDialogOpened(IDialogParameters parameters)
  489. {
  490. CPDFViewer pdfViewer = null;
  491. parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out pdfViewer);
  492. parameters.TryGetValue<bool>("PageRangeComboBoxCurrentPage", out IsCurrentPageIndex);
  493. if (pdfViewer != null)
  494. {
  495. InitCheckPageSelect();
  496. currentViewer = pdfViewer;
  497. MaxPageRange = currentViewer.Document.PageCount;
  498. if (currentViewer.Tag != null) { ConverterWordModel.Pawssword = currentViewer.Tag.ToString(); }
  499. ConverterWordModel.InputPath = pdfViewer.Document.FilePath;
  500. FileInfo fileinfo = new FileInfo(ConverterWordModel.InputPath);
  501. ConverterWordModel.OutputPath = fileinfo.DirectoryName;
  502. if (Settings.Default.UserDate.subscribestatus != 1)
  503. {
  504. LimitationsConvertVisible = Visibility.Visible;
  505. }
  506. }
  507. }
  508. #endregion
  509. }
  510. }